cortex-react-ui 0.1.157 → 0.1.159
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/lib/cjs/index.js +2 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types/Scanner/Dialog.d.ts +13 -0
- package/lib/cjs/types/Scanner/DialogBody.d.ts +3 -0
- package/lib/cjs/types/Scanner/DialogMask.d.ts +3 -0
- package/lib/cjs/types/Scanner/ScanConfirmationDialog.d.ts +18 -0
- package/lib/cjs/types/Scanner/Scanner.d.ts +6 -4
- package/lib/index.d.ts +18 -4
- package/lib/styles/Scanner/index.scss +106 -0
- package/lib/styles/index.scss +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const Dialog: (props: DialogProps) => JSX.Element;
|
|
3
|
+
export declare type DialogTitleProps = {
|
|
4
|
+
title?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type DialogProps = DialogTitleProps & {
|
|
7
|
+
open: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
confirmation?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const ScanConfirmationDialog: (props: TScanConfirmDialogProps) => JSX.Element;
|
|
2
|
+
export declare type TScanConfirmDialogLabels = {
|
|
3
|
+
title?: string;
|
|
4
|
+
message?: string;
|
|
5
|
+
btnOk?: {
|
|
6
|
+
label: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
};
|
|
9
|
+
btnCancel?: {
|
|
10
|
+
label: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare type TScanConfirmDialogProps = {
|
|
15
|
+
open: boolean;
|
|
16
|
+
onConfirm: () => void;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
} & TScanConfirmDialogLabels;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { IDetectedBarcode } from '@yudiel/react-qr-scanner';
|
|
2
|
-
|
|
1
|
+
import { IDetectedBarcode, IScannerProps } from '@yudiel/react-qr-scanner';
|
|
2
|
+
import { TScanConfirmDialogLabels } from './ScanConfirmationDialog';
|
|
3
|
+
declare const Scanner: ({ scanConfirmation, ...props }: ScannerProps) => JSX.Element;
|
|
4
|
+
declare type ScannerProps = {
|
|
3
5
|
scanConfirmation?: boolean;
|
|
6
|
+
scanConfirmDialog?: TScanConfirmDialogLabels;
|
|
4
7
|
onScan?: (detectedCodes: IDetectedBarcode[]) => void;
|
|
5
|
-
}
|
|
6
|
-
declare const Scanner: React.FC<ScannerProps>;
|
|
8
|
+
} & IScannerProps;
|
|
7
9
|
export default Scanner;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React$1, { CSSProperties } from 'react';
|
|
2
|
-
import { IDetectedBarcode } from '@yudiel/react-qr-scanner';
|
|
2
|
+
import { IDetectedBarcode, IScannerProps } from '@yudiel/react-qr-scanner';
|
|
3
3
|
|
|
4
4
|
declare const PopperPlacement: {
|
|
5
5
|
readonly Center: "center";
|
|
@@ -59,11 +59,25 @@ interface BarLoaderProps {
|
|
|
59
59
|
}
|
|
60
60
|
declare const BarLoader: React$1.FC<BarLoaderProps>;
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
declare type TScanConfirmDialogLabels = {
|
|
63
|
+
title?: string;
|
|
64
|
+
message?: string;
|
|
65
|
+
btnOk?: {
|
|
66
|
+
label: string;
|
|
67
|
+
style?: React.CSSProperties;
|
|
68
|
+
};
|
|
69
|
+
btnCancel?: {
|
|
70
|
+
label: string;
|
|
71
|
+
style?: React.CSSProperties;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
declare const Scanner: ({ scanConfirmation, ...props }: ScannerProps) => JSX.Element;
|
|
76
|
+
declare type ScannerProps = {
|
|
63
77
|
scanConfirmation?: boolean;
|
|
78
|
+
scanConfirmDialog?: TScanConfirmDialogLabels;
|
|
64
79
|
onScan?: (detectedCodes: IDetectedBarcode[]) => void;
|
|
65
|
-
}
|
|
66
|
-
declare const Scanner: React.FC<ScannerProps>;
|
|
80
|
+
} & IScannerProps;
|
|
67
81
|
|
|
68
82
|
interface SelectedProps {
|
|
69
83
|
title?: string;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
@import "../global.scss";
|
|
2
|
+
|
|
3
|
+
@mixin scanner($props: null, $options: null) {
|
|
4
|
+
$internal-options: $default-options;
|
|
5
|
+
|
|
6
|
+
$internal-props: (
|
|
7
|
+
bgColor: #ffffff,
|
|
8
|
+
fgColor: $color-grey-darker,
|
|
9
|
+
closeBtnColor: $color-grey,
|
|
10
|
+
closeBtnHoverColor: $color-blue,
|
|
11
|
+
closeBtnDisableColor: $color-blue-grey-lighter,
|
|
12
|
+
confirm: (
|
|
13
|
+
headerBgColor: $color-orange-dark,
|
|
14
|
+
headerFgColor: #ffffff,
|
|
15
|
+
bgColor: #ffffff,
|
|
16
|
+
fgColor: $color-grey-darker,
|
|
17
|
+
),
|
|
18
|
+
error: (
|
|
19
|
+
headerBgColor: $color-red,
|
|
20
|
+
headerFgColor: #ffffff,
|
|
21
|
+
bgColor: #ffffff,
|
|
22
|
+
fgColor: $color-grey-darker,
|
|
23
|
+
),
|
|
24
|
+
warning: (
|
|
25
|
+
headerBgColor: $color-grey,
|
|
26
|
+
headerFgColor: #ffffff,
|
|
27
|
+
bgColor: #ffffff,
|
|
28
|
+
fgColor: $color-grey-darker,
|
|
29
|
+
),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
$internal-props: safe-map-merge($internal-props, $props);
|
|
33
|
+
$internal-options: safe-map-merge($internal-options, $options);
|
|
34
|
+
|
|
35
|
+
.btn {
|
|
36
|
+
display: 'flex';
|
|
37
|
+
align-items: 'center';
|
|
38
|
+
justify-content: 'center';
|
|
39
|
+
padding: '0.5rem 1rem';
|
|
40
|
+
border: '1px solid transparent';
|
|
41
|
+
border-radius: '0.375rem';
|
|
42
|
+
box-shadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05)';
|
|
43
|
+
font-size: '0.875rem';
|
|
44
|
+
font-weight: '500';
|
|
45
|
+
line-height: '1.25rem';
|
|
46
|
+
text-align: 'center';
|
|
47
|
+
text-transform: 'none';
|
|
48
|
+
white-space: 'nowrap';
|
|
49
|
+
vertical-align: 'middle';
|
|
50
|
+
user-select: 'none';
|
|
51
|
+
background-color: '#4F46E5';
|
|
52
|
+
color: '#fff';
|
|
53
|
+
cursor: 'pointer';
|
|
54
|
+
outline: 'none';
|
|
55
|
+
transition: 'background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.btn-default {
|
|
59
|
+
background-color: '#4F46E5';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.btn-default:hover {
|
|
63
|
+
opacity: '0.8';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.select {
|
|
67
|
+
display: 'block';
|
|
68
|
+
width: '100%';
|
|
69
|
+
padding-left: '0.75rem';
|
|
70
|
+
color: '#000';
|
|
71
|
+
padding-right: '2.5rem';
|
|
72
|
+
padding-top: '0.5rem';
|
|
73
|
+
padding-bottom: '0.5rem';
|
|
74
|
+
font-size: '1rem';
|
|
75
|
+
border-radius: '0.375rem';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* DIALOG */
|
|
79
|
+
.dialog-header {
|
|
80
|
+
display: 'flex';
|
|
81
|
+
justify-content: 'space-between';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.dialog-mask {
|
|
85
|
+
overflow-x: 'hidden';
|
|
86
|
+
overflow-y: 'auto';
|
|
87
|
+
display: 'flex';
|
|
88
|
+
justify-content: 'center';
|
|
89
|
+
padding-top: '2.5rem';
|
|
90
|
+
padding-bottom: '5rem';
|
|
91
|
+
background-color: #0005;
|
|
92
|
+
position: fixed;
|
|
93
|
+
inset: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.dialog-body {
|
|
97
|
+
display: 'flex';
|
|
98
|
+
flex-direction: 'column';
|
|
99
|
+
gap: '1.25rem';
|
|
100
|
+
padding: '1.25rem';
|
|
101
|
+
height: 'max-content';
|
|
102
|
+
background-color: white;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* DIALOG */
|
|
106
|
+
}
|
package/lib/styles/index.scss
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
@import "TextField";
|
|
9
9
|
@import "Menu";
|
|
10
10
|
@import "Dialog";
|
|
11
|
+
@import "Scanner";
|
|
11
12
|
@import "Button";
|
|
12
13
|
@import "ToggleButton";
|
|
13
14
|
@import "Selected";
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
@include taginput();
|
|
22
23
|
@include input();
|
|
23
24
|
@include menu();
|
|
25
|
+
@include scanner();
|
|
24
26
|
@include dialog();
|
|
25
27
|
@include button();
|
|
26
28
|
@include toggleButton();
|