@sme.up/ketchup 6.2.0-SNAPSHOT → 6.2.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 (154) hide show
  1. package/dist/cjs/{cell-utils-d894e802.js → cell-utils-fe64a28c.js} +2 -2
  2. package/dist/cjs/{f-button-414b3bc3.js → f-button-5b69d882.js} +1 -1
  3. package/dist/cjs/{f-cell-c8983ec7.js → f-cell-3a740c48.js} +6 -6
  4. package/dist/cjs/{f-chip-ef81bf51.js → f-chip-02e83f82.js} +2 -2
  5. package/dist/cjs/{f-image-0618c795.js → f-image-2a61ece2.js} +1 -1
  6. package/dist/cjs/{f-paginator-utils-c9dd5173.js → f-paginator-utils-09126bdd.js} +4 -4
  7. package/dist/cjs/{f-text-field-7d31190f.js → f-text-field-9ee20a67.js} +1 -1
  8. package/dist/cjs/ketchup.cjs.js +2 -2
  9. package/dist/cjs/kup-accordion.cjs.entry.js +3 -3
  10. package/dist/cjs/kup-autocomplete_25.cjs.entry.js +35 -21
  11. package/dist/cjs/kup-box.cjs.entry.js +1306 -0
  12. package/dist/cjs/kup-calendar.cjs.entry.js +6 -6
  13. package/dist/cjs/kup-cell.cjs.entry.js +7 -7
  14. package/dist/cjs/kup-dash-list.cjs.entry.js +3 -3
  15. package/dist/cjs/kup-dash_2.cjs.entry.js +2 -2
  16. package/dist/cjs/kup-dashboard.cjs.entry.js +5 -5
  17. package/dist/cjs/kup-drawer.cjs.entry.js +2 -2
  18. package/dist/cjs/{kup-box_2.cjs.entry.js → kup-echart.cjs.entry.js} +52 -1348
  19. package/dist/cjs/kup-family-tree.cjs.entry.js +410 -0
  20. package/dist/cjs/kup-form.cjs.entry.js +40 -29
  21. package/dist/cjs/kup-iframe.cjs.entry.js +2 -2
  22. package/dist/cjs/kup-image-list.cjs.entry.js +70 -9
  23. package/dist/cjs/kup-lazy.cjs.entry.js +3 -3
  24. package/dist/cjs/kup-magic-box.cjs.entry.js +3 -3
  25. package/dist/cjs/{kup-manager-2fee8cf3.js → kup-manager-02acbb37.js} +83 -1
  26. package/dist/cjs/kup-nav-bar.cjs.entry.js +2 -2
  27. package/dist/cjs/kup-numeric-picker.cjs.entry.js +2 -2
  28. package/dist/cjs/kup-photo-frame.cjs.entry.js +8 -6
  29. package/dist/cjs/kup-probe.cjs.entry.js +1 -1
  30. package/dist/cjs/kup-qlik.cjs.entry.js +1 -1
  31. package/dist/cjs/kup-snackbar.cjs.entry.js +4 -4
  32. package/dist/cjs/loader.cjs.js +2 -2
  33. package/dist/cjs/{utils-8470184d.js → utils-4b208b48.js} +1 -1
  34. package/dist/collection/assets/data-table.js +44 -0
  35. package/dist/collection/assets/family-tree.js +2437 -0
  36. package/dist/collection/assets/form.js +254 -0
  37. package/dist/collection/assets/index.js +4 -0
  38. package/dist/collection/collection-manifest.json +2 -2
  39. package/dist/collection/components/kup-button/kup-button.js +1 -0
  40. package/dist/collection/components/kup-data-table/kup-data-table-state.js +1 -1
  41. package/dist/collection/components/kup-data-table/kup-data-table.js +7 -6
  42. package/dist/collection/components/kup-dropdown-button/kup-dropdown-button.js +1 -0
  43. package/dist/collection/components/kup-family-tree/kup-family-tree-declarations.js +12 -0
  44. package/dist/collection/components/kup-family-tree/kup-family-tree.css +101 -0
  45. package/dist/collection/components/kup-family-tree/kup-family-tree.js +666 -0
  46. package/dist/collection/components/kup-form/kup-form-declarations.js +6 -0
  47. package/dist/collection/components/kup-form/kup-form.css +22 -9
  48. package/dist/collection/components/kup-form/kup-form.js +28 -49
  49. package/dist/collection/components/kup-image-list/kup-image-list-state.js +9 -0
  50. package/dist/collection/components/kup-image-list/kup-image-list.css +0 -6
  51. package/dist/collection/components/kup-image-list/kup-image-list.js +113 -1
  52. package/dist/collection/components/kup-lazy/kup-lazy.css +13 -6
  53. package/dist/collection/components/kup-photo-frame/kup-photo-frame.css +9 -2
  54. package/dist/collection/components/kup-photo-frame/kup-photo-frame.js +5 -3
  55. package/dist/collection/components/kup-tree/kup-tree.js +16 -5
  56. package/dist/collection/managers/kup-data/kup-data-node-helper.js +69 -0
  57. package/dist/collection/managers/kup-data/kup-data.js +15 -1
  58. package/dist/collection/managers/kup-theme/kup-theme-declarations.js +2 -0
  59. package/dist/collection/types/GenericTypes.js +1 -1
  60. package/dist/esm/{cell-utils-7fc84d4e.js → cell-utils-cb5d4149.js} +2 -2
  61. package/dist/esm/{f-button-2f6cc296.js → f-button-fd44ef70.js} +1 -1
  62. package/dist/esm/{f-cell-4428481c.js → f-cell-7b159a22.js} +6 -6
  63. package/dist/esm/{f-chip-b39eb49a.js → f-chip-c2e4c522.js} +2 -2
  64. package/dist/esm/{f-image-b08ebeb2.js → f-image-2ab4b9aa.js} +1 -1
  65. package/dist/esm/{f-paginator-utils-4fda6086.js → f-paginator-utils-ef537d82.js} +4 -4
  66. package/dist/esm/{f-text-field-184a5fb3.js → f-text-field-41c575eb.js} +1 -1
  67. package/dist/esm/ketchup.js +2 -2
  68. package/dist/esm/kup-accordion.entry.js +3 -3
  69. package/dist/esm/kup-autocomplete_25.entry.js +35 -21
  70. package/dist/esm/kup-box.entry.js +1302 -0
  71. package/dist/esm/kup-calendar.entry.js +6 -6
  72. package/dist/esm/kup-cell.entry.js +7 -7
  73. package/dist/esm/kup-dash-list.entry.js +3 -3
  74. package/dist/esm/kup-dash_2.entry.js +2 -2
  75. package/dist/esm/kup-dashboard.entry.js +5 -5
  76. package/dist/esm/kup-drawer.entry.js +2 -2
  77. package/dist/esm/{kup-box_2.entry.js → kup-echart.entry.js} +53 -1348
  78. package/dist/esm/kup-family-tree.entry.js +406 -0
  79. package/dist/esm/kup-form.entry.js +40 -29
  80. package/dist/esm/kup-iframe.entry.js +2 -2
  81. package/dist/esm/kup-image-list.entry.js +70 -9
  82. package/dist/esm/kup-lazy.entry.js +3 -3
  83. package/dist/esm/kup-magic-box.entry.js +3 -3
  84. package/dist/esm/{kup-manager-3325b2d8.js → kup-manager-22a475e6.js} +83 -1
  85. package/dist/esm/kup-nav-bar.entry.js +2 -2
  86. package/dist/esm/kup-numeric-picker.entry.js +2 -2
  87. package/dist/esm/kup-photo-frame.entry.js +8 -6
  88. package/dist/esm/kup-probe.entry.js +1 -1
  89. package/dist/esm/kup-qlik.entry.js +1 -1
  90. package/dist/esm/kup-snackbar.entry.js +4 -4
  91. package/dist/esm/loader.js +2 -2
  92. package/dist/esm/{utils-6373a07e.js → utils-2c1f4122.js} +1 -1
  93. package/dist/ketchup/ketchup.esm.js +1 -1
  94. package/dist/ketchup/{p-d7004ae4.js → p-06c6cc68.js} +1 -1
  95. package/dist/ketchup/{p-6127fccf.entry.js → p-0dacd4bc.entry.js} +1 -1
  96. package/dist/ketchup/{p-1db1d42b.entry.js → p-1959f835.entry.js} +1 -1
  97. package/dist/ketchup/p-1c44dc62.entry.js +1 -0
  98. package/dist/ketchup/{p-30820f8f.entry.js → p-264b1b19.entry.js} +1 -1
  99. package/dist/ketchup/{p-70660fe2.js → p-38d7584e.js} +1 -1
  100. package/dist/ketchup/{p-6b82e4e2.entry.js → p-42080355.entry.js} +1 -1
  101. package/dist/ketchup/p-4bc9f98b.entry.js +1 -0
  102. package/dist/ketchup/p-578583db.entry.js +1 -0
  103. package/dist/ketchup/{p-cc3abf84.entry.js → p-5866d507.entry.js} +1 -1
  104. package/dist/ketchup/p-61059e9d.entry.js +9 -0
  105. package/dist/ketchup/{p-175edb62.entry.js → p-664be494.entry.js} +1 -1
  106. package/dist/ketchup/{p-8103b80a.entry.js → p-67cd575d.entry.js} +1 -1
  107. package/dist/ketchup/{p-d95c904b.js → p-682a367a.js} +1 -1
  108. package/dist/ketchup/{p-153697fb.entry.js → p-6ccf7eb2.entry.js} +1 -1
  109. package/dist/ketchup/p-7230ab97.entry.js +1 -0
  110. package/dist/ketchup/p-752b4cef.entry.js +1 -0
  111. package/dist/ketchup/{p-41cf8703.entry.js → p-7de3e7ac.entry.js} +1 -1
  112. package/dist/ketchup/{p-f49cb68e.js → p-928c5c36.js} +1 -1
  113. package/dist/ketchup/{p-3c7c92c0.entry.js → p-9b36497d.entry.js} +1 -1
  114. package/dist/ketchup/{p-9fa457d4.entry.js → p-b982d137.entry.js} +1 -1
  115. package/dist/ketchup/{p-0741da57.js → p-c0219e5e.js} +1 -1
  116. package/dist/ketchup/p-c55fd0a7.entry.js +1 -0
  117. package/dist/ketchup/p-d154b3a0.entry.js +1 -0
  118. package/dist/ketchup/{p-a804fe83.entry.js → p-d2affb6f.entry.js} +1 -1
  119. package/dist/ketchup/p-d6c12c6c.js +1 -0
  120. package/dist/ketchup/{p-caabb9ab.entry.js → p-da0eab60.entry.js} +1 -1
  121. package/dist/ketchup/{p-ddce3430.js → p-dc62a30f.js} +1 -1
  122. package/dist/ketchup/p-e9366aaf.entry.js +39 -0
  123. package/dist/ketchup/{p-13e08580.js → p-edae3076.js} +1 -1
  124. package/dist/ketchup/{p-704e60eb.js → p-fc2b1229.js} +3 -3
  125. package/dist/types/components/kup-data-table/kup-data-table-state.d.ts +1 -1
  126. package/dist/types/components/kup-family-tree/kup-family-tree-declarations.d.ts +33 -0
  127. package/dist/types/components/kup-family-tree/kup-family-tree.d.ts +61 -0
  128. package/dist/types/components/kup-form/kup-form-declarations.d.ts +18 -6
  129. package/dist/types/components/kup-form/kup-form.d.ts +1 -6
  130. package/dist/types/components/kup-image-list/kup-image-list-state.d.ts +6 -0
  131. package/dist/types/components/kup-image-list/kup-image-list.d.ts +17 -0
  132. package/dist/types/components/kup-tree/kup-tree.d.ts +0 -1
  133. package/dist/types/components.d.ts +63 -97
  134. package/dist/types/managers/kup-data/kup-data-declarations.d.ts +8 -0
  135. package/dist/types/managers/kup-data/kup-data-node-helper.d.ts +15 -1
  136. package/dist/types/managers/kup-data/kup-data.d.ts +5 -1
  137. package/dist/types/types/GenericTypes.d.ts +1 -1
  138. package/package.json +2 -2
  139. package/dist/cjs/kup-field.cjs.entry.js +0 -241
  140. package/dist/collection/components/kup-field/kup-field-declarations.js +0 -15
  141. package/dist/collection/components/kup-field/kup-field.css +0 -48
  142. package/dist/collection/components/kup-field/kup-field.js +0 -514
  143. package/dist/esm/kup-field.entry.js +0 -237
  144. package/dist/ketchup/p-006bc4d0.entry.js +0 -1
  145. package/dist/ketchup/p-35325834.entry.js +0 -9
  146. package/dist/ketchup/p-359e8bec.entry.js +0 -40
  147. package/dist/ketchup/p-762c0382.entry.js +0 -1
  148. package/dist/ketchup/p-76947316.entry.js +0 -1
  149. package/dist/ketchup/p-a0ce8075.entry.js +0 -1
  150. package/dist/ketchup/p-ca9fd099.js +0 -1
  151. package/dist/ketchup/p-d2e76960.entry.js +0 -1
  152. package/dist/ketchup/p-ee580b3a.entry.js +0 -1
  153. package/dist/types/components/kup-field/kup-field-declarations.d.ts +0 -25
  154. package/dist/types/components/kup-field/kup-field.d.ts +0 -90
