@mailstep/design-system 0.7.36-beta.0 → 0.7.36
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 +1 -1
- package/ui/Blocks/CommonGrid/components/ControlButtons/styles.d.ts +1 -1
- package/ui/Elements/Button/Button.d.ts +2 -2
- package/ui/Elements/Button/Button.js +3 -3
- package/ui/Elements/Button/stories/Button.stories.d.ts +1 -1
- package/ui/Elements/Button/styles.d.ts +1 -0
- package/ui/Elements/Button/styles.js +5 -2
- package/ui/Elements/Button/types.d.ts +1 -0
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.d.ts +5 -1
- package/ui/Elements/DatePicker/Datetime/components/Timepicker.js +34 -43
- package/ui/Forms/Input/Input.js +3 -3
- package/ui/Forms/Input/types.d.ts +1 -1
- package/ui/index.es.js +8491 -8516
- package/ui/index.umd.js +472 -506
package/package.json
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
export declare const ControlButtonsContainer: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
3
3
|
export declare const Left: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
4
4
|
export declare const Right: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
5
|
-
export declare const StyledColumnButton: import("styled-components").StyledComponent<({ isLoading, loadingText, icon, iconLeft, iconRight, variant, appearance, disabled, fullWidth, buttonRef, onClick, ...props }: import("../../../../Elements/Button/types").Props) => JSX.Element, import("@xstyled/system").Theme, {}, never>;
|
|
5
|
+
export declare const StyledColumnButton: import("styled-components").StyledComponent<({ isLoading, loadingText, icon, iconLeft, iconRight, variant, appearance, disabled, fullWidth, height, buttonRef, onClick, ...props }: import("../../../../Elements/Button/types").Props) => JSX.Element, import("@xstyled/system").Theme, {}, never>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Props } from './types';
|
|
2
|
-
declare const Button: ({ isLoading, loadingText, icon, iconLeft, iconRight, variant, appearance, disabled, fullWidth, buttonRef, onClick, ...props }: Props) => JSX.Element;
|
|
1
|
+
import type { Props } from './types';
|
|
2
|
+
declare const Button: ({ isLoading, loadingText, icon, iconLeft, iconRight, variant, appearance, disabled, fullWidth, height, buttonRef, onClick, ...props }: Props) => JSX.Element;
|
|
3
3
|
export default Button;
|
|
@@ -21,10 +21,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { StyledButton, LoadingIconWrapper, StyledIcon, StyledWrapper } from './styles';
|
|
25
24
|
import { Spinner } from '../Spinner';
|
|
25
|
+
import { StyledButton, LoadingIconWrapper, StyledIcon, StyledWrapper } from './styles';
|
|
26
26
|
var Button = function (_a) {
|
|
27
|
-
var isLoading = _a.isLoading, loadingText = _a.loadingText, icon = _a.icon, iconLeft = _a.iconLeft, iconRight = _a.iconRight, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'primary' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.fullWidth, fullWidth = _e === void 0 ? false : _e, buttonRef = _a.buttonRef, onClick = _a.onClick, props = __rest(_a, ["isLoading", "loadingText", "icon", "iconLeft", "iconRight", "variant", "appearance", "disabled", "fullWidth", "buttonRef", "onClick"]);
|
|
28
|
-
return (_jsx(StyledButton, __assign({}, props, { onClick: !disabled && !isLoading ? onClick : undefined, "data-variant": variant, "data-appearance": appearance, disabled: disabled, iconPadding: !!icon && !props.children, ref: buttonRef, fullWidth: fullWidth, children: _jsxs(StyledWrapper, { children: [iconLeft && (typeof iconLeft === 'string' ? _jsx(StyledIcon, { "$addMarginRight": !!iconLeft, icon: iconLeft }) : iconLeft), isLoading ? (_jsxs(_Fragment, { children: [_jsx(LoadingIconWrapper, { "$addMarginRight": !!loadingText || !!props.children, children: _jsx(Spinner, { variant: "sm" }) }), loadingText || loadingText === '' ? loadingText : 'Loading'] })) : props.children ? (props.children) : (icon && (typeof icon === 'string' ? _jsx(StyledIcon, { icon: icon }) : icon)), iconRight && (typeof iconRight === 'string' ? _jsx(StyledIcon, { "$addMarginLeft": !!iconRight, icon: iconRight }) : iconRight)] }) })));
|
|
27
|
+
var isLoading = _a.isLoading, loadingText = _a.loadingText, icon = _a.icon, iconLeft = _a.iconLeft, iconRight = _a.iconRight, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'primary' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.fullWidth, fullWidth = _e === void 0 ? false : _e, height = _a.height, buttonRef = _a.buttonRef, onClick = _a.onClick, props = __rest(_a, ["isLoading", "loadingText", "icon", "iconLeft", "iconRight", "variant", "appearance", "disabled", "fullWidth", "height", "buttonRef", "onClick"]);
|
|
28
|
+
return (_jsx(StyledButton, __assign({}, props, { onClick: !disabled && !isLoading ? onClick : undefined, "data-variant": variant, "data-appearance": appearance, disabled: disabled, iconPadding: !!icon && !props.children, ref: buttonRef, fullWidth: fullWidth, height: height, children: _jsxs(StyledWrapper, { children: [iconLeft && (typeof iconLeft === 'string' ? _jsx(StyledIcon, { "$addMarginRight": !!iconLeft, icon: iconLeft }) : iconLeft), isLoading ? (_jsxs(_Fragment, { children: [_jsx(LoadingIconWrapper, { "$addMarginRight": !!loadingText || !!props.children, children: _jsx(Spinner, { variant: "sm" }) }), loadingText || loadingText === '' ? loadingText : 'Loading'] })) : props.children ? (props.children) : (icon && (typeof icon === 'string' ? _jsx(StyledIcon, { icon: icon }) : icon)), iconRight && (typeof iconRight === 'string' ? _jsx(StyledIcon, { "$addMarginLeft": !!iconRight, icon: iconRight }) : iconRight)] }) })));
|
|
29
29
|
};
|
|
30
30
|
export default Button;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { StoryObj } from '@storybook/react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ isLoading, loadingText, icon, iconLeft, iconRight, variant, appearance, disabled, fullWidth, buttonRef, onClick, ...props }: import("../types").Props) => JSX.Element;
|
|
5
|
+
component: ({ isLoading, loadingText, icon, iconLeft, iconRight, variant, appearance, disabled, fullWidth, height, buttonRef, onClick, ...props }: import("../types").Props) => JSX.Element;
|
|
6
6
|
tags: string[];
|
|
7
7
|
argTypes: {};
|
|
8
8
|
parameters: {
|
|
@@ -13,4 +13,5 @@ export declare const StyledButton: import("styled-components").StyledComponent<"
|
|
|
13
13
|
onClick?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
14
14
|
iconPadding?: boolean | undefined;
|
|
15
15
|
fullWidth?: boolean | undefined;
|
|
16
|
+
height?: string | undefined;
|
|
16
17
|
}, never>;
|
|
@@ -2,8 +2,8 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
2
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
|
-
import styled, { th } from '@xstyled/styled-components';
|
|
6
5
|
import { Icon } from '../Icon';
|
|
6
|
+
import styled, { th } from '@xstyled/styled-components';
|
|
7
7
|
export var StyledWrapper = styled.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n"])));
|
|
8
8
|
export var LoadingIconWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n & svg {\n margin-right: ", ";\n }\n"], ["\n & svg {\n margin-right: ", ";\n }\n"])), function (_a) {
|
|
9
9
|
var $addMarginRight = _a.$addMarginRight;
|
|
@@ -16,10 +16,13 @@ export var StyledIcon = styled(Icon)(templateObject_3 || (templateObject_3 = __m
|
|
|
16
16
|
var $addMarginLeft = _a.$addMarginLeft;
|
|
17
17
|
return ($addMarginLeft ? '8px' : '0');
|
|
18
18
|
});
|
|
19
|
-
export var StyledButton = styled.button(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: ", ";\n font-weight: semiBold;\n font-size: 14px;\n font-family: ", ";\n display: flex;\n text-align: center;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n height:
|
|
19
|
+
export var StyledButton = styled.button(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: ", ";\n font-weight: semiBold;\n font-size: 14px;\n font-family: ", ";\n display: flex;\n text-align: center;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n height: ", ";\n border: none;\n transition-duration: 0.1s;\n transition: all 300ms ease-out;\n gap: 8px;\n padding: ", ";\n opacity: ", ";\n cursor: ", ";\n\n :focus {\n outline: none;\n }\n\n &[data-variant='default'] {\n &[data-appearance='primary'] {\n background-color: red1;\n color: white;\n\n :not(:disabled) {\n @media (hover: hover) {\n :hover {\n background-color: red80;\n }\n }\n }\n }\n\n &[data-appearance='secondary'] {\n background-color: neutral20;\n color: typoPrimary;\n\n @media (hover: hover) {\n :hover {\n background-color: lightGray7;\n }\n }\n }\n\n &[data-appearance='tertiary'] {\n background-color: red20;\n color: red1;\n\n @media (hover: hover) {\n :hover {\n background-color: red30;\n }\n }\n }\n }\n\n &[data-variant='success'] {\n background-color: successColor;\n color: white;\n\n @media (hover: hover) {\n :hover {\n background-color: green70;\n }\n }\n }\n &[data-variant='outline'] {\n background-color: white;\n border: slim;\n &[data-appearance='primary'] {\n color: typoPrimary;\n border-color: typoPrimary;\n\n @media (hover: hover) {\n :hover {\n background-color: neutral20;\n }\n }\n }\n &[data-appearance='secondary'] {\n color: red1;\n border-color: red1;\n\n @media (hover: hover) {\n :hover {\n background-color: red20;\n }\n }\n }\n }\n &[data-variant='ghost'] {\n background-color: white;\n &[data-appearance='primary'] {\n color: typoPrimary;\n\n @media (hover: hover) {\n :hover {\n background-color: neutral20;\n }\n }\n }\n &[data-appearance='secondary'] {\n color: red1;\n\n @media (hover: hover) {\n :hover {\n background-color: red20;\n }\n }\n }\n }\n\n &[data-variant='link'] {\n background-color: transparent;\n height: 20px;\n &[data-appearance='primary'] {\n color: typoPrimary;\n\n @media (hover: hover) {\n :hover {\n color: neutral500;\n }\n }\n }\n &[data-appearance='secondary'] {\n color: red1;\n\n @media (hover: hover) {\n :hover {\n color: red70;\n }\n }\n }\n }\n\n &[data-variant='icon'] {\n width: 38px;\n height: 38px;\n gap: 10px;\n\n &[data-appearance='primary'] {\n background-color: red1;\n color: white;\n\n @media (hover: hover) {\n :hover {\n background-color: red70;\n }\n }\n }\n\n &[data-appearance='secondary'] {\n background-color: neutral20;\n color: typoPrimary;\n\n @media (hover: hover) {\n :hover {\n background-color: lightGray7;\n }\n }\n }\n\n &[data-appearance='tertiary'] {\n background-color: red20;\n color: red1;\n\n @media (hover: hover) {\n :hover {\n background-color: red30;\n }\n }\n }\n\n &[data-appearance='ghost'] {\n background-color: transparent;\n color: typoPrimary;\n\n @media (hover: hover) {\n :hover {\n color: neutral500;\n }\n }\n }\n }\n\n &[data-variant='floating'] {\n &[data-appearance='primary'] {\n width: 56px;\n height: 56px;\n background-color: red1;\n color: white;\n border-radius: 50%;\n\n @media (hover: hover) {\n :hover {\n background-color: red70;\n }\n }\n }\n }\n"], ["\n width: ", ";\n font-weight: semiBold;\n font-size: 14px;\n font-family: ", ";\n display: flex;\n text-align: center;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n height: ", ";\n border: none;\n transition-duration: 0.1s;\n transition: all 300ms ease-out;\n gap: 8px;\n padding: ", ";\n opacity: ", ";\n cursor: ", ";\n\n :focus {\n outline: none;\n }\n\n &[data-variant='default'] {\n &[data-appearance='primary'] {\n background-color: red1;\n color: white;\n\n :not(:disabled) {\n @media (hover: hover) {\n :hover {\n background-color: red80;\n }\n }\n }\n }\n\n &[data-appearance='secondary'] {\n background-color: neutral20;\n color: typoPrimary;\n\n @media (hover: hover) {\n :hover {\n background-color: lightGray7;\n }\n }\n }\n\n &[data-appearance='tertiary'] {\n background-color: red20;\n color: red1;\n\n @media (hover: hover) {\n :hover {\n background-color: red30;\n }\n }\n }\n }\n\n &[data-variant='success'] {\n background-color: successColor;\n color: white;\n\n @media (hover: hover) {\n :hover {\n background-color: green70;\n }\n }\n }\n &[data-variant='outline'] {\n background-color: white;\n border: slim;\n &[data-appearance='primary'] {\n color: typoPrimary;\n border-color: typoPrimary;\n\n @media (hover: hover) {\n :hover {\n background-color: neutral20;\n }\n }\n }\n &[data-appearance='secondary'] {\n color: red1;\n border-color: red1;\n\n @media (hover: hover) {\n :hover {\n background-color: red20;\n }\n }\n }\n }\n &[data-variant='ghost'] {\n background-color: white;\n &[data-appearance='primary'] {\n color: typoPrimary;\n\n @media (hover: hover) {\n :hover {\n background-color: neutral20;\n }\n }\n }\n &[data-appearance='secondary'] {\n color: red1;\n\n @media (hover: hover) {\n :hover {\n background-color: red20;\n }\n }\n }\n }\n\n &[data-variant='link'] {\n background-color: transparent;\n height: 20px;\n &[data-appearance='primary'] {\n color: typoPrimary;\n\n @media (hover: hover) {\n :hover {\n color: neutral500;\n }\n }\n }\n &[data-appearance='secondary'] {\n color: red1;\n\n @media (hover: hover) {\n :hover {\n color: red70;\n }\n }\n }\n }\n\n &[data-variant='icon'] {\n width: 38px;\n height: 38px;\n gap: 10px;\n\n &[data-appearance='primary'] {\n background-color: red1;\n color: white;\n\n @media (hover: hover) {\n :hover {\n background-color: red70;\n }\n }\n }\n\n &[data-appearance='secondary'] {\n background-color: neutral20;\n color: typoPrimary;\n\n @media (hover: hover) {\n :hover {\n background-color: lightGray7;\n }\n }\n }\n\n &[data-appearance='tertiary'] {\n background-color: red20;\n color: red1;\n\n @media (hover: hover) {\n :hover {\n background-color: red30;\n }\n }\n }\n\n &[data-appearance='ghost'] {\n background-color: transparent;\n color: typoPrimary;\n\n @media (hover: hover) {\n :hover {\n color: neutral500;\n }\n }\n }\n }\n\n &[data-variant='floating'] {\n &[data-appearance='primary'] {\n width: 56px;\n height: 56px;\n background-color: red1;\n color: white;\n border-radius: 50%;\n\n @media (hover: hover) {\n :hover {\n background-color: red70;\n }\n }\n }\n }\n"])), function (_a) {
|
|
20
20
|
var fullWidth = _a.fullWidth;
|
|
21
21
|
return (fullWidth ? '100%' : 'initial');
|
|
22
22
|
}, th('fonts.primary'), function (_a) {
|
|
23
|
+
var height = _a.height;
|
|
24
|
+
return height || '38px';
|
|
25
|
+
}, function (_a) {
|
|
23
26
|
var iconPadding = _a.iconPadding;
|
|
24
27
|
return (iconPadding ? '9px' : '7px 18px');
|
|
25
28
|
}, function (_a) {
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { DateTimeOthers } from '../types';
|
|
2
3
|
interface TimepickerProps {
|
|
3
4
|
setTime: (type: string, value: number) => void;
|
|
4
5
|
value: Date | null;
|
|
5
6
|
disabled?: boolean;
|
|
7
|
+
others: DateTimeOthers;
|
|
8
|
+
onChangeOthers: (others: DateTimeOthers) => void;
|
|
9
|
+
isSecondDatePicker?: boolean;
|
|
6
10
|
}
|
|
7
11
|
export declare const Timepicker: FC<TimepickerProps>;
|
|
8
12
|
export {};
|
|
@@ -1,57 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
4
11
|
};
|
|
5
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
13
|
import { useCallback, useEffect, useState } from 'react';
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
import Icon from '../../../Icon';
|
|
15
|
+
import { TimePickerRepeatTrans } from '../../utils/constants';
|
|
16
|
+
import { TimePickerRepeat } from '../types';
|
|
17
|
+
import { i18n } from '@lingui/core';
|
|
18
|
+
import { x } from '@xstyled/styled-components';
|
|
19
|
+
import { FooterRow } from './FooterRow';
|
|
20
|
+
import { FooterRowLabel } from './FooterRowLabel';
|
|
21
|
+
import { TimeInput } from './TimeInput';
|
|
13
22
|
export var Timepicker = function (_a) {
|
|
14
23
|
var _b, _c, _d, _e;
|
|
15
|
-
var setTime = _a.setTime, value = _a.value, disabled = _a.disabled;
|
|
16
|
-
var initialHours = (
|
|
17
|
-
var initialMinutes = (
|
|
18
|
-
var regExp = '^[0-9]*$';
|
|
24
|
+
var setTime = _a.setTime, others = _a.others, onChangeOthers = _a.onChangeOthers, value = _a.value, disabled = _a.disabled, isSecondDatePicker = _a.isSecondDatePicker;
|
|
25
|
+
var initialHours = ((_b = value === null || value === void 0 ? void 0 : value.getHours) === null || _b === void 0 ? void 0 : _b.call(value)) || ((_c = others === null || others === void 0 ? void 0 : others.time) === null || _c === void 0 ? void 0 : _c.h) || 0;
|
|
26
|
+
var initialMinutes = ((_d = value === null || value === void 0 ? void 0 : value.getMinutes) === null || _d === void 0 ? void 0 : _d.call(value)) || ((_e = others === null || others === void 0 ? void 0 : others.time) === null || _e === void 0 ? void 0 : _e.m) || 0;
|
|
19
27
|
var _f = useState(initialHours), hours = _f[0], setHours = _f[1];
|
|
20
28
|
var _g = useState(initialMinutes), minutes = _g[0], setMinutes = _g[1];
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
minutes >= 55 ? setMinutes(minutes - 55) : setMinutes(minutes + 5);
|
|
29
|
-
}, [minutes]);
|
|
30
|
-
var decreaseMinutes = useCallback(function () {
|
|
31
|
-
minutes <= 5 ? setMinutes(minutes + 55) : setMinutes(minutes - 5);
|
|
32
|
-
}, [minutes]);
|
|
33
|
-
var onHoursChange = useCallback(function (e) {
|
|
34
|
-
if (e.target.value.match(regExp) && Number(e.target.value) <= 23) {
|
|
35
|
-
setHours(Number(e.target.value));
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
setHours(0);
|
|
39
|
-
}
|
|
40
|
-
}, []);
|
|
41
|
-
var onMinutesChange = useCallback(function (e) {
|
|
42
|
-
if (e.target.value.match(regExp) && Number(e.target.value) <= 59) {
|
|
43
|
-
setMinutes(Number(e.target.value));
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
setMinutes(0);
|
|
47
|
-
}
|
|
48
|
-
}, []);
|
|
29
|
+
var onChange = useCallback(function (e) {
|
|
30
|
+
var value = e.target.value;
|
|
31
|
+
var _a = value.split(':'), hours = _a[0], minutes = _a[1];
|
|
32
|
+
setHours(Number(hours));
|
|
33
|
+
setMinutes(Number(minutes));
|
|
34
|
+
onChangeOthers === null || onChangeOthers === void 0 ? void 0 : onChangeOthers(__assign(__assign({}, others), { time: { h: Number(hours), m: Number(minutes) } }));
|
|
35
|
+
}, [onChangeOthers, others]);
|
|
49
36
|
useEffect(function () {
|
|
50
37
|
!!value && setTime('hours', hours);
|
|
51
38
|
}, [hours]);
|
|
52
39
|
useEffect(function () {
|
|
53
40
|
!!value && setTime('minutes', minutes);
|
|
54
41
|
}, [minutes]);
|
|
55
|
-
|
|
42
|
+
useEffect(function () {
|
|
43
|
+
!!value && setHours(initialHours);
|
|
44
|
+
!!value && setMinutes(initialMinutes);
|
|
45
|
+
}, [!!value, initialHours, initialMinutes]);
|
|
46
|
+
var timeValue = "".concat(hours.toString().padStart(2, '0'), ":").concat(minutes.toString().padStart(2, '0'));
|
|
47
|
+
return (_jsx(x.div, { borderTop: "1px solid", borderColor: "lightGray2", pt: "8px", mb: "8px", children: _jsxs(FooterRow, { disabled: disabled, children: [_jsxs(x.div, { children: [_jsx(Icon, { icon: "clock" }), _jsx(FooterRowLabel, { children: i18n._({ id: 'dataGrid.filterCell.time', message: 'Time' }) })] }), _jsxs(x.div, { display: "flex", alignItems: "center", children: [_jsxs("b", { children: [isSecondDatePicker ? TimePickerRepeatTrans[TimePickerRepeat.TO] : TimePickerRepeatTrans[TimePickerRepeat.FROM], ":", ' '] }), _jsx(TimeInput, { type: "time", onChange: onChange, disabled: disabled, value: timeValue })] })] }) }));
|
|
56
48
|
};
|
|
57
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
package/ui/Forms/Input/Input.js
CHANGED
|
@@ -22,12 +22,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
import { useCallback, useEffect, useRef } from 'react';
|
|
25
|
-
import { ClearableInputIcon, IconsController, IconWrapper, InputIcon, InputRow, InputWrap, StyledInput, Suffix, Tooltip, } from './styles';
|
|
26
|
-
import { FieldLabel } from '../../Elements/Label';
|
|
27
|
-
import { SpaceAroundWrap } from '../../Elements/SpaceAround';
|
|
28
25
|
import { ErrorMessage } from '../../Elements/ErrorMessage';
|
|
29
26
|
import { Icon } from '../../Elements/Icon';
|
|
27
|
+
import { FieldLabel } from '../../Elements/Label';
|
|
28
|
+
import { SpaceAroundWrap } from '../../Elements/SpaceAround';
|
|
30
29
|
import { Spinner } from '../../Elements/Spinner';
|
|
30
|
+
import { ClearableInputIcon, IconsController, IconWrapper, InputIcon, InputRow, InputWrap, StyledInput, Suffix, Tooltip } from './styles';
|
|
31
31
|
var allowedInputTypes = ['text', 'number', 'password'];
|
|
32
32
|
export var Input = function (_a) {
|
|
33
33
|
var _b = _a.appearance, appearance = _b === void 0 ? 'primary' : _b, type = _a.type, name = _a.name, label = _a.label, value = _a.value, icon = _a.icon, _c = _a.variant, variant = _c === void 0 ? 'default' : _c, disabled = _a.disabled, error = _a.error, _d = _a.isInvalid, isInvalid = _d === void 0 ? undefined : _d, _e = _a.spaceAround, spaceAround = _e === void 0 ? false : _e, inputRef = _a.inputRef, autoComplete = _a.autoComplete, isLoading = _a.isLoading, className = _a.className, suffix = _a.suffix, suffixOnClick = _a.suffixOnClick, errorAppearance = _a.errorAppearance, _f = _a.iconPlacement, iconPlacement = _f === void 0 ? 'left' : _f, iconOnClick = _a.iconOnClick, iconTooltip = _a.iconTooltip, big = _a.big, _g = _a.showArrowsController, showArrowsController = _g === void 0 ? false : _g, onClear = _a.onClear, alwaysShowClear = _a.alwaysShowClear, setNumber = _a.setNumber, onEnter = _a.onEnter, _h = _a.forceFocus, forceFocus = _h === void 0 ? false : _h, _j = _a.autoFocus, autoFocus = _j === void 0 ? false : _j, onBlur = _a.onBlur, _k = _a.asTextArea, asTextArea = _k === void 0 ? false : _k, rest = __rest(_a, ["appearance", "type", "name", "label", "value", "icon", "variant", "disabled", "error", "isInvalid", "spaceAround", "inputRef", "autoComplete", "isLoading", "className", "suffix", "suffixOnClick", "errorAppearance", "iconPlacement", "iconOnClick", "iconTooltip", "big", "showArrowsController", "onClear", "alwaysShowClear", "setNumber", "onEnter", "forceFocus", "autoFocus", "onBlur", "asTextArea"]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeEvent, Dispatch, FocusEvent, InputHTMLAttributes, MouseEvent, ReactElement, ReactNode, RefObject, SetStateAction } from 'react';
|
|
1
|
+
import type { ChangeEvent, Dispatch, FocusEvent, InputHTMLAttributes, MouseEvent, ReactElement, ReactNode, RefObject, SetStateAction } from 'react';
|
|
2
2
|
export type SpaceAround = boolean | SpaceAroundProps;
|
|
3
3
|
export type SpaceAroundProps = {
|
|
4
4
|
marginTop?: number;
|