@hi-ui/hiui 3.9.0-rc.7 → 3.9.0

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.
package/CHANGELOG.md CHANGED
@@ -1,17 +1,54 @@
1
1
  # 更新日志
2
2
 
3
- # 3.8.0-rc
3
+ # 3.9.0
4
4
 
5
5
  - 新增 `Table` 组件 `hiddenColKeys` 和 `onHiddenColKeysChange` 受控控制列显隐 [#1994](https://github.com/XiaoMi/hiui/issues/1994)
6
- - 新增 `Input` 组件支持 placeholder 受控动态更新 [#1982](https://github.com/XiaoMi/hiui/issues/1982)
7
6
  - 新增 `Table` 组件支持 checkAll 复选框右侧自定义操作按钮 [#2007](https://github.com/XiaoMi/hiui/issues/2007)
8
7
  - 修复 `Select` 组件高亮词搜索存在正则注入 [#1972](https://github.com/XiaoMi/hiui/issues/1972)
9
8
  - 修复 `Table` 组件 resizable 调节列宽功能失效 [#1970](https://github.com/XiaoMi/hiui/issues/1970)
10
- - 修复 `Input` 组件的 placeholder 没法动态更新 [#1970](https://github.com/XiaoMi/hiui/issues/1982)
11
9
  - 优化 `Dropdown` 组件 props 中的 data 消除副作用 [#1991](https://github.com/XiaoMi/hiui/issues/1991)
12
10
  - 修复 `TimePicker` 组件使用 minusStep 当点击 clear 后会再次自动回显值 [#1986](https://github.com/XiaoMi/hiui/issues/1986)
13
11
  - 修复 `Table` 组件 window 系统 `draggable=false` 禁用失效 [#1993](https://github.com/XiaoMi/hiui/issues/1993)
14
12
  - 修复 `Popper` 组件 Popper DOM 节点位置移动时未同步进行位置计算 [#2011](https://github.com/XiaoMi/hiui/issues/2011)
13
+ - 修复 `Drawer` 组件阴影展示问题 [#1948](https://github.com/XiaoMi/hiui/issues/1948)
14
+ - 修复 `SelectTree` 组件禁用仍可删除的问题 [#1947](https://github.com/XiaoMi/hiui/issues/1947)
15
+ - 修复 `Popper` 滚动时导致弹窗位置失效的问题 [#1955](https://github.com/XiaoMi/hiui/issues/1955)
16
+ - 修复 `Table` align 配置对表头无效的问题 [#1954](https://github.com/XiaoMi/hiui/issues/1954)
17
+ - 新增 `Tree` 对添加节点返回parent指向 [#1952](https://github.com/XiaoMi/hiui/issues/1962)
18
+ - 修复 `Select` 异步请求未发出时的空校验问题 [#1953](https://github.com/XiaoMi/hiui/issues/1953)
19
+ - 修复 `Popper` 无法正确获取 clientHeight 的问题 [#1953](https://github.com/XiaoMi/hiui/issues/1953)
20
+ - 修复 `DatePicker` weekOffset 周选择失效问题 [#1976](https://github.com/XiaoMi/hiui/issues/1976)
21
+ - 修复 `Input` placeholder 不受控的问题 [#1982](https://github.com/XiaoMi/hiui/issues/1982)
22
+ - 修复 `Tabs`箭头样式问题 [#1978](https://github.com/XiaoMi/hiui/issues/1978)
23
+ - 修复 `TimePicker` 使用 minusStep,点击清空后会再次自动回显值的问题 [#1986](https://github.com/XiaoMi/hiui/issues/1986)
24
+ - 新增 `Table` rowSelection onChange 回调参数,支持选中对象和选中状态 [#1988](https://github.com/XiaoMi/hiui/issues/1988)
25
+ - 修复 `Table` filterIcon 传入 ReactNode 导致页面卡顿的问题 [#2017](https://github.com/XiaoMi/hiui/issues/2017)
26
+ - 新增 `SelectTree` 支持自定义过滤 [#2009](https://github.com/XiaoMi/hiui/issues/2009)
27
+ - 修复 `Select` dataSource 返回为 undefined 时的问题 [#2020](https://github.com/XiaoMi/hiui/issues/2020)
28
+ - 修复 `Form` schemaForm initialValues 不生效的问题 [#2028](https://github.com/XiaoMi/hiui/issues/2028)
29
+ - 修复 `Carousel`下标索引不正确的问题 [#2033](https://github.com/XiaoMi/hiui/issues/2033)
30
+ - 修复 `Table` 拖拽到自身节点时的 bug [#2035](https://github.com/XiaoMi/hiui/issues/2035)
31
+ - 新增 `Table` render 全局自定义单元格渲染 [#2037](https://github.com/XiaoMi/hiui/issues/2037)
32
+ - 修复 `Table` 单独冻结右侧列时,一处左侧操作列也会跟随冻结的问题 [#2041](https://github.com/XiaoMi/hiui/issues/2041)
33
+ - 修复 `Form` onValuesChange 返回数据字段异常的问题 [#2077](https://github.com/XiaoMi/hiui/issues/2077)
34
+ - 修复 `DatePicker` 周范围选择时展示周数异常的问题 [#2083](https://github.com/XiaoMi/hiui/issues/2083)
35
+ - 新增 `Input` 支持 ref 获取 [#2074](https://github.com/XiaoMi/hiui/issues/2074)
36
+ - 新增 `Table` 支持 onRow 事件进行行操作 [#2093](https://github.com/XiaoMi/hiui/issues/2093)
37
+ - 新增 `Table` fixedColumnTrigger 支持固定列始终固定 [#2092](https://github.com/XiaoMi/hiui/issues/2092)
38
+ - 修复 `Tree` 兼容 contextMenu 返回空数组的情况 [#2106](https://github.com/XiaoMi/hiui/issues/2106)
39
+ - 新增 `Table` 复选框增加半选状态 [#2107](https://github.com/XiaoMi/hiui/issues/2107)
40
+ - 修复 `Search` 点击下拉选项更新 input value 未触发 onChange 的问题 [#2108](https://github.com/XiaoMi/hiui/issues/2108)
41
+ - 新增 `Table` highlightedRowOnDoubleClick 支持双击高亮行功能允许开关配置 [#2118](https://github.com/XiaoMi/hiui/issues/2118)
42
+ - 修复 `Collapse` 不支持 className [#2147](https://github.com/XiaoMi/hiui/issues/2147)
43
+ - 修复 `Modal` closeable 属性不受控更新 [#2135](https://github.com/XiaoMi/hiui/issues/2135)
44
+ - 新增 `Modal` 内容区滚动控制 [#2155](https://github.com/XiaoMi/hiui/issues/2155)
45
+ - 新增 `Table` 支持固定列不允许 Resizable,添加 disabledResizableColKeys 控制指定 col 列禁用 Resizable [#2160](https://github.com/XiaoMi/hiui/issues/2160)
46
+ - 修复 `Form` 某个表单控件 initialValues 初始化有值,但是校验 required 时仍然报错无值的问题 [#2141](https://github.com/XiaoMi/hiui/issues/2141)
47
+ - 修复 `Form` 某个表单控件 initialValues 初始化有值,但是校验 required 时仍然报错无值的问题 [#2139](https://github.com/XiaoMi/hiui/issues/2139)
48
+ - 修复 `TimePicker` 只选择一个时间时的报错问题 [#2129](https://github.com/XiaoMi/hiui/issues/2129)
49
+ - 修复 `Tree` onSelect 无法获取到 hooks 定义 state 值的变化的问题 [#2131](https://github.com/XiaoMi/hiui/issues/2131)
50
+ - 修复 `Input` safari 中文输入产生无效字符的问题 [#2085](https://github.com/XiaoMi/hiui/issues/2085)
51
+
15
52
 
16
53
  # 3.8.0
17
54
 
@@ -1 +1 @@
1
- .hi-checkbox{cursor:pointer;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:16px;vertical-align:middle;font:normal 14px/1.5 -apple-system,BlinkMacSystemFont,"Helvetica Neue",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";text-align:left;text-indent:0;text-shadow:none;text-transform:none;letter-spacing:0;word-spacing:normal;white-space:normal;color:#333}.hi-checkbox a{padding-left:0;padding-right:0}.hi-checkbox p,.hi-checkbox blockquote,.hi-checkbox ul,.hi-checkbox ol,.hi-checkbox dl,.hi-checkbox table,.hi-checkbox pre,.hi-checkbox h1,.hi-checkbox h2,.hi-checkbox h3,.hi-checkbox h4,.hi-checkbox h5,.hi-checkbox h6{margin-top:0;margin-bottom:0}.hi-checkbox ul,.hi-checkbox ol{margin:0;padding:0;list-style-type:none}.hi-checkbox ul ul,.hi-checkbox ul ol,.hi-checkbox ol ul,.hi-checkbox ol ol{margin-top:0;margin-bottom:0}.hi-checkbox li+li{margin-top:0}.hi-checkbox dl{margin-top:0;margin-bottom:0}.hi-checkbox input{width:0;height:0;opacity:0}.hi-checkbox__input{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;vertical-align:middle;width:16px;height:16px;border:1px solid #d8d8d8;margin-right:8px;border-radius:2px;-webkit-transition:0.3s ease-out;transition:0.3s ease-out;line-height:1;-webkit-box-flex:0;-ms-flex:none;flex:none}.hi-checkbox__input--indeterminate::after{-webkit-transform:rotate(90deg) scaleY(1);transform:rotate(90deg) scaleY(1);pointer-events:none;-webkit-box-sizing:content-box;box-sizing:content-box;content:'';border:none;border-bottom:2px solid #fff;height:8px;left:6px;position:absolute;top:2px;width:2px;-webkit-transform-origin:center;transform-origin:center}.hi-checkbox__input--checked::after{-webkit-transform:rotate(45deg) scaleY(1);transform:rotate(45deg) scaleY(1);pointer-events:none;-webkit-box-sizing:content-box;box-sizing:content-box;content:'';border:2px solid #fff;border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;width:4px;-webkit-transform-origin:center;transform-origin:center}.hi-checkbox__text{padding:0 32px 0 0;line-height:unset}.hi-checkbox--disabled{cursor:not-allowed}.hi-checkbox--disabled .hi-checkbox__input{border-color:#d8d8d8;background:#f2f2f2}.hi-checkbox--disabled .hi-checkbox__input::after{border-color:#d8d8d8}.hi-checkbox--disabled .hi-checkbox__text{color:rgba(0,0,0,0.65)}.hi-checkbox-group{display:inline-block}.hi-checkbox-group--vertical{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.hi-checkbox-group--vertical .hi-checkbox{height:32px}.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#4285f4}.hi-checkbox input:focus+.hi-checkbox__input{border-color:#4285f4}.hi-checkbox__input--indeterminate{background:#4285f4;border-color:#4285f4}.hi-checkbox__input--indeterminate::after{background:#fff}.hi-checkbox__input--checked{background:#4285f4;border-color:#4285f4}.theme__orange .hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#f63}.theme__orange .hi-checkbox input:focus+.hi-checkbox__input{border-color:#f63}.theme__orange .hi-checkbox__input--indeterminate{background:#f63;border-color:#f63}.theme__orange .hi-checkbox__input--indeterminate::after{background:#fff}.theme__orange .hi-checkbox__input--checked{background:#f63;border-color:#f63}.theme__orange.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#f63}.theme__orange.hi-checkbox input:focus+.hi-checkbox__input{border-color:#f63}.theme__cyan .hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#46bc99}.theme__cyan .hi-checkbox input:focus+.hi-checkbox__input{border-color:#46bc99}.theme__cyan .hi-checkbox__input--indeterminate{background:#46bc99;border-color:#46bc99}.theme__cyan .hi-checkbox__input--indeterminate::after{background:#fff}.theme__cyan .hi-checkbox__input--checked{background:#46bc99;border-color:#46bc99}.theme__cyan.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#46bc99}.theme__cyan.hi-checkbox input:focus+.hi-checkbox__input{border-color:#46bc99}.theme__magenta .hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#ff5975}.theme__magenta .hi-checkbox input:focus+.hi-checkbox__input{border-color:#ff5975}.theme__magenta .hi-checkbox__input--indeterminate{background:#ff5975;border-color:#ff5975}.theme__magenta .hi-checkbox__input--indeterminate::after{background:#fff}.theme__magenta .hi-checkbox__input--checked{background:#ff5975;border-color:#ff5975}.theme__magenta.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#ff5975}.theme__magenta.hi-checkbox input:focus+.hi-checkbox__input{border-color:#ff5975}.theme__lavender .hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#b450de}.theme__lavender .hi-checkbox input:focus+.hi-checkbox__input{border-color:#b450de}.theme__lavender .hi-checkbox__input--indeterminate{background:#b450de;border-color:#b450de}.theme__lavender .hi-checkbox__input--indeterminate::after{background:#fff}.theme__lavender .hi-checkbox__input--checked{background:#b450de;border-color:#b450de}.theme__lavender.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#b450de}.theme__lavender.hi-checkbox input:focus+.hi-checkbox__input{border-color:#b450de}.theme__blue .hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#3da8f5}.theme__blue .hi-checkbox input:focus+.hi-checkbox__input{border-color:#3da8f5}.theme__blue .hi-checkbox__input--indeterminate{background:#3da8f5;border-color:#3da8f5}.theme__blue .hi-checkbox__input--indeterminate::after{background:#fff}.theme__blue .hi-checkbox__input--checked{background:#3da8f5;border-color:#3da8f5}.theme__blue.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#3da8f5}.theme__blue.hi-checkbox input:focus+.hi-checkbox__input{border-color:#3da8f5}.theme__purple .hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#8a8acb}.theme__purple .hi-checkbox input:focus+.hi-checkbox__input{border-color:#8a8acb}.theme__purple .hi-checkbox__input--indeterminate{background:#8a8acb;border-color:#8a8acb}.theme__purple .hi-checkbox__input--indeterminate::after{background:#fff}.theme__purple .hi-checkbox__input--checked{background:#8a8acb;border-color:#8a8acb}.theme__purple.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#8a8acb}.theme__purple.hi-checkbox input:focus+.hi-checkbox__input{border-color:#8a8acb}
1
+ .hi-checkbox{cursor:pointer;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:16px;vertical-align:middle;font:normal 14px/1.5 -apple-system,BlinkMacSystemFont,"Helvetica Neue",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";text-align:left;text-indent:0;text-shadow:none;text-transform:none;letter-spacing:0;word-spacing:normal;white-space:normal;color:#333}.hi-checkbox a{padding-left:0;padding-right:0}.hi-checkbox p,.hi-checkbox blockquote,.hi-checkbox ul,.hi-checkbox ol,.hi-checkbox dl,.hi-checkbox table,.hi-checkbox pre,.hi-checkbox h1,.hi-checkbox h2,.hi-checkbox h3,.hi-checkbox h4,.hi-checkbox h5,.hi-checkbox h6{margin-top:0;margin-bottom:0}.hi-checkbox ul,.hi-checkbox ol{margin:0;padding:0;list-style-type:none}.hi-checkbox ul ul,.hi-checkbox ul ol,.hi-checkbox ol ul,.hi-checkbox ol ol{margin-top:0;margin-bottom:0}.hi-checkbox li+li{margin-top:0}.hi-checkbox dl{margin-top:0;margin-bottom:0}.hi-checkbox input{width:0;height:0;opacity:0}.hi-checkbox__input{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;vertical-align:middle;width:16px;height:16px;border:1px solid #d8d8d8;background-color:var(--color-white);margin-right:8px;border-radius:2px;-webkit-transition:0.3s ease-out;transition:0.3s ease-out;line-height:1;-webkit-box-flex:0;-ms-flex:none;flex:none}.hi-checkbox__input--indeterminate::after{-webkit-transform:rotate(90deg) scaleY(1);transform:rotate(90deg) scaleY(1);pointer-events:none;-webkit-box-sizing:content-box;box-sizing:content-box;content:'';border:none;border-bottom:2px solid #fff;height:8px;left:6px;position:absolute;top:2px;width:2px;-webkit-transform-origin:center;transform-origin:center}.hi-checkbox__input--checked::after{-webkit-transform:rotate(45deg) scaleY(1);transform:rotate(45deg) scaleY(1);pointer-events:none;-webkit-box-sizing:content-box;box-sizing:content-box;content:'';border:2px solid #fff;border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;width:4px;-webkit-transform-origin:center;transform-origin:center}.hi-checkbox__text{padding:0 32px 0 0;line-height:unset}.hi-checkbox--disabled{cursor:not-allowed}.hi-checkbox--disabled .hi-checkbox__input{border-color:#d8d8d8;background:#f2f2f2}.hi-checkbox--disabled .hi-checkbox__input::after{border-color:#d8d8d8}.hi-checkbox--disabled .hi-checkbox__text{color:rgba(0,0,0,0.65)}.hi-checkbox-group{display:inline-block}.hi-checkbox-group--vertical{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.hi-checkbox-group--vertical .hi-checkbox{height:32px}.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#4285f4}.hi-checkbox input:focus+.hi-checkbox__input{border-color:#4285f4}.hi-checkbox__input--indeterminate{background:#4285f4;border-color:#4285f4}.hi-checkbox__input--indeterminate::after{background:#fff}.hi-checkbox__input--checked{background:#4285f4;border-color:#4285f4}.theme__orange .hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#f63}.theme__orange .hi-checkbox input:focus+.hi-checkbox__input{border-color:#f63}.theme__orange .hi-checkbox__input--indeterminate{background:#f63;border-color:#f63}.theme__orange .hi-checkbox__input--indeterminate::after{background:#fff}.theme__orange .hi-checkbox__input--checked{background:#f63;border-color:#f63}.theme__orange.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#f63}.theme__orange.hi-checkbox input:focus+.hi-checkbox__input{border-color:#f63}.theme__cyan .hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#46bc99}.theme__cyan .hi-checkbox input:focus+.hi-checkbox__input{border-color:#46bc99}.theme__cyan .hi-checkbox__input--indeterminate{background:#46bc99;border-color:#46bc99}.theme__cyan .hi-checkbox__input--indeterminate::after{background:#fff}.theme__cyan .hi-checkbox__input--checked{background:#46bc99;border-color:#46bc99}.theme__cyan.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#46bc99}.theme__cyan.hi-checkbox input:focus+.hi-checkbox__input{border-color:#46bc99}.theme__magenta .hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#ff5975}.theme__magenta .hi-checkbox input:focus+.hi-checkbox__input{border-color:#ff5975}.theme__magenta .hi-checkbox__input--indeterminate{background:#ff5975;border-color:#ff5975}.theme__magenta .hi-checkbox__input--indeterminate::after{background:#fff}.theme__magenta .hi-checkbox__input--checked{background:#ff5975;border-color:#ff5975}.theme__magenta.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#ff5975}.theme__magenta.hi-checkbox input:focus+.hi-checkbox__input{border-color:#ff5975}.theme__lavender .hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#b450de}.theme__lavender .hi-checkbox input:focus+.hi-checkbox__input{border-color:#b450de}.theme__lavender .hi-checkbox__input--indeterminate{background:#b450de;border-color:#b450de}.theme__lavender .hi-checkbox__input--indeterminate::after{background:#fff}.theme__lavender .hi-checkbox__input--checked{background:#b450de;border-color:#b450de}.theme__lavender.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#b450de}.theme__lavender.hi-checkbox input:focus+.hi-checkbox__input{border-color:#b450de}.theme__blue .hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#3da8f5}.theme__blue .hi-checkbox input:focus+.hi-checkbox__input{border-color:#3da8f5}.theme__blue .hi-checkbox__input--indeterminate{background:#3da8f5;border-color:#3da8f5}.theme__blue .hi-checkbox__input--indeterminate::after{background:#fff}.theme__blue .hi-checkbox__input--checked{background:#3da8f5;border-color:#3da8f5}.theme__blue.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#3da8f5}.theme__blue.hi-checkbox input:focus+.hi-checkbox__input{border-color:#3da8f5}.theme__purple .hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#8a8acb}.theme__purple .hi-checkbox input:focus+.hi-checkbox__input{border-color:#8a8acb}.theme__purple .hi-checkbox__input--indeterminate{background:#8a8acb;border-color:#8a8acb}.theme__purple .hi-checkbox__input--indeterminate::after{background:#fff}.theme__purple .hi-checkbox__input--checked{background:#8a8acb;border-color:#8a8acb}.theme__purple.hi-checkbox:not(.hi-checkbox--disabled):hover .hi-checkbox__input{border-color:#8a8acb}.theme__purple.hi-checkbox input:focus+.hi-checkbox__input{border-color:#8a8acb}
@@ -18,7 +18,9 @@ var _icon = _interopRequireDefault(require("../icon"));
18
18
  var _lodash = _interopRequireDefault(require("lodash"));
19
19
 
20
20
  var Panel = function Panel(_ref) {
21
- var key = _ref.key,
21
+ var className = _ref.className,
22
+ style = _ref.style,
23
+ key = _ref.key,
22
24
  arrow = _ref.arrow,
23
25
  header = _ref.header,
24
26
  _ref$disabled = _ref.disabled,
@@ -37,7 +39,7 @@ var Panel = function Panel(_ref) {
37
39
  var classnames = (0, _classnames["default"])('collapse-item', {
38
40
  'collapse-item--show': isActive,
39
41
  'collapse-item--disabled': disabled
40
- });
42
+ }, className);
41
43
  var onKeyDown = (0, _react.useCallback)(function (e) {
42
44
  if ([13, 32].includes(e.keyCode)) {
43
45
  e.preventDefault();
@@ -108,7 +110,8 @@ var Panel = function Panel(_ref) {
108
110
  }
109
111
  }, [panels, panelContainer, panelIndex]);
110
112
  return /*#__PURE__*/_react["default"].createElement("div", {
111
- className: classnames
113
+ className: classnames,
114
+ style: style
112
115
  }, /*#__PURE__*/_react["default"].createElement("div", {
113
116
  className: "collapse-item__head",
114
117
  onClick: function onClick() {
@@ -15,6 +15,8 @@ export interface CollapsePanelProps {
15
15
  title?: string | JSX.Element
16
16
  disabled?: boolean
17
17
  extra?: React.ReactNode
18
+ className?: string
19
+ style?: React.CSSProperties
18
20
  }
19
21
  declare class Panel extends React.Component<CollapsePanelProps, any> {
20
22
  }
@@ -146,11 +146,14 @@ var Collapse = /*#__PURE__*/function (_Component) {
146
146
  value: function render() {
147
147
  var _this$props4 = this.props,
148
148
  prefixCls = _this$props4.prefixCls,
149
- type = _this$props4.type;
150
- var classnames = (0, _classnames["default"])(prefixCls, type && "".concat(prefixCls, "__").concat(type));
149
+ type = _this$props4.type,
150
+ className = _this$props4.className,
151
+ style = _this$props4.style;
152
+ var classnames = (0, _classnames["default"])(prefixCls, type && "".concat(prefixCls, "__").concat(type), className);
151
153
  return /*#__PURE__*/_react["default"].createElement("div", {
152
154
  className: classnames,
153
- ref: this.panelContainer
155
+ ref: this.panelContainer,
156
+ style: style
154
157
  }, this.renderPanels());
155
158
  }
156
159
  }], [{
@@ -177,6 +177,8 @@ var BasePicker = function BasePicker(_ref) {
177
177
  }
178
178
  };
179
179
 
180
+ var _weekOffset = weekOffset !== undefined ? weekOffset : locale === 'en-US' ? 0 : 1;
181
+
180
182
  var callback = function callback(dates) {
181
183
  var emitOnChange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
182
184
 
@@ -185,12 +187,28 @@ var BasePicker = function BasePicker(_ref) {
185
187
  var returnDate = {};
186
188
  var returnDateStr = '';
187
189
 
188
- if (type.includes('range') || type === 'timeperiod' || type === 'week') {
190
+ var formatWeek = function formatWeek(disposeDate) {
191
+ if (!disposeDate) return '';
192
+ if (typeof format !== 'undefined') return disposeDate.format(iFormat);
193
+ var clone = (0, _utils.normalizeWeekOffset)(disposeDate, _weekOffset);
194
+ return clone.weekYear() + '-W' + clone.week();
195
+ };
196
+
197
+ if (type.includes('week')) {
198
+ returnDate = {
199
+ start: _dates[0].toDate(),
200
+ end: _dates[1].toDate()
201
+ };
202
+ returnDateStr = type.includes('range') ? {
203
+ start: formatWeek(_dates[0]),
204
+ end: formatWeek(_dates[1])
205
+ } : formatWeek(_dates[0]);
206
+ } else if (type.includes('range') || type === 'timeperiod') {
189
207
  returnDate = {
190
208
  start: _dates[0].toDate(),
191
209
  end: _dates[1].toDate()
192
210
  };
193
- returnDateStr = type === 'week' ? _dates[0].format(iFormat) : {
211
+ returnDateStr = {
194
212
  start: _dates[0].format(iFormat),
195
213
  end: _dates[1].format(iFormat)
196
214
  };
@@ -258,9 +276,6 @@ var BasePicker = function BasePicker(_ref) {
258
276
  }
259
277
  }, [propsOnSelect]);
260
278
  var popperCls = (0, _classnames["default"])('hi-datepicker__popper', type === 'date' && showTime && 'hi-datepicker__popper--time', type.includes('range') && 'hi-datepicker__popper--range', type === 'timeperiod' && 'hi-datepicker__popper--timeperiod', shortcuts && 'hi-datepicker__popper--shortcuts', isLarge && 'hi-datepicker__popper--large');
261
-
262
- var _weekOffset = weekOffset !== undefined ? weekOffset : locale === 'en-US' ? 0 : 1;
263
-
264
279
  return /*#__PURE__*/_react["default"].createElement(_context["default"].Provider, {
265
280
  value: _objectSpread(_objectSpread({}, otherPorps), {}, {
266
281
  locale: locale,
@@ -137,12 +137,12 @@ var TimePicker = function TimePicker(_ref) {
137
137
 
138
138
  if (type.includes('range')) {
139
139
  returnDate = {
140
- start: _dates[0].toDate(),
141
- end: _dates[1].toDate()
140
+ start: _dates[0] ? _dates[0].toDate() : null,
141
+ end: _dates[1] ? _dates[1].toDate() : null
142
142
  };
143
143
  returnDateStr = {
144
- start: _dates[0].format(iFormat),
145
- end: _dates[1].format(iFormat)
144
+ start: _dates[0] ? _dates[0].format(iFormat) : '',
145
+ end: _dates[1] ? _dates[1].format(iFormat) : ''
146
146
  };
147
147
  } else {
148
148
  returnDate = _dates[0].toDate();
@@ -19,6 +19,8 @@ var _context = _interopRequireDefault(require("../context"));
19
19
 
20
20
  var _hooks = require("../hooks");
21
21
 
22
+ var _utils = require("../utils");
23
+
22
24
  var Input = function Input(_ref) {
23
25
  var date = _ref.date,
24
26
  onChange = _ref.onChange,
@@ -35,6 +37,7 @@ var Input = function Input(_ref) {
35
37
  minuteStep = _useContext.minuteStep,
36
38
  secondStep = _useContext.secondStep,
37
39
  inputReadOnly = _useContext.inputReadOnly,
40
+ weekOffset = _useContext.weekOffset,
38
41
  locale = _useContext.locale;
39
42
 
40
43
  var _useFormat = (0, _hooks.useFormat)({
@@ -57,14 +60,15 @@ var Input = function Input(_ref) {
57
60
  var vals = date && (0, _moment["default"])(date).format(iFormat);
58
61
 
59
62
  if (type.includes('week') && date) {
60
- var y = (0, _moment["default"])(date).weekYear();
61
-
62
- var _date = (0, _moment["default"])(date).year(y);
63
+ if (typeof format === 'undefined') {
64
+ var clone = (0, _utils.normalizeWeekOffset)(date, weekOffset);
65
+ vals = clone.weekYear() + '-W' + clone.week();
66
+ } else {
67
+ var y = (0, _moment["default"])(date).weekYear();
63
68
 
64
- vals = (0, _moment["default"])(_date).format(iFormat);
69
+ var _date = (0, _moment["default"])(date).year(y);
65
70
 
66
- if (locale === 'zh-CN' && typeof format === 'undefined') {
67
- vals = y + '-W' + (0, _moment["default"])(_date).week();
71
+ vals = (0, _moment["default"])(_date).format(iFormat);
68
72
  }
69
73
  }
70
74
 
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.parseValue = exports.getInRangeDate = exports.getFullTime = exports.getPRCDate = exports.showLargeCalendar = exports.getTimePeriodData = exports.parseRenderDates = exports.genNewDates = exports.getView = exports.deconstructDate = void 0;
8
+ exports.normalizeWeekOffset = exports.parseValue = exports.getInRangeDate = exports.getFullTime = exports.getPRCDate = exports.showLargeCalendar = exports.getTimePeriodData = exports.parseRenderDates = exports.genNewDates = exports.getView = exports.deconstructDate = void 0;
9
9
 
10
10
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
11
 
@@ -342,6 +342,15 @@ var parseValue = function parseValue(value, type, format, weekOffset) {
342
342
  }
343
343
 
344
344
  return [isValid ? _value : null];
345
+ }; // fix: 周计算 52 53 周偏差
346
+
347
+
348
+ exports.parseValue = parseValue;
349
+
350
+ var normalizeWeekOffset = function normalizeWeekOffset(date, weekOffset) {
351
+ var clone = date.clone();
352
+ clone.locale(weekOffset === 1 ? 'zh-CN' : 'en-US');
353
+ return clone;
345
354
  };
346
355
 
347
- exports.parseValue = parseValue;
356
+ exports.normalizeWeekOffset = normalizeWeekOffset;
package/es/form/Form.js CHANGED
@@ -164,11 +164,15 @@ var InternalForm = function InternalForm(props) {
164
164
 
165
165
  Object.keys(changeValues).forEach(function (changeValuesKey) {
166
166
  fields.forEach(function (filedItem) {
167
- var realField = filedItem.realField,
167
+ var field = filedItem.field,
168
+ realField = filedItem.realField,
168
169
  _type = filedItem._type,
169
- listname = filedItem.listname;
170
+ listname = filedItem.listname; // bugfix: https://github.com/XiaoMi/hiui/issues/2077
170
171
 
171
- if (realField === changeValuesKey && _type === 'list') {
172
+ if (_type === 'SchemaForm' && field === changeValuesKey) {
173
+ _changeValues[realField] = _transformValues[realField];
174
+ delete _changeValues[changeValuesKey];
175
+ } else if (realField === changeValuesKey && _type === 'list') {
172
176
  _changeValues[listname] = _transformValues[listname];
173
177
  delete _changeValues[changeValuesKey];
174
178
  }
package/es/form/Item.js CHANGED
@@ -282,7 +282,7 @@ var FormItem = function FormItem(props) {
282
282
  cb(errors);
283
283
  }
284
284
  });
285
- }, [props]);
285
+ }, [props, getRules, getFilteredRule]);
286
286
 
287
287
  var updateFieldInfoToReducer = function updateFieldInfoToReducer() {
288
288
  var _realField = _type === 'list' ? field : realField || field;
@@ -368,7 +368,7 @@ var FormItem = function FormItem(props) {
368
368
  handleField(eventName, nextValue);
369
369
  setValue(nextValue);
370
370
  } else if (eventName === 'onBlur') {
371
- handleField(eventName, eventInfo.current ? eventInfo.current.value : value); // 处理 onBlur 事件
371
+ handleField(eventName, eventInfo.current ? eventInfo.current.value : value === undefined ? nextValue : value); // 处理 onBlur 事件
372
372
 
373
373
  var _children = childrenRef.current;
374
374
 
package/es/form/utils.js CHANGED
@@ -33,6 +33,7 @@ var transformValues = function transformValues(allvalue, fields) {
33
33
 
34
34
  sortfields.forEach(function (filedItem) {
35
35
  var realField = filedItem.realField,
36
+ field = filedItem.field,
36
37
  propsField = filedItem.propsField,
37
38
  _type = filedItem._type,
38
39
  listname = filedItem.listname;
@@ -57,13 +58,21 @@ var transformValues = function transformValues(allvalue, fields) {
57
58
  tranformValues[listname] = [allvalue[realField]];
58
59
  }
59
60
  } else {
61
+ var readField = realField; // bugfix: https://github.com/XiaoMi/hiui/issues/2077
62
+
63
+ if (_type === 'SchemaForm' && field) {
64
+ if (Object.keys(allvalue).includes(field)) {
65
+ readField = field;
66
+ }
67
+ }
68
+
60
69
  if (Array.isArray(propsField)) {
61
70
  var chainKeys = propsField.reduceRight(function (pre, next) {
62
71
  return (0, _defineProperty2["default"])({}, next, pre);
63
- }, allvalue[realField]);
72
+ }, allvalue[readField]);
64
73
  tranformValues = _lodash["default"].merge(tranformValues, chainKeys);
65
74
  } else {
66
- tranformValues = _lodash["default"].merge(tranformValues, (0, _defineProperty2["default"])({}, realField, allvalue[realField]));
75
+ tranformValues = _lodash["default"].merge(tranformValues, (0, _defineProperty2["default"])({}, realField, allvalue[readField]));
67
76
  }
68
77
  }
69
78
  });
package/es/input/Input.js CHANGED
@@ -11,6 +11,8 @@ exports["default"] = void 0;
11
11
 
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
 
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
+
14
16
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
17
 
16
18
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
@@ -31,6 +33,10 @@ var _classnames = _interopRequireDefault(require("classnames"));
31
33
 
32
34
  var _util = require("./util");
33
35
 
36
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
37
+
38
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
39
+
34
40
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
35
41
 
36
42
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
@@ -202,8 +208,11 @@ var Input = /*#__PURE__*/function (_Component) {
202
208
 
203
209
  value = (0, _util.format)(value, type); // 保证 onChange 拿到的是值是最新的 formatted value
204
210
 
205
- e.target.value = value;
206
- _this2.props.onChange && _this2.props.onChange(e, valueTrue);
211
+ var event = Object.create(e);
212
+ event.target = _objectSpread(_objectSpread({}, e.target), {}, {
213
+ value: value
214
+ });
215
+ _this2.props.onChange && _this2.props.onChange(event, valueTrue);
207
216
  _this2.props.value === undefined && _this2.setState({
208
217
  value: value,
209
218
  valueTrue: valueTrue
@@ -302,6 +311,7 @@ var Input = /*#__PURE__*/function (_Component) {
302
311
  attrs = (0, _objectWithoutProperties2["default"])(_this$attrs2, ["defaultValue"]);
303
312
  var filterAttrs = (0, _util.filterObjProps)(attrs, ['locale', 'theme', 'suffixicon', 'suffix', 'prepend', 'prefixicon', 'prefix', 'localeDatas', 'append', 'innerRef', 'clearable']);
304
313
  return /*#__PURE__*/_react["default"].createElement("textarea", (0, _extends2["default"])({
314
+ ref: this._Input,
305
315
  className: "hi-input theme__".concat(theme, " ").concat(active ? 'active' : '', " ").concat(disabled ? 'disabled' : '', " ").concat(className || ''),
306
316
  style: this.props.style,
307
317
  autoComplete: "off",
@@ -1 +1 @@
1
- textarea.hi-input{display:block;-webkit-box-shadow:none;box-shadow:none;outline:none;color:var(--color-black);font-size:14px;min-height:32px;height:auto;line-height:22px;resize:vertical;overflow:auto;padding:4px 12px;border:1px solid var(--color-gray-30);-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:2px;background-color:var(--color-white);-webkit-transition:border-color 0.3s;transition:border-color 0.3s}textarea.hi-input:not(.disabled):hover{z-index:1;border-color:var(--color-primary)}textarea.hi-input.active{z-index:1;border-color:var(--color-primary)}textarea.hi-input.disabled{color:var(--color-gray-50);background-color:var(--color-gray-10);cursor:not-allowed}textarea.hi-input::-webkit-input-placeholder{color:var(--color-gray-50)}textarea.hi-input:-moz-placeholder{color:var(--color-gray-50)}textarea.hi-input::-moz-placeholder{color:var(--color-gray-50)}textarea.hi-input:-ms-input-placeholder{color:var(--color-gray-50)}.hi-input,.hi-input_m{position:relative;display:inline-block;width:100%;height:32px;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-input ::-webkit-input-placeholder,.hi-input_m ::-webkit-input-placeholder{color:var(--color-gray-50)}.hi-input :-moz-placeholder,.hi-input_m :-moz-placeholder{color:var(--color-gray-50)}.hi-input ::-moz-placeholder,.hi-input_m ::-moz-placeholder{color:var(--color-gray-50)}.hi-input :-ms-input-placeholder,.hi-input_m :-ms-input-placeholder{color:var(--color-gray-50)}.hi-input input,.hi-input_m input{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;border:none;outline:none;min-height:30px;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--color-black);font-size:14px;line-height:22px;-webkit-box-shadow:none;box-shadow:none}.hi-input input.disabled,.hi-input_m input.disabled{color:var(--color-gray-50);background-color:var(--color-gray-10);cursor:not-allowed}.hi-input input[type='search'],.hi-input_m input[type='search']{-webkit-appearance:none}.hi-input ::-webkit-search-cancel-button,.hi-input_m ::-webkit-search-cancel-button{display:none}.hi-input .hi-input__out,.hi-input_m .hi-input__out{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;height:100%}.hi-input .hi-input__inner,.hi-input_m .hi-input__inner{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:2px;background-color:var(--color-white);-webkit-transition:border-color 0.3s;transition:border-color 0.3s}.hi-input .hi-input__inner.bordered,.hi-input_m .hi-input__inner.bordered{border:1px solid var(--color-gray-30)}.hi-input .hi-input__inner:not(.disabled):hover,.hi-input_m .hi-input__inner:not(.disabled):hover{z-index:1;border-color:var(--color-primary)}.hi-input .hi-input__inner.active,.hi-input_m .hi-input__inner.active{z-index:1;border-color:var(--color-primary)}.hi-input .hi-input__inner.disabled,.hi-input_m .hi-input__inner.disabled{color:var(--color-gray-50);background-color:var(--color-gray-10)}.hi-input__fix-box,.hi-input_m__fix-box{display:inline-block;width:12px;height:auto;padding:0 18px 0 2px;-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;cursor:pointer;opacity:1;-webkit-transition:all 0.3s;transition:all 0.3s}.hi-input__fix-box.invisible,.hi-input_m__fix-box.invisible{visibility:hidden;opacity:0}.hi-input__fix-box .hi-input__clear,.hi-input_m__fix-box .hi-input__clear{display:block;border-radius:50%;color:var(--color-gray-50);font-size:22px;text-align:center}.hi-input__fix-box .hi-input__clear:hover,.hi-input_m__fix-box .hi-input__clear:hover{color:var(--color-black)}.hi-input__fix-box .hi-input__suffix__icon,.hi-input_m__fix-box .hi-input__suffix__icon{position:absolute;top:50%;width:14px;height:14px;line-height:14px;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:14px}.hi-input__text,.hi-input_m__text{width:100%;padding:4px 12px}.hi-input__prefix,.hi-input__suffix,.hi-input_m__prefix,.hi-input_m__suffix{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around;-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;color:var(--color-black);font-size:14px;line-height:30px}.hi-input__prefix,.hi-input_m__prefix{padding-left:12px}.hi-input__suffix,.hi-input_m__suffix{padding-right:12px}.hi-input--prepend .hi-input__inner,.hi-input_m--prepend .hi-input__inner{border-top-left-radius:0;border-bottom-left-radius:0}.hi-input__prepend,.hi-input_m__prepend{margin-right:-1px;z-index:1}.hi-input__prepend .hi-btn,.hi-input__prepend .hi-select__input,.hi-input_m__prepend .hi-btn,.hi-input_m__prepend .hi-select__input{border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:2px;border-bottom-left-radius:2px}.hi-input--append .hi-input__inner,.hi-input_m--append .hi-input__inner{border-top-right-radius:0;border-bottom-right-radius:0}.hi-input__append,.hi-input_m__append{color:var(--color-primary);margin-left:-1px}.hi-input__append .hi-btn,.hi-input__append .hi-select__input,.hi-input_m__append .hi-btn,.hi-input_m__append .hi-select__input{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px}.hi-input.required::after,.hi-input_m.required::after{position:absolute;top:0;content:'*';right:-30px;width:30px;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#f44343}
1
+ textarea.hi-input{display:block;-webkit-box-shadow:none;box-shadow:none;outline:none;color:var(--color-black);font-size:14px;min-height:32px;height:auto;line-height:22px;resize:vertical;overflow:auto;padding:4px 12px;border:1px solid var(--color-gray-30);-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:2px;background-color:var(--color-white);-webkit-transition:border-color 0.3s;transition:border-color 0.3s}textarea.hi-input:not(.disabled):hover{z-index:1;border-color:var(--color-primary)}textarea.hi-input.active{z-index:1;border-color:var(--color-primary)}textarea.hi-input.disabled{color:var(--color-gray-50);background-color:var(--color-gray-10);cursor:not-allowed}textarea.hi-input::-webkit-input-placeholder{color:var(--color-gray-50)}textarea.hi-input:-moz-placeholder{color:var(--color-gray-50)}textarea.hi-input::-moz-placeholder{color:var(--color-gray-50)}textarea.hi-input:-ms-input-placeholder{color:var(--color-gray-50)}.hi-input,.hi-input_m{position:relative;z-index:0;display:inline-block;width:100%;height:32px;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-input ::-webkit-input-placeholder,.hi-input_m ::-webkit-input-placeholder{color:var(--color-gray-50)}.hi-input :-moz-placeholder,.hi-input_m :-moz-placeholder{color:var(--color-gray-50)}.hi-input ::-moz-placeholder,.hi-input_m ::-moz-placeholder{color:var(--color-gray-50)}.hi-input :-ms-input-placeholder,.hi-input_m :-ms-input-placeholder{color:var(--color-gray-50)}.hi-input input,.hi-input_m input{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;border:none;outline:none;min-height:30px;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--color-black);font-size:14px;line-height:22px;-webkit-box-shadow:none;box-shadow:none}.hi-input input.disabled,.hi-input_m input.disabled{color:var(--color-gray-50);background-color:var(--color-gray-10);cursor:not-allowed}.hi-input input[type='search'],.hi-input_m input[type='search']{-webkit-appearance:none}.hi-input ::-webkit-search-cancel-button,.hi-input_m ::-webkit-search-cancel-button{display:none}.hi-input .hi-input__out,.hi-input_m .hi-input__out{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;height:100%}.hi-input .hi-input__inner,.hi-input_m .hi-input__inner{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:2px;background-color:var(--color-white);-webkit-transition:border-color 0.3s;transition:border-color 0.3s}.hi-input .hi-input__inner.bordered,.hi-input_m .hi-input__inner.bordered{border:1px solid var(--color-gray-30)}.hi-input .hi-input__inner:not(.disabled):hover,.hi-input_m .hi-input__inner:not(.disabled):hover{z-index:1;border-color:var(--color-primary)}.hi-input .hi-input__inner.active,.hi-input_m .hi-input__inner.active{z-index:1;border-color:var(--color-primary)}.hi-input .hi-input__inner.disabled,.hi-input_m .hi-input__inner.disabled{color:var(--color-gray-50);background-color:var(--color-gray-10)}.hi-input__fix-box,.hi-input_m__fix-box{display:inline-block;width:12px;height:auto;padding:0 18px 0 2px;-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;cursor:pointer;opacity:1;-webkit-transition:all 0.3s;transition:all 0.3s}.hi-input__fix-box.invisible,.hi-input_m__fix-box.invisible{visibility:hidden;opacity:0}.hi-input__fix-box .hi-input__clear,.hi-input_m__fix-box .hi-input__clear{display:block;border-radius:50%;color:var(--color-gray-50);font-size:22px;text-align:center}.hi-input__fix-box .hi-input__clear:hover,.hi-input_m__fix-box .hi-input__clear:hover{color:var(--color-black)}.hi-input__fix-box .hi-input__suffix__icon,.hi-input_m__fix-box .hi-input__suffix__icon{position:absolute;top:50%;width:14px;height:14px;line-height:14px;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:14px}.hi-input__text,.hi-input_m__text{width:100%;padding:4px 12px}.hi-input__prefix,.hi-input__suffix,.hi-input_m__prefix,.hi-input_m__suffix{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around;-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;color:var(--color-black);font-size:14px;line-height:30px}.hi-input__prefix,.hi-input_m__prefix{padding-left:12px}.hi-input__suffix,.hi-input_m__suffix{padding-right:12px}.hi-input--prepend .hi-input__inner,.hi-input_m--prepend .hi-input__inner{border-top-left-radius:0;border-bottom-left-radius:0}.hi-input__prepend,.hi-input_m__prepend{margin-right:-1px;z-index:1}.hi-input__prepend .hi-btn,.hi-input__prepend .hi-select__input,.hi-input_m__prepend .hi-btn,.hi-input_m__prepend .hi-select__input{border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:2px;border-bottom-left-radius:2px}.hi-input--append .hi-input__inner,.hi-input_m--append .hi-input__inner{border-top-right-radius:0;border-bottom-right-radius:0}.hi-input__append,.hi-input_m__append{color:var(--color-primary);margin-left:-1px}.hi-input__append .hi-btn,.hi-input__append .hi-select__input,.hi-input_m__append .hi-btn,.hi-input_m__append .hi-select__input{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px}.hi-input.required::after,.hi-input_m.required::after{position:absolute;top:0;content:'*';right:-30px;width:30px;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#f44343}
@@ -18,6 +18,7 @@ export interface ModalProps extends ModalBaseProps {
18
18
  footer?: JSX.Element | null
19
19
  style?: React.CSSProperties
20
20
  confirmLoading?: boolean
21
+ modalContentRef?: React.Ref<HTMLDivElement | null>
21
22
  }
22
23
 
23
24
  export interface ModalOptions extends ModalBaseProps {
package/es/modal/index.js CHANGED
@@ -66,6 +66,7 @@ var InternalModalComp = function InternalModalComp(_ref) {
66
66
  style = _ref.style,
67
67
  className = _ref.className,
68
68
  destroyOnClose = _ref.destroyOnClose,
69
+ modalContentRef = _ref.modalContentRef,
69
70
  localeDatas = _ref.localeDatas,
70
71
  _ref$foucsElementOnCl = _ref.foucsElementOnClose,
71
72
  foucsElementOnClose = _ref$foucsElementOnCl === void 0 ? null : _ref$foucsElementOnCl,
@@ -88,7 +89,7 @@ var InternalModalComp = function InternalModalComp(_ref) {
88
89
  setCloseable = _useState2[1];
89
90
 
90
91
  (0, _react.useEffect)(function () {
91
- setCloseable(closeable);
92
+ setCloseable(propCloseable);
92
93
  }, [propCloseable]);
93
94
  var trapTabKey = (0, _react.useCallback)(function (e) {
94
95
  // Find all focusable children
@@ -209,6 +210,7 @@ var InternalModalComp = function InternalModalComp(_ref) {
209
210
  }
210
211
  }
211
212
  })), /*#__PURE__*/_react["default"].createElement("div", {
213
+ ref: modalContentRef,
212
214
  className: "".concat(PREFIX, "__content")
213
215
  }, children), footer !== null && /*#__PURE__*/_react["default"].createElement("div", {
214
216
  className: (0, _classnames["default"])("".concat(PREFIX, "__footer"), (0, _defineProperty2["default"])({}, "".concat(PREFIX, "__footer--divided"), showFooterDivider))
@@ -13,6 +13,7 @@ export interface ProgressProps {
13
13
  height?: string | number
14
14
  style?: React.CSSProperties
15
15
  className?: string
16
+ percent?: number
16
17
  }
17
18
  declare const Progress: React.ComponentType<ProgressProps>
18
19
  export default Progress
@@ -73,6 +73,7 @@ var Search = function Search(_ref) {
73
73
  var optionsClick = (0, _react.useCallback)(function (value, item) {
74
74
  setInputVal(value);
75
75
  setDropdownShow(false);
76
+ _onChange && _onChange(value);
76
77
  onSearch && onSearch(value, item);
77
78
  }, [onSearch]);
78
79
  var moveFocus = (0, _react.useCallback)(function (direction) {
@@ -46,7 +46,7 @@ var BodyTable = function BodyTable(_ref) {
46
46
  syncScrollLeft = _useContext.syncScrollLeft,
47
47
  firstRowRef = _useContext.firstRowRef,
48
48
  realColumnsWidth = _useContext.realColumnsWidth,
49
- resizable = _useContext.resizable,
49
+ isResizableColKey = _useContext.isResizableColKey,
50
50
  prefix = _useContext.prefix,
51
51
  hoverColIndex = _useContext.hoverColIndex,
52
52
  setHoverColIndex = _useContext.setHoverColIndex,
@@ -240,12 +240,13 @@ var BodyTable = function BodyTable(_ref) {
240
240
  ref: tableRef
241
241
  }, /*#__PURE__*/_react["default"].createElement("colgroup", null, columnsgroup.map(function (c, index) {
242
242
  var width = c === 'checkbox' ? checkboxColWidth : c.width;
243
+ var resizable = isResizableColKey(c.dataKey);
243
244
  return /*#__PURE__*/_react["default"].createElement("col", {
244
245
  key: index,
245
246
  className: (0, _classnames["default"])((0, _defineProperty2["default"])({}, "".concat(prefix, "__col__hover--highlight"), showColHighlight && hoverColIndex === c.dataKey)),
246
247
  style: {
247
- width: resizable ? realColumnsWidth[index] : width,
248
- minWidth: resizable ? realColumnsWidth[index] : width
248
+ width: resizable ? realColumnsWidth[index] || width : width,
249
+ minWidth: resizable ? realColumnsWidth[index] || width : width
249
250
  }
250
251
  });
251
252
  })), /*#__PURE__*/_react["default"].createElement("tbody", null, _data && _data.length > 0 ? _data.map(function (row, index) {
@@ -57,7 +57,7 @@ var HeaderTable = function HeaderTable(_ref) {
57
57
  prefix = _useContext.prefix,
58
58
  realColumnsWidth = _useContext.realColumnsWidth,
59
59
  setRealColumnsWidth = _useContext.setRealColumnsWidth,
60
- resizable = _useContext.resizable,
60
+ isResizableColKey = _useContext.isResizableColKey,
61
61
  setting = _useContext.setting,
62
62
  onHeaderRow = _useContext.onHeaderRow,
63
63
  sticky = _useContext.sticky,
@@ -115,11 +115,11 @@ var HeaderTable = function HeaderTable(_ref) {
115
115
  if (rowSelection) {
116
116
  var _rowSelection$selecte = rowSelection.selectedRowKeys,
117
117
  selectedRowKeys = _rowSelection$selecte === void 0 ? [] : _rowSelection$selecte;
118
- var flattedData = (0, _util.flatTreeData)((0, _util.cloneArray)(data));
119
-
120
- var _isAllChecked = flattedData.filter(function (data) {
118
+ var flattedData = (0, _util.flatTreeData)((0, _util.cloneArray)(data)).filter(function (data) {
121
119
  return !disabledData.current.includes(data.key);
122
- }).every(function (d) {
120
+ });
121
+
122
+ var _isAllChecked = flattedData.every(function (d) {
123
123
  return selectedRowKeys.includes(d.key);
124
124
  }) && flattedData.length !== 0;
125
125
 
@@ -198,7 +198,7 @@ var HeaderTable = function HeaderTable(_ref) {
198
198
  });
199
199
 
200
200
  var isStickyCol = _colums.some(function (item) {
201
- return typeof item.leftStickyWidth !== 'undefined' || typeof item.rightStickyWidth !== 'undefined';
201
+ return typeof item.leftStickyWidth !== 'undefined';
202
202
  });
203
203
 
204
204
  return /*#__PURE__*/_react["default"].createElement("tr", {
@@ -292,6 +292,7 @@ var HeaderTable = function HeaderTable(_ref) {
292
292
  })));
293
293
  }
294
294
 
295
+ var resizable = isResizableColKey(c.dataKey);
295
296
  return resizable && idx !== cols.length - 1 ? /*#__PURE__*/_react["default"].createElement(_reactResizable.Resizable, {
296
297
  key: idx,
297
298
  width: realColumnsWidth[idx],
@@ -340,7 +341,8 @@ var HeaderTable = function HeaderTable(_ref) {
340
341
  },
341
342
  ref: headerInner
342
343
  }, /*#__PURE__*/_react["default"].createElement("colgroup", null, columnsgroup.map(function (c, index) {
343
- var width = resizable ? realColumnsWidth[index] : c.width;
344
+ var resizable = isResizableColKey(c.dataKey);
345
+ var width = resizable ? realColumnsWidth[index] || c.width : c.width;
344
346
  return /*#__PURE__*/_react["default"].createElement("col", {
345
347
  key: index,
346
348
  style: {
package/es/table/Row.js CHANGED
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
12
14
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
15
 
14
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
@@ -88,7 +90,9 @@ var Row = function Row(_ref) {
88
90
  disabledData = _useContext.disabledData,
89
91
  draggable = _useContext.draggable,
90
92
  onDragStart = _useContext.onDragStart,
91
- dargInfo = _useContext.dargInfo;
93
+ dargInfo = _useContext.dargInfo,
94
+ onRow = _useContext.onRow,
95
+ highlightRowOnDoubleClick = _useContext.highlightRowOnDoubleClick;
92
96
 
93
97
  var _columns = (0, _util.cloneArray)(columns);
94
98
 
@@ -98,7 +102,7 @@ var Row = function Row(_ref) {
98
102
  return col.isLast;
99
103
  });
100
104
  var isSticky = rowColumns.some(function (item) {
101
- return typeof item.leftStickyWidth !== 'undefined' || typeof item.rightStickyWidth !== 'undefined';
105
+ return typeof item.leftStickyWidth !== 'undefined';
102
106
  });
103
107
  var checkboxConfig = rowSelection && rowSelection.getCheckboxConfig && rowSelection.getCheckboxConfig(allRowData);
104
108
  var checkboxDisabled = checkboxConfig && checkboxConfig.disabled || false;
@@ -137,13 +141,15 @@ var Row = function Row(_ref) {
137
141
  });
138
142
  dragKey !== rowKey && setDropHightLineStatus(clienY < startClientY ? 'top' : 'bottom');
139
143
  }, [rowKey, dropHightLineStatus, draggable]);
140
- return [/*#__PURE__*/_react["default"].createElement("tr", {
144
+ var onRowProps = onRow(isAvgRow || isSumRow ? null : rowData, index);
145
+ return [/*#__PURE__*/_react["default"].createElement("tr", (0, _extends2["default"])({
141
146
  style: isFixed && rowHeight ? {
142
147
  height: rowHeight
143
148
  } : {},
144
149
  ref: innerRef,
145
150
  id: rowKey,
146
- draggable: draggable,
151
+ draggable: draggable
152
+ }, onRowProps, {
147
153
  onMouseMove: function onMouseMove() {
148
154
  setDragRowKey(null);
149
155
  setDragStatus(false);
@@ -163,9 +169,15 @@ var Row = function Row(_ref) {
163
169
  if (!draggable) return;
164
170
  setDropHightLineStatus(null);
165
171
  },
166
- className: (0, _classnames["default"])("".concat(prefix, "__row"), (_classNames = {}, (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--error"), errorRowKeys.includes(rowData.key)), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--highlight"), hoverRow === rowData.key || highlightedRowKeys.includes(rowData.key)), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--total"), isSumRow), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--draggable"), draggable), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--draging"), draggable && dragRowKey === rowKey), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--draggable__border--top"), draggable && typeof dargInfo.current.dropKey !== 'undefined' && dropHightLineStatus === 'top'), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--draggable__border--bottom"), draggable && typeof dargInfo.current.dropKey !== 'undefined' && dropHightLineStatus === 'bottom'), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--avg"), isAvgRow), _classNames)),
167
- key: "row",
168
172
  onDoubleClick: function onDoubleClick(e) {
173
+ if (onRowProps && onRowProps.onDoubleClick) {
174
+ onRowProps.onDoubleClick(e);
175
+ }
176
+
177
+ if (highlightRowOnDoubleClick === false) {
178
+ return;
179
+ }
180
+
169
181
  if (highlightedRowKeys.includes(rowData.key)) {
170
182
  setHighlightRows(highlightedRowKeys.filter(function (r) {
171
183
  return r !== rowData.key;
@@ -173,8 +185,10 @@ var Row = function Row(_ref) {
173
185
  } else {
174
186
  setHighlightRows(highlightedRowKeys.concat(rowData.key));
175
187
  }
176
- }
177
- }, rowSelection && isFixed !== 'right' && !isSumRow && !isAvgRow && /*#__PURE__*/_react["default"].createElement("td", {
188
+ },
189
+ className: (0, _classnames["default"])("".concat(prefix, "__row"), (_classNames = {}, (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--error"), errorRowKeys.includes(rowData.key)), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--highlight"), hoverRow === rowData.key || highlightedRowKeys.includes(rowData.key)), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--total"), isSumRow), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--draggable"), draggable), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--draging"), draggable && dragRowKey === rowKey), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--draggable__border--top"), draggable && typeof dargInfo.current.dropKey !== 'undefined' && dropHightLineStatus === 'top'), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--draggable__border--bottom"), draggable && typeof dargInfo.current.dropKey !== 'undefined' && dropHightLineStatus === 'bottom'), (0, _defineProperty2["default"])(_classNames, "".concat(prefix, "__row--avg"), isAvgRow), _classNames)),
190
+ key: "row"
191
+ }), rowSelection && isFixed !== 'right' && !isSumRow && !isAvgRow && /*#__PURE__*/_react["default"].createElement("td", {
178
192
  style: {
179
193
  width: checkboxColWidth
180
194
  },
@@ -240,12 +254,12 @@ var Row = function Row(_ref) {
240
254
  key: "expanded-row",
241
255
  className: "".concat(prefix, "--expanded"),
242
256
  style: {
243
- background: 'rgba(251,251,251,1)'
257
+ background: 'rgba(251, 251, 251, 1)'
244
258
  }
245
259
  }, rowSelection && /*#__PURE__*/_react["default"].createElement("td", null), /*#__PURE__*/_react["default"].createElement("td", {
246
260
  colSpan: columns.length + 1,
247
261
  style: {
248
- color: '#666666'
262
+ color: '#666'
249
263
  }
250
264
  }, /*#__PURE__*/_react["default"].createElement(_Expandcol["default"], {
251
265
  rowData: rowData,
package/es/table/Table.js CHANGED
@@ -71,8 +71,12 @@ var Table = function Table(_ref) {
71
71
  propsExpandRowKeys = _ref.expandedRowKeys,
72
72
  expandRowKeys = _ref.expandRowKeys,
73
73
  onExpand = _ref.onExpand,
74
+ _ref$fixedColumnTrigg = _ref.fixedColumnTrigger,
75
+ fixedColumnTrigger = _ref$fixedColumnTrigg === void 0 ? 'auto' : _ref$fixedColumnTrigg,
74
76
  _ref$onHeaderRow = _ref.onHeaderRow,
75
77
  onHeaderRow = _ref$onHeaderRow === void 0 ? defaultHeaderRow : _ref$onHeaderRow,
78
+ _ref$onRow = _ref.onRow,
79
+ onRow = _ref$onRow === void 0 ? defaultHeaderRow : _ref$onRow,
76
80
  _ref$columns = _ref.columns,
77
81
  propsColumns = _ref$columns === void 0 ? [] : _ref$columns,
78
82
  expandedRender = _ref.expandedRender,
@@ -102,6 +106,7 @@ var Table = function Table(_ref) {
102
106
  setCacheHiddenColKeys = _ref.setCacheHiddenColKeys,
103
107
  hiddenColKeys = _ref.hiddenColKeys,
104
108
  setHiddenColKeys = _ref.setHiddenColKeys,
109
+ disabledResizableColKeys = _ref.disabledResizableColKeys,
105
110
  scrollWidth = _ref.scrollWidth,
106
111
  theme = _ref.theme,
107
112
  draggable = _ref.draggable,
@@ -112,7 +117,12 @@ var Table = function Table(_ref) {
112
117
  onDropEnd = _ref.onDropEnd,
113
118
  cellRender = _ref.cellRender,
114
119
  _ref$emptyContent = _ref.emptyContent,
115
- emptyContent = _ref$emptyContent === void 0 ? localeDatas.table.emptyContent : _ref$emptyContent;
120
+ emptyContent = _ref$emptyContent === void 0 ? localeDatas.table.emptyContent : _ref$emptyContent,
121
+ _ref$highlightRowOnDo = _ref.highlightRowOnDoubleClick,
122
+ highlightRowOnDoubleClick = _ref$highlightRowOnDo === void 0 ? true : _ref$highlightRowOnDo;
123
+ var isResizableColKey = (0, _react.useCallback)(function (colKey) {
124
+ return resizable && colKey && (!Array.isArray(disabledResizableColKeys) || disabledResizableColKeys.indexOf(colKey) === -1);
125
+ }, [resizable, disabledResizableColKeys]);
116
126
  var dargInfo = (0, _react.useRef)({
117
127
  dragKey: null
118
128
  });
@@ -448,6 +458,7 @@ var Table = function Table(_ref) {
448
458
  }, [data, draggable]); // 自定义设置 checkbox 列宽度
449
459
 
450
460
  var checkboxColWidth = rowSelection && typeof rowSelection.checkboxColWidth === 'number' ? rowSelection.checkboxColWidth : 50;
461
+ var alwaysFixedColumn = fixedColumnTrigger === 'always';
451
462
  return /*#__PURE__*/_react["default"].createElement(_context["default"].Provider, {
452
463
  value: {
453
464
  cellRender: cellRender,
@@ -460,6 +471,7 @@ var Table = function Table(_ref) {
460
471
  errorRowKeys: errorRowKeys,
461
472
  bordered: _bordered,
462
473
  resizable: resizable,
474
+ isResizableColKey: isResizableColKey,
463
475
  rowSelection: rowSelection,
464
476
  highlightedRowKeys: _highlightRows,
465
477
  setHighlightRows: setHighlightRows,
@@ -471,6 +483,7 @@ var Table = function Table(_ref) {
471
483
  expandedRowKeys: expandedRowKeys,
472
484
  // 标题点击回调事件
473
485
  onHeaderRow: onHeaderRow,
486
+ onRow: onRow,
474
487
  onExpand: onExpand,
475
488
  realColumnsWidth: realColumnsWidth,
476
489
  setRealColumnsWidth: setRealColumnsWidth,
@@ -531,7 +544,8 @@ var Table = function Table(_ref) {
531
544
  dargInfo: dargInfo,
532
545
  onDragStart: onDragStart,
533
546
  onDrop: onDrop,
534
- onDropEnd: onDropEnd
547
+ onDropEnd: onDropEnd,
548
+ highlightRowOnDoubleClick: highlightRowOnDoubleClick
535
549
  }
536
550
  }, /*#__PURE__*/_react["default"].createElement("div", {
537
551
  className: (0, _classnames3["default"])(prefix, "theme__".concat(theme), (_classnames = {}, (0, _defineProperty2["default"])(_classnames, "".concat(prefix, "--striped"), striped), (0, _defineProperty2["default"])(_classnames, "".concat(prefix, "--bordered"), _bordered), (0, _defineProperty2["default"])(_classnames, "".concat(prefix, "--").concat(size), size), _classnames)),
@@ -543,14 +557,14 @@ var Table = function Table(_ref) {
543
557
  }, /*#__PURE__*/_react["default"].createElement(_HeaderTable["default"], null), /*#__PURE__*/_react["default"].createElement(_BodyTable["default"], {
544
558
  fatherRef: hiTable,
545
559
  emptyContent: emptyContent
546
- }), scrollSize.scrollLeft > 0 && realLeftFixedColumns.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
560
+ }), (alwaysFixedColumn || scrollSize.scrollLeft > 0) && realLeftFixedColumns.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
547
561
  className: "".concat(prefix, "__shadow-mask ").concat(prefix, "__shadow-left"),
548
562
  style: {
549
563
  width: fixedColumnsWidth.left + 'px'
550
564
  }
551
565
  }, /*#__PURE__*/_react["default"].createElement("div", {
552
566
  className: "".concat(prefix, "__shadow-lock")
553
- })), scrollSize.scrollRight > 0 && realRightFixedColumns.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
567
+ })), (alwaysFixedColumn || scrollSize.scrollRight > 0) && realRightFixedColumns.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
554
568
  className: "".concat(prefix, "__shadow-mask ").concat(prefix, "__shadow-right"),
555
569
  style: {
556
570
  width: fixedColumnsWidth.right + 'px'
@@ -61,6 +61,8 @@ export type TableHeaderRowReturn = {
61
61
 
62
62
  export type HeaderRowFunc = (colums: TableColumnItem[], index: number) => TableHeaderRowReturn
63
63
 
64
+ export type RowFunc = () => TableHeaderRowReturn
65
+
64
66
  export interface TableProps {
65
67
  size?: 'small' | 'large' | 'default' | 'mini'
66
68
  fieldKey?: string
@@ -70,6 +72,7 @@ export interface TableProps {
70
72
  sticky?: boolean
71
73
  draggable?: boolean
72
74
  stickyTop?: number
75
+ fixedColumnTrigger?: 'auto' | 'always'
73
76
  expandRowKeys?: React.ReactText[]
74
77
  highlightedColKeys?: string[]
75
78
  expandedRender?: (record: object, index: number) => JSX.Element | Promise
@@ -89,9 +92,11 @@ export interface TableProps {
89
92
  striped?: boolean
90
93
  setting?: boolean
91
94
  resizable?: boolean
95
+ disabledResizableColKeys?: string[]
92
96
  standard?: boolean
93
97
  emptyContent?: string | JSX.Element
94
98
  onHeaderRow?: HeaderRowFunc
99
+ onRow?: RowFunc
95
100
  columns: TableColumnItem[]
96
101
  data: object[]
97
102
  style?: React.CSSProperties
@@ -103,6 +108,8 @@ export interface TableProps {
103
108
  hiddenColKeys?: string[]
104
109
  onHiddenColKeysChange?: (hiddenColKeys: string[]) => void
105
110
  cellRender?: (text: any) => React.ReactNode
111
+ highlightRowOnDoubleClick?: boolean
106
112
  }
113
+
107
114
  declare const Table: React.ComponentType<TableProps>
108
115
  export default Table
@@ -1 +1 @@
1
- .hi-table{position:relative}.hi-table__container{position:relative;z-index:1}.hi-table__shadow-mask{position:absolute;top:0;bottom:0;z-index:20;pointer-events:none;overflow:hidden;height:100%;width:200px}.hi-table__shadow-lock{height:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-table__shadow-left{margin-right:10px;left:0;-webkit-box-shadow:6px 0 6px -4px rgba(0,0,0,0.15);box-shadow:6px 0 6px -4px rgba(0,0,0,0.15)}.hi-table__shadow-right{margin-left:10px;right:0;-webkit-box-shadow:-6px 0 6px -4px rgba(0,0,0,0.15);box-shadow:-6px 0 6px -4px rgba(0,0,0,0.15)}.hi-table__container table{width:100%;border-collapse:separate;background:var(--color-white);margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;display:table;border-spacing:0;overflow:auto}.hi-table__container table col{display:table-column}.hi-table__container table td,.hi-table__container table th{padding-left:8px;padding-right:16px;border-bottom:1px solid #e7e7e7;text-align:left;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-table__container table th{background-color:#fbfbfb;color:var(--color-gray-70)}.hi-table__container table th i:hover{color:var(--color-primary)}.hi-table__container table td{color:var(--color-black);word-break:break-word}.hi-table__container table tr{font-size:14px;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--color-white)}.hi-table__setting-menu div,.hi-table__setting-menu p,.hi-table__setting-menu ul,.hi-table__setting-menu li{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-table__col-menu{width:124px;font-size:14px;background:var(--color-white);-webkit-box-shadow:0 2px 8px 0 rgba(56,62,71,0.1);box-shadow:0 2px 8px 0 rgba(56,62,71,0.1);border-radius:4px;border:1px solid #e7e7e7;padding:7px 0}.hi-table__col-menu__item{cursor:pointer;color:var(--color-black);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:4px 12px}.hi-table__col-menu__item:hover{color:var(--color-primary)}.hi-table__col-menu__item.col-menu__item--highlight{color:var(--color-primary)}.hi-table__col-menu__item .hi-icon{font-size:16px}.hi-table__setting-menu .btn-group{display:-webkit-box;display:-ms-flexbox;display:flex;border-top:1px solid #e7e7e7;height:48px;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.hi-table__setting-menu .btn-group .btn{width:50%;text-align:center;cursor:pointer}.hi-table__setting-menu .btn-group .btn--left{border-right:1px solid #e7e7e7}.hi-table .hi-checkbox__input:not(.hi-checkbox__input--checked){background:var(--color-white)}.hi-table .hi-checkbox--disabled .hi-checkbox__input{border-color:#d8d8d8;background:#f2f2f2}.hi-table .hi-checkbox{height:auto}.hi-table th{font-weight:500;white-space:normal}.hi-table td{white-space:normal}.hi-table__setting-btn{position:absolute;height:100%;z-index:11;-webkit-box-sizing:border-box;box-sizing:border-box;right:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-left:1px solid #e0e1e2;border-bottom:1px solid #e0e1e2;border-top:none;color:#999;cursor:pointer;font-size:14px;width:16px;background:#fbfbfb}.hi-table__pagination{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;margin-top:20px}.hi-table__pagination--left{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.hi-table__pagination--middle{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.hi-table--small table tr{font-size:14px !important}.hi-table--small table tr>td{padding:8px !important}.hi-table--small table thead>tr>th{padding:8px !important}.hi-table--mini table tr{font-size:14px !important}.hi-table--mini table tr>td{padding:4px !important}.hi-table--mini table thead>tr>th{padding:4px !important}.hi-table--large table tr{font-size:14px !important}.hi-table--large table tr>td{padding:20px !important}.hi-table--large table thead>tr>th{padding:20px !important}.hi-table--striped table tr:nth-child(2n){background:#fbfbfb}.hi-table--striped table tr:nth-child(2n) .hi-table__col--sticky{background:#fbfbfb}.hi-table--bordered table thead>tr>th{border-right:1px solid #e6e7e8}.hi-table--bordered table td{border-right:1px solid var(--color-gray-20)}.hi-table--bordered .hi-table_header>table{border-top:1px solid #e6e7e8;border-left:1px solid #e6e7e8}.hi-table__container--fixed-left{z-index:1;position:absolute;top:0;-webkit-box-shadow:2px 0 4px rgba(187,187,187,0.4);box-shadow:2px 0 4px rgba(187,187,187,0.4);overflow:hidden}.hi-table__container--fixed-right{z-index:1;position:absolute;top:0;-webkit-box-shadow:-2px 0 4px rgba(187,187,187,0.4);box-shadow:-2px 0 4px rgba(187,187,187,0.4);overflow:hidden}.hi-table__header{overflow:hidden;position:relative}.hi-table__header>table{position:relative}.hi-table__header__title{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.hi-table__header--sticky{position:fixed;z-index:10;top:0;overflow-x:hidden}.hi-table__body--draging table tr:hover:not(.hi-table__row--draging){background:var(--color-white)}.hi-table__body--draging table tr:hover:not(.hi-table__row--draging) .hi-table__col--sticky{background:var(--color-white)}.hi-table__body--draging table tr.hi-table__row--draging{background:var(--color-primary-20)}.hi-table__body--draging table tr.hi-table__row--draging .hi-table__col--sticky{background:var(--color-primary-20)}.hi-table table{table-layout:fixed}.hi-table table thead>tr>th{background:#fbfbfb;color:var(--color-gray-70);padding:15px;border-bottom:1px solid #e6e7e8;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-table table tr{min-height:52px}.hi-table table tr .hi-table__col--sticky{position:sticky;left:0;z-index:5;background:var(--color-white)}.hi-table table tr:hover{background:var(--color-primary-20)}.hi-table table tr:hover .hi-table__col--sticky{background:var(--color-primary-20)}.hi-table table tr>td{color:var(--color-black);padding:15px;border-bottom:1px solid var(--color-gray-20);-webkit-box-sizing:border-box;box-sizing:border-box}.hi-table table tr.hi-table__row--draggable__border--top td{border-top:2px dashed var(--color-primary)}.hi-table table tr.hi-table__row--draggable__border--bottom td{border-bottom:2px dashed var(--color-primary)}.hi-table table .hi-table__row .hi-table__indent{display:inline-block;width:14px;height:100%}.hi-table table .hi-table__row--expanded{background:#fbfbfb}.hi-table table .hi-table__row--expanded>td{color:var(--color-gray-80)}.hi-table table .hi-table__row.hi-table__row--error>td{color:#f44343}.hi-table table .hi-table__row.hi-table__row--highlight>td{background:var(--color-primary-20)}.hi-table table .hi-table__row.hi-table__row--total>td{background-color:#fbfbfb}.hi-table table .hi-table__row.hi-table__row--avg>td{background-color:#fbfbfb}.hi-table table .hi-table__row.hi-table__row--draggable{cursor:move}.hi-table table .hi-table__row>.hi-table__col--highlight{background:var(--color-primary-20)}.hi-table table .hi-table__row .hi-table__col__hover--highlight{background:var(--color-primary-10)}.react-resizable{position:relative;background-clip:padding-box}.react-resizable-handle{position:absolute;width:10px;height:100%;bottom:0;right:-5px;cursor:col-resize;z-index:1}
1
+ .hi-table{position:relative}.hi-table__container{position:relative;z-index:1}.hi-table__shadow-mask{position:absolute;top:0;bottom:0;z-index:20;pointer-events:none;overflow:hidden;height:100%;width:200px}.hi-table__shadow-lock{height:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-table__shadow-left{margin-right:10px;left:0;-webkit-box-shadow:6px 0 6px -4px rgba(0,0,0,0.15);box-shadow:6px 0 6px -4px rgba(0,0,0,0.15)}.hi-table__shadow-right{margin-left:10px;right:0;-webkit-box-shadow:-6px 0 6px -4px rgba(0,0,0,0.15);box-shadow:-6px 0 6px -4px rgba(0,0,0,0.15)}.hi-table__container table{width:100%;border-collapse:separate;background:var(--color-white);margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;display:table;border-spacing:0;overflow:auto}.hi-table__container table col{display:table-column}.hi-table__container table td,.hi-table__container table th{padding-left:8px;padding-right:16px;border-bottom:1px solid #e7e7e7;text-align:left;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-table__container table th{background-color:#fbfbfb;color:var(--color-gray-70)}.hi-table__container table th i:hover{color:var(--color-primary)}.hi-table__container table td{color:var(--color-black);word-break:break-word}.hi-table__container table tr{font-size:14px;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--color-white)}.hi-table__setting-menu div,.hi-table__setting-menu p,.hi-table__setting-menu ul,.hi-table__setting-menu li{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-table__col-menu{width:124px;font-size:14px;background:var(--color-white);-webkit-box-shadow:0 2px 8px 0 rgba(56,62,71,0.1);box-shadow:0 2px 8px 0 rgba(56,62,71,0.1);border-radius:4px;border:1px solid #e7e7e7;padding:7px 0}.hi-table__col-menu__item{cursor:pointer;color:var(--color-black);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:4px 12px}.hi-table__col-menu__item:hover{color:var(--color-primary)}.hi-table__col-menu__item.col-menu__item--highlight{color:var(--color-primary)}.hi-table__col-menu__item .hi-icon{font-size:16px}.hi-table__setting-menu .btn-group{display:-webkit-box;display:-ms-flexbox;display:flex;border-top:1px solid #e7e7e7;height:48px;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.hi-table__setting-menu .btn-group .btn{width:50%;text-align:center;cursor:pointer}.hi-table__setting-menu .btn-group .btn--left{border-right:1px solid #e7e7e7}.hi-table .hi-checkbox--disabled .hi-checkbox__input{border-color:#d8d8d8;background:#f2f2f2}.hi-table .hi-checkbox{height:auto}.hi-table th{font-weight:500;white-space:normal}.hi-table td{white-space:normal}.hi-table__setting-btn{position:absolute;height:100%;z-index:11;-webkit-box-sizing:border-box;box-sizing:border-box;right:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-left:1px solid #e0e1e2;border-bottom:1px solid #e0e1e2;border-top:none;color:#999;cursor:pointer;font-size:14px;width:16px;background:#fbfbfb}.hi-table__pagination{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;margin-top:20px}.hi-table__pagination--left{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.hi-table__pagination--middle{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.hi-table--small table tr{font-size:14px !important}.hi-table--small table tr>td{padding:8px !important}.hi-table--small table thead>tr>th{padding:8px !important}.hi-table--mini table tr{font-size:14px !important}.hi-table--mini table tr>td{padding:4px !important}.hi-table--mini table thead>tr>th{padding:4px !important}.hi-table--large table tr{font-size:14px !important}.hi-table--large table tr>td{padding:20px !important}.hi-table--large table thead>tr>th{padding:20px !important}.hi-table--striped table tr:nth-child(2n){background:#fbfbfb}.hi-table--striped table tr:nth-child(2n) .hi-table__col--sticky{background:#fbfbfb}.hi-table--bordered table thead>tr>th{border-right:1px solid #e6e7e8}.hi-table--bordered table td{border-right:1px solid var(--color-gray-20)}.hi-table--bordered .hi-table_header>table{border-top:1px solid #e6e7e8;border-left:1px solid #e6e7e8}.hi-table__container--fixed-left{z-index:1;position:absolute;top:0;-webkit-box-shadow:2px 0 4px rgba(187,187,187,0.4);box-shadow:2px 0 4px rgba(187,187,187,0.4);overflow:hidden}.hi-table__container--fixed-right{z-index:1;position:absolute;top:0;-webkit-box-shadow:-2px 0 4px rgba(187,187,187,0.4);box-shadow:-2px 0 4px rgba(187,187,187,0.4);overflow:hidden}.hi-table__header{overflow:hidden;position:relative}.hi-table__header>table{position:relative}.hi-table__header__title{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.hi-table__header--sticky{position:fixed;z-index:10;top:0;overflow-x:hidden}.hi-table__body--draging table tr:hover:not(.hi-table__row--draging){background:var(--color-white)}.hi-table__body--draging table tr:hover:not(.hi-table__row--draging) .hi-table__col--sticky{background:var(--color-white)}.hi-table__body--draging table tr.hi-table__row--draging{background:var(--color-primary-20)}.hi-table__body--draging table tr.hi-table__row--draging .hi-table__col--sticky{background:var(--color-primary-20)}.hi-table table{table-layout:fixed}.hi-table table thead>tr>th{background:#fbfbfb;color:var(--color-gray-70);padding:15px;border-bottom:1px solid #e6e7e8;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-table table tr{min-height:52px}.hi-table table tr .hi-table__col--sticky{position:sticky;left:0;z-index:5;background:var(--color-white)}.hi-table table tr:hover{background:var(--color-primary-20)}.hi-table table tr:hover .hi-table__col--sticky{background:var(--color-primary-20)}.hi-table table tr>td{color:var(--color-black);padding:15px;border-bottom:1px solid var(--color-gray-20);-webkit-box-sizing:border-box;box-sizing:border-box}.hi-table table tr.hi-table__row--draggable__border--top td{border-top:2px dashed var(--color-primary)}.hi-table table tr.hi-table__row--draggable__border--bottom td{border-bottom:2px dashed var(--color-primary)}.hi-table table .hi-table__row .hi-table__indent{display:inline-block;width:14px;height:100%}.hi-table table .hi-table__row--expanded{background:#fbfbfb}.hi-table table .hi-table__row--expanded>td{color:var(--color-gray-80)}.hi-table table .hi-table__row.hi-table__row--error>td{color:#f44343}.hi-table table .hi-table__row.hi-table__row--highlight>td{background:var(--color-primary-20)}.hi-table table .hi-table__row.hi-table__row--total>td{background-color:#fbfbfb}.hi-table table .hi-table__row.hi-table__row--avg>td{background-color:#fbfbfb}.hi-table table .hi-table__row.hi-table__row--draggable{cursor:move}.hi-table table .hi-table__row>.hi-table__col--highlight{background:var(--color-primary-20)}.hi-table table .hi-table__row .hi-table__col__hover--highlight{background:var(--color-primary-10)}.react-resizable{position:relative;background-clip:padding-box}.react-resizable-handle{position:absolute;width:10px;height:100%;bottom:0;right:-5px;cursor:col-resize;z-index:1}
File without changes
package/es/tree/Tree.js CHANGED
@@ -492,10 +492,13 @@ var Tree = function Tree(props) {
492
492
  type: 'deleteNode'
493
493
  }];
494
494
 
495
- if (contextMenu) {
495
+ if (Array.isArray(contextMenu)) {
496
+ menu = contextMenu;
497
+ } else if (typeof contextMenu === 'function') {
496
498
  menu = contextMenu(node);
497
499
  }
498
500
 
501
+ if (!(Array.isArray(menu) && menu.length > 0)) return null;
499
502
  return /*#__PURE__*/_react["default"].createElement("ul", {
500
503
  className: "".concat(PREFIX, "__menu theme__").concat(theme)
501
504
  }, menu.map(function (m, index) {
@@ -27,6 +27,8 @@ var useSelect = function useSelect(_ref) {
27
27
  setSelectedId(selectedId);
28
28
  }
29
29
  }, [selectedId, selectable]);
30
+ var onSelectRef = (0, _react.useRef)(onSelect);
31
+ onSelectRef.current = onSelect;
30
32
  var onSelectNode = (0, _react.useCallback)(function (selectedNode) {
31
33
  if (!selectable) return; // 兼容老版本:全局开启了 selectable,子节点默认都支持 selectable
32
34
 
@@ -36,6 +38,8 @@ var useSelect = function useSelect(_ref) {
36
38
  setSelectedId(selectedNode.id);
37
39
  }
38
40
 
41
+ var onSelect = onSelectRef.current;
42
+
39
43
  if (onSelect) {
40
44
  onSelect(selectedNode);
41
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/hiui",
3
- "version": "3.9.0-rc.7",
3
+ "version": "3.9.0",
4
4
  "description": "HIUI for React",
5
5
  "scripts": {
6
6
  "test": "node_modules/.bin/standard && node_modules/.bin/stylelint --config .stylelintrc 'components/**/*.scss'",