@aerogel/core 0.0.0-next.d547095ca85c86c1e41f5c7fa170d0ba856c3f4d → 0.0.0-next.d7394c3aa6aac799b0971e63819a8713d05a5123

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 (48) 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 +297 -38
  4. package/dist/aerogel-core.esm.js +1 -1
  5. package/dist/aerogel-core.esm.js.map +1 -1
  6. package/package.json +2 -2
  7. package/src/bootstrap/bootstrap.test.ts +0 -1
  8. package/src/components/AGAppSnackbars.vue +1 -1
  9. package/src/components/composition.ts +23 -0
  10. package/src/components/forms/AGForm.vue +9 -10
  11. package/src/components/forms/AGInput.vue +2 -0
  12. package/src/components/headless/forms/AGHeadlessButton.ts +3 -0
  13. package/src/components/headless/forms/AGHeadlessButton.vue +15 -4
  14. package/src/components/headless/forms/AGHeadlessInput.ts +10 -4
  15. package/src/components/headless/forms/AGHeadlessInput.vue +18 -5
  16. package/src/components/headless/forms/AGHeadlessInputDescription.vue +28 -0
  17. package/src/components/headless/forms/AGHeadlessInputInput.vue +42 -5
  18. package/src/components/headless/forms/AGHeadlessInputTextArea.vue +43 -0
  19. package/src/components/headless/forms/composition.ts +10 -0
  20. package/src/components/headless/forms/index.ts +4 -0
  21. package/src/components/index.ts +2 -0
  22. package/src/components/interfaces.ts +24 -0
  23. package/src/components/lib/AGMarkdown.vue +9 -4
  24. package/src/components/lib/AGMeasured.vue +1 -0
  25. package/src/components/modals/AGConfirmModal.ts +9 -3
  26. package/src/components/modals/AGConfirmModal.vue +2 -2
  27. package/src/components/modals/AGPromptModal.ts +9 -3
  28. package/src/components/modals/AGPromptModal.vue +2 -2
  29. package/src/directives/measure.ts +24 -5
  30. package/src/forms/Form.test.ts +28 -0
  31. package/src/forms/Form.ts +56 -6
  32. package/src/forms/index.ts +1 -0
  33. package/src/forms/utils.ts +15 -0
  34. package/src/lang/DefaultLangProvider.ts +43 -0
  35. package/src/lang/Lang.state.ts +11 -0
  36. package/src/lang/Lang.ts +44 -21
  37. package/src/services/App.state.ts +14 -0
  38. package/src/services/App.ts +3 -0
  39. package/src/services/Cache.ts +43 -0
  40. package/src/services/Service.ts +10 -2
  41. package/src/services/index.ts +3 -1
  42. package/src/testing/setup.ts +25 -0
  43. package/src/ui/UI.state.ts +7 -0
  44. package/src/ui/UI.ts +25 -5
  45. package/src/ui/index.ts +1 -0
  46. package/src/ui/utils.ts +16 -0
  47. package/src/utils/vue.ts +4 -2
  48. package/vite.config.ts +4 -1
@@ -27,10 +27,15 @@ import { RendererElement } from 'vue';
27
27
  import { RendererNode } from 'vue';
28
28
  import type { StateTree } from 'pinia';
29
29
  import type { Store } from 'pinia';
30
+ import type { SubPartial } from '@noeldemartin/utils';
30
31
  import type { UnwrapNestedRefs } from 'vue';
31
32
  import { VNode } from 'vue';
32
33
  import type { Writable } from '@noeldemartin/utils';
33
34
 
35
+ export declare interface __SetsElement {
36
+ __setElement(element?: HTMLElement): void;
37
+ }
38
+
34
39
  export declare type AerogelGlobalEvents = Partial<{
35
40
  [Event in EventWithoutPayload]: () => unknown;
36
41
  }> & Partial<{
@@ -149,12 +154,24 @@ validator?(value: unknown): boolean;
149
154
  } & {
150
155
  default: string | (() => string | null) | null;
151
156
  };
157
+ acceptColor: {
158
+ type?: PropType<"primary" | "secondary" | "danger" | "clear"> | undefined;
159
+ validator?(value: unknown): boolean;
160
+ } & {
161
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
162
+ };
152
163
  cancelText: {
153
164
  type?: PropType<string | null> | undefined;
154
165
  validator?(value: unknown): boolean;
155
166
  } & {
156
167
  default: string | (() => string | null) | null;
157
168
  };
169
+ cancelColor: {
170
+ type?: PropType<"primary" | "secondary" | "danger" | "clear"> | undefined;
171
+ validator?(value: unknown): boolean;
172
+ } & {
173
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
174
+ };
158
175
  }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
159
176
  [key: string]: any;
160
177
  }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
@@ -176,19 +193,33 @@ validator?(value: unknown): boolean;
176
193
  } & {
177
194
  default: string | (() => string | null) | null;
178
195
  };
