reneco-hierarchized-picker 0.4.2-beta.15 → 0.4.2-beta.17
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/cjs/reneco-hierarchized-picker_2.cjs.entry.js +33 -14
- package/dist/collection/components/hierarchized-picker/hierarchized-picker.js +24 -11
- package/dist/collection/components/treejs/index.js +1 -1
- package/dist/collection/features/tree/tree-utils.js +8 -2
- package/dist/custom-elements/index.js +33 -14
- package/dist/esm/reneco-hierarchized-picker_2.entry.js +33 -14
- package/dist/esm-es5/reneco-hierarchized-picker_2.entry.js +1 -1
- package/dist/reneco-hierarchized-picker/p-2c19f1aa.entry.js +1 -0
- package/dist/reneco-hierarchized-picker/p-73168a50.system.js +1 -1
- package/dist/reneco-hierarchized-picker/p-fa15aea0.system.entry.js +3 -0
- package/dist/reneco-hierarchized-picker/reneco-hierarchized-picker.esm.js +1 -1
- package/dist/types/components/hierarchized-picker/hierarchized-picker.d.ts +1 -1
- package/package.json +1 -1
- package/dist/reneco-hierarchized-picker/p-615eead9.entry.js +0 -1
- package/dist/reneco-hierarchized-picker/p-8c682858.system.entry.js +0 -3
|
@@ -645,7 +645,7 @@ Tree.prototype.createUlEle = function () {
|
|
|
645
645
|
Tree.prototype.createLiEle = function (node, closed) {
|
|
646
646
|
const li = document.createElement('li');
|
|
647
647
|
li.classList.add('treejs-node');
|
|
648
|
-
if (node.deprecated) {
|
|
648
|
+
if (node.deprecated || node.Is_Deprecated) {
|
|
649
649
|
li.classList.add('treejs-node__deprecated');
|
|
650
650
|
}
|
|
651
651
|
if (node.isDesaturated) {
|
|
@@ -18440,7 +18440,7 @@ function fillTreeWithObject(tree, myObject, searched, options, depth = 0) {
|
|
|
18440
18440
|
const searchResultPresentsUnMatched = options.searchResultPresentsUnMatched;
|
|
18441
18441
|
if (myObject && myObject.length) {
|
|
18442
18442
|
myObject.forEach(value => {
|
|
18443
|
-
var _a, _b, _c;
|
|
18443
|
+
var _a, _b, _c, _d;
|
|
18444
18444
|
let keyPropFromNode = null;
|
|
18445
18445
|
let valueTranslatedPropFromNode = null;
|
|
18446
18446
|
let fullpathPropFromNode = null;
|
|
@@ -18450,6 +18450,10 @@ function fillTreeWithObject(tree, myObject, searched, options, depth = 0) {
|
|
|
18450
18450
|
valueTranslatedPropFromNode = (_a = getPropertyFromNode(value, 'Translations')[options.language]) === null || _a === void 0 ? void 0 : _a.translated_name;
|
|
18451
18451
|
fullpathPropFromNode = (_b = getPropertyFromNode(value, 'Properties')) === null || _b === void 0 ? void 0 : _b.System_Fullpath;
|
|
18452
18452
|
fullpathTranslatedPropFromNode = (_c = getPropertyFromNode(value, 'Translations')[options.language]) === null || _c === void 0 ? void 0 : _c.translated_fullpath;
|
|
18453
|
+
if (!fullpathPropFromNode)
|
|
18454
|
+
fullpathPropFromNode = (_d = getPropertyFromNode(value, 'Properties')) === null || _d === void 0 ? void 0 : _d.System_FullPath;
|
|
18455
|
+
if (!fullpathTranslatedPropFromNode)
|
|
18456
|
+
fullpathTranslatedPropFromNode = getPropertyFromNode(value, 'fullpathTranslated');
|
|
18453
18457
|
}
|
|
18454
18458
|
else {
|
|
18455
18459
|
keyPropFromNode = getPropertyFromNode(value, 'key');
|
|
@@ -18458,7 +18462,9 @@ function fillTreeWithObject(tree, myObject, searched, options, depth = 0) {
|
|
|
18458
18462
|
fullpathTranslatedPropFromNode = getPropertyFromNode(value, 'fullpathTranslated');
|
|
18459
18463
|
}
|
|
18460
18464
|
const childrenPropFromNode = getPropertyFromNode(value, 'children', false);
|
|
18461
|
-
|
|
18465
|
+
let deprecated = getPropertyFromNode(value, 'deprecated', null);
|
|
18466
|
+
if (deprecated === null)
|
|
18467
|
+
deprecated = getPropertyFromNode(value, 'Is_Deprecated', false);
|
|
18462
18468
|
const objToPush = {
|
|
18463
18469
|
id: keyPropFromNode,
|
|
18464
18470
|
nodeId: keyPropFromNode,
|
|
@@ -19121,14 +19127,21 @@ const HierarchizedPickerComponent = class {
|
|
|
19121
19127
|
}
|
|
19122
19128
|
getApiSearchURL() {
|
|
19123
19129
|
if (this.optionsManager.getOptions().origin == 'classification') {
|
|
19124
|
-
|
|
19125
|
-
|
|
19126
|
-
|
|
19130
|
+
const baseURL = this.optionsManager.getOptions().url;
|
|
19131
|
+
if (baseURL.indexOf("getTree") > -1) {
|
|
19132
|
+
return baseURL.replace("/getTree/", "/search/");
|
|
19133
|
+
}
|
|
19134
|
+
else {
|
|
19135
|
+
let substringUpToLastSlash = this.optionsManager.getOptions().url.substring(0, this.optionsManager.getOptions().url.lastIndexOf('/'));
|
|
19136
|
+
let context = substringUpToLastSlash.substring(substringUpToLastSlash.lastIndexOf('/'), substringUpToLastSlash.length);
|
|
19137
|
+
return substringUpToLastSlash.substring(0, substringUpToLastSlash.lastIndexOf('/')) + '/search' + context;
|
|
19138
|
+
}
|
|
19127
19139
|
}
|
|
19128
19140
|
else {
|
|
19129
19141
|
return this.optionsManager.getOptions().url.substring(0, this.optionsManager.getOptions().url.lastIndexOf('/')) + '/GetTreeFromSearch';
|
|
19130
19142
|
}
|
|
19131
19143
|
}
|
|
19144
|
+
// TODO > Celine would rather like the context (thesaurus or position) to be extracted another way
|
|
19132
19145
|
getContextualApiURL() {
|
|
19133
19146
|
const { options, url } = this.optionsManager.getOptions();
|
|
19134
19147
|
if (options.Reach) {
|
|
@@ -19136,15 +19149,18 @@ const HierarchizedPickerComponent = class {
|
|
|
19136
19149
|
const base = window.location.origin; // fallback for relative URLs
|
|
19137
19150
|
const parsedUrl = new URL(url, base);
|
|
19138
19151
|
const pathSegments = parsedUrl.pathname.split('/');
|
|
19139
|
-
|
|
19152
|
+
let dynamicType = pathSegments[pathSegments.length - 2];
|
|
19153
|
+
if (['thesaurus', 'position'].indexOf(dynamicType) == -1)
|
|
19154
|
+
dynamicType = pathSegments[pathSegments.length - 1];
|
|
19140
19155
|
const newPathname = `/api/v1/classification/reach/${dynamicType}/${options.Reach}`;
|
|
19141
19156
|
this.optionsManager.dropReach();
|
|
19142
19157
|
return `${parsedUrl.origin}${newPathname}`;
|
|
19143
19158
|
}
|
|
19144
19159
|
return url;
|
|
19145
19160
|
}
|
|
19146
|
-
getContextualApiParams(search = null) {
|
|
19147
|
-
|
|
19161
|
+
getContextualApiParams(options = null, search = null) {
|
|
19162
|
+
if (!options)
|
|
19163
|
+
options = this.optionsManager.getOptions().options;
|
|
19148
19164
|
let optionsToReturn = Object.assign({}, options);
|
|
19149
19165
|
if (options.Reach) {
|
|
19150
19166
|
delete optionsToReturn.Reach;
|
|
@@ -19164,8 +19180,6 @@ const HierarchizedPickerComponent = class {
|
|
|
19164
19180
|
delete optionsToReturn.startNode;
|
|
19165
19181
|
}
|
|
19166
19182
|
}
|
|
19167
|
-
else
|
|
19168
|
-
return options;
|
|
19169
19183
|
return optionsToReturn;
|
|
19170
19184
|
}
|
|
19171
19185
|
translateDataForTree(dataToLoad, searchID = null, searched = null) {
|
|
@@ -19201,7 +19215,7 @@ const HierarchizedPickerComponent = class {
|
|
|
19201
19215
|
if (this.theOptions.source == 'webservice') {
|
|
19202
19216
|
if (this.theOptions.origin == 'classification') {
|
|
19203
19217
|
// WS Call
|
|
19204
|
-
this.rawDataManager.getFromClassification(this.getApiSearchURL(), Object.assign({}, this.getContextualApiParams(searched)), document.querySelector("#hierarchized-picker-" + this.componentID + ".loader"))
|
|
19218
|
+
this.rawDataManager.getFromClassification(this.getApiSearchURL(), Object.assign({}, this.getContextualApiParams(null, searched)), document.querySelector("#hierarchized-picker-" + this.componentID + ".loader"))
|
|
19205
19219
|
.then((data) => {
|
|
19206
19220
|
displayResults(data);
|
|
19207
19221
|
if (!searched) {
|
|
@@ -19446,6 +19460,11 @@ const HierarchizedPickerComponent = class {
|
|
|
19446
19460
|
if (this.hasFocus.indexOf('hide') > -1 && !isStillInsidePicker) {
|
|
19447
19461
|
this.hasFocus = [];
|
|
19448
19462
|
}
|
|
19463
|
+
else {
|
|
19464
|
+
if (!this.shownTree && this.theOptions.loading == 'click' && !this.ready) {
|
|
19465
|
+
this.loadDataForTree(true, document.querySelector("#hierarchized-picker-" + this.componentID + ".loader"));
|
|
19466
|
+
}
|
|
19467
|
+
}
|
|
19449
19468
|
const previousShownTree = this.shownTree;
|
|
19450
19469
|
this.shownTree = this.hasFocus.length > 0;
|
|
19451
19470
|
if (this.shownTree && !previousShownTree) {
|
|
@@ -19494,8 +19513,8 @@ const HierarchizedPickerComponent = class {
|
|
|
19494
19513
|
if (!value)
|
|
19495
19514
|
value = this.value;
|
|
19496
19515
|
this.displayedValue = value.map(item => {
|
|
19497
|
-
var _a
|
|
19498
|
-
return (
|
|
19516
|
+
var _a;
|
|
19517
|
+
return (_a = (this.optionsManager.getOptions().isFullpath ? item.fullpathTranslated : item.shortpathTranslated)) !== null && _a !== void 0 ? _a : `Node ${item.nodeid}`;
|
|
19499
19518
|
}).join(';');
|
|
19500
19519
|
}
|
|
19501
19520
|
// Search a value in the tree and triggers a search when necessary
|
|
@@ -442,14 +442,21 @@ export class HierarchizedPickerComponent {
|
|
|
442
442
|
}
|
|
443
443
|
getApiSearchURL() {
|
|
444
444
|
if (this.optionsManager.getOptions().origin == 'classification') {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
445
|
+
const baseURL = this.optionsManager.getOptions().url;
|
|
446
|
+
if (baseURL.indexOf("getTree") > -1) {
|
|
447
|
+
return baseURL.replace("/getTree/", "/search/");
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
let substringUpToLastSlash = this.optionsManager.getOptions().url.substring(0, this.optionsManager.getOptions().url.lastIndexOf('/'));
|
|
451
|
+
let context = substringUpToLastSlash.substring(substringUpToLastSlash.lastIndexOf('/'), substringUpToLastSlash.length);
|
|
452
|
+
return substringUpToLastSlash.substring(0, substringUpToLastSlash.lastIndexOf('/')) + '/search' + context;
|
|
453
|
+
}
|
|
448
454
|
}
|
|
449
455
|
else {
|
|
450
456
|
return this.optionsManager.getOptions().url.substring(0, this.optionsManager.getOptions().url.lastIndexOf('/')) + '/GetTreeFromSearch';
|
|
451
457
|
}
|
|
452
458
|
}
|
|
459
|
+
// TODO > Celine would rather like the context (thesaurus or position) to be extracted another way
|
|
453
460
|
getContextualApiURL() {
|
|
454
461
|
const { options, url } = this.optionsManager.getOptions();
|
|
455
462
|
if (options.Reach) {
|
|
@@ -457,15 +464,18 @@ export class HierarchizedPickerComponent {
|
|
|
457
464
|
const base = window.location.origin; // fallback for relative URLs
|
|
458
465
|
const parsedUrl = new URL(url, base);
|
|
459
466
|
const pathSegments = parsedUrl.pathname.split('/');
|
|
460
|
-
|
|
467
|
+
let dynamicType = pathSegments[pathSegments.length - 2];
|
|
468
|
+
if (['thesaurus', 'position'].indexOf(dynamicType) == -1)
|
|
469
|
+
dynamicType = pathSegments[pathSegments.length - 1];
|
|
461
470
|
const newPathname = `/api/v1/classification/reach/${dynamicType}/${options.Reach}`;
|
|
462
471
|
this.optionsManager.dropReach();
|
|
463
472
|
return `${parsedUrl.origin}${newPathname}`;
|
|
464
473
|
}
|
|
465
474
|
return url;
|
|
466
475
|
}
|
|
467
|
-
getContextualApiParams(search = null) {
|
|
468
|
-
|
|
476
|
+
getContextualApiParams(options = null, search = null) {
|
|
477
|
+
if (!options)
|
|
478
|
+
options = this.optionsManager.getOptions().options;
|
|
469
479
|
let optionsToReturn = Object.assign({}, options);
|
|
470
480
|
if (options.Reach) {
|
|
471
481
|
delete optionsToReturn.Reach;
|
|
@@ -485,8 +495,6 @@ export class HierarchizedPickerComponent {
|
|
|
485
495
|
delete optionsToReturn.startNode;
|
|
486
496
|
}
|
|
487
497
|
}
|
|
488
|
-
else
|
|
489
|
-
return options;
|
|
490
498
|
return optionsToReturn;
|
|
491
499
|
}
|
|
492
500
|
translateDataForTree(dataToLoad, searchID = null, searched = null) {
|
|
@@ -522,7 +530,7 @@ export class HierarchizedPickerComponent {
|
|
|
522
530
|
if (this.theOptions.source == 'webservice') {
|
|
523
531
|
if (this.theOptions.origin == 'classification') {
|
|
524
532
|
// WS Call
|
|
525
|
-
this.rawDataManager.getFromClassification(this.getApiSearchURL(), Object.assign({}, this.getContextualApiParams(searched)), document.querySelector("#hierarchized-picker-" + this.componentID + ".loader"))
|
|
533
|
+
this.rawDataManager.getFromClassification(this.getApiSearchURL(), Object.assign({}, this.getContextualApiParams(null, searched)), document.querySelector("#hierarchized-picker-" + this.componentID + ".loader"))
|
|
526
534
|
.then((data) => {
|
|
527
535
|
displayResults(data);
|
|
528
536
|
if (!searched) {
|
|
@@ -767,6 +775,11 @@ export class HierarchizedPickerComponent {
|
|
|
767
775
|
if (this.hasFocus.indexOf('hide') > -1 && !isStillInsidePicker) {
|
|
768
776
|
this.hasFocus = [];
|
|
769
777
|
}
|
|
778
|
+
else {
|
|
779
|
+
if (!this.shownTree && this.theOptions.loading == 'click' && !this.ready) {
|
|
780
|
+
this.loadDataForTree(true, document.querySelector("#hierarchized-picker-" + this.componentID + ".loader"));
|
|
781
|
+
}
|
|
782
|
+
}
|
|
770
783
|
const previousShownTree = this.shownTree;
|
|
771
784
|
this.shownTree = this.hasFocus.length > 0;
|
|
772
785
|
if (this.shownTree && !previousShownTree) {
|
|
@@ -815,8 +828,8 @@ export class HierarchizedPickerComponent {
|
|
|
815
828
|
if (!value)
|
|
816
829
|
value = this.value;
|
|
817
830
|
this.displayedValue = value.map(item => {
|
|
818
|
-
var _a
|
|
819
|
-
return (
|
|
831
|
+
var _a;
|
|
832
|
+
return (_a = (this.optionsManager.getOptions().isFullpath ? item.fullpathTranslated : item.shortpathTranslated)) !== null && _a !== void 0 ? _a : `Node ${item.nodeid}`;
|
|
820
833
|
}).join(';');
|
|
821
834
|
}
|
|
822
835
|
// Search a value in the tree and triggers a search when necessary
|
|
@@ -514,7 +514,7 @@ Tree.prototype.createLiEle = function (node, closed) {
|
|
|
514
514
|
const li = document.createElement('li');
|
|
515
515
|
;
|
|
516
516
|
li.classList.add('treejs-node');
|
|
517
|
-
if (node.deprecated) {
|
|
517
|
+
if (node.deprecated || node.Is_Deprecated) {
|
|
518
518
|
li.classList.add('treejs-node__deprecated');
|
|
519
519
|
}
|
|
520
520
|
if (node.isDesaturated) {
|
|
@@ -51,7 +51,7 @@ export function fillTreeWithObject(tree, myObject, searched, options, depth = 0)
|
|
|
51
51
|
const searchResultPresentsUnMatched = options.searchResultPresentsUnMatched;
|
|
52
52
|
if (myObject && myObject.length) {
|
|
53
53
|
myObject.forEach(value => {
|
|
54
|
-
var _a, _b, _c;
|
|
54
|
+
var _a, _b, _c, _d;
|
|
55
55
|
let keyPropFromNode = null;
|
|
56
56
|
let valueTranslatedPropFromNode = null;
|
|
57
57
|
let fullpathPropFromNode = null;
|
|
@@ -61,6 +61,10 @@ export function fillTreeWithObject(tree, myObject, searched, options, depth = 0)
|
|
|
61
61
|
valueTranslatedPropFromNode = (_a = getPropertyFromNode(value, 'Translations')[options.language]) === null || _a === void 0 ? void 0 : _a.translated_name;
|
|
62
62
|
fullpathPropFromNode = (_b = getPropertyFromNode(value, 'Properties')) === null || _b === void 0 ? void 0 : _b.System_Fullpath;
|
|
63
63
|
fullpathTranslatedPropFromNode = (_c = getPropertyFromNode(value, 'Translations')[options.language]) === null || _c === void 0 ? void 0 : _c.translated_fullpath;
|
|
64
|
+
if (!fullpathPropFromNode)
|
|
65
|
+
fullpathPropFromNode = (_d = getPropertyFromNode(value, 'Properties')) === null || _d === void 0 ? void 0 : _d.System_FullPath;
|
|
66
|
+
if (!fullpathTranslatedPropFromNode)
|
|
67
|
+
fullpathTranslatedPropFromNode = getPropertyFromNode(value, 'fullpathTranslated');
|
|
64
68
|
}
|
|
65
69
|
else {
|
|
66
70
|
keyPropFromNode = getPropertyFromNode(value, 'key');
|
|
@@ -69,7 +73,9 @@ export function fillTreeWithObject(tree, myObject, searched, options, depth = 0)
|
|
|
69
73
|
fullpathTranslatedPropFromNode = getPropertyFromNode(value, 'fullpathTranslated');
|
|
70
74
|
}
|
|
71
75
|
const childrenPropFromNode = getPropertyFromNode(value, 'children', false);
|
|
72
|
-
|
|
76
|
+
let deprecated = getPropertyFromNode(value, 'deprecated', null);
|
|
77
|
+
if (deprecated === null)
|
|
78
|
+
deprecated = getPropertyFromNode(value, 'Is_Deprecated', false);
|
|
73
79
|
const objToPush = {
|
|
74
80
|
id: keyPropFromNode,
|
|
75
81
|
nodeId: keyPropFromNode,
|
|
@@ -642,7 +642,7 @@ Tree.prototype.createUlEle = function () {
|
|
|
642
642
|
Tree.prototype.createLiEle = function (node, closed) {
|
|
643
643
|
const li = document.createElement('li');
|
|
644
644
|
li.classList.add('treejs-node');
|
|
645
|
-
if (node.deprecated) {
|
|
645
|
+
if (node.deprecated || node.Is_Deprecated) {
|
|
646
646
|
li.classList.add('treejs-node__deprecated');
|
|
647
647
|
}
|
|
648
648
|
if (node.isDesaturated) {
|
|
@@ -18437,7 +18437,7 @@ function fillTreeWithObject(tree, myObject, searched, options, depth = 0) {
|
|
|
18437
18437
|
const searchResultPresentsUnMatched = options.searchResultPresentsUnMatched;
|
|
18438
18438
|
if (myObject && myObject.length) {
|
|
18439
18439
|
myObject.forEach(value => {
|
|
18440
|
-
var _a, _b, _c;
|
|
18440
|
+
var _a, _b, _c, _d;
|
|
18441
18441
|
let keyPropFromNode = null;
|
|
18442
18442
|
let valueTranslatedPropFromNode = null;
|
|
18443
18443
|
let fullpathPropFromNode = null;
|
|
@@ -18447,6 +18447,10 @@ function fillTreeWithObject(tree, myObject, searched, options, depth = 0) {
|
|
|
18447
18447
|
valueTranslatedPropFromNode = (_a = getPropertyFromNode(value, 'Translations')[options.language]) === null || _a === void 0 ? void 0 : _a.translated_name;
|
|
18448
18448
|
fullpathPropFromNode = (_b = getPropertyFromNode(value, 'Properties')) === null || _b === void 0 ? void 0 : _b.System_Fullpath;
|
|
18449
18449
|
fullpathTranslatedPropFromNode = (_c = getPropertyFromNode(value, 'Translations')[options.language]) === null || _c === void 0 ? void 0 : _c.translated_fullpath;
|
|
18450
|
+
if (!fullpathPropFromNode)
|
|
18451
|
+
fullpathPropFromNode = (_d = getPropertyFromNode(value, 'Properties')) === null || _d === void 0 ? void 0 : _d.System_FullPath;
|
|
18452
|
+
if (!fullpathTranslatedPropFromNode)
|
|
18453
|
+
fullpathTranslatedPropFromNode = getPropertyFromNode(value, 'fullpathTranslated');
|
|
18450
18454
|
}
|
|
18451
18455
|
else {
|
|
18452
18456
|
keyPropFromNode = getPropertyFromNode(value, 'key');
|
|
@@ -18455,7 +18459,9 @@ function fillTreeWithObject(tree, myObject, searched, options, depth = 0) {
|
|
|
18455
18459
|
fullpathTranslatedPropFromNode = getPropertyFromNode(value, 'fullpathTranslated');
|
|
18456
18460
|
}
|
|
18457
18461
|
const childrenPropFromNode = getPropertyFromNode(value, 'children', false);
|
|
18458
|
-
|
|
18462
|
+
let deprecated = getPropertyFromNode(value, 'deprecated', null);
|
|
18463
|
+
if (deprecated === null)
|
|
18464
|
+
deprecated = getPropertyFromNode(value, 'Is_Deprecated', false);
|
|
18459
18465
|
const objToPush = {
|
|
18460
18466
|
id: keyPropFromNode,
|
|
18461
18467
|
nodeId: keyPropFromNode,
|
|
@@ -19119,14 +19125,21 @@ const HierarchizedPickerComponent = class extends HTMLElement {
|
|
|
19119
19125
|
}
|
|
19120
19126
|
getApiSearchURL() {
|
|
19121
19127
|
if (this.optionsManager.getOptions().origin == 'classification') {
|
|
19122
|
-
|
|
19123
|
-
|
|
19124
|
-
|
|
19128
|
+
const baseURL = this.optionsManager.getOptions().url;
|
|
19129
|
+
if (baseURL.indexOf("getTree") > -1) {
|
|
19130
|
+
return baseURL.replace("/getTree/", "/search/");
|
|
19131
|
+
}
|
|
19132
|
+
else {
|
|
19133
|
+
let substringUpToLastSlash = this.optionsManager.getOptions().url.substring(0, this.optionsManager.getOptions().url.lastIndexOf('/'));
|
|
19134
|
+
let context = substringUpToLastSlash.substring(substringUpToLastSlash.lastIndexOf('/'), substringUpToLastSlash.length);
|
|
19135
|
+
return substringUpToLastSlash.substring(0, substringUpToLastSlash.lastIndexOf('/')) + '/search' + context;
|
|
19136
|
+
}
|
|
19125
19137
|
}
|
|
19126
19138
|
else {
|
|
19127
19139
|
return this.optionsManager.getOptions().url.substring(0, this.optionsManager.getOptions().url.lastIndexOf('/')) + '/GetTreeFromSearch';
|
|
19128
19140
|
}
|
|
19129
19141
|
}
|
|
19142
|
+
// TODO > Celine would rather like the context (thesaurus or position) to be extracted another way
|
|
19130
19143
|
getContextualApiURL() {
|
|
19131
19144
|
const { options, url } = this.optionsManager.getOptions();
|
|
19132
19145
|
if (options.Reach) {
|
|
@@ -19134,15 +19147,18 @@ const HierarchizedPickerComponent = class extends HTMLElement {
|
|
|
19134
19147
|
const base = window.location.origin; // fallback for relative URLs
|
|
19135
19148
|
const parsedUrl = new URL(url, base);
|
|
19136
19149
|
const pathSegments = parsedUrl.pathname.split('/');
|
|
19137
|
-
|
|
19150
|
+
let dynamicType = pathSegments[pathSegments.length - 2];
|
|
19151
|
+
if (['thesaurus', 'position'].indexOf(dynamicType) == -1)
|
|
19152
|
+
dynamicType = pathSegments[pathSegments.length - 1];
|
|
19138
19153
|
const newPathname = `/api/v1/classification/reach/${dynamicType}/${options.Reach}`;
|
|
19139
19154
|
this.optionsManager.dropReach();
|
|
19140
19155
|
return `${parsedUrl.origin}${newPathname}`;
|
|
19141
19156
|
}
|
|
19142
19157
|
return url;
|
|
19143
19158
|
}
|
|
19144
|
-
getContextualApiParams(search = null) {
|
|
19145
|
-
|
|
19159
|
+
getContextualApiParams(options = null, search = null) {
|
|
19160
|
+
if (!options)
|
|
19161
|
+
options = this.optionsManager.getOptions().options;
|
|
19146
19162
|
let optionsToReturn = Object.assign({}, options);
|
|
19147
19163
|
if (options.Reach) {
|
|
19148
19164
|
delete optionsToReturn.Reach;
|
|
@@ -19162,8 +19178,6 @@ const HierarchizedPickerComponent = class extends HTMLElement {
|
|
|
19162
19178
|
delete optionsToReturn.startNode;
|
|
19163
19179
|
}
|
|
19164
19180
|
}
|
|
19165
|
-
else
|
|
19166
|
-
return options;
|
|
19167
19181
|
return optionsToReturn;
|
|
19168
19182
|
}
|
|
19169
19183
|
translateDataForTree(dataToLoad, searchID = null, searched = null) {
|
|
@@ -19199,7 +19213,7 @@ const HierarchizedPickerComponent = class extends HTMLElement {
|
|
|
19199
19213
|
if (this.theOptions.source == 'webservice') {
|
|
19200
19214
|
if (this.theOptions.origin == 'classification') {
|
|
19201
19215
|
// WS Call
|
|
19202
|
-
this.rawDataManager.getFromClassification(this.getApiSearchURL(), Object.assign({}, this.getContextualApiParams(searched)), document.querySelector("#hierarchized-picker-" + this.componentID + ".loader"))
|
|
19216
|
+
this.rawDataManager.getFromClassification(this.getApiSearchURL(), Object.assign({}, this.getContextualApiParams(null, searched)), document.querySelector("#hierarchized-picker-" + this.componentID + ".loader"))
|
|
19203
19217
|
.then((data) => {
|
|
19204
19218
|
displayResults(data);
|
|
19205
19219
|
if (!searched) {
|
|
@@ -19444,6 +19458,11 @@ const HierarchizedPickerComponent = class extends HTMLElement {
|
|
|
19444
19458
|
if (this.hasFocus.indexOf('hide') > -1 && !isStillInsidePicker) {
|
|
19445
19459
|
this.hasFocus = [];
|
|
19446
19460
|
}
|
|
19461
|
+
else {
|
|
19462
|
+
if (!this.shownTree && this.theOptions.loading == 'click' && !this.ready) {
|
|
19463
|
+
this.loadDataForTree(true, document.querySelector("#hierarchized-picker-" + this.componentID + ".loader"));
|
|
19464
|
+
}
|
|
19465
|
+
}
|
|
19447
19466
|
const previousShownTree = this.shownTree;
|
|
19448
19467
|
this.shownTree = this.hasFocus.length > 0;
|
|
19449
19468
|
if (this.shownTree && !previousShownTree) {
|
|
@@ -19492,8 +19511,8 @@ const HierarchizedPickerComponent = class extends HTMLElement {
|
|
|
19492
19511
|
if (!value)
|
|
19493
19512
|
value = this.value;
|
|
19494
19513
|
this.displayedValue = value.map(item => {
|
|
19495
|
-
var _a
|
|
19496
|
-
return (
|
|
19514
|
+
var _a;
|
|
19515
|
+
return (_a = (this.optionsManager.getOptions().isFullpath ? item.fullpathTranslated : item.shortpathTranslated)) !== null && _a !== void 0 ? _a : `Node ${item.nodeid}`;
|
|
19497
19516
|
}).join(';');
|
|
19498
19517
|
}
|
|
19499
19518
|
// Search a value in the tree and triggers a search when necessary
|
|
@@ -641,7 +641,7 @@ Tree.prototype.createUlEle = function () {
|
|
|
641
641
|
Tree.prototype.createLiEle = function (node, closed) {
|
|
642
642
|
const li = document.createElement('li');
|
|
643
643
|
li.classList.add('treejs-node');
|
|
644
|
-
if (node.deprecated) {
|
|
644
|
+
if (node.deprecated || node.Is_Deprecated) {
|
|
645
645
|
li.classList.add('treejs-node__deprecated');
|
|
646
646
|
}
|
|
647
647
|
if (node.isDesaturated) {
|
|
@@ -18436,7 +18436,7 @@ function fillTreeWithObject(tree, myObject, searched, options, depth = 0) {
|
|
|
18436
18436
|
const searchResultPresentsUnMatched = options.searchResultPresentsUnMatched;
|
|
18437
18437
|
if (myObject && myObject.length) {
|
|
18438
18438
|
myObject.forEach(value => {
|
|
18439
|
-
var _a, _b, _c;
|
|
18439
|
+
var _a, _b, _c, _d;
|
|
18440
18440
|
let keyPropFromNode = null;
|
|
18441
18441
|
let valueTranslatedPropFromNode = null;
|
|
18442
18442
|
let fullpathPropFromNode = null;
|
|
@@ -18446,6 +18446,10 @@ function fillTreeWithObject(tree, myObject, searched, options, depth = 0) {
|
|
|
18446
18446
|
valueTranslatedPropFromNode = (_a = getPropertyFromNode(value, 'Translations')[options.language]) === null || _a === void 0 ? void 0 : _a.translated_name;
|
|
18447
18447
|
fullpathPropFromNode = (_b = getPropertyFromNode(value, 'Properties')) === null || _b === void 0 ? void 0 : _b.System_Fullpath;
|
|
18448
18448
|
fullpathTranslatedPropFromNode = (_c = getPropertyFromNode(value, 'Translations')[options.language]) === null || _c === void 0 ? void 0 : _c.translated_fullpath;
|
|
18449
|
+
if (!fullpathPropFromNode)
|
|
18450
|
+
fullpathPropFromNode = (_d = getPropertyFromNode(value, 'Properties')) === null || _d === void 0 ? void 0 : _d.System_FullPath;
|
|
18451
|
+
if (!fullpathTranslatedPropFromNode)
|
|
18452
|
+
fullpathTranslatedPropFromNode = getPropertyFromNode(value, 'fullpathTranslated');
|
|
18449
18453
|
}
|
|
18450
18454
|
else {
|
|
18451
18455
|
keyPropFromNode = getPropertyFromNode(value, 'key');
|
|
@@ -18454,7 +18458,9 @@ function fillTreeWithObject(tree, myObject, searched, options, depth = 0) {
|
|
|
18454
18458
|
fullpathTranslatedPropFromNode = getPropertyFromNode(value, 'fullpathTranslated');
|
|
18455
18459
|
}
|
|
18456
18460
|
const childrenPropFromNode = getPropertyFromNode(value, 'children', false);
|
|
18457
|
-
|
|
18461
|
+
let deprecated = getPropertyFromNode(value, 'deprecated', null);
|
|
18462
|
+
if (deprecated === null)
|
|
18463
|
+
deprecated = getPropertyFromNode(value, 'Is_Deprecated', false);
|
|
18458
18464
|
const objToPush = {
|
|
18459
18465
|
id: keyPropFromNode,
|
|
18460
18466
|
nodeId: keyPropFromNode,
|
|
@@ -19117,14 +19123,21 @@ const HierarchizedPickerComponent = class {
|
|
|
19117
19123
|
}
|
|
19118
19124
|
getApiSearchURL() {
|
|
19119
19125
|
if (this.optionsManager.getOptions().origin == 'classification') {
|
|
19120
|
-
|
|
19121
|
-
|
|
19122
|
-
|
|
19126
|
+
const baseURL = this.optionsManager.getOptions().url;
|
|
19127
|
+
if (baseURL.indexOf("getTree") > -1) {
|
|
19128
|
+
return baseURL.replace("/getTree/", "/search/");
|
|
19129
|
+
}
|
|
19130
|
+
else {
|
|
19131
|
+
let substringUpToLastSlash = this.optionsManager.getOptions().url.substring(0, this.optionsManager.getOptions().url.lastIndexOf('/'));
|
|
19132
|
+
let context = substringUpToLastSlash.substring(substringUpToLastSlash.lastIndexOf('/'), substringUpToLastSlash.length);
|
|
19133
|
+
return substringUpToLastSlash.substring(0, substringUpToLastSlash.lastIndexOf('/')) + '/search' + context;
|
|
19134
|
+
}
|
|
19123
19135
|
}
|
|
19124
19136
|
else {
|
|
19125
19137
|
return this.optionsManager.getOptions().url.substring(0, this.optionsManager.getOptions().url.lastIndexOf('/')) + '/GetTreeFromSearch';
|
|
19126
19138
|
}
|
|
19127
19139
|
}
|
|
19140
|
+
// TODO > Celine would rather like the context (thesaurus or position) to be extracted another way
|
|
19128
19141
|
getContextualApiURL() {
|
|
19129
19142
|
const { options, url } = this.optionsManager.getOptions();
|
|
19130
19143
|
if (options.Reach) {
|
|
@@ -19132,15 +19145,18 @@ const HierarchizedPickerComponent = class {
|
|
|
19132
19145
|
const base = window.location.origin; // fallback for relative URLs
|
|
19133
19146
|
const parsedUrl = new URL(url, base);
|
|
19134
19147
|
const pathSegments = parsedUrl.pathname.split('/');
|
|
19135
|
-
|
|
19148
|
+
let dynamicType = pathSegments[pathSegments.length - 2];
|
|
19149
|
+
if (['thesaurus', 'position'].indexOf(dynamicType) == -1)
|
|
19150
|
+
dynamicType = pathSegments[pathSegments.length - 1];
|
|
19136
19151
|
const newPathname = `/api/v1/classification/reach/${dynamicType}/${options.Reach}`;
|
|
19137
19152
|
this.optionsManager.dropReach();
|
|
19138
19153
|
return `${parsedUrl.origin}${newPathname}`;
|
|
19139
19154
|
}
|
|
19140
19155
|
return url;
|
|
19141
19156
|
}
|
|
19142
|
-
getContextualApiParams(search = null) {
|
|
19143
|
-
|
|
19157
|
+
getContextualApiParams(options = null, search = null) {
|
|
19158
|
+
if (!options)
|
|
19159
|
+
options = this.optionsManager.getOptions().options;
|
|
19144
19160
|
let optionsToReturn = Object.assign({}, options);
|
|
19145
19161
|
if (options.Reach) {
|
|
19146
19162
|
delete optionsToReturn.Reach;
|
|
@@ -19160,8 +19176,6 @@ const HierarchizedPickerComponent = class {
|
|
|
19160
19176
|
delete optionsToReturn.startNode;
|
|
19161
19177
|
}
|
|
19162
19178
|
}
|
|
19163
|
-
else
|
|
19164
|
-
return options;
|
|
19165
19179
|
return optionsToReturn;
|
|
19166
19180
|
}
|
|
19167
19181
|
translateDataForTree(dataToLoad, searchID = null, searched = null) {
|
|
@@ -19197,7 +19211,7 @@ const HierarchizedPickerComponent = class {
|
|
|
19197
19211
|
if (this.theOptions.source == 'webservice') {
|
|
19198
19212
|
if (this.theOptions.origin == 'classification') {
|
|
19199
19213
|
// WS Call
|
|
19200
|
-
this.rawDataManager.getFromClassification(this.getApiSearchURL(), Object.assign({}, this.getContextualApiParams(searched)), document.querySelector("#hierarchized-picker-" + this.componentID + ".loader"))
|
|
19214
|
+
this.rawDataManager.getFromClassification(this.getApiSearchURL(), Object.assign({}, this.getContextualApiParams(null, searched)), document.querySelector("#hierarchized-picker-" + this.componentID + ".loader"))
|
|
19201
19215
|
.then((data) => {
|
|
19202
19216
|
displayResults(data);
|
|
19203
19217
|
if (!searched) {
|
|
@@ -19442,6 +19456,11 @@ const HierarchizedPickerComponent = class {
|
|
|
19442
19456
|
if (this.hasFocus.indexOf('hide') > -1 && !isStillInsidePicker) {
|
|
19443
19457
|
this.hasFocus = [];
|
|
19444
19458
|
}
|
|
19459
|
+
else {
|
|
19460
|
+
if (!this.shownTree && this.theOptions.loading == 'click' && !this.ready) {
|
|
19461
|
+
this.loadDataForTree(true, document.querySelector("#hierarchized-picker-" + this.componentID + ".loader"));
|
|
19462
|
+
}
|
|
19463
|
+
}
|
|
19445
19464
|
const previousShownTree = this.shownTree;
|
|
19446
19465
|
this.shownTree = this.hasFocus.length > 0;
|
|
19447
19466
|
if (this.shownTree && !previousShownTree) {
|
|
@@ -19490,8 +19509,8 @@ const HierarchizedPickerComponent = class {
|
|
|
19490
19509
|
if (!value)
|
|
19491
19510
|
value = this.value;
|
|
19492
19511
|
this.displayedValue = value.map(item => {
|
|
19493
|
-
var _a
|
|
19494
|
-
return (
|
|
19512
|
+
var _a;
|
|
19513
|
+
return (_a = (this.optionsManager.getOptions().isFullpath ? item.fullpathTranslated : item.shortpathTranslated)) !== null && _a !== void 0 ? _a : `Node ${item.nodeid}`;
|
|
19495
19514
|
}).join(';');
|
|
19496
19515
|
}
|
|
19497
19516
|
// Search a value in the tree and triggers a search when necessary
|