@teamix/pro 1.1.6 → 1.1.7

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 (59) hide show
  1. package/README.md +97 -0
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +288 -385
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/dist/pro.min.js.LICENSE.txt +1 -1
  7. package/es/form/ProForm/index.scss +7 -1
  8. package/es/form/SchemaForm/index.js +3 -2
  9. package/es/form/SchemaForm/initializeArrayCards.js +10 -55
  10. package/es/form/SchemaForm/initializeArrayCollapse.js +10 -64
  11. package/es/form/SchemaForm/initializeArrayIcon.js +13 -6
  12. package/es/form/SchemaForm/initializeArrayItems.js +16 -75
  13. package/es/form/SchemaForm/initializeArrayTable.js +23 -33
  14. package/es/form/typing.d.ts +2 -5
  15. package/es/index.d.ts +1 -1
  16. package/es/index.js +1 -1
  17. package/es/info/components/FormItem/index.js +4 -4
  18. package/es/info/components/FormItem/index.scss +11 -0
  19. package/es/info/components/InfoValueItem/index.js +12 -1
  20. package/es/info/components/baseInfo/index.js +3 -4
  21. package/es/info/components/headerInfo/index.js +3 -4
  22. package/es/info/components/tableInfo/index.js +4 -3
  23. package/es/info/components/tableInfo/index.scss +1 -1
  24. package/es/info/index.scss +4 -0
  25. package/es/info/typing.d.ts +1 -1
  26. package/es/info/utils/index.d.ts +8 -1
  27. package/es/info/utils/index.js +18 -1
  28. package/es/nocode/configurators/PageHeader.js +49 -43
  29. package/es/nocode/configurators/ProTable.js +12 -9
  30. package/es/nocode/configurators/common.d.ts +117 -105
  31. package/es/nocode/configurators/common.js +38 -34
  32. package/es/table/components/Filter/index.js +8 -16
  33. package/lib/form/ProForm/index.scss +7 -1
  34. package/lib/form/SchemaForm/index.js +3 -2
  35. package/lib/form/SchemaForm/initializeArrayCards.js +10 -54
  36. package/lib/form/SchemaForm/initializeArrayCollapse.js +10 -63
  37. package/lib/form/SchemaForm/initializeArrayIcon.js +13 -6
  38. package/lib/form/SchemaForm/initializeArrayItems.js +16 -74
  39. package/lib/form/SchemaForm/initializeArrayTable.js +23 -33
  40. package/lib/form/typing.d.ts +2 -5
  41. package/lib/index.d.ts +1 -1
  42. package/lib/index.js +1 -1
  43. package/lib/info/components/FormItem/index.js +4 -4
  44. package/lib/info/components/FormItem/index.scss +11 -0
  45. package/lib/info/components/InfoValueItem/index.js +12 -1
  46. package/lib/info/components/baseInfo/index.js +4 -6
  47. package/lib/info/components/headerInfo/index.js +6 -8
  48. package/lib/info/components/tableInfo/index.js +4 -2
  49. package/lib/info/components/tableInfo/index.scss +1 -1
  50. package/lib/info/index.scss +4 -0
  51. package/lib/info/typing.d.ts +1 -1
  52. package/lib/info/utils/index.d.ts +8 -1
  53. package/lib/info/utils/index.js +21 -1
  54. package/lib/nocode/configurators/PageHeader.js +49 -43
  55. package/lib/nocode/configurators/ProTable.js +12 -9
  56. package/lib/nocode/configurators/common.d.ts +117 -105
  57. package/lib/nocode/configurators/common.js +38 -34
  58. package/lib/table/components/Filter/index.js +7 -15
  59. package/package.json +2 -2
@@ -6,7 +6,7 @@
6
6
  padding: 16px 24px;
7
7
  }
8
8
  .next-table-row.hovered {
9
- background-color:var(--color-white);
9
+ background-color:var(--color-fill1-1);
10
10
  }
