@radix-ng/primitives 1.0.5 → 1.0.7

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 (138) hide show
  1. package/aspect-ratio/README.md +1 -1
  2. package/fesm2022/radix-ng-primitives-accordion.mjs +40 -27
  3. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  4. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +34 -34
  5. package/fesm2022/radix-ng-primitives-arrow.mjs +3 -3
  6. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +11 -35
  7. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-autocomplete.mjs +175 -125
  9. package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-avatar.mjs +92 -35
  11. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  12. package/fesm2022/radix-ng-primitives-button.mjs +11 -7
  13. package/fesm2022/radix-ng-primitives-button.mjs.map +1 -1
  14. package/fesm2022/radix-ng-primitives-calendar.mjs +140 -90
  15. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  16. package/fesm2022/radix-ng-primitives-checkbox.mjs +63 -46
  17. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  18. package/fesm2022/radix-ng-primitives-collapsible.mjs +37 -25
  19. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-combobox.mjs +278 -177
  21. package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
  22. package/fesm2022/radix-ng-primitives-composite.mjs +50 -33
  23. package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -1
  24. package/fesm2022/radix-ng-primitives-config.mjs +7 -5
  25. package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
  26. package/fesm2022/radix-ng-primitives-context-menu.mjs +48 -22
  27. package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
  28. package/fesm2022/radix-ng-primitives-core.mjs +44 -28
  29. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  30. package/fesm2022/radix-ng-primitives-cropper.mjs +73 -45
  31. package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
  32. package/fesm2022/radix-ng-primitives-date-field.mjs +70 -40
  33. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  34. package/fesm2022/radix-ng-primitives-dialog.mjs +93 -67
  35. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  36. package/fesm2022/radix-ng-primitives-direction-provider.mjs +5 -4
  37. package/fesm2022/radix-ng-primitives-direction-provider.mjs.map +1 -1
  38. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +20 -16
  39. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
  40. package/fesm2022/radix-ng-primitives-drawer.mjs +107 -81
  41. package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
  42. package/fesm2022/radix-ng-primitives-editable.mjs +53 -39
  43. package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
  44. package/fesm2022/radix-ng-primitives-field.mjs +76 -50
  45. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
  46. package/fesm2022/radix-ng-primitives-fieldset.mjs +8 -7
  47. package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -1
  48. package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs +77 -40
  49. package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs.map +1 -1
  50. package/fesm2022/radix-ng-primitives-focus-guards.mjs +3 -3
  51. package/fesm2022/radix-ng-primitives-focus-scope.mjs +7 -5
  52. package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
  53. package/fesm2022/radix-ng-primitives-form.mjs +26 -17
  54. package/fesm2022/radix-ng-primitives-form.mjs.map +1 -1
  55. package/fesm2022/radix-ng-primitives-input.mjs +41 -22
  56. package/fesm2022/radix-ng-primitives-input.mjs.map +1 -1
  57. package/fesm2022/radix-ng-primitives-label.mjs +11 -8
  58. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  59. package/fesm2022/radix-ng-primitives-menu.mjs +274 -154
  60. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  61. package/fesm2022/radix-ng-primitives-menubar.mjs +35 -17
  62. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  63. package/fesm2022/radix-ng-primitives-meter.mjs +41 -30
  64. package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -1
  65. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +220 -183
  66. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  67. package/fesm2022/radix-ng-primitives-number-field.mjs +93 -61
  68. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  69. package/fesm2022/radix-ng-primitives-pagination.mjs +48 -38
  70. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  71. package/fesm2022/radix-ng-primitives-popover.mjs +150 -107
  72. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  73. package/fesm2022/radix-ng-primitives-popper.mjs +79 -47
  74. package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
  75. package/fesm2022/radix-ng-primitives-portal.mjs +20 -13
  76. package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
  77. package/fesm2022/radix-ng-primitives-presence.mjs +3 -3
  78. package/fesm2022/radix-ng-primitives-preview-card.mjs +119 -74
  79. package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -1
  80. package/fesm2022/radix-ng-primitives-progress.mjs +73 -46
  81. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  82. package/fesm2022/radix-ng-primitives-radio.mjs +58 -40
  83. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  84. package/fesm2022/radix-ng-primitives-scroll-area.mjs +57 -41
  85. package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
  86. package/fesm2022/radix-ng-primitives-select.mjs +595 -102
  87. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  88. package/fesm2022/radix-ng-primitives-separator.mjs +11 -15
  89. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  90. package/fesm2022/radix-ng-primitives-slider.mjs +101 -64
  91. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  92. package/fesm2022/radix-ng-primitives-stepper.mjs +53 -39
  93. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  94. package/fesm2022/radix-ng-primitives-switch.mjs +25 -20
  95. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  96. package/fesm2022/radix-ng-primitives-tabs.mjs +76 -51
  97. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  98. package/fesm2022/radix-ng-primitives-time-field.mjs +72 -41
  99. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  100. package/fesm2022/radix-ng-primitives-toast.mjs +75 -56
  101. package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -1
  102. package/fesm2022/radix-ng-primitives-toggle-group.mjs +39 -23
  103. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  104. package/fesm2022/radix-ng-primitives-toggle.mjs +36 -36
  105. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  106. package/fesm2022/radix-ng-primitives-toolbar.mjs +52 -31
  107. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  108. package/fesm2022/radix-ng-primitives-tooltip.mjs +118 -63
  109. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  110. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +31 -20
  111. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
  112. package/package.json +2 -2
  113. package/types/radix-ng-primitives-accordion.d.ts +1 -0
  114. package/types/radix-ng-primitives-aspect-ratio.d.ts +10 -23
  115. package/types/radix-ng-primitives-autocomplete.d.ts +3 -1
  116. package/types/radix-ng-primitives-avatar.d.ts +51 -25
  117. package/types/radix-ng-primitives-checkbox.d.ts +26 -98
  118. package/types/radix-ng-primitives-combobox.d.ts +28 -9
  119. package/types/radix-ng-primitives-context-menu.d.ts +2 -0
  120. package/types/radix-ng-primitives-dialog.d.ts +6 -3
  121. package/types/radix-ng-primitives-field.d.ts +33 -207
  122. package/types/radix-ng-primitives-floating-focus-manager.d.ts +11 -0
  123. package/types/radix-ng-primitives-form.d.ts +24 -33
  124. package/types/radix-ng-primitives-label.d.ts +3 -2
  125. package/types/radix-ng-primitives-menu.d.ts +47 -15
  126. package/types/radix-ng-primitives-menubar.d.ts +6 -1
  127. package/types/radix-ng-primitives-navigation-menu.d.ts +8 -6
  128. package/types/radix-ng-primitives-number-field.d.ts +1 -1
  129. package/types/radix-ng-primitives-popover.d.ts +12 -4
  130. package/types/radix-ng-primitives-preview-card.d.ts +18 -5
  131. package/types/radix-ng-primitives-progress.d.ts +59 -121
  132. package/types/radix-ng-primitives-radio.d.ts +0 -1
  133. package/types/radix-ng-primitives-select.d.ts +186 -391
  134. package/types/radix-ng-primitives-separator.d.ts +0 -7
  135. package/types/radix-ng-primitives-toggle-group.d.ts +7 -3
  136. package/types/radix-ng-primitives-toggle.d.ts +8 -8
  137. package/types/radix-ng-primitives-toolbar.d.ts +2 -0
  138. package/types/radix-ng-primitives-tooltip.d.ts +17 -3
