reneco-hierarchized-picker 0.4.2-beta.7 → 0.4.2-beta.9

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.
@@ -281,16 +281,17 @@ Tree.prototype.buildTree = function (nodes, depth) {
281
281
  };
282
282
  Tree.prototype.bindEvent = function (ele) {
283
283
  var _a;
284
- const that = this;
285
284
  if (!this.options.parentApi.isDisabled) {
286
285
  const contextMenu = this.options.parentApi.theOptions.contextMenu;
287
286
  if ((_a = contextMenu === null || contextMenu === void 0 ? void 0 : contextMenu.items) === null || _a === void 0 ? void 0 : _a.length) {
288
287
  new VanillaContextMenu(Object.assign(Object.assign({}, contextMenu), { scope: ele, menuItems: contextMenu.items.map(item => {
289
288
  return typeof item === 'string'
290
289
  ? item
291
- : Object.assign(Object.assign({}, item), { callback: e => {
292
- let targetOutput = Object.assign(Object.assign({}, that.nodesById[e.target.nodeId]), { hasChildren: that.nodesById[e.target.nodeId] && that.nodesById[e.target.nodeId].children &&
293
- that.nodesById[e.target.nodeId].children.length && that.nodesById[e.target.nodeId].children.length > 0 });
290
+ : Object.assign(Object.assign({}, item), { callback: async (e) => {
291
+ const pickerValue = await this.options.parentApi.getValue();
292
+ const treeJsNodeInfo = Object.assign({}, this.options.parentApi.loadedTreeJs.nodesById[pickerValue.nodeid]);
293
+ console.log("---- HELLO ", pickerValue, treeJsNodeInfo);
294
+ let targetOutput = Object.assign(Object.assign({}, treeJsNodeInfo), { hasChildren: treeJsNodeInfo.children.length > 0 });
294
295
  delete targetOutput.children;
295
296
  this.options.parentApi.onItemContextMenuItemClick(Object.assign(Object.assign({}, e), { target: targetOutput, contextMenuItem: item }));
296
297
  } });
@@ -18923,6 +18924,7 @@ const HierarchizedPickerComponent = class {
18923
18924
  }
18924
18925
  let autoAssignReach = true;
18925
18926
  let defaultFromFullpaths = undefined;
18927
+ // TODO Revoir cette partie ? utilite ? (case == null ?)
18926
18928
  if (!this.isDisabled)
18927
18929
  this.isDisabled = false;
18928
18930
  if (this.optionsManager.getOptions().readonly !== undefined)
@@ -18940,7 +18942,7 @@ const HierarchizedPickerComponent = class {
18940
18942
  if (!this.optionsManager.getOptions().displayRootNode)
18941
18943
  this.optionsManager.getOptions().displayRootNode = false;
18942
18944
  if (!this.optionsManager.getOptions().dragAndDropEnabled)
18943
- this.optionsManager.getOptions().dragAndDropEnabled = true;
18945
+ this.optionsManager.getOptions().dragAndDropEnabled = false;
18944
18946
  if (!this.optionsManager.getOptions().defaultValueIsFullpath)
18945
18947
  this.optionsManager.getOptions().defaultValueIsFullpath = false;
18946
18948
  if (!this.optionsManager.getOptions() && this.optionsManager.getOptions().errorsInInput !== false)
@@ -19274,7 +19276,7 @@ const HierarchizedPickerComponent = class {
19274
19276
  onItemContextMenuItemClick(e) {
19275
19277
  this.itemContextMenuItemClick.emit(e);
19276
19278
  }
19277
- async setNodeAsSelected(id, treeToUpdate, userClick) {
19279
+ setNodeAsSelected(id, treeToUpdate, userClick) {
19278
19280
  // TODO Temporarily ignores disabled mode for selecting nodes if mode is tree
19279
19281
  if (((this.isDisabled && this.optionsManager.getOptions().mode != "tree") && this.shownTree && this.setValueOnClick) ||
19280
19282
  (this.loadedTreeJs.liElementsById[id] && this.loadedTreeJs.liElementsById[id].classList.value && this.loadedTreeJs.liElementsById[id].classList.value.indexOf('readonly_node') != -1)) {
@@ -262,6 +262,7 @@ export class HierarchizedPickerComponent {
262
262
  }
263
263
  let autoAssignReach = true;
264
264
  let defaultFromFullpaths = undefined;
265
+ // TODO Revoir cette partie ? utilite ? (case == null ?)
265
266
  if (!this.isDisabled)
266
267
  this.isDisabled = false;
267
268
  if (this.optionsManager.getOptions().readonly !== undefined)
@@ -279,7 +280,7 @@ export class HierarchizedPickerComponent {
279
280
  if (!this.optionsManager.getOptions().displayRootNode)
280
281
  this.optionsManager.getOptions().displayRootNode = false;
281
282
  if (!this.optionsManager.getOptions().dragAndDropEnabled)
282
- this.optionsManager.getOptions().dragAndDropEnabled = true;
283
+ this.optionsManager.getOptions().dragAndDropEnabled = false;
283
284
  if (!this.optionsManager.getOptions().defaultValueIsFullpath)
284
285
  this.optionsManager.getOptions().defaultValueIsFullpath = false;
285
286
  if (!this.optionsManager.getOptions() && this.optionsManager.getOptions().errorsInInput !== false)
@@ -616,7 +617,7 @@ export class HierarchizedPickerComponent {
616
617
  onItemContextMenuItemClick(e) {
617
618
  this.itemContextMenuItemClick.emit(e);
618
619
  }
619
- async setNodeAsSelected(id, treeToUpdate, userClick) {
620
+ setNodeAsSelected(id, treeToUpdate, userClick) {
620
621
  // TODO Temporarily ignores disabled mode for selecting nodes if mode is tree
621
622
  if (((this.isDisabled && this.optionsManager.getOptions().mode != "tree") && this.shownTree && this.setValueOnClick) ||
622
623
  (this.loadedTreeJs.liElementsById[id] && this.loadedTreeJs.liElementsById[id].classList.value && this.loadedTreeJs.liElementsById[id].classList.value.indexOf('readonly_node') != -1)) {
@@ -147,7 +147,7 @@ Tree.prototype.buildTree = function (nodes, depth) {
147
147
  };
148
148
  Tree.prototype.bindEvent = function (ele) {
149
149
  var _a;
150
- const that = this;
150
+ // const that = this;
151
151
  // let parentOptions:any = {};
152
152
  // try{
153
153
  // parentOptions = JSON.parse(this.options.parentApi.theOptions);
@@ -165,9 +165,11 @@ Tree.prototype.bindEvent = function (ele) {
165
165
  new VanillaContextMenu(Object.assign(Object.assign({}, contextMenu), { scope: ele, menuItems: contextMenu.items.map(item => {
166
166
  return typeof item === 'string'
167
167
  ? item
168
- : Object.assign(Object.assign({}, item), { callback: e => {
169
- let targetOutput = Object.assign(Object.assign({}, that.nodesById[e.target.nodeId]), { hasChildren: that.nodesById[e.target.nodeId] && that.nodesById[e.target.nodeId].children &&
170
- that.nodesById[e.target.nodeId].children.length && that.nodesById[e.target.nodeId].children.length > 0 });
168
+ : Object.assign(Object.assign({}, item), { callback: async (e) => {
169
+ const pickerValue = await this.options.parentApi.getValue();
170
+ const treeJsNodeInfo = Object.assign({}, this.options.parentApi.loadedTreeJs.nodesById[pickerValue.nodeid]);
171
+ console.log("---- HELLO ", pickerValue, treeJsNodeInfo);
172
+ let targetOutput = Object.assign(Object.assign({}, treeJsNodeInfo), { hasChildren: treeJsNodeInfo.children.length > 0 });
171
173
  delete targetOutput.children;
172
174
  this.options.parentApi.onItemContextMenuItemClick(Object.assign(Object.assign({}, e), { target: targetOutput, contextMenuItem: item }));
173
175
  } });
@@ -278,16 +278,17 @@ Tree.prototype.buildTree = function (nodes, depth) {
278
278
  };
279
279
  Tree.prototype.bindEvent = function (ele) {
280
280
  var _a;
281
- const that = this;
282
281
  if (!this.options.parentApi.isDisabled) {
283
282
  const contextMenu = this.options.parentApi.theOptions.contextMenu;
284
283
  if ((_a = contextMenu === null || contextMenu === void 0 ? void 0 : contextMenu.items) === null || _a === void 0 ? void 0 : _a.length) {
285
284
  new VanillaContextMenu(Object.assign(Object.assign({}, contextMenu), { scope: ele, menuItems: contextMenu.items.map(item => {
286
285
  return typeof item === 'string'
287
286
  ? item
288
- : Object.assign(Object.assign({}, item), { callback: e => {
289
- let targetOutput = Object.assign(Object.assign({}, that.nodesById[e.target.nodeId]), { hasChildren: that.nodesById[e.target.nodeId] && that.nodesById[e.target.nodeId].children &&
290
- that.nodesById[e.target.nodeId].children.length && that.nodesById[e.target.nodeId].children.length > 0 });
287
+ : Object.assign(Object.assign({}, item), { callback: async (e) => {
288
+ const pickerValue = await this.options.parentApi.getValue();
289
+ const treeJsNodeInfo = Object.assign({}, this.options.parentApi.loadedTreeJs.nodesById[pickerValue.nodeid]);
290
+ console.log("---- HELLO ", pickerValue, treeJsNodeInfo);
291
+ let targetOutput = Object.assign(Object.assign({}, treeJsNodeInfo), { hasChildren: treeJsNodeInfo.children.length > 0 });
291
292
  delete targetOutput.children;
292
293
  this.options.parentApi.onItemContextMenuItemClick(Object.assign(Object.assign({}, e), { target: targetOutput, contextMenuItem: item }));
293
294
  } });
@@ -18921,6 +18922,7 @@ const HierarchizedPickerComponent = class extends HTMLElement {
18921
18922
  }
18922
18923
  let autoAssignReach = true;
18923
18924
  let defaultFromFullpaths = undefined;
18925
+ // TODO Revoir cette partie ? utilite ? (case == null ?)
18924
18926
  if (!this.isDisabled)
18925
18927
  this.isDisabled = false;
18926
18928
  if (this.optionsManager.getOptions().readonly !== undefined)
@@ -18938,7 +18940,7 @@ const HierarchizedPickerComponent = class extends HTMLElement {
18938
18940
  if (!this.optionsManager.getOptions().displayRootNode)
18939
18941
  this.optionsManager.getOptions().displayRootNode = false;
18940
18942
  if (!this.optionsManager.getOptions().dragAndDropEnabled)
18941
- this.optionsManager.getOptions().dragAndDropEnabled = true;
18943
+ this.optionsManager.getOptions().dragAndDropEnabled = false;
18942
18944
  if (!this.optionsManager.getOptions().defaultValueIsFullpath)
18943
18945
  this.optionsManager.getOptions().defaultValueIsFullpath = false;
18944
18946
  if (!this.optionsManager.getOptions() && this.optionsManager.getOptions().errorsInInput !== false)
@@ -19272,7 +19274,7 @@ const HierarchizedPickerComponent = class extends HTMLElement {
19272
19274
  onItemContextMenuItemClick(e) {
19273
19275
  this.itemContextMenuItemClick.emit(e);
19274
19276
  }
19275
- async setNodeAsSelected(id, treeToUpdate, userClick) {
19277
+ setNodeAsSelected(id, treeToUpdate, userClick) {
19276
19278
  // TODO Temporarily ignores disabled mode for selecting nodes if mode is tree
19277
19279
  if (((this.isDisabled && this.optionsManager.getOptions().mode != "tree") && this.shownTree && this.setValueOnClick) ||
19278
19280
  (this.loadedTreeJs.liElementsById[id] && this.loadedTreeJs.liElementsById[id].classList.value && this.loadedTreeJs.liElementsById[id].classList.value.indexOf('readonly_node') != -1)) {
@@ -277,16 +277,17 @@ Tree.prototype.buildTree = function (nodes, depth) {
277
277
  };
278
278
  Tree.prototype.bindEvent = function (ele) {
279
279
  var _a;
280
- const that = this;
281
280
  if (!this.options.parentApi.isDisabled) {
282
281
  const contextMenu = this.options.parentApi.theOptions.contextMenu;
283
282
  if ((_a = contextMenu === null || contextMenu === void 0 ? void 0 : contextMenu.items) === null || _a === void 0 ? void 0 : _a.length) {
284
283
  new VanillaContextMenu(Object.assign(Object.assign({}, contextMenu), { scope: ele, menuItems: contextMenu.items.map(item => {
285
284
  return typeof item === 'string'
286
285
  ? item
287
- : Object.assign(Object.assign({}, item), { callback: e => {
288
- let targetOutput = Object.assign(Object.assign({}, that.nodesById[e.target.nodeId]), { hasChildren: that.nodesById[e.target.nodeId] && that.nodesById[e.target.nodeId].children &&
289
- that.nodesById[e.target.nodeId].children.length && that.nodesById[e.target.nodeId].children.length > 0 });
286
+ : Object.assign(Object.assign({}, item), { callback: async (e) => {
287
+ const pickerValue = await this.options.parentApi.getValue();
288
+ const treeJsNodeInfo = Object.assign({}, this.options.parentApi.loadedTreeJs.nodesById[pickerValue.nodeid]);
289
+ console.log("---- HELLO ", pickerValue, treeJsNodeInfo);
290
+ let targetOutput = Object.assign(Object.assign({}, treeJsNodeInfo), { hasChildren: treeJsNodeInfo.children.length > 0 });
290
291
  delete targetOutput.children;
291
292
  this.options.parentApi.onItemContextMenuItemClick(Object.assign(Object.assign({}, e), { target: targetOutput, contextMenuItem: item }));
292
293
  } });
@@ -18919,6 +18920,7 @@ const HierarchizedPickerComponent = class {
18919
18920
  }
18920
18921
  let autoAssignReach = true;
18921
18922
  let defaultFromFullpaths = undefined;
18923
+ // TODO Revoir cette partie ? utilite ? (case == null ?)
18922
18924
  if (!this.isDisabled)
18923
18925
  this.isDisabled = false;
18924
18926
  if (this.optionsManager.getOptions().readonly !== undefined)
@@ -18936,7 +18938,7 @@ const HierarchizedPickerComponent = class {
18936
18938
  if (!this.optionsManager.getOptions().displayRootNode)
18937
18939
  this.optionsManager.getOptions().displayRootNode = false;
18938
18940
  if (!this.optionsManager.getOptions().dragAndDropEnabled)
18939
- this.optionsManager.getOptions().dragAndDropEnabled = true;
18941
+ this.optionsManager.getOptions().dragAndDropEnabled = false;
18940
18942
  if (!this.optionsManager.getOptions().defaultValueIsFullpath)
18941
18943
  this.optionsManager.getOptions().defaultValueIsFullpath = false;
18942
18944
  if (!this.optionsManager.getOptions() && this.optionsManager.getOptions().errorsInInput !== false)
@@ -19270,7 +19272,7 @@ const HierarchizedPickerComponent = class {
19270
19272
  onItemContextMenuItemClick(e) {
19271
19273
  this.itemContextMenuItemClick.emit(e);
19272
19274
  }
19273
- async setNodeAsSelected(id, treeToUpdate, userClick) {
19275
+ setNodeAsSelected(id, treeToUpdate, userClick) {
19274
19276
  // TODO Temporarily ignores disabled mode for selecting nodes if mode is tree
19275
19277
  if (((this.isDisabled && this.optionsManager.getOptions().mode != "tree") && this.shownTree && this.setValueOnClick) ||
19276
19278
  (this.loadedTreeJs.liElementsById[id] && this.loadedTreeJs.liElementsById[id].classList.value && this.loadedTreeJs.liElementsById[id].classList.value.indexOf('readonly_node') != -1)) {