armtek-uikit-react 1.0.95 → 1.0.96
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"armtek-uikit-react","version":"1.0.
|
|
1
|
+
{"name":"armtek-uikit-react","version":"1.0.96","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
|
package/ui/Button/Button.js
CHANGED
|
@@ -27,6 +27,7 @@ const Button = props => {
|
|
|
27
27
|
let Component = as || 'button';
|
|
28
28
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
29
29
|
children: /*#__PURE__*/_jsxs(Component, {
|
|
30
|
+
type: 'button',
|
|
30
31
|
...restProps,
|
|
31
32
|
className: clsx('Arm-button', css.button, css['button_' + size], css['button_' + variant], css['button_' + color], className, {
|
|
32
33
|
[css['button_grouped_' + group]]: group,
|
|
@@ -4,7 +4,7 @@ export type DateFieldProps = {
|
|
|
4
4
|
format?: string;
|
|
5
5
|
onInput?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
6
6
|
onChange?: (value: Date | null) => void;
|
|
7
|
-
value?: Date | null;
|
|
7
|
+
value?: Date | string | null;
|
|
8
8
|
showTime?: boolean;
|
|
9
9
|
showTimeOnly?: boolean;
|
|
10
10
|
} & Omit<TextFieldProps, 'onChange' | 'value'>;
|
|
@@ -12,7 +12,7 @@ export declare const DateField: import("react").ForwardRefExoticComponent<{
|
|
|
12
12
|
format?: string | undefined;
|
|
13
13
|
onInput?: ((e: ChangeEvent<HTMLInputElement>) => void) | undefined;
|
|
14
14
|
onChange?: ((value: Date | null) => void) | undefined;
|
|
15
|
-
value?: Date | null | undefined;
|
|
15
|
+
value?: string | Date | null | undefined;
|
|
16
16
|
showTime?: boolean | undefined;
|
|
17
17
|
showTimeOnly?: boolean | undefined;
|
|
18
18
|
} & Omit<TextFieldProps, "value" | "onChange"> & import("react").RefAttributes<unknown>>;
|
|
@@ -25,8 +25,8 @@ export const DateField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25
25
|
let [open, setOpen] = useState(false);
|
|
26
26
|
if (showTime && !showTimeOnly) format = 'dd.MM.yyyy HH:mm';else if (showTimeOnly) format = 'HH:mm';
|
|
27
27
|
const handleChange = d => {
|
|
28
|
-
console.log(d);
|
|
29
28
|
setDate(d);
|
|
29
|
+
setOpen(false);
|
|
30
30
|
if (onChange) onChange(d);
|
|
31
31
|
};
|
|
32
32
|
const handleClick = e => {
|
|
@@ -36,10 +36,12 @@ export const DateField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
36
36
|
let realValue = value !== undefined ? value : date;
|
|
37
37
|
const btnRef = useRef();
|
|
38
38
|
const inputIcon = showTime && showTimeOnly ? 'schedule' : 'calendar_today';
|
|
39
|
+
let dateValue = typeof realValue === 'string' ? new Date(realValue) : realValue;
|
|
39
40
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
40
41
|
children: [/*#__PURE__*/_jsx(TextField, {
|
|
41
42
|
ref: ref,
|
|
42
43
|
...restProps,
|
|
44
|
+
value: (dateValue == null ? void 0 : dateValue.toLocaleDateString('ru-RU')) || '',
|
|
43
45
|
endAdornment: /*#__PURE__*/_jsx(ButtonIcon, {
|
|
44
46
|
size: 'medium',
|
|
45
47
|
variant: 'transparent',
|
|
@@ -64,7 +66,7 @@ export const DateField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
64
66
|
},
|
|
65
67
|
children: /*#__PURE__*/_jsx(DatePicker, {
|
|
66
68
|
onChange: handleChange,
|
|
67
|
-
selected:
|
|
69
|
+
selected: dateValue,
|
|
68
70
|
showTimeSelect: !!showTime,
|
|
69
71
|
timeIntervals: 15,
|
|
70
72
|
showTimeSelectOnly: !!showTimeOnly && !!showTime,
|