@@ -3,6 +3,8 @@
3
3
  * @prop --kup-form-color: Sets text color of the component.
4
4
  * @prop --kup-form-font-family: Sets font family of the component.
5
5
  * @prop --kup-form-font-size: Sets font size of the component.
6
+ * @prop --kup-form-label-alignment: Sets the text alignment of labels.
7
+ * @prop --kup-form-label-width: Sets the width of labels.
6
8
  */
7
9
  :host {
8
10
  --kup_form_background_color: var(
@@ -12,20 +14,13 @@
12
14
  --kup_form_color: var(--kup-form-color, var(--kup-text-color));
13
15
  --kup_form_font_family: var(--kup-form-font-family, var(--kup-font-family));
14
16
  --kup_form_font_size: var(--kup-form-font-size, var(--kup-font-size));
17
+ --kup_form_label_alignment: var(--kup-form-label-alignment);
18
+ --kup_form_label_width: var(--kup-form-label-width);
15
19
  display: block;
16
20
  font-family: var(--kup_form_font_family);
17
21
  font-size: var(--kup_form_font_size);
18
22
  }
19
23
 
20
- :host([label-placement=left]) .form__label {
21
- width: 0;
22
- }
23
-
24
- :host([label-placement=right]) .form__field {
25
- min-width: 200px;
26
- width: 0;
27
- }
28
-
29
24
  .form {
30
25
  background: var(--kup_form_background_color);
31
26
  color: var(--kup_form_color);
@@ -69,11 +64,29 @@
69
64
  left: 5px;
70
65
  transition: background-color 0.25s ease;
71
66
  }
67
+ .form__section--left .form__label {
68
+ width: var(--kup_form_label_width, 0);
69
+ }
70
+ .form__section--right .form__field {
71
+ min-width: 200px;
72
+ width: 0;
73
+ }
72
74
  .form__label {
73
75
  -webkit-font-smoothing: antialiased;
76
+ box-sizing: border-box;
74
77
  font-size: 0.875em;
75
78
  letter-spacing: 0.0178571429em;
76
79
  white-space: nowrap;
80
+ width: var(--kup_form_label_width);
81
+ }
82
+ .form__label--center {
83
+ text-align: var(--kup_form_label_alignment, center);
84
+ }
85
+ .form__label--left {
86
+ text-align: var(--kup_form_label_alignment, left);
87
+ }
88
+ .form__label--right {
89
+ text-align: var(--kup_form_label_alignment, right);
77
90
  }
78
91
  .form__field {
79
92
  min-height: 16px;
@@ -1,5 +1,5 @@
1
1
  import { Component, Element, forceUpdate, h, Host, Method, Prop, Watch, } from '@stencil/core';
2
- import { KupFormProps, KupFormLabelPlacement, } from './kup-form-declarations';
2
+ import { KupFormProps, KupFormLabelPlacement, KupFormLabelAlignment, } from './kup-form-declarations';
3
3
  import { kupManagerInstance, } from '../../managers/kup-manager/kup-manager';
4
4
  import { getProps, identify, setProps } from '../../utils/utils';
5
5
  import { KupLanguageGeneric } from '../../managers/kup-language/kup-language-declarations';
@@ -24,11 +24,6 @@ export class KupForm {
24
24
  * @default null
25
25
  */
26
26
  this.data = null;
27
- /**
28
- * Placement of fields' labels.
29
- * @default KupFormLabelPlacement.LEFT
30
- */
31
- this.labelPlacement = KupFormLabelPlacement.LEFT;
32
27
  /**
33
28
  * How the form will arrange its content.
34
29
  * @default null
@@ -175,6 +170,7 @@ export class KupForm {
175
170
  return h("form", { class: classObj }, formContent);
176
171
  }
177
172
  renderSection(section, parent, row, visibleColumns) {
173
+ var _a;
178
174
  let sectionContent = null;
179
175
  if (section.sections && section.sections.length > 0) {
180
176
  const sections = section.sections;
@@ -199,7 +195,7 @@ export class KupForm {
199
195
  formField: content[cnt++],
200
196
  row,
201
197
  visibleColumns,
202
- }, true);
198
+ }, section);
203
199
  let field = formField;
204
200
  if (!section.horizontal) {
205
201
  field = h("tr", null, formField);
@@ -216,12 +212,14 @@ export class KupForm {
216
212
  });
217
213
  }
218
214
  const isGrid = !!section.columns;
215
+ const labelPlacement = ((_a = section === null || section === void 0 ? void 0 : section.label) === null || _a === void 0 ? void 0 : _a.placement) || KupFormLabelPlacement.LEFT;
219
216
  const sectionClass = {
220
217
  form__section: true,
221
218
  'form__section--column': !isGrid && !section.horizontal,
222
219
  'form__section--grid': isGrid,
223
220
  'form__section--titled': !!section.title,
224
221
  'form__section--last': !section.sections || section.sections.length === 0,
222
+ [`form__section--${labelPlacement}`]: true,
225
223
  };
226
224
  const sectionStyle = section.style || {};
227
225
  if (section.dim && parent) {
@@ -241,7 +239,8 @@ export class KupForm {
241
239
  h("table", null,
242
240
  h("tbody", null, section.horizontal ? (h("tr", null, sectionContent)) : (sectionContent)))));
243
241
  }
244
- renderFormField({ formField, row, visibleColumns, }, fromSection) {
242
+ renderFormField({ formField, row, visibleColumns, }, section) {
243
+ var _a;
245
244
  const classObj = {
246
245
  form__field: true,
247
246
  };
@@ -259,7 +258,7 @@ export class KupForm {
259
258
  column = visibleColumns[index];
260
259
  visibleColumns.splice(index, 1);
261
260
  }
262
- else if (fromSection) {
261
+ else if (section) {
263
262
  column = this.data.columns.find((x) => x.name === formField.column);
264
263
  }
265
264
  const cell = row.cells[formField.column];
@@ -282,7 +281,7 @@ export class KupForm {
282
281
  return null;
283
282
  }
284
283
  const cellProps = {
285
- cell: cell,
284
+ cell: formField.data ? Object.assign(Object.assign({}, cell), { data: formField.data }) : cell,
286
285
  column: column,
287
286
  component: this,
288
287
  editable: true,
@@ -291,14 +290,15 @@ export class KupForm {
291
290
  setSizes: true,
292
291
  shape: formField.shape,
293
292
  };
293
+ const label = formField.label || column.title;
294
294
  resetLabel();
295
- switch (this.labelPlacement) {
295
+ switch ((_a = section.label) === null || _a === void 0 ? void 0 : _a.placement) {
296
296
  case KupFormLabelPlacement.BOTTOM:
297
- return [h("tr", null, fieldCell()), h("tr", null, labelCell())];
297
+ return [h("tr", null, fieldCell()), h("tr", null, labelCell(label))];
298
298
  case KupFormLabelPlacement.PLACEHOLDER:
299
299
  setPlaceholderLabel();
300
300
  case KupFormLabelPlacement.HIDDEN: {
301
- if (fromSection) {
301
+ if (section) {
302
302
  return [fieldCell()];
303
303
  }
304
304
  else {
@@ -306,27 +306,27 @@ export class KupForm {
306
306
  }
307
307
  }
308
308
  case KupFormLabelPlacement.RIGHT: {
309
- if (fromSection) {
310
- return [fieldCell(), labelCell()];
309
+ if (section) {
310
+ return [fieldCell(), labelCell(label)];
311
311
  }
312
312
  else {
313
313
  return [
314
314
  h("tr", null,
315
315
  fieldCell(),
316
- labelCell()),
316
+ labelCell(label)),
317
317
  ];
318
318
  }
319
319
  }
320
320
  case KupFormLabelPlacement.TOP:
321
- return [h("tr", null, labelCell()), h("tr", null, fieldCell())];
321
+ return [h("tr", null, labelCell(label)), h("tr", null, fieldCell())];
322
322
  default: {
323
- if (fromSection) {
324
- return [labelCell(), fieldCell()];
323
+ if (section) {
324
+ return [labelCell(label), fieldCell()];
325
325
  }
326
326
  else {
327
327
  return [
328
328
  h("tr", null,
329
- labelCell(),
329
+ labelCell(label),
330
330
  fieldCell()),
331
331
  ];
332
332
  }
@@ -335,9 +335,14 @@ export class KupForm {
335
335
  function fieldCell() {
336
336
  return (h("td", { "data-cell": cell, "data-row": row, "data-column": formField.column, class: classObj, style: styleObj, title: title }, cell && column ? (h(FCell, Object.assign({}, cellProps))) : (h("span", null, formField.value))));
337
337
  }
338
- function labelCell() {
339
- return (h("td", { class: "form__label" },
340
- h("span", null, column.title)));
338
+ function labelCell(label) {
339
+ var _a, _b, _c;
340
+ const alignment = ((_a = section === null || section === void 0 ? void 0 : section.label) === null || _a === void 0 ? void 0 : _a.alignment) || KupFormLabelAlignment.LEFT;
341
+ const style = {
342
+ width: ((_b = section === null || section === void 0 ? void 0 : section.label) === null || _b === void 0 ? void 0 : _b.width) ? (_c = section === null || section === void 0 ? void 0 : section.label) === null || _c === void 0 ? void 0 : _c.width : '',
343
+ };
344
+ return (h("td", { class: `form__label form__label--${alignment}`, style: style },
345
+ h("span", null, label)));
341
346
  }
342
347
  function resetLabel() {
343
348
  if (!cell.data) {
@@ -493,32 +498,6 @@ export class KupForm {
493
498
  },
494
499
  "defaultValue": "null"
495
500
  },
496
- "labelPlacement": {
497
- "type": "string",
498
- "mutable": false,
499
- "complexType": {
500
- "original": "KupFormLabelPlacement",
501
- "resolved": "KupFormLabelPlacement.BOTTOM | KupFormLabelPlacement.HIDDEN | KupFormLabelPlacement.LEFT | KupFormLabelPlacement.PLACEHOLDER | KupFormLabelPlacement.RIGHT | KupFormLabelPlacement.TOP",
502
- "references": {
503
- "KupFormLabelPlacement": {
504
- "location": "import",
505
- "path": "./kup-form-declarations"
506
- }
507
- }
508
- },
509
- "required": false,
510
- "optional": false,
511
- "docs": {
512
- "tags": [{
513
- "name": "default",
514
- "text": "KupFormLabelPlacement.LEFT"
515
- }],
516
- "text": "Placement of fields' labels."
517
- },
518
- "attribute": "label-placement",
519
- "reflect": true,
520
- "defaultValue": "KupFormLabelPlacement.LEFT"
521
- },
522
501
  "layout": {
523
502
  "type": "unknown",
524
503
  "mutable": false,
@@ -0,0 +1,9 @@
1
+ export class KupImageListState {
2
+ constructor() {
3
+ this.load = false;
4
+ }
5
+ toDebugString() {
6
+ // TODO
7
+ return 'image-list state';
8
+ }
9
+ }
@@ -70,14 +70,8 @@
70
70
  background-color: rgba(var(--kup_imagelist_primary_color_rgb), 0.15);
71
71
  color: var(--kup_imagelist_primary_color);
72
72
  }
73
- .navigation-bar__wrapper--active .navigation-bar__back,
74
- .navigation-bar__wrapper--active .navigation-bar__top {
75
- display: block;
76
- }
77
73
  .navigation-bar__back, .navigation-bar__top {
78
74
  --kup-button-primary-color-rgb: 0;
79
- animation: fade-in 0.375s ease-in;
80
- display: none;
81
75
  }
82
76
  .navigation-bar__title {
83
77
  border-radius: 16px;
@@ -10,7 +10,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
10
10
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
11
  };
12
12
  var _KupImageList_instances, _KupImageList_clickTimeout, _KupImageList_kupManager, _KupImageList_backProps, _KupImageList_topProps, _KupImageList_createItem, _KupImageList_createList;
13
- import { Component, Element, Event, forceUpdate, h, Host, Method, Prop, State, } from '@stencil/core';
13
+ import { Component, Element, Event, forceUpdate, h, Host, Method, Prop, State, Watch, } from '@stencil/core';
14
14
  import { MDCRipple } from '@material/ripple';
15
15
  import { kupManagerInstance, } from '../../managers/kup-manager/kup-manager';
16
16
  import { KupImageListProps, } from './kup-image-list-declarations';
@@ -22,12 +22,14 @@ import { FButtonStyling, } from '../../f-components/f-button/f-button-declaratio
22
22
  import { KupLanguageGeneric } from '../../managers/kup-language/kup-language-declarations';
23
23
  import { FCell } from '../../f-components/f-cell/f-cell';
24
24
  import { FCellPadding } from '../../f-components/f-cell/f-cell-declarations';
25
+ import { KupImageListState } from './kup-image-list-state';
25
26
  export class KupImageList {
26
27
  constructor() {
27
28
  _KupImageList_instances.add(this);
28
29
  /*-------------------------------------------------*/
29
30
  /* S t a t e s */
30
31
  /*-------------------------------------------------*/
32
+ this.state = new KupImageListState();
31
33
  this.currentNode = null;
32
34
  this.navigationBarToggled = false;
33
35
  /*-------------------------------------------------*/
@@ -49,9 +51,18 @@ export class KupImageList {
49
51
  * @default true
50
52
  */
51
53
  this.ripple = true;
54
+ /**
55
+ * An array of integers containing the path to a selected child.\
56
+ */
57
+ this.selectedNode = [];
58
+ this.stateId = '';
52
59
  /*-------------------------------------------------*/
53
60
  /* I n t e r n a l V a r i a b l e s */
54
61
  /*-------------------------------------------------*/
62
+ /**
63
+ * Instance of the KupManager class.
64
+ */
65
+ this.kupManager = kupManagerInstance();
55
66
  _KupImageList_clickTimeout.set(this, []);
56
67
  _KupImageList_kupManager.set(this, kupManagerInstance());
57
68
  _KupImageList_backProps.set(this, {
@@ -75,6 +86,32 @@ export class KupImageList {
75
86
  wrapperClass: 'navigation-bar__top',
76
87
  });
77
88
  }
89
+ initWithPersistedState() {
90
+ if (this.store && this.stateId) {
91
+ const state = this.store.getState(this.stateId);
92
+ if (state != null) {
93
+ this.currentNode =
94
+ this.kupManager.data.node.findByStrTreeNodePath(this.data, state.selectedTreeNodePath);
95
+ }
96
+ }
97
+ }
98
+ persistState() {
99
+ if (this.store && this.stateId) {
100
+ let somethingChanged = false;
101
+ let cNodeRowId = this.currentNode ? this.currentNode.id : '';
102
+ if (!this.kupManager.objects.deepEqual(this.state.selectedTreeNodePath, cNodeRowId)) {
103
+ this.state.selectedTreeNodePath = cNodeRowId;
104
+ somethingChanged = true;
105
+ }
106
+ if (!this.state.load) {
107
+ this.state.load = true;
108
+ return;
109
+ }
110
+ if (somethingChanged) {
111
+ this.store.persistState(this.stateId, this.state);
112
+ }
113
+ }
114
+ }
78
115
  onKupClick(node) {
79
116
  if (node.children && node.children.length > 0) {
80
117
  this.currentNode = node;
@@ -105,6 +142,15 @@ export class KupImageList {
105
142
  });
106
143
  }
107
144
  /*-------------------------------------------------*/
145
+ /* W a t c h e r s */
146
+ /*-------------------------------------------------*/
147
+ selectNode(newData) {
148
+ if (!newData || newData.length == 0) {
149
+ return;
150
+ }
151
+ this.currentNode = this.kupManager.data.node.find(this.data, newData);
152
+ }
153
+ /*-------------------------------------------------*/
108
154
  /* P u b l i c M e t h o d s */
109
155
  /*-------------------------------------------------*/
110
156
  /**
@@ -152,6 +198,9 @@ export class KupImageList {
152
198
  }
153
199
  }
154
200
  }
201
+ // *** Store
202
+ this.persistState();
203
+ // ***
155
204
  __classPrivateFieldGet(this, _KupImageList_kupManager, "f").debug.logRender(this, true);
156
205
  }
157
206
  render() {
@@ -253,6 +302,65 @@ export class KupImageList {
253
302
  "attribute": "ripple",
254
303
  "reflect": false,
255
304
  "defaultValue": "true"
305
+ },
306
+ "selectedNode": {
307
+ "type": "unknown",
308
+ "mutable": false,
309
+ "complexType": {
310
+ "original": "TreeNodePath",
311
+ "resolved": "number[]",
312
+ "references": {
313
+ "TreeNodePath": {
314
+ "location": "import",
315
+ "path": "../kup-tree/kup-tree-declarations"
316
+ }
317
+ }
318
+ },
319
+ "required": false,
320
+ "optional": false,
321
+ "docs": {
322
+ "tags": [],
323
+ "text": "An array of integers containing the path to a selected child.\\"
324
+ },
325
+ "defaultValue": "[]"
326
+ },
327
+ "stateId": {
328
+ "type": "string",
329
+ "mutable": false,
330
+ "complexType": {
331
+ "original": "string",
332
+ "resolved": "string",
333
+ "references": {}
334
+ },
335
+ "required": false,
336
+ "optional": false,
337
+ "docs": {
338
+ "tags": [],
339
+ "text": ""
340
+ },
341
+ "attribute": "state-id",
342
+ "reflect": false,
343
+ "defaultValue": "''"
344
+ },
345
+ "store": {
346
+ "type": "unknown",
347
+ "mutable": false,
348
+ "complexType": {
349
+ "original": "KupStore",
350
+ "resolved": "KupStore",
351
+ "references": {
352
+ "KupStore": {
353
+ "location": "import",
354
+ "path": "../kup-state/kup-store"
355
+ }
356
+ }
357
+ },
358
+ "required": false,
359
+ "optional": false,
360
+ "docs": {
361
+ "tags": [],
362
+ "text": ""
363
+ }
256
364
  }
257
365
  }; }
258
366
  static get states() { return {
@@ -400,6 +508,10 @@ export class KupImageList {
400
508
  }
401
509
  }; }
402
510
  static get elementRef() { return "rootElement"; }
511
+ static get watchers() { return [{
512
+ "propName": "selectedNode",
513
+ "methodName": "selectNode"
514
+ }]; }
403
515
  }
404
516
  _KupImageList_clickTimeout = new WeakMap(), _KupImageList_kupManager = new WeakMap(), _KupImageList_backProps = new WeakMap(), _KupImageList_topProps = new WeakMap(), _KupImageList_instances = new WeakSet(), _KupImageList_createItem = function _KupImageList_createItem(node) {
405
517
  const props = {
@@ -1,20 +1,22 @@
1
1
  /**
2
- * @prop --kup-lazy-hor-alignment: Sets the horizontal alignment of the subcomponent.
3
- * @prop --kup-lazy-ver-alignment: Sets the vertical alignment of the subcomponent.
4
2
  * @prop --kup-lazy-animation-time: Sets the duration of the animation.
3
+ * @prop --kup-lazy-hor-alignment: Sets the horizontal alignment of the subcomponent.
5
4
  * @prop --kup-lazy-placeholder-color: Sets color of the placeholder icon.
5
+ * @prop --kup-lazy-ver-alignment: Sets the vertical alignment of the subcomponent.
6
+ * @prop --kup-lazy-width: Sets the width of the component and subcomponent.
6
7
  */
7
8
  :host {
8
- --kup_lazy_hor_alignment: var(--kup-lazy-hor-alignment, center);
9
- --kup_lazy_ver_alignment: var(--kup-lazy-ver-alignment, center);
10
9
  --kup_lazy_animation_time: var(--kup-lazy-animation-time, 2s);
10
+ --kup_lazy_hor_alignment: var(--kup-lazy-hor-alignment, center);
11
11
  --kup_lazy_placeholder_color: var(
12
12
  --kup-lazy-placeholder-color,
13
13
  var(--kup-icon-color)
14
14
  );
15
+ --kup_lazy_ver_alignment: var(--kup-lazy-ver-alignment, center);
16
+ --kup_lazy_width: var(--kup-lazy-width, 100%);
15
17
  display: block;
16
18
  height: 100%;
17
- width: 100%;
19
+ width: var(--kup_lazy_width);
18
20
  position: relative;
19
21
  }
20
22
 
@@ -23,12 +25,17 @@
23
25
  display: flex;
24
26
  justify-content: var(--kup_lazy_hor_alignment);
25
27
  height: 100%;
26
- width: 100%;
28
+ width: var(--kup_lazy_width);
27
29
  }
28
30
  #kup-component kup-data-table {
29
31
  min-width: 100%;
30
32
  }
31
33
 
34
+ .kup-loaded,
35
+ .kup-to-be-loaded {
36
+ width: var(--kup_lazy_width);
37
+ }
38
+
32
39
  svg {
33
40
  fill: var(--kup_lazy_placeholder_color);
34
41
  animation: shine ease var(--kup_lazy_animation_time) infinite;
@@ -38,19 +38,26 @@ img {
38
38
  display: none;
39
39
  transition: opacity var(--kup_photoframe_fade_out_time) ease-out;
40
40
  will-change: opacity;
41
+ z-index: 1;
41
42
  }
42
43
  .placeholder--loaded {
43
44
  display: block;
44
45
  }
45
46
  .placeholder--fade-out {
46
- left: 0;
47
47
  opacity: 0;
48
48
  position: absolute;
49
- top: 0;
50
49
  }
51
50
 
52
51
  .resource {
52
+ display: none;
53
+ left: 0;
54
+ position: absolute;
55
+ top: 0;
56
+ z-index: 0;
57
+ }
58
+ .resource--fade-in {
53
59
  display: block;
60
+ position: relative;
54
61
  }
55
62
 
56
63
  /*-------------------------------------------------*/
@@ -9,7 +9,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
10
10
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11
11
  };
12
- var _KupPhotoFrame_intObserver, _KupPhotoFrame_kupManager, _KupPhotoFrame_placeholderEl, _KupPhotoFrame_renderResource, _KupPhotoFrame_wrapperEl;
12
+ var _KupPhotoFrame_intObserver, _KupPhotoFrame_kupManager, _KupPhotoFrame_placeholderEl, _KupPhotoFrame_resourceEl, _KupPhotoFrame_renderResource, _KupPhotoFrame_wrapperEl;
13
13
  import { Component, Element, Event, forceUpdate, h, Host, Prop, State, } from '@stencil/core';
14
14
  import { Method } from '@stencil/core/internal';
15
15
  import { kupManagerInstance } from '../../managers/kup-manager/kup-manager';
@@ -52,6 +52,7 @@ export class KupPhotoFrame {
52
52
  _KupPhotoFrame_intObserver.set(this, null);
53
53
  _KupPhotoFrame_kupManager.set(this, kupManagerInstance());
54
54
  _KupPhotoFrame_placeholderEl.set(this, null);
55
+ _KupPhotoFrame_resourceEl.set(this, null);
55
56
  _KupPhotoFrame_renderResource.set(this, false);
56
57
  _KupPhotoFrame_wrapperEl.set(this, null);
57
58
  }
@@ -137,8 +138,9 @@ export class KupPhotoFrame {
137
138
  id: this.rootElement.id,
138
139
  });
139
140
  } })),
