@sme.up/ketchup 6.2.0 → 6.4.0

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.
Files changed (183) hide show
  1. package/dist/cjs/{f-button-5b69d882.js → f-button-826a470e.js} +4 -4
  2. package/dist/cjs/{f-cell-3a740c48.js → f-cell-2d5bcf0c.js} +13 -15
  3. package/dist/cjs/{f-checkbox-57443ca3.js → f-checkbox-cd977193.js} +1 -1
  4. package/dist/cjs/{f-chip-02e83f82.js → f-chip-2fd3363e.js} +3 -3
  5. package/dist/cjs/{f-image-2a61ece2.js → f-image-0f17d599.js} +2 -2
  6. package/dist/cjs/{f-paginator-utils-09126bdd.js → f-paginator-utils-946b579d.js} +80 -403
  7. package/dist/cjs/{f-text-field-9ee20a67.js → f-text-field-d243e4d8.js} +13 -3
  8. package/dist/cjs/{index-06b131ea.js → index-31125378.js} +9 -4
  9. package/dist/cjs/ketchup.cjs.js +3 -3
  10. package/dist/cjs/kup-accordion.cjs.entry.js +5 -6
  11. package/dist/cjs/kup-autocomplete_25.cjs.entry.js +129 -115
  12. package/dist/cjs/kup-box.cjs.entry.js +20 -20
  13. package/dist/cjs/kup-calendar.cjs.entry.js +9 -11
  14. package/dist/cjs/kup-cell.cjs.entry.js +9 -11
  15. package/dist/cjs/kup-dash-list.cjs.entry.js +5 -7
  16. package/dist/cjs/kup-dash_2.cjs.entry.js +4 -5
  17. package/dist/cjs/kup-dashboard.cjs.entry.js +76 -17
  18. package/dist/cjs/kup-drawer.cjs.entry.js +4 -5
  19. package/dist/cjs/kup-echart.cjs.entry.js +42 -34
  20. package/dist/cjs/kup-family-tree.cjs.entry.js +140 -64
  21. package/dist/cjs/kup-form.cjs.entry.js +21 -15
  22. package/dist/cjs/kup-iframe.cjs.entry.js +4 -5
  23. package/dist/cjs/kup-image-list.cjs.entry.js +10 -12
  24. package/dist/cjs/kup-lazy.cjs.entry.js +5 -6
  25. package/dist/cjs/kup-magic-box.cjs.entry.js +5 -6
  26. package/dist/cjs/{kup-manager-02acbb37.js → kup-manager-a8eecc60.js} +1419 -375
  27. package/dist/cjs/kup-nav-bar.cjs.entry.js +4 -5
  28. package/dist/cjs/kup-numeric-picker.cjs.entry.js +3 -3
  29. package/dist/cjs/kup-photo-frame.cjs.entry.js +4 -5
  30. package/dist/cjs/kup-probe.cjs.entry.js +2 -2
  31. package/dist/cjs/kup-qlik.cjs.entry.js +2 -2
  32. package/dist/cjs/kup-snackbar.cjs.entry.js +6 -7
  33. package/dist/cjs/loader.cjs.js +3 -3
  34. package/dist/collection/assets/dashboard.js +48 -0
  35. package/dist/collection/assets/family-tree.js +236 -19
  36. package/dist/collection/assets/form.js +41 -0
  37. package/dist/collection/assets/index.js +4 -0
  38. package/dist/collection/assets/kupinteract.js +68 -0
  39. package/dist/collection/collection-manifest.json +5 -5
  40. package/dist/collection/components/kup-box/kup-box.js +5 -3
  41. package/dist/collection/components/kup-button/kup-button-declarations.js +1 -0
  42. package/dist/collection/components/kup-button/kup-button.js +27 -0
  43. package/dist/collection/components/kup-dashboard/kup-dashboard.css +7 -0
  44. package/dist/collection/components/kup-dashboard/kup-dashboard.js +67 -7
  45. package/dist/collection/components/kup-data-table/kup-data-table-helper.js +42 -30
  46. package/dist/collection/components/kup-data-table/kup-data-table.js +3 -1
  47. package/dist/collection/components/kup-echart/kup-echart.js +34 -24
  48. package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +3 -1
  49. package/dist/collection/components/kup-family-tree/kup-family-tree.css +79 -9
  50. package/dist/collection/components/kup-family-tree/kup-family-tree.js +253 -65
  51. package/dist/collection/components/kup-form/kup-form-declarations.js +1 -0
  52. package/dist/collection/components/kup-form/kup-form.css +8 -0
  53. package/dist/collection/components/kup-form/kup-form.js +31 -2
  54. package/dist/collection/components/kup-image/assets/svg/azure.svg +1 -0
  55. package/dist/collection/components/kup-lazy/kup-lazy.css +8 -2
  56. package/dist/collection/components/kup-progress-bar/kup-progress-bar.css +1 -0
  57. package/dist/collection/components/kup-text-field/kup-text-field-declarations.js +1 -0
  58. package/dist/collection/components/kup-text-field/kup-text-field.js +27 -0
  59. package/dist/collection/f-components/f-button/f-button.js +2 -2
  60. package/dist/collection/f-components/f-cell/f-cell.js +1 -1
  61. package/dist/collection/f-components/f-text-field/f-text-field.js +11 -1
  62. package/dist/collection/managers/kup-data/kup-data-cell-helper.js +49 -15
  63. package/dist/collection/managers/kup-data/kup-data.js +9 -11
  64. package/dist/collection/managers/kup-dates/kup-dates.js +14 -0
  65. package/dist/collection/managers/kup-interact/kup-interact.js +3 -5
  66. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.js +2 -0
  67. package/dist/collection/managers/kup-scroll-on-hover/kup-scroll-on-hover.js +131 -45
  68. package/dist/collection/utils/filters/filters-rows.js +4 -23
  69. package/dist/collection/utils/filters/filters-tree-items.js +4 -3
  70. package/dist/esm/{f-button-fd44ef70.js → f-button-2d0a5f21.js} +4 -4
  71. package/dist/esm/{f-cell-7b159a22.js → f-cell-ee7d7b5c.js} +7 -9
  72. package/dist/esm/{f-checkbox-c51c4a75.js → f-checkbox-e06cf07b.js} +1 -1
  73. package/dist/esm/{f-chip-c2e4c522.js → f-chip-0d29f91f.js} +3 -3
  74. package/dist/esm/{f-image-2ab4b9aa.js → f-image-ab131d59.js} +2 -2
  75. package/dist/esm/{f-paginator-utils-ef537d82.js → f-paginator-utils-aa52af0f.js} +44 -366
  76. package/dist/esm/{f-text-field-41c575eb.js → f-text-field-0729b19f.js} +13 -3
  77. package/dist/esm/{index-ad6ab214.js → index-e41330a5.js} +9 -4
  78. package/dist/esm/ketchup.js +3 -3
  79. package/dist/esm/kup-accordion.entry.js +3 -4
  80. package/dist/esm/kup-autocomplete_25.entry.js +30 -16
  81. package/dist/esm/kup-box.entry.js +14 -14
  82. package/dist/esm/kup-calendar.entry.js +5 -7
  83. package/dist/esm/kup-cell.entry.js +7 -9
  84. package/dist/esm/kup-dash-list.entry.js +2 -4
  85. package/dist/esm/kup-dash_2.entry.js +2 -3
  86. package/dist/esm/kup-dashboard.entry.js +74 -15
  87. package/dist/esm/kup-drawer.entry.js +2 -3
  88. package/dist/esm/kup-echart.entry.js +36 -28
  89. package/dist/esm/kup-family-tree.entry.js +138 -62
  90. package/dist/esm/kup-form.entry.js +18 -12
  91. package/dist/esm/kup-iframe.entry.js +2 -3
  92. package/dist/esm/kup-image-list.entry.js +8 -10
  93. package/dist/esm/kup-lazy.entry.js +3 -4
  94. package/dist/esm/kup-magic-box.entry.js +3 -4
  95. package/dist/esm/{kup-manager-22a475e6.js → kup-manager-13b4f989.js} +1398 -376
  96. package/dist/esm/kup-nav-bar.entry.js +2 -3
  97. package/dist/esm/kup-numeric-picker.entry.js +3 -3
  98. package/dist/esm/kup-photo-frame.entry.js +2 -3
  99. package/dist/esm/kup-probe.entry.js +2 -2
  100. package/dist/esm/kup-qlik.entry.js +2 -2
  101. package/dist/esm/kup-snackbar.entry.js +4 -5
  102. package/dist/esm/loader.js +3 -3
  103. package/dist/ketchup/assets/svg/azure.svg +1 -0
  104. package/dist/ketchup/ketchup.esm.js +1 -1
  105. package/dist/ketchup/p-0986ad5d.js +1 -0
  106. package/dist/ketchup/{p-38d7584e.js → p-0cf10db0.js} +1 -1
  107. package/dist/ketchup/p-13666119.entry.js +27 -0
  108. package/dist/ketchup/p-18b68e86.entry.js +1 -0
  109. package/dist/ketchup/{p-1959f835.entry.js → p-28d514d0.entry.js} +1 -1
  110. package/dist/ketchup/p-2ffdbee1.entry.js +1 -0
  111. package/dist/ketchup/p-3dcfffbe.entry.js +1 -0
  112. package/dist/ketchup/p-3fe35411.entry.js +1 -0
  113. package/dist/ketchup/{p-cd5cfa7c.js → p-5552f156.js} +1 -1
  114. package/dist/ketchup/p-5f51009b.entry.js +1 -0
  115. package/dist/ketchup/{p-264b1b19.entry.js → p-816f0938.entry.js} +1 -1
  116. package/dist/ketchup/p-83c214d7.entry.js +1 -0
  117. package/dist/ketchup/p-84957bbf.entry.js +1 -0
  118. package/dist/ketchup/p-86795579.entry.js +1 -0
  119. package/dist/ketchup/p-8f85b8bb.entry.js +9 -0
  120. package/dist/ketchup/p-982d3e3a.entry.js +1 -0
  121. package/dist/ketchup/{p-e9366aaf.entry.js → p-adcfcd4f.entry.js} +4 -4
  122. package/dist/ketchup/p-b0b3989b.js +2 -0
  123. package/dist/ketchup/{p-dc62a30f.js → p-b705be3b.js} +1 -1
  124. package/dist/ketchup/{p-fc2b1229.js → p-b8c921ee.js} +3 -3
  125. package/dist/ketchup/{p-edae3076.js → p-bfe88b03.js} +1 -1
  126. package/dist/ketchup/p-d7091875.entry.js +1 -0
  127. package/dist/ketchup/p-d8656956.entry.js +1 -0
  128. package/dist/ketchup/p-dc69549c.entry.js +1 -0
  129. package/dist/ketchup/p-e01fa411.entry.js +1 -0
  130. package/dist/ketchup/p-e0f659c9.entry.js +1 -0
  131. package/dist/ketchup/p-e1d82570.entry.js +1 -0
  132. package/dist/ketchup/p-e21c744a.js +1 -0
  133. package/dist/ketchup/p-e5a9d60a.entry.js +1 -0
  134. package/dist/ketchup/p-f50cbed9.js +1 -0
  135. package/dist/ketchup/{p-42080355.entry.js → p-fa9f161a.entry.js} +1 -1
  136. package/dist/types/components/kup-box/kup-box-declarations.d.ts +1 -0
  137. package/dist/types/components/kup-button/kup-button-declarations.d.ts +1 -0
  138. package/dist/types/components/kup-button/kup-button.d.ts +5 -0
  139. package/dist/types/components/kup-dashboard/kup-dashboard.d.ts +6 -1
  140. package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +7 -3
  141. package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +26 -5
  142. package/dist/types/components/kup-form/kup-form-declarations.d.ts +1 -0
  143. package/dist/types/components/kup-form/kup-form.d.ts +5 -0
  144. package/dist/types/components/kup-text-field/kup-text-field-declarations.d.ts +1 -0
  145. package/dist/types/components/kup-text-field/kup-text-field.d.ts +5 -0
  146. package/dist/types/components.d.ts +69 -7
  147. package/dist/types/f-components/f-button/f-button-declarations.d.ts +1 -0
  148. package/dist/types/f-components/f-text-field/f-text-field-declarations.d.ts +1 -0
  149. package/dist/types/managers/kup-data/kup-data-cell-helper.d.ts +13 -6
  150. package/dist/types/managers/kup-data/kup-data.d.ts +3 -1
  151. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover-declarations.d.ts +9 -1
  152. package/dist/types/managers/kup-scroll-on-hover/kup-scroll-on-hover.d.ts +7 -5
  153. package/dist/types/utils/filters/filters-rows.d.ts +0 -2
  154. package/dist/types/utils/filters/filters-tree-items.d.ts +1 -1
  155. package/package.json +2 -2
  156. package/dist/cjs/cell-utils-fe64a28c.js +0 -168
  157. package/dist/cjs/utils-4b208b48.js +0 -447
  158. package/dist/esm/cell-utils-cb5d4149.js +0 -160
  159. package/dist/esm/utils-2c1f4122.js +0 -428
  160. package/dist/ketchup/p-06c6cc68.js +0 -1
  161. package/dist/ketchup/p-0dacd4bc.entry.js +0 -1
  162. package/dist/ketchup/p-1c44dc62.entry.js +0 -1
  163. package/dist/ketchup/p-4bc9f98b.entry.js +0 -1
  164. package/dist/ketchup/p-578583db.entry.js +0 -1
  165. package/dist/ketchup/p-5866d507.entry.js +0 -1
  166. package/dist/ketchup/p-61059e9d.entry.js +0 -9
  167. package/dist/ketchup/p-664be494.entry.js +0 -1
  168. package/dist/ketchup/p-67cd575d.entry.js +0 -1
  169. package/dist/ketchup/p-682a367a.js +0 -1
  170. package/dist/ketchup/p-6ccf7eb2.entry.js +0 -1
  171. package/dist/ketchup/p-7230ab97.entry.js +0 -1
  172. package/dist/ketchup/p-752b4cef.entry.js +0 -1
  173. package/dist/ketchup/p-7de3e7ac.entry.js +0 -1
  174. package/dist/ketchup/p-928c5c36.js +0 -1
  175. package/dist/ketchup/p-9b36497d.entry.js +0 -1
  176. package/dist/ketchup/p-b982d137.entry.js +0 -1
  177. package/dist/ketchup/p-c0219e5e.js +0 -1
  178. package/dist/ketchup/p-c55fd0a7.entry.js +0 -1
  179. package/dist/ketchup/p-d154b3a0.entry.js +0 -1
  180. package/dist/ketchup/p-d2affb6f.entry.js +0 -27
  181. package/dist/ketchup/p-d3b542b3.js +0 -2
  182. package/dist/ketchup/p-d6c12c6c.js +0 -1
  183. package/dist/ketchup/p-da0eab60.entry.js +0 -1
