@aerogel/core 0.0.0-next.c8f032a868370824898e171969aec1bb6827688e → 0.0.0-next.f16bd1d894543c5303039c49f6f33488a1ffe931

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 (64) hide show
  1. package/dist/aerogel-core.cjs.js +1 -1
  2. package/dist/aerogel-core.cjs.js.map +1 -1
  3. package/dist/aerogel-core.d.ts +501 -83
  4. package/dist/aerogel-core.esm.js +1 -1
  5. package/dist/aerogel-core.esm.js.map +1 -1
  6. package/dist/virtual.d.ts +11 -0
  7. package/noeldemartin.config.js +4 -1
  8. package/package.json +3 -2
  9. package/src/bootstrap/index.ts +4 -1
  10. package/src/components/AGAppModals.vue +15 -0
  11. package/src/components/AGAppOverlays.vue +5 -7
  12. package/src/components/AGAppSnackbars.vue +13 -0
  13. package/src/components/basic/AGMarkdown.vue +10 -5
  14. package/src/components/constants.ts +8 -0
  15. package/src/components/forms/AGButton.vue +33 -10
  16. package/src/components/forms/AGCheckbox.vue +35 -0
  17. package/src/components/forms/AGInput.vue +8 -4
  18. package/src/components/forms/index.ts +2 -1
  19. package/src/components/headless/forms/AGHeadlessButton.vue +3 -4
  20. package/src/components/headless/forms/AGHeadlessInput.ts +2 -2
  21. package/src/components/headless/forms/AGHeadlessInput.vue +3 -3
  22. package/src/components/headless/forms/AGHeadlessInputError.vue +1 -1
  23. package/src/components/headless/forms/AGHeadlessInputInput.vue +15 -3
  24. package/src/components/headless/index.ts +1 -0
  25. package/src/components/headless/modals/AGHeadlessModalPanel.vue +5 -1
  26. package/src/components/headless/snackbars/AGHeadlessSnackbar.vue +10 -0
  27. package/src/components/headless/snackbars/index.ts +25 -0
  28. package/src/components/index.ts +2 -0
  29. package/src/components/modals/AGConfirmModal.vue +1 -1
  30. package/src/components/modals/AGErrorReportModal.ts +20 -0
  31. package/src/components/modals/AGErrorReportModal.vue +62 -0
  32. package/src/components/modals/AGErrorReportModalButtons.vue +106 -0
  33. package/src/components/modals/AGErrorReportModalTitle.vue +25 -0
  34. package/src/components/modals/AGLoadingModal.vue +19 -0
  35. package/src/components/modals/AGModal.vue +21 -3
  36. package/src/components/modals/index.ts +16 -2
  37. package/src/components/snackbars/AGSnackbar.vue +42 -0
  38. package/src/components/snackbars/index.ts +3 -0
  39. package/src/directives/index.ts +16 -3
  40. package/src/errors/Errors.state.ts +31 -0
  41. package/src/errors/Errors.ts +161 -0
  42. package/src/errors/index.ts +59 -0
  43. package/src/forms/Form.test.ts +21 -0
  44. package/src/forms/Form.ts +20 -10
  45. package/src/forms/utils.ts +17 -0
  46. package/src/lang/Lang.ts +11 -3
  47. package/src/lang/index.ts +3 -5
  48. package/src/lang/utils.ts +4 -0
  49. package/src/main.ts +1 -2
  50. package/src/services/App.state.ts +7 -1
  51. package/src/services/App.ts +11 -1
  52. package/src/services/Service.ts +126 -44
  53. package/src/services/index.ts +18 -4
  54. package/src/services/store.ts +27 -0
  55. package/src/types/virtual.d.ts +11 -0
  56. package/src/ui/UI.state.ts +11 -1
  57. package/src/ui/UI.ts +52 -6
  58. package/src/ui/index.ts +7 -1
  59. package/src/utils/composition/forms.ts +11 -0
  60. package/src/utils/index.ts +1 -0
  61. package/src/utils/vue.ts +2 -0
  62. package/tsconfig.json +1 -0
  63. package/vite.config.ts +2 -1
  64. package/src/globals.ts +0 -6
@@ -11,7 +11,7 @@ import type { Directive } from 'vue';
11
11
  import { ExtractPropTypes } from 'vue';
12
12
  import { Facade } from '@noeldemartin/utils';
13
13
  import type { InjectionKey } from 'vue';
14
- import type { LocationQuery } from 'vue-router';
14
+ import type { JSError } from '@noeldemartin/utils';
15
15
  import { MagicObject } from '@noeldemartin/utils';
16
16
  import type { ObjectValues } from '@noeldemartin/utils';
17
17
  import { PromisedValue } from '@noeldemartin/utils';
@@ -19,7 +19,6 @@ import { PropType } from 'vue';
19
19
  import type { Ref } from 'vue';
20
20
  import { RendererElement } from 'vue';
21
21
  import { RendererNode } from 'vue';
22
- import type { RouteParams } from 'vue-router';
23
22
  import type { UnwrapNestedRefs } from 'vue';
24
23
  import { VNode } from 'vue';
25
24
  import { VNodeProps } from 'vue';
@@ -69,23 +68,43 @@ export declare const AGAppOverlays: DefineComponent< {}, (_ctx: any, _cache:
69
68
  }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
