@teamix/pro 1.2.23 → 1.2.28

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.
Files changed (133) hide show
  1. package/dist/212.js +129 -129
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +18109 -15665
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/dist/pro.min.js.LICENSE.txt +2 -0
  7. package/es/actions/dialog.js +4 -3
  8. package/es/actions/index.d.ts +12 -9
  9. package/es/actions/index.js +56 -15
  10. package/es/actions/index.scss +12 -1
  11. package/es/form/Filter/AdvancedFilter.js +1 -1
  12. package/es/form/Filter/Layout.d.ts +5 -0
  13. package/es/form/Filter/Layout.js +82 -0
  14. package/es/form/Filter/SimpleFilter.js +30 -6
  15. package/es/form/Filter/index2.d.ts +2 -1
  16. package/es/form/Filter/index2.js +97 -116
  17. package/es/form/Filter/index2.scss +16 -45
  18. package/es/form/Filter/layout.scss +36 -0
  19. package/es/form/Filter/useSpecialProps.d.ts +6 -0
  20. package/es/form/Filter/useSpecialProps.js +37 -0
  21. package/es/form/ProForm/customComponent.d.ts +3 -0
  22. package/es/form/ProForm/customComponent.js +20 -0
  23. package/es/form/ProForm/index.scss +5 -6
  24. package/es/form/ProForm/useFormDisplayValues.js +14 -24
  25. package/es/form/SchemaForm/adapterType.js +1 -0
  26. package/es/form/SchemaForm/index.js +8 -6
  27. package/es/form/SchemaForm/initializeDataSource.d.ts +1 -1
  28. package/es/form/SchemaForm/initializeDataSource.js +2 -2
  29. package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
  30. package/es/form/SchemaForm/initializeRequest.js +2 -2
  31. package/es/form/SchemaForm/initializeRules.d.ts +1 -1
  32. package/es/form/SchemaForm/initializeRules.js +3 -3
  33. package/es/form/fieldTypeMap.js +2 -1
  34. package/es/form/index.d.ts +4 -2
  35. package/es/form/index.js +4 -2
  36. package/es/form/typing.d.ts +25 -1
  37. package/es/form/utils.d.ts +2 -2
  38. package/es/form/utils.js +2 -2
  39. package/es/index.d.ts +5 -2
  40. package/es/index.js +6 -3
  41. package/es/info/index.scss +1 -1
  42. package/es/nocode/pages/renderer.js +1 -1
  43. package/es/step/ProStepItem/components/HozStepItem/index.d.ts +5 -0
  44. package/es/step/ProStepItem/components/HozStepItem/index.js +235 -0
  45. package/es/step/ProStepItem/components/HozStepItem/index.scss +279 -0
  46. package/es/step/ProStepItem/components/VerStepItem/index.d.ts +5 -0
  47. package/es/step/ProStepItem/components/VerStepItem/index.js +295 -0
  48. package/es/step/ProStepItem/components/VerStepItem/index.scss +287 -0
  49. package/es/step/ProStepItem/index.d.ts +4 -0
  50. package/es/step/ProStepItem/index.js +57 -0
  51. package/es/step/index.d.ts +9 -0
  52. package/es/step/index.js +101 -0
  53. package/es/step/typing.d.ts +96 -0
  54. package/es/step/typing.js +1 -0
  55. package/es/table/components/Filter/index.js +2 -17
  56. package/es/table/components/Layout/index.js +63 -167
  57. package/es/table/components/Layout/index.scss +4 -3
  58. package/es/table/components/Pagination/index.js +2 -2
  59. package/es/table/components/Pagination/index.scss +5 -0
  60. package/es/table/components/ToolBar/FullScreenIcon.js +4 -9
  61. package/es/table/components/ToolBar/Fullscreen.js +21 -11
  62. package/es/table/index.js +82 -104
  63. package/es/table/index.scss +5 -5
  64. package/es/table/typing.d.ts +16 -10
  65. package/es/table/utils/columnRender.js +21 -3
  66. package/es/table/utils/index.d.ts +7 -0
  67. package/es/table/utils/index.js +36 -0
  68. package/es/utils/index.d.ts +1 -0
  69. package/es/utils/index.js +1 -0
  70. package/lib/actions/dialog.js +4 -3
  71. package/lib/actions/index.d.ts +12 -9
  72. package/lib/actions/index.js +56 -15
  73. package/lib/actions/index.scss +12 -1
  74. package/lib/form/Filter/AdvancedFilter.js +1 -1
  75. package/lib/form/Filter/Layout.d.ts +5 -0
  76. package/lib/form/Filter/Layout.js +102 -0
  77. package/lib/form/Filter/SimpleFilter.js +29 -4
  78. package/lib/form/Filter/index2.d.ts +2 -1
  79. package/lib/form/Filter/index2.js +101 -114
  80. package/lib/form/Filter/index2.scss +16 -45
  81. package/lib/form/Filter/layout.scss +36 -0
  82. package/lib/form/Filter/useSpecialProps.d.ts +6 -0
  83. package/lib/form/Filter/useSpecialProps.js +46 -0
  84. package/lib/form/ProForm/customComponent.d.ts +3 -0
  85. package/lib/form/ProForm/customComponent.js +28 -0
  86. package/lib/form/ProForm/index.scss +5 -6
  87. package/lib/form/ProForm/useFormDisplayValues.js +17 -24
  88. package/lib/form/SchemaForm/adapterType.js +1 -0
  89. package/lib/form/SchemaForm/index.js +8 -6
  90. package/lib/form/SchemaForm/initializeDataSource.d.ts +1 -1
  91. package/lib/form/SchemaForm/initializeDataSource.js +2 -2
  92. package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
  93. package/lib/form/SchemaForm/initializeRequest.js +2 -2
  94. package/lib/form/SchemaForm/initializeRules.d.ts +1 -1
  95. package/lib/form/SchemaForm/initializeRules.js +3 -3
  96. package/lib/form/fieldTypeMap.js +2 -1
  97. package/lib/form/index.d.ts +4 -2
  98. package/lib/form/index.js +19 -1
  99. package/lib/form/typing.d.ts +25 -1
  100. package/lib/form/utils.d.ts +2 -2
  101. package/lib/form/utils.js +2 -2
  102. package/lib/index.d.ts +5 -2
  103. package/lib/index.js +35 -3
  104. package/lib/info/index.scss +1 -1
  105. package/lib/nocode/pages/renderer.js +1 -1
  106. package/lib/step/ProStepItem/components/HozStepItem/index.d.ts +5 -0
  107. package/lib/step/ProStepItem/components/HozStepItem/index.js +258 -0
  108. package/lib/step/ProStepItem/components/HozStepItem/index.scss +279 -0
  109. package/lib/step/ProStepItem/components/VerStepItem/index.d.ts +5 -0
  110. package/lib/step/ProStepItem/components/VerStepItem/index.js +315 -0
  111. package/lib/step/ProStepItem/components/VerStepItem/index.scss +287 -0
  112. package/lib/step/ProStepItem/index.d.ts +4 -0
  113. package/lib/step/ProStepItem/index.js +69 -0
  114. package/lib/step/index.d.ts +9 -0
  115. package/lib/step/index.js +124 -0
  116. package/lib/step/typing.d.ts +96 -0
  117. package/lib/step/typing.js +5 -0
  118. package/lib/table/components/Filter/index.js +2 -17
  119. package/lib/table/components/Layout/index.js +61 -167
  120. package/lib/table/components/Layout/index.scss +4 -3
  121. package/lib/table/components/Pagination/index.js +2 -2
  122. package/lib/table/components/Pagination/index.scss +5 -0
  123. package/lib/table/components/ToolBar/FullScreenIcon.js +4 -9
  124. package/lib/table/components/ToolBar/Fullscreen.js +22 -11
  125. package/lib/table/index.js +78 -101
  126. package/lib/table/index.scss +5 -5
  127. package/lib/table/typing.d.ts +16 -10
  128. package/lib/table/utils/columnRender.js +21 -3
  129. package/lib/table/utils/index.d.ts +7 -0
  130. package/lib/table/utils/index.js +38 -0
  131. package/lib/utils/index.d.ts +1 -0
  132. package/lib/utils/index.js +13 -0
  133. package/package.json +4 -4
