reneco-hierarchized-picker 0.4.3-beta.1 → 0.4.3-beta.2

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.
@@ -18885,6 +18885,33 @@ const HierarchizedPickerComponent = class {
18885
18885
  this.lastSearchMatchCounter = 0; // Counter of number of matches for last search
18886
18886
  this.setValueOnClick = true; // Tells wether we edit the picker value on click in the tree
18887
18887
  this.mylog = console.log; // Custom log function for debug purposes
18888
+ this.getShortenedFullpath = (realFullpath) => {
18889
+ var _a, _b, _c, _d;
18890
+ let toret = realFullpath;
18891
+ try {
18892
+ const property_nodeid = (this.optionsManager.getOptions().origin == 'classification' ? "startNode" : "StartNodeID");
18893
+ const property_value = this.optionsManager.getOptions().options[property_nodeid];
18894
+ if (property_value in ["0", 0])
18895
+ return toret;
18896
+ if (isNumeric(property_value)) {
18897
+ if (this.optionsManager.getOptions().origin == 'classification') {
18898
+ const { Translations, Properties } = this.rawDataManager.getData();
18899
+ const currentLanguage = this.optionsManager.getOptions().language;
18900
+ toret = ((_b = (_a = Translations[currentLanguage]) === null || _a === void 0 ? void 0 : _a.translated_name) !== null && _b !== void 0 ? _b : Properties === null || Properties === void 0 ? void 0 : Properties.System_Name) + realFullpath.replace(((_d = (_c = Translations[currentLanguage]) === null || _c === void 0 ? void 0 : _c.translated_fullpath) !== null && _d !== void 0 ? _d : Properties === null || Properties === void 0 ? void 0 : Properties.System_Fullpath), "");
18901
+ }
18902
+ else {
18903
+ const { fullpath, fullpathTranslated, title, valueTranslated } = this.rawDataManager.getData();
18904
+ toret = (valueTranslated !== null && valueTranslated !== void 0 ? valueTranslated : title) + realFullpath.replace((fullpathTranslated !== null && fullpathTranslated !== void 0 ? fullpathTranslated : fullpath), "");
18905
+ }
18906
+ }
18907
+ else
18908
+ this.errorToLog = "Error in getFullpath : startnode is not number";
18909
+ }
18910
+ catch (error) {
18911
+ this.errorToLog = "Error in getFullpath " + error.toString();
18912
+ }
18913
+ return toret;
18914
+ };
18888
18915
  this.options = undefined;
18889
18916
  this.valueChangeCallback = undefined;
18890
18917
  this.disabled = undefined;
@@ -19520,8 +19547,8 @@ const HierarchizedPickerComponent = class {
19520
19547
  if (!value)
19521
19548
  value = this.value;
19522
19549
  this.displayedValue = value.map(item => {
19523
- var _a;
19524
- return (_a = (this.optionsManager.getOptions().isFullpath ? item.fullpathTranslated : item.shortpathTranslated)) !== null && _a !== void 0 ? _a : `Node ${item.nodeid}`;
19550
+ var _a, _b;
19551
+ return (_b = (this.optionsManager.getOptions().isFullpath ? this.getShortenedFullpath((_a = item.fullpathTranslated) !== null && _a !== void 0 ? _a : item.fullpath) : item.shortpathTranslated)) !== null && _b !== void 0 ? _b : `Node ${item.nodeid}`;
19525
19552
  }).join(';');
19526
19553
  }
19527
19554
  // Search a value in the tree and triggers a search when necessary
@@ -19708,7 +19735,7 @@ const HierarchizedPickerComponent = class {
19708
19735
  return "No selection";
19709
19736
  }
19710
19737
  return this.value
19711
- .map(item => { var _a, _b, _c; return (_c = (_b = (_a = item.fullpath) !== null && _a !== void 0 ? _a : item.fullpathTranslated) !== null && _b !== void 0 ? _b : item.shortpathTranslated) !== null && _c !== void 0 ? _c : `Node ${item.nodeid}`; })
19738
+ .map(item => { var _a, _b; return (_b = (_a = this.getShortenedFullpath(item.fullpathTranslated)) !== null && _a !== void 0 ? _a : item.fullpath) !== null && _b !== void 0 ? _b : `Node ${item.nodeid}`; })
19712
19739
  .join('; ');
19713
19740
  }