70
69
 
71
70
  export declare const AGButton: DefineComponent< {
72
- secondary: {
73
- type: PropType<boolean>;
71
+ color: {
72
+ type: PropType<"primary" | "secondary" | "danger" | "clear">;
74
73
  validator?(value: unknown): boolean;
75
74
  } & {
76
- default: boolean | (() => boolean) | null;
75
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
77
76
  };
78
77
  }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
79
78
  [key: string]: any;
80
79
  }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
81
- secondary: {
82
- type: PropType<boolean>;
80
+ color: {
81
+ type: PropType<"primary" | "secondary" | "danger" | "clear">;
83
82
  validator?(value: unknown): boolean;
84
83
  } & {
85
- default: boolean | (() => boolean) | null;
84
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
86
85
  };
87
86
  }>>, {
88
- secondary: boolean;
87
+ color: "primary" | "secondary" | "danger" | "clear";
88
+ }, {}>;
89
+
90
+ export declare const AGCheckbox: DefineComponent< {
91
+ name: {
92
+ type: PropType<string | null>;
93
+ validator?(value: unknown): boolean;
94
+ } & {
95
+ default: string | (() => string | null) | null;
96
+ };
97
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
98
+ [key: string]: any;
99
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
100
+ name: {
101
+ type: PropType<string | null>;
102
+ validator?(value: unknown): boolean;
103
+ } & {
104
+ default: string | (() => string | null) | null;
105
+ };
106
+ }>>, {
107
+ name: string | null;
89
108
  }, {}>;
90
109
 
91
110
  export declare const AGConfirmModal: DefineComponent< {
@@ -120,6 +139,69 @@ required: true;
120
139
  title: string | null;
121
140
  }, {}>;
122
141
 
142
+ export declare const AGErrorReportModalButtons: DefineComponent< {
143
+ report: {
144
+ type: PropType<ErrorReport>;
145
+ validator?(value: unknown): boolean;
146
+ } & {
147
+ required: true;
148
+ };
149
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
150
+ [key: string]: any;
151
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
152
+ report: {
153
+ type: PropType<ErrorReport>;
154
+ validator?(value: unknown): boolean;
155
+ } & {
156
+ required: true;
157
+ };
158
+ }>>, {}, {}>;
159
+
160
+ export declare const AGErrorReportModalTitle: DefineComponent< {
161
+ report: {
162
+ type: PropType<ErrorReport>;
163
+ validator?(value: unknown): boolean;
164
+ } & {
165
+ required: true;
166
+ };
167
+ currentReport: {
168
+ type: PropType<number | null>;
169
+ validator?(value: unknown): boolean;
170
+ } & {
171
+ default: number | (() => number | null) | null;
172
+ };
173
+ totalReports: {
174
+ type: PropType<number | null>;
175
+ validator?(value: unknown): boolean;
176
+ } & {
177
+ default: number | (() => number | null) | null;
178
+ };
179
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
180
+ [key: string]: any;
181
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
182
+ report: {
183
+ type: PropType<ErrorReport>;
184
+ validator?(value: unknown): boolean;
185
+ } & {
186
+ required: true;
187
+ };
188
+ currentReport: {
189
+ type: PropType<number | null>;
190
+ validator?(value: unknown): boolean;
191
+ } & {
192
+ default: number | (() => number | null) | null;
193
+ };
194
+ totalReports: {
195
+ type: PropType<number | null>;
196
+ validator?(value: unknown): boolean;
197
+ } & {
198
+ default: number | (() => number | null) | null;
199
+ };
200
+ }>>, {
201
+ currentReport: number | null;
202
+ totalReports: number | null;
203
+ }, {}>;
204
+
123
205
  export declare const AGForm: DefineComponent< {
124
206
  form: {
125
207
  type: PropType<Form<FormFieldDefinitions> | null>;
@@ -156,16 +238,16 @@ validator?(value: unknown): boolean;
156
238
  default: string | (() => string | null) | null;
157
239
  };
158
240
  routeParams: {
159
- type: PropType<RouteParams>;
241
+ type: PropType< {}>;
160
242
  validator?(value: unknown): boolean;
161
243
  } & {
162
- default: RouteParams | (() => RouteParams) | null;
244
+ default: {} | (() => {}) | null;
163
245
  };
164
246
  routeQuery: {
165
- type: PropType<LocationQuery>;
247
+ type: PropType< {}>;
166
248
  validator?(value: unknown): boolean;
167
249
  } & {
168
- default: LocationQuery | (() => LocationQuery) | null;
250
+ default: {} | (() => {}) | null;
169
251
  };
170
252
  submit: {
171
253
  type: PropType<boolean>;
@@ -189,16 +271,16 @@ validator?(value: unknown): boolean;
189
271
  default: string | (() => string | null) | null;
190
272
  };
191
273
  routeParams: {
192
- type: PropType<RouteParams>;
274
+ type: PropType< {}>;
193
275
  validator?(value: unknown): boolean;
194
276
  } & {
195
- default: RouteParams | (() => RouteParams) | null;
277
+ default: {} | (() => {}) | null;
196
278
  };
197
279
  routeQuery: {
198
- type: PropType<LocationQuery>;
280
+ type: PropType< {}>;
199
281
  validator?(value: unknown): boolean;
200
282
  } & {
201
- default: LocationQuery | (() => LocationQuery) | null;
283
+ default: {} | (() => {}) | null;
202
284
  };
203
285
  submit: {
204
286
  type: PropType<boolean>;
@@ -209,17 +291,17 @@ default: boolean | (() => boolean) | null;
209
291
  }>>, {
210
292
  url: string | null;
211
293
  route: string | null;
212
- routeParams: RouteParams;
213
- routeQuery: LocationQuery;
294
+ routeParams: {};
295
+ routeQuery: {};
214
296
  submit: boolean;
215
297
  }, {}>;
216
298
 
217
299
  export declare const AGHeadlessInput: DefineComponent< {
218
300
  as: {
219
- type: PropType<string | null>;
301
+ type: PropType<string>;
220
302
  validator?(value: unknown): boolean;
221
303
  } & {
222
- default: string | (() => string | null) | null;
304
+ default: string | (() => string) | null;
223
305
  };
224
306
  name: {
225
307
  type: PropType<string | null>;
@@ -228,19 +310,19 @@ validator?(value: unknown): boolean;
228
310
  default: string | (() => string | null) | null;
229
311
  };
230
312
  modelValue: {
231
- type: PropType<string | null>;
313
+ type: PropType<string | number | boolean | null>;
232
314
  validator?(value: unknown): boolean;
233
315
  } & {
234
- default: string | (() => string | null) | null;
316
+ default: string | number | boolean | (() => string | number | boolean | null) | null;
235
317
  };
236
318
  }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
237
319
  [key: string]: any;
238
320
  }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
