qmap-forms 1.0.1 → 1.0.2

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 ADDED
@@ -0,0 +1,129 @@
1
+ # qmap-forms
2
+
3
+ QMap Forms is a dynamic form generator that will build a form capabile of manipulating a local json object.
4
+
5
+ It uses the qMap configuration specification defined [here](https://vasat.io/qmap)
6
+
7
+ # Installation
8
+
9
+ ## Using as UMD
10
+
11
+ Declare dependencies in html head
12
+
13
+ ```html
14
+
15
+ <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons" rel="stylesheet" type="text/css">
16
+ <link href="https://use.fontawesome.com/releases/v7.0.0/css/all.css" rel="stylesheet" type="text/css">
17
+ <link href="https://cdn.jsdelivr.net/npm/quasar@2.34.0/dist/quasar.prod.css" rel="stylesheet" type="text/css">
18
+
19
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/7.8.2/rxjs.umd.js"></script>
20
+
21
+ <!-- Leaflet optional if your using a geo_map type compoennt -->
22
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"></script>
23
+
24
+ ```
25
+
26
+ Then at the end of your body tag declare dependecies for `vue`, `quasar` and the `qmap` library
27
+
28
+ ```html
29
+
30
+ <script src="https://cdn.jsdelivr.net/npm/vue@3/dist/vue.global.prod.js"></script>
31
+ <script src="https://cdn.jsdelivr.net/npm/quasar@2.34.0/dist/quasar.umd.prod.js"></script>
32
+ <script src="https://cdn.jsdelivr.net/npm/qmap-forms@latest/qmap.umd.js"></script>
33
+
34
+ ```
35
+
36
+ The UMD module exports a window variable `QMap`
37
+
38
+
39
+ ## Using as ES module
40
+
41
+ Install packages
42
+ ```sh
43
+ npm install --save rxjs quasar qmap-forms
44
+ ```
45
+
46
+
47
+ # Using qMAP
48
+
49
+ The first thing needed is the form fields defined
50
+ ```js
51
+ // the qMAP of the form you want
52
+ const qmap = [
53
+ {
54
+ id: 'name',
55
+ type: 'string',
56
+ required: true
57
+ },
58
+ {
59
+ id: 'email',
60
+ type: 'string',
61
+ required: false,
62
+ },
63
+ {
64
+ id: 'accept',
65
+ type: 'boolean',
66
+ required: true,
67
+ },
68
+ ]
69
+ ```
70
+
71
+ Followed by the plain js object you wish to use as the model
72
+ ```js
73
+ // the model object, can be pre-populated
74
+ const model = {name:'Joe'}
75
+ ```
76
+
77
+ You then connect using the `mount` method
78
+
79
+ ```js
80
+ // initialise and mound the form at designated dom selector
81
+ const form = QMap.mount('#formNode',qmap,model)
82
+ ```
83
+
84
+ You can listen to state changes by subscribing
85
+ ```js
86
+ form.state.subscribe(a => {
87
+ console.log('Form altered', a) // this will be the 'model' object with changes
88
+ })
89
+
90
+ ```
91
+
92
+ ## Using Vue Form Component
93
+
94
+ When using vue you can use the vue component directly
95
+
96
+ ```ts
97
+ <script setup lang="ts">
98
+ import { onMounted, ref } from 'vue';
99
+ import {Form} from 'qmap-forms';
100
+
101
+ const qmap = ref([
102
+ {
103
+ id: 'name',
104
+ type: 'string',
105
+ required: true,
106
+ },
107
+ {
108
+ id: 'logoURL',
109
+ type: 'string',
110
+ required: false,
111
+ },
112
+ {
113
+ id: 'email',
114
+ type: 'string',
115
+ required: true,
116
+ },
117
+ ]);
118
+
119
+ const model = ref({})
120
+
121
+ </script>
122
+ <template>
123
+
124
+ <Form :questions=qmap v-model="model" />
125
+
126
+ </template>
127
+
128
+ ```
129
+
@@ -0,0 +1,40 @@
1
+ import { M as e, St as t } from "./QPopupProxy-DMCFxQQk.mjs";
2
+ import "vue";
3
+ import "leaflet-editable";
4
+ import "leaflet";
5
+ //#region node_modules/quasar/src/components/circular-progress/circular-progress.js
6
+ var n = {
7
+ ...t,
8
+ min: {
9
+ type: Number,
10
+ default: 0
11
+ },
12
+ max: {
13
+ type: Number,
14
+ default: 100
15
+ },
16
+ color: String,
17
+ centerColor: String,
18
+ trackColor: String,
19
+ fontSize: String,
20
+ rounded: Boolean,
21
+ thickness: {
22
+ type: Number,
23
+ default: .2,
24
+ validator: (e) => e >= 0 && e <= 1
25
+ },
26
+ angle: {
27
+ type: Number,
28
+ default: 0
29
+ },
30
+ showValue: Boolean,
31
+ reverse: Boolean,
32
+ instantFeedback: Boolean
33
+ }, r = 100 * Math.PI;
34
+ throw Math.round(r * 1e3) / 1e3, { ...n }, Object.keys(n), {
35
+ ...e,
36
+ ...n
37
+ }, Error("Could not resolve \"leaflet-path-drag\" imported by \"qmap-forms\". Is it installed?");
38
+ //#endregion
39
+ export { i as default };
40
+ var i;
package/index.es.js CHANGED
@@ -12587,7 +12587,7 @@ var lh = rt((e) => {
12587
12587
  },
12588
12588
  emits: ["qmap_change", "qmap_subquestions"],
12589
12589
  setup(e, { emit: t }) {
12590
- let n = nt(() => import("./SimpleGeomEditor-BZlH3Pfj.mjs")), r = e, i = t, a = K(), o = z(() => r.qMap.style == "full-screen");
12590
+ let n = nt(() => import("./SimpleGeomEditor-D6f9x0ch.mjs")), r = e, i = t, a = K(), o = z(() => r.qMap.style == "full-screen");
12591
12591
  J(() => r.model, (e) => a.value = r.model[r.qMap.id]), ht(() => {
12592
12592
  a.value = r.model[r.qMap.id] ? JSON.parse(r.model[r.qMap.id]) : void 0, s(a.value);
12593
12593
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qmap-forms",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "author": {
5
5
  "name": "CorrelLink",
6
6
  "email": "dev@correllink.com"