@radix-ng/primitives 0.37.0 → 0.38.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 (78) hide show
  1. package/accordion/index.d.ts +3 -1
  2. package/accordion/src/accordion-content-presence.directive.d.ts +6 -0
  3. package/accordion/src/accordion-content.directive.d.ts +4 -7
  4. package/accordion/src/accordion-header.directive.d.ts +2 -2
  5. package/accordion/src/accordion-item.directive.d.ts +24 -83
  6. package/accordion/src/accordion-root.directive.d.ts +33 -87
  7. package/accordion/src/accordion-trigger.directive.d.ts +5 -11
  8. package/collapsible/index.d.ts +11 -0
  9. package/collapsible/src/collapsible-content-presence.directive.d.ts +6 -0
  10. package/collapsible/src/collapsible-content.directive.d.ts +10 -9
  11. package/collapsible/src/collapsible-root.directive.d.ts +19 -37
  12. package/collapsible/src/collapsible-trigger.directive.d.ts +1 -21
  13. package/core/index.d.ts +5 -0
  14. package/core/src/accessor/control-value-accessor.d.ts +67 -0
  15. package/core/src/create-context.d.ts +10 -0
  16. package/core/src/date-time/comparators.d.ts +7 -1
  17. package/core/src/date-time/useDateField.d.ts +2 -2
  18. package/core/src/types.d.ts +24 -0
  19. package/{stepper/src/utils → core/src}/useArrowNavigation.d.ts +2 -2
  20. package/core/src/useResizeObserver.d.ts +15 -0
  21. package/fesm2022/radix-ng-primitives-accordion.mjs +196 -408
  22. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  23. package/fesm2022/radix-ng-primitives-avatar.mjs +2 -10
  24. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  25. package/fesm2022/radix-ng-primitives-calendar.mjs +3 -14
  26. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  27. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  28. package/fesm2022/radix-ng-primitives-collapsible.mjs +138 -143
  29. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  30. package/fesm2022/radix-ng-primitives-core.mjs +248 -7
  31. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  32. package/fesm2022/radix-ng-primitives-hover-card.mjs +1 -3
  33. package/fesm2022/radix-ng-primitives-hover-card.mjs.map +1 -1
  34. package/fesm2022/radix-ng-primitives-menubar.mjs +1 -8
  35. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  36. package/fesm2022/radix-ng-primitives-pagination.mjs +2 -6
  37. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  38. package/fesm2022/radix-ng-primitives-popover.mjs +2 -6
  39. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  40. package/fesm2022/radix-ng-primitives-presence.mjs +34 -1
  41. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  42. package/fesm2022/radix-ng-primitives-progress.mjs +2 -7
  43. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  44. package/fesm2022/radix-ng-primitives-radio.mjs +1 -3
  45. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  46. package/fesm2022/radix-ng-primitives-select.mjs +75 -33
  47. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  48. package/fesm2022/radix-ng-primitives-stepper.mjs +1 -84
  49. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  50. package/fesm2022/radix-ng-primitives-switch.mjs +61 -100
  51. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  52. package/fesm2022/radix-ng-primitives-tabs.mjs +4 -19
  53. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  54. package/fesm2022/radix-ng-primitives-time-field.mjs +351 -0
  55. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -0
  56. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  57. package/fesm2022/radix-ng-primitives-toggle.mjs +1 -6
  58. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  59. package/fesm2022/radix-ng-primitives-tooltip.mjs +1 -3
  60. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  61. package/hover-card/src/hover-card-root.directive.d.ts +4 -4
  62. package/package.json +5 -1
  63. package/popover/src/popover-root.directive.d.ts +4 -4
  64. package/presence/index.d.ts +1 -0
  65. package/presence/src/presence.directive.d.ts +27 -0
  66. package/select/src/select-trigger.directive.d.ts +8 -2
  67. package/select/src/select.component.d.ts +23 -6
  68. package/switch/index.d.ts +0 -1
  69. package/switch/src/switch-input.directive.d.ts +1 -1
  70. package/switch/src/switch-root.directive.d.ts +23 -46
  71. package/switch/src/switch-thumb.directive.d.ts +1 -1
  72. package/time-field/README.md +1 -0
  73. package/time-field/index.d.ts +11 -0
  74. package/time-field/src/time-field-context.token.d.ts +19 -0
  75. package/time-field/src/time-field-input.directive.d.ts +53 -0
  76. package/time-field/src/time-field-root.directive.d.ts +125 -0
  77. package/tooltip/src/tooltip-root.directive.d.ts +4 -4
  78. package/collapsible/src/collapsible-content.token.d.ts +0 -3
