@stonecrop/beam 0.31.0 → 0.33.0

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.
Files changed (84) hide show
  1. package/dist/assets/index.css +645 -1
  2. package/dist/beam.js +674 -591
  3. package/dist/beam.js.map +1 -1
  4. package/dist/src/components/ActionFooter.vue.d.ts +18 -0
  5. package/dist/src/components/ActionFooter.vue.d.ts.map +1 -0
  6. package/dist/src/components/BeamArrow.vue.d.ts +7 -0
  7. package/dist/src/components/BeamArrow.vue.d.ts.map +1 -0
  8. package/dist/src/components/BeamBtn.vue.d.ts +14 -0
  9. package/dist/src/components/BeamBtn.vue.d.ts.map +1 -0
  10. package/dist/src/components/BeamDayDivider.vue.d.ts +17 -0
  11. package/dist/src/components/BeamDayDivider.vue.d.ts.map +1 -0
  12. package/dist/src/components/BeamFilter.vue.d.ts +13 -0
  13. package/dist/src/components/BeamFilter.vue.d.ts.map +1 -0
  14. package/dist/src/components/BeamFilterOption.vue.d.ts +13 -0
  15. package/dist/src/components/BeamFilterOption.vue.d.ts.map +1 -0
  16. package/dist/src/components/BeamHeading.vue.d.ts +14 -0
  17. package/dist/src/components/BeamHeading.vue.d.ts.map +1 -0
  18. package/dist/src/components/BeamMetadata.vue.d.ts +23 -0
  19. package/dist/src/components/BeamMetadata.vue.d.ts.map +1 -0
  20. package/dist/src/components/BeamModal.vue.d.ts +26 -0
  21. package/dist/src/components/BeamModal.vue.d.ts.map +1 -0
  22. package/dist/src/components/BeamModalOutlet.vue.d.ts +10 -0
  23. package/dist/src/components/BeamModalOutlet.vue.d.ts.map +1 -0
  24. package/dist/src/components/BeamProgress.vue.d.ts +10 -0
  25. package/dist/src/components/BeamProgress.vue.d.ts.map +1 -0
  26. package/dist/src/components/Confirm.vue.d.ts +4 -0
  27. package/dist/src/components/Confirm.vue.d.ts.map +1 -0
  28. package/dist/src/components/FixedTop.vue.d.ts +14 -0
  29. package/dist/src/components/FixedTop.vue.d.ts.map +1 -0
  30. package/dist/src/components/ItemCheck.vue.d.ts +11 -0
  31. package/dist/src/components/ItemCheck.vue.d.ts.map +1 -0
  32. package/dist/src/components/ItemCount.vue.d.ts +19 -0
  33. package/dist/src/components/ItemCount.vue.d.ts.map +1 -0
  34. package/dist/src/components/ListAnchor.vue.d.ts +17 -0
  35. package/dist/src/components/ListAnchor.vue.d.ts.map +1 -0
  36. package/dist/src/components/ListItem.vue.d.ts +12 -0
  37. package/dist/src/components/ListItem.vue.d.ts.map +1 -0
  38. package/dist/src/components/ListView.vue.d.ts +14 -0
  39. package/dist/src/components/ListView.vue.d.ts.map +1 -0
  40. package/dist/src/components/Navbar.vue.d.ts +20 -0
  41. package/dist/src/components/Navbar.vue.d.ts.map +1 -0
  42. package/dist/src/components/ScanInput.vue.d.ts +12 -0
  43. package/dist/src/components/ScanInput.vue.d.ts.map +1 -0
  44. package/dist/src/components/SegmentedDisplay.vue.d.ts +11 -0
  45. package/dist/src/components/SegmentedDisplay.vue.d.ts.map +1 -0
  46. package/dist/src/components/SplitColumn.vue.d.ts +21 -0
  47. package/dist/src/components/SplitColumn.vue.d.ts.map +1 -0
  48. package/dist/src/components/ToggleArrow.vue.d.ts +7 -0
  49. package/dist/src/components/ToggleArrow.vue.d.ts.map +1 -0
  50. package/dist/{tsdoc-metadata.json → src/tsdoc-metadata.json} +1 -1
  51. package/package.json +31 -26
  52. package/dist/beam.d.ts +0 -167
  53. package/dist/beam.tsbuildinfo +0 -1
  54. package/dist/src/composables/mqtt.js +0 -85
  55. package/dist/src/index.js +0 -56
  56. package/dist/src/types/index.js +0 -0
  57. package/src/components/ActionFooter.vue +0 -31
  58. package/src/components/BeamArrow.vue +0 -37
  59. package/src/components/BeamBtn.vue +0 -32
  60. package/src/components/BeamDayDivider.vue +0 -60
  61. package/src/components/BeamFilter.vue +0 -58
  62. package/src/components/BeamFilterOption.vue +0 -150
  63. package/src/components/BeamHeading.vue +0 -17
  64. package/src/components/BeamMetadata.vue +0 -118
  65. package/src/components/BeamModal.vue +0 -28
  66. package/src/components/BeamModalOutlet.vue +0 -18
  67. package/src/components/BeamProgress.vue +0 -23
  68. package/src/components/Confirm.vue +0 -29
  69. package/src/components/FixedTop.vue +0 -13
  70. package/src/components/ItemCheck.vue +0 -76
  71. package/src/components/ItemCount.vue +0 -55
  72. package/src/components/ListAnchor.vue +0 -17
  73. package/src/components/ListItem.vue +0 -85
  74. package/src/components/ListView.vue +0 -62
  75. package/src/components/Navbar.vue +0 -42
  76. package/src/components/ScanInput.vue +0 -23
  77. package/src/components/SegmentedDisplay.vue +0 -55
  78. package/src/components/SplitColumn.vue +0 -49
  79. package/src/components/ToggleArrow.vue +0 -35
  80. package/src/composables/mqtt.ts +0 -102
  81. package/src/index.ts +0 -87
  82. package/src/onscan.d.ts +0 -45
  83. package/src/shims-vue.d.ts +0 -7
  84. package/src/types/index.ts +0 -77
