@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.js CHANGED
@@ -1,103 +1,137 @@
1
- import { defineComponent as d, openBlock as i, createElementBlock as u, createElementVNode as c, renderSlot as v, resolveComponent as k, createBlock as p, withCtx as w, withDirectives as T, vShow as I, useModel as P, vModelCheckbox as V, mergeModels as M, computed as E, normalizeClass as F, toDisplayString as h, createCommentVNode as y, ref as N, onMounted as D, onUnmounted as $, Fragment as x, renderList as A, resolveDynamicComponent as z, createVNode as O, createTextVNode as U } from "vue";
2
- const j = { class: "beam__actionfooter" }, H = { class: "footer-action-wrapper" }, Q = /* @__PURE__ */ d({
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(s, { emit: o }) {
6
- const r = o, e = () => {
7
- r("click");
5
+ setup(r, { emit: n }) {
6
+ const s = n, e = () => {
7
+ s("click");
8
8
  };
9
- return (t, a) => (i(), u("footer", j, [
10
- c("span", H, [
11
- c("button", {
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
- v(t.$slots, "default")
15
+ _(t.$slots, "default")
16
16
  ])
17
17
  ])
18
18
  ]));
19
19
  }
20
- }), q = { class: "beam__modal" }, R = /* @__PURE__ */ d({
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(s) {
26
- return (o, r) => {
27
- const e = k("portal");
28
- return i(), p(e, { to: "beam__modal_outlet" }, {
29
- default: w(() => [
30
- T(c("div", q, [
31
- c("button", {
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: r[0] || (r[0] = (t) => o.$emit("closemodal"))
67
+ onClick: s[0] || (s[0] = (t) => n.$emit("closemodal"))
34
68
  }, "Close Modal"),
35
- v(o.$slots, "default", {
36
- onClosemodal: r[1] || (r[1] = (t) => o.$emit("closemodal")),
37
- onConfirmmodal: r[2] || (r[2] = (t) => o.$emit("confirmmodal"))
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
- [I, o.showModal]
74
+ [E, n.showModal]
41
75
  ])
42
76
  ]),
43
77
  _: 3
44
78
  });
45
79
  };
46
80
  }
47
- }), G = /* @__PURE__ */ d({
81
+ }), oe = /* @__PURE__ */ u({
48
82
  __name: "BeamModalOutlet",
49
83
  emits: ["confirmmodal", "closemodal"],
50
- setup(s) {
51
- return (o, r) => {
52
- const e = k("portal-target");
53
- return i(), p(e, { name: "beam__modal_outlet" });
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
- }), S = (s, o) => {
57
- const r = s.__vccOpts || s;
58
- for (const [e, t] of o)
59
- r[e] = t;
60
- return r;
61
- }, W = {}, Y = { class: "beam__modal-confirm" };
62
- function J(s, o) {
63
- return i(), u("div", Y, [
64
- o[2] || (o[2] = c("h2", null, "Would you like to continue?", -1)),
65
- c("button", {
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: o[0] || (o[0] = (r) => s.$emit("confirmmodal"))
101
+ onClick: n[0] || (n[0] = (s) => r.$emit("confirmmodal"))
68
102
  }, "Yes"),
69
- c("button", {
103
+ i("button", {
70
104
  class: "btn",
71
- onClick: o[1] || (o[1] = (r) => s.$emit("closemodal"))
105
+ onClick: n[1] || (n[1] = (s) => r.$emit("closemodal"))
72
106
  }, "No")
73
107
  ]);
74
108
  }
75
- const X = /* @__PURE__ */ S(W, [["render", J]]), Z = { class: "container" }, ee = /* @__PURE__ */ d({
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(s) {
83
- const o = P(s, "modelValue");
84
- return (r, e) => (i(), u("label", Z, [
85
- T(c("input", {
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) => o.value = t),
121
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => n.value = t),
88
122
  tabindex: "-1"
89
123
  }, null, 512), [
90
- [V, o.value]
124
+ [F, n.value]
91
125
  ]),
92
- e[1] || (e[1] = c("div", {
126
+ e[1] || (e[1] = i("div", {
93
127
  class: "checkmark",
94
128
  tabindex: "0"
95
129
  }, null, -1))
96
130
  ]));
97
131
  }
98
- }), K = /* @__PURE__ */ S(ee, [["__scopeId", "data-v-f44a510e"]]), te = { class: "beam__itemcount" }, ne = ["contenteditable"], ae = { key: 0 }, L = /* @__PURE__ */ d({
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__ */ M({
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(s) {
110
- const o = P(s, "modelValue"), r = E(() => o.value === s.denominator), e = (t) => {
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 a = Number(t.target.innerHTML) || 0;
113
- o.value = Math.min(a, s.denominator);
146
+ const o = Number(t.target.innerHTML) || 0;
147
+ n.value = Math.min(o, r.denominator);
114
148
  };
115
- return (t, a) => (i(), u("div", te, [
116
- c("span", {
149
+ return (t, o) => (c(), d("div", ue, [
150
+ i("span", {
117
151
  contenteditable: t.editable,
118
- class: F({ alert: !r.value }),
152
+ class: y({ alert: !s.value }),
119
153
  onInput: e,
120
154
  onClick: e
121
- }, h(o.value), 43, ne),
122
- c("span", null, "/" + h(t.denominator), 1),
123
- t.uom ? (i(), u("span", ae, "  " + h(t.uom), 1)) : y("", !0)
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
- }), oe = ["href"], se = /* @__PURE__ */ d({
160
+ }), pe = ["href"], _e = /* @__PURE__ */ u({
127
161
  __name: "ListAnchor",
128
162
  props: {
129
163
  to: { default: "" }
130
164
  },
131
- setup(s) {
132
- return (o, r) => (i(), u("a", {
133
- href: o.to,
165
+ setup(r) {
166
+ return (n, s) => (c(), d("a", {
167
+ href: n.to,
134
168
  class: "beam__listanchor"
135
169
  }, [
136
- v(o.$slots, "default")
137
- ], 8, oe));
170
+ _(n.$slots, "default")
171
+ ], 8, pe));
138
172
  }
139
- }), re = {
173
+ }), ve = {
140
174
  tabindex: "0",
141
175
  class: "beam__listitem"
142
- }, ie = { class: "beam__listtext" }, C = /* @__PURE__ */ d({
176
+ }, he = { class: "beam__listtext" }, C = /* @__PURE__ */ u({
143
177
  __name: "ListItem",
144
178
  props: {
145
179
  item: {}
146
180
  },
147
- setup(s) {
148
- const o = N(s.item);
149
- return (r, e) => (i(), u("li", re, [
150
- c("div", ie, [
151
- c("label", null, h(o.value.label), 1),
152
- c("p", null, h(o.value.description), 1)
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
- o.value.count ? (i(), p(L, {
188
+ n.value.count ? (c(), v(K, {
155
189
  key: 0,
156
- modelValue: o.value.count.count,
157
- "onUpdate:modelValue": e[0] || (e[0] = (t) => o.value.count.count = t),
158
- denominator: o.value.count.of,
159
- uom: o.value.count.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"])) : y("", !0),
162
- o.value.hasOwnProperty("checked") ? (i(), p(K, {
195
+ }, null, 8, ["modelValue", "denominator", "uom"])) : g("", !0),
196
+ n.value.hasOwnProperty("checked") ? (c(), v(I, {
163
197
  key: 1,
164
- modelValue: o.value.checked,
165
- "onUpdate:modelValue": e[1] || (e[1] = (t) => o.value.checked = t)
166
- }, null, 8, ["modelValue"])) : y("", !0)
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
- }), ce = { class: "beam__listview" }, le = /* @__PURE__ */ d({
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(s, { emit: o }) {
176
- const r = o;
177
- D(() => {
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, a = document.documentElement.scrollTop;
184
- t - a <= 2 && r("scrollbottom");
217
+ const t = document.documentElement.scrollHeight - window.innerHeight, o = document.documentElement.scrollTop;
218
+ t - o <= 2 && s("scrollbottom");
185
219
  };
186
- return (t, a) => (i(), u("ul", ce, [
187
- (i(!0), u(x, null, A(t.items, (n) => (i(), u("li", {
188
- key: n.label
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
- n.linkComponent ? (i(), p(z(n.linkComponent), {
224
+ a.linkComponent ? (c(), v(U(a.linkComponent), {
191
225
  key: 0,
192
- to: n.route,
226
+ to: a.route,
193
227
  tabindex: "-1"
194
228
  }, {
195
- default: w(() => [
196
- O(C, { item: n }, null, 8, ["item"])
229
+ default: P(() => [
230
+ j(C, { item: a }, null, 8, ["item"])
197
231
  ]),
198
232
  _: 2
199
- }, 1032, ["to"])) : (i(), p(C, {
233
+ }, 1032, ["to"])) : (c(), v(C, {
200
234
  key: 1,
201
- item: n
235
+ item: a
202
236
  }, null, 8, ["item"]))
203
237
  ]))), 128))
204
238
  ]));
205
239
  }
206
- }), ue = { class: "beam__navbar" }, de = { class: "navbar-action-wrapper" }, me = /* @__PURE__ */ d({
240
+ }), ge = { class: "beam__navbar" }, Ce = { class: "navbar-action-wrapper" }, we = /* @__PURE__ */ u({
207
241
  __name: "Navbar",
208
242
  emits: ["click"],
209
- setup(s, { emit: o }) {
210
- const r = o, e = () => {
211
- r("click");
243
+ setup(r, { emit: n }) {
244
+ const s = n, e = () => {
245
+ s("click");
212
246
  };
213
- return (t, a) => (i(), u("nav", ue, [
214
- v(t.$slots, "title", {}, () => [
215
- a[0] || (a[0] = c("h1", { class: "nav-title" }, "TITLE", -1))
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
- c("div", de, [
218
- c("button", {
251
+ i("div", Ce, [
252
+ i("button", {
219
253
  class: "navbar-action btn",
220
254
  onClick: e
221
255
  }, [
222
- v(t.$slots, "navbaraction", {}, () => [
223
- a[1] || (a[1] = U("Action"))
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 fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
231
- function pe(s) {
232
- return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
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 B = { exports: {} };
235
- (function(s, o) {
236
- (function(r, e) {
237
- s.exports = e();
238
- })(fe, function() {
239
- var r = {
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 a = {
250
- onScan: function(n, l) {
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(n) {
287
+ onScanError: function(a) {
254
288
  },
255
289
  // Callback after detection of a unsuccessfull scanning (scanned string in parameter)
256
- onKeyProcess: function(n, l) {
290
+ onKeyProcess: function(a, l) {
257
291
  },
258
292
  // Callback after receiving and processing a char (scanned char in parameter)
259
- onKeyDetect: function(n, l) {
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(n, l) {
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(n) {
266
- return r.decodeKeyEvent(n);
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(a, t), e.scannerDetectionData = {
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 a = String.fromCharCode(t);
413
+ var o = String.fromCharCode(t);
380
414
  switch (e.shiftKey) {
381
415
  case !1:
382
- a = a.toLowerCase();
416
+ o = o.toLowerCase();
383
417
  break;
384
418
  case !0:
385
- a = a.toUpperCase();
419
+ o = o.toUpperCase();
386
420
  break;
387
421
  }
388
- return a;
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(a) {
412
- var n = {};
413
- (typeof a == "object" || typeof a == "function") && a !== null ? n = a : n.keyCode = parseInt(a);
414
- var l = new KeyboardEvent("keydown", n);
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 a = document.activeElement;
470
+ var o = document.activeElement;
437
471
  if (Array.isArray(t)) {
438
- for (var n = 0; n < t.length; n++)
439
- if (a.matches(t[n]) === !0)
472
+ for (var a = 0; a < t.length; a++)
473
+ if (o.matches(t[a]) === !0)
440
474
  return !0;
441
- } else if (a.matches(t))
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 a = e.scannerDetectionData, n = a.options, l = a.options.singleScanQty, f = a.vars.firstCharTime, g = a.vars.lastCharTime, m = {}, _;
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 < n.minLength:
456
- m = {
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 g - f > t.length * n.avgTimeByChar:
461
- m = {
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 n.onScan.call(e, t, l), _ = new CustomEvent(
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(_), r._reinitialize(e), !0;
508
+ ), e.dispatchEvent(h), s._reinitialize(e), !0;
475
509
  }
476
- return m.scanCode = t, m.scanDuration = g - f, m.avgTimeByChar = n.avgTimeByChar, m.minLength = n.minLength, n.onScanError.call(e, m), _ = new CustomEvent(
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: m }
479
- ), e.dispatchEvent(_), r._reinitialize(e), !1;
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 a = {}, n;
489
- for (n in e)
490
- Object.prototype.hasOwnProperty.call(e, n) && (a[n] = e[n]);
491
- for (n in t)
492
- Object.prototype.hasOwnProperty.call(t, n) && (a[n] = t[n]);
493
- return a;
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 = r._getNormalizedKeyNum(e), a = this.scannerDetectionData.options, n = this.scannerDetectionData.vars, l = !1;
511
- if (a.onKeyDetect.call(this, t, e) !== !1 && !r._isFocusOnIgnoredElement(this)) {
512
- if (a.scanButtonKeyCode !== !1 && t == a.scanButtonKeyCode) {
513
- n.longPressed || (n.longPressTimer = setTimeout(a.onScanButtonLongPress, a.scanButtonLongPressTime, this), n.longPressed = !0);
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 (n.firstCharTime && a.suffixKeyCodes.indexOf(t) !== -1):
551
+ case (a.firstCharTime && o.suffixKeyCodes.indexOf(t) !== -1):
518
552
  e.preventDefault(), e.stopImmediatePropagation(), l = !0;
519
553
  break;
520
- case (!n.firstCharTime && a.prefixKeyCodes.indexOf(t) !== -1):
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 f = a.keyCodeMapper.call(this, e);
525
- if (f === null)
558
+ var p = o.keyCodeMapper.call(this, e);
559
+ if (p === null)
526
560
  return;
527
- n.accumulatedString += f, a.preventDefault && e.preventDefault(), a.stopPropagation && e.stopImmediatePropagation(), l = !1;
561
+ a.accumulatedString += p, o.preventDefault && e.preventDefault(), o.stopPropagation && e.stopImmediatePropagation(), l = !1;
528
562
  break;
529
563
  }
530
- n.firstCharTime || (n.firstCharTime = Date.now()), n.lastCharTime = Date.now(), n.testTimer && clearTimeout(n.testTimer), l ? (r._validateScanCode(this, n.accumulatedString), n.testTimer = !1) : n.testTimer = setTimeout(r._validateScanCode, a.timeBeforeScanTest, this, n.accumulatedString), a.onKeyProcess.call(this, f, e);
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, a = this.scannerDetectionData.vars, n = (event.clipboardData || window.clipboardData).getData("text");
540
- r._isFocusOnIgnoredElement(this) || (e.preventDefault(), t.stopPropagation && e.stopImmediatePropagation(), t.onPaste.call(this, n, event), a.firstCharTime = 0, a.lastCharTime = 0, r._validateScanCode(this, n));
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 (!r._isFocusOnIgnoredElement(this)) {
549
- var t = r._getNormalizedKeyNum(e);
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 r;
606
+ return s;
573
607
  });
574
- })(B);
575
- var he = B.exports;
576
- const b = /* @__PURE__ */ pe(he), ve = { id: "scan_input" }, _e = /* @__PURE__ */ d({
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(s, { emit: o }) {
583
- const r = o, e = s;
584
- return D(() => {
585
- const t = b.attachTo(window, { onScan: e.scanHandler });
586
- r("scanInstance", t);
587
- }), $(() => {
588
- b.detachFrom(window);
589
- }), (t, a) => (i(), u("div", ve));
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 Ce(s) {
593
- s.component("ActionFooter", Q), s.component("BeamModal", R), s.component("BeamModalOutlet", G), s.component("Confirm", X), s.component("ItemCheck", K), s.component("ItemCount", L), s.component("ListAnchor", se), s.component("ListItem", C), s.component("ListView", le), s.component("Navbar", me), s.component("ScanInput", _e);
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
- Q as ActionFooter,
597
- R as BeamModal,
598
- G as BeamModalOutlet,
599
- X as Confirm,
600
- K as ItemCheck,
601
- L as ItemCount,
602
- se as ListAnchor,
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
- le as ListView,
605
- me as Navbar,
606
- _e as ScanInput,
607
- Ce as install
639
+ ye as ListView,
640
+ we as Navbar,
641
+ De as ScanInput,
642
+ Le as install
608
643
  };
609
644
  //# sourceMappingURL=beam.js.map