@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.
- package/dist/212.js +129 -129
- package/dist/pro.css +1 -1
- package/dist/pro.js +18109 -15665
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +2 -0
- package/es/actions/dialog.js +4 -3
- package/es/actions/index.d.ts +12 -9
- package/es/actions/index.js +56 -15
- package/es/actions/index.scss +12 -1
- package/es/form/Filter/AdvancedFilter.js +1 -1
- package/es/form/Filter/Layout.d.ts +5 -0
- package/es/form/Filter/Layout.js +82 -0
- package/es/form/Filter/SimpleFilter.js +30 -6
- package/es/form/Filter/index2.d.ts +2 -1
- package/es/form/Filter/index2.js +97 -116
- package/es/form/Filter/index2.scss +16 -45
- package/es/form/Filter/layout.scss +36 -0
- package/es/form/Filter/useSpecialProps.d.ts +6 -0
- package/es/form/Filter/useSpecialProps.js +37 -0
- package/es/form/ProForm/customComponent.d.ts +3 -0
- package/es/form/ProForm/customComponent.js +20 -0
- package/es/form/ProForm/index.scss +5 -6
- package/es/form/ProForm/useFormDisplayValues.js +14 -24
- package/es/form/SchemaForm/adapterType.js +1 -0
- package/es/form/SchemaForm/index.js +8 -6
- package/es/form/SchemaForm/initializeDataSource.d.ts +1 -1
- package/es/form/SchemaForm/initializeDataSource.js +2 -2
- package/es/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/es/form/SchemaForm/initializeRequest.js +2 -2
- package/es/form/SchemaForm/initializeRules.d.ts +1 -1
- package/es/form/SchemaForm/initializeRules.js +3 -3
- package/es/form/fieldTypeMap.js +2 -1
- package/es/form/index.d.ts +4 -2
- package/es/form/index.js +4 -2
- package/es/form/typing.d.ts +25 -1
- package/es/form/utils.d.ts +2 -2
- package/es/form/utils.js +2 -2
- package/es/index.d.ts +5 -2
- package/es/index.js +6 -3
- package/es/info/index.scss +1 -1
- package/es/nocode/pages/renderer.js +1 -1
- package/es/step/ProStepItem/components/HozStepItem/index.d.ts +5 -0
- package/es/step/ProStepItem/components/HozStepItem/index.js +235 -0
- package/es/step/ProStepItem/components/HozStepItem/index.scss +279 -0
- package/es/step/ProStepItem/components/VerStepItem/index.d.ts +5 -0
- package/es/step/ProStepItem/components/VerStepItem/index.js +295 -0
- package/es/step/ProStepItem/components/VerStepItem/index.scss +287 -0
- package/es/step/ProStepItem/index.d.ts +4 -0
- package/es/step/ProStepItem/index.js +57 -0
- package/es/step/index.d.ts +9 -0
- package/es/step/index.js +101 -0
- package/es/step/typing.d.ts +96 -0
- package/es/step/typing.js +1 -0
- package/es/table/components/Filter/index.js +2 -17
- package/es/table/components/Layout/index.js +63 -167
- package/es/table/components/Layout/index.scss +4 -3
- package/es/table/components/Pagination/index.js +2 -2
- package/es/table/components/Pagination/index.scss +5 -0
- package/es/table/components/ToolBar/FullScreenIcon.js +4 -9
- package/es/table/components/ToolBar/Fullscreen.js +21 -11
- package/es/table/index.js +82 -104
- package/es/table/index.scss +5 -5
- package/es/table/typing.d.ts +16 -10
- package/es/table/utils/columnRender.js +21 -3
- package/es/table/utils/index.d.ts +7 -0
- package/es/table/utils/index.js +36 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +1 -0
- package/lib/actions/dialog.js +4 -3
- package/lib/actions/index.d.ts +12 -9
- package/lib/actions/index.js +56 -15
- package/lib/actions/index.scss +12 -1
- package/lib/form/Filter/AdvancedFilter.js +1 -1
- package/lib/form/Filter/Layout.d.ts +5 -0
- package/lib/form/Filter/Layout.js +102 -0
- package/lib/form/Filter/SimpleFilter.js +29 -4
- package/lib/form/Filter/index2.d.ts +2 -1
- package/lib/form/Filter/index2.js +101 -114
- package/lib/form/Filter/index2.scss +16 -45
- package/lib/form/Filter/layout.scss +36 -0
- package/lib/form/Filter/useSpecialProps.d.ts +6 -0
- package/lib/form/Filter/useSpecialProps.js +46 -0
- package/lib/form/ProForm/customComponent.d.ts +3 -0
- package/lib/form/ProForm/customComponent.js +28 -0
- package/lib/form/ProForm/index.scss +5 -6
- package/lib/form/ProForm/useFormDisplayValues.js +17 -24
- package/lib/form/SchemaForm/adapterType.js +1 -0
- package/lib/form/SchemaForm/index.js +8 -6
- package/lib/form/SchemaForm/initializeDataSource.d.ts +1 -1
- package/lib/form/SchemaForm/initializeDataSource.js +2 -2
- package/lib/form/SchemaForm/initializeRequest.d.ts +1 -1
- package/lib/form/SchemaForm/initializeRequest.js +2 -2
- package/lib/form/SchemaForm/initializeRules.d.ts +1 -1
- package/lib/form/SchemaForm/initializeRules.js +3 -3
- package/lib/form/fieldTypeMap.js +2 -1
- package/lib/form/index.d.ts +4 -2
- package/lib/form/index.js +19 -1
- package/lib/form/typing.d.ts +25 -1
- package/lib/form/utils.d.ts +2 -2
- package/lib/form/utils.js +2 -2
- package/lib/index.d.ts +5 -2
- package/lib/index.js +35 -3
- package/lib/info/index.scss +1 -1
- package/lib/nocode/pages/renderer.js +1 -1
- package/lib/step/ProStepItem/components/HozStepItem/index.d.ts +5 -0
- package/lib/step/ProStepItem/components/HozStepItem/index.js +258 -0
- package/lib/step/ProStepItem/components/HozStepItem/index.scss +279 -0
- package/lib/step/ProStepItem/components/VerStepItem/index.d.ts +5 -0
- package/lib/step/ProStepItem/components/VerStepItem/index.js +315 -0
- package/lib/step/ProStepItem/components/VerStepItem/index.scss +287 -0
- package/lib/step/ProStepItem/index.d.ts +4 -0
- package/lib/step/ProStepItem/index.js +69 -0
- package/lib/step/index.d.ts +9 -0
- package/lib/step/index.js +124 -0
- package/lib/step/typing.d.ts +96 -0
- package/lib/step/typing.js +5 -0
- package/lib/table/components/Filter/index.js +2 -17
- package/lib/table/components/Layout/index.js +61 -167
- package/lib/table/components/Layout/index.scss +4 -3
- package/lib/table/components/Pagination/index.js +2 -2
- package/lib/table/components/Pagination/index.scss +5 -0
- package/lib/table/components/ToolBar/FullScreenIcon.js +4 -9
- package/lib/table/components/ToolBar/Fullscreen.js +22 -11
- package/lib/table/index.js +78 -101
- package/lib/table/index.scss +5 -5
- package/lib/table/typing.d.ts +16 -10
- package/lib/table/utils/columnRender.js +21 -3
- package/lib/table/utils/index.d.ts +7 -0
- package/lib/table/utils/index.js +38 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +13 -0
- package/package.json +4 -4
package/lib/actions/index.js
CHANGED
@@ -56,7 +56,7 @@ require("./index.scss");
|
|
56
56
|
var _excluded = ["type"],
|
57
57
|
_excluded2 = ["config", "icon", "iconSize", "type", "context", "children", "visible", "onClick"],
|
58
58
|
_excluded3 = ["loading"],
|
59
|
-
_excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type"],
|
59
|
+
_excluded4 = ["icon", "iconSize", "label", "actions", "children", "context", "type", "className", "noArrow"],
|
60
60
|
_excluded5 = ["context", "text"],
|
61
61
|
_excluded6 = ["key", "actions"],
|
62
62
|
_excluded7 = ["key", "config"],
|
@@ -248,6 +248,12 @@ var ProActionMenuButtonItem = function ProActionMenuButtonItem(props) {
|
|
248
248
|
};
|
249
249
|
|
250
250
|
function renderCommonActionButtonMenuItem(action, key, context) {
|
251
|
+
if (action.type === 'divider') {
|
252
|
+
return /*#__PURE__*/_react.default.createElement(_components.Menu.Divider, {
|
253
|
+
key: key
|
254
|
+
});
|
255
|
+
}
|
256
|
+
|
251
257
|
var menuBtn = action;
|
252
258
|
|
253
259
|
if (menuBtn.actions && menuBtn.actions.length && menuBtn.disabled !== true) {
|
@@ -275,6 +281,8 @@ var ProActionMenuButton = function ProActionMenuButton(props) {
|
|
275
281
|
context = props.context,
|
276
282
|
_props$type2 = props.type,
|
277
283
|
type = _props$type2 === void 0 ? 'primary' : _props$type2,
|
284
|
+
className = props.className,
|
285
|
+
noArrow = props.noArrow,
|
278
286
|
others = _objectWithoutProperties(props, _excluded4);
|
279
287
|
|
280
288
|
return /*#__PURE__*/_react.default.createElement(_components.MenuButton, _objectSpread({
|
@@ -288,31 +296,55 @@ var ProActionMenuButton = function ProActionMenuButton(props) {
|
|
288
296
|
v2: true
|
289
297
|
},
|
290
298
|
type: type,
|
291
|
-
label: buttonContent(label || children, icon, iconSize, context)
|
299
|
+
label: buttonContent(label || children, icon, iconSize, context),
|
300
|
+
className: (0, _classnames.default)(className, {
|
301
|
+
'teamix-pro-actions-text-menu-btn-no-arrow': noArrow
|
302
|
+
})
|
292
303
|
}, others), actions.map(function (action, i) {
|
293
304
|
return renderCommonActionButtonMenuItem(action, action.key || i, context);
|
294
305
|
}));
|
295
|
-
}; //
|
306
|
+
}; // 超出 max,则折叠起来
|
296
307
|
|
297
308
|
|
298
309
|
exports.ProActionMenuButton = ProActionMenuButton;
|
299
310
|
|
300
|
-
function
|
301
|
-
|
302
|
-
|
303
|
-
if (actions.length <= MAX) {
|
311
|
+
function foldExtraActions(actions, max, moreConfig) {
|
312
|
+
if (actions.length <= max) {
|
304
313
|
return actions;
|
305
314
|
}
|
306
315
|
|
307
|
-
return [].concat(_toConsumableArray(actions.slice(0,
|
316
|
+
return [].concat(_toConsumableArray(actions.slice(0, max - 1)), [_objectSpread(_objectSpread({
|
308
317
|
key: '__teamix_pro_action_group_more_btn'
|
309
318
|
}, moreConfig), {}, {
|
310
|
-
actions: actions.slice(
|
319
|
+
actions: actions.slice(max - 1)
|
311
320
|
})]);
|
321
|
+
} // 如果 actions 数量超过了 max,则把第 max 个和剩余超出部分折叠起来成为一个 menu
|
322
|
+
// divider 不计数
|
323
|
+
|
324
|
+
|
325
|
+
function formatGroupActions(actions, max, moreConfig) {
|
326
|
+
var MAX = max < 1 ? MAX_ACTTIONS : max;
|
327
|
+
var count = 0;
|
328
|
+
var index = 0;
|
329
|
+
|
330
|
+
for (; index < actions.length && count < MAX; index++) {
|
331
|
+
if (actions[index].type !== 'divider') {
|
332
|
+
count += 1;
|
333
|
+
}
|
334
|
+
}
|
335
|
+
|
336
|
+
return foldExtraActions(actions, Math.max(index, MAX), moreConfig);
|
312
337
|
} // 渲染一个 button 或者 menu button
|
313
338
|
|
314
339
|
|
315
340
|
function renderCommonActionButton(button, context, isTypeText) {
|
341
|
+
if (button.type === 'divider') {
|
342
|
+
return /*#__PURE__*/_react.default.createElement(_components.Divider, {
|
343
|
+
key: button.key,
|
344
|
+
direction: "ver"
|
345
|
+
});
|
346
|
+
}
|
347
|
+
|
316
348
|
var buttonContext = button.context,
|
317
349
|
text = button.text,
|
318
350
|
others = _objectWithoutProperties(button, _excluded5);
|
@@ -330,18 +362,27 @@ function renderCommonActionButton(button, context, isTypeText) {
|
|
330
362
|
}
|
331
363
|
|
332
364
|
function getDefaultMoreButton(type, more) {
|
333
|
-
var moreConfig = typeof more === 'string' ? {
|
334
|
-
children: more
|
335
|
-
} : more;
|
336
365
|
var defaultConfig = type === 'button' ? {
|
337
366
|
children: (0, _utils.getMessage)('more')
|
338
367
|
} : {
|
339
368
|
icon: 'more-line',
|
340
|
-
// iconSize: 'small',
|
341
369
|
autoWidth: false,
|
342
|
-
|
370
|
+
noArrow: true
|
343
371
|
};
|
344
|
-
|
372
|
+
|
373
|
+
if (!more) {
|
374
|
+
return defaultConfig;
|
375
|
+
}
|
376
|
+
|
377
|
+
var moreConfig = typeof more === 'string' ? {
|
378
|
+
children: more
|
379
|
+
} : more;
|
380
|
+
|
381
|
+
if (type === 'button') {
|
382
|
+
return Object.assign(defaultConfig, moreConfig);
|
383
|
+
}
|
384
|
+
|
385
|
+
return moreConfig;
|
345
386
|
}
|
346
387
|
|
347
388
|
var MAX_ACTTIONS = 4;
|
package/lib/actions/index.scss
CHANGED
@@ -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
|
+
}
|
@@ -72,7 +72,7 @@ var AdvancedFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
72
72
|
props: {
|
73
73
|
breakpoints: [480, 720, 990, 1200, Infinity],
|
74
74
|
maxColumns: [1, 2, 3, 3, 4],
|
75
|
-
maxWidth: [480, 360, 330,
|
75
|
+
maxWidth: [480, 360, 330, 400],
|
76
76
|
columnGap: 16,
|
77
77
|
rowGap: 12
|
78
78
|
},
|
@@ -0,0 +1,102 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
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
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.QueryFilterLayout = void 0;
|
9
|
+
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
11
|
+
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
13
|
+
|
14
|
+
var _components = require("@alicloudfe/components");
|
15
|
+
|
16
|
+
var _icon = _interopRequireDefault(require("@teamix/icon"));
|
17
|
+
|
18
|
+
var _utils = require("@teamix/utils");
|
19
|
+
|
20
|
+
require("./layout.scss");
|
21
|
+
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
23
|
+
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
25
|
+
|
26
|
+
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; }
|
27
|
+
|
28
|
+
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; }
|
29
|
+
|
30
|
+
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; }
|
31
|
+
|
32
|
+
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; }
|
33
|
+
|
34
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
35
|
+
|
36
|
+
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."); }
|
37
|
+
|
38
|
+
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); }
|
39
|
+
|
40
|
+
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; }
|
41
|
+
|
42
|
+
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; }
|
43
|
+
|
44
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
45
|
+
|
46
|
+
var QueryFilterLayout = function QueryFilterLayout(_ref) {
|
47
|
+
var className = _ref.className,
|
48
|
+
addonBefore = _ref.addonBefore,
|
49
|
+
addonAfter = _ref.addonAfter,
|
50
|
+
inlineContent = _ref.inlineContent,
|
51
|
+
panelContent = _ref.panelContent,
|
52
|
+
count = _ref.count,
|
53
|
+
expand = _ref.expand,
|
54
|
+
onExpand = _ref.onExpand,
|
55
|
+
children = _ref.children;
|
56
|
+
var prefixCls = (0, _utils.usePrefixCls)('', {
|
57
|
+
prefix: 'teamix-pro-form-query-filter-layout'
|
58
|
+
});
|
59
|
+
|
60
|
+
var _useState = (0, _react.useState)(!!expand),
|
61
|
+
_useState2 = _slicedToArray(_useState, 2),
|
62
|
+
visible = _useState2[0],
|
63
|
+
setVisible = _useState2[1];
|
64
|
+
|
65
|
+
var onClick = (0, _react.useCallback)(function () {
|
66
|
+
setVisible(!visible);
|
67
|
+
onExpand === null || onExpand === void 0 ? void 0 : onExpand(!visible);
|
68
|
+
}, [visible]);
|
69
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
70
|
+
className: (0, _classnames.default)(prefixCls, className)
|
71
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
72
|
+
className: "".concat(prefixCls, "-inline")
|
73
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
74
|
+
className: "".concat(prefixCls, "-left")
|
75
|
+
}, addonBefore ? /*#__PURE__*/_react.default.createElement("div", {
|
76
|
+
className: "".concat(prefixCls, "-addonBefore")
|
77
|
+
}, addonBefore) : null, inlineContent, (0, _utils.isValid)(panelContent) ? /*#__PURE__*/_react.default.createElement("div", {
|
78
|
+
className: "".concat(prefixCls, "-toggle")
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(_components.Badge, {
|
80
|
+
count: count,
|
81
|
+
style: _objectSpread({
|
82
|
+
backgroundColor: 'var(--color-brand1-6, #0064c8)',
|
83
|
+
color: 'var(--color-white, #fff)'
|
84
|
+
}, visible ? {
|
85
|
+
display: 'none'
|
86
|
+
} : {})
|
87
|
+
}, /*#__PURE__*/_react.default.createElement(_components.Button, {
|
88
|
+
onClick: onClick
|
89
|
+
}, visible ? /*#__PURE__*/_react.default.createElement(_icon.default, {
|
90
|
+
type: "up-line"
|
91
|
+
}) : /*#__PURE__*/_react.default.createElement(_icon.default, {
|
92
|
+
type: "filter-line"
|
93
|
+
}), (0, _utils.getMessage)('advancedFilter')))) : null), addonAfter ? /*#__PURE__*/_react.default.createElement("div", {
|
94
|
+
className: "".concat(prefixCls, "-addonAfter")
|
95
|
+
}, addonAfter) : null), /*#__PURE__*/_react.default.createElement("div", {
|
96
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-panel"), visible && (0, _utils.isValid)(panelContent) ? '' : "".concat(prefixCls, "-panel-hidden"))
|
97
|
+
}, panelContent), /*#__PURE__*/_react.default.createElement("div", {
|
98
|
+
className: "".concat(prefixCls, "-children")
|
99
|
+
}, children));
|
100
|
+
};
|
101
|
+
|
102
|
+
exports.QueryFilterLayout = QueryFilterLayout;
|
@@ -33,9 +33,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
33
33
|
|
34
34
|
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; }
|
35
35
|
|
36
|
+
// 初始化Search组件,内置部分属性
|
36
37
|
var initializeSearch = function initializeSearch(schema) {
|
37
|
-
|
38
|
+
var searchName;
|
39
|
+
var initializedSchema = schema.map(function (item) {
|
38
40
|
if (item.component === 'Search') {
|
41
|
+
searchName = item.name;
|
39
42
|
return _objectSpread(_objectSpread({}, item), {}, {
|
40
43
|
decoratorProps: _objectSpread(_objectSpread({}, item.decoratorProps), {}, {
|
41
44
|
inset: false
|
@@ -48,6 +51,10 @@ var initializeSearch = function initializeSearch(schema) {
|
|
48
51
|
|
49
52
|
return item;
|
50
53
|
});
|
54
|
+
return {
|
55
|
+
searchName: searchName,
|
56
|
+
initializedSchema: initializedSchema
|
57
|
+
};
|
51
58
|
};
|
52
59
|
/**
|
53
60
|
* 简单筛选
|
@@ -55,6 +62,8 @@ var initializeSearch = function initializeSearch(schema) {
|
|
55
62
|
|
56
63
|
|
57
64
|
var SimpleFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
65
|
+
var searchValue = (0, _react.useRef)(undefined);
|
66
|
+
|
58
67
|
var schema = props.schema,
|
59
68
|
onChange = props.onChange,
|
60
69
|
onSubmit = props.onSubmit,
|
@@ -63,13 +72,18 @@ var SimpleFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
63
72
|
var prefixCls = (0, _utils.usePrefixCls)('', {
|
64
73
|
prefix: 'teamix-pro-form-query-filter-simple'
|
65
74
|
});
|
75
|
+
|
76
|
+
var _initializeSearch = initializeSearch(schema),
|
77
|
+
searchName = _initializeSearch.searchName,
|
78
|
+
initializedSchema = _initializeSearch.initializedSchema;
|
79
|
+
|
66
80
|
var simpleSchema = (0, _react.useMemo)(function () {
|
67
81
|
return [{
|
68
82
|
component: 'FormFlex',
|
69
83
|
props: {
|
70
84
|
size: 8
|
71
85
|
},
|
72
|
-
children:
|
86
|
+
children: initializedSchema
|
73
87
|
}, {
|
74
88
|
component: 'Submit',
|
75
89
|
props: {
|
@@ -78,7 +92,18 @@ var SimpleFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
78
92
|
}
|
79
93
|
}
|
80
94
|
}];
|
81
|
-
}, [
|
95
|
+
}, [initializedSchema]);
|
96
|
+
var onInnerChange = (0, _react.useCallback)(function (values, value, name) {
|
97
|
+
// 处理Search组件,Select切换时不触发onChange
|
98
|
+
if (searchName === name) {
|
99
|
+
if (searchValue.current !== value[1]) {
|
100
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(values, name, value);
|
101
|
+
searchValue.current = value[1];
|
102
|
+
}
|
103
|
+
} else {
|
104
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(values, name, value);
|
105
|
+
}
|
106
|
+
}, [searchName, searchValue.current]);
|
82
107
|
return /*#__PURE__*/_react.default.createElement(_ProForm.default, _objectSpread(_objectSpread({}, otherProps), {}, {
|
83
108
|
className: (0, _classnames.default)(prefixCls, props.className),
|
84
109
|
schema: simpleSchema,
|
@@ -86,7 +111,7 @@ var SimpleFilter = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
86
111
|
breakpoints: [],
|
87
112
|
inset: true,
|
88
113
|
onSubmit: onSubmit,
|
89
|
-
onChange:
|
114
|
+
onChange: onInnerChange
|
90
115
|
}));
|
91
116
|
});
|
92
117
|
var _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 };
|