plataforma-fundacao-componentes 2.25.7 → 2.25.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/button/Button.stories.d.ts +31 -32
- package/dist/components/buttonFileUpload/ButtonFileUpload.d.ts +19 -9
- package/dist/components/buttonFileUpload/ButtonFileUpload.stories.d.ts +9 -10
- package/dist/components/datePicker/components/datePickerCalendar/DatePickerCalendar.d.ts +1 -0
- package/dist/components/fileUpload/FileUpload.d.ts +2 -2
- package/dist/components/toast/Toast.stories.d.ts +1 -0
- package/dist/index.css +9 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +75 -86
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +78 -89
- package/dist/index.modern.js.map +1 -1
- package/dist/libraries/{BlobFileTypes.d.ts → FileTypes.d.ts} +15 -12
- package/dist/libraries/IconButtonTheme.d.ts +1 -0
- package/dist/libraries/Toast.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
5
|
export default _default;
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
import Button from "./Button";
|
|
6
|
+
export declare const Primary: () => React.JSX.Element;
|
|
7
|
+
export declare const LoadingOnClick: () => React.JSX.Element;
|
|
8
|
+
export declare const PrimaryLight: () => React.JSX.Element;
|
|
9
|
+
export declare const PrimaryDisabled: () => React.JSX.Element;
|
|
10
|
+
export declare const PrimaryLightDisabled: () => React.JSX.Element;
|
|
11
|
+
export declare const PrimaryLoading: () => React.JSX.Element;
|
|
12
|
+
export declare const Secondary: () => React.JSX.Element;
|
|
13
|
+
export declare const SecondaryWhiteBackground: () => React.JSX.Element;
|
|
14
|
+
export declare const SecondaryDisabled: () => React.JSX.Element;
|
|
15
|
+
export declare const StyleDefault: () => React.JSX.Element;
|
|
16
|
+
export declare const Danger: () => React.JSX.Element;
|
|
17
|
+
export declare const DangerDarker: () => React.JSX.Element;
|
|
18
|
+
export declare const DangerDarkerOutline: () => React.JSX.Element;
|
|
19
|
+
export declare const DangerDisabled: () => React.JSX.Element;
|
|
20
|
+
export declare const Black: () => React.JSX.Element;
|
|
21
|
+
export declare const FullWidth: () => React.JSX.Element;
|
|
22
|
+
export declare const LeftIcon: () => React.JSX.Element;
|
|
23
|
+
export declare const LeftIconFullWidth: () => React.JSX.Element;
|
|
24
|
+
export declare const RightIcon: () => React.JSX.Element;
|
|
25
|
+
export declare const RightIconFullWidth: () => React.JSX.Element;
|
|
26
|
+
export declare const TDLoader: () => React.JSX.Element;
|
|
27
|
+
export declare const TDLoaderFullWidth: () => React.JSX.Element;
|
|
28
|
+
export declare const BottomMobileWithLoader: () => React.JSX.Element;
|
|
29
|
+
export declare const headerButtonPrimary: () => React.JSX.Element;
|
|
30
|
+
export declare const headerButtonSecondary: () => React.JSX.Element;
|
|
31
|
+
export declare const headerUserButtonPrimary: () => React.JSX.Element;
|
|
32
|
+
export declare const headerUserButtonSecondary: () => React.JSX.Element;
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BlobFileTypes } from '../../libraries/BlobFileTypes';
|
|
1
|
+
import React, { InputHTMLAttributes } from 'react';
|
|
3
2
|
import { ButtonThemes } from '../../libraries/ButtonTheme';
|
|
3
|
+
import { FileTypes } from '../../libraries/FileTypes';
|
|
4
4
|
import { ButtonProps } from '../button/Button';
|
|
5
5
|
import './ButtonFileUpload.scss';
|
|
6
|
-
export
|
|
6
|
+
export declare type ButtonFileUploadProps = {
|
|
7
7
|
label?: string;
|
|
8
8
|
leftIcon?: React.ReactNode;
|
|
9
9
|
theme?: ButtonThemes;
|
|
10
|
-
allowedFileTypes?: Array<
|
|
11
|
-
multiple?: boolean;
|
|
10
|
+
allowedFileTypes?: Array<FileTypes | string>;
|
|
12
11
|
disabled?: boolean;
|
|
13
|
-
value?: null | object | object[] | Blob | Blob[] | File | File[];
|
|
14
|
-
onChange: (value: File | File[] | Blob | Blob[] | object | object[]) => void;
|
|
15
12
|
onTypeNotAllowed?: () => void;
|
|
16
|
-
buttonProps?: ButtonProps |
|
|
13
|
+
buttonProps?: Omit<ButtonProps, 'theme' | 'onClick' | 'disabled' | 'leftIcon' | 'w100' | 'children'> & {
|
|
14
|
+
'data-testid': string;
|
|
15
|
+
};
|
|
17
16
|
w100?: boolean;
|
|
18
|
-
|
|
17
|
+
inputProps?: Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'multiple' | 'tabIndex' | 'type' | 'accept' | 'hidden'> & {
|
|
18
|
+
'data-testid': string;
|
|
19
|
+
};
|
|
20
|
+
} & ({
|
|
21
|
+
multiple: true;
|
|
22
|
+
value?: File[];
|
|
23
|
+
onChange?: (value: File[]) => void;
|
|
24
|
+
} | {
|
|
25
|
+
multiple?: false;
|
|
26
|
+
value?: File;
|
|
27
|
+
onChange?: (value?: File) => void;
|
|
28
|
+
});
|
|
19
29
|
declare function ButtonFileUpload(props: ButtonFileUploadProps): React.JSX.Element;
|
|
20
30
|
declare namespace ButtonFileUpload {
|
|
21
31
|
var defaultProps: {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
5
|
export default _default;
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
import ButtonFileUpload from "./ButtonFileUpload";
|
|
6
|
+
export declare const Single: () => React.JSX.Element;
|
|
7
|
+
export declare const SingleFileTypes: () => React.JSX.Element;
|
|
8
|
+
export declare const Multiple: () => React.JSX.Element;
|
|
9
|
+
export declare const MultipleW100: () => React.JSX.Element;
|
|
10
|
+
export declare const NotAllowedEvent: () => React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FileTypes } from '../../libraries/FileTypes';
|
|
3
3
|
import './FileUpload.scss';
|
|
4
4
|
interface FileUploadProps {
|
|
5
5
|
label: string | React.ReactNode;
|
|
@@ -10,7 +10,7 @@ interface FileUploadProps {
|
|
|
10
10
|
error?: boolean;
|
|
11
11
|
onChange: (evt?: any) => void;
|
|
12
12
|
inputFileProps?: object;
|
|
13
|
-
allowedFileTypes?:
|
|
13
|
+
allowedFileTypes?: FileTypes[];
|
|
14
14
|
multiple?: boolean;
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
className?: string;
|
|
@@ -6,6 +6,7 @@ export default _default;
|
|
|
6
6
|
export function Default(): React.JSX.Element;
|
|
7
7
|
export function Success(): React.JSX.Element;
|
|
8
8
|
export function Error(): React.JSX.Element;
|
|
9
|
+
export function Warning(): React.JSX.Element;
|
|
9
10
|
export function DefaultWithButton(): React.JSX.Element;
|
|
10
11
|
import Toast from "./Toast";
|
|
11
12
|
import React from "react";
|
package/dist/index.css
CHANGED
|
@@ -1432,9 +1432,6 @@ h5 {
|
|
|
1432
1432
|
.component-button-file-upload.w100 {
|
|
1433
1433
|
width: 100%; }
|
|
1434
1434
|
|
|
1435
|
-
.component-button-file-upload input {
|
|
1436
|
-
display: none; }
|
|
1437
|
-
|
|
1438
1435
|
:export {
|
|
1439
1436
|
widthXs: 575.98px;
|
|
1440
1437
|
widthSm: 767.98px;
|
|
@@ -1719,6 +1716,9 @@ h5 {
|
|
|
1719
1716
|
.component-icon-button:not(:disabled).component-icon-button-secondary {
|
|
1720
1717
|
color: #fefefe; }
|
|
1721
1718
|
|
|
1719
|
+
.component-icon-button:not(:disabled).component-icon-button-gray {
|
|
1720
|
+
color: #cdd3cd; }
|
|
1721
|
+
|
|
1722
1722
|
.component-icon-button:not(:disabled).component-icon-button-dark {
|
|
1723
1723
|
color: #323c32; }
|
|
1724
1724
|
|
|
@@ -7631,6 +7631,12 @@ nav.component-tabs {
|
|
|
7631
7631
|
.component-toast-error .component-toast-close-button svg {
|
|
7632
7632
|
color: #fefefe; }
|
|
7633
7633
|
|
|
7634
|
+
.component-toast-warning {
|
|
7635
|
+
color: #765f00;
|
|
7636
|
+
background-color: #ffcd00; }
|
|
7637
|
+
.component-toast-warning .component-toast-close-button svg {
|
|
7638
|
+
color: #765f00; }
|
|
7639
|
+
|
|
7634
7640
|
@keyframes fillToZero {
|
|
7635
7641
|
0% {
|
|
7636
7642
|
width: 100%; }
|
package/dist/index.d.ts
CHANGED
|
@@ -200,7 +200,7 @@ import FormattedText from './components/formattedText/FormattedText';
|
|
|
200
200
|
import { LeftControlWithLabel } from './components/table/components/leftControlWithLabel/LeftControlWithLabel';
|
|
201
201
|
export * from './components/modal/ModalTypes';
|
|
202
202
|
export * from './libraries/ActionCardThemes';
|
|
203
|
-
export * from './libraries/
|
|
203
|
+
export * from './libraries/FileTypes';
|
|
204
204
|
export * from './libraries/ButtonTheme';
|
|
205
205
|
export * from './libraries/ControlLabelPosition';
|
|
206
206
|
export * from './libraries/CardThemes';
|
package/dist/index.js
CHANGED
|
@@ -4802,50 +4802,53 @@ Button.defaultProps = {
|
|
|
4802
4802
|
};
|
|
4803
4803
|
var Button$1 = React$1.memo(Button);
|
|
4804
4804
|
|
|
4805
|
-
(function (
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4805
|
+
(function (FileTypes) {
|
|
4806
|
+
FileTypes["ALL_IMAGES"] = "image/*";
|
|
4807
|
+
FileTypes["AVI"] = ".avi";
|
|
4808
|
+
FileTypes["DOC"] = ".doc";
|
|
4809
|
+
FileTypes["DOCX"] = ".docx";
|
|
4810
|
+
FileTypes["GIF"] = ".gif";
|
|
4811
|
+
FileTypes["JPEG"] = ".jpeg";
|
|
4812
|
+
FileTypes["JPG"] = ".jpg";
|
|
4813
|
+
FileTypes["MP4"] = ".mp4";
|
|
4814
|
+
FileTypes["PDF"] = ".pdf";
|
|
4815
|
+
FileTypes["PNG"] = ".png";
|
|
4816
|
+
FileTypes["PPT"] = ".ppt";
|
|
4817
|
+
FileTypes["PPTX"] = ".pptx";
|
|
4818
|
+
FileTypes["ODT"] = ".odt";
|
|
4819
|
+
FileTypes["SVG"] = ".svg";
|
|
4820
|
+
FileTypes["WMV"] = ".wmv";
|
|
4821
|
+
FileTypes["XLS"] = ".xls";
|
|
4822
|
+
FileTypes["XLSX"] = ".xlsx";
|
|
4823
|
+
FileTypes["ZIP"] = ".zip";
|
|
4824
|
+
FileTypes["RAR"] = ".rar";
|
|
4825
|
+
})(exports.FileTypes || (exports.FileTypes = {}));
|
|
4823
4826
|
(function (ImageTypes) {
|
|
4824
|
-
ImageTypes["PNG"] = ".png";
|
|
4825
4827
|
ImageTypes["GIF"] = ".gif";
|
|
4826
|
-
ImageTypes["JPG"] = ".jpg";
|
|
4827
4828
|
ImageTypes["JPEG"] = ".jpeg";
|
|
4829
|
+
ImageTypes["JPG"] = ".jpg";
|
|
4830
|
+
ImageTypes["PNG"] = ".png";
|
|
4828
4831
|
})(exports.ImageTypes || (exports.ImageTypes = {}));
|
|
4829
4832
|
|
|
4830
4833
|
var rootClassName$1H = 'component-button-file-upload';
|
|
4831
4834
|
function ButtonFileUpload(props) {
|
|
4832
|
-
var
|
|
4833
|
-
|
|
4834
|
-
var isAllowedFileType = function
|
|
4835
|
+
var _props$inputProps;
|
|
4836
|
+
var id = React$1.useMemo(getUniqueKey, []);
|
|
4837
|
+
var isAllowedFileType = React$1.useCallback(function (fileName) {
|
|
4835
4838
|
var extension = fileName.replace(/^(.)*(\..+)$/, '$2').toLowerCase();
|
|
4836
4839
|
if (props.allowedFileTypes && props.allowedFileTypes.length) {
|
|
4837
4840
|
if (props.allowedFileTypes.indexOf(extension) > -1) {
|
|
4838
4841
|
return true;
|
|
4839
|
-
} else if (props.allowedFileTypes.indexOf(exports.
|
|
4842
|
+
} else if (props.allowedFileTypes.indexOf(exports.FileTypes.ALL_IMAGES) > -1 && Object.values(exports.ImageTypes).indexOf(extension) > -1) {
|
|
4840
4843
|
return true;
|
|
4841
4844
|
} else {
|
|
4842
4845
|
return false;
|
|
4843
4846
|
}
|
|
4844
4847
|
}
|
|
4845
4848
|
return true;
|
|
4846
|
-
};
|
|
4847
|
-
var
|
|
4848
|
-
|
|
4849
|
+
}, [props.allowedFileTypes]);
|
|
4850
|
+
var buttonProps = React$1.useMemo(function () {
|
|
4851
|
+
return _extends({
|
|
4849
4852
|
theme: props.theme,
|
|
4850
4853
|
onClick: function onClick() {
|
|
4851
4854
|
var hiddenInput = document.querySelector("#" + id + " input");
|
|
@@ -4857,12 +4860,12 @@ function ButtonFileUpload(props) {
|
|
|
4857
4860
|
leftIcon: props.leftIcon,
|
|
4858
4861
|
w100: props.w100
|
|
4859
4862
|
}, props.buttonProps);
|
|
4860
|
-
|
|
4861
|
-
};
|
|
4863
|
+
}, [id, props.buttonProps, props.disabled, props.leftIcon, props.theme, props.w100]);
|
|
4862
4864
|
return React$1__default.createElement("div", {
|
|
4863
4865
|
className: getMergedClassNames([rootClassName$1H, props.w100 ? 'w100' : '']),
|
|
4864
4866
|
id: id
|
|
4865
|
-
}, React$1__default.createElement("input", {
|
|
4867
|
+
}, React$1__default.createElement("input", Object.assign({
|
|
4868
|
+
hidden: true,
|
|
4866
4869
|
type: 'file',
|
|
4867
4870
|
accept: props.allowedFileTypes ? Array(props.allowedFileTypes).join(', ') : undefined,
|
|
4868
4871
|
tabIndex: -1,
|
|
@@ -4877,9 +4880,11 @@ function ButtonFileUpload(props) {
|
|
|
4877
4880
|
return !props.allowedFileTypes || !props.allowedFileTypes.length || isAllowedFileType(file.name);
|
|
4878
4881
|
});
|
|
4879
4882
|
if (props.multiple) {
|
|
4880
|
-
|
|
4883
|
+
var _props$onChange;
|
|
4884
|
+
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, filteredFiles);
|
|
4881
4885
|
} else {
|
|
4882
|
-
|
|
4886
|
+
var _props$onChange2;
|
|
4887
|
+
(_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 ? void 0 : _props$onChange2.call(props, filteredFiles[0]);
|
|
4883
4888
|
}
|
|
4884
4889
|
var hiddenInput = document.querySelector("#" + id + " input");
|
|
4885
4890
|
if (hiddenInput) {
|
|
@@ -4887,7 +4892,7 @@ function ButtonFileUpload(props) {
|
|
|
4887
4892
|
}
|
|
4888
4893
|
},
|
|
4889
4894
|
multiple: props.multiple
|
|
4890
|
-
}), React$1__default.createElement(Button$1, Object.assign({},
|
|
4895
|
+
}, (_props$inputProps = props.inputProps) != null ? _props$inputProps : {})), React$1__default.createElement(Button$1, Object.assign({}, buttonProps), props.label));
|
|
4891
4896
|
}
|
|
4892
4897
|
ButtonFileUpload.defaultProps = {
|
|
4893
4898
|
label: 'Escolher arquivo',
|
|
@@ -7299,7 +7304,7 @@ function DatePickerCalendar(props) {
|
|
|
7299
7304
|
},
|
|
7300
7305
|
key: index,
|
|
7301
7306
|
className: getMergedClassNames(['day', day.getFullYear() === today.getFullYear() && day.getMonth() === today.getMonth() && day.getDate() === today.getDate() ? 'today' : '', props.value && day.getFullYear() === ((_stringToDate = stringToDate(props.value)) === null || _stringToDate === void 0 ? void 0 : _stringToDate.getFullYear()) && day.getMonth() === ((_stringToDate2 = stringToDate(props.value)) === null || _stringToDate2 === void 0 ? void 0 : _stringToDate2.getMonth()) && day.getDate() === ((_stringToDate3 = stringToDate(props.value)) === null || _stringToDate3 === void 0 ? void 0 : _stringToDate3.getDate()) ? 'selected' : '']),
|
|
7302
|
-
disabled: day.getMonth() !== month
|
|
7307
|
+
disabled: day.getMonth() !== month || props.disabled
|
|
7303
7308
|
}, day.getDate());
|
|
7304
7309
|
})))));
|
|
7305
7310
|
}
|
|
@@ -7409,6 +7414,7 @@ function DatePicker(props) {
|
|
|
7409
7414
|
}
|
|
7410
7415
|
}
|
|
7411
7416
|
}) : undefined, React$1__default.createElement(IconButton$1, {
|
|
7417
|
+
disabled: props.disabled,
|
|
7412
7418
|
icon: React$1__default.createElement(CalendarIcon, null),
|
|
7413
7419
|
onClick: function onClick() {
|
|
7414
7420
|
setOpened(!opened);
|
|
@@ -7423,6 +7429,7 @@ function DatePicker(props) {
|
|
|
7423
7429
|
className: rootClassName$1W + "-panel"
|
|
7424
7430
|
}, React$1__default.createElement(DatePickerCalendar$1, {
|
|
7425
7431
|
language: props.language,
|
|
7432
|
+
disabled: props.disabled,
|
|
7426
7433
|
value: value,
|
|
7427
7434
|
onChange: function onChange(date) {
|
|
7428
7435
|
setValue(date);
|
|
@@ -7516,6 +7523,30 @@ function DropdownItem(props) {
|
|
|
7516
7523
|
}
|
|
7517
7524
|
var DropdownItem$1 = React$1.memo(DropdownItem);
|
|
7518
7525
|
|
|
7526
|
+
function useOutsideClick(refs, handler) {
|
|
7527
|
+
var handleClickOutside = React$1.useCallback(function (e) {
|
|
7528
|
+
if (refs && 'current' in refs && refs.current) {
|
|
7529
|
+
var isInside = Array.isArray(refs.current) ? refs.current.some(function (element) {
|
|
7530
|
+
return !!element && element.contains(e.target);
|
|
7531
|
+
}) : !!refs && !!refs.current && refs.current.contains(e.target);
|
|
7532
|
+
handler(isInside);
|
|
7533
|
+
} else {
|
|
7534
|
+
var _isInside = Array.isArray(refs) && refs.some(function (element) {
|
|
7535
|
+
return !!element && !!element.current && element.current.contains(e.target);
|
|
7536
|
+
});
|
|
7537
|
+
handler(_isInside);
|
|
7538
|
+
}
|
|
7539
|
+
}, [handler, refs]);
|
|
7540
|
+
React$1.useEffect(function () {
|
|
7541
|
+
document.addEventListener('mouseup', handleClickOutside);
|
|
7542
|
+
document.addEventListener('touchstart', handleClickOutside);
|
|
7543
|
+
return function () {
|
|
7544
|
+
document.removeEventListener('mouseup', handleClickOutside);
|
|
7545
|
+
document.removeEventListener('touchstart', handleClickOutside);
|
|
7546
|
+
};
|
|
7547
|
+
}, [refs, handler, handleClickOutside]);
|
|
7548
|
+
}
|
|
7549
|
+
|
|
7519
7550
|
var rootClassName$1Z = 'component-dropdown-menu';
|
|
7520
7551
|
function DropdownMenu(props) {
|
|
7521
7552
|
var id = React$1.useMemo(function () {
|
|
@@ -7524,6 +7555,7 @@ function DropdownMenu(props) {
|
|
|
7524
7555
|
var _useState = React$1.useState(null),
|
|
7525
7556
|
inter = _useState[0],
|
|
7526
7557
|
setInter = _useState[1];
|
|
7558
|
+
var panelRef = React$1.useRef(null);
|
|
7527
7559
|
var interRef = React$1.useRef(inter);
|
|
7528
7560
|
interRef.current = inter;
|
|
7529
7561
|
React$1.useEffect(function () {
|
|
@@ -7569,37 +7601,17 @@ function DropdownMenu(props) {
|
|
|
7569
7601
|
}
|
|
7570
7602
|
};
|
|
7571
7603
|
}, [props.opened]);
|
|
7604
|
+
useOutsideClick([panelRef], function (isInside) {
|
|
7605
|
+
if (props.closeOnOutClick && !isInside) {
|
|
7606
|
+
props.setOpened(false);
|
|
7607
|
+
}
|
|
7608
|
+
});
|
|
7572
7609
|
React$1.useEffect(function () {
|
|
7573
|
-
var onHandleClick = function onHandleClick(evt) {
|
|
7574
|
-
if (evt.path) {
|
|
7575
|
-
if (document.querySelector("#" + id + " ." + rootClassName$1Z + "-panel-fade-enter-done") && !evt.path.includes(document.querySelector("#" + id))) props.setOpened(false);
|
|
7576
|
-
} else {
|
|
7577
|
-
var aux = evt.target;
|
|
7578
|
-
var deveFechar = true;
|
|
7579
|
-
while (aux && aux.id !== 'root') {
|
|
7580
|
-
if (aux && aux.id && aux.id === id && aux.classList.contains(rootClassName$1Z)) {
|
|
7581
|
-
deveFechar = false;
|
|
7582
|
-
break;
|
|
7583
|
-
}
|
|
7584
|
-
aux = aux.parentElement;
|
|
7585
|
-
}
|
|
7586
|
-
if (deveFechar) {
|
|
7587
|
-
props.setOpened(false);
|
|
7588
|
-
}
|
|
7589
|
-
}
|
|
7590
|
-
};
|
|
7591
7610
|
var onEscPress = function onEscPress(evt) {
|
|
7592
7611
|
if (evt.key === 'Escape') {
|
|
7593
7612
|
props.setOpened(false);
|
|
7594
7613
|
}
|
|
7595
7614
|
};
|
|
7596
|
-
if (props.closeOnOutClick) {
|
|
7597
|
-
if (props.opened) {
|
|
7598
|
-
document.addEventListener('mousedown', onHandleClick);
|
|
7599
|
-
} else {
|
|
7600
|
-
document.removeEventListener('mousedown', onHandleClick);
|
|
7601
|
-
}
|
|
7602
|
-
}
|
|
7603
7615
|
if (props.closeOnEsc) {
|
|
7604
7616
|
if (props.opened) {
|
|
7605
7617
|
document.addEventListener('keyup', onEscPress);
|
|
@@ -7608,7 +7620,6 @@ function DropdownMenu(props) {
|
|
|
7608
7620
|
}
|
|
7609
7621
|
}
|
|
7610
7622
|
return function () {
|
|
7611
|
-
document.removeEventListener('click', onHandleClick);
|
|
7612
7623
|
document.removeEventListener('keyup', onEscPress);
|
|
7613
7624
|
};
|
|
7614
7625
|
}, [props.opened]);
|
|
@@ -7632,6 +7643,7 @@ function DropdownMenu(props) {
|
|
|
7632
7643
|
classNames: rootClassName$1Z + "-panel-fade",
|
|
7633
7644
|
unmountOnExit: true
|
|
7634
7645
|
}, React$1__default.createElement("div", {
|
|
7646
|
+
ref: panelRef,
|
|
7635
7647
|
className: rootClassName$1Z + "-panel scroll-white"
|
|
7636
7648
|
}, props.content)));
|
|
7637
7649
|
}
|
|
@@ -8017,7 +8029,7 @@ function FileUpload(props) {
|
|
|
8017
8029
|
if (props.allowedFileTypes && props.allowedFileTypes.length) {
|
|
8018
8030
|
if (props.allowedFileTypes.indexOf(extension) > -1) {
|
|
8019
8031
|
return true;
|
|
8020
|
-
} else if (props.allowedFileTypes.indexOf(exports.
|
|
8032
|
+
} else if (props.allowedFileTypes.indexOf(exports.FileTypes.ALL_IMAGES) > -1 && Object.values(exports.ImageTypes).indexOf(extension) > -1) {
|
|
8021
8033
|
return true;
|
|
8022
8034
|
} else {
|
|
8023
8035
|
return false;
|
|
@@ -9028,7 +9040,6 @@ function Paginator(props) {
|
|
|
9028
9040
|
}
|
|
9029
9041
|
setArrOfNumbers(arr);
|
|
9030
9042
|
}, [props.quantidadeDePaginas, props.maxLength, props.paginaAtual]);
|
|
9031
|
-
console.log(props.loading);
|
|
9032
9043
|
return React$1__default.createElement("div", {
|
|
9033
9044
|
id: props.id ? props.id : undefined,
|
|
9034
9045
|
className: getMergedClassNames([rootClassName$2i, props.className || ''])
|
|
@@ -9679,30 +9690,6 @@ function Chip(props) {
|
|
|
9679
9690
|
}
|
|
9680
9691
|
var Chip$1 = React$1.memo(Chip);
|
|
9681
9692
|
|
|
9682
|
-
function useOutsideClick(refs, handler) {
|
|
9683
|
-
var handleClickOutside = React$1.useCallback(function (e) {
|
|
9684
|
-
if (refs && 'current' in refs && refs.current) {
|
|
9685
|
-
var isInside = Array.isArray(refs.current) ? refs.current.some(function (element) {
|
|
9686
|
-
return !!element && element.contains(e.target);
|
|
9687
|
-
}) : !!refs && !!refs.current && refs.current.contains(e.target);
|
|
9688
|
-
handler(isInside);
|
|
9689
|
-
} else {
|
|
9690
|
-
var _isInside = Array.isArray(refs) && refs.some(function (element) {
|
|
9691
|
-
return !!element && !!element.current && element.current.contains(e.target);
|
|
9692
|
-
});
|
|
9693
|
-
handler(_isInside);
|
|
9694
|
-
}
|
|
9695
|
-
}, [handler, refs]);
|
|
9696
|
-
React$1.useEffect(function () {
|
|
9697
|
-
document.addEventListener('mouseup', handleClickOutside);
|
|
9698
|
-
document.addEventListener('touchstart', handleClickOutside);
|
|
9699
|
-
return function () {
|
|
9700
|
-
document.removeEventListener('mouseup', handleClickOutside);
|
|
9701
|
-
document.removeEventListener('touchstart', handleClickOutside);
|
|
9702
|
-
};
|
|
9703
|
-
}, [refs, handler, handleClickOutside]);
|
|
9704
|
-
}
|
|
9705
|
-
|
|
9706
9693
|
var rootClassName$2p = 'component-search';
|
|
9707
9694
|
function Search(props) {
|
|
9708
9695
|
var _wrapperRef$current;
|
|
@@ -11632,6 +11619,7 @@ Title.defaultProps = {};
|
|
|
11632
11619
|
ToastTypes["Default"] = "default";
|
|
11633
11620
|
ToastTypes["Success"] = "success";
|
|
11634
11621
|
ToastTypes["Error"] = "error";
|
|
11622
|
+
ToastTypes["Warning"] = "warning";
|
|
11635
11623
|
})(exports.ToastTypes || (exports.ToastTypes = {}));
|
|
11636
11624
|
|
|
11637
11625
|
var rootClassName$2G = 'component-toast';
|
|
@@ -44326,6 +44314,7 @@ DestructiveModal.defaultProps = {
|
|
|
44326
44314
|
(function (IconButtonType) {
|
|
44327
44315
|
IconButtonType["Primary"] = "primary";
|
|
44328
44316
|
IconButtonType["Secondary"] = "secondary";
|
|
44317
|
+
IconButtonType["Gray"] = "gray";
|
|
44329
44318
|
IconButtonType["Dark"] = "dark";
|
|
44330
44319
|
IconButtonType["Blue"] = "blue";
|
|
44331
44320
|
})(exports.IconButtonType || (exports.IconButtonType = {}));
|