@startinblox/core 0.19.20 → 0.19.21-beta.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.
Files changed (2) hide show
  1. package/dist/index.js +35 -21
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -12492,16 +12492,25 @@ const FormFileMixin = {
12492
12492
  this.listAttributes["resetFile"] = this.resetFile.bind(this);
12493
12493
  },
12494
12494
  attached() {
12495
- document.addEventListener("reset", (e) => {
12496
- if (e.target && e.target.contains(this.element)) {
12495
+ this.element.closest("form").addEventListener("reset", this.resetFormFile.bind(this));
12496
+ this.element.closest("solid-form").addEventListener("populate", this.onPopulate.bind(this));
12497
+ },
12498
+ onPopulate() {
12499
+ const dataHolder = this.element.querySelector("input[data-holder]");
12500
+ dataHolder.value = this.value;
12501
+ dataHolder.dispatchEvent(new Event("change"));
12502
+ },
12503
+ resetFormFile(e) {
12504
+ if (e.target && e.target.contains(this.element)) {
12505
+ if (this.initialValue !== "") {
12497
12506
  this.value = this.initialValue;
12498
- this.listAttributes["resetButtonHidden"] = true;
12499
- this.planRender();
12500
- const dataHolder = this.element.querySelector("input[data-holder]");
12501
- dataHolder.value = this.value;
12502
- dataHolder.dispatchEvent(new Event("change"));
12503
12507
  }
12504
- });
12508
+ this.listAttributes["resetButtonHidden"] = true;
12509
+ this.planRender();
12510
+ const dataHolder = this.element.querySelector("input[data-holder]");
12511
+ dataHolder.value = this.value;
12512
+ dataHolder.dispatchEvent(new Event("change"));
12513
+ }
12505
12514
  },
12506
12515
  selectFile() {
12507
12516
  if (this.uploadUrl === null)
@@ -14076,6 +14085,11 @@ const formTemplates = {
14076
14085
  name=${ifDefined(attributes.name)}
14077
14086
  value=${value || ""}
14078
14087
  >
14088
+ <a
14089
+ href=${value || ""}
14090
+ ?hidden=${value === ""}
14091
+ >${value !== "" ? decodeURI(value.split("/").pop()) : ""}</a>
14092
+
14079
14093
  <input
14080
14094
  type="file"
14081
14095
  id=${ifDefined(attributes.id)}
@@ -53199,12 +53213,24 @@ const SolidForm = {
53199
53213
  name: "solid-form",
53200
53214
  use: [WidgetMixin, StoreMixin, NextMixin, ValidationMixin],
53201
53215
  attributes: {
53216
+ autosave: {
53217
+ type: Boolean,
53218
+ default: null
53219
+ },
53220
+ classSubmitButton: {
53221
+ type: String,
53222
+ default: void 0
53223
+ },
53202
53224
  defaultWidget: {
53203
53225
  type: String,
53204
53226
  default: "solid-form-label-text"
53205
53227
  },
53206
53228
  naked: {
53207
- type: String,
53229
+ type: Boolean,
53230
+ default: null
53231
+ },
53232
+ partial: {
53233
+ type: Boolean,
53208
53234
  default: null
53209
53235
  },
53210
53236
  submitButton: {
@@ -53218,18 +53244,6 @@ const SolidForm = {
53218
53244
  submitWidget: {
53219
53245
  type: String,
53220
53246
  default: null
53221
- },
53222
- classSubmitButton: {
53223
- type: String,
53224
- default: void 0
53225
- },
53226
- partial: {
53227
- type: Boolean,
53228
- default: null
53229
- },
53230
- autosave: {
53231
- type: Boolean,
53232
- default: null
53233
53247
  }
53234
53248
  },
53235
53249
  initialState: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startinblox/core",
3
- "version": "0.19.20",
3
+ "version": "0.19.21-beta.1",
4
4
  "description": "This is a series of web component respecting both the web components standards and the Linked Data Platform convention.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",