diff --git a/build.next.js b/build.next.js
index 4252e02..7827c69 100644
--- a/build.next.js
+++ b/build.next.js
@@ -4,18 +4,13 @@ const log = console.log
const fs = require('iofs')
const path = require('path')
const scss = require('node-sass')
-const postcss = require('postcss')
-const autoprefixer = require('autoprefixer')
+
const chalk = require('chalk')
const uglify = require('uglify-es')
const sourceDir = path.resolve(__dirname, 'src')
const buildDir = path.resolve(__dirname, 'dist')
-const prefixer = postcss().use(
- autoprefixer({
- browsers: ['ie > 9', 'iOS > 8', 'Android >= 4.4', 'ff > 38', 'Chrome > 38']
- })
-)
+
const cssOpt = {
includePaths: ['src/css/'],
outputStyle: 'compressed'
@@ -79,8 +74,8 @@ if (fs.isdir(buildDir)) {
// css目录
cssFiles.forEach(file => {
if (/\.scss$/.test(file)) {
- let entry = path.resolve(sourceDir, 'css/', file)
- let output = path.resolve(buildDir, 'css/', file.replace(/scss$/, 'css'))
+ let entry = file
+ let output = file.replace('src/css', 'dist/css').replace(/scss$/, 'css')
compileCss(entry, output)
}
@@ -88,8 +83,8 @@ cssFiles.forEach(file => {
// js目录的处理要复杂一点
jsFiles.forEach(file => {
- let entry = path.resolve(sourceDir, 'js', file)
- let output = path.resolve(buildDir, 'js', file)
+ let entry = file
+ let output = file.replace(/src\/js/, 'dist/js').replace(/scss$/, 'css')
let ext = file.slice(file.lastIndexOf('.') + 1)
switch (ext) {
@@ -97,7 +92,6 @@ jsFiles.forEach(file => {
compileJs(entry, output)
break
case 'scss':
- output = output.replace(/scss$/, 'css')
compileCss(entry, output)
break
case 'htm':
diff --git a/build.prod.js b/build.prod.js
index f5a487d..4fba640 100644
--- a/build.prod.js
+++ b/build.prod.js
@@ -93,8 +93,8 @@ if (fs.isdir(buildDir)) {
// css目录
cssFiles.forEach(file => {
if (/\.scss$/.test(file)) {
- let entry = path.resolve(sourceDir, 'css/', file)
- let output = path.resolve(buildDir, 'css/', file.replace(/scss$/, 'css'))
+ let entry = file
+ let output = file.replace('src/css', 'dist/css').replace(/scss$/, 'css')
compileCss(entry, output)
}
@@ -102,8 +102,8 @@ cssFiles.forEach(file => {
// js目录的处理要复杂一点
jsFiles.forEach(file => {
- let entry = path.resolve(sourceDir, 'js', file)
- let output = path.resolve(buildDir, 'js', file)
+ let entry = file
+ let output = file.replace(/src\/js/, 'dist/js').replace(/scss$/, 'css')
let ext = file.slice(file.lastIndexOf('.') + 1)
switch (ext) {
@@ -111,7 +111,6 @@ jsFiles.forEach(file => {
compileJs(entry, output)
break
case 'scss':
- output = output.replace(/scss$/, 'css')
compileCss(entry, output)
break
case 'htm':
diff --git a/package.json b/package.json
index 0897326..45d0a56 100644
--- a/package.json
+++ b/package.json
@@ -21,14 +21,14 @@
"dependencies": {
"autoprefixer": "^7.2.6",
"babel-core": "^6.26.3",
- "babel-plugin-transform-decorators-legacy": "^1.3.4",
+ "babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-plugin-transform-es2015-classes": "^6.24.1",
"babel-plugin-transform-es2015-for-of": "^6.23.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"chalk": "^2.4.1",
"chokidar": "^1.7.0",
- "iofs": "^1.0.3",
+ "iofs": "^1.1.0",
"node-sass": "^4.9.0",
"postcss": "^6.0.22",
"uglify-es": "^3.3.9"
diff --git a/src/css/basic-elem.css b/src/css/basic-elem.css
deleted file mode 100644
index a7ebba5..0000000
--- a/src/css/basic-elem.css
+++ /dev/null
@@ -1 +0,0 @@
-.do-ui-button{display:inline-block;padding:2px 5px;border:1px solid #ddd;text-align:center;font-size:12px;background:none;cursor:pointer;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.do-ui-button.medium{min-width:100px;height:35px;padding:0 8px;line-height:35px;font-size:15px}.do-ui-button.large{min-width:150px;height:50px;padding:0 13px;line-height:50px;font-size:18px}.do-ui-button.radius-3{border-radius:3px}.do-ui-button.radius-3 [class^="do-icon-"],.do-ui-button.radius-3 [class*=" do-icon-"]{border-radius:3px}.do-ui-button.radius-5{border-radius:5px}.do-ui-button.radius-5 [class^="do-icon-"],.do-ui-button.radius-5 [class*=" do-icon-"]{border-radius:3px}.do-ui-button.teal{border:0;background:#1abc9c;color:#fff}.do-ui-button.teal:hover{background:#48c9b0}.do-ui-button.teal:active{background:#16a085}.do-ui-button.green{border:0;background:#4caf50;color:#fff}.do-ui-button.green:hover{background:#81c784}.do-ui-button.green:active{background:#388e3c}.do-ui-button.blue{border:0;background:#2196f3;color:#fff}.do-ui-button.blue:hover{background:#64b5f6}.do-ui-button.blue:active{background:#1976d2}.do-ui-button.purple{border:0;background:#651fff;color:#fff}.do-ui-button.purple:hover{background:#7c4dff}.do-ui-button.purple:active{background:#6200ea}.do-ui-button.red{border:0;background:#ff5722;color:#fff}.do-ui-button.red:hover{background:#ff7043}.do-ui-button.red:active{background:#e64a19}.do-ui-button.orange{border:0;background:#ff9800;color:#fff}.do-ui-button.orange:hover{background:#ffa726}.do-ui-button.orange:active{background:#f57c00}.do-ui-button.plain{border:0;background:#e7e8eb;color:#546e7a}.do-ui-button.plain:hover{background:#ecf0f1}.do-ui-button.plain:active{background:#d3d5db}.do-ui-button.grey{border:0;background:#546e7a;color:#fff}.do-ui-button.grey:hover{background:#607d8b}.do-ui-button.grey:active{background:#37474f}.do-ui-button.disabled{border-color:#e7e8eb;color:#d3d5db;cursor:not-allowed}.do-ui-button.medium.with-icon,.do-ui-button.large.with-icon{position:relative;padding-left:43px}.do-ui-button.medium.with-icon [class^="do-icon-"],.do-ui-button.medium.with-icon [class*=" do-icon-"],.do-ui-button.large.with-icon [class^="do-icon-"],.do-ui-button.large.with-icon [class*=" do-icon-"]{position:absolute;left:0;top:0;width:35px;font-size:25px;background:rgba(0,0,0,0.1)}.do-ui-button.large.with-icon{padding-left:58px}.do-ui-button.large.with-icon [class^="do-icon-"],.do-ui-button.large.with-icon [class*=" do-icon-"]{width:50px;font-size:35px}.do-ui-input{position:relative;min-height:30px;padding:0 5px;border:1px solid #d3d5db;background:#fff;color:#546e7a;outline:none;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.do-ui-input::-webkit-input-placeholder{color:#d3d5db}.do-ui-input.area{padding:5px}.do-ui-input.radius-3{border-radius:3px}.do-ui-input.radius-5{border-radius:5px}.do-ui-input:focus,.do-ui-input:hover{border-color:#1abc9c}.do-ui-input.alert{border-color:#ff5722;color:#ff5722}.do-ui-input.alert input{color:#ff5722}.do-ui-input.disabled{border-color:transparent;background:#e7e8eb;color:#d3d5db}.do-ui-input.with-icon{display:inline-block;padding:0}.do-ui-input.with-icon input{width:100%;height:100%;min-height:30px;padding:0 30px 0 5px;border:0;background:transparent}.do-ui-input.with-icon [class^="do-icon-"],.do-ui-input.with-icon [class*=" do-icon-"]{position:absolute;right:0;top:0;width:30px;line-height:30px;font-size:22px}.do-ui-select{display:inline-block;min-height:30px;padding:0 30px 0 10px;border:0;border-bottom:1px solid #e7e7e7;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAMAAABV0m3JAAAADFBMVEUAAAD///+Pj4+JiYkxcGihAAAABHRSTlMAABBwqVQF9wAAADNJREFUeNqlzjEOACAMw8DQ/v/PSE5FFhaEx5usdekBuzRVH0RtCqJYELUFrVjQigX/5jdvzgDh9izlMQAAAABJRU5ErkJggg==) no-repeat right 8px;color:#546e7a;outline:none;-webkit-appearance:none;-moz-appearance:none;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.do-ui-select::-ms-expand{display:none}.do-ui-select:focus{border-color:#1abc9c}.do-ui-select.alert{border-color:#ff5722;color:#ff5722}.do-ui-select.disabled{border-color:transparent;background:#e7e8eb;color:#d3d5db}.do-ui-radio,.do-ui-checkbox{display:inline-block;position:relative;width:auto;height:auto;min-height:30px;padding-left:35px;line-height:30px;border-radius:3px;color:#546e7a}.do-ui-radio{padding-left:50px}.do-ui-radio>input{position:absolute;left:10px;top:10px;width:35px;height:10px;border-radius:10px;border:0;background:#d3d5db;-webkit-appearance:none;-moz-appearance:none}.do-ui-radio>input:checked{background:#d3d5db}.do-ui-radio>input:disabled{background:#ecf0f1}.do-ui-radio>input:disabled:checked{background:#d3d5db}.do-ui-radio>input::after{position:absolute;display:block;left:-2px;top:-5px;width:20px;height:20px;border-radius:50%;content:"";background:#ecf0f1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.2);box-shadow:0 1px 2px rgba(0,0,0,0.2)}.do-ui-radio>input:checked::after{left:auto;right:-2px;background:#607d8b}.do-ui-radio>input:checked:disabled::after{background:#d3d5db}.do-ui-radio.green>input:checked{background:#81c784}.do-ui-radio.green>input:checked::after{background:#388e3c}.do-ui-radio.teal>input:checked{background:#81c784}.do-ui-radio.teal>input:checked::after{background:#16a085}.do-ui-radio.blue>input:checked{background:#64b5f6}.do-ui-radio.blue>input:checked::after{background:#1976d2}.do-ui-radio.purple>input:checked{background:#64b5f6}.do-ui-radio.purple>input:checked::after{background:#6200ea}.do-ui-radio.red>input:checked{background:#ff7043}.do-ui-radio.red>input:checked::after{background:#e64a19}.do-ui-radio.orange>input:checked{background:#ffa726}.do-ui-radio.orange>input:checked::after{background:#f57c00}.do-ui-radio.grey>input:checked{background:#607d8b}.do-ui-radio.grey>input:checked::after{background:#37474f}.do-ui-radio.disabled{color:#d3d5db}.do-ui-checkbox>input{position:absolute;left:2px;top:2px;width:26px;height:26px;line-height:22px;border:2px solid #d3d5db;border-radius:3px;text-align:center;font-size:18px;font-family:"ui font" !important;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-appearance:none;-moz-appearance:none}.do-ui-checkbox>input:checked::after{content:"\e60f"}.do-ui-checkbox>input:disabled{border-color:#d3d5db;color:#d3d5db}.do-ui-checkbox.green>input{color:#4caf50 !important;border-color:#4caf50}.do-ui-checkbox.teal>input{color:#1abc9c !important;border-color:#1abc9c}.do-ui-checkbox.purple>input{color:#651fff !important;border-color:#651fff}.do-ui-checkbox.blue>input{color:#2196f3 !important;border-color:#2196f3}.do-ui-checkbox.red>input{color:#ff5722 !important;border-color:#ff5722}.do-ui-checkbox.orange>input{color:#ff9800 !important;border-color:#ff9800}.do-ui-checkbox.grey>input{color:#546e7a !important;border-color:#546e7a}.do-ui-checkbox.disabled{color:#d3d5db}.do-ui-checkbox.with-style{padding-left:5px;padding-right:35px;line-height:26px;border:2px solid #e7e8eb;background:#e7e8eb;text-align:center}.do-ui-checkbox.with-style>input{left:auto;right:0;top:0;line-height:26px;border:0;background:#fff;color:#607d8b}.do-ui-checkbox.with-style>input:disabled{color:#d3d5db !important}.do-ui-checkbox.with-style.green{border-color:#4caf50;background:#4caf50;color:#fff}.do-ui-checkbox.with-style.teal{border-color:#1abc9c;background:#1abc9c;color:#fff}.do-ui-checkbox.with-style.purple{border-color:#651fff;background:#651fff;color:#fff}.do-ui-checkbox.with-style.blue{border-color:#2196f3;background:#2196f3;color:#fff}.do-ui-checkbox.with-style.red{border-color:#ff5722;background:#ff5722;color:#fff}.do-ui-checkbox.with-style.orange{border-color:#ff9800;background:#ff9800;color:#fff}.do-ui-checkbox.with-style.grey{border-color:#546e7a;background:#546e7a;color:#fff}.do-ui-checkbox.with-style.disabled{border-color:#e7e8eb;background:#e7e8eb;color:#d3d5db}.do-ui-quote{display:block;position:relative;min-height:60px;margin:10px 0;padding:15px 5px 5px 50px;border:1px solid #ddd;border-radius:10px;background:#f7f7f7;word-break:break-all}.do-ui-quote::before{position:absolute;left:8px;top:0;font:30px/1.5 "ui font";color:#d3d5db;content:"\e61b"}.do-ui-warn,.do-ui-mark{display:inline-block;position:relative;min-height:40px;margin:5px 0;padding:5px 8px 5px 50px;border:1px solid #ff9800;border-radius:5px;background:#fffbed;color:#f57c00;word-break:break-all}.do-ui-warn p,.do-ui-mark p{margin:0 !important}.do-ui-warn::before,.do-ui-mark::before{position:absolute;left:15px;top:5px;font:20px/1.5 "ui font";color:#ff5722;content:"\e6f6"}.do-ui-mark{border-color:#48c9b0;color:#16a085;background:#edfbf8}.do-ui-mark::before{color:#16a085;content:"\e657"}
diff --git a/src/css/reset.scss b/src/css/reset-basic.scss
similarity index 99%
rename from src/css/reset.scss
rename to src/css/reset-basic.scss
index 7fe56f8..9ac6075 100644
--- a/src/css/reset.scss
+++ b/src/css/reset-basic.scss
@@ -39,7 +39,7 @@ a:focus,input,button:focus,input:focus {outline:none;}
::-moz-focus-inner {
border:none;outline:none;
}
-[anot],[\:if],do-* {visibility:hidden;}
+[anot],[\:if] {visibility:hidden;}
.do-fn-cl { *zoom: 1; }
.do-fn-cl::after { content: "."; display: block; height: 0; clear: both; visibility: hidden; overflow:hidden;}
diff --git a/src/css/reset.css b/src/css/reset.css
deleted file mode 100644
index 527e48f..0000000
--- a/src/css/reset.css
+++ /dev/null
@@ -1 +0,0 @@
-@font-face{font-family:"uifont";src:url("data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAACmUAAsAAAAARHwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFZW7ki2Y21hcAAAAYAAAAIrAAAFrHCw14BnbHlmAAADrAAAIaoAADYgQuw9GGhlYWQAACVYAAAALwAAADYRScsKaGhlYQAAJYgAAAAcAAAAJAfeA81obXR4AAAlpAAAABUAAAEwL+kAAGxvY2EAACW8AAAAmgAAAJr/zfHmbWF4cAAAJlgAAAAfAAAAIAFsAJ9uYW1lAAAmeAAAAUUAAAJtPlT+fXBvc3QAACfAAAAB0gAAAp8LNc5leJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BkYWCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGBwYKp4dYW7438AQw9zA0AAUZgTJAQDhxQw5eJzF1NVSHGEYhOF3sRgxYsTd3d09XA4RYhzEioSiilDE3d3djWvp2yA92xwkV8BsPVu7f83OP7XT/QHVQKXNsyqoqKfkT5TqvFoqr1fSv7xehfx9iF/F+U1q1im1qk0d6uruLq806phavNKuzvL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ej/bxtjJGDgSDFBhhxTzLCBfdiPAziIQziMIziKYziOEziJUziNMziLcziPC7iIS7iMK7iKa7iOG7iJW7iNO7iLOe7hPh5gE1t4iEd4jCd4imd4jhd4iVd4jTd4i3d4jw/4iE/4jC/4im/4jh/4iW38GmHFlCltshCSSTLrrBCajBSeUyOUTmhNrBQFJaVep6W2zq1ZZa2c1CRkS4HVpB3Tqg1M22Inb8h0c01lmA6VV1UdskYZ1ag/xF1tDU2cKkLniTnlYtBdy3c7G4gHsdDEgtA7LKiGMmmXRlsh0871iTWRWlpSn1gPkcmFHrD4AJP37VAlThlGUkV2tiFe1MKHjdJqSX5eaNtSElZhtjewjsx410+imKBMxZouEIsrgZXWhLQz/SBtSfiiTlohefCirXktohW8jafjNVGx2G71YTPVtrJdFN3rlzbkIXKyZt652V7V65r0iiJc5myrgrKGLYU3bEFa84EiK1W0qGvJ56qIS4PFbRA+LbQiE++L1WBq3g/nZad1WoiGvIi/8ZuSigJfemuq0egvLoS16gAA") format("woff")}*{margin:0;padding:0;vertical-align:baseline;-webkit-box-sizing:border-box;box-sizing:border-box}::before,::after{-webkit-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section,content{display:block}img{border:0;display:inline-block}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote::before,blockquote::after,q::before,q::after{content:'';content:none}table{border-collapse:collapse;border-spacing:0}a:focus,input,button:focus,input:focus{outline:none}::-moz-focus-inner{border:none;outline:none}[anot],[\:if],do-*{visibility:hidden}.do-fn-cl{*zoom:1}.do-fn-cl::after{content:".";display:block;height:0;clear:both;visibility:hidden;overflow:hidden}.do-fn-clear{clear:both;display:inline}.do-fn-show{display:block}.do-fn-hide{display:none}.do-fn-fl{float:left}.do-fn-fr{float:right}.do-fn-noselect{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.do-fn-noselect img,.do-fn-noselect a{-webkit-user-drag:none}.do-fn-ell{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.do-st-thin{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.do-st-hand{cursor:pointer}[class^="do-icon-"],[class*=" do-icon-"]{display:inline-block;font-family:"uifont" !important;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.do-icon-info:before{content:"\e673"}.do-icon-bad:before{content:"\e674"}.do-icon-deny:before{content:"\e676"}.do-icon-calendar:before{content:"\e675"}.do-icon-email:before{content:"\e677"}.do-icon-eye:before{content:"\e678"}.do-icon-face:before{content:"\e67c"}.do-icon-fly:before{content:"\e679"}.do-icon-floppy:before{content:"\e67a"}.do-icon-good:before{content:"\e67b"}.do-icon-headset:before{content:"\e67d"}.do-icon-help:before{content:"\e67e"}.do-icon-list:before{content:"\e682"}.do-icon-lock:before{content:"\e683"}.do-icon-menu-left:before{content:"\e684"}.do-icon-menu-right:before{content:"\e685"}.do-icon-minimize:before{content:"\e686"}.do-icon-phone:before{content:"\e688"}.do-icon-picture:before{content:"\e689"}.do-icon-pipe:before{content:"\e68a"}.do-icon-plus:before{content:"\e68b"}.do-icon-quote:before{content:"\e68d"}.do-icon-table:before{content:"\e690"}.do-icon-talk:before{content:"\e691"}.do-icon-time:before{content:"\e692"}.do-icon-download:before{content:"\e694"}.do-icon-upload:before{content:"\e695"}.do-icon-male:before{content:"\e696"}.do-icon-female:before{content:"\e697"}.do-icon-left:before{content:"\e698"}.do-icon-dbl-left:before{content:"\e699"}.do-icon-right:before{content:"\e69a"}.do-icon-dbl-right:before{content:"\e69b"}.do-icon-pin:before{content:"\e69c"}.do-icon-edit:before{content:"\e69d"}.do-icon-home:before{content:"\e69e"}.do-icon-chart:before{content:"\e69f"}.do-icon-folder-close:before{content:"\e6a0"}.do-icon-txt:before{content:"\e6a1"}.do-icon-folder-open:before{content:"\e6a2"}.do-icon-qr:before{content:"\e6a3"}.do-icon-setting:before{content:"\e6a4"}.do-icon-mute:before{content:"\e6a5"}.do-icon-chat:before{content:"\e6a6"}.do-icon-font:before{content:"\e6a7"}.do-icon-unmute:before{content:"\e6a8"}.do-icon-search:before{content:"\e6a9"}.do-icon-sad:before{content:"\e6aa"}.do-icon-trash:before{content:"\e6ab"}.do-icon-happy:before{content:"\e6ac"}.do-icon-share:before{content:"\e6ad"}.do-icon-tag:before{content:"\e6ae"}.do-icon-app2:before{content:"\e6af"}.do-icon-app1:before{content:"\e6b0"}.do-icon-logout:before{content:"\e6b1"}.do-icon-menu-dot:before{content:"\e6b2"}.do-icon-trigon-up:before{content:"\e6b3"}.do-icon-trigon-down:before{content:"\e6b4"}.do-icon-loading:before{content:"\e6b5"}.do-icon-position:before{content:"\e6b6"}.do-icon-warn:before{content:"\e6b7"}.do-icon-bell:before{content:"\e6b8"}.do-icon-close:before{content:"\e6b9"}.do-icon-fire:before{content:"\e6ba"}.do-icon-user:before{content:"\e6bb"}.do-icon-icon-list:before{content:"\e6bc"}.do-icon-star:before{content:"\e6bd"}.do-icon-client:before{content:"\e6be"}.do-icon-maximize:before{content:"\e6bf"}.do-icon-star-full:before{content:"\e6c0"}.do-icon-camera:before{content:"\e6c1"}.do-icon-live:before{content:"\e6c2"}.do-icon-get:before{content:"\e6c3"}.do-icon-wrong:before{content:"\e6c4"}
diff --git a/src/js/anot-touch.js b/src/js/anot-touch.js
index 4258fe6..cab09ad 100644
--- a/src/js/anot-touch.js
+++ b/src/js/anot-touch.js
@@ -225,15 +225,15 @@ const _Anot = (function() {
if ($elem === DOC.body) {
scanTag($elem, [])
} else {
- var $parent = $elem
- while (($parent = $parent.parentNode)) {
- if ($parent.anotctrl) {
+ var _parent = $elem
+ while ((_parent = _parent.parentNode)) {
+ if (_parent.anotctrl) {
break
}
}
scanTag(
$elem.parentNode,
- $parent ? [VMODELS[$parent.anotctrl]] : []
+ _parent ? [VMODELS[_parent.anotctrl]] : []
)
}
}
@@ -1456,6 +1456,7 @@ const _Anot = (function() {
function $emit(key, args) {
var event = this.$events
+ var _parent = null
if (event && event[key]) {
if (args) {
args[2] = key
@@ -1469,22 +1470,22 @@ const _Anot = (function() {
} catch (e) {}
}
}
- var parent = this.$up
- if (parent) {
+ _parent = this.$up
+ if (_parent) {
if (this.$pathname) {
- $emit.call(parent, this.$pathname + '.' + key, args) //以确切的值往上冒泡
+ $emit.call(_parent, this.$pathname + '.' + key, args) //以确切的值往上冒泡
}
- $emit.call(parent, '*.' + key, args) //以模糊的值往上冒泡
+ $emit.call(_parent, '*.' + key, args) //以模糊的值往上冒泡
}
} else {
- parent = this.$up
+ _parent = this.$up
if (this.$ups) {
for (var i in this.$ups) {
$emit.call(this.$ups[i], i + '.' + key, args) //以确切的值往上冒泡
}
return
}
- if (parent) {
+ if (_parent) {
var p = this.$pathname
if (p === '') p = '*'
var path = p + '.' + key
@@ -1493,11 +1494,11 @@ const _Anot = (function() {
args = (args && args.concat([path, key])) || [path, key]
if (arr.indexOf('*') === -1) {
- $emit.call(parent, path, args) //以确切的值往上冒泡
+ $emit.call(_parent, path, args) //以确切的值往上冒泡
arr[1] = '*'
- $emit.call(parent, arr.join('.'), args) //以模糊的值往上冒泡
+ $emit.call(_parent, arr.join('.'), args) //以模糊的值往上冒泡
} else {
- $emit.call(parent, path, args) //以确切的值往上冒泡
+ $emit.call(_parent, path, args) //以确切的值往上冒泡
}
}
}
@@ -1743,6 +1744,12 @@ const _Anot = (function() {
var v = $vmodel.$children[i]
v.$fire && v.$fire.apply(v, [ee, a])
}
+ // component! 这是一个特殊的标识,可以直接修改子组件的state值
+ } else if (path.indexOf('component!') === 0) {
+ var ee = path.slice(10)
+ for (var i in $vmodel.$children) {
+ $vmodel.$children[i][ee] = a
+ }
} else {
$emit.call($vmodel, path, [a])
}
@@ -2758,9 +2765,9 @@ const _Anot = (function() {
}
array.push(obj)
}
- var parent = node.parentNode
- if (parent && parent.nodeType === 1) {
- showHidden(parent, array)
+ var _parent = node.parentNode
+ if (_parent && _parent.nodeType === 1) {
+ showHidden(_parent, array)
}
}
}
@@ -3339,12 +3346,16 @@ const _Anot = (function() {
var rnoCollect = /^(:\S+|data-\S+|on[a-z]+|id|style|class)$/
var ronattr = '__fn__'
+ var specifiedVars = [':disabled', ':loading']
function getOptionsFromTag(elem, vmodels) {
- var attributes = elem.attributes
+ var attributes = aslice.call(elem.attributes, 0)
var ret = {}
for (var i = 0, attr; (attr = attributes[i++]); ) {
var name = attr.name
- if (attr.specified && !rnoCollect.test(name)) {
+ if (
+ (attr.specified && !rnoCollect.test(name)) ||
+ specifiedVars.includes(name)
+ ) {
if (name.indexOf(ronattr) === 0) {
name = attr.value.slice(6)
ret[name] = elem[attr.value]
@@ -3364,6 +3375,7 @@ const _Anot = (function() {
} else {
ret[camelizeName] = parseData(attr.value)
}
+ elem.removeAttribute(name)
}
}
}
@@ -3739,8 +3751,9 @@ const _Anot = (function() {
arr.forEach(function(elem) {
var slot = elem.getAttribute('slot')
if (slot) {
+ obj[slot] = obj[slot] || []
elem.removeAttribute('slot')
- obj[slot] = elem.outerHTML
+ obj[slot].push(elem.outerHTML)
}
})
return obj
@@ -3771,6 +3784,8 @@ const _Anot = (function() {
//如果还没有解析完,就延迟一下 #1155
return
}
+ var parentVm = host.vmodels[0]
+ var state = {}
var props = getOptionsFromTag(elem, host.vmodels)
var $id = props.uuid || generateID(widget)
var __willpush__ = null
@@ -3778,7 +3793,24 @@ const _Anot = (function() {
if (props.hasOwnProperty('hostPush')) {
elem.removeAttribute('host-push')
__willpush__ = props.hostPush
- props.hostPush = host.vmodels[0][__willpush__]
+ props.hostPush = parentVm[__willpush__]
+ }
+
+ if (props.hasOwnProperty(':disabled')) {
+ var disabledKey = props[':disabled']
+ state.disabled = parentVm[disabledKey]
+ parentVm.$watch(disabledKey, function(val) {
+ parentVm.$fire('component!disabled', val)
+ })
+ delete props[':disabled']
+ }
+ if (props.hasOwnProperty(':loading')) {
+ var loadingKey = props[':loading']
+ state.loading = parentVm[loadingKey]
+ parentVm.$watch(loadingKey, function(val) {
+ parentVm.$fire('component!loading', val)
+ })
+ delete props[':loading']
}
delete props.uuid
@@ -3788,6 +3820,7 @@ const _Anot = (function() {
hooks.state = hooks.state || {}
Object.assign(hooks.props, props)
+ Object.assign(hooks.state, state)
hooks.construct.call(elem, hooks.props, hooks.state)
@@ -3810,13 +3843,13 @@ const _Anot = (function() {
var vmodel = Anot(hooks)
delete vmodel.$mounted
- host.vmodels[0].$children.push(vmodel)
+ parentVm.$children.push(vmodel)
elem.msResolved = 1 //防止二进扫描此元素
if (__willpush__) {
hideProperty(vmodel, '$push', function(val) {
- host.vmodels[0][__willpush__] = val
+ parentVm[__willpush__] = val
})
}
@@ -3988,12 +4021,12 @@ const _Anot = (function() {
effectBinding(elem, binding)
binding.includeRendered = getBindingCallback(
elem,
- 'data-include-rendered',
+ 'data-rendered',
binding.vmodels
)
binding.includeLoaded = getBindingCallback(
elem,
- 'data-include-loaded',
+ 'data-loaded',
binding.vmodels
)
var outer = (binding.includeReplace = !!Anot(elem).data(
@@ -4057,10 +4090,10 @@ const _Anot = (function() {
//chrome v37- 下embed标签动态设置的src,无法发起请求
if (window.chrome && elem.tagName === 'EMBED') {
- var parent = elem.parentNode
+ var _parent = elem.parentNode
var com = DOC.createComment(':src')
- parent.replaceChild(com, elem)
- parent.replaceChild(elem, com)
+ _parent.replaceChild(com, elem)
+ _parent.replaceChild(elem, com)
}
} else {
var k = i
@@ -4375,7 +4408,7 @@ const _Anot = (function() {
var elem = binding.element
var vmodels = binding.vmodels
binding.changed =
- getBindingCallback(elem, 'data-duplex-changed', vmodels) || noop
+ getBindingCallback(elem, 'data-changed', vmodels) || noop
var params = []
var casting = oneObject('string,number,boolean,checked')
if (elem.type === 'radio' && binding.param === '') {
@@ -4995,12 +5028,12 @@ const _Anot = (function() {
Anot.mix(Anot.effect, {
apply: applyEffect,
- append: function(el, parent, after, opts) {
+ append: function(el, _parent, after, opts) {
return applyEffect(
el,
1,
function() {
- parent.appendChild(el)
+ _parent.appendChild(el)
},
after,
opts
@@ -5017,12 +5050,12 @@ const _Anot = (function() {
opts
)
},
- remove: function(el, parent, after, opts) {
+ remove: function(el, _parent, after, opts) {
return applyEffect(
el,
0,
function() {
- if (el.parentNode === parent) parent.removeChild(el)
+ if (el.parentNode === _parent) _parent.removeChild(el)
},
after,
opts
@@ -5035,15 +5068,15 @@ const _Anot = (function() {
var binding = this
var elem = this.element
var isHtmlFilter = elem.nodeType !== 1
- var parent = isHtmlFilter ? elem.parentNode : elem
- if (!parent) return
+ var _parent = isHtmlFilter ? elem.parentNode : elem
+ if (!_parent) return
val = val == null ? '' : val
if (elem.nodeType === 3) {
var signature = generateID('html')
- parent.insertBefore(DOC.createComment(signature), elem)
+ _parent.insertBefore(DOC.createComment(signature), elem)
binding.element = DOC.createComment(signature + ':end')
- parent.replaceChild(binding.element, elem)
+ _parent.replaceChild(binding.element, elem)
elem = binding.element
}
if (typeof val !== 'object') {
@@ -5069,10 +5102,10 @@ const _Anot = (function() {
if (!node || (node.nodeType === 8 && node.nodeValue === endValue)) {
break
} else {
- parent.removeChild(node)
+ _parent.removeChild(node)
}
}
- parent.insertBefore(fragment, elem)
+ _parent.insertBefore(fragment, elem)
} else {
Anot.clearHTML(elem).appendChild(fragment)
}
@@ -5430,14 +5463,9 @@ const _Anot = (function() {
elem.removeAttribute(binding.name)
effectBinding(elem, binding)
binding.param = binding.param || 'el'
- binding.sortedCallback = getBindingCallback(
- elem,
- 'data-repeat-sortby',
- binding.vmodels
- )
var rendered = getBindingCallback(
elem,
- 'data-repeat-rendered',
+ 'data-rendered',
binding.vmodels
)
@@ -5448,18 +5476,18 @@ const _Anot = (function() {
binding.start = start
binding.template = anotFragment.cloneNode(false)
- var parent = elem.parentNode
- parent.replaceChild(end, elem)
- parent.insertBefore(start, end)
+ var _parent = elem.parentNode
+ _parent.replaceChild(end, elem)
+ _parent.insertBefore(start, end)
binding.template.appendChild(elem)
binding.element = end
if (rendered) {
- var removeFn = Anot.bind(parent, 'datasetchanged', function() {
- rendered.apply(parent, parent.args)
- Anot.unbind(parent, 'datasetchanged', removeFn)
- parent.msRendered = rendered
+ var removeFn = Anot.bind(_parent, 'datasetchanged', function() {
+ rendered.apply(_parent, _parent.args)
+ Anot.unbind(_parent, 'datasetchanged', removeFn)
+ _parent.msRendered = rendered
})
}
}
@@ -5486,14 +5514,6 @@ const _Anot = (function() {
}
}
var track = this.track
- if (binding.sortedCallback) {
- //如果有回调,则让它们排序
- var keys2 = binding.sortedCallback.call(parent, track)
- if (keys2 && Array.isArray(keys2)) {
- track = keys2
- }
- }
-
var action = 'move'
binding.$repeat = value
var fragments = []
@@ -5504,7 +5524,7 @@ const _Anot = (function() {
var elem = this.element
var length = track.length
- var parent = elem.parentNode
+ var _parent = elem.parentNode
//检查新元素数量
var newCount = 0
@@ -5523,7 +5543,7 @@ const _Anot = (function() {
if (clear) {
while (kill !== start) {
- parent.removeChild(kill)
+ _parent.removeChild(kill)
kill = elem.previousSibling
}
}
@@ -5585,7 +5605,7 @@ const _Anot = (function() {
}
this.proxies = proxies
if (init && !binding.effectDriver) {
- parent.insertBefore(transation, elem)
+ _parent.insertBefore(transation, elem)
fragments.forEach(function(fragment) {
scanNodeArray(fragment.nodes || [], fragment.vmodels)
//if(fragment.vmodels.length > 2)
@@ -5617,7 +5637,7 @@ const _Anot = (function() {
staggerIndex = mayStaggerAnimate(
binding.effectEnterStagger,
function() {
- parent.insertBefore(
+ _parent.insertBefore(
fragment.content,
preElement.nextSibling
)
@@ -5637,7 +5657,7 @@ const _Anot = (function() {
function() {
var curNode = removeItem(proxy2.$anchor)
var inserted = Anot.slice(curNode.childNodes)
- parent.insertBefore(curNode, preElement.nextSibling)
+ _parent.insertBefore(curNode, preElement.nextSibling)
animateRepeat(inserted, 1, binding)
},
staggerIndex
@@ -5655,17 +5675,17 @@ const _Anot = (function() {
//repeat --> duplex
;(function(args) {
- parent.args = args
- if (parent.msRendered) {
+ _parent.args = args
+ if (_parent.msRendered) {
//第一次事件触发,以后直接调用
- parent.msRendered.apply(parent, args)
+ _parent.msRendered.apply(_parent, args)
}
})(kernel.newWatch ? arguments : [action])
var id = setTimeout(function() {
clearTimeout(id)
//触发上层的select回调及自己的rendered回调
- Anot.fireDom(parent, 'datasetchanged', {
- bubble: parent.msHasEvent
+ Anot.fireDom(_parent, 'datasetchanged', {
+ bubble: _parent.msHasEvent
})
})
this.enterCount -= 1
diff --git a/src/js/anot-touch.shim.js b/src/js/anot-touch.shim.js
index c8ff95c..074d11e 100644
--- a/src/js/anot-touch.shim.js
+++ b/src/js/anot-touch.shim.js
@@ -240,15 +240,15 @@
if ($elem === DOC.body) {
scanTag($elem, [])
} else {
- var $parent = $elem
- while (($parent = $parent.parentNode)) {
- if ($parent.anotctrl) {
+ var _parent = $elem
+ while ((_parent = _parent.parentNode)) {
+ if (_parent.anotctrl) {
break
}
}
scanTag(
$elem.parentNode,
- $parent ? [VMODELS[$parent.anotctrl]] : []
+ _parent ? [VMODELS[_parent.anotctrl]] : []
)
}
}
@@ -1471,6 +1471,7 @@
function $emit(key, args) {
var event = this.$events
+ var _parent = null
if (event && event[key]) {
if (args) {
args[2] = key
@@ -1484,22 +1485,22 @@
} catch (e) {}
}
}
- var parent = this.$up
- if (parent) {
+ _parent = this.$up
+ if (_parent) {
if (this.$pathname) {
- $emit.call(parent, this.$pathname + '.' + key, args) //以确切的值往上冒泡
+ $emit.call(_parent, this.$pathname + '.' + key, args) //以确切的值往上冒泡
}
- $emit.call(parent, '*.' + key, args) //以模糊的值往上冒泡
+ $emit.call(_parent, '*.' + key, args) //以模糊的值往上冒泡
}
} else {
- parent = this.$up
+ _parent = this.$up
if (this.$ups) {
for (var i in this.$ups) {
$emit.call(this.$ups[i], i + '.' + key, args) //以确切的值往上冒泡
}
return
}
- if (parent) {
+ if (_parent) {
var p = this.$pathname
if (p === '') p = '*'
var path = p + '.' + key
@@ -1508,11 +1509,11 @@
args = (args && args.concat([path, key])) || [path, key]
if (arr.indexOf('*') === -1) {
- $emit.call(parent, path, args) //以确切的值往上冒泡
+ $emit.call(_parent, path, args) //以确切的值往上冒泡
arr[1] = '*'
- $emit.call(parent, arr.join('.'), args) //以模糊的值往上冒泡
+ $emit.call(_parent, arr.join('.'), args) //以模糊的值往上冒泡
} else {
- $emit.call(parent, path, args) //以确切的值往上冒泡
+ $emit.call(_parent, path, args) //以确切的值往上冒泡
}
}
}
@@ -1758,6 +1759,12 @@
var v = $vmodel.$children[i]
v.$fire && v.$fire.apply(v, [ee, a])
}
+ // component! 这是一个特殊的标识,可以直接修改子组件的state值
+ } else if (path.indexOf('component!') === 0) {
+ var ee = path.slice(10)
+ for (var i in $vmodel.$children) {
+ $vmodel.$children[i][ee] = a
+ }
} else {
$emit.call($vmodel, path, [a])
}
@@ -2773,9 +2780,9 @@
}
array.push(obj)
}
- var parent = node.parentNode
- if (parent && parent.nodeType === 1) {
- showHidden(parent, array)
+ var _parent = node.parentNode
+ if (_parent && _parent.nodeType === 1) {
+ showHidden(_parent, array)
}
}
}
@@ -3354,12 +3361,16 @@
var rnoCollect = /^(:\S+|data-\S+|on[a-z]+|id|style|class)$/
var ronattr = '__fn__'
+ var specifiedVars = [':disabled', ':loading']
function getOptionsFromTag(elem, vmodels) {
- var attributes = elem.attributes
+ var attributes = aslice.call(elem.attributes, 0)
var ret = {}
for (var i = 0, attr; (attr = attributes[i++]); ) {
var name = attr.name
- if (attr.specified && !rnoCollect.test(name)) {
+ if (
+ (attr.specified && !rnoCollect.test(name)) ||
+ specifiedVars.includes(name)
+ ) {
if (name.indexOf(ronattr) === 0) {
name = attr.value.slice(6)
ret[name] = elem[attr.value]
@@ -3379,6 +3390,7 @@
} else {
ret[camelizeName] = parseData(attr.value)
}
+ elem.removeAttribute(name)
}
}
}
@@ -3754,8 +3766,9 @@
arr.forEach(function(elem) {
var slot = elem.getAttribute('slot')
if (slot) {
+ obj[slot] = obj[slot] || []
elem.removeAttribute('slot')
- obj[slot] = elem.outerHTML
+ obj[slot].push(elem.outerHTML)
}
})
return obj
@@ -3786,6 +3799,8 @@
//如果还没有解析完,就延迟一下 #1155
return
}
+ var parentVm = host.vmodels[0]
+ var state = {}
var props = getOptionsFromTag(elem, host.vmodels)
var $id = props.uuid || generateID(widget)
var __willpush__ = null
@@ -3793,7 +3808,24 @@
if (props.hasOwnProperty('hostPush')) {
elem.removeAttribute('host-push')
__willpush__ = props.hostPush
- props.hostPush = host.vmodels[0][__willpush__]
+ props.hostPush = parentVm[__willpush__]
+ }
+
+ if (props.hasOwnProperty(':disabled')) {
+ var disabledKey = props[':disabled']
+ state.disabled = parentVm[disabledKey]
+ parentVm.$watch(disabledKey, function(val) {
+ parentVm.$fire('component!disabled', val)
+ })
+ delete props[':disabled']
+ }
+ if (props.hasOwnProperty(':loading')) {
+ var loadingKey = props[':loading']
+ state.loading = parentVm[loadingKey]
+ parentVm.$watch(loadingKey, function(val) {
+ parentVm.$fire('component!loading', val)
+ })
+ delete props[':loading']
}
delete props.uuid
@@ -3803,6 +3835,7 @@
hooks.state = hooks.state || {}
Object.assign(hooks.props, props)
+ Object.assign(hooks.state, state)
hooks.construct.call(elem, hooks.props, hooks.state)
@@ -3825,13 +3858,13 @@
var vmodel = Anot(hooks)
delete vmodel.$mounted
- host.vmodels[0].$children.push(vmodel)
+ parentVm.$children.push(vmodel)
elem.msResolved = 1 //防止二进扫描此元素
if (__willpush__) {
hideProperty(vmodel, '$push', function(val) {
- host.vmodels[0][__willpush__] = val
+ parentVm[__willpush__] = val
})
}
@@ -4003,12 +4036,12 @@
effectBinding(elem, binding)
binding.includeRendered = getBindingCallback(
elem,
- 'data-include-rendered',
+ 'data-rendered',
binding.vmodels
)
binding.includeLoaded = getBindingCallback(
elem,
- 'data-include-loaded',
+ 'data-loaded',
binding.vmodels
)
var outer = (binding.includeReplace = !!Anot(elem).data(
@@ -4072,10 +4105,10 @@
//chrome v37- 下embed标签动态设置的src,无法发起请求
if (window.chrome && elem.tagName === 'EMBED') {
- var parent = elem.parentNode
+ var _parent = elem.parentNode
var com = DOC.createComment(':src')
- parent.replaceChild(com, elem)
- parent.replaceChild(elem, com)
+ _parent.replaceChild(com, elem)
+ _parent.replaceChild(elem, com)
}
} else {
var k = i
@@ -4390,7 +4423,7 @@
var elem = binding.element
var vmodels = binding.vmodels
binding.changed =
- getBindingCallback(elem, 'data-duplex-changed', vmodels) || noop
+ getBindingCallback(elem, 'data-changed', vmodels) || noop
var params = []
var casting = oneObject('string,number,boolean,checked')
if (elem.type === 'radio' && binding.param === '') {
@@ -5010,12 +5043,12 @@
Anot.mix(Anot.effect, {
apply: applyEffect,
- append: function(el, parent, after, opts) {
+ append: function(el, _parent, after, opts) {
return applyEffect(
el,
1,
function() {
- parent.appendChild(el)
+ _parent.appendChild(el)
},
after,
opts
@@ -5032,12 +5065,12 @@
opts
)
},
- remove: function(el, parent, after, opts) {
+ remove: function(el, _parent, after, opts) {
return applyEffect(
el,
0,
function() {
- if (el.parentNode === parent) parent.removeChild(el)
+ if (el.parentNode === _parent) _parent.removeChild(el)
},
after,
opts
@@ -5050,15 +5083,15 @@
var binding = this
var elem = this.element
var isHtmlFilter = elem.nodeType !== 1
- var parent = isHtmlFilter ? elem.parentNode : elem
- if (!parent) return
+ var _parent = isHtmlFilter ? elem.parentNode : elem
+ if (!_parent) return
val = val == null ? '' : val
if (elem.nodeType === 3) {
var signature = generateID('html')
- parent.insertBefore(DOC.createComment(signature), elem)
+ _parent.insertBefore(DOC.createComment(signature), elem)
binding.element = DOC.createComment(signature + ':end')
- parent.replaceChild(binding.element, elem)
+ _parent.replaceChild(binding.element, elem)
elem = binding.element
}
if (typeof val !== 'object') {
@@ -5084,10 +5117,10 @@
if (!node || (node.nodeType === 8 && node.nodeValue === endValue)) {
break
} else {
- parent.removeChild(node)
+ _parent.removeChild(node)
}
}
- parent.insertBefore(fragment, elem)
+ _parent.insertBefore(fragment, elem)
} else {
Anot.clearHTML(elem).appendChild(fragment)
}
@@ -5445,14 +5478,9 @@
elem.removeAttribute(binding.name)
effectBinding(elem, binding)
binding.param = binding.param || 'el'
- binding.sortedCallback = getBindingCallback(
- elem,
- 'data-repeat-sortby',
- binding.vmodels
- )
var rendered = getBindingCallback(
elem,
- 'data-repeat-rendered',
+ 'data-rendered',
binding.vmodels
)
@@ -5463,18 +5491,18 @@
binding.start = start
binding.template = anotFragment.cloneNode(false)
- var parent = elem.parentNode
- parent.replaceChild(end, elem)
- parent.insertBefore(start, end)
+ var _parent = elem.parentNode
+ _parent.replaceChild(end, elem)
+ _parent.insertBefore(start, end)
binding.template.appendChild(elem)
binding.element = end
if (rendered) {
- var removeFn = Anot.bind(parent, 'datasetchanged', function() {
- rendered.apply(parent, parent.args)
- Anot.unbind(parent, 'datasetchanged', removeFn)
- parent.msRendered = rendered
+ var removeFn = Anot.bind(_parent, 'datasetchanged', function() {
+ rendered.apply(_parent, _parent.args)
+ Anot.unbind(_parent, 'datasetchanged', removeFn)
+ _parent.msRendered = rendered
})
}
}
@@ -5501,14 +5529,6 @@
}
}
var track = this.track
- if (binding.sortedCallback) {
- //如果有回调,则让它们排序
- var keys2 = binding.sortedCallback.call(parent, track)
- if (keys2 && Array.isArray(keys2)) {
- track = keys2
- }
- }
-
var action = 'move'
binding.$repeat = value
var fragments = []
@@ -5519,7 +5539,7 @@
var elem = this.element
var length = track.length
- var parent = elem.parentNode
+ var _parent = elem.parentNode
//检查新元素数量
var newCount = 0
@@ -5538,7 +5558,7 @@
if (clear) {
while (kill !== start) {
- parent.removeChild(kill)
+ _parent.removeChild(kill)
kill = elem.previousSibling
}
}
@@ -5600,7 +5620,7 @@
}
this.proxies = proxies
if (init && !binding.effectDriver) {
- parent.insertBefore(transation, elem)
+ _parent.insertBefore(transation, elem)
fragments.forEach(function(fragment) {
scanNodeArray(fragment.nodes || [], fragment.vmodels)
//if(fragment.vmodels.length > 2)
@@ -5632,7 +5652,7 @@
staggerIndex = mayStaggerAnimate(
binding.effectEnterStagger,
function() {
- parent.insertBefore(
+ _parent.insertBefore(
fragment.content,
preElement.nextSibling
)
@@ -5652,7 +5672,7 @@
function() {
var curNode = removeItem(proxy2.$anchor)
var inserted = Anot.slice(curNode.childNodes)
- parent.insertBefore(curNode, preElement.nextSibling)
+ _parent.insertBefore(curNode, preElement.nextSibling)
animateRepeat(inserted, 1, binding)
},
staggerIndex
@@ -5670,17 +5690,17 @@
//repeat --> duplex
;(function(args) {
- parent.args = args
- if (parent.msRendered) {
+ _parent.args = args
+ if (_parent.msRendered) {
//第一次事件触发,以后直接调用
- parent.msRendered.apply(parent, args)
+ _parent.msRendered.apply(_parent, args)
}
})(kernel.newWatch ? arguments : [action])
var id = setTimeout(function() {
clearTimeout(id)
//触发上层的select回调及自己的rendered回调
- Anot.fireDom(parent, 'datasetchanged', {
- bubble: parent.msHasEvent
+ Anot.fireDom(_parent, 'datasetchanged', {
+ bubble: _parent.msHasEvent
})
})
this.enterCount -= 1
diff --git a/src/js/anot.js b/src/js/anot.js
index 8466b3c..aaec705 100644
--- a/src/js/anot.js
+++ b/src/js/anot.js
@@ -225,15 +225,15 @@ const _Anot = (function() {
if ($elem === DOC.body) {
scanTag($elem, [])
} else {
- var $parent = $elem
- while (($parent = $parent.parentNode)) {
- if ($parent.anotctrl) {
+ var _parent = $elem
+ while ((_parent = _parent.parentNode)) {
+ if (_parent.anotctrl) {
break
}
}
scanTag(
$elem.parentNode,
- $parent ? [VMODELS[$parent.anotctrl]] : []
+ _parent ? [VMODELS[_parent.anotctrl]] : []
)
}
}
@@ -1456,6 +1456,7 @@ const _Anot = (function() {
function $emit(key, args) {
var event = this.$events
+ var _parent = null
if (event && event[key]) {
if (args) {
args[2] = key
@@ -1469,22 +1470,22 @@ const _Anot = (function() {
} catch (e) {}
}
}
- var parent = this.$up
- if (parent) {
+ _parent = this.$up
+ if (_parent) {
if (this.$pathname) {
- $emit.call(parent, this.$pathname + '.' + key, args) //以确切的值往上冒泡
+ $emit.call(_parent, this.$pathname + '.' + key, args) //以确切的值往上冒泡
}
- $emit.call(parent, '*.' + key, args) //以模糊的值往上冒泡
+ $emit.call(_parent, '*.' + key, args) //以模糊的值往上冒泡
}
} else {
- parent = this.$up
+ _parent = this.$up
if (this.$ups) {
for (var i in this.$ups) {
$emit.call(this.$ups[i], i + '.' + key, args) //以确切的值往上冒泡
}
return
}
- if (parent) {
+ if (_parent) {
var p = this.$pathname
if (p === '') p = '*'
var path = p + '.' + key
@@ -1493,11 +1494,11 @@ const _Anot = (function() {
args = (args && args.concat([path, key])) || [path, key]
if (arr.indexOf('*') === -1) {
- $emit.call(parent, path, args) //以确切的值往上冒泡
+ $emit.call(_parent, path, args) //以确切的值往上冒泡
arr[1] = '*'
- $emit.call(parent, arr.join('.'), args) //以模糊的值往上冒泡
+ $emit.call(_parent, arr.join('.'), args) //以模糊的值往上冒泡
} else {
- $emit.call(parent, path, args) //以确切的值往上冒泡
+ $emit.call(_parent, path, args) //以确切的值往上冒泡
}
}
}
@@ -1743,6 +1744,12 @@ const _Anot = (function() {
var v = $vmodel.$children[i]
v.$fire && v.$fire.apply(v, [ee, a])
}
+ // component! 这是一个特殊的标识,可以直接修改子组件的state值
+ } else if (path.indexOf('component!') === 0) {
+ var ee = path.slice(10)
+ for (var i in $vmodel.$children) {
+ $vmodel.$children[i][ee] = a
+ }
} else {
$emit.call($vmodel, path, [a])
}
@@ -2758,9 +2765,9 @@ const _Anot = (function() {
}
array.push(obj)
}
- var parent = node.parentNode
- if (parent && parent.nodeType === 1) {
- showHidden(parent, array)
+ var _parent = node.parentNode
+ if (_parent && _parent.nodeType === 1) {
+ showHidden(_parent, array)
}
}
}
@@ -3339,12 +3346,16 @@ const _Anot = (function() {
var rnoCollect = /^(:\S+|data-\S+|on[a-z]+|id|style|class)$/
var ronattr = '__fn__'
+ var specifiedVars = [':disabled', ':loading']
function getOptionsFromTag(elem, vmodels) {
- var attributes = elem.attributes
+ var attributes = aslice.call(elem.attributes, 0)
var ret = {}
for (var i = 0, attr; (attr = attributes[i++]); ) {
var name = attr.name
- if (attr.specified && !rnoCollect.test(name)) {
+ if (
+ (attr.specified && !rnoCollect.test(name)) ||
+ specifiedVars.includes(name)
+ ) {
if (name.indexOf(ronattr) === 0) {
name = attr.value.slice(6)
ret[name] = elem[attr.value]
@@ -3364,6 +3375,7 @@ const _Anot = (function() {
} else {
ret[camelizeName] = parseData(attr.value)
}
+ elem.removeAttribute(name)
}
}
}
@@ -3739,8 +3751,9 @@ const _Anot = (function() {
arr.forEach(function(elem) {
var slot = elem.getAttribute('slot')
if (slot) {
+ obj[slot] = obj[slot] || []
elem.removeAttribute('slot')
- obj[slot] = elem.outerHTML
+ obj[slot].push(elem.outerHTML)
}
})
return obj
@@ -3771,6 +3784,8 @@ const _Anot = (function() {
//如果还没有解析完,就延迟一下 #1155
return
}
+ var parentVm = host.vmodels[0]
+ var state = {}
var props = getOptionsFromTag(elem, host.vmodels)
var $id = props.uuid || generateID(widget)
var __willpush__ = null
@@ -3778,7 +3793,24 @@ const _Anot = (function() {
if (props.hasOwnProperty('hostPush')) {
elem.removeAttribute('host-push')
__willpush__ = props.hostPush
- props.hostPush = host.vmodels[0][__willpush__]
+ props.hostPush = parentVm[__willpush__]
+ }
+
+ if (props.hasOwnProperty(':disabled')) {
+ var disabledKey = props[':disabled']
+ state.disabled = parentVm[disabledKey]
+ parentVm.$watch(disabledKey, function(val) {
+ parentVm.$fire('component!disabled', val)
+ })
+ delete props[':disabled']
+ }
+ if (props.hasOwnProperty(':loading')) {
+ var loadingKey = props[':loading']
+ state.loading = parentVm[loadingKey]
+ parentVm.$watch(loadingKey, function(val) {
+ parentVm.$fire('component!loading', val)
+ })
+ delete props[':loading']
}
delete props.uuid
@@ -3788,6 +3820,7 @@ const _Anot = (function() {
hooks.state = hooks.state || {}
Object.assign(hooks.props, props)
+ Object.assign(hooks.state, state)
hooks.construct.call(elem, hooks.props, hooks.state)
@@ -3810,13 +3843,13 @@ const _Anot = (function() {
var vmodel = Anot(hooks)
delete vmodel.$mounted
- host.vmodels[0].$children.push(vmodel)
+ parentVm.$children.push(vmodel)
elem.msResolved = 1 //防止二进扫描此元素
if (__willpush__) {
hideProperty(vmodel, '$push', function(val) {
- host.vmodels[0][__willpush__] = val
+ parentVm[__willpush__] = val
})
}
@@ -3988,12 +4021,12 @@ const _Anot = (function() {
effectBinding(elem, binding)
binding.includeRendered = getBindingCallback(
elem,
- 'data-include-rendered',
+ 'data-rendered',
binding.vmodels
)
binding.includeLoaded = getBindingCallback(
elem,
- 'data-include-loaded',
+ 'data-loaded',
binding.vmodels
)
var outer = (binding.includeReplace = !!Anot(elem).data(
@@ -4057,10 +4090,10 @@ const _Anot = (function() {
//chrome v37- 下embed标签动态设置的src,无法发起请求
if (window.chrome && elem.tagName === 'EMBED') {
- var parent = elem.parentNode
+ var _parent = elem.parentNode
var com = DOC.createComment(':src')
- parent.replaceChild(com, elem)
- parent.replaceChild(elem, com)
+ _parent.replaceChild(com, elem)
+ _parent.replaceChild(elem, com)
}
} else {
var k = i
@@ -4375,7 +4408,7 @@ const _Anot = (function() {
var elem = binding.element
var vmodels = binding.vmodels
binding.changed =
- getBindingCallback(elem, 'data-duplex-changed', vmodels) || noop
+ getBindingCallback(elem, 'data-changed', vmodels) || noop
var params = []
var casting = oneObject('string,number,boolean,checked')
if (elem.type === 'radio' && binding.param === '') {
@@ -4995,12 +5028,12 @@ const _Anot = (function() {
Anot.mix(Anot.effect, {
apply: applyEffect,
- append: function(el, parent, after, opts) {
+ append: function(el, _parent, after, opts) {
return applyEffect(
el,
1,
function() {
- parent.appendChild(el)
+ _parent.appendChild(el)
},
after,
opts
@@ -5017,12 +5050,12 @@ const _Anot = (function() {
opts
)
},
- remove: function(el, parent, after, opts) {
+ remove: function(el, _parent, after, opts) {
return applyEffect(
el,
0,
function() {
- if (el.parentNode === parent) parent.removeChild(el)
+ if (el.parentNode === _parent) _parent.removeChild(el)
},
after,
opts
@@ -5035,15 +5068,15 @@ const _Anot = (function() {
var binding = this
var elem = this.element
var isHtmlFilter = elem.nodeType !== 1
- var parent = isHtmlFilter ? elem.parentNode : elem
- if (!parent) return
+ var _parent = isHtmlFilter ? elem.parentNode : elem
+ if (!_parent) return
val = val == null ? '' : val
if (elem.nodeType === 3) {
var signature = generateID('html')
- parent.insertBefore(DOC.createComment(signature), elem)
+ _parent.insertBefore(DOC.createComment(signature), elem)
binding.element = DOC.createComment(signature + ':end')
- parent.replaceChild(binding.element, elem)
+ _parent.replaceChild(binding.element, elem)
elem = binding.element
}
if (typeof val !== 'object') {
@@ -5069,10 +5102,10 @@ const _Anot = (function() {
if (!node || (node.nodeType === 8 && node.nodeValue === endValue)) {
break
} else {
- parent.removeChild(node)
+ _parent.removeChild(node)
}
}
- parent.insertBefore(fragment, elem)
+ _parent.insertBefore(fragment, elem)
} else {
Anot.clearHTML(elem).appendChild(fragment)
}
@@ -5430,14 +5463,9 @@ const _Anot = (function() {
elem.removeAttribute(binding.name)
effectBinding(elem, binding)
binding.param = binding.param || 'el'
- binding.sortedCallback = getBindingCallback(
- elem,
- 'data-repeat-sortby',
- binding.vmodels
- )
var rendered = getBindingCallback(
elem,
- 'data-repeat-rendered',
+ 'data-rendered',
binding.vmodels
)
@@ -5448,18 +5476,18 @@ const _Anot = (function() {
binding.start = start
binding.template = anotFragment.cloneNode(false)
- var parent = elem.parentNode
- parent.replaceChild(end, elem)
- parent.insertBefore(start, end)
+ var _parent = elem.parentNode
+ _parent.replaceChild(end, elem)
+ _parent.insertBefore(start, end)
binding.template.appendChild(elem)
binding.element = end
if (rendered) {
- var removeFn = Anot.bind(parent, 'datasetchanged', function() {
- rendered.apply(parent, parent.args)
- Anot.unbind(parent, 'datasetchanged', removeFn)
- parent.msRendered = rendered
+ var removeFn = Anot.bind(_parent, 'datasetchanged', function() {
+ rendered.apply(_parent, _parent.args)
+ Anot.unbind(_parent, 'datasetchanged', removeFn)
+ _parent.msRendered = rendered
})
}
}
@@ -5486,14 +5514,6 @@ const _Anot = (function() {
}
}
var track = this.track
- if (binding.sortedCallback) {
- //如果有回调,则让它们排序
- var keys2 = binding.sortedCallback.call(parent, track)
- if (keys2 && Array.isArray(keys2)) {
- track = keys2
- }
- }
-
var action = 'move'
binding.$repeat = value
var fragments = []
@@ -5504,7 +5524,7 @@ const _Anot = (function() {
var elem = this.element
var length = track.length
- var parent = elem.parentNode
+ var _parent = elem.parentNode
//检查新元素数量
var newCount = 0
@@ -5523,7 +5543,7 @@ const _Anot = (function() {
if (clear) {
while (kill !== start) {
- parent.removeChild(kill)
+ _parent.removeChild(kill)
kill = elem.previousSibling
}
}
@@ -5585,7 +5605,7 @@ const _Anot = (function() {
}
this.proxies = proxies
if (init && !binding.effectDriver) {
- parent.insertBefore(transation, elem)
+ _parent.insertBefore(transation, elem)
fragments.forEach(function(fragment) {
scanNodeArray(fragment.nodes || [], fragment.vmodels)
//if(fragment.vmodels.length > 2)
@@ -5617,7 +5637,7 @@ const _Anot = (function() {
staggerIndex = mayStaggerAnimate(
binding.effectEnterStagger,
function() {
- parent.insertBefore(
+ _parent.insertBefore(
fragment.content,
preElement.nextSibling
)
@@ -5637,7 +5657,7 @@ const _Anot = (function() {
function() {
var curNode = removeItem(proxy2.$anchor)
var inserted = Anot.slice(curNode.childNodes)
- parent.insertBefore(curNode, preElement.nextSibling)
+ _parent.insertBefore(curNode, preElement.nextSibling)
animateRepeat(inserted, 1, binding)
},
staggerIndex
@@ -5655,17 +5675,17 @@ const _Anot = (function() {
//repeat --> duplex
;(function(args) {
- parent.args = args
- if (parent.msRendered) {
+ _parent.args = args
+ if (_parent.msRendered) {
//第一次事件触发,以后直接调用
- parent.msRendered.apply(parent, args)
+ _parent.msRendered.apply(_parent, args)
}
})(kernel.newWatch ? arguments : [action])
var id = setTimeout(function() {
clearTimeout(id)
//触发上层的select回调及自己的rendered回调
- Anot.fireDom(parent, 'datasetchanged', {
- bubble: parent.msHasEvent
+ Anot.fireDom(_parent, 'datasetchanged', {
+ bubble: _parent.msHasEvent
})
})
this.enterCount -= 1
diff --git a/src/js/anot.shim.js b/src/js/anot.shim.js
index 3a44037..37030ed 100644
--- a/src/js/anot.shim.js
+++ b/src/js/anot.shim.js
@@ -240,15 +240,15 @@
if ($elem === DOC.body) {
scanTag($elem, [])
} else {
- var $parent = $elem
- while (($parent = $parent.parentNode)) {
- if ($parent.anotctrl) {
+ var _parent = $elem
+ while ((_parent = _parent.parentNode)) {
+ if (_parent.anotctrl) {
break
}
}
scanTag(
$elem.parentNode,
- $parent ? [VMODELS[$parent.anotctrl]] : []
+ _parent ? [VMODELS[_parent.anotctrl]] : []
)
}
}
@@ -1471,6 +1471,7 @@
function $emit(key, args) {
var event = this.$events
+ var _parent = null
if (event && event[key]) {
if (args) {
args[2] = key
@@ -1484,22 +1485,22 @@
} catch (e) {}
}
}
- var parent = this.$up
- if (parent) {
+ _parent = this.$up
+ if (_parent) {
if (this.$pathname) {
- $emit.call(parent, this.$pathname + '.' + key, args) //以确切的值往上冒泡
+ $emit.call(_parent, this.$pathname + '.' + key, args) //以确切的值往上冒泡
}
- $emit.call(parent, '*.' + key, args) //以模糊的值往上冒泡
+ $emit.call(_parent, '*.' + key, args) //以模糊的值往上冒泡
}
} else {
- parent = this.$up
+ _parent = this.$up
if (this.$ups) {
for (var i in this.$ups) {
$emit.call(this.$ups[i], i + '.' + key, args) //以确切的值往上冒泡
}
return
}
- if (parent) {
+ if (_parent) {
var p = this.$pathname
if (p === '') p = '*'
var path = p + '.' + key
@@ -1508,11 +1509,11 @@
args = (args && args.concat([path, key])) || [path, key]
if (arr.indexOf('*') === -1) {
- $emit.call(parent, path, args) //以确切的值往上冒泡
+ $emit.call(_parent, path, args) //以确切的值往上冒泡
arr[1] = '*'
- $emit.call(parent, arr.join('.'), args) //以模糊的值往上冒泡
+ $emit.call(_parent, arr.join('.'), args) //以模糊的值往上冒泡
} else {
- $emit.call(parent, path, args) //以确切的值往上冒泡
+ $emit.call(_parent, path, args) //以确切的值往上冒泡
}
}
}
@@ -1758,6 +1759,12 @@
var v = $vmodel.$children[i]
v.$fire && v.$fire.apply(v, [ee, a])
}
+ // component! 这是一个特殊的标识,可以直接修改子组件的state值
+ } else if (path.indexOf('component!') === 0) {
+ var ee = path.slice(10)
+ for (var i in $vmodel.$children) {
+ $vmodel.$children[i][ee] = a
+ }
} else {
$emit.call($vmodel, path, [a])
}
@@ -2773,9 +2780,9 @@
}
array.push(obj)
}
- var parent = node.parentNode
- if (parent && parent.nodeType === 1) {
- showHidden(parent, array)
+ var _parent = node.parentNode
+ if (_parent && _parent.nodeType === 1) {
+ showHidden(_parent, array)
}
}
}
@@ -3354,12 +3361,16 @@
var rnoCollect = /^(:\S+|data-\S+|on[a-z]+|id|style|class)$/
var ronattr = '__fn__'
+ var specifiedVars = [':disabled', ':loading']
function getOptionsFromTag(elem, vmodels) {
- var attributes = elem.attributes
+ var attributes = aslice.call(elem.attributes, 0)
var ret = {}
for (var i = 0, attr; (attr = attributes[i++]); ) {
var name = attr.name
- if (attr.specified && !rnoCollect.test(name)) {
+ if (
+ (attr.specified && !rnoCollect.test(name)) ||
+ specifiedVars.includes(name)
+ ) {
if (name.indexOf(ronattr) === 0) {
name = attr.value.slice(6)
ret[name] = elem[attr.value]
@@ -3379,6 +3390,7 @@
} else {
ret[camelizeName] = parseData(attr.value)
}
+ elem.removeAttribute(name)
}
}
}
@@ -3754,8 +3766,9 @@
arr.forEach(function(elem) {
var slot = elem.getAttribute('slot')
if (slot) {
+ obj[slot] = obj[slot] || []
elem.removeAttribute('slot')
- obj[slot] = elem.outerHTML
+ obj[slot].push(elem.outerHTML)
}
})
return obj
@@ -3786,6 +3799,8 @@
//如果还没有解析完,就延迟一下 #1155
return
}
+ var parentVm = host.vmodels[0]
+ var state = {}
var props = getOptionsFromTag(elem, host.vmodels)
var $id = props.uuid || generateID(widget)
var __willpush__ = null
@@ -3793,7 +3808,24 @@
if (props.hasOwnProperty('hostPush')) {
elem.removeAttribute('host-push')
__willpush__ = props.hostPush
- props.hostPush = host.vmodels[0][__willpush__]
+ props.hostPush = parentVm[__willpush__]
+ }
+
+ if (props.hasOwnProperty(':disabled')) {
+ var disabledKey = props[':disabled']
+ state.disabled = parentVm[disabledKey]
+ parentVm.$watch(disabledKey, function(val) {
+ parentVm.$fire('component!disabled', val)
+ })
+ delete props[':disabled']
+ }
+ if (props.hasOwnProperty(':loading')) {
+ var loadingKey = props[':loading']
+ state.loading = parentVm[loadingKey]
+ parentVm.$watch(loadingKey, function(val) {
+ parentVm.$fire('component!loading', val)
+ })
+ delete props[':loading']
}
delete props.uuid
@@ -3803,6 +3835,7 @@
hooks.state = hooks.state || {}
Object.assign(hooks.props, props)
+ Object.assign(hooks.state, state)
hooks.construct.call(elem, hooks.props, hooks.state)
@@ -3825,13 +3858,13 @@
var vmodel = Anot(hooks)
delete vmodel.$mounted
- host.vmodels[0].$children.push(vmodel)
+ parentVm.$children.push(vmodel)
elem.msResolved = 1 //防止二进扫描此元素
if (__willpush__) {
hideProperty(vmodel, '$push', function(val) {
- host.vmodels[0][__willpush__] = val
+ parentVm[__willpush__] = val
})
}
@@ -4003,12 +4036,12 @@
effectBinding(elem, binding)
binding.includeRendered = getBindingCallback(
elem,
- 'data-include-rendered',
+ 'data-rendered',
binding.vmodels
)
binding.includeLoaded = getBindingCallback(
elem,
- 'data-include-loaded',
+ 'data-loaded',
binding.vmodels
)
var outer = (binding.includeReplace = !!Anot(elem).data(
@@ -4072,10 +4105,10 @@
//chrome v37- 下embed标签动态设置的src,无法发起请求
if (window.chrome && elem.tagName === 'EMBED') {
- var parent = elem.parentNode
+ var _parent = elem.parentNode
var com = DOC.createComment(':src')
- parent.replaceChild(com, elem)
- parent.replaceChild(elem, com)
+ _parent.replaceChild(com, elem)
+ _parent.replaceChild(elem, com)
}
} else {
var k = i
@@ -4390,7 +4423,7 @@
var elem = binding.element
var vmodels = binding.vmodels
binding.changed =
- getBindingCallback(elem, 'data-duplex-changed', vmodels) || noop
+ getBindingCallback(elem, 'data-changed', vmodels) || noop
var params = []
var casting = oneObject('string,number,boolean,checked')
if (elem.type === 'radio' && binding.param === '') {
@@ -5010,12 +5043,12 @@
Anot.mix(Anot.effect, {
apply: applyEffect,
- append: function(el, parent, after, opts) {
+ append: function(el, _parent, after, opts) {
return applyEffect(
el,
1,
function() {
- parent.appendChild(el)
+ _parent.appendChild(el)
},
after,
opts
@@ -5032,12 +5065,12 @@
opts
)
},
- remove: function(el, parent, after, opts) {
+ remove: function(el, _parent, after, opts) {
return applyEffect(
el,
0,
function() {
- if (el.parentNode === parent) parent.removeChild(el)
+ if (el.parentNode === _parent) _parent.removeChild(el)
},
after,
opts
@@ -5050,15 +5083,15 @@
var binding = this
var elem = this.element
var isHtmlFilter = elem.nodeType !== 1
- var parent = isHtmlFilter ? elem.parentNode : elem
- if (!parent) return
+ var _parent = isHtmlFilter ? elem.parentNode : elem
+ if (!_parent) return
val = val == null ? '' : val
if (elem.nodeType === 3) {
var signature = generateID('html')
- parent.insertBefore(DOC.createComment(signature), elem)
+ _parent.insertBefore(DOC.createComment(signature), elem)
binding.element = DOC.createComment(signature + ':end')
- parent.replaceChild(binding.element, elem)
+ _parent.replaceChild(binding.element, elem)
elem = binding.element
}
if (typeof val !== 'object') {
@@ -5084,10 +5117,10 @@
if (!node || (node.nodeType === 8 && node.nodeValue === endValue)) {
break
} else {
- parent.removeChild(node)
+ _parent.removeChild(node)
}
}
- parent.insertBefore(fragment, elem)
+ _parent.insertBefore(fragment, elem)
} else {
Anot.clearHTML(elem).appendChild(fragment)
}
@@ -5445,14 +5478,9 @@
elem.removeAttribute(binding.name)
effectBinding(elem, binding)
binding.param = binding.param || 'el'
- binding.sortedCallback = getBindingCallback(
- elem,
- 'data-repeat-sortby',
- binding.vmodels
- )
var rendered = getBindingCallback(
elem,
- 'data-repeat-rendered',
+ 'data-rendered',
binding.vmodels
)
@@ -5463,18 +5491,18 @@
binding.start = start
binding.template = anotFragment.cloneNode(false)
- var parent = elem.parentNode
- parent.replaceChild(end, elem)
- parent.insertBefore(start, end)
+ var _parent = elem.parentNode
+ _parent.replaceChild(end, elem)
+ _parent.insertBefore(start, end)
binding.template.appendChild(elem)
binding.element = end
if (rendered) {
- var removeFn = Anot.bind(parent, 'datasetchanged', function() {
- rendered.apply(parent, parent.args)
- Anot.unbind(parent, 'datasetchanged', removeFn)
- parent.msRendered = rendered
+ var removeFn = Anot.bind(_parent, 'datasetchanged', function() {
+ rendered.apply(_parent, _parent.args)
+ Anot.unbind(_parent, 'datasetchanged', removeFn)
+ _parent.msRendered = rendered
})
}
}
@@ -5501,14 +5529,6 @@
}
}
var track = this.track
- if (binding.sortedCallback) {
- //如果有回调,则让它们排序
- var keys2 = binding.sortedCallback.call(parent, track)
- if (keys2 && Array.isArray(keys2)) {
- track = keys2
- }
- }
-
var action = 'move'
binding.$repeat = value
var fragments = []
@@ -5519,7 +5539,7 @@
var elem = this.element
var length = track.length
- var parent = elem.parentNode
+ var _parent = elem.parentNode
//检查新元素数量
var newCount = 0
@@ -5538,7 +5558,7 @@
if (clear) {
while (kill !== start) {
- parent.removeChild(kill)
+ _parent.removeChild(kill)
kill = elem.previousSibling
}
}
@@ -5600,7 +5620,7 @@
}
this.proxies = proxies
if (init && !binding.effectDriver) {
- parent.insertBefore(transation, elem)
+ _parent.insertBefore(transation, elem)
fragments.forEach(function(fragment) {
scanNodeArray(fragment.nodes || [], fragment.vmodels)
//if(fragment.vmodels.length > 2)
@@ -5632,7 +5652,7 @@
staggerIndex = mayStaggerAnimate(
binding.effectEnterStagger,
function() {
- parent.insertBefore(
+ _parent.insertBefore(
fragment.content,
preElement.nextSibling
)
@@ -5652,7 +5672,7 @@
function() {
var curNode = removeItem(proxy2.$anchor)
var inserted = Anot.slice(curNode.childNodes)
- parent.insertBefore(curNode, preElement.nextSibling)
+ _parent.insertBefore(curNode, preElement.nextSibling)
animateRepeat(inserted, 1, binding)
},
staggerIndex
@@ -5670,17 +5690,17 @@
//repeat --> duplex
;(function(args) {
- parent.args = args
- if (parent.msRendered) {
+ _parent.args = args
+ if (_parent.msRendered) {
//第一次事件触发,以后直接调用
- parent.msRendered.apply(parent, args)
+ _parent.msRendered.apply(_parent, args)
}
})(kernel.newWatch ? arguments : [action])
var id = setTimeout(function() {
clearTimeout(id)
//触发上层的select回调及自己的rendered回调
- Anot.fireDom(parent, 'datasetchanged', {
- bubble: parent.msHasEvent
+ Anot.fireDom(_parent, 'datasetchanged', {
+ bubble: _parent.msHasEvent
})
})
this.enterCount -= 1
diff --git a/src/js/form/index.js b/src/js/form/index.js
new file mode 100644
index 0000000..1465262
--- /dev/null
+++ b/src/js/form/index.js
@@ -0,0 +1,50 @@
+/**
+ * 各种表单元素组件
+ * @authors yutent (yutent@doui.cc)
+ * @date 2018-06-12 13:08:41
+ * @version $Id$
+ */
+
+import './style.scss'
+const log = console.log
+
+export default Anot.component('button', {
+ construct(props, state) {
+ log(props)
+ state.text = this.textContent
+ state.style = { 'border-radius': props.radius }
+ this.classList.add('do-fn-noselect')
+ this.classList.add('do-button')
+ this.setAttribute(':click', 'onClick')
+ },
+ render() {
+ let icon = ''
+ if (this.props.icon) {
+ icon = ``
+ }
+ return `${icon}`
+ },
+ state: {
+ state: '',
+ disabled: false,
+ foo: true,
+ style: {}
+ },
+ props: {
+ click: Anot.PropsTypes.isFunction()
+ },
+ skip: ['style'],
+ componentDidMount() {
+ Anot(this.$elem).css(this.style)
+ },
+ watch: {},
+ methods: {
+ onClick() {
+ // log(this)
+ if (this.disabled) {
+ return
+ }
+ log('hello world, button')
+ }
+ }
+})
diff --git a/src/js/form/style.scss b/src/js/form/style.scss
new file mode 100644
index 0000000..ab392d7
--- /dev/null
+++ b/src/js/form/style.scss
@@ -0,0 +1,22 @@
+@charset "UTF-8";
+/**
+ *
+ * @authors yutent (yutent@doui.cc)
+ * @date 2018-06-12 13:08:26
+ * @version $Id$
+ */
+
+@import "var.scss";
+
+
+.do-button {overflow:hidden;position:relative;display:inline-block;width:auto;min-width:60px;height:30px;margin-left:5px;padding:0 10px;color:nth($ct, 1);text-align:center;cursor:pointer;
+
+ &::before {position:absolute;left:-50%;top:-50%;display:block;width:200%;height:200%;border-radius:50%;background:nth($cp, 2); content:"";opacity:0;transform: scale(0, .0); transition:opacity 1.3s cubic-bezier(0.23, 1, 0.32, 1),transform 1.3s cubic-bezier(0.23, 1, 0.32, 1);}
+
+ &:hover {
+ &::before {opacity:1;transform:scale(1, .8);}
+ }
+ &:active {background:nth($cp, 1)}
+
+ &__text,&__icon {position:relative;display:inline-block;}
+}
\ No newline at end of file
diff --git a/src/js/router/index.js b/src/js/router/index.js
index dcdf350..af20c8f 100644
--- a/src/js/router/index.js
+++ b/src/js/router/index.js
@@ -7,7 +7,7 @@
'use strict'
//储存版本信息
-Anot.ui.router = '0.0.1'
+Anot.ui.router = '1.0.0'
//判定A标签的target属性是否指向自身
//thanks https://github.com/quirkey/sammy/blob/master/lib/sammy.js#L219
@@ -233,21 +233,13 @@ Anot.component('link', {
delete props.to
},
render() {
- return ''
+ return ''
},
state: {
link: ''
},
props: {
- label: '',
- click: Anot.PropsTypes.isFunction()
- },
- methods: {
- onClick() {
- if (typeof this.props.click === 'function') {
- this.props.click()
- }
- }
+ label: ''
}
})