@sme.up/ketchup 6.8.0 → 7.0.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 (213) hide show
  1. package/dist/cjs/{f-button-229c63fd.js → f-button-293afb08.js} +1 -1
  2. package/dist/cjs/{f-cell-dd006395.js → f-cell-06b323ca.js} +11 -8
  3. package/dist/cjs/{f-chip-f2c369fd.js → f-chip-1c944c07.js} +2 -2
  4. package/dist/cjs/{f-image-847a6ddf.js → f-image-bfb4e4c9.js} +1 -1
  5. package/dist/cjs/{f-paginator-utils-cedc4b3e.js → f-paginator-utils-c9560cfd.js} +2 -2
  6. package/dist/cjs/{f-text-field-fe85187d.js → f-text-field-e99c5a26.js} +1 -1
  7. package/dist/cjs/ketchup.cjs.js +1 -1
  8. package/dist/cjs/kup-accordion.cjs.entry.js +2 -2
  9. package/dist/cjs/kup-autocomplete_26.cjs.entry.js +166 -23
  10. package/dist/cjs/kup-box.cjs.entry.js +7 -7
  11. package/dist/cjs/kup-calendar.cjs.entry.js +4 -4
  12. package/dist/cjs/kup-cell.cjs.entry.js +5 -5
  13. package/dist/cjs/kup-dash-list.cjs.entry.js +1 -1
  14. package/dist/cjs/kup-dash_2.cjs.entry.js +1 -1
  15. package/dist/cjs/kup-dashboard.cjs.entry.js +4 -4
  16. package/dist/cjs/kup-drawer.cjs.entry.js +1 -1
  17. package/dist/cjs/kup-echart.cjs.entry.js +1 -1
  18. package/dist/cjs/kup-family-tree.cjs.entry.js +3 -3
  19. package/dist/cjs/kup-iframe.cjs.entry.js +1 -1
  20. package/dist/cjs/kup-image-list.cjs.entry.js +6 -6
  21. package/dist/cjs/kup-lazy.cjs.entry.js +1 -1
  22. package/dist/cjs/kup-magic-box.cjs.entry.js +2 -2
  23. package/dist/cjs/{kup-manager-c53468cd.js → kup-manager-1e882e61.js} +7 -2
  24. package/dist/cjs/kup-nav-bar.cjs.entry.js +1 -1
  25. package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
  26. package/dist/cjs/kup-photo-frame.cjs.entry.js +1 -1
  27. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  28. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  29. package/dist/cjs/kup-snackbar.cjs.entry.js +3 -3
  30. package/dist/cjs/loader.cjs.js +1 -1
  31. package/dist/collection/assets/card.js +9 -2
  32. package/dist/collection/assets/data-table.js +4 -1
  33. package/dist/collection/components/kup-card/box/kup-card-box.js +114 -5
  34. package/dist/collection/components/kup-card/kup-card.css +171 -21
  35. package/dist/collection/components/kup-chip/kup-chip.js +2 -2
  36. package/dist/collection/components/kup-data-table/kup-data-table.js +10 -3
  37. package/dist/collection/components/kup-form/kup-form-declarations.js +3 -0
  38. package/dist/collection/components/kup-form/kup-form.js +56 -3
  39. package/dist/collection/f-components/f-cell/f-cell-declarations.js +2 -0
  40. package/dist/collection/f-components/f-cell/f-cell.js +7 -4
  41. package/dist/collection/managers/kup-data/kup-data-column-helper.js +4 -1
  42. package/dist/collection/utils/kup-column-menu/kup-column-menu.js +1 -1
  43. package/dist/components/index.d.ts +68 -0
  44. package/dist/components/index.js +48 -0
  45. package/dist/components/kup-accordion.d.ts +11 -0
  46. package/dist/components/kup-accordion.js +363 -0
  47. package/dist/components/kup-autocomplete.d.ts +11 -0
  48. package/dist/components/kup-autocomplete.js +6 -0
  49. package/dist/components/kup-autocomplete2.js +46145 -0
  50. package/dist/components/kup-badge.d.ts +11 -0
  51. package/dist/components/kup-badge.js +6 -0
  52. package/dist/components/kup-box.d.ts +11 -0
  53. package/dist/components/kup-box.js +6 -0
  54. package/dist/components/kup-box2.js +1412 -0
  55. package/dist/components/kup-button-list.d.ts +11 -0
  56. package/dist/components/kup-button-list.js +6 -0
  57. package/dist/components/kup-button.d.ts +11 -0
  58. package/dist/components/kup-button.js +6 -0
  59. package/dist/components/kup-calendar.d.ts +11 -0
  60. package/dist/components/kup-calendar.js +14818 -0
  61. package/dist/components/kup-card.d.ts +11 -0
  62. package/dist/components/kup-card.js +6 -0
  63. package/dist/components/kup-cell.d.ts +11 -0
  64. package/dist/components/kup-cell.js +332 -0
  65. package/dist/components/kup-chart.d.ts +11 -0
  66. package/dist/components/kup-chart.js +6 -0
  67. package/dist/components/kup-checkbox.d.ts +11 -0
  68. package/dist/components/kup-checkbox.js +6 -0
  69. package/dist/components/kup-chip.d.ts +11 -0
  70. package/dist/components/kup-chip.js +6 -0
  71. package/dist/components/kup-color-picker.d.ts +11 -0
  72. package/dist/components/kup-color-picker.js +6 -0
  73. package/dist/components/kup-combobox.d.ts +11 -0
  74. package/dist/components/kup-combobox.js +6 -0
  75. package/dist/components/kup-dash-list.d.ts +11 -0
  76. package/dist/components/kup-dash-list.js +275 -0
  77. package/dist/components/kup-dash.d.ts +11 -0
  78. package/dist/components/kup-dash.js +6 -0
  79. package/dist/components/kup-dash2.js +223 -0
  80. package/dist/components/kup-dashboard.d.ts +11 -0
  81. package/dist/components/kup-dashboard.js +559 -0
  82. package/dist/components/kup-data-table.d.ts +11 -0
  83. package/dist/components/kup-data-table.js +6 -0
  84. package/dist/components/kup-date-picker.d.ts +11 -0
  85. package/dist/components/kup-date-picker.js +6 -0
  86. package/dist/components/kup-drawer.d.ts +11 -0
  87. package/dist/components/kup-drawer.js +303 -0
  88. package/dist/components/kup-dropdown-button.d.ts +11 -0
  89. package/dist/components/kup-dropdown-button.js +6 -0
  90. package/dist/components/kup-echart.d.ts +11 -0
  91. package/dist/components/kup-echart.js +6 -0
  92. package/dist/components/kup-echart2.js +94317 -0
  93. package/dist/components/kup-family-tree.d.ts +11 -0
  94. package/dist/components/kup-family-tree.js +623 -0
  95. package/dist/components/kup-form.d.ts +11 -0
  96. package/dist/components/kup-form.js +6 -0
  97. package/dist/components/kup-gauge.d.ts +11 -0
  98. package/dist/components/kup-gauge.js +6 -0
  99. package/dist/components/kup-grid.d.ts +11 -0
  100. package/dist/components/kup-grid.js +6 -0
  101. package/dist/components/kup-grid2.js +256 -0
  102. package/dist/components/kup-iframe.d.ts +11 -0
  103. package/dist/components/kup-iframe.js +257 -0
  104. package/dist/components/kup-image-list.d.ts +11 -0
  105. package/dist/components/kup-image-list.js +416 -0
  106. package/dist/components/kup-image.d.ts +11 -0
  107. package/dist/components/kup-image.js +6 -0
  108. package/dist/components/kup-lazy.d.ts +11 -0
  109. package/dist/components/kup-lazy.js +352 -0
  110. package/dist/components/kup-list.d.ts +11 -0
  111. package/dist/components/kup-list.js +6 -0
  112. package/dist/components/kup-magic-box.d.ts +11 -0
  113. package/dist/components/kup-magic-box.js +470 -0
  114. package/dist/components/kup-nav-bar.d.ts +11 -0
  115. package/dist/components/kup-nav-bar.js +292 -0
  116. package/dist/components/kup-numeric-picker.d.ts +11 -0
  117. package/dist/components/kup-numeric-picker.js +536 -0
  118. package/dist/components/kup-photo-frame.d.ts +11 -0
  119. package/dist/components/kup-photo-frame.js +308 -0
  120. package/dist/components/kup-probe.d.ts +11 -0
  121. package/dist/components/kup-probe.js +403 -0
  122. package/dist/components/kup-progress-bar.d.ts +11 -0
  123. package/dist/components/kup-progress-bar.js +6 -0
  124. package/dist/components/kup-qlik.d.ts +11 -0
  125. package/dist/components/kup-qlik.js +302 -0
  126. package/dist/components/kup-radio.d.ts +11 -0
  127. package/dist/components/kup-radio.js +6 -0
  128. package/dist/components/kup-rating.d.ts +11 -0
  129. package/dist/components/kup-rating.js +6 -0
  130. package/dist/components/kup-snackbar.d.ts +11 -0
  131. package/dist/components/kup-snackbar.js +272 -0
  132. package/dist/components/kup-spinner.d.ts +11 -0
  133. package/dist/components/kup-spinner.js +6 -0
  134. package/dist/components/kup-switch.d.ts +11 -0
  135. package/dist/components/kup-switch.js +6 -0
  136. package/dist/components/kup-tab-bar.d.ts +11 -0
  137. package/dist/components/kup-tab-bar.js +6 -0
  138. package/dist/components/kup-text-field.d.ts +11 -0
  139. package/dist/components/kup-text-field.js +6 -0
  140. package/dist/components/kup-time-picker.d.ts +11 -0
  141. package/dist/components/kup-time-picker.js +6 -0
  142. package/dist/components/kup-tree.d.ts +11 -0
  143. package/dist/components/kup-tree.js +6 -0
  144. package/dist/esm/{f-button-d1aba968.js → f-button-4aad092d.js} +1 -1
  145. package/dist/esm/{f-cell-646406bb.js → f-cell-43ca8ab5.js} +11 -8
  146. package/dist/esm/{f-chip-d94e9e81.js → f-chip-94851217.js} +2 -2
  147. package/dist/esm/{f-image-57c88302.js → f-image-48a4b032.js} +1 -1
  148. package/dist/esm/{f-paginator-utils-2c865e9a.js → f-paginator-utils-fe00f75c.js} +2 -2
  149. package/dist/esm/{f-text-field-b0a1fea6.js → f-text-field-b6f9ce84.js} +1 -1
  150. package/dist/esm/ketchup.js +1 -1
  151. package/dist/esm/kup-accordion.entry.js +2 -2
  152. package/dist/esm/kup-autocomplete_26.entry.js +166 -23
  153. package/dist/esm/kup-box.entry.js +7 -7
  154. package/dist/esm/kup-calendar.entry.js +4 -4
  155. package/dist/esm/kup-cell.entry.js +5 -5
  156. package/dist/esm/kup-dash-list.entry.js +1 -1
  157. package/dist/esm/kup-dash_2.entry.js +1 -1
  158. package/dist/esm/kup-dashboard.entry.js +4 -4
  159. package/dist/esm/kup-drawer.entry.js +1 -1
  160. package/dist/esm/kup-echart.entry.js +1 -1
  161. package/dist/esm/kup-family-tree.entry.js +3 -3
  162. package/dist/esm/kup-iframe.entry.js +1 -1
  163. package/dist/esm/kup-image-list.entry.js +6 -6
  164. package/dist/esm/kup-lazy.entry.js +1 -1
  165. package/dist/esm/kup-magic-box.entry.js +2 -2
  166. package/dist/esm/{kup-manager-c0fbb180.js → kup-manager-07c9ba13.js} +7 -2
  167. package/dist/esm/kup-nav-bar.entry.js +1 -1
  168. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  169. package/dist/esm/kup-photo-frame.entry.js +1 -1
  170. package/dist/esm/kup-probe.entry.js +1 -1
  171. package/dist/esm/kup-qlik.entry.js +1 -1
  172. package/dist/esm/kup-snackbar.entry.js +3 -3
  173. package/dist/esm/loader.js +1 -1
  174. package/dist/ketchup/ketchup.esm.js +1 -1
  175. package/dist/ketchup/{p-a1fe329f.entry.js → p-02be3dd2.entry.js} +1 -1
  176. package/dist/ketchup/{p-35e16ea2.entry.js → p-10281712.entry.js} +1 -1
  177. package/dist/ketchup/{p-b1da1ba7.entry.js → p-122f51a0.entry.js} +1 -1
  178. package/dist/ketchup/{p-e6f19333.entry.js → p-14aec9c8.entry.js} +1 -1
  179. package/dist/ketchup/{p-a992cf87.js → p-200c76a8.js} +1 -1
  180. package/dist/ketchup/{p-738685f9.entry.js → p-23f50851.entry.js} +1 -1
  181. package/dist/ketchup/{p-30766296.entry.js → p-2935f22d.entry.js} +1 -1
  182. package/dist/ketchup/{p-7c8c5444.entry.js → p-33429412.entry.js} +1 -1
  183. package/dist/ketchup/{p-596bdc10.entry.js → p-3a55568c.entry.js} +1 -1
  184. package/dist/ketchup/{p-cee3635a.entry.js → p-4c92f0a4.entry.js} +1 -1
  185. package/dist/ketchup/{p-a740352c.js → p-5781af8a.js} +1 -1
  186. package/dist/ketchup/{p-1914969e.entry.js → p-5f7da18e.entry.js} +1 -1
  187. package/dist/ketchup/{p-9214ef33.entry.js → p-69a9af60.entry.js} +1 -1
  188. package/dist/ketchup/{p-f43b445e.entry.js → p-7134b172.entry.js} +1 -1
  189. package/dist/ketchup/{p-980ed953.entry.js → p-772f4bb7.entry.js} +1 -1
  190. package/dist/ketchup/{p-72d4fa26.entry.js → p-79936744.entry.js} +1 -1
  191. package/dist/ketchup/{p-395675b8.js → p-86e4bfad.js} +1 -1
  192. package/dist/ketchup/p-8f8b5a08.entry.js +9 -0
  193. package/dist/ketchup/{p-250118e3.entry.js → p-94e3b109.entry.js} +1 -1
  194. package/dist/ketchup/{p-86154e2b.js → p-984a05ff.js} +1 -1
  195. package/dist/ketchup/{p-eb10958a.entry.js → p-9f759d8d.entry.js} +1 -1
  196. package/dist/ketchup/{p-351cecba.entry.js → p-ab6c66f7.entry.js} +1 -1
  197. package/dist/ketchup/{p-fa37e92e.entry.js → p-be7748e6.entry.js} +1 -1
  198. package/dist/ketchup/{p-61ff1761.js → p-c1a5ed6b.js} +1 -1
  199. package/dist/ketchup/p-e3b85cae.js +1 -0
  200. package/dist/ketchup/p-e8666a6d.js +1 -0
  201. package/dist/ketchup/{p-d422151a.entry.js → p-eab86c09.entry.js} +1 -1
  202. package/dist/ketchup/{p-991bd70d.entry.js → p-ec2d1c8c.entry.js} +1 -1
  203. package/dist/types/adoptedStyleSheet-shim.d.ts +3 -3
  204. package/dist/types/components/kup-box/kup-box-declarations.d.ts +9 -9
  205. package/dist/types/components/kup-card/box/kup-card-box.d.ts +24 -0
  206. package/dist/types/components/kup-form/kup-form-declarations.d.ts +4 -1
  207. package/dist/types/components/kup-form/kup-form.d.ts +11 -1
  208. package/dist/types/components.d.ts +21 -1
  209. package/dist/types/f-components/f-cell/f-cell-declarations.d.ts +2 -1
  210. package/package.json +1 -1
  211. package/dist/ketchup/p-3cf97e3a.js +0 -1
  212. package/dist/ketchup/p-d05ed931.entry.js +0 -9
  213. package/dist/ketchup/p-ecac6269.js +0 -1