140
- __classPrivateFieldGet(this, _KupPhotoFrame_renderResource, "f") ? (h("img", Object.assign({}, this.resourceAttrs, { class: "resource", onLoad: () => {
141
+ __classPrivateFieldGet(this, _KupPhotoFrame_renderResource, "f") ? (h("img", Object.assign({}, this.resourceAttrs, { class: "resource", ref: (el) => (__classPrivateFieldSet(this, _KupPhotoFrame_resourceEl, el, "f")), onLoad: () => {
141
142
  __classPrivateFieldGet(this, _KupPhotoFrame_placeholderEl, "f").classList.add('placeholder--fade-out');
143
+ __classPrivateFieldGet(this, _KupPhotoFrame_resourceEl, "f").classList.add('resource--fade-in');
142
144
  this.kupPhotoFrameResourceLoad.emit({
143
145
  comp: this,
144
146
  id: this.rootElement.id,
@@ -377,4 +379,4 @@ export class KupPhotoFrame {
377
379
  }; }
378
380
  static get elementRef() { return "rootElement"; }
379
381
  }
380
- _KupPhotoFrame_intObserver = new WeakMap(), _KupPhotoFrame_kupManager = new WeakMap(), _KupPhotoFrame_placeholderEl = new WeakMap(), _KupPhotoFrame_renderResource = new WeakMap(), _KupPhotoFrame_wrapperEl = new WeakMap();
382
+ _KupPhotoFrame_intObserver = new WeakMap(), _KupPhotoFrame_kupManager = new WeakMap(), _KupPhotoFrame_placeholderEl = new WeakMap(), _KupPhotoFrame_resourceEl = new WeakMap(), _KupPhotoFrame_renderResource = new WeakMap(), _KupPhotoFrame_wrapperEl = new WeakMap();
@@ -174,7 +174,6 @@ export class KupTree {
174
174
  * Reference to the column menu card.
175
175
  */
176
176
  this.columnMenuCard = null;
177
- this.selectedColumn = '';
178
177
  this.clickTimeout = [];
179
178
  this.sizedColumns = undefined;
180
179
  this.filtersColumnMenuInstance = new FiltersColumnMenu();
@@ -659,6 +658,12 @@ export class KupTree {
659
658
  KupTreeExpansionMode.DROPDOWN ||
660
659
  (this.expansionMode.toLowerCase() === KupTreeExpansionMode.NODE &&
661
660
  !treeNodeData.expandable)) {
661
+ const td = e
662
+ ? this.getEventPath(e.target).find((el) => {
663
+ if (el.tagName === 'TD')
664
+ return el;
665
+ })
666
+ : null;
662
667
  // If this TreeNode is not disabled, then it can be selected and an event is emitted
663
668
  if (treeNodeData && !treeNodeData.disabled) {
664
669
  if (this.autoSelectionNodeMode)
@@ -672,11 +677,10 @@ export class KupTree {
672
677
  .split(',')
673
678
  .map((treeNodeIndex) => parseInt(treeNodeIndex)),
674
679
  treeNode: treeNodeData,
675
- columnName: this.selectedColumn,
680
+ columnName: td ? td.dataset.column : null,
676
681
  auto: auto,
677
682
  });
678
683
  }
679
- this.selectedColumn = '';
680
684
  }
681
685
  // If KupTreeExpansionMode.NODE then click is a collapse/expand click
682
686
  if (this.expansionMode.toLowerCase() === KupTreeExpansionMode.NODE) {
@@ -1014,13 +1018,20 @@ export class KupTree {
1014
1018
  }
1015
1019
  // When can be expanded OR selected
1016
1020
  if (!treeNodeData.disabled) {
1017
- treeNodeOptions['onClick'] = () => {
1018
- this.clickTimeout.push(setTimeout((e) => this.hdlTreeNodeClick(e, treeNodeData, treeNodePath, false), 300));
1021
+ treeNodeOptions['onClick'] = (e) => {
1022
+ // Note: event must be cloned
1023
+ // otherwise inside setTimeout will be exiting the Shadow DOM scope(causing loss of information, including target).
1024
+ const clone = {};
1025
+ for (const key in e) {
1026
+ clone[key] = e[key];
1027
+ }
1028
+ this.clickTimeout.push(setTimeout(() => this.hdlTreeNodeClick(clone, treeNodeData, treeNodePath, false), 300));
1019
1029
  };
1020
1030
  }
1021
1031
  // When a tree node is displayed as a table
1022
1032
  let treeNodeCells = null;
1023
1033
  let visibleCols = this.getVisibleColumns();
1034
+ const _hasTooltip = !this.kupManager.objects.isEmptyKupObj(treeNodeData.obj);
1024
1035
  if (this.showColumns && visibleCols && visibleCols.length) {
1025
1036
  treeNodeCells = [];
1026
1037
  // Renders all the cells