polaris_view_components 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08aa4ac3025799e63c02f893d3fa9397ae3ea2940b672ed3670e36fae0c09b93'
4
- data.tar.gz: 58ad189ac881ae6b147d3e319c1d8fb490fad89a5a8cb289f382c480806e4782
3
+ metadata.gz: 6559d19f7338ce9195fa1903e58f14596006d813bbc30599061bce4c00d49c9d
4
+ data.tar.gz: 61223fea9beddaa96b4762b8b7dc00cf42051a462e92bab25733d6f35b232ae2
5
5
  SHA512:
6
- metadata.gz: 54244ec2572f296b21d4e786b21cda3d2bf826866bf684452b67410668ed05f08a9908bfba955fbc65fbf2ef2e45530c4e6f19bafcfa4ff2ddc8bad2315b6357
7
- data.tar.gz: d0dfce86c9d6ba9f534f64782a0ea534f16f15274f98124e7d5ae74974869ee75f83e1c37f61f92a0199b3053e9f0b0cdbb19167d886829a39e58f89b9a31720
6
+ metadata.gz: 8ad6e0a1dc0f3f491e6beeae7dc4c6c72a8a077ec0b6f6c4cc04e95723761aa93181d663ef9f9f52945d5fad3be40a9d3a3b7e3f64504f9e347925b733841fb5
7
+ data.tar.gz: 4b5b661dbd74e991dde7e7386f33b65caeaac53839b0c3c0d3951acb30f5179d1d007d97a08c058024c7e1a4e72d56fba8ba0d0a12729b885ebecf458a4116b3
data/README.md CHANGED
@@ -106,7 +106,7 @@ script/release
106
106
 
107
107
  To release npm package run:
108
108
  ```bash
109
- yarn release
109
+ npm run release
110
110
  ```
111
111
 
112
112
  ## License
@@ -34,11 +34,12 @@ export default class extends Controller {
34
34
  }
35
35
 
36
36
  files = []
37
- acceptedFiles = []
38
37
  rejectedFiles = []
39
38
  _dragging = false
40
39
  dragTargets = []
41
40
  previewRendered = false
41
+
42
+ _acceptedFiles = []
42
43
  _size = 'large'
43
44
 
44
45
  connect () {
@@ -448,6 +449,20 @@ export default class extends Controller {
448
449
 
449
450
  this.element.classList.add(this.getSizeClass(val))
450
451
  }
452
+
453
+ get acceptedFiles () {
454
+ return this._acceptedFiles
455
+ }
456
+
457
+ set acceptedFiles (val) {
458
+ this._acceptedFiles = val
459
+
460
+ const list = new DataTransfer()
461
+
462
+ val.forEach(file => list.items.add(file))
463
+
464
+ this.inputTarget.files = list.files
465
+ }
451
466
  }
452
467
 
453
468
  export function fileAccepted (file, accept) {
@@ -361,11 +361,11 @@ class Dropzone extends Controller {
361
361
  size: String
362
362
  };
363
363
  files=[];
364
- acceptedFiles=[];
365
364
  rejectedFiles=[];
366
365
  _dragging=false;
367
366
  dragTargets=[];
368
367
  previewRendered=false;
368
+ _acceptedFiles=[];
369
369
  _size="large";
370
370
  connect() {
371
371
  document.body.addEventListener("click", this.onExternalTriggerClick);
@@ -684,6 +684,15 @@ class Dropzone extends Controller {
684
684
  sizeClassesToRemove.forEach((className => this.element.classList.remove(className)));
685
685
  this.element.classList.add(this.getSizeClass(val));
686
686
  }
687
+ get acceptedFiles() {
688
+ return this._acceptedFiles;
689
+ }
690
+ set acceptedFiles(val) {
691
+ this._acceptedFiles = val;
692
+ const list = new DataTransfer;
693
+ val.forEach((file => list.items.add(file)));
694
+ this.inputTarget.files = list.files;
695
+ }
687
696
  }
688
697
 
689
698
  function fileAccepted(file, accept) {
@@ -1,5 +1,5 @@
1
1
  module Polaris
2
2
  module ViewComponents
3
- VERSION = "0.10.0"
3
+ VERSION = "0.10.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polaris_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Gamble
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-05-08 00:00:00.000000000 Z
12
+ date: 2022-06-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails