@infineon/infineon-design-system-stencil 39.4.4--canary.2134.bb609f61311d4fde41e8336aa402a4fd507e0769.0 → 39.4.4--canary.2136.61ca080385a85b28f9e73c1ac2fcb72fcc5e023a.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 (32) hide show
  1. package/dist/cjs/ifx-status.cjs.entry.js +1 -1
  2. package/dist/cjs/ifx-status.cjs.entry.js.map +1 -1
  3. package/dist/cjs/ifx-status.entry.cjs.js.map +1 -1
  4. package/dist/cjs/ifx-table.cjs.entry.js +37 -126
  5. package/dist/cjs/ifx-table.cjs.entry.js.map +1 -1
  6. package/dist/cjs/ifx-table.entry.cjs.js.map +1 -1
  7. package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/collection/components/status/status.css +1 -1
  10. package/dist/collection/components/table-advanced-version/table.js +38 -128
  11. package/dist/collection/components/table-advanced-version/table.js.map +1 -1
  12. package/dist/components/ifx-status.js +1 -1
  13. package/dist/components/ifx-status.js.map +1 -1
  14. package/dist/components/ifx-table.js +37 -127
  15. package/dist/components/ifx-table.js.map +1 -1
  16. package/dist/esm/ifx-status.entry.js +1 -1
  17. package/dist/esm/ifx-status.entry.js.map +1 -1
  18. package/dist/esm/ifx-table.entry.js +37 -126
  19. package/dist/esm/ifx-table.entry.js.map +1 -1
  20. package/dist/esm/infineon-design-system-stencil.js +1 -1
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/infineon-design-system-stencil/ifx-status.entry.esm.js.map +1 -1
  23. package/dist/infineon-design-system-stencil/ifx-table.entry.esm.js.map +1 -1
  24. package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
  25. package/dist/infineon-design-system-stencil/{p-f1ba768a.entry.js → p-65bc82a4.entry.js} +2 -2
  26. package/dist/infineon-design-system-stencil/p-65bc82a4.entry.js.map +1 -0
  27. package/dist/infineon-design-system-stencil/{p-2d5290c7.entry.js → p-abd8bd80.entry.js} +2 -2
  28. package/dist/infineon-design-system-stencil/p-abd8bd80.entry.js.map +1 -0
  29. package/dist/types/components/table-advanced-version/table.d.ts +0 -1
  30. package/package.json +1 -1
  31. package/dist/infineon-design-system-stencil/p-2d5290c7.entry.js.map +0 -1
  32. package/dist/infineon-design-system-stencil/p-f1ba768a.entry.js.map +0 -1
