@teamix/pro 1.2.0 → 1.2.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.
Files changed (94) hide show
  1. package/dist/212.js +1 -1
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +1072 -507
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/es/actions/dialog-component.js +2 -1
  7. package/es/actions/dialog-form.js +2 -1
  8. package/es/actions/dialog.js +2 -1
  9. package/es/actions/index.js +1 -1
  10. package/es/actions/utils.d.ts +1 -0
  11. package/es/actions/utils.js +27 -0
  12. package/es/card/card-container.d.ts +18 -0
  13. package/es/card/card-container.js +24 -0
  14. package/es/card/divider.d.ts +6 -0
  15. package/es/card/divider.js +16 -0
  16. package/es/card/index.d.ts +59 -32
  17. package/es/card/index.js +191 -107
  18. package/es/card/index.scss +124 -9
  19. package/es/card/utils.d.ts +9 -0
  20. package/es/card/utils.js +30 -0
  21. package/es/form/Components/ProField/index.js +2 -6
  22. package/es/form/ProForm/index.js +43 -17
  23. package/es/form/ProForm/index.scss +0 -1
  24. package/es/form/ProForm/useAutoSubmit.d.ts +1 -1
  25. package/es/form/ProForm/useAutoSubmit.js +3 -3
  26. package/es/form/ProForm/useInitialRequest.d.ts +1 -1
  27. package/es/form/ProForm/useInitialRequest.js +2 -2
  28. package/es/form/SchemaForm/initializeDataSource.js +1 -1
  29. package/es/form/SchemaForm/initializeFormButton.js +3 -2
  30. package/es/form/SchemaForm/initializeRequest.js +6 -3
  31. package/es/form/SchemaForm/initializeRules.js +1 -1
  32. package/es/form/SchemaForm/reactions.d.ts +5 -4
  33. package/es/form/SchemaForm/reactions.js +20 -11
  34. package/es/form/locales/validate.d.ts +159 -0
  35. package/es/form/locales/validate.js +158 -0
  36. package/es/form/typing.d.ts +4 -3
  37. package/es/index.d.ts +1 -1
  38. package/es/index.js +1 -1
  39. package/es/info/components/InfoGroup/index.js +5 -2
  40. package/es/info/components/InfoValueItem/index.js +5 -7
  41. package/es/info/components/baseInfo/index.js +4 -2
  42. package/es/info/index.js +25 -11
  43. package/es/info/typing.d.ts +6 -0
  44. package/es/nocode/configurators/Card.js +8 -4
  45. package/es/table/components/Layout/index.js +1 -1
  46. package/es/table/components/ToolBar/FilterColumnIcon.js +2 -24
  47. package/es/table/components/ToolBar/index.scss +0 -3
  48. package/es/table/index.js +15 -7
  49. package/es/table/typing.d.ts +4 -4
  50. package/lib/actions/dialog-component.js +3 -1
  51. package/lib/actions/dialog-form.js +3 -1
  52. package/lib/actions/dialog.js +3 -1
  53. package/lib/actions/index.js +1 -1
  54. package/lib/actions/utils.d.ts +1 -0
  55. package/lib/actions/utils.js +33 -0
  56. package/lib/card/card-container.d.ts +18 -0
  57. package/lib/card/card-container.js +37 -0
  58. package/lib/card/divider.d.ts +6 -0
  59. package/lib/card/divider.js +26 -0
  60. package/lib/card/index.d.ts +59 -32
  61. package/lib/card/index.js +211 -110
  62. package/lib/card/index.scss +124 -9
  63. package/lib/card/utils.d.ts +9 -0
  64. package/lib/card/utils.js +41 -0
  65. package/lib/form/Components/ProField/index.js +1 -5
  66. package/lib/form/ProForm/index.js +41 -14
  67. package/lib/form/ProForm/index.scss +0 -1
  68. package/lib/form/ProForm/useAutoSubmit.d.ts +1 -1
  69. package/lib/form/ProForm/useAutoSubmit.js +3 -3
  70. package/lib/form/ProForm/useInitialRequest.d.ts +1 -1
  71. package/lib/form/ProForm/useInitialRequest.js +2 -2
  72. package/lib/form/SchemaForm/initializeDataSource.js +1 -1
  73. package/lib/form/SchemaForm/initializeFormButton.js +5 -2
  74. package/lib/form/SchemaForm/initializeRequest.js +5 -2
  75. package/lib/form/SchemaForm/initializeRules.js +1 -1
  76. package/lib/form/SchemaForm/reactions.d.ts +5 -4
  77. package/lib/form/SchemaForm/reactions.js +23 -12
  78. package/lib/form/locales/validate.d.ts +159 -0
  79. package/lib/form/locales/validate.js +165 -0
  80. package/lib/form/typing.d.ts +4 -3
  81. package/lib/index.d.ts +1 -1
  82. package/lib/index.js +1 -1
  83. package/lib/info/components/InfoGroup/index.js +5 -2
  84. package/lib/info/components/InfoValueItem/index.js +5 -7
  85. package/lib/info/components/baseInfo/index.js +4 -2
  86. package/lib/info/index.js +24 -10
  87. package/lib/info/typing.d.ts +6 -0
  88. package/lib/nocode/configurators/Card.js +8 -4
  89. package/lib/table/components/Layout/index.js +1 -1
  90. package/lib/table/components/ToolBar/FilterColumnIcon.js +2 -24
  91. package/lib/table/components/ToolBar/index.scss +0 -3
  92. package/lib/table/index.js +16 -7
  93. package/lib/table/typing.d.ts +4 -4
  94. package/package.json +5 -4