package/dist/beam.js CHANGED
@@ -1,597 +1,680 @@
1
- import { defineComponent as u, resolveComponent as f, openBlock as s, createElementBlock as i, createElementVNode as l, createVNode as p, withCtx as b, renderSlot as v, normalizeStyle as B, createTextVNode as g, computed as I, Fragment as S, toDisplayString as _, ref as $, withDirectives as x, vShow as N, renderList as O, normalizeClass as C, createCommentVNode as y, unref as U, createStaticVNode as j, createBlock as h, useModel as T, vModelCheckbox as R, withModifiers as V, mergeModels as q, watch as z, onMounted as F, onUnmounted as A, resolveDynamicComponent as W } from "vue";
2
- import { vOnClickOutside as Y } from "@vueuse/components";
3
- import { useDebounceFn as G } from "@vueuse/core";
4
- import D from "onscan.js";
5
- import J from "mqtt";
6
- import './assets/index.css';const K = { class: "beam_action-footer" }, Q = { class: "footer-action-wrapper" }, X = /* @__PURE__ */ u({
7
- __name: "ActionFooter",
8
- emits: ["click"],
9
- setup(e, { emit: t }) {
10
- const o = t, n = () => {
11
- o("click");
12
- };
13
- return (a, c) => {
14
- const r = f("BeamBtn");
15
- return s(), i("footer", K, [
16
- l("span", Q, [
17
- p(r, { onClick: n }, {
18
- default: b(() => [
19
- v(a.$slots, "default", {}, void 0, !0)
20
- ]),
21
- _: 3
22
- })
23
- ])
24
- ]);
25
- };
26
- }
27
- }), m = (e, t) => {
28
- const o = e.__vccOpts || e;
29
- for (const [n, a] of t)
30
- o[n] = a;
31
- return o;
32
- }, Z = /* @__PURE__ */ m(X, [["__scopeId", "data-v-37933bd1"]]), ee = { class: "beam_metadata_arrow" }, te = { class: "beam_metadata_arrow-head" }, oe = {
33
- id: "Layer_1",
34
- xmlns: "http://www.w3.org/2000/svg",
35
- viewBox: "0 0 6.74 7.78"
36
- }, ne = /* @__PURE__ */ u({
37
- __name: "BeamArrow",
38
- props: {
39
- color: { default: "#c4c4c4" }
40
- },
41
- setup(e) {
42
- return (t, o) => (s(), i("div", ee, [
43
- l("div", {
44
- class: "beam_metadata_arrow-body",
45
- style: B({ background: e.color })
46
- }, null, 4),
47
- l("div", te, [
48
- (s(), i("svg", oe, [
49
- l("polygon", {
50
- points: "6.74 3.89 0 0 0 7.78 6.74 3.89",
51
- style: B([{ fill: "#c4c4c4" }, { fill: e.color }])
52
- }, null, 4)
53
- ]))
54
- ])
55
- ]));
56
- }
57
- }), ae = /* @__PURE__ */ m(ne, [["__scopeId", "data-v-2b1d7448"]]), se = {}, le = { class: "beam_btn" };
58
- function ce(e, t) {
59
- return s(), i("button", le, [
60
- v(e.$slots, "default", {}, () => [
61
- t[0] || (t[0] = g("Action", -1))
62
- ], !0)
63
- ]);
1
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createStaticVNode, createTextVNode, createVNode, defineComponent, mergeModels, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, unref, useModel, vModelCheckbox, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
2
+ import { vOnClickOutside } from "@vueuse/components";
3
+ import { useDebounceFn } from "@vueuse/core";
4
+ import onScan from "onscan.js";
5
+ import mqtt from "mqtt";
6
+ import './assets/index.css';//#region src/components/ActionFooter.vue?vue&type=script&setup=true&lang.ts
7
+ var _hoisted_1$19 = { class: "beam_action-footer" };
8
+ var _hoisted_2$7 = { class: "footer-action-wrapper" };
9
+ var ActionFooter_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
10
+ __name: "ActionFooter",
11
+ emits: ["click"],
12
+ setup(__props, { emit: __emit }) {
13
+ const emit = __emit;
14
+ const handleFooterAction = () => {
15
+ emit("click");
16
+ };
17
+ return (_ctx, _cache) => {
18
+ const _component_BeamBtn = resolveComponent("BeamBtn");
19
+ return openBlock(), createElementBlock("footer", _hoisted_1$19, [createElementVNode("span", _hoisted_2$7, [createVNode(_component_BeamBtn, { onClick: handleFooterAction }, {
20
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
21
+ _: 3
22
+ })])]);
23
+ };
24
+ }
25
+ });
26
+ //#endregion
27
+ //#region \0plugin-vue:export-helper
28
+ var _plugin_vue_export_helper_default = (sfc, props) => {
29
+ const target = sfc.__vccOpts || sfc;
30
+ for (const [key, val] of props) target[key] = val;
31
+ return target;
32
+ };
33
+ //#endregion
34
+ //#region src/components/ActionFooter.vue
35
+ var ActionFooter_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ActionFooter_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-37933bd1"]]);
36
+ //#endregion
37
+ //#region src/components/BeamArrow.vue?vue&type=script&setup=true&lang.ts
38
+ var _hoisted_1$18 = { class: "beam_metadata_arrow" };
39
+ var _hoisted_2$6 = { class: "beam_metadata_arrow-head" };
40
+ var _hoisted_3$4 = {
41
+ id: "Layer_1",
42
+ xmlns: "http://www.w3.org/2000/svg",
43
+ viewBox: "0 0 6.74 7.78"
44
+ };
45
+ //#endregion
46
+ //#region src/components/BeamArrow.vue
47
+ var BeamArrow_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
48
+ __name: "BeamArrow",
49
+ props: { color: { default: "#c4c4c4" } },
50
+ setup(__props) {
51
+ return (_ctx, _cache) => {
52
+ return openBlock(), createElementBlock("div", _hoisted_1$18, [createElementVNode("div", {
53
+ class: "beam_metadata_arrow-body",
54
+ style: normalizeStyle({ background: __props.color })
55
+ }, null, 4), createElementVNode("div", _hoisted_2$6, [(openBlock(), createElementBlock("svg", _hoisted_3$4, [createElementVNode("polygon", {
56
+ points: "6.74 3.89 0 0 0 7.78 6.74 3.89",
57
+ style: normalizeStyle([{ "fill": "#c4c4c4" }, { fill: __props.color }])
58
+ }, null, 4)]))])]);
59
+ };
60
+ }
61
+ }), [["__scopeId", "data-v-2b1d7448"]]);
62
+ //#endregion
63
+ //#region src/components/BeamBtn.vue
64
+ var _sfc_main$3 = {};
65
+ var _hoisted_1$17 = { class: "beam_btn" };
66
+ function _sfc_render$3(_ctx, _cache) {
67
+ return openBlock(), createElementBlock("button", _hoisted_1$17, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createTextVNode("Action", -1))], true)]);
64
68
  }
