@radix-ng/primitives 0.33.2 → 0.35.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.
Files changed (48) hide show
  1. package/calendar/src/calendar-root.directive.d.ts +3 -3
  2. package/core/index.d.ts +1 -0
  3. package/core/src/accessor/provide-value-accessor.d.ts +1 -1
  4. package/core/src/date-time/index.d.ts +3 -0
  5. package/core/src/date-time/parser.d.ts +37 -0
  6. package/core/src/date-time/parts.d.ts +12 -0
  7. package/core/src/date-time/segment.d.ts +4 -0
  8. package/core/src/date-time/types.d.ts +18 -1
  9. package/core/src/date-time/useDateField.d.ts +141 -0
  10. package/core/src/date-time/utils.d.ts +3 -0
  11. package/core/src/provide-token.d.ts +22 -0
  12. package/date-field/README.md +1 -0
  13. package/date-field/index.d.ts +2 -0
  14. package/date-field/src/date-field-context.token.d.ts +18 -0
  15. package/date-field/src/date-field-input.directive.d.ts +53 -0
  16. package/date-field/src/date-field-root.directive.d.ts +126 -0
  17. package/dialog/src/dialog-ref.d.ts +3 -0
  18. package/dialog/src/dialog.config.d.ts +1 -0
  19. package/fesm2022/radix-ng-primitives-calendar.mjs +6 -15
  20. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  21. package/fesm2022/radix-ng-primitives-checkbox.mjs +3 -4
  22. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  23. package/fesm2022/radix-ng-primitives-core.mjs +1014 -8
  24. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  25. package/fesm2022/radix-ng-primitives-date-field.mjs +320 -0
  26. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -0
  27. package/fesm2022/radix-ng-primitives-dialog.mjs +54 -4
  28. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  29. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +0 -2
  30. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  31. package/fesm2022/radix-ng-primitives-progress.mjs +3 -3
  32. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  33. package/fesm2022/radix-ng-primitives-radio.mjs +7 -7
  34. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  35. package/fesm2022/radix-ng-primitives-switch.mjs +7 -15
  36. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  37. package/fesm2022/radix-ng-primitives-tabs.mjs +3 -6
  38. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  39. package/fesm2022/radix-ng-primitives-toggle-group.mjs +8 -10
  40. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  41. package/fesm2022/radix-ng-primitives-toggle.mjs +5 -12
  42. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  43. package/hover-card/src/hover-card-root.directive.d.ts +4 -4
  44. package/package.json +5 -1
  45. package/popover/src/popover-root.directive.d.ts +4 -4
  46. package/switch/src/switch-root.directive.d.ts +0 -1
  47. package/toggle/src/toggle.directive.d.ts +0 -1
  48. package/tooltip/src/tooltip-root.directive.d.ts +4 -4