@@ -1,22 +1,36 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, contentChild, input, booleanAttribute, output, Input, Directive, ElementRef } from '@angular/core';
3
- import { asyncScheduler } from 'rxjs';
2
+ import { inject, untracked, model, input, booleanAttribute, linkedSignal, computed, output, Directive, ElementRef, signal, afterNextRender, NgModule } from '@angular/core';
3
+ import * as i1 from '@radix-ng/primitives/presence';
4
+ import { provideRdxPresenceContext, RdxPresenceDirective } from '@radix-ng/primitives/presence';
5
+ import { createContext, watch } from '@radix-ng/primitives/core';
4
6
 
5
- const RdxCollapsibleContentToken = new InjectionToken('RdxCollapsibleContentToken');
6
-
7
- const RdxCollapsibleRootToken = new InjectionToken('RdxCollapsibleRootToken');
8
- function injectCollapsible() {
9
- return inject(RdxCollapsibleRootDirective);
10
- }
7
+ const [injectCollapsibleRootContext, provideCollapsibleRootContext] = createContext('CollapsibleRootContext');
8
+ const rootContext = () => {
9
+ const instance = inject(RdxCollapsibleRootDirective);
10
+ return {
11
+ contentId: instance.contentId,
12
+ disabled: instance.isDisabled,
13
+ open: instance.open,
14
+ toggle: () => {
15
+ untracked(() => instance.open.update((v) => !v));
16
+ instance.onOpenChange.emit(instance.open());
17
+ }
18
+ };
19
+ };
11
20
  /**
12
21
  * @group Components
13
22
  */
14
23
  class RdxCollapsibleRootDirective {
15
24
  constructor() {
16
25
  /**
17
- * Reference to RdxCollapsibleContent directive
26
+ * The controlled open state of the collapsible.
27
+ * Sets the state of the directive. `true` - expanded, `false` - collapsed
28
+ *
29
+ * @group Props
30
+ * @defaultValue false
18
31
  */
19
- this.contentDirective = contentChild.required(RdxCollapsibleContentToken);
32
+ this.open = model(false);
33
+ this.contentId = input('');
20
34
  /**
21
35
  * Determines whether a directive is available for interaction.
22
36
  * When true, prevents the user from interacting with the collapsible.
@@ -24,10 +38,9 @@ class RdxCollapsibleRootDirective {
24
38
  * @group Props
25
39
  */
26
40
  this.disabled = input(false, { transform: booleanAttribute });
27
- /**
28
- * Stores collapsible state
29
- */
30
- this._open = false;
41
+ this._disabled = linkedSignal(this.disabled);
42
+ this.isDisabled = this._disabled.asReadonly();
43
+ this.isOpen = computed(() => this.open());
31
44
  /**
32
45
  * Emitted with new value when directive state changed.
33
46
  * Event handler called when the open state of the collapsible changes.
@@ -36,177 +49,159 @@ class RdxCollapsibleRootDirective {
36
49
  */
37
50
  this.onOpenChange = output();
38
51
  }
39
- /**
40
- * The controlled open state of the collapsible.
41
- * Sets the state of the directive. `true` - expanded, `false` - collapsed
42
- *
43
- * @group Props
44
- * @defaultValue false
45
- */
46
- set open(value) {
47
- if (value !== this._open) {
48
- this.onOpenChange.emit(value);
49
- }
50
- this._open = value;
51
- this.setPresence();
52
- }
53
- get open() {
54
- return this._open;
55
- }
56
- /**
57
- * Allows to change directive state
58
- * @param {boolean | undefined} value
59
- * @ignore
60
- */
61
- setOpen(value) {
62
- if (this.disabled()) {
63
- return;
64
- }
65
- if (value === undefined) {
66
- this.open = !this.open;
67
- }
68
- else {
69
- this.open = value;
70
- }
71
- this.setPresence();
72
- }
73
- /**
74
- * Returns directive state (open | closed)
75
- * @ignore
76
- */
77
- getState() {
78
- return this.open ? 'open' : 'closed';
79
- }
80
- /**
81
- * Returns current directive state
82
- * @ignore
83
- */
84
- isOpen() {
85
- return this.open;
86
- }
87
- /**
88
- * Controls visibility of content
89
- */
90
- setPresence() {
91
- if (!this.contentDirective) {
92
- return;
93
- }
94
- if (this.isOpen()) {
95
- this.contentDirective().elementRef.nativeElement.removeAttribute('hidden');
96
- }
97
- else {
98
- asyncScheduler.schedule(() => {
99
- const animations = this.contentDirective().elementRef.nativeElement.getAnimations();
100
- if (animations === undefined || animations.length === 0) {
101
- this.contentDirective().elementRef.nativeElement.setAttribute('hidden', '');
102
- }
103
- });
104
- }
105
- }
106
52
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxCollapsibleRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
107
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.4", type: RdxCollapsibleRootDirective, isStandalone: true, selector: "[rdxCollapsibleRoot]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onOpenChange: "onOpenChange" }, host: { properties: { "attr.data-state": "getState()", "attr.data-disabled": "disabled() ? \"\" : undefined" } }, providers: [{ provide: RdxCollapsibleRootToken, useExisting: RdxCollapsibleRootDirective }], queries: [{ propertyName: "contentDirective", first: true, predicate: RdxCollapsibleContentToken, descendants: true, isSignal: true }], exportAs: ["collapsibleRoot"], ngImport: i0 }); }
53
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.4", type: RdxCollapsibleRootDirective, isStandalone: true, selector: "[rdxCollapsibleRoot]", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, contentId: { classPropertyName: "contentId", publicName: "contentId", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", onOpenChange: "onOpenChange" }, host: { properties: { "attr.data-state": "open() ? \"open\" : \"closed\"", "attr.data-disabled": "disabled() ? \"\" : undefined" } }, providers: [provideCollapsibleRootContext(rootContext)], exportAs: ["rdxCollapsibleRoot"], ngImport: i0 }); }
108
54
  }
