@teamix/pro 1.3.2 → 1.3.5
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/pro.css +1 -1
- package/dist/pro.js +13959 -2353
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +9 -0
- package/es/actions/dialog-form.js +8 -5
- package/es/actions/dialog.js +2 -4
- package/es/form/Components/LightFilter/index.d.ts +1 -0
- package/es/form/Components/LightFilter/index.js +9 -6
- package/es/form/Filter/LightFilter.js +13 -3
- package/es/form/Filter/SimpleFilter.js +1 -1
- package/es/form/Filter/index.js +44 -10
- package/es/form/ProForm/useFormDisplayValues.js +2 -2
- package/es/form/SchemaForm/adapterDecorator.js +1 -1
- package/es/form/SchemaForm/adapterType.js +2 -5
- package/es/form/SchemaForm/index.js +27 -12
- package/es/form/SchemaForm/initializeDataSource.d.ts +1 -0
- package/es/form/SchemaForm/initializeDataSource.js +7 -1
- package/es/form/SchemaForm/initializeSelectTable.d.ts +3 -0
- package/es/form/SchemaForm/initializeSelectTable.js +38 -0
- package/es/form/SchemaForm/reactions.d.ts +1 -1
- package/es/form/SchemaForm/reactions.js +20 -16
- package/es/form/docs/ActionResponse.d.ts +7 -0
- package/es/form/docs/ActionResponse.js +11 -0
- package/es/form/docs/ActionResponse.less +25 -0
- package/es/form/index.d.ts +1 -0
- package/es/form/typing.d.ts +6 -1
- package/es/form/utils.js +13 -4
- package/es/index.d.ts +4 -2
- package/es/index.js +5 -5
- package/es/info/components/ProInfoItem/index.js +6 -2
- package/es/info/components/ProInfoItem/index.scss +3 -0
- package/es/info/components/baseInfo/index.js +2 -1
- package/es/info/typing.d.ts +2 -0
- package/es/info/utils/index.d.ts +8 -0
- package/es/info/utils/index.js +28 -1
- package/es/page-header/index.d.ts +3 -1
- package/es/page-header/index.js +12 -3
- package/es/sidebar/components/sidebar-container/index.js +114 -9
- package/es/sidebar/components/sidebar-container/index.scss +53 -5
- package/es/sidebar/components/tree/index.d.ts +2 -0
- package/es/sidebar/components/tree/index.js +222 -76
- package/es/sidebar/components/tree/index.scss +10 -0
- package/es/sidebar/components/tree-node/componnets/HoverTooltip/index.d.ts +15 -0
- package/es/sidebar/components/tree-node/componnets/HoverTooltip/index.js +62 -0
- package/es/sidebar/components/tree-node/componnets/HoverTooltip/index.scss +7 -0
- package/es/sidebar/components/tree-node/componnets/IconAction/index.d.ts +12 -0
- package/es/sidebar/components/tree-node/componnets/IconAction/index.js +105 -0
- package/es/sidebar/components/tree-node/componnets/IconAction/index.scss +7 -0
- package/es/sidebar/components/tree-node/componnets/IconSwitch/index.d.ts +23 -0
- package/es/sidebar/components/tree-node/componnets/IconSwitch/index.js +73 -0
- package/es/sidebar/components/tree-node/componnets/IconSwitch/index.scss +7 -0
- package/es/sidebar/components/tree-node/index.d.ts +7 -0
- package/es/sidebar/components/tree-node/index.js +225 -0
- package/es/sidebar/components/tree-node/index.scss +58 -0
- package/es/sidebar/index.d.ts +2 -0
- package/es/sidebar/index.js +147 -12
- package/es/sidebar/index.scss +24 -1
- package/es/sidebar/typing.d.ts +83 -13
- package/es/sidebar/utils/action-ref.d.ts +3 -0
- package/es/sidebar/utils/action-ref.js +15 -0
- package/es/sidebar/utils/index.d.ts +71 -0
- package/es/sidebar/utils/index.js +228 -0
- package/es/table/components/ToolBar/index.scss +1 -1
- package/es/table/index.scss +10 -0
- package/lib/actions/dialog-form.js +8 -5
- package/lib/actions/dialog.js +1 -3
- package/lib/form/Components/LightFilter/index.d.ts +1 -0
- package/lib/form/Components/LightFilter/index.js +9 -6
- package/lib/form/Filter/LightFilter.js +13 -3
- package/lib/form/Filter/SimpleFilter.js +1 -1
- package/lib/form/Filter/index.js +44 -10
- package/lib/form/ProForm/useFormDisplayValues.js +1 -1
- package/lib/form/SchemaForm/adapterDecorator.js +1 -1
- package/lib/form/SchemaForm/adapterType.js +2 -5
- package/lib/form/SchemaForm/index.js +28 -11
- package/lib/form/SchemaForm/initializeDataSource.d.ts +1 -0
- package/lib/form/SchemaForm/initializeDataSource.js +7 -1
- package/lib/form/SchemaForm/initializeSelectTable.d.ts +3 -0
- package/lib/form/SchemaForm/initializeSelectTable.js +45 -0
- package/lib/form/SchemaForm/reactions.d.ts +1 -1
- package/lib/form/SchemaForm/reactions.js +20 -16
- package/lib/form/docs/ActionResponse.d.ts +7 -0
- package/lib/form/docs/ActionResponse.js +24 -0
- package/lib/form/docs/ActionResponse.less +25 -0
- package/lib/form/index.d.ts +1 -0
- package/lib/form/typing.d.ts +6 -1
- package/lib/form/utils.js +13 -4
- package/lib/index.d.ts +4 -2
- package/lib/index.js +22 -2
- package/lib/info/components/ProInfoItem/index.js +6 -2
- package/lib/info/components/ProInfoItem/index.scss +3 -0
- package/lib/info/components/baseInfo/index.js +1 -0
- package/lib/info/typing.d.ts +2 -0
- package/lib/info/utils/index.d.ts +8 -0
- package/lib/info/utils/index.js +32 -1
- package/lib/page-header/index.d.ts +3 -1
- package/lib/page-header/index.js +11 -2
- package/lib/sidebar/components/sidebar-container/index.js +120 -8
- package/lib/sidebar/components/sidebar-container/index.scss +53 -5
- package/lib/sidebar/components/tree/index.d.ts +2 -0
- package/lib/sidebar/components/tree/index.js +230 -76
- package/lib/sidebar/components/tree/index.scss +10 -0
- package/lib/sidebar/components/tree-node/componnets/HoverTooltip/index.d.ts +15 -0
- package/lib/sidebar/components/tree-node/componnets/HoverTooltip/index.js +80 -0
- package/lib/sidebar/components/tree-node/componnets/HoverTooltip/index.scss +7 -0
- package/lib/sidebar/components/tree-node/componnets/IconAction/index.d.ts +12 -0
- package/lib/sidebar/components/tree-node/componnets/IconAction/index.js +127 -0
- package/lib/sidebar/components/tree-node/componnets/IconAction/index.scss +7 -0
- package/lib/sidebar/components/tree-node/componnets/IconSwitch/index.d.ts +23 -0
- package/lib/sidebar/components/tree-node/componnets/IconSwitch/index.js +94 -0
- package/lib/sidebar/components/tree-node/componnets/IconSwitch/index.scss +7 -0
- package/lib/sidebar/components/tree-node/index.d.ts +7 -0
- package/lib/sidebar/components/tree-node/index.js +252 -0
- package/lib/sidebar/components/tree-node/index.scss +58 -0
- package/lib/sidebar/index.d.ts +2 -0
- package/lib/sidebar/index.js +173 -10
- package/lib/sidebar/index.scss +24 -1
- package/lib/sidebar/typing.d.ts +83 -13
- package/lib/sidebar/utils/action-ref.d.ts +3 -0
- package/lib/sidebar/utils/action-ref.js +22 -0
- package/lib/sidebar/utils/index.d.ts +71 -0
- package/lib/sidebar/utils/index.js +247 -0
- package/lib/table/components/ToolBar/index.scss +1 -1
- package/lib/table/index.scss +10 -0
- package/package.json +4 -4
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './ActionResponse.less';
|
3
|
+
export var ActionResponse = function ActionResponse(props) {
|
4
|
+
return /*#__PURE__*/React.createElement("div", {
|
5
|
+
className: "as-wrapper"
|
6
|
+
}, /*#__PURE__*/React.createElement("div", {
|
7
|
+
className: "as-actions"
|
8
|
+
}, props.children), props.response && /*#__PURE__*/React.createElement("div", {
|
9
|
+
className: "as-response"
|
10
|
+
}, "Response\uFF1A", props.response));
|
11
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
.as-wrapper {
|
2
|
+
.as-actions {
|
3
|
+
& button {
|
4
|
+
margin-right: 5px;
|
5
|
+
background-color: #fff;
|
6
|
+
border: 2px solid #d4bbbb;
|
7
|
+
border-radius: 6px;
|
8
|
+
outline: none;
|
9
|
+
padding: 8px 20px;
|
10
|
+
cursor: pointer;
|
11
|
+
transition: all 0.15s ease-in-out;
|
12
|
+
&:hover {
|
13
|
+
border: 2px solid #9db8f3;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.as-response {
|
19
|
+
border: 2px dashed #f0bdbd;
|
20
|
+
font-size: 14px;
|
21
|
+
border-radius: 6px;
|
22
|
+
padding: 8px 20px;
|
23
|
+
margin-top: 10px;
|
24
|
+
}
|
25
|
+
}
|
package/es/form/index.d.ts
CHANGED
@@ -31,6 +31,7 @@ declare const formilyReact: {
|
|
31
31
|
displayName: string;
|
32
32
|
};
|
33
33
|
RecursionField: import("react").FC<originalFormilyReact.IRecursionFieldProps>;
|
34
|
+
ExpressionScope: import("react").FC<originalFormilyReact.IExpressionScopeProps>;
|
34
35
|
createSchemaField<Components extends originalFormilyReact.SchemaReactComponents>(options?: originalFormilyReact.ISchemaFieldReactFactoryOptions<Components> | undefined): {
|
35
36
|
<Decorator extends originalFormilyReact.JSXComponent, Component extends originalFormilyReact.JSXComponent>(props: originalFormilyReact.ISchemaFieldProps<Decorator, Component, import("@formily/core").ObjectField<Decorator, Component>>): JSX.Element;
|
36
37
|
displayName: string;
|
package/es/form/typing.d.ts
CHANGED
@@ -14,14 +14,16 @@ export interface ProFormInitializeItem {
|
|
14
14
|
* ProForm 实例类型
|
15
15
|
*/
|
16
16
|
export declare type ProFormType = FormType;
|
17
|
-
declare type IBaseComponent = 'Input' | 'Password' | 'TextArea' | 'NumberPicker' | 'Percent' | 'Money' | 'Select' | 'MultipleSelect' | 'TreeSelect' | 'Cascader' | 'MultipleCascader' | 'ArbitraryCascader' | 'Radio' | 'Checkbox' | 'Switch' | 'DatePicker' | 'TimePicker' | 'DateTimePicker' | 'WeekPicker' | 'MonthPicker' | 'YearPicker' | 'QuarterPicker' | 'DateRangePicker' | 'TimeRangePicker' | 'DateTimeRangePicker' | 'WeekRangePicker' | 'MonthRangePicker' | 'YearRangePicker' | 'QuarterRangePicker' | 'Transfer' | 'Upload' | 'ColorPicker' | 'ColorRadio' | 'IconPicker' | 'JsonInput' | 'TagPicker' | 'MultipleTagPicker' | 'Range' | 'Search' | 'SelectGroup';
|
17
|
+
declare type IBaseComponent = 'Input' | 'Password' | 'TextArea' | 'NumberPicker' | 'Percent' | 'Money' | 'Select' | 'MultipleSelect' | 'TreeSelect' | 'Cascader' | 'MultipleCascader' | 'ArbitraryCascader' | 'Radio' | 'Checkbox' | 'Switch' | 'DatePicker' | 'TimePicker' | 'DateTimePicker' | 'WeekPicker' | 'MonthPicker' | 'YearPicker' | 'QuarterPicker' | 'DateRangePicker' | 'TimeRangePicker' | 'DateTimeRangePicker' | 'WeekRangePicker' | 'MonthRangePicker' | 'YearRangePicker' | 'QuarterRangePicker' | 'Transfer' | 'Upload' | 'ColorPicker' | 'ColorRadio' | 'IconPicker' | 'JsonInput' | 'TagPicker' | 'MultipleTagPicker' | 'Range' | 'Search' | 'SelectGroup' | 'SelectTable' | 'SelectTable.Column';
|
18
18
|
declare type IButtonComponent = 'Submit' | 'Reset';
|
19
19
|
declare type IComboComponent = 'ArrayCards' | 'ArrayCards.Addition' | 'ArrayCards.Remove' | 'ArrayCards.MoveUp' | 'ArrayCards.MoveDown' | 'ArrayCards.Index' | 'ArrayCollapse' | 'ArrayCollapse.CollapsePanel' | 'ArrayCollapse.Addition' | 'ArrayCollapse.Remove' | 'ArrayCollapse.MoveUp' | 'ArrayCollapse.MoveDown' | 'ArrayCollapse.Index' | 'ArrayTable' | 'ArrayTable.Column' | 'ArrayTable.SortHandle' | 'ArrayTable.Addition' | 'ArrayTable.Remove' | 'ArrayTable.MoveDown' | 'ArrayTable.MoveUp' | 'ArrayTable.Index' | 'ArrayItems' | 'ArrayItems.Item' | 'ArrayItems.SortHandle' | 'ArrayItems.Addition' | 'ArrayItems.Remove' | 'ArrayItems.MoveDown' | 'ArrayItems.MoveUp' | 'ArrayItems.Index' | 'Editable' | 'Editable.Popover' | 'Editable.Dialog' | 'Editable.Drawer';
|
20
20
|
declare type ILayoutComponent = 'FormFlex' | 'FormGrid' | 'FormGroup' | 'FormGroup.GroupPanel' | 'Search' | 'Search.SearchPanel' | 'FormTab' | 'FormTab.TabPane' | 'FormStep' | 'FormStep.StepPane' | 'FormCollapse' | 'FormCollapse.CollapsePanel' | 'FormButtonGroup' | 'FormDialog' | 'FormDrawer' | 'FormDialog.Footer' | 'FormDrawer.Footer';
|
21
21
|
export interface ProFormRequestConfig extends CommonRequestConfig {
|
22
22
|
beforeRequest?: (field?: any, context?: any) => any;
|
23
|
+
formatResult?: (res?: any, field?: any, context?: any) => any;
|
23
24
|
onSuccess?: (res?: any, field?: any, context?: any) => any;
|
24
25
|
onComplete?: (res?: any, field?: any, context?: any) => any;
|
26
|
+
extraConfig?: AnyObject;
|
25
27
|
}
|
26
28
|
export interface ProFormSchemaItem {
|
27
29
|
type?: string;
|
@@ -72,6 +74,7 @@ export interface ProFormProps extends IFormLayoutProps {
|
|
72
74
|
export interface FilterProps extends ProFormProps {
|
73
75
|
form: FormType;
|
74
76
|
defaultFilterValue?: string;
|
77
|
+
filterValues?: string[];
|
75
78
|
activeFilterValueRef?: React.MutableRefObject<any>;
|
76
79
|
forceClear?: boolean;
|
77
80
|
onReset?: (payload?: any) => void;
|
@@ -106,6 +109,8 @@ export interface QueryFilterProps extends ProFormProps {
|
|
106
109
|
addonAfter?: ReactNode;
|
107
110
|
/** 顶部筛选区默认筛选项 */
|
108
111
|
defaultFilterValue?: string;
|
112
|
+
/** 顶部筛选区筛选项配置 */
|
113
|
+
filterValues?: string[];
|
109
114
|
/** 透出内部表单实例 */
|
110
115
|
formRef?: React.MutableRefObject<any>;
|
111
116
|
/** onChange事件的防抖时间 */
|
package/es/form/utils.js
CHANGED
@@ -55,6 +55,8 @@ var mapSize = function mapSize(props, field) {
|
|
55
55
|
|
56
56
|
|
57
57
|
var mapStatus = function mapStatus(props, field) {
|
58
|
+
var _field$data;
|
59
|
+
|
58
60
|
var takeStatus = function takeStatus() {
|
59
61
|
var _field$warnings, _field$decoratorProps, _field$decoratorProps2;
|
60
62
|
|
@@ -72,9 +74,16 @@ var mapStatus = function mapStatus(props, field) {
|
|
72
74
|
return state;
|
73
75
|
};
|
74
76
|
|
75
|
-
|
76
|
-
|
77
|
-
|
77
|
+
var state = takeState(props.state) || takeStatus();
|
78
|
+
var result = {
|
79
|
+
state: state
|
80
|
+
}; // 当组件处于loading状态时,仅可读不可写。
|
81
|
+
|
82
|
+
if (state === 'loading' && ((_field$data = field.data) === null || _field$data === void 0 ? void 0 : _field$data.readOnlyOnLoading)) {
|
83
|
+
result.readOnly = true;
|
84
|
+
}
|
85
|
+
|
86
|
+
return _objectSpread(_objectSpread({}, props), result);
|
78
87
|
};
|
79
88
|
|
80
89
|
var patchDataSource = function patchDataSource() {
|
@@ -92,7 +101,7 @@ var patchDataSource = function patchDataSource() {
|
|
92
101
|
return result;
|
93
102
|
};
|
94
103
|
|
95
|
-
return dataSource.map(removeEmptyChildren);
|
104
|
+
return isArr(dataSource) ? dataSource.map(removeEmptyChildren) : [];
|
96
105
|
};
|
97
106
|
|
98
107
|
var mapDataSource = function mapDataSource(props, field) {
|
package/es/index.d.ts
CHANGED
@@ -9,6 +9,7 @@ import ProPageHeader from './page-header';
|
|
9
9
|
import ProTable from './table';
|
10
10
|
import ProSkeleton from './skeleton';
|
11
11
|
import utils from './utils';
|
12
|
+
import ProSidebar from './sidebar';
|
12
13
|
import { ProTimeline } from './timeline';
|
13
14
|
import * as nocode from './nocode';
|
14
15
|
import * as templates from './templates';
|
@@ -22,7 +23,8 @@ export * from './page-container';
|
|
22
23
|
export * from './page-header';
|
23
24
|
export * from './skeleton';
|
24
25
|
export * from './table';
|
26
|
+
export * from './sidebar';
|
25
27
|
export * from './utils';
|
26
28
|
export * from './timeline';
|
27
|
-
declare const version = "1.3.
|
28
|
-
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProTimeline, hooks, nocode, templates, utils, };
|
29
|
+
declare const version = "1.3.5";
|
30
|
+
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils, };
|
package/es/index.js
CHANGED
@@ -9,8 +9,8 @@ import ProPageContainer from './page-container';
|
|
9
9
|
import ProPageHeader from './page-header';
|
10
10
|
import ProTable from './table';
|
11
11
|
import ProSkeleton from './skeleton';
|
12
|
-
import utils from './utils';
|
13
|
-
|
12
|
+
import utils from './utils';
|
13
|
+
import ProSidebar from './sidebar';
|
14
14
|
import { ProTimeline } from './timeline';
|
15
15
|
import * as nocode from './nocode';
|
16
16
|
import * as templates from './templates';
|
@@ -27,10 +27,10 @@ export * from './page-container';
|
|
27
27
|
export * from './page-header';
|
28
28
|
export * from './skeleton';
|
29
29
|
export * from './table';
|
30
|
+
export * from './sidebar';
|
30
31
|
export * from './utils'; // export * from './sidebar';
|
31
32
|
|
32
33
|
export * from './timeline';
|
33
|
-
var version = '1.3.
|
34
|
+
var version = '1.3.5';
|
34
35
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
35
|
-
ProPageContainer, ProPageHeader, ProSkeleton, ProTable,
|
36
|
-
ProTimeline, hooks, nocode, templates, utils };
|
36
|
+
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, ProSidebar, ProTimeline, hooks, nocode, templates, utils };
|
@@ -14,13 +14,17 @@ var ProInfoItem = function ProInfoItem(prop) {
|
|
14
14
|
headerInfoLayout = prop.headerInfoLayout,
|
15
15
|
loading = prop.loading,
|
16
16
|
tooltip = prop.tooltip,
|
17
|
-
tooltipIcon = prop.tooltipIcon
|
17
|
+
tooltipIcon = prop.tooltipIcon,
|
18
|
+
_isLastRow = prop._isLastRow;
|
18
19
|
|
19
20
|
if (baseInfoLayout) {
|
20
21
|
var labelCol = baseInfoLayout.labelCol,
|
21
22
|
wrapperCol = baseInfoLayout.wrapperCol;
|
22
23
|
return /*#__PURE__*/React.createElement("div", {
|
23
|
-
className: cls(
|
24
|
+
className: cls({
|
25
|
+
'': true,
|
26
|
+
isLastRow: _isLastRow
|
27
|
+
})
|
24
28
|
}, /*#__PURE__*/React.createElement(Row, {
|
25
29
|
gutter: 10,
|
26
30
|
className: cls('base-row')
|
@@ -5,7 +5,7 @@ import './index.scss';
|
|
5
5
|
import { getLayout } from '../../utils/utils';
|
6
6
|
import defaultLayoutMap from '../../utils/layout';
|
7
7
|
import InfoValueItem from '../InfoValueItem';
|
8
|
-
import { getDataIndexValue } from '../../utils';
|
8
|
+
import { getDataIndexValue, isLastRow } from '../../utils';
|
9
9
|
var Row = Grid.Row,
|
10
10
|
Col = Grid.Col;
|
11
11
|
|
@@ -65,6 +65,7 @@ var ProBaseInfo = function ProBaseInfo(props) {
|
|
65
65
|
}, /*#__PURE__*/React.createElement(ProInfoItem, {
|
66
66
|
label: (_item$title = item === null || item === void 0 ? void 0 : item.title) !== null && _item$title !== void 0 ? _item$title : '',
|
67
67
|
loading: loading,
|
68
|
+
_isLastRow: !!isLastRow(columns.length, layoutSpan, index),
|
68
69
|
value: /*#__PURE__*/React.createElement(InfoValueItem, {
|
69
70
|
type: (_item$valueType = item === null || item === void 0 ? void 0 : item.valueType) !== null && _item$valueType !== void 0 ? _item$valueType : 'text',
|
70
71
|
value: getDataIndexValue(item.dataIndex, (_ref = dataSource !== null && dataSource !== void 0 ? dataSource : result) !== null && _ref !== void 0 ? _ref : {}),
|
package/es/info/typing.d.ts
CHANGED
@@ -113,6 +113,8 @@ export declare type IProProInfoItem = {
|
|
113
113
|
headerInfoLayout?: ProHeaderInfoLayoutProps;
|
114
114
|
/** loading 状态 */
|
115
115
|
loading?: boolean;
|
116
|
+
/** isLastRow 是否是最后一行的元素 */
|
117
|
+
_isLastRow?: boolean;
|
116
118
|
} & Pick<ProInfoColumnsProps, 'tooltip' | 'tooltipIcon'>;
|
117
119
|
/** header info 定义 */
|
118
120
|
export declare type IProHeaderInfo = {
|
package/es/info/utils/index.d.ts
CHANGED
@@ -10,3 +10,11 @@ export declare const ProInfoGroupContext: React.Context<ProInfoGroupContextProps
|
|
10
10
|
* @returns
|
11
11
|
*/
|
12
12
|
export declare function getDataIndexValue(dataIndex: ProInfoColumnsProps['dataIndex'], dataSource: object): any;
|
13
|
+
/**
|
14
|
+
* 是否是最后一样的元素
|
15
|
+
* @param columnsLength
|
16
|
+
* @param layoutSpan
|
17
|
+
* @params itemIndex
|
18
|
+
* @returns
|
19
|
+
*/
|
20
|
+
export declare const isLastRow: (columnsLength: number, layoutSpan: number, itemIndex: number) => boolean | undefined;
|
package/es/info/utils/index.js
CHANGED
@@ -30,4 +30,31 @@ export function getDataIndexValue(dataIndex, dataSource) {
|
|
30
30
|
}
|
31
31
|
|
32
32
|
return getDeepValue(dataIndex !== null && dataIndex !== void 0 ? dataIndex : '', dataSource);
|
33
|
-
}
|
33
|
+
}
|
34
|
+
/**
|
35
|
+
* 是否是最后一样的元素
|
36
|
+
* @param columnsLength
|
37
|
+
* @param layoutSpan
|
38
|
+
* @params itemIndex
|
39
|
+
* @returns
|
40
|
+
*/
|
41
|
+
|
42
|
+
export var isLastRow = function isLastRow(columnsLength, layoutSpan, itemIndex) {
|
43
|
+
if (!columnsLength || !layoutSpan) return;
|
44
|
+
var lastRowColumnsIndexList = [];
|
45
|
+
var rowCount = 24 / layoutSpan;
|
46
|
+
|
47
|
+
if (columnsLength % rowCount === 0) {
|
48
|
+
while (rowCount--) {
|
49
|
+
lastRowColumnsIndexList.push(columnsLength--);
|
50
|
+
}
|
51
|
+
} else {
|
52
|
+
var lastRowCount = columnsLength % rowCount;
|
53
|
+
|
54
|
+
while (lastRowCount--) {
|
55
|
+
lastRowColumnsIndexList.push(columnsLength--);
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
return lastRowColumnsIndexList.includes(itemIndex + 1);
|
60
|
+
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ItemProps } from '@alicloudfe/components/types/breadcrumb';
|
3
|
-
import { LinkPath, ProTagItem } from '@teamix/utils';
|
3
|
+
import { LinkPath, ProTagItem, CapsuleTabType } from '@teamix/utils';
|
4
4
|
import { ProActionGroupProps } from '../actions';
|
5
5
|
import { ProInfoProps } from '../info';
|
6
6
|
import './index.scss';
|
@@ -48,6 +48,8 @@ export declare type ProPageHeaderProps = {
|
|
48
48
|
data?: ProPageHeaderDataItem[];
|
49
49
|
/** 底部详情 */
|
50
50
|
info?: ProInfoProps | React.ReactNode;
|
51
|
+
/** 切换 tabs */
|
52
|
+
tabs?: CapsuleTabType;
|
51
53
|
} & Omit<React.HTMLAttributes<HTMLElement>, 'title'>;
|
52
54
|
declare const ProPageHeader: React.FC<ProPageHeaderProps>;
|
53
55
|
export default ProPageHeader;
|
package/es/page-header/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
var _excluded = ["text", "children"],
|
2
2
|
_excluded2 = ["color", "title", "num", "className"],
|
3
|
-
_excluded3 = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style"];
|
3
|
+
_excluded3 = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style", "tabs"];
|
4
4
|
|
5
5
|
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; }
|
6
6
|
|
@@ -17,7 +17,7 @@ import { useHistory } from 'react-router-dom';
|
|
17
17
|
import classnames from 'classnames';
|
18
18
|
import TeamixIcon from '@teamix/icon';
|
19
19
|
import { Breadcrumb } from '@alicloudfe/components';
|
20
|
-
import { baseClass, goToLink, renderTags, isPresetColor, getColor, getColorClassName, getBackgroundColorClassName } from '@teamix/utils';
|
20
|
+
import { baseClass, goToLink, renderTags, isPresetColor, getColor, getColorClassName, getBackgroundColorClassName, CapsuleTab } from '@teamix/utils';
|
21
21
|
import { ProActionGroup } from '../actions';
|
22
22
|
import { ProSkeletonRaw } from '../skeleton';
|
23
23
|
import ProInfo from '../info';
|
@@ -123,6 +123,14 @@ var renderInfo = function renderInfo(info) {
|
|
123
123
|
return info;
|
124
124
|
};
|
125
125
|
|
126
|
+
var renderTabs = function renderTabs(tabs) {
|
127
|
+
if (tabs) {
|
128
|
+
return /*#__PURE__*/React.createElement(CapsuleTab, _objectSpread({}, tabs));
|
129
|
+
}
|
130
|
+
|
131
|
+
return null;
|
132
|
+
};
|
133
|
+
|
126
134
|
var ProPageHeader = function ProPageHeader(props) {
|
127
135
|
var title = props.title,
|
128
136
|
description = props.description,
|
@@ -143,6 +151,7 @@ var ProPageHeader = function ProPageHeader(props) {
|
|
143
151
|
children = props.children,
|
144
152
|
className = props.className,
|
145
153
|
style = props.style,
|
154
|
+
tabs = props.tabs,
|
146
155
|
others = _objectWithoutProperties(props, _excluded3);
|
147
156
|
|
148
157
|
var history = useHistory();
|
@@ -191,7 +200,7 @@ var ProPageHeader = function ProPageHeader(props) {
|
|
191
200
|
size: "large"
|
192
201
|
}) : /*#__PURE__*/React.createElement(React.Fragment, null, icon)), /*#__PURE__*/React.createElement("span", {
|
193
202
|
className: cls('title-name')
|
194
|
-
}, title), renderTags(tags, 'large'));
|
203
|
+
}, title), renderTags(tags, 'large'), renderTabs(tabs !== null && tabs !== void 0 ? tabs : {}));
|
195
204
|
};
|
196
205
|
|
197
206
|
return /*#__PURE__*/React.createElement("header", _objectSpread({
|
@@ -1,4 +1,12 @@
|
|
1
|
-
var _excluded = ["children", "searchPlaceholder", "showSearch", "searchProps", "customSearch", "searchOnChange", "message", "messageProps", "customMessage"];
|
1
|
+
var _excluded = ["children", "searchPlaceholder", "showSearch", "searchProps", "customSearch", "searchOnChange", "message", "messageProps", "customMessage", "scrollArea", "showExpandAll", "showExpandLevel", "onExpandAllChange", "onExpandLevelChange", "expandLevel", "isTree"];
|
2
|
+
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
4
|
+
|
5
|
+
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."); }
|
6
|
+
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
8
|
+
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
2
10
|
|
3
11
|
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
12
|
|
@@ -6,16 +14,29 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
6
14
|
|
7
15
|
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
16
|
|
17
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
18
|
+
|
19
|
+
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."); }
|
20
|
+
|
21
|
+
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); }
|
22
|
+
|
23
|
+
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; }
|
24
|
+
|
25
|
+
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; }
|
26
|
+
|
27
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
28
|
+
|
9
29
|
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
30
|
|
11
31
|
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
32
|
|
13
|
-
import { Message } from '@alicloudfe/components';
|
33
|
+
import { Button, MenuButton, Message } from '@alicloudfe/components';
|
14
34
|
import { ProCard } from '../../../card';
|
15
35
|
import ProField from '@teamix/pro-field';
|
16
36
|
import { baseClass } from '@teamix/utils';
|
17
|
-
import React from 'react';
|
37
|
+
import React, { useEffect, useRef, useState } from 'react';
|
18
38
|
import './index.scss';
|
39
|
+
import TeamixIcon from '@teamix/icon';
|
19
40
|
var cls = baseClass('teamix-pro-sidebar-container');
|
20
41
|
|
21
42
|
var ProSidebarContainer = function ProSidebarContainer(props) {
|
@@ -31,8 +52,47 @@ var ProSidebarContainer = function ProSidebarContainer(props) {
|
|
31
52
|
_props$messageProps = props.messageProps,
|
32
53
|
messageProps = _props$messageProps === void 0 ? {} : _props$messageProps,
|
33
54
|
customMessage = props.customMessage,
|
34
|
-
|
55
|
+
scrollArea = props.scrollArea,
|
56
|
+
showExpandAll = props.showExpandAll,
|
57
|
+
showExpandLevel = props.showExpandLevel,
|
58
|
+
onExpandAllChange = props.onExpandAllChange,
|
59
|
+
onExpandLevelChange = props.onExpandLevelChange,
|
60
|
+
_props$expandLevel = props.expandLevel,
|
61
|
+
expandLevel = _props$expandLevel === void 0 ? 1 : _props$expandLevel,
|
62
|
+
isTree = props.isTree,
|
63
|
+
others = _objectWithoutProperties(props, _excluded);
|
64
|
+
|
65
|
+
var ref = useRef();
|
66
|
+
|
67
|
+
var _useState = useState('auto'),
|
68
|
+
_useState2 = _slicedToArray(_useState, 2),
|
69
|
+
treeHeight = _useState2[0],
|
70
|
+
setTreeHeight = _useState2[1]; // 展开全部状态
|
71
|
+
|
35
72
|
|
73
|
+
var _useState3 = useState(false),
|
74
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
75
|
+
expandAllState = _useState4[0],
|
76
|
+
setExpandAllState = _useState4[1]; // 展开层级状态
|
77
|
+
|
78
|
+
|
79
|
+
var _useState5 = useState(1),
|
80
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
81
|
+
expandLevelState = _useState6[0],
|
82
|
+
setExpandLevelState = _useState6[1];
|
83
|
+
|
84
|
+
useEffect(function () {
|
85
|
+
// 设置滚动区域
|
86
|
+
if (scrollArea === 'tree') {
|
87
|
+
var _ref$current$offsetTo, _ref$current;
|
88
|
+
|
89
|
+
var remainHeight = (_ref$current$offsetTo = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.offsetTop) !== null && _ref$current$offsetTo !== void 0 ? _ref$current$offsetTo : 0 + 40;
|
90
|
+
|
91
|
+
if (remainHeight > 0) {
|
92
|
+
setTreeHeight("calc(100% - ".concat(remainHeight, "px + 16px)"));
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}, []); // 渲染搜索区域
|
36
96
|
|
37
97
|
var renderSearch = function renderSearch() {
|
38
98
|
if (customSearch || showSearch) {
|
@@ -55,22 +115,67 @@ var ProSidebarContainer = function ProSidebarContainer(props) {
|
|
55
115
|
if (message || customMessage) {
|
56
116
|
return /*#__PURE__*/React.createElement("div", {
|
57
117
|
className: cls('notice')
|
58
|
-
}, message && /*#__PURE__*/React.createElement(Message, _objectSpread({
|
118
|
+
}, message && /*#__PURE__*/React.createElement(Message, _objectSpread(_objectSpread({
|
59
119
|
type: "notice",
|
60
120
|
closeable: true
|
61
|
-
}, messageProps),
|
121
|
+
}, messageProps), {}, {
|
122
|
+
onClose: function onClose() {
|
123
|
+
var _ref$current$offsetTo2, _ref$current2;
|
124
|
+
|
125
|
+
var remainHeight = (_ref$current$offsetTo2 = ref === null || ref === void 0 ? void 0 : (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.offsetTop) !== null && _ref$current$offsetTo2 !== void 0 ? _ref$current$offsetTo2 : 0 + 40;
|
126
|
+
setTreeHeight("calc(100% - ".concat(remainHeight, "px + 56px)"));
|
127
|
+
}
|
128
|
+
}), message), !!customMessage && customMessage);
|
62
129
|
}
|
63
130
|
|
64
131
|
return null;
|
132
|
+
}; // 渲染折叠区
|
133
|
+
|
134
|
+
|
135
|
+
var renderFold = function renderFold() {
|
136
|
+
if (showExpandAll || showExpandLevel) {
|
137
|
+
return /*#__PURE__*/React.createElement("div", {
|
138
|
+
className: cls('fold')
|
139
|
+
}, showExpandAll && /*#__PURE__*/React.createElement(Button, {
|
140
|
+
type: "primary",
|
141
|
+
text: true,
|
142
|
+
onClick: function onClick() {
|
143
|
+
var visible = !expandAllState;
|
144
|
+
setExpandAllState(visible);
|
145
|
+
onExpandAllChange === null || onExpandAllChange === void 0 ? void 0 : onExpandAllChange(visible);
|
146
|
+
}
|
147
|
+
}, /*#__PURE__*/React.createElement(TeamixIcon, {
|
148
|
+
type: expandAllState ? 'menu-unfold-line' : 'menu-fold-line'
|
149
|
+
}), expandAllState ? '全部收起' : '全部展开'), showExpandLevel && /*#__PURE__*/React.createElement(MenuButton, {
|
150
|
+
text: true,
|
151
|
+
type: "secondary",
|
152
|
+
label: "\u5C55\u793A".concat(expandLevelState, "\u7EA7"),
|
153
|
+
onItemClick: function onItemClick(key) {
|
154
|
+
setExpandLevelState(key);
|
155
|
+
onExpandLevelChange === null || onExpandLevelChange === void 0 ? void 0 : onExpandLevelChange(key);
|
156
|
+
}
|
157
|
+
}, _toConsumableArray(new Array(expandLevel)).fill(1).map(function (item, index) {
|
158
|
+
return /*#__PURE__*/React.createElement(MenuButton.Item, {
|
159
|
+
key: index + 1
|
160
|
+
}, "\u5C55\u793A", index + 1, "\u7EA7");
|
161
|
+
})));
|
162
|
+
}
|
65
163
|
};
|
66
164
|
|
67
165
|
return /*#__PURE__*/React.createElement("div", {
|
68
|
-
className: cls(
|
166
|
+
className: cls({
|
167
|
+
'': true,
|
168
|
+
'not-is-tree': !isTree
|
169
|
+
})
|
69
170
|
}, /*#__PURE__*/React.createElement(ProCard, _objectSpread({
|
70
171
|
bordered: false,
|
71
172
|
compacted: true
|
72
|
-
}, others), renderSearch(), renderNotice(), /*#__PURE__*/React.createElement("div", {
|
73
|
-
className: cls('context')
|
173
|
+
}, others), renderSearch(), renderNotice(), renderFold(), /*#__PURE__*/React.createElement("div", {
|
174
|
+
className: cls('context'),
|
175
|
+
ref: ref,
|
176
|
+
style: {
|
177
|
+
height: treeHeight
|
178
|
+
}
|
74
179
|
}, children)));
|
75
180
|
};
|
76
181
|
|
@@ -1,18 +1,66 @@
|
|
1
1
|
.teamix-pro-sidebar-container {
|
2
2
|
min-width: 180px;
|
3
|
+
.teamix-pro-card.compacted >.next-card-header{
|
4
|
+
padding: 16px 0px;
|
5
|
+
margin: 0;
|
6
|
+
|
7
|
+
}
|
8
|
+
|
9
|
+
.next-card .next-card-header-extra{
|
10
|
+
margin-top: 2px;
|
11
|
+
}
|
3
12
|
|
4
13
|
&-search {
|
5
|
-
margin-bottom:
|
14
|
+
margin-bottom: var(--s-2);
|
6
15
|
}
|
7
16
|
|
8
17
|
&-search-has-message {
|
9
|
-
margin-bottom:
|
18
|
+
margin-bottom: var(--s-1);
|
10
19
|
}
|
11
20
|
|
12
21
|
&-notice {
|
13
|
-
margin-bottom:
|
22
|
+
margin-bottom: var(--s-1);
|
23
|
+
}
|
24
|
+
|
25
|
+
&-fold {
|
26
|
+
margin-bottom: var(--s-1);
|
27
|
+
}
|
28
|
+
|
29
|
+
|
30
|
+
&.teamix-pro-sidebar-container &-context{
|
31
|
+
overflow-y: hidden;
|
32
|
+
|
33
|
+
&:hover{
|
34
|
+
overflow-y: auto;
|
35
|
+
}
|
14
36
|
}
|
15
37
|
|
16
|
-
|
38
|
+
|
39
|
+
&-not-is-tree{
|
40
|
+
|
41
|
+
.teamix-pro-card.compacted >.next-card-header{
|
42
|
+
padding: 16px 8px;
|
43
|
+
margin: 0;
|
44
|
+
}
|
45
|
+
.teamix-pro-sidebar-container-context{
|
46
|
+
padding: 0;
|
47
|
+
}
|
48
|
+
|
49
|
+
.teamix-pro-sidebar-container-search{
|
50
|
+
padding: 0 8px;
|
51
|
+
}
|
52
|
+
|
53
|
+
.teamix-pro-sidebar-container-search-has-message{
|
54
|
+
padding: 0 8px;
|
55
|
+
}
|
56
|
+
|
57
|
+
.teamix-pro-sidebar-container-notice{
|
58
|
+
padding: 0 8px;
|
59
|
+
}
|
60
|
+
|
61
|
+
.teamix-pro-sidebar-container-fold{
|
62
|
+
padding: 0 8px;
|
63
|
+
}
|
64
|
+
|
17
65
|
}
|
18
|
-
}
|
66
|
+
}
|