forty-cdk 0.2.0 → 0.3.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 (220) hide show
  1. package/accordion/README.md +122 -0
  2. package/aspect-ratio/README.md +76 -0
  3. package/avatar/README.md +100 -0
  4. package/breadcrumbs/README.md +49 -0
  5. package/breakpoints/README.md +81 -0
  6. package/button/README.md +49 -0
  7. package/calendar/README.md +458 -0
  8. package/carousel/README.md +358 -0
  9. package/checkbox/README.md +146 -0
  10. package/combobox/README.md +535 -0
  11. package/context-menu/README.md +139 -0
  12. package/date-field/README.md +184 -0
  13. package/date-picker/README.md +338 -0
  14. package/dialog/README.md +388 -0
  15. package/disclosure/README.md +114 -0
  16. package/drag-drop/README.md +359 -0
  17. package/drawer/README.md +560 -0
  18. package/dropdown-menu/README.md +176 -0
  19. package/fesm2022/forty-cdk-accordion.mjs +348 -0
  20. package/fesm2022/forty-cdk-accordion.mjs.map +1 -0
  21. package/fesm2022/forty-cdk-aspect-ratio.mjs +74 -0
  22. package/fesm2022/forty-cdk-aspect-ratio.mjs.map +1 -0
  23. package/fesm2022/forty-cdk-avatar.mjs +308 -0
  24. package/fesm2022/forty-cdk-avatar.mjs.map +1 -0
  25. package/fesm2022/forty-cdk-breadcrumbs.mjs +125 -0
  26. package/fesm2022/forty-cdk-breadcrumbs.mjs.map +1 -0
  27. package/fesm2022/forty-cdk-breakpoints.mjs +117 -0
  28. package/fesm2022/forty-cdk-breakpoints.mjs.map +1 -0
  29. package/fesm2022/forty-cdk-button.mjs +134 -0
  30. package/fesm2022/forty-cdk-button.mjs.map +1 -0
  31. package/fesm2022/forty-cdk-calendar.mjs +2034 -0
  32. package/fesm2022/forty-cdk-calendar.mjs.map +1 -0
  33. package/fesm2022/forty-cdk-carousel.mjs +968 -0
  34. package/fesm2022/forty-cdk-carousel.mjs.map +1 -0
  35. package/fesm2022/forty-cdk-checkbox.mjs +226 -0
  36. package/fesm2022/forty-cdk-checkbox.mjs.map +1 -0
  37. package/fesm2022/forty-cdk-combobox.mjs +2596 -0
  38. package/fesm2022/forty-cdk-combobox.mjs.map +1 -0
  39. package/fesm2022/forty-cdk-context-menu.mjs +413 -0
  40. package/fesm2022/forty-cdk-context-menu.mjs.map +1 -0
  41. package/fesm2022/forty-cdk-core.mjs +9022 -0
  42. package/fesm2022/forty-cdk-core.mjs.map +1 -0
  43. package/fesm2022/forty-cdk-date-field.mjs +744 -0
  44. package/fesm2022/forty-cdk-date-field.mjs.map +1 -0
  45. package/fesm2022/forty-cdk-date-picker.mjs +1011 -0
  46. package/fesm2022/forty-cdk-date-picker.mjs.map +1 -0
  47. package/fesm2022/forty-cdk-dialog.mjs +707 -0
  48. package/fesm2022/forty-cdk-dialog.mjs.map +1 -0
  49. package/fesm2022/forty-cdk-disclosure.mjs +190 -0
  50. package/fesm2022/forty-cdk-disclosure.mjs.map +1 -0
  51. package/fesm2022/forty-cdk-drag-drop.mjs +1180 -0
  52. package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -0
  53. package/fesm2022/forty-cdk-drawer.mjs +1641 -0
  54. package/fesm2022/forty-cdk-drawer.mjs.map +1 -0
  55. package/fesm2022/forty-cdk-dropdown-menu.mjs +350 -0
  56. package/fesm2022/forty-cdk-dropdown-menu.mjs.map +1 -0
  57. package/fesm2022/forty-cdk-field.mjs +425 -0
  58. package/fesm2022/forty-cdk-field.mjs.map +1 -0
  59. package/fesm2022/forty-cdk-fieldset.mjs +164 -0
  60. package/fesm2022/forty-cdk-fieldset.mjs.map +1 -0
  61. package/fesm2022/forty-cdk-file-upload.mjs +221 -0
  62. package/fesm2022/forty-cdk-file-upload.mjs.map +1 -0
  63. package/fesm2022/forty-cdk-hover-card.mjs +496 -0
  64. package/fesm2022/forty-cdk-hover-card.mjs.map +1 -0
  65. package/fesm2022/forty-cdk-input.mjs +274 -0
  66. package/fesm2022/forty-cdk-input.mjs.map +1 -0
  67. package/fesm2022/forty-cdk-internationalized-date.mjs +1 -1
  68. package/fesm2022/forty-cdk-internationalized-date.mjs.map +1 -1
  69. package/fesm2022/forty-cdk-listbox.mjs +1279 -0
  70. package/fesm2022/forty-cdk-listbox.mjs.map +1 -0
  71. package/fesm2022/forty-cdk-menu.mjs +1439 -0
  72. package/fesm2022/forty-cdk-menu.mjs.map +1 -0
  73. package/fesm2022/forty-cdk-menubar.mjs +787 -0
  74. package/fesm2022/forty-cdk-menubar.mjs.map +1 -0
  75. package/fesm2022/forty-cdk-meter.mjs +211 -0
  76. package/fesm2022/forty-cdk-meter.mjs.map +1 -0
  77. package/fesm2022/forty-cdk-navigation-menu.mjs +1145 -0
  78. package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -0
  79. package/fesm2022/forty-cdk-number-input.mjs +559 -0
  80. package/fesm2022/forty-cdk-number-input.mjs.map +1 -0
  81. package/fesm2022/forty-cdk-otp-input.mjs +527 -0
  82. package/fesm2022/forty-cdk-otp-input.mjs.map +1 -0
  83. package/fesm2022/forty-cdk-pagination.mjs +323 -0
  84. package/fesm2022/forty-cdk-pagination.mjs.map +1 -0
  85. package/fesm2022/forty-cdk-pane-resizer.mjs +297 -0
  86. package/fesm2022/forty-cdk-pane-resizer.mjs.map +1 -0
  87. package/fesm2022/forty-cdk-popover.mjs +698 -0
  88. package/fesm2022/forty-cdk-popover.mjs.map +1 -0
  89. package/fesm2022/forty-cdk-progress.mjs +226 -0
  90. package/fesm2022/forty-cdk-progress.mjs.map +1 -0
  91. package/fesm2022/forty-cdk-radio-group.mjs +378 -0
  92. package/fesm2022/forty-cdk-radio-group.mjs.map +1 -0
  93. package/fesm2022/forty-cdk-scroll-area.mjs +640 -0
  94. package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -0
  95. package/fesm2022/forty-cdk-search.mjs +205 -0
  96. package/fesm2022/forty-cdk-search.mjs.map +1 -0
  97. package/fesm2022/forty-cdk-select.mjs +1661 -0
  98. package/fesm2022/forty-cdk-select.mjs.map +1 -0
  99. package/fesm2022/forty-cdk-separator.mjs +82 -0
  100. package/fesm2022/forty-cdk-separator.mjs.map +1 -0
  101. package/fesm2022/forty-cdk-signal-forms.mjs +97 -0
  102. package/fesm2022/forty-cdk-signal-forms.mjs.map +1 -0
  103. package/fesm2022/forty-cdk-slider.mjs +803 -0
  104. package/fesm2022/forty-cdk-slider.mjs.map +1 -0
  105. package/fesm2022/forty-cdk-stepper.mjs +886 -0
  106. package/fesm2022/forty-cdk-stepper.mjs.map +1 -0
  107. package/fesm2022/forty-cdk-switch.mjs +137 -0
  108. package/fesm2022/forty-cdk-switch.mjs.map +1 -0
  109. package/fesm2022/forty-cdk-table.mjs +1518 -0
  110. package/fesm2022/forty-cdk-table.mjs.map +1 -0
  111. package/fesm2022/forty-cdk-tabs.mjs +400 -0
  112. package/fesm2022/forty-cdk-tabs.mjs.map +1 -0
  113. package/fesm2022/forty-cdk-time-field.mjs +593 -0
  114. package/fesm2022/forty-cdk-time-field.mjs.map +1 -0
  115. package/fesm2022/forty-cdk-time-picker.mjs +1013 -0
  116. package/fesm2022/forty-cdk-time-picker.mjs.map +1 -0
  117. package/fesm2022/forty-cdk-toast.mjs +1153 -0
  118. package/fesm2022/forty-cdk-toast.mjs.map +1 -0
  119. package/fesm2022/forty-cdk-toggle.mjs +516 -0
  120. package/fesm2022/forty-cdk-toggle.mjs.map +1 -0
  121. package/fesm2022/forty-cdk-toolbar.mjs +374 -0
  122. package/fesm2022/forty-cdk-toolbar.mjs.map +1 -0
  123. package/fesm2022/forty-cdk-tooltip.mjs +672 -0
  124. package/fesm2022/forty-cdk-tooltip.mjs.map +1 -0
  125. package/fesm2022/forty-cdk-tree.mjs +2007 -0
  126. package/fesm2022/forty-cdk-tree.mjs.map +1 -0
  127. package/fesm2022/forty-cdk-virtualization.mjs +1 -1
  128. package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
  129. package/fesm2022/forty-cdk.mjs +0 -43310
  130. package/fesm2022/forty-cdk.mjs.map +1 -1
  131. package/field/README.md +97 -0
  132. package/fieldset/README.md +86 -0
  133. package/file-upload/README.md +73 -0
  134. package/hover-card/README.md +171 -0
  135. package/input/README.md +156 -0
  136. package/listbox/README.md +424 -0
  137. package/menu/README.md +181 -0
  138. package/menubar/README.md +140 -0
  139. package/meter/README.md +128 -0
  140. package/navigation-menu/README.md +253 -0
  141. package/number-input/README.md +171 -0
  142. package/otp-input/README.md +198 -0
  143. package/package.json +213 -1
  144. package/pagination/README.md +61 -0
  145. package/pane-resizer/README.md +136 -0
  146. package/popover/README.md +262 -0
  147. package/progress/README.md +115 -0
  148. package/radio-group/README.md +129 -0
  149. package/scroll-area/README.md +184 -0
  150. package/search/README.md +42 -0
  151. package/select/README.md +488 -0
  152. package/separator/README.md +84 -0
  153. package/signal-forms/README.md +72 -0
  154. package/slider/README.md +152 -0
  155. package/stepper/README.md +292 -0
  156. package/switch/README.md +116 -0
  157. package/table/README.md +769 -0
  158. package/tabs/README.md +130 -0
  159. package/time-field/README.md +157 -0
  160. package/time-picker/README.md +172 -0
  161. package/toast/README.md +398 -0
  162. package/toggle/README.md +224 -0
  163. package/toolbar/README.md +109 -0
  164. package/tooltip/README.md +274 -0
  165. package/tree/README.md +708 -0
  166. package/types/forty-cdk-accordion.d.ts +242 -0
  167. package/types/forty-cdk-aspect-ratio.d.ts +59 -0
  168. package/types/forty-cdk-avatar.d.ts +133 -0
  169. package/types/forty-cdk-breadcrumbs.d.ts +92 -0
  170. package/types/forty-cdk-breakpoints.d.ts +141 -0
  171. package/types/forty-cdk-button.d.ts +80 -0
  172. package/types/forty-cdk-calendar.d.ts +914 -0
  173. package/types/forty-cdk-carousel.d.ts +530 -0
  174. package/types/forty-cdk-checkbox.d.ts +141 -0
  175. package/types/forty-cdk-combobox.d.ts +1259 -0
  176. package/types/forty-cdk-context-menu.d.ts +313 -0
  177. package/types/forty-cdk-core.d.ts +5774 -0
  178. package/types/forty-cdk-date-field.d.ts +307 -0
  179. package/types/forty-cdk-date-picker.d.ts +622 -0
  180. package/types/forty-cdk-dialog.d.ts +546 -0
  181. package/types/forty-cdk-disclosure.d.ts +127 -0
  182. package/types/forty-cdk-drag-drop.d.ts +456 -0
  183. package/types/forty-cdk-drawer.d.ts +871 -0
  184. package/types/forty-cdk-dropdown-menu.d.ts +242 -0
  185. package/types/forty-cdk-field.d.ts +236 -0
  186. package/types/forty-cdk-fieldset.d.ts +119 -0
  187. package/types/forty-cdk-file-upload.d.ts +124 -0
  188. package/types/forty-cdk-hover-card.d.ts +320 -0
  189. package/types/forty-cdk-input.d.ts +169 -0
  190. package/types/forty-cdk-internationalized-date.d.ts +1 -1
  191. package/types/forty-cdk-listbox.d.ts +513 -0
  192. package/types/forty-cdk-menu.d.ts +629 -0
  193. package/types/forty-cdk-menubar.d.ts +451 -0
  194. package/types/forty-cdk-meter.d.ts +122 -0
  195. package/types/forty-cdk-navigation-menu.d.ts +514 -0
  196. package/types/forty-cdk-number-input.d.ts +319 -0
  197. package/types/forty-cdk-otp-input.d.ts +248 -0
  198. package/types/forty-cdk-pagination.d.ts +214 -0
  199. package/types/forty-cdk-pane-resizer.d.ts +145 -0
  200. package/types/forty-cdk-popover.d.ts +509 -0
  201. package/types/forty-cdk-progress.d.ts +143 -0
  202. package/types/forty-cdk-radio-group.d.ts +222 -0
  203. package/types/forty-cdk-scroll-area.d.ts +258 -0
  204. package/types/forty-cdk-search.d.ts +142 -0
  205. package/types/forty-cdk-select.d.ts +899 -0
  206. package/types/forty-cdk-separator.d.ts +59 -0
  207. package/types/forty-cdk-signal-forms.d.ts +58 -0
  208. package/types/forty-cdk-slider.d.ts +379 -0
  209. package/types/forty-cdk-stepper.d.ts +650 -0
  210. package/types/forty-cdk-switch.d.ts +87 -0
  211. package/types/forty-cdk-table.d.ts +723 -0
  212. package/types/forty-cdk-tabs.d.ts +235 -0
  213. package/types/forty-cdk-time-field.d.ts +307 -0
  214. package/types/forty-cdk-time-picker.d.ts +578 -0
  215. package/types/forty-cdk-toast.d.ts +598 -0
  216. package/types/forty-cdk-toggle.d.ts +310 -0
  217. package/types/forty-cdk-toolbar.d.ts +217 -0
  218. package/types/forty-cdk-tooltip.d.ts +436 -0
  219. package/types/forty-cdk-tree.d.ts +688 -0
  220. package/types/forty-cdk.d.ts +1 -19743
