@rolster/react-components 18.26.22 → 18.26.23

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/cjs/index.js CHANGED
@@ -3399,29 +3399,11 @@ function RlsFormNavigation({ onAutoClose, children, className, visible, rlsTheme
3399
3399
  return ReactDOM.createPortal(jsxRuntimeExports.jsxs("div", { className: classNameForm, "rls-theme": rlsTheme, children: [jsxRuntimeExports.jsx("div", { className: "rls-form-navigation__component", children: children }), jsxRuntimeExports.jsx("div", { className: "rls-form-navigation__backdrop", onClick: onClickBackdrop })] }), document.body);
3400
3400
  }
3401
3401
 
3402
- function usePortalController(component) {
3403
- const [children, setChildren] = require$$0.useState(component);
3404
- const [visible, setVisible] = require$$0.useState(false);
3405
- const open = require$$0.useCallback((children) => {
3406
- setVisible(true);
3407
- children && setChildren(children);
3408
- }, []);
3409
- const close = require$$0.useCallback(() => {
3410
- setVisible(false);
3411
- }, []);
3412
- return { children, close, open, visible };
3413
- }
3414
-
3415
- function useFormNavigationController(component) {
3416
- const portal = usePortalController(component);
3417
- const FormNavigation = require$$0.useMemo(() => {
3418
- return (jsxRuntimeExports.jsx(RlsFormNavigation, { visible: portal.visible, children: portal.children }));
3419
- }, [portal.children, portal.visible]);
3420
- return {
3421
- close: portal.close,
3422
- FormNavigation,
3423
- open: portal.open
3424
- };
3402
+ function useFormNavigationController(portal) {
3403
+ const FormNavigation = require$$0.useCallback(({ children }) => {
3404
+ return (jsxRuntimeExports.jsx(RlsFormNavigation, { visible: portal.visible, children: children }));
3405
+ }, [portal.visible]);
3406
+ return FormNavigation;
3425
3407
  }
3426
3408
 
3427
3409
  function useRelocationOnComponent({ container, element, onDrag }) {
@@ -3953,6 +3935,17 @@ function RlsApplication({ children }) {
3953
3935
  }, children: [jsxRuntimeExports.jsxs("div", { className: className, children: [children, RlsSnackbar] }), RlsConfirmation] }));
3954
3936
  }
3955
3937
 
3938
+ function usePortalController() {
3939
+ const [visible, setVisible] = require$$0.useState(false);
3940
+ const open = require$$0.useCallback(() => {
3941
+ setVisible(true);
3942
+ }, []);
3943
+ const close = require$$0.useCallback(() => {
3944
+ setVisible(false);
3945
+ }, []);
3946
+ return { close, open, visible };
3947
+ }
3948
+
3956
3949
  exports.ConfirmationResult = ConfirmationResult;
3957
3950
  exports.RlsAlert = RlsAlert;
3958
3951
  exports.RlsAmount = RlsAmount;
@@ -4052,6 +4045,7 @@ exports.useFormSingleSelectionController = useFormSingleSelectionController;
4052
4045
  exports.useFormToggleController = useFormToggleController;
4053
4046
  exports.useImageEditorController = useImageEditorController;
4054
4047
  exports.useListController = useListController;
4048
+ exports.usePortalController = usePortalController;
4055
4049
  exports.useRelocationOnComponent = useRelocationOnComponent;
4056
4050
  exports.useResize = useResize;
4057
4051
  exports.useSnackbar = useSnackbar;