@teamix/pro 1.4.7 → 1.4.10
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.
- package/dist/pro.css +1 -1
- package/dist/pro.js +215 -127
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.js +22 -17
- package/es/actions/dialog.d.ts +5 -1
- package/es/actions/dialog.js +19 -11
- package/es/form/Components/ProField/mapDateFormat.js +0 -1
- package/es/form/Filter/AdvancedFilter.js +22 -12
- package/es/form/ProForm/index.js +13 -12
- package/es/form/typing.d.ts +3 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +7 -2
- package/es/page-header/index.scss +4 -0
- package/es/table/components/Filter/index.js +9 -15
- package/es/table/components/Layout/index.js +15 -15
- package/es/table/index.js +59 -22
- package/es/table/typing.d.ts +3 -1
- package/lib/actions/dialog-form.js +22 -16
- package/lib/actions/dialog.d.ts +5 -1
- package/lib/actions/dialog.js +18 -10
- package/lib/form/Components/ProField/mapDateFormat.js +0 -1
- package/lib/form/Filter/AdvancedFilter.js +21 -11
- package/lib/form/ProForm/index.js +12 -11
- package/lib/form/typing.d.ts +3 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +6 -3
- package/lib/page-header/index.scss +4 -0
- package/lib/table/components/Filter/index.js +9 -15
- package/lib/table/components/Layout/index.js +15 -15
- package/lib/table/index.js +59 -22
- package/lib/table/typing.d.ts +3 -1
- package/package.json +1 -1
- package/dist/pro-without-icon.min.css +0 -1
- package/dist/pro-without-icon.min.js +0 -2
- package/dist/pro-without-icon.min.js.LICENSE.txt +0 -34
package/es/table/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "afterDataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams", "reserveSelectedRecords", "size", "disableSelectAll", "context"];
|
1
|
+
var _excluded = ["header", "className", "tableClassName", "mainAction", "extra", "dataFilter", "afterDataFilter", "toolBar", "columns", "useRowSelection", "rowSelection", "onChangeRowSelection", "getRowSelection", "primaryKey", "footerAction", "footer", "url", "pageKey", "pageSizeKey", "method", "params", "formatSort", "formatParams", "formatResult", "requestWhenMount", "showPagination", "pageSizeList", "responsivePaginationType", "showSkeleton", "skeletonSize", "actionRef", "dataSource", "filterDebounce", "footerSuction", "autoRefresh", "customRequest", "filterColumnType", "defaultFilterParams", "reserveSelectedRecords", "size", "disableSelectAll", "context", "fixedTableBody"];
|
2
2
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
4
4
|
|
@@ -172,6 +172,8 @@ var ProTable = function ProTable(props) {
|
|
172
172
|
propsSize = _props$size === void 0 ? 'medium' : _props$size,
|
173
173
|
disableSelectAll = props.disableSelectAll,
|
174
174
|
context = props.context,
|
175
|
+
_props$fixedTableBody = props.fixedTableBody,
|
176
|
+
fixedTableBody = _props$fixedTableBody === void 0 ? false : _props$fixedTableBody,
|
175
177
|
otherProps = _objectWithoutProperties(props, _excluded);
|
176
178
|
|
177
179
|
var targetPageKey = pageKey || globalPageKey;
|
@@ -253,9 +255,36 @@ var ProTable = function ProTable(props) {
|
|
253
255
|
actionRefCallback = _useState24[0]; // 存储定时器 id
|
254
256
|
|
255
257
|
|
256
|
-
var autoRefreshTimerRef = useRef();
|
258
|
+
var autoRefreshTimerRef = useRef();
|
259
|
+
var onResize = null;
|
260
|
+
useEffect(function () {
|
261
|
+
getHeaderHeight(fullscreenState);
|
262
|
+
|
263
|
+
if (window.onresize) {
|
264
|
+
onResize = window.onresize;
|
265
|
+
|
266
|
+
window.onresize = function () {
|
267
|
+
var _onResize;
|
268
|
+
|
269
|
+
(_onResize = onResize) === null || _onResize === void 0 ? void 0 : _onResize();
|
270
|
+
getHeaderHeight(fullscreenState);
|
271
|
+
};
|
272
|
+
} else {
|
273
|
+
window.onresize = function () {
|
274
|
+
getHeaderHeight(fullscreenState);
|
275
|
+
};
|
276
|
+
}
|
257
277
|
|
258
|
-
|
278
|
+
return function () {
|
279
|
+
if (onResize) {
|
280
|
+
window.onresize = onResize;
|
281
|
+
} else {
|
282
|
+
window.onresize = null;
|
283
|
+
}
|
284
|
+
};
|
285
|
+
}, []); // 获取header高度,用作全屏吸底吸底高度计算以及固定body高度计算(滚动条在底部)
|
286
|
+
|
287
|
+
var getHeaderHeight = function getHeaderHeight(isFullscreen, offset) {
|
259
288
|
var _tableDom$getElements, _tableDom$getElements2;
|
260
289
|
|
261
290
|
var tableDom = tableRef.current;
|
@@ -264,16 +293,29 @@ var ProTable = function ProTable(props) {
|
|
264
293
|
base: true
|
265
294
|
});
|
266
295
|
var tableHeaderDom = tableDom === null || tableDom === void 0 ? void 0 : (_tableDom$getElements2 = tableDom.getElementsByClassName(basePrefix('table-header-inner'))) === null || _tableDom$getElements2 === void 0 ? void 0 : _tableDom$getElements2[0];
|
267
|
-
|
268
|
-
|
269
|
-
|
296
|
+
var pageContainerDom = document.querySelector('.teamix-pro-page-container-header');
|
297
|
+
var teamixNavDom = document.querySelector('.teamix-nav-console');
|
298
|
+
var footerRowSelectionDom = document.querySelector('.teamix-pro-page-container-footer');
|
299
|
+
setTimeout(function () {
|
300
|
+
var _headerDom$offsetHeig, _tableHeaderDom$offse;
|
270
301
|
|
271
|
-
|
302
|
+
var headerHeight = (_headerDom$offsetHeig = headerDom === null || headerDom === void 0 ? void 0 : headerDom.offsetHeight) !== null && _headerDom$offsetHeig !== void 0 ? _headerDom$offsetHeig : 0; // table表头默认一行。即42px
|
272
303
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
304
|
+
var tableHeaderHeight = (_tableHeaderDom$offse = tableHeaderDom === null || tableHeaderDom === void 0 ? void 0 : tableHeaderDom.offsetHeight) !== null && _tableHeaderDom$offse !== void 0 ? _tableHeaderDom$offse : 42;
|
305
|
+
var footerRowSelectionHeight = (footerRowSelectionDom === null || footerRowSelectionDom === void 0 ? void 0 : footerRowSelectionDom.offsetHeight) || 50; // 固定表格主体高度
|
306
|
+
|
307
|
+
if (fixedTableBody && !isFullscreen) {
|
308
|
+
var _pageContainerDom$off, _teamixNavDom$offsetH;
|
309
|
+
|
310
|
+
// 16px 为 padding
|
311
|
+
var pageHeaderHeight = ((_pageContainerDom$off = pageContainerDom === null || pageContainerDom === void 0 ? void 0 : pageContainerDom.offsetHeight) !== null && _pageContainerDom$off !== void 0 ? _pageContainerDom$off : 0) + 16;
|
312
|
+
var teamixNavHeight = (_teamixNavDom$offsetH = teamixNavDom === null || teamixNavDom === void 0 ? void 0 : teamixNavDom.offsetHeight) !== null && _teamixNavDom$offsetH !== void 0 ? _teamixNavDom$offsetH : 0;
|
313
|
+
setHeaderHeight(headerHeight + tableHeaderHeight + pageHeaderHeight + teamixNavHeight + footerRowSelectionHeight + 16 + (offset !== null && offset !== void 0 ? offset : 0));
|
314
|
+
} else {
|
315
|
+
// 24px 为 padding
|
316
|
+
setHeaderHeight(headerHeight + tableHeaderHeight + footerRowSelectionHeight + 24 + (offset !== null && offset !== void 0 ? offset : 0));
|
317
|
+
}
|
318
|
+
}, 50);
|
277
319
|
}; // header 区域高度。用作全屏计算吸顶吸底高度。默认不做计算
|
278
320
|
|
279
321
|
|
@@ -471,10 +513,8 @@ var ProTable = function ProTable(props) {
|
|
471
513
|
|
472
514
|
var state = !fullscreenState; // 全屏时需要重新计算header高度
|
473
515
|
|
474
|
-
getHeaderHeight().then(function (height) {
|
475
|
-
setHeaderHeight(height);
|
476
|
-
});
|
477
516
|
setFullscreenState(state);
|
517
|
+
getHeaderHeight(state);
|
478
518
|
actionRef === null || actionRef === void 0 ? void 0 : (_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$s = _actionRef$current2.setState) === null || _actionRef$current2$s === void 0 ? void 0 : _actionRef$current2$s.call(_actionRef$current2, 'fullScreenState', state);
|
479
519
|
return state;
|
480
520
|
},
|
@@ -542,10 +582,8 @@ var ProTable = function ProTable(props) {
|
|
542
582
|
normalDataFilterForm: normalDataFilterForm,
|
543
583
|
fullscreenDataFilterForm: fullscreenDataFilterForm,
|
544
584
|
filterEnableRef: filterEnableRef,
|
545
|
-
resetTableMaxBodyHeight: function resetTableMaxBodyHeight() {
|
546
|
-
getHeaderHeight(
|
547
|
-
setHeaderHeight(height);
|
548
|
-
});
|
585
|
+
resetTableMaxBodyHeight: function resetTableMaxBodyHeight(offset) {
|
586
|
+
getHeaderHeight(fullscreenState, offset);
|
549
587
|
}
|
550
588
|
}); // 将 Actions 绑定到传入的 propsActionRef 中
|
551
589
|
|
@@ -826,9 +864,8 @@ var ProTable = function ProTable(props) {
|
|
826
864
|
rowSelection: rowSelection,
|
827
865
|
emptyContent: /*#__PURE__*/React.createElement(EmptyContent, null),
|
828
866
|
sortIcons: getTableSortIcons(),
|
829
|
-
fixedHeader: fullscreenState,
|
830
|
-
|
831
|
-
maxBodyHeight: "calc(100vh - 84px - ".concat(headerHeight, "px)")
|
867
|
+
fixedHeader: fullscreenState || fixedTableBody,
|
868
|
+
maxBodyHeight: "calc(100vh - ".concat(headerHeight, "px)")
|
832
869
|
}, pickProps(getTableProps(), otherProps))));
|
833
870
|
} else {
|
834
871
|
// 不传 columns 直接返回原始 Table
|
@@ -970,7 +1007,7 @@ var ProTable = function ProTable(props) {
|
|
970
1007
|
|
971
1008
|
}),
|
972
1009
|
ref: tableRef
|
973
|
-
}, renderTable(isFullScreen), footerSuctionState && footerSuction && !fullscreenState && /*#__PURE__*/React.createElement(ProPageContainer.FixedFooter, null, renderFooter()), !(footerSuctionState && footerSuction) && !fullscreenState && renderFooter(), fullscreenState && renderFooter());
|
1010
|
+
}, renderTable(isFullScreen), (footerSuctionState && footerSuction && !fullscreenState || fixedTableBody) && /*#__PURE__*/React.createElement(ProPageContainer.FixedFooter, null, renderFooter()), !(footerSuctionState && footerSuction) && !fullscreenState && !fixedTableBody && renderFooter(), fullscreenState && renderFooter());
|
974
1011
|
});
|
975
1012
|
};
|
976
1013
|
|
package/es/table/typing.d.ts
CHANGED
@@ -141,6 +141,8 @@ export declare type ProTableProps = {
|
|
141
141
|
disableSelectAll?: boolean;
|
142
142
|
/** 接收外部传来的 context,eg: dialog-table */
|
143
143
|
context?: any;
|
144
|
+
/** 是否固定表格主体(开启后横向滚动条会固定在底部) */
|
145
|
+
fixedTableBody?: boolean;
|
144
146
|
} & Omit<TableProps, 'columns'> & ProTableTopAreaProps;
|
145
147
|
export declare type rowSelectionType = {
|
146
148
|
getProps?: (record: any, index: number) => any;
|
@@ -224,7 +226,7 @@ export declare type ProTableActionTypeMutations = {
|
|
224
226
|
/** 获取 列 过滤规则 */
|
225
227
|
getFilterRules?: () => object;
|
226
228
|
/** 重新计算表格maxHeight高度 */
|
227
|
-
resetTableMaxBodyHeight?: () => void;
|
229
|
+
resetTableMaxBodyHeight?: (offset: number) => void;
|
228
230
|
/** 列筛选规则 */
|
229
231
|
filterColumns?: any[];
|
230
232
|
/** 获取所有 on 监听事件 */
|
@@ -59,6 +59,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
59
59
|
|
60
60
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
61
61
|
|
62
|
+
var toJS = _form.formilyReactive.toJS;
|
63
|
+
|
62
64
|
function getDefaultFormPropsByDialogSize(size) {
|
63
65
|
if (size === 'small') {
|
64
66
|
return {
|
@@ -205,51 +207,55 @@ function useDialogFormAction(action, context) {
|
|
205
207
|
innerFormRef.current.validate().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
206
208
|
var _innerFormRef$current;
|
207
209
|
|
208
|
-
var beforeRequestContext, requestContext;
|
210
|
+
var beforeRequestContext, fields, requestContext;
|
209
211
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
210
212
|
while (1) {
|
211
213
|
switch (_context.prev = _context.next) {
|
212
214
|
case 0:
|
215
|
+
fields = toJS((_innerFormRef$current = innerFormRef.current) === null || _innerFormRef$current === void 0 ? void 0 : _innerFormRef$current.values);
|
216
|
+
|
213
217
|
if (!propsBeforeRequest) {
|
214
|
-
_context.next =
|
218
|
+
_context.next = 14;
|
215
219
|
break;
|
216
220
|
}
|
217
221
|
|
218
|
-
_context.prev =
|
219
|
-
_context.next =
|
220
|
-
return (0, _utils.resolveMaybePromiseMethod)(propsBeforeRequest, context)
|
222
|
+
_context.prev = 2;
|
223
|
+
_context.next = 5;
|
224
|
+
return (0, _utils.resolveMaybePromiseMethod)(propsBeforeRequest, _objectSpread(_objectSpread({}, context), {}, {
|
225
|
+
fields: fields
|
226
|
+
}));
|
221
227
|
|
222
|
-
case
|
228
|
+
case 5:
|
223
229
|
beforeRequestContext = _context.sent;
|
224
|
-
_context.next =
|
230
|
+
_context.next = 11;
|
225
231
|
break;
|
226
232
|
|
227
|
-
case
|
228
|
-
_context.prev =
|
229
|
-
_context.t0 = _context["catch"](
|
233
|
+
case 8:
|
234
|
+
_context.prev = 8;
|
235
|
+
_context.t0 = _context["catch"](2);
|
230
236
|
beforeRequestContext = false;
|
231
237
|
|
232
|
-
case
|
238
|
+
case 11:
|
233
239
|
if (!(beforeRequestContext === false)) {
|
234
|
-
_context.next =
|
240
|
+
_context.next = 14;
|
235
241
|
break;
|
236
242
|
}
|
237
243
|
|
238
244
|
reject(false);
|
239
245
|
return _context.abrupt("return");
|
240
246
|
|
241
|
-
case
|
247
|
+
case 14:
|
242
248
|
requestContext = Object.assign({
|
243
|
-
fields:
|
249
|
+
fields: fields
|
244
250
|
}, _typeof(beforeRequestContext) === 'object' ? beforeRequestContext : {});
|
245
251
|
resolve(requestContext);
|
246
252
|
|
247
|
-
case
|
253
|
+
case 16:
|
248
254
|
case "end":
|
249
255
|
return _context.stop();
|
250
256
|
}
|
251
257
|
}
|
252
|
-
}, _callee, null, [[
|
258
|
+
}, _callee, null, [[2, 8]]);
|
253
259
|
}))).catch(function () {
|
254
260
|
resolve(false);
|
255
261
|
});
|
package/lib/actions/dialog.d.ts
CHANGED
@@ -4,7 +4,7 @@ import { quickShowDrawerProps } from '@alicloudfe/components/types/drawer';
|
|
4
4
|
import { ProFormSchema, ProFormSchemaItem } from '../form';
|
5
5
|
import { ProMessageProps } from '../utils/message';
|
6
6
|
import { RequestAction } from './request';
|
7
|
-
export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShowConfig, 'onError' | 'type'>, Omit<quickShowDrawerProps, 'trigger' | 'animation' | 'height' | 'locale' | '
|
7
|
+
export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShowConfig, 'onError' | 'type'>, Omit<quickShowDrawerProps, 'trigger' | 'animation' | 'height' | 'locale' | 'onError'> {
|
8
8
|
/** 点击「确认按钮」后的数据请求地址,非必填,不填就不发请求 */
|
9
9
|
url?: string;
|
10
10
|
/** 弹窗类型,支持普通弹窗和抽屉两种模式,默认为普通弹窗 */
|
@@ -25,6 +25,10 @@ export interface DialogAction extends Omit<RequestAction, 'url'>, Omit<QuickShow
|
|
25
25
|
schema?: any;
|
26
26
|
/** 弹窗内容区的组件 */
|
27
27
|
component?: any;
|
28
|
+
/** 点击确定自定义回调函数 */
|
29
|
+
onOk?: any;
|
30
|
+
/** 点击取消自定义回调函数 */
|
31
|
+
onCancel?: any;
|
28
32
|
}
|
29
33
|
export declare function useDialogAction(action: DialogAction, actionContext?: any, hasForm?: boolean): {
|
30
34
|
[x: string]: (e: React.MouseEvent<HTMLElement, MouseEvent>) => Promise<void>;
|
package/lib/actions/dialog.js
CHANGED
@@ -30,7 +30,7 @@ var _request = require("./request");
|
|
30
30
|
|
31
31
|
var _utils2 = require("./utils");
|
32
32
|
|
33
|
-
var _excluded = ["trigger", "url", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError"],
|
33
|
+
var _excluded = ["trigger", "url", "customRequest", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError", "onOk", "onCancel"],
|
34
34
|
_excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "popType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent", "message", "footerDescription", "footerAlign", "className"];
|
35
35
|
|
36
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -77,7 +77,9 @@ var FooterForm = function FooterForm(props) {
|
|
77
77
|
var schema = props.schema,
|
78
78
|
context = props.context,
|
79
79
|
formRef = props.formRef;
|
80
|
-
var form = (0,
|
80
|
+
var form = (0, _react.useMemo)(function () {
|
81
|
+
return (0, _form.createForm)();
|
82
|
+
}, []);
|
81
83
|
(0, _react.useEffect)(function () {
|
82
84
|
formRef.current = form;
|
83
85
|
}, []);
|
@@ -110,6 +112,7 @@ function useDialogAction(action, actionContext, hasForm) {
|
|
110
112
|
|
111
113
|
var trigger = action.trigger,
|
112
114
|
url = action.url,
|
115
|
+
customRequest = action.customRequest,
|
113
116
|
method = action.method,
|
114
117
|
params = action.params,
|
115
118
|
data = action.data,
|
@@ -120,6 +123,8 @@ function useDialogAction(action, actionContext, hasForm) {
|
|
120
123
|
formatResult = action.formatResult,
|
121
124
|
onSuccess = action.onSuccess,
|
122
125
|
onError = action.onError,
|
126
|
+
propsOnOk = action.onOk,
|
127
|
+
propsOnCancel = action.onCancel,
|
123
128
|
others = _objectWithoutProperties(action, _excluded);
|
124
129
|
|
125
130
|
var _getTargetValue = (0, _utils.getTargetValue)(others, context),
|
@@ -200,33 +205,34 @@ function useDialogAction(action, actionContext, hasForm) {
|
|
200
205
|
|
201
206
|
case 6:
|
202
207
|
onFinish && onFinish();
|
208
|
+
propsOnOk && propsOnOk(context);
|
203
209
|
resolve(true);
|
204
|
-
_context.next =
|
210
|
+
_context.next = 19;
|
205
211
|
break;
|
206
212
|
|
207
|
-
case
|
208
|
-
_context.prev =
|
213
|
+
case 11:
|
214
|
+
_context.prev = 11;
|
209
215
|
_context.t0 = _context["catch"](2);
|
210
216
|
setLoading(false); // 如果 beforeRequest 中返回了 false 并且不是 dialog-form,则直接关闭弹窗
|
211
217
|
|
212
218
|
if (!(beforeRequest && !hasForm)) {
|
213
|
-
_context.next =
|
219
|
+
_context.next = 17;
|
214
220
|
break;
|
215
221
|
}
|
216
222
|
|
217
223
|
resolve(true);
|
218
224
|
return _context.abrupt("return");
|
219
225
|
|
220
|
-
case
|
226
|
+
case 17:
|
221
227
|
resolve(false);
|
222
228
|
return _context.abrupt("return");
|
223
229
|
|
224
|
-
case
|
230
|
+
case 19:
|
225
231
|
case "end":
|
226
232
|
return _context.stop();
|
227
233
|
}
|
228
234
|
}
|
229
|
-
}, _callee, null, [[2,
|
235
|
+
}, _callee, null, [[2, 11]]);
|
230
236
|
}));
|
231
237
|
|
232
238
|
return function (_x) {
|
@@ -249,7 +255,9 @@ function useDialogAction(action, actionContext, hasForm) {
|
|
249
255
|
});
|
250
256
|
var dialogContent = Component ? /*#__PURE__*/_react.default.createElement(Component, _objectSpread({}, (0, _utils2.addContext)(componentProps, dialogContext))) : addContextForReactNode(content, dialogContext);
|
251
257
|
|
252
|
-
var quickShowProps = _objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, "".concat(isPop ? 'onConfirm' : 'onOk'), onOk), _defineProperty(_objectSpread2, "
|
258
|
+
var quickShowProps = _objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, "".concat(isPop ? 'onConfirm' : 'onOk'), onOk), _defineProperty(_objectSpread2, "onCancel", function onCancel() {
|
259
|
+
propsOnCancel && propsOnCancel(context);
|
260
|
+
}), _defineProperty(_objectSpread2, "title", addContextForReactNode(title, dialogContext)), _defineProperty(_objectSpread2, "content", /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, beforeContent && /*#__PURE__*/_react.default.createElement("div", {
|
253
261
|
className: "teamix-pro-dialog-before-content"
|
254
262
|
}, addContextForReactNode(beforeContent, dialogContext)), message && /*#__PURE__*/_react.default.createElement("div", {
|
255
263
|
className: "teamix-pro-dialog-message"
|
@@ -15,7 +15,7 @@ var _ProForm = _interopRequireDefault(require("../ProForm"));
|
|
15
15
|
|
16
16
|
var _utils2 = require("../utils");
|
17
17
|
|
18
|
-
var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "forceClear"];
|
18
|
+
var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "gridProps", "forceClear"];
|
19
19
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
21
21
|
|
@@ -23,12 +23,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
23
23
|
|
24
24
|
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; }
|
25
25
|
|
26
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
27
|
-
|
28
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
29
|
-
|
30
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
31
|
-
|
32
26
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
33
27
|
|
34
28
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -41,6 +35,12 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
41
35
|
|
42
36
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
43
37
|
|
38
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
39
|
+
|
40
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
41
|
+
|
42
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
43
|
+
|
44
44
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
45
45
|
|
46
46
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
@@ -57,6 +57,8 @@ var AdvancedFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
57
57
|
wrapperAlign = props.wrapperAlign,
|
58
58
|
labelCol = props.labelCol,
|
59
59
|
wrapperCol = props.wrapperCol,
|
60
|
+
breakpoints = props.breakpoints,
|
61
|
+
gridProps = props.gridProps,
|
60
62
|
forceClear = props.forceClear,
|
61
63
|
otherProps = _objectWithoutProperties(props, _excluded);
|
62
64
|
|
@@ -65,13 +67,13 @@ var AdvancedFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
65
67
|
return [{
|
66
68
|
name: 'FormGrid',
|
67
69
|
component: 'FormGrid',
|
68
|
-
props: {
|
70
|
+
props: _objectSpread({
|
69
71
|
breakpoints: [480, 720, 990, 1200, Infinity],
|
70
72
|
maxColumns: [1, 2, 3, 3, 4],
|
71
73
|
maxWidth: [480, 360, 330, 400],
|
72
74
|
columnGap: 16,
|
73
75
|
rowGap: 12
|
74
|
-
},
|
76
|
+
}, gridProps),
|
75
77
|
children: [].concat(_toConsumableArray(schema), [{
|
76
78
|
component: 'FormGrid.GridColumn',
|
77
79
|
props: {
|
@@ -103,15 +105,22 @@ var AdvancedFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
103
105
|
}];
|
104
106
|
}, [schema, onReset]);
|
105
107
|
var getTeamixLayout = (0, _react.useMemo)(function () {
|
106
|
-
return {
|
108
|
+
return breakpoints === true ? {
|
107
109
|
breakpoints: [990],
|
108
110
|
layout: (0, _utils2.mergeArrayValue)(['vertical'], layout),
|
109
111
|
labelAlign: (0, _utils2.mergeArrayValue)(['left'], labelAlign),
|
110
112
|
wrapperAlign: (0, _utils2.mergeArrayValue)(['left'], wrapperAlign),
|
111
113
|
labelCol: (0, _utils2.mergeArrayValue)([24], labelCol),
|
112
114
|
wrapperCol: (0, _utils2.mergeArrayValue)([24], wrapperCol)
|
115
|
+
} : {
|
116
|
+
breakpoints: (0, _utils.isBool)(breakpoints) ? undefined : breakpoints,
|
117
|
+
layout: layout,
|
118
|
+
labelAlign: labelAlign,
|
119
|
+
wrapperAlign: wrapperAlign,
|
120
|
+
labelCol: labelCol,
|
121
|
+
wrapperCol: wrapperCol
|
113
122
|
};
|
114
|
-
}, [layout, labelAlign, wrapperAlign, labelCol, wrapperCol]);
|
123
|
+
}, [breakpoints, layout, labelAlign, wrapperAlign, labelCol, wrapperCol]);
|
115
124
|
return /*#__PURE__*/_react.default.createElement(_ProForm.default, _objectSpread(_objectSpread(_objectSpread({
|
116
125
|
className: (0, _utils.cls)(prefixCls(), props.className),
|
117
126
|
schema: gridSchema,
|
@@ -121,6 +130,7 @@ var AdvancedFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
121
130
|
}));
|
122
131
|
});
|
123
132
|
AdvancedFilter.defaultProps = {
|
133
|
+
breakpoints: true,
|
124
134
|
layout: 'horizontal',
|
125
135
|
labelAlign: 'right',
|
126
136
|
labelCol: 6,
|
@@ -133,20 +133,20 @@ var ProForm = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
133
133
|
var onAutoSubmit = (0, _useAutoSubmit.default)(onSubmit, context); // todo 需要formily支持断点下的属性更新
|
134
134
|
|
135
135
|
var getTeamixLayout = (0, _react.useMemo)(function () {
|
136
|
-
return breakpoints ? {
|
137
|
-
breakpoints: breakpoints,
|
138
|
-
layout: layout,
|
139
|
-
labelAlign: labelAlign,
|
140
|
-
wrapperAlign: wrapperAlign,
|
141
|
-
labelCol: labelCol,
|
142
|
-
wrapperCol: wrapperCol
|
143
|
-
} : {
|
136
|
+
return breakpoints === true ? {
|
144
137
|
breakpoints: [480],
|
145
138
|
layout: (0, _utils2.mergeArrayValue)(['vertical'], layout),
|
146
139
|
labelAlign: (0, _utils2.mergeArrayValue)(['left'], labelAlign),
|
147
140
|
wrapperAlign: (0, _utils2.mergeArrayValue)(['left'], wrapperAlign),
|
148
141
|
labelCol: (0, _utils2.mergeArrayValue)([24], labelCol),
|
149
142
|
wrapperCol: (0, _utils2.mergeArrayValue)([24], wrapperCol)
|
143
|
+
} : {
|
144
|
+
breakpoints: (0, _utils.isBool)(breakpoints) ? undefined : breakpoints,
|
145
|
+
layout: layout,
|
146
|
+
labelAlign: labelAlign,
|
147
|
+
wrapperAlign: wrapperAlign,
|
148
|
+
labelCol: labelCol,
|
149
|
+
wrapperCol: wrapperCol
|
150
150
|
};
|
151
151
|
}, [breakpoints, layout, labelAlign, wrapperAlign, labelCol, wrapperCol]);
|
152
152
|
(0, _react.useMemo)(function () {
|
@@ -182,7 +182,7 @@ var ProForm = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
182
182
|
});
|
183
183
|
});
|
184
184
|
}
|
185
|
-
}, [onChange]);
|
185
|
+
}, [onChange, form]);
|
186
186
|
(0, _react.useEffect)(function () {
|
187
187
|
// 配置国际化
|
188
188
|
(0, _core.setValidateLanguage)((0, _utils.getLanguage)() || 'zh-cn');
|
@@ -201,8 +201,9 @@ var ProForm = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
201
201
|
});
|
202
202
|
ProForm.defaultProps = {
|
203
203
|
colon: false,
|
204
|
-
|
205
|
-
|
204
|
+
validateFirst: true,
|
205
|
+
breakpoints: true,
|
206
|
+
labelAlign: 'left'
|
206
207
|
};
|
207
208
|
var _default = ProForm;
|
208
209
|
exports.default = _default;
|
package/lib/form/typing.d.ts
CHANGED
@@ -59,7 +59,7 @@ export interface ProFormSchemaItem {
|
|
59
59
|
data?: AnyObject;
|
60
60
|
}
|
61
61
|
export declare type ProFormSchema = ProFormSchemaItem[];
|
62
|
-
export interface ProFormProps extends IFormLayoutProps {
|
62
|
+
export interface ProFormProps extends Omit<IFormLayoutProps, 'breakpoints'> {
|
63
63
|
form?: FormType | false;
|
64
64
|
schema?: ProFormSchema;
|
65
65
|
scope?: any;
|
@@ -77,6 +77,7 @@ export interface ProFormProps extends IFormLayoutProps {
|
|
77
77
|
onSubmit?: ((values: any) => any) | CommonRequestConfig;
|
78
78
|
onSubmitFailed?: (feedbacks: IFormFeedback[]) => void;
|
79
79
|
onInitialComplete?: (form: FormType) => void;
|
80
|
+
breakpoints?: number[] | boolean;
|
80
81
|
}
|
81
82
|
export interface FilterProps extends ProFormProps {
|
82
83
|
form: FormType;
|
@@ -108,6 +109,7 @@ export interface QueryFilterProps extends ProFormProps {
|
|
108
109
|
purePanel?: boolean;
|
109
110
|
/** 面板是否默认展开,仅在 mode='panel' 时生效 */
|
110
111
|
expand?: boolean;
|
112
|
+
gridProps?: any;
|
111
113
|
/** 是否强制清除 */
|
112
114
|
forceClear?: boolean;
|
113
115
|
/** 顶部筛选区前缀 */
|
package/lib/index.d.ts
CHANGED
@@ -28,5 +28,5 @@ export * from './table';
|
|
28
28
|
export * from './sidebar';
|
29
29
|
export * from './utils';
|
30
30
|
export * from './timeline';
|
31
|
-
declare const version = "1.4.
|
31
|
+
declare const version = "1.4.10";
|
32
32
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils, };
|
package/lib/index.js
CHANGED
@@ -304,15 +304,18 @@ var _icon = _interopRequireDefault(require("@teamix/icon"));
|
|
304
304
|
|
305
305
|
require("./global.scss");
|
306
306
|
|
307
|
+
var _window;
|
308
|
+
|
307
309
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
308
310
|
|
309
311
|
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); }
|
310
312
|
|
311
313
|
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; }
|
312
314
|
|
313
|
-
// import ProLayout from './layout';
|
314
315
|
// 设置图标源
|
315
|
-
|
316
|
+
if (!((_window = window) === null || _window === void 0 ? void 0 : _window.TEAMIXPRO_WITHOUT_ICON)) {
|
317
|
+
_icon.default.setConfig(_utils.default.getTeamixIconConfig());
|
318
|
+
}
|
316
319
|
|
317
|
-
var version = '1.4.
|
320
|
+
var version = '1.4.10';
|
318
321
|
exports.version = version;
|
@@ -191,7 +191,7 @@ var Filter = function Filter(props) {
|
|
191
191
|
btn: true
|
192
192
|
}),
|
193
193
|
onClick: function onClick() {
|
194
|
-
var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s;
|
194
|
+
var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s, _actionRef$current5, _actionRef$current6, _actionRef$current6$r, _actionRef$current7, _actionRef$current7$r, _actionRef$current8, _actionRef$current8$c;
|
195
195
|
|
196
196
|
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$f = _actionRef$current2.filterDataSource) === null || _actionRef$current2$f === void 0 ? void 0 : _actionRef$current2$f.call(_actionRef$current2, column.dataIndex); // 先获取此列的param
|
197
197
|
|
@@ -212,24 +212,18 @@ var Filter = function Filter(props) {
|
|
212
212
|
rules: selected,
|
213
213
|
params: param
|
214
214
|
})));
|
215
|
+
var targetPageKey = 'currentPage';
|
216
|
+
var pageInfo = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.pageInfo;
|
215
217
|
|
216
|
-
if (
|
217
|
-
|
218
|
+
if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
|
219
|
+
targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
|
220
|
+
} // 发送请求
|
218
221
|
|
219
|
-
var targetPageKey = 'currentPage';
|
220
|
-
var pageInfo = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.pageInfo;
|
221
222
|
|
222
|
-
|
223
|
-
|
224
|
-
} // 发送请求
|
225
|
-
|
226
|
-
|
227
|
-
(_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$r = _actionRef$current6.request) === null || _actionRef$current6$r === void 0 ? void 0 : _actionRef$current6$r.call(_actionRef$current6, _defineProperty({}, targetPageKey, 1));
|
228
|
-
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$r = _actionRef$current7.resetPage) === null || _actionRef$current7$r === void 0 ? void 0 : _actionRef$current7$r.call(_actionRef$current7); // 清空表格选择
|
229
|
-
|
230
|
-
(_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
|
231
|
-
}
|
223
|
+
(_actionRef$current6 = actionRef.current) === null || _actionRef$current6 === void 0 ? void 0 : (_actionRef$current6$r = _actionRef$current6.request) === null || _actionRef$current6$r === void 0 ? void 0 : _actionRef$current6$r.call(_actionRef$current6, _defineProperty({}, targetPageKey, 1));
|
224
|
+
(_actionRef$current7 = actionRef.current) === null || _actionRef$current7 === void 0 ? void 0 : (_actionRef$current7$r = _actionRef$current7.resetPage) === null || _actionRef$current7$r === void 0 ? void 0 : _actionRef$current7$r.call(_actionRef$current7); // 清空表格选择
|
232
225
|
|
226
|
+
(_actionRef$current8 = actionRef.current) === null || _actionRef$current8 === void 0 ? void 0 : (_actionRef$current8$c = _actionRef$current8.clearRowSelection) === null || _actionRef$current8$c === void 0 ? void 0 : _actionRef$current8$c.call(_actionRef$current8);
|
233
227
|
setVisible(false);
|
234
228
|
}
|
235
229
|
}, (0, _utils.getMessage)('ok')), /*#__PURE__*/_react.default.createElement(_components.Button, {
|