@@ -17,34 +17,41 @@ class RdxInputDirective {
17
17
  this.fieldRootContext = injectFieldRootContext(true);
18
18
  this.initialValue = '';
19
19
  this.defaultValueApplied = false;
20
- this.filledValue = signal(false, ...(ngDevMode ? [{ debugName: "filledValue" }] : /* istanbul ignore next */ []));
21
- this.focusedValue = signal(false, ...(ngDevMode ? [{ debugName: "focusedValue" }] : /* istanbul ignore next */ []));
22
- this.dirtyValue = signal(false, ...(ngDevMode ? [{ debugName: "dirtyValue" }] : /* istanbul ignore next */ []));
20
+ this.filledValue = signal(false, /* @ts-ignore */
21
+ ...(ngDevMode ? [{ debugName: "filledValue" }] : /* istanbul ignore next */ []));
22
+ this.focusedValue = signal(false, /* @ts-ignore */
23
+ ...(ngDevMode ? [{ debugName: "focusedValue" }] : /* istanbul ignore next */ []));
24
+ this.dirtyValue = signal(false, /* @ts-ignore */
25
+ ...(ngDevMode ? [{ debugName: "dirtyValue" }] : /* istanbul ignore next */ []));
23
26
  /**
24
27
  * The input id. Field labels and descriptions use this value for accessible relationships.
25
28
  *
26
29
  * @group Props
27
30
  */
28
- this.id = input(`rdx-input-${inputId++}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
31
+ this.id = input(`rdx-input-${inputId++}`, /* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
29
33
  /**
30
34
  * The name of the input, submitted with the form data and used by Form-level
31
35
  * error matching.
32
36
  *
33
37
  * @group Props
34
38
  */
35
- this.name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
39
+ this.name = input(/* @ts-ignore */
40
+ ...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
36
41
  /**
37
42
  * The controlled input value.
38
43
  *
39
44
  * @group Props
40
45
  */
41
- this.value = model(undefined, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
46
+ this.value = model(undefined, /* @ts-ignore */
47
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
42
48
  /**
43
49
  * The initial value when the input is uncontrolled.
44
50
  *
45
51
  * @group Props
46
52
  */
47
- this.defaultValue = input(undefined, ...(ngDevMode ? [{ debugName: "defaultValue" }] : /* istanbul ignore next */ []));
53
+ this.defaultValue = input(undefined, /* @ts-ignore */
54
+ ...(ngDevMode ? [{ debugName: "defaultValue" }] : /* istanbul ignore next */ []));
48
55
  /**
49
56
  * Whether the input is disabled.
50
57
  *
@@ -76,7 +83,8 @@ class RdxInputDirective {
76
83
  *
77
84
  * @group Props
78
85
  */
79
- this.touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
86
+ this.touched = model(false, /* @ts-ignore */
87
+ ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
80
88
  /**
81
89
  * Whether the input value has changed from its initial value. Merged with the
82
90
  * internally tracked state; a form system can own it through this input.
@@ -89,7 +97,8 @@ class RdxInputDirective {
89
97
  *
90
98
  * @group Props
91
99
  */
92
- this.errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
100
+ this.errors = input([], /* @ts-ignore */
101
+ ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
93
102
  /**
94
103
  * Minimum number of characters.
95
104
  *
@@ -108,7 +117,8 @@ class RdxInputDirective {
108
117
  *
109
118
  * @group Props
110
119
  */
111
- this.pattern = input([], ...(ngDevMode ? [{ debugName: "pattern" }] : /* istanbul ignore next */ []));
120
+ this.pattern = input([], /* @ts-ignore */
121
+ ...(ngDevMode ? [{ debugName: "pattern" }] : /* istanbul ignore next */ []));
112
122
  /**
113
123
  * Emits when the input value changes.
114
124
  *
@@ -124,17 +134,25 @@ class RdxInputDirective {
124
134
  * @group Emits
125
135
  */
126
136
  this.touch = output();
127
- this.invalidState = computed(() => this.invalid() || (this.errors()?.length ?? 0) > 0 || Boolean(this.fieldRootContext?.invalidState()), ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
128
- this.disabledState = computed(() => this.disabled() || Boolean(this.fieldRootContext?.disabledState()), ...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
129
- this.requiredState = computed(() => this.required() || Boolean(this.fieldRootContext?.requiredState()), ...(ngDevMode ? [{ debugName: "requiredState" }] : /* istanbul ignore next */ []));
130
- this.filledState = computed(() => this.filledValue() || Boolean(this.fieldRootContext?.filledState()), ...(ngDevMode ? [{ debugName: "filledState" }] : /* istanbul ignore next */ []));
131
- this.focusedState = computed(() => this.focusedValue() || Boolean(this.fieldRootContext?.focusedState()), ...(ngDevMode ? [{ debugName: "focusedState" }] : /* istanbul ignore next */ []));
132
- this.touchedState = computed(() => this.touched() || Boolean(this.fieldRootContext?.touchedState()), ...(ngDevMode ? [{ debugName: "touchedState" }] : /* istanbul ignore next */ []));
133
- this.dirtyState = computed(() => this.dirty() || this.dirtyValue() || Boolean(this.fieldRootContext?.dirtyState()), ...(ngDevMode ? [{ debugName: "dirtyState" }] : /* istanbul ignore next */ []));
137
+ this.invalidState = computed(() => this.invalid() || (this.errors()?.length ?? 0) > 0 || Boolean(this.fieldRootContext?.invalidState()), /* @ts-ignore */
138
+ ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
139
+ this.disabledState = computed(() => this.disabled() || Boolean(this.fieldRootContext?.disabledState()), /* @ts-ignore */
140
+ ...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
141
+ this.requiredState = computed(() => this.required() || Boolean(this.fieldRootContext?.requiredState()), /* @ts-ignore */
142
+ ...(ngDevMode ? [{ debugName: "requiredState" }] : /* istanbul ignore next */ []));
143
+ this.filledState = computed(() => this.filledValue() || Boolean(this.fieldRootContext?.filledState()), /* @ts-ignore */
144
+ ...(ngDevMode ? [{ debugName: "filledState" }] : /* istanbul ignore next */ []));
145
+ this.focusedState = computed(() => this.focusedValue() || Boolean(this.fieldRootContext?.focusedState()), /* @ts-ignore */
146
+ ...(ngDevMode ? [{ debugName: "focusedState" }] : /* istanbul ignore next */ []));
147
+ this.touchedState = computed(() => this.touched() || Boolean(this.fieldRootContext?.touchedState()), /* @ts-ignore */
148
+ ...(ngDevMode ? [{ debugName: "touchedState" }] : /* istanbul ignore next */ []));
149
+ this.dirtyState = computed(() => this.dirty() || this.dirtyValue() || Boolean(this.fieldRootContext?.dirtyState()), /* @ts-ignore */
150
+ ...(ngDevMode ? [{ debugName: "dirtyState" }] : /* istanbul ignore next */ []));
134
151
  this.patternAttr = computed(() => {
135
152
  const patterns = this.pattern();
136
153
  return patterns?.length === 1 ? patterns[0].source : undefined;
137
- }, ...(ngDevMode ? [{ debugName: "patternAttr" }] : /* istanbul ignore next */ []));
154
+ }, /* @ts-ignore */
155
+ ...(ngDevMode ? [{ debugName: "patternAttr" }] : /* istanbul ignore next */ []));
138
156
  this.describedBy = computed(() => {
139
157
  if (!this.fieldRootContext) {
140
158
  return undefined;
@@ -144,7 +162,8 @@ class RdxInputDirective {
144
162
  ...(this.fieldRootContext.invalidState() ? this.fieldRootContext.errorIds() : [])
145
163
  ];
146
164
  return ids.length ? ids.join(' ') : undefined;
147
- }, ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
165
+ }, /* @ts-ignore */
166
+ ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
148
167
  this.dataAttr = attr;
149
168
  effect(() => {
150
169
  const value = this.value();
@@ -207,10 +226,10 @@ class RdxInputDirective {
207
226
  this.element.value = value;
208
227
  this.syncFieldState();
209
228
  }
210
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
211
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxInputDirective, isStandalone: true, selector: "input[rdxInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", 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 }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, pattern: { classPropertyName: "pattern", publicName: "pattern", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange", onValueChange: "onValueChange", touch: "touch" }, host: { listeners: { "focus": "onFocus()", "blur": "onBlur()", "input": "onInput($event)", "change": "syncFieldState()" }, properties: { "attr.id": "id()", "attr.name": "name() || undefined", "attr.aria-describedby": "describedBy()", "attr.aria-invalid": "invalidState() ? \"true\" : undefined", "attr.aria-required": "requiredState() ? \"true\" : undefined", "attr.aria-disabled": "disabledState() ? \"true\" : undefined", "attr.disabled": "disabledState() ? \"\" : undefined", "attr.required": "requiredState() ? \"\" : undefined", "attr.readonly": "readonly() ? \"\" : undefined", "attr.minlength": "minLength() ?? undefined", "attr.maxlength": "maxLength() ?? undefined", "attr.pattern": "patternAttr()", "attr.data-invalid": "dataAttr(invalidState())", "attr.data-valid": "dataAttr(!invalidState())", "attr.data-disabled": "dataAttr(disabledState())", "attr.data-required": "dataAttr(requiredState())", "attr.data-readonly": "dataAttr(readonly())", "attr.data-filled": "dataAttr(filledState())", "attr.data-focused": "dataAttr(focusedState())", "attr.data-touched": "dataAttr(touchedState())", "attr.data-dirty": "dataAttr(dirtyState())" } }, exportAs: ["rdxInput"], ngImport: i0 }); }
229
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
230
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxInputDirective, isStandalone: true, selector: "input[rdxInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", 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 }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, pattern: { classPropertyName: "pattern", publicName: "pattern", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange", onValueChange: "onValueChange", touch: "touch" }, host: { listeners: { "focus": "onFocus()", "blur": "onBlur()", "input": "onInput($event)", "change": "syncFieldState()" }, properties: { "attr.id": "id()", "attr.name": "name() || undefined", "attr.aria-describedby": "describedBy()", "attr.aria-invalid": "invalidState() ? \"true\" : undefined", "attr.aria-required": "requiredState() ? \"true\" : undefined", "attr.aria-disabled": "disabledState() ? \"true\" : undefined", "attr.disabled": "disabledState() ? \"\" : undefined", "attr.required": "requiredState() ? \"\" : undefined", "attr.readonly": "readonly() ? \"\" : undefined", "attr.minlength": "minLength() ?? undefined", "attr.maxlength": "maxLength() ?? undefined", "attr.pattern": "patternAttr()", "attr.data-invalid": "dataAttr(invalidState())", "attr.data-valid": "dataAttr(!invalidState())", "attr.data-disabled": "dataAttr(disabledState())", "attr.data-required": "dataAttr(requiredState())", "attr.data-readonly": "dataAttr(readonly())", "attr.data-filled": "dataAttr(filledState())", "attr.data-focused": "dataAttr(focusedState())", "attr.data-touched": "dataAttr(touchedState())", "attr.data-dirty": "dataAttr(dirtyState())" } }, exportAs: ["rdxInput"], ngImport: i0 }); }
212
231
  }
213
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxInputDirective, decorators: [{
232
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxInputDirective, decorators: [{
214
233
  type: Directive,
215
234
  args: [{
216
235
  selector: 'input[rdxInput]',
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-input.mjs","sources":["../../../packages/primitives/input/src/input.directive.ts","../../../packages/primitives/input/radix-ng-primitives-input.ts"],"sourcesContent":["import {\n afterNextRender,\n booleanAttribute,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n signal\n} from '@angular/core';\nimport { BooleanInput, NumberInput, RdxFormValueControl, RdxValidationError } from '@radix-ng/primitives/core';\nimport { injectFieldRootContext } from '@radix-ng/primitives/field';\n\nlet inputId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\nconst numberOrUndefined = (value: unknown): number | undefined =>\n value == null || value === '' ? undefined : Number(value);\n\n/**\n * The input value. Native text inputs always produce strings, so the model is\n * `string` — matching Signal Forms' `FormValueControl<string>` round-trip.\n */\nexport type RdxInputValue = string;\n\nexport interface RdxInputValueChangeEventDetails {\n event: Event;\n cancel: () => void;\n isCanceled: () => boolean;\n}\n\nexport interface RdxInputValueChangeEvent {\n value: string;\n eventDetails: RdxInputValueChangeEventDetails;\n}\n\n/**\n * A headless text input that can integrate with Field for accessible labeling,\n * descriptions, validation state, and data attributes.\n *\n * @group Components\n */\n@Directive({\n selector: 'input[rdxInput]',\n exportAs: 'rdxInput',\n host: {\n '[attr.id]': 'id()',\n '[attr.name]': 'name() || undefined',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.aria-invalid]': 'invalidState() ? \"true\" : undefined',\n '[attr.aria-required]': 'requiredState() ? \"true\" : undefined',\n '[attr.aria-disabled]': 'disabledState() ? \"true\" : undefined',\n '[attr.disabled]': 'disabledState() ? \"\" : undefined',\n '[attr.required]': 'requiredState() ? \"\" : undefined',\n '[attr.readonly]': 'readonly() ? \"\" : undefined',\n '[attr.minlength]': 'minLength() ?? undefined',\n '[attr.maxlength]': 'maxLength() ?? undefined',\n '[attr.pattern]': 'patternAttr()',\n '[attr.data-invalid]': 'dataAttr(invalidState())',\n '[attr.data-valid]': 'dataAttr(!invalidState())',\n '[attr.data-disabled]': 'dataAttr(disabledState())',\n '[attr.data-required]': 'dataAttr(requiredState())',\n '[attr.data-readonly]': 'dataAttr(readonly())',\n '[attr.data-filled]': 'dataAttr(filledState())',\n '[attr.data-focused]': 'dataAttr(focusedState())',\n '[attr.data-touched]': 'dataAttr(touchedState())',\n '[attr.data-dirty]': 'dataAttr(dirtyState())',\n '(focus)': 'onFocus()',\n '(blur)': 'onBlur()',\n '(input)': 'onInput($event)',\n '(change)': 'syncFieldState()'\n }\n})\nexport class RdxInputDirective implements RdxFormValueControl<RdxInputValue | undefined> {\n private readonly element = inject<ElementRef<HTMLInputElement>>(ElementRef).nativeElement;\n private readonly fieldRootContext = injectFieldRootContext(true);\n private initialValue = '';\n private defaultValueApplied = false;\n private readonly filledValue = signal(false);\n private readonly focusedValue = signal(false);\n private readonly dirtyValue = signal(false);\n\n /**\n * The input id. Field labels and descriptions use this value for accessible relationships.\n *\n * @group Props\n */\n readonly id = input(`rdx-input-${inputId++}`);\n\n /**\n * The name of the input, submitted with the form data and used by Form-level\n * error matching.\n *\n * @group Props\n */\n readonly name = input<string>();\n\n /**\n * The controlled input value.\n *\n * @group Props\n */\n readonly value = model<RdxInputValue | undefined>(undefined);\n\n /**\n * The initial value when the input is uncontrolled.\n *\n * @group Props\n */\n readonly defaultValue = input<RdxInputValue | undefined>(undefined);\n\n /**\n * Whether the input is disabled.\n *\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the input is read-only.\n *\n * @group Props\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the input is required.\n *\n * @group Props\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the input is invalid.\n *\n * @group Props\n */\n readonly invalid = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the input has been touched. A two-way model: the input sets it on\n * blur (emitting `touchedChange`, which Signal Forms' `[formField]` listens\n * to), and a form system can write it back.\n *\n * @group Props\n */\n readonly touched = model<boolean>(false);\n\n /**\n * Whether the input value has changed from its initial value. Merged with the\n * internally tracked state; a form system can own it through this input.\n *\n * @group Props\n */\n readonly dirty = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Validation errors for the input. A non-empty list marks the input invalid.\n *\n * @group Props\n */\n readonly errors = input<readonly RdxValidationError[]>([]);\n\n /**\n * Minimum number of characters.\n *\n * @group Props\n */\n readonly minLength = input<number | undefined, NumberInput>(undefined, { transform: numberOrUndefined });\n\n /**\n * Maximum number of characters.\n *\n * @group Props\n */\n readonly maxLength = input<number | undefined, NumberInput>(undefined, { transform: numberOrUndefined });\n\n /**\n * Patterns the value must match. Reflected to the native `pattern` attribute\n * only when exactly one pattern is provided (the attribute holds a single regex).\n *\n * @group Props\n */\n readonly pattern = input<readonly RegExp[]>([]);\n\n /**\n * Emits when the input value changes.\n *\n * @group Emits\n */\n readonly onValueChange = output<RdxInputValueChangeEvent>();\n\n /**\n * Emits on blur, notifying a form system the input was touched. Stable\n * Angular 22 Signal Forms listens to this `touch` output; the 21.x\n * experimental implementation listens to the `touched` model's\n * `touchedChange` instead — both are emitted, covering either version.\n *\n * @group Emits\n */\n readonly touch = output<void>();\n\n protected readonly invalidState = computed(\n () => this.invalid() || (this.errors()?.length ?? 0) > 0 || Boolean(this.fieldRootContext?.invalidState())\n );\n protected readonly disabledState = computed(\n () => this.disabled() || Boolean(this.fieldRootContext?.disabledState())\n );\n protected readonly requiredState = computed(\n () => this.required() || Boolean(this.fieldRootContext?.requiredState())\n );\n protected readonly filledState = computed(\n () => this.filledValue() || Boolean(this.fieldRootContext?.filledState())\n );\n protected readonly focusedState = computed(\n () => this.focusedValue() || Boolean(this.fieldRootContext?.focusedState())\n );\n protected readonly touchedState = computed(() => this.touched() || Boolean(this.fieldRootContext?.touchedState()));\n protected readonly dirtyState = computed(\n () => this.dirty() || this.dirtyValue() || Boolean(this.fieldRootContext?.dirtyState())\n );\n\n protected readonly patternAttr = computed(() => {\n const patterns = this.pattern();\n return patterns?.length === 1 ? patterns[0].source : undefined;\n });\n\n protected readonly describedBy = computed(() => {\n if (!this.fieldRootContext) {\n return undefined;\n }\n\n const ids = [\n ...this.fieldRootContext.descriptionIds(),\n ...(this.fieldRootContext.invalidState() ? this.fieldRootContext.errorIds() : [])\n ];\n\n return ids.length ? ids.join(' ') : undefined;\n });\n\n constructor() {\n effect(() => {\n const value = this.value();\n\n if (value !== undefined) {\n this.writeValue(value);\n }\n });\n\n effect(() => {\n const defaultValue = this.defaultValue();\n\n if (this.value() === undefined && defaultValue !== undefined && !this.defaultValueApplied) {\n this.defaultValueApplied = true;\n this.writeValue(defaultValue);\n }\n });\n\n effect(() => {\n this.fieldRootContext?.setControlId(this.id());\n });\n\n afterNextRender(() => {\n this.initialValue = this.element.value;\n this.syncFieldState();\n });\n }\n\n onFocus(): void {\n this.focusedValue.set(true);\n this.fieldRootContext?.setFocused(true);\n }\n\n onBlur(): void {\n this.focusedValue.set(false);\n this.touched.set(true);\n this.touch.emit();\n this.fieldRootContext?.setFocused(false);\n this.fieldRootContext?.setTouched(true);\n }\n\n onInput(event: Event): void {\n const nextValue = this.element.value;\n let canceled = false;\n\n const eventDetails: RdxInputValueChangeEventDetails = {\n event,\n cancel: () => {\n canceled = true;\n },\n isCanceled: () => canceled\n };\n\n this.onValueChange.emit({ value: nextValue, eventDetails });\n\n if (canceled) {\n this.writeValue(this.value() ?? this.defaultValue() ?? '');\n return;\n }\n\n this.value.set(nextValue);\n this.syncFieldState();\n }\n\n syncFieldState(): void {\n const value = this.element.value;\n\n this.filledValue.set(value !== '');\n this.dirtyValue.set(value !== this.initialValue);\n this.fieldRootContext?.setFilled(value !== '');\n this.fieldRootContext?.setDirty(value !== this.initialValue);\n }\n\n private writeValue(value: RdxInputValue): void {\n this.element.value = value;\n this.syncFieldState();\n }\n\n protected readonly dataAttr = attr;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAgBA,IAAI,OAAO,GAAG,CAAC;AAEf,MAAM,IAAI,GAAG,CAAC,KAAc,MAAM,KAAK,GAAG,EAAE,GAAG,SAAS,CAAC;AACzD,MAAM,iBAAiB,GAAG,CAAC,KAAc,KACrC,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,GAAG,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC;AAmB7D;;;;;AAKG;MAgCU,iBAAiB,CAAA;AAuK1B,IAAA,WAAA,GAAA;AAtKiB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAA+B,UAAU,CAAC,CAAC,aAAa;AACxE,QAAA,IAAA,CAAA,gBAAgB,GAAG,sBAAsB,CAAC,IAAI,CAAC;QACxD,IAAA,CAAA,YAAY,GAAG,EAAE;QACjB,IAAA,CAAA,mBAAmB,GAAG,KAAK;AAClB,QAAA,IAAA,CAAA,WAAW,GAA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,qBAAqB,EAAE,qCAAqC;AAC5D,wBAAA,sBAAsB,EAAE,sCAAsC;AAC9D,wBAAA,sBAAsB,EAAE,sCAAsC;AAC9D,wBAAA,iBAAiB,EAAE,kCAAkC;AACrD,wBAAA,iBAAiB,EAAE,kCAAkC;AACrD,wBAAA,iBAAiB,EAAE,6BAA6B;AAChD,wBAAA,kBAAkB,EAAE,0BAA0B;AAC9C,wBAAA,kBAAkB,EAAE,0BAA0B;AAC9C,wBAAA,gBAAgB,EAAE,eAAe;AACjC,wBAAA,qBAAqB,EAAE,0BAA0B;AACjD,wBAAA,mBAAmB,EAAE,2BAA2B;AAChD,wBAAA,sBAAsB,EAAE,2BAA2B;AACnD,wBAAA,sBAAsB,EAAE,2BAA2B;AACnD,wBAAA,sBAAsB,EAAE,sBAAsB;AAC9C,wBAAA,oBAAoB,EAAE,yBAAyB;AAC/C,wBAAA,qBAAqB,EAAE,0BAA0B;AACjD,wBAAA,qBAAqB,EAAE,0BAA0B;AACjD,wBAAA,mBAAmB,EAAE,wBAAwB;AAC7C,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,QAAQ,EAAE,UAAU;AACpB,wBAAA,SAAS,EAAE,iBAAiB;AAC5B,wBAAA,UAAU,EAAE;AACf;AACJ,iBAAA;;;AC3ED;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-input.mjs","sources":["../../../packages/primitives/input/src/input.directive.ts","../../../packages/primitives/input/radix-ng-primitives-input.ts"],"sourcesContent":["import {\n afterNextRender,\n booleanAttribute,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n signal\n} from '@angular/core';\nimport { BooleanInput, NumberInput, RdxFormValueControl, RdxValidationError } from '@radix-ng/primitives/core';\nimport { injectFieldRootContext } from '@radix-ng/primitives/field';\n\nlet inputId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\nconst numberOrUndefined = (value: unknown): number | undefined =>\n value == null || value === '' ? undefined : Number(value);\n\n/**\n * The input value. Native text inputs always produce strings, so the model is\n * `string` — matching Signal Forms' `FormValueControl<string>` round-trip.\n */\nexport type RdxInputValue = string;\n\nexport interface RdxInputValueChangeEventDetails {\n event: Event;\n cancel: () => void;\n isCanceled: () => boolean;\n}\n\nexport interface RdxInputValueChangeEvent {\n value: string;\n eventDetails: RdxInputValueChangeEventDetails;\n}\n\n/**\n * A headless text input that can integrate with Field for accessible labeling,\n * descriptions, validation state, and data attributes.\n *\n * @group Components\n */\n@Directive({\n selector: 'input[rdxInput]',\n exportAs: 'rdxInput',\n host: {\n '[attr.id]': 'id()',\n '[attr.name]': 'name() || undefined',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.aria-invalid]': 'invalidState() ? \"true\" : undefined',\n '[attr.aria-required]': 'requiredState() ? \"true\" : undefined',\n '[attr.aria-disabled]': 'disabledState() ? \"true\" : undefined',\n '[attr.disabled]': 'disabledState() ? \"\" : undefined',\n '[attr.required]': 'requiredState() ? \"\" : undefined',\n '[attr.readonly]': 'readonly() ? \"\" : undefined',\n '[attr.minlength]': 'minLength() ?? undefined',\n '[attr.maxlength]': 'maxLength() ?? undefined',\n '[attr.pattern]': 'patternAttr()',\n '[attr.data-invalid]': 'dataAttr(invalidState())',\n '[attr.data-valid]': 'dataAttr(!invalidState())',\n '[attr.data-disabled]': 'dataAttr(disabledState())',\n '[attr.data-required]': 'dataAttr(requiredState())',\n '[attr.data-readonly]': 'dataAttr(readonly())',\n '[attr.data-filled]': 'dataAttr(filledState())',\n '[attr.data-focused]': 'dataAttr(focusedState())',\n '[attr.data-touched]': 'dataAttr(touchedState())',\n '[attr.data-dirty]': 'dataAttr(dirtyState())',\n '(focus)': 'onFocus()',\n '(blur)': 'onBlur()',\n '(input)': 'onInput($event)',\n '(change)': 'syncFieldState()'\n }\n})\nexport class RdxInputDirective implements RdxFormValueControl<RdxInputValue | undefined> {\n private readonly element = inject<ElementRef<HTMLInputElement>>(ElementRef).nativeElement;\n private readonly fieldRootContext = injectFieldRootContext(true);\n private initialValue = '';\n private defaultValueApplied = false;\n private readonly filledValue = signal(false);\n private readonly focusedValue = signal(false);\n private readonly dirtyValue = signal(false);\n\n /**\n * The input id. Field labels and descriptions use this value for accessible relationships.\n *\n * @group Props\n */\n readonly id = input(`rdx-input-${inputId++}`);\n\n /**\n * The name of the input, submitted with the form data and used by Form-level\n * error matching.\n *\n * @group Props\n */\n readonly name = input<string>();\n\n /**\n * The controlled input value.\n *\n * @group Props\n */\n readonly value = model<RdxInputValue | undefined>(undefined);\n\n /**\n * The initial value when the input is uncontrolled.\n *\n * @group Props\n */\n readonly defaultValue = input<RdxInputValue | undefined>(undefined);\n\n /**\n * Whether the input is disabled.\n *\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the input is read-only.\n *\n * @group Props\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the input is required.\n *\n * @group Props\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the input is invalid.\n *\n * @group Props\n */\n readonly invalid = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the input has been touched. A two-way model: the input sets it on\n * blur (emitting `touchedChange`, which Signal Forms' `[formField]` listens\n * to), and a form system can write it back.\n *\n * @group Props\n */\n readonly touched = model<boolean>(false);\n\n /**\n * Whether the input value has changed from its initial value. Merged with the\n * internally tracked state; a form system can own it through this input.\n *\n * @group Props\n */\n readonly dirty = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Validation errors for the input. A non-empty list marks the input invalid.\n *\n * @group Props\n */\n readonly errors = input<readonly RdxValidationError[]>([]);\n\n /**\n * Minimum number of characters.\n *\n * @group Props\n */\n readonly minLength = input<number | undefined, NumberInput>(undefined, { transform: numberOrUndefined });\n\n /**\n * Maximum number of characters.\n *\n * @group Props\n */\n readonly maxLength = input<number | undefined, NumberInput>(undefined, { transform: numberOrUndefined });\n\n /**\n * Patterns the value must match. Reflected to the native `pattern` attribute\n * only when exactly one pattern is provided (the attribute holds a single regex).\n *\n * @group Props\n */\n readonly pattern = input<readonly RegExp[]>([]);\n\n /**\n * Emits when the input value changes.\n *\n * @group Emits\n */\n readonly onValueChange = output<RdxInputValueChangeEvent>();\n\n /**\n * Emits on blur, notifying a form system the input was touched. Stable\n * Angular 22 Signal Forms listens to this `touch` output; the 21.x\n * experimental implementation listens to the `touched` model's\n * `touchedChange` instead — both are emitted, covering either version.\n *\n * @group Emits\n */\n readonly touch = output<void>();\n\n protected readonly invalidState = computed(\n () => this.invalid() || (this.errors()?.length ?? 0) > 0 || Boolean(this.fieldRootContext?.invalidState())\n );\n protected readonly disabledState = computed(\n () => this.disabled() || Boolean(this.fieldRootContext?.disabledState())\n );\n protected readonly requiredState = computed(\n () => this.required() || Boolean(this.fieldRootContext?.requiredState())\n );\n protected readonly filledState = computed(\n () => this.filledValue() || Boolean(this.fieldRootContext?.filledState())\n );\n protected readonly focusedState = computed(\n () => this.focusedValue() || Boolean(this.fieldRootContext?.focusedState())\n );\n protected readonly touchedState = computed(() => this.touched() || Boolean(this.fieldRootContext?.touchedState()));\n protected readonly dirtyState = computed(\n () => this.dirty() || this.dirtyValue() || Boolean(this.fieldRootContext?.dirtyState())\n );\n\n protected readonly patternAttr = computed(() => {\n const patterns = this.pattern();\n return patterns?.length === 1 ? patterns[0].source : undefined;\n });\n\n protected readonly describedBy = computed(() => {\n if (!this.fieldRootContext) {\n return undefined;\n }\n\n const ids = [\n ...this.fieldRootContext.descriptionIds(),\n ...(this.fieldRootContext.invalidState() ? this.fieldRootContext.errorIds() : [])\n ];\n\n return ids.length ? ids.join(' ') : undefined;\n });\n\n constructor() {\n effect(() => {\n const value = this.value();\n\n if (value !== undefined) {\n this.writeValue(value);\n }\n });\n\n effect(() => {\n const defaultValue = this.defaultValue();\n\n if (this.value() === undefined && defaultValue !== undefined && !this.defaultValueApplied) {\n this.defaultValueApplied = true;\n this.writeValue(defaultValue);\n }\n });\n\n effect(() => {\n this.fieldRootContext?.setControlId(this.id());\n });\n\n afterNextRender(() => {\n this.initialValue = this.element.value;\n this.syncFieldState();\n });\n }\n\n onFocus(): void {\n this.focusedValue.set(true);\n this.fieldRootContext?.setFocused(true);\n }\n\n onBlur(): void {\n this.focusedValue.set(false);\n this.touched.set(true);\n this.touch.emit();\n this.fieldRootContext?.setFocused(false);\n this.fieldRootContext?.setTouched(true);\n }\n\n onInput(event: Event): void {\n const nextValue = this.element.value;\n let canceled = false;\n\n const eventDetails: RdxInputValueChangeEventDetails = {\n event,\n cancel: () => {\n canceled = true;\n },\n isCanceled: () => canceled\n };\n\n this.onValueChange.emit({ value: nextValue, eventDetails });\n\n if (canceled) {\n this.writeValue(this.value() ?? this.defaultValue() ?? '');\n return;\n }\n\n this.value.set(nextValue);\n this.syncFieldState();\n }\n\n syncFieldState(): void {\n const value = this.element.value;\n\n this.filledValue.set(value !== '');\n this.dirtyValue.set(value !== this.initialValue);\n this.fieldRootContext?.setFilled(value !== '');\n this.fieldRootContext?.setDirty(value !== this.initialValue);\n }\n\n private writeValue(value: RdxInputValue): void {\n this.element.value = value;\n this.syncFieldState();\n }\n\n protected readonly dataAttr = attr;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAgBA,IAAI,OAAO,GAAG,CAAC;AAEf,MAAM,IAAI,GAAG,CAAC,KAAc,MAAM,KAAK,GAAG,EAAE,GAAG,SAAS,CAAC;AACzD,MAAM,iBAAiB,GAAG,CAAC,KAAc,KACrC,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,GAAG,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC;AAmB7D;;;;;AAKG;MAgCU,iBAAiB,CAAA;AAuK1B,IAAA,WAAA,GAAA;AAtKiB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAA+B,UAAU,CAAC,CAAC,aAAa;AACxE,QAAA,IAAA,CAAA,gB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,sBAAsB,EAAE,sBAAsB;AAC9C,wBAAA,oBAAoB,EAAE,yBAAyB;AAC/C,wBAAA,qBAAqB,EAAE,0BAA0B;AACjD,wBAAA,qBAAqB,EAAE,0BAA0B;AACjD,wBAAA,mBAAmB,EAAE,wBAAwB;AAC7C,wBAAA,SAAS,EAAE,WAAW;AACtB,wBAAA,QAAQ,EAAE,UAAU;AACpB,wBAAA,SAAS,EAAE,iBAAiB;AAC5B,wBAAA,UAAU,EAAE;AACf;AACJ,iBAAA;;;AC3ED;;AAEG;;;;"}
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, ElementRef, input, Directive } from '@angular/core';
3
+ import { injectId } from '@radix-ng/primitives/core';
3
4
 
4
- let idIterator = 0;
5
5
  /**
6
6
  * @group Components
7
7
  */
@@ -9,15 +9,18 @@ class RdxLabelDirective {
9
9
  constructor() {
10
10
  this.elementRef = inject((ElementRef));
11
11
  /**
12
- * @default 'rdx-label-{idIterator}'
12
+ * The label id. Defaults to a stable generated id.
13
+ * @group Props
13
14
  */
14
- this.id = input(`rdx-label-${idIterator++}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
15
+ this.id = input(injectId('rdx-label-'), /* @ts-ignore */
16
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
15
17
  /**
16
18
  * The id of the element the label is associated with.
17
19
  * @group Props
18
- * @defaultValue false
20
+ * @default undefined
19
21
  */
20
- this.htmlFor = input(...(ngDevMode ? [undefined, { debugName: "htmlFor" }] : /* istanbul ignore next */ []));
22
+ this.htmlFor = input(/* @ts-ignore */
23
+ ...(ngDevMode ? [undefined, { debugName: "htmlFor" }] : /* istanbul ignore next */ []));
21
24
  }
22
25
  // prevent text selection when double-clicking label
23
26
  // The main problem with double-clicks in a web app is that
@@ -37,10 +40,10 @@ class RdxLabelDirective {
37
40
  event.preventDefault();
38
41
  }
39
42
  }
40
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
41
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxLabelDirective, isStandalone: true, selector: "label[rdxLabel]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, htmlFor: { classPropertyName: "htmlFor", publicName: "htmlFor", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "onMouseDown($event)" }, properties: { "attr.id": "id()", "attr.for": "htmlFor() ? htmlFor() : undefined" } }, exportAs: ["rdxLabel"], ngImport: i0 }); }
43
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
44
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxLabelDirective, isStandalone: true, selector: "label[rdxLabel]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, htmlFor: { classPropertyName: "htmlFor", publicName: "htmlFor", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "onMouseDown($event)" }, properties: { "attr.id": "id()", "attr.for": "htmlFor() ? htmlFor() : undefined" } }, exportAs: ["rdxLabel"], ngImport: i0 }); }
42
45
  }
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxLabelDirective, decorators: [{
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxLabelDirective, decorators: [{
44
47
  type: Directive,
45
48
  args: [{
46
49
  selector: 'label[rdxLabel]',
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-label.mjs","sources":["../../../packages/primitives/label/src/label.directive.ts","../../../packages/primitives/label/radix-ng-primitives-label.ts"],"sourcesContent":["import { Directive, ElementRef, inject, input } from '@angular/core';\n\nlet idIterator = 0;\n\n/**\n * @group Components\n */\n@Directive({\n selector: 'label[rdxLabel]',\n exportAs: 'rdxLabel',\n host: {\n '[attr.id]': 'id()',\n '[attr.for]': 'htmlFor() ? htmlFor() : undefined',\n '(mousedown)': 'onMouseDown($event)'\n }\n})\nexport class RdxLabelDirective {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * @default 'rdx-label-{idIterator}'\n */\n readonly id = input<string>(`rdx-label-${idIterator++}`);\n\n /**\n * The id of the element the label is associated with.\n * @group Props\n * @defaultValue false\n */\n readonly htmlFor = input<string>();\n\n // prevent text selection when double-clicking label\n // The main problem with double-clicks in a web app is that\n // you will have to create special code to handle this on touch enabled devices.\n /**\n * @ignore\n */\n onMouseDown(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n\n // only prevent text selection if not clicking inside an interactive control (or its\n // descendants), so clicks still focus/activate the associated control.\n if (target.closest('button, input, select, textarea')) {\n return;\n }\n\n // prevent text selection when double-clicking label\n if (this.elementRef.nativeElement.contains(target) && !event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,IAAI,UAAU,GAAG,CAAC;AAElB;;AAEG;MAUU,iBAAiB,CAAA;AAT9B,IAAA,WAAA,GAAA;AAUqB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;AAE7D;;AAEG;QACM,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,CAAA,UAAA,EAAa,UAAU,EAAE,CAAA,CAAE,yEAAC;AAExD;;;;AAIG;QACM,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;AAsBr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A,QAAQ,EAAE,UAAU;AACpB,oBAAA,IAAI,EAAE;AACF,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,YAAY,EAAE,mCAAmC;AACjD,wBAAA,aAAa,EAAE;AAClB;AACJ,iBAAA;;;ACfD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-label.mjs","sources":["../../../packages/primitives/label/src/label.directive.ts","../../../packages/primitives/label/radix-ng-primitives-label.ts"],"sourcesContent":["import { Directive, ElementRef, inject, input } from '@angular/core';\nimport { injectId } from '@radix-ng/primitives/core';\n\n/**\n * @group Components\n */\n@Directive({\n selector: 'label[rdxLabel]',\n exportAs: 'rdxLabel',\n host: {\n '[attr.id]': 'id()',\n '[attr.for]': 'htmlFor() ? htmlFor() : undefined',\n '(mousedown)': 'onMouseDown($event)'\n }\n})\nexport class RdxLabelDirective {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * The label id. Defaults to a stable generated id.\n * @group Props\n */\n readonly id = input<string>(injectId('rdx-label-'));\n\n /**\n * The id of the element the label is associated with.\n * @group Props\n * @default undefined\n */\n readonly htmlFor = input<string>();\n\n // prevent text selection when double-clicking label\n // The main problem with double-clicks in a web app is that\n // you will have to create special code to handle this on touch enabled devices.\n /**\n * @ignore\n */\n onMouseDown(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n\n // only prevent text selection if not clicking inside an interactive control (or its\n // descendants), so clicks still focus/activate the associated control.\n if (target.closest('button, input, select, textarea')) {\n return;\n }\n\n // prevent text selection when double-clicking label\n if (this.elementRef.nativeElement.contains(target) && !event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;AAEG;MAUU,iBAAiB,CAAA;AAT9B,IAAA,WAAA,GAAA;AAUqB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;AAE7D;;;AAGG;AACM,QAA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