@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.
@@ -32,11 +32,12 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
32
32
  import React, { useState, useEffect, createRef, useMemo } from 'react';
33
33
  import { useHistory } from 'react-router-dom';
34
34
  import { Loading } from '@alicloudfe/components';
35
- import ProForm, { createForm } from '../form';
35
+ import ProForm, { createForm, formilyReactive } from '../form';
36
36
  import { getTargetValue, resolveMaybePromiseMethod } from '@teamix/utils';
37
37
  import { doRequest } from './request';
38
38
  import useDialogAction from './dialog';
39
39
  import { addContext } from './utils';
40
+ var toJS = formilyReactive.toJS;
40
41
 
41
42
  function getDefaultFormPropsByDialogSize(size) {
42
43
  if (size === 'small') {
@@ -184,51 +185,55 @@ export function useDialogFormAction(action, context) {
184
185
  innerFormRef.current.validate().then( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
185
186
  var _innerFormRef$current;
186
187
 
187
- var beforeRequestContext, requestContext;
188
+ var beforeRequestContext, fields, requestContext;
188
189
  return regeneratorRuntime.wrap(function _callee$(_context) {
189
190
  while (1) {
190
191
  switch (_context.prev = _context.next) {
191
192
  case 0:
193
+ fields = toJS((_innerFormRef$current = innerFormRef.current) === null || _innerFormRef$current === void 0 ? void 0 : _innerFormRef$current.values);
194
+
192
195
  if (!propsBeforeRequest) {
193
- _context.next = 13;
196
+ _context.next = 14;
194
197
  break;
195
198
  }
196
199
 
197
- _context.prev = 1;
198
- _context.next = 4;
199
- return resolveMaybePromiseMethod(propsBeforeRequest, context);
200
+ _context.prev = 2;
201
+ _context.next = 5;
202
+ return resolveMaybePromiseMethod(propsBeforeRequest, _objectSpread(_objectSpread({}, context), {}, {
203
+ fields: fields
204
+ }));
200
205
 
201
- case 4:
206
+ case 5:
202
207
  beforeRequestContext = _context.sent;
203
- _context.next = 10;
208
+ _context.next = 11;
204
209
  break;
205
210
 
206
- case 7:
207
- _context.prev = 7;
208
- _context.t0 = _context["catch"](1);
211
+ case 8:
212
+ _context.prev = 8;
213
+ _context.t0 = _context["catch"](2);
209
214
  beforeRequestContext = false;
210
215
 
211
- case 10:
216
+ case 11:
212
217
  if (!(beforeRequestContext === false)) {
213
- _context.next = 13;
218
+ _context.next = 14;
214
219
  break;
215
220
  }
216
221
 
217
222
  reject(false);
218
223
  return _context.abrupt("return");
219
224
 
220
- case 13:
225
+ case 14:
221
226
  requestContext = Object.assign({
222
- fields: (_innerFormRef$current = innerFormRef.current) === null || _innerFormRef$current === void 0 ? void 0 : _innerFormRef$current.values
227
+ fields: fields
223
228
  }, _typeof(beforeRequestContext) === 'object' ? beforeRequestContext : {});
224
229
  resolve(requestContext);
225
230
 
226
- case 15:
231
+ case 16:
227
232
  case "end":
228
233
  return _context.stop();
229
234
  }
230
235
  }
231
- }, _callee, null, [[1, 7]]);
236
+ }, _callee, null, [[2, 8]]);
232
237
  }))).catch(function () {
233
238
  resolve(false);
234
239
  });