11
11
  .next-table-row {
12
12
  color: var(--color-text1-3, #333333);
@@ -5,4 +5,8 @@
5
5
  .teamix-pro-card-content {
6
6
  padding-bottom: 8px;
7
7
  }
8
+
9
+ .next-card {
10
+ background: none;
11
+ }
8
12
  }
@@ -58,7 +58,7 @@ export interface ProInfoItemProps {
58
58
  /** 操作组配置 */
59
59
  actionSchema?: ActionGroupProps;
60
60
  /** 指定列对应的字段,支持`a.b`形式的快速取值 和 数组取值 */
61
- dataIndex?: string;
61
+ dataIndex?: string | string[];
62
62
  /** 合并行 */
63
63
  colSpan?: number;
64
64
  /** 是否可被编辑 */
@@ -1,5 +1,12 @@
1
1
  import React from 'react';
2
- import { ProInfoActionType, ProInfoGroupContextProps } from '../typing';
2
+ import { ProInfoActionType, ProInfoGroupContextProps, ProInfoItemProps } from '../typing';
3
3
  export declare function useActionType<T>(ref: React.MutableRefObject<ProInfoActionType | undefined>, action: ProInfoActionType): void;
4
4
  /** ProInfoGroupContext */
5
5
  export declare const ProInfoGroupContext: React.Context<ProInfoGroupContextProps>;
6
+ /**
7
+ * 获取 dataIndex 值
8
+ * @param dataIndex
9
+ * @param dataSource
10
+ * @returns
11
+ */
12
+ export declare function getDataIndexValue(dataIndex: ProInfoItemProps['dataIndex'], dataSource: object): any;
@@ -4,8 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ProInfoGroupContext = void 0;
7
+ exports.getDataIndexValue = getDataIndexValue;
7
8
  exports.useActionType = useActionType;
8
9
 
10
+ var _utils = require("@teamix/utils");
11
+
9
12
  var _react = _interopRequireDefault(require("react"));
10
13
 
11
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -26,5 +29,22 @@ function useActionType(ref, action) {
26
29
 
27
30
 
28
31
  var ProInfoGroupContext = /*#__PURE__*/_react.default.createContext({});
32
+ /**
33
+ * 获取 dataIndex 值
34
+ * @param dataIndex
35
+ * @param dataSource
36
+ * @returns
37
+ */
38
+
39
+
40
+ exports.ProInfoGroupContext = ProInfoGroupContext;
41
+
42
+ function getDataIndexValue(dataIndex, dataSource) {
43
+ if (Array.isArray(dataIndex)) {
44
+ return dataIndex.map(function (item) {
45
+ return (0, _utils.getDeepValue)(item !== null && item !== void 0 ? item : '', dataSource);
46
+ });
47
+ }
29
48
 
30
- exports.ProInfoGroupContext = ProInfoGroupContext;
49
+ return (0, _utils.getDeepValue)(dataIndex !== null && dataIndex !== void 0 ? dataIndex : '', dataSource);
50
+ }
@@ -111,34 +111,37 @@ var schema = [{
111
111
  children: [{
112
112
  name: 'tags',
113
113
  component: 'ArrayTable',
114
- items: [{
115
- name: 'text',
116
- title: '名称',
117
- component: 'Input'
118
- }, {
119
- name: 'type',
120
- title: '类型',
121
- component: 'Select',
122
- dataSource: [{
123
- label: '普通',
124
- value: 'normal'
114
+ items: {
115
+ type: 'object',
116
+ children: [{
117
+ name: 'text',
118
+ title: '名称',
119
+ component: 'Input'
120
+ }, {
121
+ name: 'type',
122
+ title: '类型',
123
+ component: 'Select',
124
+ dataSource: [{
125
+ label: '普通',
126
+ value: 'normal'
127
+ }, {
128
+ label: '主要',
129
+ value: 'primary'
130
+ }]
131
+ }, {
132
+ name: 'color',
133
+ title: '颜色',
134
+ component: 'Input'
125
135
  }, {
126
- label: '主要',
127
- value: 'primary'
136
+ title: '操作',
137
+ component: 'ArrayTable.Remove',
138
+ decoratorProps: {
139
+ fixed: 'right',
140
+ width: 40
141
+ },
142
+ formItem: null
128
143
  }]
129
- }, {
130
- name: 'color',
131
- title: '颜色',
132
- component: 'Input'
133
- }, {
134
- title: '操作',
135
- component: 'ArrayTable.Remove',
136
- decoratorProps: {
137
- fixed: 'right',
138
- width: 40
139
- },
140
- formItem: null
141
- }],
144
+ },
142
145
  children: [{
143
146
  title: '添加标签'
144
147
  }]
@@ -154,23 +157,26 @@ var schema = [{
154
157
  children: [{
155
158
  name: 'breadcrumb',
156
159
  component: 'ArrayTable',
157
- items: [{
158
- name: 'text',
159
- title: '名称',
160
- component: 'Input'
161
- }, {
162
- name: 'link',
163
- title: '链接',
164
- component: 'Input'
165
- }, {
166
- title: '操作',
167
- component: 'ArrayTable.Remove',
168
- decoratorProps: {
169
- fixed: 'right',
170
- width: 40
171
- },
172
- formItem: null
173
- }],
160
+ items: {
161
+ type: 'object',
162
+ children: [{
163
+ name: 'text',
164
+ title: '名称',
165
+ component: 'Input'
166
+ }, {
167
+ name: 'link',
168
+ title: '链接',
169
+ component: 'Input'
170
+ }, {
171
+ title: '操作',
172
+ component: 'ArrayTable.Remove',
173
+ decoratorProps: {
174
+ fixed: 'right',
175
+ width: 40
176
+ },
177
+ formItem: null
178
+ }]
179
+ },
174
180
  children: [{
175
181
  title: '添加面包屑'
176
182
  }]
@@ -141,16 +141,19 @@ var schema = [{
141
141
  name: 'pageSizeList',
142
142
  title: '分页大小列表',
143
143
  component: 'ArrayItems',
144
- props: {
145
- itemType: 'string'
144
+ items: {
145
+ component: 'FormFlex',
146
+ children: [{
147
+ component: 'ArrayItems.SortHandle'
148
+ }, {
149
+ component: 'NumberPicker',
150
+ decoratorProps: {
151
+ feedbackLayout: 'none'
152
+ }
153
+ }, {
154
+ component: 'ArrayItems.Remove'
155
+ }]
146
156
  },
147
- items: [{
148
- component: 'ArrayItems.SortHandle'
149
- }, {
150
- component: 'NumberPicker'
151
- }, {
152
- component: 'ArrayItems.Remove'
153
- }],
154
157
  children: [{
155
158
  title: '添加一条'
156
159
  }],
@@ -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
  }[];
@@ -14,46 +14,50 @@ function array(title, name, fields, main, arrayTitle) {
14
14
  name: name,
15
15
  title: arrayTitle,
16
16
  component: 'ArrayItems',
17
- props: {
18
- itemType: 'card'
19
- },
20
- items: [{
21
- component: 'FormFlex',
17
+ items: {
18
+ type: 'object',
19
+ decorator: 'ArrayItems.Item',
22
20
  children: [{
23
- component: 'ArrayItems.SortHandle'
21
+ component: 'FormFlex',
22
+ children: [{
23
+ component: 'ArrayItems.SortHandle'
24
+ }, {
25
+ component: 'ArrayItems.Index'
26
+ }]
24
27
  }, {
25
- component: 'ArrayItems.Index'
26
- }]
27
- }, {
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]}}'
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: fields
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
- title: '添加一条'
57
+ component: 'ArrayItems.Addition',
58
+ props: {
59
+ title: '添加一条'
60
+ }
57
61
  }]
58
62
  }]
59
63
  };
@@ -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 RadioGroup = _components.Radio.Group;
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
- var _selected$;
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(_components.Radio, {
112
+ return /*#__PURE__*/_react.default.createElement(RadioItem, {
120
113
  id: valueStr,
121
- value: valueStr,
114
+ checked: selected.includes(valueStr),
122
115
  key: valueStr,
123
- style: {
124
- display: 'block',
125
- marginLeft: '5px'
116
+ onChange: function onChange(check) {
117
+ setSelected([valueStr]);
126
118
  }
127
119
  }, label);
128
- }));
120
+ });
129
121
  }; // 渲染多选
130
122
 
131
123
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.1.6",
4
- "description": "pro大包",
3
+ "version": "1.1.7",
4
+ "description": "TeamixPro大包",
5
5
  "repository": "http://gitlab.alibaba-inc.com/teamix/pro",
6
6
  "author": "Velociraptor(迅猛龙)",
7
7
  "license": "MIT",