From 6ad4c351940303400d5ce0a875eaa01fee974658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Thu, 14 Jun 2018 19:57:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4template=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=A0=87=E7=AD=BE,=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=87=E7=AD=BE=E6=9D=A5?= =?UTF-8?q?=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/anot-touch.js | 38 +--------- src/js/anot-touch.shim.js | 38 +--------- src/js/anot.js | 38 +--------- src/js/anot.shim.js | 38 +--------- src/js/datepicker/index.js | 138 +++++++++++++++++----------------- src/js/datepicker/style.scss | 2 +- src/js/meditor/index.js | 40 +++++----- src/js/meditor/skin/main.scss | 2 +- src/js/pager/index.js | 14 ++-- src/js/pager/main.scss | 2 +- src/js/tree/index.js | 63 ++++++++-------- src/js/tree/main.scss | 25 +++--- 12 files changed, 159 insertions(+), 279 deletions(-) diff --git a/src/js/anot-touch.js b/src/js/anot-touch.js index 99bd1ae..26f5f23 100644 --- a/src/js/anot-touch.js +++ b/src/js/anot-touch.js @@ -3367,6 +3367,7 @@ const _Anot = (function() { (attr.specified && !rnoCollect.test(name)) || specifiedVars.includes(name) ) { + elem.removeAttribute(name) if (name.indexOf(ronattr) === 0) { name = attr.value.slice(6) ret[name] = elem[attr.value] @@ -3386,7 +3387,6 @@ const _Anot = (function() { } else { ret[camelizeName] = parseData(attr.value) } - elem.removeAttribute(name) } } } @@ -3902,17 +3902,9 @@ const _Anot = (function() { globalHooks.componentWillMount.call(null, vmodel) var slots = null - var isTemplate = true - if (elem.content) { - if (elem.content.firstElementChild) { - slots = parseSlot(elem.content.children) - } - } else { - isTemplate = false - if (elem.firstElementChild) { - slots = parseSlot(elem.children) - } + if (elem.firstElementChild) { + slots = parseSlot(elem.children) } Anot.clearHTML(elem) @@ -3924,27 +3916,6 @@ const _Anot = (function() { elem.innerHTML = html - if (isTemplate) { - // 组件所使用的标签是template,所以必须要要用子元素替换掉 - var child = elem.content.firstElementChild - var nullComponent = DOC.createComment('empty component') - elem.parentNode.replaceChild(child || nullComponent, elem) - - // 空组件直接跳出 - if (!child) { - return - } - - child.msResolved = 1 - var cssText = elem.style.cssText - var className = elem.className - elem = host.element = child - elem.style && (elem.style.cssText += ';' + cssText) - if (className) { - Anot(elem).addClass(className) - } - } - hideProperty(vmodel, '$elem', elem) Anot.fireDom(elem, 'datasetchanged', { @@ -4013,9 +3984,6 @@ const _Anot = (function() { function isWidget(el) { //如果是组件,则返回组件的名字 var name = el.nodeName.toLowerCase() - if (name === 'template' && el.getAttribute('name')) { - return el.getAttribute('name') - } if (/^anot-([a-z][a-z0-9\-]*)$/.test(name)) { return RegExp.$1 } diff --git a/src/js/anot-touch.shim.js b/src/js/anot-touch.shim.js index 0e60f0b..1e80b76 100644 --- a/src/js/anot-touch.shim.js +++ b/src/js/anot-touch.shim.js @@ -3382,6 +3382,7 @@ (attr.specified && !rnoCollect.test(name)) || specifiedVars.includes(name) ) { + elem.removeAttribute(name) if (name.indexOf(ronattr) === 0) { name = attr.value.slice(6) ret[name] = elem[attr.value] @@ -3401,7 +3402,6 @@ } else { ret[camelizeName] = parseData(attr.value) } - elem.removeAttribute(name) } } } @@ -3917,17 +3917,9 @@ globalHooks.componentWillMount.call(null, vmodel) var slots = null - var isTemplate = true - if (elem.content) { - if (elem.content.firstElementChild) { - slots = parseSlot(elem.content.children) - } - } else { - isTemplate = false - if (elem.firstElementChild) { - slots = parseSlot(elem.children) - } + if (elem.firstElementChild) { + slots = parseSlot(elem.children) } Anot.clearHTML(elem) @@ -3939,27 +3931,6 @@ elem.innerHTML = html - if (isTemplate) { - // 组件所使用的标签是template,所以必须要要用子元素替换掉 - var child = elem.content.firstElementChild - var nullComponent = DOC.createComment('empty component') - elem.parentNode.replaceChild(child || nullComponent, elem) - - // 空组件直接跳出 - if (!child) { - return - } - - child.msResolved = 1 - var cssText = elem.style.cssText - var className = elem.className - elem = host.element = child - elem.style && (elem.style.cssText += ';' + cssText) - if (className) { - Anot(elem).addClass(className) - } - } - hideProperty(vmodel, '$elem', elem) Anot.fireDom(elem, 'datasetchanged', { @@ -4028,9 +3999,6 @@ function isWidget(el) { //如果是组件,则返回组件的名字 var name = el.nodeName.toLowerCase() - if (name === 'template' && el.getAttribute('name')) { - return el.getAttribute('name') - } if (/^anot-([a-z][a-z0-9\-]*)$/.test(name)) { return RegExp.$1 } diff --git a/src/js/anot.js b/src/js/anot.js index ab670cc..f61b4ed 100644 --- a/src/js/anot.js +++ b/src/js/anot.js @@ -3367,6 +3367,7 @@ const _Anot = (function() { (attr.specified && !rnoCollect.test(name)) || specifiedVars.includes(name) ) { + elem.removeAttribute(name) if (name.indexOf(ronattr) === 0) { name = attr.value.slice(6) ret[name] = elem[attr.value] @@ -3386,7 +3387,6 @@ const _Anot = (function() { } else { ret[camelizeName] = parseData(attr.value) } - elem.removeAttribute(name) } } } @@ -3902,17 +3902,9 @@ const _Anot = (function() { globalHooks.componentWillMount.call(null, vmodel) var slots = null - var isTemplate = true - if (elem.content) { - if (elem.content.firstElementChild) { - slots = parseSlot(elem.content.children) - } - } else { - isTemplate = false - if (elem.firstElementChild) { - slots = parseSlot(elem.children) - } + if (elem.firstElementChild) { + slots = parseSlot(elem.children) } Anot.clearHTML(elem) @@ -3924,27 +3916,6 @@ const _Anot = (function() { elem.innerHTML = html - if (isTemplate) { - // 组件所使用的标签是template,所以必须要要用子元素替换掉 - var child = elem.content.firstElementChild - var nullComponent = DOC.createComment('empty component') - elem.parentNode.replaceChild(child || nullComponent, elem) - - // 空组件直接跳出 - if (!child) { - return - } - - child.msResolved = 1 - var cssText = elem.style.cssText - var className = elem.className - elem = host.element = child - elem.style && (elem.style.cssText += ';' + cssText) - if (className) { - Anot(elem).addClass(className) - } - } - hideProperty(vmodel, '$elem', elem) Anot.fireDom(elem, 'datasetchanged', { @@ -4013,9 +3984,6 @@ const _Anot = (function() { function isWidget(el) { //如果是组件,则返回组件的名字 var name = el.nodeName.toLowerCase() - if (name === 'template' && el.getAttribute('name')) { - return el.getAttribute('name') - } if (/^anot-([a-z][a-z0-9\-]*)$/.test(name)) { return RegExp.$1 } diff --git a/src/js/anot.shim.js b/src/js/anot.shim.js index 0790928..c2c3e5b 100644 --- a/src/js/anot.shim.js +++ b/src/js/anot.shim.js @@ -3382,6 +3382,7 @@ (attr.specified && !rnoCollect.test(name)) || specifiedVars.includes(name) ) { + elem.removeAttribute(name) if (name.indexOf(ronattr) === 0) { name = attr.value.slice(6) ret[name] = elem[attr.value] @@ -3401,7 +3402,6 @@ } else { ret[camelizeName] = parseData(attr.value) } - elem.removeAttribute(name) } } } @@ -3917,17 +3917,9 @@ globalHooks.componentWillMount.call(null, vmodel) var slots = null - var isTemplate = true - if (elem.content) { - if (elem.content.firstElementChild) { - slots = parseSlot(elem.content.children) - } - } else { - isTemplate = false - if (elem.firstElementChild) { - slots = parseSlot(elem.children) - } + if (elem.firstElementChild) { + slots = parseSlot(elem.children) } Anot.clearHTML(elem) @@ -3939,27 +3931,6 @@ elem.innerHTML = html - if (isTemplate) { - // 组件所使用的标签是template,所以必须要要用子元素替换掉 - var child = elem.content.firstElementChild - var nullComponent = DOC.createComment('empty component') - elem.parentNode.replaceChild(child || nullComponent, elem) - - // 空组件直接跳出 - if (!child) { - return - } - - child.msResolved = 1 - var cssText = elem.style.cssText - var className = elem.className - elem = host.element = child - elem.style && (elem.style.cssText += ';' + cssText) - if (className) { - Anot(elem).addClass(className) - } - } - hideProperty(vmodel, '$elem', elem) Anot.fireDom(elem, 'datasetchanged', { @@ -4028,9 +3999,6 @@ function isWidget(el) { //如果是组件,则返回组件的名字 var name = el.nodeName.toLowerCase() - if (name === 'template' && el.getAttribute('name')) { - return el.getAttribute('name') - } if (/^anot-([a-z][a-z0-9\-]*)$/.test(name)) { return RegExp.$1 } diff --git a/src/js/datepicker/index.js b/src/js/datepicker/index.js index 2847e90..fc09205 100644 --- a/src/js/datepicker/index.js +++ b/src/js/datepicker/index.js @@ -123,78 +123,80 @@ Anot.ui.datepicker = '1.0.0' export default Anot.component('datepicker', { render: function() { - return `
+ return ` + - +
-
- -
- - - - - -
-
-
- - - - - - - -
-
- -
-
-
- - - - 现在 -
-
- 取消 - 确定 -
-
-
-
` +
+ + + + + +
+
+
+ + + + + + + +
+
+ +
+
+
+ + + + 现在 +
+
+ 取消 + 确定 +
+
+ ` }, __init__: function(props, state, next) { + this.classList.add('do-datepicker') + this.classList.add('do-fn-noselect') + this.classList.add(props.size || 'mini') + this.setAttribute( + ':css', + "{width: props.width, height: props.height, 'line-height': props.height + 'px'}" + ) + this.setAttribute(':click', 'cancelBubble') // 日期格式化, 不显示时间时, 默认会调用过滤器的格式'Y-m-d H:i:s' if (!props.showTime && !props.format) { props.format = 'Y-m-d' diff --git a/src/js/datepicker/style.scss b/src/js/datepicker/style.scss index 9bd76c4..75697f7 100644 --- a/src/js/datepicker/style.scss +++ b/src/js/datepicker/style.scss @@ -7,7 +7,7 @@ */ @import "var.scss"; -.do-datepicker { position:relative;width:100%; height:100%;color:nth($cgr, 1);font-size:14px; +.do-datepicker { position:relative;display:inline-block;width:100%; height:100%;color:nth($cgr, 1);font-size:14px; &.mini {width:155px;height:30px;line-height:30px;} &.medium {width:175px;height:35px;line-height:35px;} diff --git a/src/js/meditor/index.js b/src/js/meditor/index.js index 5bcd35b..7478c1a 100644 --- a/src/js/meditor/index.js +++ b/src/js/meditor/index.js @@ -264,10 +264,20 @@ class MEObject { Anot.component('meditor', { __init__: function(props, state, next) { + this.classList.add('do-meditor') + this.classList.add('do-meditor__font') + + this.setAttribute(':visible', 'editorVisible') + this.setAttribute(':css', '{height: height}') + this.setAttribute(':class', '{fullscreen: fullscreen, preview: preview}') if (props.hasOwnProperty('$show')) { state.editorVisible = props.$show delete props.$show } + if (props.height && props.height > 180) { + state.height = props.height + delete props.height + } next() }, render: function() { @@ -276,23 +286,18 @@ Anot.component('meditor', { delete this.toolbar return ` -
-
${toolbar}
- - -
+
${toolbar}
+ + ` }, componentDidMount: function(vm, elem) { @@ -360,6 +365,7 @@ Anot.component('meditor', { } }, state: { + height: 180, disabled: false, //禁用编辑器 fullscreen: false, //是否全屏 preview: true, //是否显示预览 diff --git a/src/js/meditor/skin/main.scss b/src/js/meditor/skin/main.scss index ae31fe4..9fd9ee4 100644 --- a/src/js/meditor/skin/main.scss +++ b/src/js/meditor/skin/main.scss @@ -12,7 +12,7 @@ src: url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAABEUAAsAAAAAGygAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFZW7kiCY21hcAAAAYAAAAELAAADBGqGdy9nbHlmAAACjAAAC8AAABIsPd75f2hlYWQAAA5MAAAALwAAADYRZEeYaGhlYQAADnwAAAAcAAAAJAfeA51obXR4AAAOmAAAABQAAABwb+kAAGxvY2EAAA6sAAAAOgAAADpDyD8EbWF4cAAADugAAAAfAAAAIAE0AG5uYW1lAAAPCAAAAUUAAAJtPlT+fXBvc3QAABBQAAAAwwAAAQaYIDHPeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2Bk/s84gYGVgYOpk+kMAwNDP4RmfM1gxMjBwMDEwMrMgBUEpLmmMDgwVDybyNzwv4EhhrmBoQEozAiSAwAwZA0EeJzFkllOAkEURU9B206I88gW/DSuxJ0goXHAeSKQwDb8clV3G3irH4lxBbzO6eRVakqdC6wATXNuCkg/JHJ9ezTV40026vGCofs2azQoqdRTXyNNNJvPPV6p636gsaZ1/1fJa9rs+bvgsu4b3rPwySWr3m3d+2/SYsuzttlh1zP3OeCQI4454ZQzOl5WsrRKyzv6f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qoHPAeAB5QIFghACLYJFgAAeJxjYGRgYJBhSGLgYwABJiDmAkIGhv9gPgMAFhIBowB4nGWPTU7DMBCFX/oHpBKqqGCH5AViASj9EatuWFRq911036ZOmyqJI8et1ANwHo7ACTgC3IA78EgnmzaWx9+8eWNPANzgBx6O3y33kT1cMjtyDRe4F65TfxBukF+Em2jjVbhF/U3YxzOmwm10YXmD17hi9oR3YQ8dfAjXcI1P4Tr1L+EG+Vu4iTv8CrfQ8erCPuZeV7iNRy/2x1YvnF6p5UHFockikzm/gple75KFrdLqnGtbxCZTg6BfSVOdaVvdU+zXQ+ciFVmTqgmrOkmMyq3Z6tAFG+fyUa8XiR6EJuVYY/62xgKOcQWFJQ6MMUIYZIjK6Og7VWb0r7FDwl57Vj3N53RbFNT/c4UBAvTPXFO6stJ5Ok+BPV8bUnV0K27LnpQ0kV7NSRKyQl7WtlRC6gE2ZVeOEXpc0Yk/KGdI/wAJWm7IAAAAeJxtjElSwzAUBfUUOY4VxjCEIRwhizDdR5a/S6r8SEKRgeODzZZedHW9xRNS/KHF/2wgMYNChTlqLNBAY4kTnOIM57jAJVa4wjVucIs17nCPBzxigyeB77kpxVinfOhj03K0exs7Ur2x1PQxlG0buVtM1RHrfmA+2kwUltPmi2FvpXuWbifdq3Rv0r0oR5yke9c+sA80HY4xav+rY9Exd5S3Y9bJ2zJkUsknqlOmT09f1ccQC1XFtEyq+AMJ8QPRDzuOAA==') format('woff'); } -.do-meditor {position:relative;width:100%;height:100%;min-height:180px;padding-top:41px;border:1px solid nth($cp, 3);background:#fff;color:#666; +.do-meditor {position:relative;display:block;width:100%;height:100%;padding-top:41px;border:1px solid nth($cp, 3);background:#fff;color:#666; ::-webkit-scrollbar {width:5px;height:5px;background:nth($cp, 2);} ::-webkit-scrollbar:hover {background:nth($cp, 1);} diff --git a/src/js/pager/index.js b/src/js/pager/index.js index 1f58ec2..87ead70 100644 --- a/src/js/pager/index.js +++ b/src/js/pager/index.js @@ -87,11 +87,14 @@ const tmpls = { jumper: `
前往
`, - slot: `` + slot: '' } export default Anot.component('pager', { __init__: function(props, state, next) { + this.classList.add('do-pager') + this.classList.add('do-fn-noselect') + this.setAttribute(':class', "{{classList.join(' ')}}") props.theme = +props.theme || 1 if (props.simpleMode) { props.theme = 1 @@ -138,18 +141,13 @@ export default Anot.component('pager', { layout = layout.map(it => { if (it === 'slot') { if (slots && slots.extra) { - return slots.extra + return slots.extra[0] } } else { return tmpls[it] || '' } }) - return ` -
- ${layout.join('\n')} -
` + return layout.join('\n') }, componentWillMount: function() { const { currPage, totalPage, props } = this diff --git a/src/js/pager/main.scss b/src/js/pager/main.scss index 8040cd2..11907a3 100644 --- a/src/js/pager/main.scss +++ b/src/js/pager/main.scss @@ -8,7 +8,7 @@ @import "var.scss"; -.do-pager {height:auto;text-align:center;font-size:14px;color: nth($cgr, 1); +.do-pager {display:block;height:auto;text-align:center;font-size:14px;color: nth($cgr, 1); &.mini {line-height:30px; .button,.page {min-width:30px;height:30px} diff --git a/src/js/tree/index.js b/src/js/tree/index.js index 5f1c6ef..c5b2739 100644 --- a/src/js/tree/index.js +++ b/src/js/tree/index.js @@ -41,41 +41,40 @@ export default Anot.component('tree', { return null } return ` -
    -
  • - - - - -
  • -
+
+ + + + +
` }, __init__: function(props, state, next) { + this.classList.add('do-tree') + this.setAttribute(':if', 'list.size()') props.id = props.id || 'id' props.label = props.label || 'label' props.parent = props.parent || 'parent' diff --git a/src/js/tree/main.scss b/src/js/tree/main.scss index 55d7b09..b57ed17 100644 --- a/src/js/tree/main.scss +++ b/src/js/tree/main.scss @@ -9,19 +9,22 @@ @import '../../css/var.scss'; -.do-tree {overflow:hidden;overflow-y:auto;position:relative;width:100%;height:100%;line-height:36px;font-size:15px;color:nth($cgr, 1); +.do-tree {overflow:hidden;overflow-y:auto;position:relative;display:inline-block;width:100%;height:100%;line-height:36px;font-size:15px;color:nth($cgr, 1); - ul {width:100%;height:auto;} - li {overflow:hidden; min-height:35px;margin:1px 0; white-space:nowrap; text-overflow:ellipsis} + &__item {overflow:hidden; min-height:35px;margin:1px 0; white-space:nowrap; text-overflow:ellipsis; + + .do-tree {display:none;margin-left:20px;} - li ul {display:none;margin-left:20px;} - li.open>ul {display:block;} + em,span {display:inline-block;cursor:pointer;color:nth($cgr, 2);} + em {float:left;padding:0 5px;font-size:20px;} - li em, - li span {display:inline-block;cursor:pointer;color:nth($cgr, 2);} - li em {float:left;padding:0 5px;font-size:20px;} - li span:hover {color:nth($cgr, 2);} - li span.active {color:nth($cgr, 3);font-weight:bold;} - li span.checkbox {float:left;position:relative;width:20px;height:20px;margin:8px 5px 8px 0;line-height:18px;border:1px solid nth($cgr, 1);border-radius:3px; font-size:20px;text-align:center; + span { + + &:hover {color:nth($cgr, 2);} + &.active {color:nth($cgr, 3);font-weight:bold;} + &.checkbox {float:left;position:relative;width:20px;height:20px;margin:8px 5px 8px 0;line-height:18px;border:1px solid nth($cgr, 1);border-radius:3px; font-size:20px;text-align:center;} + } } + &__item.open>.do-tree {display:block;} + } \ No newline at end of file