reneco-hierarchized-picker 0.4.2-beta.10 → 0.4.2-beta.12

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.
@@ -18812,7 +18812,10 @@ const HierarchizedPickerComponent = class {
18812
18812
  const isEqual = lodash.isEqual(newV, oldV);
18813
18813
  if (!newV.defaultValue && !oldV.defaultValue)
18814
18814
  return;
18815
- const changeDefaultValue = !(newV.defaultValue.length == oldV.defaultValue.length && newV.defaultValue.every(value => oldV.defaultValue.includes(value)));
18815
+ const newDefault = Array.isArray(newV.defaultValue) ? newV.defaultValue : [newV.defaultValue];
18816
+ const oldDefault = Array.isArray(oldV.defaultValue) ? oldV.defaultValue : [oldV.defaultValue];
18817
+ const changeDefaultValue = newDefault.length !== oldDefault.length ||
18818
+ !newDefault.every(value => oldDefault.includes(value));
18816
18819
  if (!isEqual && changeDefaultValue) {
18817
18820
  return changeDefaultValue;
18818
18821
  }
@@ -19105,15 +19108,17 @@ const HierarchizedPickerComponent = class {
19105
19108
  }
19106
19109
  }
19107
19110
  getContextualApiURL() {
19108
- if (this.optionsManager.getOptions().options.Reach) {
19109
- const url = new URL(this.optionsManager.getOptions().url);
19110
- const pathSegments = url.pathname.split('/');
19111
+ const { options, url } = this.optionsManager.getOptions();
19112
+ if (options.Reach) {
19113
+ // Use a base URL for relative paths
19114
+ const base = window.location.origin; // fallback for relative URLs
19115
+ const parsedUrl = new URL(url, base);
19116
+ const pathSegments = parsedUrl.pathname.split('/');
19111
19117
  const dynamicType = pathSegments[pathSegments.length - 2];
19112
- const newPathname = `/api/v1/classification/reach/${dynamicType}/${this.optionsManager.getOptions().options.Reach}`;
19113
- return `${url.origin}${newPathname}`;
19118
+ const newPathname = `/api/v1/classification/reach/${dynamicType}/${options.Reach}`;
19119
+ return `${parsedUrl.origin}${newPathname}`;
19114
19120
  }
19115
- else
19116
- return this.optionsManager.getOptions().url;
19121
+ return url;
19117
19122
  }
19118
19123
  getContextualApiParams(options = null) {
19119
19124
  if (!options)
@@ -19129,7 +19134,6 @@ const HierarchizedPickerComponent = class {
19129
19134
  optionsToReturn.startingnode = optionsToReturn.StartNodeID;
19130
19135
  delete optionsToReturn.StartNodeID;
19131
19136
  }
19132
- console.log("JE RETOURNE", optionsToReturn);
19133
19137
  return optionsToReturn;
19134
19138
  }
19135
19139
  else
@@ -156,7 +156,10 @@ export class HierarchizedPickerComponent {
156
156
  const isEqual = _.isEqual(newV, oldV);
157
157
  if (!newV.defaultValue && !oldV.defaultValue)
158
158
  return;
159
- const changeDefaultValue = !(newV.defaultValue.length == oldV.defaultValue.length && newV.defaultValue.every(value => oldV.defaultValue.includes(value)));
159
+ const newDefault = Array.isArray(newV.defaultValue) ? newV.defaultValue : [newV.defaultValue];
160
+ const oldDefault = Array.isArray(oldV.defaultValue) ? oldV.defaultValue : [oldV.defaultValue];
161
+ const changeDefaultValue = newDefault.length !== oldDefault.length ||
162
+ !newDefault.every(value => oldDefault.includes(value));
160
163
  if (!isEqual && changeDefaultValue) {
161
164
  return changeDefaultValue;
162
165
  }
@@ -447,15 +450,17 @@ export class HierarchizedPickerComponent {
447
450
  }
448
451
  }
449
452
  getContextualApiURL() {
450
- if (this.optionsManager.getOptions().options.Reach) {
451
- const url = new URL(this.optionsManager.getOptions().url);
452
- const pathSegments = url.pathname.split('/');
453
+ const { options, url } = this.optionsManager.getOptions();
454
+ if (options.Reach) {
455
+ // Use a base URL for relative paths
456
+ const base = window.location.origin; // fallback for relative URLs
457
+ const parsedUrl = new URL(url, base);
458
+ const pathSegments = parsedUrl.pathname.split('/');
453
459
  const dynamicType = pathSegments[pathSegments.length - 2];
454
- const newPathname = `/api/v1/classification/reach/${dynamicType}/${this.optionsManager.getOptions().options.Reach}`;
455
- return `${url.origin}${newPathname}`;
460
+ const newPathname = `/api/v1/classification/reach/${dynamicType}/${options.Reach}`;
461
+ return `${parsedUrl.origin}${newPathname}`;
456
462
  }
457
- else
458
- return this.optionsManager.getOptions().url;
463
+ return url;
459
464
  }
460
465
  getContextualApiParams(options = null) {
461
466
  if (!options)
@@ -471,7 +476,6 @@ export class HierarchizedPickerComponent {
471
476
  optionsToReturn.startingnode = optionsToReturn.StartNodeID;
472
477
  delete optionsToReturn.StartNodeID;
473
478
  }
474
- console.log("JE RETOURNE", optionsToReturn);
475
479
  return optionsToReturn;
476
480
  }
477
481
  else
@@ -18809,7 +18809,10 @@ const HierarchizedPickerComponent = class extends HTMLElement {
18809
18809
  const isEqual = lodash.isEqual(newV, oldV);
18810
18810
  if (!newV.defaultValue && !oldV.defaultValue)
18811
18811
  return;
18812
- const changeDefaultValue = !(newV.defaultValue.length == oldV.defaultValue.length && newV.defaultValue.every(value => oldV.defaultValue.includes(value)));
18812
+ const newDefault = Array.isArray(newV.defaultValue) ? newV.defaultValue : [newV.defaultValue];
18813
+ const oldDefault = Array.isArray(oldV.defaultValue) ? oldV.defaultValue : [oldV.defaultValue];
18814
+ const changeDefaultValue = newDefault.length !== oldDefault.length ||
18815
+ !newDefault.every(value => oldDefault.includes(value));
18813
18816
  if (!isEqual && changeDefaultValue) {
18814
18817
  return changeDefaultValue;
18815
18818
  }
@@ -19103,15 +19106,17 @@ const HierarchizedPickerComponent = class extends HTMLElement {
19103
19106
  }
19104
19107
  }
19105
19108
  getContextualApiURL() {
19106
- if (this.optionsManager.getOptions().options.Reach) {
19107
- const url = new URL(this.optionsManager.getOptions().url);
19108
- const pathSegments = url.pathname.split('/');
19109
+ const { options, url } = this.optionsManager.getOptions();
19110
+ if (options.Reach) {
19111
+ // Use a base URL for relative paths
19112
+ const base = window.location.origin; // fallback for relative URLs
19113
+ const parsedUrl = new URL(url, base);
19114
+ const pathSegments = parsedUrl.pathname.split('/');
19109
19115
  const dynamicType = pathSegments[pathSegments.length - 2];
19110
- const newPathname = `/api/v1/classification/reach/${dynamicType}/${this.optionsManager.getOptions().options.Reach}`;
19111
- return `${url.origin}${newPathname}`;
19116
+ const newPathname = `/api/v1/classification/reach/${dynamicType}/${options.Reach}`;
19117
+ return `${parsedUrl.origin}${newPathname}`;
19112
19118
  }
19113
- else
19114
- return this.optionsManager.getOptions().url;
19119
+ return url;
19115
19120
  }
19116
19121
  getContextualApiParams(options = null) {
19117
19122
  if (!options)
@@ -19127,7 +19132,6 @@ const HierarchizedPickerComponent = class extends HTMLElement {
19127
19132
  optionsToReturn.startingnode = optionsToReturn.StartNodeID;
19128
19133
  delete optionsToReturn.StartNodeID;
19129
19134
  }
19130
- console.log("JE RETOURNE", optionsToReturn);
19131
19135
  return optionsToReturn;
19132
19136
  }
19133
19137
  else
@@ -18808,7 +18808,10 @@ const HierarchizedPickerComponent = class {
18808
18808
  const isEqual = lodash.isEqual(newV, oldV);
18809
18809
  if (!newV.defaultValue && !oldV.defaultValue)
18810
18810
  return;
18811
- const changeDefaultValue = !(newV.defaultValue.length == oldV.defaultValue.length && newV.defaultValue.every(value => oldV.defaultValue.includes(value)));
18811
+ const newDefault = Array.isArray(newV.defaultValue) ? newV.defaultValue : [newV.defaultValue];
18812
+ const oldDefault = Array.isArray(oldV.defaultValue) ? oldV.defaultValue : [oldV.defaultValue];
18813
+ const changeDefaultValue = newDefault.length !== oldDefault.length ||
18814
+ !newDefault.every(value => oldDefault.includes(value));
18812
18815
  if (!isEqual && changeDefaultValue) {
18813
18816
  return changeDefaultValue;
18814
18817
  }
@@ -19101,15 +19104,17 @@ const HierarchizedPickerComponent = class {
19101
19104
  }
19102
19105
  }
19103
19106
  getContextualApiURL() {
19104
- if (this.optionsManager.getOptions().options.Reach) {
19105
- const url = new URL(this.optionsManager.getOptions().url);
19106
- const pathSegments = url.pathname.split('/');
19107
+ const { options, url } = this.optionsManager.getOptions();
19108
+ if (options.Reach) {
19109
+ // Use a base URL for relative paths
19110
+ const base = window.location.origin; // fallback for relative URLs
19111
+ const parsedUrl = new URL(url, base);
19112
+ const pathSegments = parsedUrl.pathname.split('/');
19107
19113
  const dynamicType = pathSegments[pathSegments.length - 2];
19108
- const newPathname = `/api/v1/classification/reach/${dynamicType}/${this.optionsManager.getOptions().options.Reach}`;
19109
- return `${url.origin}${newPathname}`;
19114
+ const newPathname = `/api/v1/classification/reach/${dynamicType}/${options.Reach}`;
19115
+ return `${parsedUrl.origin}${newPathname}`;
19110
19116
  }
19111
- else
19112
- return this.optionsManager.getOptions().url;
19117
+ return url;
19113
19118
  }
19114
19119
  getContextualApiParams(options = null) {
19115
19120
  if (!options)
@@ -19125,7 +19130,6 @@ const HierarchizedPickerComponent = class {
19125
19130
  optionsToReturn.startingnode = optionsToReturn.StartNodeID;
19126
19131
  delete optionsToReturn.StartNodeID;
19127
19132
  }
19128
- console.log("JE RETOURNE", optionsToReturn);
19129
19133
  return optionsToReturn;
19130
19134
  }
19131
19135
  else