@castlabs/ui 5.0.0 → 5.1.0

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(L,M,B){M.isDark=!1,M.cssClass="ace-chrome",M.cssText=L("./chrome-css");var x=L("../lib/dom");x.importCssString(M.cssText,M.cssClass,!1)}),function(){ace.require(["ace/theme/chrome"],function(L){F&&(F.exports=L)})}()}(Ae)),Ae.exports}ft();const He="chrome",gt=J.defineComponent({name:"ClFieldEditor",components:{VAceEditor:ut},inheritAttrs:!1,props:{class:{type:String,default:`ace_editor ace-${He}`},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 He},classes:function(){return this.class+" form-control"+(this.valid?"":" invalid")},options:function(){return{tabSize:2}}},methods:{setValue:function(F){const U=this.$refs.aceEditor._editor;U==null||U.setValue(F)},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(F){F.ignore=!0,this.setInvalid("Please enter valid JSON.")}this.$emit("update:modelValue",this.value),this.$emit("change")},setInvalid:function(F){this.valid=!1,this.invalidMessage=F,this.$emit("update:valid",this.valid)}}}),pt=(F,U)=>{const L=F.__vccOpts||F;for(const[M,B]of U)L[M]=B;return L},mt=["for"],vt={key:0,class:"required"},yt={class:"invalid-feedback"},wt={key:1,class:"valid-feedback"},bt={key:2,class:"valid-feedback valid-feedback-none"};function $t(F,U,L,M,B,x){const S=J.resolveComponent("v-ace-editor");return J.openBlock(),J.createElementBlock(J.Fragment,null,[F.label?(J.openBlock(),J.createElementBlock("label",{key:0,for:F.uid,class:"form-label"},[J.createTextVNode(J.toDisplayString(F.label),1),F.required?(J.openBlock(),J.createElementBlock("span",vt,"*")):J.createCommentVNode("",!0)],8,mt)):J.createCommentVNode("",!0),J.createVNode(S,{id:F.uid,ref:"aceEditor",class:J.normalizeClass(F.classes),value:F.value,disabled:F.disabled,readonly:F.disabled,lang:F.lang,theme:F.theme,options:F.options,"min-lines":F.rows??10,"max-lines":F.rows??25,onClick:F.click,onBlur:F.changed,onChange:F.changed},null,8,["id","class","value","disabled","readonly","lang","theme","options","min-lines","max-lines","onClick","onBlur","onChange"]),J.createElementVNode("p",yt,J.toDisplayString(F.invalidMessage),1),F.help?(J.openBlock(),J.createElementBlock("p",wt,J.toDisplayString(F.help),1)):(J.openBlock(),J.createElementBlock("p",bt))],64)}const pe=pt(gt,[["render",$t]]);pe.install=F=>{F.component(pe.name??"ClNoName",pe)};const Me={ClFieldEditor:pe};function Ct(F){for(const U in Me)F.component(Me[U].name,Me[U])}ue.ClFieldEditor=pe,ue.castlabsUiEditor=Ct,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})});
1137
+ `}),ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(L,M,B){M.isDark=!1,M.cssClass="ace-chrome",M.cssText=L("./chrome-css");var x=L("../lib/dom");x.importCssString(M.cssText,M.cssClass,!1)}),function(){ace.require(["ace/theme/chrome"],function(L){F&&(F.exports=L)})}()}(Ae)),Ae.exports}ft();const He="chrome",gt=J.defineComponent({name:"ClFieldEditor",components:{VAceEditor:ut},inheritAttrs:!1,props:{class:{type:String,default:`ace_editor ace-${He}`},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 He},classes:function(){return this.class+" form-control"+(this.valid?"":" invalid")},options:function(){return{tabSize:2}}},methods:{setValue:function(F){const U=this.$refs.aceEditor._editor;U==null||U.setValue(F)},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(F){F.ignore=!0,this.setInvalid("Please enter valid JSON.")}this.$emit("update:modelValue",this.value),this.$emit("change")},setInvalid:function(F){this.valid=!1,this.invalidMessage=F,this.$emit("update:valid",this.valid)}}}),pt=(F,U)=>{const L=F.__vccOpts||F;for(const[M,B]of U)L[M]=B;return L},mt=["for"],vt={key:0,class:"required"},yt={class:"invalid-feedback"},wt={key:1,class:"valid-feedback"},bt={key:2,class:"valid-feedback valid-feedback-none"};function $t(F,U,L,M,B,x){const S=J.resolveComponent("v-ace-editor");return J.openBlock(),J.createElementBlock(J.Fragment,null,[F.label?(J.openBlock(),J.createElementBlock("label",{key:0,for:F.uid,class:"form-label"},[J.createTextVNode(J.toDisplayString(F.label),1),F.required?(J.openBlock(),J.createElementBlock("span",vt,"*")):J.createCommentVNode("",!0)],8,mt)):J.createCommentVNode("",!0),J.createVNode(S,{id:F.uid,ref:"aceEditor",value:F.value,"onUpdate:value":U[0]||(U[0]=b=>F.value=b),class:J.normalizeClass(F.classes),disabled:F.disabled,readonly:F.disabled,lang:F.lang,theme:F.theme,options:F.options,"min-lines":F.rows??10,"max-lines":F.rows??25,onClick:F.click,onBlur:F.changed,onChange:F.changed},null,8,["id","value","class","disabled","readonly","lang","theme","options","min-lines","max-lines","onClick","onBlur","onChange"]),J.createElementVNode("p",yt,J.toDisplayString(F.invalidMessage),1),F.help?(J.openBlock(),J.createElementBlock("p",wt,J.toDisplayString(F.help),1)):(J.openBlock(),J.createElementBlock("p",bt))],64)}const pe=pt(gt,[["render",$t]]);pe.install=F=>{F.component(pe.name??"ClNoName",pe)};const Me={ClFieldEditor:pe};function Ct(F){for(const U in Me)F.component(Me[U].name,Me[U])}ue.ClFieldEditor=pe,ue.castlabsUiEditor=Ct,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})});
1138
1138
  //# sourceMappingURL=castlabs-ui-editor.umd.js.map