@radix-ng/primitives 0.51.0 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/radix-ng-primitives-accordion.mjs +105 -38
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +221 -129
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-arrow.mjs +20 -4
- package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +54 -61
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-button.mjs +123 -0
- package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +378 -54
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +182 -81
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collection.mjs +40 -57
- package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +140 -424
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +735 -744
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs +1 -0
- package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +51 -45
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +655 -327
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +70 -46
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +1059 -0
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +363 -0
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
- package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +23 -8
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-input.mjs +172 -0
- package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-label.mjs +6 -6
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +1480 -344
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
- package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1052 -1553
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -367
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +978 -989
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +91 -41
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-portal.mjs +34 -10
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-progress.mjs +223 -84
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +191 -51
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +96 -50
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +791 -509
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +12 -35
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +969 -717
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +15 -19
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +125 -113
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +381 -108
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +55 -46
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +121 -247
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +98 -61
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +303 -92
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +690 -1071
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +25 -66
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/meter/README.md +3 -0
- package/navigation-menu/README.md +2 -1
- package/package.json +31 -18
- package/portal/README.md +2 -0
- package/preview-card/README.md +3 -0
- package/schematics/collection.json +1 -0
- package/schematics/ng-add/index.d.ts +3 -2
- package/schematics/ng-add/index.js +62 -31
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/package-config.d.ts +4 -2
- package/schematics/ng-add/package-config.js +10 -2
- package/schematics/ng-add/package-config.js.map +1 -1
- package/schematics/ng-add/schema.d.ts +3 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +14 -0
- package/select/README.md +2 -0
- package/types/radix-ng-primitives-accordion.d.ts +48 -14
- package/types/radix-ng-primitives-alert-dialog.d.ts +95 -38
- package/types/radix-ng-primitives-arrow.d.ts +1 -1
- package/types/radix-ng-primitives-aspect-ratio.d.ts +1 -1
- package/types/radix-ng-primitives-avatar.d.ts +7 -11
- package/types/radix-ng-primitives-button.d.ts +73 -0
- package/types/radix-ng-primitives-calendar.d.ts +1 -2
- package/types/radix-ng-primitives-checkbox.d.ts +201 -32
- package/types/radix-ng-primitives-collapsible.d.ts +112 -39
- package/types/radix-ng-primitives-collection.d.ts +38 -34
- package/types/radix-ng-primitives-config.d.ts +1 -1
- package/types/radix-ng-primitives-context-menu.d.ts +60 -116
- package/types/radix-ng-primitives-core.d.ts +307 -236
- package/types/radix-ng-primitives-cropper.d.ts +2 -2
- package/types/radix-ng-primitives-date-field.d.ts +38 -23
- package/types/radix-ng-primitives-dialog.d.ts +282 -165
- package/types/radix-ng-primitives-dismissable-layer.d.ts +15 -7
- package/types/radix-ng-primitives-drawer.d.ts +448 -0
- package/types/radix-ng-primitives-editable.d.ts +1 -1
- package/types/radix-ng-primitives-field.d.ts +373 -0
- package/types/radix-ng-primitives-fieldset.d.ts +48 -0
- package/types/radix-ng-primitives-focus-scope.d.ts +13 -5
- package/types/radix-ng-primitives-input.d.ts +87 -0
- package/types/radix-ng-primitives-label.d.ts +0 -1
- package/types/radix-ng-primitives-menu.d.ts +572 -99
- package/types/radix-ng-primitives-menubar.d.ts +60 -50
- package/types/radix-ng-primitives-meter.d.ts +193 -0
- package/types/radix-ng-primitives-navigation-menu.d.ts +422 -340
- package/types/radix-ng-primitives-number-field.d.ts +405 -145
- package/types/radix-ng-primitives-pagination.d.ts +2 -2
- package/types/radix-ng-primitives-popover.d.ts +365 -351
- package/types/radix-ng-primitives-popper.d.ts +49 -9
- package/types/radix-ng-primitives-portal.d.ts +14 -6
- package/types/radix-ng-primitives-presence.d.ts +28 -76
- package/types/radix-ng-primitives-preview-card.d.ts +359 -0
- package/types/radix-ng-primitives-progress.d.ts +174 -48
- package/types/radix-ng-primitives-radio.d.ts +55 -25
- package/types/radix-ng-primitives-roving-focus.d.ts +30 -21
- package/types/radix-ng-primitives-select.d.ts +475 -177
- package/types/radix-ng-primitives-separator.d.ts +7 -32
- package/types/radix-ng-primitives-slider.d.ts +315 -201
- package/types/radix-ng-primitives-stepper.d.ts +5 -7
- package/types/radix-ng-primitives-switch.d.ts +86 -71
- package/types/radix-ng-primitives-tabs.d.ts +213 -79
- package/types/radix-ng-primitives-time-field.d.ts +42 -27
- package/types/radix-ng-primitives-toggle-group.d.ts +85 -164
- package/types/radix-ng-primitives-toggle.d.ts +43 -53
- package/types/radix-ng-primitives-toolbar.d.ts +163 -38
- package/types/radix-ng-primitives-tooltip.d.ts +347 -384
- package/types/radix-ng-primitives-visually-hidden.d.ts +19 -19
- package/dropdown-menu/README.md +0 -1
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -581
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1238
- package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-select2.mjs +0 -897
- package/fesm2022/radix-ng-primitives-select2.mjs.map +0 -1
- package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -735
- package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
- package/hover-card/README.md +0 -3
- package/select2/README.md +0 -3
- package/tooltip2/README.md +0 -3
- package/types/radix-ng-primitives-dropdown-menu.d.ts +0 -171
- package/types/radix-ng-primitives-hover-card.d.ts +0 -471
- package/types/radix-ng-primitives-select2.d.ts +0 -511
- package/types/radix-ng-primitives-tooltip2.d.ts +0 -325
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { forwardRef, input, booleanAttribute, output, linkedSignal, untracked, Directive, inject,
|
|
3
|
-
import { NG_VALUE_ACCESSOR
|
|
4
|
-
import { Platform } from '@angular/cdk/platform';
|
|
2
|
+
import { forwardRef, input, booleanAttribute, output, linkedSignal, untracked, Directive, inject, InjectionToken, computed, APP_ID, Injectable, DOCUMENT, PLATFORM_ID, DestroyRef, signal, afterNextRender, effect, ElementRef, Injector } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
4
|
import { getLocalTimeZone, CalendarDateTime, ZonedDateTime, getDayOfWeek, DateFormatter, createCalendar, toCalendar, CalendarDate, Time, startOfMonth, endOfMonth, today } from '@internationalized/date';
|
|
5
|
+
import { isPlatformBrowser, DOCUMENT as DOCUMENT$1 } from '@angular/common';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Include in the providers section of a component which utilizes ControlValueAccessor to redundant code.
|
|
@@ -111,84 +111,6 @@ function injectControlValueAccessor() {
|
|
|
111
111
|
return inject(RdxControlValueAccessor);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
/*
|
|
115
|
-
* <div [rdxAutoFocus]="true"></div>
|
|
116
|
-
*/
|
|
117
|
-
class RdxAutoFocusDirective {
|
|
118
|
-
constructor() {
|
|
119
|
-
this.#elementRef = inject(ElementRef);
|
|
120
|
-
this.#ngZone = inject(NgZone);
|
|
121
|
-
this._autoSelect = false;
|
|
122
|
-
}
|
|
123
|
-
#elementRef;
|
|
124
|
-
#ngZone;
|
|
125
|
-
/**
|
|
126
|
-
* @default false
|
|
127
|
-
*/
|
|
128
|
-
set autoFocus(value) {
|
|
129
|
-
if (value) {
|
|
130
|
-
// Note: Running this outside Angular's zone because `element.focus()` does not trigger change detection.
|
|
131
|
-
this.#ngZone.runOutsideAngular(() =>
|
|
132
|
-
// Note: `element.focus()` causes re-layout which might lead to frame drops on slower devices.
|
|
133
|
-
// https://gist.github.com/paulirish/5d52fb081b3570c81e3a#setting-focus
|
|
134
|
-
// `setTimeout` is a macrotask executed within the current rendering frame.
|
|
135
|
-
// Animation tasks are executed in the next rendering frame.
|
|
136
|
-
reqAnimationFrame(() => {
|
|
137
|
-
this.#elementRef.nativeElement.focus();
|
|
138
|
-
if (this._autoSelect && this.#elementRef.nativeElement.select) {
|
|
139
|
-
this.#elementRef.nativeElement.select();
|
|
140
|
-
}
|
|
141
|
-
}));
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
// Setter for autoSelect attribute to enable text selection when autoFocus is true.
|
|
145
|
-
set autoSelect(value) {
|
|
146
|
-
this._autoSelect = value;
|
|
147
|
-
}
|
|
148
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAutoFocusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
149
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "21.2.9", type: RdxAutoFocusDirective, isStandalone: true, selector: "[rdxAutoFocus]", inputs: { autoFocus: ["rdxAutoFocus", "autoFocus", booleanAttribute], autoSelect: ["autoSelect", "autoSelect", booleanAttribute] }, ngImport: i0 }); }
|
|
150
|
-
}
|
|
151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxAutoFocusDirective, decorators: [{
|
|
152
|
-
type: Directive,
|
|
153
|
-
args: [{
|
|
154
|
-
selector: '[rdxAutoFocus]',
|
|
155
|
-
standalone: true
|
|
156
|
-
}]
|
|
157
|
-
}], propDecorators: { autoFocus: [{
|
|
158
|
-
type: Input,
|
|
159
|
-
args: [{ alias: 'rdxAutoFocus', transform: booleanAttribute }]
|
|
160
|
-
}], autoSelect: [{
|
|
161
|
-
type: Input,
|
|
162
|
-
args: [{ transform: booleanAttribute }]
|
|
163
|
-
}] } });
|
|
164
|
-
const availablePrefixes = ['moz', 'ms', 'webkit'];
|
|
165
|
-
function requestAnimationFramePolyfill() {
|
|
166
|
-
let lastTime = 0;
|
|
167
|
-
return function (callback) {
|
|
168
|
-
const currTime = new Date().getTime();
|
|
169
|
-
const timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
|
170
|
-
const id = setTimeout(() => {
|
|
171
|
-
callback(currTime + timeToCall);
|
|
172
|
-
}, timeToCall);
|
|
173
|
-
lastTime = currTime + timeToCall;
|
|
174
|
-
return id;
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
// Function to get the appropriate requestAnimationFrame method with fallback to polyfill.
|
|
178
|
-
function getRequestAnimationFrame() {
|
|
179
|
-
if (typeof window === 'undefined') {
|
|
180
|
-
return () => 0;
|
|
181
|
-
}
|
|
182
|
-
if (window.requestAnimationFrame) {
|
|
183
|
-
// https://github.com/vuejs/vue/issues/4465
|
|
184
|
-
return window.requestAnimationFrame.bind(window);
|
|
185
|
-
}
|
|
186
|
-
const prefix = availablePrefixes.filter((key) => `${key}RequestAnimationFrame` in window)[0];
|
|
187
|
-
return prefix ? window[`${prefix}RequestAnimationFrame`] : requestAnimationFramePolyfill();
|
|
188
|
-
}
|
|
189
|
-
// Get the requestAnimationFrame function or its polyfill.
|
|
190
|
-
const reqAnimationFrame = getRequestAnimationFrame();
|
|
191
|
-
|
|
192
114
|
/**
|
|
193
115
|
* The `clamp` function restricts a number within a specified range by returning the value itself if it
|
|
194
116
|
* falls within the range, or the closest boundary value if it exceeds the range.
|
|
@@ -259,444 +181,6 @@ function snapValueToStep(value, min, max, step) {
|
|
|
259
181
|
return snappedValue;
|
|
260
182
|
}
|
|
261
183
|
|
|
262
|
-
function injectDocument() {
|
|
263
|
-
return inject(DOCUMENT);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
function elementSize({ elementRef, injector }) {
|
|
267
|
-
const destroyRef = injector.get(DestroyRef);
|
|
268
|
-
const result = signal({
|
|
269
|
-
width: elementRef.nativeElement.offsetWidth,
|
|
270
|
-
height: elementRef.nativeElement.offsetHeight
|
|
271
|
-
}, ...(ngDevMode ? [{ debugName: "result" }] : /* istanbul ignore next */ []));
|
|
272
|
-
afterNextRender(() => {
|
|
273
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
274
|
-
const entry = entries[0];
|
|
275
|
-
let width;
|
|
276
|
-
let height;
|
|
277
|
-
if ('borderBoxSize' in entry) {
|
|
278
|
-
const borderSizeEntry = entry['borderBoxSize'];
|
|
279
|
-
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
280
|
-
width = borderSize['inlineSize'];
|
|
281
|
-
height = borderSize['blockSize'];
|
|
282
|
-
}
|
|
283
|
-
else {
|
|
284
|
-
width = elementRef.nativeElement.offsetWidth;
|
|
285
|
-
height = elementRef.nativeElement.offsetHeight;
|
|
286
|
-
}
|
|
287
|
-
result.set({ width, height });
|
|
288
|
-
});
|
|
289
|
-
destroyRef.onDestroy(() => resizeObserver.disconnect());
|
|
290
|
-
}, { injector: injector });
|
|
291
|
-
return result.asReadonly();
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
class RdxFocusInitialDirective {
|
|
295
|
-
constructor() {
|
|
296
|
-
/** @ignore */
|
|
297
|
-
this.nativeElement = inject(ElementRef).nativeElement;
|
|
298
|
-
}
|
|
299
|
-
/** @ignore */
|
|
300
|
-
focus() {
|
|
301
|
-
this.nativeElement.focus();
|
|
302
|
-
}
|
|
303
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFocusInitialDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
304
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxFocusInitialDirective, isStandalone: true, selector: "[rdxFocusInitial]", ngImport: i0 }); }
|
|
305
|
-
}
|
|
306
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxFocusInitialDirective, decorators: [{
|
|
307
|
-
type: Directive,
|
|
308
|
-
args: [{
|
|
309
|
-
selector: '[rdxFocusInitial]'
|
|
310
|
-
}]
|
|
311
|
-
}] });
|
|
312
|
-
|
|
313
|
-
function getActiveElement() {
|
|
314
|
-
let activeElement = document.activeElement;
|
|
315
|
-
if (activeElement == null) {
|
|
316
|
-
return null;
|
|
317
|
-
}
|
|
318
|
-
while (activeElement != null &&
|
|
319
|
-
activeElement.shadowRoot != null &&
|
|
320
|
-
activeElement.shadowRoot.activeElement != null) {
|
|
321
|
-
activeElement = activeElement.shadowRoot.activeElement;
|
|
322
|
-
}
|
|
323
|
-
return activeElement;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* @license
|
|
328
|
-
* Copyright Google LLC All Rights Reserved.
|
|
329
|
-
*
|
|
330
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
331
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
332
|
-
*/
|
|
333
|
-
/**
|
|
334
|
-
* Keeps track of the ID count per prefix. This helps us make the IDs a bit more deterministic
|
|
335
|
-
* like they were before the service was introduced. Note that ideally we wouldn't have to do
|
|
336
|
-
* this, but there are some internal tests that rely on the IDs.
|
|
337
|
-
*/
|
|
338
|
-
const counters = {};
|
|
339
|
-
/** Service that generates unique IDs for DOM nodes. */
|
|
340
|
-
class _IdGenerator {
|
|
341
|
-
constructor() {
|
|
342
|
-
this._appId = inject(APP_ID);
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* Generates a unique ID with a specific prefix.
|
|
346
|
-
* @param prefix Prefix to add to the ID.
|
|
347
|
-
*/
|
|
348
|
-
getId(prefix) {
|
|
349
|
-
// Omit the app ID if it's the default `ng`. Since the vast majority of pages have one
|
|
350
|
-
// Angular app on them, we can reduce the amount of breakages by not adding it.
|
|
351
|
-
if (this._appId !== 'ng') {
|
|
352
|
-
prefix += this._appId;
|
|
353
|
-
}
|
|
354
|
-
if (!Object.prototype.hasOwnProperty.call(counters, prefix)) {
|
|
355
|
-
counters[prefix] = 0;
|
|
356
|
-
}
|
|
357
|
-
return `${prefix}${counters[prefix]++}`;
|
|
358
|
-
}
|
|
359
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: _IdGenerator, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
360
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: _IdGenerator, providedIn: 'root' }); }
|
|
361
|
-
}
|
|
362
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: _IdGenerator, decorators: [{
|
|
363
|
-
type: Injectable,
|
|
364
|
-
args: [{ providedIn: 'root' }]
|
|
365
|
-
}] });
|
|
366
|
-
|
|
367
|
-
function injectNgControl(params) {
|
|
368
|
-
const ngControl = inject(NgControl, { self: true, optional: true });
|
|
369
|
-
if (!params?.optional && !ngControl)
|
|
370
|
-
throw new Error('NgControl not found');
|
|
371
|
-
if (ngControl instanceof FormControlDirective ||
|
|
372
|
-
ngControl instanceof FormControlName ||
|
|
373
|
-
ngControl instanceof NgModel) {
|
|
374
|
-
return ngControl;
|
|
375
|
-
}
|
|
376
|
-
if (params?.optional) {
|
|
377
|
-
return undefined;
|
|
378
|
-
}
|
|
379
|
-
throw new Error('NgControl is not an instance of FormControlDirective, FormControlName or NgModel');
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
function injectIsClient() {
|
|
383
|
-
return inject(Platform).isBrowser;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
// Originally based on https://github.com/puleos/object-hash v3.0.0 (MIT)
|
|
387
|
-
/**
|
|
388
|
-
* Serializes any input value into a string for hashing.
|
|
389
|
-
*
|
|
390
|
-
* This method uses best efforts to generate stable serialized values.
|
|
391
|
-
* However, it is not designed for security purposes.
|
|
392
|
-
* Keep in mind that there is always a chance of intentional collisions caused by user input.
|
|
393
|
-
*
|
|
394
|
-
* @param input any value to serialize
|
|
395
|
-
* @return {string} serialized string value
|
|
396
|
-
*/
|
|
397
|
-
function serialize(input) {
|
|
398
|
-
if (typeof input === 'string') {
|
|
399
|
-
return `'${input}'`;
|
|
400
|
-
}
|
|
401
|
-
return new Serializer().serialize(input);
|
|
402
|
-
}
|
|
403
|
-
const Serializer = /*@__PURE__*/ (function () {
|
|
404
|
-
class Serializer {
|
|
405
|
-
#context = new Map();
|
|
406
|
-
compare(a, b) {
|
|
407
|
-
const typeA = typeof a;
|
|
408
|
-
const typeB = typeof b;
|
|
409
|
-
if (typeA === 'string' && typeB === 'string') {
|
|
410
|
-
return a.localeCompare(b);
|
|
411
|
-
}
|
|
412
|
-
if (typeA === 'number' && typeB === 'number') {
|
|
413
|
-
return a - b;
|
|
414
|
-
}
|
|
415
|
-
return String.prototype.localeCompare.call(this.serialize(a, true), this.serialize(b, true));
|
|
416
|
-
}
|
|
417
|
-
serialize(value, noQuotes) {
|
|
418
|
-
if (value === null) {
|
|
419
|
-
return 'null';
|
|
420
|
-
}
|
|
421
|
-
switch (typeof value) {
|
|
422
|
-
case 'string': {
|
|
423
|
-
return noQuotes ? value : `'${value}'`;
|
|
424
|
-
}
|
|
425
|
-
case 'bigint': {
|
|
426
|
-
return `${value}n`;
|
|
427
|
-
}
|
|
428
|
-
case 'object': {
|
|
429
|
-
return this.$object(value);
|
|
430
|
-
}
|
|
431
|
-
case 'function': {
|
|
432
|
-
return this.$function(value);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
return String(value);
|
|
436
|
-
}
|
|
437
|
-
serializeObject(object) {
|
|
438
|
-
const objString = Object.prototype.toString.call(object);
|
|
439
|
-
if (objString !== '[object Object]') {
|
|
440
|
-
return this.serializeBuiltInType(objString.length < 10 /* '[object a]'.length === 10, the minimum */
|
|
441
|
-
? `unknown:${objString}`
|
|
442
|
-
: objString.slice(8, -1) /* '[object '.length === 8 */, object);
|
|
443
|
-
}
|
|
444
|
-
const constructor = object.constructor;
|
|
445
|
-
const objName = constructor === Object || constructor === undefined ? '' : constructor.name;
|
|
446
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
447
|
-
// @ts-expect-error
|
|
448
|
-
if (objName !== '' && globalThis[objName] === constructor) {
|
|
449
|
-
return this.serializeBuiltInType(objName, object);
|
|
450
|
-
}
|
|
451
|
-
if ('toJSON' in object && typeof object.toJSON === 'function') {
|
|
452
|
-
const json = object.toJSON();
|
|
453
|
-
return (objName +
|
|
454
|
-
(json !== null && typeof json === 'object' ? this.$object(json) : `(${this.serialize(json)})`));
|
|
455
|
-
}
|
|
456
|
-
const keys = Object.keys(object).sort((a, b) => a.localeCompare(b));
|
|
457
|
-
let content = `${objName}{`;
|
|
458
|
-
for (let i = 0; i < keys.length; i++) {
|
|
459
|
-
const key = keys[i];
|
|
460
|
-
content += `${key}:${this.serialize(object[key])}`;
|
|
461
|
-
if (i < keys.length - 1) {
|
|
462
|
-
content += ',';
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
return content + '}';
|
|
466
|
-
}
|
|
467
|
-
serializeBuiltInType(type, object) {
|
|
468
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
469
|
-
// @ts-expect-error
|
|
470
|
-
const handler = this['$' + type];
|
|
471
|
-
if (handler) {
|
|
472
|
-
return handler.call(this, object);
|
|
473
|
-
}
|
|
474
|
-
if (typeof object.entries === 'function') {
|
|
475
|
-
return this.serializeObjectEntries(type, object.entries());
|
|
476
|
-
}
|
|
477
|
-
throw new Error(`Cannot serialize ${type}`);
|
|
478
|
-
}
|
|
479
|
-
serializeObjectEntries(type, entries) {
|
|
480
|
-
const sortedEntries = Array.from(entries).sort((a, b) => this.compare(a[0], b[0]));
|
|
481
|
-
let content = `${type}{`;
|
|
482
|
-
for (let i = 0; i < sortedEntries.length; i++) {
|
|
483
|
-
const [key, value] = sortedEntries[i];
|
|
484
|
-
content += `${this.serialize(key, true)}:${this.serialize(value)}`;
|
|
485
|
-
if (i < sortedEntries.length - 1) {
|
|
486
|
-
content += ',';
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
return content + '}';
|
|
490
|
-
}
|
|
491
|
-
$object(object) {
|
|
492
|
-
let content = this.#context.get(object);
|
|
493
|
-
if (content === undefined) {
|
|
494
|
-
this.#context.set(object, `#${this.#context.size}`);
|
|
495
|
-
content = this.serializeObject(object);
|
|
496
|
-
this.#context.set(object, content);
|
|
497
|
-
}
|
|
498
|
-
return content;
|
|
499
|
-
}
|
|
500
|
-
$function(fn) {
|
|
501
|
-
const fnStr = Function.prototype.toString.call(fn);
|
|
502
|
-
if (fnStr.slice(-15 /* "[native code] }".length */) === '[native code] }') {
|
|
503
|
-
return `${fn.name || ''}()[native]`;
|
|
504
|
-
}
|
|
505
|
-
return `${fn.name}(${fn.length})${fnStr.replace(/\s*\n\s*/g, '')}`;
|
|
506
|
-
}
|
|
507
|
-
$Array(arr) {
|
|
508
|
-
let content = '[';
|
|
509
|
-
for (let i = 0; i < arr.length; i++) {
|
|
510
|
-
content += this.serialize(arr[i]);
|
|
511
|
-
if (i < arr.length - 1) {
|
|
512
|
-
content += ',';
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
return content + ']';
|
|
516
|
-
}
|
|
517
|
-
$Date(date) {
|
|
518
|
-
try {
|
|
519
|
-
return `Date(${date.toISOString()})`;
|
|
520
|
-
}
|
|
521
|
-
catch {
|
|
522
|
-
return `Date(null)`;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
$ArrayBuffer(arr) {
|
|
526
|
-
return `ArrayBuffer[${new Uint8Array(arr).join(',')}]`;
|
|
527
|
-
}
|
|
528
|
-
$Set(set) {
|
|
529
|
-
return `Set${this.$Array(Array.from(set).sort((a, b) => this.compare(a, b)))}`;
|
|
530
|
-
}
|
|
531
|
-
$Map(map) {
|
|
532
|
-
return this.serializeObjectEntries('Map', map.entries());
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
for (const type of ['Error', 'RegExp', 'URL']) {
|
|
536
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
537
|
-
// @ts-expect-error
|
|
538
|
-
Serializer.prototype['$' + type] = function (val) {
|
|
539
|
-
return `${type}(${val})`;
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
for (const type of [
|
|
543
|
-
'Int8Array',
|
|
544
|
-
'Uint8Array',
|
|
545
|
-
'Uint8ClampedArray',
|
|
546
|
-
'Int16Array',
|
|
547
|
-
'Uint16Array',
|
|
548
|
-
'Int32Array',
|
|
549
|
-
'Uint32Array',
|
|
550
|
-
'Float32Array',
|
|
551
|
-
'Float64Array'
|
|
552
|
-
]) {
|
|
553
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
554
|
-
// @ts-expect-error
|
|
555
|
-
Serializer.prototype['$' + type] = function (arr) {
|
|
556
|
-
return `${type}[${arr.join(',')}]`;
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
for (const type of ['BigInt64Array', 'BigUint64Array']) {
|
|
560
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
561
|
-
// @ts-expect-error
|
|
562
|
-
Serializer.prototype['$' + type] = function (arr) {
|
|
563
|
-
return `${type}[${arr.join('n,')}${arr.length > 0 ? 'n' : ''}]`;
|
|
564
|
-
};
|
|
565
|
-
}
|
|
566
|
-
return Serializer;
|
|
567
|
-
})();
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* Compare two objects using reference equality and stable deep hashing.
|
|
571
|
-
* @param {any} object1 First object
|
|
572
|
-
* @param {any} object2 Second object
|
|
573
|
-
* @return {boolean} true if equal and false if not
|
|
574
|
-
*/
|
|
575
|
-
function isEqual(object1, object2) {
|
|
576
|
-
if (object1 === object2) {
|
|
577
|
-
return true;
|
|
578
|
-
}
|
|
579
|
-
if (serialize(object1) === serialize(object2)) {
|
|
580
|
-
return true;
|
|
581
|
-
}
|
|
582
|
-
return false;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
function isInsideForm(el) {
|
|
586
|
-
if (!el || !el.nativeElement) {
|
|
587
|
-
return true;
|
|
588
|
-
}
|
|
589
|
-
return Boolean(el.nativeElement.closest('form'));
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
function isNullish(value) {
|
|
593
|
-
return value === null || value === undefined;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
const isNumber = (v) => typeof v === 'number';
|
|
597
|
-
|
|
598
|
-
/**
|
|
599
|
-
* The function `isValueEqualOrExist` checks if a value is equal to or exists in another value or
|
|
600
|
-
* array.
|
|
601
|
-
* @param {T | T[] | undefined} base - It represents the base value that you want to compare with the `current` value.
|
|
602
|
-
* @param {T | T[] | undefined} current - The `current` parameter represents the current value that you want to compare with the `base` value or values.
|
|
603
|
-
* @returns The `isValueEqualOrExist` function returns a boolean value. It checks if the `base` value
|
|
604
|
-
* is equal to the `current` value or if the `current` value exists within the `base` value. The
|
|
605
|
-
* function handles cases where `base` can be a single value, an array of values, or undefined.
|
|
606
|
-
*/
|
|
607
|
-
function isValueEqualOrExist(base, current) {
|
|
608
|
-
if (isNullish(base))
|
|
609
|
-
return false;
|
|
610
|
-
if (Array.isArray(base)) {
|
|
611
|
-
return base.some((val) => isEqual(val, current));
|
|
612
|
-
}
|
|
613
|
-
else {
|
|
614
|
-
return isEqual(base, current);
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
const ALT = 'Alt';
|
|
619
|
-
const ARROW_DOWN = 'ArrowDown';
|
|
620
|
-
const ARROW_LEFT = 'ArrowLeft';
|
|
621
|
-
const ARROW_RIGHT = 'ArrowRight';
|
|
622
|
-
const ARROW_UP = 'ArrowUp';
|
|
623
|
-
const BACKSPACE = 'Backspace';
|
|
624
|
-
const CAPS_LOCK = 'CapsLock';
|
|
625
|
-
const CONTROL = 'Control';
|
|
626
|
-
const DELETE = 'Delete';
|
|
627
|
-
const END = 'End';
|
|
628
|
-
const ENTER = 'Enter';
|
|
629
|
-
const ESCAPE = 'Escape';
|
|
630
|
-
const F1 = 'F1';
|
|
631
|
-
const F10 = 'F10';
|
|
632
|
-
const F11 = 'F11';
|
|
633
|
-
const F12 = 'F12';
|
|
634
|
-
const F2 = 'F2';
|
|
635
|
-
const F3 = 'F3';
|
|
636
|
-
const F4 = 'F4';
|
|
637
|
-
const F5 = 'F5';
|
|
638
|
-
const F6 = 'F6';
|
|
639
|
-
const F7 = 'F7';
|
|
640
|
-
const F8 = 'F8';
|
|
641
|
-
const F9 = 'F9';
|
|
642
|
-
const HOME = 'Home';
|
|
643
|
-
const META = 'Meta';
|
|
644
|
-
const PAGE_DOWN = 'PageDown';
|
|
645
|
-
const PAGE_UP = 'PageUp';
|
|
646
|
-
const SHIFT = 'Shift';
|
|
647
|
-
const SPACE = ' ';
|
|
648
|
-
const TAB = 'Tab';
|
|
649
|
-
const CTRL = 'Control';
|
|
650
|
-
const ASTERISK = '*';
|
|
651
|
-
const a = 'a';
|
|
652
|
-
const P = 'P';
|
|
653
|
-
const A = 'A';
|
|
654
|
-
const p = 'p';
|
|
655
|
-
const n = 'n';
|
|
656
|
-
const j = 'j';
|
|
657
|
-
const k = 'k';
|
|
658
|
-
const SPACE_CODE = 'Space';
|
|
659
|
-
|
|
660
|
-
/**
|
|
661
|
-
* Creates an Angular provider that binds the given token to the existing instance
|
|
662
|
-
* of the specified class. This is especially useful when you want multiple
|
|
663
|
-
* tokens (or interfaces) to resolve to the same directive/component instance.
|
|
664
|
-
*
|
|
665
|
-
* @template T - The type associated with the injection token.
|
|
666
|
-
* @param token - The InjectionToken or abstract type you want to provide.
|
|
667
|
-
* @param type - The class type whose existing instance will be used for this token.
|
|
668
|
-
* @returns A Provider configuration object for Angular's DI system.
|
|
669
|
-
*
|
|
670
|
-
* @example
|
|
671
|
-
*
|
|
672
|
-
* @Directive({
|
|
673
|
-
* providers: [
|
|
674
|
-
* provideToken(RdxToggleGroupToken, RdxToggleGroupDirective),
|
|
675
|
-
* provideValueAccessor(RdxToggleGroupDirective)
|
|
676
|
-
* ]
|
|
677
|
-
* })
|
|
678
|
-
* export class RdxToggleGroupDirective {}
|
|
679
|
-
*/
|
|
680
|
-
function provideToken(token, type) {
|
|
681
|
-
return {
|
|
682
|
-
provide: token,
|
|
683
|
-
useExisting: forwardRef(() => type)
|
|
684
|
-
};
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
const WINDOW = new InjectionToken('An abstraction over global window object', {
|
|
688
|
-
factory: () => {
|
|
689
|
-
const { defaultView } = injectDocument();
|
|
690
|
-
if (!defaultView) {
|
|
691
|
-
throw new Error('Window is not available');
|
|
692
|
-
}
|
|
693
|
-
return defaultView;
|
|
694
|
-
}
|
|
695
|
-
});
|
|
696
|
-
function injectWindow() {
|
|
697
|
-
return inject(WINDOW);
|
|
698
|
-
}
|
|
699
|
-
|
|
700
184
|
// Thanks for idea.
|
|
701
185
|
// https://github.com/unovue/reka-ui/blob/v2/packages/core/src/shared/createContext.ts
|
|
702
186
|
/**
|
|
@@ -1486,25 +970,67 @@ function createContent(props) {
|
|
|
1486
970
|
};
|
|
1487
971
|
}
|
|
1488
972
|
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
973
|
+
const ALT = 'Alt';
|
|
974
|
+
const ARROW_DOWN = 'ArrowDown';
|
|
975
|
+
const ARROW_LEFT = 'ArrowLeft';
|
|
976
|
+
const ARROW_RIGHT = 'ArrowRight';
|
|
977
|
+
const ARROW_UP = 'ArrowUp';
|
|
978
|
+
const BACKSPACE = 'Backspace';
|
|
979
|
+
const CAPS_LOCK = 'CapsLock';
|
|
980
|
+
const CONTROL = 'Control';
|
|
981
|
+
const DELETE = 'Delete';
|
|
982
|
+
const END = 'End';
|
|
983
|
+
const ENTER = 'Enter';
|
|
984
|
+
const ESCAPE = 'Escape';
|
|
985
|
+
const F1 = 'F1';
|
|
986
|
+
const F10 = 'F10';
|
|
987
|
+
const F11 = 'F11';
|
|
988
|
+
const F12 = 'F12';
|
|
989
|
+
const F2 = 'F2';
|
|
990
|
+
const F3 = 'F3';
|
|
991
|
+
const F4 = 'F4';
|
|
992
|
+
const F5 = 'F5';
|
|
993
|
+
const F6 = 'F6';
|
|
994
|
+
const F7 = 'F7';
|
|
995
|
+
const F8 = 'F8';
|
|
996
|
+
const F9 = 'F9';
|
|
997
|
+
const HOME = 'Home';
|
|
998
|
+
const META = 'Meta';
|
|
999
|
+
const PAGE_DOWN = 'PageDown';
|
|
1000
|
+
const PAGE_UP = 'PageUp';
|
|
1001
|
+
const SHIFT = 'Shift';
|
|
1002
|
+
const SPACE = ' ';
|
|
1003
|
+
const TAB = 'Tab';
|
|
1004
|
+
const CTRL = 'Control';
|
|
1005
|
+
const ASTERISK = '*';
|
|
1006
|
+
const a = 'a';
|
|
1007
|
+
const P = 'P';
|
|
1008
|
+
const A = 'A';
|
|
1009
|
+
const p = 'p';
|
|
1010
|
+
const n = 'n';
|
|
1011
|
+
const j = 'j';
|
|
1012
|
+
const k = 'k';
|
|
1013
|
+
const SPACE_CODE = 'Space';
|
|
1014
|
+
|
|
1015
|
+
function isSegmentNavigationKey(key) {
|
|
1016
|
+
if (key === ARROW_RIGHT || key === ARROW_LEFT)
|
|
1017
|
+
return true;
|
|
1018
|
+
return false;
|
|
1019
|
+
}
|
|
1020
|
+
function isNumberString(value) {
|
|
1021
|
+
if (Number.isNaN(Number.parseInt(value)))
|
|
1022
|
+
return false;
|
|
1023
|
+
return true;
|
|
1024
|
+
}
|
|
1025
|
+
function isAcceptableSegmentKey(key) {
|
|
1026
|
+
const acceptableSegmentKeys = [
|
|
1027
|
+
ENTER,
|
|
1028
|
+
ARROW_UP,
|
|
1029
|
+
ARROW_DOWN,
|
|
1030
|
+
ARROW_LEFT,
|
|
1031
|
+
ARROW_RIGHT,
|
|
1032
|
+
BACKSPACE,
|
|
1033
|
+
SPACE,
|
|
1508
1034
|
'a',
|
|
1509
1035
|
'A',
|
|
1510
1036
|
'p',
|
|
@@ -2297,219 +1823,353 @@ function handleAndDispatchCustomEvent(name, handler, detail) {
|
|
|
2297
1823
|
target.dispatchEvent(event);
|
|
2298
1824
|
}
|
|
2299
1825
|
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
(
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
1826
|
+
/**
|
|
1827
|
+
* Per-prefix counters, kept module-global so generated IDs stay deterministic within a run.
|
|
1828
|
+
* Determinism keeps server and client renders in sync, which matters for hydration.
|
|
1829
|
+
*/
|
|
1830
|
+
const counters = new Map();
|
|
1831
|
+
/**
|
|
1832
|
+
* Generates unique, SSR-stable IDs for DOM nodes.
|
|
1833
|
+
*
|
|
1834
|
+
* IDs are deterministic per prefix (a monotonic counter) so the server and the client produce the
|
|
1835
|
+
* same sequence and hydration does not mismatch. The application's `APP_ID` is folded into the
|
|
1836
|
+
* prefix so multiple Angular apps on one page don't collide; the default `ng` app id is omitted to
|
|
1837
|
+
* keep IDs short for the common single-app case.
|
|
1838
|
+
*
|
|
1839
|
+
* Prefer the {@link injectId} hook at call sites; inject this service directly only when you need to
|
|
1840
|
+
* generate IDs lazily outside an injection context.
|
|
1841
|
+
*/
|
|
1842
|
+
class RdxIdGenerator {
|
|
1843
|
+
constructor() {
|
|
1844
|
+
this.appId = inject(APP_ID);
|
|
1845
|
+
}
|
|
1846
|
+
/** Generates a unique ID with the given prefix. */
|
|
1847
|
+
getId(prefix) {
|
|
1848
|
+
const key = this.appId === 'ng' ? prefix : prefix + this.appId;
|
|
1849
|
+
const next = counters.get(key) ?? 0;
|
|
1850
|
+
counters.set(key, next + 1);
|
|
1851
|
+
return `${key}${next}`;
|
|
1852
|
+
}
|
|
1853
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxIdGenerator, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1854
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxIdGenerator, providedIn: 'root' }); }
|
|
1855
|
+
}
|
|
1856
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxIdGenerator, decorators: [{
|
|
1857
|
+
type: Injectable,
|
|
1858
|
+
args: [{ providedIn: 'root' }]
|
|
1859
|
+
}] });
|
|
1860
|
+
/**
|
|
1861
|
+
* Returns a unique, SSR-stable ID for the given prefix — the Angular counterpart of React's
|
|
1862
|
+
* `useId`. Must be called in an injection context (e.g. a field initializer or constructor).
|
|
1863
|
+
*
|
|
1864
|
+
* @example
|
|
1865
|
+
* readonly contentId = injectId('rdx-dialog-content-');
|
|
1866
|
+
*/
|
|
1867
|
+
function injectId(prefix) {
|
|
1868
|
+
return inject(RdxIdGenerator).getId(prefix);
|
|
1869
|
+
}
|
|
2313
1870
|
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
1871
|
+
/**
|
|
1872
|
+
* Announces messages to screen readers through an `aria-live` region, without moving focus.
|
|
1873
|
+
*
|
|
1874
|
+
* Own replacement for CDK's `LiveAnnouncer` — lazily appends a visually hidden live region to
|
|
1875
|
+
* the document body and writes messages into it. No-op on the server.
|
|
1876
|
+
*/
|
|
1877
|
+
class RdxLiveAnnouncer {
|
|
1878
|
+
constructor() {
|
|
1879
|
+
this.document = inject(DOCUMENT);
|
|
1880
|
+
this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
1881
|
+
this.liveElement = null;
|
|
1882
|
+
inject(DestroyRef).onDestroy(() => {
|
|
1883
|
+
clearTimeout(this.previousTimeout);
|
|
1884
|
+
this.liveElement?.remove();
|
|
1885
|
+
this.liveElement = null;
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* Announces a message to screen readers.
|
|
1890
|
+
*
|
|
1891
|
+
* @param message The message to announce.
|
|
1892
|
+
* @param politeness The politeness of the announcer element (defaults to `'polite'`).
|
|
1893
|
+
* @param duration If provided, the message is cleared after this many milliseconds.
|
|
1894
|
+
*/
|
|
1895
|
+
announce(message, politeness = 'polite', duration) {
|
|
1896
|
+
if (!this.isBrowser) {
|
|
1897
|
+
return;
|
|
2333
1898
|
}
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
1899
|
+
const liveElement = this.getLiveElement();
|
|
1900
|
+
clearTimeout(this.previousTimeout);
|
|
1901
|
+
liveElement.setAttribute('aria-live', politeness);
|
|
1902
|
+
// Clear the live element first, then set the message after a tick so that screen
|
|
1903
|
+
// readers reliably pick up the change even when the text is identical.
|
|
1904
|
+
liveElement.textContent = '';
|
|
1905
|
+
this.previousTimeout = setTimeout(() => {
|
|
1906
|
+
liveElement.textContent = message;
|
|
1907
|
+
if (typeof duration === 'number') {
|
|
1908
|
+
this.previousTimeout = setTimeout(() => (liveElement.textContent = ''), duration);
|
|
1909
|
+
}
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1912
|
+
/** Clears the current announcement. */
|
|
1913
|
+
clear() {
|
|
1914
|
+
if (this.liveElement) {
|
|
1915
|
+
this.liveElement.textContent = '';
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
getLiveElement() {
|
|
1919
|
+
if (this.liveElement) {
|
|
1920
|
+
return this.liveElement;
|
|
1921
|
+
}
|
|
1922
|
+
const element = this.document.createElement('div');
|
|
1923
|
+
element.classList.add('rdx-live-announcer');
|
|
1924
|
+
element.setAttribute('aria-atomic', 'true');
|
|
1925
|
+
element.setAttribute('aria-live', 'polite');
|
|
1926
|
+
// Visually hide the region while keeping it available to assistive technology.
|
|
1927
|
+
element.style.position = 'absolute';
|
|
1928
|
+
element.style.width = '1px';
|
|
1929
|
+
element.style.height = '1px';
|
|
1930
|
+
element.style.margin = '-1px';
|
|
1931
|
+
element.style.padding = '0';
|
|
1932
|
+
element.style.border = '0';
|
|
1933
|
+
element.style.overflow = 'hidden';
|
|
1934
|
+
element.style.clip = 'rect(0 0 0 0)';
|
|
1935
|
+
element.style.clipPath = 'inset(100%)';
|
|
1936
|
+
element.style.whiteSpace = 'nowrap';
|
|
1937
|
+
this.document.body.appendChild(element);
|
|
1938
|
+
this.liveElement = element;
|
|
1939
|
+
return element;
|
|
1940
|
+
}
|
|
1941
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxLiveAnnouncer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1942
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxLiveAnnouncer, providedIn: 'root' }); }
|
|
1943
|
+
}
|
|
1944
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxLiveAnnouncer, decorators: [{
|
|
1945
|
+
type: Injectable,
|
|
1946
|
+
args: [{ providedIn: 'root' }]
|
|
1947
|
+
}], ctorParameters: () => [] });
|
|
1948
|
+
|
|
1949
|
+
/** Narrows to `null | undefined`. */
|
|
1950
|
+
function isNullish(value) {
|
|
1951
|
+
return value === null || value === undefined;
|
|
1952
|
+
}
|
|
1953
|
+
/**
|
|
1954
|
+
* Structural equality for the value shapes a primitive can hold: primitives (incl. `NaN`), arrays,
|
|
1955
|
+
* plain objects, and the common built-ins `Date`, `RegExp`, `Map`, and `Set`. Reference cycles are
|
|
1956
|
+
* handled. Other opaque objects (e.g. class instances with no own enumerable properties) fall back
|
|
1957
|
+
* to per-key comparison and so only match when they expose equal enumerable state.
|
|
1958
|
+
*/
|
|
1959
|
+
function isEqual(a, b) {
|
|
1960
|
+
return equals(a, b, new WeakMap());
|
|
1961
|
+
}
|
|
1962
|
+
function equals(a, b, seen) {
|
|
1963
|
+
if (a === b) {
|
|
1964
|
+
return true;
|
|
1965
|
+
}
|
|
1966
|
+
// NaN is the one primitive that is not reference-equal to itself.
|
|
1967
|
+
if (typeof a === 'number' && typeof b === 'number') {
|
|
1968
|
+
return Number.isNaN(a) && Number.isNaN(b);
|
|
1969
|
+
}
|
|
1970
|
+
if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') {
|
|
1971
|
+
return false;
|
|
1972
|
+
}
|
|
1973
|
+
// Different prototypes (Date vs plain object, class A vs class B, …) are never structurally equal.
|
|
1974
|
+
if (Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) {
|
|
1975
|
+
return false;
|
|
1976
|
+
}
|
|
1977
|
+
// Break reference cycles: if this exact pair is already being compared on the current path,
|
|
1978
|
+
// the structure has matched so far — treat it as equal. Cleared on ascent so sibling branches
|
|
1979
|
+
// start fresh.
|
|
1980
|
+
if (seen.get(a) === b) {
|
|
1981
|
+
return true;
|
|
1982
|
+
}
|
|
1983
|
+
seen.set(a, b);
|
|
1984
|
+
try {
|
|
1985
|
+
if (a instanceof Date) {
|
|
1986
|
+
return a.getTime() === b.getTime();
|
|
2353
1987
|
}
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
[RdxPositionAlign.Center]: {
|
|
2357
|
-
originX: 'center',
|
|
2358
|
-
originY: 'bottom',
|
|
2359
|
-
overlayX: 'center',
|
|
2360
|
-
overlayY: 'top'
|
|
2361
|
-
},
|
|
2362
|
-
[RdxPositionAlign.Start]: {
|
|
2363
|
-
originX: 'start',
|
|
2364
|
-
originY: 'bottom',
|
|
2365
|
-
overlayX: 'start',
|
|
2366
|
-
overlayY: 'top'
|
|
2367
|
-
},
|
|
2368
|
-
[RdxPositionAlign.End]: {
|
|
2369
|
-
originX: 'end',
|
|
2370
|
-
originY: 'bottom',
|
|
2371
|
-
overlayX: 'end',
|
|
2372
|
-
overlayY: 'top'
|
|
1988
|
+
if (a instanceof RegExp) {
|
|
1989
|
+
return a.source === b.source && a.flags === b.flags;
|
|
2373
1990
|
}
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
[RdxPositionAlign.Center]: {
|
|
2377
|
-
originX: 'start',
|
|
2378
|
-
originY: 'center',
|
|
2379
|
-
overlayX: 'end',
|
|
2380
|
-
overlayY: 'center'
|
|
2381
|
-
},
|
|
2382
|
-
[RdxPositionAlign.Start]: {
|
|
2383
|
-
originX: 'start',
|
|
2384
|
-
originY: 'top',
|
|
2385
|
-
overlayX: 'end',
|
|
2386
|
-
overlayY: 'top'
|
|
2387
|
-
},
|
|
2388
|
-
[RdxPositionAlign.End]: {
|
|
2389
|
-
originX: 'start',
|
|
2390
|
-
originY: 'bottom',
|
|
2391
|
-
overlayX: 'end',
|
|
2392
|
-
overlayY: 'bottom'
|
|
1991
|
+
if (Array.isArray(a)) {
|
|
1992
|
+
return a.length === b.length && a.every((item, index) => equals(item, b[index], seen));
|
|
2393
1993
|
}
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
offsets: {
|
|
2398
|
-
side: 4,
|
|
2399
|
-
align: 0
|
|
2400
|
-
},
|
|
2401
|
-
arrow: {
|
|
2402
|
-
width: 8,
|
|
2403
|
-
height: 6
|
|
2404
|
-
}
|
|
2405
|
-
};
|
|
2406
|
-
|
|
2407
|
-
function getContentPosition(sideAndAlignWithOffsets) {
|
|
2408
|
-
const { side, align, sideOffset, alignOffset } = sideAndAlignWithOffsets;
|
|
2409
|
-
const position = {
|
|
2410
|
-
...(RDX_POSITIONS[side]?.[align] ?? RDX_POSITIONS[RdxPositionSide.Top][RdxPositionAlign.Center])
|
|
2411
|
-
};
|
|
2412
|
-
if (sideOffset || alignOffset) {
|
|
2413
|
-
if ([RdxPositionSide.Top, RdxPositionSide.Bottom].includes(side)) {
|
|
2414
|
-
if (sideOffset) {
|
|
2415
|
-
position.offsetY = side === RdxPositionSide.Top ? -sideOffset : sideOffset;
|
|
1994
|
+
if (a instanceof Map) {
|
|
1995
|
+
if (a.size !== b.size) {
|
|
1996
|
+
return false;
|
|
2416
1997
|
}
|
|
2417
|
-
|
|
2418
|
-
|
|
1998
|
+
for (const [key, value] of a) {
|
|
1999
|
+
if (!b.has(key) || !equals(value, b.get(key), seen)) {
|
|
2000
|
+
return false;
|
|
2001
|
+
}
|
|
2419
2002
|
}
|
|
2003
|
+
return true;
|
|
2420
2004
|
}
|
|
2421
|
-
|
|
2422
|
-
if (
|
|
2423
|
-
|
|
2005
|
+
if (a instanceof Set) {
|
|
2006
|
+
if (a.size !== b.size) {
|
|
2007
|
+
return false;
|
|
2424
2008
|
}
|
|
2425
|
-
|
|
2426
|
-
|
|
2009
|
+
for (const value of a) {
|
|
2010
|
+
if (!b.has(value)) {
|
|
2011
|
+
return false;
|
|
2012
|
+
}
|
|
2427
2013
|
}
|
|
2014
|
+
return true;
|
|
2428
2015
|
}
|
|
2016
|
+
const keys = Object.keys(a);
|
|
2017
|
+
if (keys.length !== Object.keys(b).length) {
|
|
2018
|
+
return false;
|
|
2019
|
+
}
|
|
2020
|
+
return keys.every((key) => Object.prototype.hasOwnProperty.call(b, key) && equals(a[key], b[key], seen));
|
|
2429
2021
|
}
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
let allPossibleConnectedPositions;
|
|
2433
|
-
function getAllPossibleConnectedPositions() {
|
|
2434
|
-
if (!allPossibleConnectedPositions) {
|
|
2435
|
-
allPossibleConnectedPositions = new Map();
|
|
2022
|
+
finally {
|
|
2023
|
+
seen.delete(a);
|
|
2436
2024
|
}
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
/**
|
|
2028
|
+
* Creates an Angular provider that binds the given token to the existing instance
|
|
2029
|
+
* of the specified class. This is especially useful when you want multiple
|
|
2030
|
+
* tokens (or interfaces) to resolve to the same directive/component instance.
|
|
2031
|
+
*
|
|
2032
|
+
* @template T - The type associated with the injection token.
|
|
2033
|
+
* @param token - The InjectionToken or abstract type you want to provide.
|
|
2034
|
+
* @param type - The class type whose existing instance will be used for this token.
|
|
2035
|
+
* @returns A Provider configuration object for Angular's DI system.
|
|
2036
|
+
*
|
|
2037
|
+
* @example
|
|
2038
|
+
*
|
|
2039
|
+
* @Directive({
|
|
2040
|
+
* providers: [
|
|
2041
|
+
* provideToken(RdxFooToken, RdxFooDirective),
|
|
2042
|
+
* provideValueAccessor(RdxFooDirective)
|
|
2043
|
+
* ]
|
|
2044
|
+
* })
|
|
2045
|
+
* export class RdxFooDirective {}
|
|
2046
|
+
*/
|
|
2047
|
+
function provideToken(token, type) {
|
|
2048
|
+
return {
|
|
2049
|
+
provide: token,
|
|
2050
|
+
useExisting: forwardRef(() => type)
|
|
2051
|
+
};
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
function injectDocument() {
|
|
2055
|
+
return inject(DOCUMENT);
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
function elementSize({ elementRef, injector }) {
|
|
2059
|
+
const destroyRef = injector.get(DestroyRef);
|
|
2060
|
+
const result = signal({
|
|
2061
|
+
width: elementRef.nativeElement.offsetWidth,
|
|
2062
|
+
height: elementRef.nativeElement.offsetHeight
|
|
2063
|
+
}, ...(ngDevMode ? [{ debugName: "result" }] : /* istanbul ignore next */ []));
|
|
2064
|
+
afterNextRender(() => {
|
|
2065
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
2066
|
+
const entry = entries[0];
|
|
2067
|
+
let width;
|
|
2068
|
+
let height;
|
|
2069
|
+
if ('borderBoxSize' in entry) {
|
|
2070
|
+
const borderSizeEntry = entry['borderBoxSize'];
|
|
2071
|
+
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
2072
|
+
width = borderSize['inlineSize'];
|
|
2073
|
+
height = borderSize['blockSize'];
|
|
2441
2074
|
}
|
|
2442
|
-
|
|
2075
|
+
else {
|
|
2076
|
+
width = elementRef.nativeElement.offsetWidth;
|
|
2077
|
+
height = elementRef.nativeElement.offsetHeight;
|
|
2078
|
+
}
|
|
2079
|
+
result.set({ width, height });
|
|
2080
|
+
});
|
|
2081
|
+
destroyRef.onDestroy(() => resizeObserver.disconnect());
|
|
2082
|
+
}, { injector: injector });
|
|
2083
|
+
return result.asReadonly();
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
function getActiveElement() {
|
|
2087
|
+
let activeElement = document.activeElement;
|
|
2088
|
+
if (activeElement == null) {
|
|
2089
|
+
return null;
|
|
2443
2090
|
}
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
let sideAndAlign;
|
|
2449
|
-
allPossibleConnectedPositions.forEach((value, key) => {
|
|
2450
|
-
if (position.originX === value.originX &&
|
|
2451
|
-
position.originY === value.originY &&
|
|
2452
|
-
position.overlayX === value.overlayX &&
|
|
2453
|
-
position.overlayY === value.overlayY) {
|
|
2454
|
-
const sideAndAlignArray = key.split('|');
|
|
2455
|
-
sideAndAlign = {
|
|
2456
|
-
side: sideAndAlignArray[0],
|
|
2457
|
-
align: sideAndAlignArray[1]
|
|
2458
|
-
};
|
|
2459
|
-
}
|
|
2460
|
-
});
|
|
2461
|
-
if (!sideAndAlign) {
|
|
2462
|
-
throw Error(`[Rdx positioning] cannot infer both side and align from the given position (${JSON.stringify(position)})`);
|
|
2091
|
+
while (activeElement != null &&
|
|
2092
|
+
activeElement.shadowRoot != null &&
|
|
2093
|
+
activeElement.shadowRoot.activeElement != null) {
|
|
2094
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
2463
2095
|
}
|
|
2464
|
-
return
|
|
2096
|
+
return activeElement;
|
|
2465
2097
|
}
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2098
|
+
|
|
2099
|
+
/**
|
|
2100
|
+
* Creates a resize observer effect for element
|
|
2101
|
+
*
|
|
2102
|
+
* @param options Configuration options
|
|
2103
|
+
* @param options.injector Angular injector
|
|
2104
|
+
* @param options.element Signal returning the element to observe
|
|
2105
|
+
* @param options.onResize Callback when element is resized
|
|
2106
|
+
* @returns EffectRef that can be destroyed when needed
|
|
2107
|
+
*/
|
|
2108
|
+
function resizeEffect(options) {
|
|
2109
|
+
return effect((onCleanup) => {
|
|
2110
|
+
const elementOrRef = options.element();
|
|
2111
|
+
if (!elementOrRef)
|
|
2112
|
+
return;
|
|
2113
|
+
// Extract native element from ElementRef or use directly if it's HTMLElement
|
|
2114
|
+
const element = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;
|
|
2115
|
+
const resizeObserver = new ResizeObserver(options.onResize);
|
|
2116
|
+
resizeObserver.observe(element);
|
|
2117
|
+
onCleanup(() => resizeObserver.disconnect());
|
|
2118
|
+
}, { injector: options.injector });
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
/**
|
|
2122
|
+
* Process-wide ownership of `document.body`'s overflow while one or more overlays lock scrolling.
|
|
2123
|
+
*
|
|
2124
|
+
* A single shared counter across every primitive that locks scroll is essential: with separate
|
|
2125
|
+
* per-primitive counters, a popover and a dialog open at the same time would each capture the
|
|
2126
|
+
* other's already-locked `overflow: hidden` as the "original" value and restore it on close,
|
|
2127
|
+
* leaving the page permanently unscrollable.
|
|
2128
|
+
*/
|
|
2129
|
+
let originalBodyOverflow = null;
|
|
2130
|
+
let scrollLockCount = 0;
|
|
2131
|
+
/**
|
|
2132
|
+
* Locks `document.body` scrolling while `active()` is `true`, and restores the original overflow
|
|
2133
|
+
* when it becomes `false` or the calling context is destroyed.
|
|
2134
|
+
*
|
|
2135
|
+
* Lock ownership is shared across all callers via a single module-level counter, so nested or
|
|
2136
|
+
* concurrent overlays compose correctly. Must be called in an injection context.
|
|
2137
|
+
*/
|
|
2138
|
+
function useScrollLock(active) {
|
|
2139
|
+
const document = inject(DOCUMENT$1);
|
|
2140
|
+
let isLocked = false;
|
|
2141
|
+
const lock = () => {
|
|
2142
|
+
if (isLocked) {
|
|
2143
|
+
return;
|
|
2480
2144
|
}
|
|
2481
|
-
|
|
2482
|
-
|
|
2145
|
+
const body = document.body;
|
|
2146
|
+
if (scrollLockCount === 0) {
|
|
2147
|
+
originalBodyOverflow = body.style.overflow;
|
|
2148
|
+
body.style.overflow = 'hidden';
|
|
2483
2149
|
}
|
|
2484
|
-
|
|
2485
|
-
|
|
2150
|
+
scrollLockCount++;
|
|
2151
|
+
isLocked = true;
|
|
2152
|
+
};
|
|
2153
|
+
const unlock = () => {
|
|
2154
|
+
if (!isLocked) {
|
|
2155
|
+
return;
|
|
2486
2156
|
}
|
|
2487
|
-
|
|
2488
|
-
|
|
2157
|
+
scrollLockCount--;
|
|
2158
|
+
isLocked = false;
|
|
2159
|
+
if (scrollLockCount === 0 && originalBodyOverflow !== null) {
|
|
2160
|
+
document.body.style.overflow = originalBodyOverflow;
|
|
2161
|
+
originalBodyOverflow = null;
|
|
2489
2162
|
}
|
|
2490
|
-
}
|
|
2491
|
-
|
|
2492
|
-
if (
|
|
2493
|
-
|
|
2494
|
-
posParams.transform = `rotate(-90deg)`;
|
|
2495
|
-
posParams.transformOrigin = 'top right 0px';
|
|
2163
|
+
};
|
|
2164
|
+
effect(() => {
|
|
2165
|
+
if (active()) {
|
|
2166
|
+
lock();
|
|
2496
2167
|
}
|
|
2497
2168
|
else {
|
|
2498
|
-
|
|
2499
|
-
posParams.transform = `rotate(90deg)`;
|
|
2500
|
-
posParams.transformOrigin = 'top left 0px';
|
|
2501
|
-
}
|
|
2502
|
-
if (sideAndAlign.align === RdxPositionAlign.Start) {
|
|
2503
|
-
posParams.top = `${(triggerWidthAndHeight.height - arrowWidthAndHeight.width) / 2}px`;
|
|
2504
|
-
}
|
|
2505
|
-
else if (sideAndAlign.align === RdxPositionAlign.Center) {
|
|
2506
|
-
posParams.top = `calc(50% - ${arrowWidthAndHeight.width / 2}px)`;
|
|
2507
|
-
}
|
|
2508
|
-
else if (sideAndAlign.align === RdxPositionAlign.End) {
|
|
2509
|
-
posParams.top = `calc(100% - ${(triggerWidthAndHeight.height + arrowWidthAndHeight.width) / 2}px)`;
|
|
2169
|
+
unlock();
|
|
2510
2170
|
}
|
|
2511
|
-
}
|
|
2512
|
-
|
|
2171
|
+
});
|
|
2172
|
+
inject(DestroyRef).onDestroy(unlock);
|
|
2513
2173
|
}
|
|
2514
2174
|
|
|
2515
2175
|
// made by https://reka-ui.com/
|
|
@@ -2596,26 +2256,343 @@ function findNextFocusableElement(elements, currentElement, options, iterations
|
|
|
2596
2256
|
return candidate;
|
|
2597
2257
|
}
|
|
2598
2258
|
|
|
2259
|
+
const graceAreaContainers = new WeakMap();
|
|
2260
|
+
function createSignalEvent() {
|
|
2261
|
+
const handlers = new Set();
|
|
2262
|
+
return {
|
|
2263
|
+
on(callback) {
|
|
2264
|
+
handlers.add(callback);
|
|
2265
|
+
return () => handlers.delete(callback);
|
|
2266
|
+
},
|
|
2267
|
+
emitVoid() {
|
|
2268
|
+
handlers.forEach((handler) => handler(undefined));
|
|
2269
|
+
}
|
|
2270
|
+
};
|
|
2271
|
+
}
|
|
2599
2272
|
/**
|
|
2600
|
-
*
|
|
2273
|
+
* Keeps hover content open while the pointer crosses the gap between a trigger and a popup.
|
|
2274
|
+
*/
|
|
2275
|
+
function useGraceArea(triggerEl, containerEl, resetMs = 300) {
|
|
2276
|
+
const isPointerInTransit = signal(false, ...(ngDevMode ? [{ debugName: "isPointerInTransit" }] : /* istanbul ignore next */ []));
|
|
2277
|
+
const pointerExit = createSignalEvent();
|
|
2278
|
+
let pointerGraceArea = null;
|
|
2279
|
+
let resetTimer = null;
|
|
2280
|
+
function armInTransitAutoReset() {
|
|
2281
|
+
if (resetTimer !== null)
|
|
2282
|
+
window.clearTimeout(resetTimer);
|
|
2283
|
+
resetTimer = window.setTimeout(() => {
|
|
2284
|
+
isPointerInTransit.set(false);
|
|
2285
|
+
resetTimer = null;
|
|
2286
|
+
}, resetMs);
|
|
2287
|
+
}
|
|
2288
|
+
function clearGraceArea() {
|
|
2289
|
+
pointerGraceArea = null;
|
|
2290
|
+
isPointerInTransit.set(false);
|
|
2291
|
+
if (resetTimer !== null) {
|
|
2292
|
+
window.clearTimeout(resetTimer);
|
|
2293
|
+
resetTimer = null;
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
function createGraceArea(event, hoverTarget) {
|
|
2297
|
+
const currentTarget = event.currentTarget;
|
|
2298
|
+
const exitPoint = { x: event.clientX, y: event.clientY };
|
|
2299
|
+
const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());
|
|
2300
|
+
const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);
|
|
2301
|
+
const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());
|
|
2302
|
+
pointerGraceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]);
|
|
2303
|
+
isPointerInTransit.set(true);
|
|
2304
|
+
armInTransitAutoReset();
|
|
2305
|
+
}
|
|
2306
|
+
function trackPointerGrace(event) {
|
|
2307
|
+
if (!pointerGraceArea || !(event.target instanceof HTMLElement))
|
|
2308
|
+
return;
|
|
2309
|
+
const trigger = triggerEl();
|
|
2310
|
+
const container = containerEl();
|
|
2311
|
+
if (!trigger || !container)
|
|
2312
|
+
return;
|
|
2313
|
+
const target = event.target;
|
|
2314
|
+
const pointerPosition = { x: event.clientX, y: event.clientY };
|
|
2315
|
+
const enteredContainer = target.closest('[data-grace-area-container]');
|
|
2316
|
+
const nestedTrigger = enteredContainer ? graceAreaContainers.get(enteredContainer) : undefined;
|
|
2317
|
+
const hasEnteredTarget = trigger.contains(target) ||
|
|
2318
|
+
container.contains(target) ||
|
|
2319
|
+
(nestedTrigger ? container.contains(nestedTrigger) : false);
|
|
2320
|
+
const isOutsideGrace = !isPointInPolygon(pointerPosition, pointerGraceArea);
|
|
2321
|
+
const isAnotherGraceAreaTrigger = !!target.closest('[data-grace-area-trigger]');
|
|
2322
|
+
if (hasEnteredTarget) {
|
|
2323
|
+
clearGraceArea();
|
|
2324
|
+
}
|
|
2325
|
+
else if (isOutsideGrace || isAnotherGraceAreaTrigger) {
|
|
2326
|
+
clearGraceArea();
|
|
2327
|
+
pointerExit.emitVoid();
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
effect((onCleanup) => {
|
|
2331
|
+
const trigger = triggerEl();
|
|
2332
|
+
const container = containerEl();
|
|
2333
|
+
const onTriggerLeave = (event) => {
|
|
2334
|
+
if (container)
|
|
2335
|
+
createGraceArea(event, container);
|
|
2336
|
+
};
|
|
2337
|
+
const onContainerLeave = (event) => {
|
|
2338
|
+
if (trigger)
|
|
2339
|
+
createGraceArea(event, trigger);
|
|
2340
|
+
};
|
|
2341
|
+
onCleanup(() => {
|
|
2342
|
+
const doc = trigger?.ownerDocument;
|
|
2343
|
+
trigger?.removeEventListener('pointerleave', onTriggerLeave);
|
|
2344
|
+
container?.removeEventListener('pointerleave', onContainerLeave);
|
|
2345
|
+
doc?.removeEventListener('pointermove', trackPointerGrace);
|
|
2346
|
+
trigger?.removeAttribute('data-grace-area-trigger');
|
|
2347
|
+
container?.removeAttribute('data-grace-area-container');
|
|
2348
|
+
if (container && graceAreaContainers.get(container) === trigger) {
|
|
2349
|
+
graceAreaContainers.delete(container);
|
|
2350
|
+
}
|
|
2351
|
+
clearGraceArea();
|
|
2352
|
+
});
|
|
2353
|
+
if (!trigger || !container)
|
|
2354
|
+
return;
|
|
2355
|
+
trigger.setAttribute('data-grace-area-trigger', '');
|
|
2356
|
+
container.setAttribute('data-grace-area-container', '');
|
|
2357
|
+
graceAreaContainers.set(container, trigger);
|
|
2358
|
+
trigger.addEventListener('pointerleave', onTriggerLeave, { passive: true });
|
|
2359
|
+
container.addEventListener('pointerleave', onContainerLeave, { passive: true });
|
|
2360
|
+
trigger.ownerDocument.addEventListener('pointermove', trackPointerGrace, { passive: true });
|
|
2361
|
+
});
|
|
2362
|
+
return {
|
|
2363
|
+
isPointerInTransit: isPointerInTransit.asReadonly(),
|
|
2364
|
+
onPointerExit: pointerExit.on
|
|
2365
|
+
};
|
|
2366
|
+
}
|
|
2367
|
+
function getExitSideFromRect(point, rect) {
|
|
2368
|
+
const top = Math.abs(rect.top - point.y);
|
|
2369
|
+
const bottom = Math.abs(rect.bottom - point.y);
|
|
2370
|
+
const right = Math.abs(rect.right - point.x);
|
|
2371
|
+
const left = Math.abs(rect.left - point.x);
|
|
2372
|
+
const min = Math.min(top, bottom, right, left);
|
|
2373
|
+
if (!Number.isFinite(min)) {
|
|
2374
|
+
return 'bottom';
|
|
2375
|
+
}
|
|
2376
|
+
switch (min) {
|
|
2377
|
+
case left:
|
|
2378
|
+
return 'left';
|
|
2379
|
+
case right:
|
|
2380
|
+
return 'right';
|
|
2381
|
+
case top:
|
|
2382
|
+
return 'top';
|
|
2383
|
+
case bottom:
|
|
2384
|
+
return 'bottom';
|
|
2385
|
+
default:
|
|
2386
|
+
throw new Error('unreachable');
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
function getPaddedExitPoints(exitPoint, exitSide, padding = 5) {
|
|
2390
|
+
const points = [];
|
|
2391
|
+
switch (exitSide) {
|
|
2392
|
+
case 'top':
|
|
2393
|
+
points.push({ x: exitPoint.x - padding, y: exitPoint.y + padding }, { x: exitPoint.x + padding, y: exitPoint.y + padding });
|
|
2394
|
+
break;
|
|
2395
|
+
case 'bottom':
|
|
2396
|
+
points.push({ x: exitPoint.x - padding, y: exitPoint.y - padding }, { x: exitPoint.x + padding, y: exitPoint.y - padding });
|
|
2397
|
+
break;
|
|
2398
|
+
case 'left':
|
|
2399
|
+
points.push({ x: exitPoint.x + padding, y: exitPoint.y - padding }, { x: exitPoint.x + padding, y: exitPoint.y + padding });
|
|
2400
|
+
break;
|
|
2401
|
+
case 'right':
|
|
2402
|
+
points.push({ x: exitPoint.x - padding, y: exitPoint.y - padding }, { x: exitPoint.x - padding, y: exitPoint.y + padding });
|
|
2403
|
+
break;
|
|
2404
|
+
}
|
|
2405
|
+
return points;
|
|
2406
|
+
}
|
|
2407
|
+
function getPointsFromRect(rect) {
|
|
2408
|
+
const { top, right, bottom, left } = rect;
|
|
2409
|
+
return [
|
|
2410
|
+
{ x: left, y: top },
|
|
2411
|
+
{ x: right, y: top },
|
|
2412
|
+
{ x: right, y: bottom },
|
|
2413
|
+
{ x: left, y: bottom }
|
|
2414
|
+
];
|
|
2415
|
+
}
|
|
2416
|
+
function isPointInPolygon(point, polygon) {
|
|
2417
|
+
const { x, y } = point;
|
|
2418
|
+
let inside = false;
|
|
2419
|
+
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
2420
|
+
const xi = polygon[i].x;
|
|
2421
|
+
const yi = polygon[i].y;
|
|
2422
|
+
const xj = polygon[j].x;
|
|
2423
|
+
const yj = polygon[j].y;
|
|
2424
|
+
const intersect = yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi;
|
|
2425
|
+
if (intersect)
|
|
2426
|
+
inside = !inside;
|
|
2427
|
+
}
|
|
2428
|
+
return inside;
|
|
2429
|
+
}
|
|
2430
|
+
function getHull(points) {
|
|
2431
|
+
const sortedPoints = points.slice();
|
|
2432
|
+
sortedPoints.sort((a, b) => a.x - b.x || a.y - b.y);
|
|
2433
|
+
return getHullPresorted(sortedPoints);
|
|
2434
|
+
}
|
|
2435
|
+
function getHullPresorted(points) {
|
|
2436
|
+
if (points.length <= 1)
|
|
2437
|
+
return points.slice();
|
|
2438
|
+
const upper = [];
|
|
2439
|
+
for (const point of points) {
|
|
2440
|
+
while (upper.length >= 2) {
|
|
2441
|
+
const q = upper[upper.length - 1];
|
|
2442
|
+
const r = upper[upper.length - 2];
|
|
2443
|
+
if ((q.x - r.x) * (point.y - r.y) >= (q.y - r.y) * (point.x - r.x))
|
|
2444
|
+
upper.pop();
|
|
2445
|
+
else
|
|
2446
|
+
break;
|
|
2447
|
+
}
|
|
2448
|
+
upper.push(point);
|
|
2449
|
+
}
|
|
2450
|
+
upper.pop();
|
|
2451
|
+
const lower = [];
|
|
2452
|
+
for (let index = points.length - 1; index >= 0; index--) {
|
|
2453
|
+
const point = points[index];
|
|
2454
|
+
while (lower.length >= 2) {
|
|
2455
|
+
const q = lower[lower.length - 1];
|
|
2456
|
+
const r = lower[lower.length - 2];
|
|
2457
|
+
if ((q.x - r.x) * (point.y - r.y) >= (q.y - r.y) * (point.x - r.x))
|
|
2458
|
+
lower.pop();
|
|
2459
|
+
else
|
|
2460
|
+
break;
|
|
2461
|
+
}
|
|
2462
|
+
lower.push(point);
|
|
2463
|
+
}
|
|
2464
|
+
lower.pop();
|
|
2465
|
+
if (upper.length === 1 && lower.length === 1 && upper[0].x === lower[0].x && upper[0].y === lower[0].y) {
|
|
2466
|
+
return upper;
|
|
2467
|
+
}
|
|
2468
|
+
return upper.concat(lower);
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
/**
|
|
2472
|
+
* Grace period (ms) added to an element's declared transition duration before the
|
|
2473
|
+
* safety-net timer force-completes a transition. Only matters when the real
|
|
2474
|
+
* `animationend`/`transitionend` never arrives (interrupted, replaced without a
|
|
2475
|
+
* cancel event, reduced motion, …).
|
|
2476
|
+
*/
|
|
2477
|
+
const TRANSITION_FALLBACK_BUFFER = 50;
|
|
2478
|
+
/**
|
|
2479
|
+
* Shared open/close transition state machine used by overlay primitives (dialog, popover, …).
|
|
2601
2480
|
*
|
|
2602
|
-
*
|
|
2603
|
-
*
|
|
2604
|
-
*
|
|
2605
|
-
*
|
|
2606
|
-
*
|
|
2481
|
+
* On `start(open)` it flips `status` to `'starting'`/`'ending'`, then — after the next render and
|
|
2482
|
+
* (for opening) one animation frame — clears it and waits for the registered element's running CSS
|
|
2483
|
+
* animations/transitions to finish (via the Web Animations API) before invoking `onComplete(open)`.
|
|
2484
|
+
* Completing on the real `animationend` rather than a duration timer keeps it from firing a frame
|
|
2485
|
+
* late. A duration-based timer remains as a safety net, and if no element is registered or it has no
|
|
2486
|
+
* animation (also SSR / jsdom, where computed durations are `0`) completion is synchronous.
|
|
2487
|
+
*
|
|
2488
|
+
* Must be called in an injection context (uses {@link Injector} and {@link DestroyRef}).
|
|
2607
2489
|
*/
|
|
2608
|
-
function
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2490
|
+
function useTransitionStatus(onComplete) {
|
|
2491
|
+
const injector = inject(Injector);
|
|
2492
|
+
const destroyRef = inject(DestroyRef);
|
|
2493
|
+
const status = signal(undefined, ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
2494
|
+
let element;
|
|
2495
|
+
let timer;
|
|
2496
|
+
let frame;
|
|
2497
|
+
let version = 0;
|
|
2498
|
+
const clearTimers = () => {
|
|
2499
|
+
if (frame !== undefined) {
|
|
2500
|
+
cancelAnimationFrame(frame);
|
|
2501
|
+
frame = undefined;
|
|
2502
|
+
}
|
|
2503
|
+
if (timer !== undefined) {
|
|
2504
|
+
clearTimeout(timer);
|
|
2505
|
+
timer = undefined;
|
|
2506
|
+
}
|
|
2507
|
+
};
|
|
2508
|
+
const complete = (open, currentVersion) => {
|
|
2509
|
+
if (currentVersion !== version) {
|
|
2612
2510
|
return;
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2511
|
+
}
|
|
2512
|
+
clearTimers();
|
|
2513
|
+
status.set(undefined);
|
|
2514
|
+
if (!destroyRef.destroyed) {
|
|
2515
|
+
onComplete(open);
|
|
2516
|
+
}
|
|
2517
|
+
};
|
|
2518
|
+
const waitForTransition = (open, currentVersion) => {
|
|
2519
|
+
const node = element;
|
|
2520
|
+
const duration = node ? getMaxTransitionDuration(node) : 0;
|
|
2521
|
+
// Nothing animating (also the SSR / jsdom path, where computed durations are
|
|
2522
|
+
// 0): settle synchronously, exactly as before.
|
|
2523
|
+
if (!node || duration === 0) {
|
|
2524
|
+
complete(open, currentVersion);
|
|
2525
|
+
return;
|
|
2526
|
+
}
|
|
2527
|
+
// Prefer the Web Animations API so completion lands on the real
|
|
2528
|
+
// `animationend` / `transitionend` instead of a timer that can fire a frame
|
|
2529
|
+
// late — that lateness is what let a closing collapsible flash back to its
|
|
2530
|
+
// natural size before `hidden` was applied.
|
|
2531
|
+
const animations = typeof node.getAnimations === 'function' ? node.getAnimations() : [];
|
|
2532
|
+
// Safety net: if an animation never settles (interrupted, replaced without a
|
|
2533
|
+
// cancel event, reduced motion, or simply not exposed by the engine yet)
|
|
2534
|
+
// still complete shortly after the declared duration.
|
|
2535
|
+
timer = setTimeout(() => complete(open, currentVersion), duration + TRANSITION_FALLBACK_BUFFER);
|
|
2536
|
+
if (animations.length === 0) {
|
|
2537
|
+
return;
|
|
2538
|
+
}
|
|
2539
|
+
// A cancelled animation rejects `finished`; swallow it so reopening (which
|
|
2540
|
+
// cancels the in-flight animation) still resolves and settles.
|
|
2541
|
+
void Promise.all(animations.map((animation) => animation.finished.catch(() => undefined))).then(() => complete(open, currentVersion));
|
|
2542
|
+
};
|
|
2543
|
+
destroyRef.onDestroy(clearTimers);
|
|
2544
|
+
return {
|
|
2545
|
+
status: status.asReadonly(),
|
|
2546
|
+
registerElement: (registered) => {
|
|
2547
|
+
element = registered;
|
|
2548
|
+
return () => {
|
|
2549
|
+
if (element === registered) {
|
|
2550
|
+
element = undefined;
|
|
2551
|
+
}
|
|
2552
|
+
};
|
|
2553
|
+
},
|
|
2554
|
+
start: (open) => {
|
|
2555
|
+
const currentVersion = ++version;
|
|
2556
|
+
clearTimers();
|
|
2557
|
+
status.set(open ? 'starting' : 'ending');
|
|
2558
|
+
afterNextRender(() => {
|
|
2559
|
+
if (destroyRef.destroyed || currentVersion !== version) {
|
|
2560
|
+
return;
|
|
2561
|
+
}
|
|
2562
|
+
if (open) {
|
|
2563
|
+
frame = requestAnimationFrame(() => {
|
|
2564
|
+
frame = undefined;
|
|
2565
|
+
if (destroyRef.destroyed || currentVersion !== version) {
|
|
2566
|
+
return;
|
|
2567
|
+
}
|
|
2568
|
+
status.set(undefined);
|
|
2569
|
+
waitForTransition(open, currentVersion);
|
|
2570
|
+
});
|
|
2571
|
+
}
|
|
2572
|
+
else {
|
|
2573
|
+
waitForTransition(open, currentVersion);
|
|
2574
|
+
}
|
|
2575
|
+
}, { injector });
|
|
2576
|
+
}
|
|
2577
|
+
};
|
|
2578
|
+
}
|
|
2579
|
+
/** Longest of an element's CSS transition / animation durations (including delays), in milliseconds. */
|
|
2580
|
+
function getMaxTransitionDuration(element) {
|
|
2581
|
+
const styles = getComputedStyle(element);
|
|
2582
|
+
return Math.max(getMaxCssDuration(styles.transitionDuration, styles.transitionDelay), getMaxCssDuration(styles.animationDuration, styles.animationDelay));
|
|
2583
|
+
}
|
|
2584
|
+
function getMaxCssDuration(durations, delays) {
|
|
2585
|
+
const parsedDurations = durations.split(',').map(parseCssTime);
|
|
2586
|
+
const parsedDelays = delays.split(',').map(parseCssTime);
|
|
2587
|
+
return parsedDurations.reduce((max, duration, index) => Math.max(max, duration + parsedDelays[index % parsedDelays.length]), 0);
|
|
2588
|
+
}
|
|
2589
|
+
function parseCssTime(value) {
|
|
2590
|
+
const trimmed = value.trim();
|
|
2591
|
+
const parsed = Number.parseFloat(trimmed);
|
|
2592
|
+
if (!Number.isFinite(parsed)) {
|
|
2593
|
+
return 0;
|
|
2594
|
+
}
|
|
2595
|
+
return trimmed.endsWith('ms') ? parsed : parsed * 1000;
|
|
2619
2596
|
}
|
|
2620
2597
|
|
|
2621
2598
|
// https://ngxtension.netlify.app/utilities/signals/explicit-effect/
|
|
@@ -2655,9 +2632,23 @@ function watch(deps, fn, options) {
|
|
|
2655
2632
|
}, options);
|
|
2656
2633
|
}
|
|
2657
2634
|
|
|
2635
|
+
var RdxPositionSide;
|
|
2636
|
+
(function (RdxPositionSide) {
|
|
2637
|
+
RdxPositionSide["Top"] = "top";
|
|
2638
|
+
RdxPositionSide["Right"] = "right";
|
|
2639
|
+
RdxPositionSide["Bottom"] = "bottom";
|
|
2640
|
+
RdxPositionSide["Left"] = "left";
|
|
2641
|
+
})(RdxPositionSide || (RdxPositionSide = {}));
|
|
2642
|
+
var RdxPositionAlign;
|
|
2643
|
+
(function (RdxPositionAlign) {
|
|
2644
|
+
RdxPositionAlign["Start"] = "start";
|
|
2645
|
+
RdxPositionAlign["Center"] = "center";
|
|
2646
|
+
RdxPositionAlign["End"] = "end";
|
|
2647
|
+
})(RdxPositionAlign || (RdxPositionAlign = {}));
|
|
2648
|
+
|
|
2658
2649
|
/**
|
|
2659
2650
|
* Generated bundle index. Do not edit.
|
|
2660
2651
|
*/
|
|
2661
2652
|
|
|
2662
|
-
export { A, ALT, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ASTERISK, BACKSPACE, CAPS_LOCK, CONTROL, CTRL, DELETE, END, ENTER, ESCAPE, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, HOME, META, P, PAGE_DOWN, PAGE_UP,
|
|
2653
|
+
export { A, ALT, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ASTERISK, BACKSPACE, CAPS_LOCK, CONTROL, CTRL, DELETE, END, ENTER, ESCAPE, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, HOME, META, P, PAGE_DOWN, PAGE_UP, RdxControlValueAccessor, RdxIdGenerator, RdxLiveAnnouncer, RdxPositionAlign, RdxPositionSide, SHIFT, SPACE, SPACE_CODE, TAB, a, areAllDaysBetweenValid, clamp, createContent, createContext, createFormatter, createMonth, createMonths, elementSize, getActiveElement, getDaysBetween, getDaysInMonth, getDefaultDate, getDefaultTime, getLastFirstDayOfWeek, getMaxTransitionDuration, getNextLastDayOfWeek, getOptsByGranularity, getPlaceholder, getSegmentElements, getWeekNumber, handleAndDispatchCustomEvent, handleCalendarInitialFocus, hasTime, initializeSegmentValues, injectControlValueAccessor, injectDocument, injectId, isAcceptableSegmentKey, isAfter, isAfterOrSame, isBefore, isBeforeOrSame, isBetween, isBetweenInclusive, isCalendarDateTime, isEqual, isNullish, isNumberString, isSegmentNavigationKey, isZonedDateTime, j, k, n, normalizeDateStep, normalizeHour12, normalizeHourCycle, p, provideToken, provideValueAccessor, resizeEffect, roundToStepPrecision, segmentBuilders, snapValueToStep, syncSegmentValues, syncTimeSegmentValues, toDate, useArrowNavigation, useDateField, useGraceArea, useScrollLock, useTransitionStatus, watch };
|
|
2663
2654
|
//# sourceMappingURL=radix-ng-primitives-core.mjs.map
|