@@ -0,0 +1,159 @@
1
+ declare const _default: {
2
+ en: {
3
+ pattern: string;
4
+ required: string;
5
+ number: string;
6
+ integer: string;
7
+ url: string;
8
+ email: string;
9
+ ipv6: string;
10
+ ipv4: string;
11
+ idcard: string;
12
+ taodomain: string;
13
+ qq: string;
14
+ phone: string;
15
+ money: string;
16
+ zh: string;
17
+ date: string;
18
+ zip: string;
19
+ len: string;
20
+ min: string;
21
+ maximum: string;
22
+ exclusiveMaximum: string;
23
+ minimum: string;
24
+ exclusiveMinimum: string;
25
+ max: string;
26
+ whitespace: string;
27
+ };
28
+ 'en-us': {
29
+ pattern: string;
30
+ required: string;
31
+ number: string;
32
+ integer: string;
33
+ url: string;
34
+ email: string;
35
+ ipv6: string;
36
+ ipv4: string;
37
+ idcard: string;
38
+ taodomain: string;
39
+ qq: string;
40
+ phone: string;
41
+ money: string;
42
+ zh: string;
43
+ date: string;
44
+ zip: string;
45
+ len: string;
46
+ min: string;
47
+ maximum: string;
48
+ exclusiveMaximum: string;
49
+ minimum: string;
50
+ exclusiveMinimum: string;
51
+ max: string;
52
+ whitespace: string;
53
+ };
54
+ zh: {
55
+ pattern: string;
56
+ required: string;
57
+ number: string;
58
+ integer: string;
59
+ url: string;
60
+ email: string;
61
+ ipv6: string;
62
+ ipv4: string;
63
+ idcard: string;
64
+ taodomain: string;
65
+ qq: string;
66
+ phone: string;
67
+ money: string;
68
+ zh: string;
69
+ date: string;
70
+ zip: string;
71
+ len: string;
72
+ min: string;
73
+ max: string;
74
+ maximum: string;
75
+ exclusiveMaximum: string;
76
+ minimum: string;
77
+ exclusiveMinimum: string;
78
+ whitespace: string;
79
+ };
80
+ 'zh-cn': {
81
+ pattern: string;
82
+ required: string;
83
+ number: string;
84
+ integer: string;
85
+ url: string;
86
+ email: string;
87
+ ipv6: string;
88
+ ipv4: string;
89
+ idcard: string;
90
+ taodomain: string;
91
+ qq: string;
92
+ phone: string;
93
+ money: string;
94
+ zh: string;
95
+ date: string;
96
+ zip: string;
97
+ len: string;
98
+ min: string;
99
+ max: string;
100
+ maximum: string;
101
+ exclusiveMaximum: string;
102
+ minimum: string;
103
+ exclusiveMinimum: string;
104
+ whitespace: string;
105
+ };
106
+ 'zh-tw': {
107
+ pattern: string;
108
+ required: string;
109
+ number: string;
110
+ integer: string;
111
+ url: string;
112
+ email: string;
113
+ ipv6: string;
114
+ ipv4: string;
115
+ idcard: string;
116
+ taodomain: string;
117
+ qq: string;
118
+ phone: string;
119
+ money: string;
120
+ zh: string;
121
+ date: string;
122
+ zip: string;
123
+ len: string;
124
+ min: string;
125
+ max: string;
126
+ maximum: string;
127
+ exclusiveMaximum: string;
128
+ minimum: string;
129
+ exclusiveMinimum: string;
130
+ whitespace: string;
131
+ };
132
+ ja: {
133
+ url: string;
134
+ whitespace: string;
135
+ zh: string;
136
+ zip: string;
137
+ date: string;
138
+ email: string;
139
+ exclusiveMaximum: string;
140
+ exclusiveMinimum: string;
141
+ idcard: string;
142
+ integer: string;
143
+ ipv4: string;
144
+ ipv6: string;
145
+ len: string;
146
+ max: string;
147
+ maximum: string;
148
+ min: string;
149
+ minimum: string;
150
+ money: string;
151
+ number: string;
152
+ pattern: string;
153
+ phone: string;
154
+ qq: string;
155
+ required: string;
156
+ taodomain: string;
157
+ };
158
+ };
159
+ export default _default;
@@ -0,0 +1,158 @@
1
+ export default {
2
+ en: {
3
+ pattern: 'This field does not match any pattern',
4
+ required: 'This field is required',
5
+ number: 'This field is not a number',
6
+ integer: 'This field is not an integer number',
7
+ url: 'This field is a invalid url',
8
+ email: 'This field is not a email format',
9
+ ipv6: 'This field is not a ipv6 format',
10
+ ipv4: 'This field is not a ipv4 format',
11
+ idcard: 'This field is not an idcard format',
12
+ taodomain: 'This field is not a taobao domain format',
13
+ qq: 'This field is not a qq number format',
14
+ phone: 'This field is not a phone number format',
15
+ money: 'This field is not a currency format',
16
+ zh: 'This field is not a chinese string',
17
+ date: 'This field is not a valid date format',
18
+ zip: 'This field is not a zip format',
19
+ len: 'The length or number of entries must be {{len}}',
20
+ min: 'The length or number of entries must be at least {{min}}',
21
+ maximum: 'The value cannot be greater than {{maximum}}',
22
+ exclusiveMaximum: 'The value must be less than {{exclusiveMaximum}}',
23
+ minimum: 'The value cannot be less than {{minimum}}',
24
+ exclusiveMinimum: 'The value must be greater than {{exclusiveMinimum}}',
25
+ max: 'The length or number of entries must be at most {{max}}',
26
+ whitespace: 'This field cannot be blank string.'
27
+ },
28
+ 'en-us': {
29
+ pattern: 'This field does not match any pattern',
30
+ required: 'This field is required',
31
+ number: 'This field is not a number',
32
+ integer: 'This field is not an integer number',
33
+ url: 'This field is a invalid url',
34
+ email: 'This field is not a email format',
35
+ ipv6: 'This field is not a ipv6 format',
36
+ ipv4: 'This field is not a ipv4 format',
37
+ idcard: 'This field is not an idcard format',
38
+ taodomain: 'This field is not a taobao domain format',
39
+ qq: 'This field is not a qq number format',
40
+ phone: 'This field is not a phone number format',
41
+ money: 'This field is not a currency format',
42
+ zh: 'This field is not a chinese string',
43
+ date: 'This field is not a valid date format',
44
+ zip: 'This field is not a zip format',
45
+ len: 'The length or number of entries must be {{len}}',
46
+ min: 'The length or number of entries must be at least {{min}}',
47
+ maximum: 'The value cannot be greater than {{maximum}}',
48
+ exclusiveMaximum: 'The value must be less than {{exclusiveMaximum}}',
49
+ minimum: 'The value cannot be less than {{minimum}}',
50
+ exclusiveMinimum: 'The value must be greater than {{exclusiveMinimum}}',
51
+ max: 'The length or number of entries must be at most {{max}}',
52
+ whitespace: 'This field cannot be blank string.'
53
+ },
54
+ zh: {
55
+ pattern: '该字段不是一个合法的字段',
56
+ required: '该字段是必填字段',
57
+ number: '该字段不是合法的数字',
58
+ integer: '该字段不是合法的整型数字',
59
+ url: '该字段不是合法的url',
60
+ email: '该字段不是合法的邮箱格式',
61
+ ipv6: '该字段不是合法的ipv6格式',
62
+ ipv4: '该字段不是合法的ipv4格式',
63
+ idcard: '该字段不是合法的身份证格式',
64
+ taodomain: '该字段不符合淘系域名规则',
65
+ qq: '该字段不符合QQ号格式',
66
+ phone: '该字段不是有效的手机号',
67
+ money: '该字段不是有效货币格式',
68
+ zh: '该字段不是合法的中文字符串',
69
+ date: '该字段不是合法的日期格式',
70
+ zip: '该字段不是合法的邮编格式',
71
+ len: '长度或条目数必须为{{len}}',
72
+ min: '长度或条目数不能小于{{min}}',
73
+ max: '长度或条目数不能大于{{max}}',
74
+ maximum: '数值不能大于{{maximum}}',
75
+ exclusiveMaximum: '数值必须小于{{exclusiveMaximum}}',
76
+ minimum: '数值不能小于{{minimum}}',
77
+ exclusiveMinimum: '数值必须大于{{exclusiveMinimum}}',
78
+ whitespace: '不能为纯空白字符串'
79
+ },
80
+ 'zh-cn': {
81
+ pattern: '该字段不是一个合法的字段',
82
+ required: '该字段是必填字段',
83
+ number: '该字段不是合法的数字',
84
+ integer: '该字段不是合法的整型数字',
85
+ url: '该字段不是合法的url',
86
+ email: '该字段不是合法的邮箱格式',
87
+ ipv6: '该字段不是合法的ipv6格式',
88
+ ipv4: '该字段不是合法的ipv4格式',
89
+ idcard: '该字段不是合法的身份证格式',
90
+ taodomain: '该字段不符合淘系域名规则',
91
+ qq: '该字段不符合QQ号格式',
92
+ phone: '该字段不是有效的手机号',
93
+ money: '该字段不是有效货币格式',
94
+ zh: '该字段不是合法的中文字符串',
95
+ date: '该字段不是合法的日期格式',
96
+ zip: '该字段不是合法的邮编格式',
97
+ len: '长度或条目数必须为{{len}}',
98
+ min: '长度或条目数不能小于{{min}}',
99
+ max: '长度或条目数不能大于{{max}}',
100
+ maximum: '数值不能大于{{maximum}}',
101
+ exclusiveMaximum: '数值必须小于{{exclusiveMaximum}}',
102
+ minimum: '数值不能小于{{minimum}}',
103
+ exclusiveMinimum: '数值必须大于{{exclusiveMinimum}}',
104
+ whitespace: '不能为纯空白字符串'
105
+ },
106
+ 'zh-tw': {
107
+ pattern: '該字段不是一個合法的字段',
108
+ required: '該字段是必填字段',
109
+ number: '該字段不是合法的數字',
110
+ integer: '該字段不是合法的整型數字',
111
+ url: '該字段不是合法的url',
112
+ email: '該字段不是合法的郵箱格式',
113
+ ipv6: '該字段不是合法的ipv6格式',
114
+ ipv4: '該字段不是合法的ipv4格式',
115
+ idcard: '該字段不是合法的身份證格式',
116
+ taodomain: '該字段不符合淘系域名規則',
117
+ qq: '該字段不符合QQ號格式',
118
+ phone: '該字段不是有效的手機號',
119
+ money: '該字段不是有效貨幣格式',
120
+ zh: '該字段不是合法的中文字符串',
121
+ date: '該字段不是合法的日期格式',
122
+ zip: '該字段不是合法的郵編格式',
123
+ len: '長度或條目數必須為{{len}}',
124
+ min: '長度或條目數不能小於{{min}}',
125
+ max: '長度或條目數不能大於{{max}}',
126
+ maximum: '數值不能大於{{maximum}}',
127
+ exclusiveMaximum: '數值必須小於{{exclusiveMaximum}}',
128
+ minimum: '數值不能小於{{minimum}}',
129
+ exclusiveMinimum: '數值必須大於{{exclusiveMinimum}}',
130
+ whitespace: '不能為純空白字符串'
131
+ },
132
+ ja: {
133
+ url: 'このフィールドは無効なURLです',
134
+ whitespace: 'このフィールドを空の文字列にすることはできません。',
135
+ zh: 'このフィールドは中国語の文字列ではありません',
136
+ zip: 'このフィールドはzip形式ではありません',
137
+ date: 'このフィールドは有効な日付形式ではありません',
138
+ email: 'このフィールドはメール形式ではありません',
139
+ exclusiveMaximum: '値は{{exclusiveMaximum}}未満である必要があります',
140
+ exclusiveMinimum: '値は{{exclusiveMinimum}}より大きい必要があります',
141
+ idcard: 'このフィールドはIDカード形式ではありません',
142
+ integer: 'このフィールドは整数ではありません',
143
+ ipv4: 'このフィールドはIPv4形式ではありません',
144
+ ipv6: 'このフィールドはIPv6形式ではありません',
145
+ len: 'エントリの長さまたは数は{{len}}でなければなりません',
146
+ max: 'エントリの長さまたは数は最大{{max}}でなければなりません',
147
+ maximum: '値は{{最大}}を超えることはできません',
148
+ min: 'エントリの長さまたは数は、少なくとも{{min}}である必要があります',
149
+ minimum: '値は{{minimum}}以上にする必要があります',
150
+ money: 'このフィールドは通貨形式ではありません',
151
+ number: 'このフィールドは数値ではありません',
152
+ pattern: 'このフィールドはどのパターンとも一致しません',
153
+ phone: 'このフィールドは電話番号の形式ではありません',
154
+ qq: 'このフィールドはqq数値形式ではありません',
155
+ required: 'この項目は必須です',
156
+ taodomain: 'このフィールドは淘宝網ドメイン形式ではありません'
157
+ }
158
+ };
@@ -14,9 +14,9 @@ declare type IButtonComponent = 'Submit' | 'Reset';
14
14
  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';
