acud 1.2.1 → 1.2.2

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.
@@ -20,6 +20,7 @@ export interface SubMenuProps {
20
20
  popupClassName?: string;
21
21
  popupOffset?: number[];
22
22
  inlineCollapsed?: boolean;
23
+ mode?: 'inline' | 'horizontal' | 'vertical';
23
24
  onClick?: MenuClickEventHandler;
24
25
  onTitleClick?: (info: MenuTitleInfo) => void;
25
26
  onTitleMouseEnter?: MenuHoverEventHandler;
package/es/rate/rate.js CHANGED
@@ -73,7 +73,7 @@ var Rate = function Rate(_ref) {
73
73
  });
74
74
  }, [count]);
75
75
  useEffect(function () {
76
- return value && updateCurrValue(allowHalf ? value : value - 1);
76
+ value && updateCurrValue(allowHalf ? value : value - 1);
77
77
  }, [value]);
78
78
  // 获取焦点
79
79
  var handleFocus = useCallback(function () {
@@ -26,13 +26,13 @@ var formatContent = function formatContent(content, searchValue, prefixCls) {
26
26
  var lowerSearch = searchValue.toLowerCase();
27
27
  var searchStartIndex = lowerContent.indexOf(lowerSearch);
28
28
  var len = lowerSearch.length;
29
- // 存在搜索值不在content的情况,比如key与children不一致时
29
+ // 存在搜索值不在content的情况,比如value与children不一致时
30
30
  if (searchStartIndex === -1) {
31
31
  return /*#__PURE__*/React.createElement(React.Fragment, null, content);
32
32
  }
33
- return /*#__PURE__*/React.createElement(React.Fragment, null, content.slice(0, searchStartIndex), /*#__PURE__*/React.createElement("span", {
33
+ return /*#__PURE__*/React.createElement(React.Fragment, null, content.toString().slice(0, searchStartIndex), /*#__PURE__*/React.createElement("span", {
34
34
  className: "".concat(prefixCls, "-search-highlight")
35
- }, content.slice(searchStartIndex, searchStartIndex + len)), content.slice(searchStartIndex + len));
35
+ }, content.toString().slice(searchStartIndex, searchStartIndex + len)), content.toString().slice(searchStartIndex + len));
36
36
  };
37
37
  /**
38
38
  * {afterSearch}
@@ -277,16 +277,16 @@ var OptionList = function OptionList(_ref, ref) {
277
277
  return option.data.disabled;
278
278
  });
279
279
  enableAllValues = enableOptions.map(function (option) {
280
- return option.key;
280
+ return option.value;
281
281
  });
282
282
  enableValues = _toConsumableArray(values).filter(function (value) {
283
283
  return enableOptions.find(function (option) {
284
- return option.key === value;
284
+ return option.value === value;
285
285
  });
286
286
  });
287
287
  disabledValues = _toConsumableArray(values).filter(function (value) {
288
288
  return disabledOptions.find(function (option) {
289
- return option.key === value;
289
+ return option.value === value;
290
290
  });
291
291
  });
292
292
  selectAllChecked = enableValues.length === enableOptions.length;
@@ -331,13 +331,13 @@ var OptionList = function OptionList(_ref, ref) {
331
331
  });
332
332
  if (type === 'all') {
333
333
  return groupEnableOptions.every(function (option) {
334
- return values.has(option.key);
334
+ return values.has(option.value);
335
335
  });
336
336
  } else if (type === 'indeterminate') {
337
337
  return !groupEnableOptions.every(function (option) {
338
- return values.has(option.key);
338
+ return values.has(option.value);
339
339
  }) && groupEnableOptions.some(function (option) {
340
- return values.has(option.key);
340
+ return values.has(option.value);
341
341
  });
342
342
  }
343
343
  return false;
@@ -354,7 +354,7 @@ var OptionList = function OptionList(_ref, ref) {
354
354
  return !option.data.disabled;
355
355
  });
356
356
  var allValues = groupEnableOptions.map(function (option) {
357
- return option.key;
357
+ return option.value;
358
358
  });
359
359
  var checkAll = getCheckStatus(groupKey, 'all');
360
360
  if (checkAll) {
@@ -5,6 +5,7 @@ import { useState } from 'react';
5
5
  import classNames from 'classnames';
6
6
  import pickAttrs from "rc-util/es/pickAttrs";
7
7
  import Overflow from 'rc-overflow';
8
+ // import Overflow from '../../../overflow';
8
9
  import TransBtn from '../TransBtn';
9
10
  import Input from './Input';
10
11
  import useLayoutEffect from '../hooks/useLayoutEffect';
@@ -13,6 +14,10 @@ var onPreventMouseDown = function onPreventMouseDown(event) {
13
14
  event.preventDefault();
14
15
  event.stopPropagation();
15
16
  };
17
+ function itemKey(value) {
18
+ var _a;
19
+ return (_a = value.key) !== null && _a !== void 0 ? _a : value.value;
20
+ }
16
21
  var SelectSelector = function SelectSelector(props) {
17
22
  var id = props.id,
18
23
  prefixCls = props.prefixCls,
@@ -171,7 +176,7 @@ var SelectSelector = function SelectSelector(props) {
171
176
  renderItem: renderItem,
172
177
  renderRest: renderRest,
173
178
  suffix: inputNode,
174
- itemKey: "key",
179
+ itemKey: itemKey,
175
180
  maxCount: maxTagCount
176
181
  });
177
182
  return /*#__PURE__*/React.createElement(React.Fragment, null, selectionNode, !values.length && !inputValue && /*#__PURE__*/React.createElement("span", {
@@ -41,8 +41,8 @@ config: {
41
41
  export type FilterFunc<OptionType> = (inputValue: string, option?: OptionType) => boolean;
42
42
  export declare function RefSelectFunc<OptionsType extends object[], ValueType>(Component: React.ForwardRefRenderFunction<RefSelectProps, SelectProps<OptionsType, ValueType>>): React.ForwardRefExoticComponent<React.PropsWithoutRef<SelectProps<OptionsType, ValueType>> & React.RefAttributes<RefSelectProps>>;
43
43
  export type FlattenOptionsType<OptionsType extends object[] = object[]> = {
44
- key: Key;
45
- data: OptionsType[number];
44
+ key?: Key;
45
+ data?: OptionsType[number];
46
46
  /** Used for customize data */
47
47
  [name: string]: any;
48
48
  }[];
@@ -35,8 +35,9 @@ export type OptionsType = (OptionData | OptionGroupData)[];
35
35
  export interface FlattenOptionData {
36
36
  group?: boolean;
37
37
  groupOption?: boolean;
38
- key: string | number;
39
- data: OptionData | OptionGroupData;
38
+ key?: string | number;
39
+ value?: string | number;
40
+ data?: OptionData | OptionGroupData;
40
41
  groupKey?: string | number;
41
42
  groupLabel?: React.ReactNode;
42
43
  }
@@ -32,6 +32,7 @@ export function flattenOptions(options) {
32
32
  // Option
33
33
  flattenList.push({
34
34
  key: getKey(data, flattenList.length),
35
+ value: data.value,
35
36
  groupOption: isGroupOption,
36
37
  data: data,
37
38
  groupKey: groupKey,
@@ -217,6 +217,7 @@
217
217
  .acud-table-tbody > tr > td {
218
218
  border-bottom: 1px solid #f0f0f0;
219
219
  transition: background 0.3s;
220
+ border-right: 1px solid transparent;
220
221
  }
221
222
  .acud-table-tbody > tr > td > .acud-table-wrapper:only-child .acud-table,
222
223
  .acud-table-tbody > tr > td > .acud-table-expanded-row-fixed > .acud-table-wrapper:only-child .acud-table {
@@ -203,6 +203,7 @@
203
203
  > td {
204
204
  border-bottom: @border-width-base @border-style-base @table-border-color;
205
205
  transition: background 0.3s;
206
+ border-right: 1px solid transparent;
206
207
 
207
208
  // ========================= Nest Table ===========================
208
209
  > .@{table-prefix-cls}-wrapper:only-child,
@@ -20,6 +20,7 @@ export interface SubMenuProps {
20
20
  popupClassName?: string;
21
21
  popupOffset?: number[];
22
22
  inlineCollapsed?: boolean;
23
+ mode?: 'inline' | 'horizontal' | 'vertical';
23
24
  onClick?: MenuClickEventHandler;
24
25
  onTitleClick?: (info: MenuTitleInfo) => void;
25
26
  onTitleMouseEnter?: MenuHoverEventHandler;
package/lib/rate/rate.js CHANGED
@@ -84,7 +84,7 @@ var Rate = function Rate(_ref) {
84
84
  });
85
85
  }, [count]);
86
86
  (0, _react.useEffect)(function () {
87
- return value && updateCurrValue(allowHalf ? value : value - 1);
87
+ value && updateCurrValue(allowHalf ? value : value - 1);
88
88
  }, [value]);
89
89
  // 获取焦点
90
90
  var handleFocus = (0, _react.useCallback)(function () {
@@ -36,13 +36,13 @@ var formatContent = function formatContent(content, searchValue, prefixCls) {
36
36
  var lowerSearch = searchValue.toLowerCase();
37
37
  var searchStartIndex = lowerContent.indexOf(lowerSearch);
38
38
  var len = lowerSearch.length;
39
- // 存在搜索值不在content的情况,比如key与children不一致时
39
+ // 存在搜索值不在content的情况,比如value与children不一致时
40
40
  if (searchStartIndex === -1) {
41
41
  return /*#__PURE__*/React.createElement(React.Fragment, null, content);
42
42
  }
43
- return /*#__PURE__*/React.createElement(React.Fragment, null, content.slice(0, searchStartIndex), /*#__PURE__*/React.createElement("span", {
43
+ return /*#__PURE__*/React.createElement(React.Fragment, null, content.toString().slice(0, searchStartIndex), /*#__PURE__*/React.createElement("span", {
44
44
  className: "".concat(prefixCls, "-search-highlight")
45
- }, content.slice(searchStartIndex, searchStartIndex + len)), content.slice(searchStartIndex + len));
45
+ }, content.toString().slice(searchStartIndex, searchStartIndex + len)), content.toString().slice(searchStartIndex + len));
46
46
  };
47
47
  /**
48
48
  * {afterSearch}
@@ -287,16 +287,16 @@ var OptionList = function OptionList(_ref, ref) {
287
287
  return option.data.disabled;
288
288
  });
289
289
  enableAllValues = enableOptions.map(function (option) {
290
- return option.key;
290
+ return option.value;
291
291
  });
292
292
  enableValues = (0, _toConsumableArray2["default"])(values).filter(function (value) {
293
293
  return enableOptions.find(function (option) {
294
- return option.key === value;
294
+ return option.value === value;
295
295
  });
296
296
  });
297
297
  disabledValues = (0, _toConsumableArray2["default"])(values).filter(function (value) {
298
298
  return disabledOptions.find(function (option) {
299
- return option.key === value;
299
+ return option.value === value;
300
300
  });
301
301
  });
302
302
  selectAllChecked = enableValues.length === enableOptions.length;
@@ -341,13 +341,13 @@ var OptionList = function OptionList(_ref, ref) {
341
341
  });
342
342
  if (type === 'all') {
343
343
  return groupEnableOptions.every(function (option) {
344
- return values.has(option.key);
344
+ return values.has(option.value);
345
345
  });
346
346
  } else if (type === 'indeterminate') {
347
347
  return !groupEnableOptions.every(function (option) {
348
- return values.has(option.key);
348
+ return values.has(option.value);
349
349
  }) && groupEnableOptions.some(function (option) {
350
- return values.has(option.key);
350
+ return values.has(option.value);
351
351
  });
352
352
  }
353
353
  return false;
@@ -364,7 +364,7 @@ var OptionList = function OptionList(_ref, ref) {
364
364
  return !option.data.disabled;
365
365
  });
366
366
  var allValues = groupEnableOptions.map(function (option) {
367
- return option.key;
367
+ return option.value;
368
368
  });
369
369
  var checkAll = getCheckStatus(groupKey, 'all');
370
370
  if (checkAll) {
@@ -18,10 +18,16 @@ var _useLayoutEffect = _interopRequireDefault(require("../hooks/useLayoutEffect"
18
18
  var _LocaleReceiver = require("../../../locale-provider/LocaleReceiver");
19
19
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+ // import Overflow from '../../../overflow';
22
+
21
23
  var onPreventMouseDown = function onPreventMouseDown(event) {
22
24
  event.preventDefault();
23
25
  event.stopPropagation();
24
26
  };
27
+ function itemKey(value) {
28
+ var _a;
29
+ return (_a = value.key) !== null && _a !== void 0 ? _a : value.value;
30
+ }
25
31
  var SelectSelector = function SelectSelector(props) {
26
32
  var id = props.id,
27
33
  prefixCls = props.prefixCls,
@@ -180,7 +186,7 @@ var SelectSelector = function SelectSelector(props) {
180
186
  renderItem: renderItem,
181
187
  renderRest: renderRest,
182
188
  suffix: inputNode,
183
- itemKey: "key",
189
+ itemKey: itemKey,
184
190
  maxCount: maxTagCount
185
191
  });
186
192
  return /*#__PURE__*/React.createElement(React.Fragment, null, selectionNode, !values.length && !inputValue && /*#__PURE__*/React.createElement("span", {
@@ -41,8 +41,8 @@ config: {
41
41
  export type FilterFunc<OptionType> = (inputValue: string, option?: OptionType) => boolean;
42
42
  export declare function RefSelectFunc<OptionsType extends object[], ValueType>(Component: React.ForwardRefRenderFunction<RefSelectProps, SelectProps<OptionsType, ValueType>>): React.ForwardRefExoticComponent<React.PropsWithoutRef<SelectProps<OptionsType, ValueType>> & React.RefAttributes<RefSelectProps>>;
43
43
  export type FlattenOptionsType<OptionsType extends object[] = object[]> = {
44
- key: Key;
45
- data: OptionsType[number];
44
+ key?: Key;
45
+ data?: OptionsType[number];
46
46
  /** Used for customize data */
47
47
  [name: string]: any;
48
48
  }[];
@@ -35,8 +35,9 @@ export type OptionsType = (OptionData | OptionGroupData)[];
35
35
  export interface FlattenOptionData {
36
36
  group?: boolean;
37
37
  groupOption?: boolean;
38
- key: string | number;
39
- data: OptionData | OptionGroupData;
38
+ key?: string | number;
39
+ value?: string | number;
40
+ data?: OptionData | OptionGroupData;
40
41
  groupKey?: string | number;
41
42
  groupLabel?: React.ReactNode;
42
43
  }
@@ -46,6 +46,7 @@ function flattenOptions(options) {
46
46
  // Option
47
47
  flattenList.push({
48
48
  key: getKey(data, flattenList.length),
49
+ value: data.value,
49
50
  groupOption: isGroupOption,
50
51
  data: data,
51
52
  groupKey: groupKey,
@@ -217,6 +217,7 @@
217
217
  .acud-table-tbody > tr > td {
218
218
  border-bottom: 1px solid #f0f0f0;
219
219
  transition: background 0.3s;
220
+ border-right: 1px solid transparent;
220
221
  }
221
222
  .acud-table-tbody > tr > td > .acud-table-wrapper:only-child .acud-table,
222
223
  .acud-table-tbody > tr > td > .acud-table-expanded-row-fixed > .acud-table-wrapper:only-child .acud-table {
@@ -203,6 +203,7 @@
203
203
  > td {
204
204
  border-bottom: @border-width-base @border-style-base @table-border-color;
205
205
  transition: background 0.3s;
206
+ border-right: 1px solid transparent;
206
207
 
207
208
  // ========================= Nest Table ===========================
208
209
  > .@{table-prefix-cls}-wrapper:only-child,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acud",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "acg react 组件库",
5
5
  "license": "ISC",
6
6
  "author": "acg",
@@ -59,7 +59,7 @@
59
59
  "rc-input-number": "^7.1.3",
60
60
  "rc-motion": "2.4.3",
61
61
  "rc-notification": "4.5.7",
62
- "rc-overflow": "^1.0.2",
62
+ "rc-overflow": "1.2.8",
63
63
  "rc-resize-observer": "^1.2.0",
64
64
  "rc-select": "^14.1.13",
65
65
  "rc-slider": "^9.7.5",