196
+ acceptColor: {
197
+ type?: PropType<"primary" | "secondary" | "danger" | "clear"> | undefined;
198
+ validator?(value: unknown): boolean;
199
+ } & {
200
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
201
+ };
179
202
  cancelText: {
180
203
  type?: PropType<string | null> | undefined;
181
204
  validator?(value: unknown): boolean;
182
205
  } & {
183
206
  default: string | (() => string | null) | null;
184
207
  };
208
+ cancelColor: {
209
+ type?: PropType<"primary" | "secondary" | "danger" | "clear"> | undefined;
210
+ validator?(value: unknown): boolean;
211
+ } & {
212
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
213
+ };
185
214
  }>>, {
186
215
  title: string | null;
187
216
  acceptText: string | null;
217
+ acceptColor: "primary" | "secondary" | "danger" | "clear";
188
218
  cancelText: string | null;
219
+ cancelColor: "primary" | "secondary" | "danger" | "clear";
189
220
  }, {}>;
190
221
 
191
- export declare type AGConfirmModalProps = ObjectWithoutEmpty<ExtractPropTypes<typeof confirmModalProps>>;
222
+ export declare type AGConfirmModalProps = SubPartial<ObjectWithoutEmpty<ExtractPropTypes<typeof confirmModalProps>>, 'acceptColor' | 'cancelColor'>;
192
223
 
193
224
  export declare const AGErrorMessage: DefineComponent< {
194
225
  error: {
@@ -296,6 +327,12 @@ form: Form<FormFieldDefinitions> | null;
296
327
  }, {}>;
297
328
 
298
329
  export declare const AGHeadlessButton: DefineComponent< {
330
+ as: {
331
+ type?: PropType<Object | null> | undefined;
332
+ validator?(value: unknown): boolean;
333
+ } & {
334
+ default: Object | (() => Object | null) | null;
335
+ };
299
336
  href: {
300
337
  type?: PropType<string | null> | undefined;
301
338
  validator?(value: unknown): boolean;
@@ -335,6 +372,12 @@ default: boolean | (() => boolean) | null;
335
372
  }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
336
373
  [key: string]: any;
337
374
  }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
375
+ as: {
376
+ type?: PropType<Object | null> | undefined;
377
+ validator?(value: unknown): boolean;
378
+ } & {
379
+ default: Object | (() => Object | null) | null;
380
+ };
338
381
  href: {
339
382
  type?: PropType<string | null> | undefined;
340
383
  validator?(value: unknown): boolean;
@@ -372,6 +415,7 @@ validator?(value: unknown): boolean;
372
415
  default: boolean | (() => boolean) | null;
373
416
  };
374
417
  }>>, {
418
+ as: Object | null;
375
419
  href: string | null;
376
420
  url: string | null;
377
421
  route: string | null;
@@ -393,17 +437,23 @@ validator?(value: unknown): boolean;
393
437
  } & {
394
438
  default: string | (() => string | null) | null;
395
439
  };
396
- as: {
397
- type?: PropType<string> | undefined;
440
+ description: {
441
+ type?: PropType<string | null> | undefined;
398
442
  validator?(value: unknown): boolean;
399
443
  } & {
400
- default: string | (() => string) | null;
444
+ default: string | (() => string | null) | null;
401
445
  };
402
446
  modelValue: {
403
- type?: PropType<string | number | boolean | null> | undefined;
447
+ type?: PropType<FormFieldValue | null> | undefined;
448
+ validator?(value: unknown): boolean;
449
+ } & {
450
+ default: FormFieldValue | (() => FormFieldValue | null) | null;
451
+ };
452
+ as: {
453
+ type?: PropType<string> | undefined;
404
454
  validator?(value: unknown): boolean;
405
455
  } & {
406
- default: string | number | boolean | (() => string | number | boolean | null) | null;
456
+ default: string | (() => string) | null;
407
457
  };
408
458
  }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
409
459
  [key: string]: any;
@@ -420,27 +470,38 @@ validator?(value: unknown): boolean;
420
470
  } & {
421
471
  default: string | (() => string | null) | null;
422
472
  };
423
- as: {
424
- type?: PropType<string> | undefined;
473
+ description: {
474
+ type?: PropType<string | null> | undefined;
425
475
  validator?(value: unknown): boolean;
426
476
  } & {
427
- default: string | (() => string) | null;
477
+ default: string | (() => string | null) | null;
428
478
  };
429
479
  modelValue: {
430
- type?: PropType<string | number | boolean | null> | undefined;
480
+ type?: PropType<FormFieldValue | null> | undefined;
481
+ validator?(value: unknown): boolean;
482
+ } & {
483
+ default: FormFieldValue | (() => FormFieldValue | null) | null;
484
+ };
485
+ as: {
486
+ type?: PropType<string> | undefined;
431
487
  validator?(value: unknown): boolean;
432
488
  } & {
433
- default: string | number | boolean | (() => string | number | boolean | null) | null;
489
+ default: string | (() => string) | null;
434
490
  };
435
491
  }>> & {
436
492
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
437
493
  }, {
438
494
  as: string;
439
- modelValue: string | number | boolean | null;
440
495
  name: string | null;
441
496
  label: string | null;
497
+ description: string | null;
498
+ modelValue: FormFieldValue | null;
442
499
  }, {}>;