15
15
  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';
16
16
  export interface ProFormRequestConfig extends CommonRequestConfig {
17
- beforeRequest?: (field?: any) => any;
18
- onSuccess?: (res?: any, field?: any) => any;
19
- onComplete?: (res?: any, field?: any) => any;
17
+ beforeRequest?: (field?: any, context?: any) => any;
18
+ onSuccess?: (res?: any, field?: any, context?: any) => any;
19
+ onComplete?: (res?: any, field?: any, context?: any) => any;
20
20
  }
21
21
  export interface ProFormSchemaItem {
22
22
  type?: string;
@@ -51,6 +51,7 @@ export interface ProFormProps extends IFormLayoutProps {
51
51
  form?: FormType | false;
52
52
  schema: ProFormSchema;
53
53
  scope?: any;
54
+ context?: any;
54
55
  components?: {
55
56
  [key: string]: React.FC | React.ComponentClass;
56
57
  };
package/es/index.d.ts CHANGED
@@ -21,5 +21,5 @@ export * from './page-container';
21
21
  export * from './page-header';
22
22
  export * from './skeleton';
23
23
  export * from './table';
24
- declare const version = "1.1.39";
24
+ declare const version = "1.2.4";
25
25
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils, };
package/es/index.js CHANGED
@@ -25,6 +25,6 @@ export * from './page-container';
25
25
  export * from './page-header';
26
26
  export * from './skeleton';
27
27
  export * from './table';
28
- var version = '1.1.39';
28
+ var version = '1.2.4';
29
29
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
30
30
  ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils };
