@catalystsoftware/ui 1.0.5 → 1.0.7
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/data/data.tsx +29 -29
- package/dist/data/tailwind.config.js +3821 -261
- package/dist/data.tsx +29 -29
- package/package.json +4 -3
- package/components/catalyst-ui/buttons/burger.tsx +0 -207
- package/components/catalyst-ui/core/data-display/timeline.tsx +0 -210
- package/components/catalyst-ui/core/feedback/alert.tsx +0 -491
- package/components/catalyst-ui/core/feedback/spinner-1.tsx +0 -65
- package/components/catalyst-ui/core/feedback/toast.tsx +0 -1857
- package/components/catalyst-ui/core/navigation/menu.tsx +0 -164
- package/components/catalyst-ui/forms/toggle-class.tsx +0 -176
- package/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +0 -419
- package/components/catalyst-ui/hooks/use-counter.tsx +0 -13
- package/components/catalyst-ui/hooks/use-event-listener.tsx +0 -23
- package/components/catalyst-ui/hooks/use-export-markdown.tsx +0 -47
- package/components/catalyst-ui/hooks/use-focus.tsx +0 -17
- package/components/catalyst-ui/hooks/use-interval.tsx +0 -23
- package/components/catalyst-ui/hooks/use-is-client.tsx +0 -16
- package/components/catalyst-ui/hooks/use-media-query.tsx +0 -19
- package/components/catalyst-ui/hooks/use-mobile.tsx +0 -19
- package/components/catalyst-ui/hooks/use-resize-observer.tsx +0 -81
- package/components/catalyst-ui/hooks/use-timeout.tsx +0 -21
- package/components/catalyst-ui/hooks/use-timer.tsx +0 -209
- package/components/catalyst-ui/hooks/use-toggle.tsx +0 -12
- package/components/catalyst-ui/media/image.tsx +0 -13
- package/components/catalyst-ui/overlays/dual-sidebar.tsx +0 -4142
- package/components/catalyst-ui/overlays/sidebar-original.tsx +0 -726
- package/components/catalyst-ui/primitives/accordion.tsx +0 -250
- package/components/catalyst-ui/primitives/alert-dialog.tsx +0 -126
- package/components/catalyst-ui/primitives/aspect-ratio.tsx +0 -9
- package/components/catalyst-ui/primitives/avatar.tsx +0 -296
- package/components/catalyst-ui/primitives/badge.tsx +0 -57
- package/components/catalyst-ui/primitives/breadcrumb.tsx +0 -101
- package/components/catalyst-ui/primitives/button.tsx +0 -265
- package/components/catalyst-ui/primitives/calendar-v4.tsx +0 -208
- package/components/catalyst-ui/primitives/calendar.tsx +0 -295
- package/components/catalyst-ui/primitives/card.tsx +0 -618
- package/components/catalyst-ui/primitives/carousel.tsx +0 -238
- package/components/catalyst-ui/primitives/chart.tsx +0 -347
- package/components/catalyst-ui/primitives/checkbox.tsx +0 -225
- package/components/catalyst-ui/primitives/collapsible.tsx +0 -212
- package/components/catalyst-ui/primitives/command.tsx +0 -393
- package/components/catalyst-ui/primitives/context-menu.tsx +0 -236
- package/components/catalyst-ui/primitives/dialog.tsx +0 -471
- package/components/catalyst-ui/primitives/drawer.tsx +0 -761
- package/components/catalyst-ui/primitives/dropdown-menu.tsx +0 -290
- package/components/catalyst-ui/primitives/empty.tsx +0 -104
- package/components/catalyst-ui/primitives/field.tsx +0 -244
- package/components/catalyst-ui/primitives/hover-card.tsx +0 -124
- package/components/catalyst-ui/primitives/input-otp.tsx +0 -76
- package/components/catalyst-ui/primitives/input.tsx +0 -64
- package/components/catalyst-ui/primitives/item.tsx +0 -196
- package/components/catalyst-ui/primitives/kbd.tsx +0 -75
- package/components/catalyst-ui/primitives/label.tsx +0 -24
- package/components/catalyst-ui/primitives/navigation-menu.tsx +0 -150
- package/components/catalyst-ui/primitives/pagination.tsx +0 -198
- package/components/catalyst-ui/primitives/popover.tsx +0 -232
- package/components/catalyst-ui/primitives/progress.tsx +0 -34
- package/components/catalyst-ui/primitives/radio-group.tsx +0 -43
- package/components/catalyst-ui/primitives/resizable.tsx +0 -56
- package/components/catalyst-ui/primitives/select.tsx +0 -155
- package/components/catalyst-ui/primitives/separator.tsx +0 -74
- package/components/catalyst-ui/primitives/sheet.tsx +0 -126
- package/components/catalyst-ui/primitives/skeleton.tsx +0 -15
- package/components/catalyst-ui/primitives/slider.tsx +0 -27
- package/components/catalyst-ui/primitives/switch.tsx +0 -187
- package/components/catalyst-ui/primitives/tabs.tsx +0 -335
- package/components/catalyst-ui/primitives/textarea.tsx +0 -24
- package/components/catalyst-ui/primitives/toggle-group.tsx +0 -55
- package/components/catalyst-ui/primitives/toggle.tsx +0 -42
- package/components/catalyst-ui/primitives/tooltip.tsx +0 -116
- package/components/catalyst-ui/utils/basic-auth.tsx +0 -40
- package/components/catalyst-ui/utils/context-storage.tsx +0 -19
- package/components/catalyst-ui/utils/cors-middleware.tsx +0 -71
- package/components/catalyst-ui/utils/deferred-content.tsx +0 -595
- package/components/catalyst-ui/utils/honeypot-middleware.tsx +0 -38
- package/components/catalyst-ui/utils/incId.tsx +0 -75
- package/components/catalyst-ui/utils/jwk-auth.tsx +0 -36
- package/components/catalyst-ui/utils/request-id.tsx +0 -14
- package/components/catalyst-ui/utils/secure-headers.tsx +0 -37
- package/components/catalyst-ui/utils/server-timing.tsx +0 -23
- package/components/catalyst-ui/utils/utils.ts +0 -43
- package/components/catalyst-ui/utils/with-cookie.tsx +0 -43
- package/components/catalyst-ui/x/accordian-x.tsx +0 -428
- package/components/catalyst-ui/x/alert-x.tsx +0 -413
- package/components/catalyst-ui/x/animated-text-x.tsx +0 -2242
- package/components/catalyst-ui/x/avatar-x.tsx +0 -515
- package/components/catalyst-ui/x/badge-x.tsx +0 -670
- package/components/catalyst-ui/x/button-X.tsx +0 -2857
- package/components/catalyst-ui/x/button-group-x.tsx +0 -847
- package/components/catalyst-ui/x/calendar-x.tsx +0 -1910
- package/components/catalyst-ui/x/card-x.tsx +0 -2597
- package/components/catalyst-ui/x/checkbox-x.tsx +0 -656
- package/components/catalyst-ui/x/collapsible-x.tsx +0 -1360
- package/components/catalyst-ui/x/combobox-x.tsx +0 -911
- package/components/catalyst-ui/x/data-table-x.tsx +0 -1753
- package/components/catalyst-ui/x/date-picker-x.tsx +0 -648
- package/components/catalyst-ui/x/dialog-x.tsx +0 -659
- package/components/catalyst-ui/x/dropdown-menu-x.tsx +0 -612
- package/components/catalyst-ui/x/hover-card-x.tsx +0 -375
- package/components/catalyst-ui/x/icon-x.tsx +0 -840
- package/components/catalyst-ui/x/input-mask-x.tsx +0 -981
- package/components/catalyst-ui/x/input-otp-x.tsx +0 -659
- package/components/catalyst-ui/x/loader-x.tsx +0 -1757
- package/components/catalyst-ui/x/pagination-x.tsx +0 -622
- package/components/catalyst-ui/x/popover-x.tsx +0 -744
- package/components/catalyst-ui/x/radio-group-x.tsx +0 -499
- package/components/catalyst-ui/x/select-x.tsx +0 -1127
- package/components/catalyst-ui/x/sheet-x.tsx +0 -668
- package/components/catalyst-ui/x/switch-x.tsx +0 -681
- package/components/catalyst-ui/x/table-x.tsx +0 -574
- package/components/catalyst-ui/x/tabs-x.tsx +0 -839
- package/components/catalyst-ui/x/textarea-x.tsx +0 -1263
- package/components/catalyst-ui/x/tooltip-x.tsx +0 -396
- package/components/catalyst-ui/x/tracker-x.tsx +0 -560
- package/data/bg-data.tsx +0 -901
- package/data/buttons-data.tsx +0 -2327
- package/data/charts-data.tsx +0 -102
- package/data/chat-data.tsx +0 -83
- package/data/code-data.tsx +0 -1040
- package/data/comboboxes-data.tsx +0 -1843
- package/data/command-data.tsx +0 -1381
- package/data/core-data.tsx +0 -15953
- package/data/crm-data.tsx +0 -47
- package/data/data.tsx +0 -159
- package/data/date-and-time-data.tsx +0 -554
- package/data/dependencies.tsx +0 -7
- package/data/ecommerce-data.tsx +0 -1387
- package/data/forms-data.tsx +0 -7890
- package/data/hooks-data.tsx +0 -5487
- package/data/index.ts +0 -34
- package/data/inputs-data.tsx +0 -557
- package/data/interactive-data.tsx +0 -5394
- package/data/lofi-data.tsx +0 -18295
- package/data/marketing-data.tsx +0 -2546
- package/data/media-data.tsx +0 -1510
- package/data/motion-data.tsx +0 -5801
- package/data/overlay-data.tsx +0 -4136
- package/data/pdf-data.tsx +0 -124
- package/data/pos-data.tsx +0 -213
- package/data/postcss.config.js +0 -6
- package/data/primitive-data.tsx +0 -5170
- package/data/prompt-data.tsx +0 -1226
- package/data/requiredLibs.ts +0 -4
- package/data/sandbox-data.tsx +0 -1
- package/data/sidebars-data.tsx +0 -5421
- package/data/stacks-data.tsx +0 -32
- package/data/table-data.tsx +0 -706
- package/data/tailwind.config.js +0 -270
- package/data/tailwind.config.ngin.js +0 -3830
- package/data/tailwind.css +0 -431
- package/data/tools-data.tsx +0 -6910
- package/data/typography-data.tsx +0 -2050
- package/data/utils-data.tsx +0 -6500
- package/data/x-data.tsx +0 -1171
package/data/pdf-data.tsx
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
export const pdf = [
|
|
2
|
-
{
|
|
3
|
-
name: "PDF Action",
|
|
4
|
-
value: "pdf-action",
|
|
5
|
-
path: "/components/catalyst-ui/pdf/pdf.tsx",
|
|
6
|
-
premium: true,
|
|
7
|
-
source: null,
|
|
8
|
-
category: "PDF",
|
|
9
|
-
tags: ["pdf", "pdf generator"],
|
|
10
|
-
features: ["Responsive", "TypeScript", "Accessible"],
|
|
11
|
-
dependencies: [],
|
|
12
|
-
usage: null,
|
|
13
|
-
usagePath: "/components/catalyst-ui/pdf/pdf.tsx",
|
|
14
|
-
desc: "PDF action to generate pdfs",
|
|
15
|
-
customize: null
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
name: "generate custom pdf",
|
|
19
|
-
value: "generate_custom_pdf",
|
|
20
|
-
path: "/components/catalyst-ui/pdf/generate_custom_pdf.tsx",
|
|
21
|
-
premium: true,
|
|
22
|
-
source: null,
|
|
23
|
-
category: "PDF",
|
|
24
|
-
tags: ["pdf", "pdf generator"],
|
|
25
|
-
features: ["Responsive", "TypeScript", "Accessible"],
|
|
26
|
-
dependencies: [],
|
|
27
|
-
usage: null,
|
|
28
|
-
usagePath: "/components/catalyst-ui/pdf/generate_custom_pdf.tsx",
|
|
29
|
-
desc: "PDF action to generate pdfs",
|
|
30
|
-
customize: null
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "generate pdf",
|
|
34
|
-
value: "generate_pdf",
|
|
35
|
-
path: "/components/catalyst-ui/pdf/generate_pdf.tsx",
|
|
36
|
-
premium: true,
|
|
37
|
-
source: null,
|
|
38
|
-
category: "PDF",
|
|
39
|
-
tags: ["pdf", "pdf generator"],
|
|
40
|
-
features: ["Responsive", "TypeScript", "Accessible"],
|
|
41
|
-
dependencies: [],
|
|
42
|
-
usage: null,
|
|
43
|
-
usagePath: "/components/catalyst-ui/pdf/generate_pdf.tsx",
|
|
44
|
-
desc: "PDF action to generate pdfs",
|
|
45
|
-
customize: null
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: "pdf generator",
|
|
49
|
-
value: "pdf_generator",
|
|
50
|
-
path: "/components/catalyst-ui/pdf/pdf_generator.tsx",
|
|
51
|
-
premium: true,
|
|
52
|
-
source: null,
|
|
53
|
-
category: "PDF",
|
|
54
|
-
tags: ["pdf", "pdf generator"],
|
|
55
|
-
features: ["Responsive", "TypeScript", "Accessible"],
|
|
56
|
-
dependencies: [],
|
|
57
|
-
usage: null,
|
|
58
|
-
usagePath: "/components/catalyst-ui/pdf/pdf_generator.tsx",
|
|
59
|
-
desc: null,
|
|
60
|
-
customize: null
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: "pdf sender",
|
|
64
|
-
value: "pdf_sender.$dealerId.$documentId.$dept",
|
|
65
|
-
path: "/components/catalyst-ui/pdf/pdf_sender.$dealerId.$documentId.$dept.tsx",
|
|
66
|
-
premium: true,
|
|
67
|
-
source: null,
|
|
68
|
-
category: "PDF",
|
|
69
|
-
tags: ["pdf", "pdf generator"],
|
|
70
|
-
features: ["Responsive", "TypeScript", "Accessible"],
|
|
71
|
-
dependencies: [],
|
|
72
|
-
usage: null,
|
|
73
|
-
usagePath: "/components/catalyst-ui/pdf/pdf_sender.$dealerId.$documentId.$dept.tsx",
|
|
74
|
-
desc: null,
|
|
75
|
-
customize: null
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: "pdf signer",
|
|
79
|
-
value: "pdf_signer.$id",
|
|
80
|
-
path: "/components/catalyst-ui/pdf/pdf_signer.$id.tsx",
|
|
81
|
-
premium: true,
|
|
82
|
-
source: null,
|
|
83
|
-
category: "PDF",
|
|
84
|
-
tags: ["pdf", "pdf generator"],
|
|
85
|
-
features: ["Responsive", "TypeScript", "Accessible"],
|
|
86
|
-
dependencies: [],
|
|
87
|
-
usage: null,
|
|
88
|
-
usagePath: "/components/catalyst-ui/pdf/pdf_signer.$id.tsx",
|
|
89
|
-
desc: null,
|
|
90
|
-
customize: null
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
name: "print pdf",
|
|
94
|
-
value: "print_pdf",
|
|
95
|
-
path: "/components/catalyst-ui/pdf/print_pdf.tsx",
|
|
96
|
-
premium: true,
|
|
97
|
-
source: null,
|
|
98
|
-
category: "PDF",
|
|
99
|
-
tags: ["pdf", "pdf generator"],
|
|
100
|
-
features: ["Responsive", "TypeScript", "Accessible"],
|
|
101
|
-
dependencies: [],
|
|
102
|
-
usage: null,
|
|
103
|
-
usagePath: "/components/catalyst-ui/pdf/print_pdf.tsx",
|
|
104
|
-
desc: null,
|
|
105
|
-
customize: null
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: "template Builder",
|
|
109
|
-
value: "template-builder",
|
|
110
|
-
path: "/components/catalyst-ui/pdf/templateBuilder.tsx",
|
|
111
|
-
premium: true,
|
|
112
|
-
source: null,
|
|
113
|
-
category: "PDF",
|
|
114
|
-
tags: ["pdf", "pdf generator"],
|
|
115
|
-
features: ["Responsive", "TypeScript", "Accessible"],
|
|
116
|
-
dependencies: [],
|
|
117
|
-
usage: null,
|
|
118
|
-
usagePath: "/components/catalyst-ui/pdf/templateBuilder.tsx",
|
|
119
|
-
desc: null,
|
|
120
|
-
customize: null
|
|
121
|
-
},
|
|
122
|
-
];
|
|
123
|
-
export const pdfarray = pdf;
|
|
124
|
-
export { pdf as combinedPdf };
|
package/data/pos-data.tsx
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
export const posPages = [];
|
|
2
|
-
export const posTools = [
|
|
3
|
-
{
|
|
4
|
-
name: "Barcode Scanner",
|
|
5
|
-
value: "barcode-scanner",
|
|
6
|
-
importPath: "~/components/catalyst-ui/pos/tools/barcodeScanner",
|
|
7
|
-
multiImport: "playScanSound, BarcodeScanner",
|
|
8
|
-
path: "/components/catalyst-ui/pos/tools/barcodeScanner.tsx",
|
|
9
|
-
premium: true,
|
|
10
|
-
source: `
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export function playScanSound() {
|
|
15
|
-
const audio = new Audio(ScanSound);
|
|
16
|
-
audio.play();
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function BarcodeScanner({setScannedCode}) {
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
const codeReader = new BrowserMultiFormatReader();
|
|
22
|
-
console.log("ZXing code reader initialized");
|
|
23
|
-
|
|
24
|
-
const hints = new Map();
|
|
25
|
-
const formats = [BarcodeFormat.PDF_417, BarcodeFormat.QR_CODE, BarcodeFormat.ITF, BarcodeFormat.CODE_128, BarcodeFormat.EAN_13];
|
|
26
|
-
hints.set(DecodeHintType.POSSIBLE_FORMATS, formats);
|
|
27
|
-
|
|
28
|
-
codeReader
|
|
29
|
-
.getVideoInputDevices()
|
|
30
|
-
.then((videoInputDevices) => {
|
|
31
|
-
const sourceSelect = document.getElementById("sourceSelect");
|
|
32
|
-
let selectedDeviceId = videoInputDevices[0].deviceId;
|
|
33
|
-
if (videoInputDevices.length > 1) {
|
|
34
|
-
videoInputDevices.forEach((element) => {
|
|
35
|
-
const sourceOption = document.createElement("option");
|
|
36
|
-
sourceOption.text = element.label;
|
|
37
|
-
sourceOption.value = element.deviceId;
|
|
38
|
-
sourceSelect.appendChild(sourceOption);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
sourceSelect.onchange = () => {
|
|
42
|
-
selectedDeviceId = sourceSelect.value;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const sourceSelectPanel = document.getElementById("sourceSelectPanel");
|
|
46
|
-
sourceSelectPanel.style.display = "block";
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const listener = (event) => {
|
|
50
|
-
if (event.key === "F1") {
|
|
51
|
-
event.preventDefault();
|
|
52
|
-
codeReader
|
|
53
|
-
.decodeOnceFromVideoDevice(selectedDeviceId, "video", hints)
|
|
54
|
-
.then((result) => {
|
|
55
|
-
console.log(result);
|
|
56
|
-
playScanSound()
|
|
57
|
-
/// document.getElementById('result').textContent = result.text;
|
|
58
|
-
setScannedCode(result.text);
|
|
59
|
-
})
|
|
60
|
-
.catch((err) => {
|
|
61
|
-
console.error(err);
|
|
62
|
-
// document.getElementById('result').textContent = err;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
if (event.key === "F2") {
|
|
66
|
-
event.preventDefault();
|
|
67
|
-
codeReader.reset();
|
|
68
|
-
setScannedCode("");
|
|
69
|
-
console.log("Reset.");
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
window.addEventListener("keydown", listener);
|
|
74
|
-
return () => window.removeEventListener("keydown", listener);
|
|
75
|
-
})
|
|
76
|
-
.catch((err) => {
|
|
77
|
-
console.error(err);
|
|
78
|
-
});
|
|
79
|
-
}, []);
|
|
80
|
-
return (
|
|
81
|
-
<div className="relative flex-1 md:grow-0 mx-auto ">
|
|
82
|
-
<main className="wrapper text-foreground ">
|
|
83
|
-
<section className="container" id="demo-content">
|
|
84
|
-
<div className="flex flex-col items-center mx-auto">
|
|
85
|
-
<div
|
|
86
|
-
className="rounded-[5px] border border-border relative group"
|
|
87
|
-
style={{
|
|
88
|
-
padding: 0,
|
|
89
|
-
width: "150px",
|
|
90
|
-
maxHeight: "100px",
|
|
91
|
-
overflow: "hidden",
|
|
92
|
-
border: " ",
|
|
93
|
-
}}
|
|
94
|
-
>
|
|
95
|
-
<video id="video" style={{ width: "150px" }}></video>
|
|
96
|
-
|
|
97
|
-
<div id="sourceSelectPanel" style={{ display: "none" }}>
|
|
98
|
-
<select id="sourceSelect" className="b-rounded-[5px] px-3 py-1 bg-background text-foreground border-border border opacity-0 transition-opacity group-hover:opacity-100 " style={{ maxWidth: "150px" }}></select>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
<div style={{ display: "none" }}>
|
|
102
|
-
<div
|
|
103
|
-
style={{
|
|
104
|
-
padding: 0,
|
|
105
|
-
width: "100px",
|
|
106
|
-
maxHeight: "100px",
|
|
107
|
-
overflow: "hidden",
|
|
108
|
-
border: "1px solid gray",
|
|
109
|
-
}}
|
|
110
|
-
>
|
|
111
|
-
<video id="video" style={{ width: "100px" }}></video>
|
|
112
|
-
</div>
|
|
113
|
-
<input className="text-background bg-background border-background" type="file" id="imageUploadButton" accept="image/*" style={{ display: "inline-block" }} />
|
|
114
|
-
<label className="text-background" htmlFor="sourceSelect">
|
|
115
|
-
Change video source:
|
|
116
|
-
</label>
|
|
117
|
-
<label className="text-background">Result:</label>
|
|
118
|
-
<pre>
|
|
119
|
-
<code className="text-background" id="result"></code>
|
|
120
|
-
</pre>
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
</section>
|
|
124
|
-
</main>
|
|
125
|
-
</div>
|
|
126
|
-
)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
*
|
|
131
|
-
* press F1 to start the camera
|
|
132
|
-
* press F2 to reset the camera
|
|
133
|
-
* In file place the following along with calling <BarcodeScanner setScannedCode={setScannedCode} />
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
const [scannedCode, setScannedCode] = useState("");
|
|
137
|
-
useEffect(() => {
|
|
138
|
-
if (scannedCode) {
|
|
139
|
-
// This is where you do whatever you need to do when a barcode is scanned. For example, adding it to a useState list where you keep track of a clients products as you scan them, or setting off a forms action to save it in the database, or when replacing an enterprise scanner, have it redirect to the products page to edit the product inventory count or to order count.
|
|
140
|
-
const product = products.find((p) => p.dealerId === scannedCode || p.partNumber === scannedCode || p.sku === scannedCode || p.upc === scannedCode || p.mpn === scannedCode);
|
|
141
|
-
addToBill(product);
|
|
142
|
-
}
|
|
143
|
-
}, [scannedCode]);
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
// if you need it to do something else when scanned
|
|
148
|
-
const listener = (event) => {
|
|
149
|
-
if (event.key === "F1") {
|
|
150
|
-
event.preventDefault();
|
|
151
|
-
codeReader
|
|
152
|
-
.decodeOnceFromVideoDevice(selectedDeviceId, "video", hints)
|
|
153
|
-
.then((result) => {
|
|
154
|
-
// -------- THIS IS WHERE YOU CAN REPLACE THE SECTIONS CODE TO WHATEVER YOU LIKE WITHIN THE USEEFFECT ---------
|
|
155
|
-
console.log(result);
|
|
156
|
-
setScannedCode(result.text);
|
|
157
|
-
})
|
|
158
|
-
.catch((err) => {
|
|
159
|
-
console.error(err);
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
if (event.key === "F2") {
|
|
163
|
-
event.preventDefault();
|
|
164
|
-
codeReader.reset();
|
|
165
|
-
setScannedCode("");
|
|
166
|
-
console.log("Reset.");
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
*/`,
|
|
171
|
-
category: "POS",
|
|
172
|
-
tags: ["ui", "components", "interactive"],
|
|
173
|
-
features: ["Responsive", "TypeScript", "Accessible"],
|
|
174
|
-
dependencies: ["@zxing"],
|
|
175
|
-
basicusage: `
|
|
176
|
-
<BarcodeScanner />
|
|
177
|
-
|
|
178
|
-
<BarcodeScanner setScannedCode="" />`,
|
|
179
|
-
usage: null,
|
|
180
|
-
usagePath: null,
|
|
181
|
-
props: {
|
|
182
|
-
"BarcodeScanner": [
|
|
183
|
-
{ name: "setScannedCode", type: "string", default: null }
|
|
184
|
-
],
|
|
185
|
-
},
|
|
186
|
-
desc: null,
|
|
187
|
-
status: null,
|
|
188
|
-
lastUpdated: null
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
name: "Cash Drawer Wizard",
|
|
192
|
-
value: "cash-drawer-wizard",
|
|
193
|
-
importPath: "~/components/catalyst-ui/pos/tools/cashDrawerWizard",
|
|
194
|
-
multiImport: "CashDrawerService, validateAppPath, validateCommandArgs, validateExecution, useCashDrawer",
|
|
195
|
-
path: "/components/catalyst-ui/pos/tools/cashDrawerWizard.tsx",
|
|
196
|
-
premium: true,
|
|
197
|
-
category: "POS",
|
|
198
|
-
tags: ["ui", "components", "interactive"],
|
|
199
|
-
features: ["Responsive", "TypeScript", "Accessible"],
|
|
200
|
-
dependencies: ["@remix-run", "react", "lucide-react", "serialport", "net", "dgram", "node-hid", "path"],
|
|
201
|
-
basicusage: null,
|
|
202
|
-
usage: null,
|
|
203
|
-
usagePath: null,
|
|
204
|
-
props: {},
|
|
205
|
-
desc: null,
|
|
206
|
-
status: null,
|
|
207
|
-
lastUpdated: null
|
|
208
|
-
}
|
|
209
|
-
];
|
|
210
|
-
export const combinedPos = [
|
|
211
|
-
...posTools,
|
|
212
|
-
...posPages,
|
|
213
|
-
];
|