@aerogel/core 0.0.0-next.926bde19326fe7b6b24b277666936862b64d8295 → 0.0.0-next.b58141fee5d2fe7d25debdbca6b1d2bf1c13e48e

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 (69) 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 +535 -87
  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 +4 -3
  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/AGErrorMessage.vue +16 -0
  14. package/src/components/basic/AGLink.vue +9 -0
  15. package/src/components/basic/AGMarkdown.vue +10 -9
  16. package/src/components/basic/index.ts +3 -1
  17. package/src/components/constants.ts +8 -0
  18. package/src/components/forms/AGButton.vue +33 -10
  19. package/src/components/forms/AGCheckbox.vue +35 -0
  20. package/src/components/forms/AGInput.vue +8 -4
  21. package/src/components/forms/index.ts +2 -1
  22. package/src/components/headless/forms/AGHeadlessButton.vue +7 -7
  23. package/src/components/headless/forms/AGHeadlessInput.ts +2 -2
  24. package/src/components/headless/forms/AGHeadlessInput.vue +3 -3
  25. package/src/components/headless/forms/AGHeadlessInputError.vue +1 -1
  26. package/src/components/headless/forms/AGHeadlessInputInput.vue +15 -3
  27. package/src/components/headless/index.ts +1 -0
  28. package/src/components/headless/modals/AGHeadlessModalPanel.vue +5 -1
  29. package/src/components/headless/snackbars/AGHeadlessSnackbar.vue +10 -0
  30. package/src/components/headless/snackbars/index.ts +25 -0
  31. package/src/components/index.ts +2 -0
  32. package/src/components/modals/AGAlertModal.vue +0 -1
  33. package/src/components/modals/AGConfirmModal.vue +1 -1
  34. package/src/components/modals/AGErrorReportModal.ts +20 -0
  35. package/src/components/modals/AGErrorReportModal.vue +62 -0
  36. package/src/components/modals/AGErrorReportModalButtons.vue +109 -0
  37. package/src/components/modals/AGErrorReportModalTitle.vue +25 -0
  38. package/src/components/modals/AGLoadingModal.vue +19 -0
  39. package/src/components/modals/AGModal.vue +23 -4
  40. package/src/components/modals/AGModalTitle.vue +9 -0
  41. package/src/components/modals/index.ts +18 -2
  42. package/src/components/snackbars/AGSnackbar.vue +42 -0
  43. package/src/components/snackbars/index.ts +3 -0
  44. package/src/directives/index.ts +16 -3
  45. package/src/errors/Errors.state.ts +31 -0
  46. package/src/errors/Errors.ts +183 -0
  47. package/src/errors/index.ts +59 -0
  48. package/src/forms/Form.ts +15 -12
  49. package/src/forms/utils.ts +17 -0
  50. package/src/lang/Lang.ts +12 -4
  51. package/src/lang/index.ts +3 -5
  52. package/src/lang/utils.ts +4 -0
  53. package/src/main.ts +1 -2
  54. package/src/services/App.state.ts +8 -2
  55. package/src/services/App.ts +9 -1
  56. package/src/services/Service.ts +132 -45
  57. package/src/services/index.ts +21 -4
  58. package/src/services/store.ts +27 -0
  59. package/src/types/virtual.d.ts +11 -0
  60. package/src/ui/UI.state.ts +11 -1
  61. package/src/ui/UI.ts +52 -8
  62. package/src/ui/index.ts +7 -1
  63. package/src/utils/composition/forms.ts +11 -0
  64. package/src/utils/index.ts +1 -0
  65. package/src/utils/markdown.ts +11 -2
  66. package/src/utils/vue.ts +2 -0
  67. package/tsconfig.json +1 -0
  68. package/vite.config.ts +2 -1
  69. 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,87 @@ required: true;
120
139
  title: string | null;
121
140
  }, {}>;
122
141
 