65
- const ie = /* @__PURE__ */ m(se, [["render", ce], ["__scopeId", "data-v-bc768596"]]), re = { class: "beam_day-divider" }, de = /* @__PURE__ */ u({
66
- __name: "BeamDayDivider",
67
- props: {
68
- item: {}
69
- },
70
- setup(e) {
71
- const t = I(() => {
72
- if (!e.item.date || isNaN(Date.parse(e.item.date)))
73
- return e.item.date;
74
- const o = new Date(e.item.date);
75
- return e.item.dateFormat && e.item.dateFormat.toLowerCase() === "iso" ? o.toISOString() : o.toDateString();
76
- });
77
- return (o, n) => (s(), i(S, null, [
78
- l("div", re, [
79
- l("h2", null, _(t.value), 1)
80
- ]),
81
- v(o.$slots, "default", {}, void 0, !0)
82
- ], 64));
83
- }
84
- }), L = /* @__PURE__ */ m(de, [["__scopeId", "data-v-160cf6ef"]]), me = { class: "beam_filters" }, ue = { class: "beam_filters-options" }, _e = /* @__PURE__ */ u({
85
- __name: "BeamFilter",
86
- setup(e) {
87
- const t = $(!1);
88
- return (o, n) => {
89
- const a = f("ToggleArrow"), c = f("BeamHeading");
90
- return s(), i("div", me, [
91
- l("div", {
92
- class: "beam_filters-heading",
93
- onClick: n[0] || (n[0] = (r) => t.value = !t.value)
94
- }, [
95
- p(a, { open: t.value }, null, 8, ["open"]),
96
- p(c, null, {
97
- default: b(() => [...n[1] || (n[1] = [
98
- g("Filter", -1)
99
- ])]),
100
- _: 1
101
- })
102
- ]),
103
- x(l("div", ue, [
104
- v(o.$slots, "default", {}, void 0, !0)
105
- ], 512), [
106
- [N, t.value]
107
- ])
108
- ]);
109
- };
110
- }
111
- }), ve = /* @__PURE__ */ m(_e, [["__scopeId", "data-v-f8d60c9f"]]), fe = { class: "beam_filter-container" }, pe = { class: "beam_filter-option-select" }, be = { class: "beam_filter-label" }, ge = {
112
- key: 0,
113
- ref: "menu",
114
- class: "beam_filter-select-menu"
115
- }, $e = ["data-value", "onClick"], he = /* @__PURE__ */ u({
116
- __name: "BeamFilterOption",
117
- props: {
118
- choices: {},
119
- title: { default: "title" }
120
- },
121
- emits: ["select"],
122
- setup(e, { emit: t }) {
123
- const o = t, n = $(!1), a = $(e.choices[0].label), c = $(e.choices[0].value), r = (d) => {
124
- a.value = d.label, c.value = d.value, o("select", d);
125
- };
126
- return (d, k) => {
127
- const P = f("BeamHeading");
128
- return x((s(), i("div", fe, [
129
- p(P, { class: "beam_filter-option-heading" }, {
130
- default: b(() => [
131
- g(_(e.title), 1)
132
- ]),
133
- _: 1
134
- }),
135
- l("div", {
136
- class: "beam_filter-option",
137
- onClick: k[0] || (k[0] = (w) => n.value = !n.value)
138
- }, [
139
- l("div", pe, [
140
- k[1] || (k[1] = l("div", { class: "beam_filter-arrow" }, [
141
- l("svg", {
142
- xmlns: "http://www.w3.org/2000/svg",
143
- viewBox: "0 0 35.36 70.71"
144
- }, [
145
- l("polygon", { points: "0 70.71 0 0 35.36 35.36 0 70.71" })
146
- ])
147
- ], -1)),
148
- l("div", be, [
149
- l("label", null, _(a.value), 1)
150
- ])
151
- ]),
152
- n.value ? (s(), i("ul", ge, [
153
- (s(!0), i(S, null, O(e.choices, (w) => (s(), i("li", {
154
- key: w.value,
155
- class: C([{ selected: a.value == w.label }, "beam_filter-select-option"]),
156
- "data-value": w.value,
157
- onClick: (yt) => r(w)
158
- }, _(w.label), 11, $e))), 128))
159
- ], 512)) : y("", !0)
160
- ])
161
- ])), [
162
- [U(Y), () => n.value = !1]
163
- ]);
164
- };
165
- }
166
- }), we = /* @__PURE__ */ m(he, [["__scopeId", "data-v-ad8ee21c"]]), Be = {}, ye = { class: "beam_header" };
167
- function Ce(e, t) {
168
- return s(), i("h1", ye, [
169
- v(e.$slots, "default", {}, void 0, !0)
170
- ]);
69
+ var BeamBtn_default = /*#__PURE__*/ _plugin_vue_export_helper_default(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-bc768596"]]);
70
+ //#endregion
71
+ //#region src/components/BeamDayDivider.vue?vue&type=script&setup=true&lang.ts
72
+ var _hoisted_1$16 = { class: "beam_day-divider" };
73
+ //#endregion
74
+ //#region src/components/BeamDayDivider.vue
75
+ var BeamDayDivider_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
76
+ __name: "BeamDayDivider",
77
+ props: { item: {} },
78
+ setup(__props) {
79
+ const date = computed(() => {
80
+ if (!__props.item.date || isNaN(Date.parse(__props.item.date))) return __props.item.date;
81
+ const dateObj = new Date(__props.item.date);
82
+ if (__props.item.dateFormat) switch (__props.item.dateFormat.toLowerCase()) {
83
+ case "iso": return dateObj.toISOString();
84
+ }
85
+ return dateObj.toDateString();
86
+ });
87
+ return (_ctx, _cache) => {
88
+ return openBlock(), createElementBlock(Fragment, null, [createElementVNode("div", _hoisted_1$16, [createElementVNode("h2", null, toDisplayString(date.value), 1)]), renderSlot(_ctx.$slots, "default", {}, void 0, true)], 64);
89
+ };
90
+ }
91
+ }), [["__scopeId", "data-v-160cf6ef"]]);
92
+ //#endregion
93
+ //#region src/components/BeamFilter.vue?vue&type=script&setup=true&lang.ts
94
+ var _hoisted_1$15 = { class: "beam_filters" };
95
+ var _hoisted_2$5 = { class: "beam_filters-options" };
96
+ //#endregion
97
+ //#region src/components/BeamFilter.vue
98
+ var BeamFilter_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
99
+ __name: "BeamFilter",
100
+ setup(__props) {
101
+ const isFilterExpanded = ref(false);
102
+ return (_ctx, _cache) => {
103
+ const _component_ToggleArrow = resolveComponent("ToggleArrow");
104
+ const _component_BeamHeading = resolveComponent("BeamHeading");
105
+ return openBlock(), createElementBlock("div", _hoisted_1$15, [createElementVNode("div", {
106
+ class: "beam_filters-heading",
107
+ onClick: _cache[0] || (_cache[0] = ($event) => isFilterExpanded.value = !isFilterExpanded.value)
108
+ }, [createVNode(_component_ToggleArrow, { open: isFilterExpanded.value }, null, 8, ["open"]), createVNode(_component_BeamHeading, null, {
109
+ default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("Filter", -1)])]),
110
+ _: 1
111
+ })]), withDirectives(createElementVNode("div", _hoisted_2$5, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 512), [[vShow, isFilterExpanded.value]])]);
112
+ };
113
+ }
114
+ }), [["__scopeId", "data-v-f8d60c9f"]]);
115
+ //#endregion
116
+ //#region src/components/BeamFilterOption.vue?vue&type=script&setup=true&lang.ts
117
+ var _hoisted_1$14 = { class: "beam_filter-container" };
118
+ var _hoisted_2$4 = { class: "beam_filter-option-select" };
119
+ var _hoisted_3$3 = { class: "beam_filter-label" };
120
+ var _hoisted_4$2 = {
121
+ key: 0,
122
+ ref: "menu",
123
+ class: "beam_filter-select-menu"
124
+ };
125
+ var _hoisted_5 = ["data-value", "onClick"];
126
+ //#endregion
127
+ //#region src/components/BeamFilterOption.vue
128
+ var BeamFilterOption_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
129
+ __name: "BeamFilterOption",
130
+ props: {
131
+ choices: {},
132
+ title: { default: "title" }
133
+ },
134
+ emits: ["select"],
135
+ setup(__props, { emit: __emit }) {
136
+ const emit = __emit;
137
+ const isMenuOpen = ref(false);
138
+ const label = ref(__props.choices[0].label);
139
+ const value = ref(__props.choices[0].value);
140
+ const selectChoice = (data) => {
141
+ label.value = data.label;
142
+ value.value = data.value;
143
+ emit("select", data);
144
+ };
145
+ return (_ctx, _cache) => {
146
+ const _component_BeamHeading = resolveComponent("BeamHeading");
147
+ return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$14, [createVNode(_component_BeamHeading, { class: "beam_filter-option-heading" }, {
148
+ default: withCtx(() => [createTextVNode(toDisplayString(__props.title), 1)]),
149
+ _: 1
150
+ }), createElementVNode("div", {
151
+ class: "beam_filter-option",
152
+ onClick: _cache[0] || (_cache[0] = ($event) => isMenuOpen.value = !isMenuOpen.value)
153
+ }, [createElementVNode("div", _hoisted_2$4, [_cache[1] || (_cache[1] = createElementVNode("div", { class: "beam_filter-arrow" }, [createElementVNode("svg", {
154
+ xmlns: "http://www.w3.org/2000/svg",
155
+ viewBox: "0 0 35.36 70.71"
156
+ }, [createElementVNode("polygon", { points: "0 70.71 0 0 35.36 35.36 0 70.71" })])], -1)), createElementVNode("div", _hoisted_3$3, [createElementVNode("label", null, toDisplayString(label.value), 1)])]), isMenuOpen.value ? (openBlock(), createElementBlock("ul", _hoisted_4$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.choices, (choice) => {
157
+ return openBlock(), createElementBlock("li", {
158
+ key: choice.value,
159
+ class: normalizeClass([{ selected: label.value == choice.label }, "beam_filter-select-option"]),
160
+ "data-value": choice.value,
161
+ onClick: ($event) => selectChoice(choice)
162
+ }, toDisplayString(choice.label), 11, _hoisted_5);
163
+ }), 128))], 512)) : createCommentVNode("", true)])])), [[unref(vOnClickOutside), () => isMenuOpen.value = false]]);
164
+ };
165
+ }
166
+ }), [["__scopeId", "data-v-ad8ee21c"]]);
167
+ //#endregion
168
+ //#region src/components/BeamHeading.vue
169
+ var _sfc_main$2 = {};
170
+ var _hoisted_1$13 = { class: "beam_header" };
171
+ function _sfc_render$2(_ctx, _cache) {
172
+ return openBlock(), createElementBlock("h1", _hoisted_1$13, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]);
171
173
  }
