@ngneers/controls 0.0.1-next.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 (186) hide show
  1. package/fesm2022/ngneers-controls-accordion.mjs +234 -0
  2. package/fesm2022/ngneers-controls-accordion.mjs.map +1 -0
  3. package/fesm2022/ngneers-controls-api-ng.mjs +959 -0
  4. package/fesm2022/ngneers-controls-api-ng.mjs.map +1 -0
  5. package/fesm2022/ngneers-controls-api-resize.mjs +712 -0
  6. package/fesm2022/ngneers-controls-api-resize.mjs.map +1 -0
  7. package/fesm2022/ngneers-controls-api.mjs +347 -0
  8. package/fesm2022/ngneers-controls-api.mjs.map +1 -0
  9. package/fesm2022/ngneers-controls-avatar.mjs +77 -0
  10. package/fesm2022/ngneers-controls-avatar.mjs.map +1 -0
  11. package/fesm2022/ngneers-controls-base.mjs +620 -0
  12. package/fesm2022/ngneers-controls-base.mjs.map +1 -0
  13. package/fesm2022/ngneers-controls-breadcrumb.mjs +100 -0
  14. package/fesm2022/ngneers-controls-breadcrumb.mjs.map +1 -0
  15. package/fesm2022/ngneers-controls-button-group.mjs +110 -0
  16. package/fesm2022/ngneers-controls-button-group.mjs.map +1 -0
  17. package/fesm2022/ngneers-controls-button.mjs +83 -0
  18. package/fesm2022/ngneers-controls-button.mjs.map +1 -0
  19. package/fesm2022/ngneers-controls-calendar-time-CJT5AFlA.mjs +74 -0
  20. package/fesm2022/ngneers-controls-calendar-time-CJT5AFlA.mjs.map +1 -0
  21. package/fesm2022/ngneers-controls-calendar.mjs +801 -0
  22. package/fesm2022/ngneers-controls-calendar.mjs.map +1 -0
  23. package/fesm2022/ngneers-controls-checkbox.mjs +63 -0
  24. package/fesm2022/ngneers-controls-checkbox.mjs.map +1 -0
  25. package/fesm2022/ngneers-controls-chip.mjs +55 -0
  26. package/fesm2022/ngneers-controls-chip.mjs.map +1 -0
  27. package/fesm2022/ngneers-controls-default-icons.mjs +82 -0
  28. package/fesm2022/ngneers-controls-default-icons.mjs.map +1 -0
  29. package/fesm2022/ngneers-controls-defer.mjs +72 -0
  30. package/fesm2022/ngneers-controls-defer.mjs.map +1 -0
  31. package/fesm2022/ngneers-controls-dialog.mjs +407 -0
  32. package/fesm2022/ngneers-controls-dialog.mjs.map +1 -0
  33. package/fesm2022/ngneers-controls-directives.mjs +498 -0
  34. package/fesm2022/ngneers-controls-directives.mjs.map +1 -0
  35. package/fesm2022/ngneers-controls-drawer.mjs +271 -0
  36. package/fesm2022/ngneers-controls-drawer.mjs.map +1 -0
  37. package/fesm2022/ngneers-controls-edit-inplace.mjs +127 -0
  38. package/fesm2022/ngneers-controls-edit-inplace.mjs.map +1 -0
  39. package/fesm2022/ngneers-controls-errors.mjs +329 -0
  40. package/fesm2022/ngneers-controls-errors.mjs.map +1 -0
  41. package/fesm2022/ngneers-controls-filter.mjs +708 -0
  42. package/fesm2022/ngneers-controls-filter.mjs.map +1 -0
  43. package/fesm2022/ngneers-controls-hint.mjs +153 -0
  44. package/fesm2022/ngneers-controls-hint.mjs.map +1 -0
  45. package/fesm2022/ngneers-controls-i18n-translations-de.mjs +170 -0
  46. package/fesm2022/ngneers-controls-i18n-translations-de.mjs.map +1 -0
  47. package/fesm2022/ngneers-controls-i18n-translations-en.mjs +170 -0
  48. package/fesm2022/ngneers-controls-i18n-translations-en.mjs.map +1 -0
  49. package/fesm2022/ngneers-controls-i18n.mjs +57 -0
  50. package/fesm2022/ngneers-controls-i18n.mjs.map +1 -0
  51. package/fesm2022/ngneers-controls-icon.mjs +195 -0
  52. package/fesm2022/ngneers-controls-icon.mjs.map +1 -0
  53. package/fesm2022/ngneers-controls-inplace.mjs +150 -0
  54. package/fesm2022/ngneers-controls-inplace.mjs.map +1 -0
  55. package/fesm2022/ngneers-controls-input-field.mjs +165 -0
  56. package/fesm2022/ngneers-controls-input-field.mjs.map +1 -0
  57. package/fesm2022/ngneers-controls-input.mjs +72 -0
  58. package/fesm2022/ngneers-controls-input.mjs.map +1 -0
  59. package/fesm2022/ngneers-controls-item-view.mjs +473 -0
  60. package/fesm2022/ngneers-controls-item-view.mjs.map +1 -0
  61. package/fesm2022/ngneers-controls-list-box.mjs +281 -0
  62. package/fesm2022/ngneers-controls-list-box.mjs.map +1 -0
  63. package/fesm2022/ngneers-controls-mask-input.mjs +888 -0
  64. package/fesm2022/ngneers-controls-mask-input.mjs.map +1 -0
  65. package/fesm2022/ngneers-controls-menu.mjs +371 -0
  66. package/fesm2022/ngneers-controls-menu.mjs.map +1 -0
  67. package/fesm2022/ngneers-controls-message.mjs +30 -0
  68. package/fesm2022/ngneers-controls-message.mjs.map +1 -0
  69. package/fesm2022/ngneers-controls-number-input.mjs +366 -0
  70. package/fesm2022/ngneers-controls-number-input.mjs.map +1 -0
  71. package/fesm2022/ngneers-controls-paginator.mjs +129 -0
  72. package/fesm2022/ngneers-controls-paginator.mjs.map +1 -0
  73. package/fesm2022/ngneers-controls-popover.mjs +215 -0
  74. package/fesm2022/ngneers-controls-popover.mjs.map +1 -0
  75. package/fesm2022/ngneers-controls-progress.mjs +98 -0
  76. package/fesm2022/ngneers-controls-progress.mjs.map +1 -0
  77. package/fesm2022/ngneers-controls-radio.mjs +152 -0
  78. package/fesm2022/ngneers-controls-radio.mjs.map +1 -0
  79. package/fesm2022/ngneers-controls-roving-focus.mjs +323 -0
  80. package/fesm2022/ngneers-controls-roving-focus.mjs.map +1 -0
  81. package/fesm2022/ngneers-controls-scroll-shadow.mjs +65 -0
  82. package/fesm2022/ngneers-controls-scroll-shadow.mjs.map +1 -0
  83. package/fesm2022/ngneers-controls-scroller.mjs +308 -0
  84. package/fesm2022/ngneers-controls-scroller.mjs.map +1 -0
  85. package/fesm2022/ngneers-controls-select-button.mjs +58 -0
  86. package/fesm2022/ngneers-controls-select-button.mjs.map +1 -0
  87. package/fesm2022/ngneers-controls-select.mjs +417 -0
  88. package/fesm2022/ngneers-controls-select.mjs.map +1 -0
  89. package/fesm2022/ngneers-controls-slider.mjs +167 -0
  90. package/fesm2022/ngneers-controls-slider.mjs.map +1 -0
  91. package/fesm2022/ngneers-controls-snackbar.mjs +414 -0
  92. package/fesm2022/ngneers-controls-snackbar.mjs.map +1 -0
  93. package/fesm2022/ngneers-controls-spin-buttons.mjs +126 -0
  94. package/fesm2022/ngneers-controls-spin-buttons.mjs.map +1 -0
  95. package/fesm2022/ngneers-controls-spinner.mjs +184 -0
  96. package/fesm2022/ngneers-controls-spinner.mjs.map +1 -0
  97. package/fesm2022/ngneers-controls-splitter.mjs +604 -0
  98. package/fesm2022/ngneers-controls-splitter.mjs.map +1 -0
  99. package/fesm2022/ngneers-controls-state.mjs +185 -0
  100. package/fesm2022/ngneers-controls-state.mjs.map +1 -0
  101. package/fesm2022/ngneers-controls-switch.mjs +39 -0
  102. package/fesm2022/ngneers-controls-switch.mjs.map +1 -0
  103. package/fesm2022/ngneers-controls-table.mjs +2634 -0
  104. package/fesm2022/ngneers-controls-table.mjs.map +1 -0
  105. package/fesm2022/ngneers-controls-tabs.mjs +336 -0
  106. package/fesm2022/ngneers-controls-tabs.mjs.map +1 -0
  107. package/fesm2022/ngneers-controls-tag.mjs +30 -0
  108. package/fesm2022/ngneers-controls-tag.mjs.map +1 -0
  109. package/fesm2022/ngneers-controls-toast.mjs +350 -0
  110. package/fesm2022/ngneers-controls-toast.mjs.map +1 -0
  111. package/fesm2022/ngneers-controls-toggle-button.mjs +70 -0
  112. package/fesm2022/ngneers-controls-toggle-button.mjs.map +1 -0
  113. package/fesm2022/ngneers-controls-tooltip.mjs +506 -0
  114. package/fesm2022/ngneers-controls-tooltip.mjs.map +1 -0
  115. package/fesm2022/ngneers-controls-tree.mjs +599 -0
  116. package/fesm2022/ngneers-controls-tree.mjs.map +1 -0
  117. package/fesm2022/ngneers-controls-upload.mjs +377 -0
  118. package/fesm2022/ngneers-controls-upload.mjs.map +1 -0
  119. package/fesm2022/ngneers-controls-utils-ng.mjs +411 -0
  120. package/fesm2022/ngneers-controls-utils-ng.mjs.map +1 -0
  121. package/fesm2022/ngneers-controls-utils.mjs +261 -0
  122. package/fesm2022/ngneers-controls-utils.mjs.map +1 -0
  123. package/fesm2022/ngneers-controls.mjs +6 -0
  124. package/fesm2022/ngneers-controls.mjs.map +1 -0
  125. package/package.json +302 -0
  126. package/types/ngneers-controls-accordion.d.ts +139 -0
  127. package/types/ngneers-controls-api-ng.d.ts +364 -0
  128. package/types/ngneers-controls-api-resize.d.ts +318 -0
  129. package/types/ngneers-controls-api.d.ts +145 -0
  130. package/types/ngneers-controls-avatar.d.ts +54 -0
  131. package/types/ngneers-controls-base.d.ts +277 -0
  132. package/types/ngneers-controls-breadcrumb.d.ts +272 -0
  133. package/types/ngneers-controls-button-group.d.ts +46 -0
  134. package/types/ngneers-controls-button.d.ts +48 -0
  135. package/types/ngneers-controls-calendar.d.ts +466 -0
  136. package/types/ngneers-controls-checkbox.d.ts +40 -0
  137. package/types/ngneers-controls-chip.d.ts +202 -0
  138. package/types/ngneers-controls-default-icons.d.ts +5 -0
  139. package/types/ngneers-controls-defer.d.ts +48 -0
  140. package/types/ngneers-controls-dialog.d.ts +399 -0
  141. package/types/ngneers-controls-directives.d.ts +171 -0
  142. package/types/ngneers-controls-drawer.d.ts +308 -0
  143. package/types/ngneers-controls-edit-inplace.d.ts +263 -0
  144. package/types/ngneers-controls-errors.d.ts +155 -0
  145. package/types/ngneers-controls-filter.d.ts +609 -0
  146. package/types/ngneers-controls-hint.d.ts +88 -0
  147. package/types/ngneers-controls-i18n-translations-de.d.ts +164 -0
  148. package/types/ngneers-controls-i18n-translations-en.d.ts +164 -0
  149. package/types/ngneers-controls-i18n.d.ts +186 -0
  150. package/types/ngneers-controls-icon.d.ts +68 -0
  151. package/types/ngneers-controls-inplace.d.ts +98 -0
  152. package/types/ngneers-controls-input-field.d.ts +248 -0
  153. package/types/ngneers-controls-input.d.ts +30 -0
  154. package/types/ngneers-controls-item-view.d.ts +215 -0
  155. package/types/ngneers-controls-list-box.d.ts +334 -0
  156. package/types/ngneers-controls-mask-input.d.ts +434 -0
  157. package/types/ngneers-controls-menu.d.ts +192 -0
  158. package/types/ngneers-controls-message.d.ts +21 -0
  159. package/types/ngneers-controls-number-input.d.ts +146 -0
  160. package/types/ngneers-controls-paginator.d.ts +255 -0
  161. package/types/ngneers-controls-popover.d.ts +116 -0
  162. package/types/ngneers-controls-progress.d.ts +49 -0
  163. package/types/ngneers-controls-radio.d.ts +91 -0
  164. package/types/ngneers-controls-roving-focus.d.ts +107 -0
  165. package/types/ngneers-controls-scroll-shadow.d.ts +25 -0
  166. package/types/ngneers-controls-scroller.d.ts +151 -0
  167. package/types/ngneers-controls-select-button.d.ts +51 -0
  168. package/types/ngneers-controls-select.d.ts +409 -0
  169. package/types/ngneers-controls-slider.d.ts +57 -0
  170. package/types/ngneers-controls-snackbar.d.ts +330 -0
  171. package/types/ngneers-controls-spin-buttons.d.ts +69 -0
  172. package/types/ngneers-controls-spinner.d.ts +117 -0
  173. package/types/ngneers-controls-splitter.d.ts +465 -0
  174. package/types/ngneers-controls-state.d.ts +102 -0
  175. package/types/ngneers-controls-switch.d.ts +18 -0
  176. package/types/ngneers-controls-table.d.ts +3127 -0
  177. package/types/ngneers-controls-tabs.d.ts +118 -0
  178. package/types/ngneers-controls-tag.d.ts +21 -0
  179. package/types/ngneers-controls-toast.d.ts +298 -0
  180. package/types/ngneers-controls-toggle-button.d.ts +48 -0
  181. package/types/ngneers-controls-tooltip.d.ts +189 -0
  182. package/types/ngneers-controls-tree.d.ts +409 -0
  183. package/types/ngneers-controls-upload.d.ts +347 -0
  184. package/types/ngneers-controls-utils-ng.d.ts +129 -0
  185. package/types/ngneers-controls-utils.d.ts +130 -0
  186. package/types/ngneers-controls.d.ts +2 -0