@@ -24,6 +24,8 @@ object-assign
24
24
  * (c) Sindre Sorhus; MIT License
25
25
  */
26
26
 
27
+ /*! js-cookie v3.0.1 | MIT */
28
+
27
29
  /** @license React v16.13.1
28
30
  * react-is.production.min.js
29
31
  *
@@ -1,4 +1,4 @@
1
- var _excluded = ["url", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError"],
1
+ var _excluded = ["trigger", "url", "method", "params", "data", "extendParams", "successMsg", "errorMsg", "formatParams", "formatResult", "onSuccess", "onError"],
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; }
@@ -81,7 +81,8 @@ export function useDialogAction(action, actionContext) {
81
81
  var onActionStart = function onActionStart(context, e) {
82
82
  var _objectSpread2;
83
83
 
84
- var url = action.url,
84
+ var trigger = action.trigger,
85
+ url = action.url,
85
86
  method = action.method,
86
87
  params = action.params,
87
88
  data = action.data,
@@ -228,7 +229,7 @@ export function useDialogAction(action, actionContext) {
228
229
  })), _objectSpread2), containerProps), containerOtherProps);
229
230
 
230
231
  var ret = container.show(quickShowProps);
231
- store.hide = ret.hide;
232
+ store.hide = ret ? ret.hide || ret.close : function () {};
232
233
  };
233
234
 
234
235
  return _objectSpread({}, eventHandler(action, actionContext, onActionStart));
@@ -26,25 +26,28 @@ export declare type ProActionConfig = ({
26
26
  } & LinkAction);
27
27
  export declare function registerActionHandler(id: string, extendActionId: string, defaultConfig: any): void;
28
28
  export declare function useAction(config?: ProActionConfig, context?: any): any;
29
- export interface ProActionButtonProps extends ButtonProps {
30
- key?: string | number;
29
+ export interface ProActionButtonProps extends ProActionCommonProps, ButtonProps {
31
30
  config?: ProActionConfig;
32
- visible?: any;
33
31
  disabled?: any;
34
32
  icon?: string;
35
- context?: any;
36
33
  onClick?: (event: React.MouseEvent<Element, MouseEvent>, context?: any) => void;
37
34
  }
38
35
  export declare const ProActionButton: (props: ProActionButtonProps) => JSX.Element;
39
- export interface ProActionMenuButtonProps extends MenuButtonProps {
36
+ export interface ProActionCommonProps {
40
37
  key?: string | number;
41
- actions: ProActionProps[];
42
38
  visible?: any;
43
- icon?: string;
44
39
  context?: any;
45
40
  }
41
+ export interface ProActionMenuButtonProps extends ProActionCommonProps, Omit<MenuButtonProps, 'visible'> {
42
+ actions: ProActionProps[];
43
+ icon?: string;
44
+ noArrow?: boolean;
45
+ }
46
46
  export declare const ProActionMenuButton: (props: ProActionMenuButtonProps) => JSX.Element;
47
- export declare type ProActionProps = ProActionButtonProps | ProActionMenuButtonProps;
47
+ export interface ProActionDividerProps extends ProActionCommonProps {
48
+ type: 'divider';
49
+ }
50
+ export declare type ProActionProps = ProActionButtonProps | ProActionMenuButtonProps | ProActionDividerProps;
48
51
  export declare type ProActionGroupProps = {
49
52
  /** 操作组类型:按钮、文字按钮 */
