@castlabs/ui 7.6.0 → 7.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1134,5 +1134,5 @@
1134
1134
  .ace-chrome .ace_indent-guide-active {
1135
1135
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
1136
1136
  }
1137
- `}),ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(k,x,H){x.isDark=!1,x.cssClass="ace-chrome",x.cssText=k("./chrome-css");var E=k("../lib/dom");E.importCssString(x.cssText,x.cssClass,!1)}),(function(){ace.require(["ace/theme/chrome"],function(k){W&&(W.exports=k)})})()})(le)),le.exports}Ke();const ve="chrome",Ye=Q.defineComponent({name:"ClFieldEditor",components:{VAceEditor:je},inheritAttrs:!1,props:{class:{type:String,default:`ace_editor ace-${ve}`},label:{type:String,default:void 0},initial:{type:String,default:""},lang:{type:String,default:""},rows:{type:Number,default:void 0},required:{type:Boolean,default:!1},help:{type:String,default:void 0},error:{type:String,default:void 0},invalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1}},emits:["change","update:valid","update:modelValue"],data(){return{valid:!0,value:this.initial,invalidMessage:this.error||"Input invalid."}},computed:{uid:function(){return this.$uid},theme:function(){return ve},classes:function(){return this.class+" form-control"+(this.valid?"":" invalid")},options:function(){return{tabSize:2}}},methods:{setValue:function(W){this.$refs.aceEditor._editor?.setValue(W)},click:function(){this.changed()},changed:function(){if(this.valid=!0,this.required&&(this.value??"").trim()==="")this.setInvalid("This field may not be blank.");else if(this.lang==="json")try{JSON.parse(this.value??"{}")}catch(W){W.ignore=!0,this.setInvalid("Please enter valid JSON.")}this.$emit("update:modelValue",this.value),this.$emit("change")},setInvalid:function(W){this.valid=!1,this.invalidMessage=W,this.$emit("update:valid",this.valid)}}}),Qe=(W,U)=>{const k=W.__vccOpts||W;for(const[x,H]of U)k[x]=H;return k},Ze=["for"],Xe={key:0,class:"required"},Je={class:"invalid-feedback"},qe={key:1,class:"valid-feedback"},et={key:2,class:"valid-feedback valid-feedback-none"};function tt(W,U,k,x,H,E){const A=Q.resolveComponent("v-ace-editor");return Q.openBlock(),Q.createElementBlock(Q.Fragment,null,[W.label?(Q.openBlock(),Q.createElementBlock("label",{key:0,for:W.uid,class:"form-label"},[Q.createTextVNode(Q.toDisplayString(W.label),1),W.required?(Q.openBlock(),Q.createElementBlock("span",Xe,"*")):Q.createCommentVNode("",!0)],8,Ze)):Q.createCommentVNode("",!0),Q.createVNode(A,{id:W.uid,ref:"aceEditor",value:W.value,"onUpdate:value":U[0]||(U[0]=$=>W.value=$),class:Q.normalizeClass(W.classes),disabled:W.disabled,readonly:W.disabled,lang:W.lang,theme:W.theme,options:W.options,"min-lines":W.rows??10,"max-lines":W.rows??25,onClick:W.click,onBlur:W.changed,onChange:W.changed},null,8,["id","value","class","disabled","readonly","lang","theme","options","min-lines","max-lines","onClick","onBlur","onChange"]),Q.createElementVNode("p",Je,Q.toDisplayString(W.invalidMessage),1),W.help?(Q.openBlock(),Q.createElementBlock("p",qe,Q.toDisplayString(W.help),1)):(Q.openBlock(),Q.createElementBlock("p",et))],64)}const te=Qe(Ye,[["render",tt]]);te.install=W=>{W.component(te.name??"ClNoName",te)};const ce={ClFieldEditor:te};function it(W){for(const U in ce)W.component(ce[U].name,ce[U])}exports.ClFieldEditor=te;exports.castlabsUiEditor=it;
1137
+ `}),ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(k,x,H){x.isDark=!1,x.cssClass="ace-chrome",x.cssText=k("./chrome-css");var E=k("../lib/dom");E.importCssString(x.cssText,x.cssClass,!1)}),(function(){ace.require(["ace/theme/chrome"],function(k){W&&(W.exports=k)})})()})(le)),le.exports}Ke();const ve="chrome",Ye=Q.defineComponent({name:"ClFieldEditor",components:{VAceEditor:je},inheritAttrs:!1,props:{class:{type:String,default:`ace_editor ace-${ve}`},label:{type:String,default:void 0},initial:{type:String,default:""},lang:{type:String,default:""},rows:{type:Number,default:void 0},required:{type:Boolean,default:!1},help:{type:String,default:void 0},error:{type:String,default:void 0},invalid:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1}},emits:["change","update:valid","update:modelValue"],data(){return{valid:!0,value:this.initial,invalidMessage:this.error||"Input invalid."}},computed:{uid:function(){return this.$uid},theme:function(){return ve},classes:function(){return this.class+" form-control"+(this.valid?"":" invalid")},options:function(){return{tabSize:2}}},methods:{setValue:function(W){this.$refs.aceEditor._editor?.setValue(W)},click:function(){this.changed()},changed:function(){if(this.valid=!0,this.required&&(this.value??"").trim()==="")this.setInvalid("This field may not be blank.");else if(this.lang==="json")try{JSON.parse(this.value??"{}")}catch(W){W.ignore=!0,this.setInvalid("Please enter valid JSON.")}this.$emit("update:modelValue",this.value),this.$emit("change")},setInvalid:function(W){this.valid=!1,this.invalidMessage=W,this.$emit("update:valid",this.valid)}}}),Qe=(W,U)=>{const k=W.__vccOpts||W;for(const[x,H]of U)k[x]=H;return k},Ze=["for"],Xe={key:0,class:"required"},Je={class:"invalid-feedback"},qe={key:1,class:"valid-feedback"},et={key:2,class:"valid-feedback valid-feedback-none"};function tt(W,U,k,x,H,E){const A=Q.resolveComponent("v-ace-editor");return Q.openBlock(),Q.createElementBlock(Q.Fragment,null,[W.label?(Q.openBlock(),Q.createElementBlock("label",{key:0,for:W.uid,class:"form-label"},[Q.createTextVNode(Q.toDisplayString(W.label),1),W.required?(Q.openBlock(),Q.createElementBlock("span",Xe,"*")):Q.createCommentVNode("",!0)],8,Ze)):Q.createCommentVNode("",!0),Q.createVNode(A,{id:W.uid,ref:"aceEditor",value:W.value,"onUpdate:value":U[0]||(U[0]=$=>W.value=$),class:Q.normalizeClass(W.classes),disabled:W.disabled,readonly:W.disabled,lang:W.lang,theme:W.theme,options:W.options,"min-lines":W.rows??10,"max-lines":W.rows??25,onClick:W.click,onBlur:W.changed,onChange:W.changed},null,8,["id","value","class","disabled","readonly","lang","theme","options","min-lines","max-lines","onClick","onBlur","onChange"]),Q.createElementVNode("p",Je,Q.toDisplayString(W.invalidMessage),1),W.help?(Q.openBlock(),Q.createElementBlock("p",qe,Q.toDisplayString(W.help),1)):(Q.openBlock(),Q.createElementBlock("p",et))],64)}const te=Qe(Ye,[["render",tt]]);te.install=W=>{W.component(te.name??"ClNoName",te)};const ce={ClFieldEditor:te};function it(W){for(const U in ce)W.component(ce[U].name,ce[U])}exports.ClFieldEditor=te;exports.clUiEditor=it;
1138
1138
  //# sourceMappingURL=castlabs-ui-editor.common.js.map