amis 1.9.0-beta.13 → 1.9.0-beta.14

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 (102) hide show
  1. package/lib/actions/AjaxAction.d.ts +8 -5
  2. package/lib/actions/AjaxAction.js +27 -21
  3. package/lib/actions/AjaxAction.js.map +2 -2
  4. package/lib/actions/BroadcastAction.js +1 -1
  5. package/lib/actions/BroadcastAction.js.map +2 -2
  6. package/lib/actions/CmptAction.js +7 -9
  7. package/lib/actions/CmptAction.js.map +2 -2
  8. package/lib/actions/CopyAction.d.ts +5 -2
  9. package/lib/actions/CopyAction.js +8 -6
  10. package/lib/actions/CopyAction.js.map +2 -2
  11. package/lib/actions/DialogAction.d.ts +9 -3
  12. package/lib/actions/DialogAction.js +6 -6
  13. package/lib/actions/DialogAction.js.map +2 -2
  14. package/lib/actions/EmailAction.d.ts +8 -5
  15. package/lib/actions/EmailAction.js +4 -5
  16. package/lib/actions/EmailAction.js.map +2 -2
  17. package/lib/actions/LinkAction.d.ts +17 -11
  18. package/lib/actions/LinkAction.js +6 -5
  19. package/lib/actions/LinkAction.js.map +2 -2
  20. package/lib/actions/LoopAction.d.ts +4 -1
  21. package/lib/actions/LoopAction.js +22 -20
  22. package/lib/actions/LoopAction.js.map +2 -2
  23. package/lib/actions/PageAction.d.ts +4 -1
  24. package/lib/actions/PageAction.js +3 -2
  25. package/lib/actions/PageAction.js.map +2 -2
  26. package/lib/actions/ToastAction.js +6 -6
  27. package/lib/actions/ToastAction.js.map +2 -2
  28. package/lib/index.js +1 -1
  29. package/lib/renderers/Action.js +0 -2
  30. package/lib/renderers/Action.js.map +2 -2
  31. package/lib/renderers/Form/Combo.js +22 -3
  32. package/lib/renderers/Form/Combo.js.map +2 -2
  33. package/lib/renderers/Form/InputTree.js +1 -1
  34. package/lib/renderers/Form/InputTree.js.map +2 -2
  35. package/lib/renderers/Wizard.js +3 -3
  36. package/lib/renderers/Wizard.js.map +2 -2
  37. package/lib/schemaExtend.js +11 -24
  38. package/lib/schemaExtend.js.map +2 -2
  39. package/lib/store/table.js +1 -1
  40. package/lib/store/table.js.map +2 -2
  41. package/lib/themes/ang-ie11.css +30 -34
  42. package/lib/themes/ang.css +31 -34
  43. package/lib/themes/ang.css.map +1 -1
  44. package/lib/themes/antd-ie11.css +30 -34
  45. package/lib/themes/antd.css +31 -34
  46. package/lib/themes/antd.css.map +1 -1
  47. package/lib/themes/cxd-ie11.css +30 -34
  48. package/lib/themes/cxd.css +31 -34
  49. package/lib/themes/cxd.css.map +1 -1
  50. package/lib/themes/dark-ie11.css +30 -34
  51. package/lib/themes/dark.css +31 -34
  52. package/lib/themes/dark.css.map +1 -1
  53. package/lib/themes/default-ie11.css +30 -34
  54. package/lib/themes/default.css +31 -34
  55. package/lib/themes/default.css.map +1 -1
  56. package/lib/utils/handleAction.js +1 -1
  57. package/lib/utils/handleAction.js.map +2 -2
  58. package/package.json +2 -2
  59. package/scss/_properties.scss +1 -0
  60. package/scss/components/_button.scss +37 -39
  61. package/sdk/ang-ie11.css +38 -39
  62. package/sdk/ang.css +39 -39
  63. package/sdk/antd-ie11.css +38 -39
  64. package/sdk/antd.css +39 -39
  65. package/sdk/barcode.js +51 -51
  66. package/sdk/charts.js +14 -14
  67. package/sdk/codemirror.js +7 -7
  68. package/sdk/color-picker.js +65 -65
  69. package/sdk/cropperjs.js +2 -2
  70. package/sdk/cxd-ie11.css +38 -39
  71. package/sdk/cxd.css +39 -39
  72. package/sdk/dark-ie11.css +38 -39
  73. package/sdk/dark.css +39 -39
  74. package/sdk/exceljs.js +1 -1
  75. package/sdk/markdown.js +69 -69
  76. package/sdk/papaparse.js +1 -1
  77. package/sdk/renderers/Form/CityDB.js +1 -1
  78. package/sdk/rest.js +16 -16
  79. package/sdk/rich-text.js +62 -62
  80. package/sdk/sdk-ie11.css +38 -39
  81. package/sdk/sdk.css +39 -39
  82. package/sdk/sdk.js +1248 -1248
  83. package/sdk/thirds/hls.js/hls.js +1 -1
  84. package/sdk/thirds/mpegts.js/mpegts.js +1 -1
  85. package/sdk/tinymce.js +57 -57
  86. package/src/actions/AjaxAction.ts +31 -22
  87. package/src/actions/BroadcastAction.ts +1 -1
  88. package/src/actions/CmptAction.ts +2 -3
  89. package/src/actions/CopyAction.ts +12 -6
  90. package/src/actions/DialogAction.ts +11 -5
  91. package/src/actions/EmailAction.ts +10 -10
  92. package/src/actions/LinkAction.ts +31 -14
  93. package/src/actions/LoopAction.ts +11 -6
  94. package/src/actions/PageAction.ts +5 -2
  95. package/src/actions/ToastAction.ts +9 -2
  96. package/src/renderers/Action.tsx +1 -1
  97. package/src/renderers/Form/Combo.tsx +19 -3
  98. package/src/renderers/Form/InputTree.tsx +1 -1
  99. package/src/renderers/Wizard.tsx +3 -3
  100. package/src/schemaExtend.ts +12 -23
  101. package/src/store/table.ts +1 -1
  102. package/src/utils/handleAction.ts +1 -1
