@mw-kit/mw-ui 1.6.6 → 1.6.9
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/components/Input/components/DateIntervalPicker/index.d.ts +3 -1
- package/dist/components/Input/components/Input/interfaces.d.ts +5 -1
- package/dist/components/Input/components/Input/styles.d.ts +2 -1
- package/dist/components/Input/components/Phone/index.d.ts +4 -2
- package/dist/components/Input/components/Select/hooks/interfaces.d.ts +2 -0
- package/dist/components/Input/index.d.ts +4 -1
- package/dist/index.js +98 -64
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +99 -65
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DateIntervalPickerProps } from './interfaces';
|
|
3
|
-
declare const DatePicker: React.ForwardRefExoticComponent<DateIntervalPickerProps & React.RefAttributes<HTMLInputElement
|
|
3
|
+
declare const DatePicker: React.ForwardRefExoticComponent<DateIntervalPickerProps & React.RefAttributes<HTMLInputElement>> & {
|
|
4
|
+
useDefaultDateIntervalState: () => [string, string];
|
|
5
|
+
};
|
|
4
6
|
export default DatePicker;
|
|
@@ -26,9 +26,9 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
|
|
|
26
26
|
arrows?: boolean;
|
|
27
27
|
borderless?: boolean;
|
|
28
28
|
paddingless?: boolean;
|
|
29
|
+
inputWidth?: string;
|
|
29
30
|
}
|
|
30
31
|
export interface StyledLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
31
|
-
required: 1 | 0;
|
|
32
32
|
invalid: 1 | 0;
|
|
33
33
|
disabled: 1 | 0;
|
|
34
34
|
paddingless: 1 | 0;
|
|
@@ -43,4 +43,8 @@ export interface StyledInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
43
43
|
arrows: 1 | 0;
|
|
44
44
|
borderless: 1 | 0;
|
|
45
45
|
paddingless: 1 | 0;
|
|
46
|
+
width?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface StyledLabelTextProps {
|
|
49
|
+
required: 1 | 0;
|
|
46
50
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { StyledInputProps, StyledLabelProps } from './interfaces';
|
|
1
|
+
import { StyledInputProps, StyledLabelProps, StyledLabelTextProps } from './interfaces';
|
|
2
2
|
export declare const IconContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
3
3
|
export declare const Input: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, StyledInputProps, never>;
|
|
4
4
|
export declare const Label: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, StyledLabelProps, never>;
|
|
5
|
+
export declare const LabelText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledLabelTextProps, never>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Details, PhoneProps } from './interfaces';
|
|
3
|
-
export declare const
|
|
4
|
-
declare const Phone: React.ForwardRefExoticComponent<PhoneProps & React.RefAttributes<HTMLInputElement
|
|
3
|
+
export declare const getPhoneDetails: (phone: string) => Details | null;
|
|
4
|
+
declare const Phone: React.ForwardRefExoticComponent<PhoneProps & React.RefAttributes<HTMLInputElement>> & {
|
|
5
|
+
getPhoneDetails: (phone: string) => Details | null;
|
|
6
|
+
};
|
|
5
7
|
export default Phone;
|
|
@@ -9,6 +9,8 @@ export interface CommonOption {
|
|
|
9
9
|
element: ElementOrString;
|
|
10
10
|
};
|
|
11
11
|
value: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
disabledText?: string;
|
|
12
14
|
}
|
|
13
15
|
export interface CommonProps extends Omit<InputProps, 'type' | 'mask' | 'icon' | 'setValue' | 'name' | 'value' | 'onChange'> {
|
|
14
16
|
onScrollEnd?: () => Promise<void>;
|
|
@@ -12,5 +12,8 @@ import { RangeProps } from './components/Range/interfaces';
|
|
|
12
12
|
import { RadioButtonProps } from './components/RadioButton/interfaces';
|
|
13
13
|
import { DateIntervalPickerProps } from './components/DateIntervalPicker/interfaces';
|
|
14
14
|
export declare type Props = DateProps | TimeProps | CheckboxProps | SelectProps | PasswordProps | PhoneProps | DatePickerProps | RangeProps | DefaultInputProps | SwitchProps | RadioButtonProps | DateIntervalPickerProps;
|
|
15
|
-
declare const Input: React.ForwardRefExoticComponent<(TimeProps & React.RefAttributes<HTMLInputElement>) | (DefaultInputProps & React.RefAttributes<HTMLInputElement>) | (DateProps & React.RefAttributes<HTMLInputElement>) | (CheckboxProps & React.RefAttributes<HTMLInputElement>) | (import("./components/Select/hooks/Select/interfaces").SelectProps & React.RefAttributes<HTMLInputElement>) | (import("./components/Select/hooks/SelectMultiple/interfaces").SelectProps & React.RefAttributes<HTMLInputElement>) | (PasswordProps & React.RefAttributes<HTMLInputElement>) | (PhoneProps & React.RefAttributes<HTMLInputElement>) | (DatePickerProps & React.RefAttributes<HTMLInputElement>) | (RangeProps & React.RefAttributes<HTMLInputElement>) | (SwitchProps & React.RefAttributes<HTMLInputElement>) | (RadioButtonProps & React.RefAttributes<HTMLInputElement>) | (DateIntervalPickerProps & React.RefAttributes<HTMLInputElement>)
|
|
15
|
+
declare const Input: React.ForwardRefExoticComponent<(TimeProps & React.RefAttributes<HTMLInputElement>) | (DefaultInputProps & React.RefAttributes<HTMLInputElement>) | (DateProps & React.RefAttributes<HTMLInputElement>) | (CheckboxProps & React.RefAttributes<HTMLInputElement>) | (import("./components/Select/hooks/Select/interfaces").SelectProps & React.RefAttributes<HTMLInputElement>) | (import("./components/Select/hooks/SelectMultiple/interfaces").SelectProps & React.RefAttributes<HTMLInputElement>) | (PasswordProps & React.RefAttributes<HTMLInputElement>) | (PhoneProps & React.RefAttributes<HTMLInputElement>) | (DatePickerProps & React.RefAttributes<HTMLInputElement>) | (RangeProps & React.RefAttributes<HTMLInputElement>) | (SwitchProps & React.RefAttributes<HTMLInputElement>) | (RadioButtonProps & React.RefAttributes<HTMLInputElement>) | (DateIntervalPickerProps & React.RefAttributes<HTMLInputElement>)> & {
|
|
16
|
+
useDefaultDateIntervalState: () => [string, string];
|
|
17
|
+
getPhoneDetails: (phone: string) => import("./components/Phone/interfaces").Details | null;
|
|
18
|
+
};
|
|
16
19
|
export default Input;
|
package/dist/index.js
CHANGED
|
@@ -182,14 +182,15 @@ var dateToIsoString = function dateToIsoString(date, time, fullYear, pattern) {
|
|
|
182
182
|
|
|
183
183
|
var dateData = [date.getDate().toString().padStart(2, '0'), (date.getMonth() + 1).toString().padStart(2, '0'), date.getFullYear().toString().padStart(4, '0')];
|
|
184
184
|
if (fullYear === false) dateData[2] = dateData[2].substring(2, 4);
|
|
185
|
+
var dateStr = dateData.join('/');
|
|
185
186
|
|
|
186
187
|
if (pattern === 'us') {
|
|
187
188
|
var tmp = dateData[0];
|
|
188
189
|
dateData[0] = dateData[2];
|
|
189
190
|
dateData[2] = tmp;
|
|
191
|
+
dateStr = dateData.join('-');
|
|
190
192
|
}
|
|
191
193
|
|
|
192
|
-
var dateStr = dateData.join('/');
|
|
193
194
|
if (!time) return dateStr;
|
|
194
195
|
var timeStr = [date.getHours().toString().padStart(2, '0'), date.getMinutes().toString().padStart(2, '0'), date.getSeconds().toString().padStart(2, '0')].join(':');
|
|
195
196
|
return [dateStr, timeStr].join(' ');
|
|
@@ -12599,14 +12600,14 @@ var getMask = function getMask(mask) {
|
|
|
12599
12600
|
};
|
|
12600
12601
|
};
|
|
12601
12602
|
|
|
12602
|
-
var _templateObject$c, _templateObject2$a, _templateObject3$a, _templateObject4$9, _templateObject5$8, _templateObject6$6, _templateObject7$4, _templateObject8$3, _templateObject9$3, _templateObject10$2, _templateObject11$1, _templateObject12$1, _templateObject13$1;
|
|
12603
|
+
var _templateObject$c, _templateObject2$a, _templateObject3$a, _templateObject4$9, _templateObject5$8, _templateObject6$6, _templateObject7$4, _templateObject8$3, _templateObject9$3, _templateObject10$2, _templateObject11$1, _templateObject12$1, _templateObject13$1, _templateObject14$1;
|
|
12603
12604
|
var IconContainer = styled__default.button(_templateObject$c || (_templateObject$c = _taggedTemplateLiteralLoose(["\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 17px;\n\n background-color: transparent;\n border: none;\n box-shadow: none;\n padding: 0;\n\n ", "\n"])), function (_ref) {
|
|
12604
12605
|
var onClick = _ref.onClick,
|
|
12605
12606
|
disabled = _ref.disabled;
|
|
12606
12607
|
if (!onClick || disabled) return;
|
|
12607
12608
|
return styled.css(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n "])));
|
|
12608
12609
|
});
|
|
12609
|
-
var Input = styled__default.input(_templateObject3$a || (_templateObject3$a = _taggedTemplateLiteralLoose(["\n ", ";\n\n color: ", ";\n\n line-height: 17px;\n\n ::placeholder {\n color: ", ";\n\n line-height: 17px;\n\n ", "\n }\n\n width:
|
|
12610
|
+
var Input = styled__default.input(_templateObject3$a || (_templateObject3$a = _taggedTemplateLiteralLoose(["\n ", ";\n\n color: ", ";\n\n line-height: 17px;\n\n ::placeholder {\n color: ", ";\n\n line-height: 17px;\n\n ", "\n }\n\n display: block;\n width: ", ";\n box-sizing: border-box;\n\n ", ";\n\n border-width: 1px;\n border-style: solid;\n border-color: ", ";\n border-radius: 4px;\n\n background-color: ", ";\n\n box-shadow: none;\n outline: none;\n\n ", "\n\n ", "\n"])), function (_ref2) {
|
|
12610
12611
|
var theme = _ref2.theme;
|
|
12611
12612
|
return theme.useTypography('p');
|
|
12612
12613
|
}, function (_ref3) {
|
|
@@ -12629,69 +12630,73 @@ var Input = styled__default.input(_templateObject3$a || (_templateObject3$a = _t
|
|
|
12629
12630
|
|
|
12630
12631
|
return styled.css(_templateObject5$8 || (_templateObject5$8 = _taggedTemplateLiteralLoose(["\n opacity: 0.5;\n font-size: 14px;\n letter-spacing: 0px;\n "])));
|
|
12631
12632
|
}, function (_ref7) {
|
|
12632
|
-
var
|
|
12633
|
-
|
|
12634
|
-
if (paddingless) return;
|
|
12635
|
-
return styled.css(_templateObject6$6 || (_templateObject6$6 = _taggedTemplateLiteralLoose(["\n padding: ", " ", ";\n "])), theme.spacings.s2, theme.spacings.s3);
|
|
12633
|
+
var width = _ref7.width;
|
|
12634
|
+
return width || '100%';
|
|
12636
12635
|
}, function (_ref8) {
|
|
12637
12636
|
var theme = _ref8.theme,
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
return invalid ? theme.colors.warningRed : theme.colors.lightGrey;
|
|
12637
|
+
paddingless = _ref8.paddingless;
|
|
12638
|
+
if (paddingless) return;
|
|
12639
|
+
return styled.css(_templateObject6$6 || (_templateObject6$6 = _taggedTemplateLiteralLoose(["\n padding: ", " ", ";\n "])), theme.spacings.s2, theme.spacings.s3);
|
|
12642
12640
|
}, function (_ref9) {
|
|
12643
12641
|
var theme = _ref9.theme,
|
|
12644
|
-
invalid = _ref9.invalid
|
|
12645
|
-
|
|
12642
|
+
invalid = _ref9.invalid,
|
|
12643
|
+
borderless = _ref9.borderless;
|
|
12644
|
+
if (borderless) return 'transparent';
|
|
12645
|
+
return invalid ? theme.colors.warningRed : theme.colors.lightGrey;
|
|
12646
12646
|
}, function (_ref10) {
|
|
12647
|
-
var
|
|
12647
|
+
var theme = _ref10.theme,
|
|
12648
|
+
invalid = _ref10.invalid;
|
|
12649
|
+
return invalid ? theme.getColor('warningRed', 5) : theme.colors.white;
|
|
12650
|
+
}, function (_ref11) {
|
|
12651
|
+
var arrows = _ref11.arrows;
|
|
12648
12652
|
if (arrows) return;
|
|
12649
12653
|
return styled.css(_templateObject7$4 || (_templateObject7$4 = _taggedTemplateLiteralLoose(["\n /* Chrome, Safari, Edge, Opera */\n :-webkit-outer-spin-button,\n :-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n /* Firefox */\n -moz-appearance: textfield;\n "])));
|
|
12650
|
-
}, function (
|
|
12651
|
-
var readOnly =
|
|
12652
|
-
onClick =
|
|
12653
|
-
disabled =
|
|
12654
|
+
}, function (_ref12) {
|
|
12655
|
+
var readOnly = _ref12.readOnly,
|
|
12656
|
+
onClick = _ref12.onClick,
|
|
12657
|
+
disabled = _ref12.disabled;
|
|
12654
12658
|
if (!readOnly) return;
|
|
12655
12659
|
return styled.css(_templateObject8$3 || (_templateObject8$3 = _taggedTemplateLiteralLoose(["\n cursor: ", ";\n "])), !onClick || disabled ? 'unset' : 'pointer');
|
|
12656
12660
|
});
|
|
12657
|
-
var Label = styled__default.label(_templateObject9$3 || (_templateObject9$3 = _taggedTemplateLiteralLoose(["\n ", ";\n\n color: ", ";\n\n width: ", ";\n box-sizing: border-box;\n position: relative;\n display: block;\n\n ", "\n\n >
|
|
12658
|
-
var theme = _ref12.theme;
|
|
12659
|
-
return theme.useTypography('p');
|
|
12660
|
-
}, function (_ref13) {
|
|
12661
|
+
var Label = styled__default.label(_templateObject9$3 || (_templateObject9$3 = _taggedTemplateLiteralLoose(["\n ", ";\n\n color: ", ";\n\n width: ", ";\n box-sizing: border-box;\n position: relative;\n display: block;\n\n ", "\n\n > ", " {\n bottom: ", ";\n }\n\n ", "\n"])), function (_ref13) {
|
|
12661
12662
|
var theme = _ref13.theme;
|
|
12662
|
-
return theme.
|
|
12663
|
+
return theme.useTypography('p');
|
|
12663
12664
|
}, function (_ref14) {
|
|
12664
|
-
var
|
|
12665
|
-
return
|
|
12665
|
+
var theme = _ref14.theme;
|
|
12666
|
+
return theme.colors.greyishBlue;
|
|
12666
12667
|
}, function (_ref15) {
|
|
12667
|
-
var
|
|
12668
|
+
var width = _ref15.width;
|
|
12669
|
+
return width || '100%';
|
|
12670
|
+
}, function (_ref16) {
|
|
12671
|
+
var disabled = _ref16.disabled;
|
|
12668
12672
|
if (!disabled) return;
|
|
12669
12673
|
return styled.css(_templateObject10$2 || (_templateObject10$2 = _taggedTemplateLiteralLoose(["\n opacity: 0.5;\n "])));
|
|
12670
|
-
}, function (
|
|
12671
|
-
var theme =
|
|
12672
|
-
|
|
12673
|
-
|
|
12674
|
-
|
|
12675
|
-
if (!required) return;
|
|
12676
|
-
return styled.css(_templateObject11$1 || (_templateObject11$1 = _taggedTemplateLiteralLoose(["\n :after {\n content: ' *';\n }\n "])));
|
|
12677
|
-
}, IconContainer, function (_ref18) {
|
|
12674
|
+
}, IconContainer, function (_ref17) {
|
|
12675
|
+
var theme = _ref17.theme,
|
|
12676
|
+
paddingless = _ref17.paddingless;
|
|
12677
|
+
return paddingless ? '2px' : "calc(" + theme.spacings.s2 + " + 1px)";
|
|
12678
|
+
}, function (_ref18) {
|
|
12678
12679
|
var theme = _ref18.theme,
|
|
12680
|
+
icon = _ref18.icon,
|
|
12679
12681
|
paddingless = _ref18.paddingless;
|
|
12680
|
-
return paddingless ? '2px' : "calc(" + theme.spacings.s2 + " + 1px)";
|
|
12681
|
-
}, function (_ref19) {
|
|
12682
|
-
var theme = _ref19.theme,
|
|
12683
|
-
icon = _ref19.icon,
|
|
12684
|
-
paddingless = _ref19.paddingless;
|
|
12685
12682
|
if (!icon) return;
|
|
12686
12683
|
var width = icon.width,
|
|
12687
12684
|
position = icon.position;
|
|
12688
12685
|
var padding = paddingless ? '0px' : theme.spacings.s3;
|
|
12689
12686
|
|
|
12690
12687
|
if (position === 'right') {
|
|
12691
|
-
return styled.css(
|
|
12688
|
+
return styled.css(_templateObject11$1 || (_templateObject11$1 = _taggedTemplateLiteralLoose(["\n > ", " {\n width: ", ";\n right: calc(", " / 2);\n }\n\n > ", " {\n padding-right: calc(", " + ", ");\n }\n "])), IconContainer, width, padding, Input, padding, width);
|
|
12692
12689
|
}
|
|
12693
12690
|
|
|
12694
|
-
return styled.css(
|
|
12691
|
+
return styled.css(_templateObject12$1 || (_templateObject12$1 = _taggedTemplateLiteralLoose(["\n > ", " {\n width: ", ";\n left: calc(", " / 2);\n }\n\n > ", " {\n padding-left: calc(", " + ", ");\n }\n "])), IconContainer, width, padding, Input, padding, width);
|
|
12692
|
+
});
|
|
12693
|
+
var LabelText = styled__default.div(_templateObject13$1 || (_templateObject13$1 = _taggedTemplateLiteralLoose(["\n display: inline-block;\n margin-bottom: ", ";\n\n ", "\n"])), function (_ref19) {
|
|
12694
|
+
var theme = _ref19.theme;
|
|
12695
|
+
return theme.spacings.s1;
|
|
12696
|
+
}, function (_ref20) {
|
|
12697
|
+
var required = _ref20.required;
|
|
12698
|
+
if (!required) return;
|
|
12699
|
+
return styled.css(_templateObject14$1 || (_templateObject14$1 = _taggedTemplateLiteralLoose(["\n :after {\n content: ' *';\n }\n "])));
|
|
12695
12700
|
});
|
|
12696
12701
|
|
|
12697
12702
|
var Input$1 = React__default.forwardRef(function (props, ref) {
|
|
@@ -12731,12 +12736,13 @@ var Input$1 = React__default.forwardRef(function (props, ref) {
|
|
|
12731
12736
|
iconOnClick = props.icon.onClick;
|
|
12732
12737
|
}
|
|
12733
12738
|
|
|
12734
|
-
var inputProps = filterObject(props, ['label', 'invalid', 'required', 'icon', 'mask', 'loading', 'clearable', 'setValue', 'onPressEnter', 'htmlDisabled', 'width', 'arrows', 'borderless', 'paddingless'], {
|
|
12739
|
+
var inputProps = filterObject(props, ['label', 'invalid', 'required', 'icon', 'mask', 'loading', 'clearable', 'setValue', 'onPressEnter', 'htmlDisabled', 'width', 'inputWidth', 'arrows', 'borderless', 'paddingless'], {
|
|
12735
12740
|
invalid: intInvalid,
|
|
12736
12741
|
type: 'text',
|
|
12737
12742
|
arrows: intArrows,
|
|
12738
12743
|
borderless: intBorderless,
|
|
12739
|
-
paddingless: intPaddingless
|
|
12744
|
+
paddingless: intPaddingless,
|
|
12745
|
+
width: props.inputWidth
|
|
12740
12746
|
});
|
|
12741
12747
|
|
|
12742
12748
|
var onChange = inputProps.onChange || function () {};
|
|
@@ -12803,7 +12809,7 @@ var Input$1 = React__default.forwardRef(function (props, ref) {
|
|
|
12803
12809
|
}
|
|
12804
12810
|
|
|
12805
12811
|
if (loading) {
|
|
12806
|
-
position = position || '
|
|
12812
|
+
position = position || 'right';
|
|
12807
12813
|
icon = {
|
|
12808
12814
|
type: 'jsx',
|
|
12809
12815
|
icon: React__default.createElement(Loader, {
|
|
@@ -12830,13 +12836,14 @@ var Input$1 = React__default.forwardRef(function (props, ref) {
|
|
|
12830
12836
|
} : undefined;
|
|
12831
12837
|
if (htmlDisabled) inputProps.disabled = true;
|
|
12832
12838
|
return React__default.createElement(Label, {
|
|
12833
|
-
required: intRequired,
|
|
12834
12839
|
disabled: intDisabled,
|
|
12835
12840
|
invalid: intInvalid,
|
|
12836
12841
|
paddingless: intPaddingless,
|
|
12837
12842
|
icon: iconProps,
|
|
12838
12843
|
width: width
|
|
12839
|
-
},
|
|
12844
|
+
}, label && React__default.createElement(LabelText, {
|
|
12845
|
+
required: intRequired
|
|
12846
|
+
}, label), React__default.createElement(Input, Object.assign({}, inputProps, {
|
|
12840
12847
|
ref: ref
|
|
12841
12848
|
})), icon && React__default.createElement(IconContainer, {
|
|
12842
12849
|
type: iconSubmit ? 'submit' : 'button',
|
|
@@ -13790,7 +13797,15 @@ var getOptions$1 = function getOptions(options, checked, setChecked) {
|
|
|
13790
13797
|
element: React__default.createElement(Checkbox, {
|
|
13791
13798
|
type: 'checkbox',
|
|
13792
13799
|
checked: checked.includes(option.value),
|
|
13793
|
-
label:
|
|
13800
|
+
label: option.disabled && option.disabledText ? React__default.createElement(semanticUiReact.Popup, {
|
|
13801
|
+
on: 'click',
|
|
13802
|
+
trigger: React__default.createElement("div", null, label.element),
|
|
13803
|
+
content: option.disabledText,
|
|
13804
|
+
position: 'left center',
|
|
13805
|
+
inverted: true,
|
|
13806
|
+
wide: true
|
|
13807
|
+
}) : label.element,
|
|
13808
|
+
disabled: option.disabled,
|
|
13794
13809
|
onChange: function onChange(event) {
|
|
13795
13810
|
var isChecked = event.target.checked;
|
|
13796
13811
|
setChecked(function (prev) {
|
|
@@ -14289,7 +14304,7 @@ var Label$2 = styled__default.div(_templateObject3$e || (_templateObject3$e = _t
|
|
|
14289
14304
|
return theme.colors.darkestGrey;
|
|
14290
14305
|
});
|
|
14291
14306
|
|
|
14292
|
-
var
|
|
14307
|
+
var getPhoneDetails = function getPhoneDetails(phone) {
|
|
14293
14308
|
if (!notEmptyString(phone)) return null;
|
|
14294
14309
|
var splitted = phone.replace(/[^0-9\s]/g, '').split(' ');
|
|
14295
14310
|
if (splitted.length < 2) return null;
|
|
@@ -14336,7 +14351,7 @@ var Button$2 = function Button(props) {
|
|
|
14336
14351
|
}));
|
|
14337
14352
|
};
|
|
14338
14353
|
|
|
14339
|
-
var
|
|
14354
|
+
var Component = React__default.forwardRef(function (props, ref) {
|
|
14340
14355
|
var value = props.value,
|
|
14341
14356
|
setValue = props.setValue;
|
|
14342
14357
|
|
|
@@ -14353,7 +14368,7 @@ var Phone = React__default.forwardRef(function (props, ref) {
|
|
|
14353
14368
|
setOpen = _useState3[1];
|
|
14354
14369
|
|
|
14355
14370
|
React.useEffect(function () {
|
|
14356
|
-
var details =
|
|
14371
|
+
var details = getPhoneDetails(value || '');
|
|
14357
14372
|
setCountry(details ? details.country : countries.br);
|
|
14358
14373
|
}, [value]);
|
|
14359
14374
|
var options = Object.keys(countries).map(function (iso) {
|
|
@@ -14378,7 +14393,7 @@ var Phone = React__default.forwardRef(function (props, ref) {
|
|
|
14378
14393
|
};
|
|
14379
14394
|
|
|
14380
14395
|
React.useEffect(function () {
|
|
14381
|
-
var details =
|
|
14396
|
+
var details = getPhoneDetails(value || '');
|
|
14382
14397
|
setCountry(details ? details.country : countries.br);
|
|
14383
14398
|
}, [value]);
|
|
14384
14399
|
React.useEffect(function () {
|
|
@@ -14437,7 +14452,10 @@ var Phone = React__default.forwardRef(function (props, ref) {
|
|
|
14437
14452
|
}
|
|
14438
14453
|
}));
|
|
14439
14454
|
});
|
|
14440
|
-
|
|
14455
|
+
Component.displayName = 'Phone';
|
|
14456
|
+
var Phone = Object.assign(Component, {
|
|
14457
|
+
getPhoneDetails: getPhoneDetails
|
|
14458
|
+
});
|
|
14441
14459
|
|
|
14442
14460
|
var _templateObject$l, _templateObject2$h, _templateObject3$f, _templateObject4$c, _templateObject5$b, _templateObject6$9, _templateObject7$7, _templateObject8$5, _templateObject9$5;
|
|
14443
14461
|
var RelativeContainer$4 = styled__default.div(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n position: relative;\n\n input {\n color: transparent;\n }\n"])));
|
|
@@ -14662,7 +14680,7 @@ var Switch = function Switch(props) {
|
|
|
14662
14680
|
})), React__default.createElement("span", null), label && React__default.createElement(LabelContainer$1, null, label));
|
|
14663
14681
|
};
|
|
14664
14682
|
|
|
14665
|
-
var _templateObject$n, _templateObject2$j, _templateObject3$h, _templateObject4$e, _templateObject5$d, _templateObject6$b, _templateObject7$9, _templateObject8$6, _templateObject9$6, _templateObject10$4, _templateObject11$3, _templateObject12$3, _templateObject13$3, _templateObject14$
|
|
14683
|
+
var _templateObject$n, _templateObject2$j, _templateObject3$h, _templateObject4$e, _templateObject5$d, _templateObject6$b, _templateObject7$9, _templateObject8$6, _templateObject9$6, _templateObject10$4, _templateObject11$3, _templateObject12$3, _templateObject13$3, _templateObject14$2, _templateObject15, _templateObject16;
|
|
14666
14684
|
var bullet = styled.css(_templateObject$n || (_templateObject$n = _taggedTemplateLiteralLoose(["\n appearance: none;\n width: ", ";\n height: ", ";\n border-radius: 100%;\n border-width: 1px;\n border-style: solid;\n background-color: ", ";\n box-shadow: 0px 1px 3px ", ";\n"])), function (_ref) {
|
|
14667
14685
|
var theme = _ref.theme;
|
|
14668
14686
|
return theme.spacings.s4;
|
|
@@ -14722,7 +14740,7 @@ var SelectedArea = styled__default.div(_templateObject13$3 || (_templateObject13
|
|
|
14722
14740
|
var percent = _ref13.percent;
|
|
14723
14741
|
return percent;
|
|
14724
14742
|
});
|
|
14725
|
-
var MarkersContainer = styled__default.div(_templateObject14$
|
|
14743
|
+
var MarkersContainer = styled__default.div(_templateObject14$2 || (_templateObject14$2 = _taggedTemplateLiteralLoose(["\n height: 17px;\n"])));
|
|
14726
14744
|
var Marker = styled__default.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n width: 40px;\n text-align: center;\n left: ", ";\n z-index: 2;\n\n :first-child {\n left: 0;\n text-align: left;\n\n :after {\n left: 0;\n }\n }\n :last-child {\n right: 0;\n left: unset;\n text-align: right;\n\n :after {\n right: 0;\n left: unset;\n }\n }\n\n ", "\n"])), function (_ref14) {
|
|
14727
14745
|
var left = _ref14.left;
|
|
14728
14746
|
return left;
|
|
@@ -15111,8 +15129,8 @@ var intervalTypes = {
|
|
|
15111
15129
|
var start = new Date(base);
|
|
15112
15130
|
start.setDate(start.getDate() - start.getUTCDay());
|
|
15113
15131
|
start.setHours(0, 0, 0, 0);
|
|
15114
|
-
var end = new Date(
|
|
15115
|
-
end.setDate(start.getDate()
|
|
15132
|
+
var end = new Date(start);
|
|
15133
|
+
end.setDate(start.getDate() + 6);
|
|
15116
15134
|
end.setHours(23, 59, 59, 0);
|
|
15117
15135
|
return [start, end];
|
|
15118
15136
|
},
|
|
@@ -15152,7 +15170,7 @@ var intervalTypes = {
|
|
|
15152
15170
|
var start = new Date(base);
|
|
15153
15171
|
start.setDate(1);
|
|
15154
15172
|
start.setHours(0, 0, 0, 0);
|
|
15155
|
-
var end = new Date(
|
|
15173
|
+
var end = new Date(start);
|
|
15156
15174
|
end.setMonth(end.getMonth() + 1);
|
|
15157
15175
|
end.setDate(0);
|
|
15158
15176
|
end.setHours(23, 59, 59, 0);
|
|
@@ -15236,7 +15254,7 @@ var parse = function parse(value) {
|
|
|
15236
15254
|
};
|
|
15237
15255
|
|
|
15238
15256
|
var _templateObject$q, _templateObject2$l, _templateObject3$j, _templateObject4$g, _templateObject5$f, _templateObject6$d, _templateObject7$b, _templateObject8$7, _templateObject9$7, _templateObject10$5;
|
|
15239
|
-
var RelativeContainer$5 = styled__default.div(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n position: relative;\n\n > :nth-child(1) input {\n color: transparent;\n }\n"])));
|
|
15257
|
+
var RelativeContainer$5 = styled__default.div(_templateObject$q || (_templateObject$q = _taggedTemplateLiteralLoose(["\n position: relative;\n user-select: none;\n\n > :nth-child(1) input {\n color: transparent;\n }\n"])));
|
|
15240
15258
|
var LabelContainer$3 = styled__default.div(_templateObject2$l || (_templateObject2$l = _taggedTemplateLiteralLoose(["\n ", "\n line-height: ", ";\n"])), function (_ref) {
|
|
15241
15259
|
var theme = _ref.theme;
|
|
15242
15260
|
return theme.useTypography('p');
|
|
@@ -15275,7 +15293,7 @@ var Button$4 = styled__default.button(_templateObject9$7 || (_templateObject9$7
|
|
|
15275
15293
|
return styled.css(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n :not(:disabled) {\n cursor: pointer;\n }\n "])));
|
|
15276
15294
|
});
|
|
15277
15295
|
|
|
15278
|
-
var
|
|
15296
|
+
var Component$1 = React__default.forwardRef(function (props, ref) {
|
|
15279
15297
|
var value = parse(props.value);
|
|
15280
15298
|
var disabled = props.disabled || props.loading;
|
|
15281
15299
|
|
|
@@ -15452,9 +15470,21 @@ var DatePicker$1 = React__default.forwardRef(function (props, ref) {
|
|
|
15452
15470
|
time: {}
|
|
15453
15471
|
}));
|
|
15454
15472
|
});
|
|
15455
|
-
|
|
15473
|
+
Component$1.displayName = 'DatePicker';
|
|
15474
|
+
|
|
15475
|
+
var useDefaultDateIntervalState = function useDefaultDateIntervalState() {
|
|
15476
|
+
var start = new Date();
|
|
15477
|
+
start.setHours(0, 0, 0, 0);
|
|
15478
|
+
var end = new Date();
|
|
15479
|
+
end.setHours(23, 59, 59, 0);
|
|
15480
|
+
return [start.toISOString(), end.toISOString()];
|
|
15481
|
+
};
|
|
15482
|
+
|
|
15483
|
+
var DatePicker$1 = Object.assign(Component$1, {
|
|
15484
|
+
useDefaultDateIntervalState: useDefaultDateIntervalState
|
|
15485
|
+
});
|
|
15456
15486
|
|
|
15457
|
-
var
|
|
15487
|
+
var Component$2 = React__default.forwardRef(function (props, ref) {
|
|
15458
15488
|
switch (props.type) {
|
|
15459
15489
|
case 'date':
|
|
15460
15490
|
{
|
|
@@ -15544,7 +15574,11 @@ var Input$3 = React__default.forwardRef(function (props, ref) {
|
|
|
15544
15574
|
}
|
|
15545
15575
|
}
|
|
15546
15576
|
});
|
|
15547
|
-
|
|
15577
|
+
Component$2.displayName = 'Input';
|
|
15578
|
+
var Input$3 = Object.assign(Component$2, {
|
|
15579
|
+
useDefaultDateIntervalState: DatePicker$1.useDefaultDateIntervalState,
|
|
15580
|
+
getPhoneDetails: Phone.getPhoneDetails
|
|
15581
|
+
});
|
|
15548
15582
|
|
|
15549
15583
|
var Portal = function Portal(props) {
|
|
15550
15584
|
var id = props.id,
|
|
@@ -17000,7 +17034,7 @@ var useContext$2 = function useContext() {
|
|
|
17000
17034
|
return React__default.useContext(Provider$2);
|
|
17001
17035
|
};
|
|
17002
17036
|
|
|
17003
|
-
var _templateObject$M, _templateObject2$C, _templateObject3$A, _templateObject4$w, _templateObject5$u, _templateObject6$q, _templateObject7$n, _templateObject8$j, _templateObject9$h, _templateObject10$c, _templateObject11$6, _templateObject12$4, _templateObject13$4, _templateObject14$
|
|
17037
|
+
var _templateObject$M, _templateObject2$C, _templateObject3$A, _templateObject4$w, _templateObject5$u, _templateObject6$q, _templateObject7$n, _templateObject8$j, _templateObject9$h, _templateObject10$c, _templateObject11$6, _templateObject12$4, _templateObject13$4, _templateObject14$3, _templateObject15$1;
|
|
17004
17038
|
var aligns = {
|
|
17005
17039
|
self: {
|
|
17006
17040
|
horizontal: {
|
|
@@ -17110,7 +17144,7 @@ var Col = styled__default.div(_templateObject$M || (_templateObject$M = _taggedT
|
|
|
17110
17144
|
if (!hover) return;
|
|
17111
17145
|
var h = hover === true ? ['lightGrey', 50] : hover;
|
|
17112
17146
|
var c = Array.isArray(h) ? theme.getColor.apply(theme, h) : theme.colors[h];
|
|
17113
|
-
return styled.css(_templateObject14$
|
|
17147
|
+
return styled.css(_templateObject14$3 || (_templateObject14$3 = _taggedTemplateLiteralLoose(["\n :hover {\n background-color: ", ";\n }\n "])), c);
|
|
17114
17148
|
}, function (_ref9) {
|
|
17115
17149
|
var pointer = _ref9.pointer;
|
|
17116
17150
|
if (!pointer) return;
|