172
- const ke = /* @__PURE__ */ m(Be, [["render", Ce], ["__scopeId", "data-v-5182a4d5"]]), Ie = { class: "beam_metadata" }, xe = { class: "beam_metadata_content" }, Me = { class: "beam_metadata_block" }, Se = { class: "beam_metadata_heading" }, Fe = /* @__PURE__ */ u({
173
- __name: "BeamMetadata",
174
- props: {
175
- order: {}
176
- },
177
- setup(e) {
178
- return (t, o) => (s(), i("div", Ie, [
179
- l("div", xe, [
180
- v(t.$slots, "default", {}, () => [
181
- o[1] || (o[1] = l("div", { class: "beam_metadata_header beam_metadata--two-column" }, null, -1)),
182
- l("div", Me, [
183
- l("p", Se, [
184
- o[0] || (o[0] = g(" Status: ", -1)),
185
- l("span", {
186
- class: C([{ alert: !e.order.complete }, "beam_metadata--normal"])
187
- }, _(e.order.complete ? "Complete" : "In Progress"), 3)
188
- ])
189
- ]),
190
- o[2] || (o[2] = j('<div class="beam_metadata_shipping beam_metadata_block" data-v-80484331><div class="beam_metadata_source" data-v-80484331><p class="beam_metadata_heading" data-v-80484331>Source</p></div><div class="beam_metadata_source" data-v-80484331><p class="beam_metadata_heading" data-v-80484331>Receiving</p></div></div>', 1))
191
- ], !0)
192
- ]),
193
- o[3] || (o[3] = l("hr", null, null, -1))
194
- ]));
195
- }
196
- }), Ae = /* @__PURE__ */ m(Fe, [["__scopeId", "data-v-80484331"]]), Ve = { class: "beam_modal" }, De = /* @__PURE__ */ u({
197
- __name: "BeamModal",
198
- props: {
199
- showModal: { type: Boolean }
200
- },
201
- emits: ["closemodal", "confirmmodal"],
202
- setup(e) {
203
- return (t, o) => {
204
- const n = f("BeamBtn"), a = f("portal");
205
- return s(), h(a, { to: "beam_modal_outlet" }, {
206
- default: b(() => [
207
- x(l("div", Ve, [
208
- p(n, {
209
- onClick: o[0] || (o[0] = (c) => t.$emit("closemodal"))
210
- }, {
211
- default: b(() => [...o[3] || (o[3] = [
212
- g("Close Modal", -1)
213
- ])]),
214
- _: 1
215
- }),
216
- v(t.$slots, "default", {
217
- onClosemodal: o[1] || (o[1] = (c) => t.$emit("closemodal")),
218
- onConfirmmodal: o[2] || (o[2] = (c) => t.$emit("confirmmodal"))
219
- }, void 0, !0)
220
- ], 512), [
221
- [N, e.showModal]
222
- ])
223
- ]),
224
- _: 3
225
- });
226
- };
227
- }
228
- }), Ne = /* @__PURE__ */ m(De, [["__scopeId", "data-v-73c40686"]]), Oe = /* @__PURE__ */ u({
229
- __name: "BeamModalOutlet",
230
- emits: ["confirmmodal", "closemodal"],
231
- setup(e) {
232
- return (t, o) => {
233
- const n = f("portal-target");
234
- return s(), h(n, { name: "beam_modal_outlet" });
235
- };
236
- }
237
- }), Te = { class: "beam_metadata_heading" }, Le = /* @__PURE__ */ u({
238
- __name: "BeamProgress",
239
- props: {
240
- label: { default: "Status" },
241
- progressMessage: { default: "In Progress" },
242
- completeMessage: { default: "Complete" },
243
- complete: { type: Boolean, default: !1 }
244
- },
245
- setup(e) {
246
- const t = I(() => e.complete ? e.completeMessage : e.progressMessage);
247
- return (o, n) => (s(), i("p", Te, [
248
- g(_(e.label) + ": ", 1),
249
- l("span", {
250
- class: C([{ "beam--alert": !e.complete }, "beam--normal"])
251
- }, _(t.value), 3)
252
- ]));
253
- }
254
- }), Ee = {}, He = { class: "beam_modal-confirm" };
255
- function Pe(e, t) {
256
- const o = f("BeamBtn");
257
- return s(), i("div", He, [
258
- t[4] || (t[4] = l("h2", null, "Would you like to continue?", -1)),
259
- p(o, {
260
- onClick: t[0] || (t[0] = (n) => e.$emit("confirmmodal"))
261
- }, {
262
- default: b(() => [...t[2] || (t[2] = [
263
- g("Yes", -1)
264
- ])]),
265
- _: 1
266
- }),
267
- p(o, {
268
- onClick: t[1] || (t[1] = (n) => e.$emit("confirmmodal"))
269
- }, {
270
- default: b(() => [...t[3] || (t[3] = [
271
- g("No", -1)
272
- ])]),
273
- _: 1
274
- })
275
- ]);
174
+ var BeamHeading_default = /*#__PURE__*/ _plugin_vue_export_helper_default(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-5182a4d5"]]);
175
+ //#endregion
176
+ //#region src/components/BeamMetadata.vue?vue&type=script&setup=true&lang.ts
177
+ var _hoisted_1$12 = { class: "beam_metadata" };
178
+ var _hoisted_2$3 = { class: "beam_metadata_content" };
179
+ var _hoisted_3$2 = { class: "beam_metadata_block" };
180
+ var _hoisted_4$1 = { class: "beam_metadata_heading" };
181
+ //#endregion
182
+ //#region src/components/BeamMetadata.vue
183
+ var BeamMetadata_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
184
+ __name: "BeamMetadata",
185
+ props: { order: {} },
186
+ setup(__props) {
187
+ return (_ctx, _cache) => {
188
+ return openBlock(), createElementBlock("div", _hoisted_1$12, [createElementVNode("div", _hoisted_2$3, [renderSlot(_ctx.$slots, "default", {}, () => [
189
+ _cache[1] || (_cache[1] = createElementVNode("div", { class: "beam_metadata_header beam_metadata--two-column" }, null, -1)),
190
+ createElementVNode("div", _hoisted_3$2, [createElementVNode("p", _hoisted_4$1, [_cache[0] || (_cache[0] = createTextVNode(" Status: ", -1)), createElementVNode("span", { class: normalizeClass([{ alert: !__props.order.complete }, "beam_metadata--normal"]) }, toDisplayString(__props.order.complete ? "Complete" : "In Progress"), 3)])]),
191
+ _cache[2] || (_cache[2] = createStaticVNode("<div class=\"beam_metadata_shipping beam_metadata_block\" data-v-80484331><div class=\"beam_metadata_source\" data-v-80484331><p class=\"beam_metadata_heading\" data-v-80484331>Source</p></div><div class=\"beam_metadata_source\" data-v-80484331><p class=\"beam_metadata_heading\" data-v-80484331>Receiving</p></div></div>", 1))
192
+ ], true)]), _cache[3] || (_cache[3] = createElementVNode("hr", null, null, -1))]);
193
+ };
194
+ }
195
+ }), [["__scopeId", "data-v-80484331"]]);
196
+ //#endregion
197
+ //#region src/components/BeamModal.vue?vue&type=script&setup=true&lang.ts
198
+ var _hoisted_1$11 = { class: "beam_modal" };
199
+ //#endregion
200
+ //#region src/components/BeamModal.vue
201
+ var BeamModal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
202
+ __name: "BeamModal",
203
+ props: { showModal: { type: Boolean } },
204
+ emits: ["closemodal", "confirmmodal"],
205
+ setup(__props) {
206
+ return (_ctx, _cache) => {
207
+ const _component_BeamBtn = resolveComponent("BeamBtn");
208
+ const _component_portal = resolveComponent("portal");
209
+ return openBlock(), createBlock(_component_portal, { to: "beam_modal_outlet" }, {
210
+ default: withCtx(() => [withDirectives(createElementVNode("div", _hoisted_1$11, [createVNode(_component_BeamBtn, { onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("closemodal")) }, {
211
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("Close Modal", -1)])]),
212
+ _: 1
213
+ }), renderSlot(_ctx.$slots, "default", {
214
+ onClosemodal: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("closemodal")),
215
+ onConfirmmodal: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("confirmmodal"))
216
+ }, void 0, true)], 512), [[vShow, __props.showModal]])]),
217
+ _: 3
218
+ });
219
+ };
220
+ }
221
+ }), [["__scopeId", "data-v-73c40686"]]);
222
+ //#endregion
223
+ //#region src/components/BeamModalOutlet.vue
224
+ var BeamModalOutlet_default = /* @__PURE__ */ defineComponent({
225
+ __name: "BeamModalOutlet",
226
+ emits: ["confirmmodal", "closemodal"],
227
+ setup(__props) {
228
+ return (_ctx, _cache) => {
229
+ const _component_portal_target = resolveComponent("portal-target");
230
+ return openBlock(), createBlock(_component_portal_target, { name: "beam_modal_outlet" });
231
+ };
232
+ }
233
+ });
234
+ //#endregion
235
+ //#region src/components/BeamProgress.vue?vue&type=script&setup=true&lang.ts
236
+ var _hoisted_1$10 = { class: "beam_metadata_heading" };
237
+ //#endregion
238
+ //#region src/components/BeamProgress.vue
239
+ var BeamProgress_default = /* @__PURE__ */ defineComponent({
240
+ __name: "BeamProgress",
241
+ props: {
242
+ label: { default: "Status" },
243
+ progressMessage: { default: "In Progress" },
244
+ completeMessage: { default: "Complete" },
245
+ complete: {
246
+ type: Boolean,
247
+ default: false
248
+ }
249
+ },
250
+ setup(__props) {
251
+ const statusMessage = computed(() => __props.complete ? __props.completeMessage : __props.progressMessage);
252
+ return (_ctx, _cache) => {
253
+ return openBlock(), createElementBlock("p", _hoisted_1$10, [createTextVNode(toDisplayString(__props.label) + ": ", 1), createElementVNode("span", { class: normalizeClass([{ "beam--alert": !__props.complete }, "beam--normal"]) }, toDisplayString(statusMessage.value), 3)]);
254
+ };
255
+ }
256
+ });
257
+ //#endregion
258
+ //#region src/components/Confirm.vue
259
+ var _sfc_main$1 = {};
260
+ var _hoisted_1$9 = { class: "beam_modal-confirm" };
261
+ function _sfc_render$1(_ctx, _cache) {
262
+ const _component_BeamBtn = resolveComponent("BeamBtn");
263
+ return openBlock(), createElementBlock("div", _hoisted_1$9, [
264
+ _cache[4] || (_cache[4] = createElementVNode("h2", null, "Would you like to continue?", -1)),
265
+ createVNode(_component_BeamBtn, { onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("confirmmodal")) }, {
266
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode("Yes", -1)])]),
267
+ _: 1
268
+ }),
269
+ createVNode(_component_BeamBtn, { onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("confirmmodal")) }, {
270
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode("No", -1)])]),
271
+ _: 1
272
+ })
273
+ ]);
276
274
  }
