/* * This file is part of the TYPO3 CMS project. * * It is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, either version 2 * of the License, or any later version. * * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. * * The TYPO3 project - inspiring people to share! */ import x from"tablesort";import"tablesort.dotsep.js";import"tablesort.number.js";import{IconElement as L}from"@typo3/backend/element/icon-element.js";import{Sizes as A}from"@typo3/backend/enum/icon-types.js";import D from"~labels/core.core";class I extends x{init(o,g){let r,l;if(this.table=o,this.thead=!1,this.options=g,o.rows&&o.rows.length>0)if(o.tHead&&o.tHead.rows.length>0){for(let t=0;t{t.preventDefault(),t.stopImmediatePropagation();const n=t.currentTarget.dataset.sortDirection,e=t.currentTarget.closest("th, td");this.current===e&&this.current.ariaSort===n||(e.ariaSort=n==="ascending"?"descending":"ascending",this.current&&this.current!==e&&this.current.removeAttribute("aria-sort"),this.current=e,this.sortTable(e))};for(let t=0;t{const r=g.target;r.tHead.querySelectorAll(".dropdown-toggle[data-sorting-toggle]").forEach(s=>{s.querySelector(":scope > div").classList.remove("text-primary");const a=s.querySelector("typo3-backend-icon");a.identifier="empty-empty",a.classList.remove("text-primary")}),r.tHead.querySelectorAll(".dropdown-toggle[data-sorting-toggle] + .dropdown-menu typo3-backend-icon").forEach(s=>{s.identifier="empty-empty"});const t=r.tHead.querySelector("th[aria-sort]"),n=t.querySelector(".dropdown-toggle[data-sorting-toggle]");n.querySelector(":scope > div").classList.add("text-primary");const c=n.querySelector("typo3-backend-icon"),m=t.querySelector(".dropdown-menu");t.ariaSort==="ascending"?c.identifier="actions-sort-amount-up":c.identifier="actions-sort-amount-down",m.querySelectorAll(".dropdown-item").forEach(s=>{const i=s.dataset.sortDirection,a=s.querySelector("typo3-backend-icon");i===t.ariaSort?a.identifier="actions-dot":a.identifier="empty-empty"})}),new I(o)}}export{W as default};