@@ -1,4 +1,4 @@
1
- var _excluded = ["children", "url", "method", "params", "formatResult", "onSuccess", "onError", "formatParams", "beforeRequest", "extendParams", "className", "compacted", "divider", "style", "backgroundColor"];
1
+ var _excluded = ["children", "url", "method", "params", "formatResult", "onSuccess", "onError", "formatParams", "beforeRequest", "extendParams", "className", "compacted", "divider", "style", "backgroundColor", "context"];
2
2
 
3
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
4
 
@@ -37,6 +37,8 @@ var ProInfoGroup = function ProInfoGroup(props) {
37
37
  style = props.style,
38
38
  _props$backgroundColo = props.backgroundColor,
39
39
  backgroundColor = _props$backgroundColo === void 0 ? '' : _props$backgroundColo,
40
+ _props$context = props.context,
41
+ context = _props$context === void 0 ? {} : _props$context,
40
42
  others = _objectWithoutProperties(props, _excluded);
41
43
 
42
44
  var ref = useRef();
@@ -62,7 +64,8 @@ var ProInfoGroup = function ProInfoGroup(props) {
62
64
  onError: onError,
63
65
  formatParams: formatParams,
64
66
  beforeRequest: beforeRequest,
65
- extendParams: extendParams
67
+ extendParams: extendParams,
68
+ context: context
66
69
  };
67
70
  var proInfoClassName = cls({
68
71
  'teamix-pro-info-group-item': true,
@@ -1,4 +1,4 @@
1
- var _excluded = ["type", "value", "render", "infoItem", "record", "actionRef", "dataSource"];
1
+ var _excluded = ["type", "value", "render", "infoItem", "record", "actionRef", "dataSource", "context"];
2
2
 
3
3
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
4
 
@@ -51,6 +51,7 @@ var InfoValueItem = function InfoValueItem(props) {
51
51
  record = props.record,
52
52
  actionRef = props.actionRef,
53
53
  dataSource = props.dataSource,
54
+ context = props.context,
54
55
  others = _objectWithoutProperties(props, _excluded);
55
56
 
56
57
  var dataIndex = infoItem.dataIndex,
@@ -71,7 +72,7 @@ var InfoValueItem = function InfoValueItem(props) {
71
72
 
72
73
  if (typeof render === 'function') {
73
74
  return function () {
74
- render(value, record);
75
+ return render(value, record);
75
76
  };
76
77
  }
77
78
 
@@ -93,9 +94,8 @@ var InfoValueItem = function InfoValueItem(props) {
93
94
  v = _ref2[1];
94
95
 
95
96
  return [k, getTargetValue(v, _objectSpread(_objectSpread({}, record), {}, {
96
- record: record,
97
97
  value: value
98
- }))];
98
+ }, context))];
99
99
  }));
