@faasjs/ant-design 0.0.2-beta.329 → 0.0.2-beta.330

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/README.md CHANGED
@@ -37,4 +37,4 @@ Form are based on [Ant Design's Form component](https://ant.design/components/fo
37
37
 
38
38
  Form are based on [Ant Design's Form.Item component](https://ant.design/components/form/#Form.Item).
39
39
 
40
- <iframe src="https://codesandbox.io/s/faasjs-ant-design-formitem-olqg5" style="width:100%;height:500px;border:0;overflow:hidden;" title="faasjs-ant-design-formitem" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
40
+ <iframe src="https://codesandbox.io/embed/faasjs-ant-design-formitem-olqg5" style="width:100%;height:500px;border:0;overflow:hidden;" title="faasjs-ant-design-formitem" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
package/dist/index.js CHANGED
@@ -135,14 +135,14 @@ function FormItem(props) {
135
135
  }, computedProps.label)), fields.map((field) => /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, {
136
136
  key: field.key
137
137
  }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, {
138
- gutter: 16
138
+ gutter: 24
139
139
  }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, {
140
140
  span: 23
141
141
  }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, __spreadProps(__spreadValues({}, field), {
142
142
  noStyle: true
143
143
  }), /* @__PURE__ */ import_react.default.createElement(import_antd.Input, __spreadValues({}, computedProps.input)))), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, {
144
144
  span: 1
145
- }, !computedProps.rules.find((r) => r.required) && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, {
145
+ }, (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, {
146
146
  danger: true,
147
147
  type: "link",
148
148
  style: { float: "right" },
@@ -177,7 +177,7 @@ function FormItem(props) {
177
177
  }, computedProps.label)), fields.map((field) => /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, {
178
178
  key: field.key
179
179
  }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, {
180
- gutter: 16
180
+ gutter: 24
181
181
  }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, {
182
182
  span: 23
183
183
  }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, __spreadProps(__spreadValues({}, field), {
@@ -186,7 +186,7 @@ function FormItem(props) {
186
186
  style: { width: "100%" }
187
187
  }, computedProps.input)))), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, {
188
188
  span: 1
189
- }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, {
189
+ }, (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, {
190
190
  danger: true,
191
191
  type: "link",
192
192
  style: { float: "right" },
@@ -213,7 +213,7 @@ var Form = function(props) {
213
213
  var _a;
214
214
  return /* @__PURE__ */ import_react.default.createElement(import_antd2.Form, __spreadValues({}, props), (_a = props.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ import_react.default.createElement(FormItem, __spreadValues({
215
215
  key: item.id
216
- }, item))), /* @__PURE__ */ import_react.default.createElement(import_antd2.Button, {
216
+ }, item))), props.children, /* @__PURE__ */ import_react.default.createElement(import_antd2.Button, {
217
217
  htmlType: "submit",
218
218
  type: "primary"
219
219
  }, "Submit"));
package/dist/index.mjs CHANGED
@@ -118,14 +118,14 @@ function FormItem(props) {
118
118
  }, computedProps.label)), fields.map((field) => /* @__PURE__ */ React.createElement(AntdForm.Item, {
119
119
  key: field.key
120
120
  }, /* @__PURE__ */ React.createElement(Row, {
121
- gutter: 16
121
+ gutter: 24
122
122
  }, /* @__PURE__ */ React.createElement(Col, {
123
123
  span: 23
124
124
  }, /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadProps(__spreadValues({}, field), {
125
125
  noStyle: true
126
126
  }), /* @__PURE__ */ React.createElement(Input, __spreadValues({}, computedProps.input)))), /* @__PURE__ */ React.createElement(Col, {
127
127
  span: 1
128
- }, !computedProps.rules.find((r) => r.required) && /* @__PURE__ */ React.createElement(Button, {
128
+ }, (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ React.createElement(Button, {
129
129
  danger: true,
130
130
  type: "link",
131
131
  style: { float: "right" },
@@ -160,7 +160,7 @@ function FormItem(props) {
160
160
  }, computedProps.label)), fields.map((field) => /* @__PURE__ */ React.createElement(AntdForm.Item, {
161
161
  key: field.key
162
162
  }, /* @__PURE__ */ React.createElement(Row, {
163
- gutter: 16
163
+ gutter: 24
164
164
  }, /* @__PURE__ */ React.createElement(Col, {
165
165
  span: 23
166
166
  }, /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadProps(__spreadValues({}, field), {
@@ -169,7 +169,7 @@ function FormItem(props) {
169
169
  style: { width: "100%" }
170
170
  }, computedProps.input)))), /* @__PURE__ */ React.createElement(Col, {
171
171
  span: 1
172
- }, /* @__PURE__ */ React.createElement(Button, {
172
+ }, (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ React.createElement(Button, {
173
173
  danger: true,
174
174
  type: "link",
175
175
  style: { float: "right" },
@@ -196,7 +196,7 @@ var Form = function(props) {
196
196
  var _a;
197
197
  return /* @__PURE__ */ React.createElement(AntdForm2, __spreadValues({}, props), (_a = props.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ React.createElement(FormItem, __spreadValues({
198
198
  key: item.id
199
- }, item))), /* @__PURE__ */ React.createElement(Button2, {
199
+ }, item))), props.children, /* @__PURE__ */ React.createElement(Button2, {
200
200
  htmlType: "submit",
201
201
  type: "primary"
202
202
  }, "Submit"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.2-beta.329",
3
+ "version": "0.0.2-beta.330",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",