@teamix/pro 1.4.9 → 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 +141 -67
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/form/Components/ProField/mapDateFormat.js +0 -1
- package/es/form/Filter/AdvancedFilter.js +22 -12
- package/es/form/ProForm/index.js +12 -11
- package/es/form/typing.d.ts +3 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/page-header/index.scss +4 -0
- 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/form/Components/ProField/mapDateFormat.js +0 -1
- package/lib/form/Filter/AdvancedFilter.js +21 -11
- package/lib/form/ProForm/index.js +11 -10
- package/lib/form/typing.d.ts +3 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/page-header/index.scss +4 -0
- 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
@@ -1,10 +1,4 @@
|
|
1
|
-
var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "forceClear"];
|
2
|
-
|
3
|
-
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; }
|
4
|
-
|
5
|
-
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; }
|
6
|
-
|
7
|
-
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; }
|
1
|
+
var _excluded = ["schema", "onSubmit", "onReset", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol", "breakpoints", "gridProps", "forceClear"];
|
8
2
|
|
9
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
10
4
|
|
@@ -18,12 +12,18 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
18
12
|
|
19
13
|
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; }
|
20
14
|
|
15
|
+
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; }
|
16
|
+
|
17
|
+
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; }
|
18
|
+
|
19
|
+
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; }
|
20
|
+
|
21
21
|
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; }
|
22
22
|
|
23
23
|
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; }
|
24
24
|
|
25
25
|
import React, { memo, useMemo } from 'react';
|
26
|
-
import { usePrefixCls, getMessage, cls } from '@teamix/utils';
|
26
|
+
import { usePrefixCls, getMessage, cls, isBool } from '@teamix/utils';
|
27
27
|
import ProForm from '../ProForm';
|
28
28
|
import { mergeArrayValue } from '../utils';
|
29
29
|
/**
|
@@ -39,6 +39,8 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
39
39
|
wrapperAlign = props.wrapperAlign,
|
40
40
|
labelCol = props.labelCol,
|
41
41
|
wrapperCol = props.wrapperCol,
|
42
|
+
breakpoints = props.breakpoints,
|
43
|
+
gridProps = props.gridProps,
|
42
44
|
forceClear = props.forceClear,
|
43
45
|
otherProps = _objectWithoutProperties(props, _excluded);
|
44
46
|
|
@@ -47,13 +49,13 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
47
49
|
return [{
|
48
50
|
name: 'FormGrid',
|
49
51
|
component: 'FormGrid',
|
50
|
-
props: {
|
52
|
+
props: _objectSpread({
|
51
53
|
breakpoints: [480, 720, 990, 1200, Infinity],
|
52
54
|
maxColumns: [1, 2, 3, 3, 4],
|
53
55
|
maxWidth: [480, 360, 330, 400],
|
54
56
|
columnGap: 16,
|
55
57
|
rowGap: 12
|
56
|
-
},
|
58
|
+
}, gridProps),
|
57
59
|
children: [].concat(_toConsumableArray(schema), [{
|
58
60
|
component: 'FormGrid.GridColumn',
|
59
61
|
props: {
|
@@ -85,15 +87,22 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
85
87
|
}];
|
86
88
|
}, [schema, onReset]);
|
87
89
|
var getTeamixLayout = useMemo(function () {
|
88
|
-
return {
|
90
|
+
return breakpoints === true ? {
|
89
91
|
breakpoints: [990],
|
90
92
|
layout: mergeArrayValue(['vertical'], layout),
|
91
93
|
labelAlign: mergeArrayValue(['left'], labelAlign),
|
92
94
|
wrapperAlign: mergeArrayValue(['left'], wrapperAlign),
|
93
95
|
labelCol: mergeArrayValue([24], labelCol),
|
94
96
|
wrapperCol: mergeArrayValue([24], wrapperCol)
|
97
|
+
} : {
|
98
|
+
breakpoints: isBool(breakpoints) ? undefined : breakpoints,
|
99
|
+
layout: layout,
|
100
|
+
labelAlign: labelAlign,
|
101
|
+
wrapperAlign: wrapperAlign,
|
102
|
+
labelCol: labelCol,
|
103
|
+
wrapperCol: wrapperCol
|
95
104
|
};
|
96
|
-
}, [layout, labelAlign, wrapperAlign, labelCol, wrapperCol]);
|
105
|
+
}, [breakpoints, layout, labelAlign, wrapperAlign, labelCol, wrapperCol]);
|
97
106
|
return /*#__PURE__*/React.createElement(ProForm, _objectSpread(_objectSpread(_objectSpread({
|
98
107
|
className: cls(prefixCls(), props.className),
|
99
108
|
schema: gridSchema,
|
@@ -103,6 +112,7 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
|
|
103
112
|
}));
|
104
113
|
});
|
105
114
|
AdvancedFilter.defaultProps = {
|
115
|
+
breakpoints: true,
|
106
116
|
layout: 'horizontal',
|
107
117
|
labelAlign: 'right',
|
108
118
|
labelCol: 6,
|
package/es/form/ProForm/index.js
CHANGED
@@ -11,7 +11,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
11
11
|
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; }
|
12
12
|
|
13
13
|
import React, { memo, useEffect, useMemo } from 'react';
|
14
|
-
import { usePrefixCls, cls, getLanguage, getGlobalConfig } from '@teamix/utils';
|
14
|
+
import { usePrefixCls, cls, getLanguage, getGlobalConfig, isBool } from '@teamix/utils';
|
15
15
|
import { createForm, onFieldValueChange, onFormValuesChange, registerValidateLocale, setValidateLanguage } from '@formily/core';
|
16
16
|
import { toJS } from '@formily/reactive';
|
17
17
|
import { Form, Upload, SelectTable, FormLayout, FormItem, ArrayCollapse, ArrayCards, ArrayItems, ArrayTable, Space, FormGrid, FormTab, FormCollapse, FormStep, Editable, FormDialog, FormDrawer, FormButtonGroup, Submit, Reset } from '@teamix/formily';
|
@@ -101,20 +101,20 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
101
101
|
var onAutoSubmit = useAutoSubmit(onSubmit, context); // todo 需要formily支持断点下的属性更新
|
102
102
|
|
103
103
|
var getTeamixLayout = useMemo(function () {
|
104
|
-
return breakpoints ? {
|
105
|
-
breakpoints: breakpoints,
|
106
|
-
layout: layout,
|
107
|
-
labelAlign: labelAlign,
|
108
|
-
wrapperAlign: wrapperAlign,
|
109
|
-
labelCol: labelCol,
|
110
|
-
wrapperCol: wrapperCol
|
111
|
-
} : {
|
104
|
+
return breakpoints === true ? {
|
112
105
|
breakpoints: [480],
|
113
106
|
layout: mergeArrayValue(['vertical'], layout),
|
114
107
|
labelAlign: mergeArrayValue(['left'], labelAlign),
|
115
108
|
wrapperAlign: mergeArrayValue(['left'], wrapperAlign),
|
116
109
|
labelCol: mergeArrayValue([24], labelCol),
|
117
110
|
wrapperCol: mergeArrayValue([24], wrapperCol)
|
111
|
+
} : {
|
112
|
+
breakpoints: isBool(breakpoints) ? undefined : breakpoints,
|
113
|
+
layout: layout,
|
114
|
+
labelAlign: labelAlign,
|
115
|
+
wrapperAlign: wrapperAlign,
|
116
|
+
labelCol: labelCol,
|
117
|
+
wrapperCol: wrapperCol
|
118
118
|
};
|
119
119
|
}, [breakpoints, layout, labelAlign, wrapperAlign, labelCol, wrapperCol]);
|
120
120
|
useMemo(function () {
|
@@ -169,7 +169,8 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
|
|
169
169
|
});
|
170
170
|
ProForm.defaultProps = {
|
171
171
|
colon: false,
|
172
|
-
|
173
|
-
|
172
|
+
validateFirst: true,
|
173
|
+
breakpoints: true,
|
174
|
+
labelAlign: 'left'
|
174
175
|
};
|
175
176
|
export default ProForm;
|
package/es/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/es/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/es/index.js
CHANGED
@@ -36,6 +36,6 @@ export * from './table';
|
|
36
36
|
export * from './sidebar';
|
37
37
|
export * from './utils';
|
38
38
|
export * from './timeline';
|
39
|
-
var version = '1.4.
|
39
|
+
var version = '1.4.10';
|
40
40
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
41
41
|
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils };
|
@@ -86,13 +86,11 @@ var Layout = function Layout(props) {
|
|
86
86
|
onExpand: function onExpand(expand) {
|
87
87
|
// 全屏模式下展开收起过滤器需要重新计算tableMaxHeight
|
88
88
|
setTimeout(function () {
|
89
|
-
var _actionRef$current, _actionRef$current$
|
89
|
+
var _actionRef$current, _actionRef$current$re;
|
90
90
|
|
91
|
-
if (
|
92
|
-
|
93
|
-
|
94
|
-
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$r = _actionRef$current2.resetTableMaxBodyHeight) === null || _actionRef$current2$r === void 0 ? void 0 : _actionRef$current2$r.call(_actionRef$current2);
|
95
|
-
}
|
91
|
+
// if (actionRef.current?.getState?.().fullScreenState) {
|
92
|
+
// 偏移量8像素为面板展开后的下margin
|
93
|
+
(_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$re = _actionRef$current.resetTableMaxBodyHeight) === null || _actionRef$current$re === void 0 ? void 0 : _actionRef$current$re.call(_actionRef$current, expand ? 8 : 0); // }
|
96
94
|
});
|
97
95
|
(dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand) && (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand(expand));
|
98
96
|
},
|
@@ -106,13 +104,11 @@ var Layout = function Layout(props) {
|
|
106
104
|
onExpand: function onExpand(expand) {
|
107
105
|
// 全屏模式下展开收起过滤器需要重新计算tableMaxHeight
|
108
106
|
setTimeout(function () {
|
109
|
-
var _actionRef$
|
110
|
-
|
111
|
-
if ((_actionRef$current3 = actionRef.current) === null || _actionRef$current3 === void 0 ? void 0 : (_actionRef$current3$g = _actionRef$current3.getState) === null || _actionRef$current3$g === void 0 ? void 0 : _actionRef$current3$g.call(_actionRef$current3).fullScreenState) {
|
112
|
-
var _actionRef$current4, _actionRef$current4$r;
|
107
|
+
var _actionRef$current2, _actionRef$current2$r;
|
113
108
|
|
114
|
-
|
115
|
-
|
109
|
+
// if (actionRef.current?.getState?.().fullScreenState) {
|
110
|
+
// 偏移量8像素为面板展开后的下margin
|
111
|
+
(_actionRef$current2 = actionRef.current) === null || _actionRef$current2 === void 0 ? void 0 : (_actionRef$current2$r = _actionRef$current2.resetTableMaxBodyHeight) === null || _actionRef$current2$r === void 0 ? void 0 : _actionRef$current2$r.call(_actionRef$current2, expand ? 8 : 0); // }
|
116
112
|
});
|
117
113
|
(dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand) && (dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.onExpand(expand));
|
118
114
|
},
|
@@ -174,9 +170,13 @@ var Layout = function Layout(props) {
|
|
174
170
|
}
|
175
171
|
};
|
176
172
|
|
177
|
-
|
178
|
-
|
179
|
-
|
173
|
+
if ((dataFilter === null || dataFilter === void 0 ? void 0 : dataFilter.schema) || mainAction || header || extra) {
|
174
|
+
return /*#__PURE__*/React.createElement("div", {
|
175
|
+
className: cls()
|
176
|
+
}, renderLayout());
|
177
|
+
}
|
178
|
+
|
179
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
180
180
|
};
|
181
181
|
|
182
182
|
export default /*#__PURE__*/React.memo(Layout);
|
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 监听事件 */
|
@@ -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 () {
|
@@ -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