@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.
@@ -8773,21 +8773,39 @@ const Table = class {
8773
8773
  const newSelectedRows = new Set(this.selectedRows);
8774
8774
  const newSelectedRowsData = new Map(this.selectedRowsData);
8775
8775
  if (checked) {
8776
- // Add all current page rows
8777
- this.rowData.forEach(row => {
8778
- const rowId = row.__rowId;
8779
- newSelectedRows.add(rowId);
8780
- const cleanRow = __rest(row, ["__checkbox", "__rowId"]);
8781
- newSelectedRowsData.set(rowId, cleanRow);
8782
- });
8776
+ if (this.serverSidePagination) {
8777
+ // Server-side: select only current page rows
8778
+ this.rowData.forEach(row => {
8779
+ const rowId = row.__rowId;
8780
+ newSelectedRows.add(rowId);
8781
+ const cleanRow = __rest(row, ["__checkbox", "__rowId"]);
8782
+ newSelectedRowsData.set(rowId, cleanRow);
8783
+ });
8784
+ }
8785
+ else {
8786
+ // Client-side: select ALL rows across ALL pages
8787
+ this.allRowData.forEach(row => {
8788
+ const rowId = row.__rowId;
8789
+ newSelectedRows.add(rowId);
8790
+ const cleanRow = __rest(row, ["__checkbox", "__rowId"]);
8791
+ newSelectedRowsData.set(rowId, cleanRow);
8792
+ });
8793
+ }
8783
8794
  }
8784
8795
  else {
8785
- // Remove only current page rows
8786
- this.rowData.forEach(row => {
8787
- const rowId = row.__rowId;
8788
- newSelectedRows.delete(rowId);
8789
- newSelectedRowsData.delete(rowId);
8790
- });
8796
+ if (this.serverSidePagination) {
8797
+ // Server-side: remove only current page rows
8798
+ this.rowData.forEach(row => {
8799
+ const rowId = row.__rowId;
8800
+ newSelectedRows.delete(rowId);
8801
+ newSelectedRowsData.delete(rowId);
8802
+ });
8803
+ }
8804
+ else {
8805
+ // Client-side: remove ALL rows (clear entire selection)
8806
+ newSelectedRows.clear();
8807
+ newSelectedRowsData.clear();
8808
+ }
8791
8809
  }
8792
8810
  this.selectedRows = newSelectedRows;
8793
8811
  this.selectedRowsData = newSelectedRowsData;
@@ -8806,7 +8824,6 @@ const Table = class {
8806
8824
  }
8807
8825
  else {
8808
8826
  newSelectedRows.add(rowId);
8809
- // Store the clean row data (without internal props)
8810
8827
  const cleanRow = __rest(clickedRowData, ["__checkbox", "__rowId"]);
8811
8828
  newSelectedRowsData.set(rowId, cleanRow);
8812
8829
  }
@@ -8943,7 +8960,7 @@ const Table = class {
8943
8960
  headerCheckbox.indeterminate = someOnPageSelected;
8944
8961
  }
8945
8962
  else {
8946
- // For client-side: use all data
8963
+ // For client-side: reflect entire dataset selection
8947
8964
  const allSelected = this.selectedRows.size === this.allRowData.length && this.allRowData.length > 0;
8948
8965
  const someSelected = this.selectedRows.size > 0 && this.selectedRows.size < this.allRowData.length;
8949
8966
  headerCheckbox.checked = allSelected;
@@ -9108,6 +9125,8 @@ const Table = class {
9108
9125
  if (this.gridApi) {
9109
9126
  this.gridApi.setGridOption('rowData', this.rowData);
9110
9127
  }
9128
+ // Update header checkbox state for client-side
9129
+ this.updateHeaderCheckboxState();
9111
9130
  }
9112
9131
  }
9113
9132
  clearAllFilters() {
@@ -9303,8 +9322,29 @@ const Table = class {
9303
9322
  const startIndex = (this.currentPage - 1) * this.paginationPageSize;
9304
9323
  const endIndex = startIndex + this.paginationPageSize;
9305
9324
  const visibleRowData = this.allRowData.slice(startIndex, endIndex);
9325
+ // Update checkbox state for visible rows
9326
+ if (this.enableSelection) {
9327
+ visibleRowData.forEach(row => {
9328
+ var _a, _b;
9329
+ if (!row.__checkbox) {
9330
+ row.__checkbox = {
9331
+ disabled: false,
9332
+ checked: ((_a = this.selectedRows) === null || _a === void 0 ? void 0 : _a.has(row.__rowId)) || false,
9333
+ size: 's',
9334
+ indeterminate: false,
9335
+ error: false,
9336
+ };
9337
+ }
9338
+ else {
9339
+ row.__checkbox.checked = ((_b = this.selectedRows) === null || _b === void 0 ? void 0 : _b.has(row.__rowId)) || false;
9340
+ }
9341
+ });
9342
+ }
9343
+ this.rowData = visibleRowData;
9306
9344
  if (this.gridApi) {
9307
9345
  this.gridApi.setGridOption('rowData', visibleRowData);
9346
+ // Update header checkbox state for client-side too
9347
+ this.updateHeaderCheckboxState();
9308
9348
  }
9309
9349
  }
9310
9350
  }
@@ -9354,8 +9394,9 @@ const Table = class {
9354
9394
  return rows.slice(0, this.paginationPageSize);
9355
9395
  }
9356
9396
  updateCheckboxStates() {
9357
- const dataSource = this.serverSidePagination ? this.rowData : this.allRowData;
9358
- dataSource.forEach(row => {
9397
+ // Update checkboxes in the current view
9398
+ const dataToUpdate = this.rowData; // Always update current page
9399
+ dataToUpdate.forEach(row => {
9359
9400
  if (row.__checkbox) {
9360
9401
  row.__checkbox.checked = this.selectedRows.has(row.__rowId);
9361
9402
  }
@@ -9369,11 +9410,20 @@ const Table = class {
9369
9410
  }
9370
9411
  emitSelectionChange() {
9371
9412
  const selectedRowsArray = Array.from(this.selectedRowsData.values());
9413
+ let isSelectAll;
9414
+ if (this.serverSidePagination) {
9415
+ // Server-side: select-all only applies to current page
9416
+ isSelectAll = this.selectedRows.size === this.rowData.length && this.rowData.length > 0;
9417
+ }
9418
+ else {
9419
+ // Client-side: select-all applies to ALL data across all pages
9420
+ isSelectAll = this.selectedRows.size === this.allRowData.length && this.allRowData.length > 0;
9421
+ }
9372
9422
  this.host.dispatchEvent(new CustomEvent('ifxSelectionChange', {
9373
9423
  detail: {
9374
9424
  selectedRows: selectedRowsArray,
9375
9425
  selectedCount: selectedRowsArray.length,
9376
- isSelectAll: this.selectedRows.size === this.rowData.length && this.rowData.length > 0,
9426
+ isSelectAll: isSelectAll,
9377
9427
  },
9378
9428
  bubbles: true,
9379
9429
  }));
@@ -9497,12 +9547,12 @@ const Table = class {
9497
9547
  };
9498
9548
  }
9499
9549
  const filterClass = this.filterOrientation === 'topbar' ? 'topbar-layout' : this.filterOrientation === 'none' ? '' : 'sidebar-layout';
9500
- 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 => {
9550
+ 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 => {
9501
9551
  const filter = this.currentFilters[name];
9502
9552
  const filterValues = filter.filterValues;
9503
9553
  const isMultiSelect = filter.type !== 'text';
9504
9554
  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;
9505
- }))), 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))))));
9555
+ }))), 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))))));
9506
9556
  }
9507
9557
  hasButtonCol() {
9508
9558
  return this.getColData().some(column => column.field === 'button');