bard-file_field 0.1.5 → 0.1.6

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: 21a07daaa98d68d77291864ff9fd6d4d84c015839969e080a07bbc14c1090e16
4
- data.tar.gz: 65464101a67f2e72a5a5e52c2d88f81890d5114ec46fc79afde1b0ae9b3797a3
3
+ metadata.gz: 7e39ad76cc15f01d0d5b1eefde36318f418a6196d1e8fdcb5d4fecb674ab79fb
4
+ data.tar.gz: 2c52f5764af94cd65b2e8b39eb26ed9580579026e4c48867f83591485c97f71c
5
5
  SHA512:
6
- metadata.gz: 70538874bffa086fa2a73835e262117de7a7bffcc73b0d17bede1744078d071320cf14630413f7acc0c4ea36a229812a9386739c7ffb6f8aec8670277760a2a4
7
- data.tar.gz: 19078bfe61accc9cec5fea853a2bf8909846c9daa8688f740042d40bd6398b4078b66f7b236165b4394259b9016e4063116d15f78b2a13da79d29497ff2117fa
6
+ metadata.gz: a321f265e7c4190bb53376c611dfaa856d9d4e9a27101679f993714e04c3ae1e6313f72b2c350acfb8298163d5b24f30c9931de6af4df31185e7278e5dc59787
7
+ data.tar.gz: f8376513f28da24329a2cfaa6b8107d8a2a5834477582bc374523a8239e01088ccfd6d6bf16768e7a6e80431c978ae430e4829762e984ba94af7403e60827f39
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bard-file_field (0.1.5)
4
+ bard-file_field (0.1.6)
5
5
  activestorage (>= 7.1.0)
6
6
 
7
7
  GEM
@@ -4765,6 +4765,7 @@ const bardFileCss = ":host{display:block;padding:25px;color:var(--bard-file-text
4765
4765
  const BardFile$1 = /*@__PURE__*/ proxyCustomElement(class BardFile extends H {
4766
4766
  get el() { return this; }
4767
4767
  forceUpdate() { this._forceUpdate = !this._forceUpdate; }
4768
+ form;
4768
4769
  fileTargetId;
4769
4770
  fileTarget;
4770
4771
  hiddenTargetId;
@@ -4789,7 +4790,9 @@ const BardFile$1 = /*@__PURE__*/ proxyCustomElement(class BardFile extends H {
4789
4790
  }
4790
4791
  componentWillLoad() {
4791
4792
  this.el.removeAttribute("id");
4792
- FormController.instance(this.el.closest("form"));
4793
+ this.form = this.el.closest("form");
4794
+ this.form.addEventListener("reset", () => this.reset());
4795
+ FormController.instance(this.form);
4793
4796
  const existingFiles = Array.from(this.el.children).filter(e => e.tagName == "UPLOADED-FILE");
4794
4797
  if (existingFiles.length > 0)
4795
4798
  this.files = existingFiles;
@@ -4818,6 +4821,9 @@ const BardFile$1 = /*@__PURE__*/ proxyCustomElement(class BardFile extends H {
4818
4821
  }));
4819
4822
  }
4820
4823
  }
4824
+ reset() {
4825
+ this.value = [];
4826
+ }
4821
4827
  fileTargetChanged(event) {
4822
4828
  if (event.target !== this.fileTarget)
4823
4829
  return;
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bard
4
4
  module FileField
5
- VERSION = "0.1.5"
5
+ VERSION = "0.1.6"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard-file_field
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-18 00:00:00.000000000 Z
11
+ date: 2025-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activestorage