50
53
  type?: 'button' | 'text';
@@ -59,7 +62,7 @@ export declare type ProActionGroupProps = {
59
62
  */
60
63
  moreText?: string;
61
64
  /** 更多按钮的配置,只有在actions数量超过max时才有效 */
62
- more?: string | ProActionButtonProps;
65
+ more?: string | Omit<ProActionMenuButtonProps, 'actions'>;
63
66
  /** 是否有分割线,只有type="text"时生效,默认有分割线 */
64
67
  divider?: boolean;
65
68
  } & React.HTMLAttributes<HTMLElement>;
@@ -1,7 +1,7 @@
1
1
  var _excluded = ["type"],
2
2
  _excluded2 = ["config", "icon", "iconSize", "type", "context", "children", "visible", "onClick"],
3
3
  _excluded3 = ["loading"],
4
- _excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type"],
4
+ _excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type", "className", "noArrow"],
5
5
  _excluded5 = ["context", "text"],
6
6
  _excluded6 = ["key", "actions"],
7
7
  _excluded7 = ["key", "config"],
@@ -209,6 +209,12 @@ var ProActionMenuButtonItem = function ProActionMenuButtonItem(props) {
209
209
  };
210
210
 
211
211
  function renderCommonActionButtonMenuItem(action, key, context) {
212
+ if (action.type === 'divider') {
213
+ return /*#__PURE__*/React.createElement(Menu.Divider, {
214
+ key: key
215
+ });
216
+ }
217
+
212
218
  var menuBtn = action;
213
219
 
214
220
  if (menuBtn.actions && menuBtn.actions.length && menuBtn.disabled !== true) {
@@ -236,6 +242,8 @@ export var ProActionMenuButton = function ProActionMenuButton(props) {
236
242
  context = props.context,
237
243
  _props$type2 = props.type,
238
244
  type = _props$type2 === void 0 ? 'primary' : _props$type2,
245
+ className = props.className,
246
+ noArrow = props.noArrow,
239
247
  others = _objectWithoutProperties(props, _excluded4);
240
248
 
241
249
  return /*#__PURE__*/React.createElement(MenuButton, _objectSpread({
@@ -249,28 +257,52 @@ export var ProActionMenuButton = function ProActionMenuButton(props) {
249
257
  v2: true
250
258
  },
251
259
  type: type,
252
- label: buttonContent(label || children, icon, iconSize, context)
260
+ label: buttonContent(label || children, icon, iconSize, context),
261
+ className: cls(className, {
262
+ 'teamix-pro-actions-text-menu-btn-no-arrow': noArrow
263
+ })
253
264
  }, others), actions.map(function (action, i) {
254
265
  return renderCommonActionButtonMenuItem(action, action.key || i, context);
255
266
  }));
256
- }; // 如果 actions 数量超过了 max,则把第 max 个和剩余超出部分折叠起来成为一个 menu
267
+ }; // 超出 max,则折叠起来
257
268
 
258
- function formatGroupActions(actions, max, moreConfig) {
259
- var MAX = max < 1 ? MAX_ACTTIONS : max;
260
-
261
- if (actions.length <= MAX) {
269
+ function foldExtraActions(actions, max, moreConfig) {
270
+ if (actions.length <= max) {
262
271
  return actions;
263
272
  }
264
273
 
265
- return [].concat(_toConsumableArray(actions.slice(0, MAX - 1)), [_objectSpread(_objectSpread({
274
+ return [].concat(_toConsumableArray(actions.slice(0, max - 1)), [_objectSpread(_objectSpread({
266
275
  key: '__teamix_pro_action_group_more_btn'
267
276
  }, moreConfig), {}, {
268
- actions: actions.slice(MAX - 1)
277
+ actions: actions.slice(max - 1)
269
278
  })]);
279
+ } // 如果 actions 数量超过了 max,则把第 max 个和剩余超出部分折叠起来成为一个 menu
280
+ // divider 不计数
281
+
282
+
283
+ function formatGroupActions(actions, max, moreConfig) {
284
+ var MAX = max < 1 ? MAX_ACTTIONS : max;
285
+ var count = 0;
286
+ var index = 0;
287
+
288
+ for (; index < actions.length && count < MAX; index++) {
289
+ if (actions[index].type !== 'divider') {
290
+ count += 1;
291
+ }
292
+ }
293
+
294
+ return foldExtraActions(actions, Math.max(index, MAX), moreConfig);
270
295
  } // 渲染一个 button 或者 menu button
271
296
 
272
297
 
273
298
  function renderCommonActionButton(button, context, isTypeText) {
299
+ if (button.type === 'divider') {
300
+ return /*#__PURE__*/React.createElement(Divider, {
301
+ key: button.key,
302
+ direction: "ver"
303
+ });
304
+ }
305
+
274
306
  var buttonContext = button.context,
275
307
  text = button.text,
276
308
  others = _objectWithoutProperties(button, _excluded5);
@@ -288,18 +320,27 @@ function renderCommonActionButton(button, context, isTypeText) {
288
320
  }
289
321
 
290
322
  function getDefaultMoreButton(type, more) {
291
- var moreConfig = typeof more === 'string' ? {
292
- children: more
293
- } : more;
294
323
  var defaultConfig = type === 'button' ? {
295
324
  children: getMessage('more')
296
325
  } : {
297
326
  icon: 'more-line',
298
- // iconSize: 'small',
299
327
  autoWidth: false,
300
- className: 'teamix-pro-actions-text-menu-btn-no-arrow'
328
+ noArrow: true
301
329
  };
302
- return Object.assign(defaultConfig, moreConfig);
330
+
331
+ if (!more) {
332
+ return defaultConfig;
333
+ }
334
+
335
+ var moreConfig = typeof more === 'string' ? {
336
+ children: more
337
+ } : more;
338
+
339
+ if (type === 'button') {
340
+ return Object.assign(defaultConfig, moreConfig);
341
+ }
342
+
343
+ return moreConfig;
303
344
  }
304
345
 
305
346
  var MAX_ACTTIONS = 4;
@@ -2,12 +2,23 @@
2
2
  display: flex;
3
3
  align-items: center;
4
4
  flex-wrap: wrap;
5
+
6
+ & > .next-divider {
7
+ & + .next-divider {
8
+ display: none;
9
+ }
10
+ }
11
+
5
12
  &.teamix-pro-actions-type-button {
6
13
  & > button {
7
14
  &:not(:last-child) {
8
15
  margin-right: var(--s-2);
9
16
  }
10
17
  }
18
+ & > .next-divider {
19
+ margin-left: 0;
20
+ margin-right: var(--s-2);
21
+ }
11
22
  }
12
23
 
13
24
  &.teamix-pro-actions-type-text:not(.teamix-pro-actions-divider) {
@@ -109,4 +120,4 @@
109
120
  }
110
121
  }
111
122
  }
112
- }
123
+ }
@@ -53,7 +53,7 @@ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
53
53
  props: {
54
54
  breakpoints: [480, 720, 990, 1200, Infinity],
55
55
  maxColumns: [1, 2, 3, 3, 4],
56
- maxWidth: [480, 360, 330, 330, 300],
56
+ maxWidth: [480, 360, 330, 400],
57
57
  columnGap: 16,
58
58
  rowGap: 12
59
59
  },
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { QueryFilterLayoutProps } from '../typing';
3
+ import './layout.scss';
4
+ declare const QueryFilterLayout: React.FC<QueryFilterLayoutProps>;
5
+ export { QueryFilterLayout };
@@ -0,0 +1,82 @@
1
+ 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; }
2
+
3
+ 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; }
4
+
5
+ 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; }
6
+
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+
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; }
14
+
15
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
16
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
19
+ import React, { useCallback, useState } from 'react';
20
+ import cls from 'classnames';
21
+ import { Button, Badge } from '@alicloudfe/components';
22
+ import TeamixIcon from '@teamix/icon';
23
+ import { usePrefixCls, getMessage, isValid } from '@teamix/utils';
24
+ import './layout.scss';
25
+
26
+ var QueryFilterLayout = function QueryFilterLayout(_ref) {
27
+ var className = _ref.className,
28
+ addonBefore = _ref.addonBefore,
29
+ addonAfter = _ref.addonAfter,
30
+ inlineContent = _ref.inlineContent,
31
+ panelContent = _ref.panelContent,
32
+ count = _ref.count,
33
+ expand = _ref.expand,
34
+ onExpand = _ref.onExpand,
35
+ children = _ref.children;
36
+ var prefixCls = usePrefixCls('', {
37
+ prefix: 'teamix-pro-form-query-filter-layout'
38
+ });
39
+
40
+ var _useState = useState(!!expand),
41
+ _useState2 = _slicedToArray(_useState, 2),
42
+ visible = _useState2[0],
43
+ setVisible = _useState2[1];
44
+
45
+ var onClick = useCallback(function () {
46
+ setVisible(!visible);
47
+ onExpand === null || onExpand === void 0 ? void 0 : onExpand(!visible);
48
+ }, [visible]);
49
+ return /*#__PURE__*/React.createElement("div", {
50
+ className: cls(prefixCls, className)
51
+ }, /*#__PURE__*/React.createElement("div", {
52
+ className: "".concat(prefixCls, "-inline")
53
+ }, /*#__PURE__*/React.createElement("div", {
54
+ className: "".concat(prefixCls, "-left")
55
+ }, addonBefore ? /*#__PURE__*/React.createElement("div", {
56
+ className: "".concat(prefixCls, "-addonBefore")
57
+ }, addonBefore) : null, inlineContent, isValid(panelContent) ? /*#__PURE__*/React.createElement("div", {
58
+ className: "".concat(prefixCls, "-toggle")
59
+ }, /*#__PURE__*/React.createElement(Badge, {
60
+ count: count,
61
+ style: _objectSpread({
62
+ backgroundColor: 'var(--color-brand1-6, #0064c8)',
63
+ color: 'var(--color-white, #fff)'
64
+ }, visible ? {
65
+ display: 'none'
66
+ } : {})
67
+ }, /*#__PURE__*/React.createElement(Button, {
68
+ onClick: onClick
69
+ }, visible ? /*#__PURE__*/React.createElement(TeamixIcon, {
70
+ type: "up-line"
71
+ }) : /*#__PURE__*/React.createElement(TeamixIcon, {
72
+ type: "filter-line"
73
+ }), getMessage('advancedFilter')))) : null), addonAfter ? /*#__PURE__*/React.createElement("div", {
74
+ className: "".concat(prefixCls, "-addonAfter")
75
+ }, addonAfter) : null), /*#__PURE__*/React.createElement("div", {
76
+ className: cls("".concat(prefixCls, "-panel"), visible && isValid(panelContent) ? '' : "".concat(prefixCls, "-panel-hidden"))
77
+ }, panelContent), /*#__PURE__*/React.createElement("div", {
78
+ className: "".concat(prefixCls, "-children")
79
+ }, children));
80
+ };
81
+
82
+ export { QueryFilterLayout };
@@ -10,14 +10,16 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
10
10
 
11
11
  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; }