142
+ export declare const AGErrorMessage: DefineComponent< {
143
+ error: {
144
+ type: PropType<unknown>;
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
+ error: {
153
+ type: PropType<unknown>;
154
+ validator?(value: unknown): boolean;
155
+ } & {
156
+ required: true;
157
+ };
158
+ }>>, {}, {}>;
159
+
160
+ export declare const AGErrorReportModalButtons: DefineComponent< {
161
+ report: {
162
+ type: PropType<ErrorReport>;
163
+ validator?(value: unknown): boolean;
164
+ } & {
165
+ required: true;
166
+ };
167
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
168
+ [key: string]: any;
169
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
170
+ report: {
171
+ type: PropType<ErrorReport>;
172
+ validator?(value: unknown): boolean;
173
+ } & {
174
+ required: true;
175
+ };
176
+ }>>, {}, {}>;
177
+
178
+ export declare const AGErrorReportModalTitle: DefineComponent< {
179
+ report: {
180
+ type: PropType<ErrorReport>;
181
+ validator?(value: unknown): boolean;
182
+ } & {
183
+ required: true;
184
+ };
185
+ currentReport: {
186
+ type: PropType<number | null>;
187
+ validator?(value: unknown): boolean;
188
+ } & {
189
+ default: number | (() => number | null) | null;
190
+ };
191
+ totalReports: {
192
+ type: PropType<number | null>;
193
+ validator?(value: unknown): boolean;
194
+ } & {
195
+ default: number | (() => number | null) | null;
196
+ };
197
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
198
+ [key: string]: any;
199
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
200
+ report: {
201
+ type: PropType<ErrorReport>;
202
+ validator?(value: unknown): boolean;
203
+ } & {
204
+ required: true;
205
+ };
206
+ currentReport: {
207
+ type: PropType<number | null>;
208
+ validator?(value: unknown): boolean;
209
+ } & {
210
+ default: number | (() => number | null) | null;
211
+ };
212
+ totalReports: {
213
+ type: PropType<number | null>;
214
+ validator?(value: unknown): boolean;
215
+ } & {
216
+ default: number | (() => number | null) | null;
217
+ };
218
+ }>>, {
219
+ currentReport: number | null;
220
+ totalReports: number | null;
221
+ }, {}>;
222
+
123
223
  export declare const AGForm: DefineComponent< {
124
224
  form: {
125
225
  type: PropType<Form<FormFieldDefinitions> | null>;
@@ -143,6 +243,12 @@ form: Form<FormFieldDefinitions> | null;
143
243
  }, {}>;
144
244
 
145
245
  export declare const AGHeadlessButton: DefineComponent< {
246
+ href: {
247
+ type: PropType<string | null>;
248
+ validator?(value: unknown): boolean;
249
+ } & {
250
+ default: string | (() => string | null) | null;
251
+ };
146
252
  url: {
147
253
  type: PropType<string | null>;
148
254
  validator?(value: unknown): boolean;
@@ -156,16 +262,16 @@ validator?(value: unknown): boolean;
156
262
  default: string | (() => string | null) | null;
157
263
  };
158
264
  routeParams: {
159
- type: PropType<RouteParams>;
265
+ type: PropType< {}>;
160
266
  validator?(value: unknown): boolean;
161
267
  } & {
162
- default: RouteParams | (() => RouteParams) | null;
268
+ default: {} | (() => {}) | null;
163
269
  };
164
270
  routeQuery: {
165
- type: PropType<LocationQuery>;
271
+ type: PropType< {}>;
166
272
  validator?(value: unknown): boolean;
167
273
  } & {
168
- default: LocationQuery | (() => LocationQuery) | null;
274
+ default: {} | (() => {}) | null;
169
275
  };
170
276
  submit: {
171
277
  type: PropType<boolean>;
@@ -176,6 +282,12 @@ default: boolean | (() => boolean) | null;
176
282
  }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
177
283
  [key: string]: any;
178
284
  }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
285
+ href: {
286
+ type: PropType<string | null>;
287
+ validator?(value: unknown): boolean;
288
+ } & {
289
+ default: string | (() => string | null) | null;
290
+ };
179
291
  url: {
180
292
  type: PropType<string | null>;
181
293
  validator?(value: unknown): boolean;
@@ -189,16 +301,16 @@ validator?(value: unknown): boolean;
189
301
  default: string | (() => string | null) | null;
190
302
  };
191
303
  routeParams: {
192
- type: PropType<RouteParams>;
304
+ type: PropType< {}>;
193
305
  validator?(value: unknown): boolean;
194
306
  } & {
195
- default: RouteParams | (() => RouteParams) | null;
307
+ default: {} | (() => {}) | null;
196
308
  };
197
309
  routeQuery: {
198
- type: PropType<LocationQuery>;
310
+ type: PropType< {}>;
199
311
  validator?(value: unknown): boolean;
200
312
  } & {
201
- default: LocationQuery | (() => LocationQuery) | null;
313
+ default: {} | (() => {}) | null;
202
314
  };
203
315
  submit: {
204
316
  type: PropType<boolean>;
@@ -207,19 +319,20 @@ validator?(value: unknown): boolean;
207
319
  default: boolean | (() => boolean) | null;
208
320
  };
209
321
  }>>, {
322
+ href: string | null;
210
323
  url: string | null;
211
324
  route: string | null;
212
- routeParams: RouteParams;
213
- routeQuery: LocationQuery;
325
+ routeParams: {};
326
+ routeQuery: {};
214
327
  submit: boolean;
215
328
  }, {}>;
216
329
 
217
330
  export declare const AGHeadlessInput: DefineComponent< {
218
331
  as: {
219
- type: PropType<string | null>;
332
+ type: PropType<string>;
220
333
  validator?(value: unknown): boolean;
221
334
  } & {
222
- default: string | (() => string | null) | null;
335
+ default: string | (() => string) | null;
223
336
  };
224
337
  name: {
225
338
  type: PropType<string | null>;
@@ -228,19 +341,19 @@ validator?(value: unknown): boolean;
228
341
  default: string | (() => string | null) | null;
229
342
  };
230
343
  modelValue: {
231
- type: PropType<string | null>;
344
+ type: PropType<string | number | boolean | null>;
232
345
  validator?(value: unknown): boolean;
233
346
  } & {
234
- default: string | (() => string | null) | null;
347
+ default: string | number | boolean | (() => string | number | boolean | null) | null;
235
348
  };
236
349
  }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
237
350
  [key: string]: any;
238
351
  }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