100
100
  });
101
101
  }
@@ -134,9 +134,7 @@ var InfoValueItem = function InfoValueItem(props) {
134
134
  style: {
135
135
  marginLeft: '8px'
136
136
  },
137
- context: {
138
- record: record
139
- }
137
+ context: _objectSpread({}, context)
140
138
  });
141
139
  }
142
140
 
@@ -18,7 +18,8 @@ var ProBaseInfo = function ProBaseInfo(props) {
18
18
  result = props.result,
19
19
  actionRef = props.actionRef,
20
20
  layout = props.layout,
21
- size = props.size;
21
+ size = props.size,
22
+ context = props.context;
22
23
  var defaultLayout = defaultLayoutMap[getLayout((_size$width = size === null || size === void 0 ? void 0 : size.width) !== null && _size$width !== void 0 ? _size$width : 0)]; // 获取列内的布局参数
23
24
 
24
25
  var getFormItemLayout = function getFormItemLayout(colspan) {
@@ -71,7 +72,8 @@ var ProBaseInfo = function ProBaseInfo(props) {
71
72
  dataSource: item.dataSource,
72
73
  infoItem: item,
73
74
  record: dataSource !== null && dataSource !== void 0 ? dataSource : result,
74
- actionRef: actionRef
75
+ actionRef: actionRef,
76
+ context: context
75
77
  }),
76
78
  baseInfoLayout: getFormItemLayout((_item$colSpan = item === null || item === void 0 ? void 0 : item.colSpan) !== null && _item$colSpan !== void 0 ? _item$colSpan : 0),
77
79
  tooltip: item.tooltip,
package/es/info/index.js CHANGED
@@ -1,4 +1,5 @@
1
- var _excluded = ["type", "url", "method", "formatResult", "formatParams", "params", "actionRef", "header", "onSuccess", "onError", "beforeRequest", "extendParams", "className", "style", "columns", "layout", "dataSource", "loading", "extra"];
1
+ var _excluded = ["type", "url", "method", "formatResult", "formatParams", "params", "actionRef", "header", "onSuccess", "onError", "beforeRequest", "extendParams", "className", "style", "columns", "layout", "dataSource", "loading", "extra", "context"],
2
+ _excluded2 = ["context"];
2
3
 
3
4
  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
 
@@ -22,7 +23,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
22
23
 
23
24
  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; }
