@porsche-design-system/components-react
Version:
Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.
29 lines (25 loc) • 1.74 kB
JavaScript
;
var jsxRuntime = require('react/jsx-runtime');
var splitChildren = require('../../splitChildren.cjs');
var react = require('react');
var minifyCss = require('../../minifyCss.cjs');
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
/**
* @slot {"name": "", "description": "Default slot for the scroller content." }
*/
class DSRScroller extends react.Component {
host;
isIndicatorPrevVisible = false;
isIndicatorNextVisible = false;
intersectionObserver;
scrollArea;
sentinelLeft;
sentinelRight;
render() {
splitChildren.splitChildren(this.props.children);
const style = minifyCss.minifyCss(stylesEntry.getScrollerCss(this.props.isIndicatorPrevVisible, this.props.isIndicatorNextVisible, this.props.sticky, this.props.scrollbar, this.props.compact));
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx("span", { className: "prev" }), jsxRuntime.jsx("span", { className: "next" }), jsxRuntime.jsxs("div", { className: "scroll", ...utilsEntry.parseAndGetAriaAttributes(this.props.aria), tabIndex: this.props.isIndicatorPrevVisible || this.props.isIndicatorNextVisible ? 0 : null, children: [jsxRuntime.jsx("span", { className: "sentinel" }), jsxRuntime.jsx("slot", {}), jsxRuntime.jsx("span", { className: "sentinel" })] })] })] }), this.props.children] }));
}
}
exports.DSRScroller = DSRScroller;