12
12
 
13
- import React, { memo, useMemo } from 'react';
13
+ import React, { memo, useCallback, useMemo, useRef } from 'react';
14
14
  import cls from 'classnames';
15
15
  import { usePrefixCls } from '@teamix/utils';
16
- import ProForm from '../ProForm';
16
+ import ProForm from '../ProForm'; // 初始化Search组件,内置部分属性
17
17
 
18
18
  var initializeSearch = function initializeSearch(schema) {
19
- return schema.map(function (item) {
19
+ var searchName;
20
+ var initializedSchema = schema.map(function (item) {
20
21
  if (item.component === 'Search') {
22
+ searchName = item.name;
21
23
  return _objectSpread(_objectSpread({}, item), {}, {
22
24
  decoratorProps: _objectSpread(_objectSpread({}, item.decoratorProps), {}, {
23
25
  inset: false
@@ -30,6 +32,10 @@ var initializeSearch = function initializeSearch(schema) {
30
32
 
31
33
  return item;
32
34
  });
35
+ return {
36
+ searchName: searchName,
37
+ initializedSchema: initializedSchema
38
+ };
33
39
  };
34
40
  /**
35
41
  * 简单筛选
@@ -37,6 +43,8 @@ var initializeSearch = function initializeSearch(schema) {
37
43
 
38
44
 
39
45
  var SimpleFilter = /*#__PURE__*/memo(function (props) {
46
+ var searchValue = useRef(undefined);
47
+
40
48
  var schema = props.schema,
41
49
  onChange = props.onChange,
42
50
  onSubmit = props.onSubmit,
@@ -45,13 +53,18 @@ var SimpleFilter = /*#__PURE__*/memo(function (props) {
45
53
  var prefixCls = usePrefixCls('', {
46
54
  prefix: 'teamix-pro-form-query-filter-simple'
47
55
  });
56
+
57
+ var _initializeSearch = initializeSearch(schema),
58
+ searchName = _initializeSearch.searchName,
59
+ initializedSchema = _initializeSearch.initializedSchema;
60
+
48
61
  var simpleSchema = useMemo(function () {
49
62
  return [{
50
63
  component: 'FormFlex',
51
64
  props: {
52
65
  size: 8
53
66
  },
54
- children: initializeSearch(schema)
67
+ children: initializedSchema
55
68
  }, {
56
69
  component: 'Submit',
57
70
  props: {
@@ -60,7 +73,18 @@ var SimpleFilter = /*#__PURE__*/memo(function (props) {
60
73
  }
61
74
  }
62
75
  }];
63
- }, [schema]);
76
+ }, [initializedSchema]);
77
+ var onInnerChange = useCallback(function (values, value, name) {
78
+ // 处理Search组件,Select切换时不触发onChange
79
+ if (searchName === name) {
80
+ if (searchValue.current !== value[1]) {
81
+ onChange === null || onChange === void 0 ? void 0 : onChange(values, name, value);
82
+ searchValue.current = value[1];
83
+ }
84
+ } else {
85
+ onChange === null || onChange === void 0 ? void 0 : onChange(values, name, value);
86
+ }
87
+ }, [searchName, searchValue.current]);
64
88
  return /*#__PURE__*/React.createElement(ProForm, _objectSpread(_objectSpread({}, otherProps), {}, {
65
89
  className: cls(prefixCls, props.className),
66
90
  schema: simpleSchema,
@@ -68,7 +92,7 @@ var SimpleFilter = /*#__PURE__*/memo(function (props) {
68
92
  breakpoints: [],
69
93
  inset: true,
70
94
  onSubmit: onSubmit,
71
- onChange: onChange
95
+ onChange: onInnerChange
72
96
  }));
73
97
  });
74
98
  export default SimpleFilter;
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
+ import { QueryFilterLayout } from './Layout';
2
3
  import type { QueryFilterProps } from '../typing';
3
4
  import './index2.scss';
4
5
  /**
5
6
  * 查询筛选
6
7
  */
7
8
  declare const QueryFilter: React.FC<QueryFilterProps>;
8
- export { QueryFilter };
9
+ export { QueryFilter, QueryFilterLayout };