443
500
 
501
+ export declare const AGHeadlessInputDescription: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
502
+ [key: string]: any;
503
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
504
+
444
505
  export declare const AGHeadlessInputError: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
445
506
  [key: string]: any;
446
507
  }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
@@ -469,6 +530,10 @@ export declare const AGHeadlessInputLabel: DefineComponent< {}, (_ctx: any, _
469
530
  [key: string]: any;
470
531
  }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
471
532
 
533
+ export declare const AGHeadlessInputTextArea: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
534
+ [key: string]: any;
535
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
536
+
472
537
  export declare const AGHeadlessModal: DefineComponent< {
473
538
  cancellable: {
474
539
  type?: PropType<boolean> | undefined;
@@ -730,6 +795,18 @@ validator?(value: unknown): boolean;
730
795
  } & {
731
796
  default: string | (() => string | null) | null;
732
797
  };
798
+ description: {
799
+ type?: PropType<string | null> | undefined;
800
+ validator?(value: unknown): boolean;
801
+ } & {
802
+ default: string | (() => string | null) | null;
803
+ };
804
+ modelValue: {
805
+ type?: PropType<FormFieldValue | null> | undefined;
806
+ validator?(value: unknown): boolean;
807
+ } & {
808
+ default: FormFieldValue | (() => FormFieldValue | null) | null;
809
+ };
733
810
  }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
734
811
  [key: string]: any;
735
812
  }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
@@ -745,9 +822,23 @@ validator?(value: unknown): boolean;
745
822
  } & {
746
823
  default: string | (() => string | null) | null;
747
824
  };
825
+ description: {
826
+ type?: PropType<string | null> | undefined;
827
+ validator?(value: unknown): boolean;
828
+ } & {
829
+ default: string | (() => string | null) | null;
830
+ };
831
+ modelValue: {
832
+ type?: PropType<FormFieldValue | null> | undefined;
833
+ validator?(value: unknown): boolean;
834
+ } & {
835
+ default: FormFieldValue | (() => FormFieldValue | null) | null;
836
+ };
748
837
  }>>, {
749
838
  name: string | null;
750
839
  label: string | null;
840
+ description: string | null;
841
+ modelValue: FormFieldValue | null;
751
842
  }, {}>;
752
843
 
753
844
  export declare const AGLink: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
@@ -796,10 +887,10 @@ validator?(value: unknown): boolean;
796
887
  default: string | (() => string | null) | null;
797
888
  };
798
889
  langParams: {
799
- type?: PropType<Record<string, unknown> | null> | undefined;
890
+ type?: PropType<number | Record<string, unknown> | null> | undefined;
800
891
  validator?(value: unknown): boolean;
801
892
  } & {
802
- default: Record<string, unknown> | (() => Record<string, unknown> | null) | null;
893
+ default: number | Record<string, unknown> | (() => number | Record<string, unknown> | null) | null;
803
894
  };
804
895
  text: {
805
896
  type?: PropType<string | null> | undefined;
@@ -829,10 +920,10 @@ validator?(value: unknown): boolean;
829
920
  default: string | (() => string | null) | null;
830
921
  };
831
922
  langParams: {
832
- type?: PropType<Record<string, unknown> | null> | undefined;
923
+ type?: PropType<number | Record<string, unknown> | null> | undefined;
833
924
  validator?(value: unknown): boolean;
834
925
  } & {
835
- default: Record<string, unknown> | (() => Record<string, unknown> | null) | null;
926
+ default: number | Record<string, unknown> | (() => number | Record<string, unknown> | null) | null;
836
927
  };
837
928
  text: {
838
929
  type?: PropType<string | null> | undefined;
@@ -844,7 +935,7 @@ default: string | (() => string | null) | null;
844
935
  as: string | null;
845
936
  inline: boolean;
846
937
  langKey: string | null;
847
- langParams: Record<string, unknown> | null;
938
+ langParams: number | Record<string, unknown> | null;
848
939
  text: string | null;
849
940
  }, {}>;
850
941
 
@@ -972,12 +1063,24 @@ validator?(value: unknown): boolean;
972
1063
  } & {
973
1064
  default: string | (() => string | null) | null;
974
1065
  };