@@ -0,0 +1,274 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Directive, input, booleanAttribute, inject, ElementRef, PLATFORM_ID, computed, effect } from '@angular/core';
3
+ import { TextValueControlBase, injectElementSize, createDefaults } from 'forty-cdk/core';
4
+ import { isPlatformBrowser } from '@angular/common';
5
+
6
+ /**
7
+ * Headless text `<input>` implementing Angular's `FormValueControl<string>`
8
+ * from `@angular/forms/signals`, so it auto-wires with `[formField]` and
9
+ * auto-associates inside a `[forField]` (label / description / error) with no
10
+ * extra markup.
11
+ *
12
+ * Apply on a native `<input>`. The element keeps its own `type`
13
+ * (`text` / `email` / `password` / …), caret, IME composition, and native form
14
+ * submission — the directive only bridges the value to a signal and reflects
15
+ * validation state. For a multi-line control use `[forTextarea]`.
16
+ *
17
+ * The host gets `data-empty` (while the value is `''`), `data-disabled`, and
18
+ * `data-readonly` for CSS hooks.
19
+ *
20
+ * @example
21
+ * ```html
22
+ * <input forInput [(value)]="email" type="email" />
23
+ *
24
+ * <!-- With Signal Forms + Field (auto-wired): -->
25
+ * <div forField>
26
+ * <label forLabel>Full name</label>
27
+ * <input forInput [formField]="profile.name" />
28
+ * </div>
29
+ * ```
30
+ */
31
+ class ForInput extends TextValueControlBase {
32
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForInput, deps: null, target: i0.ɵɵFactoryTarget.Directive });
33
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: ForInput, isStandalone: true, selector: "[forInput]", host: { listeners: { "input": "onInput($event)", "compositionstart": "onCompositionStart()", "compositionend": "onCompositionEnd()", "blur": "onBlur()" }, properties: { "attr.aria-disabled": "effectiveDisabled() ? \"true\" : null", "attr.aria-readonly": "readonly() ? \"true\" : null", "attr.aria-required": "required() ? \"true\" : null", "attr.aria-invalid": "invalid() ? \"true\" : null", "attr.aria-busy": "pending() ? \"true\" : null", "attr.readonly": "readonly() ? \"\" : null", "attr.data-disabled": "effectiveDisabled() ? \"\" : null", "attr.data-readonly": "readonly() ? \"\" : null", "attr.name": "name() || null", "attr.data-empty": "value() === \"\" ? \"\" : null" } }, exportAs: ["forInput"], usesInheritance: true, ngImport: i0 });
34
+ }
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForInput, decorators: [{
36
+ type: Directive,
37
+ args: [{
38
+ selector: '[forInput]',
39
+ exportAs: 'forInput',
40
+ host: {
41
+ '[attr.aria-disabled]': 'effectiveDisabled() ? "true" : null',
42
+ '[attr.aria-readonly]': 'readonly() ? "true" : null',
43
+ '[attr.aria-required]': 'required() ? "true" : null',
44
+ '[attr.aria-invalid]': 'invalid() ? "true" : null',
45
+ '[attr.aria-busy]': 'pending() ? "true" : null',
46
+ '[attr.readonly]': 'readonly() ? "" : null',
47
+ '[attr.data-disabled]': 'effectiveDisabled() ? "" : null',
48
+ '[attr.data-readonly]': 'readonly() ? "" : null',
49
+ '[attr.name]': 'name() || null',
50
+ '[attr.data-empty]': 'value() === "" ? "" : null',
51
+ '(input)': 'onInput($event)',
52
+ '(compositionstart)': 'onCompositionStart()',
53
+ '(compositionend)': 'onCompositionEnd()',
54
+ '(blur)': 'onBlur()',
55
+ },
56
+ }]
57
+ }] });
58
+
59
+ /**
60
+ * Headless multi-line text `<textarea>` implementing Angular's
61
+ * `FormValueControl<string>` from `@angular/forms/signals`, so it auto-wires
62
+ * with `[formField]` and auto-associates inside a `[forField]` (label /
63
+ * description / error) with no extra markup.
64
+ *
65
+ * Apply on a native `<textarea>`. The element keeps its own caret, wrapping,
66
+ * IME composition, and native form submission — the directive only bridges the
67
+ * value to a signal and reflects validation state. The string-valued sibling
68
+ * of `[forInput]`.
69
+ *
70
+ * The host gets `data-empty` (while the value is `''`), `data-disabled`, and
71
+ * `data-readonly` for CSS hooks.
72
+ *
73
+ * With `[autosize]` the host grows and shrinks its height to fit the content on
74
+ * every edit, programmatic value change, and width reflow, and reflects
75
+ * `data-autosize` for styling (pair it with `resize: none; overflow: hidden;`).
76
+ * Autosize is a DOM side effect gated to the browser, so it is inert under SSR.
77
+ *
78
+ * @example
79
+ * ```html
80
+ * <textarea forTextarea [(value)]="bio" placeholder="About you"></textarea>
81
+ *
82
+ * <!-- Grow to content: -->
83
+ * <textarea forTextarea autosize [(value)]="bio"></textarea>
84
+ *
85
+ * <!-- With Signal Forms + Field (auto-wired): -->
86
+ * <div forField>
87
+ * <label forLabel>Bio</label>
88
+ * <textarea forTextarea [formField]="profile.bio"></textarea>
89
+ * </div>
90
+ * ```
91
+ */
92
+ class ForTextarea extends TextValueControlBase {
93
+ /**
94
+ * Opt into height auto-sizing. When `true` the textarea's height tracks its
95
+ * content: it grows as the value gets taller and shrinks back as it gets
96
+ * shorter, recomputed on every edit, on programmatic `value` writes, and on
97
+ * width reflow. Defaults to `false`, leaving the element's height to CSS.
98
+ */
99
+ autosize = input(false, { ...(ngDevMode ? { debugName: "autosize" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
100
+ #element = inject(ElementRef);
101
+ #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
102
+ #box = injectElementSize(computed(() => (this.autosize() && this.#isBrowser ? this.#element.nativeElement : null)));
103
+ constructor() {
104
+ super();
105
+ effect(() => {
106
+ const el = this.#element.nativeElement;
107
+ this.value();
108
+ this.#box();
109
+ if (!this.autosize() || !this.#isBrowser) {
110
+ el.style.height = '';
111
+ return;
112
+ }
113
+ this.#resizeToContent(el);
114
+ });
115
+ }
116
+ #resizeToContent(el) {
117
+ const view = el.ownerDocument.defaultView;
118
+ if (!view) {
119
+ return;
120
+ }
121
+ const style = view.getComputedStyle(el);
122
+ el.style.height = 'auto';
123
+ const content = el.scrollHeight;
124
+ if (style.boxSizing === 'border-box') {
125
+ const borderY = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
126
+ el.style.height = `${content + borderY}px`;
127
+ }
128
+ else {
129
+ const paddingY = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);
130
+ el.style.height = `${content - paddingY}px`;
131
+ }
132
+ }
133
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForTextarea, deps: [], target: i0.ɵɵFactoryTarget.Directive });
134
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: ForTextarea, isStandalone: true, selector: "[forTextarea]", inputs: { autosize: { classPropertyName: "autosize", publicName: "autosize", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "onInput($event)", "compositionstart": "onCompositionStart()", "compositionend": "onCompositionEnd()", "blur": "onBlur()" }, properties: { "attr.aria-disabled": "effectiveDisabled() ? \"true\" : null", "attr.aria-readonly": "readonly() ? \"true\" : null", "attr.aria-required": "required() ? \"true\" : null", "attr.aria-invalid": "invalid() ? \"true\" : null", "attr.aria-busy": "pending() ? \"true\" : null", "attr.readonly": "readonly() ? \"\" : null", "attr.data-disabled": "effectiveDisabled() ? \"\" : null", "attr.data-readonly": "readonly() ? \"\" : null", "attr.data-autosize": "autosize() ? \"\" : null", "attr.name": "name() || null", "attr.data-empty": "value() === \"\" ? \"\" : null" } }, exportAs: ["forTextarea"], usesInheritance: true, ngImport: i0 });
135
+ }
136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForTextarea, decorators: [{
137
+ type: Directive,
138
+ args: [{
139
+ selector: '[forTextarea]',
140
+ exportAs: 'forTextarea',
141
+ host: {
142
+ '[attr.aria-disabled]': 'effectiveDisabled() ? "true" : null',
143
+ '[attr.aria-readonly]': 'readonly() ? "true" : null',
144
+ '[attr.aria-required]': 'required() ? "true" : null',
145
+ '[attr.aria-invalid]': 'invalid() ? "true" : null',
146
+ '[attr.aria-busy]': 'pending() ? "true" : null',
147
+ '[attr.readonly]': 'readonly() ? "" : null',
148
+ '[attr.data-disabled]': 'effectiveDisabled() ? "" : null',
149
+ '[attr.data-readonly]': 'readonly() ? "" : null',
150
+ '[attr.data-autosize]': 'autosize() ? "" : null',
151
+ '[attr.name]': 'name() || null',
152
+ '[attr.data-empty]': 'value() === "" ? "" : null',
153
+ '(input)': 'onInput($event)',
154
+ '(compositionstart)': 'onCompositionStart()',
155
+ '(compositionend)': 'onCompositionEnd()',
156
+ '(blur)': 'onBlur()',
157
+ },
158
+ }]
159
+ }], ctorParameters: () => [], propDecorators: { autosize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autosize", required: false }] }] } });
160
+
161
+ const FALLBACK = {};
162
+ const { token, provideDefaults } = createDefaults('FOR_INPUT_DEFAULTS', FALLBACK);
163
+ /** Token holding the resolved text-input defaults for the current scope. */
164
+ const FOR_INPUT_DEFAULTS = token;
165
+ /**
166
+ * Configures forty-cdk text-input defaults for this injector scope. Partial
167
+ * overrides inherit unspecified keys from the parent scope (or library
168
+ * defaults at the root).
169
+ */
170
+ function provideForInputDefaults(defaults = {}) {
171
+ return provideDefaults(defaults);
172
+ }
173
+
174
+ /**
175
+ * Exact public names of every `ForInput` input, its models included. Spread it into the
176
+ * `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the
177
+ * primitive's full surface — the Signal Forms members `[formField]` binds among them —
178
+ * without hand-maintaining the list. Always spread into an inline object literal as shown
179
+ * below: the literal is what keeps the entry statically analyzable for consumers compiling
180
+ * against the published package. An anti-drift spec fails when this list no longer matches
181
+ * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported
182
+ * wrapping patterns.
183
+ *
184
+ * @example
185
+ * ```ts
186
+ * @Component({
187
+ * selector: 'input[myInput]',
188
+ * template: '',
189
+ * hostDirectives: [
190
+ * {
191
+ * directive: ForInput,
192
+ * inputs: [...FOR_INPUT_HOST_DIRECTIVE_INPUTS],
193
+ * outputs: [...FOR_INPUT_HOST_DIRECTIVE_OUTPUTS],
194
+ * },
195
+ * ],
196
+ * })
197
+ * export class MyInput {}
198
+ * ```
199
+ */
200
+ const FOR_INPUT_HOST_DIRECTIVE_INPUTS = [
201
+ 'value',
202
+ 'dirty',
203
+ 'disabled',
204
+ 'errors',
205
+ 'invalid',
206
+ 'name',
207
+ 'pending',
208
+ 'readonly',
209
+ 'required',
210
+ 'touched',
211
+ ];
212
+ /**
213
+ * Exact public names of every `ForInput` output, the Signal Forms `touch` output
214
+ * included. Spread it into the `outputs` array of the same `hostDirectives` entry as
215
+ * {@link FOR_INPUT_HOST_DIRECTIVE_INPUTS}.
216
+ */
217
+ const FOR_INPUT_HOST_DIRECTIVE_OUTPUTS = ['valueChange', 'touchedChange', 'touch'];
218
+
219
+ /**
220
+ * Exact public names of every `ForTextarea` input, its models included. Spread it into the
221
+ * `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the
222
+ * primitive's full surface — the Signal Forms members `[formField]` binds among them —
223
+ * without hand-maintaining the list. Always spread into an inline object literal as shown
224
+ * below: the literal is what keeps the entry statically analyzable for consumers compiling
225
+ * against the published package. An anti-drift spec fails when this list no longer matches
226
+ * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported
227
+ * wrapping patterns.
228
+ *
229
+ * @example
230
+ * ```ts
231
+ * @Component({
232
+ * selector: 'textarea[myTextarea]',
233
+ * template: '',
234
+ * hostDirectives: [
235
+ * {
236
+ * directive: ForTextarea,
237
+ * inputs: [...FOR_TEXTAREA_HOST_DIRECTIVE_INPUTS],
238
+ * outputs: [...FOR_TEXTAREA_HOST_DIRECTIVE_OUTPUTS],
239
+ * },
240
+ * ],
241
+ * })
242
+ * export class MyTextarea {}
243
+ * ```
244
+ */
245
+ const FOR_TEXTAREA_HOST_DIRECTIVE_INPUTS = [
246
+ 'value',
247
+ 'autosize',
248
+ 'dirty',
249
+ 'disabled',
250
+ 'errors',
251
+ 'invalid',
252
+ 'name',
253
+ 'pending',
254
+ 'readonly',
255
+ 'required',
256
+ 'touched',
257
+ ];
258
+ /**
259
+ * Exact public names of every `ForTextarea` output, the Signal Forms `touch` output
260
+ * included. Spread it into the `outputs` array of the same `hostDirectives` entry as
261
+ * {@link FOR_TEXTAREA_HOST_DIRECTIVE_INPUTS}.
262
+ */
263
+ const FOR_TEXTAREA_HOST_DIRECTIVE_OUTPUTS = [
264
+ 'valueChange',
265
+ 'touchedChange',
266
+ 'touch',
267
+ ];
268
+
269
+ /**
270
+ * Generated bundle index. Do not edit.
271
+ */
272
+
273
+ export { FOR_INPUT_DEFAULTS, FOR_INPUT_HOST_DIRECTIVE_INPUTS, FOR_INPUT_HOST_DIRECTIVE_OUTPUTS, FOR_TEXTAREA_HOST_DIRECTIVE_INPUTS, FOR_TEXTAREA_HOST_DIRECTIVE_OUTPUTS, ForInput, ForTextarea, provideForInputDefaults };
274
+ //# sourceMappingURL=forty-cdk-input.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forty-cdk-input.mjs","sources":["../../../projects/forty-cdk/input/src/input.ts","../../../projects/forty-cdk/input/src/textarea.ts","../../../projects/forty-cdk/input/src/input-defaults.ts","../../../projects/forty-cdk/input/src/input-host-directive.ts","../../../projects/forty-cdk/input/src/textarea-host-directive.ts","../../../projects/forty-cdk/input/src/forty-cdk-input.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { TextValueControlBase } from 'forty-cdk/core';\n\n/**\n * Headless text `<input>` implementing Angular's `FormValueControl<string>`\n * from `@angular/forms/signals`, so it auto-wires with `[formField]` and\n * auto-associates inside a `[forField]` (label / description / error) with no\n * extra markup.\n *\n * Apply on a native `<input>`. The element keeps its own `type`\n * (`text` / `email` / `password` / …), caret, IME composition, and native form\n * submission — the directive only bridges the value to a signal and reflects\n * validation state. For a multi-line control use `[forTextarea]`.\n *\n * The host gets `data-empty` (while the value is `''`), `data-disabled`, and\n * `data-readonly` for CSS hooks.\n *\n * @example\n * ```html\n * <input forInput [(value)]=\"email\" type=\"email\" />\n *\n * <!-- With Signal Forms + Field (auto-wired): -->\n * <div forField>\n * <label forLabel>Full name</label>\n * <input forInput [formField]=\"profile.name\" />\n * </div>\n * ```\n */\n@Directive({\n selector: '[forInput]',\n exportAs: 'forInput',\n host: {\n '[attr.aria-disabled]': 'effectiveDisabled() ? \"true\" : null',\n '[attr.aria-readonly]': 'readonly() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': 'invalid() ? \"true\" : null',\n '[attr.aria-busy]': 'pending() ? \"true\" : null',\n '[attr.readonly]': 'readonly() ? \"\" : null',\n '[attr.data-disabled]': 'effectiveDisabled() ? \"\" : null',\n '[attr.data-readonly]': 'readonly() ? \"\" : null',\n '[attr.name]': 'name() || null',\n '[attr.data-empty]': 'value() === \"\" ? \"\" : null',\n '(input)': 'onInput($event)',\n '(compositionstart)': 'onCompositionStart()',\n '(compositionend)': 'onCompositionEnd()',\n '(blur)': 'onBlur()',\n },\n})\nexport class ForInput extends TextValueControlBase implements FormValueControl<string> {}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n booleanAttribute,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n PLATFORM_ID,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { injectElementSize, TextValueControlBase } from 'forty-cdk/core';\n\n/**\n * Headless multi-line text `<textarea>` implementing Angular's\n * `FormValueControl<string>` from `@angular/forms/signals`, so it auto-wires\n * with `[formField]` and auto-associates inside a `[forField]` (label /\n * description / error) with no extra markup.\n *\n * Apply on a native `<textarea>`. The element keeps its own caret, wrapping,\n * IME composition, and native form submission — the directive only bridges the\n * value to a signal and reflects validation state. The string-valued sibling\n * of `[forInput]`.\n *\n * The host gets `data-empty` (while the value is `''`), `data-disabled`, and\n * `data-readonly` for CSS hooks.\n *\n * With `[autosize]` the host grows and shrinks its height to fit the content on\n * every edit, programmatic value change, and width reflow, and reflects\n * `data-autosize` for styling (pair it with `resize: none; overflow: hidden;`).\n * Autosize is a DOM side effect gated to the browser, so it is inert under SSR.\n *\n * @example\n * ```html\n * <textarea forTextarea [(value)]=\"bio\" placeholder=\"About you\"></textarea>\n *\n * <!-- Grow to content: -->\n * <textarea forTextarea autosize [(value)]=\"bio\"></textarea>\n *\n * <!-- With Signal Forms + Field (auto-wired): -->\n * <div forField>\n * <label forLabel>Bio</label>\n * <textarea forTextarea [formField]=\"profile.bio\"></textarea>\n * </div>\n * ```\n */\n@Directive({\n selector: '[forTextarea]',\n exportAs: 'forTextarea',\n host: {\n '[attr.aria-disabled]': 'effectiveDisabled() ? \"true\" : null',\n '[attr.aria-readonly]': 'readonly() ? \"true\" : null',\n '[attr.aria-required]': 'required() ? \"true\" : null',\n '[attr.aria-invalid]': 'invalid() ? \"true\" : null',\n '[attr.aria-busy]': 'pending() ? \"true\" : null',\n '[attr.readonly]': 'readonly() ? \"\" : null',\n '[attr.data-disabled]': 'effectiveDisabled() ? \"\" : null',\n '[attr.data-readonly]': 'readonly() ? \"\" : null',\n '[attr.data-autosize]': 'autosize() ? \"\" : null',\n '[attr.name]': 'name() || null',\n '[attr.data-empty]': 'value() === \"\" ? \"\" : null',\n '(input)': 'onInput($event)',\n '(compositionstart)': 'onCompositionStart()',\n '(compositionend)': 'onCompositionEnd()',\n '(blur)': 'onBlur()',\n },\n})\nexport class ForTextarea extends TextValueControlBase implements FormValueControl<string> {\n /**\n * Opt into height auto-sizing. When `true` the textarea's height tracks its\n * content: it grows as the value gets taller and shrinks back as it gets\n * shorter, recomputed on every edit, on programmatic `value` writes, and on\n * width reflow. Defaults to `false`, leaving the element's height to CSS.\n */\n readonly autosize = input(false, { transform: booleanAttribute });\n\n readonly #element = inject<ElementRef<HTMLTextAreaElement>>(ElementRef);\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n readonly #box = injectElementSize(\n computed(() => (this.autosize() && this.#isBrowser ? this.#element.nativeElement : null)),\n );\n\n constructor() {\n super();\n\n effect(() => {\n const el = this.#element.nativeElement;\n this.value();\n this.#box();\n if (!this.autosize() || !this.#isBrowser) {\n el.style.height = '';\n return;\n }\n this.#resizeToContent(el);\n });\n }\n\n #resizeToContent(el: HTMLTextAreaElement): void {\n const view = el.ownerDocument.defaultView;\n if (!view) {\n return;\n }\n const style = view.getComputedStyle(el);\n el.style.height = 'auto';\n const content = el.scrollHeight;\n if (style.boxSizing === 'border-box') {\n const borderY = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n el.style.height = `${content + borderY}px`;\n } else {\n const paddingY = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);\n el.style.height = `${content - paddingY}px`;\n }\n }\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\n\n/**\n * Defaults inherited by descendant `[forInput]` / `[forTextarea]` controls in\n * the surrounding injector scope. Configure with `provideForInputDefaults`.\n * The shape is a stub today — present so future per-scope tuning can land\n * without churning the public surface.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface ForInputDefaults {}\n\nconst FALLBACK: ForInputDefaults = {};\n\nconst { token, provideDefaults } = createDefaults<ForInputDefaults>('FOR_INPUT_DEFAULTS', FALLBACK);\n\n/** Token holding the resolved text-input defaults for the current scope. */\nexport const FOR_INPUT_DEFAULTS = token;\n\n/**\n * Configures forty-cdk text-input defaults for this injector scope. Partial\n * overrides inherit unspecified keys from the parent scope (or library\n * defaults at the root).\n */\nexport function provideForInputDefaults(defaults: Partial<ForInputDefaults> = {}): Provider[] {\n return provideDefaults(defaults);\n}\n","/**\n * Exact public names of every `ForInput` input, its models included. Spread it into the\n * `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the\n * primitive's full surface — the Signal Forms members `[formField]` binds among them —\n * without hand-maintaining the list. Always spread into an inline object literal as shown\n * below: the literal is what keeps the entry statically analyzable for consumers compiling\n * against the published package. An anti-drift spec fails when this list no longer matches\n * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported\n * wrapping patterns.\n *\n * @example\n * ```ts\n * @Component({\n * selector: 'input[myInput]',\n * template: '',\n * hostDirectives: [\n * {\n * directive: ForInput,\n * inputs: [...FOR_INPUT_HOST_DIRECTIVE_INPUTS],\n * outputs: [...FOR_INPUT_HOST_DIRECTIVE_OUTPUTS],\n * },\n * ],\n * })\n * export class MyInput {}\n * ```\n */\nexport const FOR_INPUT_HOST_DIRECTIVE_INPUTS = [\n 'value',\n 'dirty',\n 'disabled',\n 'errors',\n 'invalid',\n 'name',\n 'pending',\n 'readonly',\n 'required',\n 'touched',\n] as const;\n\n/**\n * Exact public names of every `ForInput` output, the Signal Forms `touch` output\n * included. Spread it into the `outputs` array of the same `hostDirectives` entry as\n * {@link FOR_INPUT_HOST_DIRECTIVE_INPUTS}.\n */\nexport const FOR_INPUT_HOST_DIRECTIVE_OUTPUTS = ['valueChange', 'touchedChange', 'touch'] as const;\n","/**\n * Exact public names of every `ForTextarea` input, its models included. Spread it into the\n * `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the\n * primitive's full surface — the Signal Forms members `[formField]` binds among them —\n * without hand-maintaining the list. Always spread into an inline object literal as shown\n * below: the literal is what keeps the entry statically analyzable for consumers compiling\n * against the published package. An anti-drift spec fails when this list no longer matches\n * the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported\n * wrapping patterns.\n *\n * @example\n * ```ts\n * @Component({\n * selector: 'textarea[myTextarea]',\n * template: '',\n * hostDirectives: [\n * {\n * directive: ForTextarea,\n * inputs: [...FOR_TEXTAREA_HOST_DIRECTIVE_INPUTS],\n * outputs: [...FOR_TEXTAREA_HOST_DIRECTIVE_OUTPUTS],\n * },\n * ],\n * })\n * export class MyTextarea {}\n * ```\n */\nexport const FOR_TEXTAREA_HOST_DIRECTIVE_INPUTS = [\n 'value',\n 'autosize',\n 'dirty',\n 'disabled',\n 'errors',\n 'invalid',\n 'name',\n 'pending',\n 'readonly',\n 'required',\n 'touched',\n] as const;\n\n/**\n * Exact public names of every `ForTextarea` output, the Signal Forms `touch` output\n * included. Spread it into the `outputs` array of the same `hostDirectives` entry as\n * {@link FOR_TEXTAREA_HOST_DIRECTIVE_INPUTS}.\n */\nexport const FOR_TEXTAREA_HOST_DIRECTIVE_OUTPUTS = [\n 'valueChange',\n 'touchedChange',\n 'touch',\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AAqBG,MAAO,QAAS,SAAQ,oBAAoB,CAAA;uGAArC,QAAQ,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAR,QAAQ,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,iBAAA,EAAA,kBAAA,EAAA,sBAAA,EAAA,gBAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,EAAA,UAAA,EAAA,EAAA,oBAAA,EAAA,uCAAA,EAAA,oBAAA,EAAA,8BAAA,EAAA,oBAAA,EAAA,8BAAA,EAAA,mBAAA,EAAA,6BAAA,EAAA,gBAAA,EAAA,6BAAA,EAAA,eAAA,EAAA,0BAAA,EAAA,oBAAA,EAAA,mCAAA,EAAA,oBAAA,EAAA,0BAAA,EAAA,WAAA,EAAA,gBAAA,EAAA,iBAAA,EAAA,gCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBApBpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,IAAI,EAAE;A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5B,wBAAA,oBAAoB,EAAE,sBAAsB;AAC5C,wBAAA,kBAAkB,EAAE,oBAAoB;AACxC,wBAAA,QAAQ,EAAE,UAAU;AACrB,qBAAA;AACF,iBAAA;;;ACvDD,MAAM,QAAQ,GAAqB,EAAE;AAErC,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,cAAc,CAAmB,oBAAoB,EAAE,QAAQ,CAAC;AAEnG;AACO,MAAM,kBAAkB,GAAG;AAElC;;;;AAIG;AACG,SAAU,uBAAuB,CAAC,QAAA,GAAsC,EAAE,EAAA;AAC9E,IAAA,OAAO,eAAe,CAAC,QAAQ,CAAC;AAClC;;AC3BA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACI,MAAM,+BAA+B,GAAG;IAC7C,OAAO;IACP,OAAO;IACP,UAAU;IACV,QAAQ;IACR,SAAS;IACT,MAAM;IACN,SAAS;IACT,UAAU;IACV,UAAU;IACV,SAAS;;AAGX;;;;AAIG;AACI,MAAM,gCAAgC,GAAG,CAAC,aAAa,EAAE,eAAe,EAAE,OAAO;;AC5CxF;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACI,MAAM,kCAAkC,GAAG;IAChD,OAAO;IACP,UAAU;IACV,OAAO;IACP,UAAU;IACV,QAAQ;IACR,SAAS;IACT,MAAM;IACN,SAAS;IACT,UAAU;IACV,UAAU;IACV,SAAS;;AAGX;;;;AAIG;AACI,MAAM,mCAAmC,GAAG;IACjD,aAAa;IACb,eAAe;IACf,OAAO;;;AChDT;;AAEG;;;;"}
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable } from '@angular/core';
3
3
  import { today, getLocalTimeZone, CalendarDate, isSameDay, toCalendarDateTime, CalendarDateTime } from '@internationalized/date';
