/*!
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('./CellEditor2.css');require('./CellEditor.css');const e=require("vue"),t=require("../../../Button/index.js"),l=require("../composables/useCellEditor.js");/* empty css                  */;/* empty css                 */const n=require("../../../_virtual/_plugin-vue_export-helper.js"),o={class:"gsc-cell-editor"},r=["value"],i={key:0},u={class:"mt-2 flex gap-2 justify-end"},c={__name:"CellEditor",props:{modelValue:[String,Number,Date],type:{type:String,default:"text"},options:Array},emits:["update:modelValue","commit","cancel"],setup(n,{emit:c}){const a=n,s=c,{localValue:d,updateLocal:f,commit:p,cancel:m}=l.useCellEditor(a,s),v=e.ref(null);function y(e){const t=e.target.innerHTML;f(t)}return e.onMounted(()=>{"rich-text"===a.type&&v.value&&(v.value.innerHTML=d.value||"")}),(l,c)=>(e.openBlock(),e.createElementBlock("div",o,["custom"===n.type?e.renderSlot(l.$slots,"custom",{key:0,modelValue:n.modelValue,update:e.unref(f),commit:e.unref(p),cancel:e.unref(m)},void 0,!0):"select"===n.type?e.withDirectives((e.openBlock(),e.createElementBlock("select",{key:1,"onUpdate:modelValue":c[0]||(c[0]=t=>e.isRef(d)?d.value=t:null),class:"gsc-control",onKeydown:[c[1]||(c[1]=e.withKeys(e.withModifiers((...t)=>e.unref(p)&&e.unref(p)(...t),["prevent"]),["enter"])),c[2]||(c[2]=e.withKeys(e.withModifiers((...t)=>e.unref(m)&&e.unref(m)(...t),["prevent"]),["esc"]))]},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options||[],t=>(e.openBlock(),e.createElementBlock("option",{key:t.value,value:t.value},e.toDisplayString(t.label),9,r))),128))],544)),[[e.vModelSelect,e.unref(d)]]):"date"===n.type?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":c[3]||(c[3]=t=>e.isRef(d)?d.value=t:null),type:"date",class:"gsc-control",onKeydown:[c[4]||(c[4]=e.withKeys(e.withModifiers((...t)=>e.unref(p)&&e.unref(p)(...t),["prevent"]),["enter"])),c[5]||(c[5]=e.withKeys(e.withModifiers((...t)=>e.unref(m)&&e.unref(m)(...t),["prevent"]),["esc"]))]},null,544)),[[e.vModelText,e.unref(d)]]):"datetime-local"===n.type?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,"onUpdate:modelValue":c[6]||(c[6]=t=>e.isRef(d)?d.value=t:null),type:"datetime-local",class:"gsc-control",onKeydown:[c[7]||(c[7]=e.withKeys(e.withModifiers((...t)=>e.unref(p)&&e.unref(p)(...t),["prevent"]),["enter"])),c[8]||(c[8]=e.withKeys(e.withModifiers((...t)=>e.unref(m)&&e.unref(m)(...t),["prevent"]),["esc"]))]},null,544)),[[e.vModelText,e.unref(d)]]):"number"===n.type?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:4,"onUpdate:modelValue":c[9]||(c[9]=t=>e.isRef(d)?d.value=t:null),type:"number",class:"gsc-control",onKeydown:[c[10]||(c[10]=e.withKeys(e.withModifiers((...t)=>e.unref(p)&&e.unref(p)(...t),["prevent"]),["enter"])),c[11]||(c[11]=e.withKeys(e.withModifiers((...t)=>e.unref(m)&&e.unref(m)(...t),["prevent"]),["esc"]))]},null,544)),[[e.vModelText,e.unref(d),void 0,{number:!0}]]):"rich-text"===n.type?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[l.$slots.custom?(e.openBlock(),e.createElementBlock("div",i,[e.renderSlot(l.$slots,"custom",{modelValue:e.unref(d),update:e.unref(f),commit:e.unref(p),cancel:e.unref(m)},void 0,!0)])):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"richRef",ref:v,contenteditable:"",class:"gsc-textarea",onInput:y},e.toDisplayString(e.unref(d)),545))],64)):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:6,"onUpdate:modelValue":c[12]||(c[12]=t=>e.isRef(d)?d.value=t:null),class:"gsc-control",onKeydown:[c[13]||(c[13]=e.withKeys(e.withModifiers((...t)=>e.unref(p)&&e.unref(p)(...t),["prevent"]),["enter"])),c[14]||(c[14]=e.withKeys(e.withModifiers((...t)=>e.unref(m)&&e.unref(m)(...t),["prevent"]),["esc"]))]},null,544)),[[e.vModelText,e.unref(d)]]),e.createElementVNode("div",u,[e.createVNode(e.unref(t.GscButton),{variant:"primary",onClick:e.unref(p)},{default:e.withCtx(()=>[...c[15]||(c[15]=[e.createTextVNode(" OK ",-1)])]),_:1},8,["onClick"]),e.createVNode(e.unref(t.GscButton),{variant:"default",onClick:e.unref(m)},{default:e.withCtx(()=>[...c[16]||(c[16]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["onClick"])])]))}},a=n.default(c,[["__scopeId","data-v-3e2da6e3"]]);exports.default=a;