@stonecrop/beam 0.2.41 → 0.2.43
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.js +168 -179
- package/dist/beam.js.map +1 -1
- package/dist/beam.umd.cjs +1 -1
- package/dist/beam.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/BeamMetadata.vue +23 -45
package/dist/beam.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const H = { class: "beam__actionfooter" }, Q = { class: "footer-action-wrapper" },
|
|
1
|
+
import { defineComponent as d, openBlock as c, createElementBlock as u, createElementVNode as i, renderSlot as _, createTextVNode as w, normalizeClass as k, toDisplayString as p, createStaticVNode as M, resolveComponent as T, createBlock as v, withCtx as P, withDirectives as $, vShow as E, useModel as D, vModelCheckbox as F, mergeModels as N, computed as x, createCommentVNode as y, ref as A, onMounted as S, onUnmounted as B, Fragment as z, renderList as O, resolveDynamicComponent as U, createVNode as j } from "vue";
|
|
2
|
+
const H = { class: "beam__actionfooter" }, Q = { class: "footer-action-wrapper" }, R = /* @__PURE__ */ d({
|
|
3
3
|
__name: "ActionFooter",
|
|
4
4
|
emits: ["click"],
|
|
5
|
-
setup(r, { emit:
|
|
6
|
-
const s =
|
|
5
|
+
setup(r, { emit: o }) {
|
|
6
|
+
const s = o, e = () => {
|
|
7
7
|
s("click");
|
|
8
8
|
};
|
|
9
|
-
return (t,
|
|
9
|
+
return (t, a) => (c(), u("footer", H, [
|
|
10
10
|
i("span", Q, [
|
|
11
11
|
i("button", {
|
|
12
12
|
class: "footer-action btn",
|
|
@@ -17,96 +17,85 @@ const H = { class: "beam__actionfooter" }, Q = { class: "footer-action-wrapper"
|
|
|
17
17
|
])
|
|
18
18
|
]));
|
|
19
19
|
}
|
|
20
|
-
}), q = { class: "beam_metadata" },
|
|
20
|
+
}), q = { class: "beam_metadata" }, G = { class: "beam_metadata_content" }, W = { class: "beam_metadata_block" }, Y = { class: "beam_metadata_heading" }, J = /* @__PURE__ */ d({
|
|
21
21
|
__name: "BeamMetadata",
|
|
22
22
|
props: {
|
|
23
23
|
order: {}
|
|
24
24
|
},
|
|
25
25
|
setup(r) {
|
|
26
|
-
return (
|
|
27
|
-
i("div",
|
|
28
|
-
|
|
29
|
-
i("
|
|
30
|
-
|
|
31
|
-
i("
|
|
26
|
+
return (o, s) => (c(), u("div", q, [
|
|
27
|
+
i("div", G, [
|
|
28
|
+
_(o.$slots, "default", {}, () => [
|
|
29
|
+
s[1] || (s[1] = i("div", { class: "beam_metadata_header beam_metadata--two-column" }, null, -1)),
|
|
30
|
+
i("div", W, [
|
|
31
|
+
i("p", Y, [
|
|
32
|
+
s[0] || (s[0] = w(" Status: ")),
|
|
33
|
+
i("span", {
|
|
34
|
+
class: k([{ alert: !o.order.complete }, "beam_metadata--normal"])
|
|
35
|
+
}, p(o.order.complete ? "Complete" : "In Progress"), 3)
|
|
36
|
+
])
|
|
32
37
|
]),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}, [
|
|
36
|
-
i("p", null, m(n.order.quantity) + "/" + m(n.order.total), 1)
|
|
37
|
-
], 2)
|
|
38
|
-
]),
|
|
39
|
-
i("div", X, [
|
|
40
|
-
i("p", Z, [
|
|
41
|
-
s[0] || (s[0] = b(" Status: ")),
|
|
42
|
-
i("span", {
|
|
43
|
-
class: y([{ alert: !n.order.complete }, "beam_metadata--normal"])
|
|
44
|
-
}, m(n.order.complete ? "Complete" : "In Progress"), 3)
|
|
45
|
-
])
|
|
46
|
-
]),
|
|
47
|
-
s[1] || (s[1] = M('<div class="beam_metadata_shipping beam_metadata_block"><div class="beam_metadata_source"><p class="beam_metadata_heading">Source</p><p> Packing Warehouse Inc.<br> 1432 W. Parkway Ave.<br> Chicago, IL 60617 </p></div><div class="beam_metadata_arrow"><div class="beam_metadata_arrow-body"></div><div class="beam_metadata_arrow-head"><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6.74 7.78"><polygon points="6.74 3.89 0 0 0 7.78 6.74 3.89" style="fill:#c4c4c4;"></polygon></svg></div></div><div class="beam_metadata_source"><p class="beam_metadata_heading">Receiving</p><p> Packing Warehouse Inc.<br> 1432 W. Parkway Ave.<br> Chicago, IL 60617 </p></div></div><div class="beam_metadata_component_header beam_metadata_block"><p class="beam_metadata_heading">Components</p><p class="beam_metadata_heading">Quantity</p></div>', 2))
|
|
48
|
-
]),
|
|
49
|
-
i("div", ee, [
|
|
50
|
-
_(n.$slots, "components")
|
|
38
|
+
s[2] || (s[2] = M('<div class="beam_metadata_shipping beam_metadata_block"><div class="beam_metadata_source"><p class="beam_metadata_heading">Source</p></div><div class="beam_metadata_arrow"><div class="beam_metadata_arrow-body"></div><div class="beam_metadata_arrow-head"><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6.74 7.78"><polygon points="6.74 3.89 0 0 0 7.78 6.74 3.89" style="fill:#c4c4c4;"></polygon></svg></div></div><div class="beam_metadata_source"><p class="beam_metadata_heading">Receiving</p></div></div>', 1))
|
|
39
|
+
])
|
|
51
40
|
])
|
|
52
41
|
]));
|
|
53
42
|
}
|
|
54
|
-
}),
|
|
43
|
+
}), X = { class: "beam__modal" }, Z = /* @__PURE__ */ d({
|
|
55
44
|
__name: "BeamModal",
|
|
56
45
|
props: {
|
|
57
46
|
showModal: { type: Boolean }
|
|
58
47
|
},
|
|
59
48
|
setup(r) {
|
|
60
|
-
return (
|
|
49
|
+
return (o, s) => {
|
|
61
50
|
const e = T("portal");
|
|
62
51
|
return c(), v(e, { to: "beam__modal_outlet" }, {
|
|
63
52
|
default: P(() => [
|
|
64
|
-
$(i("div",
|
|
53
|
+
$(i("div", X, [
|
|
65
54
|
i("button", {
|
|
66
55
|
class: "btn",
|
|
67
|
-
onClick: s[0] || (s[0] = (t) =>
|
|
56
|
+
onClick: s[0] || (s[0] = (t) => o.$emit("closemodal"))
|
|
68
57
|
}, "Close Modal"),
|
|
69
|
-
_(
|
|
70
|
-
onClosemodal: s[1] || (s[1] = (t) =>
|
|
71
|
-
onConfirmmodal: s[2] || (s[2] = (t) =>
|
|
58
|
+
_(o.$slots, "default", {
|
|
59
|
+
onClosemodal: s[1] || (s[1] = (t) => o.$emit("closemodal")),
|
|
60
|
+
onConfirmmodal: s[2] || (s[2] = (t) => o.$emit("confirmmodal"))
|
|
72
61
|
})
|
|
73
62
|
], 512), [
|
|
74
|
-
[E,
|
|
63
|
+
[E, o.showModal]
|
|
75
64
|
])
|
|
76
65
|
]),
|
|
77
66
|
_: 3
|
|
78
67
|
});
|
|
79
68
|
};
|
|
80
69
|
}
|
|
81
|
-
}),
|
|
70
|
+
}), ee = /* @__PURE__ */ d({
|
|
82
71
|
__name: "BeamModalOutlet",
|
|
83
72
|
emits: ["confirmmodal", "closemodal"],
|
|
84
73
|
setup(r) {
|
|
85
|
-
return (
|
|
74
|
+
return (o, s) => {
|
|
86
75
|
const e = T("portal-target");
|
|
87
76
|
return c(), v(e, { name: "beam__modal_outlet" });
|
|
88
77
|
};
|
|
89
78
|
}
|
|
90
|
-
}),
|
|
79
|
+
}), K = (r, o) => {
|
|
91
80
|
const s = r.__vccOpts || r;
|
|
92
|
-
for (const [e, t] of
|
|
81
|
+
for (const [e, t] of o)
|
|
93
82
|
s[e] = t;
|
|
94
83
|
return s;
|
|
95
|
-
},
|
|
96
|
-
function
|
|
97
|
-
return c(),
|
|
98
|
-
|
|
84
|
+
}, te = {}, ne = { class: "beam__modal-confirm" };
|
|
85
|
+
function ae(r, o) {
|
|
86
|
+
return c(), u("div", ne, [
|
|
87
|
+
o[2] || (o[2] = i("h2", null, "Would you like to continue?", -1)),
|
|
99
88
|
i("button", {
|
|
100
89
|
class: "btn",
|
|
101
|
-
onClick:
|
|
90
|
+
onClick: o[0] || (o[0] = (s) => r.$emit("confirmmodal"))
|
|
102
91
|
}, "Yes"),
|
|
103
92
|
i("button", {
|
|
104
93
|
class: "btn",
|
|
105
|
-
onClick:
|
|
94
|
+
onClick: o[1] || (o[1] = (s) => r.$emit("closemodal"))
|
|
106
95
|
}, "No")
|
|
107
96
|
]);
|
|
108
97
|
}
|
|
109
|
-
const
|
|
98
|
+
const oe = /* @__PURE__ */ K(te, [["render", ae]]), se = { class: "container" }, re = /* @__PURE__ */ d({
|
|
110
99
|
__name: "ItemCheck",
|
|
111
100
|
props: {
|
|
112
101
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -114,14 +103,14 @@ const ce = /* @__PURE__ */ B(se, [["render", ie]]), le = { class: "container" },
|
|
|
114
103
|
},
|
|
115
104
|
emits: ["update:modelValue"],
|
|
116
105
|
setup(r) {
|
|
117
|
-
const
|
|
118
|
-
return (s, e) => (c(),
|
|
106
|
+
const o = D(r, "modelValue");
|
|
107
|
+
return (s, e) => (c(), u("label", se, [
|
|
119
108
|
$(i("input", {
|
|
120
109
|
type: "checkbox",
|
|
121
|
-
"onUpdate:modelValue": e[0] || (e[0] = (t) =>
|
|
110
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => o.value = t),
|
|
122
111
|
tabindex: "-1"
|
|
123
112
|
}, null, 512), [
|
|
124
|
-
[F,
|
|
113
|
+
[F, o.value]
|
|
125
114
|
]),
|
|
126
115
|
e[1] || (e[1] = i("div", {
|
|
127
116
|
class: "checkmark",
|
|
@@ -129,7 +118,7 @@ const ce = /* @__PURE__ */ B(se, [["render", ie]]), le = { class: "container" },
|
|
|
129
118
|
}, null, -1))
|
|
130
119
|
]));
|
|
131
120
|
}
|
|
132
|
-
}),
|
|
121
|
+
}), L = /* @__PURE__ */ K(re, [["__scopeId", "data-v-f44a510e"]]), ie = { class: "beam__itemcount" }, ce = ["contenteditable"], le = { key: 0 }, I = /* @__PURE__ */ d({
|
|
133
122
|
__name: "ItemCount",
|
|
134
123
|
props: /* @__PURE__ */ N({
|
|
135
124
|
denominator: {},
|
|
@@ -141,135 +130,135 @@ const ce = /* @__PURE__ */ B(se, [["render", ie]]), le = { class: "container" },
|
|
|
141
130
|
}),
|
|
142
131
|
emits: ["update:modelValue"],
|
|
143
132
|
setup(r) {
|
|
144
|
-
const
|
|
133
|
+
const o = D(r, "modelValue"), s = x(() => o.value === r.denominator), e = (t) => {
|
|
145
134
|
t.preventDefault(), t.stopPropagation();
|
|
146
|
-
const
|
|
147
|
-
|
|
135
|
+
const a = Number(t.target.innerHTML) || 0;
|
|
136
|
+
o.value = Math.min(a, r.denominator);
|
|
148
137
|
};
|
|
149
|
-
return (t,
|
|
138
|
+
return (t, a) => (c(), u("div", ie, [
|
|
150
139
|
i("span", {
|
|
151
140
|
contenteditable: t.editable,
|
|
152
|
-
class:
|
|
141
|
+
class: k({ alert: !s.value }),
|
|
153
142
|
onInput: e,
|
|
154
143
|
onClick: e
|
|
155
|
-
},
|
|
156
|
-
i("span", null, "/" +
|
|
157
|
-
t.uom ? (c(),
|
|
144
|
+
}, p(o.value), 43, ce),
|
|
145
|
+
i("span", null, "/" + p(t.denominator), 1),
|
|
146
|
+
t.uom ? (c(), u("span", le, " " + p(t.uom), 1)) : y("", !0)
|
|
158
147
|
]));
|
|
159
148
|
}
|
|
160
|
-
}),
|
|
149
|
+
}), ue = ["href"], de = /* @__PURE__ */ d({
|
|
161
150
|
__name: "ListAnchor",
|
|
162
151
|
props: {
|
|
163
152
|
to: { default: "" }
|
|
164
153
|
},
|
|
165
154
|
setup(r) {
|
|
166
|
-
return (
|
|
167
|
-
href:
|
|
155
|
+
return (o, s) => (c(), u("a", {
|
|
156
|
+
href: o.to,
|
|
168
157
|
class: "beam__listanchor"
|
|
169
158
|
}, [
|
|
170
|
-
_(
|
|
171
|
-
], 8,
|
|
159
|
+
_(o.$slots, "default")
|
|
160
|
+
], 8, ue));
|
|
172
161
|
}
|
|
173
|
-
}),
|
|
162
|
+
}), me = {
|
|
174
163
|
tabindex: "0",
|
|
175
164
|
class: "beam__listitem"
|
|
176
|
-
},
|
|
165
|
+
}, fe = { class: "beam__listtext" }, b = /* @__PURE__ */ d({
|
|
177
166
|
__name: "ListItem",
|
|
178
167
|
props: {
|
|
179
168
|
item: {}
|
|
180
169
|
},
|
|
181
170
|
setup(r) {
|
|
182
|
-
const
|
|
183
|
-
return (s, e) => (c(),
|
|
184
|
-
i("div",
|
|
185
|
-
i("label", null,
|
|
186
|
-
i("p", null,
|
|
171
|
+
const o = A(r.item);
|
|
172
|
+
return (s, e) => (c(), u("li", me, [
|
|
173
|
+
i("div", fe, [
|
|
174
|
+
i("label", null, p(o.value.label), 1),
|
|
175
|
+
i("p", null, p(o.value.description), 1)
|
|
187
176
|
]),
|
|
188
|
-
|
|
177
|
+
o.value.count ? (c(), v(I, {
|
|
189
178
|
key: 0,
|
|
190
|
-
modelValue:
|
|
191
|
-
"onUpdate:modelValue": e[0] || (e[0] = (t) =>
|
|
192
|
-
denominator:
|
|
193
|
-
uom:
|
|
179
|
+
modelValue: o.value.count.count,
|
|
180
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => o.value.count.count = t),
|
|
181
|
+
denominator: o.value.count.of,
|
|
182
|
+
uom: o.value.count.uom,
|
|
194
183
|
editable: !0
|
|
195
|
-
}, null, 8, ["modelValue", "denominator", "uom"])) :
|
|
196
|
-
|
|
184
|
+
}, null, 8, ["modelValue", "denominator", "uom"])) : y("", !0),
|
|
185
|
+
o.value.hasOwnProperty("checked") ? (c(), v(L, {
|
|
197
186
|
key: 1,
|
|
198
|
-
modelValue:
|
|
199
|
-
"onUpdate:modelValue": e[1] || (e[1] = (t) =>
|
|
200
|
-
}, null, 8, ["modelValue"])) :
|
|
187
|
+
modelValue: o.value.checked,
|
|
188
|
+
"onUpdate:modelValue": e[1] || (e[1] = (t) => o.value.checked = t)
|
|
189
|
+
}, null, 8, ["modelValue"])) : y("", !0)
|
|
201
190
|
]));
|
|
202
191
|
}
|
|
203
|
-
}),
|
|
192
|
+
}), pe = { class: "beam__listview" }, _e = /* @__PURE__ */ d({
|
|
204
193
|
__name: "ListView",
|
|
205
194
|
props: {
|
|
206
195
|
items: {}
|
|
207
196
|
},
|
|
208
197
|
emits: ["scrollbottom"],
|
|
209
|
-
setup(r, { emit:
|
|
210
|
-
const s =
|
|
198
|
+
setup(r, { emit: o }) {
|
|
199
|
+
const s = o;
|
|
211
200
|
S(() => {
|
|
212
201
|
window.addEventListener("scroll", e);
|
|
213
|
-
}),
|
|
202
|
+
}), B(() => {
|
|
214
203
|
window.removeEventListener("scroll", e);
|
|
215
204
|
});
|
|
216
205
|
const e = () => {
|
|
217
|
-
const t = document.documentElement.scrollHeight - window.innerHeight,
|
|
218
|
-
t -
|
|
206
|
+
const t = document.documentElement.scrollHeight - window.innerHeight, a = document.documentElement.scrollTop;
|
|
207
|
+
t - a <= 2 && s("scrollbottom");
|
|
219
208
|
};
|
|
220
|
-
return (t,
|
|
221
|
-
(c(!0),
|
|
222
|
-
key:
|
|
209
|
+
return (t, a) => (c(), u("ul", pe, [
|
|
210
|
+
(c(!0), u(z, null, O(t.items, (n) => (c(), u("li", {
|
|
211
|
+
key: n.label
|
|
223
212
|
}, [
|
|
224
|
-
|
|
213
|
+
n.linkComponent ? (c(), v(U(n.linkComponent), {
|
|
225
214
|
key: 0,
|
|
226
|
-
to:
|
|
215
|
+
to: n.route,
|
|
227
216
|
tabindex: "-1"
|
|
228
217
|
}, {
|
|
229
218
|
default: P(() => [
|
|
230
|
-
j(
|
|
219
|
+
j(b, { item: n }, null, 8, ["item"])
|
|
231
220
|
]),
|
|
232
221
|
_: 2
|
|
233
|
-
}, 1032, ["to"])) : (c(), v(
|
|
222
|
+
}, 1032, ["to"])) : (c(), v(b, {
|
|
234
223
|
key: 1,
|
|
235
|
-
item:
|
|
224
|
+
item: n
|
|
236
225
|
}, null, 8, ["item"]))
|
|
237
226
|
]))), 128))
|
|
238
227
|
]));
|
|
239
228
|
}
|
|
240
|
-
}),
|
|
229
|
+
}), ve = { class: "beam__navbar" }, he = { class: "navbar-action-wrapper" }, ye = /* @__PURE__ */ d({
|
|
241
230
|
__name: "Navbar",
|
|
242
231
|
emits: ["click"],
|
|
243
|
-
setup(r, { emit:
|
|
244
|
-
const s =
|
|
232
|
+
setup(r, { emit: o }) {
|
|
233
|
+
const s = o, e = () => {
|
|
245
234
|
s("click");
|
|
246
235
|
};
|
|
247
|
-
return (t,
|
|
236
|
+
return (t, a) => (c(), u("nav", ve, [
|
|
248
237
|
_(t.$slots, "title", {}, () => [
|
|
249
|
-
|
|
238
|
+
a[0] || (a[0] = i("h1", { class: "nav-title" }, "TITLE", -1))
|
|
250
239
|
]),
|
|
251
|
-
i("div",
|
|
240
|
+
i("div", he, [
|
|
252
241
|
i("button", {
|
|
253
242
|
class: "navbar-action btn",
|
|
254
243
|
onClick: e
|
|
255
244
|
}, [
|
|
256
245
|
_(t.$slots, "navbaraction", {}, () => [
|
|
257
|
-
|
|
246
|
+
a[1] || (a[1] = w("Action"))
|
|
258
247
|
])
|
|
259
248
|
])
|
|
260
249
|
])
|
|
261
250
|
]));
|
|
262
251
|
}
|
|
263
252
|
});
|
|
264
|
-
var
|
|
265
|
-
function
|
|
253
|
+
var be = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
254
|
+
function ge(r) {
|
|
266
255
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
267
256
|
}
|
|
268
257
|
var V = { exports: {} };
|
|
269
|
-
(function(r,
|
|
258
|
+
(function(r, o) {
|
|
270
259
|
(function(s, e) {
|
|
271
260
|
r.exports = e();
|
|
272
|
-
})(
|
|
261
|
+
})(be, function() {
|
|
273
262
|
var s = {
|
|
274
263
|
/**
|
|
275
264
|
*
|
|
@@ -280,24 +269,24 @@ var V = { exports: {} };
|
|
|
280
269
|
attachTo: function(e, t) {
|
|
281
270
|
if (e.scannerDetectionData !== void 0)
|
|
282
271
|
throw new Error("onScan.js is already initialized for DOM element " + e);
|
|
283
|
-
var
|
|
284
|
-
onScan: function(
|
|
272
|
+
var a = {
|
|
273
|
+
onScan: function(n, l) {
|
|
285
274
|
},
|
|
286
275
|
// Callback after detection of a successfull scanning: function(){sScancode, iCount)}()
|
|
287
|
-
onScanError: function(
|
|
276
|
+
onScanError: function(n) {
|
|
288
277
|
},
|
|
289
278
|
// Callback after detection of a unsuccessfull scanning (scanned string in parameter)
|
|
290
|
-
onKeyProcess: function(
|
|
279
|
+
onKeyProcess: function(n, l) {
|
|
291
280
|
},
|
|
292
281
|
// Callback after receiving and processing a char (scanned char in parameter)
|
|
293
|
-
onKeyDetect: function(
|
|
282
|
+
onKeyDetect: function(n, l) {
|
|
294
283
|
},
|
|
295
284
|
// Callback after detecting a keyDown (key char in parameter) - in contrast to onKeyProcess, this fires for non-character keys like tab, arrows, etc. too!
|
|
296
|
-
onPaste: function(
|
|
285
|
+
onPaste: function(n, l) {
|
|
297
286
|
},
|
|
298
287
|
// Callback after receiving a value on paste, no matter if it is a valid code or not
|
|
299
|
-
keyCodeMapper: function(
|
|
300
|
-
return s.decodeKeyEvent(
|
|
288
|
+
keyCodeMapper: function(n) {
|
|
289
|
+
return s.decodeKeyEvent(n);
|
|
301
290
|
},
|
|
302
291
|
// Custom function to decode a keydown event into a character. Must return decoded character or NULL if the given event should not be processed.
|
|
303
292
|
onScanButtonLongPress: function() {
|
|
@@ -332,7 +321,7 @@ var V = { exports: {} };
|
|
|
332
321
|
singleScanQty: 1
|
|
333
322
|
// Quantity of Items put out to onScan in a single scan
|
|
334
323
|
};
|
|
335
|
-
return t = this._mergeOptions(
|
|
324
|
+
return t = this._mergeOptions(a, t), e.scannerDetectionData = {
|
|
336
325
|
options: t,
|
|
337
326
|
vars: {
|
|
338
327
|
firstCharTime: 0,
|
|
@@ -410,16 +399,16 @@ var V = { exports: {} };
|
|
|
410
399
|
case (t >= 106 && t <= 111):
|
|
411
400
|
if (e.key !== void 0 && e.key !== "")
|
|
412
401
|
return e.key;
|
|
413
|
-
var
|
|
402
|
+
var a = String.fromCharCode(t);
|
|
414
403
|
switch (e.shiftKey) {
|
|
415
404
|
case !1:
|
|
416
|
-
|
|
405
|
+
a = a.toLowerCase();
|
|
417
406
|
break;
|
|
418
407
|
case !0:
|
|
419
|
-
|
|
408
|
+
a = a.toUpperCase();
|
|
420
409
|
break;
|
|
421
410
|
}
|
|
422
|
-
return
|
|
411
|
+
return a;
|
|
423
412
|
case (t >= 96 && t <= 105):
|
|
424
413
|
return 0 + (t - 96);
|
|
425
414
|
}
|
|
@@ -442,10 +431,10 @@ var V = { exports: {} };
|
|
|
442
431
|
* @return self
|
|
443
432
|
*/
|
|
444
433
|
simulate: function(e, t) {
|
|
445
|
-
return this._reinitialize(e), Array.isArray(t) ? t.forEach(function(
|
|
446
|
-
var
|
|
447
|
-
(typeof
|
|
448
|
-
var l = new KeyboardEvent("keydown",
|
|
434
|
+
return this._reinitialize(e), Array.isArray(t) ? t.forEach(function(a) {
|
|
435
|
+
var n = {};
|
|
436
|
+
(typeof a == "object" || typeof a == "function") && a !== null ? n = a : n.keyCode = parseInt(a);
|
|
437
|
+
var l = new KeyboardEvent("keydown", n);
|
|
449
438
|
document.dispatchEvent(l);
|
|
450
439
|
}) : this._validateScanCode(e, t), this;
|
|
451
440
|
},
|
|
@@ -467,12 +456,12 @@ var V = { exports: {} };
|
|
|
467
456
|
var t = e.scannerDetectionData.options.ignoreIfFocusOn;
|
|
468
457
|
if (!t)
|
|
469
458
|
return !1;
|
|
470
|
-
var
|
|
459
|
+
var a = document.activeElement;
|
|
471
460
|
if (Array.isArray(t)) {
|
|
472
|
-
for (var
|
|
473
|
-
if (
|
|
461
|
+
for (var n = 0; n < t.length; n++)
|
|
462
|
+
if (a.matches(t[n]) === !0)
|
|
474
463
|
return !0;
|
|
475
|
-
} else if (
|
|
464
|
+
} else if (a.matches(t))
|
|
476
465
|
return !0;
|
|
477
466
|
return !1;
|
|
478
467
|
},
|
|
@@ -484,20 +473,20 @@ var V = { exports: {} };
|
|
|
484
473
|
* @return boolean
|
|
485
474
|
*/
|
|
486
475
|
_validateScanCode: function(e, t) {
|
|
487
|
-
var
|
|
476
|
+
var a = e.scannerDetectionData, n = a.options, l = a.options.singleScanQty, f = a.vars.firstCharTime, g = a.vars.lastCharTime, m = {}, h;
|
|
488
477
|
switch (!0) {
|
|
489
|
-
case t.length <
|
|
490
|
-
|
|
478
|
+
case t.length < n.minLength:
|
|
479
|
+
m = {
|
|
491
480
|
message: "Receieved code is shorter then minimal length"
|
|
492
481
|
};
|
|
493
482
|
break;
|
|
494
|
-
case
|
|
495
|
-
|
|
483
|
+
case g - f > t.length * n.avgTimeByChar:
|
|
484
|
+
m = {
|
|
496
485
|
message: "Receieved code was not entered in time"
|
|
497
486
|
};
|
|
498
487
|
break;
|
|
499
488
|
default:
|
|
500
|
-
return
|
|
489
|
+
return n.onScan.call(e, t, l), h = new CustomEvent(
|
|
501
490
|
"scan",
|
|
502
491
|
{
|
|
503
492
|
detail: {
|
|
@@ -507,9 +496,9 @@ var V = { exports: {} };
|
|
|
507
496
|
}
|
|
508
497
|
), e.dispatchEvent(h), s._reinitialize(e), !0;
|
|
509
498
|
}
|
|
510
|
-
return
|
|
499
|
+
return m.scanCode = t, m.scanDuration = g - f, m.avgTimeByChar = n.avgTimeByChar, m.minLength = n.minLength, n.onScanError.call(e, m), h = new CustomEvent(
|
|
511
500
|
"scanError",
|
|
512
|
-
{ detail:
|
|
501
|
+
{ detail: m }
|
|
513
502
|
), e.dispatchEvent(h), s._reinitialize(e), !1;
|
|
514
503
|
},
|
|
515
504
|
/**
|
|
@@ -519,12 +508,12 @@ var V = { exports: {} };
|
|
|
519
508
|
* @return Object
|
|
520
509
|
*/
|
|
521
510
|
_mergeOptions: function(e, t) {
|
|
522
|
-
var
|
|
523
|
-
for (
|
|
524
|
-
Object.prototype.hasOwnProperty.call(e,
|
|
525
|
-
for (
|
|
526
|
-
Object.prototype.hasOwnProperty.call(t,
|
|
527
|
-
return
|
|
511
|
+
var a = {}, n;
|
|
512
|
+
for (n in e)
|
|
513
|
+
Object.prototype.hasOwnProperty.call(e, n) && (a[n] = e[n]);
|
|
514
|
+
for (n in t)
|
|
515
|
+
Object.prototype.hasOwnProperty.call(t, n) && (a[n] = t[n]);
|
|
516
|
+
return a;
|
|
528
517
|
},
|
|
529
518
|
/**
|
|
530
519
|
* @private
|
|
@@ -541,27 +530,27 @@ var V = { exports: {} };
|
|
|
541
530
|
* @return void
|
|
542
531
|
*/
|
|
543
532
|
_handleKeyDown: function(e) {
|
|
544
|
-
var t = s._getNormalizedKeyNum(e),
|
|
545
|
-
if (
|
|
546
|
-
if (
|
|
547
|
-
|
|
533
|
+
var t = s._getNormalizedKeyNum(e), a = this.scannerDetectionData.options, n = this.scannerDetectionData.vars, l = !1;
|
|
534
|
+
if (a.onKeyDetect.call(this, t, e) !== !1 && !s._isFocusOnIgnoredElement(this)) {
|
|
535
|
+
if (a.scanButtonKeyCode !== !1 && t == a.scanButtonKeyCode) {
|
|
536
|
+
n.longPressed || (n.longPressTimer = setTimeout(a.onScanButtonLongPress, a.scanButtonLongPressTime, this), n.longPressed = !0);
|
|
548
537
|
return;
|
|
549
538
|
}
|
|
550
539
|
switch (!0) {
|
|
551
|
-
case (
|
|
540
|
+
case (n.firstCharTime && a.suffixKeyCodes.indexOf(t) !== -1):
|
|
552
541
|
e.preventDefault(), e.stopImmediatePropagation(), l = !0;
|
|
553
542
|
break;
|
|
554
|
-
case (!
|
|
543
|
+
case (!n.firstCharTime && a.prefixKeyCodes.indexOf(t) !== -1):
|
|
555
544
|
e.preventDefault(), e.stopImmediatePropagation(), l = !1;
|
|
556
545
|
break;
|
|
557
546
|
default:
|
|
558
|
-
var
|
|
559
|
-
if (
|
|
547
|
+
var f = a.keyCodeMapper.call(this, e);
|
|
548
|
+
if (f === null)
|
|
560
549
|
return;
|
|
561
|
-
|
|
550
|
+
n.accumulatedString += f, a.preventDefault && e.preventDefault(), a.stopPropagation && e.stopImmediatePropagation(), l = !1;
|
|
562
551
|
break;
|
|
563
552
|
}
|
|
564
|
-
|
|
553
|
+
n.firstCharTime || (n.firstCharTime = Date.now()), n.lastCharTime = Date.now(), n.testTimer && clearTimeout(n.testTimer), l ? (s._validateScanCode(this, n.accumulatedString), n.testTimer = !1) : n.testTimer = setTimeout(s._validateScanCode, a.timeBeforeScanTest, this, n.accumulatedString), a.onKeyProcess.call(this, f, e);
|
|
565
554
|
}
|
|
566
555
|
},
|
|
567
556
|
/**
|
|
@@ -570,8 +559,8 @@ var V = { exports: {} };
|
|
|
570
559
|
* @return void
|
|
571
560
|
*/
|
|
572
561
|
_handlePaste: function(e) {
|
|
573
|
-
var t = this.scannerDetectionData.options,
|
|
574
|
-
s._isFocusOnIgnoredElement(this) || (e.preventDefault(), t.stopPropagation && e.stopImmediatePropagation(), t.onPaste.call(this,
|
|
562
|
+
var t = this.scannerDetectionData.options, a = this.scannerDetectionData.vars, n = (event.clipboardData || window.clipboardData).getData("text");
|
|
563
|
+
s._isFocusOnIgnoredElement(this) || (e.preventDefault(), t.stopPropagation && e.stopImmediatePropagation(), t.onPaste.call(this, n, event), a.firstCharTime = 0, a.lastCharTime = 0, s._validateScanCode(this, n));
|
|
575
564
|
},
|
|
576
565
|
/**
|
|
577
566
|
* @private
|
|
@@ -606,39 +595,39 @@ var V = { exports: {} };
|
|
|
606
595
|
return s;
|
|
607
596
|
});
|
|
608
597
|
})(V);
|
|
609
|
-
var
|
|
610
|
-
const
|
|
598
|
+
var Ce = V.exports;
|
|
599
|
+
const C = /* @__PURE__ */ ge(Ce), we = { id: "scan_input" }, ke = /* @__PURE__ */ d({
|
|
611
600
|
__name: "ScanInput",
|
|
612
601
|
props: {
|
|
613
602
|
scanHandler: { type: Function }
|
|
614
603
|
},
|
|
615
604
|
emits: ["scanInstance"],
|
|
616
|
-
setup(r, { emit:
|
|
617
|
-
const s =
|
|
605
|
+
setup(r, { emit: o }) {
|
|
606
|
+
const s = o, e = r;
|
|
618
607
|
return S(() => {
|
|
619
|
-
const t =
|
|
608
|
+
const t = C.attachTo(window, { onScan: e.scanHandler });
|
|
620
609
|
s("scanInstance", t);
|
|
621
|
-
}),
|
|
622
|
-
|
|
623
|
-
}), (t,
|
|
610
|
+
}), B(() => {
|
|
611
|
+
C.detachFrom(window);
|
|
612
|
+
}), (t, a) => (c(), u("div", we));
|
|
624
613
|
}
|
|
625
614
|
});
|
|
626
|
-
function
|
|
627
|
-
r.component("ActionFooter",
|
|
615
|
+
function Pe(r) {
|
|
616
|
+
r.component("ActionFooter", R), r.component("BeamMetadata", J), r.component("BeamModal", Z), r.component("BeamModalOutlet", ee), r.component("Confirm", oe), r.component("ItemCheck", L), r.component("ItemCount", I), r.component("ListAnchor", de), r.component("ListItem", b), r.component("ListView", _e), r.component("Navbar", ye), r.component("ScanInput", ke);
|
|
628
617
|
}
|
|
629
618
|
export {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
619
|
+
R as ActionFooter,
|
|
620
|
+
J as BeamMetadata,
|
|
621
|
+
Z as BeamModal,
|
|
622
|
+
ee as BeamModalOutlet,
|
|
623
|
+
oe as Confirm,
|
|
624
|
+
L as ItemCheck,
|
|
625
|
+
I as ItemCount,
|
|
626
|
+
de as ListAnchor,
|
|
627
|
+
b as ListItem,
|
|
628
|
+
_e as ListView,
|
|
629
|
+
ye as Navbar,
|
|
630
|
+
ke as ScanInput,
|
|
631
|
+
Pe as install
|
|
643
632
|
};
|
|
644
633
|
//# sourceMappingURL=beam.js.map
|