@@ -0,0 +1,320 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, inject, input, computed, signal, effect, Directive, ElementRef, model, booleanAttribute } from '@angular/core';
3
+ import { useDateField, getDefaultDate, hasTime, isBefore, createContent, watch, isNullish, createFormatter, initializeSegmentValues, syncSegmentValues, getSegmentElements, ARROW_LEFT, ARROW_RIGHT, isSegmentNavigationKey, provideToken } from '@radix-ng/primitives/core';
4
+
5
+ const DATE_FIELDS_ROOT_CONTEXT = new InjectionToken('DATE_FIELDS_ROOT_CONTEXT');
6
+ function injectDateFieldsRootContext() {
7
+ return inject(DATE_FIELDS_ROOT_CONTEXT);
8
+ }
9
+
10
+ class RdxDateFieldInputDirective {
11
+ constructor(el) {
12
+ this.el = el;
13
+ this.rootContext = injectDateFieldsRootContext();
14
+ /**
15
+ * The part of the date to render
16
+ * `'day' | 'month' | 'year' | 'hour' | 'minute' | 'second' | 'dayPeriod' | 'literal' | 'timeZoneName'`
17
+ */
18
+ this.part = input();
19
+ /**
20
+ * @ignore
21
+ */
22
+ this.disabled = computed(() => this.rootContext.disabled());
23
+ /**
24
+ * @ignore
25
+ */
26
+ this.readonly = computed(() => this.rootContext.readonly());
27
+ /**
28
+ * @ignore
29
+ */
30
+ this.isInvalid = computed(() => this.rootContext.isInvalid());
31
+ /**
32
+ * @ignore
33
+ */
34
+ this.hasLeftFocus = signal(true);
35
+ /**
36
+ * @ignore
37
+ */
38
+ this.lastKeyZero = signal(false);
39
+ this.fieldData = computed(() => {
40
+ return useDateField({
41
+ hasLeftFocus: this.hasLeftFocus,
42
+ lastKeyZero: this.lastKeyZero,
43
+ placeholder: this.rootContext.placeholder,
44
+ hourCycle: this.rootContext.hourCycle(),
45
+ segmentValues: this.rootContext.segmentValues,
46
+ formatter: this.rootContext.formatter,
47
+ part: this.part(),
48
+ disabled: this.rootContext.disabled,
49
+ readonly: this.rootContext.readonly,
50
+ modelValue: this.rootContext.value,
51
+ focusNext: this.rootContext.focusNext
52
+ });
53
+ });
54
+ this.attributes = computed(() => this.fieldData().attributes());
55
+ effect(() => {
56
+ const { handleSegmentClick, handleSegmentKeydown } = this.fieldData();
57
+ this.handleSegmentKeydown = handleSegmentKeydown;
58
+ this.handleSegmentClick = handleSegmentClick;
59
+ });
60
+ effect(() => {
61
+ const attrs = this.attributes();
62
+ Object.entries(attrs).forEach(([attr, value]) => {
63
+ this.el.nativeElement.setAttribute(attr, String(value));
64
+ });
65
+ });
66
+ }
67
+ /**
68
+ * @ignore
69
+ */
70
+ onFocus(e) {
71
+ this.rootContext.setFocusedElement(e.target);
72
+ }
73
+ /**
74
+ * @ignore
75
+ */
76
+ onFocusOut() {
77
+ this.hasLeftFocus.set(true);
78
+ }
79
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxDateFieldInputDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
80
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxDateFieldInputDirective, isStandalone: true, selector: "[rdxDateFieldInput]", inputs: { part: { classPropertyName: "part", publicName: "part", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "part() !== \"literal\" && handleSegmentClick($event)", "keydown": "part() !== \"literal\" && handleSegmentKeydown($event)", "focus": "part() !== \"literal\" && onFocus($event)", "focusout": "part() !== \"literal\" && onFocusOut()" }, properties: { "attr.contenteditable": "disabled() || readonly() ? false : part() !== \"literal\"", "attr.data-rdx-date-field-segment": "part()", "attr.aria-disabled": "disabled() ? \"\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-invalid": "isInvalid() ? \"\" : undefined", "attr.aria-invalid": "isInvalid() ? true : undefined" } }, ngImport: i0 }); }
81
+ }
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxDateFieldInputDirective, decorators: [{
83
+ type: Directive,
84
+ args: [{
85
+ selector: '[rdxDateFieldInput]',
86
+ host: {
87
+ '[attr.contenteditable]': 'disabled() || readonly() ? false : part() !== "literal"',
88
+ '[attr.data-rdx-date-field-segment]': 'part()',
89
+ '[attr.aria-disabled]': 'disabled() ? "" : undefined',
90
+ '[attr.data-disabled]': 'disabled() ? "" : undefined',
91
+ '[attr.data-invalid]': 'isInvalid() ? "" : undefined',
92
+ '[attr.aria-invalid]': 'isInvalid() ? true : undefined',
93
+ '(mousedown)': 'part() !== "literal" && handleSegmentClick($event)',
94
+ '(keydown)': 'part() !== "literal" && handleSegmentKeydown($event)',
95
+ '(focus)': 'part() !== "literal" && onFocus($event)',
96
+ '(focusout)': 'part() !== "literal" && onFocusOut()'
97
+ }
98
+ }]
99
+ }], ctorParameters: () => [{ type: i0.ElementRef }] });
100
+
101
+ class RdxDateFieldRootDirective {
102
+ constructor() {
103
+ this.elementRef = inject((ElementRef));
104
+ /**
105
+ * The controlled checked state of the calendar.
106
+ */
107
+ this.value = model();
108
+ /**
109
+ * A callback fired when the date field's value is invalid.
110
+ */
111
+ this.isDateUnavailable = input(undefined);
112
+ /**
113
+ * The hour cycle to use for formatting times. Defaults to the locale preference
114
+ */
115
+ this.hourCycle = input();
116
+ /**
117
+ * The granularity to use for formatting the field. Defaults to 'day' if a CalendarDate is provided, otherwise defaults to 'minute'.
118
+ * The field will render segments for each part of the date up to and including the specified granularity.
119
+ */
120
+ this.granularity = input();
121
+ /**
122
+ * The locale to use for formatting dates.
123
+ */
124
+ this.locale = input('en');
125
+ this.dir = input('ltr');
126
+ /**
127
+ * The minimum valid date that can be entered.
128
+ */
129
+ this.minValue = input();
130
+ /**
131
+ * The maximum valid date that can be entered.
132
+ */
133
+ this.maxValue = input();
134
+ /**
135
+ * Whether or not to hide the time zone segment of the field.
136
+ */
137
+ this.hideTimeZone = input(false, { transform: booleanAttribute });
138
+ this.disabled = input(false, { transform: booleanAttribute });
139
+ /**
140
+ * Whether or not the field is readonly.
141
+ */
142
+ this.readonly = input(false, { transform: booleanAttribute });
143
+ /**
144
+ * @ignore
145
+ */
146
+ this.defaultDate = computed(() => getDefaultDate({
147
+ defaultPlaceholder: undefined,
148
+ granularity: this.granularity(),
149
+ defaultValue: this.value(),
150
+ locale: this.locale()
151
+ }));
152
+ /**
153
+ * 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
154
+ */
155
+ this.placeholder = model(this.defaultDate().copy());
156
+ // Internal state
157
+ /**
158
+ * @ignore
159
+ */
160
+ this.segmentElements = signal(new Set());
161
+ /**
162
+ * @ignore
163
+ */
164
+ this.currentFocusedElement = signal(null);
165
+ /**
166
+ * @ignore
167
+ */
168
+ this.segmentValues = signal({
169
+ year: null,
170
+ month: null,
171
+ day: null,
172
+ hour: null,
173
+ minute: null,
174
+ second: null,
175
+ dayPeriod: null
176
+ });
177
+ /**
178
+ * @ignore
179
+ */
180
+ this.inferredGranularity = computed(() => {
181
+ const placeholder = this.placeholder();
182
+ if (this.granularity())
183
+ return placeholder && !hasTime(placeholder) ? 'day' : this.granularity();
184
+ return placeholder && hasTime(placeholder) ? 'minute' : 'day';
185
+ });
186
+ /**
187
+ * @ignore
188
+ */
189
+ this.isInvalid = computed(() => {
190
+ if (!this.value())
191
+ return false;
192
+ if (this.isDateUnavailable()?.(this.value()))
193
+ return true;
194
+ if (this.minValue() && isBefore(this.value(), this.minValue()))
195
+ return true;
196
+ if (this.maxValue() && isBefore(this.maxValue(), this.value()))
197
+ return true;
198
+ return false;
199
+ });
200
+ /**
201
+ * @ignore
202
+ */
203
+ this.allSegmentContent = computed(() => createContent({
204
+ granularity: this.inferredGranularity(),
205
+ dateRef: this.placeholder(),
206
+ formatter: this.formatter,
207
+ hideTimeZone: this.hideTimeZone(),
208
+ hourCycle: this.hourCycle(),
209
+ segmentValues: this.segmentValues(),
210
+ locale: this.locale
211
+ }));
212
+ /**
213
+ * An array of segments that should be readonly, which prevent user input on them.
214
+ */
215
+ this.segmentContents = computed(() => this.allSegmentContent().arr);
216
+ /**
217
+ * @ignore
218
+ */
219
+ this.currentSegmentIndex = computed(() => Array.from(this.segmentElements()).findIndex((el) => el.getAttribute('data-rdx-date-field-segment') ===
220
+ this.currentFocusedElement()?.getAttribute('data-rdx-date-field-segment')));
221
+ /**
222
+ * @ignore
223
+ */
224
+ this.prevFocusableSegment = computed(() => {
225
+ const sign = this.dir() === 'rtl' ? -1 : 1;
226
+ const prevCondition = sign > 0 ? this.currentSegmentIndex() < 0 : this.currentSegmentIndex() > this.segmentElements().size - 1;
227
+ if (prevCondition)
228
+ return null;
229
+ const segmentToFocus = Array.from(this.segmentElements())[this.currentSegmentIndex() - sign];
230
+ return segmentToFocus;
231
+ });
232
+ /**
233
+ * @ignore
234
+ */
235
+ this.nextFocusableSegment = computed(() => {
236
+ const sign = this.dir() === 'rtl' ? -1 : 1;
237
+ const nextCondition = sign < 0 ? this.currentSegmentIndex() < 0 : this.currentSegmentIndex() > this.segmentElements().size - 1;
238
+ if (nextCondition)
239
+ return null;
240
+ const segmentToFocus = Array.from(this.segmentElements())[this.currentSegmentIndex() + sign];
241
+ return segmentToFocus;
242
+ });
243
+ /**
244
+ * @ignore
245
+ */
246
+ this.focusNext = () => {
247
+ this.nextFocusableSegment()?.focus();
248
+ };
249
+ watch([this.value], ([modelValue]) => {
250
+ if (!isNullish(modelValue) && this.placeholder()?.compare(modelValue) !== 0) {
251
+ this.placeholder.set(modelValue.copy());
252
+ }
253
+ });
254
+ }
255
+ ngOnInit() {
256
+ const defDate = getDefaultDate({
257
+ defaultPlaceholder: undefined,
258
+ granularity: this.granularity(),
259
+ defaultValue: this.value(),
260
+ locale: this.locale()
261
+ });
262
+ this.placeholder.set(defDate.copy());
263
+ this.formatter = createFormatter(this.locale());
264
+ const initialSegments = initializeSegmentValues(this.inferredGranularity());
265
+ this.segmentValues.set(this.value()
266
+ ? { ...syncSegmentValues({ value: this.value(), formatter: this.formatter }) }
267
+ : { ...initialSegments });
268
+ }
269
+ ngAfterViewInit() {
270
+ getSegmentElements(this.elementRef.nativeElement).forEach((item) => this.segmentElements().add(item));
271
+ }
272
+ /**
273
+ * @ignore
274
+ */
275
+ onKeydown(event) {
276
+ const code = event.code;
277
+ if ([ARROW_LEFT, ARROW_RIGHT].includes(code)) {
278
+ if (!isSegmentNavigationKey(event.key))
279
+ return;
280
+ if (code === ARROW_LEFT) {
281
+ this.prevFocusableSegment()?.focus();
282
+ }
283
+ if (code === ARROW_RIGHT) {
284
+ this.nextFocusableSegment()?.focus();
285
+ }
286
+ }
287
+ }
288
+ /**
289
+ * @ignore
290
+ */
291
+ setFocusedElement(el) {
292
+ this.currentFocusedElement.set(el);
293
+ }
294
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxDateFieldRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
295
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxDateFieldRootDirective, isStandalone: true, selector: "[rdxDateFieldRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, isDateUnavailable: { classPropertyName: "isDateUnavailable", publicName: "isDateUnavailable", isSignal: true, isRequired: false, transformFunction: null }, hourCycle: { classPropertyName: "hourCycle", publicName: "hourCycle", isSignal: true, isRequired: false, transformFunction: null }, granularity: { classPropertyName: "granularity", publicName: "granularity", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, hideTimeZone: { classPropertyName: "hideTimeZone", publicName: "hideTimeZone", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", placeholder: "placeholderChange" }, host: { attributes: { "role": "group" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.aria-disabled": "disabled() ? \"\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined", "attr.data-invalid": "isInvalid() ? \"\" : undefined", "attr.dir": "dir()" } }, providers: [provideToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)], exportAs: ["rdxDateFieldRoot"], ngImport: i0 }); }
296
+ }
297
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxDateFieldRootDirective, decorators: [{
298
+ type: Directive,
299
+ args: [{
300
+ selector: '[rdxDateFieldRoot]',
301
+ exportAs: 'rdxDateFieldRoot',
302
+ providers: [provideToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)],
303
+ host: {
304
+ role: 'group',
305
+ '[attr.aria-disabled]': 'disabled() ? "" : undefined',
306
+ '[attr.data-disabled]': 'disabled() ? "" : undefined',
307
+ '[attr.data-readonly]': 'readonly() ? "" : undefined',
308
+ '[attr.data-invalid]': 'isInvalid() ? "" : undefined',
309
+ '[attr.dir]': 'dir()',
310
+ '(keydown)': 'onKeydown($event)'
311
+ }
312
+ }]
313
+ }], ctorParameters: () => [] });
314
+
315
+ /**
316
+ * Generated bundle index. Do not edit.
317
+ */
318
+
319
+ export { RdxDateFieldInputDirective, RdxDateFieldRootDirective };
320
+ //# sourceMappingURL=radix-ng-primitives-date-field.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radix-ng-primitives-date-field.mjs","sources":["../../../packages/primitives/date-field/src/date-field-context.token.ts","../../../packages/primitives/date-field/src/date-field-input.directive.ts","../../../packages/primitives/date-field/src/date-field-root.directive.ts","../../../packages/primitives/date-field/radix-ng-primitives-date-field.ts"],"sourcesContent":["import { inject, InjectionToken, InputSignal, ModelSignal, Signal, WritableSignal } from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport { Formatter, HourCycle, SegmentValueObj } from '@radix-ng/primitives/core';\n\nexport interface DateFieldContextToken {\n locale: InputSignal<string>;\n value: ModelSignal<DateValue | undefined>;\n disabled: InputSignal<boolean>;\n readonly: InputSignal<boolean>;\n isInvalid: Signal<boolean>;\n placeholder: ModelSignal<DateValue>;\n hourCycle: InputSignal<HourCycle>;\n formatter: Formatter;\n segmentValues: WritableSignal<SegmentValueObj>;\n focusNext: () => void;\n setFocusedElement: (el: HTMLElement) => void;\n}\n\nexport const DATE_FIELDS_ROOT_CONTEXT = new InjectionToken<DateFieldContextToken>('DATE_FIELDS_ROOT_CONTEXT');\n\nexport function injectDateFieldsRootContext(): DateFieldContextToken {\n return inject(DATE_FIELDS_ROOT_CONTEXT);\n}\n","import { computed, Directive, effect, ElementRef, input, signal } from '@angular/core';\nimport { SegmentPart, useDateField } from '@radix-ng/primitives/core';\nimport { injectDateFieldsRootContext } from './date-field-context.token';\n\n@Directive({\n selector: '[rdxDateFieldInput]',\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 RdxDateFieldInputDirective {\n private readonly rootContext = injectDateFieldsRootContext();\n\n /**\n * The part of the date to render\n * `'day' | 'month' | 'year' | '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.placeholder,\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.value,\n focusNext: this.rootContext.focusNext\n });\n });\n\n private readonly attributes = computed(() => this.fieldData().attributes());\n\n /**\n * @ignore\n */\n handleSegmentClick: (e: MouseEvent) => void;\n\n /**\n * @ignore\n */\n handleSegmentKeydown: (e: KeyboardEvent) => void;\n\n constructor(private el: ElementRef) {\n effect(() => {\n const { handleSegmentClick, handleSegmentKeydown } = this.fieldData();\n this.handleSegmentKeydown = handleSegmentKeydown;\n this.handleSegmentClick = handleSegmentClick;\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: FocusEvent) {\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 { Direction } from '@angular/cdk/bidi';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport {\n AfterViewInit,\n booleanAttribute,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n OnInit,\n signal\n} from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport {\n ARROW_LEFT,\n ARROW_RIGHT,\n createContent,\n createFormatter,\n DateMatcher,\n Formatter,\n getDefaultDate,\n getSegmentElements,\n Granularity,\n hasTime,\n HourCycle,\n initializeSegmentValues,\n isBefore,\n isNullish,\n isSegmentNavigationKey,\n provideToken,\n SegmentValueObj,\n syncSegmentValues,\n watch\n} from '@radix-ng/primitives/core';\nimport { DATE_FIELDS_ROOT_CONTEXT } from './date-field-context.token';\n\n@Directive({\n selector: '[rdxDateFieldRoot]',\n exportAs: 'rdxDateFieldRoot',\n providers: [provideToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)],\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 RdxDateFieldRootDirective implements OnInit, AfterViewInit {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * The controlled checked state of the calendar.\n */\n readonly value = model<DateValue | undefined>();\n\n /**\n * A callback fired when the date field's value is invalid.\n */\n readonly isDateUnavailable = input<DateMatcher | undefined>(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 dir = input<Direction>('ltr');\n\n /**\n * The minimum valid date that can be entered.\n */\n readonly minValue = input<DateValue>();\n\n /**\n * The maximum valid date that can be entered.\n */\n readonly maxValue = input<DateValue>();\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 * @ignore\n */\n readonly defaultDate = computed(() =>\n getDefaultDate({\n defaultPlaceholder: undefined,\n granularity: this.granularity(),\n defaultValue: this.value(),\n locale: this.locale()\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<DateValue | undefined>(this.defaultDate().copy());\n\n // Internal state\n\n /**\n * @ignore\n */\n readonly segmentElements = signal<Set<HTMLElement>>(new Set());\n\n /**\n * @ignore\n */\n readonly currentFocusedElement = signal<HTMLElement | null>(null);\n\n /**\n * @ignore\n */\n formatter: Formatter;\n\n /**\n * @ignore\n */\n readonly segmentValues = signal<SegmentValueObj>({\n year: null,\n month: null,\n day: null,\n hour: null,\n minute: null,\n second: null,\n dayPeriod: null\n } as SegmentValueObj);\n\n /**\n * @ignore\n */\n readonly inferredGranularity = computed(() => {\n const placeholder = this.placeholder();\n\n if (this.granularity()) return placeholder && !hasTime(placeholder) ? 'day' : this.granularity();\n\n return placeholder && hasTime(placeholder) ? 'minute' : 'day';\n });\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => {\n if (!this.value()) return false;\n\n if (this.isDateUnavailable()?.(<DateValue>this.value())) return true;\n\n if (this.minValue() && isBefore(<DateValue>this.value(), <DateValue>this.minValue())) return true;\n\n if (this.maxValue() && isBefore(<DateValue>this.maxValue(), <DateValue>this.value())) return true;\n\n return false;\n });\n\n /**\n * @ignore\n */\n readonly allSegmentContent = computed(() =>\n createContent({\n granularity: <Granularity>this.inferredGranularity(),\n dateRef: <DateValue>this.placeholder(),\n formatter: this.formatter,\n hideTimeZone: this.hideTimeZone(),\n hourCycle: this.hourCycle(),\n segmentValues: this.segmentValues(),\n locale: this.locale\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 Array.from(this.segmentElements()).findIndex(\n (el) =>\n el.getAttribute('data-rdx-date-field-segment') ===\n this.currentFocusedElement()?.getAttribute('data-rdx-date-field-segment')\n )\n );\n\n /**\n * @ignore\n */\n readonly prevFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const prevCondition =\n sign > 0 ? this.currentSegmentIndex() < 0 : this.currentSegmentIndex() > this.segmentElements().size - 1;\n if (prevCondition) return null;\n\n const segmentToFocus = Array.from(this.segmentElements())[this.currentSegmentIndex() - sign];\n return segmentToFocus;\n });\n\n /**\n * @ignore\n */\n readonly nextFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const nextCondition =\n sign < 0 ? this.currentSegmentIndex() < 0 : this.currentSegmentIndex() > this.segmentElements().size - 1;\n if (nextCondition) return null;\n const segmentToFocus = Array.from(this.segmentElements())[this.currentSegmentIndex() + sign];\n return segmentToFocus;\n });\n\n /**\n * @ignore\n */\n readonly focusNext = () => {\n this.nextFocusableSegment()?.focus();\n };\n\n constructor() {\n watch([this.value], ([modelValue]) => {\n if (!isNullish(modelValue) && this.placeholder()?.compare(modelValue) !== 0) {\n this.placeholder.set(modelValue.copy());\n }\n });\n }\n\n ngOnInit() {\n const defDate = getDefaultDate({\n defaultPlaceholder: undefined,\n granularity: this.granularity(),\n defaultValue: this.value(),\n locale: this.locale()\n });\n\n this.placeholder.set(defDate.copy());\n\n this.formatter = createFormatter(this.locale());\n\n const initialSegments = initializeSegmentValues(this.inferredGranularity()!);\n\n this.segmentValues.set(\n this.value()\n ? { ...syncSegmentValues({ value: <DateValue>this.value(), formatter: this.formatter }) }\n : { ...initialSegments }\n );\n }\n\n ngAfterViewInit() {\n getSegmentElements(this.elementRef.nativeElement).forEach((item) =>\n this.segmentElements().add(item as HTMLElement)\n );\n }\n\n /**\n * @ignore\n */\n onKeydown(event: KeyboardEvent) {\n const code = event.code;\n if ([ARROW_LEFT, ARROW_RIGHT].includes(code)) {\n if (!isSegmentNavigationKey(event.key)) return;\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 /**\n * @ignore\n */\n setFocusedElement(el: HTMLElement) {\n this.currentFocusedElement.set(el);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAkBO,MAAM,wBAAwB,GAAG,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AAA,EAAA,oBAAA,EAAA,+BAAA,EAAA,oBAAA,EAAA,+BAAA,EAAA,mBAAA,EAAA,gCAAA,EAAA,UAAA,EAAA,OAAA,EAAA,EAAA,EAAA,SAAA,EAZvB,CAAC,YAAY,CAAC,wBAAwB,EAAE,yBAAyB,CAAC,CAAC,EAAA,QAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAYrE,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAfrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,SAAS,EAAE,CAAC,YAAY,CAAC,wBAAwB,4BAA4B,CAAC;AAC9E,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,sBAAsB,EAAE,6BAA6B;AACrD,wBAAA,sBAAsB,EAAE,6BAA6B;AACrD,wBAAA,sBAAsB,EAAE,6BAA6B;AACrD,wBAAA,qBAAqB,EAAE,8BAA8B;AACrD,wBAAA,YAAY,EAAE,OAAO;AAErB,wBAAA,WAAW,EAAE;AAChB;AACJ,iBAAA;;;ACpDD;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Directive, DestroyRef, signal, computed, Injector, Renderer2, Injectable, makeEnvironmentProviders, importProvidersFrom, input, Input, NgModule } from '@angular/core';
2
+ import { signal, computed, inject, Directive, DestroyRef, Injector, RendererFactory2, runInInjectionContext, effect, Renderer2, Injectable, makeEnvironmentProviders, importProvidersFrom, input, Input, NgModule } from '@angular/core';
3
3
  import { map, filter, isObservable, of, take, merge, switchMap, takeUntil } from 'rxjs';