277
- const Ue = /* @__PURE__ */ m(Ee, [["render", Pe], ["__scopeId", "data-v-5b430dca"]]), je = {}, Re = { class: "fixed-top" };
278
- function qe(e, t) {
279
- return s(), i("div", Re, [
280
- v(e.$slots, "default", {}, void 0, !0)
281
- ]);
275
+ var Confirm_default = /*#__PURE__*/ _plugin_vue_export_helper_default(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-5b430dca"]]);
276
+ //#endregion
277
+ //#region src/components/FixedTop.vue
278
+ var _sfc_main = {};
279
+ var _hoisted_1$8 = { class: "fixed-top" };
280
+ function _sfc_render(_ctx, _cache) {
281
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]);
282
282
  }
283
- const ze = /* @__PURE__ */ m(je, [["render", qe], ["__scopeId", "data-v-a38a41d0"]]), We = { class: "container" }, Ye = /* @__PURE__ */ u({
284
- __name: "ItemCheck",
285
- props: {
286
- modelValue: { type: Boolean, default: !1 },
287
- modelModifiers: {}
288
- },
289
- emits: ["update:modelValue"],
290
- setup(e) {
291
- const t = T(e, "modelValue");
292
- return (o, n) => (s(), i("label", We, [
293
- x(l("input", {
294
- "onUpdate:modelValue": n[0] || (n[0] = (a) => t.value = a),
295
- type: "checkbox",
296
- tabindex: "-1"
297
- }, null, 512), [
298
- [R, t.value]
299
- ]),
300
- n[1] || (n[1] = l("div", {
301
- class: "checkmark",
302
- tabindex: "0"
303
- }, null, -1))
304
- ]));
305
- }
306
- }), E = /* @__PURE__ */ m(Ye, [["__scopeId", "data-v-ad0dc7dc"]]), Ge = { class: "beam_item-count" }, Je = ["contenteditable"], Ke = { key: 0 }, Qe = { key: 1 }, Xe = /* @__PURE__ */ u({
307
- __name: "ItemCount",
308
- props: /* @__PURE__ */ q({
309
- denominator: { default: 0 },
310
- debounce: { default: 300 },
311
- editable: { type: [Boolean, String], default: !0 },
312
- uom: { default: "" }
313
- }, {
314
- modelValue: { required: !0 },
315
- modelModifiers: {}
316
- }),
317
- emits: ["update:modelValue"],
318
- setup(e) {
319
- const t = T(e, "modelValue"), o = I(() => e.denominator !== 0 && t.value === e.denominator), n = (r) => {
320
- const d = Number(r.target.innerHTML) || 0;
321
- t.value = e.denominator ? Math.min(d, e.denominator) : d;
322
- }, a = G((r) => n(r), e.debounce), c = async (r) => await a(r);
323
- return (r, d) => (s(), i("div", Ge, [
324
- l("span", {
325
- contenteditable: e.editable,
326
- class: C({ "beam--alert": !o.value }),
327
- onClick: V(n, ["stop", "prevent"]),
328
- onInput: V(c, ["stop", "prevent"]),
329
- onPaste: n
330
- }, _(t.value), 43, Je),
331
- e.denominator ? (s(), i("span", Ke, "/" + _(e.denominator), 1)) : y("", !0),
332
- e.uom ? (s(), i("span", Qe, "  " + _(e.uom), 1)) : y("", !0)
333
- ]));
334
- }
335
- }), H = /* @__PURE__ */ m(Xe, [["__scopeId", "data-v-d4f676ed"]]), Ze = ["href"], et = /* @__PURE__ */ u({
336
- __name: "ListAnchor",
337
- props: {
338
- to: { default: "" }
339
- },
340
- setup(e) {
341
- return (t, o) => (s(), i("a", {
342
- href: e.to,
343
- class: "beam_list-anchor"
344
- }, [
345
- v(t.$slots, "default", {}, void 0, !0)
346
- ], 8, Ze));
347
- }
348
- }), tt = /* @__PURE__ */ m(et, [["__scopeId", "data-v-7e3ecf0d"]]), ot = {
349
- tabindex: "0",
350
- class: "beam_list-item"
351
- }, nt = { class: "beam_list-text" }, at = { class: "beam--bold" }, st = /* @__PURE__ */ u({
352
- __name: "ListItem",
353
- props: {
354
- item: {}
355
- },
356
- emits: ["update"],
357
- setup(e, { emit: t }) {
358
- const o = t, n = $(e.item);
359
- return z(
360
- n,
361
- (a) => {
362
- o("update", a);
363
- },
364
- { deep: !0 }
365
- ), (a, c) => (s(), i("li", ot, [
366
- l("div", nt, [
367
- l("label", at, _(n.value.label), 1),
368
- l("p", null, _(n.value.description), 1)
369
- ]),
370
- n.value.count ? (s(), h(H, {
371
- key: 0,
372
- modelValue: n.value.count.count,
373
- "onUpdate:modelValue": c[0] || (c[0] = (r) => n.value.count.count = r),
374
- debounce: n.value.debounce,
375
- denominator: n.value.count.of,
376
- editable: !0,
377
- uom: n.value.count.uom
378
- }, null, 8, ["modelValue", "debounce", "denominator", "uom"])) : y("", !0),
379
- n.value.hasOwnProperty("checked") ? (s(), h(E, {
380
- key: 1,
381
- modelValue: n.value.checked,
382
- "onUpdate:modelValue": c[1] || (c[1] = (r) => n.value.checked = r)
383
- }, null, 8, ["modelValue"])) : y("", !0)
384
- ]));
385
- }
386
- }), M = /* @__PURE__ */ m(st, [["__scopeId", "data-v-634dd647"]]), lt = { class: "beam_list-view" }, ct = /* @__PURE__ */ u({
387
- __name: "ListView",
388
- props: {
389
- items: {}
390
- },
391
- emits: ["update", "scrollbottom"],
392
- setup(e, { emit: t }) {
393
- const o = t;
394
- F(() => {
395
- window.addEventListener("scroll", a);
396
- }), A(() => {
397
- window.removeEventListener("scroll", a);
398
- });
399
- const n = (c) => o("update", c), a = () => {
400
- const c = document.documentElement.scrollHeight - window.innerHeight, r = document.documentElement.scrollTop;
401
- c - r <= 2 && o("scrollbottom");
402
- };
403
- return (c, r) => (s(), i("ul", lt, [
404
- (s(!0), i(S, null, O(e.items, (d) => (s(), i("li", {
405
- key: d.barcode || d.label
406
- }, [
407
- d.linkComponent == "BeamDayDivider" ? (s(), h(L, {
408
- key: 0,
409
- item: d
410
- }, null, 8, ["item"])) : d.linkComponent ? (s(), h(W(d.linkComponent), {
411
- key: 1,
412
- to: d.route,
413
- tabindex: "-1"
414
- }, {
415
- default: b(() => [
416
- p(M, {
417
- item: d,
418
- onUpdate: n
419
- }, null, 8, ["item"])
420
- ]),
421
- _: 2
422
- }, 1032, ["to"])) : (s(), h(M, {
423
- key: 2,
424
- item: d,
425
- onUpdate: n
426
- }, null, 8, ["item"]))
427
- ]))), 128))
428
- ]));
429
- }
430
- }), it = /* @__PURE__ */ m(ct, [["__scopeId", "data-v-d536b2a7"]]), rt = { class: "beam_navbar" }, dt = /* @__PURE__ */ u({
431
- __name: "Navbar",
432
- emits: ["click"],
433
- setup(e, { emit: t }) {
434
- const o = t, n = () => {
435
- o("click");
436
- };
437
- return (a, c) => {
438
- const r = f("BeamHeading"), d = f("BeamBtn");
439
- return s(), i("nav", rt, [
440
- v(a.$slots, "title", {}, () => [
441
- p(r, null, {
442
- default: b(() => [...c[0] || (c[0] = [
443
- g("TITLE", -1)
444
- ])]),
445
- _: 1
446
- })
447
- ], !0),
448
- p(d, { onClick: n }, {
449
- default: b(() => [
450
- v(a.$slots, "navbaraction", {}, () => [
451
- c[1] || (c[1] = g("Action", -1))
452
- ], !0)
453
- ]),
454
- _: 3
455
- })
456
- ]);
457
- };
458
- }
459
- }), mt = /* @__PURE__ */ m(dt, [["__scopeId", "data-v-cfc4c14e"]]), ut = { id: "scan_input" }, _t = /* @__PURE__ */ u({
460
- __name: "ScanInput",
461
- props: {
462
- scanHandler: { type: Function }
463
- },
464
- emits: ["scanInstance"],
465
- setup(e, { emit: t }) {
466
- const o = t, n = e;
467
- return F(() => {
468
- const a = D.attachTo(window, { onScan: n.scanHandler });
469
- o("scanInstance", a);
470
- }), A(() => {
471
- D.detachFrom(window);
472
- }), (a, c) => (s(), i("div", ut));
473
- }
474
- }), vt = /* @__PURE__ */ u({
475
- __name: "SegmentedDisplay",
476
- props: {
477
- displayInput: { default: 120.2568 },
478
- decimalPlaces: { default: 2 },
479
- displayColor: { default: "gray" },
480
- textColor: { default: "white" }
481
- },
482
- setup(e) {
483
- const t = I(() => e.displayInput === 0 ? 0 .toFixed(e.decimalPlaces) : e.displayInput.toFixed(e.decimalPlaces)), o = (n) => n?.substring(0, 2) == "--" ? `var(${n})` : n;
484
- return (n, a) => (s(), i("div", {
485
- class: "segmented-display",
486
- style: B({ background: o(e.displayColor) })
487
- }, [
488
- l("h1", {
489
- class: "segmented-display-output",
490
- style: B({ color: o(e.textColor) })
491
- }, _(t.value), 5)
492
- ], 4));
493
- }
494
- }), ft = /* @__PURE__ */ m(vt, [["__scopeId", "data-v-1731e036"]]), pt = { class: "column column-left" }, bt = { class: "column column-right" }, gt = /* @__PURE__ */ u({
495
- __name: "SplitColumn",
496
- props: {
497
- justifyContent: { default: "space-between" },
498
- alignItems: { default: "flex-start" }
499
- },
500
- setup(e) {
501
- return (t, o) => (s(), i("div", {
502
- class: "two-column",
503
- style: B({ justifyContent: e.justifyContent, alignItems: e.alignItems })
504
- }, [
505
- l("div", pt, [
506
- v(t.$slots, "left", {}, void 0, !0)
507
- ]),
508
- l("div", bt, [
509
- v(t.$slots, "right", {}, void 0, !0)
510
- ])
511
- ], 4));
512
- }
513
- }), $t = /* @__PURE__ */ m(gt, [["__scopeId", "data-v-3f65313d"]]), ht = /* @__PURE__ */ u({
514
- __name: "ToggleArrow",
515
- props: {
516
- open: { type: Boolean }
517
- },
518
- setup(e) {
519
- return (t, o) => (s(), i("div", {
520
- class: C(["arrow-icon", { open: e.open }])
521
- }, [...o[0] || (o[0] = [
522
- l("svg", {
523
- xmlns: "http://www.w3.org/2000/svg",
524
- viewBox: "0 0 35.36 70.71"
525
- }, [
526
- l("polygon", { points: "0 70.71 0 0 35.36 35.36 0 70.71" })
527
- ], -1)
528
- ])], 2));
529
- }
530
- }), wt = /* @__PURE__ */ m(ht, [["__scopeId", "data-v-05e7abed"]]), St = async (e) => {
531
- const t = $({});
532
- if (e.host && e.port && !await Bt(e.host, e.port))
533
- return { messages: t };
534
- const o = $();
535
- return F(() => {
536
- o.value = J.connect(e), e.topics || (e.topics = ["#"]);
537
- for (const n of e.topics)
538
- o.value.subscribe(n, (a) => {
539
- if (a)
540
- throw a;
541
- });
542
- o.value.on("message", (n, a) => {
543
- t.value[n] || (t.value[n] = []), t.value[n].push(a.toString());
544
- });
545
- }), A(() => {
546
- o.value?.end();
547
- }), { messages: t };
548
- }, Bt = async (e, t) => {
549
- try {
550
- const o = new AbortController(), n = setTimeout(() => o.abort(), 2e3);
551
- try {
552
- return await fetch(`${e}:${t}`, {
553
- mode: "no-cors",
554
- // This allows checking without CORS issues
555
- signal: o.signal
556
- }), clearTimeout(n), !0;
557
- } catch (a) {
558
- if (clearTimeout(n), a instanceof DOMException && a.name === "AbortError")
559
- return !1;
560
- const c = String(a);
561
- return !(c.includes("NetworkError") || c.includes("Failed to fetch") || c.includes("net::ERR_CONNECTION_REFUSED"));
562
- }
563
- } catch {
564
- return !1;
565
- }
283
+ var FixedTop_default = /*#__PURE__*/ _plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a38a41d0"]]);
284
+ //#endregion
285
+ //#region src/components/ItemCheck.vue?vue&type=script&setup=true&lang.ts
286
+ var _hoisted_1$7 = { class: "container" };
287
+ //#endregion
288
+ //#region src/components/ItemCheck.vue
289
+ var ItemCheck_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
290
+ __name: "ItemCheck",
291
+ props: {
292
+ "modelValue": {
293
+ type: Boolean,
294
+ default: false
295
+ },
296
+ "modelModifiers": {}
297
+ },
298
+ emits: ["update:modelValue"],
299
+ setup(__props) {
300
+ const value = useModel(__props, "modelValue");
301
+ return (_ctx, _cache) => {
302
+ return openBlock(), createElementBlock("label", _hoisted_1$7, [withDirectives(createElementVNode("input", {
303
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
304
+ type: "checkbox",
305
+ tabindex: "-1"
306
+ }, null, 512), [[vModelCheckbox, value.value]]), _cache[1] || (_cache[1] = createElementVNode("div", {
307
+ class: "checkmark",
308
+ tabindex: "0"
309
+ }, null, -1))]);
310
+ };
311
+ }
312
+ }), [["__scopeId", "data-v-ad0dc7dc"]]);
313
+ //#endregion
314
+ //#region src/components/ItemCount.vue?vue&type=script&setup=true&lang.ts
315
+ var _hoisted_1$6 = { class: "beam_item-count" };
316
+ var _hoisted_2$2 = ["contenteditable"];
317
+ var _hoisted_3$1 = { key: 0 };
318
+ var _hoisted_4 = { key: 1 };
319
+ //#endregion
320
+ //#region src/components/ItemCount.vue
321
+ var ItemCount_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
322
+ __name: "ItemCount",
323
+ props: /*@__PURE__*/ mergeModels({
324
+ denominator: { default: 0 },
325
+ debounce: { default: 300 },
326
+ editable: {
327
+ type: [Boolean, String],
328
+ default: true
329
+ },
330
+ uom: { default: "" }
331
+ }, {
332
+ "modelValue": { required: true },
333
+ "modelModifiers": {}
334
+ }),
335
+ emits: ["update:modelValue"],
336
+ setup(__props) {
337
+ const count = useModel(__props, "modelValue");
338
+ const isCountComplete = computed(() => __props.denominator !== 0 && count.value === __props.denominator);
339
+ const validate = (payload) => {
340
+ const newValue = Number(payload.target.innerHTML) || 0;
341
+ count.value = __props.denominator ? Math.min(newValue, __props.denominator) : newValue;
342
+ };
343
+ const debouncedRequest = useDebounceFn((payload) => validate(payload), __props.debounce);
344
+ const debouncedValidate = async (payload) => await debouncedRequest(payload);
345
+ return (_ctx, _cache) => {
346
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [
347
+ createElementVNode("span", {
348
+ contenteditable: __props.editable,
349
+ class: normalizeClass({ "beam--alert": !isCountComplete.value }),
350
+ onClick: withModifiers(validate, ["stop", "prevent"]),
351
+ onInput: withModifiers(debouncedValidate, ["stop", "prevent"]),
352
+ onPaste: validate
353
+ }, toDisplayString(count.value), 43, _hoisted_2$2),
354
+ __props.denominator ? (openBlock(), createElementBlock("span", _hoisted_3$1, "/" + toDisplayString(__props.denominator), 1)) : createCommentVNode("", true),
355
+ __props.uom ? (openBlock(), createElementBlock("span", _hoisted_4, "\xA0 " + toDisplayString(__props.uom), 1)) : createCommentVNode("", true)
356
+ ]);
357
+ };
358
+ }
359
+ }), [["__scopeId", "data-v-d4f676ed"]]);
360
+ //#endregion
361
+ //#region src/components/ListAnchor.vue?vue&type=script&setup=true&lang.ts
362
+ var _hoisted_1$5 = ["href"];
363
+ //#endregion
364
+ //#region src/components/ListAnchor.vue
365
+ var ListAnchor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
366
+ __name: "ListAnchor",
367
+ props: { to: { default: "" } },
368
+ setup(__props) {
369
+ return (_ctx, _cache) => {
370
+ return openBlock(), createElementBlock("a", {
371
+ href: __props.to,
372
+ class: "beam_list-anchor"
373
+ }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 8, _hoisted_1$5);
374
+ };
375
+ }
376
+ }), [["__scopeId", "data-v-7e3ecf0d"]]);
377
+ //#endregion
378
+ //#region src/components/ListItem.vue?vue&type=script&setup=true&lang.ts
379
+ var _hoisted_1$4 = {
380
+ tabindex: "0",
381
+ class: "beam_list-item"
566
382
  };