@@ -384,7 +384,6 @@ const Table = class {
384
384
  this.enableSelection = false;
385
385
  this.selectedRows = new Set();
386
386
  this.selectAll = false;
387
- this.selectedRowsData = new Map();
388
387
  this.showLoading = false;
389
388
  this.originalRowData = [];
390
389
  this.internalItemsPerPage = JSON.stringify([
@@ -394,45 +393,12 @@ const Table = class {
394
393
  ]);
395
394
  this.handleSelectAll = (checked) => {
396
395
  this.selectAll = checked;
397
- const newSelectedRows = new Set(this.selectedRows);
398
- const newSelectedRowsData = new Map(this.selectedRowsData);
399
396
  if (checked) {
400
- if (this.serverSidePagination) {
401
- // Server-side: select only current page rows
402
- this.rowData.forEach(row => {
403
- const rowId = row.__rowId;
404
- newSelectedRows.add(rowId);
405
- const cleanRow = __rest(row, ["__checkbox", "__rowId"]);
406
- newSelectedRowsData.set(rowId, cleanRow);
407
- });
408
- }
409
- else {
410
- // Client-side: select ALL rows across ALL pages
411
- this.allRowData.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
- }
397
+ this.selectedRows = new Set(this.allRowData.map(row => row.__rowId));
418
398
  }
419
399
  else {
420
- if (this.serverSidePagination) {
421
- // Server-side: remove only current page rows
422
- this.rowData.forEach(row => {
423
- const rowId = row.__rowId;
424
- newSelectedRows.delete(rowId);
425
- newSelectedRowsData.delete(rowId);
426
- });
427
- }
428
- else {
429
- // Client-side: remove ALL rows (clear entire selection)
430
- newSelectedRows.clear();
431
- newSelectedRowsData.clear();
432
- }
400
+ this.selectedRows = new Set();
433
401
  }
434
- this.selectedRows = newSelectedRows;
435
- this.selectedRowsData = newSelectedRowsData;
436
402
  this.updateCheckboxStates();
437
403
  this.updateHeaderCheckboxState();
438
404
  this.emitSelectionChange();
@@ -441,19 +407,14 @@ const Table = class {
441
407
  const clickedRowData = params.data;
442
408
  const rowId = clickedRowData.__rowId;
443
409
  const newSelectedRows = new Set(this.selectedRows);
444
- const newSelectedRowsData = new Map(this.selectedRowsData);
445
410
  if (newSelectedRows.has(rowId)) {
446
411
  newSelectedRows.delete(rowId);
447
- newSelectedRowsData.delete(rowId);
448
412
  }
449
413
  else {
450
414
  newSelectedRows.add(rowId);
451
- const cleanRow = __rest(clickedRowData, ["__checkbox", "__rowId"]);
452
- newSelectedRowsData.set(rowId, cleanRow);
453
415
  }
454
416
  this.selectedRows = newSelectedRows;
455
- this.selectedRowsData = newSelectedRowsData;
456
- this.selectAll = newSelectedRows.size === this.rowData.length && this.rowData.length > 0;
417
+ this.selectAll = newSelectedRows.size === this.allRowData.length;
457
418
  this.updateCheckboxStates();
458
419
  this.updateHeaderCheckboxState();
459
420
  this.emitSelectionChange();
@@ -575,19 +536,10 @@ const Table = class {
575
536
  var _a;
576
537
  const headerCheckbox = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelector('.ag-header-cell[col-id="__checkbox"] ifx-checkbox');
577
538
  if (headerCheckbox) {
578
- if (this.serverSidePagination) {
579
- const currentPageSelectedCount = this.rowData.filter(row => { var _a; return (_a = this.selectedRows) === null || _a === void 0 ? void 0 : _a.has(row.__rowId); }).length;
580
- const allOnPageSelected = currentPageSelectedCount === this.rowData.length && this.rowData.length > 0;
581
- const someOnPageSelected = currentPageSelectedCount > 0 && currentPageSelectedCount < this.rowData.length;
582
- headerCheckbox.checked = allOnPageSelected;
583
- headerCheckbox.indeterminate = someOnPageSelected;
584
- }
585
- else {
586
- const allSelected = this.selectedRows.size === this.allRowData.length && this.allRowData.length > 0;
587
- const someSelected = this.selectedRows.size > 0 && this.selectedRows.size < this.allRowData.length;
588
- headerCheckbox.checked = allSelected;
589
- headerCheckbox.indeterminate = someSelected;
590
- }
539
+ const allSelected = this.selectedRows.size === this.allRowData.length && this.allRowData.length > 0;
540
+ const someSelected = this.selectedRows.size > 0 && this.selectedRows.size < this.allRowData.length;
541
+ headerCheckbox.checked = allSelected;
542
+ headerCheckbox.indeterminate = someSelected;
591
543
  }
592
544
  }, 0);
593
545
  }
@@ -688,31 +640,30 @@ const Table = class {
688
640
  });
689
641
  }
