qmap-forms 1.0.2 → 1.0.3

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.
@@ -0,0 +1,112 @@
1
+ import { Fragment as e, Teleport as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, nextTick as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, openBlock as p, ref as m, renderSlot as h, toDisplayString as g, withCtx as _, withKeys as v } from "vue";
2
+ //#endregion
3
+ //#region src/components/simple/BtnTooltip.vue
4
+ var y = /* @__PURE__ */ c({
5
+ __name: "BtnTooltip",
6
+ props: { label: {} },
7
+ setup(o) {
8
+ let s = m(!1), c = m({
9
+ top: "50px",
10
+ left: "50px",
11
+ position: "absolute",
12
+ zIndex: "999"
13
+ });
14
+ m(null);
15
+ let u = m(null), _ = m(null), y = `info-btn-tooltip-${Math.random().toString(36).slice(2)}`;
16
+ function b() {
17
+ s.value || (s.value = !0, l(() => {
18
+ C();
19
+ }), document.addEventListener("mousedown", S));
20
+ }
21
+ function x() {
22
+ s.value = !1, document.removeEventListener("mousedown", S);
23
+ }
24
+ function S(e) {
25
+ _.value && u.value && !_.value.contains(e.target) && !u.value.contains(e.target) && x();
26
+ }
27
+ function C() {
28
+ if (u.value && _.value) {
29
+ let e = u.value.getBoundingClientRect(), t = _.value.getBoundingClientRect(), n = e.bottom + window.scrollY + 8, r = Math.max(e.left + window.scrollX + e.width / 2 - t.width / 2, 0);
30
+ c.value = {
31
+ top: `${n}px`,
32
+ left: `${r}px`,
33
+ position: "absolute",
34
+ zIndex: "999"
35
+ };
36
+ }
37
+ }
38
+ return f(() => {
39
+ document.removeEventListener("mousedown", S);
40
+ }), (l, f) => (p(), i(e, null, [a("button", {
41
+ ref_key: "button",
42
+ ref: u,
43
+ onClick: b,
44
+ onBlur: x,
45
+ onMouseover: b,
46
+ class: "qmap-button",
47
+ onMouseleave: x,
48
+ onKeydown: v(x, ["esc"]),
49
+ style: {
50
+ border: "none",
51
+ background: "none"
52
+ },
53
+ "aria-describedby": y
54
+ }, [h(l.$slots, "default")], 544), (p(), n(t, { to: "body" }, [s.value ? (p(), i("div", {
55
+ key: 0,
56
+ id: y,
57
+ class: "tooltip",
58
+ style: d(c.value),
59
+ ref_key: "tooltip",
60
+ ref: _,
61
+ tabindex: "-1"
62
+ }, g(o.label), 5)) : r("", !0)]))], 64));
63
+ }
64
+ }), b = /* @__PURE__ */ c({
65
+ __name: "subtitle-button",
66
+ props: { qMap: {} },
67
+ setup(e) {
68
+ return (t, i) => e.qMap.subtitle ? (p(), n(y, {
69
+ key: 0,
70
+ label: e.qMap.subtitle
71
+ }, {
72
+ default: _(() => [...i[0] ||= [a("i", { class: "fa fa-question-circle" }, null, -1)]]),
73
+ _: 1
74
+ }, 8, ["label"])) : r("", !0);
75
+ }
76
+ }), x = { class: "block" }, S = /* @__PURE__ */ c({
77
+ __name: "title-block",
78
+ props: { qMap: {} },
79
+ setup(e) {
80
+ return (t, n) => (p(), i("span", x, [
81
+ o(g(e.qMap.title || (e.qMap.id !== "#" && e.qMap.type !== "col" && e.qMap.type !== "group" ? e.qMap.id : "")) + " ", 1),
82
+ h(t.$slots, "default"),
83
+ s(b, { "q-map": e.qMap }, null, 8, ["q-map"])
84
+ ]));
85
+ }
86
+ }), C = {
87
+ key: 0,
88
+ class: "inline-flex shrink-0 items-center gap-1 qmap-control-prepend"
89
+ }, w = {
90
+ key: 1,
91
+ class: "inline-flex shrink-0 items-center gap-1 qmap-control-append"
92
+ }, T = /* @__PURE__ */ c({
93
+ __name: "FieldControl",
94
+ props: {
95
+ invalid: { type: Boolean },
96
+ disabled: { type: Boolean },
97
+ multiline: { type: Boolean }
98
+ },
99
+ setup(e) {
100
+ return (t, n) => (p(), i("div", { class: u(["flex items-center gap-2 min-w-0 min-h-10 px-3 qmap-control", {
101
+ "items-start": e.multiline,
102
+ "qmap-control-invalid": e.invalid,
103
+ "qmap-control-disabled": e.disabled
104
+ }]) }, [
105
+ t.$slots.prepend ? (p(), i("div", C, [h(t.$slots, "prepend")])) : r("", !0),
106
+ h(t.$slots, "default"),
107
+ t.$slots.append ? (p(), i("div", w, [h(t.$slots, "append")])) : r("", !0)
108
+ ], 2));
109
+ }
110
+ });
111
+ //#endregion
112
+ export { S as n, b as r, T as t };
package/README.md CHANGED
@@ -11,24 +11,22 @@ It uses the qMap configuration specification defined [here](https://vasat.io/qma
11
11
  Declare dependencies in html head
12
12
 
13
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">
14
+ <!-- stylesheets -->
16
15
  <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">
16
+ <link href="https://cdn.jsdelivr.net/npm/qmap-forms@latest/qmap-forms.css" rel="stylesheet" type="text/css">
18
17
 
19
- <script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/7.8.2/rxjs.umd.js"></script>
18
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/7.8.2/rxjs.umd.js"></script>
20
19
 
21
20
  <!-- Leaflet optional if your using a geo_map type compoennt -->
22
21
  <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"></script>
23
22
 
24
23
  ```
25
24
 
26
- Then at the end of your body tag declare dependecies for `vue`, `quasar` and the `qmap` library
25
+ Then at the end of your body tag declare dependencies for `vue` and the `qmap` library
27
26
 
28
27
  ```html
29
28
 
30
29
  <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
30
  <script src="https://cdn.jsdelivr.net/npm/qmap-forms@latest/qmap.umd.js"></script>
33
31
 
34
32
  ```
@@ -40,7 +38,13 @@ The UMD module exports a window variable `QMap`
40
38
 
41
39
  Install packages
42
40
  ```sh
43
- npm install --save rxjs quasar qmap-forms
41
+ npm install --save rxjs qmap-forms
42
+ ```
43
+
44
+ Import the packaged stylesheet once in your app entry point:
45
+
46
+ ```ts
47
+ import 'qmap-forms/qmap-forms.css'
44
48
  ```
45
49
 
46
50
 
@@ -126,4 +130,3 @@ const model = ref({})
126
130
  </template>
127
131
 
128
132
  ```
129
-
@@ -0,0 +1,8 @@
1
+ import "./FieldControl-D0e9k9sx.mjs";
2
+ import "vue";
3
+ import "leaflet-editable";
4
+ import "leaflet";
5
+ throw Error("Could not resolve \"leaflet-path-drag\" imported by \"qmap-forms\". Is it installed?");
6
+ //#endregion
7
+ export { e as default };
8
+ var e;