@teamix/pro 1.2.18 → 1.2.22

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 (113) hide show
  1. package/dist/212.js +49 -49
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +3581 -990
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/es/actions/base.d.ts +2 -1
  7. package/es/actions/base.js +1 -1
  8. package/es/actions/danger-pop-confirm.d.ts +5 -0
  9. package/es/actions/danger-pop-confirm.js +10 -0
  10. package/es/actions/dialog.d.ts +1 -1
  11. package/es/actions/dialog.js +42 -55
  12. package/es/actions/index.d.ts +13 -0
  13. package/es/actions/index.js +21 -16
  14. package/es/actions/pop-confirm.d.ts +9 -0
  15. package/es/actions/pop-confirm.js +9 -0
  16. package/es/form/Components/LightFilter/componentMap.d.ts +2 -1
  17. package/es/form/Components/LightFilter/componentMap.js +4 -2
  18. package/es/form/Components/LightFilter/index.d.ts +1 -0
  19. package/es/form/Components/LightFilter/index.js +34 -16
  20. package/es/form/Components/LightFilter/index.scss +14 -4
  21. package/es/form/Filter/AdvancedFilter.d.ts +7 -0
  22. package/es/form/Filter/AdvancedFilter.js +114 -0
  23. package/es/form/Filter/LightFilter.d.ts +7 -0
  24. package/es/form/Filter/LightFilter.js +79 -0
  25. package/es/form/Filter/SimpleFilter.d.ts +7 -0
  26. package/es/form/Filter/SimpleFilter.js +74 -0
  27. package/es/form/Filter/index2.js +288 -235
  28. package/es/form/Filter/index2.scss +3 -0
  29. package/es/form/ProForm/index.js +11 -7
  30. package/es/form/ProForm/index.scss +40 -6
  31. package/es/form/ProForm/useFormDisplayValues.js +4 -2
  32. package/es/form/SchemaForm/index.js +16 -10
  33. package/es/form/SchemaForm/initializeDataSource.d.ts +2 -2
  34. package/es/form/SchemaForm/initializeDataSource.js +4 -9
  35. package/es/form/SchemaForm/initializeRequest.d.ts +2 -2
  36. package/es/form/SchemaForm/initializeRequest.js +4 -10
  37. package/es/form/SchemaForm/initializeRules.d.ts +7 -1
  38. package/es/form/SchemaForm/initializeRules.js +9 -13
  39. package/es/form/SchemaForm/reactions.d.ts +5 -5
  40. package/es/form/SchemaForm/reactions.js +27 -29
  41. package/es/form/global.scss +1 -0
  42. package/es/form/typing.d.ts +11 -2
  43. package/es/form/utils.d.ts +8 -7
  44. package/es/form/utils.js +5 -4
  45. package/es/index.d.ts +1 -1
  46. package/es/index.js +1 -1
  47. package/es/table/components/Filter/index.js +1 -0
  48. package/es/table/components/Layout/index.js +21 -12
  49. package/es/table/components/Pagination/index.d.ts +4 -0
  50. package/es/table/components/Pagination/index.js +154 -0
  51. package/es/table/components/Pagination/index.scss +22 -0
  52. package/es/table/components/ToolBar/FilterColumnIcon.js +42 -8
  53. package/es/table/components/ToolBar/index.scss +17 -6
  54. package/es/table/index.js +118 -34
  55. package/es/table/index.scss +7 -1
  56. package/es/table/typing.d.ts +6 -2
  57. package/es/table/utils/columnRender.js +2 -1
  58. package/es/table/utils/index.d.ts +7 -0
  59. package/es/table/utils/index.js +38 -4
  60. package/lib/actions/base.d.ts +2 -1
  61. package/lib/actions/base.js +1 -1
  62. package/lib/actions/danger-pop-confirm.d.ts +5 -0
  63. package/lib/actions/danger-pop-confirm.js +22 -0
  64. package/lib/actions/dialog.d.ts +1 -1
  65. package/lib/actions/dialog.js +42 -54
  66. package/lib/actions/index.d.ts +13 -0
  67. package/lib/actions/index.js +23 -16
  68. package/lib/actions/pop-confirm.d.ts +9 -0
  69. package/lib/actions/pop-confirm.js +23 -0
  70. package/lib/form/Components/LightFilter/componentMap.d.ts +2 -1
  71. package/lib/form/Components/LightFilter/componentMap.js +6 -4
  72. package/lib/form/Components/LightFilter/index.d.ts +1 -0
  73. package/lib/form/Components/LightFilter/index.js +31 -14
  74. package/lib/form/Components/LightFilter/index.scss +14 -4
  75. package/lib/form/Filter/AdvancedFilter.d.ts +7 -0
  76. package/lib/form/Filter/AdvancedFilter.js +134 -0
  77. package/lib/form/Filter/LightFilter.d.ts +7 -0
  78. package/lib/form/Filter/LightFilter.js +99 -0
  79. package/lib/form/Filter/SimpleFilter.d.ts +7 -0
  80. package/lib/form/Filter/SimpleFilter.js +93 -0
  81. package/lib/form/Filter/index2.js +291 -234
  82. package/lib/form/Filter/index2.scss +3 -0
  83. package/lib/form/ProForm/index.js +10 -6
  84. package/lib/form/ProForm/index.scss +40 -6
  85. package/lib/form/ProForm/useFormDisplayValues.js +3 -1
  86. package/lib/form/SchemaForm/index.js +16 -9
  87. package/lib/form/SchemaForm/initializeDataSource.d.ts +2 -2
  88. package/lib/form/SchemaForm/initializeDataSource.js +4 -11
  89. package/lib/form/SchemaForm/initializeRequest.d.ts +2 -2
  90. package/lib/form/SchemaForm/initializeRequest.js +4 -11
  91. package/lib/form/SchemaForm/initializeRules.d.ts +7 -1
  92. package/lib/form/SchemaForm/initializeRules.js +9 -16
  93. package/lib/form/SchemaForm/reactions.d.ts +5 -5
  94. package/lib/form/SchemaForm/reactions.js +29 -31
  95. package/lib/form/global.scss +1 -0
  96. package/lib/form/typing.d.ts +11 -2
  97. package/lib/form/utils.d.ts +8 -7
  98. package/lib/form/utils.js +6 -5
  99. package/lib/index.d.ts +1 -1
  100. package/lib/index.js +1 -1
  101. package/lib/table/components/Layout/index.js +20 -11
  102. package/lib/table/components/Pagination/index.d.ts +4 -0
  103. package/lib/table/components/Pagination/index.js +174 -0
  104. package/lib/table/components/Pagination/index.scss +22 -0
  105. package/lib/table/components/ToolBar/FilterColumnIcon.js +41 -7
  106. package/lib/table/components/ToolBar/index.scss +17 -6
  107. package/lib/table/index.js +115 -32
  108. package/lib/table/index.scss +7 -1
  109. package/lib/table/typing.d.ts +6 -2
  110. package/lib/table/utils/columnRender.js +2 -1
  111. package/lib/table/utils/index.d.ts +7 -0
  112. package/lib/table/utils/index.js +46 -4
  113. package/package.json +3 -3
