@startinblox/core 0.19.0-beta.6 → 0.19.0-beta.7

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.
package/dist/index.js CHANGED
@@ -11270,6 +11270,8 @@ const base_context = {
11270
11270
  xsd: "http://www.w3.org/2001/XMLSchema#",
11271
11271
  geo: "http://www.w3.org/2003/01/geo/wgs84_pos#",
11272
11272
  acl: "http://www.w3.org/ns/auth/acl#",
11273
+ hd: "http://cdn.startinblox.com/owl/ttl/vocab.ttl#",
11274
+ sib: "http://cdn.startinblox.com/owl/ttl/vocab.ttl#",
11273
11275
  name: "rdfs:label",
11274
11276
  deadline: "xsd:dateTime",
11275
11277
  lat: "geo:lat",
@@ -12991,15 +12993,21 @@ const RangeMixin = {
12991
12993
  async setRangeAttribute(resources) {
12992
12994
  if (resources) {
12993
12995
  const getRangeValue = async (resource) => {
12994
- const selectedValue = await resource[this.optionValue];
12995
- const value = this.optionValue.includes("@id") || selectedValue["@id"] ? (
12996
- // value of the option
12997
- `{"@id": "${selectedValue}"}`
12998
- ) : (
12999
- // resource
13000
- selectedValue
13001
- );
13002
- const label = await resource[this.optionLabel];
12996
+ let res = await store.getData(resource["@id"], this.context || base_context, void 0, void 0, true);
12997
+ if (res === null) {
12998
+ res = resource;
12999
+ }
13000
+ let valuePredicate = store.getExpandedPredicate(this.optionValue.split(/[.]+/)[0], this.context || base_context);
13001
+ const selectedValue = await res[valuePredicate];
13002
+ let value = "";
13003
+ if (this.optionValue.includes("@id") && !selectedValue["@id"])
13004
+ value = `{"@id": "${selectedValue}"}`;
13005
+ else if (typeof selectedValue === "object" && selectedValue["@id"])
13006
+ value = `{"@id": "${selectedValue["@id"]}"}`;
13007
+ else
13008
+ value = selectedValue;
13009
+ let labelPredicate = store.getExpandedPredicate(this.optionLabel.split(/[.]+/).pop(), this.context || base_context);
13010
+ const label = await res[labelPredicate];
13003
13011
  return { value, label, selectedValue };
13004
13012
  };
13005
13013
  this.listAttributes["range"] = await Promise.all(