dropzone_input 1.2.0 → 2.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b6978df16683e71da246485abbe9c61910077247541602e200a05ad0efdd905
4
- data.tar.gz: fe74ecd3c03b1ae6e7aac747ea4544e9c6dc8ab528ae6c816b19d26e79a555b2
3
+ metadata.gz: e12f999be8ae6a38ad2f0d3df3254ffc4b17676079236251707eeacae2a3869d
4
+ data.tar.gz: ec8be72e58e43ebe31279362b19d28055e060bc785aaa6b332f55a042ee3f8cc
5
5
  SHA512:
6
- metadata.gz: d3fbc2dfe54ad8085941b3f942323f52ae3216835601ec0e0c491b1427f98c1ee2503e08d6e18dbee692938473f809ad370f2c7e7d59571d462c945b1443a2b7
7
- data.tar.gz: 52576d435d1818871a8498890cfba6540220e14e3947a8ce750a26a658dfa0efeac57ab81ad59ec9576c47e9a433800a1782df04658e41ccea5904cf3911c3af
6
+ metadata.gz: 267510212e294392cf3223db8c821047876405ad8d3f4657df9cc474fe0b35b50608bd15f5a6c7a1386b3e385ae49bfc9d2853cf829e5100f12772bad8335814
7
+ data.tar.gz: f199deb4b8eff90a4b5716859098642c10412109a8ce74543372eef2a604f5f4332b5648419afa7df4e382b1d4c9fe72bb9d9e07a63304e28412f3fd50e72465
data/README.md CHANGED
@@ -21,6 +21,7 @@ time and *pull requests are welcome* and will be reviewed quickly.
21
21
  | -- | -- |
22
22
  | `max_files` | default: `null` |
23
23
  | `max_file_size` | default: `null` |
24
+ | `max_thumbnail_file_size` | default: `10` |
24
25
  | `parallel_uploads` | default: `2` |
25
26
 
26
27
  Events below receive `file` as first parameter.
@@ -1,9 +1,11 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg enable-background="new 0 0 72 43.2" version="1.1" viewBox="0 0 72 43.2" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" class="inline-block w-16 mb-1">
3
- <style type="text/css">
4
- .st0{fill:none;stroke:#424443;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
5
- </style>
6
- <polyline class="st0" points="28.3 26.3 34.4 20.3 40.4 26.3 34.4 20.3 34.4 42.3"/>
7
- <path class="st0" d="m22.1 33c-6.6 0-11.9-5.3-11.9-11.9s5.4-11.9 11.9-11.9c2.4-4.9 7.4-8.3 13.3-8.3 7.6 0 13.9 5.8 14.7 13.2 0.7-0.1 1.3-0.2 2-0.2 5.3 0 9.5 4.3 9.5 9.5s-4.1 9.6-9.4 9.6h-5.6"/>
8
- </svg>
9
- <h1 class="text-xl text-gray-700">Upload</h1>
1
+ <div class="dz-message dz-default">
2
+ <?xml version="1.0" encoding="UTF-8"?>
3
+ <svg enable-background="new 0 0 72 43.2" version="1.1" viewBox="0 0 72 43.2" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" class="inline-block w-16 mb-1">
4
+ <style type="text/css">
5
+ .st0{fill:none;stroke:#424443;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
6
+ </style>
7
+ <polyline class="st0" points="28.3 26.3 34.4 20.3 40.4 26.3 34.4 20.3 34.4 42.3"/>
8
+ <path class="st0" d="m22.1 33c-6.6 0-11.9-5.3-11.9-11.9s5.4-11.9 11.9-11.9c2.4-4.9 7.4-8.3 13.3-8.3 7.6 0 13.9 5.8 14.7 13.2 0.7-0.1 1.3-0.2 2-0.2 5.3 0 9.5 4.3 9.5 9.5s-4.1 9.6-9.4 9.6h-5.6"/>
9
+ </svg>
10
+ <h1 class="text-xl text-gray-700">Upload</h1>
11
+ </div>
@@ -1,4 +1,2 @@
1
1
  <%= form.file_field field, direct_upload: true, data: { 'dropzone-target': 'input' } %>
2
- <div class="dz-default dz-message">
3
- <%= yield %>
4
- </div>
2
+ <%= yield %>
@@ -10,11 +10,10 @@ module DropzoneInput
10
10
 
11
11
  data = {
12
12
  controller: 'dropzone',
13
- dropzone_accepted_files: ActiveStorage.variable_content_types.join(',')
13
+ dropzone_accepted_files: options.delete(:accepted_files) || ActiveStorage.variable_content_types.join(',')
14
14
  }
15
15
  %i(
16
- max_files
17
- max_file_size
16
+ croppable
18
17
  file_added_event
19
18
  file_drop_event
20
19
  file_drop_id
@@ -23,8 +22,13 @@ module DropzoneInput
23
22
  file_removed_event
24
23
  file_start_event
25
24
  file_success_event
25
+ max_file_size
26
+ max_files
27
+ max_thumbnail_file_size
26
28
  parallel_uploads
27
29
  queue_complete_event
30
+ thumbnail_height
31
+ thumbnail_width
28
32
  ).each do |key|
29
33
  data["dropzone_#{key}".to_sym] = options.delete(key) if options.key?(key)
30
34
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DropzoneInput
4
- VERSION = '1.2.0'
4
+ VERSION = '2.0.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dropzone_input
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trae Robrock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-15 00:00:00.000000000 Z
11
+ date: 2021-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails