@ucloud-fe/react-components 1.3.6 → 1.3.10

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 (37) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/icon.min.js +1 -1
  3. package/dist/main.min.js +4 -4
  4. package/index.d.ts +29 -24
  5. package/lib/components/ActionList/ActionList.d.ts +9 -4
  6. package/lib/components/ActionList/index.d.ts +4 -2
  7. package/lib/components/Badge/Badge.d.ts +1 -1
  8. package/lib/components/Badge/index.d.ts +7 -2
  9. package/lib/components/Badge/index.js +6 -2
  10. package/lib/components/Breadcrumb/Item.d.ts +2 -2
  11. package/lib/components/Breadcrumb/index.d.ts +1 -1
  12. package/lib/components/Checkbox/index.d.ts +4 -2
  13. package/lib/components/Modal/method.js +6 -1
  14. package/lib/components/Notice/Notice.d.ts +16 -33
  15. package/lib/components/Notice/Notice.js +81 -130
  16. package/lib/components/Notice/index.d.ts +16 -2
  17. package/lib/components/Notice/index.js +13 -3
  18. package/lib/components/Notice/style/index.d.ts +12 -9
  19. package/lib/components/Notice/style/index.js +53 -112
  20. package/lib/components/SvgIcon/SvgIcon.js +4 -1
  21. package/lib/components/SvgIcon/icons/Dragger.d.ts +3 -0
  22. package/lib/components/SvgIcon/icons/Dragger.js +23 -0
  23. package/lib/components/Switch/Switch.d.ts +1 -1
  24. package/lib/components/Switch/index.d.ts +2 -1
  25. package/lib/components/Table/DragWrap.d.ts +42 -0
  26. package/lib/components/Table/DragWrap.js +64 -0
  27. package/lib/components/Table/ResizableTH.js +27 -17
  28. package/lib/components/Table/Table.js +284 -59
  29. package/lib/components/Table/TableRow.d.ts +9 -0
  30. package/lib/components/Table/TableRow.js +65 -76
  31. package/lib/components/Table/style/index.js +42 -18
  32. package/lib/components/Tabs/Pane.d.ts +3 -2
  33. package/lib/components/Tabs/index.d.ts +5 -3
  34. package/lib/components/TransferMenu/TransferMenu.js +2 -1
  35. package/lib/hooks/useUncontrolled.js +7 -7
  36. package/lib/libs/rc-table/TableRow.js +2 -1
  37. package/package.json +3 -6
@@ -1,5 +1,5 @@
1
- import React, { ReactNode } from 'react';
2
- export interface TabPaneProps {
1
+ import React, { HTMLAttributes, ReactNode } from 'react';
2
+ export interface DefinedTabPaneProps {
3
3
  /** @ignore */
4
4
  className?: string;
5
5
  /**
@@ -25,5 +25,6 @@ export interface TabPaneProps {
25
25
  /** tab 的 key,由于 react 会在某些情况下改变传递的 key,顾直接使用 key 是不安全的,如发现 key 被修改,可使用 tabKey 来替换 */
26
26
  tabKey?: string;
27
27
  }
28
+ export declare type TabPaneProps = DefinedTabPaneProps & Omit<HTMLAttributes<HTMLDivElement>, keyof DefinedTabPaneProps>;
28
29
  declare const _default: React.MemoExoticComponent<({ className, active, destroyInactiveTabPane, forceRender, placeholder, children, tabKey, ...rest }: TabPaneProps) => JSX.Element>;
29
30
  export default _default;
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
- import Pane from './Pane';
2
+ import { TabsProps } from './Tabs';
3
+ import Pane, { TabPaneProps } from './Pane';
3
4
  import { TabBarPositions, Sizes, StyleTypes } from './shared';
4
- declare const ExportTabs: import("react").NamedExoticComponent<import("./Tabs").TabsProps> & {
5
- readonly type: ({ activeKey: _activeKey, defaultActiveKey, onChange: _onChange, destroyInactiveTabPane, children, className, tabBarPosition, direction, styleType, size, ...restProps }: import("./Tabs").TabsProps) => JSX.Element;
5
+ declare const ExportTabs: import("react").NamedExoticComponent<TabsProps> & {
6
+ readonly type: ({ activeKey: _activeKey, defaultActiveKey, onChange: _onChange, destroyInactiveTabPane, children, className, tabBarPosition, direction, styleType, size, ...restProps }: TabsProps) => JSX.Element;
6
7
  } & {
7
8
  Pane: typeof Pane;
8
9
  /** @private 请勿使用 */
@@ -19,3 +20,4 @@ declare const ExportTabs: import("react").NamedExoticComponent<import("./Tabs").
19
20
  Position: typeof TabBarPositions;
20
21
  };
21
22
  export default ExportTabs;
23
+ export type { TabsProps, TabPaneProps };
@@ -86,7 +86,8 @@ var TransferMenu = /*#__PURE__*/function (_PureComponent) {
86
86
  (0, _newArrowCheck2.default)(this, _this3);
87
87
  return /*#__PURE__*/_react.default.createElement(_Menu.default.Item, {
88
88
  key: item.key,
89
- itemKey: item.key
89
+ itemKey: item.key,
90
+ disabled: item.disabled
90
91
  }, renderItem ? renderItem(item) : item.label);
91
92
  }.bind(this))));