@@ -2,11 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-06b131ea.js');
6
- const kupManager = require('./kup-manager-02acbb37.js');
7
- const utils = require('./utils-4b208b48.js');
5
+ const index = require('./index-31125378.js');
6
+ const kupManager = require('./kup-manager-a8eecc60.js');
8
7
  const GenericVariables = require('./GenericVariables-a9ed17ee.js');
9
- const cellUtils = require('./cell-utils-fe64a28c.js');
10
8
 
11
9
  /*! *****************************************************************************
12
10
  Copyright (c) Microsoft Corporation.
@@ -93437,7 +93435,7 @@ const KupEchart = class {
93437
93435
  * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
93438
93436
  */
93439
93437
  async getProps(descriptions) {
93440
- return utils.getProps(this, KupEchartProps, descriptions);
93438
+ return kupManager.getProps(this, KupEchartProps, descriptions);
93441
93439
  }
93442
93440
  /**
93443
93441
  * This method is used to trigger a new render of the component.
@@ -93469,7 +93467,7 @@ const KupEchart = class {
93469
93467
  * @param {GenericObject} props - Object containing props that will be set to the component.
93470
93468
  */
93471
93469
  async setProps(props) {
93472
- utils.setProps(this, KupEchartProps, props);
93470
+ kupManager.setProps(this, KupEchartProps, props);
93473
93471
  }
