@zgfe/business-lib 1.0.21-cdp.21 → 1.0.21-cdp.24

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.
@@ -40,7 +40,7 @@ export default (function () {
40
40
  }, /*#__PURE__*/React.createElement(Form, {
41
41
  initialValues: {
42
42
  time: {
43
- day: [4, 8, 29, 32],
43
+ day: [],
44
44
  time: '02:19:33',
45
45
  unit: 3
46
46
  }
@@ -14,6 +14,7 @@ interface Value {
14
14
  declare const BizCycleTime: React.FC<{
15
15
  value?: Value;
16
16
  multiple?: boolean;
17
+ placeholder?: string;
17
18
  onChange?: (val: Value) => void;
18
19
  size?: SizeType;
19
20
  }>;
@@ -165,6 +165,7 @@ var BizCycleTime = function BizCycleTime(props) {
165
165
  }), unit.value === CycleTimeUnit.day && /*#__PURE__*/React.createElement(DatePicker.TimePicker, {
166
166
  className: "".concat(classPrefix, "-hour"),
167
167
  size: size,
168
+ placeholder: props.placeholder,
168
169
  defaultValue: time ? moment(time, 'hh:mm:ss') : undefined,
169
170
  onChange: function onChange(time) {
170
171
  setTime(time === null || time === void 0 ? void 0 : time.format('hh:mm:ss'));
@@ -177,10 +178,12 @@ var BizCycleTime = function BizCycleTime(props) {
177
178
  multiple: multiple,
178
179
  className: "".concat(classPrefix, "-day"),
179
180
  defaultValue: day,
181
+ placeholder: props.placeholder,
180
182
  onChange: function onChange(v) {
181
183
  setDay(v);
182
184
  }
183
185
  }), unit.value === CycleTimeUnit.month && /*#__PURE__*/React.createElement(MonthDay, {
186
+ placeholder: props.placeholder,
184
187
  defaultValue: day,
185
188
  onChange: setDayList
186
189
  }));
@@ -6,6 +6,7 @@ declare const MonthDay: React.FC<{
6
6
  size?: SizeType;
7
7
  className?: string;
8
8
  defaultValue?: BaseOption<number>[];
9
+ placeholder?: string;
9
10
  onChange?: (days: BaseOption<number>[]) => void;
10
11
  }>;
11
12
  export default MonthDay;
@@ -73,6 +73,17 @@ var MonthDay = function MonthDay(props) {
73
73
  });
74
74
  }
75
75
 
76
+ function onDelMonthDay(day) {
77
+ setChosenDayList(function (list) {
78
+ var res = _.cloneDeep(list);
79
+
80
+ res.forEach(function (item, i) {
81
+ if (item.value === day.value) res.splice(i, 1);
82
+ });
83
+ return res;
84
+ });
85
+ }
86
+
76
87
  return /*#__PURE__*/React.createElement(Dropdown, {
77
88
  overlay: /*#__PURE__*/React.createElement("div", {
78
89
  className: "".concat(classPrefix, "-overlay")
@@ -99,9 +110,14 @@ var MonthDay = function MonthDay(props) {
99
110
  }, chosenDayList.map(function (item) {
100
111
  return /*#__PURE__*/React.createElement(Tag, {
101
112
  closable: true,
102
- key: item.value
113
+ key: item.value,
114
+ onClose: function onClose() {
115
+ onDelMonthDay(item);
116
+ }
103
117
  }, item.label);
104
- })), /*#__PURE__*/React.createElement(IconFont, {
118
+ }), !chosenDayList.length && /*#__PURE__*/React.createElement("span", {
119
+ className: "".concat(classPrefix, "-holder")
120
+ }, props.placeholder || '请选择')), /*#__PURE__*/React.createElement(IconFont, {
105
121
  type: "xiangxia"
106
122
  }))));
107
123
  };
@@ -20,6 +20,9 @@
20
20
  flex: none;
21
21
  }
22
22
  }
23
+ &-holder {
24
+ color: @input-placeholder-color;
25
+ }
23
26
  &-val {
24
27
  flex: 1;
25
28
  .ant-tag {
@@ -67,6 +67,7 @@ var BizSelect = function BizSelect(props) {
67
67
  setWidth((boxRef === null || boxRef === void 0 ? void 0 : (_boxRef$current = boxRef.current) === null || _boxRef$current === void 0 ? void 0 : _boxRef$current.width) || 200);
68
68
 
69
69
  if (props.defaultValue) {
70
+ console.log('>>>>>>初始化参数', props.defaultValue, getValue(props.defaultValue));
70
71
  setCurrent(getValue(props.defaultValue));
71
72
  }
72
73
 
@@ -87,11 +88,7 @@ var BizSelect = function BizSelect(props) {
87
88
  };
88
89
  }, []);
89
90
  useEffect(function () {
90
- if (!props.value) {
91
- setCurrent(undefined);
92
- return;
93
- }
94
-
91
+ if (!props.value) return;
95
92
  setCurrent(getValue(props.value));
96
93
  }, [props.value]);
97
94
 
@@ -28,7 +28,8 @@ var SelectOverlay = function SelectOverlay(props) {
28
28
  disableItemList = props.disableItemList,
29
29
  dropdownExtra = props.dropdownExtra,
30
30
  loading = props.loading,
31
- customLabel = props.customLabel;
31
+ customLabel = props.customLabel,
32
+ overlayClassName = props.overlayClassName;
32
33
 
33
34
  var _useState = useState(),
34
35
  _useState2 = _slicedToArray(_useState, 2),
@@ -198,7 +199,7 @@ var SelectOverlay = function SelectOverlay(props) {
198
199
  }
199
200
 
200
201
  return /*#__PURE__*/React.createElement("div", {
201
- className: "".concat(classPrefix, "-overlay")
202
+ className: "".concat(classPrefix, "-overlay ").concat(overlayClassName)
202
203
  }, props.enableSearch && !props.multiple && /*#__PURE__*/React.createElement(BizSearchInput, {
203
204
  className: "".concat(classPrefix, "-search"),
204
205
  onChange: onSearch
@@ -28,6 +28,7 @@ export declare namespace BizSelectTypes {
28
28
  enableCreate?: boolean;
29
29
  popupContainer?: boolean;
30
30
  overlayWidth?: number;
31
+ overlayClassName?: string;
31
32
  labelField?: string;
32
33
  keyField?: string;
33
34
  disableItemList?: Option[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/business-lib",
3
- "version": "1.0.21-cdp.21",
3
+ "version": "1.0.21-cdp.24",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -58,5 +58,5 @@
58
58
  "react": "^16.12.0 || ^17.0.0",
59
59
  "yorkie": "^2.0.0"
60
60
  },
61
- "gitHead": "2807db872ccdfe515814d006494fcef325b4c846"
61
+ "gitHead": "d35d99669e5706ea5350dd60113e8bfb3ecf2a11"
62
62
  }