@formio/vue 5.0.0-rc.1
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/Changelog.md +68 -0
- package/LICENSE +21 -0
- package/README.md +116 -0
- package/lib/Plugin.d.ts +9 -0
- package/lib/Plugin.js +22 -0
- package/lib/Plugin.js.map +1 -0
- package/lib/Provider.d.ts +29 -0
- package/lib/Provider.js +118 -0
- package/lib/Provider.js.map +1 -0
- package/lib/components/Form.d.ts +26 -0
- package/lib/components/Form.js +47 -0
- package/lib/components/Form.js.map +1 -0
- package/lib/components/FormBuilder.d.ts +25 -0
- package/lib/components/FormBuilder.js +49 -0
- package/lib/components/FormBuilder.js.map +1 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.js +11 -0
- package/lib/components/index.js.map +1 -0
- package/lib/composables/form/useInitializeFormio.d.ts +6 -0
- package/lib/composables/form/useInitializeFormio.js +90 -0
- package/lib/composables/form/useInitializeFormio.js.map +1 -0
- package/lib/composables/formBuilder/useInitializeBuilder.d.ts +6 -0
- package/lib/composables/formBuilder/useInitializeBuilder.js +47 -0
- package/lib/composables/formBuilder/useInitializeBuilder.js.map +1 -0
- package/lib/composables/useFormioRef.d.ts +7 -0
- package/lib/composables/useFormioRef.js +14 -0
- package/lib/composables/useFormioRef.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +20 -0
- package/lib/index.js.map +1 -0
- package/lib/intefaces/form/initializeFormOptions.d.ts +5 -0
- package/lib/intefaces/form/initializeFormOptions.js +4 -0
- package/lib/intefaces/form/initializeFormOptions.js.map +1 -0
- package/lib/intefaces/formBuilder/initializeFormBuilderOptions.d.ts +5 -0
- package/lib/intefaces/formBuilder/initializeFormBuilderOptions.js +4 -0
- package/lib/intefaces/formBuilder/initializeFormBuilderOptions.js.map +1 -0
- package/package.json +42 -0
package/Changelog.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
All notable changes to this project will be documented in this file
|
|
3
|
+
|
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
|
+
|
|
7
|
+
## 5.0.0-rc.1
|
|
8
|
+
### Changed
|
|
9
|
+
- Support Vue 3
|
|
10
|
+
|
|
11
|
+
## 4.0.8
|
|
12
|
+
### Fixed
|
|
13
|
+
- FIO-3593 && FIO-3842: fixed some namespace errors
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Upgrade dependencies.
|
|
17
|
+
|
|
18
|
+
## 4.0.6
|
|
19
|
+
### Changed
|
|
20
|
+
- Upgrade Dependencies.
|
|
21
|
+
|
|
22
|
+
## 4.0.5
|
|
23
|
+
### Added
|
|
24
|
+
- Support for custom namespace in event handling
|
|
25
|
+
|
|
26
|
+
## 4.0.4
|
|
27
|
+
### Changed
|
|
28
|
+
- Rerelease to fix build issue.
|
|
29
|
+
|
|
30
|
+
## 4.0.3
|
|
31
|
+
### Added
|
|
32
|
+
- Namespacing of formio.
|
|
33
|
+
|
|
34
|
+
## 4.0.2
|
|
35
|
+
### Changed
|
|
36
|
+
- Upgrade Dependencies.
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
- Export of options from formio.js
|
|
40
|
+
|
|
41
|
+
## 4.0.1
|
|
42
|
+
### Changed
|
|
43
|
+
- Upgrade Dependencies.
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
- Builder should use Ready.
|
|
47
|
+
- Fix typo in event callback
|
|
48
|
+
- Set esModuleInterop in tsconfig.
|
|
49
|
+
|
|
50
|
+
## 4.0.0
|
|
51
|
+
### Changed
|
|
52
|
+
- Upgrade formio.js to v4.1.1
|
|
53
|
+
|
|
54
|
+
## 3.0.3
|
|
55
|
+
### Changed
|
|
56
|
+
- Upgrade formio.js to 3.27.3
|
|
57
|
+
|
|
58
|
+
## 3.0.2
|
|
59
|
+
### Changed
|
|
60
|
+
- Upgrade formio.js to 3.15.1
|
|
61
|
+
|
|
62
|
+
## 3.0.1
|
|
63
|
+
### Added
|
|
64
|
+
- Language change support
|
|
65
|
+
|
|
66
|
+
## 3.0.0
|
|
67
|
+
### Changed
|
|
68
|
+
- Upgrade formio.js to 3.0.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Form.io
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# vue-formio
|
|
2
|
+
|
|
3
|
+
A [Vue.js](http://vue.js/) component for rendering out forms based on the [Form.io](https://www.form.io) platform.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
### npm
|
|
8
|
+
|
|
9
|
+
`Vue Formio` can be used on the server, or bundled for the client using an
|
|
10
|
+
npm-compatible packaging system such as [Browserify](http://browserify.org/) or
|
|
11
|
+
[webpack](http://webpack.github.io/).
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
npm install vue-formio --save
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Basic Usage
|
|
18
|
+
|
|
19
|
+
HTML inside of Vue template file:
|
|
20
|
+
```
|
|
21
|
+
<template>
|
|
22
|
+
<div id="app">
|
|
23
|
+
<formio src="" url="" form="" submission="" options="" v-on:submit=""></formio>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Javascript inside of Vue template file.
|
|
29
|
+
```
|
|
30
|
+
<script>
|
|
31
|
+
import { Form } from 'vue-formio';
|
|
32
|
+
export default {
|
|
33
|
+
name: 'app',
|
|
34
|
+
components: { formio: Form },
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
```
|
|
38
|
+
## Props
|
|
39
|
+
|
|
40
|
+
### `src` : `string`
|
|
41
|
+
|
|
42
|
+
The form API source from [form.io](https://www.form.io) or your custom formio server.
|
|
43
|
+
|
|
44
|
+
See the [Creating a form](http://help.form.io/userguide/#new-form)
|
|
45
|
+
for where to set the API Path for your form.
|
|
46
|
+
|
|
47
|
+
You can also pass in the submission url as the `src` and the form will render with the data populated from the submission.
|
|
48
|
+
|
|
49
|
+
### `url` : `string`
|
|
50
|
+
|
|
51
|
+
If you pass in the form and submission directly, some components such as resources, files and forms need to know the url of the form on the server. Pass it in with the url option.
|
|
52
|
+
|
|
53
|
+
### `form` : `object`
|
|
54
|
+
|
|
55
|
+
An object representing the form. Use this instead of src for custom forms.
|
|
56
|
+
|
|
57
|
+
**Note:** `src` will override this property if used.
|
|
58
|
+
|
|
59
|
+
### `submission`: `Object`
|
|
60
|
+
|
|
61
|
+
An object representing the default data for the form.
|
|
62
|
+
|
|
63
|
+
**Note:** `src` will override this if a submission url is entered.
|
|
64
|
+
|
|
65
|
+
### `options`: `object`
|
|
66
|
+
|
|
67
|
+
An object with the formio.js options that is passed through. See [Form.io Options](https://github.com/formio/formio.js/wiki/Form-Renderer#options).
|
|
68
|
+
|
|
69
|
+
## Events
|
|
70
|
+
|
|
71
|
+
All events triggered from the form are available via the v-on property. See [Form.io Events](https://github.com/formio/formio.js/wiki/Form-Renderer#events) for all the available events.
|
|
72
|
+
|
|
73
|
+
Then on the form set `<formio src="myform" v-on:submit="doSomething" />`
|
|
74
|
+
|
|
75
|
+
## FormBuilder
|
|
76
|
+
|
|
77
|
+
HTML inside of Vue template file:
|
|
78
|
+
```
|
|
79
|
+
<template>
|
|
80
|
+
<div id="app">
|
|
81
|
+
<formbuilder v-bind:form="{display: 'form'}" v-bind:options="{}" v-on:change="(schema) => console.log(schema)"></formbuilder>
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Javascript inside of Vue template file.
|
|
87
|
+
```
|
|
88
|
+
<script>
|
|
89
|
+
import { FormBuilder } from 'vue-formio';
|
|
90
|
+
export default {
|
|
91
|
+
name: 'app',
|
|
92
|
+
components: { FormBuilder },
|
|
93
|
+
}
|
|
94
|
+
</script>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Form Actions
|
|
98
|
+
|
|
99
|
+
Get access to the form instance
|
|
100
|
+
```
|
|
101
|
+
<template>
|
|
102
|
+
<div id="app">
|
|
103
|
+
<formio ref="formioForm"></formio>
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Run a method
|
|
109
|
+
```
|
|
110
|
+
this.$refs.formioForm.formio.submit()
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
All methods are available here https://help.form.io/developers/form-renderer#form-methods
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
Released under the [MIT License](http://www.opensource.org/licenses/MIT).
|
package/lib/Plugin.d.ts
ADDED
package/lib/Plugin.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Provide a plugin by default that will register all components.
|
|
4
|
+
var Plugin = /** @class */ (function () {
|
|
5
|
+
function Plugin() {
|
|
6
|
+
}
|
|
7
|
+
// Vue Plugin
|
|
8
|
+
Plugin.install = function (Vue, _a) {
|
|
9
|
+
// Vue.$formio = formiojs;
|
|
10
|
+
var providers = _a.providers, store = _a.store, router = _a.router;
|
|
11
|
+
// Vue.component('Form', Form);
|
|
12
|
+
providers.forEach(function (provider) {
|
|
13
|
+
provider.init(Vue);
|
|
14
|
+
provider.registerRoutes(router);
|
|
15
|
+
provider.registerStore(store);
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
return Plugin;
|
|
19
|
+
}());
|
|
20
|
+
exports.Plugin = Plugin;
|
|
21
|
+
;
|
|
22
|
+
//# sourceMappingURL=Plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../src/Plugin.ts"],"names":[],"mappings":";;AAKA,iEAAiE;AACjE;IAAA;IAaA,CAAC;IAZC,aAAa;IACN,cAAO,GAAd,UAAgB,GAAQ,EAAE,EAAgF;QACxG,0BAA0B;YADA,wBAAS,EAAE,gBAAK,EAAE,kBAAM;QAGlD,+BAA+B;QAE/B,SAAS,CAAC,OAAO,CAAC,UAAA,QAAQ;YACxB,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACnB,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAChC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;IACH,aAAC;AAAD,CAAC,AAbD,IAaC;AAbY,wBAAM;AAalB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare type ProviderTypes = 'auth' | 'builder' | 'forms' | 'offline' | 'resource' | 'other';
|
|
2
|
+
export interface ProviderInterface {
|
|
3
|
+
name: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
form?: string;
|
|
6
|
+
type?: ProviderTypes;
|
|
7
|
+
titlePlural?: string;
|
|
8
|
+
routes?: any[];
|
|
9
|
+
store?: any;
|
|
10
|
+
children?: Provider[];
|
|
11
|
+
views?: any;
|
|
12
|
+
}
|
|
13
|
+
export declare class Provider implements ProviderInterface {
|
|
14
|
+
settings: ProviderInterface;
|
|
15
|
+
parent?: Provider;
|
|
16
|
+
constructor(settings: ProviderInterface, parent?: Provider);
|
|
17
|
+
protected capitalize(value: string): string;
|
|
18
|
+
protected pluralize(value: string): string;
|
|
19
|
+
name: string;
|
|
20
|
+
title: string;
|
|
21
|
+
titlePlural: string;
|
|
22
|
+
form: string;
|
|
23
|
+
readonly children: Provider[];
|
|
24
|
+
readonly rootPath: string;
|
|
25
|
+
readonly path: string;
|
|
26
|
+
init(Vue: any): void;
|
|
27
|
+
registerRoutes(router: any): void;
|
|
28
|
+
registerStore(store: any): void;
|
|
29
|
+
}
|
package/lib/Provider.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var vue_expose_inject_1 = require("vue-expose-inject");
|
|
4
|
+
var Provider = /** @class */ (function () {
|
|
5
|
+
function Provider(settings, parent) {
|
|
6
|
+
this.settings = settings;
|
|
7
|
+
this.parent = parent;
|
|
8
|
+
}
|
|
9
|
+
Provider.prototype.capitalize = function (value) {
|
|
10
|
+
return value[0].toUpperCase() + value.substring(1);
|
|
11
|
+
};
|
|
12
|
+
Provider.prototype.pluralize = function (value) {
|
|
13
|
+
return value + 's';
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(Provider.prototype, "name", {
|
|
16
|
+
get: function () {
|
|
17
|
+
return this.settings.name;
|
|
18
|
+
},
|
|
19
|
+
set: function (value) {
|
|
20
|
+
this.settings.name = value;
|
|
21
|
+
},
|
|
22
|
+
enumerable: true,
|
|
23
|
+
configurable: true
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(Provider.prototype, "title", {
|
|
26
|
+
get: function () {
|
|
27
|
+
return this.settings.title || this.capitalize(this.name);
|
|
28
|
+
},
|
|
29
|
+
set: function (value) {
|
|
30
|
+
this.settings.title = value;
|
|
31
|
+
},
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(Provider.prototype, "titlePlural", {
|
|
36
|
+
get: function () {
|
|
37
|
+
return this.settings.titlePlural || this.pluralize(this.title);
|
|
38
|
+
},
|
|
39
|
+
set: function (value) {
|
|
40
|
+
this.settings.titlePlural = value;
|
|
41
|
+
},
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(Provider.prototype, "form", {
|
|
46
|
+
get: function () {
|
|
47
|
+
return this.settings.form || this.name.toLowerCase();
|
|
48
|
+
},
|
|
49
|
+
set: function (value) {
|
|
50
|
+
this.settings.form = value;
|
|
51
|
+
},
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(Provider.prototype, "children", {
|
|
56
|
+
// public get type(): ProviderTypes {
|
|
57
|
+
// return this.type || 'resource';
|
|
58
|
+
// }
|
|
59
|
+
//
|
|
60
|
+
// public set type(value: ProviderTypes) {
|
|
61
|
+
// this.settings.type = value;
|
|
62
|
+
// }
|
|
63
|
+
//
|
|
64
|
+
get: function () {
|
|
65
|
+
return this.settings.children || [];
|
|
66
|
+
},
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(Provider.prototype, "rootPath", {
|
|
71
|
+
get: function () {
|
|
72
|
+
return (this.parent ? this.parent.path : '') + '/' + this.name;
|
|
73
|
+
},
|
|
74
|
+
enumerable: true,
|
|
75
|
+
configurable: true
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(Provider.prototype, "path", {
|
|
78
|
+
get: function () {
|
|
79
|
+
return this.rootPath + '/:id';
|
|
80
|
+
},
|
|
81
|
+
enumerable: true,
|
|
82
|
+
configurable: true
|
|
83
|
+
});
|
|
84
|
+
Provider.prototype.init = function (Vue) {
|
|
85
|
+
this.children.forEach(function (child) {
|
|
86
|
+
child.init(Vue);
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
Provider.prototype.registerRoutes = function (router) {
|
|
90
|
+
var _this = this;
|
|
91
|
+
router.addRoutes([
|
|
92
|
+
{
|
|
93
|
+
path: this.rootPath,
|
|
94
|
+
component: {
|
|
95
|
+
mixins: [vue_expose_inject_1.expose],
|
|
96
|
+
expose: function () { return ({
|
|
97
|
+
$provider: _this
|
|
98
|
+
}); },
|
|
99
|
+
render: function (createElement) {
|
|
100
|
+
return createElement('router-view');
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
children: this.settings.routes
|
|
104
|
+
}
|
|
105
|
+
]);
|
|
106
|
+
this.children.forEach(function (child) {
|
|
107
|
+
child.registerRoutes(router);
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
Provider.prototype.registerStore = function (store) {
|
|
111
|
+
this.children.forEach(function (child) {
|
|
112
|
+
child.registerStore(store);
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
return Provider;
|
|
116
|
+
}());
|
|
117
|
+
exports.Provider = Provider;
|
|
118
|
+
//# sourceMappingURL=Provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../src/Provider.ts"],"names":[],"mappings":";;AACA,uDAA2C;AAgB3C;IAIE,kBAAmB,QAA2B,EAAE,MAAiB;QAC/D,IAAI,CAAC,QAAQ,GAAG,QAAQ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AAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,KAAK;YACzB,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC;IACH,eAAC;AAAD,CAAC,AAtGD,IAsGC;AAtGY,4BAAQ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
src: StringConstructor;
|
|
3
|
+
url: StringConstructor;
|
|
4
|
+
form: ObjectConstructor;
|
|
5
|
+
submission: ObjectConstructor;
|
|
6
|
+
language: StringConstructor;
|
|
7
|
+
options: {
|
|
8
|
+
type: ObjectConstructor;
|
|
9
|
+
default: () => {};
|
|
10
|
+
};
|
|
11
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
14
|
+
src: StringConstructor;
|
|
15
|
+
url: StringConstructor;
|
|
16
|
+
form: ObjectConstructor;
|
|
17
|
+
submission: ObjectConstructor;
|
|
18
|
+
language: StringConstructor;
|
|
19
|
+
options: {
|
|
20
|
+
type: ObjectConstructor;
|
|
21
|
+
default: () => {};
|
|
22
|
+
};
|
|
23
|
+
}>>, {
|
|
24
|
+
options: Record<string, any>;
|
|
25
|
+
}>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var vue_1 = require("vue");
|
|
7
|
+
var components_1 = __importDefault(require("formiojs/components"));
|
|
8
|
+
var Components_1 = __importDefault(require("formiojs/components/Components"));
|
|
9
|
+
Components_1.default.setComponents(components_1.default);
|
|
10
|
+
var useFormioRef_1 = __importDefault(require("../composables/useFormioRef"));
|
|
11
|
+
var useInitializeFormio_1 = __importDefault(require("../composables/form/useInitializeFormio"));
|
|
12
|
+
exports.default = (0, vue_1.defineComponent)({
|
|
13
|
+
name: 'Form',
|
|
14
|
+
props: {
|
|
15
|
+
src: String,
|
|
16
|
+
url: String,
|
|
17
|
+
form: Object,
|
|
18
|
+
submission: Object,
|
|
19
|
+
language: String,
|
|
20
|
+
options: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default: function () { return ({}); },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
setup: function (props, context) {
|
|
26
|
+
var _a = (0, useFormioRef_1.default)(), formioRef = _a.formioRef, render = _a.render;
|
|
27
|
+
var _b = (0, useInitializeFormio_1.default)(props, context, {
|
|
28
|
+
formioRef: formioRef,
|
|
29
|
+
}), formio = _b.formio, initializeForm = _b.initializeForm, setupForm = _b.setupForm;
|
|
30
|
+
(0, vue_1.onMounted)(function () {
|
|
31
|
+
initializeForm()
|
|
32
|
+
.then(function () {
|
|
33
|
+
setupForm();
|
|
34
|
+
})
|
|
35
|
+
.catch(function (err) {
|
|
36
|
+
console.warn(err);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
(0, vue_1.onUnmounted)(function () {
|
|
40
|
+
if (formio.value) {
|
|
41
|
+
formio.value.destroy(true);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
return render;
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=Form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.js","sourceRoot":"","sources":["../../src/components/Form.ts"],"names":[],"mappings":";;;;;AAAA,2BAA8D;AAC9D,mEAAgD;AAChD,8EAAwD;AACxD,oBAAU,CAAC,aAAa,CAAC,oBAAa,CAAC,CAAC;AAExC,6EAAuD;AACvD,gGAAwE;AAExE,kBAAe,IAAA,qBAAe,EAAC;IAC7B,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE;QACL,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,MAAM;QACX,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,cAAM,OAAA,CAAC,EAAG,CAAC,EAAL,CAAK;SACrB;KACF;IACD,KAAK,YAAC,KAAK,EAAE,OAAO;QACZ,IAAA,KAAwB,IAAA,sBAAY,GAAE,EAApC,SAAS,eAAA,EAAE,MAAM,YAAmB,CAAC;QACvC,IAAA,KAAwC,IAAA,6BAAiB,EAAC,KAAK,EAAE,OAAO,EAAE;YAC9E,SAAS,WAAA;SACV,CAAC,EAFM,MAAM,YAAA,EAAE,cAAc,oBAAA,EAAE,SAAS,eAEvC,CAAC;QAEH,IAAA,eAAS,EAAC;YACR,cAAc,EAAE;iBACb,IAAI,CAAC;gBACJ,SAAS,EAAE,CAAC;YACd,CAAC,CAAC;iBACD,KAAK,CAAC,UAAC,GAAG;gBACT,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACpB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,IAAA,iBAAW,EAAC;YACV,IAAI,MAAM,CAAC,KAAK,EAAE;gBAChB,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;aAC5B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
form: {
|
|
3
|
+
type: ObjectConstructor;
|
|
4
|
+
default: () => {};
|
|
5
|
+
};
|
|
6
|
+
options: {
|
|
7
|
+
type: ObjectConstructor;
|
|
8
|
+
default: () => {};
|
|
9
|
+
};
|
|
10
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
form: {
|
|
14
|
+
type: ObjectConstructor;
|
|
15
|
+
default: () => {};
|
|
16
|
+
};
|
|
17
|
+
options: {
|
|
18
|
+
type: ObjectConstructor;
|
|
19
|
+
default: () => {};
|
|
20
|
+
};
|
|
21
|
+
}>>, {
|
|
22
|
+
form: Record<string, any>;
|
|
23
|
+
options: Record<string, any>;
|
|
24
|
+
}>;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/* globals console, Promise */
|
|
7
|
+
var vue_1 = require("vue");
|
|
8
|
+
var components_1 = __importDefault(require("formiojs/components"));
|
|
9
|
+
var Components_1 = __importDefault(require("formiojs/components/Components"));
|
|
10
|
+
Components_1.default.setComponents(components_1.default);
|
|
11
|
+
var useFormioRef_1 = __importDefault(require("../composables/useFormioRef"));
|
|
12
|
+
var useInitializeBuilder_1 = __importDefault(require("../composables/formBuilder/useInitializeBuilder"));
|
|
13
|
+
exports.default = (0, vue_1.defineComponent)({
|
|
14
|
+
name: 'FormBuilder',
|
|
15
|
+
props: {
|
|
16
|
+
form: {
|
|
17
|
+
type: Object,
|
|
18
|
+
default: function () { return ({}); },
|
|
19
|
+
},
|
|
20
|
+
options: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default: function () { return ({}); },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
setup: function (props, context) {
|
|
26
|
+
var _a = (0, useFormioRef_1.default)(), formioRef = _a.formioRef, render = _a.render;
|
|
27
|
+
var _b = (0, useInitializeBuilder_1.default)(props, context, {
|
|
28
|
+
formioRef: formioRef,
|
|
29
|
+
}), builder = _b.builder, initializeBuilder = _b.initializeBuilder, setupBuilder = _b.setupBuilder;
|
|
30
|
+
(0, vue_1.onMounted)(function () {
|
|
31
|
+
initializeBuilder()
|
|
32
|
+
.then(function () {
|
|
33
|
+
setupBuilder();
|
|
34
|
+
})
|
|
35
|
+
.catch(function (err) {
|
|
36
|
+
/* eslint-disable no-console */
|
|
37
|
+
console.warn(err);
|
|
38
|
+
/* eslint-enable no-console */
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
(0, vue_1.onUnmounted)(function () {
|
|
42
|
+
if (builder) {
|
|
43
|
+
builder.value.instance.destroy(true);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return render;
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=FormBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormBuilder.js","sourceRoot":"","sources":["../../src/components/FormBuilder.ts"],"names":[],"mappings":";;;;;AAAA,8BAA8B;AAC9B,2BAA8D;AAC9D,mEAAgD;AAChD,8EAAwD;AACxD,oBAAU,CAAC,aAAa,CAAC,oBAAa,CAAC,CAAC;AAExC,6EAAuD;AACvD,yGAAmF;AAEnF,kBAAe,IAAA,qBAAe,EAAC;IAC7B,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE;QACL,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,cAAM,OAAA,CAAC,EAAE,CAAC,EAAJ,CAAI;SACpB;QACD,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,cAAM,OAAA,CAAC,EAAE,CAAC,EAAJ,CAAI;SACpB;KACF;IACD,KAAK,YAAC,KAAK,EAAE,OAAO;QACZ,IAAA,KAAwB,IAAA,sBAAY,GAAE,EAApC,SAAS,eAAA,EAAE,MAAM,YAAmB,CAAC;QACvC,IAAA,KAA+C,IAAA,8BAAoB,EAAC,KAAK,EAAE,OAAO,EAAE;YACxF,SAAS,WAAA;SACV,CAAC,EAFM,OAAO,aAAA,EAAE,iBAAiB,uBAAA,EAAE,YAAY,kBAE9C,CAAC;QAEH,IAAA,eAAS,EAAC;YACR,iBAAiB,EAAE;iBAChB,IAAI,CAAC;gBACJ,YAAY,EAAE,CAAC;YACjB,CAAC,CAAC;iBACD,KAAK,CAAC,UAAC,GAAG;gBACT,+BAA+B;gBAC/B,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAClB,8BAA8B;YAChC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,IAAA,iBAAW,EAAC;YACV,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;aACtC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FormBuilder = exports.Form = void 0;
|
|
7
|
+
var Form_1 = __importDefault(require("./Form"));
|
|
8
|
+
exports.Form = Form_1.default;
|
|
9
|
+
var FormBuilder_1 = __importDefault(require("./FormBuilder"));
|
|
10
|
+
exports.FormBuilder = FormBuilder_1.default;
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAGjB,eAHF,cAAI,CAGE;AAFb,8DAAwC;AAEzB,sBAFR,qBAAW,CAEQ"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var vue_1 = require("vue");
|
|
7
|
+
var Form_1 = __importDefault(require("formiojs/Form"));
|
|
8
|
+
function useInitializeForm(props, context, options) {
|
|
9
|
+
var _formio = (0, vue_1.ref)(null);
|
|
10
|
+
var initializeFormWithSrc = function (resolve) {
|
|
11
|
+
resolve(new Form_1.default(options.formioRef.value, props.src, props.options)
|
|
12
|
+
.ready
|
|
13
|
+
.then(function (formio) {
|
|
14
|
+
_formio.value = formio;
|
|
15
|
+
_formio.value.src = props.src;
|
|
16
|
+
return _formio.value;
|
|
17
|
+
})
|
|
18
|
+
.catch(function (err) {
|
|
19
|
+
/* eslint-disable no-console */
|
|
20
|
+
console.error(err);
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
23
|
+
var initializeFormWithForm = function (resolve) {
|
|
24
|
+
resolve(new Form_1.default(options.formioRef.value, props.form, props.options)
|
|
25
|
+
.ready
|
|
26
|
+
.then(function (formio) {
|
|
27
|
+
_formio.value = formio;
|
|
28
|
+
_formio.value.form = props.form;
|
|
29
|
+
if (props.url) {
|
|
30
|
+
_formio.value.url = props.url;
|
|
31
|
+
}
|
|
32
|
+
return _formio.value;
|
|
33
|
+
})
|
|
34
|
+
.catch(function (err) {
|
|
35
|
+
/* eslint-disable no-console */
|
|
36
|
+
console.error(err);
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
var setupForm = function () {
|
|
40
|
+
if (!_formio.value) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (props.submission) {
|
|
44
|
+
_formio.value.submission = props.submission;
|
|
45
|
+
}
|
|
46
|
+
if (props.url) {
|
|
47
|
+
_formio.value.url = props.url;
|
|
48
|
+
}
|
|
49
|
+
_formio.value.language = props.language ? props.language : 'en';
|
|
50
|
+
_formio.value.events.onAny(function () {
|
|
51
|
+
var args = [];
|
|
52
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
53
|
+
args[_i] = arguments[_i];
|
|
54
|
+
}
|
|
55
|
+
var eventParts = args[0].split('.');
|
|
56
|
+
// Only handle formio events.
|
|
57
|
+
var namespace = props.options && props.options.namespace || 'formio';
|
|
58
|
+
if (eventParts[0] !== namespace || eventParts.length !== 2) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// Remove formio. from event.
|
|
62
|
+
args[0] = eventParts[1];
|
|
63
|
+
context.emit.apply(context, args);
|
|
64
|
+
// Emit custom events under their own name as well.
|
|
65
|
+
if (eventParts[1] === 'customEvent') {
|
|
66
|
+
args[0] = args[1].type;
|
|
67
|
+
context.emit.apply(context, args);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
var initializeForm = function () { return new Promise(function (resolve, reject) {
|
|
72
|
+
if (props.src) {
|
|
73
|
+
initializeFormWithSrc(resolve);
|
|
74
|
+
}
|
|
75
|
+
else if (props.form) {
|
|
76
|
+
initializeFormWithForm(resolve);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
reject('Must set src of form attribute');
|
|
80
|
+
}
|
|
81
|
+
}); };
|
|
82
|
+
return {
|
|
83
|
+
formio: _formio,
|
|
84
|
+
initializeForm: initializeForm,
|
|
85
|
+
setupForm: setupForm,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
exports.default = useInitializeForm;
|
|
89
|
+
;
|
|
90
|
+
//# sourceMappingURL=useInitializeFormio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInitializeFormio.js","source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;gBACvB,OAAO,CAAC,IAAI,OAAZ,OAAO,EAAS,IAAI,EAAE;aACvB;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAA;IAED,IAAM,cAAc,GAAG,cAAoB,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACrE,IAAI,KAAK,CAAC,GAAG,EAAE;YACb,qBAAqB,CAAC,OAAO,CAAC,CAAC;SAChC;aAAM,IAAI,KAAK,CAAC,IAAI,EAAE;YACrB,sBAAsB,CAAC,OAAO,CAAC,CAAC;SACjC;aAAM;YACL,MAAM,CAAC,gCAAgC,CAAC,CAAC;SAC1C;IACH,CAAC,CAAC,EARyC,CAQzC,CAAC;IAEH,OAAO;QACL,MAAM,EAAE,OAAO;QACf,cAAc,gBAAA;QACd,SAAS,WAAA;KACV,CAAC;AACJ,CAAC;AAvFD,oCAuFC;AAAA,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import InitializeFormBuilderOptions from '../../intefaces/formBuilder/initializeFormBuilderOptions';
|
|
2
|
+
export default function useInitializeBuilder(props: any, context: any, options: InitializeFormBuilderOptions): {
|
|
3
|
+
builder: any;
|
|
4
|
+
initializeBuilder: () => Promise<any>;
|
|
5
|
+
setupBuilder: () => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var vue_1 = require("vue");
|
|
7
|
+
var FormBuilder_1 = __importDefault(require("formiojs/FormBuilder"));
|
|
8
|
+
function useInitializeBuilder(props, context, options) {
|
|
9
|
+
var _builder = (0, vue_1.ref)(null);
|
|
10
|
+
var setupBuilder = function () {
|
|
11
|
+
_builder.value.instance.events.onAny(function () {
|
|
12
|
+
var args = [];
|
|
13
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
14
|
+
args[_i] = arguments[_i];
|
|
15
|
+
}
|
|
16
|
+
var eventParts = args[0].split('.');
|
|
17
|
+
// Only handle formio events.
|
|
18
|
+
var namespace = props.options && props.options.namespace || 'formio';
|
|
19
|
+
if (eventParts[0] !== namespace || eventParts.length !== 2) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
// Remove formio. from event.
|
|
23
|
+
args[0] = eventParts[1];
|
|
24
|
+
context.emit.apply(context, args);
|
|
25
|
+
// Emit a change event if the schema changes.
|
|
26
|
+
if (['saveComponent', 'updateComponent', 'deleteComponent'].includes(eventParts[1])) {
|
|
27
|
+
args[0] = 'change';
|
|
28
|
+
context.emit.apply(context, args);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
var initializeBuilder = function () {
|
|
33
|
+
if (_builder.value) {
|
|
34
|
+
_builder.instance.destroy(true);
|
|
35
|
+
}
|
|
36
|
+
_builder.value = new FormBuilder_1.default(options.formioRef.value, props.form, props.options);
|
|
37
|
+
return _builder.value.ready;
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
builder: _builder,
|
|
41
|
+
initializeBuilder: initializeBuilder,
|
|
42
|
+
setupBuilder: setupBuilder,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
exports.default = useInitializeBuilder;
|
|
46
|
+
;
|
|
47
|
+
//# sourceMappingURL=useInitializeBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInitializeBuilder.js","sourceRoot":"","sources":["../../../src/composables/formBuilder/useInitializeBuilder.ts"],"names":[],"mappings":";;;;;AAAA,2BAA0B;AAC1B,qEAAqD;AAGrD,SAAwB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAqC;IAChG,IAAM,QAAQ,GAAG,IAAA,SAAG,EAAC,IAAI,CAAC,CAAC;IAE3B,IAAM,YAAY,GAAG;QACnB,QAAQ,CAAC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BAAiB,mBAAA;QACjB,YAAY,cAAA;KACb,CAAC;AACJ,CAAC;AAxCD,uCAwCC;AAAA,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var vue_1 = require("vue");
|
|
4
|
+
function useFormioRef() {
|
|
5
|
+
var formioRef = (0, vue_1.ref)();
|
|
6
|
+
var render = function () { return (0, vue_1.h)('div', { ref: formioRef }); };
|
|
7
|
+
return {
|
|
8
|
+
formioRef: formioRef,
|
|
9
|
+
render: render,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
exports.default = useFormioRef;
|
|
13
|
+
;
|
|
14
|
+
//# sourceMappingURL=useFormioRef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormioRef.js","sourceRoot":"","sources":["../../src/composables/useFormioRef.ts"],"names":[],"mappings":";;AAAA,2BAA6C;AAE7C,SAAwB,YAAY;IAClC,IAAM,SAAS,GAAG,IAAA,SAAG,GAAsB,CAAC;IAE5C,IAAM,MAAM,GAAG,cAAM,OAAA,IAAA,OAAC,EAAC,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,EAA5B,CAA4B,CAAC;IAElD,OAAO;QACL,SAAS,WAAA;QACT,MAAM,QAAA;KACP,CAAC;AACJ,CAAC;AATD,+BASC;AAAA,CAAC"}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.Templates = exports.Utils = exports.Formio = exports.Components = void 0;
|
|
14
|
+
__exportStar(require("./components"), exports);
|
|
15
|
+
var formiojs_1 = require("formiojs");
|
|
16
|
+
Object.defineProperty(exports, "Components", { enumerable: true, get: function () { return formiojs_1.Components; } });
|
|
17
|
+
Object.defineProperty(exports, "Formio", { enumerable: true, get: function () { return formiojs_1.Formio; } });
|
|
18
|
+
Object.defineProperty(exports, "Utils", { enumerable: true, get: function () { return formiojs_1.Utils; } });
|
|
19
|
+
Object.defineProperty(exports, "Templates", { enumerable: true, get: function () { return formiojs_1.Templates; } });
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAEA,+CAA6B;AAE7B,qCAA8D;AAAtD,sGAAA,UAAU,OAAA;AAAE,kGAAA,MAAM,OAAA;AAAE,iGAAA,KAAK,OAAA;AAAE,qGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initializeFormOptions.js","sourceRoot":"","sources":["../../../src/intefaces/form/initializeFormOptions.ts"],"names":[],"mappings":";;AAIC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initializeFormBuilderOptions.js","sourceRoot":"","sources":["../../../src/intefaces/formBuilder/initializeFormBuilderOptions.ts"],"names":[],"mappings":";;AAIC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@formio/vue",
|
|
3
|
+
"version": "5.0.0-rc.1",
|
|
4
|
+
"description": "A vue.js renderer for form.io forms.",
|
|
5
|
+
"main": "lib/index",
|
|
6
|
+
"typeings": "lib/index",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"watch": "tsc -w",
|
|
11
|
+
"prepublish": "npm run build"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/formio/vue-formio.git"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"Form.io",
|
|
19
|
+
"vue.js",
|
|
20
|
+
"forms"
|
|
21
|
+
],
|
|
22
|
+
"author": "Randall Knutson <randall@form.io>",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/formio/vue-formio/issues"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/formio/vue-formio#readme",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@types/vue": "^2.0.0",
|
|
30
|
+
"@vue/compiler-sfc": "^3.0.7",
|
|
31
|
+
"formiojs": "^4.14.2",
|
|
32
|
+
"vue": "^3.0.9"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^4.9.5",
|
|
36
|
+
"typescript": "^4.2.3",
|
|
37
|
+
"typescript-eslint-parser": "^13.0.0"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"lib"
|
|
41
|
+
]
|
|
42
|
+
}
|