ztxkui 4.3.2 → 4.3.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.
|
@@ -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
|
-
|
|
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,
|
|
@@ -388,7 +388,6 @@ function useColumns(props) {
|
|
|
388
388
|
var _a = useState(false), refreshColumns = _a[0], setRefreshColumns = _a[1];
|
|
389
389
|
var refreshColumnsHandle = useCallback(function () { return setRefreshColumns(function (refresh) { return !refresh; }); }, []);
|
|
390
390
|
var calcColumns = useMemo(function () {
|
|
391
|
-
console.log('calc new columns');
|
|
392
391
|
return getNewColumnsMemo(columns, refreshColumns);
|
|
393
392
|
}, [getNewColumnsMemo, columns, refreshColumns]);
|
|
394
393
|
return {
|
|
@@ -203,6 +203,8 @@ var TableEnhanceCell = function (_a) {
|
|
|
203
203
|
return result;
|
|
204
204
|
});
|
|
205
205
|
// onTableChange && onTableChange(resultTextList, index, record);
|
|
206
|
+
setVal(resultTextList[0][dataIndex]);
|
|
207
|
+
valueRef.current[dataIndex] = resultTextList[0][dataIndex];
|
|
206
208
|
onTableChange && onTableChange(resultTextList, innerIndex, record);
|
|
207
209
|
}
|
|
208
210
|
}
|
|
@@ -106,7 +106,6 @@ var components = {
|
|
|
106
106
|
function Table(props) {
|
|
107
107
|
var _this = this;
|
|
108
108
|
var className = props.className, scroll = props.scroll, _a = props.pagination, pagination = _a === void 0 ? false : _a, _b = props.bordered, bordered = _b === void 0 ? true : _b, _columns = props.columns, initColumns = props.initColumns, dataSource = props.dataSource, onAddAndDelHandle = props.onAddAndDelHandle, hideAddIcon = props.hideAddIcon, addIconText = props.addIconText, hideDelIcon = props.hideDelIcon, showDelAllBtn = props.showDelAllBtn, delAllChange = props.delAllChange, delIconText = props.delIconText, showColumnDynamic = props.showColumnDynamic, showColumnDynamicKey = props.showColumnDynamicKey, summaryConfig = props.summaryConfig, summaryFixed = props.summaryFixed, summary = props.summary, onMoveRow = props.onMoveRow, onEditableSave = props.onEditableSave, onDynamicChange = props.onDynamicChange, _c = props.isResizableColumn, isResizableColumn = _c === void 0 ? true : _c, configInfo = props.configInfo, tableHandleRef = props.tableHandleRef, tableName = props.tableName, isFlex = props.isFlex, onTableChange = props.onTableChange, rowSelection = props.rowSelection, showInnerPagination = props.showInnerPagination, defaultInnerPageSize = props.defaultInnerPageSize, restProps = __rest(props, ["className", "scroll", "pagination", "bordered", "columns", "initColumns", "dataSource", "onAddAndDelHandle", "hideAddIcon", "addIconText", "hideDelIcon", "showDelAllBtn", "delAllChange", "delIconText", "showColumnDynamic", "showColumnDynamicKey", "summaryConfig", "summaryFixed", "summary", "onMoveRow", "onEditableSave", "onDynamicChange", "isResizableColumn", "configInfo", "tableHandleRef", "tableName", "isFlex", "onTableChange", "rowSelection", "showInnerPagination", "defaultInnerPageSize"]);
|
|
109
|
-
console.log('table render');
|
|
110
109
|
var classes = classNames('zt-table', className, {
|
|
111
110
|
'zt-table--flex': isFlex,
|
|
112
111
|
});
|