@@ -0,0 +1,1412 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
2
+ import { k as kupManagerInstance, az as identify, g as getProps, s as setProps, aA as filterRows, aB as paginateRows, aC as sortRows, S as getColumnByName, R as KupLanguageGeneric, F as FImage, a as KupThemeIconValues, Z as FCell, a9 as KupDebugCategory, U as FChip, ae as KupPointerEventTypes, Y as KupDragEffect, aD as kupDraggableCellAttr, an as KupDropEventTypes, aa as FTextFieldMDC, aE as KupLanguageSearch, aF as FPaginator, aG as FPaginatorMode, c as componentWrapperId, d as defineCustomElement$1, b as defineCustomElement$2, e as defineCustomElement$3, f as defineCustomElement$4, h as defineCustomElement$5, i as defineCustomElement$6, j as defineCustomElement$7, l as defineCustomElement$8, m as defineCustomElement$9, n as defineCustomElement$a, o as defineCustomElement$b, p as defineCustomElement$c, q as defineCustomElement$d, r as defineCustomElement$e, t as defineCustomElement$f, u as defineCustomElement$g, v as defineCustomElement$h, w as defineCustomElement$i, x as defineCustomElement$j, y as defineCustomElement$k, z as defineCustomElement$l, A as defineCustomElement$m, B as defineCustomElement$n, C as defineCustomElement$o, D as defineCustomElement$p, E as defineCustomElement$q, aH as pageChange, aI as rowsPerPageChange, aJ as SortMode } from './kup-autocomplete2.js';
3
+
4
+ /**
5
+ * Props of the kup-box component.
6
+ * Used to export every prop in an object.
7
+ */
8
+ var KupBoxProps;
9
+ (function (KupBoxProps) {
10
+ KupBoxProps["cardData"] = "Data of the card linked to the box when the latter's layout must be a premade template.";
11
+ KupBoxProps["columns"] = "Number of columns.";
12
+ KupBoxProps["customStyle"] = "Custom style of the component.";
13
+ KupBoxProps["data"] = "Actual data of the box.";
14
+ KupBoxProps["dragEnabled"] = "Enable dragging.";
15
+ KupBoxProps["dropEnabled"] = "Enable dropping.";
16
+ KupBoxProps["dropOnSection"] = "Drop can be done in section.";
17
+ KupBoxProps["enableRowActions"] = "If enabled, a button to load / display the row actions will be displayed on the right of every box.";
18
+ KupBoxProps["globalFilter"] = "When set to true it activates the global filter.";
19
+ KupBoxProps["globalFilterValue"] = "The value of the global filter.";
20
+ KupBoxProps["kanban"] = "Displays the boxlist as a Kanban.";
21
+ KupBoxProps["layout"] = "How the field will be displayed. If not present, a default one will be created.";
22
+ KupBoxProps["multiSelection"] = "Enable multi selection.";
23
+ KupBoxProps["pageSelected"] = "Current page number.";
24
+ KupBoxProps["pageSize"] = "Number of boxes per page.";
25
+ KupBoxProps["pagination"] = "Enables pagination.";
26
+ KupBoxProps["rowsPerPage"] = "Number of current rows per page.";
27
+ KupBoxProps["scrollOnHover"] = "Activates the scroll on hover function.";
28
+ KupBoxProps["selectBox"] = "Automatically selects the box at the specified index.";
29
+ KupBoxProps["selectedRowsState"] = "Multiple selection.";
30
+ KupBoxProps["showSelection"] = "If enabled, highlights the selected box/boxes.";
31
+ KupBoxProps["sortBy"] = "If sorting is enabled, specifies which column to sort.";
32
+ KupBoxProps["sortEnabled"] = "Enable sorting.";
33
+ KupBoxProps["stateId"] = "";
34
+ KupBoxProps["store"] = "";
35
+ KupBoxProps["swipeDisabled"] = "Disable swipe.";
36
+ })(KupBoxProps || (KupBoxProps = {}));
37
+
38
+ class KupBoxState {
39
+ constructor() {
40
+ this.globalFilterValue = '';
41
+ this.sortBy = '';
42
+ this.selectedRowsState = '';
43
+ this.pageSelected = 1;
44
+ this.rowsPerPage = 0;
45
+ this.load = false;
46
+ }
47
+ /*Add attribute*/
48
+ toDebugString() {
49
+ // TODO
50
+ return 'box state';
51
+ }
52
+ }
53
+
54
+ const kupBoxCss = ":host{--kup_box_background_color:var(\n --kup-box-background-color,\n var(--kup-background-color)\n );--kup_box_color:var(--kup-box-color, var(--kup-text-color));--kup_box_font_family:var(--kup-box-font-family, var(--kup-font-family));--kup_box_font_size:var(--kup-box-font-size, var(--kup-font-size));--kup_box_grid_gap:var(--kup-box-grid-gap, 1em);--kup_box_hover_box_shadow:var(\n --kup-box-hover-box-shadow,\n 0px 0px 7.5px 0px rgba(128, 128, 128, 0.5)\n );--kup_box_primary_color_rgb:var(\n --kup-box-primary-color-rgb,\n var(--kup-primary-color-rgb)\n );--kup_box_transition:var(--kup-box-transition, 0.25s);display:block;font-family:var(--kup_box_font_family);font-size:var(--kup_box_font_size)}.box-component{background:var(--kup_box_background_color);transition:border var(--kup_box_transition) ease}.box-component[kup-drag-over]{position:relative;border:3px dashed var(--kup-border-color)}#box-container{display:grid;grid-gap:var(--kup_box_grid_gap);color:var(--kup_box_color);overflow:auto}#box-container.is-kanban .kanban-section{overflow:auto}#box-container.is-kanban .box-wrapper{padding-top:1em}#box-container.is-kanban .box-wrapper .box{overflow:auto}#box-container *{box-sizing:border-box}#box-container .box-wrapper{display:flex;align-items:center}#box-container .box-wrapper .box{flex-grow:1;cursor:pointer;position:relative;display:flex;transition:background-color var(--kup_box_transition) ease, box-shadow var(--kup_box_transition) ease, border var(--kup_box_transition) ease}#box-container .box-wrapper .box.draggable{touch-action:none;user-select:none}#box-container .box-wrapper .box.column{flex-direction:column}#box-container .box-wrapper .box:hover{box-shadow:var(--kup_box_hover_box_shadow)}#box-container .box-wrapper .box.selected{background-color:rgba(var(--kup_box_primary_color_rgb), 0.175)}#box-container .box-wrapper .box.selected .box-section.titled>h3{background-color:transparent}#box-container .box-wrapper .box[kup-draggable]{opacity:0.5}#box-container .box-wrapper .box[kup-drag-over]{border:3px dashed var(--kup-border-color);position:relative;z-index:2}#box-container .box-wrapper .box .box-section{display:flex;flex-direction:row;flex:1 1 1%;flex-wrap:wrap}#box-container .box-wrapper .box .box-section.column{flex-direction:column;justify-content:center;flex-wrap:unset}#box-container .box-wrapper .box .box-section.column>.box-section{flex:0 0 auto}#box-container .box-wrapper .box .box-section.grid{display:grid}#box-container .box-wrapper .box .box-section .box-object{min-height:16px}#box-container .box-wrapper .box .box-section .box-object img{height:auto}#box-container .box-wrapper .box .box-section.collapse-section .header{border-top:1px solid var(--kup-border-color);color:rgba(var(--kup-text-color-rgb), 0.75);display:flex;justify-content:space-around;width:100%}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content{margin:0.5em;display:flex;align-items:center}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image{transition:transform 0.15s}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .f-image.toggled{transform:rotate(-180deg)}#box-container .box-wrapper .box .box-section.collapse-section .header .header-content .kup-icon.kup-dropdown-icon{margin:0;-webkit-mask:var(--kup-dropdown-icon);mask:var(--kup-dropdown-icon)}#box-container .box-wrapper .box .box-section.collapse-section .content{display:none;width:100%}#box-container .box-wrapper .box .box-section.collapse-section.open .content{display:block}#box-container .box-wrapper .box .box-section.titled{border:1px solid var(--kup-border-color);padding-top:5px;position:relative;margin:10px}#box-container .box-wrapper .box .box-section.titled>h3{background:var(--kup-background-color);font-size:calc(var(--kup-font-size) * 1.15);position:absolute;margin:0px;padding:0 8px;top:-11px;left:5px;transition:background-color 0.25s ease}#box-container .box-wrapper .box .box-selection{position:absolute;top:0.5em;right:0.5em;z-index:1}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler{position:relative;width:24px;height:24px;margin-left:3px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler svg{cursor:pointer;opacity:0;fill:var(--kup-text-color);transition:opacity 500ms ease-out}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu{background:var(--kup-background-color);border:1px solid var(--kup-border-color);box-shadow:0px 0px 7.5px 0px rgba(128, 128, 128, 0.5);position:absolute;top:0;right:24px;display:none;z-index:10}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul{list-style-type:none;margin:0;padding:0}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li{cursor:pointer;white-space:nowrap;padding:0 12px;display:flex;align-items:center;line-height:30px}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu ul>li:not(:last-child){border-bottom:1px solid var(--kup-border-color)}#box-container .box-wrapper .row-actions-wrapper .row-actions-toggler .row-action-menu.open{display:block}#box-container .box-wrapper:hover .row-actions-wrapper .row-actions-toggler svg{opacity:1}#sort-panel,#global-filter{margin-bottom:1em}:host(.kup-center-aligned) #kup-component .box-section{text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:center;margin:auto;text-align:center}:host(.kup-center-aligned) #kup-component .box-section .f-cell img{margin:auto}:host(.kup-right-aligned) #kup-component .box-section{text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell .f-cell__content{justify-content:flex-end;margin-left:auto;margin-right:0;text-align:right}:host(.kup-right-aligned) #kup-component .box-section .f-cell img{margin-left:auto;margin-right:0}:host(.kup-top-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-start}:host(.kup-bottom-aligned) #box-container .box-wrapper .box .box-section .column{justify-content:flex-end}:host(:not(.kup-borderless)) .box{border:1px solid var(--kup-border-color)}:host(.kup-flat-on-hover) #box-container .box-wrapper .box:hover{box-shadow:none}:host(.kup-shaped) .box{border-radius:10px}:host(.kup-round) .box{border-radius:25px}:host(.kup-dashed-sections) .box-section{border:2px dashed var(--kup-text-color)}:host(:not(.kup-paddingless)) #box-container .box{padding:3px}:host(:not(.kup-paddingless)) #box-container .box .box-section .box-object{padding:1px 4px}:host(:not(.kup-paddingless)) #box-container .box .box-section.last-child{margin:3px 4px}:host(.kup-danger){--kup-box-primary-color-rgb:var(--kup-danger-color-rgb)}:host(.kup-info){--kup-box-primary-color-rgb:var(--kup-info-color-rgb)}:host(.kup-secondary){--kup-box-primary-color-rgb:var(--kup-secondary-color-rgb)}:host(.kup-success){--kup-box-primary-color-rgb:var(--kup-success-color-rgb)}:host(.kup-warning){--kup-box-primary-color-rgb:var(--kup-warning-color-rgb)}";
55
+
56
+ const KupBox = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
57
+ constructor() {
58
+ super();
59
+ this.__registerHost();
60
+ this.__attachShadow();
61
+ this.kupBoxClick = createEvent(this, "kup-box-click", 6);
62
+ this.kupBoxSelected = createEvent(this, "kup-box-selected", 6);
63
+ this.kupAutoBoxSelect = createEvent(this, "kup-box-autoselect", 6);
64
+ this.kupRowActionMenuClick = createEvent(this, "kup-box-rowactionmenuclick", 6);
65
+ this.kupRowActionClick = createEvent(this, "kup-box-rowactionclick", 6);
66
+ this.kupDidLoad = createEvent(this, "kup-box-didload", 6);
67
+ this.kupDidUnload = createEvent(this, "kup-box-didunload", 6);
68
+ this.kupBoxContextMenu = createEvent(this, "kup-box-contextmenu", 6);
69
+ this.state = new KupBoxState();
70
+ /*-------------------------------------------------*/
71
+ /* I n t e r n a l V a r i a b l e s */
72
+ /*-------------------------------------------------*/
73
+ /**
74
+ * Instance of the KupManager class.
75
+ */
76
+ this.kupManager = kupManagerInstance();
77
+ this.visibleColumns = [];
78
+ this.rows = [];
79
+ this.filteredRows = [];
80
+ this.sectionRef = null;
81
+ this.rowsRefs = [];
82
+ this.hold = false;
83
+ this.interactableDrag = [];
84
+ this.interactableDrop = [];
85
+ this.interactableTouch = [];
86
+ this.collapsedSection = {};
87
+ this.selectedRows = [];
88
+ this.rowActionMenuOpened = undefined;
89
+ this.currentPage = 1;
90
+ this.currentRowsPerPage = 10;
91
+ this.cardData = null;
92
+ this.columns = 1;
93
+ this.customStyle = '';
94
+ this.data = null;
95
+ this.dragEnabled = false;
96
+ this.dropEnabled = false;
97
+ this.dropOnSection = false;
98
+ this.editableData = false;
99
+ this.enableRowActions = false;
100
+ this.globalFilter = false;
101
+ this.globalFilterValue = '';
102
+ this.kanban = null;
103
+ this.layout = undefined;
104
+ this.multiSelection = false;
105
+ this.pageSelected = 1;
106
+ this.pageSize = 10;
107
+ this.pagination = false;
108
+ this.rowsPerPage = undefined;
109
+ this.scrollOnHover = false;
110
+ this.selectBox = undefined;
111
+ this.selectedRowsState = undefined;
112
+ this.showSelection = true;
113
+ this.sortBy = undefined;
114
+ this.sortEnabled = false;
115
+ this.stateId = '';
116
+ this.store = undefined;
117
+ this.swipeDisabled = false;
118
+ }
119
+ initWithPersistedState() {
120
+ if (this.store && this.stateId) {
121
+ const state = this.store.getState(this.stateId);
122
+ if (state != null) {
123
+ this.kupManager.debug.logMessage(this, 'Initialize with state for stateId ' +
124
+ this.stateId +
125
+ ': ' +
126
+ state);
127
+ // *** PROPS ***
128
+ this.sortBy = this.state.sortBy;
129
+ this.globalFilterValue = this.state.globalFilterValue;
130
+ this.selectedRowsState = this.state.selectedRowsState;
131
+ this.pageSelected = this.state.pageSelected;
132
+ this.rowsPerPage = this.state.rowsPerPage;
133
+ }
134
+ }
135
+ }
136
+ persistState() {
137
+ if (this.store && this.stateId) {
138
+ let somethingChanged = false;
139
+ if (!this.kupManager.objects.deepEqual(this.state.sortBy, this.sortBy)) {
140
+ this.state.sortBy = this.sortBy;
141
+ somethingChanged = true;
142
+ }
143
+ if (!this.kupManager.objects.deepEqual(this.state.globalFilterValue, this.globalFilterValue)) {
144
+ this.state.globalFilterValue = this.globalFilterValue;
145
+ somethingChanged = true;
146
+ }
147
+ if (!this.kupManager.objects.deepEqual(this.state.pageSelected, this.currentPage)) {
148
+ this.state.pageSelected = this.currentPage;
149
+ somethingChanged = true;
150
+ }
151
+ if (!this.kupManager.objects.deepEqual(this.state.rowsPerPage, this.currentRowsPerPage)) {
152
+ this.state.rowsPerPage = this.currentRowsPerPage;
153
+ somethingChanged = true;
154
+ }
155
+ const selectedRowsState = this.selectedRows.reduce((accumulator, row, currentIndex) => {
156
+ const prefix = currentIndex > 0 ? ';' : '';
157
+ return accumulator + prefix + row.id;
158
+ }, '');
159
+ if (!this.kupManager.objects.deepEqual(this.state.selectedRowsState, selectedRowsState)) {
160
+ this.state.selectedRowsState = selectedRowsState;
161
+ somethingChanged = true;
162
+ }
163
+ if (!this.state.load) {
164
+ this.state.load = true;
165
+ return;
166
+ }
167
+ if (somethingChanged) {
168
+ this.kupManager.debug.logMessage(this, 'Persisting state for stateId ' +
169
+ this.stateId +
170
+ ': ' +
171
+ this.state);
172
+ this.store.persistState(this.stateId, this.state);
173
+ }
174
+ }
175
+ }
176
+ /*-------------------------------------------------*/
177
+ /* W a t c h e r s */
178
+ /*-------------------------------------------------*/
179
+ rowsPerPageHandler(newValue) {
180
+ this.currentRowsPerPage = newValue;
181
+ }
182
+ recalculateRows() {
183
+ this.initRows();
184
+ }
185
+ onDataChanged() {
186
+ identify(this.getRows());
187
+ this.initVisibleColumns();
188
+ this.initRows();
189
+ this.checkLayout();
190
+ }
191
+ onLayoutChanged() {
192
+ this.checkLayout();
193
+ }
194
+ onSelectBoxChanged() {
195
+ this.handleAutomaticBoxSelection();
196
+ }
197
+ /*-------------------------------------------------*/
198
+ /* P u b l i c M e t h o d s */
199
+ /*-------------------------------------------------*/
200
+ /**
201
+ * Used to retrieve component's props values.
202
+ * @param {boolean} descriptions - When provided and true, the result will be the list of props with their description.
203
+ * @returns {Promise<GenericObject>} List of props as object, each key will be a prop.
204
+ */
205
+ async getProps(descriptions) {
206
+ return getProps(this, KupBoxProps, descriptions);
207
+ }
208
+ async loadRowActions(row, actions) {
209
+ row.actions = actions;
210
+ // show menu
211
+ this.rowActionMenuOpened = row;
212
+ }
213
+ /**
214
+ * This method is used to trigger a new render of the component.
215
+ */
216
+ async refresh() {
217
+ forceUpdate(this);
218
+ }
219
+ /**
220
+ * Sets the props to the component.
221
+ * @param {GenericObject} props - Object containing props that will be set to the component.
222
+ */
223
+ async setProps(props) {
224
+ setProps(this, KupBoxProps, props);
225
+ }
226
+ /*-------------------------------------------------*/
227
+ /* P r i v a t e M e t h o d s */
228
+ /*-------------------------------------------------*/
229
+ getColumns() {
230
+ return this.data && this.data.columns
231
+ ? this.data.columns
232
+ : [{ title: '', name: '', size: undefined }];
233
+ }
234
+ initVisibleColumns() {
235
+ this.visibleColumns = this.getColumns().filter((column) => {
236
+ if (column.hasOwnProperty('visible')) {
237
+ return column.visible;
238
+ }
239
+ return true;
240
+ });
241
+ }
242
+ getRows() {
243
+ return this.data && this.data.rows ? this.data.rows : [];
244
+ }
245
+ initRows() {
246
+ this.filteredRows = this.getRows();
247
+ if (this.globalFilter && this.globalFilterValue) {
248
+ // filtering rows
249
+ this.filteredRows = filterRows(this.filteredRows, null, this.globalFilterValue, this.visibleColumns);
250
+ }
251
+ this.rows = this.sortRows(this.filteredRows);
252
+ if (this.pagination) {
253
+ this.rows = paginateRows(this.rows, this.currentPage, this.currentRowsPerPage, false);
254
+ }
255
+ }
256
+ sortRows(rows) {
257
+ let sortedRows = rows;
258
+ if (this.sortBy) {
259
+ // create 'fake' sortObject
260
+ const sortObject = {
261
+ column: this.sortBy,
262
+ sortMode: SortMode.A,
263
+ };
264
+ sortedRows = sortRows(sortedRows, [sortObject]);
265
+ }
266
+ return sortedRows;
267
+ }
268
+ checkScrollOnHover() {
269
+ if (!this.kupManager.scrollOnHover.isRegistered(this.boxContainer)) {
270
+ if (this.scrollOnHover) {
271
+ this.kupManager.scrollOnHover.register(this.boxContainer);
272
+ }
273
+ }
274
+ else {
275
+ if (!this.scrollOnHover) {
276
+ this.kupManager.scrollOnHover.unregister(this.boxContainer);
277
+ }
278
+ }
279
+ }
280
+ checkLayout() {
281
+ // check if there is a layout.
282
+ // if not, create a default layout
283
+ if (this.layout) {
284
+ this.boxLayout = this.layout;
285
+ return;
286
+ }
287
+ // only one section, containing all visible fields
288
+ const section = {
289
+ horizontal: false,
290
+ sections: [],
291
+ };
292
+ // adding box objects to section
293
+ const visibleColumns = this.visibleColumns;
294
+ let size = visibleColumns.length;
295
+ let content = [];
296
+ let cnt = 0;
297
+ while (size-- > 0) {
298
+ content.push({
299
+ column: visibleColumns[cnt++].name,
300
+ });
301
+ }
302
+ section.content = content;
303
+ // creating a new layout
304
+ this.boxLayout = {
305
+ sections: [section],
306
+ };
307
+ }
308
+ onSortChange(e) {
309
+ let column = getColumnByName(this.visibleColumns, e.detail.value);
310
+ this.sortBy = column.name;
311
+ }
312
+ onGlobalFilterChange({ detail }) {
313
+ let value = '';
314
+ if (detail && detail.value) {
315
+ value = detail.value;
316
+ }
317
+ this.globalFilterValue = value;
318
+ }
319
+ isSectionExpanded(row, section) {
320
+ if (!row.id || !section.id) {
321
+ return false;
322
+ }
323
+ return (this.collapsedSection[section.id] &&
324
+ this.collapsedSection[section.id][row.id]);
325
+ }
326
+ handleAutomaticBoxSelection() {
327
+ if (this.selectBox &&
328
+ this.selectBox > 0 &&
329
+ this.selectBox <= this.data.rows.length) {
330
+ this.selectedRows = [];
331
+ for (let boxRow of this.data.rows) {
332
+ if (boxRow.id === (this.selectBox - 1).toString()) {
333
+ this.selectedRows.push(boxRow);
334
+ break;
335
+ }
336
+ }
337
+ this.kupAutoBoxSelect.emit({
338
+ comp: this,
339
+ id: this.rootElement.id,
340
+ row: this.selectedRows[0],
341
+ });
342
+ }
343
+ }
344
+ getEventDetails(el, e) {
345
+ let boxObject = null;
346
+ let cell = null;
347
+ let row = null;
348
+ let column = null;
349
+ if (el) {
350
+ boxObject =
351
+ el.closest('.box-object') ||
352
+ el.querySelector('.box-object') ||
353
+ el.closest('.f-cell');
354
+ }
355
+ if (boxObject) {
356
+ if (boxObject.classList.contains('f-cell')) {
357
+ const props = boxObject['kup-get-cell-props']();
358
+ cell = props.cell;
359
+ column = props.column;
360
+ row = props.row;
361
+ }
362
+ else {
363
+ cell = boxObject['data-cell'];
364
+ row = boxObject['data-row'];
365
+ column = getColumnByName(this.visibleColumns, boxObject.dataset.column);
366
+ }
367
+ }
368
+ return {
369
+ boxObject: boxObject ? boxObject : null,
370
+ column: column ? column : null,
371
+ cell: cell ? cell : null,
372
+ originalEvent: e,
373
+ row: row ? row : null,
374
+ };
375
+ }
376
+ contextMenuHandler(e) {
377
+ const details = this.getEventDetails(e.target, e);
378
+ return details;
379
+ }
380
+ /**
381
+ * Checks if the element is the svg that opens the "row actions menu"
382
+ * @param element the element to check
383
+ */
384
+ checkIfElementIsActionMenuIcon(element) {
385
+ if (element.tagName && element.parentElement) {
386
+ return (element.tagName === 'svg' &&
387
+ element.parentElement.classList.contains('row-actions-toggler'));
388
+ }
389
+ return false;
390
+ }
391
+ // event listeners
392
+ onBoxClick({ target }, row) {
393
+ if (!(target instanceof HTMLElement)) {
394
+ return;
395
+ }
396
+ // searching parent
397
+ let element = target;
398
+ let classList = element.classList;
399
+ while (!classList.contains('box-object') &&
400
+ !classList.contains('box-section') &&
401
+ !classList.contains('box')) {
402
+ element = element.parentElement;
403
+ if (element === null) {
404
+ break;
405
+ }
406
+ classList = element.classList;
407
+ }
408
+ // evaluating column
409
+ let column = null;
410
+ if (classList.contains('box-object')) {
411
+ column = element.dataset.column;
412
+ }
413
+ this.kupBoxClick.emit({
414
+ comp: this,
415
+ id: this.rootElement.id,
416
+ row,
417
+ column,
418
+ });
419
+ // selecting box
420
+ if (this.multiSelection) {
421
+ // triggering multi selection
422
+ this.onSelectionCheckChange(row);
423
+ }
424
+ else {
425
+ this.selectedRows = [row];
426
+ }
427
+ }
428
+ onSelectionCheckChange(row) {
429
+ var index = -1;
430
+ for (let i = 0; i < this.selectedRows.length; i++) {
431
+ const select = this.selectedRows[i];
432
+ if (select.id === row.id) {
433
+ index = i;
434
+ break;
435
+ }
436
+ }
437
+ if (index >= 0) {
438
+ // remove row
439
+ this.selectedRows.splice(index, 1);
440
+ this.selectedRows = [...this.selectedRows];
441
+ }
442
+ else {
443
+ // add row
444
+ this.selectedRows = [...this.selectedRows, row];
445
+ }
446
+ this.kupBoxSelected.emit({
447
+ comp: this,
448
+ id: this.rootElement.id,
449
+ rows: this.selectedRows,
450
+ });
451
+ }
452
+ toggleSectionExpand(row, section) {
453
+ // check if section / row has id
454
+ if (!section.id) {
455
+ // error
456
+ console.error('cannot expand / collapse a section withoun an ID');
457
+ return;
458
+ }
459
+ if (!row.id) {
460
+ // error
461
+ console.error('cannot expand / collapse a section of a row without ad id');
462
+ return;
463
+ }
464
+ // check if section already in collapsedSection
465
+ if (!this.collapsedSection[section.id]) {
466
+ // adding element and row, setting it to expanded
467
+ this.collapsedSection[section.id] = {};
468
+ this.collapsedSection[section.id][row.id] = true;
469
+ }
470
+ else {
471
+ const s = this.collapsedSection[section.id];
472
+ if (!s[row.id]) {
473
+ s[row.id] = true;
474
+ }
475
+ else {
476
+ s[row.id] = !s[row.id];
477
+ }
478
+ }
479
+ // triggering rendering
480
+ this.collapsedSection = Object.assign({}, this.collapsedSection);
481
+ }
482
+ onRowAction(row) {
483
+ if (!row) {
484
+ return;
485
+ }
486
+ if (row === this.rowActionMenuOpened) {
487
+ // closing menu
488
+ this.rowActionMenuOpened = null;
489
+ return;
490
+ }
491
+ if (row.actions) {
492
+ // actions already loaded -> show menu
493
+ this.rowActionMenuOpened = row;
494
+ }
495
+ else {
496
+ // no actions -> triggering event
497
+ this.kupRowActionMenuClick.emit({
498
+ comp: this,
499
+ id: this.rootElement.id,
500
+ row,
501
+ });
502
+ }
503
+ }
504
+ onRowActionClick(row, action, index) {
505
+ this.kupRowActionClick.emit({
506
+ comp: this,
507
+ id: this.rootElement.id,
508
+ row,
509
+ action,
510
+ index,
511
+ });
512
+ }
513
+ /**
514
+ * see onDocumentClick in kup-combo
515
+ */
516
+ clickFunction(event) {
517
+ try {
518
+ const targets = event.composedPath();
519
+ for (let target of targets) {
520
+ if (this.checkIfElementIsActionMenuIcon(target)) {
521
+ return;
522
+ }
523
+ }
524
+ }
525
+ catch (err) {
526
+ if (this.checkIfElementIsActionMenuIcon(event.target)) {
527
+ return;
528
+ }
529
+ }
530
+ this.rowActionMenuOpened = null;
531
+ }
532
+ handlePageChange(pageNumber) {
533
+ const newPage = pageChange(pageNumber, this.filteredRows.length, this.currentRowsPerPage);
534
+ if (newPage) {
535
+ this.currentPage = newPage;
536
+ }
537
+ }
538
+ handleRowsPerPageChange(rowsNumber) {
539
+ const newRows = rowsPerPageChange(rowsNumber, this.filteredRows.length);
540
+ if (newRows) {
541
+ this.currentRowsPerPage = newRows;
542
+ this.adjustPaginator();
543
+ }
544
+ }
545
+ adjustPaginator() {
546
+ const numberOfRows = this.rows.length;
547
+ // check if current page is valid
548
+ const numberOfPages = Math.ceil(numberOfRows / this.currentRowsPerPage);
549
+ if (this.currentPage > numberOfPages) {
550
+ // reset page
551
+ this.currentPage = 1;
552
+ }
553
+ }
554
+ // render methods
555
+ renderSectionAsCard(row) {
556
+ let skipPush = false;
557
+ const cardData = {
558
+ button: [],
559
+ cell: [],
560
+ columns: [],
561
+ image: [],
562
+ progressbar: [],
563
+ text: [],
564
+ };
565
+ for (let index = 0; index < this.data.columns.length; index++) {
566
+ const column = this.data.columns[index];
567
+ if (column.visible !== false) {
568
+ cardData.cell.push(row.cells[column.name]);
569
+ cardData.columns.push(column);
570
+ }
571
+ }
572
+ //First cycle sets specific binds between cardIDs and cells
573
+ for (const key in row.cells) {
574
+ if (row.cells.hasOwnProperty(key)) {
575
+ const cell = row.cells[key];
576
+ if (cell.cardID !== undefined && cell.obj) {
577
+ switch (cell.obj.p) {
578
+ case 'BTN':
579
+ do {
580
+ cardData.button.push({});
581
+ } while (cardData.button.length < cell.cardID);
582
+ cardData.button[cell.cardID] = {
583
+ label: cell.value,
584
+ };
585
+ break;
586
+ case 'IMG':
587
+ do {
588
+ cardData.image.push({});
589
+ } while (cardData.image.length < cell.cardID);
590
+ cardData.image[cell.cardID] = {
591
+ resource: cell.value,
592
+ };
593
+ break;
594
+ case 'PGB':
595
+ do {
596
+ cardData.progressbar.push({});
597
+ } while (cardData.progressbar.length < cell.cardID);
598
+ cardData.progressbar[cell.cardID] = {
599
+ value: cell.value,
600
+ };
601
+ break;
602
+ default:
603
+ do {
604
+ cardData.text.push('');
605
+ } while (cardData.text.length < cell.cardID);
606
+ cardData.text[cell.cardID] = cell.value;
607
+ break;
608
+ }
609
+ }
610
+ }
611
+ }
612
+ //Second cycle sets leftover binds automatically
613
+ for (const key in row.cells) {
614
+ if (row.cells.hasOwnProperty(key)) {
615
+ const cell = row.cells[key];
616
+ if (cell.cardID === undefined && cell.obj) {
617
+ skipPush = false;
618
+ switch (cell.obj.p) {
619
+ case 'BTN':
620
+ for (let index = 0; index < cardData.button.length; index++) {
621
+ //If there are empty elements, the first one will be used
622
+ if (!Object.keys(cardData.button[index]).length) {
623
+ cardData.button[index] = {
624
+ label: cell.value,
625
+ };
626
+ skipPush = true;
627
+ break;
628
+ }
629
+ }
630
+ //Otherwise a new element will be pushed
631
+ if (!skipPush) {
632
+ cardData.button.push({
633
+ label: cell.value,
634
+ });
635
+ }
636
+ break;
637
+ case 'IMG':
638
+ for (let index = 0; index < cardData.image.length; index++) {
639
+ //If there are empty elements, the first one will be used
640
+ if (!Object.keys(cardData.image[index]).length) {
641
+ cardData.image[index] = {
642
+ resource: cell.value,
643
+ };
644
+ skipPush = true;
645
+ break;
646
+ }
647
+ }
648
+ //Otherwise a new element will be pushed
649
+ if (!skipPush) {
650
+ cardData.image.push({
651
+ resource: cell.value,
652
+ });
653
+ }
654
+ break;
655
+ case 'PGB':
656
+ for (let index = 0; index < cardData.progressbar.length; index++) {
657
+ //If there are empty elements, the first one will be used
658
+ if (!Object.keys(cardData.progressbar[index])
659
+ .length) {
660
+ cardData.progressbar[index] = {
661
+ value: cell.value,
662
+ };
663
+ skipPush = true;
664
+ break;
665
+ }
666
+ }
667
+ //Otherwise a new element will be pushed
668
+ if (!skipPush) {
669
+ cardData.progressbar.push({
670
+ value: cell.value,
671
+ });
672
+ }
673
+ break;
674
+ default:
675
+ for (let index = 0; index < cardData.text.length; index++) {
676
+ //If there are empty elements, the first one will be used
677
+ if (cardData.text[index] === '') {
678
+ cardData.text[index] = cell.value;
679
+ skipPush = true;
680
+ break;
681
+ }
682
+ }
683
+ //Otherwise a new element will be pushed
684
+ if (!skipPush) {
685
+ cardData.text.push(cell.value);
686
+ }
687
+ break;
688
+ }
689
+ }
690
+ }
691
+ }
692
+ return h("kup-card", Object.assign({ data: cardData }, this.cardData));
693
+ }
694
+ renderRow(row) {
695
+ const visibleColumns = [...this.visibleColumns];
696
+ let boxContent = null;
697
+ // if layout in row, use that one
698
+ let rowLayout = row.layout;
699
+ if (!rowLayout) {
700
+ // otherwise, use 'default' layout
701
+ rowLayout = this.boxLayout;
702
+ }
703
+ let horizontal = false;
704
+ if (rowLayout) {
705
+ if (rowLayout.horizontal) {
706
+ horizontal = true;
707
+ }
708
+ const sections = rowLayout.sections;
709
+ let size = sections.length;
710
+ let cnt = 0;
711
+ if (size > 0) {
712
+ boxContent = [];
713
+ }
714
+ // create fake parent section
715
+ const parent = {
716
+ horizontal: horizontal,
717
+ };
718
+ while (size-- > 0) {
719
+ if (this.cardData !== null &&
720
+ this.cardData !== undefined &&
721
+ typeof this.cardData === 'object') {
722
+ boxContent.push(this.renderSectionAsCard(row));
723
+ }
724
+ else {
725
+ boxContent.push(this.renderSection(sections[cnt++], parent, row, visibleColumns));
726
+ }
727
+ }
728
+ }
729
+ var isSelected = false;
730
+ for (let select of this.selectedRows) {
731
+ if (select.id === row.id) {
732
+ isSelected = true;
733
+ }
734
+ }
735
+ let multiSel = null;
736
+ if (this.multiSelection) {
737
+ multiSel = (h("div", { class: "box-selection" }, h("kup-checkbox", { checked: isSelected })));
738
+ }
739
+ let rowObject = null;
740
+ if (this.enableRowActions && !this.swipeDisabled) {
741
+ const menuClass = {
742
+ 'row-action-menu': true,
743
+ open: row === this.rowActionMenuOpened,
744
+ };
745
+ let rowActionMenuContent = null;
746
+ if (row.actions) {
747
+ const actionItems = row.actions.map((item, index) => {
748
+ const iconClass = `icon ${item.icon}`;
749
+ return (h("li", { tabindex: "0", onClick: () => this.onRowActionClick(row, item, index) }, h("div", { class: iconClass }), h("div", { class: "text" }, item.text)));
750
+ });
751
+ rowActionMenuContent = h("ul", null, actionItems);
752
+ }
753
+ rowObject = (h("div", { class: "row-actions-wrapper" }, h("div", { class: "row-actions-toggler" }, h("svg", { version: "1.1", width: "24", height: "24", viewBox: "0 0 24 24", onClick: () => this.onRowAction(row) }, h("path", { d: "M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z" })), h("div", { class: menuClass }, rowActionMenuContent))));
754
+ }
755
+ let badges = null;
756
+ if (row.badgeData && row.badgeData.length > 0) {
757
+ badges = row.badgeData.map((badge) => (h("kup-badge", { text: badge.text, class: badge['className']
758
+ ? `centered ${badge['className']}`
759
+ : 'centered', imageData: badge.imageData })));
760
+ }
761
+ const boxClass = {
762
+ box: true,
763
+ draggable: this.dragEnabled,
764
+ selected: this.showSelection && isSelected,
765
+ column: !horizontal,
766
+ };
767
+ const rowStyle = row.style || {};
768
+ return (h("div", { class: "box-wrapper", style: rowStyle }, h("div", { class: boxClass, onClick: (e) => this.onBoxClick(e, row), ref: (el) => this.rowsRefs.push(el) }, multiSel, boxContent, badges), rowObject));
769
+ }
770
+ renderSection(section, parent, row, visibleColumns) {
771
+ let sectionContent = null;
772
+ if (section.sections && section.sections.length > 0) {
773
+ // rendering child
774
+ const sections = section.sections;
775
+ let size = sections.length;
776
+ let cnt = 0;
777
+ if (size > 0) {
778
+ sectionContent = [];
779
+ }
780
+ while (size-- > 0) {
781
+ sectionContent.push(this.renderSection(sections[cnt++], section, row, visibleColumns));
782
+ }
783
+ }
784
+ else if (section.content) {
785
+ // rendering box objects
786
+ const content = section.content;
787
+ let size = content.length;
788
+ let cnt = 0;
789
+ if (size > 0) {
790
+ sectionContent = [];
791
+ }
792
+ while (size-- > 0) {
793
+ sectionContent.push(this.renderBoxObject({
794
+ boxObject: content[cnt++],
795
+ row,
796
+ visibleColumns,
797
+ }, true));
798
+ }
799
+ }
800
+ else if (visibleColumns.length > 0) {
801
+ const column = visibleColumns[0];
802
+ sectionContent = this.renderBoxObject({
803
+ boxObject: { column: column.name },
804
+ row,
805
+ visibleColumns,
806
+ });
807
+ }
808
+ const sectionExpanded = this.isSectionExpanded(row, section);
809
+ const isGrid = !!section.columns;
810
+ const sectionClass = {
811
+ 'box-section': true,
812
+ open: sectionExpanded,
813
+ column: !isGrid && !section.horizontal,
814
+ grid: isGrid,
815
+ titled: !!section.title,
816
+ 'last-child': !section.sections || section.sections.length === 0,
817
+ };
818
+ const sectionStyle = section.style || {};
819
+ if (section.dim && parent) {
820
+ sectionStyle.flex = `0 0 ${section.dim}`;
821
+ if (parent.horizontal) {
822
+ sectionStyle.maxWidth = section.dim;
823
+ }
824
+ else {
825
+ sectionStyle.maxHeight = section.dim;
826
+ }
827
+ }
828
+ if (isGrid) {
829
+ sectionStyle['grid-template-columns'] = `repeat(${section.columns}, 1fr)`;
830
+ }
831
+ let sectionContainer = null;
832
+ if (section.collapsible) {
833
+ sectionClass['collapse-section'] = true;
834
+ const contentClass = {
835
+ content: true,
836
+ };
837
+ // TODO I18N
838
+ let headerTitle = '';
839
+ if (section.title) {
840
+ headerTitle = section.title;
841
+ }
842
+ else if (sectionExpanded) {
843
+ headerTitle = this.kupManager.language.translate(KupLanguageGeneric.COLLAPSE);
844
+ }
845
+ else {
846
+ headerTitle = this.kupManager.language.translate(KupLanguageGeneric.EXPAND);
847
+ }
848
+ sectionContainer = (h("div", { class: sectionClass, style: sectionStyle }, h("div", { class: contentClass }, sectionContent), h("div", { class: "header", role: "button", onClick: (e) => {
849
+ e.stopPropagation();
850
+ this.toggleSectionExpand(row, section);
851
+ } }, h("div", { class: "header-content" }, h("span", null, headerTitle), h(FImage, { resource: `${KupThemeIconValues.DROPDOWN}`, sizeX: "1.25em", sizeY: "1.25em", wrapperClass: sectionExpanded ? 'toggled' : '' })))));
852
+ }
853
+ else {
854
+ const title = section.title ? h("h3", null, section.title) : null;
855
+ sectionContainer = (h("div", { class: sectionClass, style: sectionStyle }, title, sectionContent));
856
+ }
857
+ return sectionContainer;
858
+ }
859
+ renderBoxObject({ boxObject, row, visibleColumns, }, fromSection) {
860
+ const classObj = {
861
+ 'box-object': true,
862
+ };
863
+ const boStyle = {};
864
+ let column = null;
865
+ let index = -1;
866
+ for (let i = 0; i < visibleColumns.length; i++) {
867
+ const c = visibleColumns[i];
868
+ if (c.name === boxObject.column) {
869
+ index = i;
870
+ break;
871
+ }
872
+ }
873
+ if (index >= 0) {
874
+ column = visibleColumns[index];
875
+ visibleColumns.splice(index, 1);
876
+ }
877
+ else if (fromSection) {
878
+ column = this.data.columns.find((x) => x.name === boxObject.column);
879
+ }
880
+ const cell = row.cells[boxObject.column];
881
+ let title = undefined;
882
+ if (cell && !this.kupManager.objects.isEmptyKupObj(cell.obj)) {
883
+ classObj['is-obj'] = true;
884
+ if (this.kupManager.debug.isDebug()) {
885
+ title =
886
+ cell.obj.t + '; ' + cell.obj.p + '; ' + cell.obj.k + ';';
887
+ }
888
+ }
889
+ const cellProps = {
890
+ cell: cell,
891
+ column: column,
892
+ component: this,
893
+ editable: this.editableData,
894
+ renderKup: true,
895
+ row: row,
896
+ setSizes: true,
897
+ shape: boxObject.shape,
898
+ };
899
+ return (h("div", { "data-cell": cell, "data-row": row, "data-column": boxObject.column, class: classObj, style: boStyle, title: title }, cell && column ? (h(FCell, Object.assign({}, cellProps))) : (h("span", null, boxObject.value))));
900
+ }
901
+ /**
902
+ * Prepares the kanban sections by sorting the boxlist's data.
903
+ * @returns {{jsx: VNode[], style: { [index: string]: string }}} jsx contains the virtual nodes of the Kanban sections, style contains the grid CSS settings.
904
+ */
905
+ kanbanMode() {
906
+ // Testing whether there are columns to group by
907
+ if (!this.kanban.columns || this.kanban.columns.length === 0) {
908
+ this.kupManager.debug.logMessage(this, 'No columns to group by detected.', KupDebugCategory.ERROR);
909
+ return {
910
+ jsx: (h("div", { id: "empty-data-message", class: "box-wrapper" }, h("div", { ref: (el) => this.rowsRefs.push(el) }), this.kupManager.language.translate(KupLanguageGeneric.EMPTY_DATA))),
911
+ style: { 'grid-template-columns': `repeat(1, 1fr)` },
912
+ };
913
+ }
914
+ const kanbanSections = [];
915
+ // Creating empty sections from prop-defined labels
916
+ if (this.kanban.labels) {
917
+ for (let index = 0; index < this.kanban.labels.length; index++) {
918
+ const key = this.kanban.labels[index];
919
+ kanbanSections.push({ labels: key, nodes: [] });
920
+ }
921
+ }
922
+ // Browsing all rows
923
+ for (let index = 0; index < this.rows.length; index++) {
924
+ let key = [];
925
+ // Creating the key for the current row
926
+ for (let j = 0; j < this.kanban.columns.length; j++) {
927
+ try {
928
+ key.push(this.rows[index].cells[this.kanban.columns[j]].value);
929
+ }
930
+ catch (error) {
931
+ this.kupManager.debug.logMessage(this, error, KupDebugCategory.WARNING);
932
+ }
933
+ }
934
+ const check = {
935
+ found: false,
936
+ index: null,
937
+ };
938
+ // Browsing key array to search whether the current key exists or not
939
+ for (let j = 0; j < kanbanSections.length; j++) {
940
+ let sortingKey = kanbanSections[j].labels;
941
+ let found = true;
942
+ for (let i = 0; i < sortingKey.length; i++) {
943
+ if (key[i] !== sortingKey[i]) {
944
+ found = false;
945
+ break;
946
+ }
947
+ }
948
+ if (found) {
949
+ check.found = true;
950
+ check.index = j;
951
+ break;
952
+ }
953
+ }
954
+ // If current key exists, box will be pushed into the existing array of virtual nodes
955
+ if (check.found) {
956
+ kanbanSections[check.index].nodes.push(this.renderRow(this.rows[index]));
957
+ }
958
+ else {
959
+ // Otherwise, a new section will be defined starting with just the current virtal node
960
+ kanbanSections.push({
961
+ labels: key,
962
+ nodes: [this.renderRow(this.rows[index])],
963
+ });
964
+ }
965
+ }
966
+ // Once the arrays are set, they need to be emptied into columns
967
+ const kanbanJSX = [];
968
+ for (let index = 0; index < kanbanSections.length; index++) {
969
+ const sortingKey = kanbanSections[index].labels;
970
+ const props = {
971
+ data: [],
972
+ };
973
+ for (let index = 0; index < sortingKey.length; index++) {
974
+ props.data.push({
975
+ value: sortingKey[index],
976
+ id: sortingKey[index],
977
+ });
978
+ }
979
+ kanbanJSX.push(h("div", { class: "kanban-section" }, h(FChip, Object.assign({}, props)), kanbanSections[index].nodes));
980
+ }
981
+ return {
982
+ jsx: kanbanJSX,
983
+ style: {
984
+ 'grid-template-columns': this.kanban.isStacked
985
+ ? 'repeat(1fr)'
986
+ : this.kanban.size
987
+ ? `repeat(${Object.keys(kanbanSections).length}, ${this.kanban.size})`
988
+ : `repeat(${Object.keys(kanbanSections).length}, 1fr)`,
989
+ },
990
+ };
991
+ }
992
+ didLoadInteractables() {
993
+ this.interactableTouch.push(this.boxContainer);
994
+ const tapCb = (e) => {
995
+ if (this.hold) {
996
+ this.hold = false;
997
+ return;
998
+ }
999
+ switch (e.button) {
1000
+ case 2:
1001
+ this.kupBoxContextMenu.emit({
1002
+ comp: this,
1003
+ id: this.rootElement.id,
1004
+ details: this.contextMenuHandler(e),
1005
+ });
1006
+ break;
1007
+ }
1008
+ };
1009
+ const holdCb = (e) => {
1010
+ if (e.pointerType === 'pen' || e.pointerType === 'touch') {
1011
+ this.hold = true;
1012
+ this.kupBoxContextMenu.emit({
1013
+ comp: this,
1014
+ id: this.rootElement.id,
1015
+ details: this.contextMenuHandler(e),
1016
+ });
1017
+ }
1018
+ };
1019
+ this.kupManager.interact.on(this.boxContainer, KupPointerEventTypes.TAP, tapCb);
1020
+ this.kupManager.interact.on(this.boxContainer, KupPointerEventTypes.HOLD, holdCb);
1021
+ }
1022
+ didRenderInteractables() {
1023
+ if (this.dragEnabled) {
1024
+ for (let index = 0; index < this.rowsRefs.length; index++) {
1025
+ const row = this.rowsRefs[index];
1026
+ const dataCb = () => {
1027
+ const cellEl = this.rootElement.shadowRoot.querySelector('.box-object:hover');
1028
+ return {
1029
+ cell: cellEl['data-cell'],
1030
+ column: getColumnByName(this.visibleColumns, cellEl.dataset.column),
1031
+ id: this.rootElement.id,
1032
+ multiple: this.multiSelection,
1033
+ row: cellEl['data-row'],
1034
+ selectedRows: this.selectedRows,
1035
+ };
1036
+ };
1037
+ if (row && !this.interactableDrag.includes(row)) {
1038
+ this.interactableDrag.push(row);
1039
+ this.kupManager.interact.draggable(row, {
1040
+ allowFrom: '.box-object',
1041
+ cursorChecker() {
1042
+ return null;
1043
+ },
1044
+ }, {
1045
+ callback: dataCb,
1046
+ }, KupDragEffect.BADGE);
1047
+ }
1048
+ }
1049
+ }
1050
+ if (this.dropEnabled) {
1051
+ const dataCb = () => {
1052
+ const receivingDetails = this.getEventDetails(this.rootElement.shadowRoot.querySelector('.box:hover'));
1053
+ return {
1054
+ cell: receivingDetails.cell,
1055
+ column: receivingDetails.column,
1056
+ id: this.rootElement.id,
1057
+ row: receivingDetails.row,
1058
+ };
1059
+ };
1060
+ if (!this.interactableDrop.includes(this.sectionRef)) {
1061
+ this.interactableDrop.push(this.sectionRef);
1062
+ this.kupManager.interact.dropzone(this.sectionRef, {
1063
+ accept: `[${kupDraggableCellAttr}]`,
1064
+ }, {
1065
+ dispatcher: this.rootElement,
1066
+ type: KupDropEventTypes.BOX,
1067
+ });
1068
+ }
1069
+ for (let index = 0; index < this.rowsRefs.length; index++) {
1070
+ const row = this.rowsRefs[index];
1071
+ if (row && !this.interactableDrop.includes(row)) {
1072
+ this.interactableDrop.push(row);
1073
+ this.kupManager.interact.dropzone(row, {
1074
+ accept: `[${kupDraggableCellAttr}]`,
1075
+ }, {
1076
+ callback: dataCb,
1077
+ dispatcher: this.rootElement,
1078
+ type: KupDropEventTypes.BOX,
1079
+ });
1080
+ }
1081
+ }
1082
+ }
1083
+ }
1084
+ /*-------------------------------------------------*/
1085
+ /* L i f e c y c l e H o o k s */
1086
+ /*-------------------------------------------------*/
1087
+ componentWillLoad() {
1088
+ this.kupManager.debug.logLoad(this, false);
1089
+ if (this.rowsPerPage) {
1090
+ this.currentRowsPerPage = this.rowsPerPage;
1091
+ }
1092
+ else if (this.pageSize) {
1093
+ this.currentRowsPerPage = this.pageSize;
1094
+ }
1095
+ if (this.data &&
1096
+ this.data.rows &&
1097
+ this.currentRowsPerPage > this.data.rows.length) {
1098
+ this.currentRowsPerPage = this.data.rows.length;
1099
+ }
1100
+ this.kupManager.language.register(this);
1101
+ this.kupManager.theme.register(this);
1102
+ this.onDataChanged();
1103
+ this.adjustPaginator();
1104
+ }
1105
+ componentDidLoad() {
1106
+ this.handleAutomaticBoxSelection();
1107
+ // When component is created, then the listener is set. @See clickFunction for more details
1108
+ document.addEventListener('click', this.clickFunction.bind(this));
1109
+ this.currentPage = this.pageSelected;
1110
+ if (this.multiSelection && this.selectedRowsState) {
1111
+ this.selectedRows = [];
1112
+ let selectedIds = this.selectedRowsState.split(';');
1113
+ this.selectedRows = this.data.rows.filter((r) => {
1114
+ return selectedIds.indexOf(r.id) >= 0;
1115
+ });
1116
+ }
1117
+ this.didLoadInteractables();
1118
+ this.kupDidLoad.emit({ comp: this, id: this.rootElement.id });
1119
+ this.kupManager.debug.logLoad(this, true);
1120
+ }
1121
+ componentWillRender() {
1122
+ this.kupManager.debug.logRender(this, false);
1123
+ }
1124
+ componentDidRender() {
1125
+ const root = this.rootElement.shadowRoot;
1126
+ if (root) {
1127
+ const fs = root.querySelectorAll('.f-text-field');
1128
+ for (let index = 0; index < fs.length; index++) {
1129
+ FTextFieldMDC(fs[index]);
1130
+ }
1131
+ }
1132
+ this.checkScrollOnHover();
1133
+ this.persistState();
1134
+ this.didRenderInteractables();
1135
+ this.kupManager.debug.logRender(this, true);
1136
+ }
1137
+ render() {
1138
+ const isKanban = !!(typeof this.kanban === 'object' && this.kanban !== null);
1139
+ let sortPanel = null;
1140
+ if (this.sortEnabled) {
1141
+ // creating items
1142
+ const visibleColumnsItems = this.visibleColumns.map((column) => {
1143
+ const item = {
1144
+ value: column.title,
1145
+ id: column.name,
1146
+ selected: column.name === this.sortBy,
1147
+ };
1148
+ return item;
1149
+ });
1150
+ const items = [{ value: '', id: '' }, ...visibleColumnsItems];
1151
+ let textfieldData = {
1152
+ label: this.kupManager.language.translate(KupLanguageGeneric.SORT_BY),
1153
+ trailingIcon: true,
1154
+ };
1155
+ let listData = {
1156
+ data: items,
1157
+ selectable: true,
1158
+ };
1159
+ let data = {
1160
+ 'kup-text-field': textfieldData,
1161
+ 'kup-list': listData,
1162
+ };
1163
+ sortPanel = (h("div", { id: "sort-panel" }, h("kup-combobox", { data: data, initialValue: this.sortBy, "onkup-combobox-itemclick": (e) => this.onSortChange(e) })));
1164
+ }
1165
+ let filterPanel = null;
1166
+ if (this.globalFilter) {
1167
+ filterPanel = (h("div", { id: "global-filter" }, h("kup-text-field", { fullWidth: true, label: this.kupManager.language.translate(KupLanguageSearch.SEARCH), icon: KupThemeIconValues.SEARCH, initialValue: this.globalFilterValue, "onkup-textfield-input": (event) => {
1168
+ window.clearTimeout(this.globalFilterTimeout);
1169
+ this.globalFilterTimeout = window.setTimeout(() => this.onGlobalFilterChange(event), 600);
1170
+ } })));
1171
+ }
1172
+ let paginator = null;
1173
+ if (this.pagination) {
1174
+ paginator = (h(FPaginator, { id: top ? 'top-paginator' : 'bottom-paginator', currentPage: this.currentPage, max: this.filteredRows.length, mode: FPaginatorMode.SIMPLE, perPage: this.currentRowsPerPage
1175
+ ? this.currentRowsPerPage
1176
+ : this.pageSize, onPageChange: (e) => this.handlePageChange(e.detail.value), onRowsChange: (e) => this.handleRowsPerPageChange(e.detail.value) }));
1177
+ }
1178
+ let boxContent = null;
1179
+ let containerStyle = {};
1180
+ if (this.rows.length === 0) {
1181
+ boxContent = (h("div", { id: "empty-data-message", class: "box-wrapper" }, h("div", { class: "box", ref: (el) => this.rowsRefs.push(el) }, this.kupManager.language.translate(KupLanguageGeneric.EMPTY_DATA))));
1182
+ containerStyle = { 'grid-template-columns': `repeat(1, 1fr)` };
1183
+ }
1184
+ else if (isKanban) {
1185
+ const kanban = this.kanbanMode();
1186
+ boxContent = kanban.jsx;
1187
+ containerStyle = kanban.style;
1188
+ }
1189
+ else {
1190
+ containerStyle = {
1191
+ 'grid-template-columns': `repeat(${this.columns}, 1fr)`,
1192
+ };
1193
+ const rows = this.rows;
1194
+ let size = rows.length;
1195
+ let cnt = 0;
1196
+ boxContent = [];
1197
+ while (size-- > 0) {
1198
+ boxContent.push(this.renderRow(rows[cnt++]));
1199
+ }
1200
+ }
1201
+ return (h(Host, null, h("style", null, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { id: componentWrapperId }, h("div", { class: 'box-component', ref: (el) => (this.sectionRef = el) }, sortPanel, filterPanel, paginator, h("div", { class: isKanban ? 'is-kanban' : '', id: 'box-container', style: containerStyle, onContextMenu: (e) => {
1202
+ e.preventDefault();
1203
+ }, ref: (el) => (this.boxContainer =
1204
+ el) }, boxContent)))));
1205
+ }
1206
+ disconnectedCallback() {
1207
+ this.kupManager.interact.unregister(this.interactableDrag.concat(this.interactableDrop));
1208
+ this.kupManager.language.unregister(this);
1209
+ this.kupManager.theme.unregister(this);
1210
+ if (this.scrollOnHover) {
1211
+ this.kupManager.scrollOnHover.unregister(this.boxContainer);
1212
+ }
1213
+ // When component is destroyed, then the listener is removed. @See clickFunction for more details
1214
+ document.removeEventListener('click', this.clickFunction.bind(this));
1215
+ this.kupDidUnload.emit({ comp: this, id: this.rootElement.id });
1216
+ }
1217
+ get rootElement() { return this; }
1218
+ static get watchers() { return {
1219
+ "pageSize": ["rowsPerPageHandler", "recalculateRows"],
1220
+ "globalFilterValue": ["recalculateRows"],
1221
+ "sortBy": ["recalculateRows"],
1222
+ "pagination": ["recalculateRows"],
1223
+ "currentPage": ["recalculateRows"],
1224
+ "currentRowsPerPage": ["recalculateRows"],
1225
+ "data": ["onDataChanged"],
1226
+ "layout": ["onLayoutChanged"],
1227
+ "selectBox": ["onSelectBoxChanged"]
1228
+ }; }
1229
+ static get style() { return kupBoxCss; }
1230
+ }, [1, "kup-box", {
1231
+ "cardData": [16],
1232
+ "columns": [2],
1233
+ "customStyle": [1, "custom-style"],
1234
+ "data": [16],
1235
+ "dragEnabled": [4, "drag-enabled"],
1236
+ "dropEnabled": [4, "drop-enabled"],
1237
+ "dropOnSection": [4, "drop-on-section"],
1238
+ "editableData": [4, "editable-data"],
1239
+ "enableRowActions": [4, "enable-row-actions"],
1240
+ "globalFilter": [4, "global-filter"],
1241
+ "globalFilterValue": [1537, "global-filter-value"],
1242
+ "kanban": [16],
1243
+ "layout": [16],
1244
+ "multiSelection": [4, "multi-selection"],
1245
+ "pageSelected": [2, "page-selected"],
1246
+ "pageSize": [2, "page-size"],
1247
+ "pagination": [4],
1248
+ "rowsPerPage": [2, "rows-per-page"],
1249
+ "scrollOnHover": [4, "scroll-on-hover"],
1250
+ "selectBox": [2, "select-box"],
1251
+ "selectedRowsState": [1025, "selected-rows-state"],
1252
+ "showSelection": [4, "show-selection"],
1253
+ "sortBy": [1025, "sort-by"],
1254
+ "sortEnabled": [4, "sort-enabled"],
1255
+ "stateId": [1, "state-id"],
1256
+ "store": [16],
1257
+ "swipeDisabled": [4, "swipe-disabled"],
1258
+ "collapsedSection": [32],
1259
+ "selectedRows": [32],
1260
+ "rowActionMenuOpened": [32],
1261
+ "currentPage": [32],
1262
+ "currentRowsPerPage": [32],
1263
+ "getProps": [64],
1264
+ "loadRowActions": [64],
1265
+ "refresh": [64],
1266
+ "setProps": [64]
1267
+ }]);
1268
+ function defineCustomElement() {
1269
+ if (typeof customElements === "undefined") {
1270
+ return;
1271
+ }
1272
+ const components = ["kup-box", "kup-autocomplete", "kup-badge", "kup-button", "kup-button-list", "kup-card", "kup-chart", "kup-checkbox", "kup-chip", "kup-color-picker", "kup-combobox", "kup-data-table", "kup-date-picker", "kup-dropdown-button", "kup-form", "kup-gauge", "kup-image", "kup-list", "kup-progress-bar", "kup-radio", "kup-rating", "kup-spinner", "kup-switch", "kup-tab-bar", "kup-text-field", "kup-time-picker", "kup-tree"];
1273
+ components.forEach(tagName => { switch (tagName) {
1274
+ case "kup-box":
1275
+ if (!customElements.get(tagName)) {
1276
+ customElements.define(tagName, KupBox);
1277
+ }
1278
+ break;
1279
+ case "kup-autocomplete":
1280
+ if (!customElements.get(tagName)) {
1281
+ defineCustomElement$q();
1282
+ }
1283
+ break;
1284
+ case "kup-badge":
1285
+ if (!customElements.get(tagName)) {
1286
+ defineCustomElement$p();
1287
+ }
1288
+ break;
1289
+ case "kup-button":
1290
+ if (!customElements.get(tagName)) {
1291
+ defineCustomElement$o();
1292
+ }
1293
+ break;
1294
+ case "kup-button-list":
1295
+ if (!customElements.get(tagName)) {
1296
+ defineCustomElement$n();
1297
+ }
1298
+ break;
1299
+ case "kup-card":
1300
+ if (!customElements.get(tagName)) {
1301
+ defineCustomElement$m();
1302
+ }
1303
+ break;
1304
+ case "kup-chart":
1305
+ if (!customElements.get(tagName)) {
1306
+ defineCustomElement$l();
1307
+ }
1308
+ break;
1309
+ case "kup-checkbox":
1310
+ if (!customElements.get(tagName)) {
1311
+ defineCustomElement$k();
1312
+ }
1313
+ break;
1314
+ case "kup-chip":
1315
+ if (!customElements.get(tagName)) {
1316
+ defineCustomElement$j();
1317
+ }
1318
+ break;
1319
+ case "kup-color-picker":
1320
+ if (!customElements.get(tagName)) {
1321
+ defineCustomElement$i();
1322
+ }
1323
+ break;
1324
+ case "kup-combobox":
1325
+ if (!customElements.get(tagName)) {
1326
+ defineCustomElement$h();
1327
+ }
1328
+ break;
1329
+ case "kup-data-table":
1330
+ if (!customElements.get(tagName)) {
1331
+ defineCustomElement$g();
1332
+ }
1333
+ break;
1334
+ case "kup-date-picker":
1335
+ if (!customElements.get(tagName)) {
1336
+ defineCustomElement$f();
1337
+ }
1338
+ break;
1339
+ case "kup-dropdown-button":
1340
+ if (!customElements.get(tagName)) {
1341
+ defineCustomElement$e();
1342
+ }
1343
+ break;
1344
+ case "kup-form":
1345
+ if (!customElements.get(tagName)) {
1346
+ defineCustomElement$d();
1347
+ }
1348
+ break;
1349
+ case "kup-gauge":
1350
+ if (!customElements.get(tagName)) {
1351
+ defineCustomElement$c();
1352
+ }
1353
+ break;
1354
+ case "kup-image":
1355
+ if (!customElements.get(tagName)) {
1356
+ defineCustomElement$b();
1357
+ }
1358
+ break;
1359
+ case "kup-list":
1360
+ if (!customElements.get(tagName)) {
1361
+ defineCustomElement$a();
1362
+ }
1363
+ break;
1364
+ case "kup-progress-bar":
1365
+ if (!customElements.get(tagName)) {
1366
+ defineCustomElement$9();
1367
+ }
1368
+ break;
1369
+ case "kup-radio":
1370
+ if (!customElements.get(tagName)) {
1371
+ defineCustomElement$8();
1372
+ }
1373
+ break;
1374
+ case "kup-rating":
1375
+ if (!customElements.get(tagName)) {
1376
+ defineCustomElement$7();
1377
+ }
1378
+ break;
1379
+ case "kup-spinner":
1380
+ if (!customElements.get(tagName)) {
1381
+ defineCustomElement$6();
1382
+ }
1383
+ break;
1384
+ case "kup-switch":
1385
+ if (!customElements.get(tagName)) {
1386
+ defineCustomElement$5();
1387
+ }
1388
+ break;
1389
+ case "kup-tab-bar":
1390
+ if (!customElements.get(tagName)) {
1391
+ defineCustomElement$4();
1392
+ }
1393
+ break;
1394
+ case "kup-text-field":
1395
+ if (!customElements.get(tagName)) {
1396
+ defineCustomElement$3();
1397
+ }
1398
+ break;
1399
+ case "kup-time-picker":
1400
+ if (!customElements.get(tagName)) {
1401
+ defineCustomElement$2();
1402
+ }
1403
+ break;
1404
+ case "kup-tree":
1405
+ if (!customElements.get(tagName)) {
1406
+ defineCustomElement$1();
1407
+ }
1408
+ break;
1409
+ } });
1410
+ }
1411
+
1412
+ export { KupBox as K, defineCustomElement as d };