bard-file_field 0.1.4 → 0.1.6

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: 7de4ce1da2e32861039b0a20df05ba9a03ee1432bd13070d8aba19cc0e6297ee
4
- data.tar.gz: b7827c0fdd0a5c738eabbaee1ef5367e5a3c692dcd083f5f1c5a5773d08d4e91
3
+ metadata.gz: 7e39ad76cc15f01d0d5b1eefde36318f418a6196d1e8fdcb5d4fecb674ab79fb
4
+ data.tar.gz: 2c52f5764af94cd65b2e8b39eb26ed9580579026e4c48867f83591485c97f71c
5
5
  SHA512:
6
- metadata.gz: 2cfe86858cfb2ce85d9e015e183d826aaeca3d80dae4cf54834e6efa0cac2d60cd118f6508d9266f1eead98efaa582c24f5865d618539a25bd361d51c35afce0
7
- data.tar.gz: da3b9c98a3e163c79e80019ed605f33b8543d15c28100d91140ea127728ad1d548ea04e8391fc037b153955583f264c80d8b834c5689b20f8d527f7f33e989cb
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.4)
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,8 +4790,12 @@ 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.files = Array.from(this.el.children).filter(e => e.tagName == "UPLOADED-FILE");
4793
+ this.form = this.el.closest("form");
4794
+ this.form.addEventListener("reset", () => this.reset());
4795
+ FormController.instance(this.form);
4796
+ const existingFiles = Array.from(this.el.children).filter(e => e.tagName == "UPLOADED-FILE");
4797
+ if (existingFiles.length > 0)
4798
+ this.files = existingFiles;
4794
4799
  }
4795
4800
  // Methods
4796
4801
  get files() {
@@ -4816,6 +4821,9 @@ const BardFile$1 = /*@__PURE__*/ proxyCustomElement(class BardFile extends H {
4816
4821
  }));
4817
4822
  }
4818
4823
  }
4824
+ reset() {
4825
+ this.value = [];
4826
+ }
4819
4827
  fileTargetChanged(event) {
4820
4828
  if (event.target !== this.fileTarget)
4821
4829
  return;
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bard
4
4
  module FileField
5
- VERSION = "0.1.4"
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.4
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-08-19 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