@steroidsjs/core 2.2.55 → 2.2.58

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "2.2.55",
3
+ "version": "2.2.58",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -25,6 +25,7 @@ exports.__esModule = true;
25
25
  var React = __importStar(require("react"));
26
26
  var fieldWrapper_1 = __importDefault(require("../Field/fieldWrapper"));
27
27
  function BlankField(props) {
28
- return React.createElement("span", null, props.text || props.children);
28
+ var _a;
29
+ return React.createElement("span", null, props.text || props.children || ((_a = props.input) === null || _a === void 0 ? void 0 : _a.value));
29
30
  }
30
31
  exports["default"] = fieldWrapper_1["default"]('BlankField', BlankField);
@@ -57,7 +57,7 @@ function FileField(props) {
57
57
  uid: file.getUid(),
58
58
  fileId: data.id || null,
59
59
  title: file.getName(),
60
- size: props.size,
60
+ size: data.size || data.fileSize,
61
61
  disabled: props.disabled,
62
62
  showRemove: props.showRemove,
63
63
  onRemove: function () { return onRemove(file); },
@@ -153,6 +153,7 @@ export interface IFormViewProps {
153
153
  onSubmit: any;
154
154
  className?: CssClassName;
155
155
  isBordered?: boolean;
156
+ autoFocus?: boolean;
156
157
  style?: any;
157
158
  layout?: {
158
159
  layout: FormLayoutName | boolean;
@@ -131,19 +131,6 @@ function Form(props) {
131
131
  react_use_1.useUpdateEffect(function () {
132
132
  updateQuery(values);
133
133
  }, [updateQuery, values]);
134
- // Auto focus
135
- react_use_1.useMount(function () {
136
- if (props.autoFocus && process.env.IS_WEB) {
137
- // TODO
138
- /*const element: any = findDOMNode(this);
139
- const inputEl = element.querySelector('input:not([type=hidden])');
140
- setTimeout(() => {
141
- if (inputEl && inputEl.focus) {
142
- inputEl.focus();
143
- }
144
- }, 10);*/
145
- }
146
- });
147
134
  // Auto save
148
135
  react_use_1.useUpdateEffect(function () {
149
136
  if (props.autoSave && values) {
@@ -346,7 +333,7 @@ function Form(props) {
346
333
  ? components.ui.renderView(props.view || 'form.FormView', __assign(__assign({}, props.viewProps), { isInvalid: isInvalid,
347
334
  isSubmitting: isSubmitting,
348
335
  layout: layout,
349
- onSubmit: onSubmit, submitLabel: props.submitLabel, fields: props.fields, children: props.children, isBordered: props.isBordered, className: props.className, style: props.style }))
336
+ onSubmit: onSubmit, submitLabel: props.submitLabel, fields: props.fields, children: props.children, isBordered: props.isBordered, className: props.className, style: props.style, autoFocus: props.autoFocus }))
350
337
  : props.children));
351
338
  }
352
339
  Form.defaultProps = {