239
352
  as: {
240
- type: PropType<string | null>;
353
+ type: PropType<string>;
241
354
  validator?(value: unknown): boolean;
242
355
  } & {
243
- default: string | (() => string | null) | null;
356
+ default: string | (() => string) | null;
244
357
  };
245
358
  name: {
246
359
  type: PropType<string | null>;
@@ -249,26 +362,42 @@ validator?(value: unknown): boolean;
249
362
  default: string | (() => string | null) | null;
250
363
  };
251
364
  modelValue: {
252
- type: PropType<string | null>;
365
+ type: PropType<string | number | boolean | null>;
253
366
  validator?(value: unknown): boolean;
254
367
  } & {
255
- default: string | (() => string | null) | null;
368
+ default: string | number | boolean | (() => string | number | boolean | null) | null;
256
369
  };
257
370
  }>> & {
258
371
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
259
372
  }, {
260
- as: string | null;
373
+ as: string;
261
374
  name: string | null;
262
- modelValue: string | null;
375
+ modelValue: string | number | boolean | null;
263
376
  }, {}>;
264
377
 
265
378
  export declare const AGHeadlessInputError: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
266
379
  [key: string]: any;
267
380
  }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
268
381
 
269
- export declare const AGHeadlessInputInput: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
382
+ export declare const AGHeadlessInputInput: DefineComponent< {
383
+ type: {
384
+ type: PropType<string>;
385
+ validator?(value: unknown): boolean;
386
+ } & {
387
+ default: string | (() => string) | null;
388
+ };
389
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
270
390
  [key: string]: any;
271
- }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
391
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
392
+ type: {
393
+ type: PropType<string>;
394
+ validator?(value: unknown): boolean;
395
+ } & {
396
+ default: string | (() => string) | null;
397
+ };
398
+ }>>, {
399
+ type: string;
400
+ }, {}>;
272
401
 
273
402
  export declare const AGHeadlessInputLabel: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
274
403
  [key: string]: any;
@@ -318,6 +447,10 @@ default: string | (() => string) | null;
318
447
  as: string;
319
448
  }, {}>;
320
449
 
