@guo514360255/antd-lib 1.4.27 → 1.4.28

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.
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { CustomScrollProps } from "./scroll";
3
+ import './index.less';
4
+ declare const CustomScroll: {
5
+ (props: CustomScrollProps): JSX.Element;
6
+ Item: (props: import("./scrollItem").CustomScrollItemProps) => JSX.Element;
7
+ };
8
+ export default CustomScroll;
@@ -0,0 +1,51 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ /*
3
+ * @Author: 郭郭
4
+ * @Date: 2026/1/9
5
+ * @Description:
6
+ */
7
+
8
+ import React, { useEffect } from 'react';
9
+ import "./index.less";
10
+ import Item from "./item";
11
+ var CustomScroll = function CustomScroll(props) {
12
+ var children = props.children,
13
+ _props$autoplay = props.autoplay,
14
+ autoplay = _props$autoplay === void 0 ? true : _props$autoplay,
15
+ className = props.className,
16
+ _props$duration = props.duration,
17
+ duration = _props$duration === void 0 ? 3000 : _props$duration,
18
+ _props$infinite = props.infinite,
19
+ infinite = _props$infinite === void 0 ? false : _props$infinite,
20
+ _props$direction = props.direction,
21
+ direction = _props$direction === void 0 ? 'vertical' : _props$direction,
22
+ _props$style = props.style,
23
+ style = _props$style === void 0 ? {} : _props$style,
24
+ height = props.height;
25
+ var timerRef = React.useRef(null);
26
+ var scrollRef = React.useRef(null);
27
+ var handleScroll = function handleScroll() {
28
+ timerRef.current = setTimeout(function () {
29
+ console.log(true);
30
+ console.log(scrollRef.current);
31
+ handleScroll();
32
+ }, duration);
33
+ };
34
+ useEffect(function () {
35
+ if (autoplay) {
36
+ handleScroll();
37
+ }
38
+ return function () {
39
+ clearTimeout(timerRef.current);
40
+ };
41
+ }, []);
42
+ return /*#__PURE__*/React.createElement("div", {
43
+ ref: scrollRef,
44
+ className: "custom-scroll-container ".concat(direction === 'horizontal' ? 'horizontal' : '', " ").concat(className !== null && className !== void 0 ? className : ''),
45
+ style: _objectSpread({
46
+ height: height
47
+ }, style)
48
+ }, /*#__PURE__*/React.createElement("div", null, children));
49
+ };
50
+ CustomScroll.Item = Item;
51
+ export default CustomScroll;
@@ -0,0 +1,8 @@
1
+ .custom-scroll-container{
2
+ overflow: hidden;
3
+ display: flex;
4
+ flex-direction: column;
5
+ &.horizontal{
6
+ flex-direction: row;
7
+ }
8
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type { CustomScrollItemProps } from "./scrollItem";
3
+ declare const Item: (props: CustomScrollItemProps) => JSX.Element;
4
+ export default Item;
@@ -0,0 +1,18 @@
1
+ /*
2
+ * @Author: 郭郭
3
+ * @Date: 2026/1/9
4
+ * @Description:
5
+ */
6
+
7
+ import React from 'react';
8
+ var Item = function Item(props) {
9
+ var children = props.children,
10
+ className = props.className,
11
+ _props$style = props.style,
12
+ style = _props$style === void 0 ? {} : _props$style;
13
+ return /*#__PURE__*/React.createElement("div", {
14
+ className: className,
15
+ style: style
16
+ }, children);
17
+ };
18
+ export default Item;
@@ -0,0 +1,46 @@
1
+ /*
2
+ * @Author: 郭郭
3
+ * @Date: 2026/1/9
4
+ * @Description:
5
+ */
6
+
7
+ import React from 'react';
8
+
9
+ export interface CustomScrollProps {
10
+ /**
11
+ * 是否自动滚动
12
+ * @default true
13
+ */
14
+ autoplay?: boolean;
15
+ /**
16
+ * 滚动时间间隔(毫秒)
17
+ * @default 3000
18
+ */
19
+ duration?: number;
20
+ /**
21
+ * 是否无限滚动
22
+ * @default true
23
+ */
24
+ infinite?: boolean;
25
+ /**
26
+ * 滚动方向
27
+ * @default vertical
28
+ */
29
+ direction?: 'horizontal' | 'vertical';
30
+ /**
31
+ * 滚动内容
32
+ */
33
+ children?: React.ReactNode;
34
+ /**
35
+ * 样式类
36
+ */
37
+ className?: string;
38
+ /**
39
+ * 滚动内容样式
40
+ */
41
+ style?: React.CSSProperties;
42
+ /**
43
+ * 容器内容高度
44
+ */
45
+ height?: number | string;
46
+ }
@@ -0,0 +1,22 @@
1
+ /*
2
+ * @Author: 郭郭
3
+ * @Date: 2026/1/9
4
+ * @Description:
5
+ */
6
+
7
+ import React from 'react';
8
+
9
+ export interface CustomScrollItemProps {
10
+ /**
11
+ * 滚动内容
12
+ */
13
+ children?: React.ReactNode;
14
+ /**
15
+ * 滚动内容样式
16
+ */
17
+ style?: React.CSSProperties;
18
+ /**
19
+ * 滚动内容类名
20
+ */
21
+ className?: string;
22
+ }
@@ -191,6 +191,14 @@ var CustomTable = /*#__PURE__*/forwardRef(function (props, ref) {
191
191
  var _formModalRef$current2;
192
192
  // @ts-ignore
193
193
  return formModalRef === null || formModalRef === void 0 || (_formModalRef$current2 = formModalRef.current) === null || _formModalRef$current2 === void 0 ? void 0 : _formModalRef$current2.getFormRef();
194
+ },
195
+ // pro components table action ref
196
+ tableActionRef: function tableActionRef() {
197
+ return actionRef.current;
198
+ },
199
+ // pro components form ref
200
+ tableFormRef: function tableFormRef() {
201
+ return formRef.current;
194
202
  }
195
203
  };
196
204
  });
package/dist/index.d.ts CHANGED
@@ -5,6 +5,8 @@ export { default as CustomModal } from './CustomFormModal';
5
5
  export type { CustomFormModalProps } from './CustomFormModal/formModal';
6
6
  export { default as CustomTable } from './CustomTable';
7
7
  export type { CustomTableProps } from './CustomTable/table';
8
+ export { default as CustomScroll } from './CustomScroll';
9
+ export type { CustomScrollProps } from './CustomScroll/scroll';
8
10
  export { default as CustomTag } from './CustomTag';
9
11
  export { default as CustomUpload } from './CustomUpload';
10
12
  export { default as DynamicIcon } from './DynamicIcon';
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export { default as CustomDetailModal } from "./CustomDetailModal";
2
2
  export { default as CustomModal } from "./CustomFormModal";
3
3
  export { default as CustomTable } from "./CustomTable";
4
+ export { default as CustomScroll } from "./CustomScroll";
4
5
  export { default as CustomTag } from "./CustomTag";
5
6
  export { default as CustomUpload } from "./CustomUpload";
6
7
  export { default as DynamicIcon } from "./DynamicIcon";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guo514360255/antd-lib",
3
- "version": "1.4.27",
3
+ "version": "1.4.28",
4
4
  "description": "react design 5 lib",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",