@dtjoy/dt-design 1.0.2 → 1.0.4

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.
Files changed (51) hide show
  1. package/esm/blockHeader/index.js +4 -4
  2. package/esm/blockHeader/style/index.less +1 -1
  3. package/esm/collapsible/index.js +1 -1
  4. package/esm/flex/index.js +1 -1
  5. package/esm/flex/utils.js +1 -1
  6. package/esm/formList/index.d.ts +77 -0
  7. package/esm/formList/index.js +141 -0
  8. package/esm/formList/style/index.d.ts +2 -0
  9. package/esm/formList/style/index.js +2 -0
  10. package/esm/formList/style/index.less +45 -0
  11. package/esm/index.d.ts +5 -3
  12. package/esm/index.js +6 -47
  13. package/esm/overflowList/index.d.ts +39 -0
  14. package/esm/overflowList/index.js +165 -0
  15. package/esm/overflowList/style/index.d.ts +2 -0
  16. package/esm/overflowList/style/index.js +2 -0
  17. package/esm/overflowList/style/index.less +9 -0
  18. package/esm/resizeObserver/index.d.ts +45 -0
  19. package/esm/resizeObserver/index.js +175 -0
  20. package/esm/splitter/SplitBar.js +1 -1
  21. package/esm/splitter/Splitter.js +11 -40
  22. package/esm/splitter/hooks/sizeUtil.js +20 -4
  23. package/esm/splitter/hooks/useSizes.js +2 -2
  24. package/esm/splitter/interface.d.ts +1 -0
  25. package/esm/statusTag/index.js +9 -9
  26. package/lib/blockHeader/index.js +5 -5
  27. package/lib/blockHeader/style/index.less +1 -1
  28. package/lib/collapsible/index.js +3 -3
  29. package/lib/flex/index.js +2 -2
  30. package/lib/flex/utils.js +3 -2
  31. package/lib/formList/index.d.ts +77 -0
  32. package/lib/formList/index.js +128 -0
  33. package/lib/formList/style/index.d.ts +2 -0
  34. package/lib/formList/style/index.js +4 -0
  35. package/lib/formList/style/index.less +45 -0
  36. package/lib/index.d.ts +5 -3
  37. package/lib/index.js +31 -5
  38. package/lib/overflowList/index.d.ts +39 -0
  39. package/lib/overflowList/index.js +143 -0
  40. package/lib/overflowList/style/index.d.ts +2 -0
  41. package/lib/overflowList/style/index.js +4 -0
  42. package/lib/overflowList/style/index.less +9 -0
  43. package/lib/resizeObserver/index.d.ts +45 -0
  44. package/lib/resizeObserver/index.js +136 -0
  45. package/lib/splitter/SplitBar.js +3 -3
  46. package/lib/splitter/Splitter.js +9 -39
  47. package/lib/splitter/hooks/sizeUtil.js +12 -0
  48. package/lib/splitter/hooks/useSizes.js +2 -2
  49. package/lib/splitter/interface.d.ts +1 -0
  50. package/lib/statusTag/index.js +9 -9
  51. package/package.json +133 -142
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.ObserverProperty = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactDom = require("react-dom");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ let ObserverProperty = exports.ObserverProperty = /*#__PURE__*/function (ObserverProperty) {
11
+ ObserverProperty["Width"] = "width";
12
+ ObserverProperty["Height"] = "height";
13
+ ObserverProperty["All"] = "all";
14
+ return ObserverProperty;
15
+ }({});
16
+ class ReactResizeObserver extends _react.default.Component {
17
+ static defaultProps = {
18
+ onResize: () => {},
19
+ observeParent: false,
20
+ observerProperty: ObserverProperty.All,
21
+ delayTick: 0
22
+ };
23
+ observer = null;
24
+ childNode = null;
25
+ element = null;
26
+ _parentNode = null;
27
+ formerPropertyValue = new Map();
28
+ constructor(props) {
29
+ super(props);
30
+ if (typeof window !== 'undefined' && window.ResizeObserver) {
31
+ this.observer = new window.ResizeObserver(this.handleResizeEventTriggered);
32
+ }
33
+ }
34
+ getElement = () => {
35
+ try {
36
+ // eslint-disable-next-line react/no-find-dom-node
37
+ return (0, _reactDom.findDOMNode)(this.childNode || this);
38
+ } catch (error) {
39
+ return null;
40
+ }
41
+ };
42
+ handleResizeEventTriggered = entries => {
43
+ const {
44
+ observerProperty,
45
+ onResize
46
+ } = this.props;
47
+ if (observerProperty === ObserverProperty.All) {
48
+ onResize?.(entries);
49
+ } else {
50
+ const finalEntries = [];
51
+ for (const entry of entries) {
52
+ const currentValue = entry.contentRect[observerProperty];
53
+ if (this.formerPropertyValue.has(entry.target)) {
54
+ if (currentValue !== this.formerPropertyValue.get(entry.target)) {
55
+ this.formerPropertyValue.set(entry.target, currentValue);
56
+ finalEntries.push(entry);
57
+ }
58
+ } else {
59
+ this.formerPropertyValue.set(entry.target, currentValue);
60
+ finalEntries.push(entry);
61
+ }
62
+ }
63
+ if (finalEntries.length > 0) {
64
+ onResize?.(finalEntries);
65
+ }
66
+ }
67
+ };
68
+ observeElement = (force = false) => {
69
+ if (!this.observer) return;
70
+ const element = this.getElement();
71
+ if (!(element && element instanceof Element)) {
72
+ this.observer.disconnect();
73
+ return;
74
+ }
75
+ if (element === this.element && !force) {
76
+ return;
77
+ } else {
78
+ this.observer.disconnect();
79
+ this.element = element;
80
+ }
81
+ this.observer.observe(element);
82
+ if (this.props.observeParent && element.parentNode) {
83
+ const parentNode = element.parentNode;
84
+ if (parentNode.ownerDocument && parentNode.ownerDocument.defaultView && parentNode instanceof parentNode.ownerDocument.defaultView.HTMLElement) {
85
+ this._parentNode = parentNode;
86
+ this.observer.observe(parentNode);
87
+ }
88
+ }
89
+ };
90
+ mergeRef = (ref, node) => {
91
+ this.childNode = node;
92
+ // 转发外部ref
93
+ if (typeof ref === 'function') {
94
+ ref(node);
95
+ } else if (typeof ref === 'object' && ref && 'current' in ref) {
96
+ ref.current = node;
97
+ }
98
+ };
99
+ componentDidMount() {
100
+ this.observeElement?.();
101
+ }
102
+ componentDidUpdate(prevProps) {
103
+ if (this.props.observeParent !== prevProps.observeParent) {
104
+ this.observeElement?.(true);
105
+ }
106
+ }
107
+ componentWillUnmount() {
108
+ if (this.observer) {
109
+ this.observer.disconnect();
110
+ this.observer = null;
111
+ }
112
+ this.element = null;
113
+ this._parentNode = null;
114
+ this.formerPropertyValue.clear();
115
+ }
116
+ render() {
117
+ const {
118
+ children,
119
+ className,
120
+ style,
121
+ ...rest
122
+ } = this.props;
123
+ const child = _react.default.Children.only(children);
124
+ const childRef = child.ref;
125
+ return /*#__PURE__*/_react.default.cloneElement(child, {
126
+ ...rest,
127
+ className: className ? `${child.props.className || ''} ${className}` : child.props.className,
128
+ style: {
129
+ ...child.props.style,
130
+ ...style
131
+ },
132
+ ref: node => this.mergeRef(childRef, node)
133
+ });
134
+ }
135
+ }
136
+ exports.default = ReactResizeObserver;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
- var _reactIcons = require("@dtinsight/react-icons");
8
+ var _icons = require("@ant-design/icons");
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _useEvent = _interopRequireDefault(require("rc-util/lib/hooks/useEvent"));
11
11
  var _useLayoutEffect = _interopRequireDefault(require("rc-util/lib/hooks/useLayoutEffect"));
