@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.
@@ -1133,5 +1133,5 @@
1133
1133
  .ace-chrome .ace_indent-guide-active {
1134
1134
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
1135
1135
  }
1136
- `}),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)})}()}(Me)),Me.exports}ft();const Oe="chrome",gt=ee.defineComponent({name:"ClFieldEditor",components:{VAceEditor:ut},inheritAttrs:!1,props:{class:{type:String,default:`ace_editor ace-${Oe}`},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 Oe},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},vt=["for"],mt={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=ee.resolveComponent("v-ace-editor");return ee.openBlock(),ee.createElementBlock(ee.Fragment,null,[F.label?(ee.openBlock(),ee.createElementBlock("label",{key:0,for:F.uid,class:"form-label"},[ee.createTextVNode(ee.toDisplayString(F.label),1),F.required?(ee.openBlock(),ee.createElementBlock("span",mt,"*")):ee.createCommentVNode("",!0)],8,vt)):ee.createCommentVNode("",!0),ee.createVNode(S,{id:F.uid,ref:"aceEditor",class:ee.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"]),ee.createElementVNode("p",yt,ee.toDisplayString(F.invalidMessage),1),F.help?(ee.openBlock(),ee.createElementBlock("p",wt,ee.toDisplayString(F.help),1)):(ee.openBlock(),ee.createElementBlock("p",bt))],64)}const pe=pt(gt,[["render",$t]]);pe.install=F=>{F.component(pe.name??"ClNoName",pe)};const Le={ClFieldEditor:pe};function Ct(F){for(const U in Le)F.component(Le[U].name,Le[U])}exports.ClFieldEditor=pe;exports.castlabsUiEditor=Ct;
1136
+ `}),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)})}()}(Me)),Me.exports}ft();const Oe="chrome",gt=ee.defineComponent({name:"ClFieldEditor",components:{VAceEditor:ut},inheritAttrs:!1,props:{class:{type:String,default:`ace_editor ace-${Oe}`},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 Oe},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},vt=["for"],mt={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=ee.resolveComponent("v-ace-editor");return ee.openBlock(),ee.createElementBlock(ee.Fragment,null,[F.label?(ee.openBlock(),ee.createElementBlock("label",{key:0,for:F.uid,class:"form-label"},[ee.createTextVNode(ee.toDisplayString(F.label),1),F.required?(ee.openBlock(),ee.createElementBlock("span",mt,"*")):ee.createCommentVNode("",!0)],8,vt)):ee.createCommentVNode("",!0),ee.createVNode(S,{id:F.uid,ref:"aceEditor",value:F.value,"onUpdate:value":U[0]||(U[0]=b=>F.value=b),class:ee.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"]),ee.createElementVNode("p",yt,ee.toDisplayString(F.invalidMessage),1),F.help?(ee.openBlock(),ee.createElementBlock("p",wt,ee.toDisplayString(F.help),1)):(ee.openBlock(),ee.createElementBlock("p",bt))],64)}const pe=pt(gt,[["render",$t]]);pe.install=F=>{F.component(pe.name??"ClNoName",pe)};const Le={ClFieldEditor:pe};function Ct(F){for(const U in Le)F.component(Le[U].name,Le[U])}exports.ClFieldEditor=pe;exports.castlabsUiEditor=Ct;
1137
1137
  //# sourceMappingURL=castlabs-ui-editor.common.js.map