4
4
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
5
  import { Dialog, DialogModule, DIALOG_DATA } from '@angular/cdk/dialog';
@@ -21,6 +21,9 @@ class RdxDialogRef {
21
21
  constructor(cdkRef, config) {
22
22
  this.cdkRef = cdkRef;
23
23
  this.config = config;
24
+ // state tracking
25
+ this._openSignal = signal(true);
26
+ this.state = computed(() => (this._openSignal() ? 'open' : 'closed'));
24
27
  this.closed$ = this.cdkRef.closed.pipe(map((res) => (isDismissed(res) ? undefined : res)));
25
28
  this.dismissed$ = this.cdkRef.closed.pipe(filter((res) => res === DISMISSED_VALUE), map(() => undefined));
26
29
  this.result$ = this.cdkRef.closed.pipe(filter((res) => !isDismissed(res)));
@@ -45,7 +48,19 @@ class RdxDialogRef {
45
48
  });
46
49
  }
47
50
  close(result) {
48
- this.cdkRef.close(result);
51
+ // check if dialog is already in closing state to prevent double-closing
52
+ if (this.state() === 'closed') {
53
+ return;
54
+ }
55
+ this._openSignal.set(false);
56
+ if (this._previousTimeout) {
57
+ clearTimeout(this._previousTimeout);
58
+ }
59
+ const closeDelay = this.config.closeDelay ?? 100; // Default to 100ms if not specified
60
+ // Actual closing happens after delay
61
+ this._previousTimeout = setTimeout(() => {
62
+ this.cdkRef.close(result ?? DISMISSED_VALUE);
63
+ }, closeDelay);
49
64
  }
