plataforma-fundacao-componentes 2.25.8 → 2.25.10
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/checkbox/Checkbox.d.ts +1 -0
- package/dist/components/datePicker/components/datePickerCalendar/DatePickerCalendar.d.ts +1 -0
- package/dist/components/dropdownMenu/DropdownMenu.d.ts +5 -7
- package/dist/components/fileUpload/FileUpload.d.ts +2 -2
- package/dist/components/table/components/TableUpperHeader/TableUpperHeader.d.ts +1 -1
- package/dist/hooks/useOutsideClick/useOutsideClick.d.ts +3 -1
- package/dist/index.css +79 -79
- package/dist/index.d.ts +1 -1
- package/dist/index.js +116 -118
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +119 -121
- 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/package.json +1 -1
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,14 +7523,54 @@ function DropdownItem(props) {
|
|
|
7516
7523
|
}
|
|
7517
7524
|
var DropdownItem$1 = React$1.memo(DropdownItem);
|
|
7518
7525
|
|
|
7526
|
+
function useOutsideClick(refs, handler, options) {
|
|
7527
|
+
var _options3;
|
|
7528
|
+
if (options === void 0) {
|
|
7529
|
+
options = {
|
|
7530
|
+
events: ['mouseup', 'touchstart']
|
|
7531
|
+
};
|
|
7532
|
+
}
|
|
7533
|
+
var handleClickOutside = React$1.useCallback(function (e) {
|
|
7534
|
+
var isInside = refs.some(function (r) {
|
|
7535
|
+
return (r === null || r === void 0 ? void 0 : r.current) && r.current.contains(e.target);
|
|
7536
|
+
});
|
|
7537
|
+
handler(isInside);
|
|
7538
|
+
}, [handler, refs]);
|
|
7539
|
+
React$1.useEffect(function () {
|
|
7540
|
+
var _options;
|
|
7541
|
+
(_options = options) === null || _options === void 0 ? void 0 : _options.events.forEach(function (evt) {
|
|
7542
|
+
document.addEventListener(evt, handleClickOutside);
|
|
7543
|
+
});
|
|
7544
|
+
return function () {
|
|
7545
|
+
var _options2;
|
|
7546
|
+
(_options2 = options) === null || _options2 === void 0 ? void 0 : _options2.events.forEach(function (evt) {
|
|
7547
|
+
document.removeEventListener(evt, handleClickOutside);
|
|
7548
|
+
});
|
|
7549
|
+
};
|
|
7550
|
+
}, [refs, handler, handleClickOutside, (_options3 = options) === null || _options3 === void 0 ? void 0 : _options3.events]);
|
|
7551
|
+
}
|
|
7552
|
+
|
|
7553
|
+
var _excluded = ["opened", "setOpened", "content", "closeOnEsc", "closeOnOutClick", "children", "panelProps"];
|
|
7519
7554
|
var rootClassName$1Z = 'component-dropdown-menu';
|
|
7520
|
-
function DropdownMenu(
|
|
7555
|
+
function DropdownMenu(_ref) {
|
|
7556
|
+
var _panelProps$className;
|
|
7557
|
+
var opened = _ref.opened,
|
|
7558
|
+
setOpened = _ref.setOpened,
|
|
7559
|
+
content = _ref.content,
|
|
7560
|
+
closeOnEsc = _ref.closeOnEsc,
|
|
7561
|
+
closeOnOutClick = _ref.closeOnOutClick,
|
|
7562
|
+
children = _ref.children,
|
|
7563
|
+
_ref$panelProps = _ref.panelProps,
|
|
7564
|
+
panelProps = _ref$panelProps === void 0 ? {} : _ref$panelProps,
|
|
7565
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
7521
7566
|
var id = React$1.useMemo(function () {
|
|
7522
7567
|
return props.id ? props.id : getUniqueKey();
|
|
7523
7568
|
}, [props.id]);
|
|
7524
7569
|
var _useState = React$1.useState(null),
|
|
7525
7570
|
inter = _useState[0],
|
|
7526
7571
|
setInter = _useState[1];
|
|
7572
|
+
var wrapperRef = React$1.createRef();
|
|
7573
|
+
var panelRef = React$1.createRef();
|
|
7527
7574
|
var interRef = React$1.useRef(inter);
|
|
7528
7575
|
interRef.current = inter;
|
|
7529
7576
|
React$1.useEffect(function () {
|
|
@@ -7557,7 +7604,7 @@ function DropdownMenu(props) {
|
|
|
7557
7604
|
}
|
|
7558
7605
|
}
|
|
7559
7606
|
};
|
|
7560
|
-
if (
|
|
7607
|
+
if (opened) {
|
|
7561
7608
|
position();
|
|
7562
7609
|
var _inter = setInterval(position, 100);
|
|
7563
7610
|
setInter(_inter);
|
|
@@ -7568,72 +7615,46 @@ function DropdownMenu(props) {
|
|
|
7568
7615
|
setInter(null);
|
|
7569
7616
|
}
|
|
7570
7617
|
};
|
|
7571
|
-
}, [
|
|
7618
|
+
}, [opened]);
|
|
7619
|
+
useOutsideClick([wrapperRef], function (isInside) {
|
|
7620
|
+
if (closeOnOutClick && !isInside) {
|
|
7621
|
+
setOpened(false);
|
|
7622
|
+
}
|
|
7623
|
+
});
|
|
7572
7624
|
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
7625
|
var onEscPress = function onEscPress(evt) {
|
|
7592
7626
|
if (evt.key === 'Escape') {
|
|
7593
|
-
|
|
7627
|
+
setOpened(false);
|
|
7594
7628
|
}
|
|
7595
7629
|
};
|
|
7596
|
-
if (
|
|
7597
|
-
if (
|
|
7598
|
-
document.addEventListener('mousedown', onHandleClick);
|
|
7599
|
-
} else {
|
|
7600
|
-
document.removeEventListener('mousedown', onHandleClick);
|
|
7601
|
-
}
|
|
7602
|
-
}
|
|
7603
|
-
if (props.closeOnEsc) {
|
|
7604
|
-
if (props.opened) {
|
|
7630
|
+
if (closeOnEsc) {
|
|
7631
|
+
if (opened) {
|
|
7605
7632
|
document.addEventListener('keyup', onEscPress);
|
|
7606
7633
|
} else {
|
|
7607
7634
|
document.removeEventListener('keyup', onEscPress);
|
|
7608
7635
|
}
|
|
7609
7636
|
}
|
|
7610
7637
|
return function () {
|
|
7611
|
-
document.removeEventListener('click', onHandleClick);
|
|
7612
7638
|
document.removeEventListener('keyup', onEscPress);
|
|
7613
7639
|
};
|
|
7614
|
-
}, [
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
delete p.setOpened;
|
|
7622
|
-
delete p.content;
|
|
7623
|
-
delete p.closeOnOutClick;
|
|
7624
|
-
delete p.closeOnEsc;
|
|
7625
|
-
return p;
|
|
7626
|
-
};
|
|
7627
|
-
return React$1__default.createElement("div", Object.assign({}, getProps()), React$1__default.createElement("div", {
|
|
7640
|
+
}, [opened]);
|
|
7641
|
+
return React$1__default.createElement("div", Object.assign({
|
|
7642
|
+
ref: wrapperRef
|
|
7643
|
+
}, props, {
|
|
7644
|
+
id: id,
|
|
7645
|
+
className: [rootClassName$1Z, props.className || ''].join(' ')
|
|
7646
|
+
}), React$1__default.createElement("div", {
|
|
7628
7647
|
className: rootClassName$1Z + "-children"
|
|
7629
|
-
},
|
|
7630
|
-
"in":
|
|
7648
|
+
}, children), React$1__default.createElement(reactTransitionGroup.CSSTransition, {
|
|
7649
|
+
"in": opened,
|
|
7631
7650
|
timeout: 300,
|
|
7632
7651
|
classNames: rootClassName$1Z + "-panel-fade",
|
|
7633
7652
|
unmountOnExit: true
|
|
7634
|
-
}, React$1__default.createElement("div", {
|
|
7635
|
-
|
|
7636
|
-
},
|
|
7653
|
+
}, React$1__default.createElement("div", Object.assign({
|
|
7654
|
+
ref: panelRef
|
|
7655
|
+
}, panelProps, {
|
|
7656
|
+
className: [rootClassName$1Z + "-panel scroll-white", (_panelProps$className = panelProps === null || panelProps === void 0 ? void 0 : panelProps.className) != null ? _panelProps$className : ''].join(' ')
|
|
7657
|
+
}), content)));
|
|
7637
7658
|
}
|
|
7638
7659
|
DropdownMenu.defaultProps = {
|
|
7639
7660
|
closeOnOutClick: true,
|
|
@@ -8017,7 +8038,7 @@ function FileUpload(props) {
|
|
|
8017
8038
|
if (props.allowedFileTypes && props.allowedFileTypes.length) {
|
|
8018
8039
|
if (props.allowedFileTypes.indexOf(extension) > -1) {
|
|
8019
8040
|
return true;
|
|
8020
|
-
} else if (props.allowedFileTypes.indexOf(exports.
|
|
8041
|
+
} else if (props.allowedFileTypes.indexOf(exports.FileTypes.ALL_IMAGES) > -1 && Object.values(exports.ImageTypes).indexOf(extension) > -1) {
|
|
8021
8042
|
return true;
|
|
8022
8043
|
} else {
|
|
8023
8044
|
return false;
|
|
@@ -9080,7 +9101,7 @@ function Paginator(props) {
|
|
|
9080
9101
|
}
|
|
9081
9102
|
Paginator.defaultProps = {};
|
|
9082
9103
|
|
|
9083
|
-
var _excluded = ["boundaryCount", "count", "currentPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "siblingCount", "maxLength"];
|
|
9104
|
+
var _excluded$1 = ["boundaryCount", "count", "currentPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "siblingCount", "maxLength"];
|
|
9084
9105
|
function usePagination(props) {
|
|
9085
9106
|
if (props === void 0) {
|
|
9086
9107
|
props = {};
|
|
@@ -9103,7 +9124,7 @@ function usePagination(props) {
|
|
|
9103
9124
|
_props$siblingCount = _props.siblingCount,
|
|
9104
9125
|
siblingCount = _props$siblingCount === void 0 ? 1 : _props$siblingCount,
|
|
9105
9126
|
maxLength = _props.maxLength,
|
|
9106
|
-
other = _objectWithoutPropertiesLoose(_props, _excluded);
|
|
9127
|
+
other = _objectWithoutPropertiesLoose(_props, _excluded$1);
|
|
9107
9128
|
var isControlledRef = React$1.useRef(pageProp !== undefined);
|
|
9108
9129
|
var _useState = React$1.useState(currentPage),
|
|
9109
9130
|
pageCurrent = _useState[0],
|
|
@@ -9242,7 +9263,7 @@ function useScreenSize() {
|
|
|
9242
9263
|
return value;
|
|
9243
9264
|
}
|
|
9244
9265
|
|
|
9245
|
-
var _excluded$
|
|
9266
|
+
var _excluded$2 = ["page", "type", "selected"];
|
|
9246
9267
|
var rootClassName$2k = 'pagination-component';
|
|
9247
9268
|
var Pagination = function Pagination(props) {
|
|
9248
9269
|
var screenSize = useScreenSize();
|
|
@@ -9366,7 +9387,7 @@ var Pagination = function Pagination(props) {
|
|
|
9366
9387
|
var page = _ref2.page,
|
|
9367
9388
|
type = _ref2.type,
|
|
9368
9389
|
selected = _ref2.selected,
|
|
9369
|
-
item = _objectWithoutPropertiesLoose(_ref2, _excluded$
|
|
9390
|
+
item = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
|
|
9370
9391
|
var children = null;
|
|
9371
9392
|
if (type === 'start-ellipsis' || type === 'end-ellipsis') {
|
|
9372
9393
|
children = React$1__default.createElement("li", {
|
|
@@ -9678,30 +9699,6 @@ function Chip(props) {
|
|
|
9678
9699
|
}
|
|
9679
9700
|
var Chip$1 = React$1.memo(Chip);
|
|
9680
9701
|
|
|
9681
|
-
function useOutsideClick(refs, handler) {
|
|
9682
|
-
var handleClickOutside = React$1.useCallback(function (e) {
|
|
9683
|
-
if (refs && 'current' in refs && refs.current) {
|
|
9684
|
-
var isInside = Array.isArray(refs.current) ? refs.current.some(function (element) {
|
|
9685
|
-
return !!element && element.contains(e.target);
|
|
9686
|
-
}) : !!refs && !!refs.current && refs.current.contains(e.target);
|
|
9687
|
-
handler(isInside);
|
|
9688
|
-
} else {
|
|
9689
|
-
var _isInside = Array.isArray(refs) && refs.some(function (element) {
|
|
9690
|
-
return !!element && !!element.current && element.current.contains(e.target);
|
|
9691
|
-
});
|
|
9692
|
-
handler(_isInside);
|
|
9693
|
-
}
|
|
9694
|
-
}, [handler, refs]);
|
|
9695
|
-
React$1.useEffect(function () {
|
|
9696
|
-
document.addEventListener('mouseup', handleClickOutside);
|
|
9697
|
-
document.addEventListener('touchstart', handleClickOutside);
|
|
9698
|
-
return function () {
|
|
9699
|
-
document.removeEventListener('mouseup', handleClickOutside);
|
|
9700
|
-
document.removeEventListener('touchstart', handleClickOutside);
|
|
9701
|
-
};
|
|
9702
|
-
}, [refs, handler, handleClickOutside]);
|
|
9703
|
-
}
|
|
9704
|
-
|
|
9705
9702
|
var rootClassName$2p = 'component-search';
|
|
9706
9703
|
function Search(props) {
|
|
9707
9704
|
var _wrapperRef$current;
|
|
@@ -9724,11 +9721,11 @@ function Search(props) {
|
|
|
9724
9721
|
var _useState7 = React$1.useState(false),
|
|
9725
9722
|
showResults = _useState7[0],
|
|
9726
9723
|
setShowResults = _useState7[1];
|
|
9727
|
-
var wrapperRef = React$1.
|
|
9724
|
+
var wrapperRef = React$1.createRef();
|
|
9728
9725
|
var handleClickOutside = function handleClickOutside(e) {
|
|
9729
9726
|
if (!e) setShowResults(false);
|
|
9730
9727
|
};
|
|
9731
|
-
useOutsideClick(wrapperRef, handleClickOutside);
|
|
9728
|
+
useOutsideClick([wrapperRef], handleClickOutside);
|
|
9732
9729
|
var onEsc = function onEsc(evt) {
|
|
9733
9730
|
if (evt.key === 'Escape') {
|
|
9734
9731
|
setShowResults(false);
|
|
@@ -11161,13 +11158,13 @@ TextEditorColorPicker.defaultProps = {
|
|
|
11161
11158
|
onChange: function onChange() {}
|
|
11162
11159
|
};
|
|
11163
11160
|
|
|
11164
|
-
var _excluded$
|
|
11161
|
+
var _excluded$3 = ["icon", "active"];
|
|
11165
11162
|
var rootClassName$2B = 'text-editor-header-button';
|
|
11166
11163
|
function TextEditorHeaderButton(_ref) {
|
|
11167
11164
|
var _props$className;
|
|
11168
11165
|
var icon = _ref.icon,
|
|
11169
11166
|
active = _ref.active,
|
|
11170
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
11167
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
11171
11168
|
return React$1__default.createElement("button", Object.assign({
|
|
11172
11169
|
className: getMergedClassNames([rootClassName$2B, active ? 'active' : '', (_props$className = props.className) != null ? _props$className : ''])
|
|
11173
11170
|
}, props), icon);
|
|
@@ -44326,6 +44323,7 @@ DestructiveModal.defaultProps = {
|
|
|
44326
44323
|
(function (IconButtonType) {
|
|
44327
44324
|
IconButtonType["Primary"] = "primary";
|
|
44328
44325
|
IconButtonType["Secondary"] = "secondary";
|
|
44326
|
+
IconButtonType["Gray"] = "gray";
|
|
44329
44327
|
IconButtonType["Dark"] = "dark";
|
|
44330
44328
|
IconButtonType["Blue"] = "blue";
|
|
44331
44329
|
})(exports.IconButtonType || (exports.IconButtonType = {}));
|