@makeform/common 2.0.0 → 2.0.2
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 +10 -0
- package/index.html +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Change Logs
|
|
2
2
|
|
|
3
|
+
## v2.0.2
|
|
4
|
+
|
|
5
|
+
- ensure ld-scope to ensure correct ld selector scoping
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## v2.0.1
|
|
9
|
+
|
|
10
|
+
- fix bug: fallback `config` to `{}` when not given to prevent exception
|
|
11
|
+
|
|
12
|
+
|
|
3
13
|
## v2.0.0
|
|
4
14
|
|
|
5
15
|
- support `head`, `body` and `foot` plugs when `widget` is not applied.
|
package/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<div
|
|
1
|
+
<div ld-scope><style type="text/css">:scope{break-inside:avoid}:scope.m-view *[ld=label]{opacity:.85;text-decoration:underline}:scope.m-view .m-edit{display:none !important}:scope.m-edit .m-view{display:none !important}*[ld=content]{white-space:pre-wrap;word-break:break-word;overflow-wrap:break-word}.variant{display:none}.has-variant .variant{display:inline}.notes{margin-top:.5em}.notes:empty{margin-top:0}</style><script type="@plotdb/block">var mod;module.exports={pkg:{name:"@makeform/common",extend:{name:"@makeform/base",dom:"overwrite"},dependencies:[],i18n:{en:{error:"error"},"zh-TW":{error:"有錯誤"}}},init:function(t){return t.pubsub.on("subinit",function(n){n==null&&(n={});return t.pubsub.fire("init",{mod:mod(t,n.mod)})})}};mod=function(n,t){var i,e,o,r,a,s,u,l;i=n.root,e=n.ctx,o=n.data,r=n.parent,a=n.t;s=e.ldview;u={init:function(){var r,e=this;this.mod.info=r={};this.mod.child={};this.remeta=function(n){n==null&&(n={});r.meta=n;r.config=n.config||{};return r.display=r.config.display||"block"};this.on("meta",function(){return e.remeta(e.serialize())});this.remeta(o);if(!i){return}this.mod.info.view=new s({root:i,text:{label:function(){return a(r.meta.title||"untitled")},variant:function(n){var t;t=n.node;return a(r.config.variant||"")}},handler:{"@":function(n){var t;t=n.node;t.classList.toggle("m-inline",r.display!=="block");return t.classList.toggle("has-error",e.status()===2)},base:function(n){var t;t=n.node;t.classList.toggle("form-group",r.display==="block");return t.classList.toggle("has-variant",!!r.config.variant)},"is-required":function(n){var t;t=n.node;return t.classList.toggle("d-none",!r.meta.isRequired)},desc:function(n){var t;t=n.node;t.classList.toggle("d-none",!r.meta.desc);return t.innerText=a(r.meta.desc||"")||""},display:function(n){var t;t=n.node;return t.classList.toggle("d-none",t.getAttribute("data-display")!==r.display)},"error-root":function(n){var t;t=n.node;if(t.classList.contains("has-tips")){return t.classList.toggle("manual",e.status()!==2)}},limitation:function(n){var t,e;t=n.node;e=a(r.config.limitation||"");t.classList.toggle("d-none",!e);return t.innerHTML="• "+e},error:{list:function(){var n,t;if((n=e.status())!==2){return[]}t=e._errors.slice(0,1).concat(e._errors.length>1?["..."]:[]);return t.filter(function(n){return n!=="nested"})},text:function(n){var t;t=n.data;return a(t)}},note:{list:function(){if(Array.isArray(r.config.note)){return r.config.note}else if(r.config.note){return[r.config.note]}else{return[]}},key:function(n){return n},handler:function(n){var t,e,r;t=n.node,e=n.data;r=a(e);t.innerText=r?"• "+r:"";return t.classList.toggle("d-none",!r)}}}});return t.init.apply(this)},render:function(){this.remeta(this.serialize());if(this.mod.info.view){this.mod.info.view.render()}return t.render.apply(this)}};l=import$(import$({},t),u);return l};function import$(n,t){var e={}.hasOwnProperty;for(var r in t)if(e.call(t,r))n[r]=t[r];return n}</script><plug class="form-group" name="widget" ld="base"><plug name="head"><div ld="display" data-display="block"><label class="d-flex align-items-end flex-wrap justify-content-between"><div><span ld="label"></span><span class="variant text-sm ml-2">(<span ld="variant"></span>)</span><span class="text-danger ml-2" ld="is-required">*</span></div><div class="m-edit"><div class="mf-note text-sm" ld="limitation"></div></div></label></div><div class="text-sm text-muted" ld="display" data-display="block"><div ld="desc" style="margin:-.6em 0 .7em"></div></div></plug><plug name="body"></plug><plug name="foot"><div class="m-edit notes" ld="display" data-display="block"><div class="mf-note text-sm note" ld-each="note"></div></div></plug></plug></div>
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@makeform/common","version":"2.0.
|
|
1
|
+
{"name":"@makeform/common","version":"2.0.2","description":"","scripts":{},"keywords":[],"author":"zbryikt","license":"MIT","dependencies":{"@plotdb/srcbuild":"^0.0.69"},"devDependencies":{"fedep":"^1.4.6"}}
|