450
+ export declare const AGHeadlessSnackbar: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
451
+ [key: string]: any;
452
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
453
+
321
454
  export declare const AGInput: DefineComponent< {
322
455
  name: {
323
456
  type: PropType<string | null>;
@@ -338,20 +471,32 @@ default: string | (() => string | null) | null;
338
471
  name: string | null;
339
472
  }, {}>;
340
473
 
341
- export declare const AGMarkdown: DefineComponent< {
342
- as: {
343
- type: PropType<string>;
474
+ export declare const AGLink: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
475
+ [key: string]: any;
476
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
477
+
478
+ export declare const AGLoadingModal: DefineComponent< {
479
+ message: {
480
+ type: PropType<string | null>;
344
481
  validator?(value: unknown): boolean;
345
482
  } & {
346
- default: string | (() => string) | null;
483
+ default: string | (() => string | null) | null;
347
484
  };
348
- langKey: {
485
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
486
+ [key: string]: any;
487
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
488
+ message: {
349
489
  type: PropType<string | null>;
350
490
  validator?(value: unknown): boolean;
351
491
  } & {
352
492
  default: string | (() => string | null) | null;
353
493
  };
354
- text: {
494
+ }>>, {
495
+ message: string | null;
496
+ }, {}>;
497
+
498
+ export declare const AGMarkdown: DefineComponent< {
499
+ as: {
355
500
  type: PropType<string | null>;
356
501
  validator?(value: unknown): boolean;
357
502
  } & {
@@ -363,20 +508,38 @@ validator?(value: unknown): boolean;
363
508
  } & {
364
509
  default: boolean | (() => boolean) | null;
365
510
  };
366
- raw: {
367
- type: PropType<boolean>;
511
+ langKey: {
512
+ type: PropType<string | null>;
368
513
  validator?(value: unknown): boolean;
369
514
  } & {
370
- default: boolean | (() => boolean) | null;
515
+ default: string | (() => string | null) | null;
516
+ };
517
+ langParams: {
518
+ type: PropType<Record<string, unknown> | null>;
519
+ validator?(value: unknown): boolean;
520
+ } & {
521
+ default: Record<string, unknown> | (() => Record<string, unknown> | null) | null;
522
+ };
523
+ text: {
524
+ type: PropType<string | null>;
525
+ validator?(value: unknown): boolean;
526
+ } & {
527
+ default: string | (() => string | null) | null;
371
528
  };
372
529
  }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
373
530
  [key: string]: any;
374
531
  }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
375
532
  as: {
376
- type: PropType<string>;
533
+ type: PropType<string | null>;
377
534
  validator?(value: unknown): boolean;
378
535
  } & {
379
- default: string | (() => string) | null;
536
+ default: string | (() => string | null) | null;
537
+ };
538
+ inline: {
539
+ type: PropType<boolean>;
540
+ validator?(value: unknown): boolean;
541
+ } & {
542
+ default: boolean | (() => boolean) | null;
380
543
  };
381
544
  langKey: {
382
545
  type: PropType<string | null>;
@@ -384,36 +547,46 @@ validator?(value: unknown): boolean;
384
547
  } & {
385
548
  default: string | (() => string | null) | null;
386
549
  };
550
+ langParams: {
551
+ type: PropType<Record<string, unknown> | null>;
552
+ validator?(value: unknown): boolean;
553
+ } & {
554
+ default: Record<string, unknown> | (() => Record<string, unknown> | null) | null;
555
+ };
387
556
  text: {
388
557
  type: PropType<string | null>;
389
558
  validator?(value: unknown): boolean;
390
559
  } & {
391
560
  default: string | (() => string | null) | null;
392
561
  };
393
- inline: {
562
+ }>>, {
563
+ as: string | null;
564
+ inline: boolean;
565
+ langKey: string | null;
566
+ langParams: Record<string, unknown> | null;
567
+ text: string | null;
568
+ }, {}>;
569
+
570
+ export declare const AGModal: DefineComponent< {
571
+ cancellable: {
394
572
  type: PropType<boolean>;
395
573
  validator?(value: unknown): boolean;
396
574
  } & {
397
575
  default: boolean | (() => boolean) | null;
398
576
  };
399
- raw: {
577
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
578
+ [key: string]: any;
579
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
580
+ cancellable: {
400
581
  type: PropType<boolean>;
401
582
  validator?(value: unknown): boolean;
402
583
  } & {
403
584
  default: boolean | (() => boolean) | null;
404
585
  };
405
586
  }>>, {
406
- as: string;
407
- langKey: string | null;
408
- text: string | null;
409
- inline: boolean;
410
- raw: boolean;
587
+ cancellable: boolean;
411
588
  }, {}>;
412
589
 
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
590
  export declare const AGModalContext: DefineComponent< {
418
591
  modal: {
419
592
  type: PropType<Modal<unknown>>;
@@ -444,9 +617,71 @@ required: true;
444
617
  };
445
618
  }>>, {}, {}>;
446
619
 
620
+ export declare const AGModalTitle: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
621
+ [key: string]: any;
622
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
623
+
624
+ export declare const AGSnackbar: DefineComponent< {
625
+ id: {
626
+ type: PropType<string>;
627
+ validator?(value: unknown): boolean;
628
+ } & {
629
+ required: true;
630
+ };
631
+ message: {
632
+ type: PropType<string>;
633
+ validator?(value: unknown): boolean;
634
+ } & {
635
+ required: true;
636
+ };
637
+ actions: {
638
+ type: PropType<SnackbarAction[]>;
639
+ validator?(value: unknown): boolean;
640
+ } & {
641
+ default: SnackbarAction[] | (() => SnackbarAction[]) | null;
642
+ };
643
+ color: {
644
+ type: PropType<"secondary" | "danger">;
645
+ validator?(value: unknown): boolean;
646
+ } & {
647
+ default: "secondary" | "danger" | (() => "secondary" | "danger") | null;
648
+ };
649
+ }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
650
+ [key: string]: any;
651
+ }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes< {
652
+ id: {
653
+ type: PropType<string>;
654
+ validator?(value: unknown): boolean;
655
+ } & {
656
+ required: true;
657
+ };
658
+ message: {
659
+ type: PropType<string>;
660
+ validator?(value: unknown): boolean;
661
+ } & {
662
+ required: true;
663
+ };
664
+ actions: {
665
+ type: PropType<SnackbarAction[]>;
666
+ validator?(value: unknown): boolean;
667
+ } & {
668
+ default: SnackbarAction[] | (() => SnackbarAction[]) | null;
669
+ };
670
+ color: {
671
+ type: PropType<"secondary" | "danger">;
672
+ validator?(value: unknown): boolean;
673
+ } & {
674
+ default: "secondary" | "danger" | (() => "secondary" | "danger") | null;
675
+ };
676
+ }>>, {
677
+ actions: SnackbarAction[];
678
+ color: "secondary" | "danger";
679
+ }, {}>;
680
+
447
681
  export declare const App: Facade<AppService, Constructor<AppService>>;
448
682
 
449
- export declare class AppService extends _default {
683
+ export declare class AppService extends _default_2 {
684
+ protected boot(): Promise<void>;
450
685
  }
451
686
 
452
687
  export declare function arrayProp<T>(defaultValue?: () => T[]): OptionalProp<T[]>;
@@ -456,27 +691,82 @@ declare type BaseProp<T> = {
456
691
  validator?(value: unknown): boolean;
457
692
  };
458
693
 
694
+ export declare function booleanInput(defaultValue?: boolean): FormFieldDefinition<typeof FormFieldTypes.Boolean>;
695
+
459
696
  export declare function booleanProp(defaultValue?: boolean): OptionalProp<boolean>;
460
697
 
461
698
  export declare function bootServices(app: App_2, services: Record<string, Service>): Promise<void>;
462
699
 
463
700
  export declare function bootstrapApplication(rootComponent: Component, options?: AerogelOptions): Promise<void>;
464
701
 
702
+ export declare type Color = (typeof Colors)[keyof typeof Colors];
703
+
704
+ export declare const Colors: {
705
+ readonly Primary: "primary";
706
+ readonly Secondary: "secondary";
707
+ readonly Danger: "danger";
708
+ readonly Clear: "clear";
709
+ };
710
+
711
+ export declare type ComponentProps = Record<string, unknown>;
712
+
465
713
  export declare function componentRef<T>(): Ref<UnwrapNestedRefs<T> | undefined>;
466
714
 
467
715
  export declare type ComputedStateDefinition<TState extends ServiceState, TComputedState extends ServiceState> = {
468
716
  [K in keyof TComputedState]: (state: TState) => TComputedState[K];
469
- };
717
+ } & ThisType<{
718
+ readonly [K in keyof TComputedState]: TComputedState[K];
719
+ }>;
470
720
 
471
721
  declare const _default: Constructor< {
472
- environment: "production" | "development" | "testing";
722
+ logs: ErrorReportLog[];
723
+ startupErrors: ErrorReport[];
473
724
  }> & Constructor< {
474
- isDevelopment: boolean;
475
- }> & Constructor<Service<DefaultServiceState, {}>> & Service;
725
+ hasErrors: boolean;
726
+ hasNewErrors: boolean;
727
+ hasStartupErrors: boolean;
728
+ }> & Constructor<Service< {
729
+ logs: ErrorReportLog[];
730
+ startupErrors: ErrorReport[];
731
+ }, {
732
+ hasErrors: boolean;
733
+ hasNewErrors: boolean;
734
+ hasStartupErrors: boolean;
735
+ }, Partial<{
736
+ logs: ErrorReportLog[];
737
+ startupErrors: ErrorReport[];
738
+ }>>>;
476
739
 
477
740
  declare const _default_2: Constructor< {
741
+ environment: "production" | "development" | "testing";
742
+ sourceUrl: string | undefined;
743
+ isMounted: boolean;
744
+ }> & Constructor< {
745
+ development: boolean;
746
+ testing: boolean;
747
+ }> & Constructor<Service< {
748
+ environment: "production" | "development" | "testing";
749
+ sourceUrl: string | undefined;
750
+ isMounted: boolean;
751
+ }, {
752
+ development: boolean;
753
+ testing: boolean;
754
+ }, Partial<{
755
+ environment: "production" | "development" | "testing";
756
+ sourceUrl: string | undefined;
757
+ isMounted: boolean;
758
+ }>>>;
759
+
760
+ declare const _default_3: Constructor< {
761
+ modals: Modal<unknown>[];
762
+ snackbars: Snackbar[];
763
+ }> & Constructor< {}> & Constructor<Service< {
478
764
  modals: Modal<unknown>[];
479
- }> & Constructor< {}> & Constructor<Service<DefaultServiceState, {}>> & Service;
765
+ snackbars: Snackbar[];
766
+ }, {}, Partial<{
767
+ modals: Modal<unknown>[];
768
+ snackbars: Snackbar[];
769
+ }>>>;
480
770
 
481
771
  export declare type DefaultServices = typeof defaultServices;
482
772
 
@@ -485,19 +775,68 @@ declare const defaultServices: {
485
775
  $events: Facade<EventsService, Constructor<EventsService>>;
486
776
  };
487
777
 
488
- export declare type DefaultServiceState = {};
778
+ export declare type DefaultServiceState = any;
489
779
 
490
780
  export declare function defineDirective(directive: Directive): Directive;
491
781
 
492
782
  export declare function definePlugin<T extends Plugin_2>(plugin: T): T;
493
783
 
494
784
  export declare function defineServiceState<State extends ServiceState = ServiceState, ComputedState extends ServiceState = {}>(options: {
785
+ name: string;
495
786
  initialState: State;
787
+ persist?: (keyof State)[];
496
788
  computed?: ComputedStateDefinition<State, ComputedState>;
497
- }): Constructor<State> & Constructor<ComputedState> & ServiceConstructor;
789
+ serialize?: (state: Partial<State>) => Partial<State>;
790
+ }): Constructor<State> & Constructor<ComputedState> & Constructor<Service<State, ComputedState, Partial<State>>>;
498
791
 
499
792
  export declare function enumProp<Enum extends Record<string, unknown>>(enumeration: Enum, defaultValue?: Enum[keyof Enum]): OptionalProp<Enum[keyof Enum]>;
500
793
 
794
+ export declare type ErrorHandler = (error: ErrorSource) => boolean;
795
+
796
+ export declare interface ErrorReport {
797
+ title: string;
798
+ description?: string;
799
+ details?: string;
800
+ error?: Error | JSError | unknown;
801
+ }
802
+
803
+ export declare interface ErrorReportLog {
804
+ report: ErrorReport;
805
+ seen: boolean;
806
+ date: Date;
807
+ }
808
+
809
+ export declare const errorReportModalProps: {
810
+ reports: {
811
+ type: PropType<ErrorReport[]>;
812
+ validator?(value: unknown): boolean;
813
+ } & {
814
+ required: true;
815
+ };
816
+ };
817
+
818
+ export declare const Errors: Facade<ErrorsService, Constructor<ErrorsService>>;
819
+
820
+ export declare type ErrorSource = string | Error | JSError | unknown;
821
+
822
+ declare class ErrorsService extends _default {
823
+ forceReporting: boolean;
824
+ private enabled;
825
+ enable(): void;
826
+ disable(): void;
827
+ inspect(error: ErrorSource | ErrorReport[]): Promise<void>;
828
+ report(error: ErrorSource, message?: string): Promise<void>;
829
+ see(report: ErrorReport): void;
830
+ seeAll(): void;
831
+ getErrorMessage(error: ErrorSource): string;
832
+ private logError;
833
+ private createErrorReport;
834
+ private createStartupErrorReport;
835
+ private createErrorReportFromError;
836
+ }
837
+
838
+ export declare type ErrorsServices = typeof services;
839
+
501
840
  declare type EventListener_2<T = unknown> = (payload: T) => unknown;
502
841
  export { EventListener_2 as EventListener }
503
842
 
@@ -541,7 +880,10 @@ declare class Form<Fields extends FormFieldDefinitions = FormFieldDefinitions> e
541
880
  setFieldValue<T extends keyof Fields>(field: T, value: FormData_2<Fields>[T]): void;
542
881
  getFieldValue<T extends keyof Fields>(field: T): GetFormFieldValue<Fields[T]['type']>;
543
882
  validate(): boolean;
544
- reset(): void;
883
+ reset(options?: {
884
+ keepData?: boolean;
885
+ keepErrors?: boolean;
886
+ }): void;
545
887
  submit(): boolean;
546
888
  protected __get(property: string): unknown;
547
889
  protected __set(property: string, value: unknown): void;
@@ -574,15 +916,24 @@ export declare type FormFieldType = ObjectValues<typeof FormFieldTypes>;
574
916
  export declare const FormFieldTypes: {
575
917
  readonly String: "string";
576
918
  readonly Number: "number";
919
+ readonly Boolean: "boolean";
577
920
  };
578
921
 
579
- export declare type GetFormFieldValue<TType> = TType extends typeof FormFieldTypes.String ? string : TType extends typeof FormFieldTypes.Number ? number : never;
922
+ export declare type GetFormFieldValue<TType> = TType extends typeof FormFieldTypes.String ? string : TType extends typeof FormFieldTypes.Number ? number : TType extends typeof FormFieldTypes.Boolean ? boolean : never;
923
+
924
+ export declare interface IAGErrorReportModalButtonsDefaultSlotProps {
925
+ id: string;
926
+ description: string;
927
+ iconComponent: Component;
928
+ url?: string;
929
+ handler?(): void;
930
+ }
580
931
 
581
932
  export declare interface IAGHeadlessInput {
582
933
  id: string;
583
- value: ComputedRef<string | number | null>;
934
+ value: ComputedRef<string | number | boolean | null>;
584
935
  errors: DeepReadonly<Ref<string[] | null>>;
585
- update(value: string | number | null): void;
936
+ update(value: string | number | boolean | null): void;
586
937
  }
587
938
 
588
939
  export declare interface IAGHeadlessModal extends IAGModal {
@@ -593,6 +944,15 @@ export declare interface IAGModal {
593
944
  close(): Promise<void>;
594
945
  }
595
946
 
947
+ export declare interface IAGModalContext {
948
+ modal: Ref<Modal>;
949
+ childIndex: Ref<number>;
950
+ }
951
+
952
+ export declare interface IAGModalDefaultSlotProps {
953
+ close(result?: unknown): Promise<void>;
954
+ }
955
+
596
956
  export declare function injectOrFail<T>(key: InjectionKey<T> | string, errorMessage?: string): T;
597
957
 
598
958
  export declare function injectReactive<T extends object>(key: InjectionKey<T> | string): UnwrapNestedRefs<T> | undefined;
@@ -614,7 +974,7 @@ declare class LangService extends Service {
614
974
  translateWithDefault(key: string, parameters: Record<string, unknown>, defaultMessage: string): string;
615
975
  }
616
976
 
617
- export declare type LangServices = typeof services;
977
+ export declare type LangServices = typeof services_2;
618
978
 
619
979
  export declare function mixedProp<T>(type: PropType<T>): OptionalProp<T | null>;
620
980
 
@@ -656,6 +1016,8 @@ export { Plugin_2 as Plugin }
656
1016
 
657
1017
  export declare function requiredArrayProp<T>(): RequiredProp<T[]>;
658
1018
 
1019
+ export declare function requiredBooleanInput(defaultValue?: boolean): FormFieldDefinition<typeof FormFieldTypes.Boolean, 'required'>;
1020
+
659
1021
  export declare function requiredEnumProp<Enum extends Record<string, unknown>>(enumeration: Enum): RequiredProp<Enum[keyof Enum]>;
660
1022
 
661
1023
  export declare function requiredMixedProp<T>(type: PropType<T>): RequiredProp<T>;
@@ -674,25 +1036,31 @@ export declare function requiredStringInput(defaultValue?: string): FormFieldDef
674
1036
 
675
1037
  export declare function requiredStringProp(): RequiredProp<string>;
676
1038
 
677
- export declare class Service<State extends ServiceState = DefaultServiceState, ComputedState extends ServiceState = {}> extends MagicObject {
678
- protected _namespace: string;
1039
+ export declare class Service<State extends ServiceState = DefaultServiceState, ComputedState extends ServiceState = {}, ServiceStorage extends Partial<State> = Partial<State>> extends MagicObject {
1040
+ static persist: string[];
1041
+ protected _name: string;
679
1042
  private _booted;
680
- private _state;
681
- private _computedState;
1043
+ private _computedStateKeys;
1044
+ private _store?;
682
1045
  constructor();
683
1046
  get booted(): PromisedValue<void>;
684
- launch(namespace?: string): Promise<void>;
1047
+ launch(): Promise<void>;
1048
+ hasState<P extends keyof State>(property: P): boolean;
1049
+ getState(): State;
1050
+ getState<P extends keyof State>(property: P): State[P];
1051
+ setState<P extends keyof State>(property: P, value: State[P]): void;
1052
+ setState(state: Partial<State>): void;
685
1053
  protected __get(property: string): unknown;
686
1054
  protected __set(property: string, value: unknown): void;
687
- protected hasState<P extends keyof State>(property: P): boolean;
688
- protected hasComputedState<P extends keyof State>(property: P): boolean;
689
- protected getState(): State;
690
- protected getState<P extends keyof State>(property: P): State[P];
691
- protected getComputedState<P extends keyof ComputedState>(property: P): ComputedState[P];
692
- protected setState(state: Partial<State>): void;
1055
+ protected onStateUpdated(state: Partial<State>): void;
1056
+ protected usesStore(): boolean;
1057
+ protected getName(): string | null;
693
1058
  protected getInitialState(): State;
694
1059
  protected getComputedStateDefinition(): ComputedStateDefinition<State, ComputedState>;
1060
+ protected serializePersistedState(state: Partial<State>): Partial<State>;
1061
+ protected frameworkBoot(): Promise<void>;
695
1062
  protected boot(): Promise<void>;
1063
+ protected restorePersistedState(): void;
696
1064
  }
697
1065
 
698
1066
  export declare type ServiceConstructor<T extends Service = Service> = Constructor<T> & typeof Service;
@@ -701,15 +1069,73 @@ export declare interface Services extends DefaultServices {
701
1069
  }
702
1070
 
703
1071
  declare const services: {
704
- $lang: Facade<LangService, Constructor<LangService>>;
1072
+ $errors: Facade<ErrorsService, Constructor<ErrorsService>>;
705
1073
  };
706
1074
 
707
1075
  declare const services_2: {
1076
+ $lang: Facade<LangService, Constructor<LangService>>;
1077
+ };
1078
+
1079
+ declare const services_3: {
708
1080
  $ui: Facade<UIService, Constructor<UIService>>;
709
1081
  };
710
1082
 
711
1083
  export declare type ServiceState = Record<string, any>;
712
1084
 
1085
+ declare interface ShowSnackbarOptions {
1086
+ component?: Component;
1087
+ color?: SnackbarColor;
1088
+ actions?: SnackbarAction[];
1089
+ }
1090
+
1091
+ declare interface Snackbar {
1092
+ id: string;
1093
+ component: Component;
1094
+ properties: Record<string, unknown>;
1095
+ }
1096
+
1097
+ export declare interface SnackbarAction {
1098
+ text: string;
1099
+ dismiss?: boolean;
1100
+ handler?(): unknown;
1101
+ }
1102
+
1103
+ export declare type SnackbarColor = (typeof SnackbarColors)[keyof typeof SnackbarColors];
1104
+
1105
+ export declare const SnackbarColors: Omit<{
1106
+ readonly Primary: "primary";
1107
+ readonly Secondary: "secondary";
1108
+ readonly Danger: "danger";
1109
+ readonly Clear: "clear";
1110
+ }, "Primary" | "Clear">;
1111
+
1112
+ export declare const snackbarProps: {
1113
+ id: {
1114
+ type: PropType<string>;
1115
+ validator?(value: unknown): boolean;
1116
+ } & {
1117
+ required: true;
1118
+ };
1119
+ message: {
1120
+ type: PropType<string>;
1121
+ validator?(value: unknown): boolean;
1122
+ } & {
1123
+ required: true;
1124
+ };
1125
+ actions: {
1126
+ type: PropType<SnackbarAction[]>;
1127
+ validator?(value: unknown): boolean;
1128
+ } & {
1129
+ default: SnackbarAction[] | (() => SnackbarAction[]) | null;
1130
+ };
1131
+ color: {
1132
+ type: PropType<"secondary" | "danger">;
1133
+ validator?(value: unknown): boolean;
1134
+ } & {
1135
+ default: "secondary" | "danger" | (() => "secondary" | "danger") | null;
1136
+ };
1137
+ };
1138
+
713
1139
  export declare function stringInput(defaultValue?: string): FormFieldDefinition<typeof FormFieldTypes.String>;
714
1140
 
715
1141
  export declare function stringProp(): OptionalProp<string | null>;
@@ -730,27 +1156,36 @@ export declare type UIComponent = ObjectValues<typeof UIComponents>;
730
1156
  export declare const UIComponents: {
731
1157
  readonly AlertModal: "alert-modal";
732
1158
  readonly ConfirmModal: "confirm-modal";
1159
+ readonly ErrorReportModal: "error-report-modal";
1160
+ readonly LoadingModal: "loading-modal";
1161
+ readonly Snackbar: "snackbar";
733
1162
  };
734
1163
 
735
- declare class UIService extends _default_2 {
1164
+ declare class UIService extends _default_3 {
736
1165
  private modalCallbacks;
737
1166
  private components;
1167
+ requireComponent(name: UIComponent): Component;
738
1168
  alert(message: string): void;
739
1169
  alert(title: string, message: string): void;
740
1170
  confirm(message: string): Promise<boolean>;
741
1171
  confirm(title: string, message: string): Promise<boolean>;
1172
+ loading<T>(operation: Promise<T>): Promise<T>;
1173
+ loading<T>(message: string, operation: Promise<T>): Promise<T>;
1174
+ showSnackbar(message: string, options?: ShowSnackbarOptions): void;
1175
+ hideSnackbar(id: string): void;
742
1176
  registerComponent(name: UIComponent, component: Component): void;
743
1177
  openModal<TModalComponent extends ModalComponent>(component: TModalComponent, properties?: ModalProperties<TModalComponent>): Promise<Modal<ModalResult<TModalComponent>>>;
744
1178
  closeModal(id: string, result?: unknown): Promise<void>;
745
1179
  protected boot(): Promise<void>;
746
- private requireComponent;
747
1180
  private watchModalEvents;
748
1181
  }
749
1182
 
750
- export declare type UIServices = typeof services_2;
1183
+ export declare type UIServices = typeof services_3;
751
1184
 
752
1185
  export declare type UnknownEvent<T> = T extends keyof EventsPayload ? never : T;
753
1186
 
1187
+ export declare function useErrorReportModalProps(): typeof errorReportModalProps;
1188
+
754
1189
  export declare function useEvent<Event extends EventWithoutPayload>(event: Event, listener: () => unknown): void;
755
1190
 
756
1191
  export declare function useEvent<Event extends EventWithPayload>(event: Event, listener: EventListener_2<EventsPayload[Event]>): void;
@@ -759,14 +1194,23 @@ export declare function useEvent<Event extends string>(event: UnknownEvent<Event
759
1194
 
760
1195
  export declare function useForm<const T extends FormFieldDefinitions>(fields: T): Form<T> & FormData_2<T>;
761
1196
 
1197
+ export declare function useInputAttrs(): [ComputedRef<{}>, ComputedRef<unknown>];
1198
+
1199
+ export declare function useSnackbarProps(): typeof snackbarProps;
1200
+
762
1201
  export { }
763
1202
 
764
- declare global {
765
- export const __AG_BASE_PATH: string | undefined;
766
- export const __AG_ENV: 'production' | 'development' | 'testing';
767
- }
1203
+ interface AerogelOptions {
1204
+ directives?: Record<string, Directive>;
1205
+ }
1206
+
1207
+ interface AerogelOptions {
1208
+ handleError?(error: ErrorSource): boolean;
1209
+ }
768
1210
 
769
- interface Services extends LangServices {}
1211
+ export interface Services extends ErrorsServices {}
1212
+
1213
+ export interface Services extends LangServices {}
770
1214
 
771
1215
  declare module '@vue/runtime-core' {
772
1216
  interface ComponentCustomProperties {
@@ -774,6 +1218,10 @@ declare module '@vue/runtime-core' {
774
1218
  }
775
1219
  }
776
1220
 
1221
+ interface AerogelOptions {
1222
+ services?: Record<string, Service>;
1223
+ }
1224
+
777
1225
  declare module '@vue/runtime-core' {
778
1226
  interface ComponentCustomProperties extends Services {}
779
1227
  }
@@ -790,4 +1238,4 @@ declare module '@vue/runtime-core' {
790
1238
  components?: Partial<Record<UIComponent, Component>>;
791
1239
  }
792
1240
 
793
- interface Services extends UIServices {}
1241
+ export interface Services extends UIServices {}