@startinblox/core 0.19.15-beta.2 → 0.19.15-beta.4

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 +40 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -51247,6 +51247,8 @@ const WidgetMixin = {
51247
51247
  */
51248
51248
  widgetAttributes(field, resource) {
51249
51249
  const attrs2 = { name: field };
51250
+ if (this.isAlias(field))
51251
+ field = field.split(" as ")[1];
51250
51252
  const escapedField = this.getEscapedField(field);
51251
51253
  const multipleAttributes = [
51252
51254
  "fields",
@@ -51338,8 +51340,18 @@ const WidgetMixin = {
51338
51340
  }
51339
51341
  if (value === null || value === void 0)
51340
51342
  attributes.value = "";
51341
- if (widgetMeta.type === WidgetType.USER && value["@id"]) {
51342
- attributes["data-src"] = value["@id"];
51343
+ if (widgetMeta.type === WidgetType.USER) {
51344
+ if (value["@id"]) {
51345
+ attributes["data-src"] = value["@id"];
51346
+ } else {
51347
+ try {
51348
+ let isUrl = new URL(value);
51349
+ if (isUrl)
51350
+ attributes["data-src"] = value;
51351
+ } catch (e) {
51352
+ }
51353
+ attributes["value"] = value;
51354
+ }
51343
51355
  } else {
51344
51356
  attributes["value"] = value;
51345
51357
  }
@@ -53469,7 +53481,7 @@ const SolidFormSearch = {
53469
53481
  sibStore.setLocalData(data, id2);
53470
53482
  }
53471
53483
  },
53472
- change(resource, value) {
53484
+ change(resource, eventOptions) {
53473
53485
  if (!resource)
53474
53486
  return;
53475
53487
  this.element.dispatchEvent(
@@ -53478,22 +53490,41 @@ const SolidFormSearch = {
53478
53490
  detail: { resource }
53479
53491
  })
53480
53492
  );
53481
- if (!value)
53493
+ if (!eventOptions.value)
53482
53494
  return;
53483
53495
  this.element.dispatchEvent(
53484
53496
  new CustomEvent("filterChange", {
53485
53497
  bubbles: true,
53486
- detail: value
53498
+ detail: {
53499
+ value: eventOptions.value,
53500
+ inputLabel: eventOptions.inputLabel,
53501
+ type: eventOptions.type
53502
+ }
53487
53503
  })
53488
53504
  );
53489
53505
  },
53490
53506
  async inputChange(input) {
53491
- var _a;
53507
+ var _a, _b;
53508
+ let parentElementLabel = (_a = input == null ? void 0 : input.parentElement) == null ? void 0 : _a.getAttribute("label");
53492
53509
  try {
53493
- const selectedLabel = (_a = input.selectedOptions[0].textContent) == null ? void 0 : _a.trim();
53494
- this.change(this.value, selectedLabel);
53510
+ const selectedLabel = (_b = input.selectedOptions[0].textContent) == null ? void 0 : _b.trim();
53511
+ this.change(
53512
+ this.value,
53513
+ {
53514
+ value: selectedLabel,
53515
+ inputLabel: parentElementLabel,
53516
+ type: "select"
53517
+ }
53518
+ );
53495
53519
  } catch {
53496
- this.change(this.value, input.value);
53520
+ this.change(
53521
+ this.value,
53522
+ {
53523
+ value: input.value,
53524
+ inputLabel: parentElementLabel,
53525
+ type: "input"
53526
+ }
53527
+ );
53497
53528
  }
53498
53529
  },
53499
53530
  getSubmitTemplate() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startinblox/core",
3
- "version": "0.19.15-beta.2",
3
+ "version": "0.19.15-beta.4",
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",