@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.
Files changed (142) hide show
  1. package/README.md +97 -0
  2. package/dist/212.js +2 -2
  3. package/dist/pro.css +1 -1
  4. package/dist/pro.js +3147 -1872
  5. package/dist/pro.min.css +1 -1
  6. package/dist/pro.min.js +1 -1
  7. package/dist/pro.min.js.LICENSE.txt +1 -1
  8. package/es/actions/dialog-form.d.ts +3 -3
  9. package/es/actions/dialog-table.d.ts +6 -1
  10. package/es/actions/dialog-table.js +10 -1
  11. package/es/actions/drawer-table.d.ts +4 -0
  12. package/es/actions/drawer-table.js +7 -1
  13. package/es/actions/index.d.ts +6 -11
  14. package/es/actions/index.js +41 -21
  15. package/es/actions/index.scss +1 -1
  16. package/es/card/index.d.ts +17 -0
  17. package/es/form/Components/ProField/index.d.ts +8 -0
  18. package/es/form/ProForm/index.d.ts +2 -2
  19. package/es/form/ProForm/index.js +9 -2
  20. package/es/form/ProForm/index.scss +40 -7
  21. package/es/form/SchemaForm/adapterType.js +3 -3
  22. package/es/form/SchemaForm/index.d.ts +2 -2
  23. package/es/form/SchemaForm/index.js +9 -5
  24. package/es/form/SchemaForm/initializeArrayCards.js +10 -55
  25. package/es/form/SchemaForm/initializeArrayCollapse.js +10 -64
  26. package/es/form/SchemaForm/initializeArrayIcon.js +19 -7
  27. package/es/form/SchemaForm/initializeArrayItems.js +16 -75
  28. package/es/form/SchemaForm/initializeArrayTable.js +23 -33
  29. package/es/form/SchemaForm/initializeFormButton.js +35 -38
  30. package/es/form/SchemaForm/initializeFormGroup.d.ts +2 -2
  31. package/es/form/SchemaForm/initializeFormStep.d.ts +4 -2
  32. package/es/form/SchemaForm/initializeFormStep.js +21 -7
  33. package/es/form/SchemaForm/initializeFormTab.d.ts +2 -2
  34. package/es/form/SchemaForm/initializeProField.js +3 -3
  35. package/es/form/SchemaForm/reactions.d.ts +1 -1
  36. package/es/form/SchemaForm/reactions.js +2 -2
  37. package/es/form/index.d.ts +17 -9
  38. package/es/form/index.js +21 -9
  39. package/es/form/typing.d.ts +13 -22
  40. package/es/form/warning.js +2 -6
  41. package/es/index.d.ts +4 -3
  42. package/es/index.js +4 -3
  43. package/es/info/components/FormItem/index.js +4 -4
  44. package/es/info/components/FormItem/index.scss +11 -0
  45. package/es/info/components/InfoGroup/index.js +37 -6
  46. package/es/info/components/InfoGroup/index.scss +6 -0
  47. package/es/info/components/InfoValueItem/index.js +14 -2
  48. package/es/info/components/baseInfo/index.js +10 -9
  49. package/es/info/components/headerInfo/index.js +10 -9
  50. package/es/info/components/tableInfo/index.js +7 -4
  51. package/es/info/components/tableInfo/index.scss +1 -1
  52. package/es/info/index.d.ts +1 -0
  53. package/es/info/index.js +9 -7
  54. package/es/info/index.scss +4 -0
  55. package/es/info/typing.d.ts +17 -3
  56. package/es/info/utils/index.d.ts +11 -2
  57. package/es/info/utils/index.js +21 -0
  58. package/es/nocode/configurators/PageHeader.js +49 -43
  59. package/es/nocode/configurators/ProTable.js +12 -9
  60. package/es/nocode/configurators/common.d.ts +117 -105
  61. package/es/nocode/configurators/common.js +38 -34
  62. package/es/nocode/index.scss +1 -4
  63. package/es/page-header/index.d.ts +3 -0
  64. package/es/page-header/index.js +40 -13
  65. package/es/page-header/index.scss +6 -4
  66. package/es/table/components/Filter/index.js +8 -16
  67. package/es/table/components/Layout/index.js +2 -1
  68. package/es/table/components/Layout/index.scss +1 -1
  69. package/es/table/components/ToolBar/FilterColumnIcon.js +77 -17
  70. package/es/table/components/ToolBar/index.scss +10 -0
  71. package/es/table/index.d.ts +0 -1
  72. package/es/table/index.js +75 -56
  73. package/es/table/index.scss +0 -1
  74. package/es/table/typing.d.ts +3 -1
  75. package/lib/actions/dialog-form.d.ts +3 -3
  76. package/lib/actions/dialog-table.d.ts +6 -1
  77. package/lib/actions/dialog-table.js +20 -1
  78. package/lib/actions/drawer-table.d.ts +4 -0
  79. package/lib/actions/drawer-table.js +14 -1
  80. package/lib/actions/index.d.ts +6 -11
  81. package/lib/actions/index.js +44 -20
  82. package/lib/actions/index.scss +1 -1
  83. package/lib/card/index.d.ts +17 -0
  84. package/lib/form/Components/ProField/index.d.ts +8 -0
  85. package/lib/form/ProForm/index.d.ts +2 -2
  86. package/lib/form/ProForm/index.js +10 -2
  87. package/lib/form/ProForm/index.scss +40 -7
  88. package/lib/form/SchemaForm/adapterType.js +3 -3
  89. package/lib/form/SchemaForm/index.d.ts +2 -2
  90. package/lib/form/SchemaForm/index.js +10 -5
  91. package/lib/form/SchemaForm/initializeArrayCards.js +10 -54
  92. package/lib/form/SchemaForm/initializeArrayCollapse.js +10 -63
  93. package/lib/form/SchemaForm/initializeArrayIcon.js +19 -7
  94. package/lib/form/SchemaForm/initializeArrayItems.js +16 -74
  95. package/lib/form/SchemaForm/initializeArrayTable.js +23 -33
  96. package/lib/form/SchemaForm/initializeFormButton.js +35 -38
  97. package/lib/form/SchemaForm/initializeFormGroup.d.ts +2 -2
  98. package/lib/form/SchemaForm/initializeFormStep.d.ts +4 -2
  99. package/lib/form/SchemaForm/initializeFormStep.js +21 -7
  100. package/lib/form/SchemaForm/initializeFormTab.d.ts +2 -2
  101. package/lib/form/SchemaForm/initializeProField.js +3 -3
  102. package/lib/form/SchemaForm/reactions.d.ts +1 -1
  103. package/lib/form/SchemaForm/reactions.js +2 -2
  104. package/lib/form/index.d.ts +17 -9
  105. package/lib/form/index.js +81 -56
  106. package/lib/form/typing.d.ts +13 -22
  107. package/lib/form/warning.js +2 -6
  108. package/lib/index.d.ts +4 -3
  109. package/lib/index.js +16 -4
  110. package/lib/info/components/FormItem/index.js +4 -4
  111. package/lib/info/components/FormItem/index.scss +11 -0
  112. package/lib/info/components/InfoGroup/index.js +46 -6
  113. package/lib/info/components/InfoGroup/index.scss +6 -0
  114. package/lib/info/components/InfoValueItem/index.js +15 -3
  115. package/lib/info/components/baseInfo/index.js +10 -9
  116. package/lib/info/components/headerInfo/index.js +11 -10
  117. package/lib/info/components/tableInfo/index.js +7 -3
  118. package/lib/info/components/tableInfo/index.scss +1 -1
  119. package/lib/info/index.d.ts +1 -0
  120. package/lib/info/index.js +8 -6
  121. package/lib/info/index.scss +4 -0
  122. package/lib/info/typing.d.ts +17 -3
  123. package/lib/info/utils/index.d.ts +11 -2
  124. package/lib/info/utils/index.js +31 -0
  125. package/lib/nocode/configurators/PageHeader.js +49 -43
  126. package/lib/nocode/configurators/ProTable.js +12 -9
  127. package/lib/nocode/configurators/common.d.ts +117 -105
  128. package/lib/nocode/configurators/common.js +38 -34
  129. package/lib/nocode/index.scss +1 -4
  130. package/lib/page-header/index.d.ts +3 -0
  131. package/lib/page-header/index.js +42 -13
  132. package/lib/page-header/index.scss +6 -4
  133. package/lib/table/components/Filter/index.js +7 -15
  134. package/lib/table/components/Layout/index.js +2 -1
  135. package/lib/table/components/Layout/index.scss +1 -1
  136. package/lib/table/components/ToolBar/FilterColumnIcon.js +75 -16
  137. package/lib/table/components/ToolBar/index.scss +10 -0
  138. package/lib/table/index.d.ts +0 -1
  139. package/lib/table/index.js +76 -65
  140. package/lib/table/index.scss +0 -1
  141. package/lib/table/typing.d.ts +3 -1
  142. package/package.json +5 -5