92
93
  }.bind(this);
@@ -60,25 +60,25 @@ var useUncontrolled = function useUncontrolled(value, defaultValue, onChange, op
60
60
 
61
61
  var cacheVRef = (0, _react.useRef)(v);
62
62
  var finalValue = isControlled ? value : cacheVRef.current;
63
- var o = (0, _react.useCallback)(function (v) {
63
+ var updateValueWithoutCallOnChange = (0, _react.useCallback)(function (v) {
64
+ (0, _newArrowCheck2.default)(this, _this2);
64
65
  var r = options !== null && options !== void 0 && options.setter ? options === null || options === void 0 ? void 0 : options.setter(v) : v; // save value for controlled change to be uncontrolled
65
66
  // don't use state for reduce necessary update
66
67
  // still keep state for uncontrolled update
67
68
 
68
69
  cacheVRef.current = r;
69
70
  if (!isControlled) setV(r);
71
+ }.bind(this), [isControlled, options]);
72
+ var callOnChange = (0, _react.useCallback)(function (v) {
73
+ updateValueWithoutCallOnChange(v);
70
74
 
71
75
  for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
72
76
  rest[_key - 1] = arguments[_key];
73
77
  }
74
78
 
75
79
  onChange === null || onChange === void 0 ? void 0 : onChange.apply(void 0, [v].concat(rest));
76
- }, [options, isControlled, onChange]);
77
- var updateValueWithoutCallOnChange = (0, _react.useCallback)(function (v) {
78
- (0, _newArrowCheck2.default)(this, _this2);
79
- if (!isControlled) setV(v);
80
- }.bind(this), [isControlled]);
81
- return [finalValue, o, updateValueWithoutCallOnChange];
80
+ }, [updateValueWithoutCallOnChange, onChange]);
81
+ return [finalValue, callOnChange, updateValueWithoutCallOnChange];
82
82
  }.bind(void 0);
83
83
 
84
84
  var _default = useUncontrolled;
@@ -208,7 +208,8 @@ var TableRow = /*#__PURE__*/function (_React$Component) {
208
208
  className: rowClassName
209
209
  }, rowProps, {
210
210
  style: style,
211
- "data-row-key": rowKey
211
+ "data-row-key": rowKey,
212
+ "data-row-index": index
212
213
  }), cells);
213
214
  }
214
215
  }], [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucloud-fe/react-components",
3
- "version": "1.3.6",
3
+ "version": "1.3.10",
4
4
  "title": "UCloud react components",
5
5
  "description": "UCloud react components",
6
6
  "keywords": [
@@ -81,7 +81,8 @@
81
81
  "react-transition-group": "^2.4.0",
82
82
  "resize-observer-polyfill": "^1.5.1",
83
83
  "shallowequal": "^1.0.2",
84
- "warning": "^3.0.0"
84
+ "warning": "^3.0.0",
85
+ "z-use-drag": "^1.2.2"
85
86
  },
86
87
  "devDependencies": {
87
88
  "@babel/cli": "^7.11.6",
@@ -95,7 +96,6 @@
95
96
  "@babel/preset-typescript": "^7.10.4",
96
97
  "@commitlint/cli": "^7.1.2",
97
98
  "@commitlint/config-conventional": "^7.1.2",
98
- "@rapiop/mod": "^1.1.2",
99
99
  "@testing-library/jest-dom": "^5.11.4",
100
100
  "@testing-library/react": "^11.0.0",
101
101
  "@types/classnames": "^2.2.11",
@@ -145,10 +145,7 @@
145
145
  "react-resizable": "^2.0.0",
146
146
  "react-styleguidist": "^11.1.5",
147
147
  "react-test-renderer": "^16",
148
- "recodo-compiler": "^0.1.1",
149
- "recodo-doc": "^0.1.6",
150
148
  "recodo-gen": "^0.0.5",
151
- "recodo-live": "^0.1.2",
152
149
  "standard-version": "^8.0.2",
153
150
  "style-loader": "^0.20.3",
154
151
  "stylelint": "^9.9.0",