@@ -144,8 +144,8 @@ const SplitBar = props => {
144
144
  const transformStyle = {
145
145
  [`--${splitBarPrefixCls}-preview-offset`]: `${constrainedOffset}px`
146
146
  };
147
- const StartIcon = vertical ? _reactIcons.UpOutlined : _reactIcons.LeftOutlined;
148
- const EndIcon = vertical ? _reactIcons.DownOutlined : _reactIcons.RightOutlined;
147
+ const StartIcon = vertical ? _icons.UpOutlined : _icons.LeftOutlined;
148
+ const EndIcon = vertical ? _icons.DownOutlined : _icons.RightOutlined;
149
149
  return /*#__PURE__*/_react.default.createElement("div", {
150
150
  className: splitBarPrefixCls,
151
151
  role: "separator",
@@ -8,8 +8,8 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _configProvider = require("antd/es/config-provider");
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _rcResizeObserver = _interopRequireDefault(require("rc-resize-observer"));
11
- var _useEvent = _interopRequireDefault(require("rc-util/lib/hooks/useEvent"));
12
- var _warning = _interopRequireDefault(require("rc-util/lib/warning"));
11
+ var _useEvent = _interopRequireDefault(require("rc-util/es/hooks/useEvent"));
12
+ var _warning = _interopRequireDefault(require("rc-util/es/warning"));
13
13
  var _useItems = _interopRequireDefault(require("./hooks/useItems"));
14
14
  var _useResizable = _interopRequireDefault(require("./hooks/useResizable"));
15
15
  var _useResize = _interopRequireDefault(require("./hooks/useResize"));
@@ -20,8 +20,7 @@ require("./style/index.less");
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
22
22
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
23
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/no-array-index-key */ // 替换 v5 配置为 v4 ConfigContext
24
- // 替换 devUseWarning 为 v4 原生 warning
23
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25
24
  const Splitter = props => {
26
25
  const {
27
26
  prefixCls: customizePrefixCls,
@@ -40,16 +39,10 @@ const Splitter = props => {
40
39
  direction
41
40
  } = (0, _react.useContext)(_configProvider.ConfigContext);
42
41
  const prefixCls = getPrefixCls('splitter', customizePrefixCls);
43
-
44
- // ======================== Direct ========================
45
42
  const isVertical = layout === 'vertical';
46
43
  const isRTL = direction === 'rtl';
47
44
  const reverse = !isVertical && isRTL;
48
-
49
- // ====================== Items Data ======================
50
45
  const items = (0, _useItems.default)(children);
51
-
52
- // >>> Warning 适配 v4
53
46
  if (process.env.NODE_ENV !== 'production') {
54
47
  let existSize = false;
55
48
  let existUndefinedSize = false;
@@ -64,8 +57,6 @@ const Splitter = props => {
64
57
  (0, _warning.default)(false, 'When part of `Splitter.Panel` has `size`, `onResize` is required or change `size` to `defaultSize`.');
65
58
  }
66
59
  }
67
-
68
- // ====================== Container =======================
69
60
  const [containerSize, setContainerSize] = (0, _react.useState)();
70
61
  const onContainerResize = size => {
71
62
  const {
@@ -78,15 +69,9 @@ const Splitter = props => {
78
69
  }
79
70
  setContainerSize(containerSize);
80
71
  };
81
-
82
- // ========================= Size =========================
83
72
  const [panelSizes, itemPxSizes, itemPtgSizes, itemPtgMinSizes, itemPtgMaxSizes, updateSizes] = (0, _useSizes.default)(items, containerSize);
84
-
85
- // ====================== Resizable =======================
86
73
  const resizableInfos = (0, _useResizable.default)(items, itemPxSizes, isRTL);
87
74
  const [onOffsetStart, onOffsetUpdate, onOffsetEnd, onCollapse, movingIndex] = (0, _useResize.default)(items, resizableInfos, itemPtgSizes, containerSize, updateSizes, isRTL);
88
-
89
- // ======================== Events ========================
90
75
  const onInternalResizeStart = (0, _useEvent.default)(index => {
91
76
  onOffsetStart(index);
92
77
  onResizeStart?.(itemPxSizes);
@@ -109,51 +94,36 @@ const Splitter = props => {
109
94
  const nextSizes = onCollapse(index, type);
110
95
  onResize?.(nextSizes);
111
96
  onResizeEnd?.(nextSizes);
97
+ const collapsed = nextSizes.map(size => Math.abs(size) < Number.EPSILON);
98
+ props.onCollapse?.(collapsed, nextSizes);
112
99
  });
113
-
114
- // ======================== Styles ========================
115
- // 构建 v4 风格类名(移除 cssinjs 相关 hash 和变量类)
116
100
  const containerClassName = (0, _classnames.default)(prefixCls, className, `${prefixCls}-${layout}`, {
117
101
  [`${prefixCls}-rtl`]: isRTL
118
- }, rootClassName
119
- // 移除 v5 cssinjs 类名
120
- // contextClassName,
121
- // cssVarCls,
122
- // rootCls,
123
- // hashId
124
- );
125
-
126
- // ======================== Render ========================
102
+ }, rootClassName);
127
103
  const maskCls = `${prefixCls}-mask`;
128
104
  const stackSizes = _react.default.useMemo(() => {
129
105
  const mergedSizes = [];
130
106
  let stack = 0;
131
- for (let i = 0; i < items.length; i += 1) {
107
+ const len = items.length;
108
+ for (let i = 0; i < len; i += 1) {
132
109
  stack += itemPtgSizes[i];
133
110
  mergedSizes.push(stack);
134
111
  }
135
112
  return mergedSizes;
136
- }, [itemPtgSizes]);
137
-
138
- // 合并样式(移除 v5 上下文样式)
113
+ }, [itemPtgSizes, items.length]);
139
114
  const mergedStyle = {
140
115
  ...style
141
116
  };
142
-
143
- // 移除 wrapCSSVar 包装(v4 无需 cssinjs 变量注入)
144
117
  return /*#__PURE__*/_react.default.createElement(_rcResizeObserver.default, {
145
118
  onResize: onContainerResize
146
119
  }, /*#__PURE__*/_react.default.createElement("div", {
147
120
  style: mergedStyle,
148
121
  className: containerClassName
149
122
  }, items.map((item, idx) => {
150
- // Panel
151
123
  const panel = /*#__PURE__*/_react.default.createElement(_Panel.InternalPanel, _extends({}, item, {
152
124
  prefixCls: prefixCls,
153
125
  size: panelSizes[idx]
154
126
  }));
155
-
156
- // Split Bar
157
127
  let splitBar = null;
158
128
  const resizableInfo = resizableInfos[idx];
159
129
  if (resizableInfo) {
@@ -16,6 +16,18 @@ function autoPtgSizes(ptgSizes, minPtgSizes, maxPtgSizes) {
16
16
  });
17
17
  const restPtg = 1 - currentTotalPtg;
18
18
  const undefinedCount = undefinedIndexes.length;
19
+
20
+ // If all sizes are defined but don't sum to 1, scale them.
21
+ if (ptgSizes.length && !undefinedIndexes.length && currentTotalPtg !== 1) {
22
+ // Handle the case when all sizes are 0
23
+ if (currentTotalPtg === 0) {
24
+ const avg = 1 / ptgSizes.length;
25
+ return ptgSizes.map(() => avg);
26
+ }
27
+ const scale = 1 / currentTotalPtg;
28
+ // We know `size` is a number here because undefinedIndexes is empty.
29
+ return ptgSizes.map(size => size * scale);
30
+ }
19
31
  if (restPtg < 0) {
20
32
  const scale = 1 / currentTotalPtg;
21
33
  return ptgSizes.map(size => size === undefined ? 0 : size * scale);
@@ -55,8 +55,8 @@ function useSizes(items, containerSize) {
55
55
  }
56
56
  }
57
57
  return (0, _sizeUtil.autoPtgSizes)(ptgList, postPercentMinSizes, postPercentMaxSizes);
58
- }, [sizes, mergedContainerSize, postPercentMinSizes, postPercentMaxSizes]);
58
+ }, [itemsCount, sizes, mergedContainerSize, postPercentMinSizes, postPercentMaxSizes]);
59
59
  const postPxSizes = _react.default.useMemo(() => postPercentSizes.map(ptg2px), [postPercentSizes, mergedContainerSize]);
60
- const panelSizes = _react.default.useMemo(() => containerSize ? postPxSizes : sizes, [postPxSizes, containerSize]);
60
+ const panelSizes = _react.default.useMemo(() => containerSize ? postPxSizes : sizes, [postPxSizes, sizes, containerSize]);
61
61
  return [panelSizes, postPxSizes, postPercentSizes, postPercentMinSizes, postPercentMaxSizes, setInnerSizes];
62
62
  }
@@ -9,6 +9,7 @@ export interface SplitterProps {
9
9
  onResizeStart?: (sizes: number[]) => void;
10
10
  onResize?: (sizes: number[]) => void;
11
11
  onResizeEnd?: (sizes: number[]) => void;
12
+ onCollapse?: (collapsed: boolean[], sizes: number[]) => void;
12
13
  lazy?: boolean;
13
14
  }
14
15
  export interface PanelProps {
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = exports.STATUS_TAG_TYPES = exports.PRESET_COLOR_TYPES = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
- var _reactIcons = require("@dtinsight/react-icons");
8
+ var _icons = require("@ant-design/icons");
9
9
  var _antd = require("antd");
10
10
  var _configProvider = require("antd/es/config-provider");
11
11
  var _classnames = _interopRequireDefault(require("classnames"));
@@ -17,19 +17,19 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
17
17
  const PRESET_COLOR_TYPES = exports.PRESET_COLOR_TYPES = Object.freeze(['blue', 'yellow', 'green', 'gray', 'red', 'purple', 'cyan', 'pink']);
18
18
  const STATUS_TAG_TYPES = exports.STATUS_TAG_TYPES = Object.freeze(['default', 'outline', 'fill']);
19
19
  const DEFAULT_OPACITY = 0.15;
20
- /**
21
- * 校验是否为预设颜色
22
- * @param color 待校验颜色值
20
+ /**
21
+ * 校验是否为预设颜色
22
+ * @param color 待校验颜色值
23
23
  */
24
24
  function isPresetColor(color) {
25
25
  if (!color || typeof color !== 'string') return false;
26
26
  return PRESET_COLOR_TYPES.includes(color);
27
27
  }
28
28
 
29
- /**
30
- * 计算颜色的透明版本
31
- * @param color 原始颜色(支持hex/rgb/rgba)
32
- * @param opacity 透明度(默认0.15)
29
+ /**
30
+ * 计算颜色的透明版本
31
+ * @param color 原始颜色(支持hex/rgb/rgba)
32
+ * @param opacity 透明度(默认0.15)
33
33
  */
34
34
  function calculateTransparentColor(color, opacity = DEFAULT_OPACITY) {
35
35
  if (!color) return 'rgba(0, 0, 0, 0.15)';
@@ -96,7 +96,7 @@ const StatusTag = /*#__PURE__*/_react.default.memo(props => {
96
96
  }
97
97
  };
98
98
  }, [color, icon, prefixCls]);
99
- const loadingIndicator = (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_reactIcons.SpinOutlined, {
99
+ const loadingIndicator = (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_icons.LoadingOutlined, {
100
100
  className: `${prefixCls}__icon ${prefixCls}__icon--loading`
101
101
  }), [prefixCls]);
102
102
  return /*#__PURE__*/_react.default.createElement("div", _extends({}, restProps, {
package/package.json CHANGED
@@ -1,148 +1,139 @@
1
1
  {
2
- "name": "@dtjoy/dt-design",
3
- "version": "1.0.2",
4
- "description": "react-component",
5
- "repository": "https://github.com/ZhaoFxxkSky/dt-design",
6
- "main": "lib/index.js",
7
- "module": "esm/index.js",
8
- "types": "esm/index.d.ts",
9
- "scripts": {
10
- "start": "npm run dev",
11
- "dev": "dumi dev",
12
- "build": "father build",
13
- "build:watch": "father dev",
14
- "test": "jest",
15
- "docs:build": "dumi build",
16
- "prepare": "husky install && dumi setup",
17
- "doctor": "father doctor",
18
- "lint": "npm run lint:es && npm run lint:css",
19
- "lint:es-fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \".dumi/**/*.{js,jsx,ts,tsx}\" --fix",
20
- "lint:css-fix": "stylelint \"src/**/*.{css,less,scss}\" \".dumi/**/*.{css,less,scss}\" --fix",
21
- "lint:css": "stylelint \"src/**/*.{css,less,scss}\" \".dumi/**/*.{css,less,scss}\"",
22
- "lint:es": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \".dumi/**/*.{js,jsx,ts,tsx}\"",
23
- "prepublishOnly": "npm run build",
24
- "deploy": "npm run docs:build && gh-pages -d docs-dist",
25
- "release": "./scripts/release.sh"
26
- },
27
- "author": {
28
- "name": "夕颜",
29
- "email": "wx-zhaog@dtjoy.com",
30
- "url": "https://github.com/ZhaoFxxkSky/dt-design"
31
- },
32
- "license": "MIT",
33
- "files": [
34
- "lib",
35
- "esm"
2
+ "name": "@dtjoy/dt-design",
3
+ "version": "1.0.4",
4
+ "description": "react-component",
5
+ "repository": "https://github.com/ZhaoFxxkSky/dt-design",
6
+ "main": "lib/index.js",
7
+ "module": "esm/index.js",
8
+ "types": "esm/index.d.ts",
9
+ "scripts": {
10
+ "start": "npm run dev",
11
+ "dev": "dumi dev",
12
+ "build": "father build",
13
+ "build:watch": "father dev",
14
+ "test": "jest",
15
+ "docs:build": "dumi build",
16
+ "prepare": "husky install && dumi setup",
17
+ "doctor": "father doctor",
18
+ "lint": "npm run lint:es && npm run lint:css",
19
+ "lint:es-fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \".dumi/**/*.{js,jsx,ts,tsx}\" --fix",
20
+ "lint:css-fix": "stylelint \"src/**/*.{css,less,scss}\" \".dumi/**/*.{css,less,scss}\" --fix",
21
+ "lint:css": "stylelint \"src/**/*.{css,less,scss}\" \".dumi/**/*.{css,less,scss}\"",
22
+ "lint:es": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \".dumi/**/*.{js,jsx,ts,tsx}\"",
23
+ "prepublishOnly": "npm run build",
24
+ "deploy": "npm run docs:build && gh-pages -d docs-dist",
25
+ "release": "./scripts/release.sh"
26
+ },
27
+ "author": {
28
+ "name": "夕颜",
29
+ "email": "wx-zhaog@dtjoy.com",
30
+ "url": "https://github.com/ZhaoFxxkSky/dt-design"
31
+ },
32
+ "license": "MIT",
33
+ "files": [
34
+ "lib",
35
+ "esm"
36
+ ],
37
+ "sideEffects": [
38
+ "esm/**/style/*",
39
+ "lib/**/style/*",
40
+ "**/style/*"
41
+ ],
42
+ "keywords": [
43
+ "react",
44
+ "react-component",
45
+ "ui-library",
46
+ "typescript",
47
+ "ant-design"
48
+ ],
49
+ "commitlint": {
50
+ "extends": [
51
+ "@commitlint/config-conventional"
52
+ ]
53
+ },
54
+ "lint-staged": {
55
+ "*.{md,json}": [
56
+ "prettier --write --no-error-on-unmatched-pattern"
36
57
  ],
37
- "sideEffects": [
38
- "esm/**/style/*",
39
- "lib/**/style/*",
40
- "*.less",
41
- "**/style/*"
58
+ "*.{css,scss}": [
59
+ "stylelint --fix"
42
60
  ],
43
- "keywords": [
44
- "react",
45
- "react-component",
46
- "ui-library",
47
- "typescript",
48
- "ant-design"
61
+ "*.{js,jsx}": [
62
+ "eslint --fix",
63
+ "prettier --write"
49
64
  ],
50
- "commitlint": {
51
- "extends": [
52
- "@commitlint/config-conventional"
53
- ]
54
- },
55
- "lint-staged": {
56
- "*.{md,json}": [
57
- "prettier --write --no-error-on-unmatched-pattern"
58
- ],
59
- "*.{css,scss}": [
60
- "stylelint --fix"
61
- ],
62
- "*.{js,jsx}": [
63
- "eslint --fix",
64
- "prettier --write"
65
- ],
66
- "*.{ts,tsx}": [
67
- "eslint --fix",
68
- "prettier --parser=typescript --write"
69
- ]
70
- },
71
- "publishConfig": {
72
- "access": "public"
73
- },
74
- "peerDependencies": {
75
- "react": ">=16.9.0",
76
- "react-dom": ">=16.9.0"
77
- },
78
- "devDependencies": {
79
- "@commitlint/cli": "^17.1.2",
80
- "@commitlint/config-conventional": "^17.1.0",
81
- "@faker-js/faker": "^7.6.0",
82
- "@testing-library/jest-dom": "^5.16.5",
83
- "@testing-library/react": "^13.4.0",
84
- "@testing-library/react-hooks": "^8.0.1",
85
- "@testing-library/user-event": "^14.4.3",
86
- "@types/jest": "^29.2.3",
87
- "@types/lodash-es": "^4.17.12",
88
- "@types/node": "^24.3.1",
89
- "@types/react": "^18.0.0",
90
- "@types/react-resizable": "^3.0.8",
91
- "@types/react-syntax-highlighter": "~15.5.13",
92
- "@types/shortid": "^0.0.31",
93
- "@types/showdown": "^1.9.0",
94
- "@types/testing-library__jest-dom": "^5.14.5",
95
- "ant-design-testing": "^1.1.0",
96
- "babel-plugin-import": "^1.13.8",
97
- "cz-conventional-changelog": "^3.3.0",
98
- "dumi": "^2.2.12",
99
- "eslint": "^8.23.0",
100
- "father": "~4.1.0",
101
- "gh-pages": "^4.0.0",
102
- "husky": "^8.0.1",
103
- "jest": "^29.3.1",
104
- "jest-environment-jsdom": "^29.3.1",
105
- "ko-lint-config": "2.2.21",
106
- "lint-staged": "^13.0.3",
107
- "prettier": "^2.7.1",
108
- "rc-motion": "2.6.2",
109
- "rc-util": "^5.44.4",
110
- "react": "^18.0.0",
111
- "react-dom": "^18.0.0",
112
- "react-test-renderer": "^18.2.0",
113
- "resize-observer-polyfill": "^1.5.1",
114
- "standard-version": "^9.5.0",
115
- "stylelint": "^14.9.1",
116
- "ts-jest": "^29.0.3",
117
- "typescript": "~4.5.2"
118
- },
119
- "dependencies": {
120
- "@dtinsight/dt-utils": "^1.3.1",
121
- "@dtinsight/react-icons": "^1.0.0",
122
- "@handsontable/react": "2.1.0",
123
- "antd": "4.24.16",
124
- "classnames": "^2.2.6",
125
- "handsontable": "6.2.2",
126
- "highlight.js": "^10.5.0",
127
- "immer": "~10.1.1",
128
- "lodash-es": "^4.17.21",
129
- "rc-drawer": "~5.1.0",
130
- "rc-resize-observer": "^1.4.3",
131
- "rc-virtual-list": "^3.4.13",
132
- "react-draggable": "~4.4.6",
133
- "react-markdown": "~8.0.6",
134
- "react-resizable": "^3.0.5",
135
- "react-syntax-highlighter": "~15.5.0",
136
- "remark-gfm": "~3.0.1",
137
- "shortid": "^2.2.16",
138
- "showdown": "^1.9.0"
139
- },
140
- "config": {
141
- "commitizen": {
142
- "path": "./node_modules/cz-conventional-changelog"
143
- }
144
- },
145
- "resolutions": {
146
- "rc-motion": "2.6.2"
65
+ "*.{ts,tsx}": [
66
+ "eslint --fix",
67
+ "prettier --parser=typescript --write"
68
+
69
+ ]
70
+ },
71
+ "publishConfig": {
72
+ "access": "public"
73
+ },
74
+ "peerDependencies": {
75
+ "react": ">=16.9.0",
76
+ "react-dom": ">=16.9.0",
77
+ "antd": "^4.x"
78
+ },
79
+ "devDependencies": {
80
+ "@commitlint/cli": "^17.1.2",
81
+ "@commitlint/config-conventional": "^17.1.0",
82
+ "@faker-js/faker": "^7.6.0",
83
+ "@testing-library/jest-dom": "^5.16.5",
84
+ "@testing-library/react": "^13.4.0",
85
+ "@testing-library/react-hooks": "^8.0.1",
86
+ "@testing-library/user-event": "^14.4.3",
87
+ "@types/jest": "^29.2.3",
88
+ "@types/lodash-es": "^4.17.12",
89
+ "@types/node": "^24.3.1",
90
+ "@types/react": "^18.0.0",
91
+ "@types/react-resizable": "^3.0.8",
92
+ "@types/react-syntax-highlighter": "~15.5.13",
93
+ "@types/shortid": "^0.0.31",
94
+ "@types/showdown": "^1.9.0",
95
+ "@types/testing-library__jest-dom": "^5.14.5",
96
+ "ant-design-testing": "^1.1.0",
97
+ "babel-plugin-import": "^1.13.8",
98
+ "cz-conventional-changelog": "^3.3.0",
99
+ "dumi": "^2.2.12",
100
+ "eslint": "^8.23.0",
101
+ "father": "~4.1.0",
102
+ "gh-pages": "^4.0.0",
103
+ "husky": "^8.0.1",
104
+ "jest": "^29.3.1",
105
+ "jest-environment-jsdom": "^29.3.1",
106
+ "ko-lint-config": "2.2.21",
107
+ "lint-staged": "^13.0.3",
108
+ "prettier": "^2.7.1",
109
+ "rc-motion": "2.6.2",
110
+ "react": "^18.0.0",
111
+ "react-dom": "^18.0.0",
112
+ "react-test-renderer": "^18.2.0",
113
+ "resize-observer-polyfill": "^1.5.1",
114
+ "standard-version": "^9.5.0",
115
+ "stylelint": "^14.9.1",
116
+ "ts-jest": "^29.0.3",
117
+ "typescript": "~4.5.2"
118
+ },
119
+ "dependencies": {
120
+ "@ant-design/icons": "^4.8.3",
121
+ "@dtinsight/dt-utils": "^1.3.1",
122
+ "rc-util": "^5.44.4",
123
+ "classnames": "^2.2.6",
124
+ "immer": "~10.1.1",
125
+ "lodash-es": "^4.17.21",
126
+ "rc-drawer": "~5.1.0",
127
+ "rc-resize-observer": "^1.4.3",
128
+ "rc-virtual-list": "^3.4.13"
129
+ },
130
+
131
+ "config": {
132
+ "commitizen": {
133
+ "path": "./node_modules/cz-conventional-changelog"
147
134
  }
135
+ },
136
+ "resolutions": {
137
+ "rc-motion": "2.6.2"
138
+ }
148
139
  }