@sme.up/ketchup 9.6.0 → 9.6.1

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 (66) hide show
  1. package/dist/cjs/{f-paginator-utils-67dbc14c.js → f-paginator-utils-f32382f6.js} +4 -4
  2. package/dist/cjs/ketchup.cjs.js +1 -1
  3. package/dist/cjs/kup-autocomplete_27.cjs.entry.js +1 -1
  4. package/dist/cjs/kup-box.cjs.entry.js +70 -8
  5. package/dist/cjs/kup-calendar.cjs.entry.js +4 -2
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/assets/index.js +4 -0
  8. package/dist/collection/assets/planner-example-4.js +4 -4
  9. package/dist/collection/assets/planner-example-5.js +3175 -0
  10. package/dist/collection/components/kup-box/kup-box-declarations.js +11 -0
  11. package/dist/collection/components/kup-box/kup-box-state.js +2 -0
  12. package/dist/collection/components/kup-box/kup-box.js +169 -9
  13. package/dist/collection/components/kup-calendar/kup-calendar.js +4 -2
  14. package/dist/components/kup-autocomplete2.js +1 -1
  15. package/dist/components/kup-box2.js +74 -8
  16. package/dist/components/kup-button-list.js +1 -1
  17. package/dist/components/kup-button.js +1 -1
  18. package/dist/components/kup-calendar.js +5 -3
  19. package/dist/components/kup-card.js +1 -1
  20. package/dist/components/kup-chart.js +1 -1
  21. package/dist/components/kup-checkbox.js +1 -1
  22. package/dist/components/kup-chip.js +1 -1
  23. package/dist/components/kup-color-picker.js +1 -1
  24. package/dist/components/kup-combobox.js +1 -1
  25. package/dist/components/kup-dashboard.js +1 -1
  26. package/dist/components/kup-data-table.js +1 -1
  27. package/dist/components/kup-date-picker.js +1 -1
  28. package/dist/components/kup-dialog.js +1 -1
  29. package/dist/components/kup-dropdown-button.js +1 -1
  30. package/dist/components/kup-family-tree.js +1 -1
  31. package/dist/components/kup-form.js +1 -1
  32. package/dist/components/kup-gauge.js +1 -1
  33. package/dist/components/kup-image-list.js +1 -1
  34. package/dist/components/kup-image.js +1 -1
  35. package/dist/components/kup-list.js +1 -1
  36. package/dist/components/kup-magic-box.js +1 -1
  37. package/dist/components/kup-numeric-picker.js +1 -1
  38. package/dist/components/kup-planner.js +1 -1
  39. package/dist/components/kup-progress-bar.js +1 -1
  40. package/dist/components/kup-radio.js +1 -1
  41. package/dist/components/kup-rating.js +1 -1
  42. package/dist/components/kup-snackbar.js +1 -1
  43. package/dist/components/kup-spinner.js +1 -1
  44. package/dist/components/kup-switch.js +1 -1
  45. package/dist/components/kup-tab-bar.js +1 -1
  46. package/dist/components/kup-text-field.js +1 -1
  47. package/dist/components/kup-time-picker.js +1 -1
  48. package/dist/components/kup-tree.js +1 -1
  49. package/dist/esm/{f-paginator-utils-f5f4c666.js → f-paginator-utils-10fa5a7d.js} +1 -1
  50. package/dist/esm/ketchup.js +1 -1
  51. package/dist/esm/kup-autocomplete_27.entry.js +1 -1
  52. package/dist/esm/kup-box.entry.js +70 -8
  53. package/dist/esm/kup-calendar.entry.js +4 -2
  54. package/dist/esm/loader.js +1 -1
  55. package/dist/ketchup/ketchup.esm.js +1 -1
  56. package/dist/ketchup/p-060ae996.entry.js +1 -0
  57. package/dist/ketchup/{p-b086727d.entry.js → p-11d5400a.entry.js} +1 -1
  58. package/dist/ketchup/{p-6001882e.entry.js → p-b3067fd0.entry.js} +1 -1
  59. package/dist/ketchup/{p-68e9379a.js → p-dba484b8.js} +1 -1
  60. package/dist/types/components/kup-box/kup-box-declarations.d.ts +12 -0
  61. package/dist/types/components/kup-box/kup-box-state.d.ts +2 -0
  62. package/dist/types/components/kup-box/kup-box.d.ts +26 -1
  63. package/dist/types/components/kup-calendar/kup-calendar-declarations.d.ts +1 -0
  64. package/dist/types/components.d.ts +48 -6
  65. package/package.json +1 -1
  66. package/dist/ketchup/p-d1268ac7.entry.js +0 -1
@@ -17,6 +17,9 @@ export var KupBoxProps;
17
17
  KupBoxProps["kanban"] = "Displays the boxlist as a Kanban.";
18
18
  KupBoxProps["layout"] = "How the field will be displayed. If not present, a default one will be created.";
19
19
  KupBoxProps["lazyLoadRows"] = "When set to true, extra rows will be automatically loaded once the last row enters the viewport.";
20
+ KupBoxProps["loadMoreLimit"] = "Sets a maximum limit of new records which can be required by the load more functionality.";
21
+ KupBoxProps["loadMoreMode"] = "Establish the modality of how many new records will be downloaded. This property is regulated also by loadMoreStep.";
22
+ KupBoxProps["loadMoreStep"] = "The number of records which will be requested to be downloaded when clicking on the load more button. This property is regulated also by loadMoreMode.";
20
23
  KupBoxProps["multiSelection"] = "Enable multi selection.";
21
24
  KupBoxProps["pageSelected"] = "Current page number.";
22
25
  KupBoxProps["pagination"] = "Enables pagination.";
@@ -24,6 +27,7 @@ export var KupBoxProps;
24
27
  KupBoxProps["scrollOnHover"] = "Activates the scroll on hover function.";
25
28
  KupBoxProps["selectBox"] = "Automatically selects the box at the specified index.";
26
29
  KupBoxProps["selectedRowsState"] = "Multiple selection.";
30
+ KupBoxProps["showLoadMore"] = "If set to true, displays the button to load more records.";
27
31
  KupBoxProps["showSelection"] = "If enabled, highlights the selected box/boxes.";
28
32
  KupBoxProps["sortBy"] = "If sorting is enabled, specifies which column to sort.";
29
33
  KupBoxProps["sortEnabled"] = "Enable sorting.";
@@ -31,3 +35,10 @@ export var KupBoxProps;
31
35
  KupBoxProps["store"] = "";
32
36
  KupBoxProps["swipeDisabled"] = "Disable swipe.";
33
37
  })(KupBoxProps || (KupBoxProps = {}));
38
+ //---- *NEXT functionality AKA load more ----
39
+ export var LoadMoreMode;
40
+ (function (LoadMoreMode) {
41
+ LoadMoreMode["CONSTANT"] = "constant";
42
+ LoadMoreMode["CONSTANT_INCREMENT"] = "constant_increment";
43
+ LoadMoreMode["PROGRESSIVE_THRESHOLD"] = "progressive_threshold";
44
+ })(LoadMoreMode || (LoadMoreMode = {}));
@@ -6,6 +6,8 @@ export class KupBoxState {
6
6
  this.pageSelected = 1;
7
7
  this.rowsPerPage = 0;
8
8
  this.load = false;
9
+ this.loadMoreLimit = 1000;
10
+ this.showLoadMore = false;
9
11
  }
10
12
  /*Add attribute*/
11
13
  toDebugString() {
@@ -14,10 +14,10 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
14
14
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
15
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
16
  };
17
- var _KupBox_instances, _KupBox_intObserver, _KupBox_rowsRefs, _KupBox_navBarHeight, _KupBox_didRenderObservers, _KupBox_setObserver;
17
+ var _KupBox_instances, _KupBox_intObserver, _KupBox_rowsRefs, _KupBox_navBarHeight, _KupBox_loadMoreEventCounter, _KupBox_loadMoreEventPreviousQuantity, _KupBox_didRenderObservers, _KupBox_setObserver, _KupBox_onLoadMoreClick;
18
18
  import { forceUpdate, h, Host, } from "@stencil/core";
19
19
  import { SortMode, } from "../kup-data-table/kup-data-table-declarations";
20
- import { KupBoxProps, } from "./kup-box-declarations";
20
+ import { KupBoxProps, LoadMoreMode, } from "./kup-box-declarations";
21
21
  import { getColumnByName } from "../../utils/cell-utils";
22
22
  import { filterRows, sortRows, paginateRows, } from "../kup-data-table/kup-data-table-helper";
23
23
  import { kupManagerInstance, } from "../../managers/kup-manager/kup-manager";
@@ -32,7 +32,6 @@ import { KupThemeIconValues } from "../../managers/kup-theme/kup-theme-declarati
32
32
  import { KupDragEffect, kupDraggableAttr, KupDropEventTypes, KupPointerEventTypes, } from "../../managers/kup-interact/kup-interact-declarations";
33
33
  import { FCell } from "../../f-components/f-cell/f-cell";
34
34
  import { FPaginator } from "../../f-components/f-paginator/f-paginator";
35
- import { FPaginatorMode } from "../../f-components/f-paginator/f-paginator-declarations";
36
35
  import { pageChange, rowsPerPageChange, } from "../../f-components/f-paginator/f-paginator-utils";
37
36
  import { FTextFieldMDC } from "../../f-components/f-text-field/f-text-field-mdc";
38
37
  export class KupBox {
@@ -58,6 +57,8 @@ export class KupBox {
58
57
  _KupBox_intObserver.set(this, undefined);
59
58
  _KupBox_rowsRefs.set(this, []);
60
59
  _KupBox_navBarHeight.set(this, 0);
60
+ _KupBox_loadMoreEventCounter.set(this, 0);
61
+ _KupBox_loadMoreEventPreviousQuantity.set(this, 0);
61
62
  this.collapsedSection = {};
62
63
  this.selectedRows = [];
63
64
  this.rowActionMenuOpened = undefined;
@@ -77,6 +78,9 @@ export class KupBox {
77
78
  this.kanban = null;
78
79
  this.layout = undefined;
79
80
  this.lazyLoadRows = false;
81
+ this.loadMoreLimit = 1000;
82
+ this.loadMoreMode = LoadMoreMode.PROGRESSIVE_THRESHOLD;
83
+ this.loadMoreStep = 60;
80
84
  this.multiSelection = false;
81
85
  this.pageSelected = 1;
82
86
  this.pagination = false;
@@ -84,6 +88,7 @@ export class KupBox {
84
88
  this.scrollOnHover = false;
85
89
  this.selectBox = undefined;
86
90
  this.selectedRowsState = undefined;
91
+ this.showLoadMore = false;
87
92
  this.showSelection = true;
88
93
  this.sortBy = undefined;
89
94
  this.sortEnabled = false;
@@ -105,6 +110,8 @@ export class KupBox {
105
110
  this.selectedRowsState = this.state.selectedRowsState;
106
111
  this.pageSelected = this.state.pageSelected;
107
112
  this.rowsPerPage = this.state.rowsPerPage;
113
+ this.loadMoreLimit = state.loadMoreLimit;
114
+ this.showLoadMore = state.showLoadMore;
108
115
  }
109
116
  }
110
117
  }
@@ -135,6 +142,14 @@ export class KupBox {
135
142
  this.state.selectedRowsState = selectedRowsState;
136
143
  somethingChanged = true;
137
144
  }
145
+ if (!this.kupManager.objects.deepEqual(this.state.loadMoreLimit, this.loadMoreLimit)) {
146
+ this.state.loadMoreLimit = this.loadMoreLimit;
147
+ somethingChanged = true;
148
+ }
149
+ if (!this.kupManager.objects.deepEqual(this.state.showLoadMore, this.showLoadMore)) {
150
+ this.state.showLoadMore = this.showLoadMore;
151
+ somethingChanged = true;
152
+ }
138
153
  if (!this.state.load) {
139
154
  this.state.load = true;
140
155
  return;
@@ -1164,10 +1179,18 @@ export class KupBox {
1164
1179
  } })));
1165
1180
  }
1166
1181
  let paginator = null;