93474
93472
  /*-------------------------------------------------*/
93475
93473
  /* L i f e c y c l e H o o k s */
@@ -93594,7 +93592,7 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
93594
93592
  const treatedCells = {};
93595
93593
  for (const key in cells) {
93596
93594
  const cell = cells[key];
93597
- const title = cellUtils.getColumnByName(dataset.columns, key).title;
93595
+ const title = kupManager.getColumnByName(dataset.columns, key).title;
93598
93596
  treatedCells[title] = cell;
93599
93597
  }
93600
93598
  if (treatedCells[0]) {
@@ -93606,7 +93604,7 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
93606
93604
  for (let i = 0; i < dataset.rows.length; i++) {
93607
93605
  const cells = dataset.rows[i].cells;
93608
93606
  const treatedCells = {};
93609
- const title = cellUtils.getColumnByName(dataset.columns, this.axis).title;
93607
+ const title = kupManager.getColumnByName(dataset.columns, this.axis).title;
93610
93608
  treatedCells[title] = cells[this.axis];
93611
93609
  x.push(treatedCells[title].value);
93612
93610
  }
@@ -93621,7 +93619,7 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
93621
93619
  if (this.series.includes(key)) {
93622
93620
  const cell = row.cells[key];
93623
93621
  const value = cell.value;
93624
- const column = cellUtils.getColumnByName(this.data.columns, key);
93622
+ const column = kupManager.getColumnByName(this.data.columns, key);
93625
93623
  if (column) {
93626
93624
  const title = column.title;
93627
93625
  if (!y[title]) {
@@ -93640,7 +93638,7 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
93640
93638
  if (key !== this.axis) {
93641
93639
  const cell = row.cells[key];
93642
93640
  const value = cell.value;
93643
- const column = cellUtils.getColumnByName(this.data.columns, key);
93641
+ const column = kupManager.getColumnByName(this.data.columns, key);
93644
93642
  if (column) {
93645
93643
  const title = column.title;
93646
93644
  if (!y[title]) {
@@ -93743,19 +93741,21 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
93743
93741
  }
93744
93742
  const y = {};
93745
93743
  let objKey;
93746
- for (const row of this.data.rows) {
93747
- objKey = row.cells[this.axis].value;
93748
- y[objKey] = [];
93749
- for (const key of Object.keys(row.cells)) {
93750
- const cell = row.cells[key];
93751
- const value = cell.value;
93752
- if (!this.axis.includes(key)) {
93753
- if (this.series &&
93754
- this.series.length > 0 &&
93755
- !this.series.includes(key)) {
93756
- continue;
93744
+ if (this.axis) {
93745
+ for (const row of this.data.rows) {
93746
+ objKey = row.cells[this.axis].value;
93747
+ y[objKey] = [];
93748
+ for (const key of Object.keys(row.cells)) {
93749
+ const cell = row.cells[key];
93750
+ const value = cell.value;
93751
+ if (!this.axis.includes(key)) {
93752
+ if (this.series &&
93753
+ this.series.length > 0 &&
93754
+ !this.series.includes(key)) {
93755
+ continue;
93756
+ }
93757
+ y[objKey].push(value);
93757
93758
  }
93758
- y[objKey].push(value);
93759
93759
  }
93760
93760
  }
93761
93761
  }
@@ -93819,6 +93819,12 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
93819
93819
  '</div>');
93820
93820
  }
93821
93821
  };
93822
+ let axisColumn = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.column.find(this.data, {
93823
+ name: this.axis,
93824
+ });
93825
+ let serieTitle = axisColumn && axisColumn.length > 0
93826
+ ? axisColumn[0].title
93827
+ : 'No title';
93822
93828
  const echartOption = Object.assign({ emphasis: {
93823
93829
  label: {
93824
93830
  show: true,
@@ -93851,9 +93857,7 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
93851
93857
  padding: 4,
93852
93858
  },
93853
93859
  map: this.rootElement.id ? this.rootElement.id : '',
93854
- name: __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.column.find(this.data, {
93855
- name: this.axis,
93856
- })[0].title,
93860
+ name: serieTitle,
93857
93861
  roam: true,
93858
93862
  select: {
93859
93863
  itemStyle: {
@@ -93925,29 +93929,33 @@ _KupEchart_chartContainer = new WeakMap(), _KupEchart_chartEl = new WeakMap(), _
93925
93929
  if (type == KupEchartTypes.GAUSSIAN) {
93926
93930
  if (!__classPrivateFieldGet(this, _KupEchart_kupManager, "f").objects.isNumber(column.obj)) {
93927
93931
  const newDataset = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.distinct(this.data, [column.name]);
93928
- values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(newDataset, [
93929
- column.name,
93930
- ]);
93932
+ values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getUnivocalValue(newDataset, column);
93931
93933
  __classPrivateFieldGet(this, _KupEchart_gaussianDatasets, "f")[column.name] = newDataset;
93932
93934
  }
93933
93935
  else {
93934
- values = y[key];
93936
+ values = [];
93937
+ for (let index = 0; index < y[key].length; index++) {
93938
+ const element = y[key][index];
93939
+ values.push({ value: element });
93940
+ }
93935
93941
  }
93936
93942
  }
93937
93943
  else {
93938
93944
  if (needSortDataset) {
93939
93945
  // if there is only one series other than the Gaussian then I apply the sorting algorithm that arranges the data in "mountain"
93940
93946
  __classPrivateFieldSet(this, _KupEchart_sortedDataset, __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.sort(this.data, 'normalDistribution', column.name), "f");
93941
- values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(__classPrivateFieldGet(this, _KupEchart_sortedDataset, "f"), [column.name]);
93947
+ values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(__classPrivateFieldGet(this, _KupEchart_sortedDataset, "f"), column);
93942
93948
  x = __classPrivateFieldGet(this, _KupEchart_instances, "m", _KupEchart_createX).call(this, __classPrivateFieldGet(this, _KupEchart_sortedDataset, "f"));
93943
93949
  }
93944
93950
  else {
93945
- values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(this.data, [
93946
- column.name,
93947
- ]);
93951
+ values = __classPrivateFieldGet(this, _KupEchart_kupManager, "f").data.cell.getValue(this.data, column);
93948
93952
  }
93949
93953
  }
93950
- __classPrivateFieldGet(this, _KupEchart_instances, "m", _KupEchart_addSeries).call(this, type, series, values, key, mixedSeries, needSortDataset);
93954
+ const justValues = new Array();
93955
+ for (let i = 0; i < values.length; i++) {
93956
+ justValues.push(values[i].value);
93957
+ }
93958
+ __classPrivateFieldGet(this, _KupEchart_instances, "m", _KupEchart_addSeries).call(this, type, series, justValues, key, mixedSeries, needSortDataset);
93951
93959
  i++;
93952
93960
  }
93953
93961
  // "any" because type is mismanaged inside echarts library
@@ -2,13 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-06b131ea.js');
6
- const fButton = require('./f-button-5b69d882.js');
5
+ const index = require('./index-31125378.js');
6
+ const fButton = require('./f-button-826a470e.js');
7
7
  const fButtonDeclarations = require('./f-button-declarations-b611587f.js');
8
- const kupManager = require('./kup-manager-02acbb37.js');
9
- const utils = require('./utils-4b208b48.js');
8
+ const fImage = require('./f-image-0f17d599.js');
9
+ const kupManager = require('./kup-manager-a8eecc60.js');
10
10
  const GenericVariables = require('./GenericVariables-a9ed17ee.js');
11
- require('./f-image-2a61ece2.js');
12
11
 
13
12
  /**
14
13
  * Props of the kup-family-tree component.
@@ -16,14 +15,16 @@ require('./f-image-2a61ece2.js');
16
15
  */
17
16
  var KupFamilyTreeProps;
18
17
  (function (KupFamilyTreeProps) {
19
- KupFamilyTreeProps["autofit"] = "The component's initial render will fit the container.";
18
+ KupFamilyTreeProps["autofitOnExpand"] = "The component will autofit everytime a node is expanded.";
19
+ KupFamilyTreeProps["autofitOnLoad"] = "The component's initial render will fit the container by invoking the runAutofit method.";
20
20
  KupFamilyTreeProps["collapsible"] = "Nodes can be expanded/collapsed.";
21
21
  KupFamilyTreeProps["customStyle"] = "Custom style of the component.";
22
22
  KupFamilyTreeProps["data"] = "Actual data of the component";
23
23
  KupFamilyTreeProps["layout"] = "Layout of the boxes.";
24
+ KupFamilyTreeProps["stackedLeaves"] = "Child nodes that have no children are arranged vertically.";
24
25
  })(KupFamilyTreeProps || (KupFamilyTreeProps = {}));
25
26
 
26
- const kupFamilyTreeCss = ":host{--kup_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-primary-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-on-primary-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 40px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 120px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc( ( var(--kup_familytree_item_width) + (var(--kup_familytree_item_h_padding) * 2) ) / 2 )) translateY(calc( 0px - ( var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) ) ))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:\"\";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc( var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * var(--kup_familytree_item_v_padding) )}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{width:fit-content;margin-left:auto;margin-right:auto}";
27
+ const kupFamilyTreeCss = ":host{--kup_familytree_item_background_color:var(\n --kup-familytree-item-background-color,\n var(--kup-background-color)\n );--kup_familytree_item_color:var(\n --kup-familytree-item-color,\n var(--kup-text-color)\n );--kup_familytree_item_height:var(--kup-familytree-item-height, 80px);--kup_familytree_item_h_padding:var(--kup-familytree-item-h-padding, 8px);--kup_familytree_item_v_padding:var(--kup-familytree-item-v-padding, 10px);--kup_familytree_item_width:var(--kup-familytree-item-width, 280px);--kup_familytree_lines_color:var(\n --kup-familytree-lines-color,\n var(--kup-border-color)\n );display:block;overflow:hidden}.family-tree{cursor:grab;display:flex;transform:scale(var(--kup_familytree_scale, 1));transform-origin:0px 0px}.family-tree--dragging{cursor:grabbing}.family-tree__node{border-collapse:collapse;margin:auto}.family-tree__node--stacked{margin-bottom:4px}.family-tree__node__staff{align-items:center;display:flex;flex-direction:column;height:0;transform:translateX(calc( ( var(--kup_familytree_item_width) + (var(--kup_familytree_item_h_padding) * 2) ) / 2 )) translateY(calc( 0px - ( var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * (var(--kup_familytree_item_v_padding) * 2) ) ))}.family-tree__node__staff__item{padding:var(--kup_familytree_item_v_padding);text-align:left}.family-tree__node__staff__item:before{border-top:2px solid var(--kup_familytree_lines_color);content:\"\";position:absolute;transform:translateX(calc(100% + 2px)) translateY(calc(var(--kup_familytree_item_height) / 2));width:var(--kup_familytree_item_h_padding)}.family-tree__node td{vertical-align:top;padding:0}.family-tree__line--left{border-left:2px solid var(--kup_familytree_lines_color)}.family-tree__line--placeholder{height:calc(var(--kup_familytree_item_height) / 2)}.family-tree__line--staff{height:calc( var(--kup_familytree_staffchildren) * var(--kup_familytree_item_height) + var(--kup_familytree_staffchildren) * (var(--kup_familytree_item_v_padding) * 2) )}.family-tree__line--right{border-right:2px solid var(--kup_familytree_lines_color)}.family-tree__line--top{border-top:2px solid var(--kup_familytree_lines_color)}.family-tree__line--vertical{background-color:var(--kup_familytree_lines_color);margin-left:auto;margin-right:auto;width:2px}.family-tree__item{display:flex}.family-tree__item__wrapper{margin:auto}.family-tree__item__wrapper kup-box{margin:0 auto;overflow:hidden;padding:0 18px;width:var(--kup_familytree_item_width);z-index:1}.family-tree__item__wrapper .f-button{--kup-button-primary-color:var(--kup-text-color);--kup-button-primary-color-rgb:var(--kup-text-color-rgb);--kup-button-primary-color-h:var(--kup-text-color-h);--kup-button-primary-color-s:var(--kup-text-color-s);--kup-button-primary-color-l:var(--kup-text-color-l);margin:0 auto;width:max-content}.family-tree__item__wrapper .f-button button{height:32px;width:32px}.family-tree__item__layout{background-color:var(--kup_familytree_item_background_color);border:1px solid var(--kup_familytree_lines_color);border-radius:8px;box-sizing:border-box;display:flex;height:var(--kup_familytree_item_height);margin:0 18px;width:var(--kup_familytree_item_width)}.family-tree__item__layout--1{justify-content:center;color:var(--kup_familytree_item_color)}.family-tree__item__layout--1>.family-tree__item__layout__text__title{margin-top:auto;margin-bottom:auto}.family-tree__item__layout--2{background-color:var(--kup_familytree_item_background_color);justify-content:flex-start}.family-tree__item__layout__color{background-color:var(--kup-secondary-color);border-bottom-left-radius:8px;border-top-left-radius:8px;height:100%;width:10px}.family-tree__item__layout__image{display:flex;margin:auto 10px}.family-tree__item__layout__image img{border-radius:50px;object-fit:cover}.family-tree__item__layout__text{display:flex;flex-direction:column;justify-content:center}.family-tree__item__layout__text__title{font-size:18px;margin-bottom:5px}.family-tree__item__layout__text__subtitle{font-size:14px}.family-tree__item__layout__text__title,.family-tree__item__layout__text__subtitle{max-width:calc(var(--kup_familytree_item_width) - 30%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";
27
28
 
28
29
  var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
29
30
  if (kind === "a" && !f)
@@ -41,7 +42,7 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
41
42
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
42
43
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
43
44
  };
44
- var _KupFamilyTree_instances, _KupFamilyTree_clickTimeout, _KupFamilyTree_hold, _KupFamilyTree_currentPanX, _KupFamilyTree_currentPanY, _KupFamilyTree_interactableTouch, _KupFamilyTree_kupManager, _KupFamilyTree_moveCb, _KupFamilyTree_wrapperEl, _KupFamilyTree_buildChildLine, _KupFamilyTree_buildNode, _KupFamilyTree_buildNodes, _KupFamilyTree_createTree, _KupFamilyTree_startPanning, _KupFamilyTree_getEventPath, _KupFamilyTree_getEventDetails, _KupFamilyTree_clickHandler, _KupFamilyTree_contextMenuHandler, _KupFamilyTree_dblClickHandler, _KupFamilyTree_didLoadInteractables, _KupFamilyTree_zoomTree, _KupFamilyTree_autofit;
45
+ var _KupFamilyTree_instances, _KupFamilyTree_clickTimeout, _KupFamilyTree_hold, _KupFamilyTree_currentPanX, _KupFamilyTree_currentPanY, _KupFamilyTree_interactableTouch, _KupFamilyTree_kupManager, _KupFamilyTree_moveCb, _KupFamilyTree_shouldAutofit, _KupFamilyTree_wrapperEl, _KupFamilyTree_buildChildLine, _KupFamilyTree_buildNode, _KupFamilyTree_buildNodeLayout, _KupFamilyTree_buildNodeLayout1, _KupFamilyTree_buildNodeLayout2, _KupFamilyTree_buildNodes, _KupFamilyTree_createTree, _KupFamilyTree_isBoxLayout, _KupFamilyTree_startPanning, _KupFamilyTree_getEventPath, _KupFamilyTree_getEventDetails, _KupFamilyTree_clickHandler, _KupFamilyTree_contextMenuHandler, _KupFamilyTree_dblClickHandler, _KupFamilyTree_didLoadInteractables, _KupFamilyTree_zoomTree;
45
46
  const KupFamilyTree = class {
46
47
  constructor(hostRef) {
47
48
  index.registerInstance(this, hostRef);
@@ -53,10 +54,15 @@ const KupFamilyTree = class {
53
54
  /* P r o p s */
54
55
  /*-------------------------------------------------*/
55
56
  /**
56
- * The component's initial render will fit the container.
57
+ * The component will autofit everytime a node is expanded.
57
58
  * @default true
58
59
  */
59
- this.autofit = true;
60
+ this.autofitOnExpand = true;
61
+ /**
62
+ * The component's initial render will fit the container by invoking the runAutofit method.
63
+ * @default true
64
+ */
65
+ this.autofitOnLoad = true;
60
66
  /**
61
67
  * Nodes can be expanded/collapsed.
62
68
  * @default true
@@ -78,6 +84,11 @@ const KupFamilyTree = class {
78
84
  * @default null
79
85
  */
80
86
  this.layout = null;
87
+ /**
88
+ * Child nodes that have no children are arranged vertically.
89
+ * @default false
90
+ */
91
+ this.stackedLeaves = false;
81
92
  /*-------------------------------------------------*/
82
93
  /* I n t e r n a l V a r i a b l e s */
83
94
  /*-------------------------------------------------*/
@@ -95,18 +106,33 @@ const KupFamilyTree = class {
95
106
  __classPrivateFieldSet(this, _KupFamilyTree_currentPanX, e.clientX, "f");
96
107
  __classPrivateFieldSet(this, _KupFamilyTree_currentPanY, e.clientY, "f");
97
108
  });
109
+ _KupFamilyTree_shouldAutofit.set(this, false);
98
110
  _KupFamilyTree_wrapperEl.set(this, null);
99
111
  }
100
112
  /*-------------------------------------------------*/
101
113
  /* P u b l i c M e t h o d s */
102
114
  /*-------------------------------------------------*/
115
+ /**
116
+ * Collapses all nodes.
117
+ */
118
+ async collapseAll(nodes = this.data.rows) {
119
+ __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").data.node.setProperties(nodes, { isExpanded: false }, true);
120
+ this.refresh();
121
+ }
122
+ /**
123
+ * Expands all nodes.
124
+ */
125
+ async expandAll(nodes = this.data.rows) {
126
+ __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").data.node.setProperties(nodes, { isExpanded: true }, true);
127
+ this.refresh();
128
+ }
103
129
  /**
104
130
  * Used to retrieve component's props values.
105
131
  * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
106
132
  * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
107
133
  */
108
134
  async getProps(descriptions) {
109
- return utils.getProps(this, KupFamilyTreeProps, descriptions);
135
+ return kupManager.getProps(this, KupFamilyTreeProps, descriptions);
110
136
  }
111
137
  /**
112
138
  * This method is used to trigger a new render of the component.
@@ -114,12 +140,41 @@ const KupFamilyTree = class {
114
140
  async refresh() {
115
141
  index.forceUpdate(this);
116
142
  }
143
+ /**
144
+ * This method causes the component to autofit its container's width.
145
+ */
146
+ async runAutofit() {
147
+ const parentWidth = __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").clientWidth;
148
+ const childWidth = __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").children[0].clientWidth;
149
+ const multiplierStep = 0.01;
150
+ const minWidth = (85 / 100) * parentWidth;
151
+ const maxWidth = (95 / 100) * parentWidth;
152
+ let multiplier = 1;
153
+ let tooManyAttempts = 2000;
154
+ let tempWidth = childWidth;
155
+ while ((tempWidth < minWidth || tempWidth > maxWidth) &&
156
+ tooManyAttempts > 0 &&
157
+ multiplier > multiplierStep) {
158
+ tooManyAttempts--;
159
+ if (tempWidth < minWidth) {
160
+ multiplier = multiplier + multiplierStep;
161
+ }
162
+ else if (tempWidth > maxWidth) {
163
+ multiplier = multiplier - multiplierStep;
164
+ }
165
+ else {
166
+ tooManyAttempts = 0;
167
+ }
168
+ tempWidth = childWidth * multiplier;
169
+ }
170
+ __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.setProperty('--kup_familytree_scale', multiplier <= 1 ? multiplier.toFixed(2) : '1');
171
+ }
117
172
  /**
118
173
  * Sets the props to the component.
119
174
  * @param {GenericObject} props - Object containing props that will be set to the component.
120
175
  */
121
176
  async setProps(props) {
122
- utils.setProps(this, KupFamilyTreeProps, props);
177
+ kupManager.setProps(this, KupFamilyTreeProps, props);
123
178
  }
124
179
  /*-------------------------------------------------*/
125
180
  /* L i f e c y c l e H o o k s */
@@ -131,12 +186,8 @@ const KupFamilyTree = class {
131
186
  }
132
187
  componentDidLoad() {
133
188
  __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_didLoadInteractables).call(this);
134
- if (this.autofit) {
135
- const parentWidth = __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").clientWidth;
136
- const childWidth = __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").children[0].clientWidth;
137
- if (childWidth > parentWidth) {
138
- __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_autofit).call(this, parentWidth, childWidth);
139
- }
189
+ if (this.autofitOnLoad) {
190
+ this.runAutofit();
140
191
  }
141
192
  __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").debug.logLoad(this, true);
142
193
  }
@@ -144,6 +195,10 @@ const KupFamilyTree = class {
144
195
  __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").debug.logRender(this, false);
145
196
  }
146
197
  componentDidRender() {
198
+ if (__classPrivateFieldGet(this, _KupFamilyTree_shouldAutofit, "f")) {
199
+ __classPrivateFieldSet(this, _KupFamilyTree_shouldAutofit, false, "f");
200
+ this.runAutofit();
201
+ }
147
202
  __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").debug.logRender(this, true);
148
203
  }
149
204
  render() {
@@ -151,7 +206,6 @@ const KupFamilyTree = class {
151
206
  e.preventDefault();
152
207
  __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_startPanning).call(this, e);
153
208
  }, onWheel: (e) => {
154
- e.preventDefault();
155
209
  __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_zoomTree).call(this, e);
156
210
  } }, index.h("style", null, __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").theme.setKupStyle(this.rootElement)), index.h("div", { id: GenericVariables.componentWrapperId }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_createTree).call(this))));
157
211
  }
@@ -161,7 +215,7 @@ const KupFamilyTree = class {
161
215
  }
162
216
  get rootElement() { return index.getElement(this); }
163
217
  };
164
- _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap(), _KupFamilyTree_currentPanX = new WeakMap(), _KupFamilyTree_currentPanY = new WeakMap(), _KupFamilyTree_interactableTouch = new WeakMap(), _KupFamilyTree_kupManager = new WeakMap(), _KupFamilyTree_moveCb = new WeakMap(), _KupFamilyTree_wrapperEl = new WeakMap(), _KupFamilyTree_instances = new WeakSet(), _KupFamilyTree_buildChildLine = function _KupFamilyTree_buildChildLine(first, last, alone, moreTwo) {
218
+ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap(), _KupFamilyTree_currentPanX = new WeakMap(), _KupFamilyTree_currentPanY = new WeakMap(), _KupFamilyTree_interactableTouch = new WeakMap(), _KupFamilyTree_kupManager = new WeakMap(), _KupFamilyTree_moveCb = new WeakMap(), _KupFamilyTree_shouldAutofit = new WeakMap(), _KupFamilyTree_wrapperEl = new WeakMap(), _KupFamilyTree_instances = new WeakSet(), _KupFamilyTree_buildChildLine = function _KupFamilyTree_buildChildLine(first, last, alone, moreTwo) {
165
219
  const content = [];
166
220
  content.push(index.h("td", { class: {
167
221
  'family-tree__line': true,
@@ -194,6 +248,9 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
194
248
  }
195
249
  });
196
250
  }
251
+ const stacked = this.stackedLeaves &&
252
+ children &&
253
+ children.every((c) => !c.children || c.children.length == 0);
197
254
  const span1 = children ? children.length * 2 : 1;
198
255
  const styleVLine = {
199
256
  'family-tree__line': true,
@@ -207,24 +264,43 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
207
264
  ],
208
265
  rows: [{ cells: Object.assign({ '*TREECOL': node }, node.cells) }],
209
266
  };
210
- const layout = node.layout || this.layout || null;
211
- const expandButtonProp = {
267
+ const layout = node.layout || this.layout || 1;
268
+ const expandButtonProps = {
212
269
  icon: node.isExpanded ? 'remove' : 'plus',
213
- styling: fButtonDeclarations.FButtonStyling.OUTLINED,
270
+ shaped: true,
214
271
  slim: true,
215
- onClick: () => {
272
+ styling: fButtonDeclarations.FButtonStyling.OUTLINED,
273
+ title: `${__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").language.translate(kupManager.KupLanguageGeneric.EXPAND)}/${__classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").language.translate(kupManager.KupLanguageGeneric.COLLAPSE)} (CTRL + Click)`,
274
+ onClick: (e) => {
275
+ if (e.ctrlKey && node.children && node.children.length > 0) {
276
+ if (node.isExpanded) {
277
+ this.collapseAll(node.children);
278
+ }
279
+ else {
280
+ this.expandAll(node.children);
281
+ }
282
+ }
216
283
  node.isExpanded = !node.isExpanded;
284
+ if (this.autofitOnExpand) {
285
+ __classPrivateFieldSet(this, _KupFamilyTree_shouldAutofit, true, "f");
286
+ }
217
287
  this.refresh();
218
288
  },
289
+ wrapperClass: 'family-tree__item__expand',
219
290
  };
220
- const box = (index.h("div", { class: 'family-tree__item' }, index.h("div", { class: 'family-tree__item__wrapper' }, index.h("kup-box", { class: "kup-borderless kup-paddingless", customStyle: "#kup-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }", data: data, layout: layout }), this.collapsible &&
291
+ const box = (index.h("div", { class: 'family-tree__item' }, index.h("div", { class: 'family-tree__item__wrapper' }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_isBoxLayout).call(this, layout) ? (index.h("kup-box", { class: "kup-borderless kup-paddingless", customStyle: "#kup-component { background: var(--kup_familytree_item_background_color); border: 2px solid var(--kup_familytree_lines_color); box-sizing: border-box; height: var(--kup_familytree_item_height); padding: 0 var(--kup_familytree_item_h_padding); } #kup-component .box-component { background: var(--kup_familytree_item_background_color); box-sizing: border-box; height: 100%;} #kup-component .f-cell__text { color: var(--kup_familytree_item_color); }", data: data, layout: layout, showSelection: false })) : (__classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNodeLayout).call(this, node, layout)), this.collapsible &&
221
292
  node.children &&
222
- node.children.length > 0 ? (index.h(fButton.FButton, Object.assign({}, expandButtonProp))) : undefined)));
293
+ node.children.length > 0 ? (index.h(fButton.FButton, Object.assign({}, expandButtonProps))) : undefined)));
223
294
  const staffStyle = {
224
295
  ['--kup_familytree_staffchildren']: (staffChildren === null || staffChildren === void 0 ? void 0 : staffChildren.length.toString()) || '0',
225
296
  };
226
297
  //TODO: set data-cell and data-column if needed inside events
227
- return (index.h("table", { class: 'family-tree__node' }, index.h("tr", null, index.h("td", { "data-row": node, colSpan: span1 }, box)), index.h("tr", null, index.h("td", { colSpan: span1 }, index.h("div", { class: styleVLine }))), staffChildren
298
+ return (index.h("table", { class: {
299
+ 'family-tree__node': true,
300
+ 'family-tree__node--stacked': this.stackedLeaves &&
301
+ !node.isStaff &&
302
+ (!node.children || node.children.length == 0),
303
+ } }, index.h("tr", null, index.h("td", { "data-row": node, colSpan: span1 }, box)), index.h("tr", null, index.h("td", { colSpan: span1 }, index.h("div", { class: styleVLine }))), staffChildren
228
304
  ? [
229
305
  index.h("tr", null, index.h("td", { colSpan: span1 }, index.h("div", { class: Object.assign(Object.assign({}, styleVLine), { 'family-tree__line--staff': true }), style: staffStyle }), index.h("div", { class: "family-tree__node__staff", style: staffStyle }, staffChildren.map((inode) => [
230
306
  index.h("div", { class: "family-tree__node__staff__item" }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, inode)),
@@ -233,15 +309,25 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
233
309
  : null, staffChildren && children
234
310
  ? [
235
311
  index.h("tr", null, index.h("td", { colSpan: span1 }, index.h("div", { class: styleVLine }))),
236
- index.h("tr", null, index.h("td", { colSpan: span1 }, index.h("div", { class: styleVLine }))),
237
312
  ]
238
313
  : null, children
239
314
  ? [
240
- index.h("tr", null, children.map((inode) => __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildChildLine).call(this, children.indexOf(inode) == 0, children.indexOf(inode) ==
241
- children.length - 1, children.length == 1, children.length > 2))),
242
- index.h("tr", null, children.map((inode) => (index.h("td", { colSpan: 2 }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, inode))))),
315
+ index.h("tr", null, stacked ? (index.h("td", { colSpan: span1 }, index.h("div", { class: styleVLine }))) : (children.map((inode) => __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildChildLine).call(this, children.indexOf(inode) == 0, children.indexOf(inode) ==
316
+ children.length - 1, children.length == 1, children.length > 2)))),
317
+ index.h("tr", null, stacked ? (index.h("td", { colSpan: span1 }, children.map((inode) => __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, inode)))) : (children.map((inode) => (index.h("td", { colSpan: 2 }, __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, inode)))))),
243
318
  ]
244
319
  : undefined));
320
+ }, _KupFamilyTree_buildNodeLayout = function _KupFamilyTree_buildNodeLayout(node, layout) {
321
+ switch (layout) {
322
+ case 2:
323
+ return __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNodeLayout2).call(this, node);
324
+ default:
325
+ return __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNodeLayout1).call(this, node);
326
+ }
327
+ }, _KupFamilyTree_buildNodeLayout1 = function _KupFamilyTree_buildNodeLayout1(node) {
328
+ return (index.h("div", { class: `family-tree__item__layout family-tree__item__layout--1` }, index.h("div", { class: 'family-tree__item__layout__text__title' }, node.value)));
329
+ }, _KupFamilyTree_buildNodeLayout2 = function _KupFamilyTree_buildNodeLayout2(node) {
330
+ return (index.h("div", { class: `family-tree__item__layout family-tree__item__layout--2` }, index.h("div", { class: 'family-tree__item__layout__color' }), index.h("div", { class: 'family-tree__item__layout__image' }, index.h(fImage.FImage, { resource: node.icon, sizeX: "48px", sizeY: "48px" })), index.h("div", { class: 'family-tree__item__layout__text' }, index.h("div", { class: 'family-tree__item__layout__text__title' }, node.value), node.title ? (index.h("div", { class: 'family-tree__item__layout__text__subtitle' }, node.title)) : null)));
245
331
  }, _KupFamilyTree_buildNodes = function _KupFamilyTree_buildNodes(nodes) {
246
332
  return nodes.map((node) => __classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNode).call(this, node));
247
333
  }, _KupFamilyTree_createTree = function _KupFamilyTree_createTree() {
@@ -249,12 +335,17 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
249
335
  return (index.h("div", { class: "family-tree", onContextMenu: (e) => {
250
336
  e.preventDefault();
251
337
  }, ref: (el) => (__classPrivateFieldSet(this, _KupFamilyTree_wrapperEl, el, "f")) }, emptyData ? (index.h("div", null, __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").language.translate(kupManager.KupLanguageGeneric.EMPTY_DATA))) : (__classPrivateFieldGet(this, _KupFamilyTree_instances, "m", _KupFamilyTree_buildNodes).call(this, this.data.rows))));
338
+ }, _KupFamilyTree_isBoxLayout = function _KupFamilyTree_isBoxLayout(layout) {
339
+ const tmp = layout;
340
+ return tmp && tmp.sections && tmp.sections.length > 0;
252
341
  }, _KupFamilyTree_startPanning = function _KupFamilyTree_startPanning(e) {
253
342
  __classPrivateFieldSet(this, _KupFamilyTree_currentPanX, e.clientX, "f");
254
343
  __classPrivateFieldSet(this, _KupFamilyTree_currentPanY, e.clientY, "f");
344
+ __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").classList.add('family-tree--dragging');
255
345
  const endPanning = () => {
256
346
  document.removeEventListener('pointermove', __classPrivateFieldGet(this, _KupFamilyTree_moveCb, "f"));
257
347
  document.removeEventListener('pointerup', endPanning);
348
+ __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").classList.remove('family-tree--dragging');
258
349
  };
259
350
  document.addEventListener('pointermove', __classPrivateFieldGet(this, _KupFamilyTree_moveCb, "f"));
260
351
  document.addEventListener('pointerup', endPanning);
@@ -270,16 +361,20 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
270
361
  }
271
362
  return path;
272
363
  }, _KupFamilyTree_getEventDetails = function _KupFamilyTree_getEventDetails(path, e) {
364
+ let expandButton;
273
365
  let td;
274
366
  if (path) {
275
367
  for (let i = path.length - 1; i >= 0; i--) {
276
- let p = path[i];
277
- if (!p.tagName) {
368
+ const el = path[i];
369
+ if (!el.tagName) {
278
370
  continue;
279
371
  }
280
- switch (p.tagName.toUpperCase()) {
372
+ if (el.classList.contains('family-tree__item__expand')) {
373
+ expandButton = el;
374
+ }
375
+ switch (el.tagName.toUpperCase()) {
281
376
  case 'TD': {
282
- td = p;
377
+ td = el;
283
378
  break;
284
379
  }
285
380
  }
@@ -294,6 +389,7 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
294
389
  return {
295
390
  cell: cell ? cell : null,
296
391
  column: column ? column : null,
392
+ expandButton: expandButton ? expandButton : null,
297
393
  originalEvent: e,
298
394
  row: row ? row : null,
299
395
  td: td ? td : null,
@@ -373,37 +469,17 @@ _KupFamilyTree_clickTimeout = new WeakMap(), _KupFamilyTree_hold = new WeakMap()
373
469
  __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").interact.on(this.rootElement, kupManager.KupPointerEventTypes.TAP, tapCb);
374
470
  __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").interact.on(this.rootElement, kupManager.KupPointerEventTypes.DOUBLETAP, doubletapCb);
375
471
  __classPrivateFieldGet(this, _KupFamilyTree_kupManager, "f").interact.on(this.rootElement, kupManager.KupPointerEventTypes.HOLD, holdCb);
376
- }, _KupFamilyTree_zoomTree = function _KupFamilyTree_zoomTree(event) {
377
- const current = parseFloat(__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.getPropertyValue('--kup_familytree_scale')) || 1;
378
- const delta = 0.05;
379
- let value = event.deltaY > 0 ? current - delta : current + delta;
380
- if (value < delta) {
381
- value = delta;
382
- }
383
- __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.setProperty('--kup_familytree_scale', value.toFixed(2));
384
- }, _KupFamilyTree_autofit = function _KupFamilyTree_autofit(parentWidth, childWidth) {
385
- const multiplierStep = 0.01;
386
- const minWidth = (85 / 100) * parentWidth;
387
- const maxWidth = (95 / 100) * parentWidth;
388
- let multiplier = 1;
389
- let tooManyAttempts = 2000;
390
- let tempWidth = childWidth;
391
- while ((tempWidth < minWidth || tempWidth > maxWidth) &&
392
- tooManyAttempts > 0 &&
393
- multiplier > multiplierStep) {
394
- tooManyAttempts--;
395
- if (tempWidth < minWidth) {
396
- multiplier = multiplier + multiplierStep;
397
- }
398
- else if (tempWidth > maxWidth) {
399
- multiplier = multiplier - multiplierStep;
400
- }
401
- else {
402
- tooManyAttempts = 0;
472
+ }, _KupFamilyTree_zoomTree = function _KupFamilyTree_zoomTree(e) {
473
+ if (e.ctrlKey) {
474
+ e.preventDefault();
475
+ const currentScale = parseFloat(__classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.getPropertyValue('--kup_familytree_scale')) || 1;
476
+ const delta = 0.05;
477
+ let value = e.deltaY > 0 ? currentScale - delta : currentScale + delta;
478
+ if (value < delta) {
479
+ value = delta;
403
480
  }
404
- tempWidth = childWidth * multiplier;
481
+ __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.setProperty('--kup_familytree_scale', value.toFixed(2));
405
482
  }
406
- __classPrivateFieldGet(this, _KupFamilyTree_wrapperEl, "f").style.setProperty('--kup_familytree_scale', multiplier.toFixed(2));
407
483
  };
408
484
  KupFamilyTree.style = kupFamilyTreeCss;
409
485