vue3-schema-forms 0.0.32 → 0.0.34
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.
- package/README.md +26 -5
- package/dist/components/controls/Location.vue.d.ts +4 -0
- package/dist/components/controls/Location.vue.d.ts.map +1 -0
- package/dist/components/controls/RadioButton.vue.d.ts +1 -1
- package/dist/components/controls/data-viewer/DataViewer.vue.d.ts +5 -0
- package/dist/components/controls/data-viewer/DataViewer.vue.d.ts.map +1 -0
- package/dist/components/controls/date/DatePicker.vue.d.ts +1 -1
- package/dist/components/controls/date/dayjs.d.ts +1 -1
- package/dist/components/controls/duplicated-section/DraggableContextMenu.vue.d.ts +1 -1
- package/dist/components/controls/duplicated-section/DraggableIcon.vue.d.ts +1 -1
- package/dist/components/controls/duplicated-section/DuplicatedSection.vue.d.ts +1 -1
- package/dist/components/controls/editable-section/EditableSection.vue.d.ts +1 -1
- package/dist/components/engine/validation/FormErrorVisualization.vue.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/core/composables/index.d.ts +13 -0
- package/dist/core/composables/useConditionalRendering.d.ts +1 -1
- package/dist/core/composables/useDictionarySource.d.ts +3 -2
- package/dist/core/composables/useFormModel.d.ts +5 -0
- package/dist/core/composables/useLocale.d.ts +3 -1
- package/dist/core/composables/useResolveVariables.d.ts +1 -1
- package/dist/core/composables/useRules.d.ts +1 -1
- package/dist/core/composables/useSource.d.ts +1 -1
- package/dist/core/engine/evalExprParser.d.ts +1 -1
- package/dist/core/engine/utils.d.ts +0 -3
- package/dist/main.cjs.js +55 -46
- package/dist/main.d.ts +8 -2
- package/dist/main.es.js +24850 -16499
- package/dist/main.umd.js +56 -47
- package/dist/style.css +1 -1
- package/dist/vocabulary/engine/controls.d.ts +11 -2
- package/dist/vocabulary/engine/formValidation.d.ts +1 -1
- package/dist/vocabulary/engine/index.d.ts +2 -2
- package/dist/vocabulary/schema/elements.d.ts +10 -3
- package/package.json +17 -15
package/README.md
CHANGED
|
@@ -8,9 +8,11 @@ Inspired by https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/
|
|
|
8
8
|
## Documentation
|
|
9
9
|
|
|
10
10
|
The documentation and some of the testing was based on the Storybook
|
|
11
|
-
application [live](https://maciejdybowski.github.io/vue3-schema-forms/)
|
|
11
|
+
application 👉 [live](https://maciejdybowski.github.io/vue3-schema-forms/)
|
|
12
12
|
|
|
13
|
-
Check the changelog here
|
|
13
|
+
Check the changelog here 👉 [@latest](https://maciejdybowski.github.io/vue3-schema-forms/?path=/docs/changelog--docs)
|
|
14
|
+
|
|
15
|
+
Sample app with schema forms configuration 👉 [here](https://github.com/MaciejDybowski/vue3-schema-forms-demo-app)
|
|
14
16
|
|
|
15
17
|
## Requirements
|
|
16
18
|
|
|
@@ -25,7 +27,7 @@ To relieve the library of dependencies as ```peerDependencies``` library takes:
|
|
|
25
27
|
* ```vuedraggable@4.1.0``` - support for drag&drop interaction
|
|
26
28
|
|
|
27
29
|
```bash
|
|
28
|
-
npm i vue vuetify axios dayjs pinia vue-
|
|
30
|
+
npm i vue@3.4.14 vuetify@3.4.10 axios@1.6.5 dayjs@1.11.10 pinia@2.1.7 vue-i18n@9 vuedraggable@next
|
|
29
31
|
```
|
|
30
32
|
|
|
31
33
|
## Installation
|
|
@@ -105,7 +107,7 @@ The following table shows the default values for each field
|
|
|
105
107
|
|
|
106
108
|
| Name | Default | Type | Description |
|
|
107
109
|
|--------------------|-------------------------------------------------------------------------|--------|-----------------------------------------------------------|
|
|
108
|
-
| digitsAfterDecimal |
|
|
110
|
+
| digitsAfterDecimal | 2 | number | Number of decimal places in the representation of numbers |
|
|
109
111
|
| fieldProps | - | object | Option to set props for each type of field |
|
|
110
112
|
| textFieldProps | ```{'hide-details': 'auto',}``` | object | Option to set props for text fields |
|
|
111
113
|
| textAreaProps | ```{"rows": 3, "hide-details": "auto", "auto-grow": true}``` | object | Option to set props for text-area fields |
|
|
@@ -126,6 +128,25 @@ The following table shows the default values for each field
|
|
|
126
128
|
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|----------------------------------------------------|----------------------------------------------------------------------------|
|
|
127
129
|
| v-phone-input | <pre>{<br> 'country-icon-mode': 'svg',<br> 'countryLabel': t('countryLabel'),<br> 'guess-country': true, <br> 'include-countries': ['pl', 'gb', 'ru', 'de', 'us', 'es', 'fr', 'it']<br>}</pre> | phone | International phone field for Vuetify 3 and Vue 3. | [source](https://github.com/paul-thebaud/v-phone-input?tab=readme-ov-file) |
|
|
128
130
|
|
|
131
|
+
## Plugin options
|
|
132
|
+
|
|
133
|
+
| Name | Default | Type | Description |
|
|
134
|
+
|------------------|---------|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
135
|
+
| formUpdateLogger | false | boolean | enabling this option allows the console to preview the form model update event |
|
|
136
|
+
| customComponents | - | Components | This option allows you to install your custom form fields. You need to specify the name and the component. The integration is on your side using the composables provided. |
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
// example of adding options
|
|
140
|
+
const customs = {
|
|
141
|
+
'user-input': UserInput,
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const vueSchemaForms = createVueSchemaForms({
|
|
145
|
+
customComponents: customs,
|
|
146
|
+
formUpdateLogger: true
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
129
150
|
## Tests
|
|
130
151
|
|
|
131
152
|
1. ```cd``` to the project directory
|
|
@@ -146,12 +167,12 @@ The following table shows the default values for each field
|
|
|
146
167
|
|
|
147
168
|
- [ ] Ability to add validation functions in schema
|
|
148
169
|
- [ ] Ability to mark "not-saveable" field in schema/model
|
|
149
|
-
- [ ] Phone input
|
|
150
170
|
- [ ] Email input
|
|
151
171
|
- [ ] Address input
|
|
152
172
|
- [ ] Markdown input
|
|
153
173
|
- [ ] File input
|
|
154
174
|
- [ ] Table input
|
|
175
|
+
- [ ] Rsql filter on dictionary
|
|
155
176
|
- [ ] Signal for form is ready (for autosave but after initial model changes)
|
|
156
177
|
- [ ] Create datetime field
|
|
157
178
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import _sfc_main from "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/Location.vue?vue&type=script&setup=true&lang.ts";
|
|
2
|
+
export * from "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/Location.vue?vue&type=script&setup=true&lang.ts";
|
|
3
|
+
export default _sfc_main;
|
|
4
|
+
//# sourceMappingURL=Location.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Location.vue.d.ts","sourceRoot":"","sources":["../../../src/components/controls/Location.vue"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,0HAA0H,CAAC;AACjJ,cAAc,0HAA0H,CAAC;AACzI,eAAe,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/RadioButton.vue?vue&type=script&setup=true&lang.ts";
|
|
2
|
-
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/RadioButton.vue?vue&type=style&index=0&scoped=
|
|
2
|
+
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/RadioButton.vue?vue&type=style&index=0&scoped=ed62c67b&lang.css";
|
|
3
3
|
declare const _default: any;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=RadioButton.vue.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/data-viewer/DataViewer.vue?vue&type=script&setup=true&lang.ts";
|
|
2
|
+
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/data-viewer/DataViewer.vue?vue&type=style&index=0&scoped=0c93975a&lang.scss";
|
|
3
|
+
declare const _default: any;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=DataViewer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataViewer.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/controls/data-viewer/DataViewer.vue"],"names":[],"mappings":"AACA,cAAc,wIAAwI,CAAC;AACvJ,OAAO,sJAAsJ,CAAC;;AAE9J,wBAA0F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/date/DatePicker.vue?vue&type=script&setup=true&lang.ts";
|
|
2
|
-
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/date/DatePicker.vue?vue&type=style&index=0&scoped=
|
|
2
|
+
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/date/DatePicker.vue?vue&type=style&index=0&scoped=1df7b549&lang.scss";
|
|
3
3
|
declare const _default: any;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=DatePicker.vue.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import dayjs from
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
2
|
export default dayjs;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/duplicated-section/DraggableContextMenu.vue?vue&type=script&setup=true&lang.ts";
|
|
2
|
-
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/duplicated-section/DraggableContextMenu.vue?vue&type=style&index=0&scoped=
|
|
2
|
+
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/duplicated-section/DraggableContextMenu.vue?vue&type=style&index=0&scoped=da998956&lang.scss";
|
|
3
3
|
declare const _default: any;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=DraggableContextMenu.vue.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/duplicated-section/DraggableIcon.vue?vue&type=script&setup=true&lang.ts";
|
|
2
|
-
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/duplicated-section/DraggableIcon.vue?vue&type=style&index=0&scoped=
|
|
2
|
+
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/duplicated-section/DraggableIcon.vue?vue&type=style&index=0&scoped=dfc82739&lang.css";
|
|
3
3
|
declare const _default: any;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=DraggableIcon.vue.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/duplicated-section/DuplicatedSection.vue?vue&type=script&setup=true&lang.ts";
|
|
2
|
-
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/duplicated-section/DuplicatedSection.vue?vue&type=style&index=0&scoped=
|
|
2
|
+
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/duplicated-section/DuplicatedSection.vue?vue&type=style&index=0&scoped=b7b5d087&lang.scss";
|
|
3
3
|
declare const _default: any;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=DuplicatedSection.vue.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/editable-section/EditableSection.vue?vue&type=script&setup=true&lang.ts";
|
|
2
|
-
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/editable-section/EditableSection.vue?vue&type=style&index=0&scoped=
|
|
2
|
+
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/controls/editable-section/EditableSection.vue?vue&type=style&index=0&scoped=b4f2f0eb&lang.css";
|
|
3
3
|
declare const _default: any;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=EditableSection.vue.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/engine/validation/FormErrorVisualization.vue?vue&type=script&setup=true&lang.ts";
|
|
2
|
-
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/engine/validation/FormErrorVisualization.vue?vue&type=style&index=0&scoped=
|
|
2
|
+
import "/Users/maciek/WebstormProjects/vue3-schema-forms/src/components/engine/validation/FormErrorVisualization.vue?vue&type=style&index=0&scoped=f55e8a3d&lang.scss";
|
|
3
3
|
declare const _default: any;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=FormErrorVisualization.vue.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { useCalculation } from "./useCalculation";
|
|
2
|
+
export { useClass } from "./useClass";
|
|
3
|
+
export { useConditionalRendering } from "./useConditionalRendering";
|
|
4
|
+
export { useDictionarySource } from "./useDictionarySource";
|
|
5
|
+
export { useFormattedNumber } from "./useFormattedNumber";
|
|
6
|
+
export { useLabel } from "./useLabel";
|
|
7
|
+
export { useLocale } from "./useLocale";
|
|
8
|
+
export { useProps } from "./useProps";
|
|
9
|
+
export { useResolveDependency } from "./useResolveDependency";
|
|
10
|
+
export { useResolveVariables } from "./useResolveVariables";
|
|
11
|
+
export { useRules } from "./useRules";
|
|
12
|
+
export { useSource } from "./useSource";
|
|
13
|
+
export { useFormModel } from "./useFormModel";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DictionarySource } from '../../vocabulary/schema/elements';
|
|
2
|
-
import { Ref } from
|
|
3
|
-
|
|
2
|
+
import { Ref } from "vue";
|
|
3
|
+
import { EngineOptions } from '../../vocabulary/engine';
|
|
4
|
+
export declare function useDictionarySource(source: DictionarySource, formId: string, formOptions: EngineOptions): {
|
|
4
5
|
title: string;
|
|
5
6
|
value: string;
|
|
6
7
|
loading: Ref<boolean>;
|
|
@@ -5,15 +5,17 @@ export declare function useLocale(): {
|
|
|
5
5
|
counter: string;
|
|
6
6
|
phoneInvalid: string;
|
|
7
7
|
countryLabel: string;
|
|
8
|
+
emptyValue: string;
|
|
8
9
|
};
|
|
9
10
|
pl: {
|
|
10
11
|
required: string;
|
|
11
12
|
counter: string;
|
|
12
13
|
phoneInvalid: string;
|
|
13
14
|
countryLabel: string;
|
|
15
|
+
emptyValue: string;
|
|
14
16
|
};
|
|
15
17
|
}, "en" | "pl", import("@intlify/core-base").RemoveIndexSignature<{
|
|
16
18
|
[x: string]: import('../../../vue-i18n/dist/vue-i18n.runtime.esm-bundler.js').LocaleMessageValue<import('../../../vue-i18n/dist/vue-i18n.runtime.esm-bundler.js').VueMessageType>;
|
|
17
|
-
}>, never, "required" | "counter" | "phoneInvalid" | "countryLabel", "required" | "counter" | "phoneInvalid" | "countryLabel">;
|
|
19
|
+
}>, never, "required" | "counter" | "phoneInvalid" | "countryLabel" | "emptyValue", "required" | "counter" | "phoneInvalid" | "countryLabel" | "emptyValue">;
|
|
18
20
|
locale: import("vue").WritableComputedRef<"en" | "pl">;
|
|
19
21
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function useResolveVariables(inputString: string, formId: string): {
|
|
1
|
+
export declare function useResolveVariables(inputString: string, formId: string, formatNumber: (input: number) => string): {
|
|
2
2
|
resolvedText: string;
|
|
3
3
|
allVariablesResolved: boolean;
|
|
4
4
|
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { EngineField } from '../../vocabulary/engine';
|
|
2
1
|
import { Schema } from '../../vocabulary/schema';
|
|
3
2
|
export declare const variableRegexp: RegExp;
|
|
4
|
-
export declare function produceUpdateEvent(val: any, schema: EngineField): void;
|
|
5
|
-
export declare function getValueFromModel(model: object, schema: EngineField): any;
|
|
6
3
|
export declare function resolveSchemaWithLocale(schema: Schema, locale: string): Promise<Schema>;
|