@radix-ng/primitives 1.0.4 → 1.0.6
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/fesm2022/radix-ng-primitives-accordion.mjs +35 -27
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +34 -34
- package/fesm2022/radix-ng-primitives-arrow.mjs +3 -3
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +5 -4
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-autocomplete.mjs +175 -125
- package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +25 -19
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-button.mjs +11 -7
- package/fesm2022/radix-ng-primitives-button.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-calendar.mjs +140 -90
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +61 -40
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +35 -24
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-combobox.mjs +278 -177
- package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-composite.mjs +76 -35
- package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-config.mjs +7 -5
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +48 -22
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +44 -28
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs +73 -45
- package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +70 -40
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +93 -67
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-direction-provider.mjs +5 -4
- package/fesm2022/radix-ng-primitives-direction-provider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +20 -16
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +107 -81
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-editable.mjs +53 -39
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +69 -42
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-fieldset.mjs +8 -7
- package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs +77 -40
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-focus-guards.mjs +3 -3
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +7 -5
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-form.mjs +25 -16
- package/fesm2022/radix-ng-primitives-form.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-input.mjs +41 -22
- package/fesm2022/radix-ng-primitives-input.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +7 -5
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +274 -154
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +35 -17
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-meter.mjs +41 -30
- package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +220 -183
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +87 -59
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs +48 -38
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +150 -107
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +79 -47
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +20 -13
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +3 -3
- package/fesm2022/radix-ng-primitives-preview-card.mjs +119 -74
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +43 -31
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +177 -168
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +54 -38
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +595 -102
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +7 -5
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +101 -63
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +53 -39
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +44 -25
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +72 -47
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +72 -41
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toast.mjs +75 -56
- package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +29 -19
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +16 -11
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +38 -30
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +118 -63
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +31 -20
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/package.json +2 -2
- package/types/radix-ng-primitives-autocomplete.d.ts +3 -1
- package/types/radix-ng-primitives-combobox.d.ts +28 -9
- package/types/radix-ng-primitives-composite.d.ts +2 -0
- package/types/radix-ng-primitives-context-menu.d.ts +2 -0
- package/types/radix-ng-primitives-dialog.d.ts +6 -3
- package/types/radix-ng-primitives-floating-focus-manager.d.ts +11 -0
- package/types/radix-ng-primitives-menu.d.ts +47 -15
- package/types/radix-ng-primitives-menubar.d.ts +6 -1
- package/types/radix-ng-primitives-navigation-menu.d.ts +8 -6
- package/types/radix-ng-primitives-popover.d.ts +12 -4
- package/types/radix-ng-primitives-preview-card.d.ts +18 -5
- package/types/radix-ng-primitives-radio.d.ts +100 -65
- package/types/radix-ng-primitives-select.d.ts +186 -391
- package/types/radix-ng-primitives-switch.d.ts +3 -2
- package/types/radix-ng-primitives-tooltip.d.ts +17 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-time-field.mjs","sources":["../../../packages/primitives/time-field/src/time-field-context.token.ts","../../../packages/primitives/time-field/src/time-field-input.directive.ts","../../../packages/primitives/time-field/src/time-field-root.directive.ts","../../../packages/primitives/time-field/index.ts","../../../packages/primitives/time-field/radix-ng-primitives-time-field.ts"],"sourcesContent":["import { inject, InjectionToken, InputSignal, ModelSignal, Signal, WritableSignal } from '@angular/core';\nimport { DateStep, Formatter, HourCycle, SegmentValueObj, TimeValue } from '@radix-ng/primitives/core';\n\nexport interface TimeFieldContextToken {\n locale: InputSignal<string>;\n value: ModelSignal<TimeValue | undefined>;\n placeholder: ModelSignal<TimeValue>;\n isInvalid: Signal<boolean>;\n disabled: InputSignal<boolean>;\n readonly: InputSignal<boolean>;\n formatter: Signal<Formatter>;\n hourCycle: InputSignal<HourCycle>;\n segmentValues: WritableSignal<SegmentValueObj>;\n focusNext: () => void;\n setFocusedElement: (el: HTMLElement) => void;\n convertedModelValue: WritableSignal<TimeValue | undefined>;\n convertedPlaceholder: WritableSignal<TimeValue>;\n step$: Signal<DateStep>;\n}\n\nexport const TIME_FIELDS_ROOT_CONTEXT = new InjectionToken<TimeFieldContextToken>('TIME_FIELDS_ROOT_CONTEXT');\n\nexport function injectTimeFieldsRootContext(): TimeFieldContextToken {\n return inject(TIME_FIELDS_ROOT_CONTEXT);\n}\n","import { computed, Directive, effect, ElementRef, inject, input, signal, WritableSignal } from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport { SegmentPart, useDateField } from '@radix-ng/primitives/core';\nimport { injectTimeFieldsRootContext } from './time-field-context.token';\n\n@Directive({\n selector: '[rdxTimeFieldInput]',\n host: {\n '[attr.contenteditable]': 'disabled() || readonly() ? false : part() !== \"literal\"',\n '[attr.data-rdx-date-field-segment]': 'part()',\n '[attr.aria-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-invalid]': 'isInvalid() ? \"\" : undefined',\n '[attr.aria-invalid]': 'isInvalid() ? true : undefined',\n\n '(mousedown)': 'part() !== \"literal\" && handleSegmentClick($event)',\n '(keydown)': 'part() !== \"literal\" && handleSegmentKeydown($event)',\n '(focus)': 'part() !== \"literal\" && onFocus($event)',\n '(focusout)': 'part() !== \"literal\" && onFocusOut()'\n }\n})\nexport class RdxTimeFieldInputDirective {\n private readonly el = inject(ElementRef);\n\n /**\n * The host element of this segment. Consumed by the root to collect focusable\n * segments in DOM order.\n * @ignore\n */\n readonly element: HTMLElement = this.el.nativeElement;\n\n private readonly rootContext = injectTimeFieldsRootContext();\n\n /**\n * The part of the date to render\n * `'hour' | 'minute' | 'second' | 'dayPeriod' | 'literal' | 'timeZoneName'`\n */\n readonly part = input<SegmentPart>();\n\n /**\n * @ignore\n */\n readonly disabled = computed(() => this.rootContext.disabled());\n\n /**\n * @ignore\n */\n readonly readonly = computed(() => this.rootContext.readonly());\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => this.rootContext.isInvalid());\n\n /**\n * @ignore\n */\n readonly hasLeftFocus = signal<boolean>(true);\n\n /**\n * @ignore\n */\n readonly lastKeyZero = signal<boolean>(false);\n\n private readonly fieldData = computed(() => {\n return useDateField({\n hasLeftFocus: this.hasLeftFocus,\n lastKeyZero: this.lastKeyZero,\n placeholder: this.rootContext.convertedPlaceholder as unknown as WritableSignal<DateValue>,\n hourCycle: this.rootContext.hourCycle(),\n segmentValues: this.rootContext.segmentValues,\n formatter: this.rootContext.formatter(),\n part: <SegmentPart>this.part(),\n disabled: this.rootContext.disabled,\n readonly: this.rootContext.readonly,\n modelValue: this.rootContext.convertedModelValue as unknown as WritableSignal<DateValue>,\n focusNext: this.rootContext.focusNext,\n step: this.rootContext.step$\n });\n });\n\n private readonly attributes = computed(() => this.fieldData().attributes());\n\n /**\n * @ignore\n */\n handleSegmentClick: (e: Event) => void;\n\n /**\n * @ignore\n */\n handleSegmentKeydown: (e: Event) => void;\n\n constructor() {\n effect(() => {\n const { handleSegmentClick, handleSegmentKeydown } = this.fieldData();\n this.handleSegmentKeydown = handleSegmentKeydown as (e: Event) => void;\n this.handleSegmentClick = handleSegmentClick as (e: Event) => void;\n });\n\n effect(() => {\n const attrs = this.attributes();\n Object.entries(attrs).forEach(([attr, value]) => {\n this.el.nativeElement.setAttribute(attr, String(value));\n });\n });\n }\n\n /**\n * @ignore\n */\n onFocus(e: Event) {\n this.rootContext.setFocusedElement(e.target as HTMLElement);\n }\n\n /**\n * @ignore\n */\n onFocusOut() {\n this.hasLeftFocus.set(true);\n }\n}\n","import {\n booleanAttribute,\n computed,\n contentChildren,\n Directive,\n input,\n linkedSignal,\n model,\n Signal,\n signal\n} from '@angular/core';\nimport { DateValue, getLocalTimeZone, isEqualDay, Time, toCalendarDateTime, today } from '@internationalized/date';\nimport {\n ARROW_LEFT,\n ARROW_RIGHT,\n BooleanInput,\n createContent,\n createFormatter,\n DateStep,\n Direction,\n Formatter,\n getDefaultTime,\n Granularity,\n HourCycle,\n initializeSegmentValues,\n isBefore,\n isNullish,\n isSegmentNavigationKey,\n normalizeDateStep,\n normalizeHourCycle,\n provideToken,\n SegmentValueObj,\n syncSegmentValues,\n TimeValue,\n watch\n} from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { TIME_FIELDS_ROOT_CONTEXT } from './time-field-context.token';\nimport { RdxTimeFieldInputDirective } from './time-field-input.directive';\n\nfunction convertValue(value: TimeValue, date: DateValue = today(getLocalTimeZone())) {\n if (value && 'day' in value) {\n return value;\n }\n\n return toCalendarDateTime(date, value);\n}\n\n/**\n * Map the internal edit buffer (`convertedModelValue`, always a date-bearing value\n * so the segment editor has a date context) back onto the public `value` model.\n * A date-bearing model keeps its shape; a time-only model is exposed as a plain `Time`.\n */\nfunction toModelValue(value: TimeValue, current: TimeValue | undefined): TimeValue {\n if (current && 'day' in current) {\n return value;\n }\n\n return new Time(value.hour, value.minute, value.second, value.millisecond);\n}\n\nfunction isSameTimeValue(a: TimeValue | undefined, b: TimeValue | undefined): boolean {\n if (isNullish(a) || isNullish(b)) return a === b;\n return (a as { compare(other: TimeValue): number }).compare(b) === 0;\n}\n\n@Directive({\n selector: '[rdxTimeFieldRoot]',\n exportAs: 'rdxTimeFieldRoot',\n providers: [provideToken(TIME_FIELDS_ROOT_CONTEXT, RdxTimeFieldRootDirective)],\n host: {\n role: 'group',\n '[attr.aria-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.data-invalid]': 'isInvalid() ? \"\" : undefined',\n '[attr.dir]': 'dir()',\n\n '(keydown)': 'onKeydown($event)'\n }\n})\nexport class RdxTimeFieldRootDirective {\n /**\n * The controlled checked state of the calendar.\n */\n readonly value = model<TimeValue | undefined>();\n\n /**\n * The hour cycle to use for formatting times. Defaults to the locale preference\n */\n readonly hourCycle = input<HourCycle>();\n\n /**\n * The granularity to use for formatting the field. Defaults to 'day' if a CalendarDate is provided, otherwise defaults to 'minute'.\n * The field will render segments for each part of the date up to and including the specified granularity.\n */\n readonly granularity = input<Granularity>();\n\n /**\n * The locale to use for formatting dates.\n */\n readonly locale = input<string>('en');\n\n readonly dirInput = input<Direction | undefined>(undefined, { alias: 'dir' });\n readonly dir = injectDirection(this.dirInput);\n\n /**\n * The minimum valid date that can be entered.\n */\n readonly minValue = input<TimeValue>();\n\n /**\n * The maximum valid date that can be entered.\n */\n readonly maxValue = input<TimeValue>();\n\n /**\n * Whether or not to hide the time zone segment of the field.\n */\n readonly hideTimeZone = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether or not the field is readonly.\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The stepping interval for the time fields. Defaults to 1\n */\n readonly step = input<DateStep>();\n\n readonly step$ = computed(() => normalizeDateStep(this.step()));\n\n /**\n * Locale- and hour-cycle-aware formatter. Recomputed whenever `locale` or\n * `hourCycle` change so segments always render with the current settings.\n * @ignore\n */\n readonly formatter: Signal<Formatter> = computed(() =>\n createFormatter(this.locale(), {\n hourCycle: normalizeHourCycle(this.hourCycle())\n })\n );\n\n /**\n * @ignore\n */\n readonly defaultDate = computed(() =>\n getDefaultTime({\n defaultPlaceholder: undefined,\n defaultValue: this.value()\n })\n );\n\n /**\n * The placeholder date, which is used to determine what month to display when no date is selected. This updates as the user navigates the calendar and can be used to programmatically control the calendar view\n */\n readonly placeholder = model<TimeValue | undefined>(this.defaultDate().copy());\n\n // Internal state\n\n /**\n * Segment input parts, collected from the projected content in DOM order. This\n * stays in sync with `segmentContents()` (granularity / locale / value changes\n * add or remove segments) instead of being captured once after view init.\n * @ignore\n */\n private readonly segmentInputs = contentChildren(RdxTimeFieldInputDirective);\n\n /**\n * The focusable (non-literal) segment elements, in DOM order.\n * @ignore\n */\n readonly segmentElements = computed(() =>\n this.segmentInputs()\n .filter((seg) => seg.part() !== 'literal')\n .map((seg) => seg.element)\n );\n\n /**\n * @ignore\n */\n readonly currentFocusedElement = signal<HTMLElement | null>(null);\n\n /**\n * @ignore\n */\n readonly inferredGranularity = computed(() => this.granularity() ?? 'minute');\n\n readonly convertedMinValue = computed(() => (this.minValue() ? convertValue(this.minValue()!) : undefined));\n readonly convertedMaxValue = computed(() => (this.maxValue() ? convertValue(this.maxValue()!) : undefined));\n\n readonly convertedModelValue = linkedSignal({\n source: () => {\n if (isNullish(this.value())) return this.value();\n\n return convertValue(this.value()!);\n },\n computation: (value: TimeValue | undefined) => {\n return value;\n }\n });\n\n readonly convertedPlaceholder = linkedSignal({\n source: () => {\n return convertValue(<TimeValue>this.placeholder());\n },\n computation: (value: TimeValue) => {\n return value;\n }\n });\n\n /**\n * The per-segment values. Writable so segment editing (via `useDateField`) can\n * update individual parts, but re-synced from the model whenever the value,\n * granularity or formatter change — so a controlled `value` set after init is\n * reflected, and an empty field re-initializes when granularity changes.\n * @ignore\n */\n readonly segmentValues = linkedSignal<\n { value: TimeValue | undefined; granularity: Granularity; formatter: Formatter },\n SegmentValueObj\n >({\n source: () => ({\n value: this.convertedModelValue(),\n granularity: this.inferredGranularity(),\n formatter: this.formatter()\n }),\n computation: ({ value, granularity, formatter }) =>\n value\n ? { ...syncSegmentValues({ value: <DateValue>value, formatter }) }\n : { ...initializeSegmentValues(granularity, true) }\n });\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => {\n if (!this.value()) return false;\n\n if (\n this.convertedMinValue() &&\n isBefore(<DateValue>this.convertedModelValue(), <DateValue>this.convertedMinValue())\n )\n return true;\n\n if (\n this.convertedMaxValue() &&\n isBefore(<DateValue>this.convertedMaxValue(), <DateValue>this.convertedModelValue())\n )\n return true;\n\n return false;\n });\n\n /**\n * @ignore\n */\n readonly allSegmentContent = computed(() =>\n createContent({\n granularity: this.inferredGranularity(),\n dateRef: <DateValue>this.convertedPlaceholder(),\n formatter: this.formatter(),\n hideTimeZone: this.hideTimeZone(),\n hourCycle: this.hourCycle(),\n segmentValues: this.segmentValues(),\n locale: this.locale,\n isTimeValue: true\n })\n );\n\n /**\n * An array of segments that should be readonly, which prevent user input on them.\n */\n readonly segmentContents = computed(() => this.allSegmentContent().arr);\n\n /**\n * @ignore\n */\n readonly currentSegmentIndex = computed(() =>\n this.segmentElements().findIndex((el) => el === this.currentFocusedElement())\n );\n\n /**\n * @ignore\n */\n readonly prevFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const elements = this.segmentElements();\n const index = this.currentSegmentIndex();\n const prevCondition = sign > 0 ? index < 0 : index > elements.length - 1;\n if (prevCondition) return null;\n\n return elements[index - sign];\n });\n\n /**\n * @ignore\n */\n readonly nextFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const elements = this.segmentElements();\n const index = this.currentSegmentIndex();\n const nextCondition = sign < 0 ? index < 0 : index > elements.length - 1;\n if (nextCondition) return null;\n\n return elements[index + sign];\n });\n\n /**\n * @ignore\n */\n readonly focusNext = () => {\n this.nextFocusableSegment()?.focus();\n };\n\n constructor() {\n watch([this.convertedModelValue], ([value]) => {\n if (\n !isNullish(value) &&\n (!isEqualDay(<DateValue>this.convertedPlaceholder(), <DateValue>value) ||\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n this.convertedPlaceholder().compare(value) !== 0)\n )\n this.placeholder.set(value.copy());\n\n // Segment editing (via `useDateField`) writes the internal `convertedModelValue`\n // buffer; mirror it back onto the public `value` model so two-way binding and\n // `valueChange` fire. The guard keeps this idempotent and breaks the feedback loop\n // (`value` → `convertedModelValue` source → here) once the values agree.\n const next = isNullish(value) ? undefined : toModelValue(value, this.value());\n if (!isSameTimeValue(this.value(), next)) {\n this.value.set(next);\n }\n });\n }\n\n /**\n * @ignore\n */\n onKeydown(event: Event) {\n const keyEvent = event as KeyboardEvent;\n if (!isSegmentNavigationKey(keyEvent.key)) return;\n const code = keyEvent.code;\n\n if (code === ARROW_LEFT) {\n this.prevFocusableSegment()?.focus();\n }\n\n if (code === ARROW_RIGHT) {\n this.nextFocusableSegment()?.focus();\n }\n }\n\n /**\n * @ignore\n */\n setFocusedElement(el: HTMLElement) {\n this.currentFocusedElement.set(el);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxTimeFieldInputDirective } from './src/time-field-input.directive';\nimport { RdxTimeFieldRootDirective } from './src/time-field-root.directive';\n\nexport * from './src/time-field-context.token';\nexport * from './src/time-field-input.directive';\nexport * from './src/time-field-root.directive';\n\nconst _imports = [RdxTimeFieldRootDirective, RdxTimeFieldInputDirective];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxTimeFieldModule {}\n","/**\n * Generated b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A0B,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACjK/E,MAAM,QAAQ,GAAG,CAAC,yBAAyB,EAAE,0BAA0B,CAAC;MAM3D,kBAAkB,CAAA;8GAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YANb,yBAAyB,EAAE,0BAA0B,CAAA,EAAA,OAAA,EAAA,CAArD,yBAAyB,EAAE,0BAA0B,CAAA,EAAA,CAAA,CAAA;+GAM1D,kBAAkB,EAAA,CAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-time-field.mjs","sources":["../../../packages/primitives/time-field/src/time-field-context.token.ts","../../../packages/primitives/time-field/src/time-field-input.directive.ts","../../../packages/primitives/time-field/src/time-field-root.directive.ts","../../../packages/primitives/time-field/index.ts","../../../packages/primitives/time-field/radix-ng-primitives-time-field.ts"],"sourcesContent":["import { inject, InjectionToken, InputSignal, ModelSignal, Signal, WritableSignal } from '@angular/core';\nimport { DateStep, Formatter, HourCycle, SegmentValueObj, TimeValue } from '@radix-ng/primitives/core';\n\nexport interface TimeFieldContextToken {\n locale: InputSignal<string>;\n value: ModelSignal<TimeValue | undefined>;\n placeholder: ModelSignal<TimeValue>;\n isInvalid: Signal<boolean>;\n disabled: InputSignal<boolean>;\n readonly: InputSignal<boolean>;\n formatter: Signal<Formatter>;\n hourCycle: InputSignal<HourCycle>;\n segmentValues: WritableSignal<SegmentValueObj>;\n focusNext: () => void;\n setFocusedElement: (el: HTMLElement) => void;\n convertedModelValue: WritableSignal<TimeValue | undefined>;\n convertedPlaceholder: WritableSignal<TimeValue>;\n step$: Signal<DateStep>;\n}\n\nexport const TIME_FIELDS_ROOT_CONTEXT = new InjectionToken<TimeFieldContextToken>('TIME_FIELDS_ROOT_CONTEXT');\n\nexport function injectTimeFieldsRootContext(): TimeFieldContextToken {\n return inject(TIME_FIELDS_ROOT_CONTEXT);\n}\n","import { computed, Directive, effect, ElementRef, inject, input, signal, WritableSignal } from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport { SegmentPart, useDateField } from '@radix-ng/primitives/core';\nimport { injectTimeFieldsRootContext } from './time-field-context.token';\n\n@Directive({\n selector: '[rdxTimeFieldInput]',\n host: {\n '[attr.contenteditable]': 'disabled() || readonly() ? false : part() !== \"literal\"',\n '[attr.data-rdx-date-field-segment]': 'part()',\n '[attr.aria-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-invalid]': 'isInvalid() ? \"\" : undefined',\n '[attr.aria-invalid]': 'isInvalid() ? true : undefined',\n\n '(mousedown)': 'part() !== \"literal\" && handleSegmentClick($event)',\n '(keydown)': 'part() !== \"literal\" && handleSegmentKeydown($event)',\n '(focus)': 'part() !== \"literal\" && onFocus($event)',\n '(focusout)': 'part() !== \"literal\" && onFocusOut()'\n }\n})\nexport class RdxTimeFieldInputDirective {\n private readonly el = inject(ElementRef);\n\n /**\n * The host element of this segment. Consumed by the root to collect focusable\n * segments in DOM order.\n * @ignore\n */\n readonly element: HTMLElement = this.el.nativeElement;\n\n private readonly rootContext = injectTimeFieldsRootContext();\n\n /**\n * The part of the date to render\n * `'hour' | 'minute' | 'second' | 'dayPeriod' | 'literal' | 'timeZoneName'`\n */\n readonly part = input<SegmentPart>();\n\n /**\n * @ignore\n */\n readonly disabled = computed(() => this.rootContext.disabled());\n\n /**\n * @ignore\n */\n readonly readonly = computed(() => this.rootContext.readonly());\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => this.rootContext.isInvalid());\n\n /**\n * @ignore\n */\n readonly hasLeftFocus = signal<boolean>(true);\n\n /**\n * @ignore\n */\n readonly lastKeyZero = signal<boolean>(false);\n\n private readonly fieldData = computed(() => {\n return useDateField({\n hasLeftFocus: this.hasLeftFocus,\n lastKeyZero: this.lastKeyZero,\n placeholder: this.rootContext.convertedPlaceholder as unknown as WritableSignal<DateValue>,\n hourCycle: this.rootContext.hourCycle(),\n segmentValues: this.rootContext.segmentValues,\n formatter: this.rootContext.formatter(),\n part: <SegmentPart>this.part(),\n disabled: this.rootContext.disabled,\n readonly: this.rootContext.readonly,\n modelValue: this.rootContext.convertedModelValue as unknown as WritableSignal<DateValue>,\n focusNext: this.rootContext.focusNext,\n step: this.rootContext.step$\n });\n });\n\n private readonly attributes = computed(() => this.fieldData().attributes());\n\n /**\n * @ignore\n */\n handleSegmentClick: (e: Event) => void;\n\n /**\n * @ignore\n */\n handleSegmentKeydown: (e: Event) => void;\n\n constructor() {\n effect(() => {\n const { handleSegmentClick, handleSegmentKeydown } = this.fieldData();\n this.handleSegmentKeydown = handleSegmentKeydown as (e: Event) => void;\n this.handleSegmentClick = handleSegmentClick as (e: Event) => void;\n });\n\n effect(() => {\n const attrs = this.attributes();\n Object.entries(attrs).forEach(([attr, value]) => {\n this.el.nativeElement.setAttribute(attr, String(value));\n });\n });\n }\n\n /**\n * @ignore\n */\n onFocus(e: Event) {\n this.rootContext.setFocusedElement(e.target as HTMLElement);\n }\n\n /**\n * @ignore\n */\n onFocusOut() {\n this.hasLeftFocus.set(true);\n }\n}\n","import {\n booleanAttribute,\n computed,\n contentChildren,\n Directive,\n input,\n linkedSignal,\n model,\n Signal,\n signal\n} from '@angular/core';\nimport { DateValue, getLocalTimeZone, isEqualDay, Time, toCalendarDateTime, today } from '@internationalized/date';\nimport {\n ARROW_LEFT,\n ARROW_RIGHT,\n BooleanInput,\n createContent,\n createFormatter,\n DateStep,\n Direction,\n Formatter,\n getDefaultTime,\n Granularity,\n HourCycle,\n initializeSegmentValues,\n isBefore,\n isNullish,\n isSegmentNavigationKey,\n normalizeDateStep,\n normalizeHourCycle,\n provideToken,\n SegmentValueObj,\n syncSegmentValues,\n TimeValue,\n watch\n} from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { TIME_FIELDS_ROOT_CONTEXT } from './time-field-context.token';\nimport { RdxTimeFieldInputDirective } from './time-field-input.directive';\n\nfunction convertValue(value: TimeValue, date: DateValue = today(getLocalTimeZone())) {\n if (value && 'day' in value) {\n return value;\n }\n\n return toCalendarDateTime(date, value);\n}\n\n/**\n * Map the internal edit buffer (`convertedModelValue`, always a date-bearing value\n * so the segment editor has a date context) back onto the public `value` model.\n * A date-bearing model keeps its shape; a time-only model is exposed as a plain `Time`.\n */\nfunction toModelValue(value: TimeValue, current: TimeValue | undefined): TimeValue {\n if (current && 'day' in current) {\n return value;\n }\n\n return new Time(value.hour, value.minute, value.second, value.millisecond);\n}\n\nfunction isSameTimeValue(a: TimeValue | undefined, b: TimeValue | undefined): boolean {\n if (isNullish(a) || isNullish(b)) return a === b;\n return (a as { compare(other: TimeValue): number }).compare(b) === 0;\n}\n\n@Directive({\n selector: '[rdxTimeFieldRoot]',\n exportAs: 'rdxTimeFieldRoot',\n providers: [provideToken(TIME_FIELDS_ROOT_CONTEXT, RdxTimeFieldRootDirective)],\n host: {\n role: 'group',\n '[attr.aria-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.data-invalid]': 'isInvalid() ? \"\" : undefined',\n '[attr.dir]': 'dir()',\n\n '(keydown)': 'onKeydown($event)'\n }\n})\nexport class RdxTimeFieldRootDirective {\n /**\n * The controlled checked state of the calendar.\n */\n readonly value = model<TimeValue | undefined>();\n\n /**\n * The hour cycle to use for formatting times. Defaults to the locale preference\n */\n readonly hourCycle = input<HourCycle>();\n\n /**\n * The granularity to use for formatting the field. Defaults to 'day' if a CalendarDate is provided, otherwise defaults to 'minute'.\n * The field will render segments for each part of the date up to and including the specified granularity.\n */\n readonly granularity = input<Granularity>();\n\n /**\n * The locale to use for formatting dates.\n */\n readonly locale = input<string>('en');\n\n readonly dirInput = input<Direction | undefined>(undefined, { alias: 'dir' });\n readonly dir = injectDirection(this.dirInput);\n\n /**\n * The minimum valid date that can be entered.\n */\n readonly minValue = input<TimeValue>();\n\n /**\n * The maximum valid date that can be entered.\n */\n readonly maxValue = input<TimeValue>();\n\n /**\n * Whether or not to hide the time zone segment of the field.\n */\n readonly hideTimeZone = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether or not the field is readonly.\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The stepping interval for the time fields. Defaults to 1\n */\n readonly step = input<DateStep>();\n\n readonly step$ = computed(() => normalizeDateStep(this.step()));\n\n /**\n * Locale- and hour-cycle-aware formatter. Recomputed whenever `locale` or\n * `hourCycle` change so segments always render with the current settings.\n * @ignore\n */\n readonly formatter: Signal<Formatter> = computed(() =>\n createFormatter(this.locale(), {\n hourCycle: normalizeHourCycle(this.hourCycle())\n })\n );\n\n /**\n * @ignore\n */\n readonly defaultDate = computed(() =>\n getDefaultTime({\n defaultPlaceholder: undefined,\n defaultValue: this.value()\n })\n );\n\n /**\n * The placeholder date, which is used to determine what month to display when no date is selected. This updates as the user navigates the calendar and can be used to programmatically control the calendar view\n */\n readonly placeholder = model<TimeValue | undefined>(this.defaultDate().copy());\n\n // Internal state\n\n /**\n * Segment input parts, collected from the projected content in DOM order. This\n * stays in sync with `segmentContents()` (granularity / locale / value changes\n * add or remove segments) instead of being captured once after view init.\n * @ignore\n */\n private readonly segmentInputs = contentChildren(RdxTimeFieldInputDirective);\n\n /**\n * The focusable (non-literal) segment elements, in DOM order.\n * @ignore\n */\n readonly segmentElements = computed(() =>\n this.segmentInputs()\n .filter((seg) => seg.part() !== 'literal')\n .map((seg) => seg.element)\n );\n\n /**\n * @ignore\n */\n readonly currentFocusedElement = signal<HTMLElement | null>(null);\n\n /**\n * @ignore\n */\n readonly inferredGranularity = computed(() => this.granularity() ?? 'minute');\n\n readonly convertedMinValue = computed(() => (this.minValue() ? convertValue(this.minValue()!) : undefined));\n readonly convertedMaxValue = computed(() => (this.maxValue() ? convertValue(this.maxValue()!) : undefined));\n\n readonly convertedModelValue = linkedSignal({\n source: () => {\n if (isNullish(this.value())) return this.value();\n\n return convertValue(this.value()!);\n },\n computation: (value: TimeValue | undefined) => {\n return value;\n }\n });\n\n readonly convertedPlaceholder = linkedSignal({\n source: () => {\n return convertValue(<TimeValue>this.placeholder());\n },\n computation: (value: TimeValue) => {\n return value;\n }\n });\n\n /**\n * The per-segment values. Writable so segment editing (via `useDateField`) can\n * update individual parts, but re-synced from the model whenever the value,\n * granularity or formatter change — so a controlled `value` set after init is\n * reflected, and an empty field re-initializes when granularity changes.\n * @ignore\n */\n readonly segmentValues = linkedSignal<\n { value: TimeValue | undefined; granularity: Granularity; formatter: Formatter },\n SegmentValueObj\n >({\n source: () => ({\n value: this.convertedModelValue(),\n granularity: this.inferredGranularity(),\n formatter: this.formatter()\n }),\n computation: ({ value, granularity, formatter }) =>\n value\n ? { ...syncSegmentValues({ value: <DateValue>value, formatter }) }\n : { ...initializeSegmentValues(granularity, true) }\n });\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => {\n if (!this.value()) return false;\n\n if (\n this.convertedMinValue() &&\n isBefore(<DateValue>this.convertedModelValue(), <DateValue>this.convertedMinValue())\n )\n return true;\n\n if (\n this.convertedMaxValue() &&\n isBefore(<DateValue>this.convertedMaxValue(), <DateValue>this.convertedModelValue())\n )\n return true;\n\n return false;\n });\n\n /**\n * @ignore\n */\n readonly allSegmentContent = computed(() =>\n createContent({\n granularity: this.inferredGranularity(),\n dateRef: <DateValue>this.convertedPlaceholder(),\n formatter: this.formatter(),\n hideTimeZone: this.hideTimeZone(),\n hourCycle: this.hourCycle(),\n segmentValues: this.segmentValues(),\n locale: this.locale,\n isTimeValue: true\n })\n );\n\n /**\n * An array of segments that should be readonly, which prevent user input on them.\n */\n readonly segmentContents = computed(() => this.allSegmentContent().arr);\n\n /**\n * @ignore\n */\n readonly currentSegmentIndex = computed(() =>\n this.segmentElements().findIndex((el) => el === this.currentFocusedElement())\n );\n\n /**\n * @ignore\n */\n readonly prevFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const elements = this.segmentElements();\n const index = this.currentSegmentIndex();\n const prevCondition = sign > 0 ? index < 0 : index > elements.length - 1;\n if (prevCondition) return null;\n\n return elements[index - sign];\n });\n\n /**\n * @ignore\n */\n readonly nextFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const elements = this.segmentElements();\n const index = this.currentSegmentIndex();\n const nextCondition = sign < 0 ? index < 0 : index > elements.length - 1;\n if (nextCondition) return null;\n\n return elements[index + sign];\n });\n\n /**\n * @ignore\n */\n readonly focusNext = () => {\n this.nextFocusableSegment()?.focus();\n };\n\n constructor() {\n watch([this.convertedModelValue], ([value]) => {\n if (\n !isNullish(value) &&\n (!isEqualDay(<DateValue>this.convertedPlaceholder(), <DateValue>value) ||\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n this.convertedPlaceholder().compare(value) !== 0)\n )\n this.placeholder.set(value.copy());\n\n // Segment editing (via `useDateField`) writes the internal `convertedModelValue`\n // buffer; mirror it back onto the public `value` model so two-way binding and\n // `valueChange` fire. The guard keeps this idempotent and breaks the feedback loop\n // (`value` → `convertedModelValue` source → here) once the values agree.\n const next = isNullish(value) ? undefined : toModelValue(value, this.value());\n if (!isSameTimeValue(this.value(), next)) {\n this.value.set(next);\n }\n });\n }\n\n /**\n * @ignore\n */\n onKeydown(event: Event) {\n const keyEvent = event as KeyboardEvent;\n if (!isSegmentNavigationKey(keyEvent.key)) return;\n const code = keyEvent.code;\n\n if (code === ARROW_LEFT) {\n this.prevFocusableSegment()?.focus();\n }\n\n if (code === ARROW_RIGHT) {\n this.nextFocusableSegment()?.focus();\n }\n }\n\n /**\n * @ignore\n */\n setFocusedElement(el: HTMLElement) {\n this.currentFocusedElement.set(el);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxTimeFieldInputDirective } from './src/time-field-input.directive';\nimport { RdxTimeFieldRootDirective } from './src/time-field-root.directive';\n\nexport * from './src/time-field-context.token';\nexport * from './src/time-field-input.directive';\nexport * from './src/time-field-root.directive';\n\nconst _imports = [RdxTimeFieldRootDirective, RdxTimeFieldInputDirective];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxTimeFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAoBa,wBAAwB,GAAG,IAAI,cAAc,CAAwB,0BAA0B;SAE5F,2BAA2B,GAAA;AACvC,IAAA,OAAO,MAAM,CAAC,wBAAwB,CAAC;AAC3C;;MCHa,0BAA0B,CAAA;AAwEnC,IAAA,WAAA,GAAA;AAvEiB,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;AAExC;;;;AAIG;AACM,QAAA,IAAA,CAAA,OAAO,GAAgB,IAAI,CAAC,EAAE,CAAC,aAAa;QAEpC,IAAA,CAAA,WAAW,GAAG,2BAA2B,EAAE;AAE5D;;;AAGG;AACM,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK;4FAAe;AAEpC;;AAEG;QACM,IAAA,CAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC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A,CAArD,yBAAyB,EAAE,0BAA0B,CAAA,EAAA,CAAA,CAAA;+GAM1D,kBAAkB,EAAA,CAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -22,15 +22,19 @@ const DEFAULT_LIMIT = 3;
|
|
|
22
22
|
class RdxToastManager {
|
|
23
23
|
constructor() {
|
|
24
24
|
this.idGenerator = inject(RdxIdGenerator);
|
|
25
|
-
this._toasts = signal([],
|
|
25
|
+
this._toasts = signal([], /* @ts-ignore */
|
|
26
|
+
...(ngDevMode ? [{ debugName: "_toasts" }] : /* istanbul ignore next */ []));
|
|
26
27
|
/** The live queue, oldest first. Render it in `RdxToastViewport` (e.g. via `@for`). */
|
|
27
28
|
this.toasts = this._toasts.asReadonly();
|
|
28
29
|
/** Whether any toast is currently in the queue. */
|
|
29
|
-
this.hasToasts = computed(() => this._toasts().length > 0,
|
|
30
|
-
|
|
30
|
+
this.hasToasts = computed(() => this._toasts().length > 0, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "hasToasts" }] : /* istanbul ignore next */ []));
|
|
32
|
+
this._expanded = signal(false, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "_expanded" }] : /* istanbul ignore next */ []));
|
|
31
34
|
/** Whether the stack is expanded (viewport hovered or focused) — drives `data-expanded`. */
|
|
32
35
|
this.expanded = this._expanded.asReadonly();
|
|
33
|
-
this._heights = signal({},
|
|
36
|
+
this._heights = signal({}, /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "_heights" }] : /* istanbul ignore next */ []));
|
|
34
38
|
/** Measured heights (px) per toast id, reported by each `RdxToastRoot` for expanded-stack offsets. */
|
|
35
39
|
this.heights = this._heights.asReadonly();
|
|
36
40
|
/**
|
|
@@ -49,7 +53,8 @@ class RdxToastManager {
|
|
|
49
53
|
offsetInFront += heights[toast.id] ?? 0;
|
|
50
54
|
}
|
|
51
55
|
return result;
|
|
52
|
-
},
|
|
56
|
+
}, /* @ts-ignore */
|
|
57
|
+
...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
|
|
53
58
|
/** Max number of simultaneously visible toasts. Configurable via `[rdxToastProvider]`. */
|
|
54
59
|
this.limit = DEFAULT_LIMIT;
|
|
55
60
|
/** Default auto-dismiss delay (ms) for toasts that omit `timeout`. Set via `[rdxToastProvider]`. */
|
|
@@ -211,10 +216,10 @@ class RdxToastManager {
|
|
|
211
216
|
return next;
|
|
212
217
|
});
|
|
213
218
|
}
|
|
214
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
215
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
219
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
220
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastManager }); }
|
|
216
221
|
}
|
|
217
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastManager, decorators: [{
|
|
218
223
|
type: Injectable
|
|
219
224
|
}] });
|
|
220
225
|
/** Normalize a string-or-options promise-copy entry (optionally derived from the settled value). */
|
|
@@ -234,19 +239,21 @@ class RdxToastProvider {
|
|
|
234
239
|
constructor() {
|
|
235
240
|
this.manager = inject(RdxToastManager);
|
|
236
241
|
/** Max number of toasts shown at once. */
|
|
237
|
-
this.limit = input(DEFAULT_LIMIT,
|
|
242
|
+
this.limit = input(DEFAULT_LIMIT, /* @ts-ignore */
|
|
243
|
+
...(ngDevMode ? [{ debugName: "limit" }] : /* istanbul ignore next */ []));
|
|
238
244
|
/** Default auto-dismiss delay (ms) for toasts that omit their own `timeout`. `0` disables it. */
|
|
239
|
-
this.timeout = input(DEFAULT_TIMEOUT,
|
|
245
|
+
this.timeout = input(DEFAULT_TIMEOUT, /* @ts-ignore */
|
|
246
|
+
...(ngDevMode ? [{ debugName: "timeout" }] : /* istanbul ignore next */ []));
|
|
240
247
|
// `limit` / `defaultTimeout` are plain fields on the manager; keep them in sync with inputs.
|
|
241
248
|
effect(() => {
|
|
242
249
|
this.manager.limit = this.limit();
|
|
243
250
|
this.manager.defaultTimeout = this.timeout();
|
|
244
251
|
});
|
|
245
252
|
}
|
|
246
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
247
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
253
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastProvider, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
254
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxToastProvider, isStandalone: true, selector: "[rdxToastProvider]", inputs: { limit: { classPropertyName: "limit", publicName: "limit", isSignal: true, isRequired: false, transformFunction: null }, timeout: { classPropertyName: "timeout", publicName: "timeout", isSignal: true, isRequired: false, transformFunction: null } }, providers: [RdxToastManager], exportAs: ["rdxToastProvider"], ngImport: i0 }); }
|
|
248
255
|
}
|
|
249
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastProvider, decorators: [{
|
|
250
257
|
type: Directive,
|
|
251
258
|
args: [{
|
|
252
259
|
selector: '[rdxToastProvider]',
|
|
@@ -425,29 +432,39 @@ class RdxToastRoot {
|
|
|
425
432
|
this.elementRef = inject(ElementRef);
|
|
426
433
|
this.injector = inject(Injector);
|
|
427
434
|
/** The toast model to render — pass the item from the viewport's `@for`. */
|
|
428
|
-
this.toast = input.required(
|
|
435
|
+
this.toast = input.required(/* @ts-ignore */
|
|
436
|
+
...(ngDevMode ? [{ debugName: "toast" }] : /* istanbul ignore next */ []));
|
|
429
437
|
/** Allowed swipe-to-dismiss directions. Accepts a single direction or a list. */
|
|
430
|
-
this.swipeDirection = input(['down', 'right'],
|
|
438
|
+
this.swipeDirection = input(['down', 'right'], /* @ts-ignore */
|
|
439
|
+
...(ngDevMode ? [{ debugName: "swipeDirection" }] : /* istanbul ignore next */ []));
|
|
431
440
|
this.titleId = injectId('rdx-toast-title-');
|
|
432
441
|
this.descriptionId = injectId('rdx-toast-description-');
|
|
433
442
|
/** Whether a title / description part has registered, gating the aria-* references. */
|
|
434
|
-
this.titlePresent = signal(false,
|
|
435
|
-
|
|
443
|
+
this.titlePresent = signal(false, /* @ts-ignore */
|
|
444
|
+
...(ngDevMode ? [{ debugName: "titlePresent" }] : /* istanbul ignore next */ []));
|
|
445
|
+
this.descriptionPresent = signal(false, /* @ts-ignore */
|
|
446
|
+
...(ngDevMode ? [{ debugName: "descriptionPresent" }] : /* istanbul ignore next */ []));
|
|
436
447
|
this.size = elementSize({ elementRef: this.elementRef, injector: this.injector });
|
|
437
448
|
/** This toast's measured height (px). */
|
|
438
|
-
this.height = computed(() => this.size().height,
|
|
449
|
+
this.height = computed(() => this.size().height, /* @ts-ignore */
|
|
450
|
+
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
439
451
|
/** Position from the front of the stack — `0` is the newest/frontmost toast. */
|
|
440
|
-
this.index = computed(() => this.manager.layout()[this.toast().id]?.index ?? 0,
|
|
452
|
+
this.index = computed(() => this.manager.layout()[this.toast().id]?.index ?? 0, /* @ts-ignore */
|
|
453
|
+
...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
441
454
|
/** Combined height (px) of the toasts stacked in front of this one (for expanded layout). */
|
|
442
|
-
this.offsetY = computed(() => this.manager.layout()[this.toast().id]?.offsetY ?? 0,
|
|
455
|
+
this.offsetY = computed(() => this.manager.layout()[this.toast().id]?.offsetY ?? 0, /* @ts-ignore */
|
|
456
|
+
...(ngDevMode ? [{ debugName: "offsetY" }] : /* istanbul ignore next */ []));
|
|
443
457
|
/** `alert` (assertive) for high-priority toasts, otherwise `status`. */
|
|
444
|
-
this.role = computed(() => (this.toast().priority === 'high' ? 'alert' : 'status'),
|
|
458
|
+
this.role = computed(() => (this.toast().priority === 'high' ? 'alert' : 'status'), /* @ts-ignore */
|
|
459
|
+
...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
445
460
|
/** `open` while visible, `closed` once dismissal begins — drives enter/leave animations. */
|
|
446
|
-
this.dataState = computed(() => (this.toast().transitionStatus === 'ending' ? 'closed' : 'open'),
|
|
461
|
+
this.dataState = computed(() => (this.toast().transitionStatus === 'ending' ? 'closed' : 'open'), /* @ts-ignore */
|
|
462
|
+
...(ngDevMode ? [{ debugName: "dataState" }] : /* istanbul ignore next */ []));
|
|
447
463
|
this.directions = computed(() => {
|
|
448
464
|
const value = this.swipeDirection();
|
|
449
465
|
return Array.isArray(value) ? value : [value];
|
|
450
|
-
},
|
|
466
|
+
}, /* @ts-ignore */
|
|
467
|
+
...(ngDevMode ? [{ debugName: "directions" }] : /* istanbul ignore next */ []));
|
|
451
468
|
const destroyRef = inject(DestroyRef);
|
|
452
469
|
// Mirror the measured height into the manager for the expanded-stack offset math.
|
|
453
470
|
effect(() => {
|
|
@@ -486,10 +503,10 @@ class RdxToastRoot {
|
|
|
486
503
|
this.manager.remove(this.toast().id);
|
|
487
504
|
}
|
|
488
505
|
}
|
|
489
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
490
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
506
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
507
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxToastRoot, isStandalone: true, selector: "[rdxToastRoot]", inputs: { toast: { classPropertyName: "toast", publicName: "toast", isSignal: true, isRequired: true, transformFunction: null }, swipeDirection: { classPropertyName: "swipeDirection", publicName: "swipeDirection", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "animationend": "onAnimationEnd()" }, properties: { "style.touch-action": "\"none\"", "style.user-select": "\"none\"", "style.-webkit-user-select": "\"none\"", "attr.role": "role()", "attr.aria-labelledby": "titlePresent() ? titleId : undefined", "attr.aria-describedby": "descriptionPresent() ? descriptionId : undefined", "attr.data-state": "dataState()", "attr.data-type": "toast().type ?? undefined", "attr.data-front": "index() === 0 ? \"\" : undefined", "attr.data-expanded": "manager.expanded() ? \"\" : undefined", "style.--toast-index": "index()", "style.--toast-height": "height() + \"px\"", "style.--toast-offset-y": "offsetY() + \"px\"" } }, providers: [provideRdxToastRootContext(rootContext)], exportAs: ["rdxToastRoot"], ngImport: i0 }); }
|
|
491
508
|
}
|
|
492
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
509
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastRoot, decorators: [{
|
|
493
510
|
type: Directive,
|
|
494
511
|
args: [{
|
|
495
512
|
selector: '[rdxToastRoot]',
|
|
@@ -529,10 +546,10 @@ class RdxToastAction {
|
|
|
529
546
|
/** The toast root context, so handlers can read the toast or dismiss it after acting. */
|
|
530
547
|
this.rootContext = injectRdxToastRootContext();
|
|
531
548
|
}
|
|
532
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
533
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
549
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastAction, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
550
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxToastAction, isStandalone: true, selector: "[rdxToastAction]", host: { attributes: { "type": "button" } }, exportAs: ["rdxToastAction"], ngImport: i0 }); }
|
|
534
551
|
}
|
|
535
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
552
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastAction, decorators: [{
|
|
536
553
|
type: Directive,
|
|
537
554
|
args: [{
|
|
538
555
|
selector: '[rdxToastAction]',
|
|
@@ -548,10 +565,10 @@ class RdxToastClose {
|
|
|
548
565
|
constructor() {
|
|
549
566
|
this.rootContext = injectRdxToastRootContext();
|
|
550
567
|
}
|
|
551
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
552
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
568
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastClose, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
569
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxToastClose, isStandalone: true, selector: "[rdxToastClose]", host: { attributes: { "type": "button" }, listeners: { "click": "rootContext.close()" } }, exportAs: ["rdxToastClose"], ngImport: i0 }); }
|
|
553
570
|
}
|
|
554
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
571
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastClose, decorators: [{
|
|
555
572
|
type: Directive,
|
|
556
573
|
args: [{
|
|
557
574
|
selector: '[rdxToastClose]',
|
|
@@ -573,10 +590,10 @@ class RdxToastContent {
|
|
|
573
590
|
constructor() {
|
|
574
591
|
this.rootContext = injectRdxToastRootContext();
|
|
575
592
|
}
|
|
576
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
577
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
593
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
594
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxToastContent, isStandalone: true, selector: "[rdxToastContent]", host: { properties: { "attr.data-state": "rootContext.toast().transitionStatus === \"ending\" ? \"closed\" : \"open\"" } }, exportAs: ["rdxToastContent"], ngImport: i0 }); }
|
|
578
595
|
}
|
|
579
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
596
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastContent, decorators: [{
|
|
580
597
|
type: Directive,
|
|
581
598
|
args: [{
|
|
582
599
|
selector: '[rdxToastContent]',
|
|
@@ -594,10 +611,10 @@ class RdxToastDescription {
|
|
|
594
611
|
this.rootContext.setDescriptionPresent(true);
|
|
595
612
|
inject(DestroyRef).onDestroy(() => this.rootContext.setDescriptionPresent(false));
|
|
596
613
|
}
|
|
597
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
598
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
614
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
615
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxToastDescription, isStandalone: true, selector: "[rdxToastDescription]", host: { properties: { "id": "rootContext.descriptionId" } }, exportAs: ["rdxToastDescription"], ngImport: i0 }); }
|
|
599
616
|
}
|
|
600
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
617
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastDescription, decorators: [{
|
|
601
618
|
type: Directive,
|
|
602
619
|
args: [{
|
|
603
620
|
selector: '[rdxToastDescription]',
|
|
@@ -613,10 +630,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
613
630
|
* `<Toast.Portal>`. Defaults to `document.body`; pass `container` to target another element.
|
|
614
631
|
*/
|
|
615
632
|
class RdxToastPortal {
|
|
616
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
617
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
633
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastPortal, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
634
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxToastPortal, isStandalone: true, selector: "[rdxToastPortal]", exportAs: ["rdxToastPortal"], hostDirectives: [{ directive: i1.RdxPortal, inputs: ["container", "container"] }], ngImport: i0 }); }
|
|
618
635
|
}
|
|
619
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
636
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastPortal, decorators: [{
|
|
620
637
|
type: Directive,
|
|
621
638
|
args: [{
|
|
622
639
|
selector: '[rdxToastPortal]',
|
|
@@ -640,8 +657,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
640
657
|
* mirrors the anchor width / transform origin as friendlier `--toast-*` CSS variables.
|
|
641
658
|
*/
|
|
642
659
|
class RdxToastPositioner extends RdxPopperContentWrapper {
|
|
643
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
644
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
660
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastPositioner, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
661
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxToastPositioner, isStandalone: true, selector: "[rdxToastPositioner]", host: { properties: { "style.--toast-anchor-width": "\"var(--radix-popper-anchor-width)\"", "style.--toast-transform-origin": "\"var(--radix-popper-transform-origin)\"" } }, providers: [
|
|
645
662
|
...provideRdxPopperContentWrapper(RdxToastPositioner),
|
|
646
663
|
provideRdxPopperContentConfig({
|
|
647
664
|
side: 'top',
|
|
@@ -653,7 +670,7 @@ class RdxToastPositioner extends RdxPopperContentWrapper {
|
|
|
653
670
|
})
|
|
654
671
|
], exportAs: ["rdxToastPositioner"], usesInheritance: true, hostDirectives: [{ directive: i1$1.RdxPopper }], ngImport: i0 }); }
|
|
655
672
|
}
|
|
656
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
673
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastPositioner, decorators: [{
|
|
657
674
|
type: Directive,
|
|
658
675
|
args: [{
|
|
659
676
|
selector: '[rdxToastPositioner]',
|
|
@@ -686,10 +703,10 @@ class RdxToastTitle {
|
|
|
686
703
|
this.rootContext.setTitlePresent(true);
|
|
687
704
|
inject(DestroyRef).onDestroy(() => this.rootContext.setTitlePresent(false));
|
|
688
705
|
}
|
|
689
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
690
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
706
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
707
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxToastTitle, isStandalone: true, selector: "[rdxToastTitle]", host: { properties: { "id": "rootContext.titleId" } }, exportAs: ["rdxToastTitle"], ngImport: i0 }); }
|
|
691
708
|
}
|
|
692
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
709
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastTitle, decorators: [{
|
|
693
710
|
type: Directive,
|
|
694
711
|
args: [{
|
|
695
712
|
selector: '[rdxToastTitle]',
|
|
@@ -714,8 +731,10 @@ class RdxToastViewport {
|
|
|
714
731
|
this.manager = inject(RdxToastManager);
|
|
715
732
|
/** The live toast queue to render. */
|
|
716
733
|
this.toasts = this.manager.toasts;
|
|
717
|
-
this.hovered = signal(false,
|
|
718
|
-
|
|
734
|
+
this.hovered = signal(false, /* @ts-ignore */
|
|
735
|
+
...(ngDevMode ? [{ debugName: "hovered" }] : /* istanbul ignore next */ []));
|
|
736
|
+
this.focused = signal(false, /* @ts-ignore */
|
|
737
|
+
...(ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []));
|
|
719
738
|
/** Tracks the last expanded state so pause/resume stay balanced across transitions. */
|
|
720
739
|
this.wasExpanded = false;
|
|
721
740
|
effect(() => {
|
|
@@ -748,10 +767,10 @@ class RdxToastViewport {
|
|
|
748
767
|
this.focused.set(false);
|
|
749
768
|
}
|
|
750
769
|
}
|
|
751
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
752
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
770
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastViewport, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
771
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxToastViewport, isStandalone: true, selector: "[rdxToastViewport]", host: { attributes: { "role": "region", "tabindex": "-1" }, listeners: { "mouseenter": "hovered.set(true)", "mouseleave": "hovered.set(false)", "focusin": "focused.set(true)", "focusout": "onFocusOut($event)" } }, exportAs: ["rdxToastViewport"], ngImport: i0 }); }
|
|
753
772
|
}
|
|
754
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
773
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastViewport, decorators: [{
|
|
755
774
|
type: Directive,
|
|
756
775
|
args: [{
|
|
757
776
|
selector: '[rdxToastViewport]',
|
|
@@ -780,8 +799,8 @@ const toastImports = [
|
|
|
780
799
|
RdxToastAction
|
|
781
800
|
];
|
|
782
801
|
class RdxToastModule {
|
|
783
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
784
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
802
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
803
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.2", ngImport: i0, type: RdxToastModule, imports: [RdxToastProvider,
|
|
785
804
|
RdxToastPortal,
|
|
786
805
|
RdxToastViewport,
|
|
787
806
|
RdxToastPositioner,
|
|
@@ -800,9 +819,9 @@ class RdxToastModule {
|
|
|
800
819
|
RdxToastDescription,
|
|
801
820
|
RdxToastClose,
|
|
802
821
|
RdxToastAction] }); }
|
|
803
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
822
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastModule }); }
|
|
804
823
|
}
|
|
805
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
824
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxToastModule, decorators: [{
|
|
806
825
|
type: NgModule,
|
|
807
826
|
args: [{
|
|
808
827
|
imports: [...toastImports],
|