@uniquedj95/vform 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +110 -1
  2. package/dist/components/inputs/BaseInput.vue.d.ts.map +1 -1
  3. package/dist/components/inputs/CheckboxInput.vue.d.ts +1 -1
  4. package/dist/components/inputs/CheckboxInput.vue.d.ts.map +1 -1
  5. package/dist/components/inputs/DateInput.vue.d.ts.map +1 -1
  6. package/dist/components/inputs/EmailInput.vue.d.ts +3 -3
  7. package/dist/components/inputs/EmailInput.vue.d.ts.map +1 -1
  8. package/dist/components/inputs/NumberInput.vue.d.ts +3 -3
  9. package/dist/components/inputs/NumberInput.vue.d.ts.map +1 -1
  10. package/dist/components/inputs/PasswordInput.vue.d.ts +3 -3
  11. package/dist/components/inputs/PasswordInput.vue.d.ts.map +1 -1
  12. package/dist/components/inputs/RadioInput.vue.d.ts.map +1 -1
  13. package/dist/components/inputs/RepeatInput.vue.d.ts +1 -1
  14. package/dist/components/inputs/RepeatInput.vue.d.ts.map +1 -1
  15. package/dist/components/inputs/SelectInput.vue.d.ts +1 -7
  16. package/dist/components/inputs/SelectInput.vue.d.ts.map +1 -1
  17. package/dist/components/inputs/TextAreaInput.vue.d.ts +1 -1
  18. package/dist/components/inputs/TextAreaInput.vue.d.ts.map +1 -1
  19. package/dist/components/inputs/TextInput.vue.d.ts +3 -3
  20. package/dist/components/inputs/TextInput.vue.d.ts.map +1 -1
  21. package/dist/components/shared/InputLabel.vue.d.ts.map +1 -1
  22. package/dist/components/vForm.vue.d.ts.map +1 -1
  23. package/dist/composables/useDataTransformation.d.ts +1 -1
  24. package/dist/composables/useDataTransformation.d.ts.map +1 -1
  25. package/dist/composables/useDependentOptions.d.ts.map +1 -1
  26. package/dist/composables/useInputProps.d.ts.map +1 -1
  27. package/dist/composables/useInputValidation.d.ts.map +1 -1
  28. package/dist/composables/useLabelTemplate.d.ts.map +1 -1
  29. package/dist/index.cjs.js +1 -1
  30. package/dist/index.cjs.js.map +1 -1
  31. package/dist/index.es.js +599 -599
  32. package/dist/index.es.js.map +1 -1
  33. package/dist/index.umd.js +1 -1
  34. package/dist/index.umd.js.map +1 -1
  35. package/dist/types/index.d.ts +4 -2
  36. package/dist/types/index.d.ts.map +1 -1
  37. package/dist/utils/index.d.ts +7 -1
  38. package/dist/utils/index.d.ts.map +1 -1
  39. package/dist/vform.css +1 -1
  40. package/package.json +5 -1
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  A dynamic form builder for Vue.js with Ionic components
8
8
 