@@ -1,9 +1,9 @@
1
+ import omit from 'lodash/omit';
1
2
  import {Api} from '../types';
2
3
  import {normalizeApiResponseData} from '../utils/api';
3
4
  import {ServerError} from '../utils/errors';
4
- import {createObject, isEmpty, isVisible} from '../utils/helper';
5
+ import {createObject, isEmpty} from '../utils/helper';
5
6
  import {RendererEvent} from '../utils/renderer-event';
6
- import {filter} from '../utils/tpl';
7
7
  import {
8
8
  RendererAction,
9
9
  ListenerAction,
@@ -12,12 +12,15 @@ import {
12
12
  } from './Action';
13
13
 
14
14
  export interface IAjaxAction extends ListenerAction {
15
- api: Api;
16
- messages: {
17
- success: string;
18
- failed: string;
15
+ args: {
16
+ api: Api;
17
+ messages: {
18
+ success: string;
19
+ failed: string;
20
+ };
21
+ options: object;
22
+ [propName: string]: any;
19
23
  };
20
- options: object;
21
24
  }
22
25
 
23
26
  /**
@@ -33,17 +36,21 @@ export class AjaxAction implements RendererAction {
33
36
  renderer: ListenerContext,
34
37
  event: RendererEvent<any>
35
38
  ) {
39
+ if (!renderer.props.env?.fetcher) {
40
+ throw new Error('env.fetcher is required!');
41
+ }
42
+
36
43
  const env = event.context.env;
37
44
  try {
38
45
  const result = await env.fetcher(
39
- action.api as string,
40
- action.args,
41
- action.options ?? {}
46
+ action.args?.api as string,
47
+ omit(action.args ?? {}, ['api', 'options', 'messages']),
48
+ action.args?.options ?? {}
42
49
  );
43
50
 
44
51
  if (!isEmpty(result.data) || result.ok) {
45
52
  const responseData = normalizeApiResponseData(result.data);
46
- // 记录请求返回的数据
53
+ // 记录请求返回的数据
47
54
  event.setData(
48
55
  createObject(
49
56
  event.data,
@@ -58,20 +65,22 @@ export class AjaxAction implements RendererAction {
58
65
 
59
66
  if (!result.ok) {
60
67
  throw new ServerError(
61
- (action.messages && action.messages.failed) ?? result.msg,
68
+ action.args?.messages?.failed ?? result.msg,
62
69
  result
63
70
  );
64
71
  } else {
65
- env.notify(
66
- 'success',
67
- (action.messages && action.messages.success) ?? result.msg,
68
- result.msgTimeout !== undefined
69
- ? {
70
- closeButton: true,
71
- timeout: result.msgTimeout
72
- }
73
- : undefined
74
- );
72
+ const msg = action.args?.messages?.success ?? result.msg;
73
+ msg &&
74
+ env.notify(
75
+ 'success',
76
+ msg,
77
+ result.msgTimeout !== undefined
78
+ ? {
79
+ closeButton: true,
80
+ timeout: result.msgTimeout
81
+ }
82
+ : undefined
83
+ );
75
84
  }
76
85
 
77
86
  return result.data;
@@ -26,7 +26,7 @@ export class BroadcastAction implements RendererAction {
26
26
  event: RendererEvent<any>
27
27
  ) {
28
28
  if (!action.eventName) {
29
- console.warn('eventName 未定义,请定义事件名称');
29
+ console.error('eventName 未定义,请定义事件名称');
30
30
  return;
31
31
  }
32
32
 
@@ -49,11 +49,10 @@ export class CmptAction implements RendererAction {
49
49
 
50
50
  // 数据更新
51
51
  if (action.actionType === 'setValue') {
52
- const value = dataMapping(action.value, event.data);
53
52
  if (component.setData) {
54
- return component.setData(value);
53
+ return component.setData(action.args?.value);
55
54
  } else {
56
- return component.props.onChange?.(value);
55
+ return component.props.onChange?.(action.args?.value);
57
56
  }
58
57
  }
59
58
 
@@ -4,13 +4,15 @@ import {
4
4
  RendererAction,
5
5
  ListenerAction,
6
6
  ListenerContext,
7
- LoopStatus,
8
7
  registerAction
9
8
  } from './Action';
10
9
 
11
10
  export interface ICopyAction extends ListenerAction {
12
- content: string;
13
- copyFormat?: string;
11
+ args: {
12
+ content: string;
13
+ copyFormat?: string;
14
+ [propName: string]: any;
15
+ };
14
16
  }
15
17
 
16
18
  /**
@@ -26,9 +28,13 @@ export class CopyAction implements RendererAction {
26
28
  renderer: ListenerContext,
27
29
  event: RendererEvent<any>
28
30
  ) {
29
- if (action.content) {
30
- renderer.props.env.copy?.(filter(action.content, action.args, '| raw'), {
31
- format: action.copyFormat
31
+ if (!renderer.props.env?.copy) {
32
+ throw new Error('env.copy is required!');
33
+ }
34
+
35
+ if (action.args?.content) {
36
+ renderer.props.env.copy?.(action.args.content, {
37
+ format: action.args?.copyFormat ?? 'text/html'
32
38
  });
33
39
  }
34
40
  }
@@ -8,12 +8,18 @@ import {
8
8
  } from './Action';
9
9
 
10
10
  export interface IAlertAction extends ListenerAction {
11
- msg: string;
11
+ args: {
12
+ msg: string;
13
+ [propName: string]: any;
14
+ };
12
15
  }
13
16
 
14
17
  export interface IConfirmAction extends ListenerAction {
15
- title: string;
16
- msg: string;
18
+ args: {
19
+ title: string;
20
+ msg: string;
21
+ [propName: string]: any;
22
+ };
17
23
  }
18
24
 
19
25
  export interface IDialogAction extends ListenerAction {
@@ -76,7 +82,7 @@ export class AlertAction implements RendererAction {
76
82
  renderer: ListenerContext,
77
83
  event: RendererEvent<any>
78
84
  ) {
79
- event.context.env.alert?.(action.msg);
85
+ event.context.env.alert?.(action.args?.msg);
80
86
  }
81
87
  }
82
88
 
@@ -89,7 +95,7 @@ export class ConfirmAction implements RendererAction {
89
95
  renderer: ListenerContext,
90
96
  event: RendererEvent<any>
91
97
  ) {
92
- event.context.env.confirm?.(action.msg, action.title);
98
+ event.context.env.confirm?.(action.args?.msg, action.args?.title);
93
99
  }
94
100
  }
95
101
 
@@ -11,11 +11,14 @@ import {
11
11
  } from './Action';
12
12
 
13
13
  export interface IEmailAction extends ListenerAction {
14
- to: string;
15
- cc: string;
16
- bcc: string;
17
- subject: string;
18
- body: string;
14
+ args: {
15
+ to: string;
16
+ cc: string;
17
+ bcc: string;
18
+ subject: string;
19
+ body: string;
20
+ [propName: string]: any;
21
+ };
19
22
  }
20
23
 
21
24
  /**
@@ -31,11 +34,8 @@ export class EmailAction implements RendererAction {
31
34
  renderer: ListenerContext,
32
35
  event: RendererEvent<any>
33
36
  ) {
34
- const mailTo = filter(action.to, action.args);
35
- const mailInfo = mapValues(
36
- pick(action, 'cc', 'bcc', 'subject', 'body'),
37
- val => filter(val, action.args)
38
- );
37
+ const mailTo = action.args?.to;
38
+ const mailInfo = pick(action.args ?? {}, 'cc', 'bcc', 'subject', 'body');
39
39
  const mailStr = qs.stringify(mailInfo);
40
40
  const mailto = `mailto:${mailTo}?${mailStr}`;
41
41
 
@@ -3,6 +3,7 @@ import {buildApi} from '../utils/api';
3
3
  import {isEmpty, isObject, qsstringify} from '../utils/helper';
4
4
  import {RendererEvent} from '../utils/renderer-event';
5
5
  import {filter} from '../utils/tpl';
6
+ import omit from 'lodash/omit';
6
7
  import {
7
8
  RendererAction,
8
9
  ListenerAction,
@@ -11,20 +12,26 @@ import {
11
12
  } from './Action';
12
13
 
13
14
  export interface ILinkAction extends ListenerAction {
14
- link: string;
15
- url?: never;
16
- blank?: boolean;
17
- params?: {
18
- [key: string]: string;
15
+ args: {
16
+ link: string;
17
+ url?: never;
18
+ blank?: boolean;
19
+ params?: {
20
+ [key: string]: string;
21
+ };
22
+ [propName: string]: any;
19
23
  };
20
24
  }
21
25
 
22
26
  export interface IUrlAction extends ListenerAction {
23
- url: string;
24
- link?: never;
25
- blank?: boolean;
26
- params?: {
27
- [key: string]: string;
27
+ args: {
28
+ url: string;
29
+ link?: never;
30
+ blank?: boolean;
31
+ params?: {
32
+ [key: string]: string;
33
+ };
34
+ [propName: string]: any;
28
35
  };
29
36
  }
30
37
 
@@ -37,7 +44,7 @@ export interface IUrlAction extends ListenerAction {
37
44
  */
38
45
  export class LinkAction implements RendererAction {
39
46
  async run(
40
- action: ILinkAction | IUrlAction,
47
+ action: ListenerAction,
41
48
  renderer: ListenerContext,
42
49
  event: RendererEvent<any>
43
50
  ) {
@@ -48,16 +55,26 @@ export class LinkAction implements RendererAction {
48
55
  // 通过buildApi兼容较复杂的url情况
49
56
  let urlObj = buildApi(
50
57
  {
51
- url: (action.url || action.link) as string,
58
+ url: (action.args?.url || action.args?.link) as string,
52
59
  method: 'get'
53
60
  },
54
- {...action.params, ...action.args},
61
+ {
62
+ ...(action.args?.params ?? {}),
63
+ ...omit(action.args ?? {}, ['params', 'blank', 'url', 'link'])
64
+ },
55
65
  {
56
66
  autoAppend: true
57
67
  }
58
68
  );
59
69
 
60
- renderer.props.env.jumpTo(urlObj.url, action as Action, action.args);
70
+ renderer.props.env.jumpTo(
71
+ urlObj.url,
72
+ {
73
+ actionType: action.actionType,
74
+ ...action.args
75
+ },
76
+ action.args
77
+ );
61
78
  }
62
79
  }
63
80
 
@@ -13,7 +13,10 @@ import {
13
13
  import {resolveVariable} from '../utils/tpl-builtin';
14
14
 
15
15
  export interface ILoopAction extends ListenerAction, LogicAction {
16
- loopName: string;
16
+ args: {
17
+ loopName: string;
18
+ [propName: string]: any;
19
+ };
17
20
  }
18
21
 
19
22
  /**
@@ -30,18 +33,19 @@ export class LoopAction implements RendererAction {
30
33
  event: RendererEvent<any>,
31
34
  mergeData: any
32
35
  ) {
33
- if (typeof action.loopName !== 'string') {
34
- console.warn('loopName 必须是字符串类型');
36
+ const loopName = action.args?.loopName;
37
+ if (typeof loopName !== 'string') {
38
+ console.error('loopName 必须是字符串类型');
35
39
  return;
36
40
  }
37
41
 
38
- const loopData = resolveVariable(action.loopName, mergeData) || [];
42
+ const loopData = resolveVariable(loopName, mergeData) || [];
39
43
 
40
44
  // 必须是数组
41
45
  if (!loopData) {
42
- console.warn(`没有找到数据 ${action.loopName}`);
46
+ console.error(`没有找到数据 ${loopName}`);
43
47
  } else if (!Array.isArray(loopData)) {
44
- console.warn(`${action.loopName} 数据不是数组`);
48
+ console.error(`${loopName} 数据不是数组`);
45
49
  } else if (action.children?.length) {
46
50
  // 暂存一下
47
51
  const protoData = event.data;
@@ -62,6 +66,7 @@ export class LoopAction implements RendererAction {
62
66
  if (renderer.loopStatus === LoopStatus.BREAK || event.stoped) {
63
67
  // 还原事件数据
64
68
  event.setData(protoData);
69
+ event.stopPropagation();
65
70
  break;
66
71
  }
67
72
  }
@@ -7,7 +7,10 @@ import {
7
7
  } from './Action';
8
8
 
9
9
  export interface IPageGoAction extends ListenerAction {
10
- delta?: number;
10
+ args: {
11
+ delta?: number;
12
+ [propName: string]: any;
13
+ };
11
14
  }
12
15
 
13
16
  /**
@@ -40,7 +43,7 @@ export class PageGoAction implements RendererAction {
40
43
  renderer: ListenerContext,
41
44
  event: RendererEvent<any>
42
45
  ) {
43
- window.history.go(action.delta || 0);
46
+ window.history.go(action.args?.delta || 0);
44
47
  }
45
48
  }
46
49
 
@@ -32,8 +32,15 @@ export class ToastAction implements RendererAction {
32
32
  renderer: ListenerContext,
33
33
  event: RendererEvent<any>
34
34
  ) {
35
- const msg = resolveVariableAndFilter(action.msg, action.args, '| raw');
36
- event.context.env.notify?.(action.msgType || 'info', String(msg), action);
35
+ if (!renderer.props.env?.notify) {
36
+ throw new Error('env.notify is required!');
37
+ }
38
+
39
+ event.context.env.notify?.(
40
+ action.args?.msgType || 'info',
41
+ String(action.args?.msg),
42
+ action.args
43
+ );
37
44
  }
38
45
  }
39
46
 
@@ -614,7 +614,7 @@ export class Action extends React.Component<ActionProps, ActionState> {
614
614
  const {onAction, disabled, countDown, env} = this.props;
615
615
 
616
616
  // https://reactjs.org/docs/legacy-event-pooling.html
617
- e.persist();
617
+ // e.persist(); // react 17之后去掉 event pooling 了,这个应该没用了
618
618
  let onClick = this.props.onClick;
619
619
 
620
620
  if (typeof onClick === 'string') {
@@ -434,7 +434,7 @@ export default class ComboControl extends React.Component<ComboProps> {
434
434
  }
435
435
 
436
436
  getValueAsArray(props = this.props) {
437
- const {flat, joinValues, delimiter} = props;
437
+ const {flat, joinValues, delimiter, type} = props;
438
438
  let value = props.value;
439
439
 
440
440
  if (joinValues && flat && typeof value === 'string') {
@@ -581,7 +581,7 @@ export default class ComboControl extends React.Component<ComboProps> {
581
581
  }
582
582
 
583
583
  handleChange(values: any, diff: any, {index}: any) {
584
- const {flat, store, joinValues, delimiter, disabled, submitOnChange} =
584
+ const {flat, store, joinValues, delimiter, disabled, submitOnChange, type} =
585
585
  this.props;
586
586
 
587
587
  if (disabled) {
@@ -595,7 +595,23 @@ export default class ComboControl extends React.Component<ComboProps> {
595
595
  value = value.join(delimiter || ',');
596
596
  }
597
597
 
598
- this.props.onChange(value, submitOnChange, true);
598
+ if (type === 'input-kv') {
599
+ let hasDuplicateKey = false;
600
+ const keys: {[key: string]: boolean} = {};
601
+ for (const item of value) {
602
+ if (keys[item.key]) {
603
+ hasDuplicateKey = true;
604
+ } else {
605
+ keys[item.key] = true;
606
+ }
607
+ }
608
+ // 有重复值就不触发修改,因为 KV 模式下无法支持重复值
609
+ if (!hasDuplicateKey) {
610
+ this.props.onChange(value, submitOnChange, true);
611
+ }
612
+ } else {
613
+ this.props.onChange(value, submitOnChange, true);
614
+ }
599
615
 
600
616
  store.forms.forEach(
601
617
  form =>
@@ -122,7 +122,7 @@ export default class TreeControl extends React.Component<TreeProps> {
122
122
  onChange && onChange(resetValue ?? '');
123
123
  }
124
124
  if (action.actionType === 'expand') {
125
- this.treeRef.syncUnFolded(this.props, action.openLevel);
125
+ this.treeRef.syncUnFolded(this.props, action.args.openLevel);
126
126
  }
127
127
  if (action.actionType === 'collapse') {
128
128
  this.treeRef.syncUnFolded(this.props, 0);
@@ -648,7 +648,7 @@ export default class Wizard extends React.Component<WizardProps, WizardState> {
648
648
  const previous = store.data;
649
649
  const final = {...previous, ...values};
650
650
 
651
- if (await this.dispatchEvent('change', {formData: final})) {
651
+ if (await this.dispatchEvent('change', final)) {
652
652
  return;
653
653
  }
654
654
 
@@ -692,7 +692,7 @@ export default class Wizard extends React.Component<WizardProps, WizardState> {
692
692
  onFinished
693
693
  } = this.props;
694
694
 
695
- if (await this.dispatchEvent('finished', {formData: store.data})) {
695
+ if (await this.dispatchEvent('finished', store.data)) {
696
696
  return;
697
697
  }
698
698
 
@@ -719,7 +719,7 @@ export default class Wizard extends React.Component<WizardProps, WizardState> {
719
719
  formStore
720
720
  .saveRemote(action.api || step.api || api!, store.data, {
721
721
  onSuccess: () => {
722
- this.dispatchEvent('submitSucc', {formData: store.data});
722
+ this.dispatchEvent('submitSucc', store.data);
723
723
 
724
724
  if (
725
725
  !isEffectiveApi(finnalAsyncApi, store.data) ||
@@ -19,22 +19,15 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
19
19
  const arr: Array<any> = [];
20
20
  Object.keys(value).forEach(key => {
21
21
  const valueType = typeof value[key];
22
- if (key.endsWith('___tmp')) {
23
- arr.push({
24
- key: key.replace('___tmp', ''),
25
- value: ''
26
- });
27
- } else {
28
- arr.push({
29
- key: key || '',
30
- value:
31
- valueType === 'string' ||
32
- valueType === 'number' ||
33
- valueType === 'boolean'
34
- ? value[key]
35
- : JSON.stringify(value[key])
36
- });
37
- }
22
+ arr.push({
23
+ key: key || '',
24
+ value:
25
+ valueType === 'string' ||
26
+ valueType === 'number' ||
27
+ valueType === 'boolean'
28
+ ? value[key]
29
+ : JSON.stringify(value[key])
30
+ });
38
31
  });
39
32
  return arr;
40
33
  },
@@ -52,12 +45,7 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
52
45
  } catch (e) {}
53
46
  }
54
47
 
55
- // 如果先输入了 a 作为 key,想输入 aa 的时候会先进入这里,导致无法输入 aa,因此当遇到 key 相同的时候加个 ___tmp 后缀
56
- if (key in obj) {
57
- obj[key + '___tmp'] = value;
58
- } else {
59
- obj[key] = value;
60
- }
48
+ obj[key] = value;
61
49
  });
62
50
  return obj;
63
51
  },
@@ -67,7 +55,8 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
67
55
  type: 'input-text',
68
56
  unique: true,
69
57
  name: 'key',
70
- required: true
58
+ required: true,
59
+ validateOnChange: true
71
60
  },
72
61
  {
73
62
  placeholder: schema.valuePlaceholder ?? 'Value',
@@ -497,7 +497,7 @@ export const TableStore = iRendererStore
497
497
  prev.has.push(current);
498
498
  } else {
499
499
  groups.push({
500
- label: current.groupName,
500
+ label: current.groupName || ' ', // 如果中间没有配置groupName,那么样式会错乱,这里加一个空白字符,当做一个占位表头
501
501
  colSpan: 1,
502
502
  rowSpan: 1,
503
503
  index: current.index,
@@ -13,7 +13,7 @@ export default function handleAction(
13
13
  data?: any
14
14
  ) {
15
15
  // https://reactjs.org/docs/legacy-event-pooling.html
16
- e.persist();
16
+ // e.persist(); // react 17之后去掉 event pooling 了,这个应该没用了
17
17
 
18
18
  const onAction = props.onAction;
19
19
  let onClick: any = action.onClick;