24
25
 
25
- import React, { isValidElement, useContext, useEffect, useRef, useState } from 'react';
26
+ import React, { isValidElement, useContext, useEffect, useRef, useState, useMemo } from 'react';
26
27
  import ProTableInfo from './components/tableInfo';
27
28
  import ProHeaderInfo from './components/headerInfo';
28
29
  import ProBaseInfo from './components/baseInfo';
@@ -59,6 +60,7 @@ var ProInfo = function ProInfo(props) {
59
60
  dataSource = props.dataSource,
60
61
  userLoading = props.loading,
61
62
  extra = props.extra,
63
+ infoContext = props.context,
62
64
  others = _objectWithoutProperties(props, _excluded);
63
65
 
64
66
  var _useContext = useContext(ProInfoGroupContext),
@@ -72,7 +74,9 @@ var ProInfo = function ProInfo(props) {
72
74
  contextOnError = _useContext.onError,
73
75
  contextFormatParams = _useContext.formatParams,
74
76
  contextBeforeRequest = _useContext.beforeRequest,
75
- contextExtendParams = _useContext.extendParams; // 获取容器宽度
77
+ contextExtendParams = _useContext.extendParams,
78
+ _useContext$context = _useContext.context,
79
+ contextContext = _useContext$context === void 0 ? {} : _useContext$context; // 获取容器宽度
76
80
 
77
81
 
78
82
  var ref = useRef();
@@ -109,7 +113,12 @@ var ProInfo = function ProInfo(props) {
109
113
  } else {
110
114
  setLoading(false);
111
115
  }
112
- }, []); // 获取数据
116
+ }, []);
117
+ var context = useMemo(function () {
118
+ return _objectSpread(_objectSpread({}, infoContext), {}, {
119
+ record: dataSource !== null && dataSource !== void 0 ? dataSource : data
120
+ }, contextContext);
121
+ }, [dataSource, data]); // 获取数据
113
122
 
