/*!
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('./Grid.css');require('./styles/table.css');const e=require("vue"),t=require("./components/QueryBar.vue.js"),a=require("./components/ActionBar.vue.js"),o=require("./components/Pager.vue.js"),l=require("./components/DataTable.vue.js"),r=require("./components/ColumnSettings.vue.js"),u=require("./composables/useGridTable.js");/* empty css                    */;/* empty css           */const n=require("../../_virtual/_plugin-vue_export-helper.js"),i={class:"gsc-grid space-y-3"},c={class:"gsc-card gsc-card-pad"},s={class:"gsc-card"},d={key:0,class:"px-4 py-3 gsc-divider-top"},p={__name:"Grid",props:{data:{type:Array,default:()=>[]},request:{type:Function},mode:{type:String,default:"server"},columns:{type:Array,default:()=>[]},pagination:{type:[Boolean,Object],default:()=>({page:1,pageSize:10})},query:{type:Object,default:()=>({})},filterSchema:{type:Array,default:()=>[]},actions:{type:Object,default:()=>({})},rowKey:{type:String,default:"id"},rowSelection:{type:Boolean,default:!1},virtual:{type:Boolean,default:!1},rowHeight:{type:Number,default:40},height:{type:Number,default:400}},emits:["update:query","selection-change","load","cell-change","update:modelValue","info"],setup(n,{emit:p}){const g=n,m=p,v=e.computed(()=>g.filterSchema||[]),y=e.computed(()=>!!g.rowSelection),f=e.computed(()=>!1!==g.pagination),h=e.computed(()=>{const e=g.actions||{},t=e.left||e.leftActions||[];return Array.isArray(t)?t:[]}),w=e.computed(()=>{const e=g.actions||{},t=e.right||e.rightActions||[];return Array.isArray(t)?t:[]}),S=e.computed(()=>!1!==(g.actions||{}).showColumnSettings),b=u.useGridTable({data:g.data,request:g.request,mode:g.mode,pageSize:g.pagination&&g.pagination.pageSize||10,initialQuery:g.query,columns:g.columns,rowKey:g.rowKey,enableRowSelection:y.value}),q=e.computed(()=>!!b.loading.value),j=e.computed({get:()=>b.query.value||{},set(e){b.setQuery(e||{})}}),k=e.computed({get:()=>b.page.value,set(e){b.page.value=e}}),B=e.computed({get:()=>b.pageSize.value,set(e){b.pageSize.value=e}}),C=e.computed(()=>b.total.value||0);function V(e){const t=e||{};b.setQuery(t),b.load()}function _(e){const t=e||{};b.setQuery(t),b.load()}function A({key:e,value:t}){const a={...b.query.value||{}};null!=t&&""!==t?a[e]=t:delete a[e],b.setQuery(a),b.load()}function N(e){m("selection-change",e||[])}function z(e){"client"===g.mode?b.setData((b.rows.value||[]).slice()):m("cell-change",{rowKey:e?.row?.[g.rowKey],column:e?.column,value:e?.value,row:e?.row}),m("update:modelValue",(b.rows.value||[]).slice())}return e.watch(()=>g.data,e=>{b.setData(e||[])},{deep:!0}),e.watch(()=>g.columns,e=>{b.setColumns(e||[])},{deep:!0}),e.watch(()=>b.query.value,e=>{m("update:query",e)},{deep:!0}),(u,n)=>(e.openBlock(),e.createElementBlock("div",i,[v.value.length?(e.openBlock(),e.createBlock(t.default,{key:0,modelValue:j.value,"onUpdate:modelValue":n[0]||(n[0]=e=>j.value=e),schema:v.value,loading:q.value,onSearch:V,onReset:_},null,8,["modelValue","schema","loading"])):e.createCommentVNode("",!0),e.createElementVNode("div",c,[e.createVNode(a.default,{loading:q.value,"left-actions":h.value,"right-actions":w.value,onInfo:n[1]||(n[1]=e=>u.$emit("info"))},e.createSlots({right:e.withCtx(()=>[e.renderSlot(u.$slots,"actions-right",{},()=>[S.value?(e.openBlock(),e.createBlock(r.default,{key:0,table:e.unref(b).table},null,8,["table"])):e.createCommentVNode("",!0)],!0)]),_:2},[u.$slots["actions-left"]?{name:"left",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"actions-left",{},void 0,!0)]),key:"0"}:void 0]),1032,["loading","left-actions","right-actions"])]),e.createElementVNode("div",s,[e.createVNode(l.default,{table:e.unref(b).table,mode:g.mode,loading:q.value,virtual:g.virtual,height:g.height,"row-height":g.rowHeight,"enable-row-selection":y.value,onSelectionChange:N,onCellChange:z,onServerFilterChange:A},e.createSlots({_:2},[e.renderList(u.$slots,(t,a)=>({name:a,fn:e.withCtx(t=>[e.renderSlot(u.$slots,a,e.normalizeProps(e.guardReactiveProps(t)),void 0,!0)])}))]),1032,["table","mode","loading","virtual","height","row-height","enable-row-selection"]),f.value?(e.openBlock(),e.createElementBlock("div",d,[e.createVNode(o.default,{page:k.value,"page-size":B.value,total:C.value,"onUpdate:page":n[2]||(n[2]=e=>{k.value=e}),"onUpdate:pageSize":n[3]||(n[3]=e=>{B.value=e})},null,8,["page","page-size","total"])])):e.createCommentVNode("",!0)])]))}},g=n.default(p,[["__scopeId","data-v-2d3b7c2e"]]);exports.default=g;