@startinblox/core 0.19.12-beta.3 → 0.19.13-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 +23 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -53476,16 +53476,32 @@ const SolidFormSearch = {
53476
53476
  sibStore.setLocalData(data, id2);
53477
53477
  }
53478
53478
  },
53479
- change(resource) {
53479
+ change(resource, value) {
53480
+ if (!resource)
53481
+ return;
53480
53482
  this.element.dispatchEvent(
53481
53483
  new CustomEvent("formChange", {
53482
53484
  bubbles: true,
53483
53485
  detail: { resource }
53484
53486
  })
53485
53487
  );
53488
+ if (!value)
53489
+ return;
53490
+ this.element.dispatchEvent(
53491
+ new CustomEvent("filterChange", {
53492
+ bubbles: true,
53493
+ detail: value
53494
+ })
53495
+ );
53486
53496
  },
53487
- async inputChange() {
53488
- this.change(this.value);
53497
+ async inputChange(input) {
53498
+ var _a;
53499
+ try {
53500
+ const selectedLabel = (_a = input.selectedOptions[0].textContent) == null ? void 0 : _a.trim();
53501
+ this.change(this.value, selectedLabel);
53502
+ } catch {
53503
+ this.change(this.value, input.value);
53504
+ }
53489
53505
  },
53490
53506
  getSubmitTemplate() {
53491
53507
  return html$1`
@@ -53500,21 +53516,21 @@ const SolidFormSearch = {
53500
53516
  },
53501
53517
  empty() {
53502
53518
  },
53503
- debounceInput() {
53519
+ debounceInput(input) {
53504
53520
  clearTimeout(this.debounceTimeout);
53505
53521
  this.debounceTimeout = setTimeout(() => {
53506
53522
  this.debounceTimeout = void 0;
53507
- this.inputChange();
53523
+ this.inputChange(input);
53508
53524
  }, this.debounce);
53509
53525
  },
53510
53526
  async populate() {
53511
53527
  await this.replaceAttributesData();
53512
53528
  if (this.submitButton == null) {
53513
- this.element.addEventListener("input", () => this.debounceInput());
53529
+ this.element.addEventListener("input", (e) => this.debounceInput(e.target));
53514
53530
  } else {
53515
53531
  this.element.addEventListener("submit", (e) => {
53516
53532
  e.preventDefault();
53517
- this.inputChange();
53533
+ this.inputChange(e.target);
53518
53534
  });
53519
53535
  }
53520
53536
  const fields = await this.getFields();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startinblox/core",
3
- "version": "0.19.12-beta.3",
3
+ "version": "0.19.13-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",