239
321
  as: {
240
- type: PropType<string | null>;
322
+ type: PropType<string>;
241
323
  validator?(value: unknown): boolean;
242
324
  } & {
243
- default: string | (() => string | null) | null;
325
+ default: string | (() => string) | null;
244
326
  };
245
327
  name: {
246
328
  type: PropType<string | null>;
@@ -249,26 +331,42 @@ validator?(value: unknown): boolean;
249
331
  default: string | (() => string | null) | null;
250
332
  };
251
333
  modelValue: {
252
- type: PropType<string | null>;
334
+ type: PropType<string | number | boolean | null>;
253
335
  validator?(value: unknown): boolean;
254
336
  } & {
255
- default: string | (() => string | null) | null;
337
+ default: string | number | boolean | (() => string | number | boolean | null) | null;
256
338
  };
257
339
  }>> & {
258
340
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
259
341
  }, {
260
- as: string | null;
342
+ as: string;
261
343
  name: string | null;
262
- modelValue: string | null;
344
+ modelValue: string | number | boolean | null;
263
345
  }, {}>;
264
346
 
265
347
  export declare const AGHeadlessInputError: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
266
348
  [key: string]: any;
267
349
  }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
268
350
 
269
- export declare const AGHeadlessInputInput: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
351
+ export declare const AGHeadlessInputInput: DefineComponent< {
352
+ type: {
353
+ type: PropType<string>;
354
+ validator?(value: unknown): boolean;
355
+ } & {
356
+ default: string | (() => string) | null;
357
+ };
358
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
270
359
  [key: string]: any;
271
- }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
360
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
361
+ type: {
362
+ type: PropType<string>;
363
+ validator?(value: unknown): boolean;
364
+ } & {
365
+ default: string | (() => string) | null;
366
+ };
367
+ }>>, {
368
+ type: string;
369
+ }, {}>;
272
370
 
273
371
  export declare const AGHeadlessInputLabel: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
274
372
  [key: string]: any;
@@ -318,6 +416,10 @@ default: string | (() => string) | null;
318
416
  as: string;
319
417
  }, {}>;
320
418
 
