@canlooks/can-ui 0.0.86 → 0.0.88

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.
@@ -63,14 +63,6 @@ function Dialog({ icon, title, footer, prefix, suffix, width = 420, minWidth, ma
63
63
  el.dataset.borderBottom = (el.scrollHeight - el.clientHeight > el.scrollTop).toString();
64
64
  }
65
65
  };
66
- (0, react_1.useEffect)(() => {
67
- if (scrollBehavior === 'card') {
68
- bodyRef.current.addEventListener('scroll', onScroll);
69
- return () => {
70
- bodyRef.current.removeEventListener('scroll', onScroll);
71
- };
72
- }
73
- }, [scrollBehavior]);
74
66
  (0, react_1.useEffect)(() => {
75
67
  if (scrollBehavior !== 'card') {
76
68
  return;
@@ -117,7 +109,7 @@ function Dialog({ icon, title, footer, prefix, suffix, width = 420, minWidth, ma
117
109
  return ((0, jsx_runtime_1.jsx)(modal_1.Modal, { ...props, ref: (0, utils_1.cloneRef)(overlayRef, props.ref), css: dialog_style_1.style, className: (0, utils_1.clsx)(dialog_style_1.classes.root, props.className), open: innerOpen.current, "data-scroll-behavior": scrollBehavior, "data-draggable": draggable, children: (0, jsx_runtime_1.jsx)("div", { ref: containerRef, className: dialog_style_1.classes.container, onClick: onMaskClick, children: (0, jsx_runtime_1.jsx)(draggable_1.Draggable, { container: () => overlayRef.current, children: (targetProps, handleProps) => (0, jsx_runtime_1.jsxs)("div", { ref: cardRef, className: dialog_style_1.classes.card, ...targetProps, style: { width, minWidth, maxWidth, ...targetProps.style }, children: [!!icon &&
118
110
  (0, jsx_runtime_1.jsx)("div", { className: dialog_style_1.classes.icon, children: icon }), (0, jsx_runtime_1.jsxs)("div", { className: dialog_style_1.classes.content, children: [!!(title || showClose) &&
119
111
  (0, jsx_runtime_1.jsxs)("div", { className: dialog_style_1.classes.titleRow, ...handleProps, children: [(0, jsx_runtime_1.jsx)("div", { className: dialog_style_1.classes.title, children: title }), showClose &&
120
- (0, jsx_runtime_1.jsx)(button_1.Button, { shape: "circular", variant: "text", color: "text.secondary", ...closeProps, className: (0, utils_1.clsx)(dialog_style_1.classes.close, closeProps?.className), onClick: closeHandler, children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faXmark_1.faXmark }) })] }), (0, jsx_runtime_1.jsxs)("div", { ref: bodyRef, className: dialog_style_1.classes.body, children: [!!prefix &&
112
+ (0, jsx_runtime_1.jsx)(button_1.Button, { shape: "circular", variant: "text", color: "text.secondary", ...closeProps, className: (0, utils_1.clsx)(dialog_style_1.classes.close, closeProps?.className), onClick: closeHandler, children: (0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: faXmark_1.faXmark }) })] }), (0, jsx_runtime_1.jsxs)("div", { ref: bodyRef, className: dialog_style_1.classes.body, onScroll: scrollBehavior === 'card' ? onScroll : void 0, children: [!!prefix &&
121
113
  (0, jsx_runtime_1.jsx)("div", { className: dialog_style_1.classes.prefix, children: prefix }), (0, jsx_runtime_1.jsx)("div", { ref: bodyWrapRef, className: dialog_style_1.classes.bodyWrap, children: props.children }), !!suffix &&
122
114
  (0, jsx_runtime_1.jsx)("div", { className: dialog_style_1.classes.suffix, children: suffix })] }), (typeof footer === 'undefined' || !!footer) &&
123
115
  (0, jsx_runtime_1.jsx)("div", { className: dialog_style_1.classes.footer, children: renderFooter() })] })] }) }) }) }));
@@ -60,14 +60,6 @@ export function Dialog({ icon, title, footer, prefix, suffix, width = 420, minWi
60
60
  el.dataset.borderBottom = (el.scrollHeight - el.clientHeight > el.scrollTop).toString();
61
61
  }
62
62
  };
63
- useEffect(() => {
64
- if (scrollBehavior === 'card') {
65
- bodyRef.current.addEventListener('scroll', onScroll);
66
- return () => {
67
- bodyRef.current.removeEventListener('scroll', onScroll);
68
- };
69
- }
70
- }, [scrollBehavior]);
71
63
  useEffect(() => {
72
64
  if (scrollBehavior !== 'card') {
73
65
  return;
@@ -114,7 +106,7 @@ export function Dialog({ icon, title, footer, prefix, suffix, width = 420, minWi
114
106
  return (_jsx(Modal, { ...props, ref: cloneRef(overlayRef, props.ref), css: style, className: clsx(classes.root, props.className), open: innerOpen.current, "data-scroll-behavior": scrollBehavior, "data-draggable": draggable, children: _jsx("div", { ref: containerRef, className: classes.container, onClick: onMaskClick, children: _jsx(Draggable, { container: () => overlayRef.current, children: (targetProps, handleProps) => _jsxs("div", { ref: cardRef, className: classes.card, ...targetProps, style: { width, minWidth, maxWidth, ...targetProps.style }, children: [!!icon &&
115
107
  _jsx("div", { className: classes.icon, children: icon }), _jsxs("div", { className: classes.content, children: [!!(title || showClose) &&
116
108
  _jsxs("div", { className: classes.titleRow, ...handleProps, children: [_jsx("div", { className: classes.title, children: title }), showClose &&
117
- _jsx(Button, { shape: "circular", variant: "text", color: "text.secondary", ...closeProps, className: clsx(classes.close, closeProps?.className), onClick: closeHandler, children: _jsx(Icon, { icon: faXmark }) })] }), _jsxs("div", { ref: bodyRef, className: classes.body, children: [!!prefix &&
109
+ _jsx(Button, { shape: "circular", variant: "text", color: "text.secondary", ...closeProps, className: clsx(classes.close, closeProps?.className), onClick: closeHandler, children: _jsx(Icon, { icon: faXmark }) })] }), _jsxs("div", { ref: bodyRef, className: classes.body, onScroll: scrollBehavior === 'card' ? onScroll : void 0, children: [!!prefix &&
118
110
  _jsx("div", { className: classes.prefix, children: prefix }), _jsx("div", { ref: bodyWrapRef, className: classes.bodyWrap, children: props.children }), !!suffix &&
119
111
  _jsx("div", { className: classes.suffix, children: suffix })] }), (typeof footer === 'undefined' || !!footer) &&
120
112
  _jsx("div", { className: classes.footer, children: renderFooter() })] })] }) }) }) }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canlooks/can-ui",
3
- "version": "0.0.86",
3
+ "version": "0.0.88",
4
4
  "author": "C.CanLiang <canlooks@gmail.com>",
5
5
  "description": "My ui framework",
6
6
  "license": "MIT",