@@ -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' | 'onOk' | 'onCancel' | 'onError'> {
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>;
@@ -1,4 +1,4 @@
1
- var _excluded = ["trigger", "url", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError"],
1
+ var _excluded = ["trigger", "url", "customRequest", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError", "onOk", "onCancel"],
2
2
  _excluded2 = ["title", "content", "component", "schema", "onFinish", "dialogType", "dialogQuickShowType", "messageType", "popType", "beforeRequest", "onTrigger", "link", "beforeContent", "afterContent", "message", "footerDescription", "footerAlign", "className"];
3
3
 
4
4
  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,7 +27,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
27
27
 
28
28
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
29
29
 
30
- import React, { useState, useEffect, useRef } from 'react';
30
+ import React, { useState, useEffect, useMemo, useRef } from 'react';
31
31
  import classnames from 'classnames';
32
32
  import { useHistory } from 'react-router-dom';
33
33
  import { Dialog, Drawer } from '@alicloudfe/components';
@@ -51,7 +51,9 @@ var FooterForm = function FooterForm(props) {
51
51
  var schema = props.schema,
52
52
  context = props.context,
53
53
  formRef = props.formRef;
54
- var form = createForm();
54
+ var form = useMemo(function () {
55
+ return createForm();
56
+ }, []);
55
57
  useEffect(function () {
56
58
  formRef.current = form;
57
59
  }, []);
@@ -84,6 +86,7 @@ export function useDialogAction(action, actionContext, hasForm) {
84
86
 
85
87
  var trigger = action.trigger,
86
88
  url = action.url,
89
+ customRequest = action.customRequest,
87
90
  method = action.method,
88
91
  params = action.params,
89
92
  data = action.data,
@@ -94,6 +97,8 @@ export function useDialogAction(action, actionContext, hasForm) {
94
97
  formatResult = action.formatResult,
95
98
  onSuccess = action.onSuccess,
96
99
  onError = action.onError,
100
+ propsOnOk = action.onOk,
101
+ propsOnCancel = action.onCancel,
97
102
  others = _objectWithoutProperties(action, _excluded);
98
103
 
99
104
  var _getTargetValue = getTargetValue(others, context),
@@ -174,33 +179,34 @@ export function useDialogAction(action, actionContext, hasForm) {
174
179
 
175
180
  case 6:
176
181
  onFinish && onFinish();
182
+ propsOnOk && propsOnOk(context);
177
183
  resolve(true);
178
- _context.next = 18;
184
+ _context.next = 19;
179
185
  break;
180
186
 
181
- case 10:
182
- _context.prev = 10;
187
+ case 11:
188
+ _context.prev = 11;
183
189
  _context.t0 = _context["catch"](2);
184
190
  setLoading(false); // 如果 beforeRequest 中返回了 false 并且不是 dialog-form,则直接关闭弹窗
185
191
 
186
192
  if (!(beforeRequest && !hasForm)) {
187
- _context.next = 16;
193
+ _context.next = 17;
188
194
  break;
189
195
  }
190
196
 
191
197
  resolve(true);
192
198
  return _context.abrupt("return");
193
199
 
194
- case 16:
200
+ case 17:
195
201
  resolve(false);
196
202
  return _context.abrupt("return");
197
203
 
198
- case 18:
204
+ case 19:
199
205
  case "end":
200
206
  return _context.stop();
201
207
  }
202
208
  }
203
- }, _callee, null, [[2, 10]]);
209
+ }, _callee, null, [[2, 11]]);
204
210
  }));
205
211
 
206
212
  return function (_x) {
@@ -223,7 +229,9 @@ export function useDialogAction(action, actionContext, hasForm) {
223
229
  });
224
230
  var dialogContent = Component ? /*#__PURE__*/React.createElement(Component, _objectSpread({}, addContext(componentProps, dialogContext))) : addContextForReactNode(content, dialogContext);
225
231
 
