@infineon/infineon-design-system-stencil 37.6.1--canary.1972.c978f8ac91ef429bb1f8bacc092c1bd327faa594.0 → 37.6.1--canary.1966.24e8efd5e58438d060c76865d601e2b4499cabc4.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 (26) hide show
  1. package/dist/cjs/ifx-modal.cjs.entry.js +4 -4
  2. package/dist/cjs/ifx-modal.cjs.entry.js.map +1 -1
  3. package/dist/cjs/ifx-table.cjs.entry.js +2 -7
  4. package/dist/cjs/ifx-table.cjs.entry.js.map +1 -1
  5. package/dist/collection/components/modal/modal.js +4 -4
  6. package/dist/collection/components/modal/modal.js.map +1 -1
  7. package/dist/collection/components/table-advanced-version/table.js +2 -7
  8. package/dist/collection/components/table-advanced-version/table.js.map +1 -1
  9. package/dist/components/ifx-modal.js +4 -4
  10. package/dist/components/ifx-modal.js.map +1 -1
  11. package/dist/components/ifx-table.js +2 -7
  12. package/dist/components/ifx-table.js.map +1 -1
  13. package/dist/esm/ifx-modal.entry.js +4 -4
  14. package/dist/esm/ifx-modal.entry.js.map +1 -1
  15. package/dist/esm/ifx-table.entry.js +2 -7
  16. package/dist/esm/ifx-table.entry.js.map +1 -1
  17. package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
  18. package/dist/infineon-design-system-stencil/{p-d8755b62.entry.js → p-5afef060.entry.js} +2 -2
  19. package/dist/infineon-design-system-stencil/p-5afef060.entry.js.map +1 -0
  20. package/dist/infineon-design-system-stencil/p-c99f2f00.entry.js +2 -0
  21. package/dist/infineon-design-system-stencil/{p-3b22661a.entry.js.map → p-c99f2f00.entry.js.map} +1 -1
  22. package/dist/types/components/modal/modal.d.ts +1 -1
  23. package/dist/types/components/table-advanced-version/table.d.ts +0 -1
  24. package/package.json +1 -1
  25. package/dist/infineon-design-system-stencil/p-3b22661a.entry.js +0 -2
  26. package/dist/infineon-design-system-stencil/p-d8755b62.entry.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ButtonCellRenderer","init","params","this","createButton","getGui","eGui","refresh","updateButton","config","data","button","options","colDef","cellRendererParams","document","createElement","eButton","hasRequiredKeys","setButtonAttributes","appendChild","attachEventListener","innerHTML","detachEventListener","setAttribute","disabled","toString","variant","theme","type","size","fullWidth","target","href","textContent","text","eventListener","event","onButtonClick","addEventListener","removeEventListener","CustomNoRowsOverlay","noRowsMessageFunc","_params","CustomLoadingOverlay","tableCss","IfxTableStyle0","Table","constructor","hostRef","currentPage","rowData","colData","filterOptions","currentFilters","allRowData","rowHeight","tableHeight","pagination","paginationPageSize","filterOrientation","showSidebarFilters","matchingResultsCount","showLoading","originalRowData","handleChipChange","name","currentSelection","previousSelection","detail","updatedFilters","Object","assign","length","customEvent","CustomEvent","filterName","bubbles","composed","host","dispatchEvent","filterValues","map","selection","value","applyAllFilters","updateTableView","onButtonRendererOptionsChanged","getColData","gridApi","setColumnDefs","toggleSidebarFilters","updateFilterOptions","col","field","Set","row","handleSidebarFilterChange","filterGroups","forEach","filterGroup","filterGroupName","selectedItems","item","label","handleTopbarFilterChange","filters","filter","filterInfo","selectedValues","toLowerCase","textFilterMatched","property","hasOwnProperty","rowValue","String","some","filterValue","startsWith","includesUndefined","includes","startIndex","endIndex","visibleRowData","slice","setGridOption","clearAllFilters","onBtShowLoading","showLoadingOverlay","componentWillLoad","uniqueKey","Math","floor","random","getRowData","gridOptions","headerHeight","defaultColDef","resizable","suppressDragLeaveHidesColumns","enableCellTextSelection","onFirstDataRendered","bind","columnDefs","loadingOverlayComponent","noRowsOverlayComponent","noRowsOverlayComponentParams","icons","sortAscending","sortDescending","sortUnSort","rowDragManaged","dndSource","animateRows","componentDidRender","componentDidLoad","container","isNestedInIfxComponent","framework","detectFramework","trackComponent","createGrid","sizeColumnsToFit","defaultMinWidth","paginationElement","shadowRoot","querySelector","handlePageChange","sidebarFilterElements","querySelectorAll","sidebarFilterElement","topbarFilterElements","topbarFilterElement","componentWillUnmount","sidebarFilters","sidebarFilter","topbarFilters","topbarFilter","isJSONParseable","str","JSON","parse","e","rows","undefined","Array","isArray","console","error","cols","buttonColumn","find","column","cellRenderer","valueFormatter","buttonRendererOptions","api","handleResetButtonClick","resetEvent","window","disconnectedCallback","resetButton","getTableClassNames","classNames","render","style","height","filterClass","h","Host","key","class","onClick","icon","keys","isMultiSelect","placeholder","readOnly","selected","id","ref","el","total","hasButtonCol","onDragOver","dragSupported","dataTransfer","dropEffect","preventDefault","onDrop","jsonData","getData","eJsonRow","classList","add","innerText","eJsonDisplay"],"sources":["src/components/table-advanced-version/buttonCellRenderer.ts","src/components/table-advanced-version/customNoRowsOverlay.ts","src/components/table-advanced-version/customLoadingOverlay.ts","src/components/table-advanced-version/table.scss?tag=ifx-table&encapsulation=shadow","src/components/table-advanced-version/table.tsx"],"sourcesContent":["import { ICellRendererComp, ICellRendererParams } from 'ag-grid-community';\nimport { ButtonInterface } from './interfaces';\n\nexport class ButtonCellRenderer implements ICellRendererComp {\n eGui!: HTMLDivElement;\n eButton!: HTMLElement; // Change to a generic HTMLElement to accommodate custom elements\n eventListener!: (event: Event) => void;\n\n init(params: ICellRendererParams) {\n this.createButton(params);\n }\n\n getGui() {\n return this.eGui;\n }\n\n refresh(params: ICellRendererParams) {\n this.updateButton(params);\n return true;\n }\n\n private createButton(params: ICellRendererParams) {\n const config = params.data.button;\n const options = params.colDef.cellRendererParams || {};\n \n this.eGui = document.createElement('div');\n this.eButton = document.createElement('ifx-button') as HTMLElement;\n \n if (this.hasRequiredKeys(config)) {\n this.setButtonAttributes(config);\n this.eGui.appendChild(this.eButton);\n this.attachEventListener(options, params);\n } else {\n this.eGui.innerHTML = `<span>${config}</span>`;\n }\n }\n\n private updateButton(params: ICellRendererParams) {\n const config = params.data.button;\n const options = params.colDef.cellRendererParams || {};\n \n if (this.hasRequiredKeys(config)) {\n this.setButtonAttributes(config);\n this.detachEventListener();\n this.attachEventListener(options, params);\n } else {\n this.eGui.innerHTML = `<span>${config}</span>`;\n }\n }\n\n private setButtonAttributes(config: ButtonInterface) {\n this.eButton.setAttribute('disabled', config.disabled.toString());\n this.eButton.setAttribute('variant', config.variant);\n this.eButton.setAttribute('theme', config.theme);\n this.eButton.setAttribute('type', config.type);\n this.eButton.setAttribute('size', config.size);\n this.eButton.setAttribute('full-width', config.fullWidth.toString());\n this.eButton.setAttribute('target', config.target);\n this.eButton.setAttribute('href', config.href);\n this.eButton.textContent = config.text;\n }\n\n private attachEventListener(options: any, params: ICellRendererParams) {\n this.eventListener = (event: Event) => {\n if (options.onButtonClick) {\n options.onButtonClick(params, event);\n }\n };\n this.eButton.addEventListener('click', this.eventListener);\n }\n\n private detachEventListener() {\n if (this.eventListener) {\n this.eButton.removeEventListener('click', this.eventListener);\n }\n }\n\n private hasRequiredKeys(config: ButtonInterface): boolean {\n return config && config.text !== '' && config.variant !== '' && config.size !== '' && config.type !== '';\n }\n}\n","import { ICellRendererComp, ICellRendererParams } from 'ag-grid-community';\n\nexport class CustomNoRowsOverlay implements ICellRendererComp {\n eGui!: HTMLElement;\n\n init(params: ICellRendererParams & { noRowsMessageFunc: () => string }) {\n this.eGui = document.createElement('div');\n this.eGui.innerHTML = `\n <div role=\"presentation\" class=\"ag-overlay-loading-center\" >\n ${params.noRowsMessageFunc()}\n </div>\n `;\n }\n\n getGui() {\n return this.eGui;\n }\n\n refresh(_params: ICellRendererParams): boolean {\n return false;\n }\n}","import { ICellRendererComp, ICellRendererParams } from 'ag-grid-community';\n\nexport class CustomLoadingOverlay implements ICellRendererComp {\n eGui!: HTMLElement;\n\n init(_params: ICellRendererParams & { loadingMessage: string }) {\n this.eGui = document.createElement('div');\n this.eGui.innerHTML = `<div class=\"ag-overlay-loading-center\" role=\"presentation\">\n<ifx-spinner></ifx-spinner>\n </div>`;\n }\n\n getGui() {\n return this.eGui;\n }\n\n refresh(_params: ICellRendererParams): boolean {\n return false;\n }\n}","@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n@import \"~ag-grid-community/styles/ag-grid.css\";\n\n.zebra { \n & .ag-row-odd { \n background-color: tokens.$ifxColorEngineering100!important;\n }\n\n & .ag-row { \n border-bottom: none!important;\n }\n}\n\n.ag-header-viewport { \n background-color: tokens.$ifxColorEngineering200!important;\n}\n\n\n.table-container {\n display: block;\n}\n\n.sidebar-btn {\n margin-bottom: 24px;\n}\n\n.sidebar-container {\n margin-right: 24px;\n}\n\n.sidebar-layout {\n display: flex;\n flex-direction: row;\n}\n\n.topbar-layout {\n display: flex;\n flex-direction: column;\n}\n\n.table-pagination-wrapper {\n display: flex;\n flex-direction: column;\n align-items: stretch; // stretches items to fill the container horizontally\n width: 100%; // ensures the wrapper takes up the full width of its parent\n}\n\n#table-wrapper {\n flex: 1; // allows the table to take up the remaining space\n padding-bottom: tokens.$ifxSpace100;\n}\n\n\n.table-wrapper .ag-root-wrapper-body {\n height: auto !important;\n min-height: 100px !important;\n min-width: 100px;\n}\n\n.filter-chips { \n display:flex;\n gap:tokens.$ifxSpace100;\n margin-bottom: 12px;\n}\n\n.filter-chips > ifx-button { // ifx-button with icon and text has a paddingof 16 px. This is to remove the padding to align with the filter-chips container definition\n margin-left: -8px;\n}\n\n.set-filter-wrapper-sidebar {\n display: flex;\n flex-direction: column;\n margin-bottom: tokens.$ifxSpace100;\n}\n\n.set-filter-wrapper-topbar {\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n margin-bottom: tokens.$ifxSpace100;\n background: tokens.$ifxColorEngineering100;\n padding-top: 32px;\n padding-bottom: 32px;\n gap: 24px;\n }\n\n\n.ifx-ag-grid {\n display: grid;\n height: 100%;\n width: 100%;\n min-width: 100px;\n //padding-bottom: tokens.$ifxSpace100;\n}\n\n\n.ifx-ag-grid .ag-header-cell::after {\n outline: none !important;\n border: none !important;\n box-shadow: none !important;\n}\n\n.ifx-ag-grid .ag-header-cell:focus {\n outline: none !important;\n}\n\n.ifx-ag-grid *:not(.ag-header-cell):focus {\n outline: none;\n}\n\n\n.ifx-ag-grid .ag-header-cell:not(:last-child)::before {\n content: '';\n position: absolute;\n right: 0;\n top: calc(50% - 12px);\n height: 24px; \n width: 1px;\n background-color: tokens.$ifxColorEngineering300; \n}\n\n\n.ag-overlay-loading-center {\n border: none;\n background: none;\n border-radius: none;\n box-shadow: none;\n}\n\n\n.ag-root-wrapper {\n border: 1px solid tokens.$ifxColorEngineering200;\n}\n\n\n\n.ag-header {\n background-color: tokens.$ifxColorEngineering100;\n border-bottom: none;\n\n &.ag-header-active {\n outline: none !important;\n border-color: #0A8276 !important;\n }\n}\n\n.ag-header-cell {\n padding-left: 16px;\n padding-right: 16px;\n gap: 4px;\n}\n\n\n.ag-header-cell-focus {\n border: none !important;\n outline: none !important;\n}\n\n.ag-header-cell-text {\n font-size: 13px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n color: tokens.$ifxColorBaseBlack;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n\n}\n\n.ag-row-focus {\n background-color: inherit !important;\n /* Reset the hover color to the row's original color */\n}\n\n.ag-row-hover {\n background-color: tokens.$ifxColorBaseWhite !important; //inherit !important;\n /* Reset the hover color to the row's original color */\n}\n\n\n.ag-cell-focus {\n border: none !important;\n outline: none !important;\n background-color: inherit !important;\n}\n\n\n\n.ag-row {\n background-color: tokens.$ifxColorBaseWhite;\n border-bottom: 1px solid tokens.$ifxColorEngineering200;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n z-index: 1; //ensure the stacking order when used inside js frameworks\n}\n\n.ag-row-odd {\n background-color: tokens.$ifxColorBaseWhite;\n}\n\n.ag-cell {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n align-items: center;\n\n}\n\n.ag-ltr .ag-sort-indicator-icon {\n padding-left: 0px;\n vertical-align: bottom;\n line-height: 12px;\n}\n\n.ag-sort-indicator-container .ag-sort-order { \n display: none;\n}\n\n.unsort-icon-custom-color {\n color: tokens.$ifxColorEngineering400;\n}\n\n\n// Table with set filters in sidebar orientation\n\n\n.filters-title {\n font-size: 24px;\n font-weight: 600;\n}\n\n\n.matching-results-container {\n display: flex;\n gap: 4px;\n font-size: 14px;\n}\n\n.matching-results-count {\n font-weight: 600;\n}\n\n.matching-results-text {\n font-weight: 400;\n}","import { Component, h, Host, Method, Element, Prop, State, Listen, Watch } from '@stencil/core';\nimport classNames from 'classnames';\nimport { trackComponent } from '../../global/utils/tracking'; \nimport { isNestedInIfxComponent } from '../../global/utils/dom-utils';\nimport { detectFramework } from '../../global/utils/framework-detection';\nimport { createGrid, FirstDataRenderedEvent, GridApi, GridOptions } from 'ag-grid-community';\nimport { ButtonCellRenderer } from './buttonCellRenderer';\nimport { CustomNoRowsOverlay } from './customNoRowsOverlay';\nimport { CustomLoadingOverlay } from './customLoadingOverlay';\n\n\n@Component({\n tag: 'ifx-table',\n styleUrl: 'table.scss',\n shadow: true\n})\nexport class Table {\n gridOptions: GridOptions;\n gridApi: GridApi;\n @State() currentPage: number = 1;\n @Prop() cols: any;\n @Prop() rows: any;\n @Prop() buttonRendererOptions?: { onButtonClick?: (params: any, event: Event) => void;}; \n @State() rowData: any[] = [];\n @State() colData: any[] = [];\n @State() filterOptions: { [key: string]: string[] } = {};\n @State() currentFilters = {};\n @State() uniqueKey: string;\n allRowData: any[] = [];\n @Prop() rowHeight: string = 'default';\n @Prop() tableHeight: string = 'auto';\n @Prop() pagination: boolean = true;\n @Prop() paginationPageSize: number = 10;\n @Prop() filterOrientation: string = 'sidebar'; // topbar / none\n @State() showSidebarFilters: boolean = true;\n @State() matchingResultsCount: number = 0;\n @Prop() variant: string = 'default'\n\n @Prop() showLoading: boolean = false;\n private container: HTMLDivElement;\n @Element() host: HTMLElement;\n originalRowData: any[] = [];\n\n @Listen('ifxChange')\n handleChipChange(event: CustomEvent<{ previousSelection: Array<any>, currentSelection: Array<any>, name: string }>) {\n const { name, currentSelection, previousSelection } = event.detail;\n if(currentSelection && previousSelection) { \n // Clone the current filters state\n const updatedFilters = { ...this.currentFilters };\n \n if (currentSelection.length === 0) {\n // If there are no selections for this filter, delete the filter\n delete updatedFilters[name];\n \n // Emit event with specific filter name\n const customEvent = new CustomEvent('ifxUpdateSidebarFilter', { detail: { filterName: name }, bubbles: true, composed: true });\n this.host.dispatchEvent(customEvent);\n } else {\n // Otherwise, update the filter values with the current selection\n updatedFilters[name].filterValues = currentSelection.map(selection => selection.value);\n }\n \n // Update the component's filters\n this.currentFilters = updatedFilters;\n \n // Ensure table data is updated\n this.allRowData = this.applyAllFilters(this.originalRowData, this.currentFilters);\n this.updateTableView();\n }\n }\n\n @Watch('buttonRendererOptions')\n onButtonRendererOptionsChanged() {\n this.colData = this.getColData(); // Re-fetch column data to apply new renderer options\n if (this.gridApi) {\n this.gridApi.setColumnDefs(this.colData); // Update column definitions in the grid API\n }\n }\n\n toggleSidebarFilters() {\n this.showSidebarFilters = !this.showSidebarFilters;\n }\n\n updateFilterOptions() {\n const options = {};\n for (let col of this.colData) {\n options[col.field] = [...new Set(this.rowData.map(row => row[col.field]))];\n }\n this.filterOptions = options;\n }\n\n handleSidebarFilterChange(event: CustomEvent) {\n const filterGroups = event.detail;\n const updatedFilters = {};\n\n filterGroups.forEach(filterGroup => {\n const filterName = filterGroup.filterGroupName;\n let filterValues;\n let type;\n\n if (filterGroup.selectedItems && filterGroup.selectedItems.length > 0) {\n filterValues = filterGroup.selectedItems.map(item => item.label);\n type = 'multi-select';\n } else if (filterGroup.value) {\n filterValues = [filterGroup.value];\n type = 'text';\n } else {\n filterValues = [];\n }\n\n if (!(filterValues.length === 0 || (filterValues.length === 1 && type === 'text' && filterValues[0] === ''))) {\n updatedFilters[filterName] = { filterValues, type };\n }\n });\n\n this.allRowData = this.applyAllFilters(this.originalRowData, updatedFilters);\n this.updateTableView();\n this.currentFilters = updatedFilters;\n }\n\n\n handleTopbarFilterChange(event: CustomEvent) {\n const filters = event.detail;\n\n // Start by resetting the filter conditions to a blank object\n this.currentFilters = {};\n\n // Loop through each filter group provided in the event detail\n filters.forEach(filter => {\n const filterName = filter.filterName;\n let filterValues;\n\n let type = filter.type;\n\n if (type === 'text') {\n // Search/Text filter\n filterValues = filter.filterValues\n } else {\n // Multi-select/Single-Select\n filterValues = filter.filterValues.map(item => item.label);\n }\n\n // If there are no filter values, or the filter is a text filter with an empty value, remove the filter\n if (!(filterValues.length === 0 || (filterValues.length === 1 && type === 'text' && filterValues[0] === ''))) {\n // Add or update the filter in the currentFilters object\n this.currentFilters[filterName] = { filterValues, type };\n }\n });\n\n\n // Now that the currentFilters object has been updated, apply all filters to the data\n this.allRowData = this.applyAllFilters(this.originalRowData, this.currentFilters);\n\n // After filtering, update the table view with the new filtered data\n this.updateTableView();\n }\n\n\n applyAllFilters(data, filters) {\n return data.filter(row => {\n for (const filterName in filters) {\n const filterInfo = filters[filterName];\n let selectedValues = (filterInfo.filterValues || []).map(value => {\n if (typeof value === 'string') {\n return value.toLowerCase();\n } else if (typeof value === 'number' || typeof value === 'boolean') {\n return value.toString();\n }\n return '';\n });\n\n // For text filters, check if row values start with any of the selectedValues\n if (filterInfo.type === 'text') {\n let textFilterMatched = false;\n for (let property in row) {\n if (row.hasOwnProperty(property)) {\n let rowValue = row[property] != null ? String(row[property]).toLowerCase() : '';\n if (selectedValues.some(filterValue => rowValue.startsWith(filterValue))) {\n textFilterMatched = true;\n break;\n }\n }\n }\n if (!textFilterMatched) return false;\n }\n // For multi-select filters, this remains unchanged\n else if (filterInfo.type === 'multi-select') {\n let rowValue = row[filterName] != null ? String(row[filterName]).toLowerCase() : '';\n // Check if 'undefined' is a selected value and include rows with empty values in that case\n let includesUndefined = selectedValues.includes('undefined');\n if (!selectedValues.includes(rowValue) && !(includesUndefined && rowValue === '')) {\n return false;\n }\n }\n }\n return true;\n });\n }\n\n\n\n updateTableView() {\n // Calculate the slice of data to display based on pagination\n const startIndex = (this.currentPage - 1) * this.paginationPageSize;\n const endIndex = startIndex + this.paginationPageSize;\n const visibleRowData = this.allRowData.slice(startIndex, endIndex);\n\n // Update the row data in the table\n this.rowData = visibleRowData;\n this.gridApi.setGridOption('rowData', this.rowData);\n\n // Update matching results count\n this.matchingResultsCount = this.allRowData.length;\n }\n\n\n clearAllFilters() {\n this.currentFilters = {};\n this.allRowData = [...this.originalRowData];\n }\n\n\n @Method()\n async onBtShowLoading() {\n this.gridApi.showLoadingOverlay();\n }\n\n componentWillLoad() {\n this.uniqueKey = `unique-${Math.floor(Math.random() * 1000000)}`;\n this.rowData = this.getRowData();\n this.colData = this.getColData();\n this.updateFilterOptions();\n\n this.gridOptions = {\n\n rowHeight: this.rowHeight === 'default' ? 40 : 32,\n headerHeight: 40,\n defaultColDef: {\n resizable: true,\n },\n suppressDragLeaveHidesColumns: true,\n enableCellTextSelection: true,\n onFirstDataRendered: this.onFirstDataRendered.bind(this),\n columnDefs: this.colData,\n rowData: this.rowData,\n loadingOverlayComponent: CustomLoadingOverlay,\n noRowsOverlayComponent: CustomNoRowsOverlay,\n noRowsOverlayComponentParams: {\n noRowsMessageFunc: () =>\n 'No rows found' //at: ' + new Date().toLocaleTimeString(),\n },\n icons: {\n sortAscending: '<ifx-icon icon=\"arrow-triangle-up-16\"></ifx-icon>',\n sortDescending: '<ifx-icon icon=\"arrow-triangle-down-16\"></ifx-icon>',\n sortUnSort: '<a class=\"unsort-icon-custom-color\"><ifx-icon icon=\"arrow-triangle-vertikal-16\"></ifx-icon></a>'\n },\n rowDragManaged: this.colData.some(col => col.dndSource === true) ? true : false,\n animateRows: this.colData.some(col => col.dndSource === true) ? true : false,\n };\n\n }\n\n componentDidRender() {\n if (this.gridApi) {\n this.gridApi.setGridOption('columnDefs', this.colData);\n }\n }\n\n async componentDidLoad() {\n if (this.container) {\n if(!isNestedInIfxComponent(this.host)) { \n const framework = detectFramework();\n trackComponent('ifx-table', await framework)\n }\n this.gridApi = createGrid(this.container, this.gridOptions);\n if (this.gridApi) {\n this.gridApi.sizeColumnsToFit({\n defaultMinWidth: 100,\n });\n this.gridApi.setGridOption('columnDefs', this.colData);\n this.gridApi.setGridOption('rowData', this.rowData);\n\n if (this.pagination) {\n const paginationElement = this.host.shadowRoot.querySelector('ifx-pagination');\n if (paginationElement) {\n paginationElement.addEventListener('ifxPageChange', this.handlePageChange.bind(this));\n }\n }\n const sidebarFilterElements = this.host.querySelectorAll('ifx-filter-type-group');\n // Add an event listener to each SetFilter component\n sidebarFilterElements.forEach(sidebarFilterElement => {\n sidebarFilterElement.addEventListener('ifxSidebarFilterChange', this.handleSidebarFilterChange.bind(this));\n });\n const topbarFilterElements = this.host.querySelectorAll('ifx-filter-bar');\n // Add an event listener to each SetFilter component\n topbarFilterElements.forEach(topbarFilterElement => {\n topbarFilterElement.addEventListener('ifxTopbarFilterChange', this.handleTopbarFilterChange.bind(this));\n });\n }\n }\n }\n\n componentWillUnmount() {\n if (this.pagination) {\n const paginationElement = this.host.shadowRoot.querySelector('ifx-pagination');\n if (paginationElement) {\n paginationElement.removeEventListener('ifxPageChange', this.handlePageChange.bind(this));\n }\n }\n const sidebarFilters = this.host.shadowRoot.querySelectorAll('ifx-filter-type-group');\n // Remove the event listener from each SetFilter component\n sidebarFilters.forEach(sidebarFilter => {\n sidebarFilter.removeEventListener('ifxSidebarFilterChange', this.handleSidebarFilterChange.bind(this));\n });\n const topbarFilters = this.host.shadowRoot.querySelectorAll('ifx-filter-type-group');\n // Remove the event listener from each SetFilter component\n topbarFilters.forEach(topbarFilter => {\n topbarFilter.removeEventListener('ifxTopbarFilterChange', this.handleTopbarFilterChange.bind(this));\n });\n }\n\n handlePageChange(event) {\n this.currentPage = event.detail.currentPage;\n const startIndex = (this.currentPage - 1) * this.paginationPageSize;\n const endIndex = startIndex + this.paginationPageSize;\n const visibleRowData = this.allRowData.slice(startIndex, endIndex);\n // Update the data in the grid\n if (this.gridApi) {\n this.gridApi.setGridOption('rowData', visibleRowData);\n }\n }\n\n isJSONParseable(str) {\n try {\n JSON.parse(str);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n\n getRowData() {\n let rows: any[] = [];\n if (this.rows === undefined || this.rows === null) {\n return rows;\n }\n \n if (this.isJSONParseable(this.rows)) {\n rows = [...JSON.parse(this.rows)];\n }\n else if (Array.isArray(this.rows) || typeof this.rows === 'object') {\n rows = [...this.rows];\n }\n else {\n console.error('Unexpected value for rows: ', this.rows);\n }\n\n this.allRowData = rows;\n this.originalRowData = [...rows]; // Deep copy the original data\n this.matchingResultsCount = this.allRowData.length;\n\n return rows.slice(0, this.paginationPageSize);\n }\n\n\n getColData() {\n let cols: any[] = [];\n if (this.cols === undefined || this.cols === null) {\n return cols;\n }\n \n if (this.isJSONParseable(this.cols)) {\n cols = [...JSON.parse(this.cols)];\n } else if (Array.isArray(this.cols) || typeof this.cols === 'object') {\n cols = [...this.cols];\n } else {\n console.error('Unexpected value for cols: ', this.cols);\n }\n \n const buttonColumn = cols.find(column => column.field === 'button');\n if (buttonColumn) {\n buttonColumn.cellRenderer = ButtonCellRenderer;\n buttonColumn.valueFormatter = params => params.value.text;\n \n // No JSON.parse needed now\n if (this.buttonRendererOptions && typeof this.buttonRendererOptions === 'object') {\n if (this.buttonRendererOptions.onButtonClick) {\n buttonColumn.cellRendererParams = {\n onButtonClick: this.buttonRendererOptions.onButtonClick\n };\n }\n }\n }\n \n return cols;\n }\n \n\n onFirstDataRendered(params: FirstDataRenderedEvent) {\n params.api.sizeColumnsToFit();\n }\n\n handleResetButtonClick() {\n const resetEvent = new CustomEvent('ifxResetFiltersEvent', { bubbles: true, composed: true });\n window.dispatchEvent(resetEvent); // Dispatch from the window object\n\n this.clearAllFilters();\n this.updateTableView(); // Update table view with the original data\n }\n\n\n disconnectedCallback() {\n if (this.pagination) {\n const paginationElement = this.host.shadowRoot.querySelector('ifx-pagination');\n if (paginationElement) {\n paginationElement.removeEventListener('ifxPageChange', this.handlePageChange);\n }\n }\n\n const resetButton = this.host.shadowRoot.querySelector('#reset-filters-button');\n if (resetButton) {\n resetButton.removeEventListener('click', this.handleResetButtonClick.bind(this));\n }\n }\n\n\n\n getTableClassNames() {\n return classNames(\n this.tableHeight === 'auto' && 'table-wrapper ag-root-wrapper-body',\n 'table-wrapper',\n );\n }\n\n\n render() {\n let style = {};\n if (this.tableHeight !== 'auto') {\n style = {\n 'height': this.tableHeight\n };\n }\n const filterClass = this.filterOrientation === 'topbar' ? 'topbar-layout' : 'sidebar-layout';\n return (\n <Host>\n <div class=\"table-container\">\n {this.filterOrientation === 'sidebar' && (\n <div class=\"sidebar-btn\">\n <ifx-button\n type=\"button\"\n disabled={false}\n variant=\"secondary\"\n size=\"m\"\n target=\"_blank\"\n theme=\"default\"\n full-width=\"false\"\n onClick={() => this.toggleSidebarFilters()}\n >\n <ifx-icon icon=\"cross-16\"></ifx-icon>{this.showSidebarFilters ? 'Hide Filters' : 'Show Filters'}\n </ifx-button>\n </div>\n )}\n\n <div class={filterClass}>\n {this.filterOrientation === 'sidebar' && this.showSidebarFilters && (\n <div class=\"sidebar-container\">\n <div class=\"filters-title-container\">\n <span class=\"filters-title\">Filters</span>\n </div>\n <div class=\"set-filter-wrapper-sidebar\">\n {(this.filterOrientation !== 'sidebar' || this.showSidebarFilters) && (\n <slot name=\"sidebar-filter\"></slot>\n )}\n </div>\n </div>\n )}\n\n {this.filterOrientation !== 'none' && this.filterOrientation !== 'sidebar' && (\n <div class=\"set-filter-wrapper-topbar\">\n {(this.filterOrientation !== 'sidebar' || this.showSidebarFilters) && (\n <slot name=\"topbar-filter\"></slot>\n )}\n </div>\n )}\n\n <div class=\"table-pagination-wrapper\">\n <div class=\"filter-chips\">\n {this.filterOrientation !== 'none' && this.filterOrientation !== 'topbar' && this.showSidebarFilters && (\n Object.keys(this.currentFilters).map(name => {\n const filter = this.currentFilters[name];\n const filterValues = filter.filterValues;\n const isMultiSelect = filter.type !== 'text';\n\n return filterValues.length > 0 ? (\n <ifx-chip\n placeholder={name}\n size=\"large\"\n variant={isMultiSelect ? \"multi\" : \"single\"}\n readOnly={true}\n value={filterValues} // Ensure value prop is set\n key={name}\n >\n {filterValues.map(filterValue => (\n <ifx-chip-item value={filterValue} selected={true} key={filterValue}>\n {filterValue}\n </ifx-chip-item>\n ))}\n </ifx-chip>\n ) : null;\n })\n )}\n\n {this.filterOrientation !== 'none' && this.filterOrientation === 'sidebar' && this.showSidebarFilters && Object.keys(this.currentFilters).length > 0 && (\n <ifx-button type=\"button\" disabled={false} variant=\"tertiary\" size=\"m\" target=\"_blank\" theme=\"default\" full-width=\"false\" onClick={() => this.handleResetButtonClick()}\n >\n <ifx-icon icon=\"curved-arrow-left-16\"></ifx-icon>Reset all\n </ifx-button>\n )}\n </div>\n\n {this.filterOrientation !== 'none' && (\n <div class=\"matching-results-container\">\n <span class=\"matching-results-count\">\n {this.matchingResultsCount}\n </span>\n <span class=\"matching-results-text\">\n matching results\n </span>\n </div>\n )}\n\n <div id=\"table-wrapper\" class={this.getTableClassNames()}>\n <div id={`ifxTable-${this.uniqueKey}`} class={`ifx-ag-grid ${this.variant === 'zebra' ? 'zebra' : \"\"}`} style={style} ref={(el) => this.container = el}>\n </div>\n </div>\n {this.pagination ? <ifx-pagination total={this.allRowData.length} current-page={this.currentPage} items-per-page='[{\"value\":\"ten\",\"label\":\"10\",\"selected\":true}, {\"value\":\"Twenty\",\"label\":\"20\",\"selected\":false}, {\"value\":\"Thirty\",\"label\":\"30\",\"selected\":false}]'></ifx-pagination> : null}\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n\n hasButtonCol(): boolean {\n return this.getColData().some(column => column.field === 'button');\n }\n\n onDragOver(event) {\n var dragSupported = event.dataTransfer.length;\n\n if (dragSupported) {\n event.dataTransfer.dropEffect = 'move';\n }\n\n event.preventDefault();\n }\n\n onDrop(event) {\n var jsonData = event.dataTransfer.getData('application/json');\n\n var eJsonRow = document.createElement('div');\n eJsonRow.classList.add('json-row');\n eJsonRow.innerText = jsonData;\n\n var eJsonDisplay = document.querySelector('#eJsonDisplay');\n\n eJsonDisplay.appendChild(eJsonRow);\n event.preventDefault();\n }\n\n}\n"],"mappings":"iNAGaA,EAKX,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AehN,KAAKwB,UAAY,QAAU,QAAU,KAAMkL,MAAOA,EAAOe,IAAMC,GAAO1N,KAAKyJ,UAAYiE,KAGrJ1N,KAAKuD,WAAasJ,EAAA,kBAAgBc,MAAO3N,KAAKoD,WAAWkB,OAAM,eAAgBtE,KAAK+C,YAAW,iBAAiB,uJAAyK,Q,CAStS,YAAA6K,GACE,OAAO5N,KAAKqF,aAAa4B,MAAK4E,GAAUA,EAAOlG,QAAU,U,CAG3D,UAAAkI,CAAW3L,GACT,IAAI4L,EAAgB5L,EAAM6L,aAAazJ,OAEvC,GAAIwJ,EAAe,CACjB5L,EAAM6L,aAAaC,WAAa,M,CAGlC9L,EAAM+L,gB,CAGR,MAAAC,CAAOhM,GACL,IAAIiM,EAAWjM,EAAM6L,aAAaK,QAAQ,oBAE1C,IAAIC,EAAWzN,SAASC,cAAc,OACtCwN,EAASC,UAAUC,IAAI,YACvBF,EAASG,UAAYL,EAErB,IAAIM,EAAe7N,SAASuJ,cAAc,iBAE1CsE,EAAaxN,YAAYoN,GACzBnM,EAAM+L,gB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as e,c as t,h as o,a as n,g as i}from"./p-b7a462e5.js";import{d as a,t as s}from"./p-08c92877.js";import{i as r}from"./p-1ecafb97.js";function d(e,t,o,n=20,i=0){const a=[];if(i>=n){return a}const s=e=>{const a=e.assignedNodes().filter((e=>e.nodeType===1));if(a.length>0){const e=a[0].parentElement;return d(e,t,o,n,i+1)}return[]};const r=Array.from(e.children||[]);for(const e of r){if(t(e)){continue}if(o(e)){a.push(e)}if(e.shadowRoot!=null){a.push(...d(e.shadowRoot,t,o,n,i+1))}else if(e.tagName==="SLOT"){a.push(...s(e))}else{a.push(...d(e,t,o,n,i+1))}}return a}function c(e){return e.hasAttribute("hidden")||e.hasAttribute("aria-hidden")&&e.getAttribute("aria-hidden")!=="false"||e.style.display===`none`||e.style.opacity===`0`||e.style.visibility===`hidden`||e.style.visibility===`collapse`}function l(e){return e.hasAttribute("disabled")||e.hasAttribute("aria-disabled")&&e.getAttribute("aria-disabled")!=="false"}function f(e){if(e.getAttribute("tabindex")==="-1"||c(e)||l(e)){return false}return e.hasAttribute("tabindex")||(e instanceof HTMLAnchorElement||e instanceof HTMLAreaElement)&&e.hasAttribute("href")||e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLIFrameElement}function h(e,t,o){const n=e.animate(t,Object.assign(Object.assign({},o),{fill:"both"}));n.addEventListener("finish",(()=>{n.commitStyles();n.cancel()}));return n}const b={easing:"cubic-bezier(0.390, 0.575, 0.565, 1.000)"};const m={fadeIn:[Object.assign(Object.assign({offset:0},b),{opacity:0}),Object.assign(Object.assign({offset:1},b),{opacity:1})],fadeOut:[Object.assign(Object.assign({offset:0},b),{opacity:1}),Object.assign(Object.assign({offset:1},b),{opacity:0})]};const u=':root{--ifx-font-family:"Source Sans 3", "Arial, sans-serif"}:host{display:block}.modal-container{display:none;justify-content:center;align-items:center;position:fixed;top:0;left:0;width:100%;height:100%;z-index:1060;overflow-y:auto;font-family:var(--ifx-font-family)}.modal-container.open{display:flex}.modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#1D1D1D;opacity:0.5;z-index:0}.modal-content-container{position:absolute;display:flex;justify-content:center;width:90%;min-height:218px;background-color:#fff;border-radius:0;box-shadow:0 2px 10px rgba(0, 0, 0, 0.1);box-sizing:border-box;align-items:stretch}.modal-content-container.no-overflow{overflow:hidden}.modal-content-container.no-overflow .modal-body{overflow-y:auto}@media screen and (min-width: 768px){.modal-content-container{width:540px;min-height:132px}.modal-content-container.m,.modal-content-container.l,.modal-content-container.s{width:90%}}@media screen and (min-width: 1024px){.modal-content-container.s{width:47vw}.modal-content-container.m{width:63vw}.modal-content-container.l{width:80%}}.modal-content{display:flex;flex-direction:column;width:100%;max-height:90vh}.modal-icon-container{display:flex;align-items:center;justify-content:center;width:32px;background-color:#0A8276;align-self:stretch}.modal-icon-container.danger{background-color:#CD002F}.modal-icon-container ifx-icon{color:#FFFFFF}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:24px;min-height:76px;max-height:105px;box-sizing:border-box;border-radius:1px 1px 0px 0px;border-bottom:1px solid #EEEDED}.modal-caption{max-height:56px;display:-webkit-box;overflow:hidden;white-space:pre-wrap;word-wrap:break-word;-webkit-line-clamp:2;-webkit-box-orient:vertical}.modal-header h2{margin:0;font-weight:600;font-size:1.25rem;line-height:28px}.modal-header button{background:none;border:none;font-size:1.5em;padding:0;cursor:pointer}.modal-close-button{align-self:flex-start;margin-right:-8px}.modal-body{padding:16px 24px;min-height:56px;box-sizing:border-box;flex:1}.modal-footer.buttons-present ::slotted(*){display:flex;justify-content:flex-end;gap:16px;padding:16px 24px 32px 16px}.modal-border{display:flex;align-items:center;justify-content:center;width:100%;font-size:1.5em;flex-grow:1}.modal-border.primary{background-color:#0A8276}.modal-border.secondary{background-color:#575352}.modal-border.danger{background-color:#CD002F}.modal-border.success{background-color:#4CA460}.modal-border.warning{background-color:#E16B25}.modal-border.orange{background-color:#E16B25}.modal-border.ocean{background-color:#0A8276}.modal-border.grey{background-color:#575352}.modal-border.grey-200{background-color:#EEEDED}.modal-border.red{background-color:#CD002F}.modal-border.green{background-color:#4CA460}.modal-border.berry{background-color:#9C216E}';const p=u;const g=class{constructor(o){e(this,o);this.ifxOpen=t(this,"ifxOpen",7);this.ifxClose=t(this,"ifxClose",7);this.opened=false;this.showModal=this.opened||false;this.caption="Modal Title";this.closeOnOverlayClick=true;this.variant="default";this.size="s";this.alertIcon="";this.okButtonLabel="OK";this.cancelButtonLabel="Cancel";this.slotButtonsPresent=false;this.showCloseButton=true;this.focusableElements=[];this.handleTopFocus=()=>{this.attemptFocus(this.getLastFocusableElement())};this.handleBottomFocus=()=>{this.attemptFocus(this.getFirstFocusableElement())};this.handleKeypress=e=>{if(!this.showModal){return}if(e.key==="Escape"){this.doBeforeClose("ESCAPE_KEY")}}}async componentDidLoad(){if(!r(this.hostElement)){const e=a();s("ifx-modal",await e)}this.focusableElements=d(this.hostElement.shadowRoot,(e=>c(e)||e.matches("[data-focus-trap-edge]")),f)}componentWillRender(){if(this.showModal){this.handleComponentOverflow()}}async handleComponentOverflow(){const e=this.hostElement.shadowRoot.querySelector(".modal-content-container");if(this.showModal&&await this.isModalContentContainerHeightReachedViewport()){e.classList.add("no-overflow")}else if(e===null||e===void 0?void 0:e.classList.contains("no-overflow")){e===null||e===void 0?void 0:e.classList.remove("no-overflow")}}getFirstFocusableElement(){return this.focusableElements[0]}getLastFocusableElement(){return this.focusableElements[this.focusableElements.length-1]}attemptFocus(e){if(e==null){setTimeout((()=>{this.closeButton.focus()}));return}setTimeout((()=>{e.focus()}),0)}open(){this.showModal=true;try{const e=h(this.modalContainer,m.fadeIn,{duration:200});e.addEventListener("finish",(()=>{setTimeout((()=>{var e,t;(e=this.getLastFocusableElement())===null||e===void 0?void 0:e.focus();(t=this.getLastFocusableElement())===null||t===void 0?void 0:t.blur()}),0);this.ifxOpen.emit()}));this.hostElement.addEventListener("keydown",this.handleKeypress)}catch(e){this.ifxOpen.emit()}}close(){try{const e=h(this.modalContainer,m.fadeOut,{duration:200});e.addEventListener("finish",(()=>{this.showModal=false;this.ifxClose.emit()}));this.hostElement.removeEventListener("keydown",this.handleKeypress)}catch(e){this.showModal=false;this.ifxClose.emit()}}doBeforeClose(e){const t=[];t.push(e);const o=t.some((e=>e.defaultPrevented));if(!o){this.opened=false}}openedChanged(e){if(e===true){this.open()}else{this.close()}}handleOverlayClick(){if(this.closeOnOverlayClick){this.doBeforeClose("BACKDROP")}}handleContentUpdate(e){const t=e.target;const o=t.assignedNodes();if(o.length>0){o.forEach((e=>{if(e.observer){e.observer.disconnect();delete e.observer}const t=new MutationObserver(((e,t)=>{for(let t of e){if(t.type==="childList"){if(this.showModal){this.handleComponentOverflow()}}}}));t.observe(e,{attributes:true,childList:true,subtree:true});e.observer=t}))}}handleButtonsSlotChange(e){var t;if(((t=e.currentTarget.assignedElements()[0])===null||t===void 0?void 0:t.childElementCount)>0){this.slotButtonsPresent=true}else{this.slotButtonsPresent=false}}isModalContentContainerHeightReachedViewport(){return new Promise((e=>{setTimeout((()=>{const t=this.hostElement.shadowRoot.querySelector(".modal-content");const o=t.offsetHeight;const n=window.innerHeight;e(o>=n*.9)}),100)}))}render(){const e=this.variant!=="default";return o(n,{key:"7c84f8ffdfff21cbada9e88a8565d8432d7b280d"},o("div",{key:"32d1cbf8ff758a474ed1366e0d8d30159d77c9e7",ref:e=>this.modalContainer=e,class:`modal-container ${this.showModal?"open":""}`},o("div",{key:"036a4ab1cfa90cb759a8613d21cd3d1dcf3ee74d",class:"modal-overlay",onClick:()=>this.handleOverlayClick()}),o("div",{key:"529ecb2daaab9133632c1937589f790e31610522","data-focus-trap-edge":true,onFocus:this.handleTopFocus,tabindex:"0"}),o("div",{key:"af950b569f582d07465797f39d7d79834ce3512b",class:`modal-content-container ${this.size}`,role:"dialog","aria-modal":"true","aria-label":this.caption},e?o("div",{class:`modal-icon-container ${this.variant==="alert-brand"?"":"danger"}`},this.alertIcon?o("ifx-icon",{icon:this.alertIcon}):null):null,o("div",{key:"6ddefbc12feb0f1c6269092dc948adc84617e8fb",class:"modal-content"},o("div",{key:"c82231719e7e0b8180b71b97c89fc2846b5ff79d",class:"modal-header"},o("h2",{key:"70ad4e29a330632fa3176066578e826a6f4e96db",class:"modal-caption"},this.caption),this.showCloseButton&&o("ifx-icon-button",{key:"2e9f091e469964c2e475caee8eb112a3e4fa0eae",class:"modal-close-button",ref:e=>this.closeButton=e,icon:"cross-16",variant:"tertiary",onClick:()=>this.doBeforeClose("CLOSE_BUTTON")})),o("div",{key:"517696fdc9de127624b6ed276e2deedd1c7ea6f8",class:"modal-body"},o("slot",{key:"f280964c1902a46fb81bb3e92195d20b31b2af1f",name:"content",onSlotchange:e=>this.handleContentUpdate(e)})),o("div",{key:"60f5005ec5bfe6ef0d05bf0135377c7c7715e649",class:`modal-footer ${this.slotButtonsPresent?"buttons-present":""}`},o("slot",{key:"4f334f79931102713261ba746c881595bda9306c",name:"buttons",onSlotchange:e=>this.handleButtonsSlotChange(e)})))),o("div",{key:"1527d25c162c439022a58255b95f627555ebe6d7","data-focus-trap-edge":true,onFocus:this.handleBottomFocus,tabindex:"0"})))}get hostElement(){return i(this)}static get watchers(){return{opened:["openedChanged"]}}};g.style=p;export{g as ifx_modal};
2
+ //# sourceMappingURL=p-c99f2f00.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["queryShadowRoot","root","skipNode","isMatch","maxDepth","depth","matches","traverseSlot","$slot","assignedNodes","filter","node","nodeType","length","$slotParent","parentElement","children","Array","from","$child","push","shadowRoot","tagName","isHidden","$elem","hasAttribute","getAttribute","style","display","opacity","visibility","isDisabled","isFocusable","HTMLAnchorElement","HTMLAreaElement","HTMLButtonElement","HTMLInputElement","HTMLTextAreaElement","HTMLSelectElement","HTMLIFrameElement","animationTo","element","keyframes","options","animated","animate","Object","assign","fill","addEventListener","commitStyles","cancel","keyframeDefaults","easing","KEYFRAMES","fadeIn","offset","fadeOut","modalCss","IfxModalStyle0","IfxModal","constructor","hostRef","this","opened","showModal","caption","closeOnOverlayClick","variant","size","alertIcon","okButtonLabel","cancelButtonLabel","slotButtonsPresent","showCloseButton","focusableElements","handleTopFocus","attemptFocus","getLastFocusableElement","handleBottomFocus","getFirstFocusableElement","handleKeypress","event","key","doBeforeClose","componentDidLoad","isNestedInIfxComponent","hostElement","framework","detectFramework","trackComponent","el","componentWillRender","handleComponentOverflow","modalContentContainer","querySelector","isModalContentContainerHeightReachedViewport","classList","add","contains","remove","setTimeout","closeButton","focus","open","anim","modalContainer","duration","_a","_b","blur","ifxOpen","emit","err","close","ifxClose","removeEventListener","trigger","triggers","prevented","some","defaultPrevented","openedChanged","newValue","handleOverlayClick","handleContentUpdate","e","slotElement","target","nodes","forEach","observer","disconnect","MutationObserver","mutationsList","_","mutation","type","observe","attributes","childList","subtree","handleButtonsSlotChange","currentTarget","assignedElements","childElementCount","Promise","resolve","modalContent","modalContentHeight","offsetHeight","viewportHeight","window","innerHeight","render","isAlertVariant","h","Host","ref","class","onClick","onFocus","tabindex","role","icon","name","onSlotchange"],"sources":["src/global/utils/focus-trap.ts","src/global/utils/animation.ts","src/components/modal/modal.scss?tag=ifx-modal&encapsulation=shadow","src/components/modal/modal.tsx"],"sourcesContent":["/**\n * Copy/pasted from https://github.com/andreasbm/focus-trap\n */\n\n/**\n * Traverses the slots of the open shadowroots and returns all children matching the query.\n * We need to traverse each child-depth one at a time because if an element should be skipped\n * (for example because it is hidden) we need to skip all of it's children. If we use querySelectorAll(\"*\")\n * the information of whether the children is within a hidden parent is lost.\n * @param {ShadowRoot | HTMLElement} root\n * @param skipNode\n * @param isMatch\n * @param {number} maxDepth\n * @param {number} depth\n * @returns {HTMLElement[]}\n */\nexport function queryShadowRoot(\n root: ShadowRoot | HTMLElement,\n skipNode: ($elem: HTMLElement) => boolean,\n isMatch: ($elem: HTMLElement) => boolean,\n maxDepth: number = 20,\n depth: number = 0\n): HTMLElement[] {\n const matches: HTMLElement[] = [];\n\n // If the depth is above the max depth, abort the searching here.\n if (depth >= maxDepth) {\n return matches;\n }\n\n // Traverses a slot element\n const traverseSlot = ($slot: HTMLSlotElement) => {\n // Only check nodes that are of the type Node.ELEMENT_NODE\n // Read more here https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\n const assignedNodes = $slot\n .assignedNodes()\n .filter((node) => node.nodeType === 1);\n if (assignedNodes.length > 0) {\n const $slotParent = assignedNodes[0].parentElement!;\n return queryShadowRoot(\n $slotParent,\n skipNode,\n isMatch,\n maxDepth,\n depth + 1\n );\n }\n\n return [];\n };\n\n // Go through each child and continue the traversing if necessary\n // Even though the typing says that children can't be undefined, Edge 15 sometimes gives an undefined value.\n // Therefore we fallback to an empty array if it is undefined.\n const children = Array.from(root.children || []) as HTMLElement[];\n for (const $child of children) {\n // Check if the element and its descendants should be skipped\n if (skipNode($child)) {\n // console.log('-- SKIP', $child);\n continue;\n }\n\n // console.log('$child', $child);\n\n // If the element matches we always add it\n if (isMatch($child)) {\n matches.push($child);\n }\n\n if ($child.shadowRoot != null) {\n // If the element has a shadow root we need to traverse it\n matches.push(\n ...queryShadowRoot(\n $child.shadowRoot,\n skipNode,\n isMatch,\n maxDepth,\n depth + 1\n )\n );\n } else if ($child.tagName === 'SLOT') {\n // If the child is a slot we need to traverse each assigned node\n matches.push(...traverseSlot($child as HTMLSlotElement));\n } else {\n // Traverse the children of the element\n matches.push(\n ...queryShadowRoot($child, skipNode, isMatch, maxDepth, depth + 1)\n );\n }\n }\n\n return matches;\n}\n\n/**\n * Returns whether the element is hidden.\n * @param $elem\n */\nexport function isHidden($elem: HTMLElement): boolean {\n return (\n $elem.hasAttribute('hidden') ||\n ($elem.hasAttribute('aria-hidden') &&\n $elem.getAttribute('aria-hidden') !== 'false') ||\n // A quick and dirty way to check whether the element is hidden.\n // For a more fine-grained check we could use \"window.getComputedStyle\" but we don't because of bad performance.\n // If the element has visibility set to \"hidden\" or \"collapse\", display set to \"none\" or opacity set to \"0\" through CSS\n // we won't be able to catch it here. We accept it due to the huge performance benefits.\n $elem.style.display === `none` ||\n $elem.style.opacity === `0` ||\n $elem.style.visibility === `hidden` ||\n $elem.style.visibility === `collapse`\n );\n\n // If offsetParent is null we can assume that the element is hidden\n // https://stackoverflow.com/questions/306305/what-would-make-offsetparent-null\n // || $elem.offsetParent == null;\n}\n\n/**\n * Returns whether the element is disabled.\n * @param $elem\n */\nexport function isDisabled($elem: HTMLElement): boolean {\n return (\n $elem.hasAttribute('disabled') ||\n ($elem.hasAttribute('aria-disabled') &&\n $elem.getAttribute('aria-disabled') !== 'false')\n );\n}\n\n/**\n * Determines whether an element is focusable.\n * Read more here: https://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus/1600194#1600194\n * Or here: https://stackoverflow.com/questions/18261595/how-to-check-if-a-dom-element-is-focusable\n * @param $elem\n */\nexport function isFocusable($elem: HTMLElement): boolean {\n // Discard elements that are removed from the tab order.\n if (\n $elem.getAttribute('tabindex') === '-1' ||\n isHidden($elem) ||\n isDisabled($elem)\n ) {\n return false;\n }\n\n return (\n // At this point we know that the element can have focus (eg. won't be -1) if the tabindex attribute exists\n $elem.hasAttribute('tabindex') ||\n // Anchor tags or area tags with a href set\n (($elem instanceof HTMLAnchorElement || $elem instanceof HTMLAreaElement) &&\n $elem.hasAttribute('href')) ||\n // Form elements which are not disabled\n $elem instanceof HTMLButtonElement ||\n $elem instanceof HTMLInputElement ||\n $elem instanceof HTMLTextAreaElement ||\n $elem instanceof HTMLSelectElement ||\n // IFrames\n $elem instanceof HTMLIFrameElement\n );\n}","export function animationTo(\n element: HTMLElement,\n keyframes: Keyframe | Keyframe[],\n options?: KeyframeAnimationOptions\n) {\n const animated = element.animate(keyframes, { ...options, fill: 'both' });\n animated.addEventListener('finish', () => {\n // @ts-ignore\n animated.commitStyles();\n animated.cancel();\n });\n\n return animated;\n}\n\nconst keyframeDefaults = {\n easing: 'cubic-bezier(0.390, 0.575, 0.565, 1.000)',\n};\n\nexport const KEYFRAMES = {\n fadeIn: [\n {\n offset: 0,\n ...keyframeDefaults,\n opacity: 0,\n },\n {\n offset: 1,\n ...keyframeDefaults,\n opacity: 1,\n },\n ],\n fadeOut: [\n {\n offset: 0,\n ...keyframeDefaults,\n opacity: 1,\n },\n {\n offset: 1,\n ...keyframeDefaults,\n opacity: 0,\n },\n ],\n};","@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n:host {\n display: block;\n}\n\n.modal-container {\n display: none;\n justify-content: center;\n align-items: center;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1060;\n overflow-y: auto;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n\n}\n\n.modal-container.open {\n display: flex;\n}\n\n.modal-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: tokens.$ifxColorBaseBlack;\n opacity: 0.5;\n z-index: 0;\n}\n\n.modal-content-container {\n position: absolute;\n display: flex;\n justify-content: center;\n width: 90%;\n min-height: 218px;\n background-color: #fff;\n border-radius: tokens.$ifxBorderRadiusNone;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n \n //overflow: hidden;\n\n box-sizing: border-box;\n align-items: stretch;\n}\n\n.modal-content-container {\n &.no-overflow { \n overflow: hidden;\n & .modal-body { \n overflow-y: auto;\n }\n }\n}\n\n/* Add desktop size here */\n@media screen and (min-width: 768px) {\n .modal-content-container {\n width: 540px;\n min-height: 132px;\n\n &.m,\n &.l,\n &.s {\n width: 90%;\n }\n }\n}\n\n@media screen and (min-width: 1024px) {\n .modal-content-container {\n\n &.s {\n width: 47vw;\n }\n\n &.m {\n width: 63vw;\n }\n\n &.l {\n width: 80%;\n }\n }\n}\n\n.modal-content {\n display: flex;\n flex-direction: column;\n width: 100%;\n max-height: 90vh;\n}\n\n.modal-icon-container {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n background-color: tokens.$ifxColorOcean500;\n align-self: stretch;\n\n &.danger {\n background-color: tokens.$ifxColorRed500;\n }\n\n & ifx-icon {\n color: tokens.$ifxColorBaseWhite;\n }\n}\n\n.modal-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 24px;\n min-height: 76px;\n max-height: 105px;\n box-sizing: border-box;\n border-radius: 1px 1px 0px 0px;\n border-bottom: 1px solid tokens.$ifxColorEngineering200;\n}\n\n.modal-caption {\n max-height: 56px;\n display: -webkit-box;\n overflow: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical; \n}\n\n.modal-header h2 {\n margin: 0;\n font-weight: tokens.$ifxFontWeightSemibold;\n font-size: tokens.$ifxFontSizeXl;\n line-height: 28px;\n}\n\n.modal-header button {\n background: none;\n border: none;\n font-size: 1.5em;\n padding: 0;\n cursor: pointer;\n}\n\n.modal-close-button {\n align-self: flex-start;\n margin-right: -8px;\n}\n\n.modal-body {\n padding: 16px 24px;\n min-height: 56px;\n box-sizing: border-box;\n flex: 1;\n \n //overflow-y: auto;\n}\n\n.modal-footer.buttons-present ::slotted(*){\n display: flex;\n justify-content: flex-end;\n gap: 16px;\n padding: 16px 24px 32px 16px\n}\n\n.modal-border {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n font-size: 1.5em;\n flex-grow: 1;\n\n &.primary {\n background-color: tokens.$ifxColorOcean500;\n }\n\n &.secondary {\n background-color: tokens.$ifxColorEngineering500;\n }\n\n &.danger {\n background-color: tokens.$ifxColorRed500;\n }\n\n &.success {\n background-color: tokens.$ifxColorGreen500;\n }\n\n &.warning {\n background-color: tokens.$ifxColorOrange500;\n }\n\n &.orange {\n background-color: tokens.$ifxColorOrange500;\n }\n\n &.ocean {\n background-color: tokens.$ifxColorOcean500;\n }\n\n &.grey {\n background-color: tokens.$ifxColorEngineering500;\n }\n\n &.grey-200 {\n background-color: tokens.$ifxColorEngineering200;\n }\n\n &.red {\n background-color: tokens.$ifxColorRed500;\n }\n\n &.green {\n background-color: tokens.$ifxColorGreen500;\n }\n\n &.berry {\n background-color: tokens.$ifxColorBerry500;\n }\n}","import { Component, Prop, Element, State, Event, Host, EventEmitter, h, Watch } from '@stencil/core';\nimport { trackComponent } from '../../global/utils/tracking';\nimport { isNestedInIfxComponent } from '../../global/utils/dom-utils';\nimport { detectFramework } from '../../global/utils/framework-detection';\nimport { queryShadowRoot, isHidden, isFocusable } from '../../global/utils/focus-trap';\nimport { animationTo, KEYFRAMES } from '../../global/utils/animation';\n \ntype CloseEventTrigger = 'CLOSE_BUTTON' | 'ESCAPE_KEY' | 'BACKDROP';\n\nexport interface BeforeCloseEventDetail {\n trigger: CloseEventTrigger;\n}\n@Component({\n tag: 'ifx-modal',\n styleUrl: 'modal.scss',\n shadow: true\n})\nexport class IfxModal {\n @Prop({ reflect: true, mutable: true }) opened?: boolean = false;\n @State() showModal: boolean = this.opened || false;\n\n @Prop() caption: string = 'Modal Title';\n @Prop() closeOnOverlayClick: boolean = true;\n\n @Event() ifxOpen: EventEmitter;\n @Event() ifxClose: EventEmitter;\n\n @Prop() variant: 'default' | 'alert-brand' | 'alert-danger' = 'default';\n \n @Prop() size: 's' | 'm' | 'l' = 's';\n\n @Prop() alertIcon: string = '';\n @Prop() okButtonLabel: string = 'OK';\n @Prop() cancelButtonLabel: string = 'Cancel';\n @Element() hostElement: HTMLElement;\n\n @State() slotButtonsPresent: boolean = false;\n\n @Prop() showCloseButton: boolean = true;\n\n private modalContainer: HTMLElement;\n private focusableElements: HTMLElement[] = [];\n private closeButton: HTMLButtonElement | HTMLIfxIconButtonElement;\n\n async componentDidLoad() {\n if(!isNestedInIfxComponent(this.hostElement)) { \n const framework = detectFramework();\n trackComponent('ifx-modal', await framework)\n }\n // Query all focusable elements and store them in `focusableElements`.\n // Needed for the \"focus trap\" functionality.\n this.focusableElements = queryShadowRoot(\n this.hostElement.shadowRoot,\n (el) => isHidden(el) || el.matches('[data-focus-trap-edge]'),\n isFocusable\n );\n }\n\n componentWillRender() { \n if(this.showModal) { \n this.handleComponentOverflow();\n }\n }\n\n handleComponentOverflow() { \n const modalContentContainer = this.hostElement.shadowRoot.querySelector('.modal-content-container');\n if (this.showModal && this.isModalContentContainerHeightReachedViewport()) {\n modalContentContainer.classList.add('no-overflow')\n } else if(modalContentContainer?.classList.contains('no-overflow')) { \n modalContentContainer?.classList.remove('no-overflow')\n }\n }\n\n getFirstFocusableElement(): HTMLElement | null {\n return this.focusableElements[0];\n }\n\n getLastFocusableElement(): HTMLElement | null {\n return this.focusableElements[this.focusableElements.length - 1];\n }\n\n handleTopFocus = () => {\n this.attemptFocus(this.getLastFocusableElement());\n };\n\n handleBottomFocus = () => {\n this.attemptFocus(this.getFirstFocusableElement());\n };\n\n attemptFocus(element: HTMLElement | null) {\n if (element == null) {\n setTimeout(() => { //wait until DOM is fully loaded\n this.closeButton.focus();\n },);\n return;\n }\n\n setTimeout(() => { //wait until DOM is fully loaded\n element.focus();\n }, 0);\n }\n\n open() {\n this.showModal = true;\n try {\n const anim = animationTo(this.modalContainer, KEYFRAMES.fadeIn, {\n duration: 200,\n });\n anim.addEventListener('finish', () => {\n // Setting focus on last item and removing immediately\n // so, on tab press first element is focused\n setTimeout(() => {\n this.getLastFocusableElement()?.focus();\n this.getLastFocusableElement()?.blur();\n }, 0);\n\n this.ifxOpen.emit();\n });\n\n this.hostElement.addEventListener('keydown', this.handleKeypress);\n } catch (err) {\n this.ifxOpen.emit();\n }\n }\n\n close() {\n try {\n const anim = animationTo(this.modalContainer, KEYFRAMES.fadeOut, {\n duration: 200,\n });\n anim.addEventListener('finish', () => {\n this.showModal = false;\n this.ifxClose.emit();\n });\n this.hostElement.removeEventListener('keydown', this.handleKeypress);\n } catch (err) {\n this.showModal = false;\n this.ifxClose.emit();\n }\n }\n\n handleKeypress = (event: KeyboardEvent) => {\n if (!this.showModal) {\n return;\n }\n if (event.key === 'Escape') {\n this.doBeforeClose('ESCAPE_KEY');\n }\n };\n\n doBeforeClose(trigger: CloseEventTrigger) {\n const triggers = [];\n triggers.push(trigger);\n const prevented = triggers.some((event) => event.defaultPrevented);\n if (!prevented) {\n this.opened = false;\n }\n }\n\n @Watch('opened')\n openedChanged(newValue) {\n if (newValue === true) {\n this.open();\n } else {\n this.close()\n }\n }\n\n handleOverlayClick() {\n if (this.closeOnOverlayClick) {\n this.doBeforeClose('BACKDROP')\n }\n }\n\n handleContentUpdate(e) {\n const slotElement = e.target;\n const nodes = slotElement.assignedNodes();\n if(nodes.length > 0) {\n nodes.forEach(node => {\n if (node.observer) {\n node.observer.disconnect();\n delete node.observer;\n }\n const observer = new MutationObserver((mutationsList, _) => {\n for(let mutation of mutationsList) {\n if (mutation.type === 'childList') {\n if(this.showModal) { \n this.handleComponentOverflow();\n }\n }\n }\n });\n observer.observe(node, { attributes: true, childList: true, subtree: true });\n node.observer = observer;\n });\n } \n }\n\n handleButtonsSlotChange(e) {\n if(e.currentTarget.assignedElements()[0]?.childElementCount > 0) {\n this.slotButtonsPresent = true;\n }else{\n this.slotButtonsPresent = false;\n }\n }\n\n isModalContentContainerHeightReachedViewport() {\n //Adding timeout for proper height detection on Edge browser\n return new Promise(resolve => {\n setTimeout(() => {\n const modalContent = this.hostElement.shadowRoot.querySelector('.modal-content') as HTMLElement;\n const modalContentHeight = modalContent.offsetHeight;\n const viewportHeight = window.innerHeight;\n resolve(modalContentHeight >= viewportHeight * 0.9);\n }, 100);\n });\n}\n\n\n render() {\n const isAlertVariant = this.variant !== 'default';\n return (\n <Host>\n <div\n ref={(el) => (this.modalContainer = el)}\n class={`modal-container ${this.showModal ? 'open' : ''}`}\n >\n <div\n class=\"modal-overlay\"\n onClick={() => this.handleOverlayClick()}\n ></div>\n <div\n data-focus-trap-edge\n onFocus={this.handleTopFocus}\n tabindex=\"0\"\n ></div>\n <div\n class={`modal-content-container ${this.size}`}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={this.caption}>\n {isAlertVariant ? (\n <div class={`modal-icon-container ${this.variant === 'alert-brand' ? '' : 'danger'}`}>\n {this.alertIcon ? <ifx-icon icon={this.alertIcon} /> : null}\n </div>\n ) : null}\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h2 class=\"modal-caption\">{this.caption}</h2>\n { \n this.showCloseButton && \n <ifx-icon-button class = 'modal-close-button' ref={(el) => (this.closeButton = el)} icon=\"cross-16\" variant=\"tertiary\" onClick={() => this.doBeforeClose('CLOSE_BUTTON') }>\n </ifx-icon-button>\n }\n </div>\n <div class=\"modal-body\">\n <slot name=\"content\" onSlotchange={(e) => this.handleContentUpdate(e)} />\n </div>\n <div class={`modal-footer ${this.slotButtonsPresent ? 'buttons-present' : ''}`}>\n <slot name=\"buttons\" onSlotchange={(e)=>this.handleButtonsSlotChange(e)}>\n </slot>\n </div>\n </div>\n </div>\n <div\n data-focus-trap-edge\n onFocus={this.handleBottomFocus}\n tabindex=\"0\"\n ></div>\n </div>\n </Host>\n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,2CAAK4E,MAAM,cACTH,EAAA,QAAAzE,IAAA,2CAAMkF,KAAK,UAAUC,aAAexC,GAAM/D,KAAK8D,oBAAoBC,MAErE8B,EAAA,OAAAzE,IAAA,2CAAK4E,MAAO,gBAAgBhG,KAAKU,mBAAqB,kBAAoB,MACxEmF,EAAA,QAAAzE,IAAA,2CAAMkF,KAAK,UAAUC,aAAexC,GAAI/D,KAAK+E,wBAAwBhB,QAK3E8B,EAAA,OAAAzE,IAAA,uEAEE8E,QAASlG,KAAKgB,kBACdmF,SAAS,O","ignoreList":[]}
1
+ {"version":3,"names":["queryShadowRoot","root","skipNode","isMatch","maxDepth","depth","matches","traverseSlot","$slot","assignedNodes","filter","node","nodeType","length","$slotParent","parentElement","children","Array","from","$child","push","shadowRoot","tagName","isHidden","$elem","hasAttribute","getAttribute","style","display","opacity","visibility","isDisabled","isFocusable","HTMLAnchorElement","HTMLAreaElement","HTMLButtonElement","HTMLInputElement","HTMLTextAreaElement","HTMLSelectElement","HTMLIFrameElement","animationTo","element","keyframes","options","animated","animate","Object","assign","fill","addEventListener","commitStyles","cancel","keyframeDefaults","easing","KEYFRAMES","fadeIn","offset","fadeOut","modalCss","IfxModalStyle0","IfxModal","constructor","hostRef","this","opened","showModal","caption","closeOnOverlayClick","variant","size","alertIcon","okButtonLabel","cancelButtonLabel","slotButtonsPresent","showCloseButton","focusableElements","handleTopFocus","attemptFocus","getLastFocusableElement","handleBottomFocus","getFirstFocusableElement","handleKeypress","event","key","doBeforeClose","componentDidLoad","isNestedInIfxComponent","hostElement","framework","detectFramework","trackComponent","el","componentWillRender","handleComponentOverflow","modalContentContainer","querySelector","isModalContentContainerHeightReachedViewport","classList","add","contains","remove","setTimeout","closeButton","focus","open","anim","modalContainer","duration","_a","_b","blur","ifxOpen","emit","err","close","ifxClose","removeEventListener","trigger","triggers","prevented","some","defaultPrevented","openedChanged","newValue","handleOverlayClick","handleContentUpdate","e","slotElement","target","nodes","forEach","observer","disconnect","MutationObserver","mutationsList","_","mutation","type","observe","attributes","childList","subtree","handleButtonsSlotChange","currentTarget","assignedElements","childElementCount","Promise","resolve","modalContent","modalContentHeight","offsetHeight","viewportHeight","window","innerHeight","render","isAlertVariant","h","Host","ref","class","onClick","onFocus","tabindex","role","icon","name","onSlotchange"],"sources":["src/global/utils/focus-trap.ts","src/global/utils/animation.ts","src/components/modal/modal.scss?tag=ifx-modal&encapsulation=shadow","src/components/modal/modal.tsx"],"sourcesContent":["/**\n * Copy/pasted from https://github.com/andreasbm/focus-trap\n */\n\n/**\n * Traverses the slots of the open shadowroots and returns all children matching the query.\n * We need to traverse each child-depth one at a time because if an element should be skipped\n * (for example because it is hidden) we need to skip all of it's children. If we use querySelectorAll(\"*\")\n * the information of whether the children is within a hidden parent is lost.\n * @param {ShadowRoot | HTMLElement} root\n * @param skipNode\n * @param isMatch\n * @param {number} maxDepth\n * @param {number} depth\n * @returns {HTMLElement[]}\n */\nexport function queryShadowRoot(\n root: ShadowRoot | HTMLElement,\n skipNode: ($elem: HTMLElement) => boolean,\n isMatch: ($elem: HTMLElement) => boolean,\n maxDepth: number = 20,\n depth: number = 0\n): HTMLElement[] {\n const matches: HTMLElement[] = [];\n\n // If the depth is above the max depth, abort the searching here.\n if (depth >= maxDepth) {\n return matches;\n }\n\n // Traverses a slot element\n const traverseSlot = ($slot: HTMLSlotElement) => {\n // Only check nodes that are of the type Node.ELEMENT_NODE\n // Read more here https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\n const assignedNodes = $slot\n .assignedNodes()\n .filter((node) => node.nodeType === 1);\n if (assignedNodes.length > 0) {\n const $slotParent = assignedNodes[0].parentElement!;\n return queryShadowRoot(\n $slotParent,\n skipNode,\n isMatch,\n maxDepth,\n depth + 1\n );\n }\n\n return [];\n };\n\n // Go through each child and continue the traversing if necessary\n // Even though the typing says that children can't be undefined, Edge 15 sometimes gives an undefined value.\n // Therefore we fallback to an empty array if it is undefined.\n const children = Array.from(root.children || []) as HTMLElement[];\n for (const $child of children) {\n // Check if the element and its descendants should be skipped\n if (skipNode($child)) {\n // console.log('-- SKIP', $child);\n continue;\n }\n\n // console.log('$child', $child);\n\n // If the element matches we always add it\n if (isMatch($child)) {\n matches.push($child);\n }\n\n if ($child.shadowRoot != null) {\n // If the element has a shadow root we need to traverse it\n matches.push(\n ...queryShadowRoot(\n $child.shadowRoot,\n skipNode,\n isMatch,\n maxDepth,\n depth + 1\n )\n );\n } else if ($child.tagName === 'SLOT') {\n // If the child is a slot we need to traverse each assigned node\n matches.push(...traverseSlot($child as HTMLSlotElement));\n } else {\n // Traverse the children of the element\n matches.push(\n ...queryShadowRoot($child, skipNode, isMatch, maxDepth, depth + 1)\n );\n }\n }\n\n return matches;\n}\n\n/**\n * Returns whether the element is hidden.\n * @param $elem\n */\nexport function isHidden($elem: HTMLElement): boolean {\n return (\n $elem.hasAttribute('hidden') ||\n ($elem.hasAttribute('aria-hidden') &&\n $elem.getAttribute('aria-hidden') !== 'false') ||\n // A quick and dirty way to check whether the element is hidden.\n // For a more fine-grained check we could use \"window.getComputedStyle\" but we don't because of bad performance.\n // If the element has visibility set to \"hidden\" or \"collapse\", display set to \"none\" or opacity set to \"0\" through CSS\n // we won't be able to catch it here. We accept it due to the huge performance benefits.\n $elem.style.display === `none` ||\n $elem.style.opacity === `0` ||\n $elem.style.visibility === `hidden` ||\n $elem.style.visibility === `collapse`\n );\n\n // If offsetParent is null we can assume that the element is hidden\n // https://stackoverflow.com/questions/306305/what-would-make-offsetparent-null\n // || $elem.offsetParent == null;\n}\n\n/**\n * Returns whether the element is disabled.\n * @param $elem\n */\nexport function isDisabled($elem: HTMLElement): boolean {\n return (\n $elem.hasAttribute('disabled') ||\n ($elem.hasAttribute('aria-disabled') &&\n $elem.getAttribute('aria-disabled') !== 'false')\n );\n}\n\n/**\n * Determines whether an element is focusable.\n * Read more here: https://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus/1600194#1600194\n * Or here: https://stackoverflow.com/questions/18261595/how-to-check-if-a-dom-element-is-focusable\n * @param $elem\n */\nexport function isFocusable($elem: HTMLElement): boolean {\n // Discard elements that are removed from the tab order.\n if (\n $elem.getAttribute('tabindex') === '-1' ||\n isHidden($elem) ||\n isDisabled($elem)\n ) {\n return false;\n }\n\n return (\n // At this point we know that the element can have focus (eg. won't be -1) if the tabindex attribute exists\n $elem.hasAttribute('tabindex') ||\n // Anchor tags or area tags with a href set\n (($elem instanceof HTMLAnchorElement || $elem instanceof HTMLAreaElement) &&\n $elem.hasAttribute('href')) ||\n // Form elements which are not disabled\n $elem instanceof HTMLButtonElement ||\n $elem instanceof HTMLInputElement ||\n $elem instanceof HTMLTextAreaElement ||\n $elem instanceof HTMLSelectElement ||\n // IFrames\n $elem instanceof HTMLIFrameElement\n );\n}","export function animationTo(\n element: HTMLElement,\n keyframes: Keyframe | Keyframe[],\n options?: KeyframeAnimationOptions\n) {\n const animated = element.animate(keyframes, { ...options, fill: 'both' });\n animated.addEventListener('finish', () => {\n // @ts-ignore\n animated.commitStyles();\n animated.cancel();\n });\n\n return animated;\n}\n\nconst keyframeDefaults = {\n easing: 'cubic-bezier(0.390, 0.575, 0.565, 1.000)',\n};\n\nexport const KEYFRAMES = {\n fadeIn: [\n {\n offset: 0,\n ...keyframeDefaults,\n opacity: 0,\n },\n {\n offset: 1,\n ...keyframeDefaults,\n opacity: 1,\n },\n ],\n fadeOut: [\n {\n offset: 0,\n ...keyframeDefaults,\n opacity: 1,\n },\n {\n offset: 1,\n ...keyframeDefaults,\n opacity: 0,\n },\n ],\n};","@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n:host {\n display: block;\n}\n\n.modal-container {\n display: none;\n justify-content: center;\n align-items: center;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1060;\n overflow-y: auto;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n\n}\n\n.modal-container.open {\n display: flex;\n}\n\n.modal-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: tokens.$ifxColorBaseBlack;\n opacity: 0.5;\n z-index: 0;\n}\n\n.modal-content-container {\n position: absolute;\n display: flex;\n justify-content: center;\n width: 90%;\n min-height: 218px;\n background-color: #fff;\n border-radius: tokens.$ifxBorderRadiusNone;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n \n //overflow: hidden;\n\n box-sizing: border-box;\n align-items: stretch;\n}\n\n.modal-content-container {\n &.no-overflow { \n overflow: hidden;\n & .modal-body { \n overflow-y: auto;\n }\n }\n}\n\n/* Add desktop size here */\n@media screen and (min-width: 768px) {\n .modal-content-container {\n width: 540px;\n min-height: 132px;\n\n &.m,\n &.l,\n &.s {\n width: 90%;\n }\n }\n}\n\n@media screen and (min-width: 1024px) {\n .modal-content-container {\n\n &.s {\n width: 47vw;\n }\n\n &.m {\n width: 63vw;\n }\n\n &.l {\n width: 80%;\n }\n }\n}\n\n.modal-content {\n display: flex;\n flex-direction: column;\n width: 100%;\n max-height: 90vh;\n}\n\n.modal-icon-container {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n background-color: tokens.$ifxColorOcean500;\n align-self: stretch;\n\n &.danger {\n background-color: tokens.$ifxColorRed500;\n }\n\n & ifx-icon {\n color: tokens.$ifxColorBaseWhite;\n }\n}\n\n.modal-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 24px;\n min-height: 76px;\n max-height: 105px;\n box-sizing: border-box;\n border-radius: 1px 1px 0px 0px;\n border-bottom: 1px solid tokens.$ifxColorEngineering200;\n}\n\n.modal-caption {\n max-height: 56px;\n display: -webkit-box;\n overflow: hidden;\n white-space: pre-wrap;\n word-wrap: break-word;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical; \n}\n\n.modal-header h2 {\n margin: 0;\n font-weight: tokens.$ifxFontWeightSemibold;\n font-size: tokens.$ifxFontSizeXl;\n line-height: 28px;\n}\n\n.modal-header button {\n background: none;\n border: none;\n font-size: 1.5em;\n padding: 0;\n cursor: pointer;\n}\n\n.modal-close-button {\n align-self: flex-start;\n margin-right: -8px;\n}\n\n.modal-body {\n padding: 16px 24px;\n min-height: 56px;\n box-sizing: border-box;\n flex: 1;\n \n //overflow-y: auto;\n}\n\n.modal-footer.buttons-present ::slotted(*){\n display: flex;\n justify-content: flex-end;\n gap: 16px;\n padding: 16px 24px 32px 16px\n}\n\n.modal-border {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n font-size: 1.5em;\n flex-grow: 1;\n\n &.primary {\n background-color: tokens.$ifxColorOcean500;\n }\n\n &.secondary {\n background-color: tokens.$ifxColorEngineering500;\n }\n\n &.danger {\n background-color: tokens.$ifxColorRed500;\n }\n\n &.success {\n background-color: tokens.$ifxColorGreen500;\n }\n\n &.warning {\n background-color: tokens.$ifxColorOrange500;\n }\n\n &.orange {\n background-color: tokens.$ifxColorOrange500;\n }\n\n &.ocean {\n background-color: tokens.$ifxColorOcean500;\n }\n\n &.grey {\n background-color: tokens.$ifxColorEngineering500;\n }\n\n &.grey-200 {\n background-color: tokens.$ifxColorEngineering200;\n }\n\n &.red {\n background-color: tokens.$ifxColorRed500;\n }\n\n &.green {\n background-color: tokens.$ifxColorGreen500;\n }\n\n &.berry {\n background-color: tokens.$ifxColorBerry500;\n }\n}","import { Component, Prop, Element, State, Event, Host, EventEmitter, h, Watch } from '@stencil/core';\nimport { trackComponent } from '../../global/utils/tracking';\nimport { isNestedInIfxComponent } from '../../global/utils/dom-utils';\nimport { detectFramework } from '../../global/utils/framework-detection';\nimport { queryShadowRoot, isHidden, isFocusable } from '../../global/utils/focus-trap';\nimport { animationTo, KEYFRAMES } from '../../global/utils/animation';\n \ntype CloseEventTrigger = 'CLOSE_BUTTON' | 'ESCAPE_KEY' | 'BACKDROP';\n\nexport interface BeforeCloseEventDetail {\n trigger: CloseEventTrigger;\n}\n@Component({\n tag: 'ifx-modal',\n styleUrl: 'modal.scss',\n shadow: true\n})\nexport class IfxModal {\n @Prop({ reflect: true, mutable: true }) opened?: boolean = false;\n @State() showModal: boolean = this.opened || false;\n\n @Prop() caption: string = 'Modal Title';\n @Prop() closeOnOverlayClick: boolean = true;\n\n @Event() ifxOpen: EventEmitter;\n @Event() ifxClose: EventEmitter;\n\n @Prop() variant: 'default' | 'alert-brand' | 'alert-danger' = 'default';\n \n @Prop() size: 's' | 'm' | 'l' = 's';\n\n @Prop() alertIcon: string = '';\n @Prop() okButtonLabel: string = 'OK';\n @Prop() cancelButtonLabel: string = 'Cancel';\n @Element() hostElement: HTMLElement;\n\n @State() slotButtonsPresent: boolean = false;\n\n @Prop() showCloseButton: boolean = true;\n\n private modalContainer: HTMLElement;\n private focusableElements: HTMLElement[] = [];\n private closeButton: HTMLButtonElement | HTMLIfxIconButtonElement;\n\n async componentDidLoad() {\n if(!isNestedInIfxComponent(this.hostElement)) { \n const framework = detectFramework();\n trackComponent('ifx-modal', await framework)\n }\n // Query all focusable elements and store them in `focusableElements`.\n // Needed for the \"focus trap\" functionality.\n this.focusableElements = queryShadowRoot(\n this.hostElement.shadowRoot,\n (el) => isHidden(el) || el.matches('[data-focus-trap-edge]'),\n isFocusable\n );\n }\n\n componentWillRender() { \n if(this.showModal) { \n this.handleComponentOverflow();\n }\n }\n\n async handleComponentOverflow() { \n const modalContentContainer = this.hostElement.shadowRoot.querySelector('.modal-content-container');\n if (this.showModal && await this.isModalContentContainerHeightReachedViewport()) {\n modalContentContainer.classList.add('no-overflow')\n } else if(modalContentContainer?.classList.contains('no-overflow')) { \n modalContentContainer?.classList.remove('no-overflow')\n }\n }\n\n getFirstFocusableElement(): HTMLElement | null {\n return this.focusableElements[0];\n }\n\n getLastFocusableElement(): HTMLElement | null {\n return this.focusableElements[this.focusableElements.length - 1];\n }\n\n handleTopFocus = () => {\n this.attemptFocus(this.getLastFocusableElement());\n };\n\n handleBottomFocus = () => {\n this.attemptFocus(this.getFirstFocusableElement());\n };\n\n attemptFocus(element: HTMLElement | null) {\n if (element == null) {\n setTimeout(() => { //wait until DOM is fully loaded\n this.closeButton.focus();\n },);\n return;\n }\n\n setTimeout(() => { //wait until DOM is fully loaded\n element.focus();\n }, 0);\n }\n\n open() {\n this.showModal = true;\n try {\n const anim = animationTo(this.modalContainer, KEYFRAMES.fadeIn, {\n duration: 200,\n });\n anim.addEventListener('finish', () => {\n // Setting focus on last item and removing immediately\n // so, on tab press first element is focused\n setTimeout(() => {\n this.getLastFocusableElement()?.focus();\n this.getLastFocusableElement()?.blur();\n }, 0);\n\n this.ifxOpen.emit();\n });\n\n this.hostElement.addEventListener('keydown', this.handleKeypress);\n } catch (err) {\n this.ifxOpen.emit();\n }\n }\n\n close() {\n try {\n const anim = animationTo(this.modalContainer, KEYFRAMES.fadeOut, {\n duration: 200,\n });\n anim.addEventListener('finish', () => {\n this.showModal = false;\n this.ifxClose.emit();\n });\n this.hostElement.removeEventListener('keydown', this.handleKeypress);\n } catch (err) {\n this.showModal = false;\n this.ifxClose.emit();\n }\n }\n\n handleKeypress = (event: KeyboardEvent) => {\n if (!this.showModal) {\n return;\n }\n if (event.key === 'Escape') {\n this.doBeforeClose('ESCAPE_KEY');\n }\n };\n\n doBeforeClose(trigger: CloseEventTrigger) {\n const triggers = [];\n triggers.push(trigger);\n const prevented = triggers.some((event) => event.defaultPrevented);\n if (!prevented) {\n this.opened = false;\n }\n }\n\n @Watch('opened')\n openedChanged(newValue) {\n if (newValue === true) {\n this.open();\n } else {\n this.close()\n }\n }\n\n handleOverlayClick() {\n if (this.closeOnOverlayClick) {\n this.doBeforeClose('BACKDROP')\n }\n }\n\n handleContentUpdate(e) {\n const slotElement = e.target;\n const nodes = slotElement.assignedNodes();\n if(nodes.length > 0) {\n nodes.forEach(node => {\n if (node.observer) {\n node.observer.disconnect();\n delete node.observer;\n }\n const observer = new MutationObserver((mutationsList, _) => {\n for(let mutation of mutationsList) {\n if (mutation.type === 'childList') {\n if(this.showModal) { \n this.handleComponentOverflow();\n }\n }\n }\n });\n observer.observe(node, { attributes: true, childList: true, subtree: true });\n node.observer = observer;\n });\n } \n }\n\n handleButtonsSlotChange(e) {\n if(e.currentTarget.assignedElements()[0]?.childElementCount > 0) {\n this.slotButtonsPresent = true;\n }else{\n this.slotButtonsPresent = false;\n }\n }\n\n isModalContentContainerHeightReachedViewport() {\n //Adding timeout for proper height detection on Edge browser\n return new Promise(resolve => {\n setTimeout(() => {\n const modalContent = this.hostElement.shadowRoot.querySelector('.modal-content') as HTMLElement;\n const modalContentHeight = modalContent.offsetHeight;\n const viewportHeight = window.innerHeight;\n resolve(modalContentHeight >= viewportHeight * 0.9);\n }, 100);\n });\n}\n\n\n render() {\n const isAlertVariant = this.variant !== 'default';\n return (\n <Host>\n <div\n ref={(el) => (this.modalContainer = el)}\n class={`modal-container ${this.showModal ? 'open' : ''}`}\n >\n <div\n class=\"modal-overlay\"\n onClick={() => this.handleOverlayClick()}\n ></div>\n <div\n data-focus-trap-edge\n onFocus={this.handleTopFocus}\n tabindex=\"0\"\n ></div>\n <div\n class={`modal-content-container ${this.size}`}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={this.caption}>\n {isAlertVariant ? (\n <div class={`modal-icon-container ${this.variant === 'alert-brand' ? '' : 'danger'}`}>\n {this.alertIcon ? <ifx-icon icon={this.alertIcon} /> : null}\n </div>\n ) : null}\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h2 class=\"modal-caption\">{this.caption}</h2>\n { \n this.showCloseButton && \n <ifx-icon-button class = 'modal-close-button' ref={(el) => (this.closeButton = el)} icon=\"cross-16\" variant=\"tertiary\" onClick={() => this.doBeforeClose('CLOSE_BUTTON') }>\n </ifx-icon-button>\n }\n </div>\n <div class=\"modal-body\">\n <slot name=\"content\" onSlotchange={(e) => this.handleContentUpdate(e)} />\n </div>\n <div class={`modal-footer ${this.slotButtonsPresent ? 'buttons-present' : ''}`}>\n <slot name=\"buttons\" onSlotchange={(e)=>this.handleButtonsSlotChange(e)}>\n </slot>\n </div>\n </div>\n </div>\n <div\n data-focus-trap-edge\n onFoc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AAS,IAAMjG,KAAKqB,cAAc,mBAI7JwE,EAAA,OAAAzE,IAAA,2CAAK4E,MAAM,cACTH,EAAA,QAAAzE,IAAA,2CAAMkF,KAAK,UAAUC,aAAexC,GAAM/D,KAAK8D,oBAAoBC,MAErE8B,EAAA,OAAAzE,IAAA,2CAAK4E,MAAO,gBAAgBhG,KAAKU,mBAAqB,kBAAoB,MACxEmF,EAAA,QAAAzE,IAAA,2CAAMkF,KAAK,UAAUC,aAAexC,GAAI/D,KAAK+E,wBAAwBhB,QAK3E8B,EAAA,OAAAzE,IAAA,uEAEE8E,QAASlG,KAAKgB,kBACdmF,SAAS,O","ignoreList":[]}
@@ -23,7 +23,7 @@ export declare class IfxModal {
23
23
  private closeButton;
24
24
  componentDidLoad(): Promise<void>;
25
25
  componentWillRender(): void;
26
- handleComponentOverflow(): void;
26
+ handleComponentOverflow(): Promise<void>;
27
27
  getFirstFocusableElement(): HTMLElement | null;
28
28
  getLastFocusableElement(): HTMLElement | null;
29
29
  handleTopFocus: () => void;
@@ -28,7 +28,6 @@ export declare class Table {
28
28
  private container;
29
29
  host: HTMLElement;
30
30
  originalRowData: any[];
31
- private itemsPerPage;
32
31
  handleChipChange(event: CustomEvent<{
33
32
  previousSelection: Array<any>;
34
33
  currentSelection: Array<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infineon/infineon-design-system-stencil",
3
- "version": "37.6.1--canary.1972.c978f8ac91ef429bb1f8bacc092c1bd327faa594.0",
3
+ "version": "37.6.1--canary.1966.24e8efd5e58438d060c76865d601e2b4499cabc4.0",
4
4
  "private": false,
5
5
  "description": "Infineon design system Stencil web components",
6
6
  "homepage": "https://infineon.github.io/infineon-design-system-stencil",
@@ -1,2 +0,0 @@
1
- import{r as e,c as t,h as o,a as n,g as i}from"./p-b7a462e5.js";import{d as a,t as s}from"./p-08c92877.js";import{i as d}from"./p-1ecafb97.js";function r(e,t,o,n=20,i=0){const a=[];if(i>=n){return a}const s=e=>{const a=e.assignedNodes().filter((e=>e.nodeType===1));if(a.length>0){const e=a[0].parentElement;return r(e,t,o,n,i+1)}return[]};const d=Array.from(e.children||[]);for(const e of d){if(t(e)){continue}if(o(e)){a.push(e)}if(e.shadowRoot!=null){a.push(...r(e.shadowRoot,t,o,n,i+1))}else if(e.tagName==="SLOT"){a.push(...s(e))}else{a.push(...r(e,t,o,n,i+1))}}return a}function c(e){return e.hasAttribute("hidden")||e.hasAttribute("aria-hidden")&&e.getAttribute("aria-hidden")!=="false"||e.style.display===`none`||e.style.opacity===`0`||e.style.visibility===`hidden`||e.style.visibility===`collapse`}function l(e){return e.hasAttribute("disabled")||e.hasAttribute("aria-disabled")&&e.getAttribute("aria-disabled")!=="false"}function f(e){if(e.getAttribute("tabindex")==="-1"||c(e)||l(e)){return false}return e.hasAttribute("tabindex")||(e instanceof HTMLAnchorElement||e instanceof HTMLAreaElement)&&e.hasAttribute("href")||e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLIFrameElement}function h(e,t,o){const n=e.animate(t,Object.assign(Object.assign({},o),{fill:"both"}));n.addEventListener("finish",(()=>{n.commitStyles();n.cancel()}));return n}const b={easing:"cubic-bezier(0.390, 0.575, 0.565, 1.000)"};const m={fadeIn:[Object.assign(Object.assign({offset:0},b),{opacity:0}),Object.assign(Object.assign({offset:1},b),{opacity:1})],fadeOut:[Object.assign(Object.assign({offset:0},b),{opacity:1}),Object.assign(Object.assign({offset:1},b),{opacity:0})]};const u=':root{--ifx-font-family:"Source Sans 3", "Arial, sans-serif"}:host{display:block}.modal-container{display:none;justify-content:center;align-items:center;position:fixed;top:0;left:0;width:100%;height:100%;z-index:1060;overflow-y:auto;font-family:var(--ifx-font-family)}.modal-container.open{display:flex}.modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#1D1D1D;opacity:0.5;z-index:0}.modal-content-container{position:absolute;display:flex;justify-content:center;width:90%;min-height:218px;background-color:#fff;border-radius:0;box-shadow:0 2px 10px rgba(0, 0, 0, 0.1);box-sizing:border-box;align-items:stretch}.modal-content-container.no-overflow{overflow:hidden}.modal-content-container.no-overflow .modal-body{overflow-y:auto}@media screen and (min-width: 768px){.modal-content-container{width:540px;min-height:132px}.modal-content-container.m,.modal-content-container.l,.modal-content-container.s{width:90%}}@media screen and (min-width: 1024px){.modal-content-container.s{width:47vw}.modal-content-container.m{width:63vw}.modal-content-container.l{width:80%}}.modal-content{display:flex;flex-direction:column;width:100%;max-height:90vh}.modal-icon-container{display:flex;align-items:center;justify-content:center;width:32px;background-color:#0A8276;align-self:stretch}.modal-icon-container.danger{background-color:#CD002F}.modal-icon-container ifx-icon{color:#FFFFFF}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:24px;min-height:76px;max-height:105px;box-sizing:border-box;border-radius:1px 1px 0px 0px;border-bottom:1px solid #EEEDED}.modal-caption{max-height:56px;display:-webkit-box;overflow:hidden;white-space:pre-wrap;word-wrap:break-word;-webkit-line-clamp:2;-webkit-box-orient:vertical}.modal-header h2{margin:0;font-weight:600;font-size:1.25rem;line-height:28px}.modal-header button{background:none;border:none;font-size:1.5em;padding:0;cursor:pointer}.modal-close-button{align-self:flex-start;margin-right:-8px}.modal-body{padding:16px 24px;min-height:56px;box-sizing:border-box;flex:1}.modal-footer.buttons-present ::slotted(*){display:flex;justify-content:flex-end;gap:16px;padding:16px 24px 32px 16px}.modal-border{display:flex;align-items:center;justify-content:center;width:100%;font-size:1.5em;flex-grow:1}.modal-border.primary{background-color:#0A8276}.modal-border.secondary{background-color:#575352}.modal-border.danger{background-color:#CD002F}.modal-border.success{background-color:#4CA460}.modal-border.warning{background-color:#E16B25}.modal-border.orange{background-color:#E16B25}.modal-border.ocean{background-color:#0A8276}.modal-border.grey{background-color:#575352}.modal-border.grey-200{background-color:#EEEDED}.modal-border.red{background-color:#CD002F}.modal-border.green{background-color:#4CA460}.modal-border.berry{background-color:#9C216E}';const p=u;const g=class{constructor(o){e(this,o);this.ifxOpen=t(this,"ifxOpen",7);this.ifxClose=t(this,"ifxClose",7);this.opened=false;this.showModal=this.opened||false;this.caption="Modal Title";this.closeOnOverlayClick=true;this.variant="default";this.size="s";this.alertIcon="";this.okButtonLabel="OK";this.cancelButtonLabel="Cancel";this.slotButtonsPresent=false;this.showCloseButton=true;this.focusableElements=[];this.handleTopFocus=()=>{this.attemptFocus(this.getLastFocusableElement())};this.handleBottomFocus=()=>{this.attemptFocus(this.getFirstFocusableElement())};this.handleKeypress=e=>{if(!this.showModal){return}if(e.key==="Escape"){this.doBeforeClose("ESCAPE_KEY")}}}async componentDidLoad(){if(!d(this.hostElement)){const e=a();s("ifx-modal",await e)}this.focusableElements=r(this.hostElement.shadowRoot,(e=>c(e)||e.matches("[data-focus-trap-edge]")),f)}componentWillRender(){if(this.showModal){this.handleComponentOverflow()}}handleComponentOverflow(){const e=this.hostElement.shadowRoot.querySelector(".modal-content-container");if(this.showModal&&this.isModalContentContainerHeightReachedViewport()){e.classList.add("no-overflow")}else if(e===null||e===void 0?void 0:e.classList.contains("no-overflow")){e===null||e===void 0?void 0:e.classList.remove("no-overflow")}}getFirstFocusableElement(){return this.focusableElements[0]}getLastFocusableElement(){return this.focusableElements[this.focusableElements.length-1]}attemptFocus(e){if(e==null){setTimeout((()=>{this.closeButton.focus()}));return}setTimeout((()=>{e.focus()}),0)}open(){this.showModal=true;try{const e=h(this.modalContainer,m.fadeIn,{duration:200});e.addEventListener("finish",(()=>{setTimeout((()=>{var e,t;(e=this.getLastFocusableElement())===null||e===void 0?void 0:e.focus();(t=this.getLastFocusableElement())===null||t===void 0?void 0:t.blur()}),0);this.ifxOpen.emit()}));this.hostElement.addEventListener("keydown",this.handleKeypress)}catch(e){this.ifxOpen.emit()}}close(){try{const e=h(this.modalContainer,m.fadeOut,{duration:200});e.addEventListener("finish",(()=>{this.showModal=false;this.ifxClose.emit()}));this.hostElement.removeEventListener("keydown",this.handleKeypress)}catch(e){this.showModal=false;this.ifxClose.emit()}}doBeforeClose(e){const t=[];t.push(e);const o=t.some((e=>e.defaultPrevented));if(!o){this.opened=false}}openedChanged(e){if(e===true){this.open()}else{this.close()}}handleOverlayClick(){if(this.closeOnOverlayClick){this.doBeforeClose("BACKDROP")}}handleContentUpdate(e){const t=e.target;const o=t.assignedNodes();if(o.length>0){o.forEach((e=>{if(e.observer){e.observer.disconnect();delete e.observer}const t=new MutationObserver(((e,t)=>{for(let t of e){if(t.type==="childList"){if(this.showModal){this.handleComponentOverflow()}}}}));t.observe(e,{attributes:true,childList:true,subtree:true});e.observer=t}))}}handleButtonsSlotChange(e){var t;if(((t=e.currentTarget.assignedElements()[0])===null||t===void 0?void 0:t.childElementCount)>0){this.slotButtonsPresent=true}else{this.slotButtonsPresent=false}}isModalContentContainerHeightReachedViewport(){return new Promise((e=>{setTimeout((()=>{const t=this.hostElement.shadowRoot.querySelector(".modal-content");const o=t.offsetHeight;const n=window.innerHeight;e(o>=n*.9)}),100)}))}render(){const e=this.variant!=="default";return o(n,{key:"0d573f93f0188f8255994ebd1f4355d0007d081e"},o("div",{key:"2909db24603f28a307a3d2f88b9df3f1cc496ef3",ref:e=>this.modalContainer=e,class:`modal-container ${this.showModal?"open":""}`},o("div",{key:"bc8994163ac10cc94fbf553bee4590e75cd94c9f",class:"modal-overlay",onClick:()=>this.handleOverlayClick()}),o("div",{key:"4c978da70c5de23b0f05396a29a8a7d77a998fac","data-focus-trap-edge":true,onFocus:this.handleTopFocus,tabindex:"0"}),o("div",{key:"45d00c0226bfaf81f076e9fe99c967b10a24f6e5",class:`modal-content-container ${this.size}`,role:"dialog","aria-modal":"true","aria-label":this.caption},e?o("div",{class:`modal-icon-container ${this.variant==="alert-brand"?"":"danger"}`},this.alertIcon?o("ifx-icon",{icon:this.alertIcon}):null):null,o("div",{key:"3db82f776b5ea0551a28b941a14812ddddf99a60",class:"modal-content"},o("div",{key:"f471b0e9429d3ee696a5921b201fe582ca5d94b5",class:"modal-header"},o("h2",{key:"5ea3807496762c5c99f5c8ee86f3d13b5a96b3b2",class:"modal-caption"},this.caption),this.showCloseButton&&o("ifx-icon-button",{key:"f725cab8121fa8caf5f3d61925d521a8935864d6",class:"modal-close-button",ref:e=>this.closeButton=e,icon:"cross-16",variant:"tertiary",onClick:()=>this.doBeforeClose("CLOSE_BUTTON")})),o("div",{key:"7c05913f69feb6ea5e7cc6957f1e051bd0dc1278",class:"modal-body"},o("slot",{key:"674d48b6361b1eece2bb4efd337d8ff1543e3c12",name:"content",onSlotchange:e=>this.handleContentUpdate(e)})),o("div",{key:"13680bcdc4115d945653aa606fda3f6d80cfa94f",class:`modal-footer ${this.slotButtonsPresent?"buttons-present":""}`},o("slot",{key:"de1f6c2c4ad5f3d36b68d825ba914784b271a6c6",name:"buttons",onSlotchange:e=>this.handleButtonsSlotChange(e)})))),o("div",{key:"373cf96a9d6a8783440bbff74fcd60d02f8884cc","data-focus-trap-edge":true,onFocus:this.handleBottomFocus,tabindex:"0"})))}get hostElement(){return i(this)}static get watchers(){return{opened:["openedChanged"]}}};g.style=p;export{g as ifx_modal};
2
- //# sourceMappingURL=p-3b22661a.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ButtonCellRenderer","init","params","this","createButton","getGui","eGui","refresh","updateButton","config","data","button","options","colDef","cellRendererParams","document","createElement","eButton","hasRequiredKeys","setButtonAttributes","appendChild","attachEventListener","innerHTML","detachEventListener","setAttribute","disabled","toString","variant","theme","type","size","fullWidth","target","href","textContent","text","eventListener","event","onButtonClick","addEventListener","removeEventListener","CustomNoRowsOverlay","noRowsMessageFunc","_params","CustomLoadingOverlay","tableCss","IfxTableStyle0","Table","constructor","hostRef","currentPage","rowData","colData","filterOptions","currentFilters","allRowData","rowHeight","tableHeight","pagination","paginationPageSize","filterOrientation","showSidebarFilters","matchingResultsCount","showLoading","originalRowData","itemsPerPage","JSON","stringify","value","label","selected","handleChipChange","name","currentSelection","previousSelection","detail","updatedFilters","Object","assign","length","customEvent","CustomEvent","filterName","bubbles","composed","host","dispatchEvent","filterValues","map","selection","applyAllFilters","updateTableView","onButtonRendererOptionsChanged","getColData","gridApi","setColumnDefs","toggleSidebarFilters","updateFilterOptions","col","field","Set","row","handleSidebarFilterChange","filterGroups","forEach","filterGroup","filterGroupName","selectedItems","item","handleTopbarFilterChange","filters","filter","filterInfo","selectedValues","toLowerCase","textFilterMatched","property","hasOwnProperty","rowValue","String","some","filterValue","startsWith","includesUndefined","includes","startIndex","endIndex","visibleRowData","slice","setGridOption","clearAllFilters","onBtShowLoading","showLoadingOverlay","componentWillLoad","uniqueKey","Math","floor","random","getRowData","gridOptions","headerHeight","defaultColDef","resizable","suppressDragLeaveHidesColumns","enableCellTextSelection","onFirstDataRendered","bind","columnDefs","loadingOverlayComponent","noRowsOverlayComponent","noRowsOverlayComponentParams","icons","sortAscending","sortDescending","sortUnSort","rowDragManaged","dndSource","animateRows","componentDidRender","componentDidLoad","container","isNestedInIfxComponent","framework","detectFramework","trackComponent","createGrid","sizeColumnsToFit","defaultMinWidth","paginationElement","shadowRoot","querySelector","handlePageChange","sidebarFilterElements","querySelectorAll","sidebarFilterElement","topbarFilterElements","topbarFilterElement","componentWillUnmount","sidebarFilters","sidebarFilter","topbarFilters","topbarFilter","isJSONParseable","str","parse","e","rows","undefined","Array","isArray","console","error","cols","buttonColumn","find","column","cellRenderer","valueFormatter","buttonRendererOptions","api","handleResetButtonClick","resetEvent","window","disconnectedCallback","resetButton","getTableClassNames","classNames","render","style","height","filterClass","h","Host","key","class","onClick","icon","keys","isMultiSelect","placeholder","readOnly","id","ref","el","total","hasButtonCol","onDragOver","dragSupported","dataTransfer","dropEffect","preventDefault","onDrop","jsonData","getData","eJsonRow","classList","add","innerText","eJsonDisplay"],"sources":["src/components/table-advanced-version/buttonCellRenderer.ts","src/components/table-advanced-version/customNoRowsOverlay.ts","src/components/table-advanced-version/customLoadingOverlay.ts","src/components/table-advanced-version/table.scss?tag=ifx-table&encapsulation=shadow","src/components/table-advanced-version/table.tsx"],"sourcesContent":["import { ICellRendererComp, ICellRendererParams } from 'ag-grid-community';\nimport { ButtonInterface } from './interfaces';\n\nexport class ButtonCellRenderer implements ICellRendererComp {\n eGui!: HTMLDivElement;\n eButton!: HTMLElement; // Change to a generic HTMLElement to accommodate custom elements\n eventListener!: (event: Event) => void;\n\n init(params: ICellRendererParams) {\n this.createButton(params);\n }\n\n getGui() {\n return this.eGui;\n }\n\n refresh(params: ICellRendererParams) {\n this.updateButton(params);\n return true;\n }\n\n private createButton(params: ICellRendererParams) {\n const config = params.data.button;\n const options = params.colDef.cellRendererParams || {};\n \n this.eGui = document.createElement('div');\n this.eButton = document.createElement('ifx-button') as HTMLElement;\n \n if (this.hasRequiredKeys(config)) {\n this.setButtonAttributes(config);\n this.eGui.appendChild(this.eButton);\n this.attachEventListener(options, params);\n } else {\n this.eGui.innerHTML = `<span>${config}</span>`;\n }\n }\n\n private updateButton(params: ICellRendererParams) {\n const config = params.data.button;\n const options = params.colDef.cellRendererParams || {};\n \n if (this.hasRequiredKeys(config)) {\n this.setButtonAttributes(config);\n this.detachEventListener();\n this.attachEventListener(options, params);\n } else {\n this.eGui.innerHTML = `<span>${config}</span>`;\n }\n }\n\n private setButtonAttributes(config: ButtonInterface) {\n this.eButton.setAttribute('disabled', config.disabled.toString());\n this.eButton.setAttribute('variant', config.variant);\n this.eButton.setAttribute('theme', config.theme);\n this.eButton.setAttribute('type', config.type);\n this.eButton.setAttribute('size', config.size);\n this.eButton.setAttribute('full-width', config.fullWidth.toString());\n this.eButton.setAttribute('target', config.target);\n this.eButton.setAttribute('href', config.href);\n this.eButton.textContent = config.text;\n }\n\n private attachEventListener(options: any, params: ICellRendererParams) {\n this.eventListener = (event: Event) => {\n if (options.onButtonClick) {\n options.onButtonClick(params, event);\n }\n };\n this.eButton.addEventListener('click', this.eventListener);\n }\n\n private detachEventListener() {\n if (this.eventListener) {\n this.eButton.removeEventListener('click', this.eventListener);\n }\n }\n\n private hasRequiredKeys(config: ButtonInterface): boolean {\n return config && config.text !== '' && config.variant !== '' && config.size !== '' && config.type !== '';\n }\n}\n","import { ICellRendererComp, ICellRendererParams } from 'ag-grid-community';\n\nexport class CustomNoRowsOverlay implements ICellRendererComp {\n eGui!: HTMLElement;\n\n init(params: ICellRendererParams & { noRowsMessageFunc: () => string }) {\n this.eGui = document.createElement('div');\n this.eGui.innerHTML = `\n <div role=\"presentation\" class=\"ag-overlay-loading-center\" >\n ${params.noRowsMessageFunc()}\n </div>\n `;\n }\n\n getGui() {\n return this.eGui;\n }\n\n refresh(_params: ICellRendererParams): boolean {\n return false;\n }\n}","import { ICellRendererComp, ICellRendererParams } from 'ag-grid-community';\n\nexport class CustomLoadingOverlay implements ICellRendererComp {\n eGui!: HTMLElement;\n\n init(_params: ICellRendererParams & { loadingMessage: string }) {\n this.eGui = document.createElement('div');\n this.eGui.innerHTML = `<div class=\"ag-overlay-loading-center\" role=\"presentation\">\n<ifx-spinner></ifx-spinner>\n </div>`;\n }\n\n getGui() {\n return this.eGui;\n }\n\n refresh(_params: ICellRendererParams): boolean {\n return false;\n }\n}","@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n@import \"~ag-grid-community/styles/ag-grid.css\";\n\n.zebra { \n & .ag-row-odd { \n background-color: tokens.$ifxColorEngineering100!important;\n }\n\n & .ag-row { \n border-bottom: none!important;\n }\n}\n\n.ag-header-viewport { \n background-color: tokens.$ifxColorEngineering200!important;\n}\n\n\n.table-container {\n display: block;\n}\n\n.sidebar-btn {\n margin-bottom: 24px;\n}\n\n.sidebar-container {\n margin-right: 24px;\n}\n\n.sidebar-layout {\n display: flex;\n flex-direction: row;\n}\n\n.topbar-layout {\n display: flex;\n flex-direction: column;\n}\n\n.table-pagination-wrapper {\n display: flex;\n flex-direction: column;\n align-items: stretch; // stretches items to fill the container horizontally\n width: 100%; // ensures the wrapper takes up the full width of its parent\n}\n\n#table-wrapper {\n flex: 1; // allows the table to take up the remaining space\n padding-bottom: tokens.$ifxSpace100;\n}\n\n\n.table-wrapper .ag-root-wrapper-body {\n height: auto !important;\n min-height: 100px !important;\n min-width: 100px;\n}\n\n.filter-chips { \n display:flex;\n gap:tokens.$ifxSpace100;\n margin-bottom: 12px;\n}\n\n.filter-chips > ifx-button { // ifx-button with icon and text has a paddingof 16 px. This is to remove the padding to align with the filter-chips container definition\n margin-left: -8px;\n}\n\n.set-filter-wrapper-sidebar {\n display: flex;\n flex-direction: column;\n margin-bottom: tokens.$ifxSpace100;\n}\n\n.set-filter-wrapper-topbar {\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n margin-bottom: tokens.$ifxSpace100;\n background: tokens.$ifxColorEngineering100;\n padding-top: 32px;\n padding-bottom: 32px;\n gap: 24px;\n }\n\n\n.ifx-ag-grid {\n display: grid;\n height: 100%;\n width: 100%;\n min-width: 100px;\n //padding-bottom: tokens.$ifxSpace100;\n}\n\n\n.ifx-ag-grid .ag-header-cell::after {\n outline: none !important;\n border: none !important;\n box-shadow: none !important;\n}\n\n.ifx-ag-grid .ag-header-cell:focus {\n outline: none !important;\n}\n\n.ifx-ag-grid *:not(.ag-header-cell):focus {\n outline: none;\n}\n\n\n.ifx-ag-grid .ag-header-cell:not(:last-child)::before {\n content: '';\n position: absolute;\n right: 0;\n top: calc(50% - 12px);\n height: 24px; \n width: 1px;\n background-color: tokens.$ifxColorEngineering300; \n}\n\n\n.ag-overlay-loading-center {\n border: none;\n background: none;\n border-radius: none;\n box-shadow: none;\n}\n\n\n.ag-root-wrapper {\n border: 1px solid tokens.$ifxColorEngineering200;\n}\n\n\n\n.ag-header {\n background-color: tokens.$ifxColorEngineering100;\n border-bottom: none;\n\n &.ag-header-active {\n outline: none !important;\n border-color: #0A8276 !important;\n }\n}\n\n.ag-header-cell {\n padding-left: 16px;\n padding-right: 16px;\n gap: 4px;\n}\n\n\n.ag-header-cell-focus {\n border: none !important;\n outline: none !important;\n}\n\n.ag-header-cell-text {\n font-size: 13px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n color: tokens.$ifxColorBaseBlack;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n\n}\n\n.ag-row-focus {\n background-color: inherit !important;\n /* Reset the hover color to the row's original color */\n}\n\n.ag-row-hover {\n background-color: tokens.$ifxColorBaseWhite !important; //inherit !important;\n /* Reset the hover color to the row's original color */\n}\n\n\n.ag-cell-focus {\n border: none !important;\n outline: none !important;\n background-color: inherit !important;\n}\n\n\n\n.ag-row {\n background-color: tokens.$ifxColorBaseWhite;\n border-bottom: 1px solid tokens.$ifxColorEngineering200;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n z-index: 1; //ensure the stacking order when used inside js frameworks\n}\n\n.ag-row-odd {\n background-color: tokens.$ifxColorBaseWhite;\n}\n\n.ag-cell {\n display: flex;\n padding-left: 16px;\n padding-right: 16px;\n align-items: center;\n\n}\n\n.ag-ltr .ag-sort-indicator-icon {\n padding-left: 0px;\n vertical-align: bottom;\n line-height: 12px;\n}\n\n.ag-sort-indicator-container .ag-sort-order { \n display: none;\n}\n\n.unsort-icon-custom-color {\n color: tokens.$ifxColorEngineering400;\n}\n\n\n// Table with set filters in sidebar orientation\n\n\n.filters-title {\n font-size: 24px;\n font-weight: 600;\n}\n\n\n.matching-results-container {\n display: flex;\n gap: 4px;\n font-size: 14px;\n}\n\n.matching-results-count {\n font-weight: 600;\n}\n\n.matching-results-text {\n font-weight: 400;\n}","import { Component, h, Host, Method, Element, Prop, State, Listen, Watch } from '@stencil/core';\nimport classNames from 'classnames';\nimport { trackComponent } from '../../global/utils/tracking'; \nimport { isNestedInIfxComponent } from '../../global/utils/dom-utils';\nimport { detectFramework } from '../../global/utils/framework-detection';\nimport { createGrid, FirstDataRenderedEvent, GridApi, GridOptions } from 'ag-grid-community';\nimport { ButtonCellRenderer } from './buttonCellRenderer';\nimport { CustomNoRowsOverlay } from './customNoRowsOverlay';\nimport { CustomLoadingOverlay } from './customLoadingOverlay';\n\n\n@Component({\n tag: 'ifx-table',\n styleUrl: 'table.scss',\n shadow: true\n})\nexport class Table {\n gridOptions: GridOptions;\n gridApi: GridApi;\n @State() currentPage: number = 1;\n @Prop() cols: any;\n @Prop() rows: any;\n @Prop() buttonRendererOptions?: { onButtonClick?: (params: any, event: Event) => void;}; \n @State() rowData: any[] = [];\n @State() colData: any[] = [];\n @State() filterOptions: { [key: string]: string[] } = {};\n @State() currentFilters = {};\n @State() uniqueKey: string;\n allRowData: any[] = [];\n @Prop() rowHeight: string = 'default';\n @Prop() tableHeight: string = 'auto';\n @Prop() pagination: boolean = true;\n @Prop() paginationPageSize: number = 10;\n @Prop() filterOrientation: string = 'sidebar'; // topbar / none\n @State() showSidebarFilters: boolean = true;\n @State() matchingResultsCount: number = 0;\n @Prop() variant: string = 'default'\n\n @Prop() showLoading: boolean = false;\n private container: HTMLDivElement;\n @Element() host: HTMLElement;\n originalRowData: any[] = [];\n\n private itemsPerPage = JSON.stringify([\n { value: 10, label: '10', selected: true },\n { value: 20, label: '20', selected: false },\n { value: 30, label: '30', selected: false }\n ]); \n\n @Listen('ifxChange')\n handleChipChange(event: CustomEvent<{ previousSelection: Array<any>, currentSelection: Array<any>, name: string }>) {\n const { name, currentSelection, previousSelection } = event.detail;\n if(currentSelection && previousSelection) { \n // Clone the current filters state\n const updatedFilters = { ...this.currentFilters };\n \n if (currentSelection.length === 0) {\n // If there are no selections for this filter, delete the filter\n delete updatedFilters[name];\n \n // Emit event with specific filter name\n const customEvent = new CustomEvent('ifxUpdateSidebarFilter', { detail: { filterName: name }, bubbles: true, composed: true });\n this.host.dispatchEvent(customEvent);\n } else {\n // Otherwise, update the filter values with the current selection\n updatedFilters[name].filterValues = currentSelection.map(selection => selection.value);\n }\n \n // Update the component's filters\n this.currentFilters = updatedFilters;\n \n // Ensure table data is updated\n this.allRowData = this.applyAllFilters(this.originalRowData, this.currentFilters);\n this.updateTableView();\n }\n }\n\n @Watch('buttonRendererOptions')\n onButtonRendererOptionsChanged() {\n this.colData = this.getColData(); // Re-fetch column data to apply new renderer options\n if (this.gridApi) {\n this.gridApi.setColumnDefs(this.colData); // Update column definitions in the grid API\n }\n }\n\n toggleSidebarFilters() {\n this.showSidebarFilters = !this.showSidebarFilters;\n }\n\n updateFilterOptions() {\n const options = {};\n for (let col of this.colData) {\n options[col.field] = [...new Set(this.rowData.map(row => row[col.field]))];\n }\n this.filterOptions = options;\n }\n\n handleSidebarFilterChange(event: CustomEvent) {\n const filterGroups = event.detail;\n const updatedFilters = {};\n\n filterGroups.forEach(filterGroup => {\n const filterName = filterGroup.filterGroupName;\n let filterValues;\n let type;\n\n if (filterGroup.selectedItems && filterGroup.selectedItems.length > 0) {\n filterValues = filterGroup.selectedItems.map(item => item.label);\n type = 'multi-select';\n } else if (filterGroup.value) {\n filterValues = [filterGroup.value];\n type = 'text';\n } else {\n filterValues = [];\n }\n\n if (!(filterValues.length === 0 || (filterValues.length === 1 && type === 'text' && filterValues[0] === ''))) {\n updatedFilters[filterName] = { filterValues, type };\n }\n });\n\n this.allRowData = this.applyAllFilters(this.originalRowData, updatedFilters);\n this.updateTableView();\n this.currentFilters = updatedFilters;\n }\n\n\n handleTopbarFilterChange(event: CustomEvent) {\n const filters = event.detail;\n\n // Start by resetting the filter conditions to a blank object\n this.currentFilters = {};\n\n // Loop through each filter group provided in the event detail\n filters.forEach(filter => {\n const filterName = filter.filterName;\n let filterValues;\n\n let type = filter.type;\n\n if (type === 'text') {\n // Search/Text filter\n filterValues = filter.filterValues\n } else {\n // Multi-select/Single-Select\n filterValues = filter.filterValues.map(item => item.label);\n }\n\n // If there are no filter values, or the filter is a text filter with an empty value, remove the filter\n if (!(filterValues.length === 0 || (filterValues.length === 1 && type === 'text' && filterValues[0] === ''))) {\n // Add or update the filter in the currentFilters object\n this.currentFilters[filterName] = { filterValues, type };\n }\n });\n\n\n // Now that the currentFilters object has been updated, apply all filters to the data\n this.allRowData = this.applyAllFilters(this.originalRowData, this.currentFilters);\n\n // After filtering, update the table view with the new filtered data\n this.updateTableView();\n }\n\n\n applyAllFilters(data, filters) {\n return data.filter(row => {\n for (const filterName in filters) {\n const filterInfo = filters[filterName];\n let selectedValues = (filterInfo.filterValues || []).map(value => {\n if (typeof value === 'string') {\n return value.toLowerCase();\n } else if (typeof value === 'number' || typeof value === 'boolean') {\n return value.toString();\n }\n return '';\n });\n\n // For text filters, check if row values start with any of the selectedValues\n if (filterInfo.type === 'text') {\n let textFilterMatched = false;\n for (let property in row) {\n if (row.hasOwnProperty(property)) {\n let rowValue = row[property] != null ? String(row[property]).toLowerCase() : '';\n if (selectedValues.some(filterValue => rowValue.startsWith(filterValue))) {\n textFilterMatched = true;\n break;\n }\n }\n }\n if (!textFilterMatched) return false;\n }\n // For multi-select filters, this remains unchanged\n else if (filterInfo.type === 'multi-select') {\n let rowValue = row[filterName] != null ? String(row[filterName]).toLowerCase() : '';\n // Check if 'undefined' is a selected value and include rows with empty values in that case\n let includesUndefined = selectedValues.includes('undefined');\n if (!selectedValues.includes(rowValue) && !(includesUndefined && rowValue === '')) {\n return false;\n }\n }\n }\n return true;\n });\n }\n\n\n\n updateTableView() {\n // Calculate the slice of data to display based on pagination\n const startIndex = (this.currentPage - 1) * this.paginationPageSize;\n const endIndex = startIndex + this.paginationPageSize;\n const visibleRowData = this.allRowData.slice(startIndex, endIndex);\n\n // Update the row data in the table\n this.rowData = visibleRowData;\n this.gridApi.setGridOption('rowData', this.rowData);\n\n // Update matching results count\n this.matchingResultsCount = this.allRowData.length;\n }\n\n\n clearAllFilters() {\n this.currentFilters = {};\n this.allRowData = [...this.originalRowData];\n }\n\n\n @Method()\n async onBtShowLoading() {\n this.gridApi.showLoadingOverlay();\n }\n\n componentWillLoad() {\n this.uniqueKey = `unique-${Math.floor(Math.random() * 1000000)}`;\n this.rowData = this.getRowData();\n this.colData = this.getColData();\n this.updateFilterOptions();\n\n this.gridOptions = {\n\n rowHeight: this.rowHeight === 'default' ? 40 : 32,\n headerHeight: 40,\n defaultColDef: {\n resizable: true,\n },\n suppressDragLeaveHidesColumns: true,\n enableCellTextSelection: true,\n onFirstDataRendered: this.onFirstDataRendered.bind(this),\n columnDefs: this.colData,\n rowData: this.rowData,\n loadingOverlayComponent: CustomLoadingOverlay,\n noRowsOverlayComponent: CustomNoRowsOverlay,\n noRowsOverlayComponentParams: {\n noRowsMessageFunc: () =>\n 'No rows found' //at: ' + new Date().toLocaleTimeString(),\n },\n icons: {\n sortAscending: '<ifx-icon icon=\"arrow-triangle-up-16\"></ifx-icon>',\n sortDescending: '<ifx-icon icon=\"arrow-triangle-down-16\"></ifx-icon>',\n sortUnSort: '<a class=\"unsort-icon-custom-color\"><ifx-icon icon=\"arrow-triangle-vertikal-16\"></ifx-icon></a>'\n },\n rowDragManaged: this.colData.some(col => col.dndSource === true) ? true : false,\n animateRows: this.colData.some(col => col.dndSource === true) ? true : false,\n };\n\n }\n\n componentDidRender() {\n if (this.gridApi) {\n this.gridApi.setGridOption('columnDefs', this.colData);\n }\n }\n\n async componentDidLoad() {\n if (this.container) {\n if(!isNestedInIfxComponent(this.host)) { \n const framework = detectFramework();\n trackComponent('ifx-table', await framework)\n }\n this.gridApi = createGrid(this.container, this.gridOptions);\n if (this.gridApi) {\n this.gridApi.sizeColumnsToFit({\n defaultMinWidth: 100,\n });\n this.gridApi.setGridOption('columnDefs', this.colData);\n this.gridApi.setGridOption('rowData', this.rowData);\n\n if (this.pagination) {\n const paginationElement = this.host.shadowRoot.querySelector('ifx-pagination');\n if (paginationElement) {\n paginationElement.addEventListener('ifxPageChange', this.handlePageChange.bind(this));\n }\n }\n const sidebarFilterElements = this.host.querySelectorAll('ifx-filter-type-group');\n // Add an event listener to each SetFilter component\n sidebarFilterElements.forEach(sidebarFilterElement => {\n sidebarFilterElement.addEventListener('ifxSidebarFilterChange', this.handleSidebarFilterChange.bind(this));\n });\n const topbarFilterElements = this.host.querySelectorAll('ifx-filter-bar');\n // Add an event listener to each SetFilter component\n topbarFilterElements.forEach(topbarFilterElement => {\n topbarFilterElement.addEventListener('ifxTopbarFilterChange', this.handleTopbarFilterChange.bind(this));\n });\n }\n }\n }\n\n componentWillUnmount() {\n if (this.pagination) {\n const paginationElement = this.host.shadowRoot.querySelector('ifx-pagination');\n if (paginationElement) {\n paginationElement.removeEventListener('ifxPageChange', this.handlePageChange.bind(this));\n }\n }\n const sidebarFilters = this.host.shadowRoot.querySelectorAll('ifx-filter-type-group');\n // Remove the event listener from each SetFilter component\n sidebarFilters.forEach(sidebarFilter => {\n sidebarFilter.removeEventListener('ifxSidebarFilterChange', this.handleSidebarFilterChange.bind(this));\n });\n const topbarFilters = this.host.shadowRoot.querySelectorAll('ifx-filter-type-group');\n // Remove the event listener from each SetFilter component\n topbarFilters.forEach(topbarFilter => {\n topbarFilter.removeEventListener('ifxTopbarFilterChange', this.handleTopbarFilterChange.bind(this));\n });\n }\n\n handlePageChange(event) {\n this.currentPage = event.detail.currentPage;\n const startIndex = (this.currentPage - 1) * this.paginationPageSize;\n const endIndex = startIndex + this.paginationPageSize;\n const visibleRowData = this.allRowData.slice(startIndex, endIndex);\n // Update the data in the grid\n if (this.gridApi) {\n this.gridApi.setGridOption('rowData', visibleRowData);\n }\n }\n\n isJSONParseable(str) {\n try {\n JSON.parse(str);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n\n getRowData() {\n let rows: any[] = [];\n if (this.rows === undefined || this.rows === null) {\n return rows;\n }\n \n if (this.isJSONParseable(this.rows)) {\n rows = [...JSON.parse(this.rows)];\n }\n else if (Array.isArray(this.rows) || typeof this.rows === 'object') {\n rows = [...this.rows];\n }\n else {\n console.error('Unexpected value for rows: ', this.rows);\n }\n\n this.allRowData = rows;\n this.originalRowData = [...rows]; // Deep copy the original data\n this.matchingResultsCount = this.allRowData.length;\n\n return rows.slice(0, this.paginationPageSize);\n }\n\n\n getColData() {\n let cols: any[] = [];\n if (this.cols === undefined || this.cols === null) {\n return cols;\n }\n \n if (this.isJSONParseable(this.cols)) {\n cols = [...JSON.parse(this.cols)];\n } else if (Array.isArray(this.cols) || typeof this.cols === 'object') {\n cols = [...this.cols];\n } else {\n console.error('Unexpected value for cols: ', this.cols);\n }\n \n const buttonColumn = cols.find(column => column.field === 'button');\n if (buttonColumn) {\n buttonColumn.cellRenderer = ButtonCellRenderer;\n buttonColumn.valueFormatter = params => params.value.text;\n \n // No JSON.parse needed now\n if (this.buttonRendererOptions && typeof this.buttonRendererOptions === 'object') {\n if (this.buttonRendererOptions.onButtonClick) {\n buttonColumn.cellRendererParams = {\n onButtonClick: this.buttonRendererOptions.onButtonClick\n };\n }\n }\n }\n \n return cols;\n }\n \n\n onFirstDataRendered(params: FirstDataRenderedEvent) {\n params.api.sizeColumnsToFit();\n }\n\n handleResetButtonClick() {\n const resetEvent = new CustomEvent('ifxResetFiltersEvent', { bubbles: true, composed: true });\n window.dispatchEvent(resetEvent); // Dispatch from the window object\n\n this.clearAllFilters();\n this.updateTableView(); // Update table view with the original data\n }\n\n\n disconnectedCallback() {\n if (this.pagination) {\n const paginationElement = this.host.shadowRoot.querySelector('ifx-pagination');\n if (paginationElement) {\n paginationElement.removeEventListener('ifxPageChange', this.handlePageChange);\n }\n }\n\n const resetButton = this.host.shadowRoot.querySelector('#reset-filters-button');\n if (resetButton) {\n resetButton.removeEventListener('click', this.handleResetButtonClick.bind(this));\n }\n }\n\n\n\n getTableClassNames() {\n return classNames(\n this.tableHeight === 'auto' && 'table-wrapper ag-root-wrapper-body',\n 'table-wrapper',\n );\n }\n\n\n render() {\n let style = {};\n if (this.tableHeight !== 'auto') {\n style = {\n 'height': this.tableHeight\n };\n }\n const filterClass = this.filterOrientation === 'topbar' ? 'topbar-layout' : 'sidebar-layout';\n return (\n <Host>\n <div class=\"table-container\">\n {this.filterOrientation === 'sidebar' && (\n <div class=\"sidebar-btn\">\n <ifx-button\n type=\"button\"\n disabled={false}\n variant=\"secondary\"\n size=\"m\"\n target=\"_blank\"\n theme=\"default\"\n full-width=\"false\"\n onClick={() => this.toggleSidebarFilters()}\n >\n <ifx-icon icon=\"cross-16\"></ifx-icon>{this.showSidebarFilters ? 'Hide Filters' : 'Show Filters'}\n </ifx-button>\n </div>\n )}\n\n <div class={filterClass}>\n {this.filterOrientation === 'sidebar' && this.showSidebarFilters && (\n <div class=\"sidebar-container\">\n <div class=\"filters-title-container\">\n <span class=\"filters-title\">Filters</span>\n </div>\n <div class=\"set-filter-wrapper-sidebar\">\n {(this.filterOrientation !== 'sidebar' || this.showSidebarFilters) && (\n <slot name=\"sidebar-filter\"></slot>\n )}\n </div>\n </div>\n )}\n\n {this.filterOrientation !== 'none' && this.filterOrientation !== 'sidebar' && (\n <div class=\"set-filter-wrapper-topbar\">\n {(this.filterOrientation !== 'sidebar' || this.showSidebarFilters) && (\n <slot name=\"topbar-filter\"></slot>\n )}\n </div>\n )}\n\n <div class=\"table-pagination-wrapper\">\n <div class=\"filter-chips\">\n {this.filterOrientation !== 'none' && this.filterOrientation !== 'topbar' && this.showSidebarFilters && (\n Object.keys(this.currentFilters).map(name => {\n const filter = this.currentFilters[name];\n const filterValues = filter.filterValues;\n const isMultiSelect = filter.type !== 'text';\n\n return filterValues.length > 0 ? (\n <ifx-chip\n placeholder={name}\n size=\"large\"\n variant={isMultiSelect ? \"multi\" : \"single\"}\n readOnly={true}\n value={filterValues} // Ensure value prop is set\n key={name}\n >\n {filterValues.map(filterValue => (\n <ifx-chip-item value={filterValue} selected={true} key={filterValue}>\n {filterValue}\n </ifx-chip-item>\n ))}\n </ifx-chip>\n ) : null;\n })\n )}\n\n {this.filterOrientation !== 'none' && this.filterOrientation === 'sidebar' && this.showSidebarFilters && Object.keys(this.currentFilters).length > 0 && (\n <ifx-button type=\"button\" disabled={false} variant=\"tertiary\" size=\"m\" target=\"_blank\" theme=\"default\" full-width=\"false\" onClick={() => this.handleResetButtonClick()}\n >\n <ifx-icon icon=\"curved-arrow-left-16\"></ifx-icon>Reset all\n </ifx-button>\n )}\n </div>\n\n {this.filterOrientation !== 'none' && (\n <div class=\"matching-results-container\">\n <span class=\"matching-results-count\">\n {this.matchingResultsCount}\n </span>\n <span class=\"matching-results-text\">\n matching results\n </span>\n </div>\n )}\n\n <div id=\"table-wrapper\" class={this.getTableClassNames()}>\n <div id={`ifxTable-${this.uniqueKey}`} class={`ifx-ag-grid ${this.variant === 'zebra' ? 'zebra' : \"\"}`} style={style} ref={(el) => this.container = el}>\n </div>\n </div>\n {this.pagination ? <ifx-pagination total={this.allRowData.length} current-page={this.currentPage} items-per-page={this.itemsPerPage}></ifx-pagination> : null}\n </div>\n </div>\n </div>\n </Host>\n );\n }\n\n\n hasButtonCol(): boolean {\n return this.getColData().some(column => column.field === 'button');\n }\n\n onDragOver(event) {\n var dragSupported = event.dataTransfer.length;\n\n if (dragSupported) {\n event.dataTransfer.dropEffect = 'move';\n }\n\n event.preventDefault();\n }\n\n onDrop(event) {\n var jsonData = event.dataTransfer.getData('application/json');\n\n var eJsonRow = document.createElement('div');\n eJsonRow.classList.add('json-row');\n eJsonRow.innerText = jsonData;\n\n var eJsonDisplay = document.querySelector('#eJsonDisplay');\n\n eJsonDisplay.appendChild(eJsonRow);\n event.preventDefault();\n }\n\n}\n"],"mappings":"iNAGaA,EAKX,IAAAC,CAAKC,GACHC,KAAKC,aAAaF,E,CAGpB,MAAAG,GACE,OAAOF,KAAKG,I,CAGd,OAAAC,CAAQL,GACNC,KAAKK,aAAaN,GAClB,OAAO,I,CAGD,YAAAE,CAAaF,GACnB,MAAMO,EAASP,EAAOQ,KAAKC,OAC3B,MAAMC,EAAUV,EAAOW,OAAOC,oBAAsB,GAEpDX,KAAKG,KAAOS,SAASC,cAAc,OACnCb,KAAKc,QAAUF,SAASC,cAAc,cAEtC,GAAIb,KAAKe,gBAAgBT,GAAS,CAChCN,KAAKgB,oBAAoBV,GACzBN,KAAKG,KAAKc,YAAYjB,KAAKc,SAC3Bd,KAAKkB,oBAAoBT,EAASV,E,KAC7B,CACLC,KAAKG,KAAKgB,UAAY,SAASb,U,EAI3B,YAAAD,CAAaN,GACnB,MAAMO,EAASP,EAAOQ,KAA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