2 lines
8.2 KiB
JavaScript
2 lines
8.2 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("$"),require("VueColor")):"function"==typeof define&&define.amd?define(["$","VueColor"],t):"object"==typeof exports?exports["g5-vue-ctrls"]=t(require("$"),require("VueColor")):e["g5-vue-ctrls"]=t(e.$,e.VueColor)}(this,function(e,t){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=28)}({0:function(e,t){e.exports=function(e,t,n,o,r){var i,s=e=e||{},a=typeof e.default;"object"!==a&&"function"!==a||(i=e,s=e.default);var c="function"==typeof s?s.options:s;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns),o&&(c._scopeId=o);var l;if(r?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=l):n&&(l=n),l){var u=c.functional,p=u?c.render:c.beforeCreate;u?c.render=function(e,t){return l.call(t),p(e,t)}:c.beforeCreate=p?[].concat(p,l):[l]}return{esModule:i,exports:s,options:c}}},12:function(e,t){function n(){this._dictionary={}}n.prototype.get=function(e){return this._dictionary[e]},n.prototype.clear=function(){this._dictionary={}},n.prototype.add=function(e,t){this._dictionary[e]=t},e.exports=n},17:function(e,t,n){function o(e){n(52)}var r=n(0)(n(45),n(85),o,"data-v-9fe03e78",null);e.exports=r.exports},18:function(e,t,n){function o(e){n(48)}var r=n(0)(n(46),n(71),o,"data-v-2b1cb026",null);e.exports=r.exports},28:function(e,t,n){var o=n(17),r=n(18),i=n(12),s=n(3);e.exports={aggregateItem:o,colorbox:r,Dictionary:i,directives:s}},3:function(e,t){function n(e){null!=e.preventDefault?e.preventDefault():e.returnValue=!1}function o(e){if(!e)return-1;if(null!=e.selectionStart)return e.selectionStart;try{var t=document.selection.createRange();return t.moveStart("character",-e.value.length),t.text.length}catch(e){return 0}}function r(e){return function(t){8===t.keyCode||9===t.keyCode||46===t.keyCode||t.keyCode>=35&&t.keyCode<=40||65===t.keyCode&&t.ctrlKey||("float"!==e||110!==t.keyCode&&190!==t.keyCode?173===t.keyCode||189===t.keyCode||109===t.keyCode?"noneg"===e?n(t):this.value.indexOf("-")>=0?n(t):0!==o(t.target)&&n(t):(t.keyCode<48||t.keyCode>57)&&(t.keyCode<96||t.keyCode>105)?n(t):t.shiftKey&&n(t):this.value.indexOf(".")>=0&&n(t))}}e.exports={install:function(e){e.directive("fic-number",{bind:function(e,t){e.addEventListener("keydown",r(t.arg))}})},options:{bind:function(e,t){!0===t.value&&e.addEventListener("keydown",r(t.arg))}}}},4:function(t,n){t.exports=e},45:function(e,t){e.exports={props:{field:String,item:Object,source:Array},data:function(){return{itemReadonly:!0}},computed:{innerItem:function(){return this.item||{}}},mounted:function(){this.typeChanged(this.$refs.type,!0)},methods:{typeChanged:function(e,t){if(this.innerItem.type=e.value,this.itemReadonly=!/^expression$/i.test(e.value),this.itemReadonly)if(null==this.innerItem.type||/^\s*$/.test(this.innerItem.type))this.innerItem.expression="";else{var n=Array.prototype.filter.call(e.children,function(e){return e.selected});n.length>0&&(this.innerItem.expression=n[0].innerText+"()")}else t&&null!=this.innerItem.expression&&0!==this.innerItem.expression.length||(this.innerItem.expression="Count(["+this.field+"])")},valueChanged:function(e){this.innerItem.expression=e.value},onMultiLangs:function(){"function"==typeof this.innerItem.onMultiLangs&&this.innerItem.onMultiLangs()}}}},46:function(e,t,n){function o(e){return e.getBoundingClientRect()}function r(e){var t=/^#([\dA-Fa-f]{2})([\dA-Fa-f]{2})([\dA-Fa-f]{2})$/.exec(e);return null==t?{r:0,g:0,b:0,a:1}:{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16),a:1}}var i=n(88),s=n(4);null==i&&(i=window.VueColor),null==i&&null!=window.parent&&(i=window.parent.VueColor);var a=i.Sketch,c=a.data().presetColors;e.exports={props:{value:[String,Object],presets:Array,transparent:Boolean,enabled:null,window:null},data:function(){if(this.transparent&&(null==this.value||0===this.value.length))return{colorPanelVisible:!1,colorObject:{hex:"None",rgba:{r:0,g:0,b:0,a:0}}};var e=this.value||"#000000";return e.length>7&&(e="#"+e.substring(3)),{colorPanelVisible:!1,colorObject:{hex:e,rgba:r(e)}}},computed:{hexColor:function(){var e=this.colorObject.rgba||{r:0,g:0,b:0,a:1};return"rgba("+e.r+", "+e.g+", "+e.b+", "+e.a+")"},colorLabel:function(){var e=this.colorObject.hex,t=this.presets.filter(function(t){return t.color===e});return t&&t.length>0?t[0].text:e}},components:{"sketch-color":a},mounted:function(){null!=this.presets&&(this.$refs.colorpicker.presetColors=this.presets.map(function(e){return e.color})),s(this.$refs.colorpicker_wrapper).detach(),s((this.window||window).document.body).append(this.$refs.colorpicker_wrapper),s(this.$refs.colorpicker.$el).detach(),s((this.window||window).document.body).append(this.$refs.colorpicker.$el)},watch:{presets:function(e){e=e&&e.map(function(e){return e.color}),this.$refs.colorpicker.presetColors=e||c},value:function(e){!this.transparent||null!=e&&""!==e?this.colorObject={hex:e||"#000000",rgba:r(e)}:this.colorObject={hex:"None",rgba:{r:0,g:0,b:0,a:0}}}},methods:{onColorChanged:function(e){this.colorObject=e,this.$emit("input",e.hex)},onclickPanel:function(){if(!1!==this.enabled){var e=this.$el,t=o(e),n=this.$refs.colorpicker.$el;n.style.left=t.left+"px";var r=s(this.window||window).height(),i=t.top+e.offsetHeight,a=s(n).height();i+a+20>r&&(i=r-a-20),n.style.top=i+"px",this.colorPanelVisible=!0}},onmousedownWrapper:function(){this.colorPanelVisible=!1}}}},48:function(e,t){},52:function(e,t){},71:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"selector",style:{background:!1===e.enabled&&"none"}},[n("div",{staticStyle:{height:"100%"},on:{click:e.onclickPanel}},[n("span",{staticClass:"color-block"},[n("div",{staticClass:"color-block-bg"}),e._v(" "),n("div",{staticClass:"color-block-cell",style:{backgroundColor:e.hexColor}})]),e._v(" "),n("span",{staticClass:"color-label"},[e._v(e._s(e.colorLabel))]),e._v(" "),!1!==e.enabled?n("span",{staticClass:"color-drop"}):e._e()]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.colorPanelVisible,expression:"colorPanelVisible"}],ref:"colorpicker_wrapper",staticClass:"wrapper",on:{mousedown:function(t){return t.target!==t.currentTarget?null:e.onmousedownWrapper(t)}}}),e._v(" "),n("sketch-color",{directives:[{name:"show",rawName:"v-show",value:e.colorPanelVisible,expression:"colorPanelVisible"}],ref:"colorpicker",staticClass:"wrapper-color",attrs:{value:e.colorObject},on:{input:e.onColorChanged}})],1)},staticRenderFns:[]}},85:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("span",{staticClass:"fi-input-wrapper"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.innerItem.caption,expression:"innerItem.caption"}],staticClass:"caption",attrs:{type:"text"},domProps:{value:e.innerItem.caption},on:{focus:function(t){return e.$emit("focused",e.innerItem,"caption")},input:function(t){t.target.composing||e.$set(e.innerItem,"caption",t.target.value)}}}),e._v(" "),n("em",{staticClass:"fa fi-multilangs",on:{mouseup:e.onMultiLangs}})]),n("select",{ref:"type",staticClass:"type",domProps:{value:e.innerItem.type},on:{change:function(t){return e.typeChanged(t.target)},focus:function(t){return e.$emit("focused",e.innerItem,"type")}}},[e._l(e.source,function(t,o){return[n("option",{key:o,domProps:{value:t}},[e._v(e._s(t))])]})],2),n("input",{class:["expr",e.itemReadonly&&"readonly"],attrs:{type:"text"},domProps:{value:e.innerItem.expression,readOnly:e.itemReadonly},on:{focus:function(t){return e.$emit("focused",e.innerItem,"expression")},input:function(t){return e.valueChanged(t.target)}}})])},staticRenderFns:[]}},88:function(e,n){e.exports=t}})});
|
|
//# sourceMappingURL=vue-ctrls.js.map?ee21d614aa0b2fb92c7c
|