@olenbetong/synergi-react 4.1.1 → 4.1.3
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/es/components/ImageEditor/plugins/cropPlugin/useCropTool.js +3 -1
- package/es/components/ImageEditor/useEdgeDetection.d.ts +17 -2
- package/es/components/ImageEditor/useEdgeDetection.js +241 -61
- package/es/components/Toolbar/index.js +20 -1
- package/package.json +3 -3
- package/src/chrome/AppShell/index.tsx +29 -29
- package/src/chrome/openReport.ts +34 -34
- package/src/colorScheme.ts +81 -81
- package/src/components/DateNavigator/index.tsx +186 -186
- package/src/components/FilePond.tsx +312 -312
- package/src/components/ImageEditor/ImageEditor.tsx +343 -343
- package/src/components/ImageEditor/index.ts +9 -9
- package/src/components/ImageEditor/plugins/cropPlugin/CropOverlay.tsx +165 -165
- package/src/components/ImageEditor/plugins/cropPlugin/CropToolbar.tsx +48 -48
- package/src/components/ImageEditor/plugins/cropPlugin/useCropTool.ts +405 -403
- package/src/components/ImageEditor/plugins/redactPlugin/RedactToolbar.tsx +47 -47
- package/src/components/ImageEditor/plugins/zoomPlugin/ZoomContext.tsx +23 -23
- package/src/components/ImageEditor/plugins/zoomPlugin/ZoomControls.tsx +40 -40
- package/src/components/ImageEditor/useEdgeDetection.ts +319 -127
- package/src/components/ImageEditor/useImageHistory.ts +197 -197
- package/src/components/ImageEditor/useOpenCV.ts +184 -184
- package/src/components/LinkedCardList/index.scss +95 -95
- package/src/components/MergeProgressDialog/index.tsx +249 -249
- package/src/components/PageBanner/index.tsx +80 -80
- package/src/components/PdfViewer/PdfViewer.tsx +158 -158
- package/src/components/ProgressBar/index.scss +96 -96
- package/src/components/SplitContainer/index.tsx +333 -333
- package/src/components/Toolbar/index.tsx +232 -212
- package/src/designsystemet-web-types.d.ts +24 -24
- package/src/elements/ElementDamage/DamageFormButtons.tsx +35 -35
- package/src/elements/ElementDamage/DescriptionInput.tsx +120 -120
- package/src/elements/ElementDamage/DuplicateDamage/DesktopView.tsx +82 -82
- package/src/elements/ElementDamage/DuplicateDamage/DublicateElementDamageDialog.tsx +67 -67
- package/src/elements/ElementDamage/DuplicateDamage/PhoneView.tsx +45 -45
- package/src/elements/ElementDamage/ElementNumberTextField.tsx +41 -41
- package/src/elements/ElementDamage/RegisterFix.tsx +100 -100
- package/src/elements/ElementDamage/SubmitButtons.tsx +40 -40
- package/src/elements/ElementDamage/TransportElementSelect.tsx +52 -52
- package/src/elements/ElementLookup.tsx +123 -123
- package/src/elements/ElementLookupDialog/BarcodeScanner/decoder.ts +32 -32
- package/src/elements/ElementLookupDialog/BarcodeScanner/decoders/dbr.ts +118 -118
- package/src/elements/ElementLookupDialog/BarcodeScanner/decoders/native.ts +103 -103
- package/src/elements/ElementLookupDialog/BarcodeScanner/decoders/zxing.ts +95 -95
- package/src/elements/ElementLookupDialog/BarcodeScanner/decoders.test.ts +118 -118
- package/src/elements/ElementLookupDialog/BarcodeScanner/duplicateFilter.ts +21 -21
- package/src/elements/ElementLookupDialog/BarcodeScanner/index.tsx +90 -90
- package/src/elements/ElementLookupDialog/BarcodeScanner/useScanner.ts +280 -280
- package/src/elements/ElementLookupDialog/HIDScanner/index.tsx +67 -67
- package/src/elements/ElementLookupDialog/Manual/ManualForm.tsx +141 -141
- package/src/elements/ElementLookupDialog/index.tsx +226 -226
- package/src/elements/ElementLookupDialog/utils/Giai.ts +209 -209
- package/src/elements/ProjectSelect.tsx +130 -130
- package/src/elements/index.ts +15 -15
- package/src/filter/index.ts +34 -34
- package/src/i18n.ts +13 -13
- package/src/index.ts +77 -77
- package/src/mui/MuiThemeProvider.tsx +174 -174
- package/src/mui/index.ts +1 -1
- package/src/test/setup.ts +8 -8
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import SwitchCameraOutlined from "@mui/icons-material/SwitchCameraOutlined";
|
|
2
|
-
import { Box, IconButton, type SxProps, Typography } from "@mui/material";
|
|
3
|
-
import { type ReactNode, useRef } from "react";
|
|
4
|
-
import type { DecoderFactory } from "./decoder";
|
|
5
|
-
import { ErrorIcon } from "./Error";
|
|
6
|
-
import { useScanner } from "./useScanner";
|
|
7
|
-
import { getLocalizedString } from "../../../i18n.js";
|
|
8
|
-
|
|
9
|
-
export type { BarcodeDecoder, DecodedBarcode, DecodedPoint, DecoderFactory } from "./decoder";
|
|
10
|
-
export { createDbrDecoder, type DbrDecoderOptions } from "./decoders/dbr";
|
|
11
|
-
export { createNativeDecoder, isNativeDecoderAvailable } from "./decoders/native";
|
|
12
|
-
export { createZxingDecoder, type ZxingDecoderOptions } from "./decoders/zxing";
|
|
13
|
-
|
|
14
|
-
export type BarcodeScannerProps = {
|
|
15
|
-
onRead: (barcode: string) => void;
|
|
16
|
-
/**
|
|
17
|
-
* Engine used to decode the camera frames. Defaults to zxing-wasm. Pass a stable reference and
|
|
18
|
-
* change it only to switch engine — the decoder is recreated whenever it changes.
|
|
19
|
-
*/
|
|
20
|
-
decoder?: DecoderFactory;
|
|
21
|
-
/** Extra controls rendered in the scanner footer, next to the engine name — e.g. an engine picker. */
|
|
22
|
-
actions?: ReactNode;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const frameSx: SxProps = {
|
|
26
|
-
position: "absolute",
|
|
27
|
-
bottom: 0,
|
|
28
|
-
left: 0,
|
|
29
|
-
right: 0,
|
|
30
|
-
top: 0,
|
|
31
|
-
height: "100%",
|
|
32
|
-
width: "100%",
|
|
33
|
-
objectFit: "contain",
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export function BarcodeScanner({ onRead, decoder, actions }: BarcodeScannerProps) {
|
|
37
|
-
let video = useRef<HTMLVideoElement | null>(null);
|
|
38
|
-
let canvas = useRef<HTMLCanvasElement | null>(null);
|
|
39
|
-
let { devices, engine, error, setNextDevice } = useScanner(video, canvas, onRead, decoder);
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<Box
|
|
43
|
-
sx={{
|
|
44
|
-
position: "relative",
|
|
45
|
-
bgcolor: "black",
|
|
46
|
-
height: "100%",
|
|
47
|
-
}}
|
|
48
|
-
>
|
|
49
|
-
<Box sx={{ height: "100%" }}>
|
|
50
|
-
<Box component="video" playsInline muted autoPlay sx={frameSx} ref={video} />
|
|
51
|
-
<Box component="canvas" sx={frameSx} ref={canvas} />
|
|
52
|
-
{error && <ErrorIcon {...error} />}
|
|
53
|
-
</Box>
|
|
54
|
-
<Box
|
|
55
|
-
sx={{
|
|
56
|
-
display: "flex",
|
|
57
|
-
alignItems: "center",
|
|
58
|
-
justifyContent: "space-between",
|
|
59
|
-
position: "absolute",
|
|
60
|
-
bottom: 0,
|
|
61
|
-
left: 0,
|
|
62
|
-
right: 0,
|
|
63
|
-
py: 1,
|
|
64
|
-
px: 3,
|
|
65
|
-
color: "white",
|
|
66
|
-
}}
|
|
67
|
-
>
|
|
68
|
-
{devices.length <= 1 && <span />}
|
|
69
|
-
{devices.length > 1 && (
|
|
70
|
-
<IconButton
|
|
71
|
-
color="inherit"
|
|
72
|
-
aria-label={getLocalizedString("Switch camera")}
|
|
73
|
-
onClick={() => setNextDevice()}
|
|
74
|
-
size="large"
|
|
75
|
-
>
|
|
76
|
-
<SwitchCameraOutlined />
|
|
77
|
-
</IconButton>
|
|
78
|
-
)}
|
|
79
|
-
<Box sx={{ display: "flex", alignItems: "center", gap: 1 }}>
|
|
80
|
-
{engine && (
|
|
81
|
-
<Typography variant="caption" sx={{ opacity: 0.7 }} data-testid="barcode-engine">
|
|
82
|
-
{engine}
|
|
83
|
-
</Typography>
|
|
84
|
-
)}
|
|
85
|
-
{actions}
|
|
86
|
-
</Box>
|
|
87
|
-
</Box>
|
|
88
|
-
</Box>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
1
|
+
import SwitchCameraOutlined from "@mui/icons-material/SwitchCameraOutlined";
|
|
2
|
+
import { Box, IconButton, type SxProps, Typography } from "@mui/material";
|
|
3
|
+
import { type ReactNode, useRef } from "react";
|
|
4
|
+
import type { DecoderFactory } from "./decoder";
|
|
5
|
+
import { ErrorIcon } from "./Error";
|
|
6
|
+
import { useScanner } from "./useScanner";
|
|
7
|
+
import { getLocalizedString } from "../../../i18n.js";
|
|
8
|
+
|
|
9
|
+
export type { BarcodeDecoder, DecodedBarcode, DecodedPoint, DecoderFactory } from "./decoder";
|
|
10
|
+
export { createDbrDecoder, type DbrDecoderOptions } from "./decoders/dbr";
|
|
11
|
+
export { createNativeDecoder, isNativeDecoderAvailable } from "./decoders/native";
|
|
12
|
+
export { createZxingDecoder, type ZxingDecoderOptions } from "./decoders/zxing";
|
|
13
|
+
|
|
14
|
+
export type BarcodeScannerProps = {
|
|
15
|
+
onRead: (barcode: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Engine used to decode the camera frames. Defaults to zxing-wasm. Pass a stable reference and
|
|
18
|
+
* change it only to switch engine — the decoder is recreated whenever it changes.
|
|
19
|
+
*/
|
|
20
|
+
decoder?: DecoderFactory;
|
|
21
|
+
/** Extra controls rendered in the scanner footer, next to the engine name — e.g. an engine picker. */
|
|
22
|
+
actions?: ReactNode;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const frameSx: SxProps = {
|
|
26
|
+
position: "absolute",
|
|
27
|
+
bottom: 0,
|
|
28
|
+
left: 0,
|
|
29
|
+
right: 0,
|
|
30
|
+
top: 0,
|
|
31
|
+
height: "100%",
|
|
32
|
+
width: "100%",
|
|
33
|
+
objectFit: "contain",
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export function BarcodeScanner({ onRead, decoder, actions }: BarcodeScannerProps) {
|
|
37
|
+
let video = useRef<HTMLVideoElement | null>(null);
|
|
38
|
+
let canvas = useRef<HTMLCanvasElement | null>(null);
|
|
39
|
+
let { devices, engine, error, setNextDevice } = useScanner(video, canvas, onRead, decoder);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Box
|
|
43
|
+
sx={{
|
|
44
|
+
position: "relative",
|
|
45
|
+
bgcolor: "black",
|
|
46
|
+
height: "100%",
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<Box sx={{ height: "100%" }}>
|
|
50
|
+
<Box component="video" playsInline muted autoPlay sx={frameSx} ref={video} />
|
|
51
|
+
<Box component="canvas" sx={frameSx} ref={canvas} />
|
|
52
|
+
{error && <ErrorIcon {...error} />}
|
|
53
|
+
</Box>
|
|
54
|
+
<Box
|
|
55
|
+
sx={{
|
|
56
|
+
display: "flex",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
justifyContent: "space-between",
|
|
59
|
+
position: "absolute",
|
|
60
|
+
bottom: 0,
|
|
61
|
+
left: 0,
|
|
62
|
+
right: 0,
|
|
63
|
+
py: 1,
|
|
64
|
+
px: 3,
|
|
65
|
+
color: "white",
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
{devices.length <= 1 && <span />}
|
|
69
|
+
{devices.length > 1 && (
|
|
70
|
+
<IconButton
|
|
71
|
+
color="inherit"
|
|
72
|
+
aria-label={getLocalizedString("Switch camera")}
|
|
73
|
+
onClick={() => setNextDevice()}
|
|
74
|
+
size="large"
|
|
75
|
+
>
|
|
76
|
+
<SwitchCameraOutlined />
|
|
77
|
+
</IconButton>
|
|
78
|
+
)}
|
|
79
|
+
<Box sx={{ display: "flex", alignItems: "center", gap: 1 }}>
|
|
80
|
+
{engine && (
|
|
81
|
+
<Typography variant="caption" sx={{ opacity: 0.7 }} data-testid="barcode-engine">
|
|
82
|
+
{engine}
|
|
83
|
+
</Typography>
|
|
84
|
+
)}
|
|
85
|
+
{actions}
|
|
86
|
+
</Box>
|
|
87
|
+
</Box>
|
|
88
|
+
</Box>
|
|
89
|
+
);
|
|
90
|
+
}
|