109
55
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxCollapsibleRootDirective, decorators: [{
110
56
  type: Directive,
111
57
  args: [{
112
58
  selector: '[rdxCollapsibleRoot]',
113
- exportAs: 'collapsibleRoot',
114
- providers: [{ provide: RdxCollapsibleRootToken, useExisting: RdxCollapsibleRootDirective }],
59
+ exportAs: 'rdxCollapsibleRoot',
60
+ providers: [provideCollapsibleRootContext(rootContext)],
115
61
  host: {
116
- '[attr.data-state]': 'getState()',
62
+ '[attr.data-state]': 'open() ? "open" : "closed"',
117
63
  '[attr.data-disabled]': 'disabled() ? "" : undefined'
118
64
  }
119
65
  }]
120
- }], propDecorators: { open: [{
121
- type: Input
122
- }] } });
66
+ }] });
67
+
68
+ class RdxCollapsibleContentPresenceDirective {
69
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxCollapsibleContentPresenceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
70
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: RdxCollapsibleContentPresenceDirective, isStandalone: true, selector: "ng-template[rdxCollapsibleContentPresence]", providers: [
71
+ provideRdxPresenceContext(() => ({
72
+ present: injectCollapsibleRootContext().open
73
+ }))
74
+ ], hostDirectives: [{ directive: i1.RdxPresenceDirective }], ngImport: i0 }); }
75
+ }
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxCollapsibleContentPresenceDirective, decorators: [{
77
+ type: Directive,
78
+ args: [{
79
+ selector: 'ng-template[rdxCollapsibleContentPresence]',
80
+ providers: [
81
+ provideRdxPresenceContext(() => ({
82
+ present: injectCollapsibleRootContext().open
83
+ }))
84
+ ],
85
+ hostDirectives: [RdxPresenceDirective]
86
+ }]
87
+ }] });
123
88
 