@@ -0,0 +1,347 @@
1
+ import * as _ngneers_controls_custom_types from '@ngneers/controls-custom-types';
2
+ import * as _iconify_types from '@iconify/types';
3
+ import * as _angular_core from '@angular/core';
4
+ import * as _ngneers_signal_translate from '@ngneers/signal-translate';
5
+ import * as _ngneers_controls_api_ng from '@ngneers/controls/api/ng';
6
+ import * as _ngneers_controls_themes from '@ngneers/controls-themes';
7
+ import { NgnBase } from '@ngneers/controls/base';
8
+
9
+ /**
10
+ * The lifecycle state of a single {@link NgnUploadFile}.
11
+ *
12
+ * - `pending` — queued, not yet handed to the consumer (manual mode, or pre-emit).
13
+ * - `uploading` — emitted via `(upload)`, the consumer is transferring it.
14
+ * - `done` — the consumer reported success via `markDone`.
15
+ * - `failed` — the consumer reported an error via `markFailed`.
16
+ * - `cancelled` — dismissed while in-flight; the item is removed from the list
17
+ * but settles the upload promise in this terminal state.
18
+ */
19
+ type NgnUploadFileState = 'pending' | 'uploading' | 'done' | 'failed' | 'cancelled';
20
+ /**
21
+ * A file tracked by {@link NgnUpload}. Wraps the native {@link File} with the
22
+ * control-owned {@link id} (used to report progress/status back through the
23
+ * `exportAs` handle) and the current lifecycle {@link state}.
24
+ *
25
+ * The control cannot observe the real upload — the consumer runs the request —
26
+ * so {@link progress} is only meaningful once the consumer wires it back via
27
+ * `setProgress`. It stays `0` (rendered as an indeterminate bar while
28
+ * `uploading`) until then.
29
+ */
30
+ interface NgnUploadFile {
31
+ /** Stable, control-generated id. Use it to call back through the handle. */
32
+ readonly id: string;
33
+ /** The native file selected or dropped by the user. */
34
+ readonly file: File;
35
+ /** Current lifecycle state. */
36
+ state: NgnUploadFileState;
37
+ /** Upload progress in the range `0`–`100`. `0` renders as indeterminate. */
38
+ progress: number;
39
+ /** Error reported by the consumer for a `failed` file, if any. */
40
+ error?: unknown;
41
+ }
42
+
43
+ /** How the user is allowed to add files to the drop zone. */
44
+ type NgnUploadInteraction = 'click' | 'drag' | 'both';
45
+ /**
46
+ * When selected/dropped files start uploading.
47
+ * - `auto` — instantly.
48
+ * - `confirm` — queued as `pending`; the user presses a rendered trigger.
49
+ * - `manual` — queued as `pending`; no trigger is rendered, upload starts only
50
+ * via {@link NgnUpload.uploadAll}/{@link NgnUpload.uploadFile} from code.
51
+ */
52
+ type NgnUploadMode = 'auto' | 'confirm' | 'manual';
53
+ /** Which trigger(s) are rendered in `confirm` mode. */
54
+ type NgnUploadConfirmTrigger = 'all' | 'per-item' | 'both';
55
+ /** Where the file list renders relative to the drop zone. */
56
+ type NgnUploadListPosition = 'top' | 'bottom' | 'left' | 'right';
57
+ /**
58
+ * A file drop zone that wraps a **consumer-provided** native `input[type=file]`.
59
+ * Project the input as content and configure its native features there
60
+ * (`accept`, `multiple`, `name`, size limits, …) — the control discovers it,
61
+ * hides it, and drives it:
62
+ *
63
+ * ```html
64
+ * <ngn-upload #up="ngnUpload" mode="auto" (upload)="send($event, up)">
65
+ * <input type="file" multiple accept="image/*" />
66
+ * </ngn-upload>
67
+ * ```
68
+ *
69
+ * The control owns the list of {@link NgnUploadFile}s and their lifecycle
70
+ * state, but it **cannot** observe the actual transfer (the consumer runs the
71
+ * request). Report progress/status back through the `exportAs="ngnUpload"`
72
+ * handle: {@link setProgress}, {@link markDone}, {@link markFailed}.
73
+ *
74
+ * @category control
75
+ */
76
+ declare class NgnUpload extends NgnBase<'upload'> {
77
+ protected readonly theme: _ngneers_controls_api_ng.ControlTemplateInfo<_ngneers_controls_themes.ControlTemplate<"upload", ["root", "dragover", "disabled", "clickable", "draggable", "has-files", "list-top", "list-bottom", "list-left", "list-right", "main", "zone", "icon", "placeholder", "list", "item", "item-pending", "item-uploading", "item-done", "item-failed", "status", "file", "name", "size", "progress", "actions", "action", "footer", "trigger"], readonly []>>;
78
+ protected readonly i18n: _ngneers_signal_translate.TranslationsSignal<{
79
+ calendar: {
80
+ today: string;
81
+ input: string;
82
+ selectYear: string;
83
+ selectMonth: string;
84
+ previousMonth: string;
85
+ nextMonth: string;
86
+ weekdays: {
87
+ monday: string;
88
+ tuesday: string;
89
+ wednesday: string;
90
+ thursday: string;
91
+ friday: string;
92
+ saturday: string;
93
+ sunday: string;
94
+ };
95
+ weekdaysShort: {
96
+ monday: string;
97
+ tuesday: string;
98
+ wednesday: string;
99
+ thursday: string;
100
+ friday: string;
101
+ saturday: string;
102
+ sunday: string;
103
+ };
104
+ months: {
105
+ january: string;
106
+ february: string;
107
+ march: string;
108
+ april: string;
109
+ may: string;
110
+ june: string;
111
+ july: string;
112
+ august: string;
113
+ september: string;
114
+ october: string;
115
+ november: string;
116
+ december: string;
117
+ };
118
+ };
119
+ editInplace: {
120
+ placeholder: string;
121
+ confirm: string;
122
+ };
123
+ filter: {
124
+ noFilter: string;
125
+ addCondition: string;
126
+ removeCondition: string;
127
+ operator: string;
128
+ value: string;
129
+ clear: string;
130
+ apply: string;
131
+ cancel: string;
132
+ matchModeLabel: string;
133
+ match: {
134
+ all: string;
135
+ any: string;
136
+ and: string;
137
+ or: string;
138
+ };
139
+ selected: string;
140
+ conditions: string;
141
+ operators: {
142
+ isEqual: string;
143
+ isNotEqual: string;
144
+ contains: string;
145
+ startsWith: string;
146
+ endsWith: string;
147
+ in: string;
148
+ isEmpty: string;
149
+ isNotEmpty: string;
150
+ greaterThan: string;
151
+ greaterThanOrEqual: string;
152
+ lessThan: string;
153
+ lessThanOrEqual: string;
154
+ after: string;
155
+ onOrAfter: string;
156
+ before: string;
157
+ onOrBefore: string;
158
+ isTrue: string;
159
+ isFalse: string;
160
+ custom: string;
161
+ };
162
+ };
163
+ splitter: {
164
+ handleLabel: string;
165
+ };
166
+ inputField: {
167
+ clearInput: string;
168
+ };
169
+ maskInput: {
170
+ roleDescription: string;
171
+ segmentRange: string;
172
+ optionSeparator: string;
173
+ };
174
+ drawer: {
175
+ close: string;
176
+ };
177
+ dialog: {
178
+ close: string;
179
+ };
180
+ chip: {
181
+ close: string;
182
+ };
183
+ breadcrumb: {
184
+ overflow: string;
185
+ };
186
+ toast: {
187
+ close: string;
188
+ region: string;
189
+ };
190
+ snackbar: {
191
+ close: string;
192
+ region: string;
193
+ severity: {
194
+ error: string;
195
+ warning: string;
196
+ success: string;
197
+ info: string;
198
+ };
199
+ };
200
+ upload: {
201
+ upload: string;
202
+ uploadNamed: string;
203
+ retryNamed: string;
204
+ cancelNamed: string;
205
+ removeNamed: string;
206
+ progressNamed: string;
207
+ };
208
+ select: {
209
+ filterOptions: string;
210
+ };
211
+ paginator: {
212
+ previousPage: string;
213
+ nextPage: string;
214
+ };
215
+ listBox: {
216
+ noItemsFound: string;
217
+ };
218
+ tree: {
219
+ noItemsFound: string;
220
+ };
221
+ table: {
222
+ selectAllRows: string;
223
+ selectRow: string;
224
+ sortedBy: string;
225
+ sortAscending: string;
226
+ sortDescending: string;
227
+ sortCleared: string;
228
+ selectedCount: string;
229
+ page: string;
230
+ resultCount: string;
231
+ };
232
+ state: {
233
+ loading: string;
234
+ success: string;
235
+ warning: string;
236
+ error: string;
237
+ cancelled: string;
238
+ };
239
+ }, "_">;
240
+ /** Unique id for the placeholder, referenced as the native input's a11y name. */
241
+ protected readonly labelId: string;
242
+ /**
243
+ * How the user may add files.
244
+ * - `click` — only clicking the zone opens the picker.
245
+ * - `drag` — only dropping files works.
246
+ * - `both` — either.
247
+ * @default both
248
+ */
249
+ readonly interaction: _angular_core.InputSignal<NgnUploadInteraction>;
250
+ /**
251
+ * When uploads start: `auto` (instantly), `confirm` (user presses a rendered
252
+ * trigger), or `manual` (only via {@link uploadAll}/{@link uploadFile}).
253
+ * @default auto
254
+ */
255
+ readonly mode: _angular_core.InputSignal<NgnUploadMode>;
256
+ /**
257
+ * Provide a custom upload icon
258
+ */
259
+ readonly iconUpload: _angular_core.InputSignal<_iconify_types.IconifyIcon | _ngneers_controls_custom_types.NgnIconEntry | undefined>;
260
+ /**
261
+ * In `confirm` mode, which trigger(s) to render: a single "upload all" button
262
+ * (`all`), a button per pending item (`per-item`), or `both`.
263
+ * @default all
264
+ */
265
+ readonly confirmTrigger: _angular_core.InputSignal<NgnUploadConfirmTrigger>;
266
+ /**
267
+ * Disables all interaction.
268
+ * @default false
269
+ */
270
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
271
+ /**
272
+ * Where the file list renders relative to the drop zone.
273
+ * @default bottom
274
+ */
275
+ readonly listPosition: _angular_core.InputSignal<NgnUploadListPosition>;
276
+ /**
277
+ * Emitted with the files to upload: on select/drop in `auto` mode, or when a
278
+ * manual trigger fires. The emitted items are already marked `uploading`.
279
+ */
280
+ readonly upload: _angular_core.OutputEmitterRef<NgnUploadFile[]>;
281
+ /** Emitted when a file is removed from the list. */
282
+ readonly remove: _angular_core.OutputEmitterRef<NgnUploadFile>;
283
+ /** Emitted when a `failed` file's retry is pressed (also re-emits `upload`). */
284
+ readonly retry: _angular_core.OutputEmitterRef<NgnUploadFile>;
285
+ /**
286
+ * Emitted when an in-flight file is dismissed (the item's remove/cancel
287
+ * action while `uploading`). Abort the request; the item is then removed.
288
+ */
289
+ readonly cancelUpload: _angular_core.OutputEmitterRef<NgnUploadFile>;
290
+ /** The tracked files, in insertion order. */
291
+ readonly files: _angular_core.WritableSignal<NgnUploadFile[]>;
292
+ protected readonly dragover: _angular_core.WritableSignal<boolean>;
293
+ protected readonly clickable: _angular_core.Signal<boolean>;
294
+ protected readonly draggable: _angular_core.Signal<boolean>;
295
+ protected readonly hasPending: _angular_core.Signal<boolean>;
296
+ protected readonly showUploadAll: _angular_core.Signal<boolean>;
297
+ protected readonly showPerItem: _angular_core.Signal<boolean>;
298
+ private readonly _nativeInput;
299
+ /** Resolvers awaiting a file (by id) reaching a terminal/settled state. */
300
+ private readonly _settlers;
301
+ constructor();
302
+ /** Report transfer progress (`0`–`100`) for a file; marks it `uploading`. */
303
+ setProgress(id: string, progress: number): void;
304
+ /** Mark a file as actively uploading. */
305
+ markUploading(id: string): void;
306
+ /** Mark a file as successfully uploaded. */
307
+ markDone(id: string): void;
308
+ /** Mark a file as failed, optionally attaching an error. */
309
+ markFailed(id: string, error?: unknown): void;
310
+ protected onDragOver(event: DragEvent): void;
311
+ protected onDragLeave(event: DragEvent): void;
312
+ protected onDrop(event: DragEvent): void;
313
+ private onNativeChange;
314
+ /**
315
+ * Start uploading every `pending` file. This is the code-driven trigger for
316
+ * `manual` mode, and what the "upload all" button calls in `confirm` mode.
317
+ *
318
+ * Returns a promise that resolves once every started file has settled — i.e.
319
+ * reached `done`, `failed`, or been cancelled/removed. It resolves with the
320
+ * same items handed to `(upload)`, so their final {@link NgnUploadFile.state}
321
+ * tells you which succeeded and which failed. Resolves with `[]` if there was
322
+ * nothing pending.
323
+ */
324
+ uploadAll(): Promise<NgnUploadFile[]>;
325
+ /**
326
+ * Start uploading a single `pending` file by its {@link NgnUploadFile.id}.
327
+ * Returns the same settle-promise as {@link uploadAll}.
328
+ */
329
+ uploadFile(id: string): Promise<NgnUploadFile[]>;
330
+ protected uploadOne(item: NgnUploadFile): void;
331
+ protected retryFile(item: NgnUploadFile): void;
332
+ protected removeFile(item: NgnUploadFile): void;
333
+ /** Human-readable file size for display in the list. */
334
+ protected formatSize(bytes: number): string;
335
+ /** Filter/trim dropped files to mirror the native input's own validation. */
336
+ private ingest;
337
+ private startUpload;
338
+ /** Resolve once the file (by id) leaves `uploading` — done/failed/cancelled. */
339
+ private whenSettled;
340
+ private settle;
341
+ private patch;
342
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnUpload, never>;
343
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgnUpload, "ngn-upload", ["ngnUpload"], { "interaction": { "alias": "interaction"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "iconUpload": { "alias": "iconUpload"; "required": false; "isSignal": true; }; "confirmTrigger": { "alias": "confirmTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "listPosition": { "alias": "listPosition"; "required": false; "isSignal": true; }; }, { "upload": "upload"; "remove": "remove"; "retry": "retry"; "cancelUpload": "cancelUpload"; }, never, ["*"], true, never>;
344
+ }
345
+
346
+ export { NgnUpload };
347
+ export type { NgnUploadConfirmTrigger, NgnUploadFile, NgnUploadFileState, NgnUploadInteraction, NgnUploadListPosition, NgnUploadMode };
@@ -0,0 +1,129 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Signal, ProviderToken, EffectRef, InputSignal, InputSignalWithTransform, Injector } from '@angular/core';
3
+ import { NgnGlobalType } from '@ngneers/controls/utils';
4
+
5
+ declare function classSignal(element: HTMLElement, klass: Signal<string | string[]>): void;
6
+
7
+ /**
8
+ * Keeps keyboard focus inside a single container for the duration a modal
9
+ * overlay is open. On {@link activate} it remembers what was focused, moves
10
+ * focus into the container, and wraps `Tab`/`Shift+Tab` at the edges;
11
+ * {@link deactivate} tears the listener down and restores the prior focus.
12
+ *
13
+ * The container itself is focused as a fallback when it has no focusable
14
+ * children, so focus never escapes to the (inert) background.
15
+ */
16
+ declare class FocusTrap {
17
+ private readonly container;
18
+ private _previouslyFocused;
19
+ private _active;
20
+ constructor(container: HTMLElement);
21
+ activate(): void;
22
+ deactivate(): void;
23
+ private readonly _onKeydown;
24
+ }
25
+
26
+ declare function generateElementId(): string;
27
+
28
+ declare class NgnGlobal implements NgnGlobalType {
29
+ private readonly _window;
30
+ constructor();
31
+ get nextElementId(): number;
32
+ set nextElementId(value: number);
33
+ get fancyLogging(): boolean;
34
+ set fancyLogging(value: boolean);
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgnGlobal, never>;
36
+ static ɵprov: i0.ɵɵInjectableDeclaration<NgnGlobal>;
37
+ }
38
+
39
+ declare function injectOrThrow<T>(token: ProviderToken<T>, moduleName: string, errorMsg: string): T;
40
+
41
+ /**
42
+ * An item managed by a {@link NotificationRegionController} — a single snackbar or
43
+ * toast. The controller drives focus and timer state through this narrow contract.
44
+ */
45
+ interface NotificationRegionItem {
46
+ /** Move DOM focus to this item's root element. */
47
+ focus(): void;
48
+ /** Freeze the auto-hide timer because the region as a whole holds focus. */
49
+ regionPause(): void;
50
+ /** Release the region-level freeze; the item resumes unless still hovered/focused. */
51
+ regionResume(): void;
52
+ }
53
+ /**
54
+ * Keyboard-accessibility controller for a stack of transient notifications
55
+ * (snackbars / toasts) rendered inside a single host region.
56
+ *
57
+ * Implements the WAI-ARIA APG guidance for toasts: focus is never stolen when a
58
+ * notification appears, but a global hotkey (`F6`) lets the user jump into the
59
+ * region on demand. Within the region, a roving-tabindex model exposes exactly one
60
+ * item to the Tab sequence while `ArrowUp`/`ArrowDown`/`Home`/`End` move between
61
+ * items. Whenever the region holds focus, every timer in it is paused so nothing
62
+ * disappears mid-read.
63
+ *
64
+ * The host component owns the wiring: it forwards its events to the handlers here
65
+ * and binds {@link tabbableIndex} to each item's `tabindex`.
66
+ */
67
+ declare class NotificationRegionController<T extends NotificationRegionItem> {
68
+ private readonly host;
69
+ private readonly items;
70
+ /** The item index currently exposed to the Tab sequence (roving tabindex). */
71
+ readonly activeIndex: i0.WritableSignal<number>;
72
+ private _regionFocused;
73
+ /**
74
+ * @param host The region's root element, used to scope focus containment checks.
75
+ * @param items A getter returning the live, ordered list of items (oldest first).
76
+ */
77
+ constructor(host: HTMLElement, items: () => readonly T[]);
78
+ /**
79
+ * The roving tabindex target, clamped to the current item count so the region
80
+ * always has exactly one tabbable entry point even after items are removed.
81
+ */
82
+ tabbableIndex(): number;
83
+ /** Document-level handler: `F6` moves focus to the newest notification. */
84
+ handleGlobalKeydown(event: KeyboardEvent): void;
85
+ /** Region-level handler: arrow / Home / End roving between notifications. */
86
+ handleKeydown(event: KeyboardEvent): void;
87
+ /** Region gained focus (via hotkey, Tab, or click) — pause every timer in it. */
88
+ handleFocusIn(): void;
89
+ /** Region lost focus to something outside it — resume every timer. */
90
+ handleFocusOut(event: FocusEvent): void;
91
+ private focusIndex;
92
+ }
93
+
94
+ declare function signalWithPrevious<T>(signal: Signal<T>, previous?: T): Signal<{
95
+ current: T;
96
+ previous: T | undefined;
97
+ }>;
98
+ declare function computedWithPrevious<T>(computeFn: (prev?: T) => T, previous?: T): Signal<T>;
99
+ declare function effectWithPrevious<T>(signal: Signal<T>, effectFn: (current: T, previous: T | undefined) => void): EffectRef;
100
+ declare function explicitEffect<T extends readonly Signal<any>[]>(signals: [...T], effectFn: (values: {
101
+ [K in keyof T]: T[K] extends Signal<infer U> ? U : never;
102
+ }) => void): EffectRef;
103
+ declare function explicitAfterRenderEffect<T extends readonly Signal<any>[]>(signals: [...T], effectFn: (values: {
104
+ [K in keyof T]: T[K] extends Signal<infer U> ? U : never;
105
+ }) => void): EffectRef;
106
+ declare function asyncComputed<T>(computeFn: () => Promise<T>, initial: T): {
107
+ (): T;
108
+ isRunning: Signal<boolean>;
109
+ firstRunCompleted: Signal<boolean>;
110
+ };
111
+ declare function setInputSignalValue<T>(input: InputSignal<T> | InputSignalWithTransform<T, unknown>, value: T): void;
112
+ declare function afterRenderComputed<T>(computeFn: () => T, defaultValue: T): () => T;
113
+ declare function debounceSignal<T>(input: Signal<T>, delayMs: (() => number) | number): Signal<T>;
114
+
115
+ type NgnStateStorage = 'local' | 'session';
116
+ declare function loadState<T>(storage: NgnStateStorage, key: string): T | null;
117
+ declare function saveState<T>(storage: NgnStateStorage, key: string, state: T | null): void;
118
+ type RegisterStateOptions<T> = {
119
+ storage: () => NgnStateStorage;
120
+ key: () => string | null | undefined;
121
+ valueFn: (previousState: T | null) => T | null;
122
+ onLoad: (state: T | null) => T | null;
123
+ debounce?: number;
124
+ injector?: Injector;
125
+ };
126
+ declare function registerState<T>(options: RegisterStateOptions<T>): void;
127
+
128
+ export { FocusTrap, NgnGlobal, NotificationRegionController, afterRenderComputed, asyncComputed, classSignal, computedWithPrevious, debounceSignal, effectWithPrevious, explicitAfterRenderEffect, explicitEffect, generateElementId, injectOrThrow, loadState, registerState, saveState, setInputSignalValue, signalWithPrevious };
129
+ export type { NgnStateStorage, NotificationRegionItem, RegisterStateOptions };
@@ -0,0 +1,130 @@
1
+ declare function toggleClass(element: HTMLElement, className: string | string[], state: boolean): void;
2
+
3
+ declare function areObjectsDeepEqual<T extends object>(a: T, b: T): boolean;
4
+ declare function areArraysDeepEqual<T>(a: readonly T[], b: readonly T[]): boolean;
5
+
6
+ declare function throwExp(moduleName: string, errorMsg: string, ...additionalContext: unknown[]): never;
7
+ declare class NgnError extends Error {
8
+ readonly additionalContext?: unknown[];
9
+ constructor(area: string, errorMsg: string, ...additionalContext: unknown[]);
10
+ }
11
+
12
+ declare function maybeCallback<T>(value: T | (() => T)): T;
13
+
14
+ declare function fuzzyMatch(input: string, search: string): boolean;
15
+
16
+ declare const globalPropertyName = "__ngn-controls-global__";
17
+ interface NgnGlobalType {
18
+ nextElementId: number;
19
+ fancyLogging: boolean;
20
+ }
21
+ declare global {
22
+ interface Window {
23
+ [globalPropertyName]: NgnGlobalType;
24
+ }
25
+ }
26
+
27
+ type LogLevel = 'debug' | 'info' | 'warn' | 'error';
28
+ declare const Logger: {
29
+ logLevel: LogLevel;
30
+ debug(...args: unknown[]): void;
31
+ info(...args: unknown[]): void;
32
+ warn(...args: unknown[]): void;
33
+ error(...args: unknown[]): void;
34
+ };
35
+
36
+ declare function notNullish<T>(value: T | null | undefined): value is T;
37
+
38
+ type Prettify<T> = {
39
+ [K in keyof T]: T[K];
40
+ } & {};
41
+ type SubKey<P, K> = [P] extends [never] ? K : P extends string ? K extends string ? `${P}.${K}` : K : K;
42
+ type DeepPartial<T, Exclude extends string = never, P = never> = T extends object ? SubKey<P, '*'> extends Exclude ? T : Prettify<{
43
+ [K in keyof T as SubKey<P, K> extends Exclude ? never : K]?: DeepPartial<T[K], Exclude, SubKey<P, K>>;
44
+ } & {
45
+ [K in keyof T as SubKey<P, K> extends Exclude ? K : never]: DeepPartial<T[K], Exclude, SubKey<P, K>>;
46
+ }> : T;
47
+ /**
48
+ * Returns all keys of a type T.
49
+ * If T is a union, returns all keys from all union members.
50
+ */
51
+ type AllKeysOfUnion<T> = T extends any ? keyof T : never;
52
+ /**
53
+ * Angular fills unspecified generic inputs with `any`.
54
+ * This replaces that `any` with a `Default` type, or returns `T` if `T` is not `any`.
55
+ */
56
+ type InputGeneric<T, Default> = symbol extends T ? Default : T;
57
+
58
+ declare function deepCopy<T>(obj: T): T extends ReadonlyArray<infer U> ? Array<U> : T;
59
+ declare function objectKeys<T extends object>(obj: T): (keyof T)[];
60
+ declare function objectEntries<T extends object>(obj: T): [keyof T, T[keyof T]][];
61
+ declare function isObject(item: unknown): item is Record<string, unknown>;
62
+ declare function deepMerge<T extends Record<string, unknown>, U extends Record<string, unknown>>(target: T, source: U): T & U;
63
+ declare function getPropertyIfExists<T extends object, K extends AllKeysOfUnion<T>>(obj: T, key: K): T[K] | undefined;
64
+
65
+ declare function getScrollTop(elementOffsetTop: number, elementHeight: number, containerHeight: number, currentScrollTop: number, behavior: ScrollLogicalPosition): number;
66
+
67
+ /**
68
+ * Represents a time span that can be expressed in various formats:
69
+ * - As a number (milliseconds)
70
+ * - As a string in the format "XdXhXmXsXms" where each part is optional (e.g., "1d2h30m45s500ms" or "2h15m")
71
+ * - As an object with properties for days, hours, minutes, seconds, and milliseconds
72
+ * @example
73
+ * ```typescript
74
+ * // As a number
75
+ * const duration1: TimeSpan = 5000;
76
+ * // As a string
77
+ * const duration2: TimeSpan = "1d2h30m45s500ms";
78
+ * // As an object
79
+ * const duration3: TimeSpan = { days: 1, hours: 2, minutes: 30, seconds: 45, milliseconds: 500 };
80
+ * ```
81
+ */
82
+ type TimeSpan = number | `${`${number}d` | ''}${`${number}h` | ''}${`${number}m` | ''}${`${number}s` | ''}${`${number}ms` | ''}` | {
83
+ /**
84
+ * Number of days in the time span.
85
+ */
86
+ days?: number;
87
+ /**
88
+ * Number of hours in the time span.
89
+ */
90
+ hours?: number;
91
+ /**
92
+ * Number of minutes in the time span.
93
+ */
94
+ minutes?: number;
95
+ /**
96
+ * Number of seconds in the time span.
97
+ */
98
+ seconds?: number;
99
+ /**
100
+ * Number of milliseconds in the time span.
101
+ */
102
+ milliseconds?: number;
103
+ };
104
+ /**
105
+ * Checks if the provided value is a valid TimeSpan.
106
+ * @param value The value to check.
107
+ * @returns `true` if the value is a valid TimeSpan, otherwise `false`.
108
+ */
109
+ declare function isTimeSpan(value: unknown): value is TimeSpan;
110
+ /**
111
+ * Converts a TimeSpan to milliseconds.
112
+ * @param timeSpan The TimeSpan to convert.
113
+ * @returns The equivalent time span in milliseconds.
114
+ */
115
+ declare function getTimeSpanMilliseconds(timeSpan: TimeSpan): number;
116
+ /**
117
+ * Converts a TimeSpan to a string representation.
118
+ * @param timeSpan The TimeSpan to convert.
119
+ * @returns A string representation of the time span.
120
+ */
121
+ declare function getTimeSpanString(timeSpan: TimeSpan): string;
122
+ /**
123
+ * Converts a TimeSpan to an object representation.
124
+ * @param timeSpan The TimeSpan to convert.
125
+ * @returns An object representation of the time span with properties for days, hours, minutes, seconds, and milliseconds.
126
+ */
127
+ declare function getTimeSpan(timeSpan: TimeSpan): TimeSpan & object;
128
+
129
+ export { Logger, NgnError, areArraysDeepEqual, areObjectsDeepEqual, deepCopy, deepMerge, fuzzyMatch, getPropertyIfExists, getScrollTop, getTimeSpan, getTimeSpanMilliseconds, getTimeSpanString, globalPropertyName, isObject, isTimeSpan, maybeCallback, notNullish, objectEntries, objectKeys, throwExp, toggleClass };
130
+ export type { AllKeysOfUnion, DeepPartial, InputGeneric, LogLevel, NgnGlobalType, Prettify, TimeSpan };
@@ -0,0 +1,2 @@
1
+
2
+ export { };