419
+ export declare const AGHeadlessSnackbar: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
420
+ [key: string]: any;
421
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
422
+
321
423
  export declare const AGInput: DefineComponent< {
322
424
  name: {
323
425
  type: PropType<string | null>;
@@ -338,24 +440,38 @@ default: string | (() => string | null) | null;
338
440
  name: string | null;
339
441
  }, {}>;
340
442
 
341
- export declare const AGMarkdown: DefineComponent< {
342
- as: {
343
- type: PropType<string>;
443
+ export declare const AGLoadingModal: DefineComponent< {
444
+ message: {
445
+ type: PropType<string | null>;
344
446
  validator?(value: unknown): boolean;
345
447
  } & {
346
- default: string | (() => string) | null;
448
+ default: string | (() => string | null) | null;
347
449
  };
348
- langKey: {
450
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
451
+ [key: string]: any;
452
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
453
+ message: {
349
454
  type: PropType<string | null>;
350
455
  validator?(value: unknown): boolean;
351
456
  } & {
352
457
  default: string | (() => string | null) | null;
353
458
  };
354
- text: {
355
- type: PropType<string | null>;
459
+ }>>, {
460
+ message: string | null;
461
+ }, {}>;
462
+
463
+ export declare const AGMarkdown: DefineComponent< {
464
+ as: {
465
+ type: PropType<string>;
356
466
  validator?(value: unknown): boolean;
357
467
  } & {
358
- default: string | (() => string | null) | null;
468
+ default: string | (() => string) | null;
469
+ };
470
+ heading: {
471
+ type: PropType<boolean>;
472
+ validator?(value: unknown): boolean;
473
+ } & {
474
+ default: boolean | (() => boolean) | null;
359
475
  };
360
476
  inline: {
361
477
  type: PropType<boolean>;
@@ -363,12 +479,24 @@ validator?(value: unknown): boolean;
363
479
  } & {
364
480
  default: boolean | (() => boolean) | null;
365
481
  };
482
+ langKey: {
483
+ type: PropType<string | null>;
484
+ validator?(value: unknown): boolean;
485
+ } & {
486
+ default: string | (() => string | null) | null;
487
+ };
366
488
  raw: {
367
489
  type: PropType<boolean>;
368
490
  validator?(value: unknown): boolean;
369
491
  } & {
370
492
  default: boolean | (() => boolean) | null;
371
493
  };
494
+ text: {
495
+ type: PropType<string | null>;
496
+ validator?(value: unknown): boolean;
497
+ } & {
498
+ default: string | (() => string | null) | null;
499
+ };
372
500
  }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
373
501
  [key: string]: any;
374
502
  }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
@@ -378,42 +506,65 @@ validator?(value: unknown): boolean;
378
506
  } & {
379
507
  default: string | (() => string) | null;
380
508
  };
509
+ heading: {
510
+ type: PropType<boolean>;
511
+ validator?(value: unknown): boolean;
512
+ } & {
513
+ default: boolean | (() => boolean) | null;
514
+ };
515
+ inline: {
516
+ type: PropType<boolean>;
517
+ validator?(value: unknown): boolean;
518
+ } & {
519
+ default: boolean | (() => boolean) | null;
520
+ };
381
521
  langKey: {
382
522
  type: PropType<string | null>;
383
523
  validator?(value: unknown): boolean;
384
524
  } & {
385
525
  default: string | (() => string | null) | null;
386
526
  };
527
+ raw: {
528
+ type: PropType<boolean>;
529
+ validator?(value: unknown): boolean;
530
+ } & {
531
+ default: boolean | (() => boolean) | null;
532
+ };
387
533
  text: {
388
534
  type: PropType<string | null>;
389
535
  validator?(value: unknown): boolean;
390
536
  } & {
391
537
  default: string | (() => string | null) | null;
392
538
  };
393
- inline: {
539
+ }>>, {
540
+ as: string;
541
+ heading: boolean;
542
+ inline: boolean;
543
+ langKey: string | null;
544
+ raw: boolean;
545
+ text: string | null;
546
+ }, {}>;
547
+
548
+ export declare const AGModal: DefineComponent< {
549
+ cancellable: {
394
550
  type: PropType<boolean>;
395
551
  validator?(value: unknown): boolean;
396
552
  } & {
397
553
  default: boolean | (() => boolean) | null;
398
554
  };
399
- raw: {
555
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
556
+ [key: string]: any;
557
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
558
+ cancellable: {
400
559
  type: PropType<boolean>;
401
560
  validator?(value: unknown): boolean;
402
561
  } & {
403
562
  default: boolean | (() => boolean) | null;
404
563
  };
405
564
  }>>, {
406
- as: string;
407
- langKey: string | null;
408
- text: string | null;
409
- inline: boolean;
410
- raw: boolean;
565
+ cancellable: boolean;
411
566
  }, {}>;
412
567
 
413
- export declare const AGModal: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
414
- [key: string]: any;
415
- }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
416
-
417
568
  export declare const AGModalContext: DefineComponent< {
418
569
  modal: {
419
570
  type: PropType<Modal<unknown>>;
@@ -444,9 +595,67 @@ required: true;
444
595
  };
445
596
  }>>, {}, {}>;
446
597
 
598
+ export declare const AGSnackbar: DefineComponent< {
599
+ id: {
600
+ type: PropType<string>;
601
+ validator?(value: unknown): boolean;
602
+ } & {
603
+ required: true;
604
+ };
605
+ message: {
606
+ type: PropType<string>;
607
+ validator?(value: unknown): boolean;
608
+ } & {
609
+ required: true;
610
+ };
611
+ actions: {
612
+ type: PropType<SnackbarAction[]>;
613
+ validator?(value: unknown): boolean;
614
+ } & {
615
+ default: SnackbarAction[] | (() => SnackbarAction[]) | null;
616
+ };
617
+ color: {
618
+ type: PropType<"secondary" | "danger">;
619
+ validator?(value: unknown): boolean;
620
+ } & {
621
+ default: "secondary" | "danger" | (() => "secondary" | "danger") | null;
622
+ };
623
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
624
+ [key: string]: any;
625
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
626
+ id: {
627
+ type: PropType<string>;
628
+ validator?(value: unknown): boolean;
629
+ } & {
630
+ required: true;
631
+ };
632
+ message: {
633
+ type: PropType<string>;
634
+ validator?(value: unknown): boolean;
635
+ } & {
636
+ required: true;
637
+ };
638
+ actions: {
639
+ type: PropType<SnackbarAction[]>;
640
+ validator?(value: unknown): boolean;
641
+ } & {
642
+ default: SnackbarAction[] | (() => SnackbarAction[]) | null;
643
+ };
644
+ color: {
645
+ type: PropType<"secondary" | "danger">;
646
+ validator?(value: unknown): boolean;
647
+ } & {
648
+ default: "secondary" | "danger" | (() => "secondary" | "danger") | null;
649
+ };
650
+ }>>, {
651
+ actions: SnackbarAction[];
652
+ color: "secondary" | "danger";
653
+ }, {}>;
654
+
447
655
  export declare const App: Facade<AppService, Constructor<AppService>>;
448
656
 
449
- export declare class AppService extends _default {
657
+ export declare class AppService extends _default_2 {
658
+ protected boot(): Promise<void>;
450
659
  }
451
660
 
452
661
  export declare function arrayProp<T>(defaultValue?: () => T[]): OptionalProp<T[]>;
@@ -456,27 +665,82 @@ declare type BaseProp<T> = {
456
665
  validator?(value: unknown): boolean;
457
666
  };
458
667
 
668
+ export declare function booleanInput(defaultValue?: boolean): FormFieldDefinition<typeof FormFieldTypes.Boolean>;
669
+
459
670
  export declare function booleanProp(defaultValue?: boolean): OptionalProp<boolean>;
460
671
 
461
672
  export declare function bootServices(app: App_2, services: Record<string, Service>): Promise<void>;
462
673
 
463
674
  export declare function bootstrapApplication(rootComponent: Component, options?: AerogelOptions): Promise<void>;
464
675
 
676
+ export declare type Color = (typeof Colors)[keyof typeof Colors];
677
+
678
+ export declare const Colors: {
679
+ readonly Primary: "primary";
680
+ readonly Secondary: "secondary";
681
+ readonly Danger: "danger";
682
+ readonly Clear: "clear";
683
+ };
684
+
685
+ export declare type ComponentProps = Record<string, unknown>;
686
+
465
687
  export declare function componentRef<T>(): Ref<UnwrapNestedRefs<T> | undefined>;
466
688
 
467
689
  export declare type ComputedStateDefinition<TState extends ServiceState, TComputedState extends ServiceState> = {
468
690
  [K in keyof TComputedState]: (state: TState) => TComputedState[K];
469
- };
691
+ } & ThisType<{
692
+ readonly [K in keyof TComputedState]: TComputedState[K];
693
+ }>;
470
694
 
471
695
  declare const _default: Constructor< {
696
+ logs: ErrorReportLog[];
697
+ startupErrors: ErrorReport[];
698
+ }> & Constructor< {
699
+ hasErrors: boolean;
700
+ hasNewErrors: boolean;
701
+ hasStartupErrors: boolean;
702
+ }> & Constructor<Service< {
703
+ logs: ErrorReportLog[];
704
+ startupErrors: ErrorReport[];
705
+ }, {
706
+ hasErrors: boolean;
707
+ hasNewErrors: boolean;
708
+ hasStartupErrors: boolean;
709
+ }, Partial<{
710
+ logs: ErrorReportLog[];
711
+ startupErrors: ErrorReport[];
712
+ }>>>;
713
+
714
+ declare const _default_2: Constructor< {
472
715
  environment: "production" | "development" | "testing";
716
+ sourceUrl: string | undefined;
717
+ isMounted: boolean;
473
718
  }> & Constructor< {
474
719
  isDevelopment: boolean;
475
- }> & Constructor<Service<DefaultServiceState, {}>> & Service;
720
+ isTesting: boolean;
721
+ }> & Constructor<Service< {
722
+ environment: "production" | "development" | "testing";
723
+ sourceUrl: string | undefined;
724
+ isMounted: boolean;
725
+ }, {
726
+ isDevelopment: boolean;
727
+ isTesting: boolean;
728
+ }, Partial<{
729
+ environment: "production" | "development" | "testing";
730
+ sourceUrl: string | undefined;
731
+ isMounted: boolean;
732
+ }>>>;
476
733
 
477
- declare const _default_2: Constructor< {
734
+ declare const _default_3: Constructor< {
735
+ modals: Modal<unknown>[];
736
+ snackbars: Snackbar[];
737
+ }> & Constructor< {}> & Constructor<Service< {
738
+ modals: Modal<unknown>[];
739
+ snackbars: Snackbar[];
740
+ }, {}, Partial<{
478
741
  modals: Modal<unknown>[];
479
- }> & Constructor< {}> & Constructor<Service<DefaultServiceState, {}>> & Service;
742
+ snackbars: Snackbar[];
743
+ }>>>;
480
744
 
481
745
  export declare type DefaultServices = typeof defaultServices;
482
746
 
@@ -485,19 +749,67 @@ declare const defaultServices: {
485
749
  $events: Facade<EventsService, Constructor<EventsService>>;
486
750
  };
487
751
 
488
- export declare type DefaultServiceState = {};
752
+ export declare type DefaultServiceState = any;
489
753
 
490
754
  export declare function defineDirective(directive: Directive): Directive;
491
755
 
492
756
  export declare function definePlugin<T extends Plugin_2>(plugin: T): T;
493
757
 
494
758
  export declare function defineServiceState<State extends ServiceState = ServiceState, ComputedState extends ServiceState = {}>(options: {
759
+ name: string;
495
760
  initialState: State;
761
+ persist?: (keyof State)[];
496
762
  computed?: ComputedStateDefinition<State, ComputedState>;
497
- }): Constructor<State> & Constructor<ComputedState> & ServiceConstructor;
763
+ serialize?: (state: Partial<State>) => Partial<State>;
764
+ }): Constructor<State> & Constructor<ComputedState> & Constructor<Service<State, ComputedState, Partial<State>>>;
498
765
 