124
89
  class RdxCollapsibleContentDirective {
125
90
  constructor() {
126
- this.collapsible = inject(RdxCollapsibleRootDirective);
127
- /**
128
- * Reference to CollapsibleContent host element
129
- * @ignore
130
- */
131
91
  this.elementRef = inject(ElementRef);
92
+ this.rootContext = injectCollapsibleRootContext();
93
+ this.isOpen = computed(() => this.rootContext.open());
94
+ this.height = signal(0);
95
+ this.width = signal(0);
96
+ this.isMountAnimationPrevented = signal(true);
97
+ this.originalStyles = {
98
+ transition: '',
99
+ animation: ''
100
+ };
101
+ this.hiddenSignal = signal(false);
102
+ watch([this.isOpen], ([isOpen]) => {
103
+ if (isOpen) {
104
+ this.hiddenSignal.set(false);
105
+ setTimeout(() => {
106
+ const node = this.elementRef.nativeElement;
107
+ if (!node)
108
+ return;
109
+ node.style.transition = 'none';
110
+ node.style.animation = 'none';
111
+ const rect = node.getBoundingClientRect();
112
+ this.height.set(rect.height);
113
+ this.width.set(rect.width);
114
+ if (!this.isMountAnimationPrevented()) {
115
+ node.style.transition = this.originalStyles.transition;
116
+ node.style.animation = this.originalStyles.animation;
117
+ }
118
+ });
119
+ }
120
+ });
121
+ afterNextRender(() => {
122
+ this.originalStyles = {
123
+ transition: this.elementRef.nativeElement.style.transition,
124
+ animation: this.elementRef.nativeElement.style.animation
125
+ };
126
+ requestAnimationFrame(() => {
127
+ this.isMountAnimationPrevented.set(false);
128
+ });
129
+ });
132
130
  }
133
- getDisabled() {
134
- return this.collapsible.disabled() ? 'disabled' : undefined;
131
+ onAnimationEnd() {
132
+ if (!this.rootContext.open()) {
133
+ this.hiddenSignal.set(true);
134
+ }
135
135
  }
136
136
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxCollapsibleContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
137
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: RdxCollapsibleContentDirective, isStandalone: true, selector: "[rdxCollapsibleContent]", host: { properties: { "attr.data-state": "collapsible.getState()", "attr.data-disabled": "getDisabled()" } }, providers: [
138
- {
139
- provide: RdxCollapsibleContentToken,
140
- useExisting: RdxCollapsibleContentDirective
141
- }
142
- ], ngImport: i0 }); }
137
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: RdxCollapsibleContentDirective, isStandalone: true, selector: "[rdxCollapsibleContent]", host: { attributes: { "id": "rootContext.contentId()" }, listeners: { "animationend": "onAnimationEnd()" }, properties: { "attr.data-state": "rootContext.open() ? \"open\" : \"closed\"", "attr.data-disabled": "rootContext.disabled() ? \"true\" : undefined", "style.display": "hiddenSignal() ? \"none\" : undefined", "style.--radix-collapsible-content-width.px": "width()", "style.--radix-collapsible-content-height.px": "height()" } }, ngImport: i0 }); }
143
138
  }
144
139
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxCollapsibleContentDirective, decorators: [{
145
140
  type: Directive,
146
141
  args: [{
147
142
  selector: '[rdxCollapsibleContent]',
148
- providers: [
149
- {
150
- provide: RdxCollapsibleContentToken,
151
- useExisting: RdxCollapsibleContentDirective
152
- }
153
- ],
154
143
  host: {
155
- '[attr.data-state]': 'collapsible.getState()',
156
- '[attr.data-disabled]': 'getDisabled()'
144
+ id: 'rootContext.contentId()',
145
+ '[attr.data-state]': 'rootContext.open() ? "open" : "closed"',
146
+ '[attr.data-disabled]': 'rootContext.disabled() ? "true" : undefined',
147
+ '[style.display]': 'hiddenSignal() ? "none" : undefined',
148
+ '[style.--radix-collapsible-content-width.px]': 'width()',
149
+ '[style.--radix-collapsible-content-height.px]': 'height()',
150
+ '(animationend)': 'onAnimationEnd()'
157
151
  }
158
152
  }]
159
- }] });
153
+ }], ctorParameters: () => [] });
160
154
 
