-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
1 lines (1 loc) · 1.7 KB
/
index.js
1
(function(){"use strict";function l(r,e,t,o,s,c,i,k){var n=typeof r=="function"?r.options:r;return e&&(n.render=e,n.staticRenderFns=t,n._compiled=!0),{exports:r,options:n}}const a={props:{help:String,value:Object,label:String,disabled:Boolean,required:Boolean,options:Object},methods:{isBrightColor(r){const e=r.replace("#",""),[t,o,s]=[0,2,4].map(i=>parseInt(e.substr(i,2),16));return(t*299+o*587+s*114)/1e3>155}}};var d=function(){var e=this,t=e._self._c;return t("k-field",e._b({staticClass:"k-color-field",attrs:{input:e.id}},"k-field",e.$props,!1),[t("fieldset",{staticClass:"k-coloroptions-input k-color-field-options",attrs:{disabled:e.disabled}},[t("ul",e._l(e.options,function(o,s){return t("li",{key:s},[t("label",{attrs:{title:o.title??o.class}},[t("input",{staticClass:"input-hidden",attrs:{autofocus:e.autofocus&&s===0,disabled:e.disabled,name:e.name??e.id,required:e.required,type:"radio"},domProps:{checked:o.hex===e.value.hex,value:o.hex},on:{change:function(c){return e.$emit("input",o)}}}),t("k-color-frame",{attrs:{color:"#"+o.hex}},[o.hex===e.value.hex?t("k-icon",{staticStyle:{"z-index":"var(--z-content)"},attrs:{color:e.isBrightColor(o.hex)?"var(--color-black)":"var(--color-white)",type:"checked"}}):e._e()],1)],1)])}),0)])])},u=[],f=l(a,d,u);const _=f.exports,p={props:{value:Object}};var h=function(){var e=this,t=e._self._c;return t("div",{staticClass:"k-color-field-preview"},[t("k-color-frame",{attrs:{color:"#"+e.value.hex}})],1)},v=[],m=l(p,h,v);const b=m.exports;panel.plugin("double-check/colors-field",{fields:{colors:_},components:{"k-colors-field-preview":b},icons:{checked:'<path d="M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z" />'}})})();