form-driver 0.3.12 → 0.3.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.
package/es/m3.js CHANGED
@@ -18005,12 +18005,15 @@ function ItemLabel(props) {
18005
18005
  }));
18006
18006
  }
18007
18007
 
18008
+ console.log('ItemLabel', props);
18009
+
18008
18010
  if (props.labelWidth) {
18011
+ // 防止 提示信息 换行
18009
18012
  return /*#__PURE__*/React.createElement("span", {
18010
18013
  className: "ItemLabel",
18011
18014
  style: {
18012
18015
  display: "inline-block",
18013
- width: props.labelWidth + 20
18016
+ width: props.labelWidth + 40
18014
18017
  }
18015
18018
  }, star, label, popoverDesc);
18016
18019
  } else {
@@ -21322,7 +21325,13 @@ function SubmitBar(props) {
21322
21325
  return /*#__PURE__*/React.createElement("div", {
21323
21326
  style: style,
21324
21327
  onClick: props.children ? onClick : undefined
21325
- }, props.children ? _.isFunction(props.children) ? props.children(loading) : props.children : /*#__PURE__*/React.createElement(Button, {
21328
+ }, props.onCancel ? /*#__PURE__*/React.createElement(Button, {
21329
+ style: {
21330
+ width: "40%",
21331
+ marginRight: '20px'
21332
+ },
21333
+ onClick: props.onCancel
21334
+ }, "\u8FD4\u56DE") : null, props.children ? _.isFunction(props.children) ? props.children(loading) : props.children : /*#__PURE__*/React.createElement(Button, {
21326
21335
  style: {
21327
21336
  width: "40%"
21328
21337
  },
package/lib/m3.js CHANGED
@@ -18027,12 +18027,15 @@ function ItemLabel(props) {
18027
18027
  }));
18028
18028
  }
18029
18029
 
18030
+ console.log('ItemLabel', props);
18031
+
18030
18032
  if (props.labelWidth) {
18033
+ // 防止 提示信息 换行
18031
18034
  return /*#__PURE__*/React__default["default"].createElement("span", {
18032
18035
  className: "ItemLabel",
18033
18036
  style: {
18034
18037
  display: "inline-block",
18035
- width: props.labelWidth + 20
18038
+ width: props.labelWidth + 40
18036
18039
  }
18037
18040
  }, star, label, popoverDesc);
18038
18041
  } else {
@@ -21344,7 +21347,13 @@ function SubmitBar(props) {
21344
21347
  return /*#__PURE__*/React__default["default"].createElement("div", {
21345
21348
  style: style,
21346
21349
  onClick: props.children ? onClick : undefined
21347
- }, props.children ? ___default["default"].isFunction(props.children) ? props.children(loading) : props.children : /*#__PURE__*/React__default["default"].createElement(antd.Button, {
21350
+ }, props.onCancel ? /*#__PURE__*/React__default["default"].createElement(antd.Button, {
21351
+ style: {
21352
+ width: "40%",
21353
+ marginRight: '20px'
21354
+ },
21355
+ onClick: props.onCancel
21356
+ }, "\u8FD4\u56DE") : null, props.children ? ___default["default"].isFunction(props.children) ? props.children(loading) : props.children : /*#__PURE__*/React__default["default"].createElement(antd.Button, {
21348
21357
  style: {
21349
21358
  width: "40%"
21350
21359
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "form-driver",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
4
4
  "description": "An efficient framework for creating forms.",
5
5
  "license": "MIT",
6
6
  "authors": [
@@ -135,6 +135,7 @@ export class MViewer extends React.Component<MViewerProp, State> {
135
135
  export function SubmitBar(props: {
136
136
  style?: React.CSSProperties,
137
137
  onSubmit?: (finalData: any) => Promise<any>,
138
+ onCancel?: () => void,
138
139
  children?: React.ReactNode | ((loading: boolean) => React.ReactNode)
139
140
  }): JSX.Element {
140
141
 
@@ -178,6 +179,9 @@ export function SubmitBar(props: {
178
179
  }
179
180
  };
180
181
  return <div style={style} onClick={props.children ? onClick : undefined}>
182
+ {
183
+ props.onCancel ? <Button style={{ width: "40%", marginRight: '20px' }} onClick={props.onCancel}>返回</Button> : null
184
+ }
181
185
  {
182
186
  props.children
183
187
  ? (_.isFunction(props.children) ? props.children(loading) : props.children)
@@ -35,8 +35,10 @@ function ItemLabel(props: { uispec?: M3UISpec, schema: MFieldSchema, labelWidth?
35
35
  </Popover>
36
36
  }
37
37
 
38
+ console.log('ItemLabel', props)
38
39
  if (props.labelWidth) {
39
- return <span className="ItemLabel" style={{ display: "inline-block", width: props.labelWidth + 20 }}>{star}{label}{popoverDesc}</span>;
40
+ // 防止 提示信息 换行
41
+ return <span className="ItemLabel" style={{ display: "inline-block", width: props.labelWidth + 40 }}>{star}{label}{popoverDesc}</span>;
40
42
  } else {
41
43
  return <div className="ItemLabel" key={"字段标题:" + props.schema.name}>{star}{label}{popoverDesc}</div>;
42
44
  }
@@ -74,6 +74,7 @@ export declare class MViewer extends React.Component<MViewerProp, State> {
74
74
  export declare function SubmitBar(props: {
75
75
  style?: React.CSSProperties;
76
76
  onSubmit?: (finalData: any) => Promise<any>;
77
+ onCancel?: () => void;
77
78
  children?: React.ReactNode | ((loading: boolean) => React.ReactNode);
78
79
  }): JSX.Element;
79
80
  export declare function useM3Database(initValue: any): [any, React.Dispatch<any>];