161
155
  class RdxCollapsibleTriggerDirective {
162
156
  constructor() {
163
- /**
164
- * Reference to CollapsibleRoot
165
- * @private
166
- * @ignore
167
- */
168
- this.collapsible = injectCollapsible();
169
- }
170
- /**
171
- * Called on trigger clicked
172
- */
173
- onOpenToggle() {
174
- this.collapsible.setOpen();
175
- }
176
- /**
177
- * Returns current directive state (open | closed)
178
- * @ignore
179
- */
180
- getState() {
181
- return this.collapsible.getState();
182
- }
183
- /**
184
- * Returns current trigger state
185
- * @ignore
186
- */
187
- getDisabled() {
188
- return this.collapsible.disabled() ? 'disabled' : undefined;
157
+ this.rootContext = injectCollapsibleRootContext();
189
158
  }
190
159
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxCollapsibleTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
191
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: RdxCollapsibleTriggerDirective, isStandalone: true, selector: "[rdxCollapsibleTrigger]", host: { listeners: { "click": "onOpenToggle()" }, properties: { "attr.data-state": "getState()", "attr.data-disabled": "getDisabled()", "attr.aria-expanded": "getState() === \"open\" ? \"true\" : \"false\"", "disabled": "getDisabled()" } }, ngImport: i0 }); }
160
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.4", type: RdxCollapsibleTriggerDirective, isStandalone: true, selector: "[rdxCollapsibleTrigger]", host: { listeners: { "click": "rootContext.toggle()" }, properties: { "attr.aria-controls": "rootContext.contentId()", "attr.aria-expanded": "rootContext.open()", "attr.data-state": "rootContext.open() ? \"open\" : \"closed\"", "attr.data-disabled": "rootContext.disabled() ? \"true\" : undefined", "disabled": "rootContext.disabled()" } }, ngImport: i0 }); }
192
161
  }
193
162
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxCollapsibleTriggerDirective, decorators: [{
194
163
  type: Directive,
195
164
  args: [{
196
165
  selector: '[rdxCollapsibleTrigger]',
197
166
  host: {
198
- '[attr.data-state]': 'getState()',
199
- '[attr.data-disabled]': 'getDisabled()',
200
- '[attr.aria-expanded]': 'getState() === "open" ? "true" : "false"',
201
- '[disabled]': 'getDisabled()',
202
- '(click)': 'onOpenToggle()'
167
+ '[attr.aria-controls]': 'rootContext.contentId()',
168
+ '[attr.aria-expanded]': 'rootContext.open()',
169
+ '[attr.data-state]': 'rootContext.open() ? "open" : "closed"',
170
+ '[attr.data-disabled]': 'rootContext.disabled() ? "true" : undefined',
171
+ '[disabled]': 'rootContext.disabled()',
172
+ '(click)': 'rootContext.toggle()'
203
173
  }
204
174
  }]
205
175
  }] });
206
176
 
177
+ const _imports = [
178
+ RdxCollapsibleContentDirective,
179
+ RdxCollapsibleRootDirective,
180
+ RdxCollapsibleTriggerDirective,
181
+ RdxCollapsibleContentPresenceDirective
182
+ ];
183
+ class RdxCollapsibleModule {
184
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxCollapsibleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
185
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.4", ngImport: i0, type: RdxCollapsibleModule, imports: [RdxCollapsibleContentDirective,
186
+ RdxCollapsibleRootDirective,
187
+ RdxCollapsibleTriggerDirective,
188
+ RdxCollapsibleContentPresenceDirective], exports: [RdxCollapsibleContentDirective,
189
+ RdxCollapsibleRootDirective,
190
+ RdxCollapsibleTriggerDirective,
191
+ RdxCollapsibleContentPresenceDirective] }); }
192
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxCollapsibleModule }); }
193
+ }
194
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxCollapsibleModule, decorators: [{
195
+ type: NgModule,
196
+ args: [{
197
+ imports: [..._imports],
198
+ exports: [..._imports]
199
+ }]
200
+ }] });
201
+
207
202
  /**
208
203
  * Generated bundle index. Do not edit.
209
204
  */
210
205
 