1167
- if (!this.lazyLoadRows && this.pagination) {
1168
- paginator = (h(FPaginator, { id: top ? 'top-paginator' : 'bottom-paginator', currentPage: this.currentPage, max: this.filteredRows.length, mode: FPaginatorMode.SIMPLE, perPage: this.currentRowsPerPage
1182
+ // paginaltorPos prop not managed yet
1183
+ const top = true;
1184
+ if (this.showLoadMore || (!this.lazyLoadRows && this.pagination)) {
1185
+ paginator = (h(FPaginator, { id: top ? 'top-paginator' : 'bottom-paginator', currentPage: this.currentPage, max: this.filteredRows.length,
1186
+ // mode={FPaginatorMode.SIMPLE}
1187
+ perPage: this.currentRowsPerPage
1169
1188
  ? this.currentRowsPerPage
1170
- : this.rowsPerPage, onPageChange: (e) => this.handlePageChange(e.detail.value), onRowsChange: (e) => this.handleRowsPerPageChange(e.detail.value) }));
1189
+ : this.rowsPerPage, onLoadMore: this.showLoadMore
1190
+ ? () => {
1191
+ __classPrivateFieldGet(this, _KupBox_instances, "m", _KupBox_onLoadMoreClick).call(this);
1192
+ }
1193
+ : null, onNextPage: () => this.handlePageChange(this.currentPage + 1), onPrevPage: () => this.handlePageChange(this.currentPage - 1), onPageChange: (e) => this.handlePageChange(e.detail.value), onRowsChange: (e) => this.handleRowsPerPageChange(e.detail.value) }));
1171
1194
  }
1172
1195
  let boxContent = null;
1173
1196
  let containerStyle = {};
@@ -1531,6 +1554,78 @@ export class KupBox {
1531
1554
  "reflect": false,
1532
1555
  "defaultValue": "false"
1533
1556
  },
1557
+ "loadMoreLimit": {
1558
+ "type": "number",
1559
+ "mutable": false,
1560
+ "complexType": {
1561
+ "original": "number",
1562
+ "resolved": "number",
1563
+ "references": {}
1564
+ },
1565
+ "required": false,
1566
+ "optional": false,
1567
+ "docs": {
1568
+ "tags": [],
1569
+ "text": "Sets a maximum limit of new records which can be required by the load more functionality."
1570
+ },
1571
+ "attribute": "load-more-limit",
1572
+ "reflect": false,
1573
+ "defaultValue": "1000"
1574
+ },
1575
+ "loadMoreMode": {
1576
+ "type": "string",
1577
+ "mutable": false,
1578
+ "complexType": {
1579
+ "original": "LoadMoreMode",
1580
+ "resolved": "LoadMoreMode.CONSTANT | LoadMoreMode.CONSTANT_INCREMENT | LoadMoreMode.PROGRESSIVE_THRESHOLD",
1581
+ "references": {
1582
+ "LoadMoreMode": {
1583
+ "location": "import",
1584
+ "path": "./kup-box-declarations",
1585
+ "id": "src/components/kup-box/kup-box-declarations.ts::LoadMoreMode"
1586
+ }
1587
+ }
1588
+ },
1589
+ "required": false,
1590
+ "optional": false,
1591
+ "docs": {
1592
+ "tags": [{
1593
+ "name": "see",
1594
+ "text": "loadMoreStep *"
1595
+ }, {
1596
+ "name": "see",
1597
+ "text": "loadMoreLimit"
1598
+ }],
1599
+ "text": "Establish the modality of how many new records will be downloaded.\r\n\r\nThis property is regulated also by loadMoreStep."
1600
+ },
1601
+ "attribute": "load-more-mode",
1602
+ "reflect": false,
1603
+ "defaultValue": "LoadMoreMode.PROGRESSIVE_THRESHOLD"
1604
+ },
1605
+ "loadMoreStep": {
1606
+ "type": "number",
1607
+ "mutable": false,
1608
+ "complexType": {
1609
+ "original": "number",
1610
+ "resolved": "number",
1611
+ "references": {}
1612
+ },
1613
+ "required": false,
1614
+ "optional": false,
1615
+ "docs": {
1616
+ "tags": [{
1617
+ "name": "see",
1618
+ "text": "loadMoreMode *"
1619
+ }, {
1620
+ "name": "see",
1621
+ "text": "loadMoreLimit"
1622
+ }],
1623
+ "text": "The number of records which will be requested to be downloaded when clicking on the load more button.\r\n\r\nThis property is regulated also by loadMoreMode."
1624
+ },
1625
+ "attribute": "load-more-step",
1626
+ "reflect": false,
1627
+ "defaultValue": "60"
1628
+ },
1534
1629
  "multiSelection": {
1535
1630
  "type": "boolean",
1536
1631
  "mutable": false,
@@ -1675,6 +1770,24 @@ export class KupBox {
1675
1770
  "attribute": "selected-rows-state",
1676
1771
  "reflect": false
1677
1772
  },
1773
+ "showLoadMore": {
1774
+ "type": "boolean",
1775
+ "mutable": false,
1776
+ "complexType": {
1777
+ "original": "boolean",
1778
+ "resolved": "boolean",
1779
+ "references": {}
1780
+ },
1781
+ "required": false,
1782
+ "optional": false,
1783
+ "docs": {
1784
+ "tags": [],
1785
+ "text": "If set to true, displays the button to load more records."
1786
+ },
1787
+ "attribute": "show-load-more",
1788
+ "reflect": false,
1789
+ "defaultValue": "false"
1790
+ },
1678
1791
  "showSelection": {
1679
1792
  "type": "boolean",
1680
1793
  "mutable": false,
@@ -1977,6 +2090,27 @@ export class KupBox {
1977
2090
  }
1978
2091
  }
1979
2092
  }
2093
+ }, {
2094
+ "method": "kupLoadMoreClick",
2095
+ "name": "kup-box-loadmoreclick",
2096
+ "bubbles": true,
2097
+ "cancelable": false,
2098
+ "composed": true,
2099
+ "docs": {
2100
+ "tags": [],
2101
+ "text": ""
2102
+ },
2103
+ "complexType": {
2104
+ "original": "KupBoxLoadMoreClickEventPayload",
2105
+ "resolved": "KupBoxLoadMoreClickEventPayload",
2106
+ "references": {
2107
+ "KupBoxLoadMoreClickEventPayload": {
2108
+ "location": "import",
2109
+ "path": "./kup-box-declarations",
2110
+ "id": "src/components/kup-box/kup-box-declarations.ts::KupBoxLoadMoreClickEventPayload"
2111
+ }
2112
+ }
2113
+ }
1980
2114
  }];
