/*!
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
*/
import{ref as e,onMounted as o,onBeforeUnmount as l,openBlock as i,createElementBlock as t,createElementVNode as r,normalizeClass as n,withDirectives as c,Fragment as s,renderList as a,normalizeStyle as u,vShow as d}from"vue";import './ColorPicker.css';/* empty css                */import p from"../../../../_virtual/_plugin-vue_export-helper.js";const v=["disabled","title"],m=["innerHTML"],b={class:"popover-menu absolute right-0 top-full z-[1000] mt-1"},k={class:"color-picker grid grid-cols-5 gap-1"},y=["onClick"],C=/* @__PURE__ */p({__name:"ColorPicker",props:{editor:{type:Object,required:!0},disabled:{type:Boolean,default:!1},title:{type:String,required:!0},icon:{type:[Object,Function],required:!0},colors:{type:Array,default:()=>[]},isActive:{type:Function,required:!0},isActiveColor:{type:Function,required:!0},onSelectColor:{type:Function,required:!0}},emits:["colorChange"],setup(p,{emit:C}){const f=p,g=C,_=e(null),q=e(!1),h=()=>{q.value=!q.value},j=e=>{f.onSelectColor(e),g("colorChange",e),q.value=!1},A=e=>{_.value&&!_.value.contains(e.target)&&(q.value=!1)};return o(()=>{document.addEventListener("click",A)}),l(()=>{document.removeEventListener("click",A)}),(e,o)=>(i(),t("div",{ref_key:"popoverRef",ref:_,class:"relative"},[r("button",{class:n([{"is-active":p.isActive(),"is-disabled":p.disabled}]),disabled:p.disabled,title:p.title,onClick:h},[r("span",{innerHTML:p.icon},null,8,m)],10,v),c(r("div",b,[r("div",k,[(i(!0),t(s,null,a(p.colors,e=>(i(),t("div",{key:e,class:"color-option",style:u({backgroundColor:e}),onClick:o=>j(e)},null,12,y))),128)),r("div",{class:"color-none h-6 w-6 cursor-pointer rounded",onClick:o[0]||(o[0]=e=>j(null))},[r("span",{class:n(["icon","i-ic:baseline-close"])})])])],512),[[d,q.value]])],512))}},[["__scopeId","data-v-40a951f4"]]);export{C as default};