@infineon/infineon-design-system-stencil 39.4.4--canary.2134.cd83647d2771e1e22b8c6c80a0df75f24ca168b6.0 → 39.4.4--canary.2134.84be7b9e85db8400d052b6d3b5addde807790384.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.
@@ -406,21 +406,39 @@ const Table = /*@__PURE__*/ proxyCustomElement(class Table extends H {
406
406
  const newSelectedRows = new Set(this.selectedRows);
407
407
  const newSelectedRowsData = new Map(this.selectedRowsData);
408
408
  if (checked) {
409
- // Add all current page rows
410
- this.rowData.forEach(row => {
411
- const rowId = row.__rowId;
412
- newSelectedRows.add(rowId);
413
- const cleanRow = __rest(row, ["__checkbox", "__rowId"]);
414
- newSelectedRowsData.set(rowId, cleanRow);
415
- });
409
+ if (this.serverSidePagination) {
410
+ // Server-side: select only current page rows
411
+ this.rowData.forEach(row => {
412
+ const rowId = row.__rowId;
413
+ newSelectedRows.add(rowId);
414
+ const cleanRow = __rest(row, ["__checkbox", "__rowId"]);
415
+ newSelectedRowsData.set(rowId, cleanRow);
416
+ });
417
+ }
418
+ else {
419
+ // Client-side: select ALL rows across ALL pages
420
+ this.allRowData.forEach(row => {
421
+ const rowId = row.__rowId;
422
+ newSelectedRows.add(rowId);
423
+ const cleanRow = __rest(row, ["__checkbox", "__rowId"]);
424
+ newSelectedRowsData.set(rowId, cleanRow);
425
+ });
426
+ }
416
427
  }
417
428
  else {
418
- // Remove only current page rows
419
- this.rowData.forEach(row => {
420
- const rowId = row.__rowId;
421
- newSelectedRows.delete(rowId);
422
- newSelectedRowsData.delete(rowId);
423
- });
429
+ if (this.serverSidePagination) {
430
+ // Server-side: remove only current page rows
431
+ this.rowData.forEach(row => {
432
+ const rowId = row.__rowId;
433
+ newSelectedRows.delete(rowId);
434
+ newSelectedRowsData.delete(rowId);
435
+ });
436
+ }
437
+ else {
438
+ // Client-side: remove ALL rows (clear entire selection)
439
+ newSelectedRows.clear();
440
+ newSelectedRowsData.clear();
441
+ }
424
442
  }
425
443
  this.selectedRows = newSelectedRows;
426
444
  this.selectedRowsData = newSelectedRowsData;
@@ -439,7 +457,6 @@ const Table = /*@__PURE__*/ proxyCustomElement(class Table extends H {
439
457
  }
440
458
  else {
441
459
  newSelectedRows.add(rowId);
442
- // Store the clean row data (without internal props)
443
460
  const cleanRow = __rest(clickedRowData, ["__checkbox", "__rowId"]);
444
461
  newSelectedRowsData.set(rowId, cleanRow);
445
462
  }
@@ -576,7 +593,7 @@ const Table = /*@__PURE__*/ proxyCustomElement(class Table extends H {
576
593
  headerCheckbox.indeterminate = someOnPageSelected;
577
594
  }
578
595
  else {
579
- // For client-side: use all data
596
+ // For client-side: reflect entire dataset selection
580
597
  const allSelected = this.selectedRows.size === this.allRowData.length && this.allRowData.length > 0;
581
598
  const someSelected = this.selectedRows.size > 0 && this.selectedRows.size < this.allRowData.length;
582
599
  headerCheckbox.checked = allSelected;
@@ -741,6 +758,8 @@ const Table = /*@__PURE__*/ proxyCustomElement(class Table extends H {
741
758
  if (this.gridApi) {
742
759
  this.gridApi.setGridOption('rowData', this.rowData);
743
760
  }
761
+ // Update header checkbox state for client-side
762
+ this.updateHeaderCheckboxState();
744
763
  }
745
764
  }
746
765
  clearAllFilters() {
@@ -936,8 +955,29 @@ const Table = /*@__PURE__*/ proxyCustomElement(class Table extends H {
936
955
  const startIndex = (this.currentPage - 1) * this.paginationPageSize;
937
956
  const endIndex = startIndex + this.paginationPageSize;
938
957
  const visibleRowData = this.allRowData.slice(startIndex, endIndex);
958
+ // Update checkbox state for visible rows
959
+ if (this.enableSelection) {
960
+ visibleRowData.forEach(row => {
961
+ var _a, _b;
962
+ if (!row.__checkbox) {
963
+ row.__checkbox = {
964
+ disabled: false,
965
+ checked: ((_a = this.selectedRows) === null || _a === void 0 ? void 0 : _a.has(row.__rowId)) || false,
966
+ size: 's',
967
+ indeterminate: false,
968
+ error: false,
969
+ };
970
+ }
971
+ else {
972
+ row.__checkbox.checked = ((_b = this.selectedRows) === null || _b === void 0 ? void 0 : _b.has(row.__rowId)) || false;
973
+ }
974
+ });
975
+ }
976
+ this.rowData = visibleRowData;
939
977
  if (this.gridApi) {
940
978
  this.gridApi.setGridOption('rowData', visibleRowData);
979
+ // Update header checkbox state for client-side too
980
+ this.updateHeaderCheckboxState();
941
981
  }
942
982
  }
943
983
  }
@@ -987,8 +1027,9 @@ const Table = /*@__PURE__*/ proxyCustomElement(class Table extends H {
987
1027
  return rows.slice(0, this.paginationPageSize);
988
1028
  }
989
1029
  updateCheckboxStates() {
990
- const dataSource = this.serverSidePagination ? this.rowData : this.allRowData;
991
- dataSource.forEach(row => {
1030
+ // Update checkboxes in the current view
1031
+ const dataToUpdate = this.rowData; // Always update current page
1032
+ dataToUpdate.forEach(row => {
992
1033
  if (row.__checkbox) {
993
1034
  row.__checkbox.checked = this.selectedRows.has(row.__rowId);
994
1035
  }
@@ -1002,11 +1043,20 @@ const Table = /*@__PURE__*/ proxyCustomElement(class Table extends H {
1002
1043
  }
1003
1044
  emitSelectionChange() {
1004
1045
  const selectedRowsArray = Array.from(this.selectedRowsData.values());
1046
+ let isSelectAll;
1047
+ if (this.serverSidePagination) {
1048
+ // Server-side: select-all only applies to current page
1049
+ isSelectAll = this.selectedRows.size === this.rowData.length && this.rowData.length > 0;
1050
+ }
1051
+ else {
1052
+ // Client-side: select-all applies to ALL data across all pages
1053
+ isSelectAll = this.selectedRows.size === this.allRowData.length && this.allRowData.length > 0;
1054
+ }
1005
1055
  this.host.dispatchEvent(new CustomEvent('ifxSelectionChange', {
1006
1056
  detail: {
1007
1057
  selectedRows: selectedRowsArray,
1008
1058
  selectedCount: selectedRowsArray.length,
1009
- isSelectAll: this.selectedRows.size === this.rowData.length && this.rowData.length > 0,
1059
+ isSelectAll: isSelectAll,
1010
1060
  },
1011
1061
  bubbles: true,
1012
1062
  }));
@@ -1130,12 +1180,12 @@ const Table = /*@__PURE__*/ proxyCustomElement(class Table extends H {
1130
1180
  };
1131
1181
  }
1132
1182
  const filterClass = this.filterOrientation === 'topbar' ? 'topbar-layout' : this.filterOrientation === 'none' ? '' : 'sidebar-layout';
1133
- return (h(Host, { key: 'a2f150aad2574eeffa1dd8c7d36f53e6f55782f8' }, h("div", { key: '0494daa800f969dac282546a4aa3bf29d73b0dee', class: "table-container" }, this.filterOrientation === 'sidebar' && (h("div", { key: '97d09d41f762cb69c8cc95c40c678212121b9d81', class: "sidebar-btn" }, h("ifx-button", { key: 'b0acf69262ba77be65729feb4c0d7c5c35668fdc', type: "button", disabled: false, variant: "secondary", size: "m", target: "_blank", theme: "default", "full-width": "false", onClick: () => this.toggleSidebarFilters() }, h("ifx-icon", { key: '16898e4191dc9e96376cbdccc763dd719560a4e7', icon: "cross-16" }), this.showSidebarFilters ? 'Hide Filters' : 'Show Filters'))), h("div", { key: '534fa230ed9eef7f4f595fcb47d2b423095af247', class: filterClass }, this.filterOrientation === 'sidebar' && this.showSidebarFilters && (h("div", { key: '06bc3e0489a0e2c1ac0541bea932ad7c4b6cd1d4', class: "sidebar-container" }, h("div", { key: '934d51db8d1fdfd9ffe0f78fa9f4898cff326187', class: "filters-title-container" }, h("span", { key: 'ff9720c28c01d585d7d0ecb7d5a0766f6c8eefdc', class: "filters-title" }, "Filters")), h("div", { key: '0bdf4d4b121b099dcebfdc0c5192b0a756ee6610', class: "set-filter-wrapper-sidebar" }, (this.filterOrientation !== 'sidebar' || this.showSidebarFilters) && h("slot", { key: 'eb6c5c820eba7d7629e38f142859074c9ba51b3b', name: "sidebar-filter" })))), this.filterOrientation !== 'none' && this.filterOrientation !== 'sidebar' && (h("div", { key: '4ffaca956ae3c9a7fe80de3f934b29345803d9d7', class: "set-filter-wrapper-topbar" }, (this.filterOrientation !== 'sidebar' || this.showSidebarFilters) && h("slot", { key: '021dcdc239c0e68c3eb17fcbcba1805aa5d161d3', name: "topbar-filter" }))), h("div", { key: '8508f3aebd906f0bdafe59e4b57ac0566d5f2afe', class: "table-pagination-wrapper" }, this.filterOrientation !== 'none' && this.filterOrientation !== 'topbar' && this.showSidebarFilters && (h("div", { key: 'a430a912abf9bc63d40331f5b361e9407f139427', class: "filter-chips" }, Object.keys(this.currentFilters).map(name => {
1183
+ return (h(Host, { key: 'c1489506902cdb79a3ba86f9253601c1ba5ce495' }, h("div", { key: '4f5439475ea09640a4cbd0224d30c4d8ede316e2', class: "table-container" }, this.filterOrientation === 'sidebar' && (h("div", { key: '0bddd913070ac4bf564620fc5f1a2254c6428f46', class: "sidebar-btn" }, h("ifx-button", { key: '9a9395c870d35290b8b89f9ec8137819c19b3397', type: "button", disabled: false, variant: "secondary", size: "m", target: "_blank", theme: "default", "full-width": "false", onClick: () => this.toggleSidebarFilters() }, h("ifx-icon", { key: '87a92e599608e4927b5b29fda70acb8268aca7a1', icon: "cross-16" }), this.showSidebarFilters ? 'Hide Filters' : 'Show Filters'))), h("div", { key: '33d925bf3bc281bc67af9f76b837b9216f1f0dc0', class: filterClass }, this.filterOrientation === 'sidebar' && this.showSidebarFilters && (h("div", { key: '4002c1a03d92dea9b4beffd3d7bfe57d7f667add', class: "sidebar-container" }, h("div", { key: 'a443ffddc716cefbaf89c33f5cc5f6278f332442', class: "filters-title-container" }, h("span", { key: '8eb9160571bf1a54927aeab52b9900ca6c3bab44', class: "filters-title" }, "Filters")), h("div", { key: '0d084ba8d7ede405c4015cb52020871c7046417b', class: "set-filter-wrapper-sidebar" }, (this.filterOrientation !== 'sidebar' || this.showSidebarFilters) && h("slot", { key: '67912ff1dd15e0b2ea691a8a376863204ceefad2', name: "sidebar-filter" })))), this.filterOrientation !== 'none' && this.filterOrientation !== 'sidebar' && (h("div", { key: 'd50eae526270c682cb15f15fffa173d8c1898b34', class: "set-filter-wrapper-topbar" }, (this.filterOrientation !== 'sidebar' || this.showSidebarFilters) && h("slot", { key: 'fdfa7a32a95c0b4c01995ff95ab8c166647482a2', name: "topbar-filter" }))), h("div", { key: 'e165963816e9c7412024c10314cb7aa09730e8e7', class: "table-pagination-wrapper" }, this.filterOrientation !== 'none' && this.filterOrientation !== 'topbar' && this.showSidebarFilters && (h("div", { key: 'c97d793d611e819c0a244bda14dfd1805794e199', class: "filter-chips" }, Object.keys(this.currentFilters).map(name => {
1134
1184
  const filter = this.currentFilters[name];
1135
1185
  const filterValues = filter.filterValues;
1136
1186
  const isMultiSelect = filter.type !== 'text';
1137
1187
  return filterValues.length > 0 ? (h("ifx-chip", { placeholder: name, size: "large", variant: isMultiSelect ? 'multi' : 'single', readOnly: true, value: filterValues, key: name }, filterValues.map(filterValue => (h("ifx-chip-item", { value: filterValue, selected: true, key: filterValue }, filterValue))))) : null;
1138
- }))), h("div", { key: '47f7204aaa206dc5006dfd86b23d04b3253f90fa', class: "headline-wrapper" }, this.filterOrientation !== 'none' && this.headline && (h("div", { key: 'ac971158ad29b68104bb0f673b837e8829ee02ca', class: "matching-results-container" }, h("span", { key: '74461f519fa629475b71022e963877f65198565a', class: "matching-results-count" }, "(", this.matchingResultsCount, ")"), h("span", { key: '2c78f6d8356b626191026553cd6880e017856894', class: "matching-results-text" }, this.headline))), h("div", { key: '36674e8d798b37bc8b464e8de7bab20db848ba6c', class: "inner-buttons-wrapper" }, h("slot", { key: '8cba564911474ce81c34e712b0007fc44d43118d', name: "inner-button" }))), h("div", { key: '5c6828eb0890e87e245e58a4f7028807cba7ff84', id: "table-wrapper", class: this.getTableClassNames() }, h("div", { key: '2de36779dd79f3ad5ad8efd65aeab9a733ee7088', id: `ifxTable-${this.uniqueKey}`, class: `ifx-ag-grid ${this.variant === 'zebra' ? 'zebra' : ''}`, style: style, ref: el => (this.container = el) })), h("div", { key: 'f9defe46fdc990ab64e5a976697267acb4d3a20f', class: "pagination-wrapper" }, this.pagination ? (h("ifx-pagination", { total: this.serverSidePagination ? this.matchingResultsCount : this.allRowData.length, "current-page": this.currentPage, "items-per-page": this.internalItemsPerPage })) : null))))));
1188
+ }))), h("div", { key: '3e9accd07cdb2f084062331ad51bb09e05b37ad9', class: "headline-wrapper" }, this.filterOrientation !== 'none' && this.headline && (h("div", { key: '7b62e23de92579c87dd31223cc462e5896f26fcd', class: "matching-results-container" }, h("span", { key: 'fb9c0f9d176143756c1d9bd5a212bfa94f81cd5e', class: "matching-results-count" }, "(", this.matchingResultsCount, ")"), h("span", { key: 'fd0d1dd3db1903b518244ce9ec9d7c9fb5f06381', class: "matching-results-text" }, this.headline))), h("div", { key: '55abe9fd4fb5b31b6ba3faa05d6bdbfce23a4c0c', class: "inner-buttons-wrapper" }, h("slot", { key: '64e5f8b60a7459acb2025abf50dd3f12e96ecb4d', name: "inner-button" }))), h("div", { key: 'cbf11cb3a5c83b2510523a866d9c3e3039acb0cb', id: "table-wrapper", class: this.getTableClassNames() }, h("div", { key: 'aa309053f78bc3c20497480ca1a36633a52982b6', id: `ifxTable-${this.uniqueKey}`, class: `ifx-ag-grid ${this.variant === 'zebra' ? 'zebra' : ''}`, style: style, ref: el => (this.container = el) })), h("div", { key: '00801e7da0e53ae3076c1f9d36158193fed1d242', class: "pagination-wrapper" }, this.pagination ? (h("ifx-pagination", { total: this.serverSidePagination ? this.matchingResultsCount : this.allRowData.length, "current-page": this.currentPage, "items-per-page": this.internalItemsPerPage })) : null))))));
1139
1189
  }
1140
1190
  hasButtonCol() {
1141
1191
  return this.getColData().some(column => column.field === 'button');