567
- function Ft(e) {
568
- e.component("ActionFooter", Z), e.component("BeamArrow", ae), e.component("BeamBtn", ie), e.component("BeamDayDivider", L), e.component("BeamFilter", ve), e.component("BeamFilterOption", we), e.component("BeamHeading", ke), e.component("BeamMetadata", Ae), e.component("BeamModal", Ne), e.component("BeamModalOutlet", Oe), e.component("BeamProgress", Le), e.component("Confirm", Ue), e.component("FixedTop", ze), e.component("ItemCheck", E), e.component("ItemCount", H), e.component("ListAnchor", tt), e.component("ListItem", M), e.component("ListView", it), e.component("Navbar", mt), e.component("ScanInput", _t), e.component("SegmentedDisplay", ft), e.component("SplitColumn", $t), e.component("ToggleArrow", wt);
569
- }
570
- export {
571
- Z as ActionFooter,
572
- ae as BeamArrow,
573
- ie as BeamBtn,
574
- L as BeamDayDivider,
575
- ve as BeamFilter,
576
- we as BeamFilterOption,
577
- ke as BeamHeading,
578
- Ae as BeamMetadata,
579
- Ne as BeamModal,
580
- Oe as BeamModalOutlet,
581
- Le as BeamProgress,
582
- Ue as Confirm,
583
- ze as FixedTop,
584
- E as ItemCheck,
585
- H as ItemCount,
586
- tt as ListAnchor,
587
- M as ListItem,
588
- it as ListView,
589
- mt as Navbar,
590
- _t as ScanInput,
591
- ft as SegmentedDisplay,
592
- $t as SplitColumn,
593
- wt as ToggleArrow,
594
- Ft as install,
595
- St as useMqttStream
383
+ var _hoisted_2$1 = { class: "beam_list-text" };
384
+ var _hoisted_3 = { class: "beam--bold" };
385
+ //#endregion
386
+ //#region src/components/ListItem.vue
387
+ var ListItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
388
+ __name: "ListItem",
389
+ props: { item: {} },
390
+ emits: ["update"],
391
+ setup(__props, { emit: __emit }) {
392
+ const emit = __emit;
393
+ const listItem = ref(__props.item);
394
+ watch(listItem, (value) => {
395
+ emit("update", value);
396
+ }, { deep: true });
397
+ return (_ctx, _cache) => {
398
+ return openBlock(), createElementBlock("li", _hoisted_1$4, [
399
+ createElementVNode("div", _hoisted_2$1, [createElementVNode("label", _hoisted_3, toDisplayString(listItem.value.label), 1), createElementVNode("p", null, toDisplayString(listItem.value.description), 1)]),
400
+ listItem.value.count ? (openBlock(), createBlock(ItemCount_default, {
401
+ key: 0,
402
+ modelValue: listItem.value.count.count,
403
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => listItem.value.count.count = $event),
404
+ debounce: listItem.value.debounce,
405
+ denominator: listItem.value.count.of,
406
+ editable: true,
407
+ uom: listItem.value.count.uom
408
+ }, null, 8, [
409
+ "modelValue",
410
+ "debounce",
411
+ "denominator",
412
+ "uom"
413
+ ])) : createCommentVNode("", true),
414
+ listItem.value.hasOwnProperty("checked") ? (openBlock(), createBlock(ItemCheck_default, {
415
+ key: 1,
416
+ modelValue: listItem.value.checked,
417
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => listItem.value.checked = $event)
418
+ }, null, 8, ["modelValue"])) : createCommentVNode("", true)
419
+ ]);
420
+ };
421
+ }
422
+ }), [["__scopeId", "data-v-634dd647"]]);
423
+ //#endregion
424
+ //#region src/components/ListView.vue?vue&type=script&setup=true&lang.ts
425
+ var _hoisted_1$3 = { class: "beam_list-view" };
426
+ //#endregion
427
+ //#region src/components/ListView.vue
428
+ var ListView_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
429
+ __name: "ListView",
430
+ props: { items: {} },
431
+ emits: ["update", "scrollbottom"],
432
+ setup(__props, { emit: __emit }) {
433
+ const emit = __emit;
434
+ onMounted(() => {
435
+ window.addEventListener("scroll", handleScroll);
436
+ });
437
+ onUnmounted(() => {
438
+ window.removeEventListener("scroll", handleScroll);
439
+ });
440
+ const handleUpdate = (item) => emit("update", item);
441
+ const handleScroll = () => {
442
+ if (document.documentElement.scrollHeight - window.innerHeight - document.documentElement.scrollTop <= 2) emit("scrollbottom");
443
+ };
444
+ return (_ctx, _cache) => {
445
+ return openBlock(), createElementBlock("ul", _hoisted_1$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
446
+ return openBlock(), createElementBlock("li", { key: item.barcode || item.label }, [item.linkComponent == "BeamDayDivider" ? (openBlock(), createBlock(BeamDayDivider_default, {
447
+ key: 0,
448
+ item
449
+ }, null, 8, ["item"])) : item.linkComponent ? (openBlock(), createBlock(resolveDynamicComponent(item.linkComponent), {
450
+ key: 1,
451
+ to: item.route,
452
+ tabindex: "-1"
453
+ }, {
454
+ default: withCtx(() => [createVNode(ListItem_default, {
455
+ item,
456
+ onUpdate: handleUpdate
457
+ }, null, 8, ["item"])]),
458
+ _: 2
459
+ }, 1032, ["to"])) : (openBlock(), createBlock(ListItem_default, {
460
+ key: 2,
461
+ item,
462
+ onUpdate: handleUpdate
463
+ }, null, 8, ["item"]))]);
464
+ }), 128))]);
465
+ };
466
+ }
467
+ }), [["__scopeId", "data-v-d536b2a7"]]);
468
+ //#endregion
469
+ //#region src/components/Navbar.vue?vue&type=script&setup=true&lang.ts
470
+ var _hoisted_1$2 = { class: "beam_navbar" };
471
+ //#endregion
472
+ //#region src/components/Navbar.vue
473
+ var Navbar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
474
+ __name: "Navbar",
475
+ emits: ["click"],
476
+ setup(__props, { emit: __emit }) {
477
+ const emit = __emit;
478
+ const handlePrimaryAction = () => {
479
+ emit("click");
480
+ };
481
+ return (_ctx, _cache) => {
482
+ const _component_BeamHeading = resolveComponent("BeamHeading");
483
+ const _component_BeamBtn = resolveComponent("BeamBtn");
484
+ return openBlock(), createElementBlock("nav", _hoisted_1$2, [renderSlot(_ctx.$slots, "title", {}, () => [createVNode(_component_BeamHeading, null, {
485
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("TITLE", -1)])]),
486
+ _: 1
487
+ })], true), createVNode(_component_BeamBtn, { onClick: handlePrimaryAction }, {
488
+ default: withCtx(() => [renderSlot(_ctx.$slots, "navbaraction", {}, () => [_cache[1] || (_cache[1] = createTextVNode("Action", -1))], true)]),
489
+ _: 3
490
+ })]);
491
+ };
492
+ }
493
+ }), [["__scopeId", "data-v-cfc4c14e"]]);
494
+ //#endregion
495
+ //#region src/components/ScanInput.vue?vue&type=script&setup=true&lang.ts
496
+ var _hoisted_1$1 = { id: "scan_input" };
497
+ //#endregion
498
+ //#region src/components/ScanInput.vue
499
+ var ScanInput_default = /* @__PURE__ */ defineComponent({
500
+ __name: "ScanInput",
501
+ props: { scanHandler: { type: Function } },
502
+ emits: ["scanInstance"],
503
+ setup(__props, { emit: __emit }) {
504
+ const emit = __emit;
505
+ const props = __props;
506
+ onMounted(() => {
507
+ const instance = onScan.attachTo(window, { onScan: props.scanHandler });
508
+ emit("scanInstance", instance);
509
+ });
510
+ onUnmounted(() => {
511
+ onScan.detachFrom(window);
512
+ });
513
+ return (_ctx, _cache) => {
514
+ return openBlock(), createElementBlock("div", _hoisted_1$1);
515
+ };
516
+ }
517
+ });
518
+ //#endregion
519
+ //#region src/components/SegmentedDisplay.vue
520
+ var SegmentedDisplay_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
521
+ __name: "SegmentedDisplay",
522
+ props: {
523
+ displayInput: { default: 120.2568 },
524
+ decimalPlaces: { default: 2 },
525
+ displayColor: { default: "gray" },
526
+ textColor: { default: "white" }
527
+ },
528
+ setup(__props) {
529
+ const getOutput = computed(() => {
530
+ if (__props.displayInput === 0) return 0 .toFixed(__props.decimalPlaces);
531
+ return __props.displayInput.toFixed(__props.decimalPlaces);
532
+ });
533
+ const getColor = (color) => {
534
+ return color?.substring(0, 2) == "--" ? `var(${color})` : color;
535
+ };
536
+ return (_ctx, _cache) => {
537
+ return openBlock(), createElementBlock("div", {
538
+ class: "segmented-display",
539
+ style: normalizeStyle({ background: getColor(__props.displayColor) })
540
+ }, [createElementVNode("h1", {
541
+ class: "segmented-display-output",
542
+ style: normalizeStyle({ color: getColor(__props.textColor) })
543
+ }, toDisplayString(getOutput.value), 5)], 4);
544
+ };
545
+ }
546
+ }), [["__scopeId", "data-v-1731e036"]]);
547
+ //#endregion
548
+ //#region src/components/SplitColumn.vue?vue&type=script&setup=true&lang.ts
549
+ var _hoisted_1 = { class: "column column-left" };
550
+ var _hoisted_2 = { class: "column column-right" };
551
+ //#endregion
552
+ //#region src/components/SplitColumn.vue
553
+ var SplitColumn_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
554
+ __name: "SplitColumn",
555
+ props: {
556
+ justifyContent: { default: "space-between" },
557
+ alignItems: { default: "flex-start" }
558
+ },
559
+ setup(__props) {
560
+ return (_ctx, _cache) => {
561
+ return openBlock(), createElementBlock("div", {
562
+ class: "two-column",
563
+ style: normalizeStyle({
564
+ justifyContent: __props.justifyContent,
565
+ alignItems: __props.alignItems
566
+ })
567
+ }, [createElementVNode("div", _hoisted_1, [renderSlot(_ctx.$slots, "left", {}, void 0, true)]), createElementVNode("div", _hoisted_2, [renderSlot(_ctx.$slots, "right", {}, void 0, true)])], 4);
568
+ };
569
+ }
570
+ }), [["__scopeId", "data-v-3f65313d"]]);
571
+ //#endregion
572
+ //#region src/components/ToggleArrow.vue
573
+ var ToggleArrow_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
574
+ __name: "ToggleArrow",
575
+ props: { open: { type: Boolean } },
576
+ setup(__props) {
577
+ return (_ctx, _cache) => {
578
+ return openBlock(), createElementBlock("div", { class: normalizeClass(["arrow-icon", { open: __props.open }]) }, [..._cache[0] || (_cache[0] = [createElementVNode("svg", {
579
+ xmlns: "http://www.w3.org/2000/svg",
580
+ viewBox: "0 0 35.36 70.71"
581
+ }, [createElementVNode("polygon", { points: "0 70.71 0 0 35.36 35.36 0 70.71" })], -1)])], 2);
582
+ };
583
+ }
584
+ }), [["__scopeId", "data-v-05e7abed"]]);
585
+ //#endregion
586
+ //#region src/composables/mqtt.ts
587
+ /**
588
+ * Use MQTT stream
589
+ * @param options - MQTT stream options
590
+ * @returns MQTT stream messages
591
+ * @beta
592
+ */
593
+ var useMqttStream = async (options) => {
594
+ const messages = ref({});
595
+ if (options.host && options.port) {
596
+ if (!await isPortActive(options.host, options.port)) return { messages };
597
+ }
598
+ const client = ref();
599
+ onMounted(() => {
600
+ client.value = mqtt.connect(options);
601
+ if (!options.topics) options.topics = ["#"];
602
+ for (const topic of options.topics) client.value.subscribe(topic, (err) => {
603
+ if (err) throw err;
604
+ });
605
+ client.value.on("message", (topic, message) => {
606
+ if (!messages.value[topic]) messages.value[topic] = [];
607
+ messages.value[topic].push(message.toString());
608
+ });
609
+ });
610
+ onUnmounted(() => {
611
+ client.value?.end();
612
+ });
613
+ return { messages };
614
+ };
615
+ /**
616
+ * Check if a local port has a service running
617
+ * @param host the host to check
618
+ * @param port the port to check
619
+ * @returns true if the port has a service running, false otherwise
620
+ *
621
+ * @beta
622
+ */
623
+ var isPortActive = async (host, port) => {
624
+ try {
625
+ const controller = new AbortController();
626
+ const timeoutId = setTimeout(() => controller.abort(), 2e3);
627
+ try {
628
+ await fetch(`${host}:${port}`, {
629
+ mode: "no-cors",
630
+ signal: controller.signal
631
+ });
632
+ clearTimeout(timeoutId);
633
+ return true;
634
+ } catch (error) {
635
+ clearTimeout(timeoutId);
636
+ if (error instanceof DOMException && error.name === "AbortError") return false;
637
+ const errorString = String(error);
638
+ if (errorString.includes("NetworkError") || errorString.includes("Failed to fetch") || errorString.includes("net::ERR_CONNECTION_REFUSED")) return false;
639
+ return true;
640
+ }
641
+ } catch {
642
+ return false;
643
+ }
596
644
  };
