/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./ColumnSettings.css');const e=require("vue"),t=require("../../../hooks/useLocale.js"),n=require("../../../Button/index.js");;/* empty css                     */const o=require("../../../_virtual/_plugin-vue_export-helper.js"),l={class:"relative"},r={class:"flex items-center justify-between px-2 py-1"},c={class:"text-sm font-medium text-[rgba(0,0,0,0.88)]"},i={class:"max-h-64 overflow-auto pr-1 mt-1"},a=["checked","onChange"],s=["title"],u={class:"mt-2 flex items-center justify-between gap-2 gsc-divider-top pt-2"},d={__name:"ColumnSettings",props:{table:{type:Object,required:!0}},setup(o){const d=o,g=e.ref(!1),{t:p}=t.useLocale(),m=e.computed(()=>{try{return d.table.getAllLeafColumns?.()||[]}catch{return[]}});function f(){m.value.forEach(e=>e.toggleVisibility(!0))}function v(){m.value.forEach(e=>e.toggleVisibility(!1))}function x(){g.value=!1}return e.onMounted(()=>{document.addEventListener("click",x)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",x)}),(t,o)=>(e.openBlock(),e.createElementBlock("div",l,[e.createVNode(e.unref(n.GscButton),{type:"button",variant:"default",onClick:o[0]||(o[0]=e.withModifiers(e=>g.value=!g.value,["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)("gsc.grid.columnSettings.trigger")),1)]),_:1}),g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"gsc-popover absolute right-0 mt-2 w-72 p-2 z-20",onClick:o[2]||(o[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",r,[e.createElementVNode("div",c,e.toDisplayString(e.unref(p)("gsc.grid.columnSettings.title")),1),e.createVNode(e.unref(n.GscButton),{type:"button",variant:"text",onClick:o[1]||(o[1]=e=>g.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)("gsc.grid.columnSettings.close")),1)]),_:1})]),e.createElementVNode("div",i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,t=>(e.openBlock(),e.createElementBlock("label",{key:t.id,class:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-[rgba(0,0,0,0.02)] cursor-pointer"},[e.createElementVNode("input",{type:"checkbox",class:"gsc-checkbox",checked:t.getIsVisible(),onChange:e=>t.toggleVisibility(!!e.target.checked)},null,40,a),e.createElementVNode("span",{class:"text-sm truncate",title:String(t.columnDef?.header??t.id)},e.toDisplayString(String(t.columnDef?.header??t.id)),9,s)]))),128))]),e.createElementVNode("div",u,[e.createVNode(e.unref(n.GscButton),{type:"button",variant:"default",class:"px-2",onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)("gsc.grid.columnSettings.checkAll")),1)]),_:1}),e.createVNode(e.unref(n.GscButton),{type:"button",variant:"default",class:"px-2",onClick:v},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)("gsc.grid.columnSettings.uncheckAll")),1)]),_:1})])])):e.createCommentVNode("",!0)]))}},g=o.default(d,[["__scopeId","data-v-e7aee950"]]);exports.default=g;