1066
+ acceptColor: {
1067
+ type?: PropType<"primary" | "secondary" | "danger" | "clear"> | undefined;
1068
+ validator?(value: unknown): boolean;
1069
+ } & {
1070
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
1071
+ };
975
1072
  cancelText: {
976
1073
  type?: PropType<string | null> | undefined;
977
1074
  validator?(value: unknown): boolean;
978
1075
  } & {
979
1076
  default: string | (() => string | null) | null;
980
1077
  };
1078
+ cancelColor: {
1079
+ type?: PropType<"primary" | "secondary" | "danger" | "clear"> | undefined;
1080
+ validator?(value: unknown): boolean;
1081
+ } & {
1082
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
1083
+ };
981
1084
  }, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
982
1085
  [key: string]: any;
983
1086
  }>, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {
@@ -1017,22 +1120,36 @@ validator?(value: unknown): boolean;
1017
1120
  } & {
1018
1121
  default: string | (() => string | null) | null;
1019
1122
  };
1123
+ acceptColor: {
1124
+ type?: PropType<"primary" | "secondary" | "danger" | "clear"> | undefined;
1125
+ validator?(value: unknown): boolean;
1126
+ } & {
1127
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
1128
+ };
1020
1129
  cancelText: {
1021
1130
  type?: PropType<string | null> | undefined;
1022
1131
  validator?(value: unknown): boolean;
1023
1132
  } & {
1024
1133
  default: string | (() => string | null) | null;
1025
1134
  };
1135
+ cancelColor: {
1136
+ type?: PropType<"primary" | "secondary" | "danger" | "clear"> | undefined;
1137
+ validator?(value: unknown): boolean;
1138
+ } & {
1139
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
1140
+ };
1026
1141
  }>>, {
1027
1142
  title: string | null;
1028
1143
  label: string | null;
1029
1144
  defaultValue: string | null;
1030
1145
  placeholder: string | null;
1031
1146
  acceptText: string | null;
1147
+ acceptColor: "primary" | "secondary" | "danger" | "clear";
1032
1148
  cancelText: string | null;
1149
+ cancelColor: "primary" | "secondary" | "danger" | "clear";
1033
1150
  }, {}>;
1034
1151
 
1035
- export declare type AGPromptModalProps = ObjectWithoutEmpty<ExtractPropTypes<typeof promptModalProps>>;
1152
+ export declare type AGPromptModalProps = SubPartial<ObjectWithoutEmpty<ExtractPropTypes<typeof promptModalProps>>, 'acceptColor' | 'cancelColor'>;
1036
1153
 
