dropzone_input 1.1.1 → 2.0.0

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: 0a282646878001432fa9f7ea3f9ef9845b681e47d4f365bdf5f7dea4ce6d2775
4
- data.tar.gz: b8ccddf7ef9ca778d1f3e8f85977fa4d4b1ce20571b51f850cd056b0b05ca00c
3
+ metadata.gz: b769e1c9e608c81220cdf2347457b4a473c76e0fd7b1ee73deb4e0d90d38cf1d
4
+ data.tar.gz: bf793f5d943d8b0b2d5e140b2fb0546ee9dac55dcc8da7897f9d5083982a0a93
5
5
  SHA512:
6
- metadata.gz: 236de3ec694675c8bb83b8c6f634cb41fb0427522a244dc0f65049e43f4545668bf36159c2be1fb57661815f892738c540996216eeb3bb2198d9a111d4e49ca1
7
- data.tar.gz: f9546fbb10ae5eaec063d6818551ddd6e8c91f139f13ad3e208cff1e27ef71fe4d0712f8e345e2b2e38dfd80f9b0d231a7e6108cf00fae8518091da0182fdacd
6
+ metadata.gz: ba69bbb62d9950ac32a2f6bcc4c0e6436be0ba76e1602cabe2992f7919ffd88046a20a4839cd041694a86dad1a801183949f7db7c0b041beff04b06944148a34
7
+ data.tar.gz: 89701e527dbe42d752ca1a444c0915246f21c71a516075a481fbe3b2aa5b3c4d5d3654df13384d61b4b2e445b0669f87918d11696dc9664959ebc781120565f3
data/README.md CHANGED
@@ -15,6 +15,25 @@ A Rails helper and Stimulus Controller that makes adding dropzone to a Rails for
15
15
  specific styles, etc) will be non-configurable at the moment. We will work to generalize this over
16
16
  time and *pull requests are welcome* and will be reviewed quickly.
17
17
 
18
+ ## Options & Events
19
+
20
+ | Option Name | Description |
21
+ | -- | -- |
22
+ | `max_files` | default: `null` |
23
+ | `max_file_size` | default: `null` |
24
+ | `max_thumbnail_file_size` | default: `10` |
25
+ | `parallel_uploads` | default: `2` |
26
+
27
+ Events below receive `file` as first parameter.
28
+
29
+ | Event Name | Description |
30
+ | -- | -- |
31
+ | `file_added_event` | File added to queue |
32
+ | `file_progress_event` | Periodically called while file is being uploaded. `progress` in the second parameter, or through the `upload` property: `file.upload.progress`, `file.upload.bytesSent` |
33
+ | `file_removed_event` | File removed from queue |
34
+ | `file_start_event` | File will start uploading |
35
+ | `file_success_event` | File successfully uploaded |
36
+
18
37
  ## Installation
19
38
 
20
39
  Add to your Gemfile.
@@ -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 %>
@@ -13,16 +13,22 @@ module DropzoneInput
13
13
  dropzone_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
- file_removed_event
20
18
  file_drop_event
19
+ file_drop_id
20
+ file_drop_over_id
21
21
  file_progress_event
22
+ file_removed_event
23
+ file_start_event
22
24
  file_success_event
25
+ max_file_size
26
+ max_files
27
+ max_thumbnail_file_size
28
+ parallel_uploads
23
29
  queue_complete_event
24
- file_drop_id
25
- file_drop_over_id
30
+ thumbnail_height
31
+ thumbnail_width
26
32
  ).each do |key|
27
33
  data["dropzone_#{key}".to_sym] = options.delete(key) if options.key?(key)
28
34
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DropzoneInput
4
- VERSION = '1.1.1'
4
+ VERSION = '2.0.0'
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.1.1
4
+ version: 2.0.0
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-12 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails