@josercl/form-maker 1.0.0-alpha17 → 1.1.0-beta01
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/LICENSE +0 -0
- package/README.md +0 -0
- package/index.js +11 -11
- package/lib/components/FormMaker.vue +1 -1
- package/lib/components/FormMakerInput.vue +0 -0
- package/lib/components/inputs/CheckboxInput.vue +11 -16
- package/lib/components/inputs/FileInput.vue +0 -0
- package/lib/components/inputs/FormInputMixin.js +0 -0
- package/lib/components/inputs/FormMakerInputError.vue +0 -0
- package/lib/components/inputs/FormMakerInputHelp.vue +0 -0
- package/lib/components/inputs/FormMakerInputLabel.vue +0 -0
- package/lib/components/inputs/RadioInput.vue +0 -0
- package/lib/components/inputs/SelectInput.vue +3 -3
- package/lib/components/inputs/TextAreaInput.vue +0 -0
- package/lib/components/inputs/TextInput.vue +0 -0
- package/lib/utils.js +0 -0
- package/package.json +16 -23
- package/umd/index.umd.js +1 -1095
- package/commonjs/index.common.js +0 -1085
- package/umd/index.umd.min.js +0 -1
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import FormMakerComponent from './lib/components/FormMaker';
|
|
2
|
-
import FormMakerInput from './lib/components/FormMakerInput';
|
|
3
|
-
import CheckboxInput from './lib/components/inputs/CheckboxInput';
|
|
4
|
-
import FileInput from './lib/components/inputs/FileInput';
|
|
5
|
-
import FormMakerInputError from './lib/components/inputs/FormMakerInputError';
|
|
6
|
-
import FormMakerInputHelp from './lib/components/inputs/FormMakerInputHelp';
|
|
7
|
-
import FormMakerInputLabel from './lib/components/inputs/FormMakerInputLabel';
|
|
8
|
-
import RadioInput from './lib/components/inputs/RadioInput';
|
|
9
|
-
import SelectInput from './lib/components/inputs/SelectInput';
|
|
10
|
-
import TextAreaInput from './lib/components/inputs/TextAreaInput';
|
|
11
|
-
import TextInput from './lib/components/inputs/TextInput';
|
|
1
|
+
import FormMakerComponent from './lib/components/FormMaker.vue';
|
|
2
|
+
import FormMakerInput from './lib/components/FormMakerInput.vue';
|
|
3
|
+
import CheckboxInput from './lib/components/inputs/CheckboxInput.vue';
|
|
4
|
+
import FileInput from './lib/components/inputs/FileInput.vue';
|
|
5
|
+
import FormMakerInputError from './lib/components/inputs/FormMakerInputError.vue';
|
|
6
|
+
import FormMakerInputHelp from './lib/components/inputs/FormMakerInputHelp.vue';
|
|
7
|
+
import FormMakerInputLabel from './lib/components/inputs/FormMakerInputLabel.vue';
|
|
8
|
+
import RadioInput from './lib/components/inputs/RadioInput.vue';
|
|
9
|
+
import SelectInput from './lib/components/inputs/SelectInput.vue';
|
|
10
|
+
import TextAreaInput from './lib/components/inputs/TextAreaInput.vue';
|
|
11
|
+
import TextInput from './lib/components/inputs/TextInput.vue';
|
|
12
12
|
|
|
13
13
|
const defaultOptions = {
|
|
14
14
|
classes: {
|
|
File without changes
|
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script>
|
|
20
|
-
import {
|
|
21
|
-
computed, ref, toRefs, watch,
|
|
22
|
-
} from 'vue';
|
|
20
|
+
import { computed, toRefs } from 'vue';
|
|
23
21
|
import { FormInputMixin } from './FormInputMixin';
|
|
24
22
|
|
|
25
23
|
export default {
|
|
@@ -39,14 +37,10 @@ export default {
|
|
|
39
37
|
|
|
40
38
|
const val = computed(() => props.modelValue);
|
|
41
39
|
|
|
42
|
-
const selectedOptions =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
newVal => {
|
|
47
|
-
selectedOptions.value = (Array.isArray(newVal) ? newVal : [ newVal ]).filter(x => !!x);
|
|
48
|
-
},
|
|
49
|
-
);
|
|
40
|
+
const selectedOptions = computed(() => {
|
|
41
|
+
const arr = Array.isArray(val.value) ? val.value : [ val.value ];
|
|
42
|
+
return arr.filter(x => !!x);
|
|
43
|
+
});
|
|
50
44
|
|
|
51
45
|
const fieldOptions = computed(() => {
|
|
52
46
|
if (!isBinary.value) {
|
|
@@ -61,16 +55,17 @@ export default {
|
|
|
61
55
|
});
|
|
62
56
|
|
|
63
57
|
const handleClick = clickVal => {
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
let selOptions = [ ...selectedOptions.value ];
|
|
59
|
+
if (selOptions.indexOf(clickVal) === -1) {
|
|
60
|
+
selOptions.push(clickVal);
|
|
66
61
|
} else {
|
|
67
|
-
|
|
62
|
+
selOptions = selOptions.filter(x => x !== clickVal);
|
|
68
63
|
}
|
|
69
64
|
|
|
70
65
|
if (isBinary.value) {
|
|
71
|
-
emit('update:modelValue',
|
|
66
|
+
emit('update:modelValue', selOptions.length > 0);
|
|
72
67
|
} else {
|
|
73
|
-
emit('update:modelValue',
|
|
68
|
+
emit('update:modelValue', selOptions);
|
|
74
69
|
}
|
|
75
70
|
};
|
|
76
71
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/utils.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,47 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@josercl/form-maker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0-beta01",
|
|
4
4
|
"description": "Form generator using vue 3",
|
|
5
5
|
"author": "Jose Carrero <josercl@gmail.com>",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
"build
|
|
9
|
-
"build": "
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"lint": "vue-cli-service lint --ext .js,.vue lib/ docs/ index.js"
|
|
7
|
+
"dev": "vite -c docs.config.js dev",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"build-docs": "vite -c docs.config.js build",
|
|
10
|
+
"preview": "vite -c docs.config.js preview --port 5050",
|
|
11
|
+
"lint": "eslint --ext .vue,.js lib/ docs/ index.js"
|
|
13
12
|
},
|
|
14
13
|
"files": [
|
|
15
14
|
"index.js",
|
|
16
15
|
"lib/**",
|
|
17
|
-
"umd/*.js"
|
|
18
|
-
"umd/*.map",
|
|
19
|
-
"commonjs/*.js",
|
|
20
|
-
"commonjs/*.map"
|
|
16
|
+
"umd/*.js"
|
|
21
17
|
],
|
|
22
18
|
"homepage": "https://josercl.gitlab.io/form-maker",
|
|
23
19
|
"dependencies": {
|
|
24
|
-
"
|
|
25
|
-
"vue": "^3.0.0"
|
|
20
|
+
"vue": "^3.2.31"
|
|
26
21
|
},
|
|
27
22
|
"devDependencies": {
|
|
23
|
+
"@babel/core": "^7.17.5",
|
|
24
|
+
"@babel/eslint-parser": "^7.17.0",
|
|
28
25
|
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
|
29
26
|
"@fortawesome/free-brands-svg-icons": "^5.15.1",
|
|
30
27
|
"@fortawesome/free-regular-svg-icons": "^5.15.1",
|
|
31
28
|
"@fortawesome/vue-fontawesome": "^3.0.0-2",
|
|
32
29
|
"@tailwindcss/typography": "^0.2.0",
|
|
33
|
-
"@
|
|
34
|
-
"@vue/
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"@vue/eslint-config-airbnb": "^5.0.2",
|
|
38
|
-
"babel-eslint": "^10.1.0",
|
|
39
|
-
"eslint": "^6.7.2",
|
|
40
|
-
"eslint-plugin-import": "^2.20.2",
|
|
41
|
-
"eslint-plugin-vue": "^7.0.0-0",
|
|
30
|
+
"@vitejs/plugin-vue": "^2.2.2",
|
|
31
|
+
"@vue/eslint-config-airbnb": "^6.0.0",
|
|
32
|
+
"eslint": "^8.10.0",
|
|
33
|
+
"eslint-plugin-vue": "^8.5.0",
|
|
42
34
|
"highlight.js": "^10.2.1",
|
|
43
35
|
"tailwindcss": "^1.9.6",
|
|
44
|
-
"
|
|
36
|
+
"vite": "^2.8.4",
|
|
37
|
+
"vue-router": "^4.0.12"
|
|
45
38
|
},
|
|
46
39
|
"keywords": [
|
|
47
40
|
"vue 3",
|