@carbonorm/carbonreact 4.0.24 → 4.0.25
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/OutsideClickHandler/OutsideClickHandler.d.ts +9 -0
- package/dist/index.cjs.js +24 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +25 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -2
- package/src/components/Errors/BackendThrowable.tsx +1 -1
- package/src/components/OutsideClickHandler/OutsideClickHandler.tsx +33 -0
- package/src/components/Popup/Popup.tsx +1 -1
- package/src/index.ts +2 -0
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import require$$0, { useRef,
|
|
1
|
+
import require$$0, { useRef, useEffect, useState, Component, createContext, lazy } from 'react';
|
|
2
2
|
import { useNavigate, HashRouter, MemoryRouter, BrowserRouter } from 'react-router-dom';
|
|
3
3
|
import { toast, ToastContainer } from 'react-toastify';
|
|
4
|
-
import OutsideClickHandler from 'react-outside-click-handler';
|
|
5
4
|
import { toastOptions, timeout, axiosInstance, isVerbose, checkAllRequestsComplete } from '@carbonorm/carbonnode';
|
|
6
5
|
import classNames from 'classnames';
|
|
7
6
|
import { faClose } from '@fortawesome/free-solid-svg-icons';
|
|
@@ -484,6 +483,29 @@ function hexToRgb (hex) {
|
|
|
484
483
|
|
|
485
484
|
var styles$1 = {"maintenanceHero":"C5KSPNF","httpStatusCode":"NhyRQts","centeredContainer":"nA4Uno6","errorTextGeneral":"yJAgaUs","errorKeys":"SRIoY4m","errorValues":"xQIsoNw","errorPre":"C6eWpJ3"};
|
|
486
485
|
|
|
486
|
+
function OutsideClickHandler({ onOutsideClick, children, disabled, useCapture }) {
|
|
487
|
+
const containerRef = useRef(null);
|
|
488
|
+
useEffect(() => {
|
|
489
|
+
if (disabled) {
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
function handle(event) {
|
|
493
|
+
const element = containerRef.current;
|
|
494
|
+
if (!element || element.contains(event.target)) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
onOutsideClick();
|
|
498
|
+
}
|
|
499
|
+
document.addEventListener('mousedown', handle, useCapture);
|
|
500
|
+
document.addEventListener('touchstart', handle, useCapture);
|
|
501
|
+
return () => {
|
|
502
|
+
document.removeEventListener('mousedown', handle, useCapture);
|
|
503
|
+
document.removeEventListener('touchstart', handle, useCapture);
|
|
504
|
+
};
|
|
505
|
+
}, [onOutsideClick, disabled, useCapture]);
|
|
506
|
+
return jsxRuntimeExports.jsx("div", { ref: containerRef, children: children });
|
|
507
|
+
}
|
|
508
|
+
|
|
487
509
|
var BackendThrowable = (props) => {
|
|
488
510
|
const { instance } = props;
|
|
489
511
|
const currentThrowable = instance.state.backendThrowable[0];
|
|
@@ -3845,5 +3867,5 @@ function useWindowDimensions() {
|
|
|
3845
3867
|
return windowDimensions;
|
|
3846
3868
|
}
|
|
3847
3869
|
|
|
3848
|
-
export { AccessDenied, Alert, BackendThrowable, C6, COLUMNS, CarbonReact, CarbonWebSocket, ErrorHttpCode, GlobalHistory, Loading, Nest, PageNotFound, Popup, TABLES, addAlert, addValidSQL$1 as addValidSQL, carbons, changed, comments, deleteRestfulObjectArrays, documentation, eRouterType, eUpdateInsertMethod, feature_group_references, features, getRootStyleValue, getStatefulObjectWithWhere, getStyles, globalNavigate, group_references, groups, hexToRgb, history_logs, initialCarbonReactState, initialRequiredCarbonORMState, initialRestfulObjectsState, initiateWebsocket, isEdgeBrowser, isJsonString, isProduction, location_references, locations, parseMultipleJson, photos, range, reports, ScrollIntoViewDirective as scrollIntoView, setCookies, setUrl, setupTests, toDataURL, updateRestfulObjectArrays, uploadImage, uploadImageChange, useEffectOnce, user_followers, user_groups, user_messages, user_sessions, user_tasks, users, ValidSQL as validSQL, watchInputElementChangeEvent, useWindowDimensions as windowDimensions, wp_commentmeta, wp_comments, wp_links, wp_options, wp_postmeta, wp_posts, wp_term_relationships, wp_term_taxonomy, wp_termmeta, wp_terms, wp_usermeta, wp_users };
|
|
3870
|
+
export { AccessDenied, Alert, BackendThrowable, C6, COLUMNS, CarbonReact, CarbonWebSocket, ErrorHttpCode, GlobalHistory, Loading, Nest, OutsideClickHandler, PageNotFound, Popup, TABLES, addAlert, addValidSQL$1 as addValidSQL, carbons, changed, comments, deleteRestfulObjectArrays, documentation, eRouterType, eUpdateInsertMethod, feature_group_references, features, getRootStyleValue, getStatefulObjectWithWhere, getStyles, globalNavigate, group_references, groups, hexToRgb, history_logs, initialCarbonReactState, initialRequiredCarbonORMState, initialRestfulObjectsState, initiateWebsocket, isEdgeBrowser, isJsonString, isProduction, location_references, locations, parseMultipleJson, photos, range, reports, ScrollIntoViewDirective as scrollIntoView, setCookies, setUrl, setupTests, toDataURL, updateRestfulObjectArrays, uploadImage, uploadImageChange, useEffectOnce, user_followers, user_groups, user_messages, user_sessions, user_tasks, users, ValidSQL as validSQL, watchInputElementChangeEvent, useWindowDimensions as windowDimensions, wp_commentmeta, wp_comments, wp_links, wp_options, wp_postmeta, wp_posts, wp_term_relationships, wp_term_taxonomy, wp_termmeta, wp_terms, wp_usermeta, wp_users };
|
|
3849
3871
|
//# sourceMappingURL=index.esm.js.map
|