ztxkui 4.3.2 → 4.3.3

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.
@@ -237,9 +237,6 @@ function onMouseDownHandle(e) {
237
237
  */
238
238
  function EnhanceSelect(_a) {
239
239
  var list = _a.list, defaultList = _a.defaultList, params = _a.params, url = _a.url, _b = _a.method, method = _b === void 0 ? 'GET' : _b, _c = _a.timeout, timeout = _c === void 0 ? 60000 : _c, _d = _a.dataKey, dataKey = _d === void 0 ? 'id' : _d, componentKey = _a.componentKey, _e = _a.titleKey, titleKey = _e === void 0 ? 'name' : _e, showAll = _a.showAll, isCatch = _a.isCatch, onCompleted = _a.onCompleted, onChange = _a.onChange, onSearch = _a.onSearch, request = _a.request, remoteSearch = _a.remoteSearch, remoteSearchKey = _a.remoteSearchKey, remoteSearchDataKey = _a.remoteSearchDataKey, _f = _a.isRemoteSearchDataKey, isRemoteSearchDataKey = _f === void 0 ? true : _f, transformData = _a.transformData, joinKey = _a.joinKey, _g = _a.joinStr, joinStr = _g === void 0 ? '-' : _g, lineFeedKey = _a.lineFeedKey, _h = _a.lineFeedStr, lineFeedStr = _h === void 0 ? '-' : _h, mustHasParams = _a.mustHasParams, disabledValues = _a.disabledValues, searchDeleteKeys = _a.searchDeleteKeys, isHandAddItem = _a.isHandAddItem, isPage = _a.isPage, _j = _a.currentSize, currentSize = _j === void 0 ? 30 : _j, isCopy = _a.isCopy, onFocus = _a.onFocus, isClickRequest = _a.isClickRequest, handleRef = _a.handleRef, isPaste = _a.isPaste, _k = _a.pasteRule, pasteRule = _k === void 0 ? defaultPasteRule : _k, restProps = __rest(_a, ["list", "defaultList", "params", "url", "method", "timeout", "dataKey", "componentKey", "titleKey", "showAll", "isCatch", "onCompleted", "onChange", "onSearch", "request", "remoteSearch", "remoteSearchKey", "remoteSearchDataKey", "isRemoteSearchDataKey", "transformData", "joinKey", "joinStr", "lineFeedKey", "lineFeedStr", "mustHasParams", "disabledValues", "searchDeleteKeys", "isHandAddItem", "isPage", "currentSize", "isCopy", "onFocus", "isClickRequest", "handleRef", "isPaste", "pasteRule"]);
240
- // TODO: 注释动态设置open逻辑 start
241
- // const currentClick = useRef<boolean>(true);
242
- // TODO: 注释动态设置open逻辑 end
243
240
  // 下拉数据源
244
241
  var _l = useFetchState([]), selectList = _l[0], setSelectList = _l[1];
245
242
  // 手动添加的数据源
@@ -1006,9 +1003,20 @@ function EnhanceSelect(_a) {
1006
1003
  // 焦点事件
1007
1004
  var onFocusHandle = useCallback(function (e) {
1008
1005
  // console.log('焦点事件');
1009
- setIsOpen(true);
1006
+ if (!clearClick.current) {
1007
+ clearClick.current = false;
1008
+ setIsOpen(true);
1009
+ }
1010
1010
  onFocus && onFocus(e);
1011
1011
  }, [onFocus]);
1012
+ // 清空事件
1013
+ // TODO: 注释动态设置open逻辑 start
1014
+ var clearClick = useRef(false);
1015
+ // TODO: 注释动态设置open逻辑 end
1016
+ var onClearHandle = useCallback(function () {
1017
+ // 清空
1018
+ clearClick.current = true;
1019
+ }, []);
1012
1020
  // 选中时
1013
1021
  var onSelectHandle = useCallback(function (value, obj) {
1014
1022
  // console.log('选中数据事件');
@@ -1120,7 +1128,7 @@ function EnhanceSelect(_a) {
1120
1128
  }
1121
1129
  },
1122
1130
  }); });
1123
- return (React.createElement(Select, __assign({ defaultValue: showAll ? '' : undefined, allowClear: true, showSearch: true, filterOption: remoteSearch ? false : filterOptionHandle, onSearch: remoteSearch ? onSearchHandle : onSearchHandleInner, onChange: onChangeHandle, optionLabelProp: "title", loading: loading, onFocus: onFocusHandle, onSelect: onSelectHandle, onClick: onClickHandle, onMouseDown: onMouseDownHandle,
1131
+ return (React.createElement(Select, __assign({ defaultValue: showAll ? '' : undefined, allowClear: true, onClear: onClearHandle, showSearch: true, filterOption: remoteSearch ? false : filterOptionHandle, onSearch: remoteSearch ? onSearchHandle : onSearchHandleInner, onChange: onChangeHandle, optionLabelProp: "title", loading: loading, onFocus: onFocusHandle, onSelect: onSelectHandle, onClick: onClickHandle, onMouseDown: onMouseDownHandle,
1124
1132
  // getPopupContainer={(trigger) => trigger || document.body}
1125
1133
  open: isOpen, onDropdownVisibleChange: function (visible) { return setIsOpen(visible); }, onPopupScroll: onPopupScrollHandle, dropdownRender: url && !remoteSearch && isCatch
1126
1134
  ? function (menu) { return (React.createElement(React.Fragment, null,
@@ -95,6 +95,7 @@ var TableEnhanceCell = function (_a) {
95
95
  if (dataIndex) {
96
96
  // form?.setFieldsValue({ [dataIndex]: record[dataIndex] });
97
97
  // form?.setFieldValue(dataIndex, record[dataIndex]);
98
+ console.log(record[dataIndex]);
98
99
  setVal(record[dataIndex]);
99
100
  }
100
101
  }, [dataIndex, record]);
@@ -203,6 +204,8 @@ var TableEnhanceCell = function (_a) {
203
204
  return result;
204
205
  });
205
206
  // onTableChange && onTableChange(resultTextList, index, record);
207
+ setVal(resultTextList[0][dataIndex]);
208
+ valueRef.current[dataIndex] = resultTextList[0][dataIndex];
206
209
  onTableChange && onTableChange(resultTextList, innerIndex, record);
207
210
  }
208
211
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "4.3.2",
3
+ "version": "4.3.3",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",