reneco-hierarchized-picker 0.5.1 → 0.5.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.
@@ -18043,7 +18043,10 @@ function replacer(key, value) {
18043
18043
  }
18044
18044
  function searchValue(obj, strict, searched) {
18045
18045
  let toret = false;
18046
- if (obj.text.toLowerCase().indexOf(searched.toLowerCase()) > -1) {
18046
+ function normalize(s) {
18047
+ return s.replace(/\u00A0/g, " ");
18048
+ }
18049
+ if (normalize(obj.text).toLowerCase().indexOf(normalize(searched).toLowerCase()) > -1) {
18047
18050
  toret = true;
18048
18051
  }
18049
18052
  else if (!strict && obj.children.length > 0 && Object.keys(obj.children[0]).length != 0) {
@@ -18331,7 +18334,7 @@ class RawDataManager {
18331
18334
  toAdd[childrenKey] = this.reorderItems(source[childrenKey], toAdd[childrenKey], idKey);
18332
18335
  source[childrenKey] = ((_b = source[childrenKey]) === null || _b === void 0 ? void 0 : _b.length)
18333
18336
  ? source[childrenKey].map((child, index) => {
18334
- return this.genericMerge(child, toAdd[childrenKey].filter(item => item.key == child.key)[index], idKey, childrenKey);
18337
+ return this.genericMerge(child, toAdd[childrenKey].filter(item => item.key == child.key)[0], idKey, childrenKey);
18335
18338
  })
18336
18339
  : toAdd[childrenKey];
18337
18340
  return source;
@@ -18435,6 +18438,9 @@ function getPropertyFromNode(node, property, logerror = true) {
18435
18438
  function findNodeById(tree, nodeId) {
18436
18439
  return tree.nodesById[nodeId] || null;
18437
18440
  }
18441
+ function normalizeStr(str) {
18442
+ return str.replace(/\u00A0/g, " ");
18443
+ }
18438
18444
  // TODO Deprecated ?
18439
18445
  // export function getNodesFromSearch(data: any, searched: string): any[] {
18440
18446
  // let toret: any[] = [];
@@ -18491,9 +18497,9 @@ function fillTreeWithObject(tree, myObject, searched, options) {
18491
18497
  const objToPush = {
18492
18498
  id: keyPropFromNode,
18493
18499
  nodeId: keyPropFromNode,
18494
- text: valueTranslatedPropFromNode,
18495
- fullpath: fullpathPropFromNode,
18496
- fullpathTranslated: fullpathTranslatedPropFromNode,
18500
+ text: normalizeStr(valueTranslatedPropFromNode),
18501
+ fullpath: normalizeStr(fullpathPropFromNode),
18502
+ fullpathTranslated: normalizeStr(fullpathTranslatedPropFromNode),
18497
18503
  children: getPropertyFromNode(value, 'hasChildren', false) && childrenPropFromNode && childrenPropFromNode.length === 0 ? [{}] : [],
18498
18504
  deprecated,
18499
18505
  isDesaturated: false,
@@ -182,7 +182,7 @@ export class RawDataManager {
182
182
  toAdd[childrenKey] = this.reorderItems(source[childrenKey], toAdd[childrenKey], idKey);
183
183
  source[childrenKey] = ((_b = source[childrenKey]) === null || _b === void 0 ? void 0 : _b.length)
184
184
  ? source[childrenKey].map((child, index) => {
185
- return this.genericMerge(child, toAdd[childrenKey].filter(item => item.key == child.key)[index], idKey, childrenKey);
185
+ return this.genericMerge(child, toAdd[childrenKey].filter(item => item.key == child.key)[0], idKey, childrenKey);
186
186
  })
187
187
  : toAdd[childrenKey];
188
188
  return source;
@@ -23,6 +23,9 @@ export function getPropertyFromNode(node, property, logerror = true) {
23
23
  export function findNodeById(tree, nodeId) {
24
24
  return tree.nodesById[nodeId] || null;
25
25
  }
26
+ function normalizeStr(str) {
27
+ return str.replace(/\u00A0/g, " ");
28
+ }
26
29
  // TODO Deprecated ?
27
30
  // export function getNodesFromSearch(data: any, searched: string): any[] {
28
31
  // let toret: any[] = [];
@@ -79,9 +82,9 @@ export function fillTreeWithObject(tree, myObject, searched, options) {
79
82
  const objToPush = {
80
83
  id: keyPropFromNode,
81
84
  nodeId: keyPropFromNode,
82
- text: valueTranslatedPropFromNode,
83
- fullpath: fullpathPropFromNode,
84
- fullpathTranslated: fullpathTranslatedPropFromNode,
85
+ text: normalizeStr(valueTranslatedPropFromNode),
86
+ fullpath: normalizeStr(fullpathPropFromNode),
87
+ fullpathTranslated: normalizeStr(fullpathTranslatedPropFromNode),
85
88
  children: getPropertyFromNode(value, 'hasChildren', false) && childrenPropFromNode && childrenPropFromNode.length === 0 ? [{}] : [],
86
89
  deprecated,
87
90
  isDesaturated: false,
@@ -17,7 +17,10 @@ export function replacer(key, value) {
17
17
  }
18
18
  export function searchValue(obj, strict, searched) {
19
19
  let toret = false;
20
- if (obj.text.toLowerCase().indexOf(searched.toLowerCase()) > -1) {
20
+ function normalize(s) {
21
+ return s.replace(/\u00A0/g, " ");
22
+ }
23
+ if (normalize(obj.text).toLowerCase().indexOf(normalize(searched).toLowerCase()) > -1) {
21
24
  toret = true;
22
25
  }
23
26
  else if (!strict && obj.children.length > 0 && Object.keys(obj.children[0]).length != 0) {
@@ -18040,7 +18040,10 @@ function replacer(key, value) {
18040
18040
  }
18041
18041
  function searchValue(obj, strict, searched) {
18042
18042
  let toret = false;
18043
- if (obj.text.toLowerCase().indexOf(searched.toLowerCase()) > -1) {
18043
+ function normalize(s) {
18044
+ return s.replace(/\u00A0/g, " ");
18045
+ }
18046
+ if (normalize(obj.text).toLowerCase().indexOf(normalize(searched).toLowerCase()) > -1) {
18044
18047
  toret = true;
18045
18048
  }
18046
18049
  else if (!strict && obj.children.length > 0 && Object.keys(obj.children[0]).length != 0) {
@@ -18328,7 +18331,7 @@ class RawDataManager {
18328
18331
  toAdd[childrenKey] = this.reorderItems(source[childrenKey], toAdd[childrenKey], idKey);
18329
18332
  source[childrenKey] = ((_b = source[childrenKey]) === null || _b === void 0 ? void 0 : _b.length)
18330
18333
  ? source[childrenKey].map((child, index) => {
18331
- return this.genericMerge(child, toAdd[childrenKey].filter(item => item.key == child.key)[index], idKey, childrenKey);
18334
+ return this.genericMerge(child, toAdd[childrenKey].filter(item => item.key == child.key)[0], idKey, childrenKey);
18332
18335
  })
18333
18336
  : toAdd[childrenKey];
18334
18337
  return source;
@@ -18432,6 +18435,9 @@ function getPropertyFromNode(node, property, logerror = true) {
18432
18435
  function findNodeById(tree, nodeId) {
18433
18436
  return tree.nodesById[nodeId] || null;
18434
18437
  }
18438
+ function normalizeStr(str) {
18439
+ return str.replace(/\u00A0/g, " ");
18440
+ }
18435
18441
  // TODO Deprecated ?
18436
18442
  // export function getNodesFromSearch(data: any, searched: string): any[] {
18437
18443
  // let toret: any[] = [];
@@ -18488,9 +18494,9 @@ function fillTreeWithObject(tree, myObject, searched, options) {
18488
18494
  const objToPush = {
18489
18495
  id: keyPropFromNode,
18490
18496
  nodeId: keyPropFromNode,
18491
- text: valueTranslatedPropFromNode,
18492
- fullpath: fullpathPropFromNode,
18493
- fullpathTranslated: fullpathTranslatedPropFromNode,
18497
+ text: normalizeStr(valueTranslatedPropFromNode),
18498
+ fullpath: normalizeStr(fullpathPropFromNode),
18499
+ fullpathTranslated: normalizeStr(fullpathTranslatedPropFromNode),
18494
18500
  children: getPropertyFromNode(value, 'hasChildren', false) && childrenPropFromNode && childrenPropFromNode.length === 0 ? [{}] : [],
18495
18501
  deprecated,
18496
18502
  isDesaturated: false,
@@ -18039,7 +18039,10 @@ function replacer(key, value) {
18039
18039
  }
18040
18040
  function searchValue(obj, strict, searched) {
18041
18041
  let toret = false;
18042
- if (obj.text.toLowerCase().indexOf(searched.toLowerCase()) > -1) {
18042
+ function normalize(s) {
18043
+ return s.replace(/\u00A0/g, " ");
18044
+ }
18045
+ if (normalize(obj.text).toLowerCase().indexOf(normalize(searched).toLowerCase()) > -1) {
18043
18046
  toret = true;
18044
18047
  }
18045
18048
  else if (!strict && obj.children.length > 0 && Object.keys(obj.children[0]).length != 0) {
@@ -18327,7 +18330,7 @@ class RawDataManager {
18327
18330
  toAdd[childrenKey] = this.reorderItems(source[childrenKey], toAdd[childrenKey], idKey);
18328
18331
  source[childrenKey] = ((_b = source[childrenKey]) === null || _b === void 0 ? void 0 : _b.length)
18329
18332
  ? source[childrenKey].map((child, index) => {
18330
- return this.genericMerge(child, toAdd[childrenKey].filter(item => item.key == child.key)[index], idKey, childrenKey);
18333
+ return this.genericMerge(child, toAdd[childrenKey].filter(item => item.key == child.key)[0], idKey, childrenKey);
18331
18334
  })
18332
18335
  : toAdd[childrenKey];
18333
18336
  return source;
@@ -18431,6 +18434,9 @@ function getPropertyFromNode(node, property, logerror = true) {
18431
18434
  function findNodeById(tree, nodeId) {
18432
18435
  return tree.nodesById[nodeId] || null;
18433
18436
  }
18437
+ function normalizeStr(str) {
18438
+ return str.replace(/\u00A0/g, " ");
18439
+ }
18434
18440
  // TODO Deprecated ?
18435
18441
  // export function getNodesFromSearch(data: any, searched: string): any[] {
18436
18442
  // let toret: any[] = [];
@@ -18487,9 +18493,9 @@ function fillTreeWithObject(tree, myObject, searched, options) {
18487
18493
  const objToPush = {
18488
18494
  id: keyPropFromNode,
18489
18495
  nodeId: keyPropFromNode,
18490
- text: valueTranslatedPropFromNode,
18491
- fullpath: fullpathPropFromNode,
18492
- fullpathTranslated: fullpathTranslatedPropFromNode,
18496
+ text: normalizeStr(valueTranslatedPropFromNode),
18497
+ fullpath: normalizeStr(fullpathPropFromNode),
18498
+ fullpathTranslated: normalizeStr(fullpathTranslatedPropFromNode),
18493
18499
  children: getPropertyFromNode(value, 'hasChildren', false) && childrenPropFromNode && childrenPropFromNode.length === 0 ? [{}] : [],
18494
18500
  deprecated,
18495
18501
  isDesaturated: false,