@makeform/radio 1.1.1 → 1.1.3

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Change Logs
2
2
 
3
+ ## v1.1.3
4
+
5
+ - tweak radio list layout
6
+
7
+
8
+ ## v1.1.2
9
+
10
+ - use `mf-note` to replace styling in note-related tag.
11
+
12
+
3
13
  ## v1.1.1
4
14
 
5
15
  - i18n for other.prompt
package/index.html CHANGED
@@ -1 +1 @@
1
- <div><div class="form-group" plug="widget"><label class="d-flex align-items-end flex-wrap"><div><span ld="label"></span><span class="text-danger ml-2" ld="is-required">*</span></div><div class="flex-grow-1"></div><div class="m-edit"><div class="text-danger text-sm" ld="limitation"></div></div></label><div class="text-sm text-muted"><div ld="desc" style="margin:-.6em 0 .7em"></div></div><div class="m-edit" ld="input"><div><label class="mr-3 mb-3 clickable" ld-each="option"><input class="mr-1" ld="radio" type="radio"><span ld="text"></span></label></div><div ld="other"><label class="clickable d-flex align-items-center"><input class="mr-1" ld="other-radio" type="radio"><div class="mr-2 text-nowrap" ld="other-prompt"></div><input class="form-control form-control-sm" type="text" ld="other-text"></label></div></div><div class="m-edit"><div class="text-danger text-sm mt-2 note" ld-each="note"></div></div><div class="m-view" ld="content"></div></div><script type="@plotdb/block">var mod;module.exports={pkg:{name:"@makeform/radio",extend:{name:"@makeform/common"},i18n:{en:{"其它":"Other"},"zh-TW":{"其它":"其它"}}},init:function(e){return e.pubsub.fire("subinit",{mod:mod(e)})}};mod=function(e){var n,t,r,o,i,u,a,d,l;n=e.root,t=e.ctx,r=e.data,o=e.parent,i=e.t,u=e.i18n;a=t.ldview;d={};l="_"+Math.random().toString(36).substring(2);return{init:function(){var e,o=this;this.on("change",function(){return o.mod.child.view.render("option")});return this.mod.child.view=e=new a({root:n,text:{content:function(e){var n;n=e.node;if(o.isEmpty()){return"n/a"}else{return i(o.content())}},"other-prompt":function(e){var n,t,r;n=e.node;if(t=((r=o.mod.info.config).other||(r.other={})).prompt){return i(t)}else{return i("其它")}}},action:{input:{"other-text":function(e){var n;n=e.node;return o.value(n.value)}},change:{"other-radio":function(e){var n,t;n=e.node,t=e.ctx;if(in$(o.value(),o.mod.info.config.values||[])||!o.value()){return o.value("")}}}},handler:{input:function(e){var n;n=e.node;return n.classList.toggle("text-danger",o.status()===2)},other:function(e){var n,t;n=e.node;return n.classList.toggle("d-none",!((t=o.mod.info.config).other||(t.other={})).enabled)},"other-radio":function(e){var n;n=e.node;n.setAttribute("name",l);if(!o.mod.info.meta.readonly){n.removeAttribute("disabled")}else{n.setAttribute("disabled",null)}return n.checked=!in$(o.value(),o.mod.info.config.values||[])},"other-text":function(e){var n,t;n=e.node;if(!o.mod.info.meta.readonly){n.removeAttribute("readonly")}else{n.setAttribute("readonly",null)}t=o.value();return n.value=in$(t,o.mod.info.config.values||[])?"":t!=null?t:""},option:{list:function(){return o.mod.info.config.values||[]},key:function(e){return e},view:{action:{change:{radio:function(e){var n,t;n=e.node,t=e.ctx;if(n.checked){return o.value(t)}}}},handler:{radio:function(e){var n,t;n=e.node,t=e.ctx;n.setAttribute("name",l);n.checked=o.value()===t;if(!o.mod.info.meta.readonly){return n.removeAttribute("disabled")}else{return n.setAttribute("disabled",null)}}},text:{text:function(e){var n,t;n=e.node,t=e.ctx;return i(t)}}}}}})},render:function(){return this.mod.child.view.render()}}};function in$(e,n){var t=-1,r=n.length>>>0;while(++t<r)if(e===n[t])return true;return false}</script></div>
1
+ <div><div class="form-group" plug="widget"><label class="d-flex align-items-end flex-wrap"><div><span ld="label"></span><span class="text-danger ml-2" ld="is-required">*</span></div><div class="flex-grow-1"></div><div class="m-edit"><div class="mf-note text-sm" ld="limitation"></div></div></label><div class="text-sm text-muted"><div ld="desc" style="margin:-.6em 0 .7em"></div></div><div class="m-edit" ld="input"><div class="my-3"><div class="d-flex g-2 flex-wrap"><div class="mr-2 clickable" ld-each="option" style="line-height:1em"><input class="mr-1" ld="radio" type="radio"><span ld="text"></span></div></div><div ld="other"><label class="clickable d-flex align-items-center"><input class="mr-1" ld="other-radio" type="radio"><div class="mr-2 text-nowrap" ld="other-prompt"></div><input class="form-control form-control-sm" type="text" ld="other-text"></label></div></div></div><div class="m-edit"><div class="d-flex flex-column g-1"><div class="mf-note text-sm note" ld-each="note"></div></div></div><div class="m-view" ld="content"></div></div><script type="@plotdb/block">var mod;module.exports={pkg:{name:"@makeform/radio",extend:{name:"@makeform/common"},i18n:{en:{"其它":"Other"},"zh-TW":{"其它":"其它"}}},init:function(e){return e.pubsub.fire("subinit",{mod:mod(e)})}};mod=function(e){var n,t,r,o,i,u,a,d,l;n=e.root,t=e.ctx,r=e.data,o=e.parent,i=e.t,u=e.i18n;a=t.ldview;d={};l="_"+Math.random().toString(36).substring(2);return{init:function(){var e,o=this;this.on("change",function(){return o.mod.child.view.render("option")});return this.mod.child.view=e=new a({root:n,text:{content:function(e){var n;n=e.node;if(o.isEmpty()){return"n/a"}else{return i(o.content())}},"other-prompt":function(e){var n,t,r;n=e.node;if(t=((r=o.mod.info.config).other||(r.other={})).prompt){return i(t)}else{return i("其它")}}},action:{input:{"other-text":function(e){var n;n=e.node;return o.value(n.value)}},change:{"other-radio":function(e){var n,t;n=e.node,t=e.ctx;if(in$(o.value(),o.mod.info.config.values||[])||!o.value()){return o.value("")}}}},handler:{input:function(e){var n;n=e.node;return n.classList.toggle("text-danger",o.status()===2)},other:function(e){var n,t;n=e.node;return n.classList.toggle("d-none",!((t=o.mod.info.config).other||(t.other={})).enabled)},"other-radio":function(e){var n;n=e.node;n.setAttribute("name",l);if(!o.mod.info.meta.readonly){n.removeAttribute("disabled")}else{n.setAttribute("disabled",null)}return n.checked=!in$(o.value(),o.mod.info.config.values||[])},"other-text":function(e){var n,t;n=e.node;if(!o.mod.info.meta.readonly){n.removeAttribute("readonly")}else{n.setAttribute("readonly",null)}t=o.value();return n.value=in$(t,o.mod.info.config.values||[])?"":t!=null?t:""},option:{list:function(){return o.mod.info.config.values||[]},key:function(e){return e},view:{action:{change:{radio:function(e){var n,t;n=e.node,t=e.ctx;if(n.checked){return o.value(t)}}}},handler:{radio:function(e){var n,t;n=e.node,t=e.ctx;n.setAttribute("name",l);n.checked=o.value()===t;if(!o.mod.info.meta.readonly){return n.removeAttribute("disabled")}else{return n.setAttribute("disabled",null)}}},text:{text:function(e){var n,t;n=e.node,t=e.ctx;return i(t)}}}}}})},render:function(){return this.mod.child.view.render()}}};function in$(e,n){var t=-1,r=n.length>>>0;while(++t<r)if(e===n[t])return true;return false}</script></div>
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@makeform/radio","version":"1.1.1","description":"","scripts":{},"keywords":[],"author":"zbryikt","license":"MIT","dependencies":{"@plotdb/srcbuild":"^0.0.51"},"devDependencies":{"fedep":"^1.1.7"}}
1
+ {"name":"@makeform/radio","version":"1.1.3","description":"","scripts":{},"keywords":[],"author":"zbryikt","license":"MIT","dependencies":{"@plotdb/srcbuild":"^0.0.65"},"devDependencies":{"fedep":"^1.3.0"}}