499
766
  export declare function enumProp<Enum extends Record<string, unknown>>(enumeration: Enum, defaultValue?: Enum[keyof Enum]): OptionalProp<Enum[keyof Enum]>;
500
767
 
768
+ export declare type ErrorHandler = (error: ErrorSource) => boolean;
769
+
770
+ export declare interface ErrorReport {
771
+ title: string;
772
+ description?: string;
773
+ details?: string;
774
+ error?: Error | JSError | unknown;
775
+ }
776
+
777
+ export declare interface ErrorReportLog {
778
+ report: ErrorReport;
779
+ seen: boolean;
780
+ date: Date;
781
+ }
782
+
783
+ export declare const errorReportModalProps: {
784
+ reports: {
785
+ type: PropType<ErrorReport[]>;
786
+ validator?(value: unknown): boolean;
787
+ } & {
788
+ required: true;
789
+ };
790
+ };
791
+
792
+ export declare const Errors: Facade<ErrorsService, Constructor<ErrorsService>>;
793
+
794
+ export declare type ErrorSource = string | Error | JSError | unknown;
795
+
796
+ declare class ErrorsService extends _default {
797
+ forceReporting: boolean;
798
+ private enabled;
799
+ enable(): void;
800
+ disable(): void;
801
+ inspect(error: ErrorSource | ErrorReport[]): Promise<void>;
802
+ report(error: ErrorSource, message?: string): Promise<void>;
803
+ see(report: ErrorReport): void;
804
+ seeAll(): void;
805
+ private logError;
806
+ private createErrorReport;
807
+ private createStartupErrorReport;
808
+ private createErrorReportFromError;
809
+ }
810
+
811
+ export declare type ErrorsServices = typeof services;
812
+
501
813
  declare type EventListener_2<T = unknown> = (payload: T) => unknown;