9
- [![Version](https://img.shields.io/badge/version-3.2.0-blue.svg)](https://github.com/uniquedj95/vform/releases)
9
+ [![Version](https://img.shields.io/badge/version-3.3.0-blue.svg)](https://github.com/uniquedj95/vform/releases)
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
11
11
  [![Vue Version](https://img.shields.io/badge/vue-3.5+-brightgreen.svg)](https://vuejs.org/)
12
12
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.5-blue)](https://www.typescriptlang.org/)
@@ -20,6 +20,7 @@ A dynamic form builder for Vue.js with Ionic components
20
20
  ## Table of Contents
21
21
 
22
22
  - [Overview](#overview)
23
+ - [🎯 Demo](#demo)
23
24
  - [Features](#features)
24
25
  - [Installation](#installation)
25
26
  - [Usage](#usage)
@@ -30,6 +31,7 @@ A dynamic form builder for Vue.js with Ionic components
30
31
  - [Form Methods](#form-methods)
31
32
  - [Input Dependencies](#input-dependencies)
32
33
  - [Dynamic Options](#dynamic-options)
34
+ - [Resetting Dependent Fields](#resetting-dependent-fields)
33
35
  - [Advanced Components](#advanced-components)
34
36
  - [SelectInput](#selectinput)
35
37
  - [Custom Buttons](#custom-buttons)
@@ -43,6 +45,39 @@ A dynamic form builder for Vue.js with Ionic components
43
45
 
44
46
  vForm is a Vue.js component that dynamically generates forms based on a provided schema. It leverages Ionic components for a responsive and mobile-friendly design, supporting complex forms with conditional rendering and validation logic. It provides a robust and flexible form-building solution for Vue.js applications, allowing for a high degree of customization and control over the form behavior and appearance.
45
47
 
48
+ ## 🎯 Demo
49
+
50
+ Explore all VForm features with our comprehensive interactive demo:
51
+
52
+ ```bash
53
+ # Clone the repository
54
+ git clone https://github.com/uniquedj95/vform.git
55
+ cd vform
56
+
57
+ # Setup and run the demo
58
+ npm run demo:setup
59
+ npm run demo:dev
60
+ ```
61
+
62
+ The demo showcases:
63
+
64
+ - **Basic Forms**: All input types and basic functionality
65
+ - **Advanced Features**: Masking, computed fields, custom buttons
66
+ - **Validation Examples**: Custom validators and error handling
67
+ - **Dependent Fields**: Dynamic field behavior and cascading options
68
+ - **Custom Styles**: Theming and visual customization
69
+
70
+ Visit the displayed URL (usually `http://localhost:3000`) to explore the interactive examples.
71
+
72
+ ### Development Workflow
73
+
74
+ When working on the library and wanting to test changes in the demo:
75
+
76
+ ```bash
77
+ # Update demo with latest library changes
78
+ npm run demo:update
79
+ ```
80
+
46
81
  ## Features
47
82
 
48
83
  - **Dynamic Form Generation**: Create forms dynamically based on a schema definition.
@@ -391,6 +426,80 @@ An input can also depend on multiple other inputs:
391
426
 
392
427
  For more details and examples, see the [Dependencies Documentation](./docs/DEPENDENCIES.md).
393
428
 
429
+ #### Resetting Dependent Fields
430
+
431
+ When a dependency changes, you often want to reset the dependent field's value to prevent invalid combinations (e.g., when changing from "USA" to "Canada", the previously selected "California" state should be cleared).
432
+
433
+ **Method 1: Automatic Reset (Built-in)**
434
+
435
+ The SelectInput component automatically detects dependency changes and resets the field value when using the `dependsOn` property:
436
+
437
+ ```javascript
438
+ const formSchema = {
439
+ country: {
440
+ type: 'SelectInput',
441
+ label: 'Country',
442
+ options: [
443
+ { label: 'United States', value: 'us' },
444
+ { label: 'Canada', value: 'ca' },
445
+ ],
446
+ },
447
+ state: {
448
+ type: 'SelectInput',
449
+ label: 'State/Province',
450
+ dependsOn: 'country',
451
+ options: (filter, dependencyValues) => {
452
+ const country = dependencyValues?.country?.value;
453
+ return getStatesForCountry(country);
454
+ },
455
+ },
456
+ };
457
+ ```
458
+
459
+ When the country changes, the state field automatically resets to empty and reloads options.
460
+
461
+ **Method 2: Manual Reset (Workaround)**
462
+
463
+ If the automatic reset doesn't work as expected, you can manually reset dependent fields using the `onChange` callback:
464
+
465
+ ```javascript
466
+ {
467
+ country: {
468
+ type: 'SelectInput',
469
+ label: 'Country',
470
+ options: [...],
471
+ onChange: (value, schema) => {
472
+ // Manual reset as workaround
473
+ schema.state.value = '';
474
+ return value;
475
+ },
476
+ }
477
+ }
478
+ ```
479
+
480
+ **Method 3: Multiple Field Reset**
481
+
482
+ You can reset multiple dependent fields at once using onChange:
483
+
484
+ ```javascript
485
+ {
486
+ country: {
487
+ type: 'SelectInput',
488
+ label: 'Country',
489
+ options: [...],
490
+ onChange: (value, schema) => {
491
+ // Reset all location-dependent fields
492
+ schema.state.value = '';
493
+ schema.city.value = '';
494
+ schema.zipCode.value = '';
495
+ return value;
496
+ },
497
+ }
498
+ }
499
+ ```
500
+
501
+ **Note:** Use the onChange approach as a workaround when the automatic reset doesn't work properly, or when you need to reset multiple fields or perform additional logic when dependencies change.
502
+
394
503
  ### Advanced Components
395
504
 
396
505
  #### SelectInput
@@ -1 +1 @@
1
- {"version":3,"file":"BaseInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/BaseInput.vue"],"names":[],"mappings":"AA8BA;AAyEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMpE,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAC;IAAC,IAAI,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC;AAElE,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAwChF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;AA8JhB,wBAUG"}
1
+ {"version":3,"file":"BaseInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/BaseInput.vue"],"names":[],"mappings":"AA8BA;AAyEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAMhE,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAC;IAAC,IAAI,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC;AAElE,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAwChF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;AA8JhB,wBAUG"}
@@ -1,4 +1,4 @@
1
- import { FormField, FormSchema } from 'types';
1
+ import { FormField, FormSchema } from '../../types';
2
2
  type __VLS_Props = {
3
3
  schema?: FormSchema;
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/CheckboxInput.vue"],"names":[],"mappings":"AAcA;AAuDA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAK9C,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAYhF,iBAAS,OAAO,SAIf;AAsBD,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;AAmFhB,wBAUG"}
1
+ {"version":3,"file":"CheckboxInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/CheckboxInput.vue"],"names":[],"mappings":"AAcA;AAuDA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKhD,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAYhF,iBAAS,OAAO,SAIf;AAsBD,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;AAmFhB,wBAUG"}
@@ -1 +1 @@
1
- {"version":3,"file":"DateInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/DateInput.vue"],"names":[],"mappings":"AAQA;AA0BA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzD,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAkBhF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DhB,wBAUG"}
1
+ {"version":3,"file":"DateInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/DateInput.vue"],"names":[],"mappings":"AAQA;AA0BA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrD,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAkBhF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DhB,wBAUG"}
@@ -1,4 +1,4 @@
1
- import { FormField, FormSchema } from 'types';
1
+ import { FormField, FormSchema } from '../../types';
2
2
  type __VLS_Props = {
3
3
  schema?: FormSchema;
4
4
  };
@@ -19,7 +19,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
19
19
  modelValue?: FormField;
20
20
  } & {
21
21
  schema?: FormSchema;
22
- type?: import('types').BaseFieldTypes;
22
+ type?: import('../../types').BaseFieldTypes;
23
23
  }> & Readonly<{
24
24
  "onUpdate:modelValue"?: ((value: FormField) => any) | undefined;
25
25
  }>, {
@@ -49,7 +49,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
49
49
  modelValue?: FormField;
50
50
  } & {
51
51
  schema?: FormSchema;
52
- type?: import('types').BaseFieldTypes;
52
+ type?: import('../../types').BaseFieldTypes;
53
53
  }> & Readonly<{
54
54
  "onUpdate:modelValue"?: ((value: FormField) => any) | undefined;
55
55
  }>, {
@@ -1 +1 @@
1
- {"version":3,"file":"EmailInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/EmailInput.vue"],"names":[],"mappings":"AAGA;AAsBA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG9C,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAkBhF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DhB,wBAUG"}
1
+ {"version":3,"file":"EmailInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/EmailInput.vue"],"names":[],"mappings":"AAGA;AAsBA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGhD,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAkBhF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DhB,wBAUG"}
@@ -1,4 +1,4 @@
1
- import { FormField, FormSchema } from 'types';
1
+ import { FormField, FormSchema } from '../../types';
2
2
  type __VLS_Props = {
3
3
  schema?: FormSchema;
4
4
  };
@@ -19,7 +19,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
19
19
  modelValue?: FormField;
20
20
  } & {
21
21
  schema?: FormSchema;
22
- type?: import('types').BaseFieldTypes;
22
+ type?: import('../../types').BaseFieldTypes;
23
23
  }> & Readonly<{
24
24
  "onUpdate:modelValue"?: ((value: FormField) => any) | undefined;
25
25
  }>, {
@@ -49,7 +49,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
49
49
  modelValue?: FormField;
50
50
  } & {
51
51
  schema?: FormSchema;
52
- type?: import('types').BaseFieldTypes;
52
+ type?: import('../../types').BaseFieldTypes;
53
53
  }> & Readonly<{
54
54
  "onUpdate:modelValue"?: ((value: FormField) => any) | undefined;
55
55
  }>, {
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/NumberInput.vue"],"names":[],"mappings":"AAGA;AAsBA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG9C,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAkBhF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DhB,wBAUG"}
1
+ {"version":3,"file":"NumberInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/NumberInput.vue"],"names":[],"mappings":"AAGA;AAsBA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGhD,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAkBhF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DhB,wBAUG"}
@@ -1,4 +1,4 @@
1
- import { FormField, FormSchema } from 'types';
1
+ import { FormField, FormSchema } from '../../types';
2
2
  type __VLS_Props = {
3
3
  schema?: FormSchema;
4
4
  };
@@ -19,7 +19,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
19
19
  modelValue?: FormField;
20
20
  } & {
21
21
  schema?: FormSchema;
22
- type?: import('types').BaseFieldTypes;
22
+ type?: import('../../types').BaseFieldTypes;
23
23
  }> & Readonly<{
24
24
  "onUpdate:modelValue"?: ((value: FormField) => any) | undefined;
25
25
  }>, {
@@ -49,7 +49,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
49
49
  modelValue?: FormField;
50
50
  } & {
51
51
  schema?: FormSchema;
52
- type?: import('types').BaseFieldTypes;
52
+ type?: import('../../types').BaseFieldTypes;
53
53
  }> & Readonly<{
54
54
  "onUpdate:modelValue"?: ((value: FormField) => any) | undefined;
55
55
  }>, {
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/PasswordInput.vue"],"names":[],"mappings":"AAGA;AAsBA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG9C,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAkBhF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DhB,wBAUG"}
1
+ {"version":3,"file":"PasswordInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/PasswordInput.vue"],"names":[],"mappings":"AAGA;AAsBA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGhD,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAkBhF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DhB,wBAUG"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/RadioInput.vue"],"names":[],"mappings":"AA0BA;AAkFA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAU,MAAM,aAAa,CAAC;AAK5D,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAYhF,iBAAS,OAAO,SAIf;AAqCD,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;AAiHhB,wBAUG"}
1
+ {"version":3,"file":"RadioInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/RadioInput.vue"],"names":[],"mappings":"AA0BA;AAkFA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAU,MAAM,SAAS,CAAC;AAKxD,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAYhF,iBAAS,OAAO,SAIf;AAqCD,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;AAiHhB,wBAUG"}
@@ -1,4 +1,4 @@
1
- import { ComputedData, FormData, FormField, FormSchema } from 'types';
1
+ import { ComputedData, FormData, FormField, FormSchema } from '../../types';
2
2
  interface PropsI {
3
3
  schema?: FormSchema;
4
4
  data: FormData;
@@ -1 +1 @@
1
- {"version":3,"file":"RepeatInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/RepeatInput.vue"],"names":[],"mappings":"AAoCA;AAwHA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAU,MAAM,OAAO,CAAC;AAO9E,UAAU,MAAM;IACd,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,KAAK,WAAW,GAAG,MAAM,CAAC;AAE1B,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAwChF,iBAAS,OAAO,SAEf;AAED,iBAAS,SAAS,aAEjB;AAED,iBAAe,aAAa,kBAE3B;AAiBD,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;AAyLhB,wBASG"}
1
+ {"version":3,"file":"RepeatInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/RepeatInput.vue"],"names":[],"mappings":"AAoCA;AAwHA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAU,MAAM,SAAS,CAAC;AAOhF,UAAU,MAAM;IACd,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,KAAK,WAAW,GAAG,MAAM,CAAC;AAE1B,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAwChF,iBAAS,OAAO,SAEf;AAED,iBAAS,SAAS,aAEjB;AAED,iBAAe,aAAa,kBAE3B;AAiBD,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;AAyLhB,wBASG"}
@@ -1,15 +1,10 @@
1
1
  import { PropType } from 'vue';
2
- import { FormSchema, BaseFieldTypes, FormField, Option, FormValue } from '../../types';
3
- interface DependencyManager {
4
- registerDependency: (fieldId: string, dependsOn: string[], loader: (filter?: string, dependencyValues?: Record<string, FormValue>) => Promise<Option[]>) => void;
5
- updateOptions: (fieldId: string, filterValue?: string) => void;
6
- }
2
+ import { FormSchema, BaseFieldTypes, FormField } from '../../types';
7
3
  declare function onReset(): void;
8
4
  declare function onValueUpdate(evt?: any): Promise<void>;
9
5
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
10
6
  schema: PropType<FormSchema>;
11
7
  type: PropType<BaseFieldTypes>;
12
- dependencyManager: PropType<DependencyManager>;
13
8
  formId: StringConstructor;
14
9
  modelValue: {
15
10
  type: PropType<FormField>;
@@ -23,7 +18,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
23
18
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
24
19
  schema: PropType<FormSchema>;
25
20
  type: PropType<BaseFieldTypes>;
26
- dependencyManager: PropType<DependencyManager>;
27
21
  formId: StringConstructor;
28
22
  modelValue: {
29
23
  type: PropType<FormField>;
@@ -1 +1 @@
1
- {"version":3,"file":"SelectInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/SelectInput.vue"],"names":[],"mappings":"AAiDA;AAgbA,OAAO,EAAiB,QAAQ,EAA6C,MAAM,KAAK,CAAC;AAEzF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAiBvF,UAAU,iBAAiB;IACzB,kBAAkB,EAAE,CAClB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EAAE,EACnB,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,KACzF,IAAI,CAAC;IACV,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChE;AAsCD,iBAAS,OAAO,SAMf;AA6ID,iBAAe,aAAa,CAAC,GAAG,CAAC,EAAE,GAAG,iBAgBrC;;YA0ZmB,QAAQ,CAAC,UAAU,CAAC;UACtB,QAAQ,CAAC,cAAc,CAAC;uBACX,QAAQ,CAAC,iBAAiB,CAAC;;;;;;;;;;;;YAFtC,QAAQ,CAAC,UAAU,CAAC;UACtB,QAAQ,CAAC,cAAc,CAAC;uBACX,QAAQ,CAAC,iBAAiB,CAAC;;;;;;;;;;;;;;;;;;AAZ1D,wBAkBG"}
1
+ {"version":3,"file":"SelectInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/SelectInput.vue"],"names":[],"mappings":"AAiDA;AA0aA,OAAO,EAAiB,QAAQ,EAA6C,MAAM,KAAK,CAAC;AAEzF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAU,MAAM,SAAS,CAAC;AAmFxE,iBAAS,OAAO,SAMf;AA6ID,iBAAe,aAAa,CAAC,GAAG,CAAC,EAAE,GAAG,iBAgBrC;;YA8XmB,QAAQ,CAAC,UAAU,CAAC;UACtB,QAAQ,CAAC,cAAc,CAAC;;;;;;;;;;;;YADtB,QAAQ,CAAC,UAAU,CAAC;UACtB,QAAQ,CAAC,cAAc,CAAC;;;;;;;;;;;;;;;;;;AAX1C,wBAiBG"}
@@ -1,4 +1,4 @@
1
- import { FormField, FormSchema } from 'types';
1
+ import { FormField, FormSchema } from '../../types';
2
2
  type __VLS_Props = {
3
3
  schema?: FormSchema;
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TextAreaInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/TextAreaInput.vue"],"names":[],"mappings":"AA4BA;AAgEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAK9C,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAiChF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;AAuHhB,wBAUG"}
1
+ {"version":3,"file":"TextAreaInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/TextAreaInput.vue"],"names":[],"mappings":"AA4BA;AAgEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKhD,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAiChF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;AAuHhB,wBAUG"}
@@ -1,4 +1,4 @@
1
- import { FormField, FormSchema } from 'types';
1
+ import { FormField, FormSchema } from '../../types';
2
2
  type __VLS_Props = {
3
3
  schema?: FormSchema;
4
4
  };
@@ -19,7 +19,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
19
19
  modelValue?: FormField;
20
20
  } & {
21
21
  schema?: FormSchema;
22
- type?: import('types').BaseFieldTypes;
22
+ type?: import('../../types').BaseFieldTypes;
23
23
  }> & Readonly<{
24
24
  "onUpdate:modelValue"?: ((value: FormField) => any) | undefined;
25
25
  }>, {
@@ -49,7 +49,7 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {
49
49
  modelValue?: FormField;
50
50
  } & {
51
51
  schema?: FormSchema;
52
- type?: import('types').BaseFieldTypes;
52
+ type?: import('../../types').BaseFieldTypes;
53
53
  }> & Readonly<{
54
54
  "onUpdate:modelValue"?: ((value: FormField) => any) | undefined;
55
55
  }>, {
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/TextInput.vue"],"names":[],"mappings":"AAGA;AAsBA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG9C,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAkBhF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DhB,wBAUG"}
1
+ {"version":3,"file":"TextInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/TextInput.vue"],"names":[],"mappings":"AAGA;AAsBA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGhD,KAAK,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3C,QAAA,MAAM,KAAK,iEAAoE,CAAC;AAkBhF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;CAClC,GAAG,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DhB,wBAUG"}
@@ -1 +1 @@
1
- {"version":3,"file":"InputLabel.vue.d.ts","sourceRoot":"","sources":["../../../src/components/shared/InputLabel.vue"],"names":[],"mappings":"AAMA;AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;;AAyEF,wBAMG"}
1
+ {"version":3,"file":"InputLabel.vue.d.ts","sourceRoot":"","sources":["../../../src/components/shared/InputLabel.vue"],"names":[],"mappings":"AAMA;AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIzC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;;AAyEF,wBAMG"}
@@ -1 +1 @@
1
- {"version":3,"file":"vForm.vue.d.ts","sourceRoot":"","sources":["../../src/components/vForm.vue"],"names":[],"mappings":"AA8CA;AAqKA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAMjF,UAAU,SAAS;IACjB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CACrC;;;;;;;;;;;;;;;;;gBATc,OAAO;qBACF,OAAO;sBACN,OAAO;qBACR,OAAO,GAAG,QAAQ,GAAG,KAAK;sBACzB,MAAM;qBACP,MAAM;sBACL,MAAM;iBACX,OAAO;;;;AA2UvB,wBAWG"}
1
+ {"version":3,"file":"vForm.vue.d.ts","sourceRoot":"","sources":["../../src/components/vForm.vue"],"names":[],"mappings":"AA6CA;AA+JA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAKhF,UAAU,SAAS;IACjB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CACrC;;;;;;;;;;;;;;;;;gBATc,OAAO;qBACF,OAAO;sBACN,OAAO;qBACR,OAAO,GAAG,QAAQ,GAAG,KAAK;sBACzB,MAAM;qBACP,MAAM;sBACL,MAAM;iBACX,OAAO;;;;AAoUvB,wBAWG"}
@@ -1,5 +1,5 @@
1
1
  import { Ref } from 'vue';
2
- import { FormData, FormSchema, ComputedData } from 'types';
2
+ import { FormData, FormSchema, ComputedData } from '../types';
3
3
  /**
4
4
  * Composable for data transformation logic
5
5
  * Reduces duplication in computed data processing
@@ -1 +1 @@
1
- {"version":3,"file":"useDataTransformation.d.ts","sourceRoot":"","sources":["../../src/composables/useDataTransformation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,GAAG,EAAS,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAU,MAAM,OAAO,CAAC;AAGnE;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC;;;EAwJlE"}
1
+ {"version":3,"file":"useDataTransformation.d.ts","sourceRoot":"","sources":["../../src/composables/useDataTransformation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,GAAG,EAAS,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAU,MAAM,SAAS,CAAC;AAGrE;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC;;;EAwJlE"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDependentOptions.d.ts","sourceRoot":"","sources":["../../src/composables/useDependentOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,GAAG,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE3E;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,GAAG,CAAC,UAAU,CAAC,EACvB,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,EACnB,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC;kCAiBpB,MAAM,aACJ,MAAM,EAAE,UACX,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;6BAoElD,MAAM,gBAAgB,MAAM;EAgEnE"}
1
+ {"version":3,"file":"useDependentOptions.d.ts","sourceRoot":"","sources":["../../src/composables/useDependentOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,GAAG,EAAE,MAAM,KAAK,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE1E;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,GAAG,CAAC,UAAU,CAAC,EACvB,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,EACnB,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC;kCAiBpB,MAAM,aACJ,MAAM,EAAE,UACX,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;6BAoElD,MAAM,gBAAgB,MAAM;EAgEnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"useInputProps.d.ts","sourceRoot":"","sources":["../../src/composables/useInputProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;EA2DlD"}
1
+ {"version":3,"file":"useInputProps.d.ts","sourceRoot":"","sources":["../../src/composables/useInputProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;EA2DlD"}
@@ -1 +1 @@
1
- {"version":3,"file":"useInputValidation.d.ts","sourceRoot":"","sources":["../../src/composables/useInputValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,KAAK,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,GAAG,CAAC,uBAAuB,GAAG,IAAI,CAAC,EAC7C,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,EACrB,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,EACpB,MAAM,CAAC,EAAE,GAAG,CAAC,UAAU,GAAG,SAAS,CAAC,EACpC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;mBAOlC,OAAO,CAAC,OAAO,CAAC;yBAkCV,OAAO,CAAC,IAAI,CAAC;mBAczB,IAAI;6BAQO,GAAG,KAAQ,IAAI;qBASxB,MAAM,EAAE;;;EAa/B"}
1
+ {"version":3,"file":"useInputValidation.d.ts","sourceRoot":"","sources":["../../src/composables/useInputValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,KAAK,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,GAAG,CAAC,uBAAuB,GAAG,IAAI,CAAC,EAC7C,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,EACrB,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,EACpB,MAAM,CAAC,EAAE,GAAG,CAAC,UAAU,GAAG,SAAS,CAAC,EACpC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;mBAOlC,OAAO,CAAC,OAAO,CAAC;yBAkCV,OAAO,CAAC,IAAI,CAAC;mBAczB,IAAI;6BAQO,GAAG,KAAQ,IAAI;qBASxB,MAAM,EAAE;;;EAa/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"useLabelTemplate.d.ts","sourceRoot":"","sources":["../../src/composables/useLabelTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC;;;;EAqBrD"}
1
+ {"version":3,"file":"useLabelTemplate.d.ts","sourceRoot":"","sources":["../../src/composables/useLabelTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC;;;;EAqBrD"}
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("@ionic/vue"),S=require("ionicons/icons"),Q=require("@maskito/vue");function X(n){return new Promise(r=>{requestAnimationFrame(async()=>{const l=await n.getInputElement();r(l)})})}const Y={d:/\d/,a:/[A-Za-z]/,"*":/[A-Za-z0-9]/},ee={d:["1","2","3","4","5","6","7","8","9","0"],a:["A","B","C","x","y","z","D","f"],"*":["A","3","b","8","z","4","D","0"]};function te(n,r){const l=ee[n];return l[r%l.length]}function ne(n){const r=[];let l="",t=0,o=0;for(;t<n.length;){const a=n[t];if(["d","a","*"].includes(a)){let i=1;if(n[t+1]==="{"){const c=n.indexOf("}",t+2);if(c!==-1){const p=n.slice(t+2,c);if(p.includes(",")){const[,d]=p.split(",").map(s=>parseInt(s.trim()));i=d||parseInt(p.split(",")[0])}else i=parseInt(p);t=c}}else{let c=t+1;for(;n[c]===a;)i++,c++;t=c-1}for(let c=0;c<i;c++)r.push(Y[a]),l+=te(a,o++)}else r.push(a),l+=a;t++}return{mask:r,placeholder:l,elementPredicate:X}}function L(n){return n==null||Array.isArray(n)&&!n.length||typeof n=="object"&&!Object.keys(n).length||!n}function U(n,r,l){return typeof n.condition=="function"?n.condition(r,l):!0}function D(n){if(typeof n!="object"||n===null)return n;if(Array.isArray(n))return n.map(l=>D(l));const r={};return Object.entries(n).forEach(([l,t])=>{typeof t=="function"?r[l]=t.bind(r):r[l]=D(t)}),r}function j(n,r){return r.findIndex(l=>l.value===n.value||l.label===n.label||l.value===n.label||l.label===n.value)}function I(n,r){const l=j(n,r);l>=0?r[l].isChecked=!0:r.push({...n,isChecked:!0})}function q(n,r){const l=j(n,r);l>=0&&(r[l].isChecked=!1)}function oe(n,r){return r?n.filter(l=>JSON.stringify(l).toLowerCase().includes(r.toLowerCase())):n}function P(n){const r=n.label||"",l=n.required?" *":"";return r+l}function T(n,r){if(n===r)return!0;if(n==null||r==null||typeof n!=typeof r)return!1;if(typeof n!="object")return n===r;if(Array.isArray(n)&&Array.isArray(r))return n.length!==r.length?!1:n.every((o,a)=>T(o,r[a]));if(Array.isArray(n)!==Array.isArray(r))return!1;const l=Object.keys(n),t=Object.keys(r);return l.length!==t.length?!1:l.every(o=>Object.prototype.hasOwnProperty.call(r,o)&&T(n[o],r[o]))}function $(){const n=e.ref([]);async function r(){console.debug("Validating form inputs");const a=[];for(const i of n.value)if(typeof(i==null?void 0:i.onValueUpdate)=="function"&&await i.onValueUpdate(),typeof(i==null?void 0:i.getErrors)=="function")try{const c=i.getErrors();Array.isArray(c)?a.push(...c):console.warn("getErrors() returned non-array value:",c)}catch(c){console.error("Error calling getErrors on component:",c,i)}else console.warn("Component does not have getErrors function:",i);return a.every(L)}function l(){n.value.forEach(a=>{typeof(a==null?void 0:a.onReset)=="function"&&a.onReset()})}function t(){const a=[];for(const i of n.value)if(typeof(i==null?void 0:i.getErrors)=="function")try{const c=i.getErrors();Array.isArray(c)?a.push(...c):a.push(String(c))}catch(c){console.error("Error calling getErrors on component:",c,i)}return a}async function o(){for(const a of n.value)typeof(a==null?void 0:a.onValueUpdate)=="function"&&await a.onValueUpdate()}return{dynamicRefs:n,isFormValid:r,resetForm:l,getFormErrors:t,updateFormValues:o}}function G(n){const r=e.computed(()=>Object.entries(n.value).reduce((d,[s,f])=>(f.value!==void 0&&(typeof f.onChange=="function"?d[s]=f.onChange(f.value):d[s]=f.value),d),{})),l=e.ref({}),t=(d,s,f)=>{var u;return typeof((u=n.value[d].children[s])==null?void 0:u.computedValue)=="function"?n.value[d].children[s].computedValue(f,n.value):f},o=(d,s,f,u)=>{l.value[d][u]||(l.value[d][u]={}),Object.entries(s.other??{}).forEach(([m,V])=>{var g;!T(V,(g=f.other)==null?void 0:g[m])&&(l.value[d][u][m]=t(d,m,V))})},a=(d,s,f)=>{s.forEach((u,m)=>{const V=f[m]??{other:{}};o(d,u,V,m)})},i=(d,{other:s})=>Object.entries(s??{}).reduce((f,[u,m])=>(f[u]=t(d,u,m),f),{}),c=(d,s,f)=>{l.value[d]||(l.value[d]=[]);const u=s;Array.isArray(f[d])?a(d,u,f[d]):l.value[d]=u.map(m=>i(d,m))},p=(d,s,f)=>{if(!s){delete l.value[d];return}const u=n.value[d];u.children!==void 0?c(d,s,f):typeof u.computedValue=="function"&&(l.value[d]=u.computedValue(s,n.value))};return e.watch(r,(d,s={})=>{Object.keys(d).forEach(f=>{T(d[f],s[f])||p(f,d[f],s)}),Object.keys(s).forEach(f=>{!(f in d)&&f in l.value&&delete l.value[f]})},{immediate:!0,deep:!0}),{formData:r,computedData:l}}function H(n,r,l){const t=e.ref({}),o=e.ref({});function a(s,f,u){o.value[s]=u,f.forEach(m=>{var V;(V=t.value)[m]??(V[m]=[]),t.value[m].includes(s)||t.value[m].push(s)}),d(s)}function i(s){return Object.entries(t.value).filter(([,u])=>u.includes(s)).map(([u])=>u).reduce((u,m)=>(u[m]=r.value[m]??l.value[m],u),{})}function c(s,f){return s?Array.isArray(s)?s.some(u=>f.some(m=>p(u,m.value))):f.some(u=>p(s,u.value)):!1}function p(s,f){return typeof s=="object"&&s!==null?s.value===f:String(s)===String(f)}async function d(s,f){if(!o.value[s])return;const u=i(s),m=Object.keys(u);if(!(m.length===0||!m.every(k=>u[k]!==void 0&&u[k]!==null)))try{const k=o.value[s],g=await k(f,u);if(!n.value[s])return;n.value[s].options=g;const v=n.value[s].value;if(!v)return;c(v,g)||(n.value[s].value=n.value[s].multiple?[]:"")}catch(k){console.error(`Error loading options for ${s}:`,k)}}return e.watch([r,l],()=>{Object.entries(t.value).forEach(([s,f])=>{(r.value[s]!==void 0||l.value[s]!==void 0)&&f.forEach(u=>{d(u)})})},{deep:!0,immediate:!0}),{registerDependency:a,updateOptions:d}}const le=e.defineComponent({__name:"vForm",props:{schema:{},showLabels:{type:Boolean,default:!0},showClearButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},buttonPlacement:{default:"start"},submitButtonText:{default:"Submit"},clearButtonText:{default:"Reset"},cancelButtonText:{default:"Cancel"},hideButtons:{type:Boolean,default:!1},customButtons:{}},emits:["submit","clear","cancel"],setup(n,{expose:r,emit:l}){const t=n,o=l,a=e.ref(t.schema),{dynamicRefs:i,isFormValid:c,resetForm:p}=$(),{formData:d,computedData:s}=G(a),f=H(a,d,s);async function u(){await c()&&o("submit",d.value,s.value)}function m(){p(),o("clear")}function V(){p(),o("cancel")}return e.watch(d,async()=>{for(const[k,g]of Object.entries(a.value))U(g,d.value,s.value)||(g.value=t.schema[k].value)},{deep:!0,immediate:!0}),e.watch(()=>t.schema,k=>{for(const[g,v]of Object.entries(k))v.value!==void 0&&(a.value[g].value=v.value)},{deep:!0,immediate:!0}),r({resetForm:p,isFormValid:c,resolveData:()=>({formData:d.value,computedData:s.value})}),(k,g)=>(e.openBlock(),e.createBlock(e.unref(y.IonGrid),null,{default:e.withCtx(()=>[e.createVNode(e.unref(y.IonRow),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(a.value),v=>{var B,_,E,O,F;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(U)(a.value[v],e.unref(d),e.unref(s))?(e.openBlock(),e.createBlock(e.unref(y.IonCol),{key:v,size:((B=a.value[v].grid)==null?void 0:B.xs)??"12","size-sm":(_=a.value[v].grid)==null?void 0:_.sm,"size-md":(E=a.value[v].grid)==null?void 0:E.md,"size-lg":(O=a.value[v].grid)==null?void 0:O.lg,"size-xl":(F=a.value[v].grid)==null?void 0:F.xl,class:"ion-margin-vertical"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value[v].type),{modelValue:a.value[v],"onUpdate:modelValue":w=>a.value[v]=w,schema:a.value,"dependency-manager":e.unref(f),"form-id":v,ref_for:!0,ref_key:"dynamicRefs",ref:i,"ref-key":v},null,8,["modelValue","onUpdate:modelValue","schema","dependency-manager","form-id","ref-key"]))]),_:2},1032,["size","size-sm","size-md","size-lg","size-xl"])):e.createCommentVNode("",!0)],64)}),256))]),_:1}),k.hideButtons?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(y.IonRow),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(y.IonCol),{size:"12",style:e.normalizeStyle([{display:"flex"},{justifyContent:k.buttonPlacement}])},{default:e.withCtx(()=>[k.showCancelButton?(e.openBlock(),e.createBlock(e.unref(y.IonButton),{key:0,onClick:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.cancelButtonText??"Cancel"),1)]),_:1})):e.createCommentVNode("",!0),k.showClearButton?(e.openBlock(),e.createBlock(e.unref(y.IonButton),{key:1,onClick:m},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.clearButtonText??"Reset"),1)]),_:1})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.customButtons,v=>(e.openBlock(),e.createBlock(e.unref(y.IonButton),{key:v.label,onClick:v.action,color:v.color??"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v.label),1)]),_:2},1032,["onClick","color"]))),128)),e.createVNode(e.unref(y.IonButton),{onClick:u},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.submitButtonText??"Submit"),1)]),_:1})]),_:1},8,["style"])]),_:1}))]),_:1}))}});function ae(n){return{applyValidationState:async t=>{var o,a,i,c,p;(o=n.value)==null||o.$el.classList.remove("ion-invalid"),(a=n.value)==null||a.$el.classList.remove("ion-valid"),t?(i=n.value)==null||i.$el.classList.add("ion-valid"):(c=n.value)==null||c.$el.classList.add("ion-invalid"),(p=n.value)==null||p.$el.classList.add("ion-touched")},resetValidationState:()=>{var t,o;(t=n.value)==null||t.$el.classList.remove("ion-touched"),(o=n.value)==null||o.$el.classList.remove("ion-invalid")}}}function M(n,r,l,t,o){const{applyValidationState:a,resetValidationState:i}=ae(n);async function c(){if(r.value.required&&!l.value)return r.value.error="This field is required",!1;if(o){const u=await o(l.value);if(typeof u=="string")return r.value.error=u,!1;if(u===!1)return!1}if(r.value.validation){const u=await r.value.validation(l.value,t==null?void 0:t.value);if(u&&u.length)return r.value.error=u.join(),!1}return!0}async function p(){const u=await c();u&&(r.value.error="",r.value.value=l.value),await a(u)}function d(){i(),r.value.error=""}function s(u=""){l.value=u,r.value.error="",r.value.value=u}function f(){return r.value.error?[r.value.error]:[]}return{isValid:c,onValueUpdate:p,onFocus:d,onReset:s,getErrors:f,applyValidationState:a,resetValidationState:i}}function re(n){const r=e.computed(()=>!!n.value.label),l=e.computed(()=>!!n.value.required),t=e.computed(()=>n.value.label||"");return{showLabel:r,showRequired:l,labelText:t}}const z=e.defineComponent({__name:"InputLabel",props:{model:{}},setup(n){const r=n,{showLabel:l,showRequired:t,labelText:o}=re(e.toRef(r,"model"));return(a,i)=>e.unref(l)?(e.openBlock(),e.createBlock(e.unref(y.IonLabel),{key:0,slot:"label",class:"input-label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o))+" ",1),e.unref(t)?(e.openBlock(),e.createBlock(e.unref(y.IonText),{key:0,color:"danger"},{default:e.withCtx(()=>i[0]||(i[0]=[e.createTextVNode("*")])),_:1,__:[0]})):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0)}}),A=e.defineComponent({__name:"BaseInput",props:e.mergeModels({schema:{},type:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const l=n,t=e.useModel(n,"modelValue"),o=e.ref(null),a=e.ref(t.value.value),i=e.computed(()=>l.schema),{isValid:c,onValueUpdate:p,onFocus:d,onReset:s,getErrors:f}=M(o,t,a,i),u=e.computed(()=>{if(t.value.pattern)return ne(t.value.pattern)});return e.watch(()=>t.value.value,m=>a.value=m),r({onValueUpdate:p,onReset:s,getErrors:f,isValid:c}),(m,V)=>{var g;const k=e.resolveDirective("maskito");return e.withDirectives((e.openBlock(),e.createBlock(e.unref(y.IonInput),{ref_key:"inputRef",ref:o,modelValue:a.value,"onUpdate:modelValue":V[0]||(V[0]=v=>a.value=v),"clear-input":!0,fill:t.value.fill??"solid","label-placement":t.value.labelPlacement??"stacked",type:m.type??"text",required:t.value.required,"error-text":t.value.error,autofocus:t.value.autoFocus,placeholder:((g=u.value)==null?void 0:g.placeholder)??t.value.placeholder,disabled:t.value.disabled,counter:t.value.counter,min:t.value.min,max:t.value.max,"max-length":t.value.maxLength,"min-length":t.value.minLength,pattern:t.value.pattern,onIonFocus:e.unref(d),onIonChange:e.unref(p),onIonBlur:e.unref(p)},{default:e.withCtx(()=>[e.createVNode(z,{model:t.value},null,8,["model"]),t.value.prefix?(e.openBlock(),e.createBlock(e.unref(y.IonLabel),{key:0,slot:"start"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.value.prefix),1)]),_:1})):e.createCommentVNode("",!0),t.value.suffix?(e.openBlock(),e.createBlock(e.unref(y.IonLabel),{key:1,slot:"end"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.value.suffix),1)]),_:1})):e.createCommentVNode("",!0),m.type==="password"?(e.openBlock(),e.createBlock(e.unref(y.IonInputPasswordToggle),{key:2,slot:"end"})):e.createCommentVNode("",!0)]),_:1},8,["modelValue","fill","label-placement","type","required","error-text","autofocus","placeholder","disabled","counter","min","max","max-length","min-length","pattern","onIonFocus","onIonChange","onIonBlur"])),[[k,u.value]])}}}),ue=e.defineComponent({__name:"TextInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const l=e.useModel(n,"modelValue"),t=e.ref(null);return r({onReset:()=>{var o;return(o=t.value)==null?void 0:o.onReset()},onValueUpdate:()=>{var o;return(o=t.value)==null?void 0:o.onValueUpdate()},getErrors:()=>{var o,a;return((a=(o=t.value)==null?void 0:o.getErrors)==null?void 0:a.call(o))??[]}}),(o,a)=>(e.openBlock(),e.createBlock(A,{modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=i=>l.value=i),type:"text",schema:o.schema,ref_key:"inputRef",ref:t},null,8,["modelValue","schema"]))}}),se=e.defineComponent({__name:"DateInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const l=e.useModel(n,"modelValue"),t=e.ref(null);return r({onValueUpdate:()=>{var o;return(o=t.value)==null?void 0:o.onValueUpdate()},onReset:()=>{var o;return(o=t.value)==null?void 0:o.onReset()},getErrors:()=>{var o,a;return((a=(o=t.value)==null?void 0:o.getErrors)==null?void 0:a.call(o))??[]}}),(o,a)=>(e.openBlock(),e.createBlock(A,{modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=i=>l.value=i),type:l.value.enableTime?"datetime-local":"date",schema:o.schema,ref_key:"inputRef",ref:t},null,8,["modelValue","type","schema"]))}}),ce=e.defineComponent({__name:"NumberInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const l=e.useModel(n,"modelValue"),t=e.ref(null);return r({onReset:()=>{var o;return(o=t.value)==null?void 0:o.onReset()},onValueUpdate:()=>{var o;return(o=t.value)==null?void 0:o.onValueUpdate()},getErrors:()=>{var o,a;return((a=(o=t.value)==null?void 0:o.getErrors)==null?void 0:a.call(o))??[]}}),(o,a)=>(e.openBlock(),e.createBlock(A,{modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=i=>l.value=i),type:"number",schema:o.schema,ref_key:"inputRef",ref:t},null,8,["modelValue","schema"]))}}),ie=e.defineComponent({__name:"EmailInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const l=e.useModel(n,"modelValue"),t=e.ref(null);return r({onReset:()=>{var o;return(o=t.value)==null?void 0:o.onReset()},onValueUpdate:()=>{var o;return(o=t.value)==null?void 0:o.onValueUpdate()},getErrors:()=>{var o,a;return((a=(o=t.value)==null?void 0:o.getErrors)==null?void 0:a.call(o))??[]}}),(o,a)=>(e.openBlock(),e.createBlock(A,{modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=i=>l.value=i),type:"email",schema:o.schema,ref_key:"inputRef",ref:t},null,8,["modelValue","schema"]))}}),de=e.defineComponent({__name:"PasswordInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const l=e.useModel(n,"modelValue"),t=e.ref(null);return r({onReset:()=>{var o;return(o=t.value)==null?void 0:o.onReset()},onValueUpdate:()=>{var o;return(o=t.value)==null?void 0:o.onValueUpdate()},getErrors:()=>{var o,a;return((a=(o=t.value)==null?void 0:o.getErrors)==null?void 0:a.call(o))??[]}}),(o,a)=>(e.openBlock(),e.createBlock(A,{modelValue:l.value,"onUpdate:modelValue":a[0]||(a[0]=i=>l.value=i),type:"password",schema:o.schema,ref_key:"inputRef",ref:t},null,8,["modelValue","schema"]))}}),fe=e.defineComponent({__name:"SelectInput",props:e.mergeModels({schema:Object,type:String,dependencyManager:Object,formId:String},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const l=n,t=e.useModel(n,"modelValue"),o=e.ref(null),a=e.ref(null),i=e.ref(!1),c=e.ref([]),p=e.ref(""),d=e.ref(1),s=e.computed(()=>t.value.interface??"popover"),f=e.computed(()=>t.value.optionsPlacement==="top"?"top":"bottom"),u=e.computed(()=>c.value.filter(h=>!!h.isChecked)),m=e.computed(()=>!p.value&&L(u.value)&&!i.value?t.value.placeholder??"Select an option":"");e.watch([p,()=>t.value.options],N,{immediate:!0,deep:!0}),e.watch(()=>t.value.value,Z,{immediate:!0,deep:!0});function V(){c.value.forEach(h=>q(h,c.value)),t.value.error="",p.value="",d.value=1,t.value.value=t.value.multiple?[]:""}function k(h){if(h.isChecked)return q(h,c.value);t.value.multiple?I(h,c.value):(V(),I(h,c.value),w()),p.value=""}function g(){switch(s.value){case"action-sheet":v();break;case"alert":B();break;case"popover":default:i.value=!0;break}}async function v(){if(await N(),t.value.multiple){i.value=!0;return}await(await y.actionSheetController.create({header:t.value.label||"Select an option",buttons:[...c.value.map(C=>({text:C.label,cssClass:C.isChecked?"selected-option":"",handler:()=>(k(C),!1)})),{text:"Cancel",role:"cancel"}]})).present()}async function B(){await N();const h=c.value.map(x=>({label:x.label,type:t.value.multiple?"checkbox":"radio",value:x,checked:x.isChecked}));await(await y.alertController.create({header:t.value.label||"Select an option",inputs:h,buttons:[{text:"Cancel",role:"cancel"},{text:"OK",handler:x=>{if(t.value.multiple)c.value.forEach(b=>q(b,c.value)),x.forEach(b=>{const R=c.value.find(J=>J.value===b.value);R&&I(R,c.value)});else{V();const b=c.value.find(R=>R.value===x.value);b&&I(b,c.value)}w()}}]})).present()}async function _(){if(t.value.required&&L(u.value))return"This field is required";if(t.value.validation){const h=await t.value.validation(u.value,l==null?void 0:l.schema);if(h&&h.length)return h.join()}return!0}const{onFocus:E,applyValidationState:O}=M(o,t,e.computed(()=>t.value.multiple?u.value:u.value[0]),e.computed(()=>l==null?void 0:l.schema),_);function F(h){var C;h.target===((C=o.value)==null?void 0:C.$el)&&(E(),s.value==="popover"&&(i.value=!0))}async function w(h){var x;if((x=h==null?void 0:h.relatedTarget)!=null&&x.closest(".suggestions-list"))return;i.value=!1;const C=await _();C===!0?(t.value.error="",t.value.value=t.value.multiple?u.value:u.value[0]):t.value.error=typeof C=="string"?C:"Validation failed",await O(C===!0)}async function N(){const h=[];if(l.dependencyManager&&l.formId&&t.value.dependsOn)l.dependencyManager.updateOptions(l.formId,p.value),Array.isArray(t.value.options)&&h.push(...t.value.options.filter(C=>!!C.label));else if(typeof t.value.options=="function"){const C=await t.value.options(p.value);h.push(...C.filter(x=>!!x.label))}else h.push(...oe(t.value.options??[],p.value));u.value.forEach(C=>I(C,h)),c.value=h}function Z(){const h=t.value.value;h&&(Array.isArray(h)?h.forEach(C=>I(C,c.value)):I(typeof h=="object"?h:{value:h,label:h},c.value))}return e.onMounted(()=>{if(l.dependencyManager&&l.formId&&t.value.dependsOn&&typeof l.dependencyManager.registerDependency=="function"){const h=Array.isArray(t.value.dependsOn)?t.value.dependsOn:[t.value.dependsOn];l.dependencyManager.registerDependency(l.formId,h,async(C,x)=>{if(Array.isArray(t.value.options))return t.value.options;if(typeof t.value.options=="function")try{const b=C!==void 0?C:p.value,R=await t.value.options(b,x);return Array.isArray(R)?R:[]}catch(b){return console.error(`Error loading options for ${l.formId}:`,b),[]}return[]})}}),r({onValueUpdate:w,onReset:V,getErrors:()=>t.value.error?[t.value.error]:[]}),(h,C)=>(e.openBlock(),e.createElementBlock("div",{class:"autocomplete-container",onFocusout:w,ref_key:"containerRef",ref:a},[e.createVNode(e.unref(y.IonInput),{ref_key:"inputRef",ref:o,modelValue:p.value,"onUpdate:modelValue":C[0]||(C[0]=x=>p.value=x),fill:t.value.fill??"solid","label-placement":t.value.labelPlacement??"stacked",type:n.type??"text",required:t.value.required,"error-text":t.value.error,autofocus:t.value.autoFocus,placeholder:m.value,disabled:t.value.disabled,counter:t.value.counter,onIonFocus:F,debounce:300,onClick:g},{default:e.withCtx(()=>[e.createVNode(z,{model:t.value},null,8,["model"]),t.value.multiple?(e.openBlock(),e.createBlock(e.unref(y.IonLabel),{key:0,style:{width:"fit-content"},slot:"start"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(x,b)=>(e.openBlock(),e.createBlock(e.unref(y.IonChip),{key:b},{default:e.withCtx(()=>[e.createVNode(e.unref(y.IonLabel),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.label),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})):(e.openBlock(),e.createBlock(e.unref(y.IonLabel),{key:1,slot:"start",class:"ion-no-wrap"},{default:e.withCtx(()=>{var x;return[e.createTextVNode(e.toDisplayString(((x=u.value[0])==null?void 0:x.label)??""),1)]}),_:1})),e.createVNode(e.unref(y.IonIcon),{slot:"end",icon:e.unref(S.chevronDown)},null,8,["icon"]),u.value.length>0||p.value?(e.openBlock(),e.createBlock(e.unref(y.IonIcon),{key:2,slot:"end",icon:e.unref(S.close),onClick:V,style:{"z-index":"999999"}},null,8,["icon"])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","fill","label-placement","type","required","error-text","autofocus","placeholder","disabled","counter"]),i.value&&c.value.length>0&&s.value==="popover"?(e.openBlock(),e.createBlock(e.unref(y.IonList),{key:0,class:e.normalizeClass(["suggestions-list",f.value])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,x=>(e.openBlock(),e.createBlock(e.unref(y.IonItem),{button:"",key:x.label,onClick:b=>k(x)},{default:e.withCtx(()=>[t.value.multiple?(e.openBlock(),e.createBlock(e.unref(y.IonCheckbox),{key:0,slot:"start",checked:x.isChecked},null,8,["checked"])):e.createCommentVNode("",!0),e.createVNode(e.unref(y.IonLabel),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.label),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1},8,["class"])):e.createCommentVNode("",!0)],544))}}),K=(n,r)=>{const l=n.__vccOpts||n;for(const[t,o]of r)l[t]=o;return l},pe=K(fe,[["__scopeId","data-v-439c5bca"]]),me=e.defineComponent({__name:"TextAreaInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const l=n,t=e.useModel(n,"modelValue"),o=e.ref(null),a=e.ref(t.value.value),i=e.computed(()=>l.schema),{onValueUpdate:c,onFocus:p,onReset:d,getErrors:s}=M(o,t,a,i);return e.watch(()=>t.value.value,f=>a.value=f),r({onReset:d,onValueUpdate:c,getErrors:s}),(f,u)=>(e.openBlock(),e.createBlock(e.unref(y.IonTextarea),{ref_key:"inputRef",ref:o,modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=m=>a.value=m),"clear-input":!0,fill:t.value.fill??"solid","label-placement":t.value.labelPlacement??"stacked",required:t.value.required,"error-text":t.value.error,autofocus:t.value.autoFocus,placeholder:t.value.placeholder,disabled:t.value.disabled,counter:t.value.counter,min:t.value.min,max:t.value.max,rows:t.value.rows,cols:t.value.cols,"auto-grow":t.value.autoGrow,"max-length":t.value.maxLength,"min-length":t.value.minLength,pattern:t.value.pattern,onIonFocus:e.unref(p),onIonChange:e.unref(c),onIonBlur:e.unref(c)},{default:e.withCtx(()=>[e.createVNode(z,{model:t.value},null,8,["model"])]),_:1},8,["modelValue","fill","label-placement","required","error-text","autofocus","placeholder","disabled","counter","min","max","rows","cols","auto-grow","max-length","min-length","pattern","onIonFocus","onIonChange","onIonBlur"]))}}),ve={class:"ion-margin-end",style:{"flex-grow":"1"}},he={style:{display:"flex","justify-content":"flex-end"}},ye=e.defineComponent({__name:"RepeatInput",props:e.mergeModels({schema:{},data:{},computedData:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const l=e.useModel(n,"modelValue"),t=e.ref([]),{dynamicRefs:o,resetForm:a,getFormErrors:i,updateFormValues:c}=$(),p=e.computed(()=>t.value.map((V,k)=>({label:`Set ${k+1}`,value:k,other:Object.entries(V).reduce((g,[v,B])=>(g[v]=B.value,g),{})})));e.watch(p,V=>{l.value.value=V},{deep:!0,immediate:!0}),e.onMounted(d);function d(){l.value.children&&t.value.push(D(l.value.children))}function s(V){t.value.splice(V,1)}function f(){a()}function u(){return i()}async function m(){await c()}return r({onValueUpdate:m,onReset:f,getErrors:u}),(V,k)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(g,v)=>(e.openBlock(),e.createElementBlock("div",{class:"repeat-input-wrapper",key:v},[e.createElementVNode("div",ve,[e.createVNode(e.unref(y.IonRow),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(g),B=>{var _,E,O,F,w;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(U)(g[B],V.data,V.computedData)?(e.openBlock(),e.createBlock(e.unref(y.IonCol),{key:`${v}-${B}`,size:((_=g[B].grid)==null?void 0:_.xs)??"12","size-sm":(E=g[B].grid)==null?void 0:E.sm,"size-md":(O=g[B].grid)==null?void 0:O.md,"size-lg":(F=g[B].grid)==null?void 0:F.lg,"size-xl":(w=g[B].grid)==null?void 0:w.xl,class:"ion-margin-bottom"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g[B].type),{modelValue:g[B],"onUpdate:modelValue":N=>g[B]=N,schema:g,"ref-key":`${v}-${B}`,ref_for:!0,ref_key:"dynamicRefs",ref:o},null,8,["modelValue","onUpdate:modelValue","schema","ref-key"]))]),_:2},1032,["size","size-sm","size-md","size-lg","size-xl"])):e.createCommentVNode("",!0)],64)}),256))]),_:2},1024)]),e.createElementVNode("div",he,[v===t.value.length-1?(e.openBlock(),e.createBlock(e.unref(y.IonButton),{key:0,onClick:d,color:"primary"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.IonIcon),{slot:"icon-only",icon:e.unref(S.add)},null,8,["icon"])]),_:1})):e.createCommentVNode("",!0),t.value.length>1?(e.openBlock(),e.createBlock(e.unref(y.IonButton),{key:1,onClick:B=>s(v),color:"warning"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.IonIcon),{slot:"icon-only",icon:e.unref(S.remove)},null,8,["icon"])]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)])]))),128))}}),ge=K(ye,[["__scopeId","data-v-402695fe"]]),ke=e.defineComponent({__name:"CheckboxInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const l=n,t=e.useModel(n,"modelValue"),o=e.ref(null),a=e.ref(t.value.value),i=e.computed(()=>l.schema),c=e.computed(()=>P(t.value)),{onValueUpdate:p,onFocus:d,getErrors:s}=M(o,t,a,i);function f(){a.value=!1,t.value.error="",t.value.value=!1}return e.watch(()=>t.value.value,u=>a.value=u),r({onValueUpdate:p,onReset:f,getErrors:s}),(u,m)=>(e.openBlock(),e.createBlock(e.unref(y.IonCheckbox),{modelValue:a.value,"onUpdate:modelValue":m[0]||(m[0]=V=>a.value=V),ref_key:"inputRef",ref:o,required:t.value.required,"error-text":t.value.error,disabled:t.value.disabled,onIonFocus:e.unref(d),onIonChange:e.unref(p),onIonBlur:e.unref(p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["modelValue","required","error-text","disabled","onIonFocus","onIonChange","onIonBlur"]))}}),Ve=e.defineComponent({__name:"RadioInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const l=n,t=e.useModel(n,"modelValue"),o=e.ref(null),a=e.ref(t.value.value),i=e.computed(()=>l.schema),c=e.ref([]),p=e.computed(()=>P(t.value)),{onValueUpdate:d,onFocus:s,getErrors:f}=M(o,t,a,i);function u(){t.value.error="",a.value=void 0,t.value.value=void 0}function m(k,g){return k.value===g.value}async function V(){typeof t.value.options=="function"?c.value=await t.value.options():c.value=t.value.options}return e.watch(()=>t.value.value,k=>a.value=k),r({onValueUpdate:d,onReset:u,getErrors:f}),e.onMounted(V),(k,g)=>(e.openBlock(),e.createBlock(e.unref(y.IonRadioGroup),{modelValue:a.value,"onUpdate:modelValue":g[0]||(g[0]=v=>a.value=v),ref_key:"inputRef",ref:o,required:t.value.required,"helper-text":p.value,"error-text":t.value.error,disabled:t.value.disabled,compareWith:m,"allow-empty-selection":!t.value.required,onIonFocus:e.unref(s),onIonChange:e.unref(d),onIonBlur:e.unref(d)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,v=>(e.openBlock(),e.createBlock(e.unref(y.IonRadio),{key:v.value,value:v,disabled:t.value.disabled,"label-placement":"end",justify:"start"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v.label),1)]),_:2},1032,["value","disabled"]))),128))]),_:1},8,["modelValue","required","helper-text","error-text","disabled","allow-empty-selection","onIonFocus","onIonChange","onIonBlur"]))}}),W={install(n){n.component("VForm",le),n.component("TextInput",ue),n.component("DateInput",se),n.component("NumberInput",ce),n.component("EmailInput",ie),n.component("PasswordInput",de),n.component("SelectInput",pe),n.component("TextAreaInput",me),n.component("RepeatInput",ge),n.component("CheckboxInput",ke),n.component("RadioInput",Ve),n.directive("maskito",Q.maskito)}};exports.VForm=W;exports.default=W;exports.useDataTransformation=G;exports.useDependentOptions=H;exports.useFormValidation=$;exports.useInputValidation=M;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("@ionic/vue"),q=require("ionicons/icons"),Q=require("@maskito/vue");function X(n){return new Promise(r=>{requestAnimationFrame(async()=>{const a=await n.getInputElement();r(a)})})}const Y={d:/\d/,a:/[A-Za-z]/,"*":/[A-Za-z0-9]/},ee={d:["1","2","3","4","5","6","7","8","9","0"],a:["A","B","C","x","y","z","D","f"],"*":["A","3","b","8","z","4","D","0"]};function te(n,r){const a=ee[n];return a[r%a.length]}function ne(n){const r=[];let a="",t=0,l=0;for(;t<n.length;){const o=n[t];if(["d","a","*"].includes(o)){let i=1;if(n[t+1]==="{"){const c=n.indexOf("}",t+2);if(c!==-1){const h=n.slice(t+2,c);if(h.includes(",")){const[,d]=h.split(",").map(s=>parseInt(s.trim()));i=d||parseInt(h.split(",")[0])}else i=parseInt(h);t=c}}else{let c=t+1;for(;n[c]===o;)i++,c++;t=c-1}for(let c=0;c<i;c++)r.push(Y[o]),a+=te(o,l++)}else r.push(o),a+=o;t++}return{mask:r,placeholder:a,elementPredicate:X}}function L(n){return n==null||Array.isArray(n)&&!n.length||typeof n=="object"&&!Object.keys(n).length||!n}function U(n,r,a){return typeof n.condition=="function"?n.condition(r,a):!0}function D(n){if(typeof n!="object"||n===null)return n;if(Array.isArray(n))return n.map(a=>D(a));const r={};return Object.entries(n).forEach(([a,t])=>{typeof t=="function"?r[a]=t.bind(r):r[a]=D(t)}),r}function G(n,r){return r.findIndex(a=>a.value===n.value||a.label===n.label||a.value===n.label||a.label===n.value)}function _(n,r){const a=G(n,r);a>=0?r[a].isChecked=!0:r.push({...n,isChecked:!0})}function P(n,r){const a=G(n,r);a>=0&&(r[a].isChecked=!1)}function le(n){n.forEach(r=>{r.isChecked=!1})}function oe(n,r){return r?n.filter(a=>JSON.stringify(a).toLowerCase().includes(r.toLowerCase())):n}function H(n){const r=n.label||"",a=n.required?" *":"";return r+a}function S(n,r){if(n===r)return!0;if(n==null||r==null||typeof n!=typeof r)return!1;if(typeof n!="object")return n===r;if(Array.isArray(n)&&Array.isArray(r))return n.length!==r.length?!1:n.every((l,o)=>S(l,r[o]));if(Array.isArray(n)!==Array.isArray(r))return!1;const a=Object.keys(n),t=Object.keys(r);return a.length!==t.length?!1:a.every(l=>Object.prototype.hasOwnProperty.call(r,l)&&S(n[l],r[l]))}function z(){const n=e.ref([]);async function r(){console.debug("Validating form inputs");const o=[];for(const i of n.value)if(typeof(i==null?void 0:i.onValueUpdate)=="function"&&await i.onValueUpdate(),typeof(i==null?void 0:i.getErrors)=="function")try{const c=i.getErrors();Array.isArray(c)?o.push(...c):console.warn("getErrors() returned non-array value:",c)}catch(c){console.error("Error calling getErrors on component:",c,i)}else console.warn("Component does not have getErrors function:",i);return o.every(L)}function a(){n.value.forEach(o=>{typeof(o==null?void 0:o.onReset)=="function"&&o.onReset()})}function t(){const o=[];for(const i of n.value)if(typeof(i==null?void 0:i.getErrors)=="function")try{const c=i.getErrors();Array.isArray(c)?o.push(...c):o.push(String(c))}catch(c){console.error("Error calling getErrors on component:",c,i)}return o}async function l(){for(const o of n.value)typeof(o==null?void 0:o.onValueUpdate)=="function"&&await o.onValueUpdate()}return{dynamicRefs:n,isFormValid:r,resetForm:a,getFormErrors:t,updateFormValues:l}}function K(n){const r=e.computed(()=>Object.entries(n.value).reduce((d,[s,f])=>(f.value!==void 0&&(typeof f.onChange=="function"?d[s]=f.onChange(f.value,n.value):d[s]=f.value),d),{})),a=e.ref({}),t=(d,s,f)=>{var u;return typeof((u=n.value[d].children[s])==null?void 0:u.computedValue)=="function"?n.value[d].children[s].computedValue(f,n.value):f},l=(d,s,f,u)=>{a.value[d][u]||(a.value[d][u]={}),Object.entries(s.other??{}).forEach(([m,v])=>{var p;!S(v,(p=f.other)==null?void 0:p[m])&&(a.value[d][u][m]=t(d,m,v))})},o=(d,s,f)=>{s.forEach((u,m)=>{const v=f[m]??{other:{}};l(d,u,v,m)})},i=(d,{other:s})=>Object.entries(s??{}).reduce((f,[u,m])=>(f[u]=t(d,u,m),f),{}),c=(d,s,f)=>{a.value[d]||(a.value[d]=[]);const u=s;Array.isArray(f[d])?o(d,u,f[d]):a.value[d]=u.map(m=>i(d,m))},h=(d,s,f)=>{if(!s){delete a.value[d];return}const u=n.value[d];u.children!==void 0?c(d,s,f):typeof u.computedValue=="function"&&(a.value[d]=u.computedValue(s,n.value))};return e.watch(r,(d,s={})=>{Object.keys(d).forEach(f=>{S(d[f],s[f])||h(f,d[f],s)}),Object.keys(s).forEach(f=>{!(f in d)&&f in a.value&&delete a.value[f]})},{immediate:!0,deep:!0}),{formData:r,computedData:a}}const ae=e.defineComponent({__name:"vForm",props:{schema:{},showLabels:{type:Boolean,default:!0},showClearButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},buttonPlacement:{default:"start"},submitButtonText:{default:"Submit"},clearButtonText:{default:"Reset"},cancelButtonText:{default:"Cancel"},hideButtons:{type:Boolean,default:!1},customButtons:{}},emits:["submit","clear","cancel"],setup(n,{expose:r,emit:a}){const t=n,l=a,o=e.ref(t.schema),{dynamicRefs:i,isFormValid:c,resetForm:h}=z(),{formData:d,computedData:s}=K(o);async function f(){await c()&&l("submit",d.value,s.value)}function u(){h(),l("clear")}function m(){h(),l("cancel")}return e.watch(d,async()=>{for(const[v,V]of Object.entries(o.value))U(V,d.value,s.value)||(V.value=t.schema[v].value)},{deep:!0,immediate:!0}),e.watch(()=>t.schema,v=>{for(const[V,p]of Object.entries(v))p.value!==void 0&&(o.value[V].value=p.value)},{deep:!0,immediate:!0}),r({resetForm:h,isFormValid:c,resolveData:()=>({formData:d.value,computedData:s.value})}),(v,V)=>(e.openBlock(),e.createBlock(e.unref(y.IonGrid),null,{default:e.withCtx(()=>[e.createVNode(e.unref(y.IonRow),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(o.value),p=>{var x,B,w,E,I;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(U)(o.value[p],e.unref(d),e.unref(s))?(e.openBlock(),e.createBlock(e.unref(y.IonCol),{key:p,size:((x=o.value[p].grid)==null?void 0:x.xs)??"12","size-sm":(B=o.value[p].grid)==null?void 0:B.sm,"size-md":(w=o.value[p].grid)==null?void 0:w.md,"size-lg":(E=o.value[p].grid)==null?void 0:E.lg,"size-xl":(I=o.value[p].grid)==null?void 0:I.xl,class:"ion-margin-vertical"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value[p].type),{modelValue:o.value[p],"onUpdate:modelValue":N=>o.value[p]=N,schema:o.value,"form-id":p,ref_for:!0,ref_key:"dynamicRefs",ref:i,"ref-key":p},null,8,["modelValue","onUpdate:modelValue","schema","form-id","ref-key"]))]),_:2},1032,["size","size-sm","size-md","size-lg","size-xl"])):e.createCommentVNode("",!0)],64)}),256))]),_:1}),v.hideButtons?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(y.IonRow),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(y.IonCol),{size:"12",style:e.normalizeStyle([{display:"flex"},{justifyContent:v.buttonPlacement}])},{default:e.withCtx(()=>[v.showCancelButton?(e.openBlock(),e.createBlock(e.unref(y.IonButton),{key:0,onClick:m},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v.cancelButtonText??"Cancel"),1)]),_:1})):e.createCommentVNode("",!0),v.showClearButton?(e.openBlock(),e.createBlock(e.unref(y.IonButton),{key:1,onClick:u},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v.clearButtonText??"Reset"),1)]),_:1})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.customButtons,p=>(e.openBlock(),e.createBlock(e.unref(y.IonButton),{key:p.label,onClick:p.action,color:p.color??"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),_:2},1032,["onClick","color"]))),128)),e.createVNode(e.unref(y.IonButton),{onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v.submitButtonText??"Submit"),1)]),_:1})]),_:1},8,["style"])]),_:1}))]),_:1}))}});function re(n){return{applyValidationState:async t=>{var l,o,i,c,h;(l=n.value)==null||l.$el.classList.remove("ion-invalid"),(o=n.value)==null||o.$el.classList.remove("ion-valid"),t?(i=n.value)==null||i.$el.classList.add("ion-valid"):(c=n.value)==null||c.$el.classList.add("ion-invalid"),(h=n.value)==null||h.$el.classList.add("ion-touched")},resetValidationState:()=>{var t,l;(t=n.value)==null||t.$el.classList.remove("ion-touched"),(l=n.value)==null||l.$el.classList.remove("ion-invalid")}}}function A(n,r,a,t,l){const{applyValidationState:o,resetValidationState:i}=re(n);async function c(){if(r.value.required&&!a.value)return r.value.error="This field is required",!1;if(l){const u=await l(a.value);if(typeof u=="string")return r.value.error=u,!1;if(u===!1)return!1}if(r.value.validation){const u=await r.value.validation(a.value,t==null?void 0:t.value);if(u&&u.length)return r.value.error=u.join(),!1}return!0}async function h(){const u=await c();u&&(r.value.error="",r.value.value=a.value),await o(u)}function d(){i(),r.value.error=""}function s(u=""){a.value=u,r.value.error="",r.value.value=u}function f(){return r.value.error?[r.value.error]:[]}return{isValid:c,onValueUpdate:h,onFocus:d,onReset:s,getErrors:f,applyValidationState:o,resetValidationState:i}}function ue(n){const r=e.computed(()=>!!n.value.label),a=e.computed(()=>!!n.value.required),t=e.computed(()=>n.value.label||"");return{showLabel:r,showRequired:a,labelText:t}}const $=e.defineComponent({__name:"InputLabel",props:{model:{}},setup(n){const r=n,{showLabel:a,showRequired:t,labelText:l}=ue(e.toRef(r,"model"));return(o,i)=>e.unref(a)?(e.openBlock(),e.createBlock(e.unref(y.IonLabel),{key:0,slot:"label",class:"input-label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l))+" ",1),e.unref(t)?(e.openBlock(),e.createBlock(e.unref(y.IonText),{key:0,color:"danger"},{default:e.withCtx(()=>i[0]||(i[0]=[e.createTextVNode("*")])),_:1,__:[0]})):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0)}}),M=e.defineComponent({__name:"BaseInput",props:e.mergeModels({schema:{},type:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const a=n,t=e.useModel(n,"modelValue"),l=e.ref(null),o=e.ref(t.value.value),i=e.computed(()=>a.schema),{isValid:c,onValueUpdate:h,onFocus:d,onReset:s,getErrors:f}=A(l,t,o,i),u=e.computed(()=>{if(t.value.pattern)return ne(t.value.pattern)});return e.watch(()=>t.value.value,m=>o.value=m),r({onValueUpdate:h,onReset:s,getErrors:f,isValid:c}),(m,v)=>{var p;const V=e.resolveDirective("maskito");return e.withDirectives((e.openBlock(),e.createBlock(e.unref(y.IonInput),{ref_key:"inputRef",ref:l,modelValue:o.value,"onUpdate:modelValue":v[0]||(v[0]=x=>o.value=x),"clear-input":!0,fill:t.value.fill??"solid","label-placement":t.value.labelPlacement??"stacked",type:m.type??"text",required:t.value.required,"error-text":t.value.error,autofocus:t.value.autoFocus,placeholder:((p=u.value)==null?void 0:p.placeholder)??t.value.placeholder,disabled:t.value.disabled,counter:t.value.counter,min:t.value.min,max:t.value.max,"max-length":t.value.maxLength,"min-length":t.value.minLength,pattern:t.value.pattern,onIonFocus:e.unref(d),onIonChange:e.unref(h),onIonBlur:e.unref(h)},{default:e.withCtx(()=>[e.createVNode($,{model:t.value},null,8,["model"]),t.value.prefix?(e.openBlock(),e.createBlock(e.unref(y.IonLabel),{key:0,slot:"start"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.value.prefix),1)]),_:1})):e.createCommentVNode("",!0),t.value.suffix?(e.openBlock(),e.createBlock(e.unref(y.IonLabel),{key:1,slot:"end"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.value.suffix),1)]),_:1})):e.createCommentVNode("",!0),m.type==="password"?(e.openBlock(),e.createBlock(e.unref(y.IonInputPasswordToggle),{key:2,slot:"end"})):e.createCommentVNode("",!0)]),_:1},8,["modelValue","fill","label-placement","type","required","error-text","autofocus","placeholder","disabled","counter","min","max","max-length","min-length","pattern","onIonFocus","onIonChange","onIonBlur"])),[[V,u.value]])}}}),se=e.defineComponent({__name:"TextInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const a=e.useModel(n,"modelValue"),t=e.ref(null);return r({onReset:()=>{var l;return(l=t.value)==null?void 0:l.onReset()},onValueUpdate:()=>{var l;return(l=t.value)==null?void 0:l.onValueUpdate()},getErrors:()=>{var l,o;return((o=(l=t.value)==null?void 0:l.getErrors)==null?void 0:o.call(l))??[]}}),(l,o)=>(e.openBlock(),e.createBlock(M,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),type:"text",schema:l.schema,ref_key:"inputRef",ref:t},null,8,["modelValue","schema"]))}}),ce=e.defineComponent({__name:"DateInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const a=e.useModel(n,"modelValue"),t=e.ref(null);return r({onValueUpdate:()=>{var l;return(l=t.value)==null?void 0:l.onValueUpdate()},onReset:()=>{var l;return(l=t.value)==null?void 0:l.onReset()},getErrors:()=>{var l,o;return((o=(l=t.value)==null?void 0:l.getErrors)==null?void 0:o.call(l))??[]}}),(l,o)=>(e.openBlock(),e.createBlock(M,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),type:a.value.enableTime?"datetime-local":"date",schema:l.schema,ref_key:"inputRef",ref:t},null,8,["modelValue","type","schema"]))}}),ie=e.defineComponent({__name:"NumberInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const a=e.useModel(n,"modelValue"),t=e.ref(null);return r({onReset:()=>{var l;return(l=t.value)==null?void 0:l.onReset()},onValueUpdate:()=>{var l;return(l=t.value)==null?void 0:l.onValueUpdate()},getErrors:()=>{var l,o;return((o=(l=t.value)==null?void 0:l.getErrors)==null?void 0:o.call(l))??[]}}),(l,o)=>(e.openBlock(),e.createBlock(M,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),type:"number",schema:l.schema,ref_key:"inputRef",ref:t},null,8,["modelValue","schema"]))}}),de=e.defineComponent({__name:"EmailInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const a=e.useModel(n,"modelValue"),t=e.ref(null);return r({onReset:()=>{var l;return(l=t.value)==null?void 0:l.onReset()},onValueUpdate:()=>{var l;return(l=t.value)==null?void 0:l.onValueUpdate()},getErrors:()=>{var l,o;return((o=(l=t.value)==null?void 0:l.getErrors)==null?void 0:o.call(l))??[]}}),(l,o)=>(e.openBlock(),e.createBlock(M,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),type:"email",schema:l.schema,ref_key:"inputRef",ref:t},null,8,["modelValue","schema"]))}}),fe=e.defineComponent({__name:"PasswordInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const a=e.useModel(n,"modelValue"),t=e.ref(null);return r({onReset:()=>{var l;return(l=t.value)==null?void 0:l.onReset()},onValueUpdate:()=>{var l;return(l=t.value)==null?void 0:l.onValueUpdate()},getErrors:()=>{var l,o;return((o=(l=t.value)==null?void 0:l.getErrors)==null?void 0:o.call(l))??[]}}),(l,o)=>(e.openBlock(),e.createBlock(M,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),type:"password",schema:l.schema,ref_key:"inputRef",ref:t},null,8,["modelValue","schema"]))}}),pe=e.defineComponent({__name:"SelectInput",props:e.mergeModels({schema:Object,type:String,formId:String},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const a=n,t=e.useModel(n,"modelValue"),l=e.ref(null),o=e.ref(null),i=e.ref(!1),c=e.ref([]),h=e.ref(""),d=e.ref(1),s=e.computed(()=>t.value.interface??"popover"),f=e.computed(()=>t.value.optionsPlacement==="top"?"top":"bottom"),u=e.computed(()=>c.value.filter(k=>!!k.isChecked)),m=e.computed(()=>!h.value&&L(u.value)&&!i.value?t.value.placeholder??"Select an option":"");e.watch([h,()=>t.value.options],R,{immediate:!0,deep:!0}),e.watch(()=>t.value.value,J,{immediate:!0,deep:!0}),e.watch(()=>!t.value.dependsOn||!a.schema?null:(Array.isArray(t.value.dependsOn)?t.value.dependsOn:[t.value.dependsOn]).map(g=>{var C;return(C=a.schema[g])==null?void 0:C.value}),async(k,g)=>{k&&g&&!S(k,g)&&(v(),c.value=[],await R())},{deep:!0});function v(){t.value.error="",h.value="",d.value=1,t.value.value=t.value.multiple?[]:"",le(c.value)}function V(k){if(k.isChecked)return P(k,c.value);t.value.multiple?_(k,c.value):(v(),_(k,c.value),O()),h.value=""}function p(){switch(s.value){case"action-sheet":x();break;case"alert":B();break;case"popover":default:i.value=!0;break}}async function x(){if(await R(),t.value.multiple){i.value=!0;return}await(await y.actionSheetController.create({header:t.value.label||"Select an option",buttons:[...c.value.map(g=>({text:g.label,cssClass:g.isChecked?"selected-option":"",handler:()=>(V(g),!1)})),{text:"Cancel",role:"cancel"}]})).present()}async function B(){await R();const k=c.value.map(C=>({label:C.label,type:t.value.multiple?"checkbox":"radio",value:C,checked:C.isChecked}));await(await y.alertController.create({header:t.value.label||"Select an option",inputs:k,buttons:[{text:"Cancel",role:"cancel"},{text:"OK",handler:C=>{if(t.value.multiple)c.value.forEach(b=>P(b,c.value)),C.forEach(b=>{const F=c.value.find(T=>T.value===b.value);F&&_(F,c.value)});else{v();const b=c.value.find(F=>F.value===C.value);b&&_(b,c.value)}O()}}]})).present()}async function w(){if(t.value.required&&L(u.value))return"This field is required";if(t.value.validation){const k=await t.value.validation(u.value,a==null?void 0:a.schema);if(k&&k.length)return k.join()}return!0}const{onFocus:E,applyValidationState:I}=A(l,t,e.computed(()=>t.value.multiple?u.value:u.value[0]),e.computed(()=>a==null?void 0:a.schema),w);function N(k){var g;k.target===((g=l.value)==null?void 0:g.$el)&&(E(),s.value==="popover"&&(i.value=!0))}async function O(k){var C;if((C=k==null?void 0:k.relatedTarget)!=null&&C.closest(".suggestions-list"))return;i.value=!1;const g=await w();g===!0?(t.value.error="",t.value.value=t.value.multiple?u.value:u.value[0]):t.value.error=typeof g=="string"?g:"Validation failed",await I(g===!0)}async function R(){const k=[];if(typeof t.value.options=="function"){let g={};t.value.dependsOn&&a.schema&&(g=(Array.isArray(t.value.dependsOn)?t.value.dependsOn:[t.value.dependsOn]).reduce((F,T)=>{var j;return F[T]=(j=a.schema[T])==null?void 0:j.value,F},{}));const C=await t.value.options(h.value,g);k.push(...C.filter(b=>!!b.label))}else Array.isArray(t.value.options)&&k.push(...oe(t.value.options,h.value));u.value.forEach(g=>_(g,k)),c.value=k}function J(){const k=t.value.value;k&&(Array.isArray(k)?k.forEach(g=>_(g,c.value)):_(typeof k=="object"?k:{value:k,label:k},c.value))}return e.onMounted(()=>{R()}),r({onValueUpdate:O,onReset:v,getErrors:()=>t.value.error?[t.value.error]:[]}),(k,g)=>(e.openBlock(),e.createElementBlock("div",{class:"autocomplete-container",onFocusout:O,ref_key:"containerRef",ref:o},[e.createVNode(e.unref(y.IonInput),{ref_key:"inputRef",ref:l,modelValue:h.value,"onUpdate:modelValue":g[0]||(g[0]=C=>h.value=C),fill:t.value.fill??"solid","label-placement":t.value.labelPlacement??"stacked",type:n.type??"text",required:t.value.required,"error-text":t.value.error,autofocus:t.value.autoFocus,placeholder:m.value,disabled:t.value.disabled,counter:t.value.counter,onIonFocus:N,debounce:300,onClick:p},{default:e.withCtx(()=>[e.createVNode($,{model:t.value},null,8,["model"]),t.value.multiple?(e.openBlock(),e.createBlock(e.unref(y.IonLabel),{key:0,style:{width:"fit-content"},slot:"start"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(C,b)=>(e.openBlock(),e.createBlock(e.unref(y.IonChip),{key:b},{default:e.withCtx(()=>[e.createVNode(e.unref(y.IonLabel),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.label),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})):(e.openBlock(),e.createBlock(e.unref(y.IonLabel),{key:1,slot:"start",class:"ion-no-wrap"},{default:e.withCtx(()=>{var C;return[e.createTextVNode(e.toDisplayString(((C=u.value[0])==null?void 0:C.label)??""),1)]}),_:1})),e.createVNode(e.unref(y.IonIcon),{slot:"end",icon:e.unref(q.chevronDown)},null,8,["icon"]),u.value.length>0||h.value?(e.openBlock(),e.createBlock(e.unref(y.IonIcon),{key:2,slot:"end",icon:e.unref(q.close),onClick:v,style:{"z-index":"999999"}},null,8,["icon"])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","fill","label-placement","type","required","error-text","autofocus","placeholder","disabled","counter"]),i.value&&c.value.length>0&&s.value==="popover"?(e.openBlock(),e.createBlock(e.unref(y.IonList),{key:0,class:e.normalizeClass(["suggestions-list",f.value])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,C=>(e.openBlock(),e.createBlock(e.unref(y.IonItem),{button:"",key:C.label,onClick:b=>V(C)},{default:e.withCtx(()=>[t.value.multiple?(e.openBlock(),e.createBlock(e.unref(y.IonCheckbox),{key:0,slot:"start",checked:C.isChecked},null,8,["checked"])):e.createCommentVNode("",!0),e.createVNode(e.unref(y.IonLabel),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.label),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1},8,["class"])):e.createCommentVNode("",!0)],544))}}),W=(n,r)=>{const a=n.__vccOpts||n;for(const[t,l]of r)a[t]=l;return a},me=W(pe,[["__scopeId","data-v-4766dec2"]]),ve=e.defineComponent({__name:"TextAreaInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const a=n,t=e.useModel(n,"modelValue"),l=e.ref(null),o=e.ref(t.value.value),i=e.computed(()=>a.schema),{onValueUpdate:c,onFocus:h,onReset:d,getErrors:s}=A(l,t,o,i);return e.watch(()=>t.value.value,f=>o.value=f),r({onReset:d,onValueUpdate:c,getErrors:s}),(f,u)=>(e.openBlock(),e.createBlock(e.unref(y.IonTextarea),{ref_key:"inputRef",ref:l,modelValue:o.value,"onUpdate:modelValue":u[0]||(u[0]=m=>o.value=m),"clear-input":!0,fill:t.value.fill??"solid","label-placement":t.value.labelPlacement??"stacked",required:t.value.required,"error-text":t.value.error,autofocus:t.value.autoFocus,placeholder:t.value.placeholder,disabled:t.value.disabled,counter:t.value.counter,min:t.value.min,max:t.value.max,rows:t.value.rows,cols:t.value.cols,"auto-grow":t.value.autoGrow,"max-length":t.value.maxLength,"min-length":t.value.minLength,pattern:t.value.pattern,onIonFocus:e.unref(h),onIonChange:e.unref(c),onIonBlur:e.unref(c)},{default:e.withCtx(()=>[e.createVNode($,{model:t.value},null,8,["model"])]),_:1},8,["modelValue","fill","label-placement","required","error-text","autofocus","placeholder","disabled","counter","min","max","rows","cols","auto-grow","max-length","min-length","pattern","onIonFocus","onIonChange","onIonBlur"]))}}),he={class:"ion-margin-end",style:{"flex-grow":"1"}},ye={style:{display:"flex","justify-content":"flex-end"}},ke=e.defineComponent({__name:"RepeatInput",props:e.mergeModels({schema:{},data:{},computedData:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const a=e.useModel(n,"modelValue"),t=e.ref([]),{dynamicRefs:l,resetForm:o,getFormErrors:i,updateFormValues:c}=z(),h=e.computed(()=>t.value.map((v,V)=>({label:`Set ${V+1}`,value:V,other:Object.entries(v).reduce((p,[x,B])=>(p[x]=B.value,p),{})})));e.watch(h,v=>{a.value.value=v},{deep:!0,immediate:!0}),e.onMounted(d);function d(){a.value.children&&t.value.push(D(a.value.children))}function s(v){t.value.splice(v,1)}function f(){o()}function u(){return i()}async function m(){await c()}return r({onValueUpdate:m,onReset:f,getErrors:u}),(v,V)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(p,x)=>(e.openBlock(),e.createElementBlock("div",{class:"repeat-input-wrapper",key:x},[e.createElementVNode("div",he,[e.createVNode(e.unref(y.IonRow),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(p),B=>{var w,E,I,N,O;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(U)(p[B],v.data,v.computedData)?(e.openBlock(),e.createBlock(e.unref(y.IonCol),{key:`${x}-${B}`,size:((w=p[B].grid)==null?void 0:w.xs)??"12","size-sm":(E=p[B].grid)==null?void 0:E.sm,"size-md":(I=p[B].grid)==null?void 0:I.md,"size-lg":(N=p[B].grid)==null?void 0:N.lg,"size-xl":(O=p[B].grid)==null?void 0:O.xl,class:"ion-margin-bottom"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p[B].type),{modelValue:p[B],"onUpdate:modelValue":R=>p[B]=R,schema:p,"ref-key":`${x}-${B}`,ref_for:!0,ref_key:"dynamicRefs",ref:l},null,8,["modelValue","onUpdate:modelValue","schema","ref-key"]))]),_:2},1032,["size","size-sm","size-md","size-lg","size-xl"])):e.createCommentVNode("",!0)],64)}),256))]),_:2},1024)]),e.createElementVNode("div",ye,[x===t.value.length-1?(e.openBlock(),e.createBlock(e.unref(y.IonButton),{key:0,onClick:d,color:"primary"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.IonIcon),{slot:"icon-only",icon:e.unref(q.add)},null,8,["icon"])]),_:1})):e.createCommentVNode("",!0),t.value.length>1?(e.openBlock(),e.createBlock(e.unref(y.IonButton),{key:1,onClick:B=>s(x),color:"warning"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.IonIcon),{slot:"icon-only",icon:e.unref(q.remove)},null,8,["icon"])]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)])]))),128))}}),Ve=W(ke,[["__scopeId","data-v-060bdf58"]]),ge=e.defineComponent({__name:"CheckboxInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const a=n,t=e.useModel(n,"modelValue"),l=e.ref(null),o=e.ref(t.value.value),i=e.computed(()=>a.schema),c=e.computed(()=>H(t.value)),{onValueUpdate:h,onFocus:d,getErrors:s}=A(l,t,o,i);function f(){o.value=!1,t.value.error="",t.value.value=!1}return e.watch(()=>t.value.value,u=>o.value=u),r({onValueUpdate:h,onReset:f,getErrors:s}),(u,m)=>(e.openBlock(),e.createBlock(e.unref(y.IonCheckbox),{modelValue:o.value,"onUpdate:modelValue":m[0]||(m[0]=v=>o.value=v),ref_key:"inputRef",ref:l,required:t.value.required,"error-text":t.value.error,disabled:t.value.disabled,onIonFocus:e.unref(d),onIonChange:e.unref(h),onIonBlur:e.unref(h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1},8,["modelValue","required","error-text","disabled","onIonFocus","onIonChange","onIonBlur"]))}}),Ce=e.defineComponent({__name:"RadioInput",props:e.mergeModels({schema:{}},{modelValue:{type:Object,default:{}},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const a=n,t=e.useModel(n,"modelValue"),l=e.ref(null),o=e.ref(t.value.value),i=e.computed(()=>a.schema),c=e.ref([]),h=e.computed(()=>H(t.value)),{onValueUpdate:d,onFocus:s,getErrors:f}=A(l,t,o,i);function u(){t.value.error="",o.value=void 0,t.value.value=void 0}function m(V,p){return V.value===p.value}async function v(){typeof t.value.options=="function"?c.value=await t.value.options():c.value=t.value.options}return e.watch(()=>t.value.value,V=>o.value=V),r({onValueUpdate:d,onReset:u,getErrors:f}),e.onMounted(v),(V,p)=>(e.openBlock(),e.createBlock(e.unref(y.IonRadioGroup),{modelValue:o.value,"onUpdate:modelValue":p[0]||(p[0]=x=>o.value=x),ref_key:"inputRef",ref:l,required:t.value.required,"helper-text":h.value,"error-text":t.value.error,disabled:t.value.disabled,compareWith:m,"allow-empty-selection":!t.value.required,onIonFocus:e.unref(s),onIonChange:e.unref(d),onIonBlur:e.unref(d)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,x=>(e.openBlock(),e.createBlock(e.unref(y.IonRadio),{key:x.value,value:x,disabled:t.value.disabled,"label-placement":"end",justify:"start"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.label),1)]),_:2},1032,["value","disabled"]))),128))]),_:1},8,["modelValue","required","helper-text","error-text","disabled","allow-empty-selection","onIonFocus","onIonChange","onIonBlur"]))}});function xe(n,r,a){const t=e.ref({}),l=e.ref({});function o(s,f,u){l.value[s]=u,f.forEach(m=>{var v;(v=t.value)[m]??(v[m]=[]),t.value[m].includes(s)||t.value[m].push(s)}),d(s)}function i(s){return Object.entries(t.value).filter(([,u])=>u.includes(s)).map(([u])=>u).reduce((u,m)=>(u[m]=r.value[m]??a.value[m],u),{})}function c(s,f){return s?Array.isArray(s)?s.some(u=>f.some(m=>h(u,m.value))):f.some(u=>h(s,u.value)):!1}function h(s,f){return typeof s=="object"&&s!==null?s.value===f:String(s)===String(f)}async function d(s,f){if(!l.value[s])return;const u=i(s),m=Object.keys(u);if(!(m.length===0||!m.every(V=>u[V]!==void 0&&u[V]!==null)))try{const V=l.value[s],p=await V(f,u);if(!n.value[s])return;n.value[s].options=p;const x=n.value[s].value;if(!x)return;c(x,p)||(n.value[s].value=n.value[s].multiple?[]:"")}catch(V){console.error(`Error loading options for ${s}:`,V)}}return e.watch([r,a],()=>{Object.entries(t.value).forEach(([s,f])=>{(r.value[s]!==void 0||a.value[s]!==void 0)&&f.forEach(u=>{d(u)})})},{deep:!0,immediate:!0}),{registerDependency:o,updateOptions:d}}const Z={install(n){n.component("VForm",ae),n.component("TextInput",se),n.component("DateInput",ce),n.component("NumberInput",ie),n.component("EmailInput",de),n.component("PasswordInput",fe),n.component("SelectInput",me),n.component("TextAreaInput",ve),n.component("RepeatInput",Ve),n.component("CheckboxInput",ge),n.component("RadioInput",Ce),n.directive("maskito",Q.maskito)}};exports.VForm=Z;exports.default=Z;exports.useDataTransformation=K;exports.useDependentOptions=xe;exports.useFormValidation=z;exports.useInputValidation=A;
2
2
  //# sourceMappingURL=index.cjs.js.map