1037
1154
  export declare const AGSelect: DefineComponent< {
1038
1155
  name: {
@@ -1187,7 +1304,8 @@ export declare const alertModalProps: {
1187
1304
 
1188
1305
  export declare const App: Facade<AppService, AppService>;
1189
1306
 
1190
- export declare class AppService extends _default_2 {
1307
+ export declare class AppService extends _default_3 {
1308
+ readonly name: string;
1191
1309
  readonly ready: PromisedValue<void>;
1192
1310
  readonly mounted: PromisedValue<void>;
1193
1311
  isReady(): boolean;
@@ -1215,6 +1333,17 @@ export declare function bootstrap(rootComponent: Component, options?: AerogelOpt
1215
1333
 
1216
1334
  export declare function bootstrapApplication(app: App_2, options?: AerogelOptions): Promise<void>;
1217
1335
 
1336
+ declare const Cache_2: Facade<CacheService, CacheService>;
1337
+ export { Cache_2 as Cache }
1338
+
1339
+ export declare class CacheService extends Service {
1340
+ private cache?;
1341
+ get(url: string): Promise<Response | null>;
1342
+ store(url: string, response: Response): Promise<void>;
1343
+ replace(url: string, response: Response): Promise<void>;
1344
+ protected open(): Promise<Cache>;
1345
+ }
1346
+
1218
1347
  export declare type Color = (typeof Colors)[keyof typeof Colors];
1219
1348
 
1220
1349
  export declare const Colors: {
@@ -1255,19 +1384,35 @@ export declare const confirmModalProps: {
1255
1384
  } & {
1256
1385
  default: string | (() => string | null) | null;
1257
1386
  };
1387
+ acceptColor: {
1388
+ type?: PropType<"primary" | "secondary" | "danger" | "clear"> | undefined;
1389
+ validator?(value: unknown): boolean;
1390
+ } & {
1391
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
1392
+ };
1258
1393
  cancelText: {
1259
1394
  type?: PropType<string | null> | undefined;
1260
1395
  validator?(value: unknown): boolean;
1261
1396
  } & {
1262
1397
  default: string | (() => string | null) | null;
1263
1398
  };
1399
+ cancelColor: {
1400
+ type?: PropType<"primary" | "secondary" | "danger" | "clear"> | undefined;
1401
+ validator?(value: unknown): boolean;
1402
+ } & {
1403
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
1404
+ };
1264
1405
  };
1265
1406
 
1266
1407
  export declare interface ConfirmOptions {
1267
1408
  acceptText?: string;
1409
+ acceptColor?: Color;
1268
1410
  cancelText?: string;
1411
+ cancelColor?: Color;
1269
1412
  }
1270
1413
 
1414
+ export declare function dateInput(defaultValue?: Date): FormFieldDefinition<typeof FormFieldTypes.Date>;
1415
+
1271
1416
  declare const _default: Constructor<UnrefServiceState< {
1272
1417
  logs: ErrorReportLog[];
1273
1418
  startupErrors: ErrorReport[];
@@ -1288,34 +1433,64 @@ startupErrors: ErrorReport[];
1288
1433
  }>>>>;
1289
1434
 
1290
1435
  declare const _default_2: Constructor<UnrefServiceState< {
1436
+ locale: string | null;
1437
+ locales: string[];
1438
+ fallbackLocale: string;
1439
+ }>> & Constructor< {}> & Constructor<Service<UnrefServiceState< {
1440
+ locale: string | null;
1441
+ locales: string[];
1442
+ fallbackLocale: string;
1443
+ }>, {}, Partial<UnrefServiceState< {
1444
+ locale: string | null;
1445
+ locales: string[];
1446
+ fallbackLocale: string;
1447
+ }>>>>;
1448
+
1449
+ declare const _default_3: Constructor<UnrefServiceState< {
1291
1450
  plugins: Record<string, Plugin_2>;
1292
1451
  environment: string;
1452
+ version: string;
1293
1453
  sourceUrl: string | undefined;
1294
1454
  }>> & Constructor< {
1295
1455
  development: boolean;
1296
1456
  testing: boolean;
1457
+ versionName: string;
1458
+ versionUrl: string;
1297
1459
  }> & Constructor<Service<UnrefServiceState< {
1298
1460
  plugins: Record<string, Plugin_2>;
1299
1461
  environment: string;
1462
+ version: string;
1300
1463
  sourceUrl: string | undefined;
1301
1464
  }>, {
1302
1465
  development: boolean;
1303
1466
  testing: boolean;
1467
+ versionName: string;
1468
+ versionUrl: string;
1304
1469
  }, Partial<UnrefServiceState< {
1305
1470
  plugins: Record<string, Plugin_2>;
1306
1471
  environment: string;
1472
+ version: string;
1307
1473
  sourceUrl: string | undefined;
1308
1474
  }>>>>;
1309
1475
 
1310
- declare const _default_3: Constructor<UnrefServiceState< {
1476
+ declare const _default_4: Constructor<UnrefServiceState< {
1311
1477
  modals: Modal<unknown>[];
1312
1478
  snackbars: Snackbar[];
1313
- }>> & Constructor< {}> & Constructor<Service<UnrefServiceState< {
1479
+ layout: Layout;
1480
+ }>> & Constructor< {
1481
+ mobile: boolean;
1482
+ desktop: boolean;
1483
+ }> & Constructor<Service<UnrefServiceState< {
1314
1484
  modals: Modal<unknown>[];
1315
1485
  snackbars: Snackbar[];
1316
- }>, {}, Partial<UnrefServiceState< {
1486
+ layout: Layout;
1487
+ }>, {
1488
+ mobile: boolean;
1489
+ desktop: boolean;
1490
+ }, Partial<UnrefServiceState< {
1317
1491
  modals: Modal<unknown>[];
1318
1492
  snackbars: Snackbar[];
1493
+ layout: Layout;
1319
1494
  }>>>>;
1320
1495
 
1321
1496
  export declare type DefaultServices = typeof defaultServices;
@@ -1343,6 +1518,8 @@ export declare function defineServiceStore<Id extends string, S extends StateTre
1343
1518
 
1344
1519
  export declare function dispatch(job: Job): Promise<void>;
1345
1520
 
1521
+ export declare function elementRef(): Ref<HTMLElement | undefined>;
1522
+
1346
1523
  export declare interface ElementSize {
1347
1524
  width: number;
1348
1525
  height: number;
@@ -1450,23 +1627,33 @@ export declare function extractModalProps<T extends ExtractPropTypes<typeof moda
1450
1627
 
1451
1628
  export declare function extractSelectProps<T extends ExtractPropTypes<typeof selectProps>>(props: T): Pick<T, keyof typeof selectProps>;
1452
1629
 
1453
- declare class Form<Fields extends FormFieldDefinitions = FormFieldDefinitions> extends MagicObject {
1630
+ export declare type FocusFormListener = (input: string) => unknown;
1631
+
1632
+ export declare class Form<Fields extends FormFieldDefinitions = FormFieldDefinitions> extends MagicObject {
1454
1633
  errors: DeepReadonly<UnwrapNestedRefs<FormErrors<Fields>>>;
1455
1634
  private _fields;
1456
1635
  private _data;
1457
1636
  private _submitted;
1458
1637
  private _errors;
1638
+ private _listeners;
1459
1639
  constructor(fields: Fields);
1460
1640
  get valid(): boolean;
1461
1641
  get submitted(): boolean;
1462
1642
  setFieldValue<T extends keyof Fields>(field: T, value: FormData_2<Fields>[T]): void;
1463
1643
  getFieldValue<T extends keyof Fields>(field: T): GetFormFieldValue<Fields[T]['type']>;
1644
+ getFieldRules<T extends keyof Fields>(field: T): string[];
1645
+ data(): FormData_2<Fields>;
1464
1646
  validate(): boolean;
1465
1647
  reset(options?: {
1466
1648
  keepData?: boolean;
1467
1649
  keepErrors?: boolean;
1468
1650
  }): void;
1469
1651
  submit(): boolean;
1652
+ on(event: 'focus', listener: FocusFormListener): () => void;
1653
+ on(event: 'submit', listener: SubmitFormListener): () => void;
1654
+ off(event: 'focus', listener: FocusFormListener): void;
1655
+ off(event: 'submit', listener: SubmitFormListener): void;
1656
+ focus(input: string): Promise<void>;
1470
1657
  protected __get(property: string): unknown;
1471
1658
  protected __set(property: string, value: unknown): void;
1472
1659
  private getFieldErrors;
@@ -1487,6 +1674,7 @@ export declare type FormErrors<T> = {
1487
1674
 
1488
1675
  export declare interface FormFieldDefinition<TType extends FormFieldType = FormFieldType, TRules extends string = string> {
1489
1676
  type: TType;
1677
+ trim?: boolean;
1490
1678
  default?: GetFormFieldValue<TType>;
1491
1679
  rules?: TRules;
1492
1680
  }
@@ -1500,16 +1688,27 @@ export declare const FormFieldTypes: {
1500
1688
  readonly Number: "number";
1501
1689
  readonly Boolean: "boolean";
1502
1690
  readonly Object: "object";
1691
+ readonly Date: "date";
1503
1692
  };
1504
1693
 
1505
1694
  export declare type FormFieldValue = GetFormFieldValue<FormFieldType>;
1506
1695
 
1696
+ export declare function getCurrentLayout(): Layout;
1697
+
1698
+ export declare function getElement(value: unknown): HTMLElement | undefined;
1699
+
1507
1700
  export declare function getErrorMessage(error: ErrorSource): string;
1508
1701
 
1509
- export declare type GetFormFieldValue<TType> = TType extends typeof FormFieldTypes.String ? string : TType extends typeof FormFieldTypes.Number ? number : TType extends typeof FormFieldTypes.Boolean ? boolean : TType extends typeof FormFieldTypes.Object ? object : never;
1702
+ export declare type GetFormFieldValue<TType> = TType extends typeof FormFieldTypes.String ? string : TType extends typeof FormFieldTypes.Number ? number : TType extends typeof FormFieldTypes.Boolean ? boolean : TType extends typeof FormFieldTypes.Object ? object : TType extends typeof FormFieldTypes.Date ? Date : never;
1510
1703
 
1511
1704
  export declare function getPiniaStore(): Pinia;
1512
1705
 
1706
+ export declare interface HasElement {
1707
+ $el: Readonly<Ref<HTMLElement | undefined>>;
1708
+ }
1709
+
1710
+ export declare function hasElement(value: unknown): value is UnwrapNestedRefs<HasElement>;
1711
+
1513
1712
  export declare interface IAGErrorReportModalButtonsDefaultSlotProps {
1514
1713
  id: string;
1515
1714
  description: string;
@@ -1518,13 +1717,18 @@ export declare interface IAGErrorReportModalButtonsDefaultSlotProps {
1518
1717
  handler?(): void;
1519
1718
  }
1520
1719
 
1521
- export declare interface IAGHeadlessInput {
1720
+ export declare interface IAGHeadlessButton extends HasElement {
1721
+ }
1722
+
1723
+ export declare interface IAGHeadlessInput extends HasElement {
1522
1724
  id: string;
1523
1725
  name: ComputedRef<string | null>;
1524
1726
  label: ComputedRef<string | null>;
1525
- value: ComputedRef<string | number | boolean | null>;
1727
+ description: ComputedRef<string | boolean | null>;
1728
+ value: ComputedRef<FormFieldValue | null>;
1729
+ required: ComputedRef<boolean | null>;
1526
1730
  errors: DeepReadonly<Ref<string[] | null>>;
1527
- update(value: string | number | boolean | null): void;
1731
+ update(value: FormFieldValue | null): void;
1528
1732
  }
1529
1733
 
1530
1734
  export declare interface IAGHeadlessModal extends IAGModal {
@@ -1584,6 +1788,18 @@ export declare const inputProps: {
1584
1788
  } & {
1585
1789
  default: string | (() => string | null) | null;
1586
1790
  };
1791
+ description: {
1792
+ type?: PropType<string | null> | undefined;
1793
+ validator?(value: unknown): boolean;
1794
+ } & {
1795
+ default: string | (() => string | null) | null;
1796
+ };
1797
+ modelValue: {
1798
+ type?: PropType<FormFieldValue | null> | undefined;
1799
+ validator?(value: unknown): boolean;
1800
+ } & {
1801
+ default: FormFieldValue | (() => FormFieldValue | null) | null;
1802
+ };
1587
1803
  };
1588
1804
 
1589
1805
  export declare function installPlugins(plugins: Plugin_2[], ...args: GetClosureArgs<Plugin_2['install']>): Promise<void>;
@@ -1595,20 +1811,34 @@ export declare abstract class Job {
1595
1811
  export declare const Lang: Facade<LangService, LangService>;
1596
1812
 
1597
1813
  export declare interface LangProvider {
1598
- translate(key: string, parameters?: Record<string, unknown>): string;
1599
- translateWithDefault(key: string, defaultMessage: string, parameters?: Record<string, unknown>): string;
1814
+ getLocale(): string;
1815
+ setLocale(locale: string): Promise<void>;
1816
+ getFallbackLocale(): string;
1817
+ setFallbackLocale(fallbackLocale: string): Promise<void>;
1818
+ getLocales(): string[];
1819
+ translate(key: string, parameters?: Record<string, unknown> | number): string;
1820
+ translateWithDefault(key: string, defaultMessage: string, parameters?: Record<string, unknown> | number): string;
1600
1821
  }
1601
1822
 
1602
- declare class LangService extends Service {
1823
+ declare class LangService extends _default_2 {
1603
1824
  private provider;
1604
1825
  constructor();
1605
- setProvider(provider: LangProvider): void;
1606
- translate(key: string, parameters?: Record<string, unknown>): string;
1607
- translateWithDefault(key: string, defaultMessage: string, parameters?: Record<string, unknown>): string;
1826
+ setProvider(provider: LangProvider): Promise<void>;
1827
+ translate(key: string, parameters?: Record<string, unknown> | number): string;
1828
+ translateWithDefault(key: string, defaultMessage: string, parameters?: Record<string, unknown> | number): string;
1829
+ getBrowserLocale(): string;
1830
+ protected boot(): Promise<void>;
1608
1831
  }
1609
1832
 
1610
1833
  export declare type LangServices = typeof services_2;
1611
1834
 
1835
+ export declare type Layout = (typeof Layouts)[keyof typeof Layouts];
1836
+
1837
+ export declare const Layouts: {
1838
+ readonly Mobile: "mobile";
1839
+ readonly Desktop: "desktop";
1840
+ };
1841
+
1612
1842
  export declare const loadingModalProps: {
1613
1843
  message: {
1614
1844
  type?: PropType<string | null> | undefined;
@@ -1622,6 +1852,10 @@ export declare type MeasureDirectiveListener = (size: ElementSize) => unknown;
1622
1852
 
1623
1853
  export declare function mixedProp<T>(type?: PropType<T>): OptionalProp<T | null>;
1624
1854
 
1855
+ export declare function mixedProp<T>(type: PropType<T>, defaultValue: T): OptionalProp<T>;
1856
+
1857
+ export declare const MOBILE_BREAKPOINT = 768;
1858
+
1625
1859
  declare interface Modal<T = unknown> {
1626
1860
  id: string;
1627
1861
  properties: Record<string, unknown>;
@@ -1664,6 +1898,10 @@ export declare function objectProp<T>(defaultValue: () => T): OptionalProp<T>;
1664
1898
 
1665
1899
  export declare function onCleanMounted(operation: () => Function): void;
1666
1900
 
1901
+ export declare function onFormFocus(input: {
1902
+ name: string | null;
1903
+ }, listener: () => unknown): void;
1904
+
1667
1905
  declare type OptionalProp<T> = BaseProp<T> & {
1668
1906
  default: T | (() => T) | null;
1669
1907
  };
@@ -1711,12 +1949,24 @@ export declare const promptModalProps: {
1711
1949
  } & {
1712
1950
  default: string | (() => string | null) | null;
1713
1951
  };
1952
+ acceptColor: {
1953
+ type?: PropType<"primary" | "secondary" | "danger" | "clear"> | undefined;
1954
+ validator?(value: unknown): boolean;
1955
+ } & {
1956
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
1957
+ };
1714
1958
  cancelText: {
1715
1959
  type?: PropType<string | null> | undefined;
1716
1960
  validator?(value: unknown): boolean;
1717
1961
  } & {
1718
1962
  default: string | (() => string | null) | null;
1719
1963
  };
1964
+ cancelColor: {
1965
+ type?: PropType<"primary" | "secondary" | "danger" | "clear"> | undefined;
1966
+ validator?(value: unknown): boolean;
1967
+ } & {
1968
+ default: "primary" | "secondary" | "danger" | "clear" | (() => "primary" | "secondary" | "danger" | "clear") | null;
1969
+ };
1720
1970
  };
1721
1971
 
1722
1972
  export declare interface PromptOptions {
@@ -1724,7 +1974,10 @@ export declare interface PromptOptions {
1724
1974
  defaultValue?: string;
1725
1975
  placeholder?: string;
1726
1976
  acceptText?: string;
1977
+ acceptColor?: Color;
1727
1978
  cancelText?: string;
1979
+ cancelColor?: Color;
1980
+ trim?: boolean;
1728
1981
  }
1729
1982
 
1730
1983
  export declare function removeInteractiveClasses(classes: string): string;
@@ -1733,6 +1986,8 @@ export declare function requiredArrayProp<T>(): RequiredProp<T[]>;
1733
1986
 
1734
1987
  export declare function requiredBooleanInput(defaultValue?: boolean): FormFieldDefinition<typeof FormFieldTypes.Boolean, 'required'>;
1735
1988
 
1989
+ export declare function requiredDateInput(defaultValue?: Date): FormFieldDefinition<typeof FormFieldTypes.Date>;
1990
+
1736
1991
  export declare function requiredEnumProp<Enum extends Record<string, unknown>>(enumeration: Enum): RequiredProp<Enum[keyof Enum]>;
1737
1992
 
1738
1993
  export declare function requiredMixedProp<T>(type?: PropType<T>): RequiredProp<T>;
@@ -1814,6 +2069,7 @@ export declare class Service<State extends ServiceState = DefaultServiceState, C
1814
2069
  protected frameworkBoot(): Promise<void>;
1815
2070
  protected boot(): Promise<void>;
1816
2071
  protected initializePersistedState(): void;
2072
+ protected requireStore(): Store<string, State, ComputedState, {}>;
1817
2073
  }
1818
2074
 
1819
2075
  export declare type ServiceConstructor<T extends Service = Service> = Constructor<T> & typeof Service;
@@ -1895,9 +2151,11 @@ export declare function stringProp(): OptionalProp<string | null>;
1895
2151
 
1896
2152
  export declare function stringProp(defaultValue: string): OptionalProp<string>;
1897
2153
 
1898
- export declare const translate: (key: string, parameters?: Record<string, unknown> | undefined) => string;
2154
+ export declare type SubmitFormListener = () => unknown;
2155
+
2156
+ export declare const translate: (key: string, parameters?: number | Record<string, unknown> | undefined) => string;
1899
2157
 
1900
- export declare const translateWithDefault: (key: string, defaultMessage: string, parameters?: Record<string, unknown>) => string;
2158
+ export declare const translateWithDefault: (key: string, defaultMessage: string, parameters?: number | Record<string, unknown>) => string;
1901
2159
 
1902
2160
  export declare const UI: Facade<UIService, UIService>;
1903
2161
 
@@ -1913,7 +2171,7 @@ export declare const UIComponents: {
1913
2171
  readonly StartupCrash: "startup-crash";
1914
2172
  };
1915
2173
 
1916
- export declare class UIService extends _default_3 {
2174
+ export declare class UIService extends _default_4 {
1917
2175
  private modalCallbacks;
1918
2176
  private components;
1919
2177
  requireComponent(name: UIComponent): Component;
@@ -1923,8 +2181,8 @@ export declare class UIService extends _default_3 {
1923
2181
  confirm(title: string, message: string, options?: ConfirmOptions): Promise<boolean>;
1924
2182
  prompt(message: string, options?: PromptOptions): Promise<string | null>;
1925
2183
  prompt(title: string, message: string, options?: PromptOptions): Promise<string | null>;
1926
- loading<T>(operation: Promise<T>): Promise<T>;
1927
- loading<T>(message: string, operation: Promise<T>): Promise<T>;
2184
+ loading<T>(operation: Promise<T> | (() => T)): Promise<T>;
2185
+ loading<T>(message: string, operation: Promise<T> | (() => T)): Promise<T>;
1928
2186
  showSnackbar(message: string, options?: ShowSnackbarOptions): void;
1929
2187
  hideSnackbar(id: string): void;
1930
2188
  registerComponent(name: UIComponent, component: Component): void;
@@ -1933,6 +2191,7 @@ export declare class UIService extends _default_3 {
1933
2191
  protected boot(): Promise<void>;
1934
2192
  private watchModalEvents;
1935
2193
  private watchMountedEvent;
2194
+ private watchWindowMedia;
1936
2195
  }
1937
2196
 
1938
2197
  export declare type UIServices = typeof services_3;