502
814
  export { EventListener_2 as EventListener }
503
815
 
@@ -548,11 +860,12 @@ declare class Form<Fields extends FormFieldDefinitions = FormFieldDefinitions> e
548
860
  private getFieldErrors;
549
861
  private getInitialData;
550
862
  private getInitialErrors;
863
+ private resetData;
551
864
  private resetErrors;
552
865
  }
553
866
 
554
867
  declare type FormData_2<T> = {
555
- [k in keyof T]: T[k] extends FormFieldDefinition<infer TType, infer TRules> ? TRules extends 'required' ? GetFormFieldValue<TType> : GetFormFieldValue<TType> | null : never;
868
+ -readonly [k in keyof T]: T[k] extends FormFieldDefinition<infer TType, infer TRules> ? TRules extends 'required' ? GetFormFieldValue<TType> : GetFormFieldValue<TType> | null : never;
556
869
  };
557
870
  export { FormData_2 as FormData }
558
871
 
@@ -573,15 +886,24 @@ export declare type FormFieldType = ObjectValues<typeof FormFieldTypes>;
573
886
  export declare const FormFieldTypes: {
574
887
  readonly String: "string";
575
888
  readonly Number: "number";
889
+ readonly Boolean: "boolean";
576
890
  };
577
891
 
578
- export declare type GetFormFieldValue<TType> = TType extends typeof FormFieldTypes.String ? string : TType extends typeof FormFieldTypes.Number ? number : never;
892
+ export declare type GetFormFieldValue<TType> = TType extends typeof FormFieldTypes.String ? string : TType extends typeof FormFieldTypes.Number ? number : TType extends typeof FormFieldTypes.Boolean ? boolean : never;
893
+
894
+ export declare interface IAGErrorReportModalButtonsDefaultSlotProps {
895
+ id: string;
896
+ description: string;
897
+ iconComponent: Component;
898
+ url?: string;
899
+ handler?(): void;
900
+ }
579
901
 
580
902
  export declare interface IAGHeadlessInput {
581
903
  id: string;
582
- value: ComputedRef<string | number | null>;
904
+ value: ComputedRef<string | number | boolean | null>;
583
905
  errors: DeepReadonly<Ref<string[] | null>>;
584
- update(value: string | number | null): void;
906
+ update(value: string | number | boolean | null): void;
585
907
  }
586
908
 
