@pallasoft/ps-core-components 2.51.0 → 2.51.1
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.
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PsSplitView = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ps_split_view_config_1 = require("../constants/ps-split-view-config");
|
|
5
6
|
const use_ps_fill_height_1 = require("../hooks/use-ps-fill-height");
|
|
7
|
+
const use_ps_media_query_1 = require("../hooks/use-ps-media-query");
|
|
8
|
+
const use_ps_scroll_lock_1 = require("../hooks/use-ps-scroll-lock");
|
|
6
9
|
const PsSplitView = ({ detail, list }) => {
|
|
7
10
|
const isSplit = detail !== null && detail !== undefined && detail !== false;
|
|
8
11
|
const { height, ref } = (0, use_ps_fill_height_1.usePsFillHeight)(isSplit);
|
|
12
|
+
const isWide = (0, use_ps_media_query_1.usePsMediaQuery)(ps_split_view_config_1.PsSplitViewConfig.wideQuery) === true;
|
|
13
|
+
(0, use_ps_scroll_lock_1.usePsScrollLock)(isSplit && isWide);
|
|
9
14
|
if (!isSplit)
|
|
10
15
|
return (0, jsx_runtime_1.jsx)("div", { className: 'min-w-0', children: list });
|
|
11
16
|
return ((0, jsx_runtime_1.jsxs)("div", { className: 'min-w-0 xl:grid xl:h-[var(--ps-split-height,calc(100dvh-14rem))] xl:grid-cols-[minmax(0,1fr)_minmax(26rem,34rem)] xl:gap-4', ref: ref, style: height === null ? undefined : { '--ps-split-height': `${height}px` }, children: [(0, jsx_runtime_1.jsx)("div", { className: 'ps-scrollbar-hidden min-h-0 min-w-0 xl:overflow-y-auto', children: list }), (0, jsx_runtime_1.jsx)("div", { className: 'hidden min-h-0 min-w-0 xl:block', children: detail })] }));
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PsSplitViewConfig } from '../constants/ps-split-view-config.js';
|
|
2
3
|
import { usePsFillHeight } from '../hooks/use-ps-fill-height.js';
|
|
4
|
+
import { usePsMediaQuery } from '../hooks/use-ps-media-query.js';
|
|
5
|
+
import { usePsScrollLock } from '../hooks/use-ps-scroll-lock.js';
|
|
3
6
|
export const PsSplitView = ({ detail, list }) => {
|
|
4
7
|
const isSplit = detail !== null && detail !== undefined && detail !== false;
|
|
5
8
|
const { height, ref } = usePsFillHeight(isSplit);
|
|
9
|
+
const isWide = usePsMediaQuery(PsSplitViewConfig.wideQuery) === true;
|
|
10
|
+
usePsScrollLock(isSplit && isWide);
|
|
6
11
|
if (!isSplit)
|
|
7
12
|
return _jsx("div", { className: 'min-w-0', children: list });
|
|
8
13
|
return (_jsxs("div", { className: 'min-w-0 xl:grid xl:h-[var(--ps-split-height,calc(100dvh-14rem))] xl:grid-cols-[minmax(0,1fr)_minmax(26rem,34rem)] xl:gap-4', ref: ref, style: height === null ? undefined : { '--ps-split-height': `${height}px` }, children: [_jsx("div", { className: 'ps-scrollbar-hidden min-h-0 min-w-0 xl:overflow-y-auto', children: list }), _jsx("div", { className: 'hidden min-h-0 min-w-0 xl:block', children: detail })] }));
|