@@ -0,0 +1,114 @@
1
+ var _excluded = ["schema", "onSubmit", "onReset", "onResetClick", "layout", "labelAlign", "wrapperAlign", "labelCol", "wrapperCol"];
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; }
8
+
9
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
10
+
11
+ 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."); }
12
+
13
+ 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); }
14
+
15
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
16
+
17
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
18
+
19
+ 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
+
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
+
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
+
25
+ import React, { memo, useMemo } from 'react';
26
+ import cls from 'classnames';
27
+ import { usePrefixCls, getMessage } from '@teamix/utils';
28
+ import ProForm from '../ProForm';
29
+ import { mergeArrayValue } from '../utils';
30
+ /**
31
+ * 高级筛选
32
+ */
33
+
34
+ var AdvancedFilter = /*#__PURE__*/memo(function (props) {
35
+ var schema = props.schema,
36
+ onSubmit = props.onSubmit,
37
+ onReset = props.onReset,
38
+ onResetClick = props.onResetClick,
39
+ layout = props.layout,
40
+ labelAlign = props.labelAlign,
41
+ wrapperAlign = props.wrapperAlign,
42
+ labelCol = props.labelCol,
43
+ wrapperCol = props.wrapperCol,
44
+ otherProps = _objectWithoutProperties(props, _excluded);
45
+
46
+ var prefixCls = usePrefixCls('', {
47
+ prefix: 'teamix-pro-form-query-filter-advanced'
48
+ });
49
+ var gridSchema = useMemo(function () {
50
+ return [{
51
+ name: 'FormGrid',
52
+ component: 'FormGrid',
53
+ props: {
54
+ breakpoints: [480, 720, 990, 1200, Infinity],
55
+ maxColumns: [1, 2, 3, 3, 4],
56
+ maxWidth: [480, 360, 330, 330, 300],
57
+ columnGap: 16,
58
+ rowGap: 12
59
+ },
60
+ children: [].concat(_toConsumableArray(schema), [{
61
+ component: 'FormGrid.GridColumn',
62
+ props: {
63
+ gridSpan: -1
64
+ },
65
+ children: [{
66
+ component: 'FormButtonGroup',
67
+ props: {
68
+ align: 'right'
69
+ },
70
+ children: [{
71
+ component: 'Reset',
72
+ props: {
73
+ onResetValidateSuccess: onReset,
74
+ onClick: onResetClick,
75
+ children: getMessage('reset')
76
+ }
77
+ }, {
78
+ component: 'Submit',
79
+ props: {
80
+ style: {
81
+ marginRight: -8
82
+ },
83
+ children: getMessage('search')
84
+ }
85
+ }]
86
+ }]
87
+ }])
88
+ }];
89
+ }, [schema, onReset, onResetClick]);
90
+ var getTeamixLayout = useMemo(function () {
91
+ return {
92
+ breakpoints: [990],
93
+ layout: mergeArrayValue(['vertical'], layout),
94
+ labelAlign: mergeArrayValue(['left'], labelAlign),
95
+ wrapperAlign: mergeArrayValue(['left'], wrapperAlign),
96
+ labelCol: mergeArrayValue([24], labelCol),
97
+ wrapperCol: mergeArrayValue([24], wrapperCol)
98
+ };
99
+ }, [layout, labelAlign, wrapperAlign, labelCol, wrapperCol]);
100
+ return /*#__PURE__*/React.createElement(ProForm, _objectSpread(_objectSpread(_objectSpread({
101
+ className: cls(prefixCls, props.className),
102
+ schema: gridSchema,
103
+ feedbackLayout: "popover"
104
+ }, otherProps), getTeamixLayout), {}, {
105
+ onSubmit: onSubmit
106
+ }));
107
+ });
108
+ AdvancedFilter.defaultProps = {
109
+ layout: 'horizontal',
110
+ labelAlign: 'right',
111
+ labelCol: 6,
112
+ wrapperCol: 18
113
+ };
114
+ export default AdvancedFilter;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { FilterProps } from '../typing';
3
+ /**
4
+ * 轻量筛选
5
+ */
6
+ declare const LightFilter: React.FC<FilterProps>;
7
+ export default LightFilter;
@@ -0,0 +1,79 @@
1
+ var _excluded = ["form", "schema", "onSubmit", "onChange", "defaultFilterValue"];
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; }
8
+
9
+ 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; }
10
+
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
+
13
+ import React, { memo, useMemo, useCallback, useRef } from 'react';
14
+ import cls from 'classnames';
15
+ import { toJS } from '@formily/reactive';
16
+ import { usePrefixCls } from '@teamix/utils';
17
+ import ProForm from '../ProForm';
18
+ /**
19
+ * 轻量筛选
20
+ */
21
+
22
+ var LightFilter = /*#__PURE__*/memo(function (props) {
23
+ var _schema$;
24
+
25
+ var form = props.form,
26
+ schema = props.schema,
27
+ onSubmit = props.onSubmit,
28
+ onChange = props.onChange,
29
+ defaultFilterValue = props.defaultFilterValue,
30
+ otherProps = _objectWithoutProperties(props, _excluded);
31
+
32
+ var filterValue = useRef(defaultFilterValue || ((_schema$ = schema[0]) === null || _schema$ === void 0 ? void 0 : _schema$.name));
33
+ var prefixCls = usePrefixCls('', {
34
+ prefix: 'teamix-pro-form-query-filter-light'
35
+ }); // input类组件的按钮
36
+
37
+ var onBtnClick = useCallback(function () {
38
+ onChange && onChange(toJS(form.values));
39
+ }, [form]); // 筛选提交切换
40
+
41
+ var onFilterChange = useCallback(function (value) {
42
+ filterValue.current = value;
43
+ }, [form]); // onChange
44
+
45
+ var onCurrentChange = useCallback(function (values) {
46
+ onChange && onChange(_defineProperty({}, filterValue.current, values[filterValue.current]));
47
+ }, [onChange, filterValue.current]);
48
+ var LightSchema = useMemo(function () {
49
+ return [{
50
+ component: 'LightFilter',
51
+ props: {
52
+ defaultFilterValue: defaultFilterValue,
53
+ onFilterChange: onFilterChange,
54
+ buttonProps: {
55
+ onClick: onBtnClick
56
+ }
57
+ },
58
+ children: schema
59
+ }, {
60
+ component: 'Submit',
61
+ props: {
62
+ style: {
63
+ display: 'none'
64
+ }
65
+ }
66
+ }];
67
+ }, [schema, onBtnClick, onFilterChange, defaultFilterValue]);
68
+ return /*#__PURE__*/React.createElement(ProForm, _objectSpread(_objectSpread({}, otherProps), {}, {
69
+ form: form,
70
+ className: cls(prefixCls, props.className),
71
+ schema: LightSchema,
72
+ feedbackLayout: "none",
73
+ breakpoints: [],
74
+ bordered: false,
75
+ onSubmit: onSubmit,
76
+ onChange: onCurrentChange
77
+ }));
78
+ });
79
+ export default LightFilter;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { FilterProps } from '../typing';
3
+ /**
4
+ * 简单筛选
5
+ */
6
+ declare const SimpleFilter: React.FC<FilterProps>;
7
+ export default SimpleFilter;
@@ -0,0 +1,74 @@
1
+ var _excluded = ["schema", "onChange", "onSubmit"];
2
+
3
+ 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; }
4
+
5
+ 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; }
6
+
7
+ 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; }
8
+
9
+ 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; }
10
+
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
+
13
+ import React, { memo, useMemo } from 'react';
14
+ import cls from 'classnames';
15
+ import { usePrefixCls } from '@teamix/utils';
16
+ import ProForm from '../ProForm';
17
+
18
+ var initializeSearch = function initializeSearch(schema) {
19
+ return schema.map(function (item) {
20
+ if (item.component === 'Search') {
21
+ return _objectSpread(_objectSpread({}, item), {}, {
22
+ decoratorProps: _objectSpread(_objectSpread({}, item.decoratorProps), {}, {
23
+ inset: false
24
+ }),
25
+ props: _objectSpread({
26
+ shape: 'simple'
27
+ }, item.props)
28
+ });
29
+ }
30
+
31
+ return item;
32
+ });
33
+ };
34
+ /**
35
+ * 简单筛选
36
+ */
37
+
38
+
39
+ var SimpleFilter = /*#__PURE__*/memo(function (props) {
40
+ var schema = props.schema,
41
+ onChange = props.onChange,
42
+ onSubmit = props.onSubmit,
43
+ otherProps = _objectWithoutProperties(props, _excluded);
44
+
45
+ var prefixCls = usePrefixCls('', {
46
+ prefix: 'teamix-pro-form-query-filter-simple'
47
+ });
48
+ var simpleSchema = useMemo(function () {
49
+ return [{
50
+ component: 'FormFlex',
51
+ props: {
52
+ size: 8
53
+ },
54
+ children: initializeSearch(schema)
55
+ }, {
56
+ component: 'Submit',
57
+ props: {
58
+ style: {
59
+ display: 'none'
60
+ }
61
+ }
62
+ }];
63
+ }, [schema]);
64
+ return /*#__PURE__*/React.createElement(ProForm, _objectSpread(_objectSpread({}, otherProps), {}, {
65
+ className: cls(prefixCls, props.className),
66
+ schema: simpleSchema,
67
+ feedbackLayout: "popover",
68
+ breakpoints: [],
69
+ inset: true,
70
+ onSubmit: onSubmit,
71
+ onChange: onChange
72
+ }));
73
+ });
74
+ export default SimpleFilter;