@pareto-engineering/design-system 4.9.1 → 4.9.2

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.
@@ -101,6 +101,7 @@ const FileUpload = _ref => {
101
101
  });
102
102
  };
103
103
  const acceptOptions = Array.isArray(accept) ? accept?.join(',') : accept;
104
+ const isAnyFileUploading = Object.values(uploadStatus ?? {})?.map(e => e?.status)?.some(status => status === 'pending');
104
105
  return /*#__PURE__*/React.createElement("div", {
105
106
  id: id,
106
107
  className: [baseClassName, componentClassName, userClassName, `preview-${filePreviewAlignment}`, `y-${color}`].filter(e => e).join(' '),
@@ -119,7 +120,7 @@ const FileUpload = _ref => {
119
120
  type: "file",
120
121
  accept: acceptOptions,
121
122
  multiple: multiple || maxCount && maxCount > 0,
122
- disabled: disabled,
123
+ disabled: disabled || isAnyFileUploading,
123
124
  onChange: handleChange
124
125
  }), /*#__PURE__*/React.createElement("span", {
125
126
  className: "ai-icon"
@@ -226,7 +227,8 @@ FileUpload.defaultProps = {
226
227
  disabled: false,
227
228
  color: 'paragraph',
228
229
  filePreviewAlignment: 'bottom',
229
- viewOnly: false
230
+ viewOnly: false,
231
+ multiple: true
230
232
  };
231
233
  FileUpload.Preview = _common.Preview;
232
234
  var _default = exports.default = FileUpload;
@@ -90,6 +90,7 @@ const FileUpload = ({
90
90
  });
91
91
  };
92
92
  const acceptOptions = Array.isArray(accept) ? accept?.join(',') : accept;
93
+ const isAnyFileUploading = Object.values(uploadStatus ?? {})?.map(e => e?.status)?.some(status => status === 'pending');
93
94
  return /*#__PURE__*/React.createElement("div", {
94
95
  id: id,
95
96
  className: [baseClassName, componentClassName, userClassName, `preview-${filePreviewAlignment}`, `y-${color}`].filter(e => e).join(' '),
@@ -108,7 +109,7 @@ const FileUpload = ({
108
109
  type: "file",
109
110
  accept: acceptOptions,
110
111
  multiple: multiple || maxCount && maxCount > 0,
111
- disabled: disabled,
112
+ disabled: disabled || isAnyFileUploading,
112
113
  onChange: handleChange
113
114
  }), /*#__PURE__*/React.createElement("span", {
114
115
  className: "ai-icon"
@@ -215,7 +216,8 @@ FileUpload.defaultProps = {
215
216
  disabled: false,
216
217
  color: 'paragraph',
217
218
  filePreviewAlignment: 'bottom',
218
- viewOnly: false
219
+ viewOnly: false,
220
+ multiple: true
219
221
  };
220
222
  FileUpload.Preview = Preview;
221
223
  export default FileUpload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "4.9.1",
3
+ "version": "4.9.2",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -82,5 +82,5 @@
82
82
  "relay-test-utils": "^15.0.0"
83
83
  },
84
84
  "browserslist": "> 2%",
85
- "gitHead": "eb386a252643ab5658f474ec7cc42c3d4e645f02"
85
+ "gitHead": "d7034652bbfb7fa7362d9cedaa04ae23fc8323ad"
86
86
  }
@@ -98,6 +98,8 @@ const FileUpload = ({
98
98
 
99
99
  const acceptOptions = Array.isArray(accept) ? accept?.join(',') : accept
100
100
 
101
+ const isAnyFileUploading = Object.values(uploadStatus ?? {})?.map((e) => e?.status)?.some((status) => status === 'pending')
102
+
101
103
  return (
102
104
  <div
103
105
  id={id}
@@ -128,7 +130,7 @@ const FileUpload = ({
128
130
  type="file"
129
131
  accept={acceptOptions}
130
132
  multiple={multiple || (maxCount && maxCount > 0)}
131
- disabled={disabled}
133
+ disabled={disabled || isAnyFileUploading}
132
134
  onChange={handleChange}
133
135
  />
134
136
  <span className="ai-icon">
@@ -270,6 +272,7 @@ FileUpload.defaultProps = {
270
272
  color :'paragraph',
271
273
  filePreviewAlignment:'bottom',
272
274
  viewOnly :false,
275
+ multiple :true,
273
276
  }
274
277
 
275
278
  FileUpload.Preview = Preview
@@ -27888,6 +27888,7 @@ exports[`Storyshots f/fields/FileUpload Base 1`] = `
27888
27888
  className="file"
27889
27889
  disabled={false}
27890
27890
  id="section_0_input_0"
27891
+ multiple={true}
27891
27892
  onChange={[Function]}
27892
27893
  type="file"
27893
27894
  />