@awes-io/ui 2.114.2 → 2.115.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.115.0](https://github.com/awes-io/client/compare/@awes-io/ui@2.114.2...@awes-io/ui@2.115.0) (2024-11-14)
7
+
8
+
9
+ ### Features
10
+
11
+ * add max files for upload in uploader ([53a2237](https://github.com/awes-io/client/commit/53a2237eaaaadf48ae976e6452d7115f593c3138))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.114.2](https://github.com/awes-io/client/compare/@awes-io/ui@2.114.1...@awes-io/ui@2.114.2) (2024-11-01)
7
18
 
8
19
 
@@ -205,6 +205,16 @@ export default {
205
205
  processData: {
206
206
  type: Function,
207
207
  default: null
208
+ },
209
+
210
+ maxFiles: {
211
+ type: Number,
212
+ default: null
213
+ },
214
+
215
+ uploadedFilesNumber: {
216
+ type: Number,
217
+ default: null
208
218
  }
209
219
  },
210
220
 
@@ -300,7 +310,23 @@ export default {
300
310
  _uploadFile(files) {
301
311
  this.errorText = ''
302
312
 
303
- for (var i = files.length - 1; i >= 0; i--) {
313
+ let maxFilesForUpload = files.length - 1
314
+
315
+ if (this.maxFiles) {
316
+ maxFilesForUpload = this.maxFiles - this.uploadedFilesNumber - 1
317
+
318
+ if (files.length > maxFilesForUpload) {
319
+ this.$notify({
320
+ type: 'error',
321
+ title: this.$tc(
322
+ `ui.general.interface.max_upload_files__count`,
323
+ this.maxFiles
324
+ )
325
+ })
326
+ }
327
+ }
328
+
329
+ for (var i = maxFilesForUpload; i >= 0; i--) {
304
330
  const file = files[i]
305
331
  const errors = this._validateFile(file)
306
332
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awes-io/ui",
3
- "version": "2.114.2",
3
+ "version": "2.115.0",
4
4
  "description": "User Interface (UI) components",
5
5
  "keywords": [
6
6
  "ui",
@@ -114,5 +114,5 @@
114
114
  "rollup-plugin-visualizer": "^2.6.0",
115
115
  "rollup-plugin-vue": "^5.0.1"
116
116
  },
117
- "gitHead": "48217f0639aabe19ba1044e7cb7b3bf2307b5f35"
117
+ "gitHead": "e142d5ccc5bc0bc6769dcecfd4e8a6fc129e766b"
118
118
  }