@startinblox/core 0.19.10-beta.2 → 0.19.11-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 +19 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10996,8 +10996,20 @@ class CustomGetter {
10996
10996
  if (!isUrl.protocol.startsWith("http"))
10997
10997
  throw new Error("Not a valid HTTP url");
10998
10998
  if (isUrl) {
10999
- let value = this.resource[this.getExpandedPredicate(path)];
11000
- return value ? value : void 0;
10999
+ let resources = this.resource[this.getExpandedPredicate(path)];
11000
+ if (!resources)
11001
+ return void 0;
11002
+ if (!Array.isArray(resources))
11003
+ resources = [resources];
11004
+ let result = resources ? resources.map((res) => {
11005
+ let resource = store.get(res["@id"]);
11006
+ if (resource)
11007
+ return resource;
11008
+ resource = new CustomGetter(res["@id"], { "@id": res["@id"] }, this.clientContext, this.serverContext, this.parentId).getProxy();
11009
+ store.cacheResource(res["@id"], resource);
11010
+ return resource;
11011
+ }) : [];
11012
+ return result;
11001
11013
  }
11002
11014
  } catch (e) {
11003
11015
  if (!path.split)
@@ -12108,8 +12120,6 @@ const StoreMixin = {
12108
12120
  const nestedResource = resource ? await resource[this.nestedField] : null;
12109
12121
  this.resourceId = nestedResource ? await nestedResource["@id"] : null;
12110
12122
  if (resource && !this.resourceId && !nestedResource) {
12111
- console.trace();
12112
- console.log(nestedResource);
12113
12123
  for (const property in await resource) {
12114
12124
  console.log(`${property}: ${await resource[property]}`);
12115
12125
  }
@@ -13016,15 +13026,11 @@ const RangeMixin = {
13016
13026
  if (res === null) {
13017
13027
  res = resource;
13018
13028
  }
13019
- let valuePredicate = store.getExpandedPredicate(this.optionValue.split(/[.]+/)[0], this.context || base_context);
13020
- const selectedValue = await res[valuePredicate];
13021
- let value = "";
13022
- if (this.optionValue.includes("@id") && !selectedValue["@id"])
13023
- value = `{"@id": "${selectedValue}"}`;
13024
- else if (typeof selectedValue === "object" && selectedValue["@id"])
13025
- value = `{"@id": "${selectedValue["@id"]}"}`;
13026
- else
13027
- value = selectedValue;
13029
+ const selectedValue = await resource[this.optionValue];
13030
+ const value = this.optionValue.includes("@id") || selectedValue["@id"] ? `{"@id": "${selectedValue}"}` : (
13031
+ // resource
13032
+ selectedValue
13033
+ );
13028
13034
  let labelPredicate = store.getExpandedPredicate(this.optionLabel.split(/[.]+/).pop(), this.context || base_context);
13029
13035
  const label = await res[labelPredicate];
13030
13036
  return { value, label, selectedValue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startinblox/core",
3
- "version": "0.19.10-beta.2",
3
+ "version": "0.19.11-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",