@teamix/pro 1.1.4 → 1.1.8
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/README.md +97 -0
- package/dist/212.js +2 -2
- package/dist/pro.css +1 -1
- package/dist/pro.js +3147 -1872
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +1 -1
- package/es/actions/dialog-form.d.ts +3 -3
- package/es/actions/dialog-table.d.ts +6 -1
- package/es/actions/dialog-table.js +10 -1
- package/es/actions/drawer-table.d.ts +4 -0
- package/es/actions/drawer-table.js +7 -1
- package/es/actions/index.d.ts +6 -11
- package/es/actions/index.js +41 -21
- package/es/actions/index.scss +1 -1
- package/es/card/index.d.ts +17 -0
- package/es/form/Components/ProField/index.d.ts +8 -0
- package/es/form/ProForm/index.d.ts +2 -2
- package/es/form/ProForm/index.js +9 -2
- package/es/form/ProForm/index.scss +40 -7
- package/es/form/SchemaForm/adapterType.js +3 -3
- package/es/form/SchemaForm/index.d.ts +2 -2
- package/es/form/SchemaForm/index.js +9 -5
- package/es/form/SchemaForm/initializeArrayCards.js +10 -55
- package/es/form/SchemaForm/initializeArrayCollapse.js +10 -64
- package/es/form/SchemaForm/initializeArrayIcon.js +19 -7
- package/es/form/SchemaForm/initializeArrayItems.js +16 -75
- package/es/form/SchemaForm/initializeArrayTable.js +23 -33
- package/es/form/SchemaForm/initializeFormButton.js +35 -38
- package/es/form/SchemaForm/initializeFormGroup.d.ts +2 -2
- package/es/form/SchemaForm/initializeFormStep.d.ts +4 -2
- package/es/form/SchemaForm/initializeFormStep.js +21 -7
- package/es/form/SchemaForm/initializeFormTab.d.ts +2 -2
- package/es/form/SchemaForm/initializeProField.js +3 -3
- package/es/form/SchemaForm/reactions.d.ts +1 -1
- package/es/form/SchemaForm/reactions.js +2 -2
- package/es/form/index.d.ts +17 -9
- package/es/form/index.js +21 -9
- package/es/form/typing.d.ts +13 -22
- package/es/form/warning.js +2 -6
- package/es/index.d.ts +4 -3
- package/es/index.js +4 -3
- package/es/info/components/FormItem/index.js +4 -4
- package/es/info/components/FormItem/index.scss +11 -0
- package/es/info/components/InfoGroup/index.js +37 -6
- package/es/info/components/InfoGroup/index.scss +6 -0
- package/es/info/components/InfoValueItem/index.js +14 -2
- package/es/info/components/baseInfo/index.js +10 -9
- package/es/info/components/headerInfo/index.js +10 -9
- package/es/info/components/tableInfo/index.js +7 -4
- package/es/info/components/tableInfo/index.scss +1 -1
- package/es/info/index.d.ts +1 -0
- package/es/info/index.js +9 -7
- package/es/info/index.scss +4 -0
- package/es/info/typing.d.ts +17 -3
- package/es/info/utils/index.d.ts +11 -2
- package/es/info/utils/index.js +21 -0
- package/es/nocode/configurators/PageHeader.js +49 -43
- package/es/nocode/configurators/ProTable.js +12 -9
- package/es/nocode/configurators/common.d.ts +117 -105
- package/es/nocode/configurators/common.js +38 -34
- package/es/nocode/index.scss +1 -4
- package/es/page-header/index.d.ts +3 -0
- package/es/page-header/index.js +40 -13
- package/es/page-header/index.scss +6 -4
- package/es/table/components/Filter/index.js +8 -16
- package/es/table/components/Layout/index.js +2 -1
- package/es/table/components/Layout/index.scss +1 -1
- package/es/table/components/ToolBar/FilterColumnIcon.js +77 -17
- package/es/table/components/ToolBar/index.scss +10 -0
- package/es/table/index.d.ts +0 -1
- package/es/table/index.js +75 -56
- package/es/table/index.scss +0 -1
- package/es/table/typing.d.ts +3 -1
- package/lib/actions/dialog-form.d.ts +3 -3
- package/lib/actions/dialog-table.d.ts +6 -1
- package/lib/actions/dialog-table.js +20 -1
- package/lib/actions/drawer-table.d.ts +4 -0
- package/lib/actions/drawer-table.js +14 -1
- package/lib/actions/index.d.ts +6 -11
- package/lib/actions/index.js +44 -20
- package/lib/actions/index.scss +1 -1
- package/lib/card/index.d.ts +17 -0
- package/lib/form/Components/ProField/index.d.ts +8 -0
- package/lib/form/ProForm/index.d.ts +2 -2
- package/lib/form/ProForm/index.js +10 -2
- package/lib/form/ProForm/index.scss +40 -7
- package/lib/form/SchemaForm/adapterType.js +3 -3
- package/lib/form/SchemaForm/index.d.ts +2 -2
- package/lib/form/SchemaForm/index.js +10 -5
- package/lib/form/SchemaForm/initializeArrayCards.js +10 -54
- package/lib/form/SchemaForm/initializeArrayCollapse.js +10 -63
- package/lib/form/SchemaForm/initializeArrayIcon.js +19 -7
- package/lib/form/SchemaForm/initializeArrayItems.js +16 -74
- package/lib/form/SchemaForm/initializeArrayTable.js +23 -33
- package/lib/form/SchemaForm/initializeFormButton.js +35 -38
- package/lib/form/SchemaForm/initializeFormGroup.d.ts +2 -2
- package/lib/form/SchemaForm/initializeFormStep.d.ts +4 -2
- package/lib/form/SchemaForm/initializeFormStep.js +21 -7
- package/lib/form/SchemaForm/initializeFormTab.d.ts +2 -2
- package/lib/form/SchemaForm/initializeProField.js +3 -3
- package/lib/form/SchemaForm/reactions.d.ts +1 -1
- package/lib/form/SchemaForm/reactions.js +2 -2
- package/lib/form/index.d.ts +17 -9
- package/lib/form/index.js +81 -56
- package/lib/form/typing.d.ts +13 -22
- package/lib/form/warning.js +2 -6
- package/lib/index.d.ts +4 -3
- package/lib/index.js +16 -4
- package/lib/info/components/FormItem/index.js +4 -4
- package/lib/info/components/FormItem/index.scss +11 -0
- package/lib/info/components/InfoGroup/index.js +46 -6
- package/lib/info/components/InfoGroup/index.scss +6 -0
- package/lib/info/components/InfoValueItem/index.js +15 -3
- package/lib/info/components/baseInfo/index.js +10 -9
- package/lib/info/components/headerInfo/index.js +11 -10
- package/lib/info/components/tableInfo/index.js +7 -3
- package/lib/info/components/tableInfo/index.scss +1 -1
- package/lib/info/index.d.ts +1 -0
- package/lib/info/index.js +8 -6
- package/lib/info/index.scss +4 -0
- package/lib/info/typing.d.ts +17 -3
- package/lib/info/utils/index.d.ts +11 -2
- package/lib/info/utils/index.js +31 -0
- package/lib/nocode/configurators/PageHeader.js +49 -43
- package/lib/nocode/configurators/ProTable.js +12 -9
- package/lib/nocode/configurators/common.d.ts +117 -105
- package/lib/nocode/configurators/common.js +38 -34
- package/lib/nocode/index.scss +1 -4
- package/lib/page-header/index.d.ts +3 -0
- package/lib/page-header/index.js +42 -13
- package/lib/page-header/index.scss +6 -4
- package/lib/table/components/Filter/index.js +7 -15
- package/lib/table/components/Layout/index.js +2 -1
- package/lib/table/components/Layout/index.scss +1 -1
- package/lib/table/components/ToolBar/FilterColumnIcon.js +75 -16
- package/lib/table/components/ToolBar/index.scss +10 -0
- package/lib/table/index.d.ts +0 -1
- package/lib/table/index.js +76 -65
- package/lib/table/index.scss +0 -1
- package/lib/table/typing.d.ts +3 -1
- package/package.json +5 -5
@@ -14,46 +14,50 @@ function array(title, name, fields, main, arrayTitle) {
|
|
14
14
|
name: name,
|
15
15
|
title: arrayTitle,
|
16
16
|
component: 'ArrayItems',
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
items: [{
|
21
|
-
component: 'FormFlex',
|
17
|
+
items: {
|
18
|
+
type: 'object',
|
19
|
+
decorator: 'ArrayItems.Item',
|
22
20
|
children: [{
|
23
|
-
component: '
|
21
|
+
component: 'FormFlex',
|
22
|
+
children: [{
|
23
|
+
component: 'ArrayItems.SortHandle'
|
24
|
+
}, {
|
25
|
+
component: 'ArrayItems.Index'
|
26
|
+
}]
|
24
27
|
}, {
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
schema: {
|
36
|
-
title: '{{$deps[0]}}'
|
28
|
+
name: 'drawer',
|
29
|
+
component: 'Editable.Drawer',
|
30
|
+
type: 'void',
|
31
|
+
title: '编辑详情',
|
32
|
+
reactions: {
|
33
|
+
dependencies: [".drawer.layout.".concat(main ? main : fields[0].name)],
|
34
|
+
fulfill: {
|
35
|
+
schema: {
|
36
|
+
title: '{{$deps[0]}}'
|
37
|
+
}
|
37
38
|
}
|
38
|
-
}
|
39
|
-
},
|
40
|
-
children: [{
|
41
|
-
name: 'layout',
|
42
|
-
component: 'FormLayout',
|
43
|
-
props: {
|
44
|
-
layout: 'vertical',
|
45
|
-
labelAlign: 'left',
|
46
|
-
colon: false,
|
47
|
-
labelCol: 24,
|
48
|
-
wrapperCol: 24
|
49
39
|
},
|
50
|
-
children:
|
40
|
+
children: [{
|
41
|
+
name: 'layout',
|
42
|
+
component: 'FormLayout',
|
43
|
+
props: {
|
44
|
+
layout: 'vertical',
|
45
|
+
labelAlign: 'left',
|
46
|
+
colon: false,
|
47
|
+
labelCol: 24,
|
48
|
+
wrapperCol: 24
|
49
|
+
},
|
50
|
+
children: fields
|
51
|
+
}]
|
52
|
+
}, {
|
53
|
+
component: 'ArrayItems.Remove'
|
51
54
|
}]
|
52
|
-
},
|
53
|
-
component: 'ArrayItems.Remove'
|
54
|
-
}],
|
55
|
+
},
|
55
56
|
children: [{
|
56
|
-
|
57
|
+
component: 'ArrayItems.Addition',
|
58
|
+
props: {
|
59
|
+
title: '添加一条'
|
60
|
+
}
|
57
61
|
}]
|
58
62
|
}]
|
59
63
|
};
|
package/lib/nocode/index.scss
CHANGED
@@ -17,13 +17,10 @@
|
|
17
17
|
border: 1px solid var(--color-line1-1, #eaeaea);
|
18
18
|
|
19
19
|
&-component {
|
20
|
+
position: relative;
|
20
21
|
padding: 20px;
|
21
22
|
flex-grow: 1;
|
22
23
|
border-right: 1px solid var(--color-line1-1, #eaeaea);
|
23
|
-
|
24
|
-
&>.teamix-pro-page-container {
|
25
|
-
padding: 0;
|
26
|
-
}
|
27
24
|
}
|
28
25
|
|
29
26
|
&-configurator {
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { IActionButton } from '../actions';
|
3
|
+
import { ProInfoProps } from '../info';
|
3
4
|
import './index.scss';
|
4
5
|
export interface BreadcrumbItem {
|
5
6
|
link?: string;
|
@@ -35,8 +36,10 @@ export declare type PageHeaderProps = {
|
|
35
36
|
breadcrumb?: BreadcrumbItem[];
|
36
37
|
extra?: IActionButton[] | React.ReactNode;
|
37
38
|
operation?: IActionButton[] | React.ReactNode;
|
39
|
+
maxActions?: number;
|
38
40
|
tags?: TagItem[];
|
39
41
|
data?: DataItem[];
|
42
|
+
info?: ProInfoProps | React.ReactNode;
|
40
43
|
} & React.HTMLAttributes<HTMLElement>;
|
41
44
|
declare const PageHeader: React.FC<PageHeaderProps>;
|
42
45
|
export default PageHeader;
|
package/lib/page-header/index.js
CHANGED
@@ -7,6 +7,8 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
|
+
var _reactRouterDom = require("react-router-dom");
|
11
|
+
|
10
12
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
11
13
|
|
12
14
|
var _icon = _interopRequireDefault(require("@teamix/icon"));
|
@@ -19,20 +21,22 @@ var _actions = require("../actions");
|
|
19
21
|
|
20
22
|
var _skeleton = require("../skeleton");
|
21
23
|
|
24
|
+
var _info = _interopRequireDefault(require("../info"));
|
25
|
+
|
22
26
|
require("./index.scss");
|
23
27
|
|
24
|
-
var _excluded = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "children", "className", "style"];
|
28
|
+
var _excluded = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "maxActions", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style"];
|
25
29
|
|
26
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
27
31
|
|
28
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
31
|
-
|
32
32
|
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; }
|
33
33
|
|
34
34
|
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; }
|
35
35
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
37
|
+
|
38
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
39
|
+
|
36
40
|
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; }
|
37
41
|
|
38
42
|
var cls = (0, _utils.baseClass)('teamix-pro-page-header');
|
@@ -50,16 +54,22 @@ var renderNav = function renderNav(breadcrumbs) {
|
|
50
54
|
return null;
|
51
55
|
};
|
52
56
|
|
53
|
-
var renderExtra = function renderExtra(helps) {
|
57
|
+
var renderExtra = function renderExtra(helps, max) {
|
54
58
|
if (!helps) {
|
55
59
|
return null;
|
56
60
|
}
|
57
61
|
|
58
62
|
if (helps instanceof Array && helps.length) {
|
63
|
+
var actions = helps.map(function (item) {
|
64
|
+
return Object.assign({
|
65
|
+
type: 'normal'
|
66
|
+
}, item);
|
67
|
+
});
|
59
68
|
return /*#__PURE__*/_react.default.createElement(_actions.ActionGroup, {
|
60
|
-
actions:
|
69
|
+
actions: actions,
|
61
70
|
type: "text",
|
62
|
-
divider: false
|
71
|
+
divider: false,
|
72
|
+
max: max
|
63
73
|
});
|
64
74
|
}
|
65
75
|
|
@@ -95,14 +105,15 @@ var isPresetColor = function isPresetColor(color) {
|
|
95
105
|
return PRESET_COLOR_REG.test(color);
|
96
106
|
};
|
97
107
|
|
98
|
-
var renderOperations = function renderOperations(operations) {
|
108
|
+
var renderOperations = function renderOperations(operations, max) {
|
99
109
|
if (!operations) {
|
100
110
|
return null;
|
101
111
|
}
|
102
112
|
|
103
113
|
if (operations instanceof Array && operations.length) {
|
104
114
|
return /*#__PURE__*/_react.default.createElement(_actions.ActionGroup, {
|
105
|
-
actions: operations
|
115
|
+
actions: operations,
|
116
|
+
max: max
|
106
117
|
});
|
107
118
|
}
|
108
119
|
|
@@ -149,6 +160,18 @@ var renderData = function renderData(data) {
|
|
149
160
|
}));
|
150
161
|
};
|
151
162
|
|
163
|
+
var renderInfo = function renderInfo(info) {
|
164
|
+
// @ts-ignore
|
165
|
+
if (info === null || info === void 0 ? void 0 : info.columns) {
|
166
|
+
// @ts-ignore
|
167
|
+
return /*#__PURE__*/_react.default.createElement(_info.default, _objectSpread({
|
168
|
+
type: "header"
|
169
|
+
}, info));
|
170
|
+
}
|
171
|
+
|
172
|
+
return info;
|
173
|
+
};
|
174
|
+
|
152
175
|
var PageHeader = function PageHeader(props) {
|
153
176
|
var title = props.title,
|
154
177
|
description = props.description,
|
@@ -157,6 +180,8 @@ var PageHeader = function PageHeader(props) {
|
|
157
180
|
_props$iconBackground = props.iconBackgroundType,
|
158
181
|
iconBackgroundType = _props$iconBackground === void 0 ? 'square' : _props$iconBackground,
|
159
182
|
iconBackgroundColor = props.iconBackgroundColor,
|
183
|
+
_props$maxActions = props.maxActions,
|
184
|
+
maxActions = _props$maxActions === void 0 ? 4 : _props$maxActions,
|
160
185
|
goback = props.goback,
|
161
186
|
operation = props.operation,
|
162
187
|
extra = props.extra,
|
@@ -165,11 +190,13 @@ var PageHeader = function PageHeader(props) {
|
|
165
190
|
breadcrumb = props.breadcrumb,
|
166
191
|
tags = props.tags,
|
167
192
|
data = props.data,
|
193
|
+
info = props.info,
|
168
194
|
children = props.children,
|
169
195
|
className = props.className,
|
170
196
|
style = props.style,
|
171
197
|
others = _objectWithoutProperties(props, _excluded);
|
172
198
|
|
199
|
+
var history = (0, _reactRouterDom.useHistory)();
|
173
200
|
var backgroundImage = image ? "url('".concat(image, "')") : undefined;
|
174
201
|
|
175
202
|
var showList = function showList(list) {
|
@@ -189,7 +216,7 @@ var PageHeader = function PageHeader(props) {
|
|
189
216
|
if (goback === true) {
|
190
217
|
history.go(-1);
|
191
218
|
} else if (typeof goback === 'string') {
|
192
|
-
|
219
|
+
history.push && history.push(goback);
|
193
220
|
}
|
194
221
|
};
|
195
222
|
|
@@ -217,7 +244,7 @@ var PageHeader = function PageHeader(props) {
|
|
217
244
|
className: cls('nav')
|
218
245
|
}, loading && /*#__PURE__*/_react.default.createElement(_skeleton.BaseSkeleton.Header.Nav, null), !loading && renderNav(breadcrumb)), /*#__PURE__*/_react.default.createElement("section", {
|
219
246
|
className: cls('extra')
|
220
|
-
}, !loading && renderExtra(extra))), (goback || icon || title !== undefined || description !== undefined || data || tags || operation) && /*#__PURE__*/_react.default.createElement("section", {
|
247
|
+
}, !loading && renderExtra(extra, maxActions))), (goback || icon || title !== undefined || description !== undefined || data || tags || operation) && /*#__PURE__*/_react.default.createElement("section", {
|
221
248
|
className: (0, _classnames2.default)(cls('section'), {
|
222
249
|
'with-description': description
|
223
250
|
})
|
@@ -233,7 +260,9 @@ var PageHeader = function PageHeader(props) {
|
|
233
260
|
className: cls('data')
|
234
261
|
}, renderData(data)), /*#__PURE__*/_react.default.createElement("section", {
|
235
262
|
className: cls('operation')
|
236
|
-
}, !loading && renderOperations(operation)))),
|
263
|
+
}, !loading && renderOperations(operation, maxActions)))), info && !loading && /*#__PURE__*/_react.default.createElement("section", {
|
264
|
+
className: (0, _classnames2.default)(cls('section'), cls('info'))
|
265
|
+
}, renderInfo(info)), children);
|
237
266
|
};
|
238
267
|
|
239
268
|
var _default = PageHeader;
|
@@ -20,6 +20,10 @@ $prefix: 'teamix-pro-page-header';
|
|
20
20
|
}
|
21
21
|
}
|
22
22
|
|
23
|
+
.#{$prefix}-info {
|
24
|
+
padding-top: var(--s-2, 8px);
|
25
|
+
}
|
26
|
+
|
23
27
|
.#{$prefix}-title {
|
24
28
|
display: flex;
|
25
29
|
font-size: var(--font-size-display-1, 24px);
|
@@ -130,7 +134,7 @@ $prefix: 'teamix-pro-page-header';
|
|
130
134
|
color: var(--color-help-5);
|
131
135
|
}
|
132
136
|
}
|
133
|
-
|
137
|
+
|
134
138
|
.#{$prefix}-bg-color {
|
135
139
|
&-blue {
|
136
140
|
background-color: var(--color-notice-5);
|
@@ -148,7 +152,7 @@ $prefix: 'teamix-pro-page-header';
|
|
148
152
|
background-color: var(--color-help-5);
|
149
153
|
}
|
150
154
|
}
|
151
|
-
|
155
|
+
|
152
156
|
.#{$prefix}-bg-type {
|
153
157
|
&-circle {
|
154
158
|
border-radius: 100%;
|
@@ -157,8 +161,6 @@ $prefix: 'teamix-pro-page-header';
|
|
157
161
|
border-radius: 4px;
|
158
162
|
}
|
159
163
|
}
|
160
|
-
|
161
|
-
|
162
164
|
}
|
163
165
|
|
164
166
|
.#{$prefix}-link {
|
@@ -51,7 +51,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
51
51
|
|
52
52
|
var CheckboxItem = _components.Menu.CheckboxItem;
|
53
53
|
var cls = (0, _utils.baseClass)('teamix-pro-table-toolbar-filter');
|
54
|
-
var
|
54
|
+
var RadioItem = _components.Menu.RadioItem;
|
55
55
|
|
56
56
|
var Filter = function Filter(props) {
|
57
57
|
var column = props.column,
|
@@ -105,27 +105,19 @@ var Filter = function Filter(props) {
|
|
105
105
|
}, []); // 渲染单选
|
106
106
|
|
107
107
|
var renderSingle = function renderSingle() {
|
108
|
-
|
109
|
-
|
110
|
-
return /*#__PURE__*/_react.default.createElement(RadioGroup, {
|
111
|
-
value: (_selected$ = selected === null || selected === void 0 ? void 0 : selected[0]) !== null && _selected$ !== void 0 ? _selected$ : '',
|
112
|
-
onChange: function onChange(check) {
|
113
|
-
setSelected([check]);
|
114
|
-
}
|
115
|
-
}, filters === null || filters === void 0 ? void 0 : filters.map(function (_ref3) {
|
108
|
+
return filters === null || filters === void 0 ? void 0 : filters.map(function (_ref3) {
|
116
109
|
var label = _ref3.label,
|
117
110
|
value = _ref3.value;
|
118
111
|
var valueStr = value.toString();
|
119
|
-
return /*#__PURE__*/_react.default.createElement(
|
112
|
+
return /*#__PURE__*/_react.default.createElement(RadioItem, {
|
120
113
|
id: valueStr,
|
121
|
-
|
114
|
+
checked: selected.includes(valueStr),
|
122
115
|
key: valueStr,
|
123
|
-
|
124
|
-
|
125
|
-
marginLeft: '5px'
|
116
|
+
onChange: function onChange(check) {
|
117
|
+
setSelected([valueStr]);
|
126
118
|
}
|
127
119
|
}, label);
|
128
|
-
})
|
120
|
+
});
|
129
121
|
}; // 渲染多选
|
130
122
|
|
131
123
|
|
@@ -58,6 +58,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
58
58
|
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; }
|
59
59
|
|
60
60
|
var cls = (0, _utils.baseClass)('teamix-pro-table-layout');
|
61
|
+
var toJS = _form.formilyReactive.toJS;
|
61
62
|
|
62
63
|
var Layout = function Layout(props) {
|
63
64
|
var header = props.header,
|
@@ -137,7 +138,7 @@ var Layout = function Layout(props) {
|
|
137
138
|
var renderFilterBtn = function renderFilterBtn() {
|
138
139
|
var handleBtnClick = function handleBtnClick() {
|
139
140
|
setExpand(!expand);
|
140
|
-
var filterValues = Object.values(
|
141
|
+
var filterValues = Object.values(toJS(dataFilterForm === null || dataFilterForm === void 0 ? void 0 : dataFilterForm.values)).filter(function (v) {
|
141
142
|
return !(0, _lodash.default)(v);
|
142
143
|
}); // console.log('filterValues', filterValues);
|
143
144
|
|
@@ -43,8 +43,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
43
43
|
|
44
44
|
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; }
|
45
45
|
|
46
|
-
var CheckboxItem = _components.Menu.CheckboxItem;
|
47
|
-
|
46
|
+
var CheckboxItem = _components.Menu.CheckboxItem;
|
47
|
+
var Row = _components.Grid.Row,
|
48
|
+
Col = _components.Grid.Col;
|
48
49
|
var cls = (0, _utils.baseClass)('teamix-pro-table-toolbar-filter-column');
|
49
50
|
|
50
51
|
var processColumns = function processColumns(columns) {
|
@@ -144,6 +145,13 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
144
145
|
return item;
|
145
146
|
});
|
146
147
|
notifyTableRender(keyNewColumns);
|
148
|
+
}; // 修改:dialog
|
149
|
+
|
150
|
+
|
151
|
+
var onChangeColumnsForDialog = function onChangeColumnsForDialog() {
|
152
|
+
var keyNewColumns = (0, _utils2.cloneDeep)(newColumns);
|
153
|
+
notifyTableRender(keyNewColumns);
|
154
|
+
setDropdownVisible(false);
|
147
155
|
}; // 向上
|
148
156
|
|
149
157
|
|
@@ -283,20 +291,71 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
283
291
|
})))));
|
284
292
|
};
|
285
293
|
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
294
|
+
var renderDialog = function renderDialog() {
|
295
|
+
// 对话框关闭
|
296
|
+
var dialogOnClose = function dialogOnClose() {
|
297
|
+
setDropdownVisible(false);
|
298
|
+
};
|
299
|
+
|
300
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_components.Button, {
|
301
|
+
iconSize: "small",
|
302
|
+
className: "teamix-pro-table-toolbar-icon",
|
303
|
+
onClick: function onClick() {
|
304
|
+
setDropdownVisible(!dropdownVisible);
|
305
|
+
}
|
306
|
+
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
307
|
+
size: "small",
|
308
|
+
type: "set-line"
|
309
|
+
})), /*#__PURE__*/_react.default.createElement(_components.Dialog, {
|
310
|
+
title: (0, _utils.getMessage)('customColumnSetting'),
|
311
|
+
visible: dropdownVisible,
|
312
|
+
onOk: onChangeColumnsForDialog,
|
313
|
+
onCancel: dialogOnClose,
|
314
|
+
onClose: dialogOnClose,
|
315
|
+
style: {
|
316
|
+
width: '440px'
|
317
|
+
}
|
318
|
+
}, /*#__PURE__*/_react.default.createElement(Row, {
|
319
|
+
gutter: 20,
|
320
|
+
wrap: true,
|
321
|
+
className: cls('row')
|
322
|
+
}, newColumns.map(function (item, index) {
|
323
|
+
var _newColumns$find2;
|
324
|
+
|
325
|
+
var dataIndex = item.dataIndex,
|
326
|
+
title = item.title,
|
327
|
+
columnFiltersDisabled = item.columnFiltersDisabled;
|
328
|
+
return /*#__PURE__*/_react.default.createElement(Col, {
|
329
|
+
span: 8,
|
330
|
+
key: index,
|
331
|
+
className: cls('col')
|
332
|
+
}, /*#__PURE__*/_react.default.createElement(_components.Checkbox, {
|
333
|
+
checked: (_newColumns$find2 = newColumns.find(function (_ref5) {
|
334
|
+
var key = _ref5.dataIndex;
|
335
|
+
return key === dataIndex;
|
336
|
+
})) === null || _newColumns$find2 === void 0 ? void 0 : _newColumns$find2.columnFilters,
|
337
|
+
onChange: function onChange(check) {
|
338
|
+
var columnsList = (0, _utils2.cloneDeep)(newColumns).map(function (item) {
|
339
|
+
if (item.dataIndex === dataIndex) {
|
340
|
+
item.columnFilters = check;
|
341
|
+
}
|
342
|
+
|
343
|
+
return item;
|
344
|
+
});
|
345
|
+
setNewColumns(columnsList);
|
346
|
+
},
|
347
|
+
disabled: columnFiltersDisabled
|
348
|
+
}, /*#__PURE__*/_react.default.createElement(_utils.Ellipsis, {
|
349
|
+
tooltip: false
|
350
|
+
}, title)));
|
351
|
+
}))));
|
352
|
+
};
|
353
|
+
|
354
|
+
if (newColumns.length > 10) {
|
355
|
+
return renderDialog();
|
356
|
+
}
|
357
|
+
|
358
|
+
return renderDropdown();
|
300
359
|
};
|
301
360
|
|
302
361
|
var _default = FilterColumnIcon;
|
@@ -66,8 +66,18 @@
|
|
66
66
|
}
|
67
67
|
}
|
68
68
|
}
|
69
|
+
|
70
|
+
|
71
|
+
}
|
72
|
+
.teamix-pro-table-toolbar-filter-column-col {
|
73
|
+
height: 28px;
|
74
|
+
.next-checkbox-wrapper {
|
75
|
+
display: flex;
|
76
|
+
align-items: center;
|
77
|
+
}
|
69
78
|
}
|
70
79
|
|
80
|
+
|
71
81
|
// fullscreen
|
72
82
|
.teamix-pro-table-full-screen {
|
73
83
|
width: 100vw;
|
package/lib/table/index.d.ts
CHANGED
@@ -2,6 +2,5 @@ import { ProTableProps } from './typing';
|
|
2
2
|
import './index.scss';
|
3
3
|
export * from './typing';
|
4
4
|
export * from '../actions';
|
5
|
-
export { default as ActionButton } from '../actions';
|
6
5
|
declare const ProTable: (props: ProTableProps) => JSX.Element;
|
7
6
|
export default ProTable;
|