211
- export { RdxCollapsibleContentDirective, RdxCollapsibleRootDirective, RdxCollapsibleTriggerDirective, injectCollapsible };
206
+ export { RdxCollapsibleContentDirective, RdxCollapsibleContentPresenceDirective, RdxCollapsibleModule, RdxCollapsibleRootDirective, RdxCollapsibleTriggerDirective, injectCollapsibleRootContext, provideCollapsibleRootContext };
212
207
  //# sourceMappingURL=radix-ng-primitives-collapsible.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-collapsible.mjs","sources":["../../../packages/primitives/collapsible/src/collapsible-content.token.ts","../../../packages/primitives/collapsible/src/collapsible-root.directive.ts","../../../packages/primitives/collapsible/src/collapsible-content.directive.ts","../../../packages/primitives/collapsible/src/collapsible-trigger.directive.ts","../../../packages/primitives/collapsible/radix-ng-primitives-collapsible.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { RdxCollapsibleContentDirective } from './collapsible-content.directive';\n\nexport const RdxCollapsibleContentToken = new InjectionToken<RdxCollapsibleContentDirective>(\n 'RdxCollapsibleContentToken'\n);\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, contentChild, Directive, inject, InjectionToken, input, Input, output } from '@angular/core';\nimport { asyncScheduler } from 'rxjs';\nimport { RdxCollapsibleContentToken } from './collapsible-content.token';\n\nconst RdxCollapsibleRootToken = new InjectionToken<RdxCollapsibleRootDirective>('RdxCollapsibleRootToken');\n\nexport function injectCollapsible(): RdxCollapsibleRootDirective {\n return inject(RdxCollapsibleRootDirective);\n}\n\nexport type RdxCollapsibleState = 'open' | 'closed';\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxCollapsibleRoot]',\n exportAs: 'collapsibleRoot',\n providers: [{ provide: RdxCollapsibleRootToken, useExisting: RdxCollapsibleRootDirective }],\n host: {\n '[attr.data-state]': 'getState()',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxCollapsibleRootDirective {\n /**\n * Reference to RdxCollapsibleContent directive\n */\n private readonly contentDirective = contentChild.required(RdxCollapsibleContentToken);\n\n /**\n * Determines whether a directive is available for interaction.\n * When true, prevents the user from interacting with the collapsible.\n *\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled open state of the collapsible.\n * Sets the state of the directive. `true` - expanded, `false` - collapsed\n *\n * @group Props\n * @defaultValue false\n */\n @Input() set open(value: boolean) {\n if (value !== this._open) {\n this.onOpenChange.emit(value);\n }\n\n this._open = value;\n this.setPresence();\n }\n\n get open(): boolean {\n return this._open;\n }\n\n /**\n * Stores collapsible state\n */\n private _open = false;\n\n /**\n * Emitted with new value when directive state changed.\n * Event handler called when the open state of the collapsible changes.\n *\n * @group Emits\n */\n readonly onOpenChange = output<boolean>();\n\n /**\n * Allows to change directive state\n * @param {boolean | undefined} value\n * @ignore\n */\n setOpen(value?: boolean) {\n if (this.disabled()) {\n return;\n }\n\n if (value === undefined) {\n this.open = !this.open;\n } else {\n this.open = value;\n }\n\n this.setPresence();\n }\n\n /**\n * Returns directive state (open | closed)\n * @ignore\n */\n getState(): RdxCollapsibleState {\n return this.open ? 'open' : 'closed';\n }\n\n /**\n * Returns current directive state\n * @ignore\n */\n isOpen(): boolean {\n return this.open;\n }\n\n /**\n * Controls visibility of content\n */\n private setPresence(): void {\n if (!this.contentDirective) {\n return;\n }\n\n if (this.isOpen()) {\n this.contentDirective().elementRef.nativeElement.removeAttribute('hidden');\n } else {\n asyncScheduler.schedule(() => {\n const animations = this.contentDirective().elementRef.nativeElement.getAnimations();\n\n if (animations === undefined || animations.length === 0) {\n this.contentDirective().elementRef.nativeElement.setAttribute('hidden', '');\n }\n });\n }\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\nimport { RdxCollapsibleContentToken } from './collapsible-content.token';\nimport { RdxCollapsibleRootDirective } from './collapsible-root.directive';\n\n@Directive({\n selector: '[rdxCollapsibleContent]',\n providers: [\n {\n provide: RdxCollapsibleContentToken,\n useExisting: RdxCollapsibleContentDirective\n }\n ],\n host: {\n '[attr.data-state]': 'collapsible.getState()',\n '[attr.data-disabled]': 'getDisabled()'\n }\n})\nexport class RdxCollapsibleContentDirective {\n protected readonly collapsible = inject(RdxCollapsibleRootDirective);\n\n /**\n * Reference to CollapsibleContent host element\n * @ignore\n */\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n getDisabled(): string | undefined {\n return this.collapsible.disabled() ? 'disabled' : undefined;\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectCollapsible, RdxCollapsibleState } from './collapsible-root.directive';\n\n@Directive({\n selector: '[rdxCollapsibleTrigger]',\n host: {\n '[attr.data-state]': 'getState()',\n '[attr.data-disabled]': 'getDisabled()',\n '[attr.aria-expanded]': 'getState() === \"open\" ? \"true\" : \"false\"',\n '[disabled]': 'getDisabled()',\n\n '(click)': 'onOpenToggle()'\n }\n})\nexport class RdxCollapsibleTriggerDirective {\n /**\n * Reference to CollapsibleRoot\n * @private\n * @ignore\n */\n private readonly collapsible = injectCollapsible();\n\n /**\n * Called on trigger clicked\n */\n onOpenToggle(): void {\n this.collapsible.setOpen();\n }\n\n /**\n * Returns current directive state (open | closed)\n * @ignore\n */\n getState(): RdxCollapsibleState {\n return this.collapsible.getState();\n }\n\n /**\n * Returns current trigger state\n * @ignore\n */\n getDisabled(): string | undefined {\n return this.collapsible.disabled() ? 'disabled' : undefined;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGO,MAAM,0B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,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA9B,8BAA8B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,gBAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,oBAAA,EAAA,eAAA,EAAA,oBAAA,EAAA,gDAAA,EAAA,UAAA,EAAA,eAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAA9B,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAX1C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,yBAAyB;AACnC,oBAAA,IAAI,EAAE;AACF,wBAAA,mBAAmB,EAAE,YAAY;AACjC,wBAAA,sBAAsB,EAAE,eAAe;AACvC,wBAAA,sBAAsB,EAAE,0CAA0C;AAClE,wBAAA,YAAY,EAAE,eAAe;AAE7B,wBAAA,SAAS,EAAE;AACd;AACJ,iBAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-collapsible.mjs","sources":["../../../packages/primitives/collapsible/src/collapsible-root.directive.ts","../../../packages/primitives/collapsible/src/collapsible-content-presence.directive.ts","../../../packages/primitives/collapsible/src/collapsible-content.directive.ts","../../../packages/primitives/collapsible/src/collapsible-trigger.directive.ts","../../../packages/primitives/collapsible/index.ts","../../../packages/primitives/collapsible/radix-ng-primitives-collapsible.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n input,\n InputSignal,\n linkedSignal,\n model,\n ModelSignal,\n output,\n Signal,\n untracked\n} from '@angular/core';\nimport { createContext } from '@radix-ng/primitives/core';\n\nexport type RdxCollapsibleState = 'open' | 'closed';\n\nexport interface CollapsibleRootContext {\n contentId: InputSignal<string>;\n open: ModelSignal<boolean>;\n toggle: () => void;\n disabled: Signal<boolean>;\n}\n\nexport const [injectCollapsibleRootContext, provideCollapsibleRootContext] =\n createContext<CollapsibleRootContext>('CollapsibleRootContext');\n\nconst rootContext = (): CollapsibleRootContext => {\n const instance = inject(RdxCollapsibleRootDirective);\n\n return {\n contentId: instance.contentId,\n disabled: instance.isDisabled,\n open: instance.open,\n toggle: () => {\n untracked(() => instance.open.update((v) => !v));\n instance.onOpenChange.emit(instance.open());\n }\n };\n};\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxCollapsibleRoot]',\n exportAs: 'rdxCollapsibleRoot',\n providers: [provideCollapsibleRootContext(rootContext)],\n host: {\n '[attr.data-state]': 'open() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxCollapsibleRootDirective {\n /**\n * The controlled open state of the collapsible.\n * Sets the state of the directive. `true` - expanded, `false` - collapsed\n *\n * @group Props\n * @defaultValue false\n */\n readonly open = model<boolean>(false);\n\n readonly contentId = input<string>('');\n\n /**\n * Determines whether a directive is available for interaction.\n * When true, prevents the user from interacting with the collapsible.\n *\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly _disabled = linkedSignal(this.disabled);\n\n readonly isDisabled = this._disabled.asReadonly();\n\n readonly isOpen = computed(() => this.open());\n\n /**\n * Emitted with new value when directive state changed.\n * Event handler called when the open state of the collapsible changes.\n *\n * @group Emits\n */\n readonly onOpenChange = output<boolean>();\n}\n","import { Directive } from '@angular/core';\nimport { provideRdxPresenceContext, RdxPresenceDirective } from '@radix-ng/primitives/presence';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n@Directive({\n selector: 'ng-template[rdxCollapsibleContentPresence]',\n providers: [\n provideRdxPresenceContext(() => ({\n present: injectCollapsibleRootContext()!.open\n }))\n ],\n hostDirectives: [RdxPresenceDirective]\n})\nexport class RdxCollapsibleContentPresenceDirective {}\n","import { afterNextRender, computed, Directive, ElementRef, inject, signal } from '@angular/core';\nimport { watch } from '@radix-ng/primitives/core';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n@Directive({\n selector: '[rdxCollapsibleContent]',\n host: {\n id: 'rootContext.contentId()',\n\n '[attr.data-state]': 'rootContext.open() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"true\" : undefined',\n '[style.display]': 'hiddenSignal() ? \"none\" : undefined',\n '[style.--radix-collapsible-content-width.px]': 'width()',\n '[style.--radix-collapsible-content-height.px]': 'height()',\n '(animationend)': 'onAnimationEnd()'\n }\n})\nexport class RdxCollapsibleContentDirective {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected readonly rootContext = injectCollapsibleRootContext()!;\n\n readonly isOpen = computed(() => this.rootContext.open());\n\n readonly height = signal(0);\n readonly width = signal(0);\n readonly isMountAnimationPrevented = signal(true);\n\n private originalStyles: { transition: string; animation: string } = {\n transition: '',\n animation: ''\n };\n\n protected readonly hiddenSignal = signal(false);\n\n constructor() {\n watch([this.isOpen], ([isOpen]) => {\n if (isOpen) {\n this.hiddenSignal.set(false);\n\n setTimeout(() => {\n const node = this.elementRef.nativeElement;\n if (!node) return;\n\n node.style.transition = 'none';\n node.style.animation = 'none';\n\n const rect = node.getBoundingClientRect();\n this.height.set(rect.height);\n this.width.set(rect.width);\n\n if (!this.isMountAnimationPrevented()) {\n node.style.transition = this.originalStyles.transition;\n node.style.animation = this.originalStyles.animation;\n }\n });\n }\n });\n\n afterNextRender(() => {\n this.originalStyles = {\n transition: this.elementRef.nativeElement.style.transition,\n animation: this.elementRef.nativeElement.style.animation\n };\n requestAnimationFrame(() => {\n this.isMountAnimationPrevented.set(false);\n });\n });\n }\n\n onAnimationEnd() {\n if (!this.rootContext.open()) {\n this.hiddenSignal.set(true);\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectCollapsibleRootContext } from './collapsible-root.directive';\n\n@Directive({\n selector: '[rdxCollapsibleTrigger]',\n host: {\n '[attr.aria-controls]': 'rootContext.contentId()',\n '[attr.aria-expanded]': 'rootContext.open()',\n '[attr.data-state]': 'rootContext.open() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"true\" : undefined',\n '[disabled]': 'rootContext.disabled()',\n\n '(click)': 'rootContext.toggle()'\n }\n})\nexport class RdxCollapsibleTriggerDirective {\n protected readonly rootContext = injectCollapsibleRootContext()!;\n}\n","import { NgModule } from '@angular/core';\nimport { RdxCollapsibleContentPresenceDirective } from './src/collapsible-content-presence.directive';\nimport { RdxCollapsibleContentDirective } from './src/collapsible-content.directive';\nimport { RdxCollapsibleRootDirective } from './src/collapsible-root.directive';\nimport { RdxCollapsibleTriggerDirective } from './src/collapsible-trigger.directive';\n\nexport * from './src/collapsible-content-presence.directive';\nexport * from './src/collapsible-content.directive';\nexport * from './src/collapsible-root.directive';\nexport * from './src/collapsible-trigger.directive';\n\nconst _imports = [\n RdxCollapsibleContentDirective,\n RdxCollapsibleRootDirective,\n RdxCollapsibleTriggerDirective,\n RdxCollapsibleContentPresenceDirective\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxCollapsibleModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AA0BO,MAAM,CAAC,4BAA4B,EAAE,6BAA6B,CAAC,GACtE,aAAa,CAAyB,wBAAwB;AAElE,MAAM,WAAW,GAAG,MAA6B;AAC7C,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,2BAA2B,CAAC;IAEpD,OAAO;QACH,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,QAAQ,EAAE,QAAQ,CAAC,UAAU;QAC7B,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,MAAM,EAAE,MAAK;AACT,YAAA,SAAS,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,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