@teamix/pro 1.2.19 → 1.2.23
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 +49 -49
- package/dist/pro.css +1 -1
- package/dist/pro.js +3400 -880
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog.js +10 -24
- package/es/actions/index.d.ts +10 -0
- package/es/actions/index.js +11 -16
- package/es/form/Components/LightFilter/componentMap.js +2 -1
- package/es/form/Components/LightFilter/index.js +16 -4
- package/es/form/Components/LightFilter/index.scss +1 -1
- package/es/form/Components/SelectTable/index.d.ts +24 -0
- package/es/form/Components/SelectTable/index.js +135 -0
- package/es/form/Components/SelectTable/index.scss +28 -0
- package/es/form/Components/SelectTable/table.d.ts +6 -0
- package/es/form/Components/SelectTable/table.js +64 -0
- package/es/form/Filter/AdvancedFilter.d.ts +7 -0
- package/es/form/Filter/AdvancedFilter.js +114 -0
- package/es/form/Filter/LightFilter.d.ts +7 -0
- package/es/form/Filter/LightFilter.js +79 -0
- package/es/form/Filter/SimpleFilter.d.ts +7 -0
- package/es/form/Filter/SimpleFilter.js +74 -0
- package/es/form/Filter/index2.js +203 -257
- package/es/form/ProForm/index.js +12 -9
- package/es/form/ProForm/index.scss +40 -6
- package/es/form/ProForm/useFormDisplayValues.js +4 -2
- package/es/form/SchemaForm/index.js +16 -10
- package/es/form/SchemaForm/initializeDataSource.d.ts +2 -2
- package/es/form/SchemaForm/initializeDataSource.js +4 -9
- package/es/form/SchemaForm/initializeRequest.d.ts +2 -2
- package/es/form/SchemaForm/initializeRequest.js +4 -10
- package/es/form/SchemaForm/initializeRules.d.ts +7 -1
- package/es/form/SchemaForm/initializeRules.js +9 -13
- package/es/form/SchemaForm/reactions.d.ts +5 -5
- package/es/form/SchemaForm/reactions.js +27 -29
- package/es/form/global.scss +1 -0
- package/es/form/typing.d.ts +7 -3
- package/es/form/utils.d.ts +8 -7
- package/es/form/utils.js +5 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/table/components/Filter/index.js +1 -0
- package/es/table/components/Layout/index.js +22 -12
- package/es/table/components/Pagination/index.d.ts +7 -0
- package/es/table/components/Pagination/index.js +245 -0
- package/es/table/components/Pagination/index.scss +50 -0
- package/es/table/components/ToolBar/FilterColumnIcon.js +41 -7
- package/es/table/components/ToolBar/index.scss +17 -6
- package/es/table/index.js +96 -37
- package/es/table/index.scss +7 -1
- package/es/table/typing.d.ts +9 -2
- package/es/table/utils/columnRender.js +2 -1
- package/es/table/utils/index.d.ts +7 -0
- package/es/table/utils/index.js +38 -4
- package/lib/actions/dialog.js +9 -23
- package/lib/actions/index.d.ts +10 -0
- package/lib/actions/index.js +11 -16
- package/lib/form/Components/LightFilter/componentMap.js +2 -1
- package/lib/form/Components/LightFilter/index.js +15 -4
- package/lib/form/Components/LightFilter/index.scss +1 -1
- package/lib/form/Components/SelectTable/index.d.ts +24 -0
- package/lib/form/Components/SelectTable/index.js +157 -0
- package/lib/form/Components/SelectTable/index.scss +28 -0
- package/lib/form/Components/SelectTable/table.d.ts +6 -0
- package/lib/form/Components/SelectTable/table.js +76 -0
- package/lib/form/Filter/AdvancedFilter.d.ts +7 -0
- package/lib/form/Filter/AdvancedFilter.js +134 -0
- package/lib/form/Filter/LightFilter.d.ts +7 -0
- package/lib/form/Filter/LightFilter.js +99 -0
- package/lib/form/Filter/SimpleFilter.d.ts +7 -0
- package/lib/form/Filter/SimpleFilter.js +93 -0
- package/lib/form/Filter/index2.js +207 -258
- package/lib/form/ProForm/index.js +11 -9
- package/lib/form/ProForm/index.scss +40 -6
- package/lib/form/ProForm/useFormDisplayValues.js +3 -1
- package/lib/form/SchemaForm/index.js +16 -9
- package/lib/form/SchemaForm/initializeDataSource.d.ts +2 -2
- package/lib/form/SchemaForm/initializeDataSource.js +4 -11
- package/lib/form/SchemaForm/initializeRequest.d.ts +2 -2
- package/lib/form/SchemaForm/initializeRequest.js +4 -11
- package/lib/form/SchemaForm/initializeRules.d.ts +7 -1
- package/lib/form/SchemaForm/initializeRules.js +9 -16
- package/lib/form/SchemaForm/reactions.d.ts +5 -5
- package/lib/form/SchemaForm/reactions.js +29 -31
- package/lib/form/global.scss +1 -0
- package/lib/form/typing.d.ts +7 -3
- package/lib/form/utils.d.ts +8 -7
- package/lib/form/utils.js +6 -5
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/table/components/Layout/index.js +21 -11
- package/lib/table/components/Pagination/index.d.ts +7 -0
- package/lib/table/components/Pagination/index.js +265 -0
- package/lib/table/components/Pagination/index.scss +50 -0
- package/lib/table/components/ToolBar/FilterColumnIcon.js +40 -6
- package/lib/table/components/ToolBar/index.scss +17 -6
- package/lib/table/index.js +96 -36
- package/lib/table/index.scss +7 -1
- package/lib/table/typing.d.ts +9 -2
- package/lib/table/utils/columnRender.js +2 -1
- package/lib/table/utils/index.d.ts +7 -0
- package/lib/table/utils/index.js +46 -4
- package/package.json +2 -2
@@ -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,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;
|