587
909
  export declare interface IAGHeadlessModal extends IAGModal {
@@ -592,6 +914,15 @@ export declare interface IAGModal {
592
914
  close(): Promise<void>;
593
915
  }
594
916
 
917
+ export declare interface IAGModalContext {
918
+ modal: Ref<Modal>;
919
+ childIndex: Ref<number>;
920
+ }
921
+
922
+ export declare interface IAGModalDefaultSlotProps {
923
+ close(result?: unknown): Promise<void>;
924
+ }
925
+
595
926
  export declare function injectOrFail<T>(key: InjectionKey<T> | string, errorMessage?: string): T;
596
927
 
597
928
  export declare function injectReactive<T extends object>(key: InjectionKey<T> | string): UnwrapNestedRefs<T> | undefined;
@@ -613,7 +944,7 @@ declare class LangService extends Service {
613
944
  translateWithDefault(key: string, parameters: Record<string, unknown>, defaultMessage: string): string;
614
945
  }
615
946
 
616
- export declare type LangServices = typeof services;
947
+ export declare type LangServices = typeof services_2;
617
948
 
618
949
  export declare function mixedProp<T>(type: PropType<T>): OptionalProp<T | null>;
619
950
 
@@ -655,6 +986,8 @@ export { Plugin_2 as Plugin }
655
986
 
656
987
  export declare function requiredArrayProp<T>(): RequiredProp<T[]>;
657
988
 
989
+ export declare function requiredBooleanInput(defaultValue?: boolean): FormFieldDefinition<typeof FormFieldTypes.Boolean, 'required'>;
990
+
658
991
  export declare function requiredEnumProp<Enum extends Record<string, unknown>>(enumeration: Enum): RequiredProp<Enum[keyof Enum]>;
659
992
 
660
993
  export declare function requiredMixedProp<T>(type: PropType<T>): RequiredProp<T>;
@@ -673,25 +1006,30 @@ export declare function requiredStringInput(defaultValue?: string): FormFieldDef
673
1006
 
674
1007
  export declare function requiredStringProp(): RequiredProp<string>;
675
1008
 
676
- export declare class Service<State extends ServiceState = DefaultServiceState, ComputedState extends ServiceState = {}> extends MagicObject {
677
- protected _namespace: string;
1009
+ export declare class Service<State extends ServiceState = DefaultServiceState, ComputedState extends ServiceState = {}, ServiceStorage extends Partial<State> = Partial<State>> extends MagicObject {
1010
+ static persist: string[];
1011
+ protected _name: string;
678
1012
  private _booted;
679
- private _state;
680
- private _computedState;
1013
+ private _computedStateKeys;
1014
+ private _store?;
681
1015
  constructor();
682
1016
  get booted(): PromisedValue<void>;
683
- launch(namespace?: string): Promise<void>;
1017
+ launch(): Promise<void>;
1018
+ hasState<P extends keyof State>(property: P): boolean;
1019
+ getState(): State;
1020
+ getState<P extends keyof State>(property: P): State[P];
1021
+ setState<P extends keyof State>(property: P, value: State[P]): void;
1022
+ setState(state: Partial<State>): void;
684
1023
  protected __get(property: string): unknown;
685
1024
  protected __set(property: string, value: unknown): void;
686
- protected hasState<P extends keyof State>(property: P): boolean;
687
- protected hasComputedState<P extends keyof State>(property: P): boolean;
688
- protected getState(): State;
689
- protected getState<P extends keyof State>(property: P): State[P];
690
- protected getComputedState<P extends keyof ComputedState>(property: P): ComputedState[P];
691
- protected setState(state: Partial<State>): void;
1025
+ protected onStateUpdated(state: Partial<State>): void;
1026
+ protected usesStore(): boolean;
1027
+ protected getName(): string | null;
692
1028
  protected getInitialState(): State;
693
1029
  protected getComputedStateDefinition(): ComputedStateDefinition<State, ComputedState>;
1030
+ protected serializePersistedState(state: Partial<State>): Partial<State>;
694
1031
  protected boot(): Promise<void>;
1032
+ protected restorePersistedState(): void;
695
1033
  }
696
1034
 
697
1035
  export declare type ServiceConstructor<T extends Service = Service> = Constructor<T> & typeof Service;
@@ -700,15 +1038,73 @@ export declare interface Services extends DefaultServices {
700
1038
  }
701
1039
 
702
1040
  declare const services: {
703
- $lang: Facade<LangService, Constructor<LangService>>;
1041
+ $errors: Facade<ErrorsService, Constructor<ErrorsService>>;
704
1042
  };
705
1043
 
706
1044
  declare const services_2: {
1045
+ $lang: Facade<LangService, Constructor<LangService>>;
1046
+ };
1047
+
1048
+ declare const services_3: {
707
1049
  $ui: Facade<UIService, Constructor<UIService>>;
708
1050
  };
709
1051
 
710
1052
  export declare type ServiceState = Record<string, any>;
711
1053
 
1054
+ declare interface ShowSnackbarOptions {
1055
+ component?: Component;
1056
+ color?: SnackbarColor;
1057
+ actions?: SnackbarAction[];
1058
+ }
1059
+
1060
+ declare interface Snackbar {
1061
+ id: string;
1062
+ component: Component;
1063
+ properties: Record<string, unknown>;
1064
+ }
1065
+
1066
+ export declare interface SnackbarAction {
1067
+ text: string;
1068
+ dismiss?: boolean;
1069
+ handler?(): unknown;
1070
+ }
1071
+
1072
+ export declare type SnackbarColor = (typeof SnackbarColors)[keyof typeof SnackbarColors];
1073
+
1074
+ export declare const SnackbarColors: Omit<{
1075
+ readonly Primary: "primary";
1076
+ readonly Secondary: "secondary";
1077
+ readonly Danger: "danger";
1078
+ readonly Clear: "clear";
1079
+ }, "Primary" | "Clear">;
1080
+
1081
+ export declare const snackbarProps: {
1082
+ id: {
1083
+ type: PropType<string>;
1084
+ validator?(value: unknown): boolean;
1085
+ } & {
1086
+ required: true;
1087
+ };
1088
+ message: {
1089
+ type: PropType<string>;
1090
+ validator?(value: unknown): boolean;
1091
+ } & {
1092
+ required: true;
1093
+ };
1094
+ actions: {
1095
+ type: PropType<SnackbarAction[]>;
1096
+ validator?(value: unknown): boolean;
1097
+ } & {
1098
+ default: SnackbarAction[] | (() => SnackbarAction[]) | null;
1099
+ };
1100
+ color: {
1101
+ type: PropType<"secondary" | "danger">;
1102
+ validator?(value: unknown): boolean;
1103
+ } & {
1104
+ default: "secondary" | "danger" | (() => "secondary" | "danger") | null;
1105
+ };
1106
+ };
1107
+
712
1108
  export declare function stringInput(defaultValue?: string): FormFieldDefinition<typeof FormFieldTypes.String>;
713
1109
 
714
1110
  export declare function stringProp(): OptionalProp<string | null>;
@@ -729,27 +1125,36 @@ export declare type UIComponent = ObjectValues<typeof UIComponents>;
729
1125
  export declare const UIComponents: {
730
1126
  readonly AlertModal: "alert-modal";
731
1127
  readonly ConfirmModal: "confirm-modal";
1128
+ readonly ErrorReportModal: "error-report-modal";
1129
+ readonly LoadingModal: "loading-modal";
1130
+ readonly Snackbar: "snackbar";
732
1131
  };
733
1132
 
734
- declare class UIService extends _default_2 {
1133
+ declare class UIService extends _default_3 {
735
1134
  private modalCallbacks;
736
1135
  private components;
1136
+ requireComponent(name: UIComponent): Component;
737
1137
  alert(message: string): void;
738
1138
  alert(title: string, message: string): void;
739
1139
  confirm(message: string): Promise<boolean>;
740
1140
  confirm(title: string, message: string): Promise<boolean>;
1141
+ loading<T>(operation: Promise<T>): Promise<T>;
1142
+ loading<T>(message: string, operation: Promise<T>): Promise<T>;
1143
+ showSnackbar(message: string, options?: ShowSnackbarOptions): void;
1144
+ hideSnackbar(id: string): void;
741
1145
  registerComponent(name: UIComponent, component: Component): void;
742
1146
  openModal<TModalComponent extends ModalComponent>(component: TModalComponent, properties?: ModalProperties<TModalComponent>): Promise<Modal<ModalResult<TModalComponent>>>;
743
1147
  closeModal(id: string, result?: unknown): Promise<void>;
744
1148
  protected boot(): Promise<void>;
745
- private requireComponent;
746
1149
  private watchModalEvents;
747
1150
  }
748
1151
 
749
- export declare type UIServices = typeof services_2;
1152
+ export declare type UIServices = typeof services_3;
750
1153
 
751
1154
  export declare type UnknownEvent<T> = T extends keyof EventsPayload ? never : T;
752
1155
 
1156
+ export declare function useErrorReportModalProps(): typeof errorReportModalProps;
1157
+
753
1158
  export declare function useEvent<Event extends EventWithoutPayload>(event: Event, listener: () => unknown): void;
754
1159
 
755
1160
  export declare function useEvent<Event extends EventWithPayload>(event: Event, listener: EventListener_2<EventsPayload[Event]>): void;
@@ -758,14 +1163,23 @@ export declare function useEvent<Event extends string>(event: UnknownEvent<Event
758
1163
 
759
1164
  export declare function useForm<const T extends FormFieldDefinitions>(fields: T): Form<T> & FormData_2<T>;
760
1165
 
1166
+ export declare function useInputAttrs(): [ComputedRef<{}>, ComputedRef<unknown>];
1167
+
1168
+ export declare function useSnackbarProps(): typeof snackbarProps;
1169
+
761
1170
  export { }
762
1171
 
763
- declare global {
764
- export const __AG_BASE_PATH: string | undefined;
765
- export const __AG_ENV: 'production' | 'development' | 'testing';
766
- }
1172
+ interface AerogelOptions {
1173
+ directives?: Record<string, Directive>;
1174
+ }
1175
+
1176
+ interface AerogelOptions {
1177
+ handleError?(error: ErrorSource): boolean;
1178
+ }
767
1179
 
768
- interface Services extends LangServices {}
1180
+ export interface Services extends ErrorsServices {}
1181
+
1182
+ export interface Services extends LangServices {}
769
1183
 
770
1184
  declare module '@vue/runtime-core' {
771
1185
  interface ComponentCustomProperties {
@@ -773,6 +1187,10 @@ declare module '@vue/runtime-core' {
773
1187
  }
774
1188
  }
775
1189
 
1190
+ interface AerogelOptions {
1191
+ services?: Record<string, Service>;
1192
+ }
1193
+
776
1194
  declare module '@vue/runtime-core' {
777
1195
  interface ComponentCustomProperties extends Services {}
778
1196
  }
@@ -789,4 +1207,4 @@ declare module '@vue/runtime-core' {
789
1207
  components?: Partial<Record<UIComponent, Component>>;
790
1208
  }
791
1209
 
792
- interface Services extends UIServices {}
1210
+ export interface Services extends UIServices {}