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