1981
2115
  }
1982
2116
  static get methods() {
@@ -2131,7 +2265,7 @@ export class KupBox {
2131
2265
  }];
2132
2266
  }
2133
2267
  }
2134
- _KupBox_intObserver = new WeakMap(), _KupBox_rowsRefs = new WeakMap(), _KupBox_navBarHeight = new WeakMap(), _KupBox_instances = new WeakSet(), _KupBox_didRenderObservers = function _KupBox_didRenderObservers() {
2268
+ _KupBox_intObserver = new WeakMap(), _KupBox_rowsRefs = new WeakMap(), _KupBox_navBarHeight = new WeakMap(), _KupBox_loadMoreEventCounter = new WeakMap(), _KupBox_loadMoreEventPreviousQuantity = new WeakMap(), _KupBox_instances = new WeakSet(), _KupBox_didRenderObservers = function _KupBox_didRenderObservers() {
2135
2269
  if (this.lazyLoadRows &&
2136
2270
  this.currentRowsPerPage < this.data.rows.length) {
2137
2271
  __classPrivateFieldGet(this, _KupBox_intObserver, "f").observe(__classPrivateFieldGet(this, _KupBox_rowsRefs, "f")[__classPrivateFieldGet(this, _KupBox_rowsRefs, "f").length - 1]);
@@ -2142,11 +2276,11 @@ _KupBox_intObserver = new WeakMap(), _KupBox_rowsRefs = new WeakMap(), _KupBox_n
2142
2276
  if (entry.isIntersecting) {
2143
2277
  this.kupManager.debug.logMessage(this, 'Last row entering the viewport, loading more elements.');
2144
2278
  const delta = this.data.rows.length - this.currentRowsPerPage;
2145
- if (delta < 10) {
2279
+ if (delta < this.loadMoreStep) {
2146
2280
  this.currentRowsPerPage += delta;
2147
2281
  }
2148
2282
  else {
2149
- this.currentRowsPerPage += 10;
2283
+ this.currentRowsPerPage += this.loadMoreStep;
2150
2284
  }
2151
2285
  entry.target.classList.remove('last-row');
2152
2286
  __classPrivateFieldGet(this, _KupBox_intObserver, "f").unobserve(entry.target);
@@ -2158,4 +2292,30 @@ _KupBox_intObserver = new WeakMap(), _KupBox_rowsRefs = new WeakMap(), _KupBox_n
2158
2292
  rootMargin: '-' + __classPrivateFieldGet(this, _KupBox_navBarHeight, "f") + 'px 0px 0px 0px',
2159
2293
  };
2160
2294
  __classPrivateFieldSet(this, _KupBox_intObserver, new IntersectionObserver(callback, options), "f");
2295
+ }, _KupBox_onLoadMoreClick = function _KupBox_onLoadMoreClick() {
2296
+ var _a;
2297
+ let loadItems = 0;
2298
+ switch (this.loadMoreMode) {
2299
+ case LoadMoreMode.CONSTANT:
2300
+ loadItems = this.loadMoreStep;
2301
+ break;
2302
+ case LoadMoreMode.CONSTANT_INCREMENT:
2303
+ loadItems =
2304
+ this.loadMoreStep * (__classPrivateFieldGet(this, _KupBox_loadMoreEventCounter, "f") + 1);
2305
+ break;
2306
+ case LoadMoreMode.PROGRESSIVE_THRESHOLD:
2307
+ loadItems =
2308
+ Math.max(__classPrivateFieldGet(this, _KupBox_loadMoreEventPreviousQuantity, "f"), this.loadMoreStep) * Math.min(__classPrivateFieldGet(this, _KupBox_loadMoreEventCounter, "f") + 1, 2);
2309
+ break;
2310
+ }
2311
+ if (loadItems > this.loadMoreLimit) {
2312
+ loadItems = this.loadMoreLimit;
2313
+ }
2314
+ this.kupLoadMoreClick.emit({
2315
+ comp: this,
2316
+ id: this.rootElement.id,
2317
+ loadItems: loadItems,
2318
+ });
2319
+ __classPrivateFieldSet(this, _KupBox_loadMoreEventPreviousQuantity, loadItems, "f");
2320
+ __classPrivateFieldSet(this, _KupBox_loadMoreEventCounter, (_a = __classPrivateFieldGet(this, _KupBox_loadMoreEventCounter, "f"), _a++, _a), "f");
2161
2321
  };
@@ -138,6 +138,7 @@ export class KupCalendar {
138
138
  }
139
139
  },
140
140
  eventDrop: ({ event, oldEvent }) => {
141
+ var _a;
141
142
  this.kupCalendarEventDrop.emit({
142
143
  comp: this,
143
144
  id: this.rootElement.id,
@@ -149,6 +150,7 @@ export class KupCalendar {
149
150
  start: event.start,
150
151
  end: event.end,
151
152
  },
153
+ row: (_a = oldEvent.extendedProps) === null || _a === void 0 ? void 0 : _a.row,
152
154
  });
153
155
  },
154
156
  events: this.getEvents(),
@@ -355,11 +357,11 @@ export class KupCalendar {
355
357
  this.kupManager.debug.logRender(this, true);
356
358
  }
357
359
  render() {
358
- return (h(Host, { key: '81ca54ecc64da284ef682bb11afdcf8ce4d30667' }, h("style", { key: '2a65b0d79e2d0b3356347657c4cbb50afbf13eaf' }, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { key: '5a1efc80bc76c8bf6163acfd9e7ed1ba49d9f124', id: componentWrapperId }, h("div", { key: '975f9f451d580535f80602c2ef1de548f24797c6', class: "navigation" }, !this.hideNavigation ? (h("div", { class: "navigation__left" }, h(FButton, { icon: "chevron_left", onClick: () => this.onPrev(), title: this.kupManager.language.translate(KupLanguageGeneric.PREVIOUS), wrapperClass: "navigation__prev" }), h(FButton, { icon: "calendar", onClick: () => this.onToday(), title: this.kupManager.language.translate(KupLanguageGeneric.TODAY), wrapperClass: "navigation__today" }), h(FButton, { icon: "chevron_right", onClick: () => this.onNext(), title: this.kupManager.language.translate(KupLanguageGeneric.NEXT), wrapperClass: "navigation__next" }))) : null, h("div", { key: 'ca9fb802c7820068a9b5f482e751606f90db72c4', class: `navigation__title ${this.hideNavigation
360
+ return (h(Host, { key: '256712f0367d8a4979fbe5cf01230ef6919cbe30' }, h("style", { key: '483bc12677fbf0feb94f0322d050d3e92b76aa96' }, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { key: 'd396f95087febb8439ba747250dbde5c966664a9', id: componentWrapperId }, h("div", { key: '218107d205ccc74759b902682fbb4ffc38b4e6af', class: "navigation" }, !this.hideNavigation ? (h("div", { class: "navigation__left" }, h(FButton, { icon: "chevron_left", onClick: () => this.onPrev(), title: this.kupManager.language.translate(KupLanguageGeneric.PREVIOUS), wrapperClass: "navigation__prev" }), h(FButton, { icon: "calendar", onClick: () => this.onToday(), title: this.kupManager.language.translate(KupLanguageGeneric.TODAY), wrapperClass: "navigation__today" }), h(FButton, { icon: "chevron_right", onClick: () => this.onNext(), title: this.kupManager.language.translate(KupLanguageGeneric.NEXT), wrapperClass: "navigation__next" }))) : null, h("div", { key: '35207cde78644377b8a90dc0798da7cb3a8fb028', class: `navigation__title ${this.hideNavigation
359
361
  ? 'navigation__title--centered'
360
362
  : ''}`, ref: (el) => {
361
363
  this.navTitle = el;
362
- } }), !this.hideNavigation ? (h("div", { class: "navigation__right" }, h(FChip, Object.assign({}, this.setChipProps())))) : null), h("div", { key: '0b19f1dad2e7236feecd159ac0421b521bf72a04', class: "calendar", ref: (el) => (this.calendarContainer = el) }))));
364
+ } }), !this.hideNavigation ? (h("div", { class: "navigation__right" }, h(FChip, Object.assign({}, this.setChipProps())))) : null), h("div", { key: '0cc18bfc6befd69d45d4ba0c119fc5a4c2437d36', class: "calendar", ref: (el) => (this.calendarContainer = el) }))));
363
365
  }
364
366
  disconnectedCallback() {
365
367
  if (this.calendar) {
@@ -28810,4 +28810,4 @@ function defineCustomElement() {
28810
28810
  } });
28811
28811
  }
28812
28812
 
28813
- export { FCheckbox as $, defineCustomElement$1 as A, defineCustomElement as B, KupBadge as C, filterRows as D, paginateRows as E, FImage as F, sortRows as G, pageChange as H, rowsPerPageChange as I, FCell as J, KupAutocomplete as K, FChip as L, MDCRipple as M, FTextFieldMDC as N, FPaginator as O, FPaginatorMode as P, KupButton as Q, KupButtonList as R, FButton as S, FChipType as T, KupCard as U, KupChart as V, KupCheckbox as W, KupChip as X, KupColorPicker as Y, KupCombobox as Z, FTextField as _, defineCustomElement$o as a, KupDataTable as a0, KupDatePicker as a1, KupDialog as a2, KupDropdownButton as a3, FButtonStyling as a4, KupForm as a5, KupGauge as a6, KupImage as a7, KupList as a8, KupProgressBar as a9, KupRadio as aa, KupRating as ab, KupSpinner as ac, KupSwitch as ad, KupTabBar as ae, KupTextField as af, KupTimePicker as ag, KupTree as ah, defineCustomElement$n as b, componentWrapperId as c, defineCustomElement$q as d, defineCustomElement$m as e, defineCustomElement$l as f, defineCustomElement$k as g, defineCustomElement$j as h, defineCustomElement$p as i, defineCustomElement$i as j, defineCustomElement$h as k, defineCustomElement$g as l, defineCustomElement$f as m, defineCustomElement$b as n, defineCustomElement$e as o, defineCustomElement$d as p, defineCustomElement$c as q, defineCustomElement$a as r, defineCustomElement$9 as s, defineCustomElement$8 as t, defineCustomElement$7 as u, defineCustomElement$6 as v, defineCustomElement$5 as w, defineCustomElement$4 as x, defineCustomElement$3 as y, defineCustomElement$2 as z };
28813
+ export { KupDataTable as $, defineCustomElement$1 as A, defineCustomElement as B, KupBadge as C, filterRows as D, paginateRows as E, FImage as F, sortRows as G, pageChange as H, rowsPerPageChange as I, FCell as J, KupAutocomplete as K, FChip as L, MDCRipple as M, FTextFieldMDC as N, FPaginator as O, KupButton as P, KupButtonList as Q, FButton as R, FChipType as S, KupCard as T, KupChart as U, KupCheckbox as V, KupChip as W, KupColorPicker as X, KupCombobox as Y, FTextField as Z, FCheckbox as _, defineCustomElement$o as a, KupDatePicker as a0, KupDialog as a1, KupDropdownButton as a2, FButtonStyling as a3, KupForm as a4, KupGauge as a5, KupImage as a6, KupList as a7, KupProgressBar as a8, KupRadio as a9, KupRating as aa, KupSpinner as ab, KupSwitch as ac, KupTabBar as ad, KupTextField as ae, KupTimePicker as af, KupTree as ag, defineCustomElement$n as b, componentWrapperId as c, defineCustomElement$q as d, defineCustomElement$m as e, defineCustomElement$l as f, defineCustomElement$k as g, defineCustomElement$j as h, defineCustomElement$p as i, defineCustomElement$i as j, defineCustomElement$h as k, defineCustomElement$g as l, defineCustomElement$f as m, defineCustomElement$b as n, defineCustomElement$e as o, defineCustomElement$d as p, defineCustomElement$c as q, defineCustomElement$a as r, defineCustomElement$9 as s, defineCustomElement$8 as t, defineCustomElement$7 as u, defineCustomElement$6 as v, defineCustomElement$5 as w, defineCustomElement$4 as x, defineCustomElement$3 as y, defineCustomElement$2 as z };
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
2
2
  import { k as kupManagerInstance, _ as identify, g as getProps, s as setProps, S as SortMode, z as getColumnByName, c as KupLanguageGeneric, b as KupThemeIconValues, P as KupDebugCategory, X as KupPointerEventTypes, a4 as KupDragEffect, ah as kupDraggableAttr, a6 as KupDropEventTypes, Q as KupLanguageSearch } from './kup-manager.js';
3
- import { D as filterRows, E as paginateRows, G as sortRows, H as pageChange, I as rowsPerPageChange, F as FImage, J as FCell, L as FChip, N as FTextFieldMDC, O as FPaginator, P as FPaginatorMode, c as componentWrapperId, d as defineCustomElement$1, a as defineCustomElement$2, b as defineCustomElement$3, e as defineCustomElement$4, f as defineCustomElement$5, g as defineCustomElement$6, h as defineCustomElement$7, i as defineCustomElement$8, j as defineCustomElement$9, k as defineCustomElement$a, l as defineCustomElement$b, m as defineCustomElement$c, n as defineCustomElement$d, o as defineCustomElement$e, p as defineCustomElement$f, q as defineCustomElement$g, r as defineCustomElement$h, s as defineCustomElement$i, t as defineCustomElement$j, u as defineCustomElement$k, v as defineCustomElement$l, w as defineCustomElement$m, x as defineCustomElement$n, y as defineCustomElement$o, z as defineCustomElement$p, A as defineCustomElement$q, B as defineCustomElement$r } from './kup-autocomplete2.js';
3
+ import { D as filterRows, E as paginateRows, G as sortRows, H as pageChange, I as rowsPerPageChange, F as FImage, J as FCell, L as FChip, N as FTextFieldMDC, O as FPaginator, c as componentWrapperId, d as defineCustomElement$1, a as defineCustomElement$2, b as defineCustomElement$3, e as defineCustomElement$4, f as defineCustomElement$5, g as defineCustomElement$6, h as defineCustomElement$7, i as defineCustomElement$8, j as defineCustomElement$9, k as defineCustomElement$a, l as defineCustomElement$b, m as defineCustomElement$c, n as defineCustomElement$d, o as defineCustomElement$e, p as defineCustomElement$f, q as defineCustomElement$g, r as defineCustomElement$h, s as defineCustomElement$i, t as defineCustomElement$j, u as defineCustomElement$k, v as defineCustomElement$l, w as defineCustomElement$m, x as defineCustomElement$n, y as defineCustomElement$o, z as defineCustomElement$p, A as defineCustomElement$q, B as defineCustomElement$r } from './kup-autocomplete2.js';
4
4
 
5
5
  /**
6
6
  * Props of the kup-box component.
@@ -21,6 +21,9 @@ var KupBoxProps;
21
21
  KupBoxProps["kanban"] = "Displays the boxlist as a Kanban.";
22
22
  KupBoxProps["layout"] = "How the field will be displayed. If not present, a default one will be created.";
23
23
  KupBoxProps["lazyLoadRows"] = "When set to true, extra rows will be automatically loaded once the last row enters the viewport.";
24
+ KupBoxProps["loadMoreLimit"] = "Sets a maximum limit of new records which can be required by the load more functionality.";
25
+ KupBoxProps["loadMoreMode"] = "Establish the modality of how many new records will be downloaded. This property is regulated also by loadMoreStep.";
26
+ KupBoxProps["loadMoreStep"] = "The number of records which will be requested to be downloaded when clicking on the load more button. This property is regulated also by loadMoreMode.";
24
27
  KupBoxProps["multiSelection"] = "Enable multi selection.";
25
28
  KupBoxProps["pageSelected"] = "Current page number.";
26
29
  KupBoxProps["pagination"] = "Enables pagination.";
@@ -28,6 +31,7 @@ var KupBoxProps;
28
31
  KupBoxProps["scrollOnHover"] = "Activates the scroll on hover function.";
29
32
  KupBoxProps["selectBox"] = "Automatically selects the box at the specified index.";
30
33
  KupBoxProps["selectedRowsState"] = "Multiple selection.";
34
+ KupBoxProps["showLoadMore"] = "If set to true, displays the button to load more records.";
31
35
  KupBoxProps["showSelection"] = "If enabled, highlights the selected box/boxes.";
32
36
  KupBoxProps["sortBy"] = "If sorting is enabled, specifies which column to sort.";
33
37
  KupBoxProps["sortEnabled"] = "Enable sorting.";
@@ -35,6 +39,13 @@ var KupBoxProps;
35
39
  KupBoxProps["store"] = "";
36
40
  KupBoxProps["swipeDisabled"] = "Disable swipe.";
37
41
  })(KupBoxProps || (KupBoxProps = {}));
42
+ //---- *NEXT functionality AKA load more ----
43
+ var LoadMoreMode;
44
+ (function (LoadMoreMode) {
45
+ LoadMoreMode["CONSTANT"] = "constant";
46
+ LoadMoreMode["CONSTANT_INCREMENT"] = "constant_increment";
47
+ LoadMoreMode["PROGRESSIVE_THRESHOLD"] = "progressive_threshold";
48
+ })(LoadMoreMode || (LoadMoreMode = {}));
38
49
 
39
50
  class KupBoxState {
40
51
  constructor() {
@@ -44,6 +55,8 @@ class KupBoxState {
44
55
  this.pageSelected = 1;
45
56
  this.rowsPerPage = 0;
46
57
  this.load = false;
58
+ this.loadMoreLimit = 1000;
59
+ this.showLoadMore = false;
47
60
  }
48
61
  /*Add attribute*/
49
62
  toDebugString() {
@@ -71,7 +84,7 @@ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) ||
71
84
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
72
85
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
73
86
  };
74
- var _KupBox_instances, _KupBox_intObserver, _KupBox_rowsRefs, _KupBox_navBarHeight, _KupBox_didRenderObservers, _KupBox_setObserver;
87
+ var _KupBox_instances, _KupBox_intObserver, _KupBox_rowsRefs, _KupBox_navBarHeight, _KupBox_loadMoreEventCounter, _KupBox_loadMoreEventPreviousQuantity, _KupBox_didRenderObservers, _KupBox_setObserver, _KupBox_onLoadMoreClick;
75
88
  const KupBox = /*@__PURE__*/ proxyCustomElement(class KupBox extends HTMLElement {
76
89
  constructor() {
77
90
  super();
@@ -85,6 +98,7 @@ const KupBox = /*@__PURE__*/ proxyCustomElement(class KupBox extends HTMLElement
85
98
  this.kupDidLoad = createEvent(this, "kup-box-didload", 6);
86
99
  this.kupDidUnload = createEvent(this, "kup-box-didunload", 6);
87
100
  this.kupBoxContextMenu = createEvent(this, "kup-box-contextmenu", 6);
101
+ this.kupLoadMoreClick = createEvent(this, "kup-box-loadmoreclick", 6);
88
102
  _KupBox_instances.add(this);
89
103
  this.state = new KupBoxState();
90
104
  /*-------------------------------------------------*/
@@ -106,6 +120,8 @@ const KupBox = /*@__PURE__*/ proxyCustomElement(class KupBox extends HTMLElement
106
120
  _KupBox_intObserver.set(this, undefined);
107
121
  _KupBox_rowsRefs.set(this, []);
108
122
  _KupBox_navBarHeight.set(this, 0);
123
+ _KupBox_loadMoreEventCounter.set(this, 0);
124
+ _KupBox_loadMoreEventPreviousQuantity.set(this, 0);
109
125
  this.collapsedSection = {};
110
126
  this.selectedRows = [];
111
127
  this.rowActionMenuOpened = undefined;
@@ -125,6 +141,9 @@ const KupBox = /*@__PURE__*/ proxyCustomElement(class KupBox extends HTMLElement
125
141
  this.kanban = null;
126
142
  this.layout = undefined;
127
143
  this.lazyLoadRows = false;
144
+ this.loadMoreLimit = 1000;
145
+ this.loadMoreMode = LoadMoreMode.PROGRESSIVE_THRESHOLD;
146
+ this.loadMoreStep = 60;
128
147
  this.multiSelection = false;
129
148
  this.pageSelected = 1;
130
149
  this.pagination = false;
@@ -132,6 +151,7 @@ const KupBox = /*@__PURE__*/ proxyCustomElement(class KupBox extends HTMLElement
132
151
  this.scrollOnHover = false;
133
152
  this.selectBox = undefined;
134
153
  this.selectedRowsState = undefined;
154
+ this.showLoadMore = false;
135
155
  this.showSelection = true;
136
156
  this.sortBy = undefined;
137
157
  this.sortEnabled = false;
@@ -153,6 +173,8 @@ const KupBox = /*@__PURE__*/ proxyCustomElement(class KupBox extends HTMLElement
153
173
  this.selectedRowsState = this.state.selectedRowsState;
154
174
  this.pageSelected = this.state.pageSelected;
155
175
  this.rowsPerPage = this.state.rowsPerPage;
176
+ this.loadMoreLimit = state.loadMoreLimit;
177
+ this.showLoadMore = state.showLoadMore;
156
178
  }
157
179
  }
158
180
  }
@@ -183,6 +205,14 @@ const KupBox = /*@__PURE__*/ proxyCustomElement(class KupBox extends HTMLElement
183
205
  this.state.selectedRowsState = selectedRowsState;
184
206
  somethingChanged = true;
185
207
  }
208
+ if (!this.kupManager.objects.deepEqual(this.state.loadMoreLimit, this.loadMoreLimit)) {
209
+ this.state.loadMoreLimit = this.loadMoreLimit;
210
+ somethingChanged = true;
211
+ }
212
+ if (!this.kupManager.objects.deepEqual(this.state.showLoadMore, this.showLoadMore)) {
213
+ this.state.showLoadMore = this.showLoadMore;
214
+ somethingChanged = true;
215
+ }
186
216
  if (!this.state.load) {
187
217
  this.state.load = true;
188
218
  return;
@@ -1210,10 +1240,16 @@ const KupBox = /*@__PURE__*/ proxyCustomElement(class KupBox extends HTMLElement
1210
1240
  } })));
1211
1241
  }
1212
1242
  let paginator = null;
1213
- if (!this.lazyLoadRows && this.pagination) {
1214
- paginator = (h(FPaginator, { id: top ? 'top-paginator' : 'bottom-paginator', currentPage: this.currentPage, max: this.filteredRows.length, mode: FPaginatorMode.SIMPLE, perPage: this.currentRowsPerPage
1243
+ if (this.showLoadMore || (!this.lazyLoadRows && this.pagination)) {
1244
+ paginator = (h(FPaginator, { id: 'top-paginator' , currentPage: this.currentPage, max: this.filteredRows.length,
1245
+ // mode={FPaginatorMode.SIMPLE}
1246
+ perPage: this.currentRowsPerPage
1215
1247
  ? this.currentRowsPerPage
1216
- : this.rowsPerPage, onPageChange: (e) => this.handlePageChange(e.detail.value), onRowsChange: (e) => this.handleRowsPerPageChange(e.detail.value) }));
1248
+ : this.rowsPerPage, onLoadMore: this.showLoadMore
1249
+ ? () => {
1250
+ __classPrivateFieldGet(this, _KupBox_instances, "m", _KupBox_onLoadMoreClick).call(this);
1251
+ }
1252
+ : null, onNextPage: () => this.handlePageChange(this.currentPage + 1), onPrevPage: () => this.handlePageChange(this.currentPage - 1), onPageChange: (e) => this.handlePageChange(e.detail.value), onRowsChange: (e) => this.handleRowsPerPageChange(e.detail.value) }));
1217
1253
  }
1218
1254
  let boxContent = null;
1219
1255
  let containerStyle = {};
@@ -1282,6 +1318,9 @@ const KupBox = /*@__PURE__*/ proxyCustomElement(class KupBox extends HTMLElement
1282
1318
  "kanban": [16],
1283
1319
  "layout": [16],
1284
1320
  "lazyLoadRows": [4, "lazy-load-rows"],
1321
+ "loadMoreLimit": [2, "load-more-limit"],
1322
+ "loadMoreMode": [1, "load-more-mode"],
1323
+ "loadMoreStep": [2, "load-more-step"],
1285
1324
  "multiSelection": [4, "multi-selection"],
1286
1325
  "pageSelected": [2, "page-selected"],
1287
1326
  "pagination": [4],
@@ -1289,6 +1328,7 @@ const KupBox = /*@__PURE__*/ proxyCustomElement(class KupBox extends HTMLElement
1289
1328
  "scrollOnHover": [4, "scroll-on-hover"],
1290
1329
  "selectBox": [2, "select-box"],
1291
1330
  "selectedRowsState": [1025, "selected-rows-state"],
1331
+ "showLoadMore": [4, "show-load-more"],
1292
1332
  "showSelection": [4, "show-selection"],
1293
1333
  "sortBy": [1025, "sort-by"],
1294
1334
  "sortEnabled": [4, "sort-enabled"],
@@ -1315,7 +1355,7 @@ const KupBox = /*@__PURE__*/ proxyCustomElement(class KupBox extends HTMLElement
1315
1355
  "layout": ["onLayoutChanged"],
1316
1356
  "selectBox": ["onSelectBoxChanged"]
1317
1357
  }]);
1318
- _KupBox_intObserver = new WeakMap(), _KupBox_rowsRefs = new WeakMap(), _KupBox_navBarHeight = new WeakMap(), _KupBox_instances = new WeakSet(), _KupBox_didRenderObservers = function _KupBox_didRenderObservers() {
1358
+ _KupBox_intObserver = new WeakMap(), _KupBox_rowsRefs = new WeakMap(), _KupBox_navBarHeight = new WeakMap(), _KupBox_loadMoreEventCounter = new WeakMap(), _KupBox_loadMoreEventPreviousQuantity = new WeakMap(), _KupBox_instances = new WeakSet(), _KupBox_didRenderObservers = function _KupBox_didRenderObservers() {
1319
1359
  if (this.lazyLoadRows &&
1320
1360
  this.currentRowsPerPage < this.data.rows.length) {
1321
1361
  __classPrivateFieldGet(this, _KupBox_intObserver, "f").observe(__classPrivateFieldGet(this, _KupBox_rowsRefs, "f")[__classPrivateFieldGet(this, _KupBox_rowsRefs, "f").length - 1]);
@@ -1326,11 +1366,11 @@ _KupBox_intObserver = new WeakMap(), _KupBox_rowsRefs = new WeakMap(), _KupBox_n
1326
1366
  if (entry.isIntersecting) {
1327
1367
  this.kupManager.debug.logMessage(this, 'Last row entering the viewport, loading more elements.');
1328
1368
  const delta = this.data.rows.length - this.currentRowsPerPage;
1329
- if (delta < 10) {
1369
+ if (delta < this.loadMoreStep) {
1330
1370
  this.currentRowsPerPage += delta;
1331
1371
  }
1332
1372
  else {
1333
- this.currentRowsPerPage += 10;
1373
+ this.currentRowsPerPage += this.loadMoreStep;
1334
1374
  }
1335
1375
  entry.target.classList.remove('last-row');
1336
1376
  __classPrivateFieldGet(this, _KupBox_intObserver, "f").unobserve(entry.target);
@@ -1342,6 +1382,32 @@ _KupBox_intObserver = new WeakMap(), _KupBox_rowsRefs = new WeakMap(), _KupBox_n
1342
1382
  rootMargin: '-' + __classPrivateFieldGet(this, _KupBox_navBarHeight, "f") + 'px 0px 0px 0px',
1343
1383
  };
1344
1384
  __classPrivateFieldSet(this, _KupBox_intObserver, new IntersectionObserver(callback, options), "f");
1385
+ }, _KupBox_onLoadMoreClick = function _KupBox_onLoadMoreClick() {
1386
+ var _a;
1387
+ let loadItems = 0;
1388
+ switch (this.loadMoreMode) {
1389
+ case LoadMoreMode.CONSTANT:
1390
+ loadItems = this.loadMoreStep;
1391
+ break;
1392
+ case LoadMoreMode.CONSTANT_INCREMENT:
1393
+ loadItems =
1394
+ this.loadMoreStep * (__classPrivateFieldGet(this, _KupBox_loadMoreEventCounter, "f") + 1);
1395
+ break;
1396
+ case LoadMoreMode.PROGRESSIVE_THRESHOLD:
1397
+ loadItems =
1398
+ Math.max(__classPrivateFieldGet(this, _KupBox_loadMoreEventPreviousQuantity, "f"), this.loadMoreStep) * Math.min(__classPrivateFieldGet(this, _KupBox_loadMoreEventCounter, "f") + 1, 2);
1399
+ break;
1400
+ }
1401
+ if (loadItems > this.loadMoreLimit) {
1402
+ loadItems = this.loadMoreLimit;
1403
+ }
1404
+ this.kupLoadMoreClick.emit({
1405
+ comp: this,
1406
+ id: this.rootElement.id,
1407
+ loadItems: loadItems,
1408
+ });
1409
+ __classPrivateFieldSet(this, _KupBox_loadMoreEventPreviousQuantity, loadItems, "f");
1410
+ __classPrivateFieldSet(this, _KupBox_loadMoreEventCounter, (_a = __classPrivateFieldGet(this, _KupBox_loadMoreEventCounter, "f"), _a++, _a), "f");
1345
1411
  };
1346
1412
  function defineCustomElement() {
1347
1413
  if (typeof customElements === "undefined") {
@@ -1,4 +1,4 @@
1
- import { R as KupButtonList$1, y as defineCustomElement$1 } from './kup-autocomplete2.js';
1
+ import { Q as KupButtonList$1, y as defineCustomElement$1 } from './kup-autocomplete2.js';
2
2
 
3
3
  const KupButtonList = KupButtonList$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { Q as KupButton$1, z as defineCustomElement$1 } from './kup-autocomplete2.js';
1
+ import { P as KupButton$1, z as defineCustomElement$1 } from './kup-autocomplete2.js';
2
2
 
3
3
  const KupButton = KupButton$1;
4
4
  const defineCustomElement = defineCustomElement$1;