50
65
  }
51
66
 
@@ -183,6 +198,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImpor
183
198
  class RdxDialogService {
184
199
  #cdkDialog = inject(Dialog);
185
200
  #injector = inject(Injector);
201
+ #rendererFactory = inject(RendererFactory2);
202
+ #renderer = this.#rendererFactory.createRenderer(null, null);
186
203
  open(config) {
187
204
  let dialogRef;
188
205
  let modeClasses = [];
@@ -203,6 +220,11 @@ class RdxDialogService {
203
220
  modeClasses = ['mod-sheet', 'mod-top'];
204
221
  break;
205
222
  }
223
+ // Create a new configuration with default closeDelay if not provided
224
+ const extendedConfig = {
225
+ ...config,
226
+ closeDelay: config.closeDelay ?? 0
227
+ };
206
228
  const cdkRef = this.#cdkDialog.open(config.content, {
207
229
  ariaModal: config.modal ?? true,
208
230
  hasBackdrop: config.modal ?? true,
@@ -218,7 +240,33 @@ class RdxDialogService {
218
240
  ariaLabel: config.ariaLabel,
219
241
  templateContext: () => ({ dialogRef: dialogRef }),
220
242
  providers: (ref) => {
221
- dialogRef = new RdxDialogRef(ref, config);
243
+ // Create dialog ref with state tracking
244
+ dialogRef = new RdxDialogRef(ref, extendedConfig);
245
+ // Get overlay and backdrop references
246
+ const overlay = ref.overlayRef.overlayElement;
247
+ const backdrop = ref.overlayRef.backdropElement;
248
+ // Set up effect to track and update state attributes
249
+ runInInjectionContext(this.#injector, () => {
250
+ effect(() => {
251
+ const currentState = dialogRef.state();
252
+ if (overlay) {
253
+ this.#renderer.setAttribute(overlay, 'data-state', currentState);
254
+ }
255
+ if (backdrop) {
256
+ this.#renderer.setAttribute(backdrop, 'data-state', currentState);
257
+ }
258
+ // For sheet dialogs, add data-side attribute
259
+ if (config.mode?.startsWith('sheet-')) {
260
+ const side = config.mode.substring(6);
261
+ if (overlay) {
262
+ this.#renderer.setAttribute(overlay, 'data-side', side);
263
+ }
264
+ if (backdrop) {
265
+ this.#renderer.setAttribute(backdrop, 'data-side', side);
266
+ }
267
+ }
268
+ });
269
+ });
222
270
  return [
223
271
  {
224
272
  provide: RdxDialogRef,
@@ -243,7 +291,9 @@ class RdxDialogService {
243
291
  }), takeUntil(dialogRef.closed$))
244
292
  .subscribe((canClose) => {
245
293
  if (canClose) {
246
- cdkRef.close(DISMISSED_VALUE);
294
+ // rather than `cdkRef.close()`, closing the `dialogRef` directly
295
+ // ensures that the `state` is represented correctly
296
+ dialogRef.close(undefined);
247
297
  }
248
298
  });
249
299
  }
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-dialog.mjs","sources":["../../../packages/primitives/dialog/src/dialog-ref.ts","../../../packages/primitives/dialog/src/dialog-close.directive.ts","../../../packages/primitives/dialog/src/dialog.config.ts","../../../packages/primitives/dialog/src/dialog-content.directive.ts","../../../packages/primitives/dialog/src/dialog-description.directive.ts","../../../packages/primitives/dialog/src/dialog-dismiss.directive.ts","../../../packages/primitives/dialog/src/dialog-title.directive.ts","../../../packages/primitives/dialog/src/dialog.service.ts","../../../packages/primitives/dialog/src/dialog.providers.ts","../../../packages/primitives/dialog/src/dialog-trigger.directive.ts","../../../packages/primitives/dialog/src/dialog.injectors.ts","../../../packages/primitives/dialog/index.ts","../../../packages/primitives/dialog/radix-ng-primitives-dialog.ts"],"sourcesContent":["import { DialogRef } from '@angular/cdk/dialog';\nimport { filter, isObservable, map, Observable, of, take } from 'rxjs';\nimport { RdxDialogConfig, RdxDialogResult } from './dialog.config';\n\nexport const DISMISSED_VALUE = {} as const;\n\nfunction isDismissed(v: unknown): v is typeof DISMISSED_VALUE {\n return v === DISMISSED_VALUE;\n}\n\n/**\n * Represents a reference to an open dialog.\n * Provides methods and observables to interact with and monitor the dialog's state.\n * @template C - The type of the dialog's content component\n */\nexport class RdxDialogRef<C = unknown> {\n closed$: Observable<RdxDialogResult<C> | undefined> = this.cdkRef.closed.pipe(\n map((res): RdxDialogResult<C> | undefined => (isDismissed(res) ? undefined : res))\n );\n\n dismissed$: Observable<void> = this.cdkRef.closed.pipe(\n filter((res) => res === DISMISSED_VALUE),\n map((): void => undefined)\n );\n\n result$: Observable<RdxDialogResult<C>> = this.cdkRef.closed.pipe(\n filter((res): res is RdxDialogResult<C> => !isDismissed(res))\n );\n\n /**\n * @param cdkRef - Reference to the underlying CDK dialog\n * @param config - Configuration options for the dialog\n */\n constructor(\n public readonly cdkRef: DialogRef<RdxDialogResult<C> | typeof DISMISSED_VALUE, C>,\n public readonly config: RdxDialogConfig<C>\n ) {}\n\n get instance(): C | null {\n return this.cdkRef.componentInstance;\n }\n\n /**\n * Attempts to dismiss the dialog\n * Checks the canClose condition before dismissing\n */\n dismiss(): void {\n if (!this.instance || this.config.isAlert) {\n return;\n }\n\n const canClose = this.config.canClose?.(this.instance) ?? true;\n const canClose$ = isObservable(canClose) ? canClose : of(canClose);\n canClose$.pipe(take(1)).subscribe((close) => {\n if (close) {\n this.cdkRef.close(DISMISSED_VALUE);\n }\n });\n }\n\n close(result: RdxDialogResult<C>): void {\n this.cdkRef.close(result);\n }\n}\n\n/**\n * Represents a simplified interface for dialog interaction\n * Typically used by dialog content components\n * @template R - The type of the result when closing the dialog\n */\nexport type RdxDialogSelfRef<R> = { dismiss(): void; close(res: R): void };\n","import { Directive, inject } from '@angular/core';\nimport { RdxDialogRef } from './dialog-ref';\n\n@Directive({\n selector: '[rdxDialogClose]',\n standalone: true,\n host: {\n '(click)': 'onClick()'\n }\n})\nexport class RdxDialogCloseDirective {\n private readonly ref = inject<RdxDialogRef>(RdxDialogRef);\n\n protected onClick(): void {\n this.ref.close();\n }\n}\n","import { AutoFocusTarget, DialogConfig } from '@angular/cdk/dialog';\nimport { ComponentType } from '@angular/cdk/overlay';\nimport { TemplateRef } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nconst ɵdialogData = Symbol.for('rdxDialogData');\nconst ɵdialogResult = Symbol.for('rdxDialogResult');\n\nexport type ɵDialogDataFlag = { [ɵdialogData]: unknown };\nexport type ɵDialogResultFlag<R> = { [ɵdialogResult]: R };\n\nexport type RdxDialogData<T> = {\n [K in keyof T]: T[K] extends ɵDialogDataFlag ? Omit<T[K], typeof ɵdialogData> : never;\n}[keyof T];\n\ntype DialogRefProps<C> = { [K in keyof C]: C[K] extends ɵDialogResultFlag<unknown> ? K : never }[keyof C] & keyof C;\nexport type RdxDialogResult<C> =\n DialogRefProps<C> extends never ? void : C[DialogRefProps<C>] extends ɵDialogResultFlag<infer T> ? T : void;\n\ntype RdxDialogMode = 'default' | 'sheet' | 'sheet-bottom' | 'sheet-top' | 'sheet-left' | 'sheet-right';\n\ntype RdxBaseDialogConfig<C> = {\n content: ComponentType<C> | TemplateRef<C>;\n\n data: RdxDialogData<C>;\n\n modal?: boolean;\n\n ariaLabel?: string;\n\n autoFocus?: AutoFocusTarget | 'first-input' | string;\n\n canClose?: (comp: C) => boolean | Observable<boolean>;\n\n canCloseWithBackdrop?: boolean;\n\n cdkConfigOverride?: Partial<DialogConfig<C>>;\n\n mode?: RdxDialogMode;\n\n backdropClass?: string | string[];\n\n panelClasses?: string[];\n\n isAlert?: boolean;\n};\n\nexport type RdxDialogConfig<T> =\n RdxDialogData<T> extends never\n ? Omit<RdxBaseDialogConfig<T>, 'data'>\n : RdxBaseDialogConfig<T> & { data: Required<RdxDialogData<T>> };\n\nexport type RdxDialogState = 'open' | 'closed';\n\nexport function getState(open: boolean): RdxDialogState {\n return open ? 'open' : 'closed';\n}\n","import { computed, DestroyRef, Directive, inject, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { RdxDialogRef } from './dialog-ref';\nimport { getState, RdxDialogResult } from './dialog.config';\n\n@Directive({\n selector: '[rdxDialogContent]',\n standalone: true,\n host: {\n role: 'dialog',\n '[attr.aria-describedby]': '\"true\"',\n '[attr.aria-labelledby]': '\"true\"',\n '[attr.data-state]': 'state()'\n }\n})\nexport class RdxDialogContentDirective<C = unknown> {\n private readonly dialogRef = inject<RdxDialogRef<C>>(RdxDialogRef);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly isOpen = signal(true);\n\n readonly state = computed(() => getState(this.isOpen()));\n\n constructor() {\n this.dialogRef.closed$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.isOpen.set(false);\n });\n }\n\n /**\n * Closes the dialog with a specified result.\n *\n * @param result The result to be passed back when closing the dialog\n */\n close(result: RdxDialogResult<C>): void {\n this.dialogRef.close(result);\n }\n\n /**\n * Dismisses the dialog without a result.\n */\n dismiss(): void {\n this.dialogRef.dismiss();\n }\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[rdxDialogDescription]',\n standalone: true\n})\nexport class RdxDialogDescriptionDirective {}\n","import { Directive, inject } from '@angular/core';\nimport { RdxDialogRef } from './dialog-ref';\n\n@Directive({\n selector: 'button[rdxDialogDismiss]',\n standalone: true,\n host: {\n type: 'button',\n '(click)': 'onClick()'\n }\n})\nexport class RdxDialogDismissDirective {\n private readonly ref = inject<RdxDialogRef>(RdxDialogRef);\n\n protected onClick(): void {\n this.ref.dismiss();\n }\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[rdxDialogTitle]',\n standalone: true\n})\nexport class RdxDialogTitleDirective {}\n","import { Dialog } from '@angular/cdk/dialog';\nimport { inject, Injectable, Injector, Renderer2 } from '@angular/core';\nimport { filter, isObservable, merge, of, switchMap, take, takeUntil } from 'rxjs';\nimport { DISMISSED_VALUE, RdxDialogRef } from './dialog-ref';\nimport type { RdxDialogConfig, RdxDialogResult } from './dialog.config';\n\n/**\n * Modality control: When `isModal` is set to `true`, the dialog will:\n *\n * - Have a backdrop that blocks interaction with the rest of the page\n * - Disable closing by clicking outside or pressing Escape\n * - Set `aria-modal=\"true\"` for screen readers\n * - Automatically focus the first tabbable element in the dialog\n * - Restore focus to the element that opened the dialog when it's closed\n *\n *\n * When `isModal` is `false`, the dialog will:\n *\n * - Not have a backdrop, allowing interaction with the rest of the page\n * - Allow closing by clicking outside or pressing Escape\n * - Not set `aria-modal` attribute\n * - Not automatically manage focus\n */\n@Injectable()\nexport class RdxDialogService {\n #cdkDialog = inject(Dialog);\n #injector = inject(Injector);\n\n open<C>(config: RdxDialogConfig<C>): RdxDialogRef<C> {\n let dialogRef: RdxDialogRef<C>;\n let modeClasses: string[] = [];\n\n switch (config.mode) {\n case 'sheet':\n modeClasses = ['mod-sheet', 'mod-right'];\n break;\n case 'sheet-right':\n modeClasses = ['mod-sheet', 'mod-right'];\n break;\n case 'sheet-bottom':\n modeClasses = ['mod-sheet', 'mod-bottom'];\n break;\n case 'sheet-left':\n modeClasses = ['mod-sheet', 'mod-left'];\n break;\n case 'sheet-top':\n modeClasses = ['mod-sheet', 'mod-top'];\n break;\n }\n\n const cdkRef = this.#cdkDialog.open<RdxDialogResult<C> | typeof DISMISSED_VALUE, unknown, C>(config.content, {\n ariaModal: config.modal ?? true,\n hasBackdrop: config.modal ?? true,\n data: 'data' in config ? config.data : null,\n restoreFocus: true,\n role: config.isAlert ? 'alertdialog' : 'dialog',\n disableClose: true,\n closeOnDestroy: true,\n injector: this.#injector,\n backdropClass: config.backdropClass ? config.backdropClass : 'cdk-overlay-dark-backdrop',\n panelClass: ['dialog', ...modeClasses, ...(config.panelClasses || [])],\n autoFocus: config.autoFocus === 'first-input' ? 'dialog' : (config.autoFocus ?? 'first-tabbable'),\n ariaLabel: config.ariaLabel,\n templateContext: () => ({ dialogRef: dialogRef }),\n providers: (ref) => {\n dialogRef = new RdxDialogRef(ref, config);\n return [\n {\n provide: RdxDialogRef,\n useValue: dialogRef\n }\n ];\n },\n // @FIXME\n ...(config.cdkConfigOverride || ({} as any))\n });\n\n if (cdkRef.componentRef) {\n cdkRef.componentRef.injector\n .get(Renderer2)\n .setStyle(cdkRef.componentRef.location.nativeElement, 'display', 'contents');\n }\n\n if (!config.isAlert) {\n merge(\n cdkRef.backdropClick,\n cdkRef.keydownEvents.pipe(filter((e) => e.key === 'Escape' && !e.defaultPrevented))\n )\n .pipe(\n filter(() => config.canCloseWithBackdrop ?? true),\n switchMap(() => {\n const canClose =\n (cdkRef.componentInstance && config.canClose?.(cdkRef.componentInstance)) ?? true;\n const canClose$ = isObservable(canClose) ? canClose : of(canClose);\n return canClose$.pipe(take(1));\n }),\n\n takeUntil(dialogRef!.closed$)\n )\n .subscribe((canClose) => {\n if (canClose) {\n cdkRef.close(DISMISSED_VALUE);\n }\n });\n }\n\n return dialogRef!;\n }\n}\n","import { DialogModule } from '@angular/cdk/dialog';\nimport { EnvironmentProviders, importProvidersFrom, makeEnvironmentProviders, Provider } from '@angular/core';\nimport { RdxDialogService } from './dialog.service';\n\n/**\n * Configures the RdxDialog module by providing necessary dependencies.\n *\n * This function sets up the environment providers required for the RdxDialog to function,\n * specifically importing the Angular CDK's DialogModule.\n *\n * @returns {EnvironmentProviders} An EnvironmentProviders instance containing the DialogModule.\n */\nexport function provideRdxDialogConfig(): EnvironmentProviders {\n return makeEnvironmentProviders([importProvidersFrom(DialogModule)]);\n}\n\n/**\n * Provides the RdxDialogService for dependency injection.\n *\n * This function is used to make the RdxDialogService available for injection\n * in components, directives, or other services that require dialog functionality.\n *\n * @returns {Provider} A provider for the RdxDialogService.\n */\nexport function provideRdxDialog(): Provider {\n return RdxDialogService;\n}\n","import { computed, Directive, inject, Input, input, signal, TemplateRef } from '@angular/core';\nimport { RdxDialogRef } from './dialog-ref';\nimport { getState, RdxDialogConfig, RdxDialogState } from './dialog.config';\nimport { provideRdxDialog } from './dialog.providers';\nimport { RdxDialogService } from './dialog.service';\n\nlet nextId = 0;\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxDialogTrigger]',\n standalone: true,\n providers: [provideRdxDialog()],\n host: {\n type: 'button',\n '[attr.id]': 'id()',\n '[attr.aria-haspopup]': '\"dialog\"',\n '[attr.aria-expanded]': 'isOpen()',\n '[attr.aria-controls]': 'dialogId()',\n '[attr.data-state]': 'state()',\n '(click)': 'onClick()'\n }\n})\nexport class RdxDialogTriggerDirective {\n private readonly dialogService = inject(RdxDialogService);\n\n /**\n * @group Props\n */\n readonly id = input(`rdx-dialog-trigger-${nextId++}`);\n readonly dialogId = computed(() => `rdx-dialog-${this.id()}`);\n\n /**\n * @group Props\n */\n @Input({ required: true, alias: 'rdxDialogTrigger' }) dialog: TemplateRef<void>;\n\n /**\n * @group Props\n */\n @Input({ alias: 'rdxDialogConfig' }) dialogConfig: RdxDialogConfig<unknown>;\n\n readonly isOpen = signal(false);\n readonly state = computed<RdxDialogState>(() => getState(this.isOpen()));\n\n private currentDialogRef: RdxDialogRef | null = null;\n\n protected onClick() {\n this.currentDialogRef = this.dialogService.open({\n ...this.dialogConfig,\n content: this.dialog\n });\n\n this.isOpen.set(true);\n\n this.currentDialogRef.closed$.subscribe(() => {\n this.isOpen.set(false);\n this.currentDialogRef = null;\n });\n }\n}\n","import { DIALOG_DATA } from '@angular/cdk/dialog';\nimport { inject } from '@angular/core';\nimport { RdxDialogRef, RdxDialogSelfRef } from './dialog-ref';\nimport { ɵDialogDataFlag, ɵDialogResultFlag } from './dialog.config';\n\nexport function injectDialogData<TData>(): TData & ɵDialogDataFlag {\n return inject<TData & ɵDialogDataFlag>(DIALOG_DATA);\n}\n\nexport function injectDialogRef<R = void>(): RdxDialogSelfRef<R> & ɵDialogResultFlag<R> {\n return inject<RdxDialogSelfRef<R>>(RdxDialogRef) as RdxDialogSelfRef<R> & ɵDialogResultFlag<R>;\n}\n","import { NgModule } from '@angular/core';\nimport { RdxDialogCloseDirective } from './src/dialog-close.directive';\nimport { RdxDialogContentDirective } from './src/dialog-content.directive';\nimport { RdxDialogDescriptionDirective } from './src/dialog-description.directive';\nimport { RdxDialogDismissDirective } from './src/dialog-dismiss.directive';\nimport { RdxDialogTitleDirective } from './src/dialog-title.directive';\nimport { RdxDialogTriggerDirective } from './src/dialog-trigger.directive';\n\nexport * from './src/dialog-close.directive';\nexport * from './src/dialog-content.directive';\nexport * from './src/dialog-description.directive';\nexport * from './src/dialog-dismiss.directive';\nexport * from './src/dialog-ref';\nexport * from './src/dialog-title.directive';\nexport * from './src/dialog-trigger.directive';\nexport * from './src/dialog.config';\nexport * from './src/dialog.injectors';\nexport * from './src/dialog.providers';\nexport * from './src/dialog.service';\n\nconst _imports = [\n RdxDialogTriggerDirective,\n RdxDialogContentDirective,\n RdxDialogTitleDirective,\n RdxDialogCloseDirective,\n RdxDialogDescriptionDirective,\n RdxDialogDismissDirective\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAIO,MAAM,eAAe,GAAG;AAE/B,SAAS,WAAW,CAAC,CAAU,EAAA;IAC3B,OAAO,CAAC,KAAK,eAAe;AAChC;AAEA;;;;AAIG;MACU,YAAY,CAAA;AAcrB;;;AAGG;IACH,WACoB,CAAA,MAAiE,EACjE,MAA0B,EAAA;QAD1B,IAAM,CAA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version":3,"file":"radix-ng-primitives-dialog.mjs","sources":["../../../packages/primitives/dialog/src/dialog-ref.ts","../../../packages/primitives/dialog/src/dialog-close.directive.ts","../../../packages/primitives/dialog/src/dialog.config.ts","../../../packages/primitives/dialog/src/dialog-content.directive.ts","../../../packages/primitives/dialog/src/dialog-description.directive.ts","../../../packages/primitives/dialog/src/dialog-dismiss.directive.ts","../../../packages/primitives/dialog/src/dialog-title.directive.ts","../../../packages/primitives/dialog/src/dialog.service.ts","../../../packages/primitives/dialog/src/dialog.providers.ts","../../../packages/primitives/dialog/src/dialog-trigger.directive.ts","../../../packages/primitives/dialog/src/dialog.injectors.ts","../../../packages/primitives/dialog/index.ts","../../../packages/primitives/dialog/radix-ng-primitives-dialog.ts"],"sourcesContent":["import { DialogRef } from '@angular/cdk/dialog';\nimport { computed, signal } from '@angular/core';\nimport { filter, isObservable, map, Observable, of, take } from 'rxjs';\nimport { RdxDialogConfig, RdxDialogResult } from './dialog.config';\n\nexport const DISMISSED_VALUE = {} as const;\n\nfunction isDismissed(v: unknown): v is typeof DISMISSED_VALUE {\n return v === DISMISSED_VALUE;\n}\n\n/**\n * Represents a reference to an open dialog.\n * Provides methods and observables to interact with and monitor the dialog's state.\n * @template C - The type of the dialog's content component\n */\nexport class RdxDialogRef<C = unknown> {\n private _previousTimeout: ReturnType<typeof setTimeout> | undefined;\n\n // state tracking\n private readonly _openSignal = signal(true);\n public readonly state = computed(() => (this._openSignal() ? 'open' : 'closed'));\n\n closed$: Observable<RdxDialogResult<C> | undefined> = this.cdkRef.closed.pipe(\n map((res): RdxDialogResult<C> | undefined => (isDismissed(res) ? undefined : res))\n );\n\n dismissed$: Observable<void> = this.cdkRef.closed.pipe(\n filter((res) => res === DISMISSED_VALUE),\n map((): void => undefined)\n );\n\n result$: Observable<RdxDialogResult<C>> = this.cdkRef.closed.pipe(\n filter((res): res is RdxDialogResult<C> => !isDismissed(res))\n );\n\n /**\n * @param cdkRef - Reference to the underlying CDK dialog\n * @param config - Configuration options for the dialog\n */\n constructor(\n public readonly cdkRef: DialogRef<RdxDialogResult<C> | typeof DISMISSED_VALUE, C>,\n public readonly config: RdxDialogConfig<C>\n ) {}\n\n get instance(): C | null {\n return this.cdkRef.componentInstance;\n }\n\n /**\n * Attempts to dismiss the dialog\n * Checks the canClose condition before dismissing\n */\n dismiss(): void {\n if (!this.instance || this.config.isAlert) {\n return;\n }\n\n const canClose = this.config.canClose?.(this.instance) ?? true;\n const canClose$ = isObservable(canClose) ? canClose : of(canClose);\n canClose$.pipe(take(1)).subscribe((close) => {\n if (close) {\n this.cdkRef.close(DISMISSED_VALUE);\n }\n });\n }\n\n close(result: RdxDialogResult<C>): void {\n // check if dialog is already in closing state to prevent double-closing\n if (this.state() === 'closed') {\n return;\n }\n\n this._openSignal.set(false);\n\n if (this._previousTimeout) {\n clearTimeout(this._previousTimeout);\n }\n\n const closeDelay = this.config.closeDelay ?? 100; // Default to 100ms if not specified\n\n // Actual closing happens after delay\n this._previousTimeout = setTimeout(() => {\n this.cdkRef.close(result ?? DISMISSED_VALUE);\n }, closeDelay);\n }\n}\n\n/**\n * Represents a simplified interface for dialog interaction\n * Typically used by dialog content components\n * @template R - The type of the result when closing the dialog\n */\nexport type RdxDialogSelfRef<R> = { dismiss(): void; close(res: R): void };\n","import { Directive, inject } from '@angular/core';\nimport { RdxDialogRef } from './dialog-ref';\n\n@Directive({\n selector: '[rdxDialogClose]',\n standalone: true,\n host: {\n '(click)': 'onClick()'\n }\n})\nexport class RdxDialogCloseDirective {\n private readonly ref = inject<RdxDialogRef>(RdxDialogRef);\n\n protected onClick(): void {\n this.ref.close();\n }\n}\n","import { AutoFocusTarget, DialogConfig } from '@angular/cdk/dialog';\nimport { ComponentType } from '@angular/cdk/overlay';\nimport { TemplateRef } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nconst ɵdialogData = Symbol.for('rdxDialogData');\nconst ɵdialogResult = Symbol.for('rdxDialogResult');\n\nexport type ɵDialogDataFlag = { [ɵdialogData]: unknown };\nexport type ɵDialogResultFlag<R> = { [ɵdialogResult]: R };\n\nexport type RdxDialogData<T> = {\n [K in keyof T]: T[K] extends ɵDialogDataFlag ? Omit<T[K], typeof ɵdialogData> : never;\n}[keyof T];\n\ntype DialogRefProps<C> = { [K in keyof C]: C[K] extends ɵDialogResultFlag<unknown> ? K : never }[keyof C] & keyof C;\nexport type RdxDialogResult<C> =\n DialogRefProps<C> extends never ? void : C[DialogRefProps<C>] extends ɵDialogResultFlag<infer T> ? T : void;\n\ntype RdxDialogMode = 'default' | 'sheet' | 'sheet-bottom' | 'sheet-top' | 'sheet-left' | 'sheet-right';\n\ntype RdxBaseDialogConfig<C> = {\n content: ComponentType<C> | TemplateRef<C>;\n\n data: RdxDialogData<C>;\n\n modal?: boolean;\n\n ariaLabel?: string;\n\n autoFocus?: AutoFocusTarget | 'first-input' | string;\n\n canClose?: (comp: C) => boolean | Observable<boolean>;\n\n canCloseWithBackdrop?: boolean;\n\n closeDelay?: number;\n\n cdkConfigOverride?: Partial<DialogConfig<C>>;\n\n mode?: RdxDialogMode;\n\n backdropClass?: string | string[];\n\n panelClasses?: string[];\n\n isAlert?: boolean;\n};\n\nexport type RdxDialogConfig<T> =\n RdxDialogData<T> extends never\n ? Omit<RdxBaseDialogConfig<T>, 'data'>\n : RdxBaseDialogConfig<T> & { data: Required<RdxDialogData<T>> };\n\nexport type RdxDialogState = 'open' | 'closed';\n\nexport function getState(open: boolean): RdxDialogState {\n return open ? 'open' : 'closed';\n}\n","import { computed, DestroyRef, Directive, inject, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { RdxDialogRef } from './dialog-ref';\nimport { getState, RdxDialogResult } from './dialog.config';\n\n@Directive({\n selector: '[rdxDialogContent]',\n standalone: true,\n host: {\n role: 'dialog',\n '[attr.aria-describedby]': '\"true\"',\n '[attr.aria-labelledby]': '\"true\"',\n '[attr.data-state]': 'state()'\n }\n})\nexport class RdxDialogContentDirective<C = unknown> {\n private readonly dialogRef = inject<RdxDialogRef<C>>(RdxDialogRef);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly isOpen = signal(true);\n\n readonly state = computed(() => getState(this.isOpen()));\n\n constructor() {\n this.dialogRef.closed$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.isOpen.set(false);\n });\n }\n\n /**\n * Closes the dialog with a specified result.\n *\n * @param result The result to be passed back when closing the dialog\n */\n close(result: RdxDialogResult<C>): void {\n this.dialogRef.close(result);\n }\n\n /**\n * Dismisses the dialog without a result.\n */\n dismiss(): void {\n this.dialogRef.dismiss();\n }\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[rdxDialogDescription]',\n standalone: true\n})\nexport class RdxDialogDescriptionDirective {}\n","import { Directive, inject } from '@angular/core';\nimport { RdxDialogRef } from './dialog-ref';\n\n@Directive({\n selector: 'button[rdxDialogDismiss]',\n standalone: true,\n host: {\n type: 'button',\n '(click)': 'onClick()'\n }\n})\nexport class RdxDialogDismissDirective {\n private readonly ref = inject<RdxDialogRef>(RdxDialogRef);\n\n protected onClick(): void {\n this.ref.dismiss();\n }\n}\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: '[rdxDialogTitle]',\n standalone: true\n})\nexport class RdxDialogTitleDirective {}\n","import { Dialog } from '@angular/cdk/dialog';\nimport {\n effect,\n inject,\n Injectable,\n Injector,\n Renderer2,\n RendererFactory2,\n runInInjectionContext\n} from '@angular/core';\nimport { filter, isObservable, merge, of, switchMap, take, takeUntil } from 'rxjs';\nimport { DISMISSED_VALUE, RdxDialogRef } from './dialog-ref';\nimport type { RdxDialogConfig, RdxDialogResult } from './dialog.config';\n\n/**\n * Modality control: When `isModal` is set to `true`, the dialog will:\n *\n * - Have a backdrop that blocks interaction with the rest of the page\n * - Disable closing by clicking outside or pressing Escape\n * - Set `aria-modal=\"true\"` for screen readers\n * - Automatically focus the first tabbable element in the dialog\n * - Restore focus to the element that opened the dialog when it's closed\n *\n *\n * When `isModal` is `false`, the dialog will:\n *\n * - Not have a backdrop, allowing interaction with the rest of the page\n * - Allow closing by clicking outside or pressing Escape\n * - Not set `aria-modal` attribute\n * - Not automatically manage focus\n */\n@Injectable()\nexport class RdxDialogService {\n #cdkDialog = inject(Dialog);\n #injector = inject(Injector);\n #rendererFactory = inject(RendererFactory2);\n #renderer = this.#rendererFactory.createRenderer(null, null);\n\n open<C>(config: RdxDialogConfig<C>): RdxDialogRef<C> {\n let dialogRef: RdxDialogRef<C>;\n let modeClasses: string[] = [];\n\n switch (config.mode) {\n case 'sheet':\n modeClasses = ['mod-sheet', 'mod-right'];\n break;\n case 'sheet-right':\n modeClasses = ['mod-sheet', 'mod-right'];\n break;\n case 'sheet-bottom':\n modeClasses = ['mod-sheet', 'mod-bottom'];\n break;\n case 'sheet-left':\n modeClasses = ['mod-sheet', 'mod-left'];\n break;\n case 'sheet-top':\n modeClasses = ['mod-sheet', 'mod-top'];\n break;\n }\n\n // Create a new configuration with default closeDelay if not provided\n const extendedConfig: RdxDialogConfig<C> = {\n ...config,\n closeDelay: config.closeDelay ?? 0\n };\n\n const cdkRef = this.#cdkDialog.open<RdxDialogResult<C> | typeof DISMISSED_VALUE, unknown, C>(config.content, {\n ariaModal: config.modal ?? true,\n hasBackdrop: config.modal ?? true,\n data: 'data' in config ? config.data : null,\n restoreFocus: true,\n role: config.isAlert ? 'alertdialog' : 'dialog',\n disableClose: true,\n closeOnDestroy: true,\n injector: this.#injector,\n backdropClass: config.backdropClass ? config.backdropClass : 'cdk-overlay-dark-backdrop',\n panelClass: ['dialog', ...modeClasses, ...(config.panelClasses || [])],\n autoFocus: config.autoFocus === 'first-input' ? 'dialog' : (config.autoFocus ?? 'first-tabbable'),\n ariaLabel: config.ariaLabel,\n templateContext: () => ({ dialogRef: dialogRef }),\n providers: (ref) => {\n // Create dialog ref with state tracking\n dialogRef = new RdxDialogRef(ref, extendedConfig);\n\n // Get overlay and backdrop references\n const overlay = ref.overlayRef.overlayElement;\n const backdrop = ref.overlayRef.backdropElement;\n\n // Set up effect to track and update state attributes\n runInInjectionContext(this.#injector, () => {\n effect(() => {\n const currentState = dialogRef.state();\n\n if (overlay) {\n this.#renderer.setAttribute(overlay, 'data-state', currentState);\n }\n\n if (backdrop) {\n this.#renderer.setAttribute(backdrop, 'data-state', currentState);\n }\n\n // For sheet dialogs, add data-side attribute\n if (config.mode?.startsWith('sheet-')) {\n const side = config.mode.substring(6);\n if (overlay) {\n this.#renderer.setAttribute(overlay, 'data-side', side);\n }\n if (backdrop) {\n this.#renderer.setAttribute(backdrop, 'data-side', side);\n }\n }\n });\n });\n\n return [\n {\n provide: RdxDialogRef,\n useValue: dialogRef\n }\n ];\n },\n // @FIXME\n ...(config.cdkConfigOverride || ({} as any))\n });\n\n if (cdkRef.componentRef) {\n cdkRef.componentRef.injector\n .get(Renderer2)\n .setStyle(cdkRef.componentRef.location.nativeElement, 'display', 'contents');\n }\n\n if (!config.isAlert) {\n merge(\n cdkRef.backdropClick,\n cdkRef.keydownEvents.pipe(filter((e) => e.key === 'Escape' && !e.defaultPrevented))\n )\n .pipe(\n filter(() => config.canCloseWithBackdrop ?? true),\n switchMap(() => {\n const canClose =\n (cdkRef.componentInstance && config.canClose?.(cdkRef.componentInstance)) ?? true;\n const canClose$ = isObservable(canClose) ? canClose : of(canClose);\n return canClose$.pipe(take(1));\n }),\n\n takeUntil(dialogRef!.closed$)\n )\n .subscribe((canClose) => {\n if (canClose) {\n // rather than `cdkRef.close()`, closing the `dialogRef` directly\n // ensures that the `state` is represented correctly\n dialogRef!.close(undefined as unknown as RdxDialogResult<C>);\n }\n });\n }\n\n return dialogRef!;\n }\n}\n","import { DialogModule } from '@angular/cdk/dialog';\nimport { EnvironmentProviders, importProvidersFrom, makeEnvironmentProviders, Provider } from '@angular/core';\nimport { RdxDialogService } from './dialog.service';\n\n/**\n * Configures the RdxDialog module by providing necessary dependencies.\n *\n * This function sets up the environment providers required for the RdxDialog to function,\n * specifically importing the Angular CDK's DialogModule.\n *\n * @returns {EnvironmentProviders} An EnvironmentProviders instance containing the DialogModule.\n */\nexport function provideRdxDialogConfig(): EnvironmentProviders {\n return makeEnvironmentProviders([importProvidersFrom(DialogModule)]);\n}\n\n/**\n * Provides the RdxDialogService for dependency injection.\n *\n * This function is used to make the RdxDialogService available for injection\n * in components, directives, or other services that require dialog functionality.\n *\n * @returns {Provider} A provider for the RdxDialogService.\n */\nexport function provideRdxDialog(): Provider {\n return RdxDialogService;\n}\n","import { computed, Directive, inject, Input, input, signal, TemplateRef } from '@angular/core';\nimport { RdxDialogRef } from './dialog-ref';\nimport { getState, RdxDialogConfig, RdxDialogState } from './dialog.config';\nimport { provideRdxDialog } from './dialog.providers';\nimport { RdxDialogService } from './dialog.service';\n\nlet nextId = 0;\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxDialogTrigger]',\n standalone: true,\n providers: [provideRdxDialog()],\n host: {\n type: 'button',\n '[attr.id]': 'id()',\n '[attr.aria-haspopup]': '\"dialog\"',\n '[attr.aria-expanded]': 'isOpen()',\n '[attr.aria-controls]': 'dialogId()',\n '[attr.data-state]': 'state()',\n '(click)': 'onClick()'\n }\n})\nexport class RdxDialogTriggerDirective {\n private readonly dialogService = inject(RdxDialogService);\n\n /**\n * @group Props\n */\n readonly id = input(`rdx-dialog-trigger-${nextId++}`);\n readonly dialogId = computed(() => `rdx-dialog-${this.id()}`);\n\n /**\n * @group Props\n */\n @Input({ required: true, alias: 'rdxDialogTrigger' }) dialog: TemplateRef<void>;\n\n /**\n * @group Props\n */\n @Input({ alias: 'rdxDialogConfig' }) dialogConfig: RdxDialogConfig<unknown>;\n\n readonly isOpen = signal(false);\n readonly state = computed<RdxDialogState>(() => getState(this.isOpen()));\n\n private currentDialogRef: RdxDialogRef | null = null;\n\n protected onClick() {\n this.currentDialogRef = this.dialogService.open({\n ...this.dialogConfig,\n content: this.dialog\n });\n\n this.isOpen.set(true);\n\n this.currentDialogRef.closed$.subscribe(() => {\n this.isOpen.set(false);\n this.currentDialogRef = null;\n });\n }\n}\n","import { DIALOG_DATA } from '@angular/cdk/dialog';\nimport { inject } from '@angular/core';\nimport { RdxDialogRef, RdxDialogSelfRef } from './dialog-ref';\nimport { ɵDialogDataFlag, ɵDialogResultFlag } from './dialog.config';\n\nexport function injectDialogData<TData>(): TData & ɵDialogDataFlag {\n return inject<TData & ɵDialogDataFlag>(DIALOG_DATA);\n}\n\nexport function injectDialogRef<R = void>(): RdxDialogSelfRef<R> & ɵDialogResultFlag<R> {\n return inject<RdxDialogSelfRef<R>>(RdxDialogRef) as RdxDialogSelfRef<R> & ɵDialogResultFlag<R>;\n}\n","import { NgModule } from '@angular/core';\nimport { RdxDialogCloseDirective } from './src/dialog-close.directive';\nimport { RdxDialogContentDirective } from './src/dialog-content.directive';\nimport { RdxDialogDescriptionDirective } from './src/dialog-description.directive';\nimport { RdxDialogDismissDirective } from './src/dialog-dismiss.directive';\nimport { RdxDialogTitleDirective } from './src/dialog-title.directive';\nimport { RdxDialogTriggerDirective } from './src/dialog-trigger.directive';\n\nexport * from './src/dialog-close.directive';\nexport * from './src/dialog-content.directive';\nexport * from './src/dialog-description.directive';\nexport * from './src/dialog-dismiss.directive';\nexport * from './src/dialog-ref';\nexport * from './src/dialog-title.directive';\nexport * from './src/dialog-trigger.directive';\nexport * from './src/dialog.config';\nexport * from './src/dialog.injectors';\nexport * from './src/dialog.providers';\nexport * from './src/dialog.service';\n\nconst _imports = [\n RdxDialogTriggerDirective,\n RdxDialogContentDirective,\n RdxDialogTitleDirective,\n RdxDialogCloseDirective,\n RdxDialogDescriptionDirective,\n RdxDialogDismissDirective\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAKO,MAAM,eAAe,GAAG;AAE/B,SAAS,WAAW,CAAC,CAAU,EAAA;IAC3B,OAAO,CAAC,KAAK,eAAe;AAChC;AAEA;;;;AAIG;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