Comparing version 1.0.51 to 1.0.52
declare module '*.png'; | ||
declare module '*.css'; | ||
declare module 'react-custom-scrollbars'; |
@@ -10,4 +10,2 @@ "use strict"; | ||
var _tslib = require("tslib"); | ||
var React = _interopRequireWildcard(require("react")); | ||
@@ -17,2 +15,8 @@ | ||
var _reactCustomScrollbars = require("react-custom-scrollbars"); | ||
var _Div = _interopRequireDefault(require("../../tags/container/Div")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
@@ -23,6 +27,21 @@ | ||
var ASScrollView = React.forwardRef(function (props, forwardedRef) { | ||
var _a; | ||
var extraProps = (0, _useParseProps.useParseProps)('scrollable', props); | ||
return React.createElement("div", (0, _tslib.__assign)({ | ||
ref: forwardedRef | ||
}, extraProps)); | ||
return React.createElement(React.Fragment, null, (props === null || props === void 0 ? void 0 : props.stickyHeaderIndices) && // @ts-ignore | ||
React.createElement("style", { | ||
jsx: true | ||
}, (_a = props === null || props === void 0 ? void 0 : props.stickyHeaderIndices) === null || _a === void 0 ? void 0 : _a.map(function (ix) { | ||
return "\n #" + props.id + ">div:nth-child(" + (ix + 1) + ") {\n position: sticky;\n position: -webkit-sticky;\n top: 0;\n max-height: 100vh;\n }\n "; | ||
})), React.createElement(_reactCustomScrollbars.Scrollbars, { | ||
ref: forwardedRef, | ||
universal: true, | ||
autohide: true, | ||
autoHeightMin: 50, | ||
autoHeightMax: 500 | ||
}, React.createElement(_Div.default, { | ||
id: props.id, | ||
className: extraProps === null || extraProps === void 0 ? void 0 : extraProps.contentContainerClassName, | ||
style: extraProps === null || extraProps === void 0 ? void 0 : extraProps.contentContainerStyle | ||
}, props.children))); | ||
}); | ||
@@ -29,0 +48,0 @@ ASScrollView.displayName = 'ScrollView'; |
@@ -21,4 +21,7 @@ import { ReactNode } from 'react'; | ||
export interface ScrollableProps extends ViewProps { | ||
id?: string; | ||
contentContainerClassName?: string; | ||
contentContainerStyle?: any; | ||
stickyHeaderIndices?: number[]; | ||
horizontal?: boolean; | ||
} |
{ | ||
"name": "actbase", | ||
"version": "1.0.51", | ||
"version": "1.0.52", | ||
"description": "React-Native Design Components", | ||
@@ -40,3 +40,4 @@ "main": "lib/index.js", | ||
"lodash": "^4.17.15", | ||
"prop-types": "^15.7.2" | ||
"prop-types": "^15.7.2", | ||
"react-custom-scrollbars": "^4.2.1" | ||
}, | ||
@@ -43,0 +44,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
289779
5803
9
+ Addedadd-px-to-style@1.0.0(transitive)
+ Addeddom-css@2.1.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedprefix-style@2.0.1(transitive)
+ Addedraf@3.4.1(transitive)
+ Addedreact@16.14.0(transitive)
+ Addedreact-custom-scrollbars@4.2.1(transitive)
+ Addedreact-dom@16.14.0(transitive)
+ Addedscheduler@0.19.1(transitive)
+ Addedto-camel-case@1.0.0(transitive)
+ Addedto-no-case@1.0.2(transitive)
+ Addedto-space-case@1.0.0(transitive)