@hi-ui/hiui 3.9.3 → 3.9.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.
@@ -170,9 +170,17 @@ var BasePicker = function BasePicker(_ref) {
170
170
 
171
171
  var inputChangeEvent = function inputChangeEvent(val, dir) {
172
172
  if (val.isValid()) {
173
- var oData = _lodash["default"].cloneDeep(outDate);
173
+ var oData = _lodash["default"].cloneDeep(outDate); // 如果是范围的修改,则校准下时间范围的值
174
+
175
+
176
+ if (outDate.length === 2) {
177
+ if (dir === 0 && (0, _moment["default"])(val) < (0, _moment["default"])(outDate[1]) || dir === 1 && (0, _moment["default"])(val) > (0, _moment["default"])(outDate[0])) {
178
+ oData[dir] = val;
179
+ }
180
+ } else {
181
+ oData[dir] = val;
182
+ }
174
183
 
175
- oData[dir] = val;
176
184
  changeOutDate(oData);
177
185
  }
178
186
  };
@@ -85,31 +85,52 @@ var Time = function Time(_ref) {
85
85
  endHour = _ref2.hour,
86
86
  endMinute = _ref2.minute;
87
87
 
88
- isDisabled = type === 'hour' && hour > i;
89
-
90
- if (type === 'minute') {
91
- if (endHour === hour) {
92
- isDisabled = minute > i;
93
- }
94
-
95
- if (endHour < hour) {
96
- isDisabled = true;
97
- }
98
- }
99
-
100
- if (type === 'second') {
101
- if (endHour === hour) {
102
- isDisabled = endMinute === minute && second > i;
103
-
104
- if (endMinute < minute) {
105
- isDisabled = true;
88
+ var dateDiff = (0, _moment["default"])(date).diff((0, _moment["default"])(startDate), 'days');
89
+ var hourDiff = (0, _moment["default"])(date).diff((0, _moment["default"])(startDate), 'hour');
90
+ var minuteDiff = (0, _moment["default"])(date).diff((0, _moment["default"])(startDate), 'minutes'); // 不在同一天
91
+
92
+ if (dateDiff !== 0) {
93
+ isDisabled = dateDiff < 0;
94
+ } // 在同一天,则比较小时
95
+ else {
96
+ if (type === 'hour') {
97
+ isDisabled = hour > i;
98
+ } else {
99
+ // 不在同一小时
100
+ if (hourDiff !== 0) {
101
+ isDisabled = hourDiff < 0;
102
+ } // 在同一小时,则比较分钟
103
+ else {
104
+ if (type === 'minute') {
105
+ if (endHour === hour) {
106
+ isDisabled = minute > i;
107
+ }
108
+
109
+ if (endHour < hour) {
110
+ isDisabled = true;
111
+ }
112
+ } else {
113
+ // 不在同一分
114
+ if (minuteDiff !== 0) {
115
+ isDisabled = minuteDiff < 0;
116
+ } // 在同一分钟,则比较秒
117
+ else {
118
+ if (endHour === hour) {
119
+ isDisabled = endMinute === minute && second > i;
120
+
121
+ if (endMinute < minute) {
122
+ isDisabled = true;
123
+ }
124
+ }
125
+
126
+ if (endHour < hour) {
127
+ isDisabled = true;
128
+ }
129
+ }
130
+ }
131
+ }
106
132
  }
107
133
  }
108
-
109
- if (endHour < hour) {
110
- isDisabled = true;
111
- }
112
- }
113
134
  }
114
135
 
115
136
  return isDisabled;
@@ -1 +1 @@
1
- .hi-select__input{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--color-white);color:var(--color-black);line-height:1;border-radius:2px;cursor:pointer;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box;height:32px}.hi-select__input--readonly{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;-webkit-transition:margin 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);transition:margin 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)}.hi-select__input.bordered{border:1px solid var(--color-gray-30)}.hi-select__input.disabled{cursor:not-allowed;background-color:var(--color-gray-10);color:var(--color-gray-50)}.hi-select__input.disabled .hi-select__input--icon{background-color:var(--color-gray-10);color:var(--color-gray-50);margin-left:0 !important}.hi-select__input.disabled .hi-select__input--icon,.hi-select__input.disabled input{cursor:not-allowed}.hi-select__input.disabled.multiple-values .hi-select__input-items--left{color:var(--color-gray-50)}.hi-select__input.disabled .hi-select__input--item .hi-select__input--item__remove{cursor:not-allowed}.hi-select__input .hi-icon{margin-left:0 !important}.hi-select__input.active:not(.disabled),.hi-select__input:not(.disabled):hover{border-color:var(--color-primary)}.hi-select__input__focus:not(.disabled){border-color:var(--color-primary)}.hi-select__input:not(.disabled):hover .clearable{display:none}.hi-select__input:not(.disabled):hover .hi-select__input--icon__close{display:block;color:var(--color-gray-50)}.hi-select__input:not(.disabled):hover .hi-select__input--icon__close:hover{display:block;color:var(--color-black)}.hi-select__input .hi-select__input--icon{-webkit-box-flex:0;-ms-flex:none;flex:none}.hi-select__input--search input{position:relative;max-width:100%;width:100%;height:100%;padding:0;line-height:1;border-radius:2px;font-size:14px;cursor:pointer;background:transparent;border-width:0;outline:0;z-index:10}.hi-select__input--search input[data-visbility='false']{width:1px}.hi-select__input--search input::-webkit-input-placeholder{font-weight:300;color:var(--color-gray-50)}.hi-select__input--search input::-moz-placeholder{font-weight:300;color:var(--color-gray-50)}.hi-select__input--search input:-moz-placeholder{font-weight:300;color:var(--color-gray-50)}.hi-select__input--search input:-ms-input-placeholder{font-weight:300;color:var(--color-gray-50)}.hi-select__input--search--value input{color:var(--color-black)}.hi-select__input--icon{position:relative;-webkit-box-flex:0;-ms-flex:none;flex:none;display:inline-block;padding-right:8px;cursor:pointer;font-size:22px;color:#434343;background-color:var(--color-white);-webkit-transform:scale(0.66667) rotate(0deg);transform:scale(0.66667) rotate(0deg);-webkit-transition:all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);transition:all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);zoom:1;filter:"progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=1, M12=0, M21=0, M22=1)"}.hi-select__input--icon .hi-select__input--icon__close{display:none}.hi-select__input.single-value{height:32px;line-height:32px}.hi-select__input.single-value .hi-select__input--item,.hi-select__input.single-value .hi-select__input--search{-webkit-box-flex:1;-ms-flex:auto;flex:auto;padding:0 0 0 12px}.hi-select__input.single-value .hi-select__input--item{height:32px;line-height:32px;overflow:hidden;-webkit-transition:padding 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);transition:padding 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);text-align:left}.hi-select__input.single-value .hi-select__input--item__name{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;-webkit-transition:margin 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);transition:margin 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)}.hi-select__input.multiple-values{padding:4px 4px 0 4px}.hi-select__input.multiple-values .hi-select__input--icon{margin-top:-4px;margin-right:-4px}.hi-select__input.multiple-values .hi-select__input--placeholder{position:absolute;top:3px;left:13px;right:30px;height:24px;line-height:24px;color:var(--color-gray-50);z-index:1}.hi-select__input.multiple-values .hi-select__input--placeholder ~ .hi-select__input-items .hi-select__input--search{padding:0 20px 0 11px}.hi-select__input.multiple-values .hi-select__input-items{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:auto;flex:auto;overflow:hidden}.hi-select__input.multiple-values .hi-select__input-items.hi-select__input-items--all{-ms-flex-wrap:wrap;flex-wrap:wrap}.hi-select__input.multiple-values .hi-select__input-items--left{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 8px;height:22px;line-height:22px;font-size:12px;color:var(--color-black);background-color:var(--color-gray-20);border-radius:2px;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-select__input.multiple-values .hi-select__input--item{-webkit-box-flex:0;-ms-flex:none;flex:none;position:relative;max-width:60%;height:22px;line-height:22px;padding:0 20px 0 10px;margin:0 4px 4px 0;overflow:hidden;vertical-align:middle;background-color:var(--color-gray-20);border-radius:2px;text-align:left}.hi-select__input.multiple-values .hi-select__input--item__name{font-size:13px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.hi-select__input.multiple-values .hi-select__input--item__remove{cursor:pointer;display:inline-block;font-size:12px;position:absolute;top:0;right:4px;padding:0 0 0 8px}.hi-select__input.multiple-values .hi-select__input--search{height:22px;line-height:22px;margin-bottom:4px;padding-left:3px}
1
+ .hi-select__input{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--color-white);color:var(--color-black);line-height:1;border-radius:2px;cursor:pointer;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box;height:32px}.hi-select__input--readonly{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;-webkit-transition:margin 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);transition:margin 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)}.hi-select__input.bordered{border:1px solid var(--color-gray-30)}.hi-select__input.disabled{cursor:not-allowed;background-color:var(--color-gray-10);color:var(--color-gray-50)}.hi-select__input.disabled .hi-select__input--icon{background-color:var(--color-gray-10);color:var(--color-gray-50);margin-left:0 !important}.hi-select__input.disabled .hi-select__input--icon,.hi-select__input.disabled input{cursor:not-allowed}.hi-select__input.disabled.multiple-values .hi-select__input-items--left{color:var(--color-gray-50)}.hi-select__input.disabled .hi-select__input--item .hi-select__input--item__remove{cursor:not-allowed}.hi-select__input .hi-icon{margin-left:0 !important}.hi-select__input.active:not(.disabled),.hi-select__input:not(.disabled):hover{border-color:var(--color-primary)}.hi-select__input__focus:not(.disabled){border-color:var(--color-primary)}.hi-select__input:not(.disabled):hover .clearable{display:none}.hi-select__input:not(.disabled):hover .hi-select__input--icon__close{display:block;color:var(--color-gray-50)}.hi-select__input:not(.disabled):hover .hi-select__input--icon__close:hover{display:block;color:var(--color-black)}.hi-select__input .hi-select__input--icon{-webkit-box-flex:0;-ms-flex:none;flex:none}.hi-select__input--search input{position:relative;max-width:100%;width:100%;height:100%;padding:0;line-height:1;border-radius:2px;font-size:14px;cursor:pointer;background:transparent;border-width:0;outline:0;z-index:10}.hi-select__input--search input[data-visbility='false']{width:1px}.hi-select__input--search input::-webkit-input-placeholder{color:var(--color-gray-50)}.hi-select__input--search input::-moz-placeholder{color:var(--color-gray-50)}.hi-select__input--search input:-moz-placeholder{color:var(--color-gray-50)}.hi-select__input--search input:-ms-input-placeholder{color:var(--color-gray-50)}.hi-select__input--search--value input{color:var(--color-black)}.hi-select__input--icon{position:relative;-webkit-box-flex:0;-ms-flex:none;flex:none;display:inline-block;padding-right:8px;cursor:pointer;font-size:22px;color:#434343;background-color:var(--color-white);-webkit-transform:scale(0.66667) rotate(0deg);transform:scale(0.66667) rotate(0deg);-webkit-transition:all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);transition:all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);zoom:1;filter:"progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=1, M12=0, M21=0, M22=1)"}.hi-select__input--icon .hi-select__input--icon__close{display:none}.hi-select__input.single-value{height:32px;line-height:32px}.hi-select__input.single-value .hi-select__input--item,.hi-select__input.single-value .hi-select__input--search{-webkit-box-flex:1;-ms-flex:auto;flex:auto;padding:0 0 0 12px}.hi-select__input.single-value .hi-select__input--item{height:32px;line-height:32px;overflow:hidden;-webkit-transition:padding 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);transition:padding 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);text-align:left}.hi-select__input.single-value .hi-select__input--item__name{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;-webkit-transition:margin 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);transition:margin 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)}.hi-select__input.multiple-values{padding:4px 4px 0 4px}.hi-select__input.multiple-values .hi-select__input--icon{margin-top:-4px;margin-right:-4px}.hi-select__input.multiple-values .hi-select__input--placeholder{position:absolute;top:3px;left:13px;right:30px;height:24px;line-height:24px;color:var(--color-gray-50);z-index:1}.hi-select__input.multiple-values .hi-select__input--placeholder ~ .hi-select__input-items .hi-select__input--search{padding:0 20px 0 11px}.hi-select__input.multiple-values .hi-select__input-items{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:auto;flex:auto;overflow:hidden}.hi-select__input.multiple-values .hi-select__input-items.hi-select__input-items--all{-ms-flex-wrap:wrap;flex-wrap:wrap}.hi-select__input.multiple-values .hi-select__input-items--left{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 8px;height:22px;line-height:22px;font-size:12px;color:var(--color-black);background-color:var(--color-gray-20);border-radius:2px;-webkit-box-sizing:border-box;box-sizing:border-box}.hi-select__input.multiple-values .hi-select__input--item{-webkit-box-flex:0;-ms-flex:none;flex:none;position:relative;max-width:60%;height:22px;line-height:22px;padding:0 20px 0 10px;margin:0 4px 4px 0;overflow:hidden;vertical-align:middle;background-color:var(--color-gray-20);border-radius:2px;text-align:left}.hi-select__input.multiple-values .hi-select__input--item__name{font-size:13px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.hi-select__input.multiple-values .hi-select__input--item__remove{cursor:pointer;display:inline-block;font-size:12px;position:absolute;top:0;right:4px;padding:0 0 0 8px}.hi-select__input.multiple-values .hi-select__input--search{height:22px;line-height:22px;margin-bottom:4px;padding-left:3px}
package/es/table/Table.js CHANGED
@@ -226,9 +226,17 @@ var Table = function Table(_ref) {
226
226
 
227
227
  var loadChildren = (0, _react.useRef)(null);
228
228
 
229
- var _useState25 = (0, _react.useState)(columns.map(function (c) {
230
- return c.width || 'auto';
231
- })),
229
+ var _useState25 = (0, _react.useState)(function () {
230
+ var _columns = columns.map(function (c) {
231
+ return c.width || 'auto';
232
+ });
233
+
234
+ if (rowSelection) {
235
+ _columns.unshift(rowSelection.checkboxColWidth || 50);
236
+ }
237
+
238
+ return _columns;
239
+ }),
232
240
  _useState26 = (0, _slicedToArray2["default"])(_useState25, 2),
233
241
  realColumnsWidth = _useState26[0],
234
242
  setRealColumnsWidth = _useState26[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/hiui",
3
- "version": "3.9.3",
3
+ "version": "3.9.4",
4
4
  "description": "HIUI for React",
5
5
  "scripts": {
6
6
  "test": "node_modules/.bin/standard && node_modules/.bin/stylelint --config .stylelintrc 'components/**/*.scss'",
@@ -48,6 +48,9 @@
48
48
  "es/lib/*",
49
49
  "es/_util/*"
50
50
  ],
51
+ "engines": {
52
+ "node": "~11.0.0"
53
+ },
51
54
  "peerDependencies": {
52
55
  "react": ">=16.13.0",
53
56
  "react-dom": ">=16.13.0"