114
123
  var request = function request() {
115
124
  setLoading(true);
@@ -142,10 +151,12 @@ var ProInfo = function ProInfo(props) {
142
151
  return extra;
143
152
  }
144
153
 
145
- return _objectSpread(_objectSpread({}, extra), {}, {
146
- context: {
147
- record: dataSource !== null && dataSource !== void 0 ? dataSource : data
148
- }
154
+ var _extra$context = extra.context,
155
+ actionContext = _extra$context === void 0 ? {} : _extra$context,
156
+ others = _objectWithoutProperties(extra, _excluded2);
157
+
158
+ return _objectSpread(_objectSpread({}, others), {}, {
159
+ context: _objectSpread(_objectSpread({}, context), actionContext)
149
160
  });
150
161
  };
151
162
 
@@ -166,7 +177,8 @@ var ProInfo = function ProInfo(props) {
166
177
  loading: userLoading || loading,
167
178
  result: data,
168
179
  actionRef: actionRef,
169
- layout: layout
180
+ layout: layout,
181
+ context: context
170
182
  }), type === 'header' && /*#__PURE__*/React.createElement(ProHeaderInfo, {
171
183
  dataSource: dataSource,
172
184
  columns: columns,
@@ -175,7 +187,8 @@ var ProInfo = function ProInfo(props) {
175
187
  result: data,
176
188
  actionRef: actionRef,
177
189
  layout: layout,
178
- size: size
190
+ size: size,
191
+ context: context
179
192
  }), type === 'base' && /*#__PURE__*/React.createElement(ProBaseInfo, {
180
193
  dataSource: dataSource,
181
194
  columns: columns,
@@ -183,7 +196,8 @@ var ProInfo = function ProInfo(props) {
183
196
  result: data,
184
197
  actionRef: actionRef,
185
198
  layout: layout,
186
- size: size
199
+ size: size,
200
+ context: context
187
201
  })));
188
202
  };
189
203
 
@@ -48,6 +48,8 @@ export declare type ProInfoBaseProps = {
48
48
  layout?: ProBaseInfoLayoutProps;
49
49
  /** 加载动画 */
50
50
  loading?: boolean;
51
+ /** 上下文传递 */
52
+ context?: object;
51
53
  } & ProInfoHeaderProps & ProInfoRequestProps;
52
54
  /** ProInfoColumnsProps info 单元格 定义 */
53
55
  export declare type ProInfoItemProps = ProInfoColumnsProps;
@@ -155,6 +157,8 @@ export declare type ProInfoGroupProps = {
155
157
  compacted?: ProCardProps['compacted'];
156
158
  /** 背景颜色 */
157
159
  backgroundColor?: ProCardProps['backgroundColor'];
160
+ /** 上下文 */
161
+ context?: object;
158
162
  } & ProInfoRequestProps & React.HTMLAttributes<HTMLElement>;
159
163
  export declare type TableInfoLayoutProps = {} & ProHeaderInfoLayoutProps;
