@cloud-ru/ds-drawer 1.1.0 → 1.1.1-preview-6339d104.0
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/components/DrawerCustom/DrawerCustom.js +1 -1
- package/dist/cjs/components/DrawerCustom/constants.js +6 -2
- package/dist/cjs/components/DrawerCustom/hooks/useDrawerResize.js +5 -1
- package/dist/cjs/components/DrawerCustom/styles.module.css +123 -117
- package/dist/cjs/constants.d.ts +1 -1
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/style.css +123 -117
- package/dist/esm/components/DrawerCustom/DrawerCustom.js +1 -1
- package/dist/esm/components/DrawerCustom/constants.js +3 -2
- package/dist/esm/components/DrawerCustom/hooks/useDrawerResize.js +2 -1
- package/dist/esm/components/DrawerCustom/styles.module.css +123 -117
- package/dist/esm/constants.d.ts +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/style.css +123 -117
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/components/DrawerCustom/DrawerCustom.tsx +1 -1
- package/src/components/DrawerCustom/constants.ts +4 -2
- package/src/components/DrawerCustom/hooks/useDrawerResize.tsx +2 -1
- package/src/components/DrawerCustom/styles.module.scss +60 -42
- package/src/constants.ts +1 -1
|
@@ -59,7 +59,7 @@ function DrawerFrame(props) {
|
|
|
59
59
|
const resolvedContainer = container ?? (portalContextRef.current ? () => portalContextRef.current : undefined);
|
|
60
60
|
return ((0, jsx_runtime_1.jsx)(RcDrawer, { resizable: drawerResizable, panelRef: checkElement, mask: showBlackout, maskClosable: showBlackout, keyboard: showBlackout, "data-showblackout": showBlackout, open: open, onClose: onClose, push: push, getContainer: resolvedContainer, placement: position, destroyOnHidden: true, rootClassName: (0, classnames_1.default)(styles_module_scss_1.default.drawerRoot, rootClassName), style: drawerPanelStyle, classNames: {
|
|
61
61
|
section: (0, classnames_1.default)(styles_module_scss_1.default.drawer, className),
|
|
62
|
-
}, size: isPredefinedWidth ? 'null' : width, ...(0, utils_1.extractSupportProps)(rest), "data-content-wrapper": true, "data-position": position, "data-width": isPredefinedWidth ? width : undefined, "data-height-auto": heightAutoVertical ? true : undefined, "data-acrylic-appearance": 'neutral', "data-acrylic-level": '1Level', prefixCls:
|
|
62
|
+
}, size: isPredefinedWidth ? 'null' : width, ...(0, utils_1.extractSupportProps)(rest), "data-content-wrapper": true, "data-position": position, "data-width": isPredefinedWidth ? width : undefined, "data-height-auto": heightAutoVertical ? true : undefined, "data-acrylic-appearance": 'neutral', "data-acrylic-level": '1Level', prefixCls: styles_module_scss_1.default.prefixCls, ...(disableMotions ? {} : constants_2.motionProps), children: (0, jsx_runtime_1.jsxs)(react_remove_scroll_1.RemoveScroll, { enabled: showBlackout || outerScrollLock, removeScrollBar: false, ref: focusTrapRef, className: styles_module_scss_1.default.scrollLock, children: [showButtonClosed && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.showButtonClosedWrapper, children: (0, jsx_runtime_1.jsx)(popup_private_1.PopupCloseButton, { className: styles_module_scss_1.default.showButtonClosed, "aria-label": 'close drawer', "data-test-id": constants_1.TEST_IDS.closeButton, onClick: onClose }) })), (0, jsx_runtime_1.jsx)(bottom_sheet_1.OverlaySurfaceProvider, { surface: bottom_sheet_1.OVERLAY_SURFACE.Drawer, bodyHeightAuto: heightAutoVertical, children: children }), tooltip, nestedDrawer] }) }));
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Адаптивный low-level `DrawerCustom`: на `mobile` — `BottomSheetCustom`, иначе — `DrawerFrame`.
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.motionProps = exports.motion = exports.maskMotion = void 0;
|
|
7
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
4
8
|
exports.maskMotion = {
|
|
5
9
|
motionAppear: true,
|
|
6
|
-
motionName:
|
|
10
|
+
motionName: styles_module_scss_1.default.maskMotionName,
|
|
7
11
|
};
|
|
8
12
|
const motion = placement => ({
|
|
9
13
|
motionAppear: true,
|
|
10
14
|
motionDeadline: 300,
|
|
11
|
-
motionName:
|
|
15
|
+
motionName: `${styles_module_scss_1.default.panelMotionName}-${placement}`,
|
|
12
16
|
});
|
|
13
17
|
exports.motion = motion;
|
|
14
18
|
exports.motionProps = {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.useDrawerResize = useDrawerResize;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
8
|
const tooltip_1 = require("@cloud-ru/ds-tooltip");
|
|
6
9
|
const utils_1 = require("@cloud-ru/ds-utils");
|
|
7
10
|
const react_1 = require("react");
|
|
8
|
-
const
|
|
11
|
+
const styles_module_scss_1 = __importDefault(require('../styles.module.css'));
|
|
12
|
+
const DRAGGER_SELECTOR = `.${styles_module_scss_1.default.prefixCls}-resizable-dragger`;
|
|
9
13
|
function useDrawerResize({ position, resizable: resizableProp }) {
|
|
10
14
|
const targetRef = (0, react_1.useRef)(null);
|
|
11
15
|
const targetRefCallbackRef = (0, react_1.useRef)();
|