@steroidsjs/core 2.2.56 → 2.2.59

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/hooks/useFile.js CHANGED
@@ -66,12 +66,9 @@ function useFile(props) {
66
66
  uploader.queue.add(normalizedInitialFiles_1
67
67
  .map(function (item) {
68
68
  var path = item.title || item.label || item.uid || item.id;
69
- var resultHttpMessage = {
70
- id: item.id || item.uid,
71
- images: item.thumbnailUrl
69
+ var resultHttpMessage = __assign(__assign({}, item), { id: item.id || item.uid, images: item.thumbnailUrl
72
70
  ? [{ url: item.thumbnailUrl }]
73
- : null
74
- };
71
+ : null });
75
72
  var file = uploader.queue.getByUid(item.uid);
76
73
  if (file) {
77
74
  file.setPath(path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/core",
3
- "version": "2.2.56",
3
+ "version": "2.2.59",
4
4
  "description": "",
5
5
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
6
6
  "repository": {
@@ -57,13 +57,14 @@ 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); },
64
64
  error: null,
65
65
  image: null,
66
- progress: null
66
+ progress: null,
67
+ item: data
67
68
  };
68
69
  // Add error
69
70
  if (file.getResult() === File_1["default"].RESULT_ERROR) {
@@ -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 = {