4
- import { FOR_DATE_ADAPTER } from 'forty-cdk';
4
+ import { FOR_DATE_ADAPTER } from 'forty-cdk/core';
5
5
 
6
6
  /**
7
7
  * {@link DateAdapter} over `@internationalized/date`'s immutable `CalendarDate`.
@@ -1 +1 @@
1
- {"version":3,"file":"forty-cdk-internationalized-date.mjs","sources":["../../../projects/forty-cdk/internationalized-date/src/internationalized-date-adapter.ts","../../../projects/forty-cdk/internationalized-date/src/internationalized-date-time-adapter.ts","../../../projects/forty-cdk/internationalized-date/src/forty-cdk-internationalized-date.ts"],"sourcesContent":["import { Injectable, type Provider } from '@angular/core';\nimport { CalendarDate, getLocalTimeZone, isSameDay, today } from '@internationalized/date';\n\nimport { type DateAdapter, FOR_DATE_ADAPTER } from 'forty-cdk';\n\n/**\n * {@link DateAdapter} over `@internationalized/date`'s immutable `CalendarDate`.\n * This is the recommended adapter: it is a widely-used immutable date primitive,\n * it works in every browser today with no polyfill, and its\n * reference-equality-on-mutation makes it signal-friendly.\n *\n * **Gregorian only.** `createDate` always builds a Gregorian `CalendarDate`, so\n * the calendar grid is Gregorian regardless of the runtime locale. True\n * non-Gregorian calendar systems are deferred to the planned Temporal adapter\n * track (#354).\n *\n * Ships in the `forty-cdk/internationalized-date` secondary entry point so the\n * main `forty-cdk` bundle never references `@internationalized/date` — the\n * package is an **optional peer dependency**, required only by consumers who\n * import this entry point. A consumer relying solely on\n * `provideNativeDateAdapter()` never resolves it at all.\n */\n@Injectable()\nexport class InternationalizedDateAdapter implements DateAdapter<CalendarDate> {\n /**\n * Today as a `CalendarDate` in the runtime time zone (`getLocalTimeZone()`).\n * Subject to the SSR/hydration caveat on {@link DateAdapter.today}.\n */\n today(): CalendarDate {\n return today(getLocalTimeZone());\n }\n\n createDate(year: number, month: number, day: number): CalendarDate {\n return new CalendarDate(year, month, day);\n }\n\n getYear(date: CalendarDate): number {\n return date.year;\n }\n\n getMonth(date: CalendarDate): number {\n return date.month;\n }\n\n getDate(date: CalendarDate): number {\n return date.day;\n }\n\n getDayOfWeek(date: CalendarDate): number {\n return date.toDate(getLocalTimeZone()).getDay();\n }\n\n getDaysInMonth(date: CalendarDate): number {\n return date.calendar.getDaysInMonth(date);\n }\n\n getFirstDayOfWeek(): number {\n return 0;\n }\n\n addDays(date: CalendarDate, n: number): CalendarDate {\n return date.add({ days: n });\n }\n\n addMonths(date: CalendarDate, n: number): CalendarDate {\n return date.add({ months: n });\n }\n\n addYears(date: CalendarDate, n: number): CalendarDate {\n return date.add({ years: n });\n }\n\n compare(a: CalendarDate, b: CalendarDate): number {\n return a.compare(b);\n }\n\n isSameDay(a: CalendarDate, b: CalendarDate): boolean {\n return isSameDay(a, b);\n }\n\n isValid(date: CalendarDate): boolean {\n return date instanceof CalendarDate;\n }\n\n /**\n * Formats through the runtime's default locale and time zone. Subject to the\n * SSR/hydration caveat on {@link DateAdapter.format}.\n */\n format(date: CalendarDate, options: Intl.DateTimeFormatOptions): string {\n return new Intl.DateTimeFormat(undefined, options).format(date.toDate(getLocalTimeZone()));\n }\n}\n\n/**\n * Provides the {@link InternationalizedDateAdapter} as the active\n * {@link DateAdapter}, making `ForCalendar` operate on `CalendarDate` values\n * from `@internationalized/date`.\n *\n * Requires `@internationalized/date` to be installed (optional peer\n * dependency).\n *\n * @example\n * ```ts\n * bootstrapApplication(App, {\n * providers: [provideInternationalizedDateAdapter()],\n * });\n * ```\n */\nexport function provideInternationalizedDateAdapter(): Provider[] {\n return [{ provide: FOR_DATE_ADAPTER, useClass: InternationalizedDateAdapter }];\n}\n","import { Injectable, type Provider } from '@angular/core';\r\nimport {\r\n CalendarDateTime,\r\n getLocalTimeZone,\r\n isSameDay,\r\n toCalendarDateTime,\r\n today,\r\n} from '@internationalized/date';\r\n\r\nimport { type DateAdapter, FOR_DATE_ADAPTER } from 'forty-cdk';\r\n\r\n/**\r\n * Time-capable {@link DateAdapter} over `@internationalized/date`'s immutable\r\n * `CalendarDateTime`. It mirrors {@link InternationalizedDateAdapter} for all\r\n * day operations but adds a wall-clock time component (hour / minute / second),\r\n * so it backs `ForTimeField` and the time granularity of the date primitives.\r\n * Use it when you want the `@internationalized/date` types *and* a time.\r\n *\r\n * **Gregorian only.** Like {@link InternationalizedDateAdapter}, `createDate`\r\n * builds a Gregorian `CalendarDateTime`; non-Gregorian calendar systems are\r\n * deferred to the planned Temporal adapter track (#354).\r\n *\r\n * Ships in the `forty-cdk/internationalized-date` secondary entry point so the\r\n * main `forty-cdk` bundle never references `@internationalized/date` — the\r\n * package is an **optional peer dependency**, required only by consumers who\r\n * import this entry point. A consumer relying solely on\r\n * `provideNativeDateAdapter()` never resolves it at all.\r\n *\r\n * `compare` orders by the full date-time (day *and* time); `compareDate`\r\n * ignores the time and orders by calendar day, so the calendar grid stays\r\n * day-granular even when `min`/`max` carry a time.\r\n */\r\n@Injectable()\r\nexport class InternationalizedDateTimeAdapter implements DateAdapter<CalendarDateTime> {\r\n /**\r\n * Today as a `CalendarDateTime` in the runtime time zone\r\n * (`getLocalTimeZone()`). Subject to the SSR/hydration caveat on\r\n * {@link DateAdapter.today}.\r\n */\r\n today(): CalendarDateTime {\r\n return toCalendarDateTime(today(getLocalTimeZone()));\r\n }\r\n\r\n createDate(year: number, month: number, day: number): CalendarDateTime {\r\n return new CalendarDateTime(year, month, day);\r\n }\r\n\r\n getYear(date: CalendarDateTime): number {\r\n return date.year;\r\n }\r\n\r\n getMonth(date: CalendarDateTime): number {\r\n return date.month;\r\n }\r\n\r\n getDate(date: CalendarDateTime): number {\r\n return date.day;\r\n }\r\n\r\n getDayOfWeek(date: CalendarDateTime): number {\r\n return date.toDate(getLocalTimeZone()).getDay();\r\n }\r\n\r\n getDaysInMonth(date: CalendarDateTime): number {\r\n return date.calendar.getDaysInMonth(date);\r\n }\r\n\r\n getFirstDayOfWeek(): number {\r\n return 0;\r\n }\r\n\r\n addDays(date: CalendarDateTime, n: number): CalendarDateTime {\r\n return date.add({ days: n });\r\n }\r\n\r\n addMonths(date: CalendarDateTime, n: number): CalendarDateTime {\r\n return date.add({ months: n });\r\n }\r\n\r\n addYears(date: CalendarDateTime, n: number): CalendarDateTime {\r\n return date.add({ years: n });\r\n }\r\n\r\n compare(a: CalendarDateTime, b: CalendarDateTime): number {\r\n return a.compare(b);\r\n }\r\n\r\n compareDate(a: CalendarDateTime, b: CalendarDateTime): number {\r\n if (a.year !== b.year) {\r\n return a.year - b.year;\r\n }\r\n if (a.month !== b.month) {\r\n return a.month - b.month;\r\n }\r\n return a.day - b.day;\r\n }\r\n\r\n isSameDay(a: CalendarDateTime, b: CalendarDateTime): boolean {\r\n return isSameDay(a, b);\r\n }\r\n\r\n isValid(date: CalendarDateTime): boolean {\r\n return date instanceof CalendarDateTime;\r\n }\r\n\r\n /**\r\n * Formats through the runtime's default locale and time zone. Subject to the\r\n * SSR/hydration caveat on {@link DateAdapter.format}.\r\n */\r\n format(date: CalendarDateTime, options: Intl.DateTimeFormatOptions): string {\r\n return new Intl.DateTimeFormat(undefined, options).format(date.toDate(getLocalTimeZone()));\r\n }\r\n\r\n supportsTime(): boolean {\r\n return true;\r\n }\r\n\r\n getHours(date: CalendarDateTime): number {\r\n return date.hour;\r\n }\r\n\r\n getMinutes(date: CalendarDateTime): number {\r\n return date.minute;\r\n }\r\n\r\n getSeconds(date: CalendarDateTime): number {\r\n return date.second;\r\n }\r\n\r\n setTime(\r\n date: CalendarDateTime,\r\n hours: number,\r\n minutes: number,\r\n seconds: number,\r\n ): CalendarDateTime {\r\n return date.set({ hour: hours, minute: minutes, second: seconds, millisecond: 0 });\r\n }\r\n}\r\n\r\n/**\r\n * Provides the {@link InternationalizedDateTimeAdapter} as the active\r\n * {@link DateAdapter}, making the time / date-time primitives operate on\r\n * `CalendarDateTime` values from `@internationalized/date`.\r\n *\r\n * Requires `@internationalized/date` to be installed (optional peer\r\n * dependency).\r\n *\r\n * @example\r\n * ```ts\r\n * bootstrapApplication(App, {\r\n * providers: [provideInternationalizedDateTimeAdapter()],\r\n * });\r\n * ```\r\n */\r\nexport function provideInternationalizedDateTimeAdapter(): Provider[] {\r\n return [{ provide: FOR_DATE_ADAPTER, useClass: InternationalizedDateTimeAdapter }];\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],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O,CAAC,IAAsB,EAAA;QAC5B,OAAO,IAAI,YAAY,gBAAgB;IACzC;AAEA;;;AAGG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAmC,EAAA;QAChE,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC5F;IAEA,YAAY,GAAA;AACV,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,QAAQ,CAAC,IAAsB,EAAA;QAC7B,OAAO,IAAI,CAAC,IAAI;IAClB;AAEA,IAAA,UAAU,CAAC,IAAsB,EAAA;QAC/B,OAAO,IAAI,CAAC,MAAM;IACpB;AAEA,IAAA,UAAU,CAAC,IAAsB,EAAA;QAC/B,OAAO,IAAI,CAAC,MAAM;IACpB;AAEA,IAAA,OAAO,CACL,IAAsB,EACtB,KAAa,EACb,OAAe,EACf,OAAe,EAAA;QAEf,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC;IACpF;uGAvGW,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAhC,gCAAgC,EAAA,CAAA;;2FAAhC,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAD5C;;AA2GD;;;;;;;;;;;;;;AAcG;SACa,uCAAuC,GAAA;IACrD,OAAO,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gCAAgC,EAAE,CAAC;AACpF;;AC5JA;;AAEG;;;;"}
1
+ {"version":3,"file":"forty-cdk-internationalized-date.mjs","sources":["../../../projects/forty-cdk/internationalized-date/src/internationalized-date-adapter.ts","../../../projects/forty-cdk/internationalized-date/src/internationalized-date-time-adapter.ts","../../../projects/forty-cdk/internationalized-date/src/forty-cdk-internationalized-date.ts"],"sourcesContent":["import { Injectable, type Provider } from '@angular/core';\nimport { CalendarDate, getLocalTimeZone, isSameDay, today } from '@internationalized/date';\n\nimport { type DateAdapter, FOR_DATE_ADAPTER } from 'forty-cdk/core';\n\n/**\n * {@link DateAdapter} over `@internationalized/date`'s immutable `CalendarDate`.\n * This is the recommended adapter: it is a widely-used immutable date primitive,\n * it works in every browser today with no polyfill, and its\n * reference-equality-on-mutation makes it signal-friendly.\n *\n * **Gregorian only.** `createDate` always builds a Gregorian `CalendarDate`, so\n * the calendar grid is Gregorian regardless of the runtime locale. True\n * non-Gregorian calendar systems are deferred to the planned Temporal adapter\n * track (#354).\n *\n * Ships in the `forty-cdk/internationalized-date` secondary entry point so the\n * main `forty-cdk` bundle never references `@internationalized/date` — the\n * package is an **optional peer dependency**, required only by consumers who\n * import this entry point. A consumer relying solely on\n * `provideNativeDateAdapter()` never resolves it at all.\n */\n@Injectable()\nexport class InternationalizedDateAdapter implements DateAdapter<CalendarDate> {\n /**\n * Today as a `CalendarDate` in the runtime time zone (`getLocalTimeZone()`).\n * Subject to the SSR/hydration caveat on {@link DateAdapter.today}.\n */\n today(): CalendarDate {\n return today(getLocalTimeZone());\n }\n\n createDate(year: number, month: number, day: number): CalendarDate {\n return new CalendarDate(year, month, day);\n }\n\n getYear(date: CalendarDate): number {\n return date.year;\n }\n\n getMonth(date: CalendarDate): number {\n return date.month;\n }\n\n getDate(date: CalendarDate): number {\n return date.day;\n }\n\n getDayOfWeek(date: CalendarDate): number {\n return date.toDate(getLocalTimeZone()).getDay();\n }\n\n getDaysInMonth(date: CalendarDate): number {\n return date.calendar.getDaysInMonth(date);\n }\n\n getFirstDayOfWeek(): number {\n return 0;\n }\n\n addDays(date: CalendarDate, n: number): CalendarDate {\n return date.add({ days: n });\n }\n\n addMonths(date: CalendarDate, n: number): CalendarDate {\n return date.add({ months: n });\n }\n\n addYears(date: CalendarDate, n: number): CalendarDate {\n return date.add({ years: n });\n }\n\n compare(a: CalendarDate, b: CalendarDate): number {\n return a.compare(b);\n }\n\n isSameDay(a: CalendarDate, b: CalendarDate): boolean {\n return isSameDay(a, b);\n }\n\n isValid(date: CalendarDate): boolean {\n return date instanceof CalendarDate;\n }\n\n /**\n * Formats through the runtime's default locale and time zone. Subject to the\n * SSR/hydration caveat on {@link DateAdapter.format}.\n */\n format(date: CalendarDate, options: Intl.DateTimeFormatOptions): string {\n return new Intl.DateTimeFormat(undefined, options).format(date.toDate(getLocalTimeZone()));\n }\n}\n\n/**\n * Provides the {@link InternationalizedDateAdapter} as the active\n * {@link DateAdapter}, making `ForCalendar` operate on `CalendarDate` values\n * from `@internationalized/date`.\n *\n * Requires `@internationalized/date` to be installed (optional peer\n * dependency).\n *\n * @example\n * ```ts\n * bootstrapApplication(App, {\n * providers: [provideInternationalizedDateAdapter()],\n * });\n * ```\n */\nexport function provideInternationalizedDateAdapter(): Provider[] {\n return [{ provide: FOR_DATE_ADAPTER, useClass: InternationalizedDateAdapter }];\n}\n","import { Injectable, type Provider } from '@angular/core';\nimport {\n CalendarDateTime,\n getLocalTimeZone,\n isSameDay,\n toCalendarDateTime,\n today,\n} from '@internationalized/date';\n\nimport { type DateAdapter, FOR_DATE_ADAPTER } from 'forty-cdk/core';\n\n/**\n * Time-capable {@link DateAdapter} over `@internationalized/date`'s immutable\n * `CalendarDateTime`. It mirrors {@link InternationalizedDateAdapter} for all\n * day operations but adds a wall-clock time component (hour / minute / second),\n * so it backs `ForTimeField` and the time granularity of the date primitives.\n * Use it when you want the `@internationalized/date` types *and* a time.\n *\n * **Gregorian only.** Like {@link InternationalizedDateAdapter}, `createDate`\n * builds a Gregorian `CalendarDateTime`; non-Gregorian calendar systems are\n * deferred to the planned Temporal adapter track (#354).\n *\n * Ships in the `forty-cdk/internationalized-date` secondary entry point so the\n * main `forty-cdk` bundle never references `@internationalized/date` — the\n * package is an **optional peer dependency**, required only by consumers who\n * import this entry point. A consumer relying solely on\n * `provideNativeDateAdapter()` never resolves it at all.\n *\n * `compare` orders by the full date-time (day *and* time); `compareDate`\n * ignores the time and orders by calendar day, so the calendar grid stays\n * day-granular even when `min`/`max` carry a time.\n */\n@Injectable()\nexport class InternationalizedDateTimeAdapter implements DateAdapter<CalendarDateTime> {\n /**\n * Today as a `CalendarDateTime` in the runtime time zone\n * (`getLocalTimeZone()`). Subject to the SSR/hydration caveat on\n * {@link DateAdapter.today}.\n */\n today(): CalendarDateTime {\n return toCalendarDateTime(today(getLocalTimeZone()));\n }\n\n createDate(year: number, month: number, day: number): CalendarDateTime {\n return new CalendarDateTime(year, month, day);\n }\n\n getYear(date: CalendarDateTime): number {\n return date.year;\n }\n\n getMonth(date: CalendarDateTime): number {\n return date.month;\n }\n\n getDate(date: CalendarDateTime): number {\n return date.day;\n }\n\n getDayOfWeek(date: CalendarDateTime): number {\n return date.toDate(getLocalTimeZone()).getDay();\n }\n\n getDaysInMonth(date: CalendarDateTime): number {\n return date.calendar.getDaysInMonth(date);\n }\n\n getFirstDayOfWeek(): number {\n return 0;\n }\n\n addDays(date: CalendarDateTime, n: number): CalendarDateTime {\n return date.add({ days: n });\n }\n\n addMonths(date: CalendarDateTime, n: number): CalendarDateTime {\n return date.add({ months: n });\n }\n\n addYears(date: CalendarDateTime, n: number): CalendarDateTime {\n return date.add({ years: n });\n }\n\n compare(a: CalendarDateTime, b: CalendarDateTime): number {\n return a.compare(b);\n }\n\n compareDate(a: CalendarDateTime, b: CalendarDateTime): number {\n if (a.year !== b.year) {\n return a.year - b.year;\n }\n if (a.month !== b.month) {\n return a.month - b.month;\n }\n return a.day - b.day;\n }\n\n isSameDay(a: CalendarDateTime, b: CalendarDateTime): boolean {\n return isSameDay(a, b);\n }\n\n isValid(date: CalendarDateTime): boolean {\n return date instanceof CalendarDateTime;\n }\n\n /**\n * Formats through the runtime's default locale and time zone. Subject to the\n * SSR/hydration caveat on {@link DateAdapter.format}.\n */\n format(date: CalendarDateTime, options: Intl.DateTimeFormatOptions): string {\n return new Intl.DateTimeFormat(undefined, options).format(date.toDate(getLocalTimeZone()));\n }\n\n supportsTime(): boolean {\n return true;\n }\n\n getHours(date: CalendarDateTime): number {\n return date.hour;\n }\n\n getMinutes(date: CalendarDateTime): number {\n return date.minute;\n }\n\n getSeconds(date: CalendarDateTime): number {\n return date.second;\n }\n\n setTime(\n date: CalendarDateTime,\n hours: number,\n minutes: number,\n seconds: number,\n ): CalendarDateTime {\n return date.set({ hour: hours, minute: minutes, second: seconds, millisecond: 0 });\n }\n}\n\n/**\n * Provides the {@link InternationalizedDateTimeAdapter} as the active\n * {@link DateAdapter}, making the time / date-time primitives operate on\n * `CalendarDateTime` values from `@internationalized/date`.\n *\n * Requires `@internationalized/date` to be installed (optional peer\n * dependency).\n *\n * @example\n * ```ts\n * bootstrapApplication(App, {\n * providers: [provideInternationalizedDateTimeAdapter()],\n * });\n * ```\n */\nexport function provideInternationalizedDateTimeAdapter(): Provider[] {\n return [{ provide: FOR_DATE_ADAPTER, useClass: InternationalizedDateTimeAdapter }];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAKA;;;;;;;;;;;;;;;;AAgBG;MAEU,4BAA4B,CAAA;AACvC;;;AAGG;IACH,KAAK,GAAA;AACH,QAAA,OAAO,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAClC;AAEA,IAAA,UAAU,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW,EAAA;QACjD,OAAO,IAAI,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC;IAC3C;AAEA,IAAA,OAAO,CAAC,IAAkB,EAAA;QACxB,OAAO,IAAI,CAAC,IAAI;IAClB;AAEA,IAAA,QAAQ,CAAC,IAAkB,EAAA;QACzB,OAAO,IAAI,CAAC,KAAK;IACnB;AAEA,IAAA,OAAO,CAAC,IAAkB,EAAA;QACxB,OAAO,IAAI,CAAC,GAAG;IACjB;AAEA,IAAA,YAAY,CAAC,IAA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