@stonecrop/beam 0.2.23 → 0.2.25
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/dist/beam.d.ts +43 -0
- package/dist/beam.js +88 -86
- package/dist/beam.js.map +1 -1
- package/dist/beam.tsbuildinfo +1 -0
- package/dist/beam.umd.cjs +1 -1
- package/dist/beam.umd.cjs.map +1 -1
- package/dist/index.js +30 -0
- package/dist/src/index.d.ts +20 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/package.json +16 -18
- package/src/components/BeamModalOutlet.vue +8 -7
- package/src/components/ItemCheck.vue +1 -1
- package/src/components/ItemCount.vue +1 -1
- package/src/components/ListItem.vue +9 -5
- package/src/components/ListView.vue +2 -2
- package/src/components/ScanInput.vue +2 -2
- package/src/index.ts +5 -0
- package/src/histoire.setup.ts +0 -30
package/dist/beam.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import ActionFooter from '@/components/ActionFooter.vue';
|
|
2
|
+
import { App } from 'vue';
|
|
3
|
+
import BeamModal from '@/components/BeamModal.vue';
|
|
4
|
+
import BeamModalOutlet from '@/components/BeamModalOutlet.vue';
|
|
5
|
+
import Confirm from '@/components/Confirm.vue';
|
|
6
|
+
import ItemCheck from '@/components/ItemCheck.vue';
|
|
7
|
+
import ItemCount from '@/components/ItemCount.vue';
|
|
8
|
+
import ListAnchor from '@/components/ListAnchor.vue';
|
|
9
|
+
import ListItem from '@/components/ListItem.vue';
|
|
10
|
+
import ListView from '@/components/ListView.vue';
|
|
11
|
+
import Navbar from '@/components/Navbar.vue';
|
|
12
|
+
import ScanInput from '@/components/ScanInput.vue';
|
|
13
|
+
|
|
14
|
+
export { ActionFooter }
|
|
15
|
+
|
|
16
|
+
export { BeamModal }
|
|
17
|
+
|
|
18
|
+
export { BeamModalOutlet }
|
|
19
|
+
|
|
20
|
+
export { Confirm }
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Install all Beam components
|
|
24
|
+
* @param app - Vue app instance
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export declare function install(app: App): void;
|
|
28
|
+
|
|
29
|
+
export { ItemCheck }
|
|
30
|
+
|
|
31
|
+
export { ItemCount }
|
|
32
|
+
|
|
33
|
+
export { ListAnchor }
|
|
34
|
+
|
|
35
|
+
export { ListItem }
|
|
36
|
+
|
|
37
|
+
export { ListView }
|
|
38
|
+
|
|
39
|
+
export { Navbar }
|
|
40
|
+
|
|
41
|
+
export { ScanInput }
|
|
42
|
+
|
|
43
|
+
export { }
|
package/dist/beam.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const F = { class: "beam__actionfooter" }, O = { class: "footer-action-wrapper" }, H = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as m, openBlock as l, createElementBlock as i, createElementVNode as c, renderSlot as d, resolveComponent as f, createBlock as _, withCtx as $, withDirectives as L, vShow as g, ref as h, pushScopeId as V, popScopeId as B, computed as E, normalizeClass as M, toDisplayString as p, createCommentVNode as v, onMounted as k, onUnmounted as C, Fragment as N, renderList as S, resolveDynamicComponent as A, createVNode as T, createTextVNode as D } from "vue";
|
|
2
|
+
const F = { class: "beam__actionfooter" }, O = { class: "footer-action-wrapper" }, H = /* @__PURE__ */ m({
|
|
3
3
|
__name: "ActionFooter",
|
|
4
4
|
emits: ["click"],
|
|
5
|
-
setup(
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
setup(e, { emit: o }) {
|
|
6
|
+
const t = o, s = () => {
|
|
7
|
+
t("click");
|
|
8
8
|
};
|
|
9
9
|
return (n, a) => (l(), i("footer", F, [
|
|
10
10
|
c("span", O, [
|
|
@@ -17,75 +17,74 @@ const F = { class: "beam__actionfooter" }, O = { class: "footer-action-wrapper"
|
|
|
17
17
|
])
|
|
18
18
|
]));
|
|
19
19
|
}
|
|
20
|
-
}), P = { class: "beam__modal" }, U = /* @__PURE__ */
|
|
20
|
+
}), P = { class: "beam__modal" }, U = /* @__PURE__ */ m({
|
|
21
21
|
__name: "BeamModal",
|
|
22
22
|
props: {
|
|
23
23
|
showModal: { type: Boolean }
|
|
24
24
|
},
|
|
25
|
-
setup(
|
|
26
|
-
return (
|
|
27
|
-
const s =
|
|
25
|
+
setup(e) {
|
|
26
|
+
return (o, t) => {
|
|
27
|
+
const s = f("portal");
|
|
28
28
|
return l(), _(s, { to: "beam__modal_outlet" }, {
|
|
29
29
|
default: $(() => [
|
|
30
30
|
L(c("div", P, [
|
|
31
31
|
c("button", {
|
|
32
32
|
class: "btn",
|
|
33
|
-
onClick:
|
|
33
|
+
onClick: t[0] || (t[0] = (n) => o.$emit("closemodal"))
|
|
34
34
|
}, "Close Modal"),
|
|
35
|
-
d(
|
|
36
|
-
onClosemodal:
|
|
37
|
-
onConfirmmodal:
|
|
35
|
+
d(o.$slots, "default", {
|
|
36
|
+
onClosemodal: t[1] || (t[1] = (n) => o.$emit("closemodal")),
|
|
37
|
+
onConfirmmodal: t[2] || (t[2] = (n) => o.$emit("confirmmodal"))
|
|
38
38
|
})
|
|
39
39
|
], 512), [
|
|
40
|
-
[g,
|
|
40
|
+
[g, o.showModal]
|
|
41
41
|
])
|
|
42
42
|
]),
|
|
43
43
|
_: 3
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
}), z = /* @__PURE__ */
|
|
47
|
+
}), z = /* @__PURE__ */ m({
|
|
48
48
|
__name: "BeamModalOutlet",
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return l(), _(n, { name: "beam__modal_outlet" });
|
|
49
|
+
setup(e) {
|
|
50
|
+
return (o, t) => {
|
|
51
|
+
const s = f("portal-target");
|
|
52
|
+
return l(), _(s, { name: "beam__modal_outlet" });
|
|
54
53
|
};
|
|
55
54
|
}
|
|
56
|
-
}), I = (
|
|
57
|
-
const
|
|
58
|
-
for (const [s, n] of
|
|
59
|
-
|
|
60
|
-
return
|
|
61
|
-
},
|
|
62
|
-
function
|
|
63
|
-
return l(), i("div",
|
|
64
|
-
|
|
55
|
+
}), I = (e, o) => {
|
|
56
|
+
const t = e.__vccOpts || e;
|
|
57
|
+
for (const [s, n] of o)
|
|
58
|
+
t[s] = n;
|
|
59
|
+
return t;
|
|
60
|
+
}, K = {}, W = { class: "beam__modal-confirm" }, Y = /* @__PURE__ */ c("h2", null, "Would you like to continue?", -1);
|
|
61
|
+
function j(e, o) {
|
|
62
|
+
return l(), i("div", W, [
|
|
63
|
+
Y,
|
|
65
64
|
c("button", {
|
|
66
65
|
class: "btn",
|
|
67
|
-
onClick:
|
|
66
|
+
onClick: o[0] || (o[0] = (t) => e.$emit("confirmmodal"))
|
|
68
67
|
}, "Yes"),
|
|
69
68
|
c("button", {
|
|
70
69
|
class: "btn",
|
|
71
|
-
onClick:
|
|
70
|
+
onClick: o[1] || (o[1] = (t) => e.$emit("closemodal"))
|
|
72
71
|
}, "No")
|
|
73
72
|
]);
|
|
74
73
|
}
|
|
75
|
-
const
|
|
74
|
+
const q = /* @__PURE__ */ I(K, [["render", j]]), G = (e) => (V("data-v-7261b52e"), e = e(), B(), e), J = { class: "container" }, Q = ["checked"], R = /* @__PURE__ */ G(() => /* @__PURE__ */ c("div", {
|
|
76
75
|
class: "checkmark",
|
|
77
76
|
tabindex: "0"
|
|
78
|
-
}, null, -1)), X = /* @__PURE__ */
|
|
77
|
+
}, null, -1)), X = /* @__PURE__ */ m({
|
|
79
78
|
__name: "ItemCheck",
|
|
80
79
|
props: {
|
|
81
80
|
value: { type: Boolean }
|
|
82
81
|
},
|
|
83
82
|
emits: ["input"],
|
|
84
|
-
setup(
|
|
85
|
-
const
|
|
83
|
+
setup(e, { emit: o }) {
|
|
84
|
+
const t = e, s = o, n = h(t.value), a = () => {
|
|
86
85
|
s("input", n.value);
|
|
87
86
|
};
|
|
88
|
-
return (r,
|
|
87
|
+
return (r, u) => (l(), i("label", J, [
|
|
89
88
|
c("input", {
|
|
90
89
|
type: "checkbox",
|
|
91
90
|
checked: r.value,
|
|
@@ -95,7 +94,7 @@ const G = /* @__PURE__ */ I(W, [["render", q]]), J = (t) => (V("data-v-4d5731cd"
|
|
|
95
94
|
R
|
|
96
95
|
]));
|
|
97
96
|
}
|
|
98
|
-
}), w = /* @__PURE__ */ I(X, [["__scopeId", "data-v-
|
|
97
|
+
}), w = /* @__PURE__ */ I(X, [["__scopeId", "data-v-7261b52e"]]), Z = { class: "beam__itemcount" }, x = ["contenteditable"], ee = { key: 0 }, y = /* @__PURE__ */ m({
|
|
99
98
|
__name: "ItemCount",
|
|
100
99
|
props: {
|
|
101
100
|
value: { default: 0 },
|
|
@@ -104,71 +103,72 @@ const G = /* @__PURE__ */ I(W, [["render", q]]), J = (t) => (V("data-v-4d5731cd"
|
|
|
104
103
|
editable: { type: Boolean, default: !0 }
|
|
105
104
|
},
|
|
106
105
|
emits: ["input"],
|
|
107
|
-
setup(
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
}, r =
|
|
111
|
-
return (
|
|
106
|
+
setup(e, { emit: o }) {
|
|
107
|
+
const t = o, s = e, n = h(s.value), a = (u) => {
|
|
108
|
+
u.preventDefault(), u.stopPropagation(), n.value = Number(u.target.innerHTML.replace(/[^0-9]/g, "")), t("input", n.value);
|
|
109
|
+
}, r = E(() => n.value === s.denominator);
|
|
110
|
+
return (u, pe) => (l(), i("div", Z, [
|
|
112
111
|
c("span", {
|
|
113
|
-
contenteditable:
|
|
114
|
-
class:
|
|
112
|
+
contenteditable: u.editable,
|
|
113
|
+
class: M({ alert: r.value === !1 }),
|
|
115
114
|
onInput: a,
|
|
116
115
|
onClick: a
|
|
117
116
|
}, p(n.value), 43, x),
|
|
118
|
-
c("span", null, "/" + p(
|
|
119
|
-
|
|
117
|
+
c("span", null, "/" + p(u.denominator), 1),
|
|
118
|
+
u.uom ? (l(), i("span", ee, " " + p(u.uom), 1)) : v("", !0)
|
|
120
119
|
]));
|
|
121
120
|
}
|
|
122
|
-
}), te = ["href"], oe = /* @__PURE__ */
|
|
121
|
+
}), te = ["href"], oe = /* @__PURE__ */ m({
|
|
123
122
|
__name: "ListAnchor",
|
|
124
123
|
props: {
|
|
125
124
|
to: { default: "" }
|
|
126
125
|
},
|
|
127
|
-
setup(
|
|
128
|
-
return (
|
|
129
|
-
href:
|
|
126
|
+
setup(e) {
|
|
127
|
+
return (o, t) => (l(), i("a", {
|
|
128
|
+
href: o.to,
|
|
130
129
|
class: "beam__listanchor"
|
|
131
130
|
}, [
|
|
132
|
-
d(
|
|
131
|
+
d(o.$slots, "default")
|
|
133
132
|
], 8, te));
|
|
134
133
|
}
|
|
135
134
|
}), ne = {
|
|
136
135
|
tabindex: "0",
|
|
137
136
|
class: "beam__listitem"
|
|
138
|
-
}, se = { class: "beam__listtext" },
|
|
137
|
+
}, se = { class: "beam__listtext" }, b = /* @__PURE__ */ m({
|
|
139
138
|
__name: "ListItem",
|
|
140
139
|
props: {
|
|
141
140
|
item: {}
|
|
142
141
|
},
|
|
143
|
-
setup(
|
|
144
|
-
|
|
142
|
+
setup(e) {
|
|
143
|
+
const t = h(e.item);
|
|
144
|
+
return (s, n) => (l(), i("li", ne, [
|
|
145
145
|
c("div", se, [
|
|
146
|
-
c("label", null, p(
|
|
147
|
-
c("p", null, p(
|
|
146
|
+
c("label", null, p(s.item.label), 1),
|
|
147
|
+
c("p", null, p(s.item.description), 1)
|
|
148
148
|
]),
|
|
149
|
-
|
|
149
|
+
s.item.count ? (l(), _(y, {
|
|
150
150
|
key: 0,
|
|
151
|
-
modelValue:
|
|
152
|
-
"onUpdate:modelValue":
|
|
153
|
-
denominator:
|
|
154
|
-
uom:
|
|
151
|
+
modelValue: t.value.count.count,
|
|
152
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => t.value.count.count = a),
|
|
153
|
+
denominator: s.item.count.of,
|
|
154
|
+
uom: s.item.count.uom,
|
|
155
155
|
editable: !0
|
|
156
|
-
}, null, 8, ["modelValue", "denominator", "uom"])) :
|
|
157
|
-
|
|
156
|
+
}, null, 8, ["modelValue", "denominator", "uom"])) : v("", !0),
|
|
157
|
+
s.item.hasOwnProperty("checked") ? (l(), _(w, {
|
|
158
158
|
key: 1,
|
|
159
|
-
modelValue:
|
|
160
|
-
"onUpdate:modelValue":
|
|
161
|
-
}, null, 8, ["modelValue"])) :
|
|
159
|
+
modelValue: t.value.checked,
|
|
160
|
+
"onUpdate:modelValue": n[1] || (n[1] = (a) => t.value.checked = a)
|
|
161
|
+
}, null, 8, ["modelValue"])) : v("", !0)
|
|
162
162
|
]));
|
|
163
163
|
}
|
|
164
|
-
}), ae = { class: "beam__listview" }, le = /* @__PURE__ */
|
|
164
|
+
}), ae = { class: "beam__listview" }, le = /* @__PURE__ */ m({
|
|
165
165
|
__name: "ListView",
|
|
166
166
|
props: {
|
|
167
167
|
items: {}
|
|
168
168
|
},
|
|
169
169
|
emits: ["scrollbottom"],
|
|
170
|
-
setup(
|
|
171
|
-
const
|
|
170
|
+
setup(e, { emit: o }) {
|
|
171
|
+
const t = o;
|
|
172
172
|
k(() => {
|
|
173
173
|
window.addEventListener("scroll", s);
|
|
174
174
|
}), C(() => {
|
|
@@ -176,32 +176,34 @@ const G = /* @__PURE__ */ I(W, [["render", q]]), J = (t) => (V("data-v-4d5731cd"
|
|
|
176
176
|
});
|
|
177
177
|
const s = () => {
|
|
178
178
|
const n = document.documentElement.scrollHeight - window.innerHeight, a = document.documentElement.scrollTop;
|
|
179
|
-
n - a <= 2 &&
|
|
179
|
+
n - a <= 2 && t("scrollbottom");
|
|
180
180
|
};
|
|
181
181
|
return (n, a) => (l(), i("ul", ae, [
|
|
182
|
-
(l(!0), i(
|
|
182
|
+
(l(!0), i(N, null, S(n.items, (r) => (l(), i("li", {
|
|
183
|
+
key: r.label
|
|
184
|
+
}, [
|
|
183
185
|
r.linkComponent ? (l(), _(A(r.linkComponent), {
|
|
184
186
|
key: 0,
|
|
185
187
|
to: r.route,
|
|
186
188
|
tabindex: "-1"
|
|
187
189
|
}, {
|
|
188
190
|
default: $(() => [
|
|
189
|
-
T(
|
|
191
|
+
T(b, { item: r }, null, 8, ["item"])
|
|
190
192
|
]),
|
|
191
193
|
_: 2
|
|
192
|
-
}, 1032, ["to"])) : (l(), _(
|
|
194
|
+
}, 1032, ["to"])) : (l(), _(b, {
|
|
193
195
|
key: 1,
|
|
194
196
|
item: r
|
|
195
197
|
}, null, 8, ["item"]))
|
|
196
198
|
]))), 128))
|
|
197
199
|
]));
|
|
198
200
|
}
|
|
199
|
-
}), ce = { class: "beam__navbar" }, ie = /* @__PURE__ */ c("span", { class: "home-icon" }, "⬣", -1), re = /* @__PURE__ */ c("h1", { class: "nav-title" }, "TITLE", -1), me = { class: "navbar-action-wrapper" }, ue = /* @__PURE__ */
|
|
201
|
+
}), ce = { class: "beam__navbar" }, ie = /* @__PURE__ */ c("span", { class: "home-icon" }, "⬣", -1), re = /* @__PURE__ */ c("h1", { class: "nav-title" }, "TITLE", -1), me = { class: "navbar-action-wrapper" }, ue = /* @__PURE__ */ m({
|
|
200
202
|
__name: "Navbar",
|
|
201
203
|
emits: ["click"],
|
|
202
|
-
setup(
|
|
203
|
-
const
|
|
204
|
-
|
|
204
|
+
setup(e, { emit: o }) {
|
|
205
|
+
const t = o, s = () => {
|
|
206
|
+
t("click");
|
|
205
207
|
};
|
|
206
208
|
return (n, a) => (l(), i("nav", ce, [
|
|
207
209
|
d(n.$slots, "icon", {}, () => [
|
|
@@ -222,12 +224,12 @@ const G = /* @__PURE__ */ I(W, [["render", q]]), J = (t) => (V("data-v-4d5731cd"
|
|
|
222
224
|
])
|
|
223
225
|
]));
|
|
224
226
|
}
|
|
225
|
-
}), de = { id: "scan_input" }, _e = /* @__PURE__ */
|
|
227
|
+
}), de = { id: "scan_input" }, _e = /* @__PURE__ */ m({
|
|
226
228
|
__name: "ScanInput",
|
|
227
229
|
emits: ["scaninput"],
|
|
228
|
-
setup(
|
|
229
|
-
const
|
|
230
|
-
a.target.tagName !== "INPUT" && (a.key !== "Enter" ? s.value += `${a.key}` : (
|
|
230
|
+
setup(e, { emit: o }) {
|
|
231
|
+
const t = o, s = h(""), n = (a) => {
|
|
232
|
+
a.target.tagName !== "INPUT" && (a instanceof KeyboardEvent && a.key !== "Enter" ? s.value += `${a.key}` : (t("scaninput", s.value), s.value = ""));
|
|
231
233
|
};
|
|
232
234
|
return k(() => {
|
|
233
235
|
document.addEventListener("keypress", (a) => {
|
|
@@ -240,21 +242,21 @@ const G = /* @__PURE__ */ I(W, [["render", q]]), J = (t) => (V("data-v-4d5731cd"
|
|
|
240
242
|
}), (a, r) => (l(), i("div", de));
|
|
241
243
|
}
|
|
242
244
|
});
|
|
243
|
-
function
|
|
244
|
-
|
|
245
|
+
function ve(e) {
|
|
246
|
+
e.component("ActionFooter", H), e.component("BeamModal", U), e.component("BeamModalOutlet", z), e.component("Confirm", q), e.component("ItemCheck", w), e.component("ItemCount", y), e.component("ListAnchor", oe), e.component("ListItem", b), e.component("ListView", le), e.component("Navbar", ue), e.component("ScanInput", _e);
|
|
245
247
|
}
|
|
246
248
|
export {
|
|
247
249
|
H as ActionFooter,
|
|
248
250
|
U as BeamModal,
|
|
249
251
|
z as BeamModalOutlet,
|
|
250
|
-
|
|
252
|
+
q as Confirm,
|
|
251
253
|
w as ItemCheck,
|
|
252
254
|
y as ItemCount,
|
|
253
255
|
oe as ListAnchor,
|
|
254
|
-
|
|
256
|
+
b as ListItem,
|
|
255
257
|
le as ListView,
|
|
256
258
|
ue as Navbar,
|
|
257
259
|
_e as ScanInput,
|
|
258
|
-
|
|
260
|
+
ve as install
|
|
259
261
|
};
|
|
260
262
|
//# sourceMappingURL=beam.js.map
|
package/dist/beam.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beam.js","sources":["../src/components/ActionFooter.vue","../src/components/Confirm.vue","../src/components/ItemCheck.vue","../src/components/ItemCount.vue","../src/components/ListView.vue","../src/components/Navbar.vue","../src/components/ScanInput.vue","../src/index.ts"],"sourcesContent":["<template>\n\t<footer class=\"beam__actionfooter\">\n\t\t<span class=\"footer-action-wrapper\">\n\t\t\t<button class=\"footer-action btn\" @click=\"handleFooterAction\">\n\t\t\t\t<slot />\n\t\t\t</button>\n\t\t</span>\n\t</footer>\n</template>\n\n<script setup lang=\"ts\">\nconst emit = defineEmits(['click'])\n\nconst handleFooterAction = () => {\n\temit('click')\n}\n</script>\n","<template>\n\t<div class=\"beam__modal-confirm\">\n\t\t<h2>Would you like to continue?</h2>\n\t\t<button class=\"btn\" @click=\"$emit('confirmmodal')\">Yes</button>\n\t\t<button class=\"btn\" @click=\"$emit('closemodal')\">No</button>\n\t</div>\n</template>\n","<template>\n\t<label class=\"container\">\n\t\t<input type=\"checkbox\" :checked=\"value\" @input=\"handleInput\" tabindex=\"-1\" />\n\t\t<div class=\"checkmark\" tabindex=\"0\"></div>\n\t</label>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\n\n// make this v-model sensitive from parent\nconst props = defineProps<{\n\tvalue?: boolean\n}>()\n\nconst emit = defineEmits(['input'])\n\nconst checked = ref(props.value)\n\nconst handleInput = (e: InputEvent) => {\n\temit('input', checked.value)\n}\n</script>\n\n<style scoped>\n.container {\n\tdisplay: block;\n\tposition: relative;\n\tpadding-left: 2.5ch;\n\tmargin: 0;\n\tmargin-top: 0.5rem;\n\tcursor: pointer;\n\tfont-size: 2rem;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n}\n\n/* hide default checkbox */\n.container input {\n\tposition: absolute;\n\topacity: 0;\n\tcursor: pointer;\n\theight: 0;\n\twidth: 0;\n}\n\n.checkmark {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 2rem;\n\twidth: 2rem;\n\tbackground-color: #eee;\n\toutline: 2px solid transparent;\n\tborder: 1px solid var(--highlight);\n}\n\n.container:hover input ~ .checkmark {\n\tbackground-color: white;\n}\n\n.container input:checked ~ .checkmark {\n\tbackground-color: var(--brand-secondary);\n}\n\n.checkmark:after {\n\tcontent: '';\n\tposition: absolute;\n\tdisplay: none;\n}\n\n.container input:checked ~ .checkmark:after {\n\tdisplay: block;\n}\n\n.container .checkmark:after {\n\tleft: 25%;\n\ttop: 50%;\n\twidth: 0.5rem;\n\theight: 1rem;\n\tborder: solid var(--text-color);\n\tborder-width: 0 3px 3px 0;\n\t-webkit-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\ttransform: rotate(45deg) translate(-50%, -50%);\n}\n</style>\n","<template>\n\t<div class=\"beam__itemcount\">\n\t\t<span\n\t\t\t:contenteditable=\"editable\"\n\t\t\t:class=\"{ alert: countColor === false }\"\n\t\t\t@input=\"handleInput\"\n\t\t\t@click=\"handleInput\">\n\t\t\t{{ count }}\n\t\t</span>\n\t\t<span>/{{ denominator }}</span>\n\t\t<span v-if=\"uom\"> {{ uom }}</span>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed } from 'vue'\n\nconst emit = defineEmits(['input'])\nconst props = withDefaults(\n\tdefineProps<{\n\t\tvalue?: number\n\t\tdenominator: number\n\t\tuom?: string\n\t\teditable?: boolean\n\t}>(),\n\t{ value: 0, editable: true, uom: '' }\n)\n\nconst count = ref(props.value)\n\nconst handleInput = (event: InputEvent | MouseEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n\tcount.value = Number(event.target.innerHTML.replace(/[^0-9]/g, ''))\n\temit('input', count.value)\n}\n\nconst countColor = computed(() => {\n\treturn count.value === props.denominator\n})\n</script>\n","<template>\n\t<ul class=\"beam__listview\">\n\t\t<li v-for=\"(item, index) in items\" :key=\"index\">\n\t\t\t<template v-if=\"item.linkComponent\">\n\t\t\t\t<component :is=\"item.linkComponent\" :to=\"item.route\" tabindex=\"-1\">\n\t\t\t\t\t<ListItem :item=\"item\"></ListItem>\n\t\t\t\t</component>\n\t\t\t</template>\n\t\t\t<template v-else>\n\t\t\t\t<ListItem :item=\"item\"></ListItem>\n\t\t\t</template>\n\t\t</li>\n\t</ul>\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, onUnmounted } from 'vue'\n\nimport ListItem from './ListItem.vue'\n\ndefineProps<{\n\titems: {\n\t\tlabel: string\n\t\tdescription: string\n\t\tcount?: {\n\t\t\tcount: number\n\t\t\tof: number\n\t\t\tuom: string\n\t\t}\n\t\tchecked?: boolean\n\t\tlinkComponent?: string\n\t\troute?: string\n\t}[]\n}>()\n\nconst emit = defineEmits(['scrollbottom'])\n\nonMounted(() => {\n\twindow.addEventListener('scroll', handleScroll)\n})\n\nonUnmounted(() => {\n\twindow.removeEventListener('scroll', handleScroll)\n})\n\nconst handleScroll = () => {\n\tconst scrollHeightDifference = document.documentElement.scrollHeight - window.innerHeight\n\tconst scrollposition = document.documentElement.scrollTop\n\tif (scrollHeightDifference - scrollposition <= 2) {\n\t\temit('scrollbottom')\n\t}\n}\n</script>\n","<template>\n\t<nav class=\"beam__navbar\">\n\t\t<slot name=\"icon\">\n\t\t\t<span class=\"home-icon\">⬣</span>\n\t\t</slot>\n\t\t<slot name=\"title\">\n\t\t\t<h1 class=\"nav-title\">TITLE</h1>\n\t\t</slot>\n\t\t<div class=\"navbar-action-wrapper\">\n\t\t\t<button class=\"navbar-action btn\" @click=\"handlePrimaryAction\">\n\t\t\t\t<slot name=\"navbaraction\">Action</slot>\n\t\t\t</button>\n\t\t</div>\n\t</nav>\n</template>\n\n<script setup lang=\"ts\">\nconst emit = defineEmits(['click'])\n\nconst handlePrimaryAction = () => {\n\temit('click')\n}\n</script>\n","<template>\n\t<div id=\"scan_input\"></div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted, onUnmounted } from 'vue'\n\nconst emit = defineEmits(['scaninput'])\nconst barcode = ref('')\n\nconst handleScanInput = (event: InputEvent | KeyboardEvent) => {\n\tif (event.target.tagName !== 'INPUT') {\n\t\tif (event.key !== 'Enter') {\n\t\t\tbarcode.value += `${event.key}`\n\t\t} else {\n\t\t\temit('scaninput', barcode.value)\n\t\t\tbarcode.value = ''\n\t\t}\n\t}\n}\n\nonMounted(() => {\n\tdocument.addEventListener('keypress', event => {\n\t\thandleScanInput(event)\n\t})\n})\n\nonUnmounted(() => {\n\twindow.removeEventListener('keypress', event => {\n\t\thandleScanInput(event)\n\t})\n})\n</script>\n","import { App } from 'vue'\n\nimport ActionFooter from '@/components/ActionFooter.vue'\nimport BeamModal from '@/components/BeamModal.vue'\nimport BeamModalOutlet from '@/components/BeamModalOutlet.vue'\nimport Confirm from '@/components/Confirm.vue'\nimport ItemCheck from '@/components/ItemCheck.vue'\nimport ItemCount from '@/components/ItemCount.vue'\nimport ListAnchor from '@/components/ListAnchor.vue'\nimport ListItem from '@/components/ListItem.vue'\nimport ListView from '@/components/ListView.vue'\nimport Navbar from '@/components/Navbar.vue'\nimport ScanInput from '@/components/ScanInput.vue'\n\nfunction install(app: App /* options */) {\n\tapp.component('ActionFooter', ActionFooter)\n\tapp.component('BeamModal', BeamModal)\n\tapp.component('BeamModalOutlet', BeamModalOutlet)\n\tapp.component('Confirm', Confirm)\n\tapp.component('ItemCheck', ItemCheck)\n\tapp.component('ItemCount', ItemCount)\n\tapp.component('ListAnchor', ListAnchor)\n\tapp.component('ListItem', ListItem)\n\tapp.component('ListView', ListView)\n\tapp.component('Navbar', Navbar)\n\tapp.component('ScanInput', ScanInput)\n}\n\nexport {\n\tActionFooter,\n\tBeamModal,\n\tBeamModalOutlet,\n\tConfirm,\n\tItemCheck,\n\tItemCount,\n\tListAnchor,\n\tListItem,\n\tListView,\n\tNavbar,\n\tScanInput,\n\tinstall,\n}\n"],"names":["emit","__emit","handleFooterAction","_hoisted_1","_sfc_render","_ctx","_cache","_openBlock","_createElementBlock","_hoisted_2","_createElementVNode","$event","props","__props","checked","ref","handleInput","e","count","event","countColor","computed","onMounted","handleScroll","onUnmounted","scrollHeightDifference","scrollposition","handlePrimaryAction","barcode","handleScanInput","install","app","Act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,CAAQ,GAC9BR,EAAA,UAAU,YAAYS,EAAQ,GAC9BT,EAAA,UAAU,UAAUU,EAAM,GAC1BV,EAAA,UAAU,aAAaW,EAAS;AACrC;"}
|
|
1
|
+
{"version":3,"file":"beam.js","sources":["../src/components/ActionFooter.vue","../src/components/Confirm.vue","../src/components/ItemCheck.vue","../src/components/ItemCount.vue","../src/components/ListItem.vue","../src/components/ListView.vue","../src/components/Navbar.vue","../src/components/ScanInput.vue","../src/index.ts"],"sourcesContent":["<template>\n\t<footer class=\"beam__actionfooter\">\n\t\t<span class=\"footer-action-wrapper\">\n\t\t\t<button class=\"footer-action btn\" @click=\"handleFooterAction\">\n\t\t\t\t<slot />\n\t\t\t</button>\n\t\t</span>\n\t</footer>\n</template>\n\n<script setup lang=\"ts\">\nconst emit = defineEmits(['click'])\n\nconst handleFooterAction = () => {\n\temit('click')\n}\n</script>\n","<template>\n\t<div class=\"beam__modal-confirm\">\n\t\t<h2>Would you like to continue?</h2>\n\t\t<button class=\"btn\" @click=\"$emit('confirmmodal')\">Yes</button>\n\t\t<button class=\"btn\" @click=\"$emit('closemodal')\">No</button>\n\t</div>\n</template>\n","<template>\n\t<label class=\"container\">\n\t\t<input type=\"checkbox\" :checked=\"value\" @input=\"handleInput\" tabindex=\"-1\" />\n\t\t<div class=\"checkmark\" tabindex=\"0\"></div>\n\t</label>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\n\n// make this v-model sensitive from parent\nconst props = defineProps<{\n\tvalue?: boolean\n}>()\n\nconst emit = defineEmits(['input'])\n\nconst checked = ref(props.value)\n\nconst handleInput = () => {\n\temit('input', checked.value)\n}\n</script>\n\n<style scoped>\n.container {\n\tdisplay: block;\n\tposition: relative;\n\tpadding-left: 2.5ch;\n\tmargin: 0;\n\tmargin-top: 0.5rem;\n\tcursor: pointer;\n\tfont-size: 2rem;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n}\n\n/* hide default checkbox */\n.container input {\n\tposition: absolute;\n\topacity: 0;\n\tcursor: pointer;\n\theight: 0;\n\twidth: 0;\n}\n\n.checkmark {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 2rem;\n\twidth: 2rem;\n\tbackground-color: #eee;\n\toutline: 2px solid transparent;\n\tborder: 1px solid var(--highlight);\n}\n\n.container:hover input ~ .checkmark {\n\tbackground-color: white;\n}\n\n.container input:checked ~ .checkmark {\n\tbackground-color: var(--brand-secondary);\n}\n\n.checkmark:after {\n\tcontent: '';\n\tposition: absolute;\n\tdisplay: none;\n}\n\n.container input:checked ~ .checkmark:after {\n\tdisplay: block;\n}\n\n.container .checkmark:after {\n\tleft: 25%;\n\ttop: 50%;\n\twidth: 0.5rem;\n\theight: 1rem;\n\tborder: solid var(--text-color);\n\tborder-width: 0 3px 3px 0;\n\t-webkit-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\ttransform: rotate(45deg) translate(-50%, -50%);\n}\n</style>\n","<template>\n\t<div class=\"beam__itemcount\">\n\t\t<span\n\t\t\t:contenteditable=\"editable\"\n\t\t\t:class=\"{ alert: countColor === false }\"\n\t\t\t@input=\"handleInput\"\n\t\t\t@click=\"handleInput\">\n\t\t\t{{ count }}\n\t\t</span>\n\t\t<span>/{{ denominator }}</span>\n\t\t<span v-if=\"uom\"> {{ uom }}</span>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed } from 'vue'\n\nconst emit = defineEmits(['input'])\nconst props = withDefaults(\n\tdefineProps<{\n\t\tvalue?: number\n\t\tdenominator: number\n\t\tuom?: string\n\t\teditable?: boolean\n\t}>(),\n\t{ value: 0, editable: true, uom: '' }\n)\n\nconst count = ref(props.value)\n\nconst handleInput = (event: InputEvent | MouseEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n\tcount.value = Number((event.target as HTMLElement).innerHTML.replace(/[^0-9]/g, ''))\n\temit('input', count.value)\n}\n\nconst countColor = computed(() => {\n\treturn count.value === props.denominator\n})\n</script>\n","<template>\n\t<li tabindex=\"0\" class=\"beam__listitem\">\n\t\t<div class=\"beam__listtext\">\n\t\t\t<label>{{ item.label }}</label>\n\t\t\t<p>{{ item.description }}</p>\n\t\t</div>\n\n\t\t<ItemCount\n\t\t\tv-if=\"item.count\"\n\t\t\tv-model=\"listItem.count.count\"\n\t\t\t:denominator=\"item.count.of\"\n\t\t\t:uom=\"item.count.uom\"\n\t\t\t:editable=\"true\" />\n\t\t<ItemCheck v-if=\"item.hasOwnProperty('checked')\" v-model=\"listItem.checked\" />\n\t</li>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\n\nimport ItemCount from '@/components/ItemCount.vue'\nimport ItemCheck from '@/components/ItemCheck.vue'\n\nconst props = defineProps<{\n\titem: {\n\t\tlabel: string\n\t\tdescription: string\n\t\tcount?: {\n\t\t\tcount: number\n\t\t\tof: number\n\t\t\tuom: string\n\t\t}\n\t\tchecked?: boolean\n\t}\n}>()\n\nconst listItem = ref(props.item)\n</script>\n","<template>\n\t<ul class=\"beam__listview\">\n\t\t<li v-for=\"item in items\" :key=\"item.label\">\n\t\t\t<template v-if=\"item.linkComponent\">\n\t\t\t\t<component :is=\"item.linkComponent\" :to=\"item.route\" tabindex=\"-1\">\n\t\t\t\t\t<ListItem :item=\"item\"></ListItem>\n\t\t\t\t</component>\n\t\t\t</template>\n\t\t\t<template v-else>\n\t\t\t\t<ListItem :item=\"item\"></ListItem>\n\t\t\t</template>\n\t\t</li>\n\t</ul>\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, onUnmounted } from 'vue'\n\nimport ListItem from '@/components/ListItem.vue'\n\ndefineProps<{\n\titems: {\n\t\tlabel: string\n\t\tdescription: string\n\t\tcount?: {\n\t\t\tcount: number\n\t\t\tof: number\n\t\t\tuom: string\n\t\t}\n\t\tchecked?: boolean\n\t\tlinkComponent?: string\n\t\troute?: string\n\t}[]\n}>()\n\nconst emit = defineEmits(['scrollbottom'])\n\nonMounted(() => {\n\twindow.addEventListener('scroll', handleScroll)\n})\n\nonUnmounted(() => {\n\twindow.removeEventListener('scroll', handleScroll)\n})\n\nconst handleScroll = () => {\n\tconst scrollHeightDifference = document.documentElement.scrollHeight - window.innerHeight\n\tconst scrollposition = document.documentElement.scrollTop\n\tif (scrollHeightDifference - scrollposition <= 2) {\n\t\temit('scrollbottom')\n\t}\n}\n</script>\n","<template>\n\t<nav class=\"beam__navbar\">\n\t\t<slot name=\"icon\">\n\t\t\t<span class=\"home-icon\">⬣</span>\n\t\t</slot>\n\t\t<slot name=\"title\">\n\t\t\t<h1 class=\"nav-title\">TITLE</h1>\n\t\t</slot>\n\t\t<div class=\"navbar-action-wrapper\">\n\t\t\t<button class=\"navbar-action btn\" @click=\"handlePrimaryAction\">\n\t\t\t\t<slot name=\"navbaraction\">Action</slot>\n\t\t\t</button>\n\t\t</div>\n\t</nav>\n</template>\n\n<script setup lang=\"ts\">\nconst emit = defineEmits(['click'])\n\nconst handlePrimaryAction = () => {\n\temit('click')\n}\n</script>\n","<template>\n\t<div id=\"scan_input\"></div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted, onUnmounted } from 'vue'\n\nconst emit = defineEmits(['scaninput'])\nconst barcode = ref('')\n\nconst handleScanInput = (event: InputEvent | KeyboardEvent) => {\n\tif ((event.target as HTMLElement).tagName !== 'INPUT') {\n\t\tif (event instanceof KeyboardEvent && event.key !== 'Enter') {\n\t\t\tbarcode.value += `${event.key}`\n\t\t} else {\n\t\t\temit('scaninput', barcode.value)\n\t\t\tbarcode.value = ''\n\t\t}\n\t}\n}\n\nonMounted(() => {\n\tdocument.addEventListener('keypress', event => {\n\t\thandleScanInput(event)\n\t})\n})\n\nonUnmounted(() => {\n\twindow.removeEventListener('keypress', event => {\n\t\thandleScanInput(event)\n\t})\n})\n</script>\n","import { App } from 'vue'\n\nimport ActionFooter from '@/components/ActionFooter.vue'\nimport BeamModal from '@/components/BeamModal.vue'\nimport BeamModalOutlet from '@/components/BeamModalOutlet.vue'\nimport Confirm from '@/components/Confirm.vue'\nimport ItemCheck from '@/components/ItemCheck.vue'\nimport ItemCount from '@/components/ItemCount.vue'\nimport ListAnchor from '@/components/ListAnchor.vue'\nimport ListItem from '@/components/ListItem.vue'\nimport ListView from '@/components/ListView.vue'\nimport Navbar from '@/components/Navbar.vue'\nimport ScanInput from '@/components/ScanInput.vue'\n\n/**\n * Install all Beam components\n * @param app - Vue app instance\n * @public\n */\nfunction install(app: App /* options */) {\n\tapp.component('ActionFooter', ActionFooter)\n\tapp.component('BeamModal', BeamModal)\n\tapp.component('BeamModalOutlet', BeamModalOutlet)\n\tapp.component('Confirm', Confirm)\n\tapp.component('ItemCheck', ItemCheck)\n\tapp.component('ItemCount', ItemCount)\n\tapp.component('ListAnchor', ListAnchor)\n\tapp.component('ListItem', ListItem)\n\tapp.component('ListView', ListView)\n\tapp.component('Navbar', Navbar)\n\tapp.component('ScanInput', ScanInput)\n}\n\nexport {\n\tActionFooter,\n\tBeamModal,\n\tBeamModalOutlet,\n\tConfirm,\n\tItemCheck,\n\tItemCount,\n\tListAnchor,\n\tListItem,\n\tListView,\n\tNavbar,\n\tScanInput,\n\tinstall,\n}\n"],"names":["emit","__emit","handleFooterAction","_hoisted_1","_sfc_render","_ctx","_cache","_openBlock","_createElementBlock","_hoisted_2","_createElementVNode","$event","props","__props","checked","ref","handleInput","count","event","countColor","computed","listItem","onMounted","handleScroll","onUnmounted","scrollHeightDifference","scrollposition","handlePrimaryAction","barcode","handleScanInput","install","app","ActionFooter","BeamModal","BeamModalOutlet","Confirm","ItemCheck","ItemCount","ListAnchor","ListItem","ListView","Navbar","ScanInput"],"mappings":";;;;;AAWA,UAAMA,IAAOC,GAEPC,IAAqB,MAAM;AAChC,MAAAF,EAAK,OAAO;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCZXG,IAAA,EAAA,OAAA,sBAAA;AADD,SAAAC,EAAAC,GAAA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-
(function(
|
|
1
|
+
(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s["@stonecrop/beam"]={},s.Vue))})(this,function(s,e){"use strict";const E={class:"beam__actionfooter"},V={class:"footer-action-wrapper"},_=e.defineComponent({__name:"ActionFooter",emits:["click"],setup(t,{emit:o}){const n=o,c=()=>{n("click")};return(l,a)=>(e.openBlock(),e.createElementBlock("footer",E,[e.createElementVNode("span",V,[e.createElementVNode("button",{class:"footer-action btn",onClick:c},[e.renderSlot(l.$slots,"default")])])]))}}),N={class:"beam__modal"},f=e.defineComponent({__name:"BeamModal",props:{showModal:{type:Boolean}},setup(t){return(o,n)=>{const c=e.resolveComponent("portal");return e.openBlock(),e.createBlock(c,{to:"beam__modal_outlet"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",N,[e.createElementVNode("button",{class:"btn",onClick:n[0]||(n[0]=l=>o.$emit("closemodal"))},"Close Modal"),e.renderSlot(o.$slots,"default",{onClosemodal:n[1]||(n[1]=l=>o.$emit("closemodal")),onConfirmmodal:n[2]||(n[2]=l=>o.$emit("confirmmodal"))})],512),[[e.vShow,o.showModal]])]),_:3})}}}),k=e.defineComponent({__name:"BeamModalOutlet",setup(t){return(o,n)=>{const c=e.resolveComponent("portal-target");return e.openBlock(),e.createBlock(c,{name:"beam__modal_outlet"})}}}),u=(t,o)=>{const n=t.__vccOpts||t;for(const[c,l]of o)n[c]=l;return n},y={},I={class:"beam__modal-confirm"},w=e.createElementVNode("h2",null,"Would you like to continue?",-1);function S(t,o){return e.openBlock(),e.createElementBlock("div",I,[w,e.createElementVNode("button",{class:"btn",onClick:o[0]||(o[0]=n=>t.$emit("confirmmodal"))},"Yes"),e.createElementVNode("button",{class:"btn",onClick:o[1]||(o[1]=n=>t.$emit("closemodal"))},"No")])}const h=u(y,[["render",S]]),g=t=>(e.pushScopeId("data-v-7261b52e"),t=t(),e.popScopeId(),t),L={class:"container"},M=["checked"],A=g(()=>e.createElementVNode("div",{class:"checkmark",tabindex:"0"},null,-1)),d=u(e.defineComponent({__name:"ItemCheck",props:{value:{type:Boolean}},emits:["input"],setup(t,{emit:o}){const n=t,c=o,l=e.ref(n.value),a=()=>{c("input",l.value)};return(r,i)=>(e.openBlock(),e.createElementBlock("label",L,[e.createElementVNode("input",{type:"checkbox",checked:r.value,onInput:a,tabindex:"-1"},null,40,M),A]))}}),[["__scopeId","data-v-7261b52e"]]),D={class:"beam__itemcount"},T=["contenteditable"],O={key:0},p=e.defineComponent({__name:"ItemCount",props:{value:{default:0},denominator:{},uom:{default:""},editable:{type:Boolean,default:!0}},emits:["input"],setup(t,{emit:o}){const n=o,c=t,l=e.ref(c.value),a=i=>{i.preventDefault(),i.stopPropagation(),l.value=Number(i.target.innerHTML.replace(/[^0-9]/g,"")),n("input",l.value)},r=e.computed(()=>l.value===c.denominator);return(i,J)=>(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("span",{contenteditable:i.editable,class:e.normalizeClass({alert:r.value===!1}),onInput:a,onClick:a},e.toDisplayString(l.value),43,T),e.createElementVNode("span",null,"/"+e.toDisplayString(i.denominator),1),i.uom?(e.openBlock(),e.createElementBlock("span",O," "+e.toDisplayString(i.uom),1)):e.createCommentVNode("",!0)]))}}),F=["href"],b=e.defineComponent({__name:"ListAnchor",props:{to:{default:""}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("a",{href:o.to,class:"beam__listanchor"},[e.renderSlot(o.$slots,"default")],8,F))}}),P={tabindex:"0",class:"beam__listitem"},U={class:"beam__listtext"},m=e.defineComponent({__name:"ListItem",props:{item:{}},setup(t){const o=t,n=e.ref(o.item);return(c,l)=>(e.openBlock(),e.createElementBlock("li",P,[e.createElementVNode("div",U,[e.createElementVNode("label",null,e.toDisplayString(c.item.label),1),e.createElementVNode("p",null,e.toDisplayString(c.item.description),1)]),c.item.count?(e.openBlock(),e.createBlock(p,{key:0,modelValue:n.value.count.count,"onUpdate:modelValue":l[0]||(l[0]=a=>n.value.count.count=a),denominator:c.item.count.of,uom:c.item.count.uom,editable:!0},null,8,["modelValue","denominator","uom"])):e.createCommentVNode("",!0),c.item.hasOwnProperty("checked")?(e.openBlock(),e.createBlock(d,{key:1,modelValue:n.value.checked,"onUpdate:modelValue":l[1]||(l[1]=a=>n.value.checked=a)},null,8,["modelValue"])):e.createCommentVNode("",!0)]))}}),H={class:"beam__listview"},B=e.defineComponent({__name:"ListView",props:{items:{}},emits:["scrollbottom"],setup(t,{emit:o}){const n=o;e.onMounted(()=>{window.addEventListener("scroll",c)}),e.onUnmounted(()=>{window.removeEventListener("scroll",c)});const c=()=>{const l=document.documentElement.scrollHeight-window.innerHeight,a=document.documentElement.scrollTop;l-a<=2&&n("scrollbottom")};return(l,a)=>(e.openBlock(),e.createElementBlock("ul",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,r=>(e.openBlock(),e.createElementBlock("li",{key:r.label},[r.linkComponent?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.linkComponent),{key:0,to:r.route,tabindex:"-1"},{default:e.withCtx(()=>[e.createVNode(m,{item:r},null,8,["item"])]),_:2},1032,["to"])):(e.openBlock(),e.createBlock(m,{key:1,item:r},null,8,["item"]))]))),128))]))}}),j={class:"beam__navbar"},q=e.createElementVNode("span",{class:"home-icon"},"⬣",-1),z=e.createElementVNode("h1",{class:"nav-title"},"TITLE",-1),K={class:"navbar-action-wrapper"},$=e.defineComponent({__name:"Navbar",emits:["click"],setup(t,{emit:o}){const n=o,c=()=>{n("click")};return(l,a)=>(e.openBlock(),e.createElementBlock("nav",j,[e.renderSlot(l.$slots,"icon",{},()=>[q]),e.renderSlot(l.$slots,"title",{},()=>[z]),e.createElementVNode("div",K,[e.createElementVNode("button",{class:"navbar-action btn",onClick:c},[e.renderSlot(l.$slots,"navbaraction",{},()=>[e.createTextVNode("Action")])])])]))}}),W={id:"scan_input"},C=e.defineComponent({__name:"ScanInput",emits:["scaninput"],setup(t,{emit:o}){const n=o,c=e.ref(""),l=a=>{a.target.tagName!=="INPUT"&&(a instanceof KeyboardEvent&&a.key!=="Enter"?c.value+=`${a.key}`:(n("scaninput",c.value),c.value=""))};return e.onMounted(()=>{document.addEventListener("keypress",a=>{l(a)})}),e.onUnmounted(()=>{window.removeEventListener("keypress",a=>{l(a)})}),(a,r)=>(e.openBlock(),e.createElementBlock("div",W))}});function Y(t){t.component("ActionFooter",_),t.component("BeamModal",f),t.component("BeamModalOutlet",k),t.component("Confirm",h),t.component("ItemCheck",d),t.component("ItemCount",p),t.component("ListAnchor",b),t.component("ListItem",m),t.component("ListView",B),t.component("Navbar",$),t.component("ScanInput",C)}s.ActionFooter=_,s.BeamModal=f,s.BeamModalOutlet=k,s.Confirm=h,s.ItemCheck=d,s.ItemCount=p,s.ListAnchor=b,s.ListItem=m,s.ListView=B,s.Navbar=$,s.ScanInput=C,s.install=Y,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=beam.umd.cjs.map
|
package/dist/beam.umd.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beam.umd.cjs","sources":["../src/components/ActionFooter.vue","../src/components/Confirm.vue","../src/components/ItemCheck.vue","../src/components/ItemCount.vue","../src/components/ListView.vue","../src/components/Navbar.vue","../src/components/ScanInput.vue","../src/index.ts"],"sourcesContent":["<template>\n\t<footer class=\"beam__actionfooter\">\n\t\t<span class=\"footer-action-wrapper\">\n\t\t\t<button class=\"footer-action btn\" @click=\"handleFooterAction\">\n\t\t\t\t<slot />\n\t\t\t</button>\n\t\t</span>\n\t</footer>\n</template>\n\n<script setup lang=\"ts\">\nconst emit = defineEmits(['click'])\n\nconst handleFooterAction = () => {\n\temit('click')\n}\n</script>\n","<template>\n\t<div class=\"beam__modal-confirm\">\n\t\t<h2>Would you like to continue?</h2>\n\t\t<button class=\"btn\" @click=\"$emit('confirmmodal')\">Yes</button>\n\t\t<button class=\"btn\" @click=\"$emit('closemodal')\">No</button>\n\t</div>\n</template>\n","<template>\n\t<label class=\"container\">\n\t\t<input type=\"checkbox\" :checked=\"value\" @input=\"handleInput\" tabindex=\"-1\" />\n\t\t<div class=\"checkmark\" tabindex=\"0\"></div>\n\t</label>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\n\n// make this v-model sensitive from parent\nconst props = defineProps<{\n\tvalue?: boolean\n}>()\n\nconst emit = defineEmits(['input'])\n\nconst checked = ref(props.value)\n\nconst handleInput = (e: InputEvent) => {\n\temit('input', checked.value)\n}\n</script>\n\n<style scoped>\n.container {\n\tdisplay: block;\n\tposition: relative;\n\tpadding-left: 2.5ch;\n\tmargin: 0;\n\tmargin-top: 0.5rem;\n\tcursor: pointer;\n\tfont-size: 2rem;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n}\n\n/* hide default checkbox */\n.container input {\n\tposition: absolute;\n\topacity: 0;\n\tcursor: pointer;\n\theight: 0;\n\twidth: 0;\n}\n\n.checkmark {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 2rem;\n\twidth: 2rem;\n\tbackground-color: #eee;\n\toutline: 2px solid transparent;\n\tborder: 1px solid var(--highlight);\n}\n\n.container:hover input ~ .checkmark {\n\tbackground-color: white;\n}\n\n.container input:checked ~ .checkmark {\n\tbackground-color: var(--brand-secondary);\n}\n\n.checkmark:after {\n\tcontent: '';\n\tposition: absolute;\n\tdisplay: none;\n}\n\n.container input:checked ~ .checkmark:after {\n\tdisplay: block;\n}\n\n.container .checkmark:after {\n\tleft: 25%;\n\ttop: 50%;\n\twidth: 0.5rem;\n\theight: 1rem;\n\tborder: solid var(--text-color);\n\tborder-width: 0 3px 3px 0;\n\t-webkit-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\ttransform: rotate(45deg) translate(-50%, -50%);\n}\n</style>\n","<template>\n\t<div class=\"beam__itemcount\">\n\t\t<span\n\t\t\t:contenteditable=\"editable\"\n\t\t\t:class=\"{ alert: countColor === false }\"\n\t\t\t@input=\"handleInput\"\n\t\t\t@click=\"handleInput\">\n\t\t\t{{ count }}\n\t\t</span>\n\t\t<span>/{{ denominator }}</span>\n\t\t<span v-if=\"uom\"> {{ uom }}</span>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed } from 'vue'\n\nconst emit = defineEmits(['input'])\nconst props = withDefaults(\n\tdefineProps<{\n\t\tvalue?: number\n\t\tdenominator: number\n\t\tuom?: string\n\t\teditable?: boolean\n\t}>(),\n\t{ value: 0, editable: true, uom: '' }\n)\n\nconst count = ref(props.value)\n\nconst handleInput = (event: InputEvent | MouseEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n\tcount.value = Number(event.target.innerHTML.replace(/[^0-9]/g, ''))\n\temit('input', count.value)\n}\n\nconst countColor = computed(() => {\n\treturn count.value === props.denominator\n})\n</script>\n","<template>\n\t<ul class=\"beam__listview\">\n\t\t<li v-for=\"(item, index) in items\" :key=\"index\">\n\t\t\t<template v-if=\"item.linkComponent\">\n\t\t\t\t<component :is=\"item.linkComponent\" :to=\"item.route\" tabindex=\"-1\">\n\t\t\t\t\t<ListItem :item=\"item\"></ListItem>\n\t\t\t\t</component>\n\t\t\t</template>\n\t\t\t<template v-else>\n\t\t\t\t<ListItem :item=\"item\"></ListItem>\n\t\t\t</template>\n\t\t</li>\n\t</ul>\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, onUnmounted } from 'vue'\n\nimport ListItem from './ListItem.vue'\n\ndefineProps<{\n\titems: {\n\t\tlabel: string\n\t\tdescription: string\n\t\tcount?: {\n\t\t\tcount: number\n\t\t\tof: number\n\t\t\tuom: string\n\t\t}\n\t\tchecked?: boolean\n\t\tlinkComponent?: string\n\t\troute?: string\n\t}[]\n}>()\n\nconst emit = defineEmits(['scrollbottom'])\n\nonMounted(() => {\n\twindow.addEventListener('scroll', handleScroll)\n})\n\nonUnmounted(() => {\n\twindow.removeEventListener('scroll', handleScroll)\n})\n\nconst handleScroll = () => {\n\tconst scrollHeightDifference = document.documentElement.scrollHeight - window.innerHeight\n\tconst scrollposition = document.documentElement.scrollTop\n\tif (scrollHeightDifference - scrollposition <= 2) {\n\t\temit('scrollbottom')\n\t}\n}\n</script>\n","<template>\n\t<nav class=\"beam__navbar\">\n\t\t<slot name=\"icon\">\n\t\t\t<span class=\"home-icon\">⬣</span>\n\t\t</slot>\n\t\t<slot name=\"title\">\n\t\t\t<h1 class=\"nav-title\">TITLE</h1>\n\t\t</slot>\n\t\t<div class=\"navbar-action-wrapper\">\n\t\t\t<button class=\"navbar-action btn\" @click=\"handlePrimaryAction\">\n\t\t\t\t<slot name=\"navbaraction\">Action</slot>\n\t\t\t</button>\n\t\t</div>\n\t</nav>\n</template>\n\n<script setup lang=\"ts\">\nconst emit = defineEmits(['click'])\n\nconst handlePrimaryAction = () => {\n\temit('click')\n}\n</script>\n","<template>\n\t<div id=\"scan_input\"></div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted, onUnmounted } from 'vue'\n\nconst emit = defineEmits(['scaninput'])\nconst barcode = ref('')\n\nconst handleScanInput = (event: InputEvent | KeyboardEvent) => {\n\tif (event.target.tagName !== 'INPUT') {\n\t\tif (event.key !== 'Enter') {\n\t\t\tbarcode.value += `${event.key}`\n\t\t} else {\n\t\t\temit('scaninput', barcode.value)\n\t\t\tbarcode.value = ''\n\t\t}\n\t}\n}\n\nonMounted(() => {\n\tdocument.addEventListener('keypress', event => {\n\t\thandleScanInput(event)\n\t})\n})\n\nonUnmounted(() => {\n\twindow.removeEventListener('keypress', event => {\n\t\thandleScanInput(event)\n\t})\n})\n</script>\n","import { App } from 'vue'\n\nimport ActionFooter from '@/components/ActionFooter.vue'\nimport BeamModal from '@/components/BeamModal.vue'\nimport BeamModalOutlet from '@/components/BeamModalOutlet.vue'\nimport Confirm from '@/components/Confirm.vue'\nimport ItemCheck from '@/components/ItemCheck.vue'\nimport ItemCount from '@/components/ItemCount.vue'\nimport ListAnchor from '@/components/ListAnchor.vue'\nimport ListItem from '@/components/ListItem.vue'\nimport ListView from '@/components/ListView.vue'\nimport Navbar from '@/components/Navbar.vue'\nimport ScanInput from '@/components/ScanInput.vue'\n\nfunction install(app: App /* options */) {\n\tapp.component('ActionFooter', ActionFooter)\n\tapp.component('BeamModal', BeamModal)\n\tapp.component('BeamModalOutlet', BeamModalOutlet)\n\tapp.component('Confirm', Confirm)\n\tapp.component('ItemCheck', ItemCheck)\n\tapp.component('ItemCount', ItemCount)\n\tapp.component('ListAnchor', ListAnchor)\n\tapp.component('ListItem', ListItem)\n\tapp.component('ListView', ListView)\n\tapp.component('Navbar', Navbar)\n\tapp.component('ScanInput', ScanInput)\n}\n\nexport {\n\tActionFooter,\n\tBeamModal,\n\tBeamModalOutlet,\n\tConfirm,\n\tItemCheck,\n\tItemCount,\n\tListAnchor,\n\tListItem,\n\tListView,\n\tNavbar,\n\tScanInput,\n\tinstall,\n}\n"],"names":["emit","__emit","handleFooterAction","_hoisted_1","_sfc_render","_ctx","_cache","_openBlock","_createElementBlock","_hoisted_2","_createElementVNode","$event","props","__props","checked","ref","handleInput","e","count","event","countColor","computed","onMounted","handleScroll","onUnmounted","scrollHeightDifference","scrollposition","handlePrimaryAction","barcode","handleScanInput","install","app","ActionFooter","BeamModal","BeamModalOutlet","Confirm","ItemCheck","ItemCount","ListAnchor","ListItem","ListView","Navbar","ScanInput"],"mappings":"2ZAWA,MAAMA,EAAOC,EAEPC,EAAqB,IAAM,CAChCF,EAAK,OAAO,CAAA,gkCCZXG,EAAA,CAAA,MAAA,qBAAA,qEADD,SAAAC,EAAAC,EAAAC,EAAA,QACqCC,YAAA,EAAAC,qBAAA,MAAAL,EAAA,CACpCM,EAAQC,EAAAA,mBAAW,SAAA,CAAE,MAAK,cAA4BJ,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAK,GAAAN,EAAA,MAAA,cAAA,EAC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,SAAA,iBAAiB,WAAqBH,GAAA,CAC9CU,EAAgBV,CAAK,CAAA,CACrB,CAAA,CACD,EAEDK,EAAAA,YAAY,IAAM,CACV,OAAA,oBAAoB,WAAqBL,GAAA,CAC/CU,EAAgBV,CAAK,CAAA,CACrB,CAAA,CACD,0DCjBD,SAASW,EAAQC,EAAwB,CACpCA,EAAA,UAAU,eAAgBC,CAAY,EACtCD,EAAA,UAAU,YAAaE,CAAS,EAChCF,EAAA,UAAU,kBAAmBG,CAAe,EAC5CH,EAAA,UAAU,UAAWI,CAAO,EAC5BJ,EAAA,UAAU,YAAaK,CAAS,EAChCL,EAAA,UAAU,YAAaM,CAAS,EAChCN,EAAA,UAAU,aAAcO,CAAU,EAClCP,EAAA,UAAU,WAAYQ,CAAQ,EAC9BR,EAAA,UAAU,WAAYS,CAAQ,EAC9BT,EAAA,UAAU,SAAUU,CAAM,EAC1BV,EAAA,UAAU,YAAaW,CAAS,CACrC"}
|
|
1
|
+
{"version":3,"file":"beam.umd.cjs","sources":["../src/components/ActionFooter.vue","../src/components/Confirm.vue","../src/components/ItemCheck.vue","../src/components/ItemCount.vue","../src/components/ListItem.vue","../src/components/ListView.vue","../src/components/Navbar.vue","../src/components/ScanInput.vue","../src/index.ts"],"sourcesContent":["<template>\n\t<footer class=\"beam__actionfooter\">\n\t\t<span class=\"footer-action-wrapper\">\n\t\t\t<button class=\"footer-action btn\" @click=\"handleFooterAction\">\n\t\t\t\t<slot />\n\t\t\t</button>\n\t\t</span>\n\t</footer>\n</template>\n\n<script setup lang=\"ts\">\nconst emit = defineEmits(['click'])\n\nconst handleFooterAction = () => {\n\temit('click')\n}\n</script>\n","<template>\n\t<div class=\"beam__modal-confirm\">\n\t\t<h2>Would you like to continue?</h2>\n\t\t<button class=\"btn\" @click=\"$emit('confirmmodal')\">Yes</button>\n\t\t<button class=\"btn\" @click=\"$emit('closemodal')\">No</button>\n\t</div>\n</template>\n","<template>\n\t<label class=\"container\">\n\t\t<input type=\"checkbox\" :checked=\"value\" @input=\"handleInput\" tabindex=\"-1\" />\n\t\t<div class=\"checkmark\" tabindex=\"0\"></div>\n\t</label>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\n\n// make this v-model sensitive from parent\nconst props = defineProps<{\n\tvalue?: boolean\n}>()\n\nconst emit = defineEmits(['input'])\n\nconst checked = ref(props.value)\n\nconst handleInput = () => {\n\temit('input', checked.value)\n}\n</script>\n\n<style scoped>\n.container {\n\tdisplay: block;\n\tposition: relative;\n\tpadding-left: 2.5ch;\n\tmargin: 0;\n\tmargin-top: 0.5rem;\n\tcursor: pointer;\n\tfont-size: 2rem;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n}\n\n/* hide default checkbox */\n.container input {\n\tposition: absolute;\n\topacity: 0;\n\tcursor: pointer;\n\theight: 0;\n\twidth: 0;\n}\n\n.checkmark {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 2rem;\n\twidth: 2rem;\n\tbackground-color: #eee;\n\toutline: 2px solid transparent;\n\tborder: 1px solid var(--highlight);\n}\n\n.container:hover input ~ .checkmark {\n\tbackground-color: white;\n}\n\n.container input:checked ~ .checkmark {\n\tbackground-color: var(--brand-secondary);\n}\n\n.checkmark:after {\n\tcontent: '';\n\tposition: absolute;\n\tdisplay: none;\n}\n\n.container input:checked ~ .checkmark:after {\n\tdisplay: block;\n}\n\n.container .checkmark:after {\n\tleft: 25%;\n\ttop: 50%;\n\twidth: 0.5rem;\n\theight: 1rem;\n\tborder: solid var(--text-color);\n\tborder-width: 0 3px 3px 0;\n\t-webkit-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\ttransform: rotate(45deg) translate(-50%, -50%);\n}\n</style>\n","<template>\n\t<div class=\"beam__itemcount\">\n\t\t<span\n\t\t\t:contenteditable=\"editable\"\n\t\t\t:class=\"{ alert: countColor === false }\"\n\t\t\t@input=\"handleInput\"\n\t\t\t@click=\"handleInput\">\n\t\t\t{{ count }}\n\t\t</span>\n\t\t<span>/{{ denominator }}</span>\n\t\t<span v-if=\"uom\"> {{ uom }}</span>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed } from 'vue'\n\nconst emit = defineEmits(['input'])\nconst props = withDefaults(\n\tdefineProps<{\n\t\tvalue?: number\n\t\tdenominator: number\n\t\tuom?: string\n\t\teditable?: boolean\n\t}>(),\n\t{ value: 0, editable: true, uom: '' }\n)\n\nconst count = ref(props.value)\n\nconst handleInput = (event: InputEvent | MouseEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n\tcount.value = Number((event.target as HTMLElement).innerHTML.replace(/[^0-9]/g, ''))\n\temit('input', count.value)\n}\n\nconst countColor = computed(() => {\n\treturn count.value === props.denominator\n})\n</script>\n","<template>\n\t<li tabindex=\"0\" class=\"beam__listitem\">\n\t\t<div class=\"beam__listtext\">\n\t\t\t<label>{{ item.label }}</label>\n\t\t\t<p>{{ item.description }}</p>\n\t\t</div>\n\n\t\t<ItemCount\n\t\t\tv-if=\"item.count\"\n\t\t\tv-model=\"listItem.count.count\"\n\t\t\t:denominator=\"item.count.of\"\n\t\t\t:uom=\"item.count.uom\"\n\t\t\t:editable=\"true\" />\n\t\t<ItemCheck v-if=\"item.hasOwnProperty('checked')\" v-model=\"listItem.checked\" />\n\t</li>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\n\nimport ItemCount from '@/components/ItemCount.vue'\nimport ItemCheck from '@/components/ItemCheck.vue'\n\nconst props = defineProps<{\n\titem: {\n\t\tlabel: string\n\t\tdescription: string\n\t\tcount?: {\n\t\t\tcount: number\n\t\t\tof: number\n\t\t\tuom: string\n\t\t}\n\t\tchecked?: boolean\n\t}\n}>()\n\nconst listItem = ref(props.item)\n</script>\n","<template>\n\t<ul class=\"beam__listview\">\n\t\t<li v-for=\"item in items\" :key=\"item.label\">\n\t\t\t<template v-if=\"item.linkComponent\">\n\t\t\t\t<component :is=\"item.linkComponent\" :to=\"item.route\" tabindex=\"-1\">\n\t\t\t\t\t<ListItem :item=\"item\"></ListItem>\n\t\t\t\t</component>\n\t\t\t</template>\n\t\t\t<template v-else>\n\t\t\t\t<ListItem :item=\"item\"></ListItem>\n\t\t\t</template>\n\t\t</li>\n\t</ul>\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, onUnmounted } from 'vue'\n\nimport ListItem from '@/components/ListItem.vue'\n\ndefineProps<{\n\titems: {\n\t\tlabel: string\n\t\tdescription: string\n\t\tcount?: {\n\t\t\tcount: number\n\t\t\tof: number\n\t\t\tuom: string\n\t\t}\n\t\tchecked?: boolean\n\t\tlinkComponent?: string\n\t\troute?: string\n\t}[]\n}>()\n\nconst emit = defineEmits(['scrollbottom'])\n\nonMounted(() => {\n\twindow.addEventListener('scroll', handleScroll)\n})\n\nonUnmounted(() => {\n\twindow.removeEventListener('scroll', handleScroll)\n})\n\nconst handleScroll = () => {\n\tconst scrollHeightDifference = document.documentElement.scrollHeight - window.innerHeight\n\tconst scrollposition = document.documentElement.scrollTop\n\tif (scrollHeightDifference - scrollposition <= 2) {\n\t\temit('scrollbottom')\n\t}\n}\n</script>\n","<template>\n\t<nav class=\"beam__navbar\">\n\t\t<slot name=\"icon\">\n\t\t\t<span class=\"home-icon\">⬣</span>\n\t\t</slot>\n\t\t<slot name=\"title\">\n\t\t\t<h1 class=\"nav-title\">TITLE</h1>\n\t\t</slot>\n\t\t<div class=\"navbar-action-wrapper\">\n\t\t\t<button class=\"navbar-action btn\" @click=\"handlePrimaryAction\">\n\t\t\t\t<slot name=\"navbaraction\">Action</slot>\n\t\t\t</button>\n\t\t</div>\n\t</nav>\n</template>\n\n<script setup lang=\"ts\">\nconst emit = defineEmits(['click'])\n\nconst handlePrimaryAction = () => {\n\temit('click')\n}\n</script>\n","<template>\n\t<div id=\"scan_input\"></div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, onMounted, onUnmounted } from 'vue'\n\nconst emit = defineEmits(['scaninput'])\nconst barcode = ref('')\n\nconst handleScanInput = (event: InputEvent | KeyboardEvent) => {\n\tif ((event.target as HTMLElement).tagName !== 'INPUT') {\n\t\tif (event instanceof KeyboardEvent && event.key !== 'Enter') {\n\t\t\tbarcode.value += `${event.key}`\n\t\t} else {\n\t\t\temit('scaninput', barcode.value)\n\t\t\tbarcode.value = ''\n\t\t}\n\t}\n}\n\nonMounted(() => {\n\tdocument.addEventListener('keypress', event => {\n\t\thandleScanInput(event)\n\t})\n})\n\nonUnmounted(() => {\n\twindow.removeEventListener('keypress', event => {\n\t\thandleScanInput(event)\n\t})\n})\n</script>\n","import { App } from 'vue'\n\nimport ActionFooter from '@/components/ActionFooter.vue'\nimport BeamModal from '@/components/BeamModal.vue'\nimport BeamModalOutlet from '@/components/BeamModalOutlet.vue'\nimport Confirm from '@/components/Confirm.vue'\nimport ItemCheck from '@/components/ItemCheck.vue'\nimport ItemCount from '@/components/ItemCount.vue'\nimport ListAnchor from '@/components/ListAnchor.vue'\nimport ListItem from '@/components/ListItem.vue'\nimport ListView from '@/components/ListView.vue'\nimport Navbar from '@/components/Navbar.vue'\nimport ScanInput from '@/components/ScanInput.vue'\n\n/**\n * Install all Beam components\n * @param app - Vue app instance\n * @public\n */\nfunction install(app: App /* options */) {\n\tapp.component('ActionFooter', ActionFooter)\n\tapp.component('BeamModal', BeamModal)\n\tapp.component('BeamModalOutlet', BeamModalOutlet)\n\tapp.component('Confirm', Confirm)\n\tapp.component('ItemCheck', ItemCheck)\n\tapp.component('ItemCount', ItemCount)\n\tapp.component('ListAnchor', ListAnchor)\n\tapp.component('ListItem', ListItem)\n\tapp.component('ListView', ListView)\n\tapp.component('Navbar', Navbar)\n\tapp.component('ScanInput', ScanInput)\n}\n\nexport {\n\tActionFooter,\n\tBeamModal,\n\tBeamModalOutlet,\n\tConfirm,\n\tItemCheck,\n\tItemCount,\n\tListAnchor,\n\tListItem,\n\tListView,\n\tNavbar,\n\tScanInput,\n\tinstall,\n}\n"],"names":["emit","__emit","handleFooterAction","_hoisted_1","_sfc_render","_ctx","_cache","_openBlock","_createElementBlock","_hoisted_2","_createElementVNode","$event","props","__props","checked","ref","handleInput","count","event","countColor","computed","listItem","onMounted","handleScroll","onUnmounted","scrollHeightDifference","scrollposition","handlePrimaryAction","barcode","handleScanInput","install","app","ActionFooter","BeamModal","BeamModalOutlet","Confirm","ItemCheck","ItemCount","ListAnchor","ListItem","ListView","Navbar","ScanInput"],"mappings":"2ZAWA,MAAMA,EAAOC,EAEPC,EAAqB,IAAM,CAChCF,EAAK,OAAO,CAAA,mhCCZXG,EAAA,CAAA,MAAA,qBAAA,qEADD,SAAAC,EAAAC,EAAAC,EAAA,QACqCC,YAAA,EAAAC,qBAAA,MAAAL,EAAA,CACpCM,EAAQC,EAAAA,mBAAW,SAAA,CAAE,MAAK,cAA4BJ,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAK,GAAAN,EAAA,MAAA,cAAA,EACM,EAAA,KAAA,EAApDK,EAAAA,mBAAW,SAAA,CAAE,MAAK,cAAyBJ,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAK,GAAAN,EAAA,MAAA,YAAA,kUCOrD,MAAMO,EAAQC,EAIRb,EAAOC,EAEPa,EAAUC,EAAAA,IAAIH,EAAM,KAAK,EAEzBI,EAAc,IAAM,CACpBhB,EAAA,QAASc,EAAQ,KAAK,CAAA,8aCH5B,MAAMd,EAAOC,EACPW,EAAQC,EAURI,EAAQF,EAAAA,IAAIH,EAAM,KAAK,EAEvBI,EAAeE,GAAmC,CACvDA,EAAM,eAAe,EACrBA,EAAM,gBAAgB,EAChBD,EAAA,MAAQ,OAAQC,EAAM,OAAuB,UAAU,QAAQ,UAAW,EAAE,CAAC,EAC9ElB,EAAA,QAASiB,EAAM,KAAK,CAAA,EAGpBE,EAAaC,EAAAA,SAAS,IACpBH,EAAM,QAAUL,EAAM,WAC7B,qvBChBD,MAAMA,EAAQC,EAaRQ,EAAWN,EAAAA,IAAIH,EAAM,IAAI,40BCD/B,MA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W,CAAS,CACrC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import ActionFooter from '@/components/ActionFooter.vue';
|
|
2
|
+
import BeamModal from '@/components/BeamModal.vue';
|
|
3
|
+
import BeamModalOutlet from '@/components/BeamModalOutlet.vue';
|
|
4
|
+
import Confirm from '@/components/Confirm.vue';
|
|
5
|
+
import ItemCheck from '@/components/ItemCheck.vue';
|
|
6
|
+
import ItemCount from '@/components/ItemCount.vue';
|
|
7
|
+
import ListAnchor from '@/components/ListAnchor.vue';
|
|
8
|
+
import ListItem from '@/components/ListItem.vue';
|
|
9
|
+
import ListView from '@/components/ListView.vue';
|
|
10
|
+
import Navbar from '@/components/Navbar.vue';
|
|
11
|
+
import ScanInput from '@/components/ScanInput.vue';
|
|
12
|
+
/**
|
|
13
|
+
* Install all Beam components
|
|
14
|
+
* @param app - Vue app instance
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
function install(app /* options */) {
|
|
18
|
+
app.component('ActionFooter', ActionFooter);
|
|
19
|
+
app.component('BeamModal', BeamModal);
|
|
20
|
+
app.component('BeamModalOutlet', BeamModalOutlet);
|
|
21
|
+
app.component('Confirm', Confirm);
|
|
22
|
+
app.component('ItemCheck', ItemCheck);
|
|
23
|
+
app.component('ItemCount', ItemCount);
|
|
24
|
+
app.component('ListAnchor', ListAnchor);
|
|
25
|
+
app.component('ListItem', ListItem);
|
|
26
|
+
app.component('ListView', ListView);
|
|
27
|
+
app.component('Navbar', Navbar);
|
|
28
|
+
app.component('ScanInput', ScanInput);
|
|
29
|
+
}
|
|
30
|
+
export { ActionFooter, BeamModal, BeamModalOutlet, Confirm, ItemCheck, ItemCount, ListAnchor, ListItem, ListView, Navbar, ScanInput, install, };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import ActionFooter from '@/components/ActionFooter.vue';
|
|
3
|
+
import BeamModal from '@/components/BeamModal.vue';
|
|
4
|
+
import BeamModalOutlet from '@/components/BeamModalOutlet.vue';
|
|
5
|
+
import Confirm from '@/components/Confirm.vue';
|
|
6
|
+
import ItemCheck from '@/components/ItemCheck.vue';
|
|
7
|
+
import ItemCount from '@/components/ItemCount.vue';
|
|
8
|
+
import ListAnchor from '@/components/ListAnchor.vue';
|
|
9
|
+
import ListItem from '@/components/ListItem.vue';
|
|
10
|
+
import ListView from '@/components/ListView.vue';
|
|
11
|
+
import Navbar from '@/components/Navbar.vue';
|
|
12
|
+
import ScanInput from '@/components/ScanInput.vue';
|
|
13
|
+
/**
|
|
14
|
+
* Install all Beam components
|
|
15
|
+
* @param app - Vue app instance
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
declare function install(app: App): void;
|
|
19
|
+
export { ActionFooter, BeamModal, BeamModalOutlet, Confirm, ItemCheck, ItemCount, ListAnchor, ListItem, ListView, Navbar, ScanInput, install, };
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,OAAO,YAAY,MAAM,+BAA+B,CAAA;AACxD,OAAO,SAAS,MAAM,4BAA4B,CAAA;AAClD,OAAO,eAAe,MAAM,kCAAkC,CAAA;AAC9D,OAAO,OAAO,MAAM,0BAA0B,CAAA;AAC9C,OAAO,SAAS,MAAM,4BAA4B,CAAA;AAClD,OAAO,SAAS,MAAM,4BAA4B,CAAA;AAClD,OAAO,UAAU,MAAM,6BAA6B,CAAA;AACpD,OAAO,QAAQ,MAAM,2BAA2B,CAAA;AAChD,OAAO,QAAQ,MAAM,2BAA2B,CAAA;AAChD,OAAO,MAAM,MAAM,yBAAyB,CAAA;AAC5C,OAAO,SAAS,MAAM,4BAA4B,CAAA;AAElD;;;;GAIG;AACH,iBAAS,OAAO,CAAC,GAAG,EAAE,GAAG,QAYxB;AAED,OAAO,EACN,YAAY,EACZ,SAAS,EACT,eAAe,EACf,OAAO,EACP,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,SAAS,EACT,OAAO,GACP,CAAA"}
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.container[data-v-
|
|
1
|
+
.container[data-v-7261b52e]{display:block;position:relative;padding-left:2.5ch;margin:0;margin-top:.5rem;cursor:pointer;font-size:2rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container input[data-v-7261b52e]{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.checkmark[data-v-7261b52e]{position:absolute;top:0;left:0;height:2rem;width:2rem;background-color:#eee;outline:2px solid transparent;border:1px solid var(--highlight)}.container:hover input~.checkmark[data-v-7261b52e]{background-color:#fff}.container input:checked~.checkmark[data-v-7261b52e]{background-color:var(--brand-secondary)}.checkmark[data-v-7261b52e]:after{content:"";position:absolute;display:none}.container input:checked~.checkmark[data-v-7261b52e]:after{display:block}.container .checkmark[data-v-7261b52e]:after{left:25%;top:50%;width:.5rem;height:1rem;border:solid var(--text-color);border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg) translate(-50%,-50%)}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.47.0"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/beam",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -29,23 +29,23 @@
|
|
|
29
29
|
"src/*"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"
|
|
33
|
-
"vue": "^3.4.23"
|
|
32
|
+
"vue": "^3.4.31"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@typescript-eslint/
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
35
|
+
"@microsoft/api-documenter": "^7.25.3",
|
|
36
|
+
"@rushstack/heft": "^0.66.18",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
38
|
+
"@typescript-eslint/parser": "^7.14.1",
|
|
39
|
+
"@vitejs/plugin-vue": "^5.0.5",
|
|
40
|
+
"cypress": "^13.11.0",
|
|
41
41
|
"eslint": "^8.40.0",
|
|
42
42
|
"eslint-config-prettier": "^8.8.0",
|
|
43
43
|
"eslint-plugin-vue": "^9.11.1",
|
|
44
|
-
"histoire": "^0.17.17",
|
|
45
44
|
"sass": "^1.75.0",
|
|
46
|
-
"typescript": "^5.
|
|
47
|
-
"vite": "^5.2
|
|
48
|
-
"vue-router": "^4"
|
|
45
|
+
"typescript": "^5.5.2",
|
|
46
|
+
"vite": "^5.3.2",
|
|
47
|
+
"vue-router": "^4.4.0",
|
|
48
|
+
"stonecrop-rig": "0.2.22"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
@@ -54,13 +54,11 @@
|
|
|
54
54
|
"node": ">=20.11.0"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
|
-
"prepublish": "
|
|
58
|
-
"build": "
|
|
57
|
+
"prepublish": "heft build && vite build && rushx docs",
|
|
58
|
+
"build": "heft build && vite build && rushx docs",
|
|
59
59
|
"dev": "vite",
|
|
60
|
+
"docs": "api-documenter markdown -i temp -o ../docs/beam",
|
|
60
61
|
"lint": "eslint . --ext .ts,.vue",
|
|
61
|
-
"preview": "vite preview"
|
|
62
|
-
"story:build": "histoire build",
|
|
63
|
-
"story:dev": "histoire dev",
|
|
64
|
-
"story:preview": "histoire preview"
|
|
62
|
+
"preview": "vite preview"
|
|
65
63
|
}
|
|
66
64
|
}
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup lang="ts">
|
|
6
|
-
const emit = defineEmits(['confirmmodal', 'closemodal'])
|
|
6
|
+
// const emit = defineEmits(['confirmmodal', 'closemodal'])
|
|
7
7
|
|
|
8
|
-
const confirmModal = () => {
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
// const confirmModal = () => {
|
|
9
|
+
// emit('confirmmodal')
|
|
10
|
+
// }
|
|
11
|
+
|
|
12
|
+
// const closeModal = () => {
|
|
13
|
+
// emit('closemodal')
|
|
14
|
+
// }
|
|
14
15
|
</script>
|
|
@@ -31,7 +31,7 @@ const count = ref(props.value)
|
|
|
31
31
|
const handleInput = (event: InputEvent | MouseEvent) => {
|
|
32
32
|
event.preventDefault()
|
|
33
33
|
event.stopPropagation()
|
|
34
|
-
count.value = Number(event.target.innerHTML.replace(/[^0-9]/g, ''))
|
|
34
|
+
count.value = Number((event.target as HTMLElement).innerHTML.replace(/[^0-9]/g, ''))
|
|
35
35
|
emit('input', count.value)
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -7,19 +7,21 @@
|
|
|
7
7
|
|
|
8
8
|
<ItemCount
|
|
9
9
|
v-if="item.count"
|
|
10
|
-
v-model="
|
|
10
|
+
v-model="listItem.count.count"
|
|
11
11
|
:denominator="item.count.of"
|
|
12
12
|
:uom="item.count.uom"
|
|
13
13
|
:editable="true" />
|
|
14
|
-
<ItemCheck v-if="item.hasOwnProperty('checked')" v-model="
|
|
14
|
+
<ItemCheck v-if="item.hasOwnProperty('checked')" v-model="listItem.checked" />
|
|
15
15
|
</li>
|
|
16
16
|
</template>
|
|
17
17
|
|
|
18
18
|
<script setup lang="ts">
|
|
19
|
-
import
|
|
20
|
-
import ItemCheck from './ItemCheck.vue'
|
|
19
|
+
import { ref } from 'vue'
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
import ItemCount from '@/components/ItemCount.vue'
|
|
22
|
+
import ItemCheck from '@/components/ItemCheck.vue'
|
|
23
|
+
|
|
24
|
+
const props = defineProps<{
|
|
23
25
|
item: {
|
|
24
26
|
label: string
|
|
25
27
|
description: string
|
|
@@ -31,4 +33,6 @@ defineProps<{
|
|
|
31
33
|
checked?: boolean
|
|
32
34
|
}
|
|
33
35
|
}>()
|
|
36
|
+
|
|
37
|
+
const listItem = ref(props.item)
|
|
34
38
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ul class="beam__listview">
|
|
3
|
-
<li v-for="
|
|
3
|
+
<li v-for="item in items" :key="item.label">
|
|
4
4
|
<template v-if="item.linkComponent">
|
|
5
5
|
<component :is="item.linkComponent" :to="item.route" tabindex="-1">
|
|
6
6
|
<ListItem :item="item"></ListItem>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<script setup lang="ts">
|
|
17
17
|
import { onMounted, onUnmounted } from 'vue'
|
|
18
18
|
|
|
19
|
-
import ListItem from '
|
|
19
|
+
import ListItem from '@/components/ListItem.vue'
|
|
20
20
|
|
|
21
21
|
defineProps<{
|
|
22
22
|
items: {
|
|
@@ -9,8 +9,8 @@ const emit = defineEmits(['scaninput'])
|
|
|
9
9
|
const barcode = ref('')
|
|
10
10
|
|
|
11
11
|
const handleScanInput = (event: InputEvent | KeyboardEvent) => {
|
|
12
|
-
if (event.target.tagName !== 'INPUT') {
|
|
13
|
-
if (event.key !== 'Enter') {
|
|
12
|
+
if ((event.target as HTMLElement).tagName !== 'INPUT') {
|
|
13
|
+
if (event instanceof KeyboardEvent && event.key !== 'Enter') {
|
|
14
14
|
barcode.value += `${event.key}`
|
|
15
15
|
} else {
|
|
16
16
|
emit('scaninput', barcode.value)
|
package/src/index.ts
CHANGED
|
@@ -12,6 +12,11 @@ import ListView from '@/components/ListView.vue'
|
|
|
12
12
|
import Navbar from '@/components/Navbar.vue'
|
|
13
13
|
import ScanInput from '@/components/ScanInput.vue'
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Install all Beam components
|
|
17
|
+
* @param app - Vue app instance
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
15
20
|
function install(app: App /* options */) {
|
|
16
21
|
app.component('ActionFooter', ActionFooter)
|
|
17
22
|
app.component('BeamModal', BeamModal)
|
package/src/histoire.setup.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { defineSetupVue3 } from '@histoire/plugin-vue'
|
|
2
|
-
|
|
3
|
-
import ActionFooter from '@/components/ActionFooter.vue'
|
|
4
|
-
import BeamModal from '@/components/BeamModal.vue'
|
|
5
|
-
import BeamModalOutlet from '@/components/BeamModalOutlet.vue'
|
|
6
|
-
import Confirm from '@/components/Confirm.vue'
|
|
7
|
-
import ItemCheck from '@/components/ItemCheck.vue'
|
|
8
|
-
import ItemCount from '@/components/ItemCount.vue'
|
|
9
|
-
import ListAnchor from '@/components/ListAnchor.vue'
|
|
10
|
-
import ListItem from '@/components/ListItem.vue'
|
|
11
|
-
import ListView from '@/components/ListView.vue'
|
|
12
|
-
import Navbar from '@/components/Navbar.vue'
|
|
13
|
-
import ScanInput from '@/components/ScanInput.vue'
|
|
14
|
-
import PortalVue from 'portal-vue'
|
|
15
|
-
|
|
16
|
-
export const setupVue3 = defineSetupVue3(({ app }) => {
|
|
17
|
-
app.use(PortalVue)
|
|
18
|
-
|
|
19
|
-
app.component('ActionFooter', ActionFooter)
|
|
20
|
-
app.component('BeamModal', BeamModal)
|
|
21
|
-
app.component('BeamModalOutlet', BeamModalOutlet)
|
|
22
|
-
app.component('Confirm', Confirm)
|
|
23
|
-
app.component('ItemCheck', ItemCheck)
|
|
24
|
-
app.component('ItemCount', ItemCount)
|
|
25
|
-
app.component('ListAnchor', ListAnchor)
|
|
26
|
-
app.component('ListItem', ListItem)
|
|
27
|
-
app.component('ListView', ListView)
|
|
28
|
-
app.component('Navbar', Navbar)
|
|
29
|
-
app.component('ScanInput', ScanInput)
|
|
30
|
-
})
|