226
- var quickShowProps = _objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, "".concat(isPop ? 'onConfirm' : 'onOk'), onOk), _defineProperty(_objectSpread2, "title", addContextForReactNode(title, dialogContext)), _defineProperty(_objectSpread2, "content", /*#__PURE__*/React.createElement(React.Fragment, null, beforeContent && /*#__PURE__*/React.createElement("div", {
232
+ var quickShowProps = _objectSpread(_objectSpread((_objectSpread2 = {}, _defineProperty(_objectSpread2, "".concat(isPop ? 'onConfirm' : 'onOk'), onOk), _defineProperty(_objectSpread2, "onCancel", function onCancel() {
233
+ propsOnCancel && propsOnCancel(context);
234
+ }), _defineProperty(_objectSpread2, "title", addContextForReactNode(title, dialogContext)), _defineProperty(_objectSpread2, "content", /*#__PURE__*/React.createElement(React.Fragment, null, beforeContent && /*#__PURE__*/React.createElement("div", {
227
235
  className: "teamix-pro-dialog-before-content"
228
236
  }, addContextForReactNode(beforeContent, dialogContext)), message && /*#__PURE__*/React.createElement("div", {
229
237
  className: "teamix-pro-dialog-message"
@@ -106,7 +106,6 @@ var mapDateFormat = function mapDateFormat(props, field) {
106
106
  _ref2 = _slicedToArray(_ref, 1),
107
107
  component = _ref2[0];
108
108
 
109
- console.log(component);
110
109
  return {};
111
110
  };
112
111
 
@@ -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,
@@ -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 () {
@@ -150,7 +150,7 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
150
150
  });
151
151
  });
152
152
  }
153
- }, [onChange]);
153
+ }, [onChange, form]);
154
154
  useEffect(function () {
155
155
  // 配置国际化
156
156
  setValidateLanguage(getLanguage() || 'zh-cn');
@@ -169,7 +169,8 @@ var ProForm = /*#__PURE__*/memo(function (_ref) {
169
169
  });
170
170
  ProForm.defaultProps = {
171
171
  colon: false,
172
- labelAlign: 'left',
173
- validateFirst: true
172
+ validateFirst: true,
173
+ breakpoints: true,
174
+ labelAlign: 'left'
174
175
  };
175
176
  export default ProForm;
@@ -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.7";
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
@@ -1,3 +1,5 @@
1
+ var _window;
2
+
1
3
  import ProAction from './actions';
2
4
  import ProCard from './card';
3
5
  import ProField from './field';
@@ -17,7 +19,10 @@ import * as templates from './templates';
17
19
  import TeamixIcon from '@teamix/icon';
18
20
  import './global.scss'; // 设置图标源
19
21
 
20
- TeamixIcon.setConfig(utils.getTeamixIconConfig());
22
+ if (!((_window = window) === null || _window === void 0 ? void 0 : _window.TEAMIXPRO_WITHOUT_ICON)) {
23
+ TeamixIcon.setConfig(utils.getTeamixIconConfig());
24
+ }
25
+
21
26
  export * from './actions';
22
27
  export * from './card';
23
28
  export * from './field';
@@ -31,6 +36,6 @@ export * from './table';
31
36
  export * from './sidebar';
32
37
  export * from './utils';
33
38
  export * from './timeline';
34
- var version = '1.4.7';
39
+ var version = '1.4.10';
35
40
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
36
41
  ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, TeamixIcon, hooks, nocode, templates, utils };
@@ -17,6 +17,10 @@ $prefix: 'teamix-pro-page-header';
17
17
 
18
18
  &.with-description {
19
19
  margin-bottom: 0;
20
+ .#{$prefix}-right {
21
+ align-self: flex-start;
22
+ margin-top: 2px;
23
+ }
20
24
  }
21
25
  }
22
26
 
@@ -172,7 +172,7 @@ var Filter = function Filter(props) {
172
172
  btn: true
173
173
  }),
174
174
  onClick: function onClick() {
175
- var _actionRef$current2, _actionRef$current2$f, _actionRef$current$ge6, _actionRef$current3, _actionRef$current3$g, _actionRef$current3$g2, _actionRef$current4, _actionRef$current4$s;
175
+ 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;
176
176
 
177
177
  (_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
178
178
 
@@ -193,24 +193,18 @@ var Filter = function Filter(props) {
193
193
  rules: selected,
194
194
  params: param
195
195
  })));
196
+ var targetPageKey = 'currentPage';
197
+ var pageInfo = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.pageInfo;
196
198
 
197
- if (selected.length > 0) {
198
- var _actionRef$current5, _actionRef$current6, _actionRef$current6$r, _actionRef$current7, _actionRef$current7$r, _actionRef$current8, _actionRef$current8$c;
199
+ if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
200
+ targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
201
+ } // 发送请求
199
202
 
200
- var targetPageKey = 'currentPage';
201
- var pageInfo = (_actionRef$current5 = actionRef.current) === null || _actionRef$current5 === void 0 ? void 0 : _actionRef$current5.pageInfo;
202
203
 
203
- if (pageInfo && (pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey)) {
204
- targetPageKey = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.targetPageKey;
205
- } // 发送请求
206
-
207
-
208
- (_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));
209
- (_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); // 清空表格选择
210
-
211
- (_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);
212
- }
204
+ (_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));
205
+ (_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); // 清空表格选择
213
206
 
207
+ (_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);
214
208
  setVisible(false);
215
209
  }
216
210
  }, getMessage('ok')), /*#__PURE__*/React.createElement(Button, {
@@ -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$ge;
89
+ var _actionRef$current, _actionRef$current$re;
90
90
 
91
- if ((_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$ge = _actionRef$current.getState) === null || _actionRef$current$ge === void 0 ? void 0 : _actionRef$current$ge.call(_actionRef$current).fullScreenState) {
92
- var _actionRef$current2, _actionRef$current2$r;
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$current3, _actionRef$current3$g;
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
- (_actionRef$current4 = actionRef.current) === null || _actionRef$current4 === void 0 ? void 0 : (_actionRef$current4$r = _actionRef$current4.resetTableMaxBodyHeight) === null || _actionRef$current4$r === void 0 ? void 0 : _actionRef$current4$r.call(_actionRef$current4);
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
- return /*#__PURE__*/React.createElement("div", {
178
- className: cls()
179
- }, renderLayout());
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);