690
642
  async updateTableView() {
691
- if (this.serverSidePagination) {
692
- this.selectAll = false;
693
- }
694
643
  if (this.serverSidePagination && this.serverPageChangeHandler) {
695
644
  const { rows, total } = await this.serverPageChangeHandler({
696
645
  page: this.currentPage,
697
646
  pageSize: this.paginationPageSize,
698
647
  });
699
- rows.forEach((row, index) => {
700
- var _a;
701
- const rowId = row.sampleNumber || `row_${(this.currentPage - 1) * this.paginationPageSize + index}`;
702
- row.__rowId = rowId;
703
- row.__checkbox = {
704
- disabled: false,
705
- checked: ((_a = this.selectedRows) === null || _a === void 0 ? void 0 : _a.has(rowId)) || false,
706
- size: 's',
707
- indeterminate: false,
708
- error: false,
709
- };
710
- });
648
+ if (this.enableSelection) {
649
+ rows.forEach((row, index) => {
650
+ var _a;
651
+ if (!row.__rowId) {
652
+ row.__rowId = `row_${(this.currentPage - 1) * this.paginationPageSize + index}_${Date.now()}`;
653
+ }
654
+ row.__checkbox = {
655
+ disabled: false,
656
+ checked: ((_a = this.selectedRows) === null || _a === void 0 ? void 0 : _a.has(row.__rowId)) || false,
657
+ size: 's',
658
+ indeterminate: false,
659
+ error: false,
660
+ };
661
+ });
662
+ }
711
663
  this.rowData = rows;
712
664
  this.matchingResultsCount = total;
713
665
  if (this.gridApi) {
714
666
  this.gridApi.setGridOption('rowData', rows);
715
- this.updateHeaderCheckboxState();
716
667
  }
717
668
  const paginationElement = this.host.shadowRoot.querySelector('ifx-pagination');
718
669
  if (paginationElement) {
@@ -745,7 +696,6 @@ const Table = class {
745
696
  if (this.gridApi) {
746
697
  this.gridApi.setGridOption('rowData', this.rowData);
747
698
  }
748
- this.updateHeaderCheckboxState();
749
699
  }
750
700
  }
751
701
  clearAllFilters() {
@@ -903,32 +853,15 @@ const Table = class {
903
853
  }
904
854
  async handlePageChange(event) {
905
855
  this.currentPage = event.detail.currentPage;
906
- if (this.serverSidePagination) {
907
- this.selectAll = false;
908
- }
909
856
  if (this.serverSidePagination && this.serverPageChangeHandler) {
910
857
  const { rows, total } = await this.serverPageChangeHandler({
911
858
  page: this.currentPage,
912
859
  pageSize: this.paginationPageSize,
913
860
  });
914
- // Add checkbox properties to rows
915
- rows.forEach((row, index) => {
916
- var _a;
917
- const rowId = row.sampleNumber || `row_${(this.currentPage - 1) * this.paginationPageSize + index}`;
918
- row.__rowId = rowId;
919
- row.__checkbox = {
920
- disabled: false,
921
- checked: ((_a = this.selectedRows) === null || _a === void 0 ? void 0 : _a.has(rowId)) || false,
922
- size: 's',
923
- indeterminate: false,
924
- error: false,
925
- };
926
- });
927
861
  this.rowData = rows;
928
862
  this.matchingResultsCount = total;
929
863
  if (this.gridApi) {
930
864
  this.gridApi.setGridOption('rowData', this.rowData);
931
- this.updateHeaderCheckboxState();
932
865
  }
933
866
  const paginationElement = this.host.shadowRoot.querySelector('ifx-pagination');
934
867
  if (paginationElement) {
@@ -939,27 +872,8 @@ const Table = class {
939
872
  const startIndex = (this.currentPage - 1) * this.paginationPageSize;
940
873
  const endIndex = startIndex + this.paginationPageSize;
941
874
  const visibleRowData = this.allRowData.slice(startIndex, endIndex);
942
- if (this.enableSelection) {
943
- visibleRowData.forEach(row => {
944
- var _a, _b;
945
- if (!row.__checkbox) {
946
- row.__checkbox = {
947
- disabled: false,
948
- checked: ((_a = this.selectedRows) === null || _a === void 0 ? void 0 : _a.has(row.__rowId)) || false,
949
- size: 's',
950
- indeterminate: false,
951
- error: false,
952
- };
953
- }
954
- else {
955
- row.__checkbox.checked = ((_b = this.selectedRows) === null || _b === void 0 ? void 0 : _b.has(row.__rowId)) || false;
956
- }
957
- });
958
- }
959
- this.rowData = visibleRowData;
960
875
  if (this.gridApi) {
961
876
  this.gridApi.setGridOption('rowData', visibleRowData);
962
- this.updateHeaderCheckboxState();
963
877
  }
964
878
  }
965
879
  }
@@ -1009,9 +923,7 @@ const Table = class {
1009
923
  return rows.slice(0, this.paginationPageSize);
1010
924
  }
1011
925
  updateCheckboxStates() {
1012
- // Update checkboxes in the current view
1013
- const dataToUpdate = this.rowData;
1014
- dataToUpdate.forEach(row => {
926
+ this.allRowData.forEach(row => {
1015
927
  if (row.__checkbox) {
1016
928
  row.__checkbox.checked = this.selectedRows.has(row.__rowId);
1017
929
  }
@@ -1024,21 +936,20 @@ const Table = class {
1024
936
  }
1025
937
  }
1026
938
  emitSelectionChange() {
1027
- const selectedRowsArray = Array.from(this.selectedRowsData.values());
1028
- let isSelectAll;
1029
- if (this.serverSidePagination) {
1030
- // Server-side: select-all only applies to current page
1031
- isSelectAll = this.selectedRows.size === this.rowData.length && this.rowData.length > 0;
1032
- }
1033
- else {
1034
- // Client-side: select-all applies to ALL data across all pages
1035
- isSelectAll = this.selectedRows.size === this.allRowData.length && this.allRowData.length > 0;
1036
- }
939
+ const selectedRowsData = Array.from(this.selectedRows)
940
+ .map(rowId => {
941
+ const row = this.allRowData.find(r => r.__rowId === rowId);
942
+ if (!row)
943
+ return null;
944
+ const rowData = __rest(row, ["__checkbox", "__rowId"]);
945
+ return rowData;
946
+ })
947
+ .filter(row => row !== null);
1037
948
  this.host.dispatchEvent(new CustomEvent('ifxSelectionChange', {
1038
949
  detail: {
1039
- selectedRows: selectedRowsArray,
1040
- selectedCount: selectedRowsArray.length,
1041
- isSelectAll: isSelectAll,
950
+ selectedRows: selectedRowsData,
951
+ selectedCount: selectedRowsData.length,
952
+ isSelectAll: this.selectedRows.size === this.allRowData.length && this.allRowData.length > 0,
1042
953
  },
1043
954
  bubbles: true,
1044
955
  }));
@@ -1162,12 +1073,12 @@ const Table = class {
1162
1073
  };
1163
1074
  }
1164
1075
  const filterClass = this.filterOrientation === 'topbar' ? 'topbar-layout' : this.filterOrientation === 'none' ? '' : 'sidebar-layout';
1165
- return (h(Host, { key: '6e65d1e685e01446b302eb455c9c50633654e737' }, h("div", { key: 'a19a49374cbb31eba3e6830fd4f951939b6ac0ec', class: "table-container" }, this.filterOrientation === 'sidebar' && (h("div", { key: 'd23b2c69cba710a9a0a4c56a57dd2d885234a02e', class: "sidebar-btn" }, h("ifx-button", { key: 'ad545a0fdac95be05282825b4dd93259b5545415', type: "button", disabled: false, variant: "secondary", size: "m", target: "_blank", theme: "default", "full-width": "false", onClick: () => this.toggleSidebarFilters() }, h("ifx-icon", { key: '90593cbb33a5bbc7d7c06651611dc48898a7b05c', icon: "cross-16" }), this.showSidebarFilters ? 'Hide Filters' : 'Show Filters'))), h("div", { key: '0040c5c1490e1ae59e3b8735bf231db9aa43b582', class: filterClass }, this.filterOrientation === 'sidebar' && this.showSidebarFilters && (h("div", { key: '25df19d6d55a4f42d705a476bdc7acf465159865', class: "sidebar-container" }, h("div", { key: '71c760d9931e858f0b0d779e63b03658d2ea85ee', class: "filters-title-container" }, h("span", { key: '036e85ab74bd2f6f4e1556b9940f9bc65be3be63', class: "filters-title" }, "Filters")), h("div", { key: '752d883df46a8c23995764a7e1e15a3fbc1b6a37', class: "set-filter-wrapper-sidebar" }, (this.filterOrientation !== 'sidebar' || this.showSidebarFilters) && h("slot", { key: 'affdd08af207405e7ae811f9cfd359d24a7c57a9', name: "sidebar-filter" })))), this.filterOrientation !== 'none' && this.filterOrientation !== 'sidebar' && (h("div", { key: 'eb5eb4c3592408a16b31bbf8a1f6e7a7a93009c1', class: "set-filter-wrapper-topbar" }, (this.filterOrientation !== 'sidebar' || this.showSidebarFilters) && h("slot", { key: '8d604394fee9cdd4b9f5a5f9c9048a86d138a7e6', name: "topbar-filter" }))), h("div", { key: '33075e7e5a8cf24a834784e30dd43fef11f23fba', class: "table-pagination-wrapper" }, this.filterOrientation !== 'none' && this.filterOrientation !== 'topbar' && this.showSidebarFilters && (h("div", { key: '46d8fc50da97745a1a2b2359489934ce0d9569a8', class: "filter-chips" }, Object.keys(this.currentFilters).map(name => {
1076
+ return (h(Host, { key: '66b9e97b36c201f86732fbd1452819419d739fd3' }, h("div", { key: 'a5c54e731669b840a732b9cf4de334a09c37ccb0', class: "table-container" }, this.filterOrientation === 'sidebar' && (h("div", { key: '786e0cdf15170384f5dfb34995db3f5ca3c419d4', class: "sidebar-btn" }, h("ifx-button", { key: '7097db9958849a342a4918dc96441ba4275539b1', type: "button", disabled: false, variant: "secondary", size: "m", target: "_blank", theme: "default", "full-width": "false", onClick: () => this.toggleSidebarFilters() }, h("ifx-icon", { key: '8005336599ce5aa87ddc1973f8005d8bd7a03551', icon: "cross-16" }), this.showSidebarFilters ? 'Hide Filters' : 'Show Filters'))), h("div", { key: '875c2049c9d4745ec5a40f14fab62d4394b8f63a', class: filterClass }, this.filterOrientation === 'sidebar' && this.showSidebarFilters && (h("div", { key: 'c87a5a9a5bb27915e6170ebe139bced53164136f', class: "sidebar-container" }, h("div", { key: '14420330d730046eda3e9049bd6df5fd66222693', class: "filters-title-container" }, h("span", { key: 'a8f006c463b5858daf5f9ff191287a1dc7be24ef', class: "filters-title" }, "Filters")), h("div", { key: '201324d69551491db05dae532a080460527e8a79', class: "set-filter-wrapper-sidebar" }, (this.filterOrientation !== 'sidebar' || this.showSidebarFilters) && h("slot", { key: '3a3be2bc00d1148fa21cf692a077f85625cafdec', name: "sidebar-filter" })))), this.filterOrientation !== 'none' && this.filterOrientation !== 'sidebar' && (h("div", { key: '3d20934e66c39335c8966599b13be1acc48338b2', class: "set-filter-wrapper-topbar" }, (this.filterOrientation !== 'sidebar' || this.showSidebarFilters) && h("slot", { key: 'b45be18917095b816833ac7ac30260d51a29eb5c', name: "topbar-filter" }))), h("div", { key: '490b41840efb18253618d0a838d7a31ebaac6001', class: "table-pagination-wrapper" }, this.filterOrientation !== 'none' && this.filterOrientation !== 'topbar' && this.showSidebarFilters && (h("div", { key: '51a213af18af7b58e36551239eba437bce8a2b51', class: "filter-chips" }, Object.keys(this.currentFilters).map(name => {
1166
1077
  const filter = this.currentFilters[name];
1167
1078
  const filterValues = filter.filterValues;
1168
1079
  const isMultiSelect = filter.type !== 'text';
1169
1080
  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;
1170
- }))), h("div", { key: '550d81b83063f53f46d0fbae4cb9ab14cc851f85', class: "headline-wrapper" }, this.filterOrientation !== 'none' && this.headline && (h("div", { key: '4cdb1ae6ceaf431043c90d67878f8331e22cee69', class: "matching-results-container" }, h("span", { key: 'e016eaa45a596a8ed58a0299e32971a8fc359a37', class: "matching-results-count" }, "(", this.matchingResultsCount, ")"), h("span", { key: '733a37a944479ae3cca7b5eb2dc071f9c4633bda', class: "matching-results-text" }, this.headline))), h("div", { key: '0d56c5a4858011afeeeb449093671a263f29ef07', class: "inner-buttons-wrapper" }, h("slot", { key: '3124df956c8213e083c21a6d2a65ca2195fffa35', name: "inner-button" }))), h("div", { key: '8b5ac864fa27af705a367c66233687ff7ccfd735', id: "table-wrapper", class: this.getTableClassNames() }, h("div", { key: '977a875c21adaa413cf3b01bb31571e9673481b2', id: `ifxTable-${this.uniqueKey}`, class: `ifx-ag-grid ${this.variant === 'zebra' ? 'zebra' : ''}`, style: style, ref: el => (this.container = el) })), h("div", { key: '2ebc0a7a053aad1d87e1a998537c1e351fe52d82', 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))))));
1081
+ }))), h("div", { key: '4cda426751074f84547a5f6870308ab48dfdab03', class: "headline-wrapper" }, this.filterOrientation !== 'none' && this.headline && (h("div", { key: 'c538c15f038caf9a0ba2c56a2d3e114c40112b01', class: "matching-results-container" }, h("span", { key: '9c263730471d93cfe519e4d2b68c5fbc13f612d1', class: "matching-results-count" }, "(", this.matchingResultsCount, ")"), h("span", { key: '34d9334bce111c93e6e813916a06282f11071fab', class: "matching-results-text" }, this.headline))), h("div", { key: '031ef0ce92afc9ad6fbc2c4c1b8849fcefdf7213', class: "inner-buttons-wrapper" }, h("slot", { key: '4e77698e25702ee13640fac3e24558ce5e5518b7', name: "inner-button" }))), h("div", { key: '36f1cdcd7c9560c3f3f8fbaad2d37b27e99483f5', id: "table-wrapper", class: this.getTableClassNames() }, h("div", { key: '12284c6b014a6fd63b20c8ccb95c0f181ef7557e', id: `ifxTable-${this.uniqueKey}`, class: `ifx-ag-grid ${this.variant === 'zebra' ? 'zebra' : ''}`, style: style, ref: el => (this.container = el) })), h("div", { key: '5a768d894603d010c52deb2867a8bcfd953ddaac', 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))))));
1171
1082
  }
1172
1083
  hasButtonCol() {
1173
1084
  return this.getColData().some(column => column.field === 'button');