@@ -4,9 +4,30 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  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; }
6
6
 
7
+ import { getDeepValue } from '@teamix/utils';
8
+ import React from 'react';
7
9
  export function useActionType(ref, action) {
8
10
  // 合并自定义事件
9
11
  var userAction = _objectSpread({}, action);
10
12
 
11
13
  ref.current = userAction;
14
+ }
15
+ /** ProInfoGroupContext */
16
+
17
+ export var ProInfoGroupContext = /*#__PURE__*/React.createContext({});
18
+ /**
19
+ * 获取 dataIndex 值
20
+ * @param dataIndex
21
+ * @param dataSource
22
+ * @returns
23
+ */
24
+
25
+ export function getDataIndexValue(dataIndex, dataSource) {
26
+ if (Array.isArray(dataIndex)) {
27
+ return dataIndex.map(function (item) {
28
+ return getDeepValue(item !== null && item !== void 0 ? item : '', dataSource);
29
+ });
30
+ }
31
+
32
+ return getDeepValue(dataIndex !== null && dataIndex !== void 0 ? dataIndex : '', dataSource);
12
33
  }
@@ -103,34 +103,37 @@ var schema = [{
103
103
  children: [{
104
104
  name: 'tags',
105
105
  component: 'ArrayTable',
106
- items: [{
107
- name: 'text',
108
- title: '名称',
109
- component: 'Input'
110
- }, {
111
- name: 'type',
112
- title: '类型',
113
- component: 'Select',
114
- dataSource: [{
115
- label: '普通',
116
- value: 'normal'
106
+ items: {
107
+ type: 'object',
108
+ children: [{
109
+ name: 'text',
110
+ title: '名称',
111
+ component: 'Input'
112
+ }, {
113
+ name: 'type',
114
+ title: '类型',
115
+ component: 'Select',
116
+ dataSource: [{
117
+ label: '普通',
118
+ value: 'normal'
119
+ }, {
120
+ label: '主要',
121
+ value: 'primary'
122
+ }]
123
+ }, {
124
+ name: 'color',
125
+ title: '颜色',
126
+ component: 'Input'
117
127
  }, {
118
- label: '主要',
119
- value: 'primary'
128
+ title: '操作',
129
+ component: 'ArrayTable.Remove',
130
+ decoratorProps: {
131
+ fixed: 'right',
132
+ width: 40
133
+ },
134
+ formItem: null
120
135
  }]
121
- }, {
122
- name: 'color',
123
- title: '颜色',
124
- component: 'Input'
125
- }, {
126
- title: '操作',
127
- component: 'ArrayTable.Remove',
128
- decoratorProps: {
129
- fixed: 'right',
130
- width: 40
131
- },
132
- formItem: null
133
- }],
136
+ },
134
137
  children: [{
135
138
  title: '添加标签'
136
139
  }]
@@ -146,23 +149,26 @@ var schema = [{
146
149
  children: [{
147
150
  name: 'breadcrumb',
148
151
  component: 'ArrayTable',
149
- items: [{
150
- name: 'text',
151
- title: '名称',
152
- component: 'Input'
153
- }, {
154
- name: 'link',
155
- title: '链接',
156
- component: 'Input'
157
- }, {
158
- title: '操作',
159
- component: 'ArrayTable.Remove',
160
- decoratorProps: {
161
- fixed: 'right',
162
- width: 40
163
- },
164
- formItem: null
165
- }],
152
+ items: {
153
+ type: 'object',
154
+ children: [{
155
+ name: 'text',
156
+ title: '名称',
157
+ component: 'Input'
158
+ }, {
159
+ name: 'link',
160
+ title: '链接',
161
+ component: 'Input'
162
+ }, {
163
+ title: '操作',
164
+ component: 'ArrayTable.Remove',
165
+ decoratorProps: {
166
+ fixed: 'right',
167
+ width: 40
168
+ },
169
+ formItem: null
170
+ }]
171
+ },
166
172
  children: [{
167
173
  title: '添加面包屑'
168
174
  }]
@@ -133,16 +133,19 @@ var schema = [{
133
133
  name: 'pageSizeList',
134
134
  title: '分页大小列表',
135
135
  component: 'ArrayItems',
136
- props: {
137
- itemType: 'string'
136
+ items: {
137
+ component: 'FormFlex',
138
+ children: [{
139
+ component: 'ArrayItems.SortHandle'
140
+ }, {
141
+ component: 'NumberPicker',
142
+ decoratorProps: {
143
+ feedbackLayout: 'none'
144
+ }
145
+ }, {
146
+ component: 'ArrayItems.Remove'
147
+ }]
138
148
  },
139
- items: [{
140
- component: 'ArrayItems.SortHandle'
141
- }, {
142
- component: 'NumberPicker'
143
- }, {
144
- component: 'ArrayItems.Remove'
145
- }],
146
149
  children: [{
147
150
  title: '添加一条'
148
151
  }],
@@ -4,53 +4,57 @@ export declare function array(title: string, name: string, fields: any[], main?:
4
4
  name: string;
5
5
  title: string | undefined;
6
6
  component: string;
7
- props: {
8
- itemType: string;
9
- };
10
- items: ({
11
- component: string;
12
- children: {
13
- component: string;
14
- }[];
15
- name?: undefined;
16
- type?: undefined;
17
- title?: undefined;
18
- reactions?: undefined;
19
- } | {
20
- name: string;
21
- component: string;
7
+ items: {
22
8
  type: string;
23
- title: string;
24
- reactions: {
25
- dependencies: string[];
26
- fulfill: {
27
- schema: {
28
- title: string;
29
- };
30
- };
31
- };
32
- children: {
9
+ decorator: string;
10
+ children: ({
11
+ component: string;
12
+ children: {
13
+ component: string;
14
+ }[];
15
+ name?: undefined;
16
+ type?: undefined;
17
+ title?: undefined;
18
+ reactions?: undefined;
19
+ } | {
33
20
  name: string;
34
21
  component: string;
35
- props: {
36
- layout: string;
37
- labelAlign: string;
38
- colon: boolean;
39
- labelCol: number;
40
- wrapperCol: number;
22
+ type: string;
23
+ title: string;
24
+ reactions: {
25
+ dependencies: string[];
26
+ fulfill: {
27
+ schema: {
28
+ title: string;
29
+ };
30
+ };
41
31
  };
42
- children: any[];
43
- }[];
44
- } | {
45
- component: string;
46
- children?: undefined;
47
- name?: undefined;
48
- type?: undefined;
49
- title?: undefined;
50
- reactions?: undefined;
51
- })[];
32
+ children: {
33
+ name: string;
34
+ component: string;
35
+ props: {
36
+ layout: string;
37
+ labelAlign: string;
38
+ colon: boolean;
39
+ labelCol: number;
40
+ wrapperCol: number;
41
+ };
42
+ children: any[];
43
+ }[];
44
+ } | {
45
+ component: string;
46
+ children?: undefined;
47
+ name?: undefined;
48
+ type?: undefined;
49
+ title?: undefined;
50
+ reactions?: undefined;
51
+ })[];
52
+ };
52
53
  children: {
53
- title: string;
54
+ component: string;
55
+ props: {
56
+ title: string;
57
+ };
54
58
  }[];
55
59
  }[];
56
60
  };
@@ -64,69 +68,10 @@ export declare function actions(props?: {
64
68
  name: string;
65
69
  title: string | undefined;
66
70
  component: string;
67
- props: {
68
- itemType: string;
69
- };
70
- items: ({
71
- component: string;
72
- children: {
73
- component: string;
74
- }[];
75
- name?: undefined;
76
- type?: undefined;
77
- title?: undefined;
78
- reactions?: undefined;
79
- } | {
80
- name: string;
81
- component: string;
71
+ items: {
82
72
  type: string;
83
- title: string;
84
- reactions: {
85
- dependencies: string[];
86
- fulfill: {
87
- schema: {
88
- title: string;
89
- };
90
- };
91
- };
92
- children: {
93
- name: string;
94
- component: string;
95
- props: {
96
- layout: string;
97
- labelAlign: string;
98
- colon: boolean;
99
- labelCol: number;
100
- wrapperCol: number;
101
- };
102
- children: any[];
103
- }[];
104
- } | {
105
- component: string;
106
- children?: undefined;
107
- name?: undefined;
108
- type?: undefined;
109
- title?: undefined;
110
- reactions?: undefined;
111
- })[];
112
- children: {
113
- title: string;
114
- }[];
115
- }[];
116
- };
117
- export declare function filter(name: string): {
118
- name: string;
119
- type: string;
120
- children: {
121
- title: string;
122
- children: {
123
- name: string;
124
- title: string | undefined;
125
- component: string;
126
- props: {
127
- itemType: string;
128
- };
129
- items: ({
73
+ decorator: string;
74
+ children: ({
130
75
  component: string;
131
76
  children: {
132
77
  component: string;
@@ -168,8 +113,75 @@ export declare function filter(name: string): {
168
113
  title?: undefined;
169
114
  reactions?: undefined;
170
115
  })[];
171
- children: {
116
+ };
117
+ children: {
118
+ component: string;
119
+ props: {
172
120
  title: string;
121
+ };
122
+ }[];
123
+ }[];
124
+ };
125
+ export declare function filter(name: string): {
126
+ name: string;
127
+ type: string;
128
+ children: {
129
+ title: string;
130
+ children: {
131
+ name: string;
132
+ title: string | undefined;
133
+ component: string;
134
+ items: {
135
+ type: string;
136
+ decorator: string;
137
+ children: ({
138
+ component: string;
139
+ children: {
140
+ component: string;
141
+ }[];
142
+ name?: undefined;
143
+ type?: undefined;
144
+ title?: undefined;
145
+ reactions?: undefined;
146
+ } | {
147
+ name: string;
148
+ component: string;
149
+ type: string;
150
+ title: string;
151
+ reactions: {
152
+ dependencies: string[];
153
+ fulfill: {
154
+ schema: {
155
+ title: string;
156
+ };
157
+ };
158
+ };
159
+ children: {
160
+ name: string;
161
+ component: string;
162
+ props: {
163
+ layout: string;
164
+ labelAlign: string;
165
+ colon: boolean;
166
+ labelCol: number;
167
+ wrapperCol: number;
168
+ };
169
+ children: any[];
170
+ }[];
171
+ } | {
172
+ component: string;
173
+ children?: undefined;
174
+ name?: undefined;
175
+ type?: undefined;
176
+ title?: undefined;
177
+ reactions?: undefined;
178
+ })[];
179
+ };
180
+ children: {
181
+ component: string;
182
+ props: {
183
+ title: string;
184
+ };
173
185
  }[];
174
186
  }[];
175
187
  }[];
@@ -5,46 +5,50 @@ export function array(title, name, fields, main, arrayTitle) {
5
5
  name: name,
6
6
  title: arrayTitle,
7
7
  component: 'ArrayItems',
8
- props: {
9
- itemType: 'card'
10
- },
11
- items: [{
12
- component: 'FormFlex',
8
+ items: {
9
+ type: 'object',
10
+ decorator: 'ArrayItems.Item',
13
11
  children: [{
14
- component: 'ArrayItems.SortHandle'
12
+ component: 'FormFlex',
13
+ children: [{
14
+ component: 'ArrayItems.SortHandle'
15
+ }, {
16
+ component: 'ArrayItems.Index'
17
+ }]
15
18
  }, {
16
- component: 'ArrayItems.Index'
17
- }]
18
- }, {
19
- name: 'drawer',
20
- component: 'Editable.Drawer',
21
- type: 'void',
22
- title: '编辑详情',
23
- reactions: {
24
- dependencies: [".drawer.layout.".concat(main ? main : fields[0].name)],
25
- fulfill: {
26
- schema: {
27
- title: '{{$deps[0]}}'
19
+ name: 'drawer',
20
+ component: 'Editable.Drawer',
21
+ type: 'void',
22
+ title: '编辑详情',
23
+ reactions: {
24
+ dependencies: [".drawer.layout.".concat(main ? main : fields[0].name)],
25
+ fulfill: {
26
+ schema: {
27
+ title: '{{$deps[0]}}'
28
+ }
28
29
  }
29
- }
30
- },
31
- children: [{
32
- name: 'layout',
33
- component: 'FormLayout',
34
- props: {
35
- layout: 'vertical',
36
- labelAlign: 'left',
37
- colon: false,
38
- labelCol: 24,
39
- wrapperCol: 24
40
30
  },
41
- children: fields
31
+ children: [{
32
+ name: 'layout',
33
+ component: 'FormLayout',
34
+ props: {
35
+ layout: 'vertical',
36
+ labelAlign: 'left',
37
+ colon: false,
38
+ labelCol: 24,
39
+ wrapperCol: 24
40
+ },
41
+ children: fields
42
+ }]
43
+ }, {
44
+ component: 'ArrayItems.Remove'
42
45
  }]
43
- }, {
44
- component: 'ArrayItems.Remove'
45
- }],
46
+ },
46
47
  children: [{
47
- title: '添加一条'
48
+ component: 'ArrayItems.Addition',
49
+ props: {
50
+ title: '添加一条'
51
+ }
48
52
  }]
49
53
  }]
50
54
  };
@@ -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;
@@ -1,22 +1,24 @@
1
- var _excluded = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "children", "className", "style"];
2
-
3
- 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; }
4
-
5
- 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; }
1
+ var _excluded = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "maxActions", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style"];
6
2
 
7
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; }
8
4
 
9
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; }
10
6
 
7
+ 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; }
8
+
9
+ 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; }
10
+
11
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
12
 
13
13
  import React from 'react';
14
+ import { useHistory } from 'react-router-dom';
14
15
  import classnames from 'classnames';
15
16
  import TeamixIcon from '@teamix/icon';
16
17
  import { Breadcrumb, Tag } from '@alicloudfe/components';
17
18
  import { baseClass } from '@teamix/utils';
18
19
  import { ActionGroup } from '../actions';
19
20
  import { BaseSkeleton } from '../skeleton';
21
+ import ProInfo from '../info';
20
22
  import './index.scss';
21
23
  var cls = baseClass('teamix-pro-page-header');
22
24
 
@@ -33,16 +35,22 @@ var renderNav = function renderNav(breadcrumbs) {
33
35
  return null;
34
36
  };
35
37
 
36
- var renderExtra = function renderExtra(helps) {
38
+ var renderExtra = function renderExtra(helps, max) {
37
39
  if (!helps) {
38
40
  return null;
39
41
  }
40
42
 
41
43
  if (helps instanceof Array && helps.length) {
44
+ var actions = helps.map(function (item) {
45
+ return Object.assign({
46
+ type: 'normal'
47
+ }, item);
48
+ });
42
49
  return /*#__PURE__*/React.createElement(ActionGroup, {
43
- actions: helps,
50
+ actions: actions,
44
51
  type: "text",
45
- divider: false
52
+ divider: false,
53
+ max: max
46
54
  });
47
55
  }
48
56
 
@@ -78,14 +86,15 @@ var isPresetColor = function isPresetColor(color) {
78
86
  return PRESET_COLOR_REG.test(color);
79
87
  };
80
88
 
81
- var renderOperations = function renderOperations(operations) {
89
+ var renderOperations = function renderOperations(operations, max) {
82
90
  if (!operations) {
83
91
  return null;
84
92
  }
85
93
 
86
94
  if (operations instanceof Array && operations.length) {
87
95
  return /*#__PURE__*/React.createElement(ActionGroup, {
88
- actions: operations
96
+ actions: operations,
97
+ max: max
89
98
  });
90
99
  }
91
100
 
@@ -132,6 +141,18 @@ var renderData = function renderData(data) {
132
141
  }));
133
142
  };
134
143
 
144
+ var renderInfo = function renderInfo(info) {
145
+ // @ts-ignore
146
+ if (info === null || info === void 0 ? void 0 : info.columns) {
147
+ // @ts-ignore
148
+ return /*#__PURE__*/React.createElement(ProInfo, _objectSpread({
149
+ type: "header"
150
+ }, info));
151
+ }
152
+
153
+ return info;
154
+ };
155
+
135
156
  var PageHeader = function PageHeader(props) {
136
157
  var title = props.title,
137
158
  description = props.description,
@@ -140,6 +161,8 @@ var PageHeader = function PageHeader(props) {
140
161
  _props$iconBackground = props.iconBackgroundType,
141
162
  iconBackgroundType = _props$iconBackground === void 0 ? 'square' : _props$iconBackground,
142
163
  iconBackgroundColor = props.iconBackgroundColor,
164
+ _props$maxActions = props.maxActions,
165
+ maxActions = _props$maxActions === void 0 ? 4 : _props$maxActions,
143
166
  goback = props.goback,
144
167
  operation = props.operation,
145
168
  extra = props.extra,
@@ -148,11 +171,13 @@ var PageHeader = function PageHeader(props) {
148
171
  breadcrumb = props.breadcrumb,
149
172
  tags = props.tags,
150
173
  data = props.data,
174
+ info = props.info,
151
175
  children = props.children,
152
176
  className = props.className,
153
177
  style = props.style,
154
178
  others = _objectWithoutProperties(props, _excluded);
155
179
 
180
+ var history = useHistory();
156
181
  var backgroundImage = image ? "url('".concat(image, "')") : undefined;
157
182
 
158
183
  var showList = function showList(list) {
@@ -172,7 +197,7 @@ var PageHeader = function PageHeader(props) {
172
197
  if (goback === true) {
173
198
  history.go(-1);
174
199
  } else if (typeof goback === 'string') {
175
- location.href = goback;
200
+ history.push && history.push(goback);
176
201
  }
177
202
  };
178
203
 
@@ -200,7 +225,7 @@ var PageHeader = function PageHeader(props) {
200
225
  className: cls('nav')
201
226
  }, loading && /*#__PURE__*/React.createElement(BaseSkeleton.Header.Nav, null), !loading && renderNav(breadcrumb)), /*#__PURE__*/React.createElement("section", {
202
227
  className: cls('extra')
203
- }, !loading && renderExtra(extra))), (goback || icon || title !== undefined || description !== undefined || data || tags || operation) && /*#__PURE__*/React.createElement("section", {
228
+ }, !loading && renderExtra(extra, maxActions))), (goback || icon || title !== undefined || description !== undefined || data || tags || operation) && /*#__PURE__*/React.createElement("section", {
204
229
  className: classnames(cls('section'), {
205
230
  'with-description': description
206
231
  })
@@ -216,7 +241,9 @@ var PageHeader = function PageHeader(props) {
216
241
  className: cls('data')
217
242
  }, renderData(data)), /*#__PURE__*/React.createElement("section", {
218
243
  className: cls('operation')
219
- }, !loading && renderOperations(operation)))), children);
244
+ }, !loading && renderOperations(operation, maxActions)))), info && !loading && /*#__PURE__*/React.createElement("section", {
245
+ className: classnames(cls('section'), cls('info'))
246
+ }, renderInfo(info)), children);
220
247
  };
221
248
 
222
249
  export default PageHeader;