@itcase/ui 1.8.163 → 1.8.164

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.
@@ -22,14 +22,16 @@ require('../hooks/useStyles/styleAttributes.js');
22
22
  require('lodash/maxBy');
23
23
 
24
24
  function ScrollOnDrag(props) {
25
- const { className, scrollContainerProps, children, isScrollbar } = props;
25
+ const { className, scrollContainerProps, isScrollbar, children } = props;
26
26
  const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
27
27
  const { ref } = ScrollContainer.useScrollContainer();
28
28
  const { fillClass, fillHoverClass, borderColorClass, borderTypeClass, borderWidthClass, elevationClass, heightClass, widthClass = 'fill', } = propsGenerator;
29
29
  // @ts-expect-error
30
30
  const { scrollContainer: scrollContainerStyles, styles: styles } = useStyles.useStyles(props);
31
31
  const ScrollOnDragWrapper = isScrollbar ? SimpleBar : React.Fragment;
32
- return (jsxRuntime.jsx(ScrollOnDragWrapper, { scrollableNodeProps: { ref }, children: jsxRuntime.jsx("div", { className: clsx('scroll-on-drag', className, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, borderWidthClass && `border-width_${borderWidthClass}`, elevationClass && `elevation_${elevationClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, heightClass && `height_${heightClass}`, widthClass && `width_${widthClass}`), style: styles, children: jsxRuntime.jsx(ScrollContainer, { className: clsx(!isScrollbar && 'scroll-on-drag__wrapper'), ref: ref, ...scrollContainerProps, style: scrollContainerStyles, children: children }) }) }));
32
+ // fix to error 'Invalid prop `scrollableNodeProps` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.'
33
+ const fixedProps = isScrollbar ? { scrollableNodeProps: { ref } } : {};
34
+ return (jsxRuntime.jsx(ScrollOnDragWrapper, { ...fixedProps, children: jsxRuntime.jsx("div", { className: clsx('scroll-on-drag', className, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, borderWidthClass && `border-width_${borderWidthClass}`, elevationClass && `elevation_${elevationClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, heightClass && `height_${heightClass}`, widthClass && `width_${widthClass}`), style: styles, children: jsxRuntime.jsx(ScrollContainer, { className: clsx(!isScrollbar && 'scroll-on-drag__wrapper'), ref: ref, ...scrollContainerProps, style: scrollContainerStyles, children: children }) }) }));
33
35
  }
34
36
 
35
37
  exports.ScrollOnDrag = ScrollOnDrag;
@@ -20,14 +20,16 @@ import '../hooks/useStyles/styleAttributes.js';
20
20
  import 'lodash/maxBy';
21
21
 
22
22
  function ScrollOnDrag(props) {
23
- const { className, scrollContainerProps, children, isScrollbar } = props;
23
+ const { className, scrollContainerProps, isScrollbar, children } = props;
24
24
  const propsGenerator = useDevicePropsGenerator(props);
25
25
  const { ref } = useScrollContainer();
26
26
  const { fillClass, fillHoverClass, borderColorClass, borderTypeClass, borderWidthClass, elevationClass, heightClass, widthClass = 'fill', } = propsGenerator;
27
27
  // @ts-expect-error
28
28
  const { scrollContainer: scrollContainerStyles, styles: styles } = useStyles(props);
29
29
  const ScrollOnDragWrapper = isScrollbar ? SimpleBar : React.Fragment;
30
- return (jsx(ScrollOnDragWrapper, { scrollableNodeProps: { ref }, children: jsx("div", { className: clsx('scroll-on-drag', className, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, borderWidthClass && `border-width_${borderWidthClass}`, elevationClass && `elevation_${elevationClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, heightClass && `height_${heightClass}`, widthClass && `width_${widthClass}`), style: styles, children: jsx(ScrollContainer, { className: clsx(!isScrollbar && 'scroll-on-drag__wrapper'), ref: ref, ...scrollContainerProps, style: scrollContainerStyles, children: children }) }) }));
30
+ // fix to error 'Invalid prop `scrollableNodeProps` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.'
31
+ const fixedProps = isScrollbar ? { scrollableNodeProps: { ref } } : {};
32
+ return (jsx(ScrollOnDragWrapper, { ...fixedProps, children: jsx("div", { className: clsx('scroll-on-drag', className, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, borderWidthClass && `border-width_${borderWidthClass}`, elevationClass && `elevation_${elevationClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, heightClass && `height_${heightClass}`, widthClass && `width_${widthClass}`), style: styles, children: jsx(ScrollContainer, { className: clsx(!isScrollbar && 'scroll-on-drag__wrapper'), ref: ref, ...scrollContainerProps, style: scrollContainerStyles, children: children }) }) }));
31
33
  }
32
34
 
33
35
  export { ScrollOnDrag };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/ui",
3
- "version": "1.8.163",
3
+ "version": "1.8.164",
4
4
  "description": "UI components (Modal, Loader, Popup, etc)",
5
5
  "keywords": [
6
6
  "Modal",