597
- //# sourceMappingURL=beam.js.map
645
+ //#endregion
646
+ //#region src/index.ts
647
+ /**
648
+ * Install all Beam components
649
+ * @param app - Vue app instance
650
+ * @public
651
+ */
652
+ function install(app) {
653
+ app.component("ActionFooter", ActionFooter_default);
654
+ app.component("BeamArrow", BeamArrow_default);
655
+ app.component("BeamBtn", BeamBtn_default);
656
+ app.component("BeamDayDivider", BeamDayDivider_default);
657
+ app.component("BeamFilter", BeamFilter_default);
658
+ app.component("BeamFilterOption", BeamFilterOption_default);
659
+ app.component("BeamHeading", BeamHeading_default);
660
+ app.component("BeamMetadata", BeamMetadata_default);
661
+ app.component("BeamModal", BeamModal_default);
662
+ app.component("BeamModalOutlet", BeamModalOutlet_default);
663
+ app.component("BeamProgress", BeamProgress_default);
664
+ app.component("Confirm", Confirm_default);
665
+ app.component("FixedTop", FixedTop_default);
666
+ app.component("ItemCheck", ItemCheck_default);
667
+ app.component("ItemCount", ItemCount_default);
668
+ app.component("ListAnchor", ListAnchor_default);
669
+ app.component("ListItem", ListItem_default);
670
+ app.component("ListView", ListView_default);
671
+ app.component("Navbar", Navbar_default);
672
+ app.component("ScanInput", ScanInput_default);
673
+ app.component("SegmentedDisplay", SegmentedDisplay_default);
674
+ app.component("SplitColumn", SplitColumn_default);
675
+ app.component("ToggleArrow", ToggleArrow_default);
676
+ }
677
+ //#endregion
678
+ export { ActionFooter_default as ActionFooter, BeamArrow_default as BeamArrow, BeamBtn_default as BeamBtn, BeamDayDivider_default as BeamDayDivider, BeamFilter_default as BeamFilter, BeamFilterOption_default as BeamFilterOption, BeamHeading_default as BeamHeading, BeamMetadata_default as BeamMetadata, BeamModal_default as BeamModal, BeamModalOutlet_default as BeamModalOutlet, BeamProgress_default as BeamProgress, Confirm_default as Confirm, FixedTop_default as FixedTop, ItemCheck_default as ItemCheck, ItemCount_default as ItemCount, ListAnchor_default as ListAnchor, ListItem_default as ListItem, ListView_default as ListView, Navbar_default as Navbar, ScanInput_default as ScanInput, SegmentedDisplay_default as SegmentedDisplay, SplitColumn_default as SplitColumn, ToggleArrow_default as ToggleArrow, install, useMqttStream };
679
+
680
+ //# sourceMappingURL=beam.js.map