160
164
  export declare type InfoValueItemProps = {
@@ -163,6 +167,7 @@ export declare type InfoValueItemProps = {
163
167
  actionRef?: React.MutableRefObject<ProInfoActionType | undefined>;
164
168
  render?: ProInfoCellRender;
165
169
  dataSource?: ProFieldDataSourceItem[] | ProInfoCellFunProp;
170
+ context?: object;
166
171
  } & Omit<ProFieldProps, 'render' | 'dataSource'>;
167
172
  export declare type ProInfoHeaderProps = Omit<ProCardProps, 'loading'>;
168
173
  /** ProInfoGroupContextProps */
@@ -174,6 +179,7 @@ export declare type ProInfoGroupContextProps = {
174
179
  width?: number;
175
180
  height?: number;
176
181
  };
182
+ context?: object;
177
183
  } & ProInfoRequestProps;
178
184
  /** 基本透传类型 */
179
185
  export declare type ProInfoTransparentBase = {
@@ -21,6 +21,14 @@ var schema = [{
21
21
  name: 'subTitle',
22
22
  title: '副标题',
23
23
  component: 'Input'
24
+ }, {
25
+ name: 'tooltip',
26
+ title: '介绍信息',
27
+ component: 'Input'
28
+ }, {
29
+ name: 'description',
30
+ title: '描述文字',
31
+ component: 'Input'
24
32
  }, {
25
33
  name: 'extra',
26
34
  title: '额外信息',
@@ -49,10 +57,6 @@ var schema = [{
49
57
  name: 'bordered',
50
58
  title: '边框',
51
59
  component: 'Switch'
52
- }, {
53
- name: 'hoveredShadow',
54
- title: '悬浮阴影',
55
- component: 'Switch'
56
60
  }, {
57
61
  name: 'divider',
58
62
  title: '头部分割线',
@@ -100,7 +100,7 @@ var Layout = function Layout(props) {
100
100
  var renderPanelFilter = function renderPanelFilter() {
101
101
  var _dataFilter$schema2;
102
102
 
103
- if (dataFilter && (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema2 = dataFilter.schema) === null || _dataFilter$schema2 === void 0 ? void 0 : _dataFilter$schema2.length) > 0) {
103
+ if (dataFilter && (dataFilter === null || dataFilter === void 0 ? void 0 : (_dataFilter$schema2 = dataFilter.schema) === null || _dataFilter$schema2 === void 0 ? void 0 : _dataFilter$schema2.length) >= 0) {
104
104
  return /*#__PURE__*/React.createElement("div", {
105
105
  className: cls('panel-filter'),
106
106
  style: {
@@ -78,27 +78,7 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
78
78
 
79
79
  useEffect(function () {
80
80
  setNewColumns(processColumns(columns));
81
- }, [columns]); // useEffect(() => {
82
- // console.log("这个函数被触发");
83
- // setTimeout(() => {
84
- // setFullscreen(actionRef?.current?.getState?.().fullScreenState ?? false);
85
- // }, 0)
86
- // }, [])
87
- // // 销毁监听函数
88
- // useEffect(() => {
89
- // return () => {
90
- // actionRef.current?.off?.('filterColumnIcon');
91
- // };
92
- // }, []);
93
- // // 监听全屏变化
94
- // actionRef.current?.on?.(
95
- // (state: boolean) => {
96
- // setFullscreen(state);
97
- // },
98
- // 'fullScreenState',
99
- // 'filterColumnIcon',
100
- // );
101
- // 全选
81
+ }, [columns]); // 全选
102
82
 
103
83
  var onChangeAllColumns = function onChangeAllColumns(check) {
104
84
  setAllVisible(check);
@@ -297,9 +277,7 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
297
277
  onOk: onChangeColumnsForDialog,
298
278
  onCancel: dialogOnClose,
299
279
  onClose: dialogOnClose,
300
- style: {
301
- width: '440px'
302
- }
280
+ width: 480
303
281
  }, /*#__PURE__*/React.createElement(Row, {
304
282
  gutter: 20,
305
283
  wrap: true,
@@ -67,8 +67,6 @@
67
67
  }
68
68
  }
69
69
  }
70
-
71
-
72
70
  }
73
71
  .teamix-pro-table-toolbar-filter-column-col {
74
72
  height: 28px;
@@ -78,7 +76,6 @@
78
76
  }
79
77
  }
80
78
 
81
-
82
79
  // fullscreen
83
80
  .teamix-pro-table-full-screen {
84
81
  width: 100vw;