@yilianjituan/yilian_dgerm 1.0.5-alpha.8 → 1.0.5-alpha.9

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.
@@ -1,76 +1,80 @@
1
1
  /// <reference types="react" />
2
- import { SelectProps } from "antd";
2
+ import { SelectProps } from 'antd';
3
3
  export interface OptionItem {
4
4
  /**
5
5
  * @description 用于key
6
6
  */
7
7
  id: string;
8
8
  /**
9
- * @description 获取或者回填的值结构
10
- */
9
+ * @description 获取或者回填的值结构
10
+ */
11
11
  value: (item: any) => string;
12
12
  /**
13
- * @description list展示项
14
- */
13
+ * @description list展示项
14
+ */
15
15
  lable: (item: any) => string | React.ReactNode;
16
+ /**
17
+ * @description 选项的额外属性
18
+ */
19
+ optionProps?: (item: any) => any;
16
20
  }
17
21
  export interface DropDownSelectProps extends SelectProps {
18
22
  /**
19
- * @description http请求
20
- */
23
+ * @description http请求
24
+ */
21
25
  http: any;
22
26
  /**
23
- * @description 需要查询的接口
24
- */
27
+ * @description 需要查询的接口
28
+ */
25
29
  url: string;
26
30
  /**
27
- * @description http方法
28
- * @default get
29
- */
31
+ * @description http方法
32
+ * @default get
33
+ */
30
34
  method?: string;
31
35
  /**
32
- * @description 选择后的回调,参数是传入的value
33
- */
36
+ * @description 选择后的回调,参数是传入的value
37
+ */
34
38
  handleSelect?: (value: string, option?: any) => void;
35
39
  /**
36
- * @description 需要展示的和传出去的值
37
- */
40
+ * @description 需要展示的和传出去的值
41
+ */
38
42
  showValue: OptionItem;
39
43
  /**
40
- * @description 是否开启搜索查询
41
- */
44
+ * @description 是否开启搜索查询
45
+ */
42
46
  customInput?: boolean;
43
47
  /**
44
- * @description 输入搜索时的参数名
45
- */
48
+ * @description 输入搜索时的参数名
49
+ */
46
50
  searchValue?: string;
47
51
  /**
48
- * @description 选择模式
49
- */
52
+ * @description 选择模式
53
+ */
50
54
  mode?: 'multiple' | 'tags' | undefined;
51
55
  /**
52
- * @description 额外需要传入的字段
53
- */
56
+ * @description 额外需要传入的字段
57
+ */
54
58
  additionalParameters?: any;
55
59
  /**
56
- * @description 处理options的回调
57
- */
60
+ * @description 处理options的回调
61
+ */
58
62
  filterOptionsCallback?: (opt: any) => void;
59
63
  /**
60
- * @description 选择变化的回调
61
- */
64
+ * @description 选择变化的回调
65
+ */
62
66
  onChange?: (value: any) => void;
63
67
  /**
64
- * @description 动态参数,执行查询需要执行之前处理的参数
65
- */
68
+ * @description 动态参数,执行查询需要执行之前处理的参数
69
+ */
66
70
  dynamicParameter?: any;
67
71
  /**
68
72
  * @description 动态参数,处理动态参数的方法
69
73
  */
70
74
  beforeSearch?: (params: any) => void;
71
75
  /**
72
- * @description 是否开启搜索查询
73
- */
76
+ * @description 是否开启搜索查询
77
+ */
74
78
  changeNoSearch?: boolean;
75
79
  /**
76
80
  * @description 是否初始化搜索
@@ -50,7 +50,8 @@ var Index = function Index(props) {
50
50
  prop = _objectWithoutProperties(props, _excluded);
51
51
  var id = showValue.id,
52
52
  value = showValue.value,
53
- lable = showValue.lable;
53
+ lable = showValue.lable,
54
+ optionProps = showValue.optionProps;
54
55
  var _useState = useState([]),
55
56
  _useState2 = _slicedToArray(_useState, 2),
56
57
  storeList = _useState2[0],
@@ -210,10 +211,10 @@ var Index = function Index(props) {
210
211
  })));
211
212
  };
212
213
  var options = storeList.map(function (item) {
213
- return /*#__PURE__*/React.createElement(Option, {
214
+ return /*#__PURE__*/React.createElement(Option, _extends({
214
215
  key: item[id],
215
216
  value: value(item)
216
- }, lable(item));
217
+ }, optionProps === null || optionProps === void 0 ? void 0 : optionProps(item)), lable(item));
217
218
  });
218
219
  var commonProps = _objectSpread(_objectSpread({}, prop), {}, {
219
220
  mode: mode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yilianjituan/yilian_dgerm",
3
- "version": "1.0.5-alpha.8",
3
+ "version": "1.0.5-alpha.9",
4
4
  "description": "A react library developed with dumi",
5
5
  "keywords": [
6
6
  "React",