19714
19741
  render() {
@@ -195,6 +195,33 @@ export class HierarchizedPickerComponent {
195
195
  this.lastSearchMatchCounter = 0; // Counter of number of matches for last search
196
196
  this.setValueOnClick = true; // Tells wether we edit the picker value on click in the tree
197
197
  this.mylog = console.log; // Custom log function for debug purposes
198
+ this.getShortenedFullpath = (realFullpath) => {
199
+ var _a, _b, _c, _d;
200
+ let toret = realFullpath;
201
+ try {
202
+ const property_nodeid = (this.optionsManager.getOptions().origin == 'classification' ? "startNode" : "StartNodeID");
203
+ const property_value = this.optionsManager.getOptions().options[property_nodeid];
204
+ if (property_value in ["0", 0])
205
+ return toret;
206
+ if (isNumeric(property_value)) {
207
+ if (this.optionsManager.getOptions().origin == 'classification') {
208
+ const { Translations, Properties } = this.rawDataManager.getData();
209
+ const currentLanguage = this.optionsManager.getOptions().language;
210
+ toret = ((_b = (_a = Translations[currentLanguage]) === null || _a === void 0 ? void 0 : _a.translated_name) !== null && _b !== void 0 ? _b : Properties === null || Properties === void 0 ? void 0 : Properties.System_Name) + realFullpath.replace(((_d = (_c = Translations[currentLanguage]) === null || _c === void 0 ? void 0 : _c.translated_fullpath) !== null && _d !== void 0 ? _d : Properties === null || Properties === void 0 ? void 0 : Properties.System_Fullpath), "");
211
+ }
212
+ else {
213
+ const { fullpath, fullpathTranslated, title, valueTranslated } = this.rawDataManager.getData();
214
+ toret = (valueTranslated !== null && valueTranslated !== void 0 ? valueTranslated : title) + realFullpath.replace((fullpathTranslated !== null && fullpathTranslated !== void 0 ? fullpathTranslated : fullpath), "");
215
+ }
216
+ }
217
+ else
218
+ this.errorToLog = "Error in getFullpath : startnode is not number";
219
+ }
220
+ catch (error) {
221
+ this.errorToLog = "Error in getFullpath " + error.toString();
222
+ }
223
+ return toret;
224
+ };
198
225
  this.options = undefined;
199
226
  this.valueChangeCallback = undefined;
200
227
  this.disabled = undefined;
@@ -833,8 +860,8 @@ export class HierarchizedPickerComponent {
833
860
  if (!value)
834
861
  value = this.value;
835
862
  this.displayedValue = value.map(item => {
836
- var _a;
837
- return (_a = (this.optionsManager.getOptions().isFullpath ? item.fullpathTranslated : item.shortpathTranslated)) !== null && _a !== void 0 ? _a : `Node ${item.nodeid}`;
863
+ var _a, _b;
864
+ return (_b = (this.optionsManager.getOptions().isFullpath ? this.getShortenedFullpath((_a = item.fullpathTranslated) !== null && _a !== void 0 ? _a : item.fullpath) : item.shortpathTranslated)) !== null && _b !== void 0 ? _b : `Node ${item.nodeid}`;
838
865
  }).join(';');
839
866
  }
840
867
  // Search a value in the tree and triggers a search when necessary
@@ -1021,7 +1048,7 @@ export class HierarchizedPickerComponent {
1021
1048
  return "No selection";
1022
1049
  }
1023
1050
  return this.value
1024
- .map(item => { var _a, _b, _c; return (_c = (_b = (_a = item.fullpath) !== null && _a !== void 0 ? _a : item.fullpathTranslated) !== null && _b !== void 0 ? _b : item.shortpathTranslated) !== null && _c !== void 0 ? _c : `Node ${item.nodeid}`; })
1051
+ .map(item => { var _a, _b; return (_b = (_a = this.getShortenedFullpath(item.fullpathTranslated)) !== null && _a !== void 0 ? _a : item.fullpath) !== null && _b !== void 0 ? _b : `Node ${item.nodeid}`; })
1025
1052
  .join('; ');
1026
1053
  }
1027
1054
  render() {
@@ -18883,6 +18883,33 @@ const HierarchizedPickerComponent = class extends HTMLElement {
18883
18883
  this.lastSearchMatchCounter = 0; // Counter of number of matches for last search
18884
18884
  this.setValueOnClick = true; // Tells wether we edit the picker value on click in the tree
18885
18885
  this.mylog = console.log; // Custom log function for debug purposes
18886
+ this.getShortenedFullpath = (realFullpath) => {
18887
+ var _a, _b, _c, _d;
18888
+ let toret = realFullpath;
18889
+ try {
18890
+ const property_nodeid = (this.optionsManager.getOptions().origin == 'classification' ? "startNode" : "StartNodeID");
18891
+ const property_value = this.optionsManager.getOptions().options[property_nodeid];
18892
+ if (property_value in ["0", 0])
18893
+ return toret;
18894
+ if (isNumeric(property_value)) {
18895
+ if (this.optionsManager.getOptions().origin == 'classification') {
18896
+ const { Translations, Properties } = this.rawDataManager.getData();
18897
+ const currentLanguage = this.optionsManager.getOptions().language;
18898
+ toret = ((_b = (_a = Translations[currentLanguage]) === null || _a === void 0 ? void 0 : _a.translated_name) !== null && _b !== void 0 ? _b : Properties === null || Properties === void 0 ? void 0 : Properties.System_Name) + realFullpath.replace(((_d = (_c = Translations[currentLanguage]) === null || _c === void 0 ? void 0 : _c.translated_fullpath) !== null && _d !== void 0 ? _d : Properties === null || Properties === void 0 ? void 0 : Properties.System_Fullpath), "");
18899
+ }
18900
+ else {
18901
+ const { fullpath, fullpathTranslated, title, valueTranslated } = this.rawDataManager.getData();
18902
+ toret = (valueTranslated !== null && valueTranslated !== void 0 ? valueTranslated : title) + realFullpath.replace((fullpathTranslated !== null && fullpathTranslated !== void 0 ? fullpathTranslated : fullpath), "");
18903
+ }
18904
+ }
18905
+ else
18906
+ this.errorToLog = "Error in getFullpath : startnode is not number";
18907
+ }
18908
+ catch (error) {
18909
+ this.errorToLog = "Error in getFullpath " + error.toString();
18910
+ }
18911
+ return toret;
18912
+ };
18886
18913
  this.options = undefined;
18887
18914
  this.valueChangeCallback = undefined;
18888
18915
  this.disabled = undefined;
@@ -19518,8 +19545,8 @@ const HierarchizedPickerComponent = class extends HTMLElement {
19518
19545
  if (!value)
19519
19546
  value = this.value;
19520
19547
  this.displayedValue = value.map(item => {
19521
- var _a;
19522
- return (_a = (this.optionsManager.getOptions().isFullpath ? item.fullpathTranslated : item.shortpathTranslated)) !== null && _a !== void 0 ? _a : `Node ${item.nodeid}`;
19548
+ var _a, _b;
19549
+ return (_b = (this.optionsManager.getOptions().isFullpath ? this.getShortenedFullpath((_a = item.fullpathTranslated) !== null && _a !== void 0 ? _a : item.fullpath) : item.shortpathTranslated)) !== null && _b !== void 0 ? _b : `Node ${item.nodeid}`;
19523
19550
  }).join(';');
19524
19551
  }
19525
19552
  // Search a value in the tree and triggers a search when necessary
@@ -19706,7 +19733,7 @@ const HierarchizedPickerComponent = class extends HTMLElement {
19706
19733
  return "No selection";
19707
19734
  }
19708
19735
  return this.value
19709
- .map(item => { var _a, _b, _c; return (_c = (_b = (_a = item.fullpath) !== null && _a !== void 0 ? _a : item.fullpathTranslated) !== null && _b !== void 0 ? _b : item.shortpathTranslated) !== null && _c !== void 0 ? _c : `Node ${item.nodeid}`; })
19736
+ .map(item => { var _a, _b; return (_b = (_a = this.getShortenedFullpath(item.fullpathTranslated)) !== null && _a !== void 0 ? _a : item.fullpath) !== null && _b !== void 0 ? _b : `Node ${item.nodeid}`; })
19710
19737
  .join('; ');
19711
19738
  }
19712
19739
  render() {
@@ -18881,6 +18881,33 @@ const HierarchizedPickerComponent = class {
18881
18881
  this.lastSearchMatchCounter = 0; // Counter of number of matches for last search
18882
18882
  this.setValueOnClick = true; // Tells wether we edit the picker value on click in the tree
18883
18883
  this.mylog = console.log; // Custom log function for debug purposes
18884
+ this.getShortenedFullpath = (realFullpath) => {
18885
+ var _a, _b, _c, _d;
18886
+ let toret = realFullpath;
18887
+ try {
18888
+ const property_nodeid = (this.optionsManager.getOptions().origin == 'classification' ? "startNode" : "StartNodeID");
18889
+ const property_value = this.optionsManager.getOptions().options[property_nodeid];
18890
+ if (property_value in ["0", 0])
18891
+ return toret;
18892
+ if (isNumeric(property_value)) {
18893
+ if (this.optionsManager.getOptions().origin == 'classification') {
18894
+ const { Translations, Properties } = this.rawDataManager.getData();
18895
+ const currentLanguage = this.optionsManager.getOptions().language;
18896
+ toret = ((_b = (_a = Translations[currentLanguage]) === null || _a === void 0 ? void 0 : _a.translated_name) !== null && _b !== void 0 ? _b : Properties === null || Properties === void 0 ? void 0 : Properties.System_Name) + realFullpath.replace(((_d = (_c = Translations[currentLanguage]) === null || _c === void 0 ? void 0 : _c.translated_fullpath) !== null && _d !== void 0 ? _d : Properties === null || Properties === void 0 ? void 0 : Properties.System_Fullpath), "");
18897
+ }
18898
+ else {
18899
+ const { fullpath, fullpathTranslated, title, valueTranslated } = this.rawDataManager.getData();
18900
+ toret = (valueTranslated !== null && valueTranslated !== void 0 ? valueTranslated : title) + realFullpath.replace((fullpathTranslated !== null && fullpathTranslated !== void 0 ? fullpathTranslated : fullpath), "");
18901
+ }
18902
+ }
18903
+ else
18904
+ this.errorToLog = "Error in getFullpath : startnode is not number";
18905
+ }
18906
+ catch (error) {
18907
+ this.errorToLog = "Error in getFullpath " + error.toString();
18908
+ }
18909
+ return toret;
18910
+ };
18884
18911
  this.options = undefined;
18885
18912
  this.valueChangeCallback = undefined;
18886
18913
  this.disabled = undefined;
@@ -19516,8 +19543,8 @@ const HierarchizedPickerComponent = class {
19516
19543
  if (!value)
19517
19544
  value = this.value;
19518
19545
  this.displayedValue = value.map(item => {
19519
- var _a;
19520
- return (_a = (this.optionsManager.getOptions().isFullpath ? item.fullpathTranslated : item.shortpathTranslated)) !== null && _a !== void 0 ? _a : `Node ${item.nodeid}`;
19546
+ var _a, _b;
19547
+ return (_b = (this.optionsManager.getOptions().isFullpath ? this.getShortenedFullpath((_a = item.fullpathTranslated) !== null && _a !== void 0 ? _a : item.fullpath) : item.shortpathTranslated)) !== null && _b !== void 0 ? _b : `Node ${item.nodeid}`;
19521
19548
  }).join(';');
19522
19549
  }
19523
19550
  // Search a value in the tree and triggers a search when necessary
@@ -19704,7 +19731,7 @@ const HierarchizedPickerComponent = class {
19704
19731
  return "No selection";
19705
19732
  }
19706
19733
  return this.value
19707
- .map(item => { var _a, _b, _c; return (_c = (_b = (_a = item.fullpath) !== null && _a !== void 0 ? _a : item.fullpathTranslated) !== null && _b !== void 0 ? _b : item.shortpathTranslated) !== null && _c !== void 0 ? _c : `Node ${item.nodeid}`; })
19734
+ .map(item => { var _a, _b; return (_b = (_a = this.getShortenedFullpath(item.fullpathTranslated)) !== null && _a !== void 0 ? _a : item.fullpath) !== null && _b !== void 0 ? _b : `Node ${item.nodeid}`; })
19708
19735
  .join('; ');
19709
19736
  }
19710
19737
  render() {