1 |
- var ze=Object.defineProperty,Oe=Object.defineProperties;var Te=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable;var he=(e,t,a)=>t in e?ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,m=(e,t)=>{for(var a in t||(t={}))me.call(t,a)&&he(e,a,t[a]);if(Y)for(var a of Y(t))be.call(t,a)&&he(e,a,t[a]);return e},V=(e,t)=>Oe(e,Te(t));var q=(e,t)=>{var a={};for(var r in e)me.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&Y)for(var r of Y(e))t.indexOf(r)<0&&be.call(e,r)&&(a[r]=e[r]);return a};var ge=(e,t,a)=>new Promise((r,i)=>{var d=s=>{try{h(a.next(s))}catch(f){i(f)}},n=s=>{try{h(a.throw(s))}catch(f){i(f)}},h=s=>s.done?r(s.value):Promise.resolve(s.value).then(d,n);h((a=a.apply(e,t)).next())});import{q as N,ap as W,aq as X,ar as ae,r as S,C as B,as as Q,at as z,au as je,A as T,av as ue,E as F,b as o,aw as Ge,ax as Pe,ay as J,az as $e,aA as Me,aB as fe,aC as We,aD as Ee,Q as Be,aE as Xe,aF as ke,aG as De,aH as Ue,aI as Ye,aJ as qe,S as Qe,aK as Je,aL as Ke,aM as Ze,aN as et,aO as tt,aP as at,aQ as lt,aR as ot,aS as nt,x as st,aT as rt,aU as ct,aV as dt,aW as it,aX as ut,aY as ft,aZ as vt,a_ as ht,a$ as mt,b0 as bt,y as Ce,b1 as gt,b2 as kt,D as Ct,d as ve,b3 as re,b4 as Ie,b5 as te,b6 as pt,b7 as le,b8 as O,o as M,X as E,a as y,a0 as K,Y as Z,U as ee,b9 as I,ab as pe,ac as ye,t as xe,w,V as j,j as U,$ as H,n as A,e as G,h as He,p as Ae,m as Re,_ as Le,ba as we,u as yt,c as xt,l as Ve,bb as wt}from"./index.6c36cb53.js";import{M as Vt}from"./index.a696a3d7.js";import{M as _t}from"./index.42cbb984.js";import{g as oe}from"./math.58b544d2.js";import{V as ce}from"./VSlider.4e6efa7b.js";const St=N(m({color:{type:Object},disabled:Boolean,dotSize:{type:[Number,String],default:10},height:{type:[Number,String],default:150},width:{type:[Number,String],default:300}},W()),"VColorPickerCanvas"),Pt=X({name:"VColorPickerCanvas",props:St(),emits:{"update:color":e=>!0,"update:position":e=>!0},setup(e,t){let{emit:a}=t;const r=ae(!1),i=S(),d=ae(parseFloat(e.width)),n=ae(parseFloat(e.height)),h=S({x:0,y:0}),s=B({get:()=>h.value,set(u){var v,p,b,$;if(!i.value)return;const{x:g,y:P}=u;h.value=u,a("update:color",{h:(p=(v=e.color)==null?void 0:v.h)!=null?p:0,s:Q(g,0,d.value)/d.value,v:1-Q(P,0,n.value)/n.value,a:($=(b=e.color)==null?void 0:b.a)!=null?$:1})}}),f=B(()=>{const{x:u,y:g}=s.value,P=parseInt(e.dotSize,10)/2;return{width:z(e.dotSize),height:z(e.dotSize),transform:`translate(${z(u-P)}, ${z(g-P)})`}}),{resizeRef:C}=je(u=>{var v;if(!((v=C.value)!=null&&v.offsetParent))return;const{width:g,height:P}=u[0].contentRect;d.value=g,n.value=P});function x(u,g,P){const{left:v,top:p,width:b,height:$}=P;s.value={x:Q(u-v,0,b),y:Q(g-p,0,$)}}function k(u){u.type==="mousedown"&&u.preventDefault(),!e.disabled&&(l(u),window.addEventListener("mousemove",l),window.addEventListener("mouseup",c),window.addEventListener("touchmove",l),window.addEventListener("touchend",c))}function l(u){if(e.disabled||!i.value)return;r.value=!0;const g=Ge(u);x(g.clientX,g.clientY,i.value.getBoundingClientRect())}function c(){window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",c),window.removeEventListener("touchmove",l),window.removeEventListener("touchend",c)}function _(){var p,b;if(!i.value)return;const u=i.value,g=u.getContext("2d");if(!g)return;const P=g.createLinearGradient(0,0,u.width,0);P.addColorStop(0,"hsla(0, 0%, 100%, 1)"),P.addColorStop(1,`hsla(${(b=(p=e.color)==null?void 0:p.h)!=null?b:0}, 100%, 50%, 1)`),g.fillStyle=P,g.fillRect(0,0,u.width,u.height);const v=g.createLinearGradient(0,0,0,u.height);v.addColorStop(0,"hsla(0, 0%, 0%, 0)"),v.addColorStop(1,"hsla(0, 0%, 0%, 1)"),g.fillStyle=v,g.fillRect(0,0,u.width,u.height)}return T(()=>{var u;return(u=e.color)==null?void 0:u.h},_,{immediate:!0}),T(()=>[d.value,n.value],(u,g)=>{_(),h.value={x:s.value.x*u[0]/g[0],y:s.value.y*u[1]/g[1]}},{flush:"post"}),T(()=>e.color,()=>{if(r.value){r.value=!1;return}h.value=e.color?{x:e.color.s*d.value,y:(1-e.color.v)*n.value}:{x:0,y:0}},{deep:!0,immediate:!0}),ue(()=>_()),F(()=>o("div",{ref:C,class:["v-color-picker-canvas",e.class],style:e.style,onMousedown:k,onTouchstartPassive:k},[o("canvas",{ref:i,width:d.value,height:n.value},null),e.color&&o("div",{class:["v-color-picker-canvas__dot",{"v-color-picker-canvas__dot--disabled":e.disabled}],style:f.value},null)])),{}}});function $t(e,t){if(t){const a=e,{a:r}=a;return q(a,["a"])}return e}function Mt(e,t){if(t==null||typeof t=="string"){const a=Pe(e);return e.a===1?a.slice(0,7):a}if(typeof t=="object"){let a;return J(t,["r","g","b"])?a=$e(e):J(t,["h","s","l"])?a=Me(e):J(t,["h","s","v"])&&(a=e),$t(a,!J(t,["a"])&&e.a===1)}return e}const L={h:0,s:0,v:0,a:1},de={inputProps:{type:"number",min:0},inputs:[{label:"R",max:255,step:1,getValue:e=>Math.round(e.r),getColor:(e,t)=>V(m({},e),{r:Number(t)})},{label:"G",max:255,step:1,getValue:e=>Math.round(e.g),getColor:(e,t)=>V(m({},e),{g:Number(t)})},{label:"B",max:255,step:1,getValue:e=>Math.round(e.b),getColor:(e,t)=>V(m({},e),{b:Number(t)})},{label:"A",max:1,step:.01,getValue:e=>{let{a:t}=e;return t!=null?Math.round(t*100)/100:1},getColor:(e,t)=>V(m({},e),{a:Number(t)})}],to:$e,from:fe};var Se;const Et=V(m({},de),{inputs:(Se=de.inputs)==null?void 0:Se.slice(0,3)}),ie={inputProps:{type:"number",min:0},inputs:[{label:"H",max:360,step:1,getValue:e=>Math.round(e.h),getColor:(e,t)=>V(m({},e),{h:Number(t)})},{label:"S",max:1,step:.01,getValue:e=>Math.round(e.s*100)/100,getColor:(e,t)=>V(m({},e),{s:Number(t)})},{label:"L",max:1,step:.01,getValue:e=>Math.round(e.l*100)/100,getColor:(e,t)=>V(m({},e),{l:Number(t)})},{label:"A",max:1,step:.01,getValue:e=>{let{a:t}=e;return t!=null?Math.round(t*100)/100:1},getColor:(e,t)=>V(m({},e),{a:Number(t)})}],to:Me,from:We},Bt=V(m({},ie),{inputs:ie.inputs.slice(0,3)}),Ne={inputProps:{type:"text"},inputs:[{label:"HEXA",getValue:e=>e,getColor:(e,t)=>t}],to:Pe,from:Ee},Dt=V(m({},Ne),{inputs:[{label:"HEX",getValue:e=>e.slice(0,7),getColor:(e,t)=>t}]}),R={rgb:Et,rgba:de,hsl:Bt,hsla:ie,hex:Dt,hexa:Ne},Ut=e=>{let r=e,{label:t}=r,a=q(r,["label"]);return o("div",{class:"v-color-picker-edit__input"},[o("input",a,null),o("span",null,[t])])},It=N(m({color:Object,disabled:Boolean,mode:{type:String,default:"rgba",validator:e=>Object.keys(R).includes(e)},modes:{type:Array,default:()=>Object.keys(R),validator:e=>Array.isArray(e)&&e.every(t=>Object.keys(R).includes(t))}},W()),"VColorPickerEdit"),Ht=X({name:"VColorPickerEdit",props:It(),emits:{"update:color":e=>!0,"update:mode":e=>!0},setup(e,t){let{emit:a}=t;const r=B(()=>e.modes.map(d=>V(m({},R[d]),{name:d}))),i=B(()=>{var h;const d=r.value.find(s=>s.name===e.mode);if(!d)return[];const n=e.color?d.to(e.color):null;return(h=d.inputs)==null?void 0:h.map(s=>{let k=s,{getValue:f,getColor:C}=k,x=q(k,["getValue","getColor"]);return V(m(m({},d.inputProps),x),{disabled:e.disabled,value:n&&f(n),onChange:l=>{const c=l.target;!c||a("update:color",d.from(C(n!=null?n:d.to(L),c.value)))}})})});return F(()=>{var d;return o("div",{class:["v-color-picker-edit",e.class],style:e.style},[(d=i.value)==null?void 0:d.map(n=>o(Ut,n,null)),r.value.length>1&&o(Be,{icon:"$unfold",size:"x-small",variant:"plain",onClick:()=>{const n=r.value.findIndex(h=>h.name===e.mode);a("update:mode",r.value[(n+1)%r.value.length].name)}},null)])}),{}}});const At=N(m({color:{type:Object},disabled:Boolean,hideAlpha:Boolean},W()),"VColorPickerPreview"),Rt=X({name:"VColorPickerPreview",props:At(),emits:{"update:color":e=>!0},setup(e,t){let{emit:a}=t;const r=new AbortController;Xe(()=>r.abort());function i(){return ge(this,null,function*(){var n;if(!ke)return;const d=new window.EyeDropper;try{const h=yield d.open({signal:r.signal}),s=Ee(h.sRGBHex);a("update:color",m(m({},(n=e.color)!=null?n:L),s))}catch(h){}})}return F(()=>{var d,n,h,s;return o("div",{class:["v-color-picker-preview",{"v-color-picker-preview--hide-alpha":e.hideAlpha},e.class],style:e.style},[ke&&o("div",{class:"v-color-picker-preview__eye-dropper",key:"eyeDropper"},[o(Be,{onClick:i,icon:"$eyeDropper",variant:"plain",density:"comfortable"},null)]),o("div",{class:"v-color-picker-preview__dot"},[o("div",{style:{background:De((d=e.color)!=null?d:L)}},null)]),o("div",{class:"v-color-picker-preview__sliders"},[o(ce,{class:"v-color-picker-preview__track v-color-picker-preview__hue",modelValue:(n=e.color)==null?void 0:n.h,"onUpdate:modelValue":f=>{var C;return a("update:color",V(m({},(C=e.color)!=null?C:L),{h:f}))},step:0,min:0,max:360,disabled:e.disabled,thumbSize:14,trackSize:8,trackFillColor:"white",hideDetails:!0},null),!e.hideAlpha&&o(ce,{class:"v-color-picker-preview__track v-color-picker-preview__alpha",modelValue:(s=(h=e.color)==null?void 0:h.a)!=null?s:1,"onUpdate:modelValue":f=>{var C;return a("update:color",V(m({},(C=e.color)!=null?C:L),{a:f}))},step:1/256,min:0,max:1,disabled:e.disabled,thumbSize:14,trackSize:8,trackFillColor:"white",hideDetails:!0},null)])])}),{}}});const Lt={base:"#f44336",lighten5:"#ffebee",lighten4:"#ffcdd2",lighten3:"#ef9a9a",lighten2:"#e57373",lighten1:"#ef5350",darken1:"#e53935",darken2:"#d32f2f",darken3:"#c62828",darken4:"#b71c1c",accent1:"#ff8a80",accent2:"#ff5252",accent3:"#ff1744",accent4:"#d50000"},Nt={base:"#e91e63",lighten5:"#fce4ec",lighten4:"#f8bbd0",lighten3:"#f48fb1",lighten2:"#f06292",lighten1:"#ec407a",darken1:"#d81b60",darken2:"#c2185b",darken3:"#ad1457",darken4:"#880e4f",accent1:"#ff80ab",accent2:"#ff4081",accent3:"#f50057",accent4:"#c51162"},Ft={base:"#9c27b0",lighten5:"#f3e5f5",lighten4:"#e1bee7",lighten3:"#ce93d8",lighten2:"#ba68c8",lighten1:"#ab47bc",darken1:"#8e24aa",darken2:"#7b1fa2",darken3:"#6a1b9a",darken4:"#4a148c",accent1:"#ea80fc",accent2:"#e040fb",accent3:"#d500f9",accent4:"#aa00ff"},zt={base:"#673ab7",lighten5:"#ede7f6",lighten4:"#d1c4e9",lighten3:"#b39ddb",lighten2:"#9575cd",lighten1:"#7e57c2",darken1:"#5e35b1",darken2:"#512da8",darken3:"#4527a0",darken4:"#311b92",accent1:"#b388ff",accent2:"#7c4dff",accent3:"#651fff",accent4:"#6200ea"},Ot={base:"#3f51b5",lighten5:"#e8eaf6",lighten4:"#c5cae9",lighten3:"#9fa8da",lighten2:"#7986cb",lighten1:"#5c6bc0",darken1:"#3949ab",darken2:"#303f9f",darken3:"#283593",darken4:"#1a237e",accent1:"#8c9eff",accent2:"#536dfe",accent3:"#3d5afe",accent4:"#304ffe"},Tt={base:"#2196f3",lighten5:"#e3f2fd",lighten4:"#bbdefb",lighten3:"#90caf9",lighten2:"#64b5f6",lighten1:"#42a5f5",darken1:"#1e88e5",darken2:"#1976d2",darken3:"#1565c0",darken4:"#0d47a1",accent1:"#82b1ff",accent2:"#448aff",accent3:"#2979ff",accent4:"#2962ff"},jt={base:"#03a9f4",lighten5:"#e1f5fe",lighten4:"#b3e5fc",lighten3:"#81d4fa",lighten2:"#4fc3f7",lighten1:"#29b6f6",darken1:"#039be5",darken2:"#0288d1",darken3:"#0277bd",darken4:"#01579b",accent1:"#80d8ff",accent2:"#40c4ff",accent3:"#00b0ff",accent4:"#0091ea"},Gt={base:"#00bcd4",lighten5:"#e0f7fa",lighten4:"#b2ebf2",lighten3:"#80deea",lighten2:"#4dd0e1",lighten1:"#26c6da",darken1:"#00acc1",darken2:"#0097a7",darken3:"#00838f",darken4:"#006064",accent1:"#84ffff",accent2:"#18ffff",accent3:"#00e5ff",accent4:"#00b8d4"},Wt={base:"#009688",lighten5:"#e0f2f1",lighten4:"#b2dfdb",lighten3:"#80cbc4",lighten2:"#4db6ac",lighten1:"#26a69a",darken1:"#00897b",darken2:"#00796b",darken3:"#00695c",darken4:"#004d40",accent1:"#a7ffeb",accent2:"#64ffda",accent3:"#1de9b6",accent4:"#00bfa5"},Xt={base:"#4caf50",lighten5:"#e8f5e9",lighten4:"#c8e6c9",lighten3:"#a5d6a7",lighten2:"#81c784",lighten1:"#66bb6a",darken1:"#43a047",darken2:"#388e3c",darken3:"#2e7d32",darken4:"#1b5e20",accent1:"#b9f6ca",accent2:"#69f0ae",accent3:"#00e676",accent4:"#00c853"},Yt={base:"#8bc34a",lighten5:"#f1f8e9",lighten4:"#dcedc8",lighten3:"#c5e1a5",lighten2:"#aed581",lighten1:"#9ccc65",darken1:"#7cb342",darken2:"#689f38",darken3:"#558b2f",darken4:"#33691e",accent1:"#ccff90",accent2:"#b2ff59",accent3:"#76ff03",accent4:"#64dd17"},qt={base:"#cddc39",lighten5:"#f9fbe7",lighten4:"#f0f4c3",lighten3:"#e6ee9c",lighten2:"#dce775",lighten1:"#d4e157",darken1:"#c0ca33",darken2:"#afb42b",darken3:"#9e9d24",darken4:"#827717",accent1:"#f4ff81",accent2:"#eeff41",accent3:"#c6ff00",accent4:"#aeea00"},Qt={base:"#ffeb3b",lighten5:"#fffde7",lighten4:"#fff9c4",lighten3:"#fff59d",lighten2:"#fff176",lighten1:"#ffee58",darken1:"#fdd835",darken2:"#fbc02d",darken3:"#f9a825",darken4:"#f57f17",accent1:"#ffff8d",accent2:"#ffff00",accent3:"#ffea00",accent4:"#ffd600"},Jt={base:"#ffc107",lighten5:"#fff8e1",lighten4:"#ffecb3",lighten3:"#ffe082",lighten2:"#ffd54f",lighten1:"#ffca28",darken1:"#ffb300",darken2:"#ffa000",darken3:"#ff8f00",darken4:"#ff6f00",accent1:"#ffe57f",accent2:"#ffd740",accent3:"#ffc400",accent4:"#ffab00"},Kt={base:"#ff9800",lighten5:"#fff3e0",lighten4:"#ffe0b2",lighten3:"#ffcc80",lighten2:"#ffb74d",lighten1:"#ffa726",darken1:"#fb8c00",darken2:"#f57c00",darken3:"#ef6c00",darken4:"#e65100",accent1:"#ffd180",accent2:"#ffab40",accent3:"#ff9100",accent4:"#ff6d00"},Zt={base:"#ff5722",lighten5:"#fbe9e7",lighten4:"#ffccbc",lighten3:"#ffab91",lighten2:"#ff8a65",lighten1:"#ff7043",darken1:"#f4511e",darken2:"#e64a19",darken3:"#d84315",darken4:"#bf360c",accent1:"#ff9e80",accent2:"#ff6e40",accent3:"#ff3d00",accent4:"#dd2c00"},ea={base:"#795548",lighten5:"#efebe9",lighten4:"#d7ccc8",lighten3:"#bcaaa4",lighten2:"#a1887f",lighten1:"#8d6e63",darken1:"#6d4c41",darken2:"#5d4037",darken3:"#4e342e",darken4:"#3e2723"},ta={base:"#607d8b",lighten5:"#eceff1",lighten4:"#cfd8dc",lighten3:"#b0bec5",lighten2:"#90a4ae",lighten1:"#78909c",darken1:"#546e7a",darken2:"#455a64",darken3:"#37474f",darken4:"#263238"},aa={base:"#9e9e9e",lighten5:"#fafafa",lighten4:"#f5f5f5",lighten3:"#eeeeee",lighten2:"#e0e0e0",lighten1:"#bdbdbd",darken1:"#757575",darken2:"#616161",darken3:"#424242",darken4:"#212121"},la={black:"#000000",white:"#ffffff",transparent:"#ffffff00"},oa={red:Lt,pink:Nt,purple:Ft,deepPurple:zt,indigo:Ot,blue:Tt,lightBlue:jt,cyan:Gt,teal:Wt,green:Xt,lightGreen:Yt,lime:qt,yellow:Qt,amber:Jt,orange:Kt,deepOrange:Zt,brown:ea,blueGrey:ta,grey:aa,shades:la},na=N(m({swatches:{type:Array,default:()=>sa(oa)},disabled:Boolean,color:Object,maxHeight:[Number,String]},W()),"VColorPickerSwatches");function sa(e){return Object.keys(e).map(t=>{const a=e[t];return a.base?[a.base,a.darken4,a.darken3,a.darken2,a.darken1,a.lighten1,a.lighten2,a.lighten3,a.lighten4,a.lighten5]:[a.black,a.white,a.transparent]})}const ra=X({name:"VColorPickerSwatches",props:na(),emits:{"update:color":e=>!0},setup(e,t){let{emit:a}=t;return F(()=>o("div",{class:["v-color-picker-swatches",e.class],style:[{maxHeight:z(e.maxHeight)},e.style]},[o("div",null,[e.swatches.map(r=>o("div",{class:"v-color-picker-swatches__swatch"},[r.map(i=>{const d=Ue(i),n=fe(d),h=Ye(d);return o("div",{class:"v-color-picker-swatches__color",onClick:()=>n&&a("update:color",n)},[o("div",{style:{background:h}},[e.color&&qe(e.color,n)?o(Qe,{size:"x-small",icon:"$success",color:Je(i,"#FFFFFF")>2?"white":"black"},null):void 0])])})]))])])),{}}});const Fe=N(m(m(m(m(m(m(m(m(m({color:String},Ke()),W()),Ze()),et()),tt()),at()),lt()),ot()),nt()),"VSheet"),_e=st()({name:"VSheet",props:Fe(),setup(e,t){let{slots:a}=t;const{themeClasses:r}=rt(e),{backgroundColorClasses:i,backgroundColorStyles:d}=ct(dt(e,"color")),{borderClasses:n}=it(e),{dimensionStyles:h}=ut(e),{elevationClasses:s}=ft(e),{locationStyles:f}=vt(e),{positionClasses:C}=ht(e),{roundedClasses:x}=mt(e);return F(()=>o(e.tag,{class:["v-sheet",r.value,i.value,n.value,s.value,C.value,x.value,e.class],style:[d.value,h.value,f.value,e.style]},a)),{}}}),ca=N(m({canvasHeight:{type:[String,Number],default:150},disabled:Boolean,dotSize:{type:[Number,String],default:10},hideCanvas:Boolean,hideSliders:Boolean,hideInputs:Boolean,mode:{type:String,default:"rgba",validator:e=>Object.keys(R).includes(e)},modes:{type:Array,default:()=>Object.keys(R),validator:e=>Array.isArray(e)&&e.every(t=>Object.keys(R).includes(t))},showSwatches:Boolean,swatches:Array,swatchesMaxHeight:{type:[Number,String],default:150},modelValue:{type:[Object,String]}},bt(Fe({width:300}),["height","location","minHeight","maxHeight","minWidth","maxWidth"])),"VColorPicker"),da=X({name:"VColorPicker",props:ca(),emits:{"update:modelValue":e=>!0,"update:mode":e=>!0},setup(e){const t=Ce(e,"mode"),a=S(null),r=Ce(e,"modelValue",void 0,s=>{if(s==null||s==="")return null;let f;try{f=fe(Ue(s))}catch(C){return null}return f},s=>s?Mt(s,e.modelValue):null),i=B(()=>{var s;return r.value?V(m({},r.value),{h:(s=a.value)!=null?s:r.value.h}):null}),{rtlClasses:d}=gt();let n=!0;T(r,s=>{if(!n){n=!0;return}!s||(a.value=s.h)},{immediate:!0});const h=s=>{n=!1,a.value=s.h,r.value=s};return ue(()=>{e.modes.includes(t.value)||(t.value=e.modes[0])}),kt({VSlider:{color:void 0,trackColor:void 0,trackFillColor:void 0}}),F(()=>{var f;const s=_e.filterProps(e);return o(_e,Ct({rounded:e.rounded,elevation:e.elevation,theme:e.theme,class:["v-color-picker",d.value,e.class],style:[{"--v-color-picker-color-hsv":De(V(m({},(f=i.value)!=null?f:L),{a:1}))},e.style]},s,{maxWidth:e.width}),{default:()=>[!e.hideCanvas&&o(Pt,{key:"canvas",color:i.value,"onUpdate:color":h,disabled:e.disabled,dotSize:e.dotSize,width:e.width,height:e.canvasHeight},null),(!e.hideSliders||!e.hideInputs)&&o("div",{key:"controls",class:"v-color-picker__controls"},[!e.hideSliders&&o(Rt,{key:"preview",color:i.value,"onUpdate:color":h,hideAlpha:!t.value.endsWith("a"),disabled:e.disabled},null),!e.hideInputs&&o(Ht,{key:"edit",modes:e.modes,mode:t.value,"onUpdate:mode":C=>t.value=C,color:i.value,"onUpdate:color":h,disabled:e.disabled},null)]),e.showSwatches&&o(ra,{key:"swatches",color:i.value,"onUpdate:color":h,maxHeight:e.swatchesMaxHeight,swatches:e.swatches,disabled:e.disabled},null)]})}),{}}}),ia=e=>(Ae("data-v-47d6114b"),e=e(),Re(),e),ua={class:"pa-1"},fa=ia(()=>y("p",{class:"ml-2 mt-1"},"MxCAD\u989C\u8272\u7D22\u5F15(ACI):",-1)),va={class:"px-2 pt-1 pb-4"},ha={class:"colors d-flex flex-column flex-wrap mt-1 mirrorRotateVertical",style:{height:"100px"}},ma=["onMousemove","onClick"],ba={class:"colors d-flex flex-column flex-wrap mt-3",style:{height:"100px"}},ga=["onMousemove","onClick"],ka={style:{height:"24px"}},Ca={class:"d-flex justify-space-between mt-1"},pa={class:"index-colors d-flex flex-wrap"},ya=["onMousemove","onClick"],xa={class:"index-colors d-flex flex-wrap"},wa=["onMousemove","onClick"],Va={class:"superimposed-layer align-self-end mt-2"},ne=9,se=7,_a=ve({__name:"IndexColor",props:{color:{},method:{}},emits:["update:color"],setup(e,{emit:t}){const a=v=>{t("update:color",v)},r=re(),{colorIndexList:i}=Ie(r),d=B(()=>i.value.slice(0,ne)),n=B(()=>i.value.slice(i.value.length-se,i.value.length-1)),h=B(()=>i.value.slice(ne,i.value.length-se).filter((v,p)=>p%2!==0)),s=B(()=>i.value.slice(ne,i.value.length-se-1).filter((v,p)=>p%2===0)),f=S(-1),C=S(-1),x=S(e.color),k=S(""),l=S(!1),c=e.color.toString();ue(()=>{const v=te(e.color),p=v.red(),b=v.green(),$=v.blue(),D=pt(p,b,$,!1);C.value=D,f.value=D,k.value=le[D]||D.toString(),e.method!==O.kByACI&&(k.value=`${p},${b},${$}`)});const _=v=>{f.value=v.index,k.value=le[v.index]||v.index.toString(),a(v.color)},u=v=>{k.value=v;const p=le[v];typeof p=="number"?f.value=p:f.value=Number(v)},g=v=>{x.value=v.color,C.value=v.index},P=B(()=>{const v=te(x.value);return`${v.red()}, ${v.green()}, ${v.blue()}`});return(v,p)=>(M(),E("div",ua,[fa,y("div",va,[y("div",{onMouseout:p[0]||(p[0]=b=>l.value=!1),onMousemove:p[1]||(p[1]=b=>l.value=!0)},[y("div",ha,[(M(!0),E(K,null,Z(s.value,(b,$)=>(M(),E("div",{class:ee(["color-box",f.value===b.index?"active-color-box":""]),style:I({backgroundColor:b.color}),onMousemove:D=>g(b),onClick:D=>_(b)},null,46,ma))),256))]),y("div",ba,[(M(!0),E(K,null,Z(h.value,(b,$)=>(M(),E("div",{class:ee(["color-box",f.value===b.index?"active-color-box":""]),style:I({backgroundColor:b.color}),onMousemove:D=>g(b),onClick:D=>_(b)},null,46,ga))),256))])],32),y("div",ka,[y("div",Ca,[pe(y("span",null,"\u7D22\u5F15\u989C\u8272: "+xe(C.value),513),[[ye,l.value]]),pe(y("span",null,"RGB: "+xe(P.value),513),[[ye,l.value]])])]),o(He,null,{default:w(()=>[o(j,{cols:"6"},{default:w(()=>[y("div",{onMouseout:p[2]||(p[2]=b=>l.value=!1),onMousemove:p[3]||(p[3]=b=>l.value=!0)},[y("div",pa,[(M(!0),E(K,null,Z(d.value,b=>(M(),E("div",{class:ee(["color-box",f.value===b.index?"active-color-box":""]),style:I({backgroundColor:b.color}),onMousemove:$=>g(b),onClick:$=>_(b)},null,46,ya))),256))]),y("div",xa,[(M(!0),E(K,null,Z(n.value,b=>(M(),E("div",{class:ee(["color-box",f.value===b.index?"active-color-box":""]),style:I({backgroundColor:b.color}),onMousemove:$=>g(b),onClick:$=>_(b)},null,46,wa))),256))])],32),o(U,{class:"mt-2","model-value":k.value,"onUpdate:modelValue":u},{prepend:w(()=>[o(H,{"key-name":"C"},{default:w(()=>[A("\u989C\u8272")]),_:1})]),_:1},8,["model-value"])]),_:1}),o(j,{cols:"6",class:"d-flex justify-end"},{default:w(()=>[y("div",Va,[y("div",{class:"box1",style:I({backgroundColor:G(c)})},null,4),y("div",{class:"box2",style:I({backgroundColor:v.color})},null,4)])]),_:1})]),_:1})])]))}});const Sa=Le(_a,[["__scopeId","data-v-47d6114b"]]),Pa=e=>(Ae("data-v-378db9df"),e=e(),Re(),e),$a={class:"pa-1"},Ma={class:"d-flex mr-12"},Ea={class:""},Ba={class:"ml-5"},Da=Pa(()=>y("span",null,"HEX: ",-1)),Ua={class:"d-flex flex-column justify-center align-center"},Ia={class:"d-flex flex-column"},Ha={class:"superimposed-layer align-self-end m-t mb-2"},Aa=ve({__name:"TrueColor",props:{color:{default:"#fff"},method:{}},emits:["update:color"],setup(e,{emit:t}){const a=k=>{t("update:color",k)},r=e.color.toString(),i=S(0),d=S(0),n=S(0),h=S(0),s=S(0),f=S(0),C=k=>{const l=te(k);i.value=l.red(),d.value=l.blue(),n.value=l.green();const c=2;h.value=oe(l.hue(),c),s.value=oe(l.saturationl(),c),f.value=oe(l.lightness(),c)};T(()=>e.color,k=>{if(k)try{C(k)}catch(l){}}),C(e.color);const x=(k,l)=>{const c=te(e.color);a(c[k](Number(l)).toString())};return(k,l)=>(M(),E("div",$a,[o(He,null,{default:w(()=>[o(j,{cols:"7","align-self":"start"},{default:w(()=>[y("div",Ma,[y("div",Ea,[o(H,{"key-name":"E"},{default:w(()=>[A("\u8272\u8C03")]),_:1}),o(U,{class:"",type:"number",modelValue:h.value,"onUpdate:modelValue":[l[0]||(l[0]=c=>h.value=c),l[1]||(l[1]=c=>x("hue",c))]},null,8,["modelValue"])]),y("div",Ba,[o(H,{"key-name":"S"},{default:w(()=>[A("\u9971\u548C\u5EA6")]),_:1}),o(U,{class:"",type:"number",modelValue:s.value,"onUpdate:modelValue":[l[2]||(l[2]=c=>s.value=c),l[3]||(l[3]=c=>x("saturationl",c))]},null,8,["modelValue"])])]),o(da,{class:"mt-4 mx-color-picker","hide-inputs":"","model-value":k.color,"onUpdate:modelValue":a,elevation:"0",rounded:"0",width:"300"},null,8,["model-value"]),o(U,{"model-value":k.color,"onUpdate:modelValue":a},{prepend:w(()=>[Da]),_:1},8,["model-value"])]),_:1}),o(j,{cols:"2","align-self":"start"},{default:w(()=>[y("div",Ua,[y("div",Ia,[o(H,{"key-name":"L"},{default:w(()=>[A("\u4EAE\u5EA6")]),_:1}),o(U,{class:"",type:"number",modelValue:f.value,"onUpdate:modelValue":[l[4]||(l[4]=c=>f.value=c),l[5]||(l[5]=c=>x("lightness",c))]},null,8,["modelValue"]),o(ce,{class:"mx-color-slider",direction:"vertical",modelValue:f.value,"onUpdate:modelValue":[l[6]||(l[6]=c=>f.value=c),l[7]||(l[7]=c=>x("lightness",c))]},null,8,["modelValue"])])])]),_:1}),o(j,{cols:"3","align-self":"end"},{default:w(()=>[o(U,{class:"mt-1",type:"number",modelValue:i.value,"onUpdate:modelValue":[l[8]||(l[8]=c=>i.value=c),l[9]||(l[9]=c=>x("red",c))]},{prepend:w(()=>[o(H,{"key-name":"R"},{default:w(()=>[A("\u7EA2")]),_:1})]),_:1},8,["modelValue"]),o(U,{class:"mt-1",type:"number",modelValue:d.value,"onUpdate:modelValue":[l[10]||(l[10]=c=>d.value=c),l[11]||(l[11]=c=>x("blue",c))]},{prepend:w(()=>[o(H,{"key-name":"G"},{default:w(()=>[A("\u7EFF")]),_:1})]),_:1},8,["modelValue"]),o(U,{class:"mt-1",type:"number",modelValue:n.value,"onUpdate:modelValue":[l[12]||(l[12]=c=>n.value=c),l[13]||(l[13]=c=>x("green",c))]},{prepend:w(()=>[o(H,{"key-name":"B"},{default:w(()=>[A("\u84DD")]),_:1})]),_:1},8,["modelValue"]),y("div",Ha,[y("div",{class:"box1",style:I(`background:${G(r)};`)},null,4),y("div",{class:"box2",style:I(`background:${k.color};`)},null,4)])]),_:1})]),_:1})]))}});const Ra=Le(Aa,[["__scopeId","data-v-378db9df"]]),La=()=>{const e=S("#000"),t=S(O.kByACI),a=S(0),r=[{tab:"\u7D22\u5F15\u989C\u8272",component:()=>we(Sa,{color:e.value,method:t.value,["onUpdate:color"]:n=>{e.value=n,d(O.kByACI)}})},{tab:"\u771F\u5F69\u8272",component:()=>we(Ra,{color:e.value,method:t.value,["onUpdate:color"]:n=>{e.value=n,d(O.kByColor)}})}],i=n=>{e.value=n},d=n=>{t.value=n,a.value=n===O.kByColor?1:0};return{items:r,color:e,setColor:i,setMethod:d,tab:a,method:t}},Na={class:"px-1"},Wa=ve({__name:"index",setup(e){const{items:t,color:a,tab:r,method:i,setColor:d,setMethod:n}=La(),{createColor:h}=re(),{colorSelectList:s,currentSelectColor:f}=Ie(re());let C;const{isShow:x,showDialog:k}=yt(!1,"Mx_Color",(c={call:(_,u)=>{const g=h(m({},wt(_,u)));s.value.unshift(g),f.value=g},color:f.value})=>{const{call:_,color:u}=c;k(),C=_,u&&(d(u.color),n(u.method))}),l=[{name:"\u786E\u5B9A",fun:()=>{C&&C(a.value,i.value),k(!1)},primary:!0},{name:"\u53D6\u6D88",fun:()=>k(!1)}];return(c,_)=>(M(),xt(Vt,{modelValue:G(x),"onUpdate:modelValue":_[1]||(_[1]=u=>Ve(x)?x.value=u:null),footerBtnList:l,"max-width":"580",title:"\u9009\u62E9\u989C\u8272"},{default:w(()=>[y("div",Na,[o(_t,{modelValue:G(r),"onUpdate:modelValue":_[0]||(_[0]=u=>Ve(r)?r.value=u:null),items:G(t),"tabs-props":{grow:!0},height:386},null,8,["modelValue","items"])])]),_:1},8,["modelValue"]))}});export{Wa as default};
|