diff --git a/ajax.js b/ajax.js new file mode 100644 index 0000000..2bf5713 --- /dev/null +++ b/ajax.js @@ -0,0 +1,54 @@ +; +(function(factory) { + if (typeof module === 'object' && typeof module.exports == 'object') { + module.exports = factory( + require('vue'), require('jquery') + ); + } else { + factory(window.Vue, window.Jquery); + } +})(function(Vue, $) { + Vue.prototype.ajax = function() { + var _url=arguments[0],_success=arguments[3],_error=arguments[4]; + var _type='GET'; + var _data={}; + if(typeof arguments[1]=='string'){ + _type=arguments[1]; + } + else if(typeof arguments[1]=='object'){ + _data=arguments[1]; + } + else if(typeof arguments[1]=='function'){ + _success=arguments[1]; + _error=arguments[2]; + } + if(typeof arguments[2]=='object'){ + _data=arguments[2]; + } + else if(arguments[1]!='function'){ + _success=arguments[2]; + _error=arguments[3]; + } + + $.ajax({ + url: _url, + dataType: "json", + type: _type, + data: _data, + success: function(data) { + if (data.success) { + _success && _success(data); + } else { + _error && _error(data.error!=undefined?data.error:'未知错误'); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + if (XMLHttpRequest.status == 401) { + location.href = $('#major-layout-login').val(); + } else { + _error && _error(errorThrown); + } + } + }); + } +}); \ No newline at end of file diff --git a/ajaxServer.js b/ajaxServer.js new file mode 100644 index 0000000..1c6ed52 --- /dev/null +++ b/ajaxServer.js @@ -0,0 +1,33 @@ +; +(function(factory) { + if (typeof module === 'object' && typeof module.exports == 'object') { + module.exports = factory( + require('vue'), require('jquery') + ); + } else { + factory(window.Vue, window.Jquery); + } +})(function(Vue, $) { + Vue.prototype.ajaxServer = function(url, type, data, success, error) { + $.ajax({ + url: url, + dataType: "json", + type: type, + data: data, + success: function(data) { + if (data.success) { + success && success(data); + } else { + error && error(data.error); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + if (XMLHttpRequest.status == 401) { + location.href = $('#major-layout-login').val(); + } else { + error && error(errorThrown); + } + } + }); + } +}); diff --git a/autoinput.css b/autoinput.css new file mode 100644 index 0000000..4670c86 --- /dev/null +++ b/autoinput.css @@ -0,0 +1,71 @@ +.lg-autoinput{ + display: inline-block; + position: relative; + input{ + padding-left: 20px; + padding-right: 20px; + } + i:first-child:before{ + content: '\e60a'; + color: #e1e1e1; + font-family: "iconfont" !important; + position: absolute; + top: 7px; + left: 3px; + font-size: 14px; + } + .c:before{ + content: '\e65e'; + color: #e1e1e1; + font-family: "iconfont" !important; + position: absolute; + top: 7px; + right: 10px; + font-size: 14px; + cursor: pointer; + } + + ul{ + position: absolute; + z-index: 1000; + top:25px; + padding-top:3px; + padding-bottom:2px; + border:1px solid #5986e1; + border-top:none; + border-radius: 3px; + margin-right: 5px; + background-color: white; + box-sizing:border-box; + max-height: 150px; + overflow-y:auto; + li{ + height: 24px; + line-height: 24px; + cursor: pointer; + padding: 0 5px 0 20px; + + font-size: 12px; + &:hover{ + background-color:#5986e1; + color: white; + a{ + color: white; + } + } + a{ + color: #666; + display: inline-block; + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow:ellipsis; + &:hover{ + background-color:#5986e1; + color: white; + } + } + } + } + +} diff --git a/autoinput.js b/autoinput.js new file mode 100644 index 0000000..83c71df --- /dev/null +++ b/autoinput.js @@ -0,0 +1,64 @@ +; +(function(factory) { + if (typeof module === 'object' && typeof module.exports == 'object') { + module.exports = factory( + require('vue') + ); + } else { + factory(window.Vue); + } +})(function(Vue) { + var autoinput={}; + autoinput.install = function(Vue) { + Vue.component('autoinput',{ + delimiters: ['${', '}'], + props: ['data', 'width','placeholder','update','select','clear','value'], + template: '
', + methods: { + check: function(obj) {//li select + this.selected=obj.text; + this.select&&this.select(obj); + this.show=false; + }, + focus:function (argument) {//input focus + this.show=true; + }, + keyup:function (event) {//input keyup + this.update&&this.update(this.selected,this.list); + }, + blur:function (event) {//input blur + var _this=this; + if(this.over){ + _this.show=false; + } + }, + clean:function (argument) {//clean input + this.selected=''; + this.show=false; + this.list=[]; + this.clear&&this.clear(); + }, + enter:function (argument) {//hover ul + this.over=false; + }, + leave:function (argument) {//leave ul + this.over=true; + } + }, + data:function (argument) { + return { + selected:this.value?this.value:'', + show:false, + visible:false, + over:true + } + }, + watch:{ + value:function(vNew,vOld){ + this.selected=vNew; + } + } + }) + } + Vue.use(autoinput); +}); diff --git a/checkbox-group.js b/checkbox-group.js new file mode 100644 index 0000000..a13d97d --- /dev/null +++ b/checkbox-group.js @@ -0,0 +1,54 @@ +; +(function(factory) { + if (typeof module === 'object' && typeof module.exports == 'object') { + module.exports = factory( + require('vue') + ); + } else { + factory(window.Vue); + } +})(function(Vue) { + var checkboxGroup = {}; + checkboxGroup.install = function(Vue) { + Vue.component('checkbox-group', { + delimiters: ['${', '}'], + props: ['data', 'model', 'className','index'], + template: '', + methods: { + check: function() { + this.$emit('input',this.selected.join(',')); + }, + name:function(name,index){ + if(index!=undefined){ + return name+index; + } + return name; + }, + id:function(id,index){ + if(index!=undefined){ + return id+index; + } + return id; + } + }, + data:function(){ + return { + selected:getVal(this.model) + } + }, + watch:{ + model:function(val){ + this.selected=getVal(val); + } + } + }) + } + function getVal(value){ + var result=[]; + if(value&&value!=''){ + result=value.split(','); + } + return result + } + Vue.use(checkboxGroup); +}); diff --git a/legoland.css b/legoland.css new file mode 100644 index 0000000..27e99fb --- /dev/null +++ b/legoland.css @@ -0,0 +1,2510 @@ +/* ------- color -------*/ +/*蓝1*/ +/*深蓝*/ +/*橙*/ +/*红*/ +/*绿*/ +/*紫*/ +/*深灰*/ +/*灰*/ +/*浅灰*/ +/*灰*/ +/*灰黄*/ +/*浅灰黄*/ +/* ------- font -------*/ +/* ------- grid -------*/ +/* ------- structure -------*/ +/* 导航高度 */ +/* 菜单宽度 */ +/* 导航文字颜色 */ +/* base 公共基础 */ +html, +body { + margin: 0; + height: 100%; + font-family: Arial, "Microsoft Yahei", "Helvetica Neue", "Hiragino Sans GB", sans-serif; + overflow-x: hidden; + color: #666; +} +iframe { + width: 100%; + height: 100%; + border: none; + color: white; +} +a { + box-sizing: border-box; + text-decoration: none !important; + color: #5986e1; + cursor: pointer; +} +ul { + margin: 0; + padding: 0; + list-style: none; +} +p { + margin: 0; +} +label, +span { + color: #666; + font-size: 12px; +} +@font-face { + font-family: "iconfont"; + src: url('iconfont.eot?t=1477549960'); + /* IE9*/ + src: url('iconfont.eot?t=1477549960#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('iconfont.woff?t=1477549960') format('woff'), /* chrome, firefox */ url('iconfont.ttf?t=1477549960') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ url('iconfont.svg?t=1477549960#iconfont') format('svg'); + /* iOS 4.1- */ +} +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -webkit-text-stroke-width: 0.2px; + -moz-osx-font-smoothing: grayscale; +} +.icon-sousuo:before { + content: "\e60a"; +} +.icon-yonghu:before { + content: "\e60b"; +} +.icon-roundadd:before { + content: "\e670"; +} +.icon-roundaddfill:before { + content: "\e66f"; +} +.icon-jinzhi:before { + content: "\e639"; +} +.icon-zhengque:before { + content: "\e637"; +} +.icon-cuowu:before { + content: "\e638"; +} +.icon-xiasanjiao:before { + content: "\e644"; +} +.icon-shangsanjiao:before { + content: "\e645"; +} +.icon-zuosanjiao:before { + content: "\e646"; +} +.icon-yousanjiao:before { + content: "\e648"; +} +.icon-upfn:before { + content: "\e62c"; +} +.icon-arrow-up-o:before { + content: "\e641"; +} +.icon-arrow-down-o:before { + content: "\e642"; +} +.icon-jiantou:before { + content: "\e62f"; +} +.icon-check:before { + content: "\e65d"; +} +.icon-close:before { + content: "\e65e"; +} +.icon-roundcheckfill:before { + content: "\e65f"; +} +.icon-roundcheck:before { + content: "\e660"; +} +.icon-roundclosefill:before { + content: "\e661"; +} +.icon-roundrightfill:before { + content: "\e662"; +} +.icon-roundright:before { + content: "\e663"; +} +.icon-back:before { + content: "\e667"; +} +.icon-right:before { + content: "\e66a"; +} +.icon-up_sm_ic:before { + content: "\e63f"; +} +.icon-down_sm_ic:before { + content: "\e633"; +} +.icon-yiwen:before { + content: "\e658"; +} +.icon-chucuo:before { + content: "\e659"; +} +.icon-squarecheckfill:before { + content: "\e66c"; +} +.icon-square:before { + content: "\e66d"; +} +.icon-squarecheck:before { + content: "\e66e"; +} +.icon-edit:before { + content: "\e600"; +} +.lg-color-main { + color: #5986e1 !important; +} +.lg-color-main-bg { + background-color: #5986e1; +} +.lg-color-highlight { + color: #ff8447 !important; +} +.lg-color-highlight-bg { + background-color: #ff8447; +} +.lg-color-danger { + color: #d05538 !important; +} +.lg-color-danger-bg { + background-color: #d05538; +} +.lg-color-success { + color: #8bb455 !important; +} +.lg-color-success-bg { + background-color: #8bb455; +} +.lg-color-plain { + color: #e1e1e1 !important; +} +.lg-color-plain-bg { + background-color: #e1e1e1; +} +.lg-color-sys { + color: #464e78 !important; +} +.lg-color-sys-bg { + background-color: #464e78; +} +.lg-color-title { + color: #333; +} +.lg-color-title-bg { + background-color: #333; +} +.lg-color-text { + color: #666; +} +.lg-color-text-bg { + background-color: #666; +} +.lg-color-subtext { + color: #999; +} +.lg-color-subtext-bg { + background-color: #999; +} +.lg-color-border { + color: #e1e1e1; + border: 1px solid #e1e1e1; +} +.lg-color-border-bg { + background-color: #e1e1e1; +} +.lg-color-bg { + background-color: #ededed; +} +.lg-fn-hide, +.hide { + display: none; +} +.lg-fn-show, +.show { + display: block; +} +.lg-fn-invisible, +.invisible { + visibility: hidden; +} +.lg-fn-right, +.right { + float: right; +} +.lg-fn-left, +.left { + float: left; +} +.lg-fn-clear:before, +.clear:before, +.lg-fn-clear:after, +.clear:after { + content: " "; + display: table; +} +.lg-fn-clear:after, +.clear:after { + clear: both; +} +.lg-blank-10 { + display: block; + width: 100%; + height: 10px; +} +.lg-blank-20 { + display: block; + width: 100%; + height: 20px; +} +.lg-blank-50 { + display: block; + width: 100%; + height: 50px; +} +.lg-nowrap { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.lg-error-border { + border: 1px solid #d05538 !important; +} +.lg-error-msg { + color: #d05538 !important; + font-size: 12px; +} +/* grid 栅格 */ +.lg-grid-container { + padding: 15px; + margin-top: -15px; + margin-bottom: -15px; +} +.lg-grid-row { + margin-left: -15px; + margin-right: -15px; + margin-top: 15px; + margin-bottom: 15px; +} +.lg-grid-row:before, +.lg-grid-row:after { + content: ' '; + display: table; + clear: both; +} +.lg-grid-1 { + position: relative; + box-sizing: border-box; + float: left; + padding: 0 15px; + min-height: 22px; + width: 8.33333333%; +} +.lg-grid-offset-1 { + margin-left: 8.33333333%; +} +.lg-grid-2 { + position: relative; + box-sizing: border-box; + float: left; + padding: 0 15px; + min-height: 22px; + width: 16.66666667%; +} +.lg-grid-offset-2 { + margin-left: 16.66666667%; +} +.lg-grid-3 { + position: relative; + box-sizing: border-box; + float: left; + padding: 0 15px; + min-height: 22px; + width: 25%; +} +.lg-grid-offset-3 { + margin-left: 25%; +} +.lg-grid-4 { + position: relative; + box-sizing: border-box; + float: left; + padding: 0 15px; + min-height: 22px; + width: 33.33333333%; +} +.lg-grid-offset-4 { + margin-left: 33.33333333%; +} +.lg-grid-5 { + position: relative; + box-sizing: border-box; + float: left; + padding: 0 15px; + min-height: 22px; + width: 41.66666667%; +} +.lg-grid-offset-5 { + margin-left: 41.66666667%; +} +.lg-grid-6 { + position: relative; + box-sizing: border-box; + float: left; + padding: 0 15px; + min-height: 22px; + width: 50%; +} +.lg-grid-offset-6 { + margin-left: 50%; +} +.lg-grid-7 { + position: relative; + box-sizing: border-box; + float: left; + padding: 0 15px; + min-height: 22px; + width: 58.33333333%; +} +.lg-grid-offset-7 { + margin-left: 58.33333333%; +} +.lg-grid-8 { + position: relative; + box-sizing: border-box; + float: left; + padding: 0 15px; + min-height: 22px; + width: 66.66666667%; +} +.lg-grid-offset-8 { + margin-left: 66.66666667%; +} +.lg-grid-9 { + position: relative; + box-sizing: border-box; + float: left; + padding: 0 15px; + min-height: 22px; + width: 75%; +} +.lg-grid-offset-9 { + margin-left: 75%; +} +.lg-grid-10 { + position: relative; + box-sizing: border-box; + float: left; + padding: 0 15px; + min-height: 22px; + width: 83.33333333%; +} +.lg-grid-offset-10 { + margin-left: 83.33333333%; +} +.lg-grid-11 { + position: relative; + box-sizing: border-box; + float: left; + padding: 0 15px; + min-height: 22px; + width: 91.66666667%; +} +.lg-grid-offset-11 { + margin-left: 91.66666667%; +} +.lg-grid-12 { + position: relative; + box-sizing: border-box; + float: left; + padding: 0 15px; + min-height: 22px; + width: 100%; +} +.lg-grid-offset-12 { + margin-left: 100%; +} +.lg-grid-blank { + display: block; + height: 10px; +} +.lg-title, +.lg-title-m, +.lg-title-r { + font-size: 16px; + line-height: 40px; + color: #333; + display: inline; + margin-right: 30px; +} +.lg-text { + font-size: 14px; + line-height: 22px; + color: #666; +} +.lg-subtext { + font-size: 12px; + line-height: 18px; + color: #999; +} +/* 未整理 */ +.lg-title-m { + text-align: center; + display: block; +} +.lg-title-r { + text-align: right; +} +.lg-text-s { + font-size: 14px; + line-height: 18px; + color: #999; +} +.lg-btn, +.lg-btn-large, +.lg-btn-small, +.lg-btn-o, +.lg-btn-o-large, +.lg-btn-o-small, +.lg-btn-o, +.lg-btn-small-o, +.lg-btn-large-o, +.lg-btn-main, +.lg-btn-o-main, +.lg-btn-danger, +.lg-btn-o-danger, +.lg-btn-success, +.lg-btn-o-success, +.lg-btn-sys, +.lg-btn-o-sys, +.lg-btn-plain, +.lg-btn-o-plain, +.lg-btn-highlight, +.lg-btn-o-highlight, +.lg-btn-large-main, +.lg-btn-large-o-main, +.lg-btn-large-danger, +.lg-btn-large-o-danger, +.lg-btn-large-success, +.lg-btn-large-o-success, +.lg-btn-large-sys, +.lg-btn-large-o-sys, +.lg-btn-large-plain, +.lg-btn-large-o-plain, +.lg-btn-large-highlight, +.lg-btn-large-o-highlight, +.lg-btn-small-main, +.lg-btn-small-o-main, +.lg-btn-small-danger, +.lg-btn-small-o-danger, +.lg-btn-small-success, +.lg-btn-small-o-success, +.lg-btn-small-sys, +.lg-btn-small-o-sys, +.lg-btn-small-plain, +.lg-btn-small-o-plain, +.lg-btn-small-highlight, +.lg-btn-small-o-highlight { + display: inline-block; + text-align: center; + vertical-align: middle; + margin: 5px; + padding: 6px 12px; + font-size: 12px; + font-family: Arial, "Microsoft Yahei", "Helvetica Neue", "Hiragino Sans GB", sans-serif; + height: 30px; + min-width: 100px; + line-height: 14px; + cursor: pointer; + outline: none; + border: 1px solid #5986e1; + border-radius: 3px; + color: white; + background-color: #5986e1; + -webkit-text-stroke-width: 0; +} +.lg-btn:last-child, +.lg-btn-large:last-child, +.lg-btn-small:last-child, +.lg-btn-o:last-child, +.lg-btn-o-large:last-child, +.lg-btn-o-small:last-child { + margin-right: 0; +} +.lg-btn:before, +.lg-btn-large:before, +.lg-btn-small:before, +.lg-btn-o:before, +.lg-btn-o-large:before, +.lg-btn-o-small:before { + margin-right: 3px; + margin-left: 2px; + font-size: 14px; +} +.lg-btn:hover, +.lg-btn-large:hover, +.lg-btn-small:hover, +.lg-btn-o:hover, +.lg-btn-o-large:hover, +.lg-btn-o-small:hover { + background-color: #2e67d9; + border-color: #2e67d9; + color: white; +} +.lg-btn .iconfont, +.lg-btn-large .iconfont, +.lg-btn-small .iconfont, +.lg-btn-o .iconfont, +.lg-btn-o-large .iconfont, +.lg-btn-o-small .iconfont { + font-size: 14px; + margin-right: 5px; +} +.lg-btn-large, +.lg-btn-large-o, +.lg-btn-large-main, +.lg-btn-large-o-main, +.lg-btn-large-danger, +.lg-btn-large-o-danger, +.lg-btn-large-success, +.lg-btn-large-o-success, +.lg-btn-large-sys, +.lg-btn-large-o-sys, +.lg-btn-large-plain, +.lg-btn-large-o-plain, +.lg-btn-large-highlight, +.lg-btn-large-o-highlight { + font-size: 20px; + line-height: 24px; + height: 40px; + min-width: 176px; +} +.lg-btn-large:before { + font-size: 20px; +} +.lg-btn-large .iconfont { + font-size: 20px; +} +.lg-btn-small, +.lg-btn-small-o, +.lg-btn-small-main, +.lg-btn-small-o-main, +.lg-btn-small-danger, +.lg-btn-small-o-danger, +.lg-btn-small-success, +.lg-btn-small-o-success, +.lg-btn-small-sys, +.lg-btn-small-o-sys, +.lg-btn-small-plain, +.lg-btn-small-o-plain, +.lg-btn-small-highlight, +.lg-btn-small-o-highlight { + height: 24px; + line-height: 14px; + font-size: 12px; + padding-top: 4px; + padding-bottom: 4px; + min-width: 66px; +} +.lg-btn-small:before { + font-size: 12px; +} +.lg-btn-small .iconfont { + font-size: 12px; +} +/* o */ +.lg-btn-o { + color: #5986e1; + border: 1px solid #5986e1; + background-color: white !important; +} +.lg-btn-o:hover { + color: #2e67d9; + border: 1px solid #2e67d9; +} +.lg-btn-o:last-child { + margin-right: 0; +} +.lg-btn-o:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-small-o { + color: #5986e1; + border: 1px solid #5986e1; + background-color: white !important; +} +.lg-btn-small-o:hover { + color: #2e67d9; + border: 1px solid #2e67d9; +} +.lg-btn-small-o:last-child { + margin-right: 0; +} +.lg-btn-small-o:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-large-o { + color: #5986e1; + border: 1px solid #5986e1; + background-color: white !important; +} +.lg-btn-large-o:hover { + color: #2e67d9; + border: 1px solid #2e67d9; +} +.lg-btn-large-o:last-child { + margin-right: 0; +} +.lg-btn-large-o:before { + margin-right: 5px; + font-size: 14px; +} +/* color */ +.lg-btn.lg-color-main { + background-color: #5986e1; + border-color: #5986e1; +} +.lg-btn.lg-color-main:hover { + color: white; + background-color: #2e67d9; + border-color: #2e67d9; +} +.lg-btn-o.lg-color-main, +.lg-btn-o.lg-btn-main { + background-color: white; + border-color: #5986e1; + color: #5986e1; +} +.lg-btn-o.lg-color-main:hover, +.lg-btn-o.lg-btn-main:hover { + background-color: white; + color: #2e67d9 !important; + border-color: #2e67d9; +} +.lg-btn-main { + background-color: #5986e1; + border-color: #5986e1; +} +.lg-btn-main:hover { + color: white; + background-color: #2e67d9; + border-color: #2e67d9; +} +.lg-btn-o-main { + background-color: white; + border-color: #5986e1; + color: #5986e1; +} +.lg-btn-o-main:hover { + background-color: white; + color: #2e67d9; + border-color: #2e67d9; +} +.lg-btn-o-main:last-child { + margin-right: 0; +} +.lg-btn-o-main:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn.lg-color-danger { + background-color: #d05538; + border-color: #d05538; +} +.lg-btn.lg-color-danger:hover { + color: white; + background-color: #ac4229; + border-color: #ac4229; +} +.lg-btn-o.lg-color-danger, +.lg-btn-o.lg-btn-danger { + background-color: white; + border-color: #d05538; + color: #d05538; +} +.lg-btn-o.lg-color-danger:hover, +.lg-btn-o.lg-btn-danger:hover { + background-color: white; + color: #ac4229 !important; + border-color: #ac4229; +} +.lg-btn-danger { + background-color: #d05538; + border-color: #d05538; +} +.lg-btn-danger:hover { + color: white; + background-color: #ac4229; + border-color: #ac4229; +} +.lg-btn-o-danger { + background-color: white; + border-color: #d05538; + color: #d05538; +} +.lg-btn-o-danger:hover { + background-color: white; + color: #ac4229; + border-color: #ac4229; +} +.lg-btn-o-danger:last-child { + margin-right: 0; +} +.lg-btn-o-danger:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn.lg-color-success { + background-color: #8bb455; + border-color: #8bb455; +} +.lg-btn.lg-color-success:hover { + color: white; + background-color: #719442; + border-color: #719442; +} +.lg-btn-o.lg-color-success, +.lg-btn-o.lg-btn-success { + background-color: white; + border-color: #8bb455; + color: #8bb455; +} +.lg-btn-o.lg-color-success:hover, +.lg-btn-o.lg-btn-success:hover { + background-color: white; + color: #719442 !important; + border-color: #719442; +} +.lg-btn-success { + background-color: #8bb455; + border-color: #8bb455; +} +.lg-btn-success:hover { + color: white; + background-color: #719442; + border-color: #719442; +} +.lg-btn-o-success { + background-color: white; + border-color: #8bb455; + color: #8bb455; +} +.lg-btn-o-success:hover { + background-color: white; + color: #719442; + border-color: #719442; +} +.lg-btn-o-success:last-child { + margin-right: 0; +} +.lg-btn-o-success:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn.lg-color-sys { + background-color: #464e78; + border-color: #464e78; +} +.lg-btn.lg-color-sys:hover { + color: white; + background-color: #333958; + border-color: #333958; +} +.lg-btn-o.lg-color-sys, +.lg-btn-o.lg-btn-sys { + background-color: white; + border-color: #464e78; + color: #464e78; +} +.lg-btn-o.lg-color-sys:hover, +.lg-btn-o.lg-btn-sys:hover { + background-color: white; + color: #333958 !important; + border-color: #333958; +} +.lg-btn-sys { + background-color: #464e78; + border-color: #464e78; +} +.lg-btn-sys:hover { + color: white; + background-color: #333958; + border-color: #333958; +} +.lg-btn-o-sys { + background-color: white; + border-color: #464e78; + color: #464e78; +} +.lg-btn-o-sys:hover { + background-color: white; + color: #333958; + border-color: #333958; +} +.lg-btn-o-sys:last-child { + margin-right: 0; +} +.lg-btn-o-sys:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn.lg-color-plain { + background-color: #e1e1e1; + border-color: #e1e1e1; +} +.lg-btn.lg-color-plain:hover { + color: white; + background-color: #c8c8c8; + border-color: #c8c8c8; +} +.lg-btn-o.lg-color-plain, +.lg-btn-o.lg-btn-plain { + background-color: white; + border-color: #e1e1e1; + color: #e1e1e1; +} +.lg-btn-o.lg-color-plain:hover, +.lg-btn-o.lg-btn-plain:hover { + background-color: white; + color: #c8c8c8 !important; + border-color: #c8c8c8; +} +.lg-btn-plain { + background-color: #e1e1e1; + border-color: #e1e1e1; +} +.lg-btn-plain:hover { + color: white; + background-color: #c8c8c8; + border-color: #c8c8c8; +} +.lg-btn-o-plain { + background-color: white; + border-color: #e1e1e1; + color: #e1e1e1; +} +.lg-btn-o-plain:hover { + background-color: white; + color: #c8c8c8; + border-color: #c8c8c8; +} +.lg-btn-o-plain:last-child { + margin-right: 0; +} +.lg-btn-o-plain:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn.lg-color-highlight { + background-color: #ff8447; + border-color: #ff8447; +} +.lg-btn.lg-color-highlight:hover { + color: white; + background-color: #ff6214; + border-color: #ff6214; +} +.lg-btn-o.lg-color-highlight, +.lg-btn-o.lg-btn-highlight { + background-color: white; + border-color: #ff8447; + color: #ff8447; +} +.lg-btn-o.lg-color-highlight:hover, +.lg-btn-o.lg-btn-highlight:hover { + background-color: white; + color: #ff6214 !important; + border-color: #ff6214; +} +.lg-btn-highlight { + background-color: #ff8447; + border-color: #ff8447; +} +.lg-btn-highlight:hover { + color: white; + background-color: #ff6214; + border-color: #ff6214; +} +.lg-btn-o-highlight { + background-color: white; + border-color: #ff8447; + color: #ff8447; +} +.lg-btn-o-highlight:hover { + background-color: white; + color: #ff6214; + border-color: #ff6214; +} +.lg-btn-o-highlight:last-child { + margin-right: 0; +} +.lg-btn-o-highlight:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-large.lg-color-main { + background-color: #5986e1; + border-color: #5986e1; +} +.lg-btn-large.lg-color-main:hover { + color: white; + background-color: #2e67d9; + border-color: #2e67d9; +} +.lg-btn-large-o.lg-color-main, +.lg-btn-large-o.lg-btn-large-main { + background-color: white; + border-color: #5986e1; + color: #5986e1; +} +.lg-btn-large-o.lg-color-main:hover, +.lg-btn-large-o.lg-btn-large-main:hover { + background-color: white; + color: #2e67d9 !important; + border-color: #2e67d9; +} +.lg-btn-large-main { + background-color: #5986e1; + border-color: #5986e1; +} +.lg-btn-large-main:hover { + color: white; + background-color: #2e67d9; + border-color: #2e67d9; +} +.lg-btn-large-o-main { + background-color: white; + border-color: #5986e1; + color: #5986e1; +} +.lg-btn-large-o-main:hover { + background-color: white; + color: #2e67d9; + border-color: #2e67d9; +} +.lg-btn-large-o-main:last-child { + margin-right: 0; +} +.lg-btn-large-o-main:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-large.lg-color-danger { + background-color: #d05538; + border-color: #d05538; +} +.lg-btn-large.lg-color-danger:hover { + color: white; + background-color: #ac4229; + border-color: #ac4229; +} +.lg-btn-large-o.lg-color-danger, +.lg-btn-large-o.lg-btn-large-danger { + background-color: white; + border-color: #d05538; + color: #d05538; +} +.lg-btn-large-o.lg-color-danger:hover, +.lg-btn-large-o.lg-btn-large-danger:hover { + background-color: white; + color: #ac4229 !important; + border-color: #ac4229; +} +.lg-btn-large-danger { + background-color: #d05538; + border-color: #d05538; +} +.lg-btn-large-danger:hover { + color: white; + background-color: #ac4229; + border-color: #ac4229; +} +.lg-btn-large-o-danger { + background-color: white; + border-color: #d05538; + color: #d05538; +} +.lg-btn-large-o-danger:hover { + background-color: white; + color: #ac4229; + border-color: #ac4229; +} +.lg-btn-large-o-danger:last-child { + margin-right: 0; +} +.lg-btn-large-o-danger:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-large.lg-color-success { + background-color: #8bb455; + border-color: #8bb455; +} +.lg-btn-large.lg-color-success:hover { + color: white; + background-color: #719442; + border-color: #719442; +} +.lg-btn-large-o.lg-color-success, +.lg-btn-large-o.lg-btn-large-success { + background-color: white; + border-color: #8bb455; + color: #8bb455; +} +.lg-btn-large-o.lg-color-success:hover, +.lg-btn-large-o.lg-btn-large-success:hover { + background-color: white; + color: #719442 !important; + border-color: #719442; +} +.lg-btn-large-success { + background-color: #8bb455; + border-color: #8bb455; +} +.lg-btn-large-success:hover { + color: white; + background-color: #719442; + border-color: #719442; +} +.lg-btn-large-o-success { + background-color: white; + border-color: #8bb455; + color: #8bb455; +} +.lg-btn-large-o-success:hover { + background-color: white; + color: #719442; + border-color: #719442; +} +.lg-btn-large-o-success:last-child { + margin-right: 0; +} +.lg-btn-large-o-success:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-large.lg-color-sys { + background-color: #464e78; + border-color: #464e78; +} +.lg-btn-large.lg-color-sys:hover { + color: white; + background-color: #333958; + border-color: #333958; +} +.lg-btn-large-o.lg-color-sys, +.lg-btn-large-o.lg-btn-large-sys { + background-color: white; + border-color: #464e78; + color: #464e78; +} +.lg-btn-large-o.lg-color-sys:hover, +.lg-btn-large-o.lg-btn-large-sys:hover { + background-color: white; + color: #333958 !important; + border-color: #333958; +} +.lg-btn-large-sys { + background-color: #464e78; + border-color: #464e78; +} +.lg-btn-large-sys:hover { + color: white; + background-color: #333958; + border-color: #333958; +} +.lg-btn-large-o-sys { + background-color: white; + border-color: #464e78; + color: #464e78; +} +.lg-btn-large-o-sys:hover { + background-color: white; + color: #333958; + border-color: #333958; +} +.lg-btn-large-o-sys:last-child { + margin-right: 0; +} +.lg-btn-large-o-sys:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-large.lg-color-plain { + background-color: #e1e1e1; + border-color: #e1e1e1; +} +.lg-btn-large.lg-color-plain:hover { + color: white; + background-color: #c8c8c8; + border-color: #c8c8c8; +} +.lg-btn-large-o.lg-color-plain, +.lg-btn-large-o.lg-btn-large-plain { + background-color: white; + border-color: #e1e1e1; + color: #e1e1e1; +} +.lg-btn-large-o.lg-color-plain:hover, +.lg-btn-large-o.lg-btn-large-plain:hover { + background-color: white; + color: #c8c8c8 !important; + border-color: #c8c8c8; +} +.lg-btn-large-plain { + background-color: #e1e1e1; + border-color: #e1e1e1; +} +.lg-btn-large-plain:hover { + color: white; + background-color: #c8c8c8; + border-color: #c8c8c8; +} +.lg-btn-large-o-plain { + background-color: white; + border-color: #e1e1e1; + color: #e1e1e1; +} +.lg-btn-large-o-plain:hover { + background-color: white; + color: #c8c8c8; + border-color: #c8c8c8; +} +.lg-btn-large-o-plain:last-child { + margin-right: 0; +} +.lg-btn-large-o-plain:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-large.lg-color-highlight { + background-color: #ff8447; + border-color: #ff8447; +} +.lg-btn-large.lg-color-highlight:hover { + color: white; + background-color: #ff6214; + border-color: #ff6214; +} +.lg-btn-large-o.lg-color-highlight, +.lg-btn-large-o.lg-btn-large-highlight { + background-color: white; + border-color: #ff8447; + color: #ff8447; +} +.lg-btn-large-o.lg-color-highlight:hover, +.lg-btn-large-o.lg-btn-large-highlight:hover { + background-color: white; + color: #ff6214 !important; + border-color: #ff6214; +} +.lg-btn-large-highlight { + background-color: #ff8447; + border-color: #ff8447; +} +.lg-btn-large-highlight:hover { + color: white; + background-color: #ff6214; + border-color: #ff6214; +} +.lg-btn-large-o-highlight { + background-color: white; + border-color: #ff8447; + color: #ff8447; +} +.lg-btn-large-o-highlight:hover { + background-color: white; + color: #ff6214; + border-color: #ff6214; +} +.lg-btn-large-o-highlight:last-child { + margin-right: 0; +} +.lg-btn-large-o-highlight:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-small.lg-color-main { + background-color: #5986e1; + border-color: #5986e1; +} +.lg-btn-small.lg-color-main:hover { + color: white; + background-color: #2e67d9; + border-color: #2e67d9; +} +.lg-btn-small-o.lg-color-main, +.lg-btn-small-o.lg-btn-small-main { + background-color: white; + border-color: #5986e1; + color: #5986e1; +} +.lg-btn-small-o.lg-color-main:hover, +.lg-btn-small-o.lg-btn-small-main:hover { + background-color: white; + color: #2e67d9 !important; + border-color: #2e67d9; +} +.lg-btn-small-main { + background-color: #5986e1; + border-color: #5986e1; +} +.lg-btn-small-main:hover { + color: white; + background-color: #2e67d9; + border-color: #2e67d9; +} +.lg-btn-small-o-main { + background-color: white; + border-color: #5986e1; + color: #5986e1; +} +.lg-btn-small-o-main:hover { + background-color: white; + color: #2e67d9; + border-color: #2e67d9; +} +.lg-btn-small-o-main:last-child { + margin-right: 0; +} +.lg-btn-small-o-main:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-small.lg-color-danger { + background-color: #d05538; + border-color: #d05538; +} +.lg-btn-small.lg-color-danger:hover { + color: white; + background-color: #ac4229; + border-color: #ac4229; +} +.lg-btn-small-o.lg-color-danger, +.lg-btn-small-o.lg-btn-small-danger { + background-color: white; + border-color: #d05538; + color: #d05538; +} +.lg-btn-small-o.lg-color-danger:hover, +.lg-btn-small-o.lg-btn-small-danger:hover { + background-color: white; + color: #ac4229 !important; + border-color: #ac4229; +} +.lg-btn-small-danger { + background-color: #d05538; + border-color: #d05538; +} +.lg-btn-small-danger:hover { + color: white; + background-color: #ac4229; + border-color: #ac4229; +} +.lg-btn-small-o-danger { + background-color: white; + border-color: #d05538; + color: #d05538; +} +.lg-btn-small-o-danger:hover { + background-color: white; + color: #ac4229; + border-color: #ac4229; +} +.lg-btn-small-o-danger:last-child { + margin-right: 0; +} +.lg-btn-small-o-danger:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-small.lg-color-success { + background-color: #8bb455; + border-color: #8bb455; +} +.lg-btn-small.lg-color-success:hover { + color: white; + background-color: #719442; + border-color: #719442; +} +.lg-btn-small-o.lg-color-success, +.lg-btn-small-o.lg-btn-small-success { + background-color: white; + border-color: #8bb455; + color: #8bb455; +} +.lg-btn-small-o.lg-color-success:hover, +.lg-btn-small-o.lg-btn-small-success:hover { + background-color: white; + color: #719442 !important; + border-color: #719442; +} +.lg-btn-small-success { + background-color: #8bb455; + border-color: #8bb455; +} +.lg-btn-small-success:hover { + color: white; + background-color: #719442; + border-color: #719442; +} +.lg-btn-small-o-success { + background-color: white; + border-color: #8bb455; + color: #8bb455; +} +.lg-btn-small-o-success:hover { + background-color: white; + color: #719442; + border-color: #719442; +} +.lg-btn-small-o-success:last-child { + margin-right: 0; +} +.lg-btn-small-o-success:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-small.lg-color-sys { + background-color: #464e78; + border-color: #464e78; +} +.lg-btn-small.lg-color-sys:hover { + color: white; + background-color: #333958; + border-color: #333958; +} +.lg-btn-small-o.lg-color-sys, +.lg-btn-small-o.lg-btn-small-sys { + background-color: white; + border-color: #464e78; + color: #464e78; +} +.lg-btn-small-o.lg-color-sys:hover, +.lg-btn-small-o.lg-btn-small-sys:hover { + background-color: white; + color: #333958 !important; + border-color: #333958; +} +.lg-btn-small-sys { + background-color: #464e78; + border-color: #464e78; +} +.lg-btn-small-sys:hover { + color: white; + background-color: #333958; + border-color: #333958; +} +.lg-btn-small-o-sys { + background-color: white; + border-color: #464e78; + color: #464e78; +} +.lg-btn-small-o-sys:hover { + background-color: white; + color: #333958; + border-color: #333958; +} +.lg-btn-small-o-sys:last-child { + margin-right: 0; +} +.lg-btn-small-o-sys:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-small.lg-color-plain { + background-color: #e1e1e1; + border-color: #e1e1e1; +} +.lg-btn-small.lg-color-plain:hover { + color: white; + background-color: #c8c8c8; + border-color: #c8c8c8; +} +.lg-btn-small-o.lg-color-plain, +.lg-btn-small-o.lg-btn-small-plain { + background-color: white; + border-color: #e1e1e1; + color: #e1e1e1; +} +.lg-btn-small-o.lg-color-plain:hover, +.lg-btn-small-o.lg-btn-small-plain:hover { + background-color: white; + color: #c8c8c8 !important; + border-color: #c8c8c8; +} +.lg-btn-small-plain { + background-color: #e1e1e1; + border-color: #e1e1e1; +} +.lg-btn-small-plain:hover { + color: white; + background-color: #c8c8c8; + border-color: #c8c8c8; +} +.lg-btn-small-o-plain { + background-color: white; + border-color: #e1e1e1; + color: #e1e1e1; +} +.lg-btn-small-o-plain:hover { + background-color: white; + color: #c8c8c8; + border-color: #c8c8c8; +} +.lg-btn-small-o-plain:last-child { + margin-right: 0; +} +.lg-btn-small-o-plain:before { + margin-right: 5px; + font-size: 14px; +} +.lg-btn-small.lg-color-highlight { + background-color: #ff8447; + border-color: #ff8447; +} +.lg-btn-small.lg-color-highlight:hover { + color: white; + background-color: #ff6214; + border-color: #ff6214; +} +.lg-btn-small-o.lg-color-highlight, +.lg-btn-small-o.lg-btn-small-highlight { + background-color: white; + border-color: #ff8447; + color: #ff8447; +} +.lg-btn-small-o.lg-color-highlight:hover, +.lg-btn-small-o.lg-btn-small-highlight:hover { + background-color: white; + color: #ff6214 !important; + border-color: #ff6214; +} +.lg-btn-small-highlight { + background-color: #ff8447; + border-color: #ff8447; +} +.lg-btn-small-highlight:hover { + color: white; + background-color: #ff6214; + border-color: #ff6214; +} +.lg-btn-small-o-highlight { + background-color: white; + border-color: #ff8447; + color: #ff8447; +} +.lg-btn-small-o-highlight:hover { + background-color: white; + color: #ff6214; + border-color: #ff6214; +} +.lg-btn-small-o-highlight:last-child { + margin-right: 0; +} +.lg-btn-small-o-highlight:before { + margin-right: 5px; + font-size: 14px; +} +/* group */ +.lg-btn-group { + display: inline-block; + margin: 5px; +} +.lg-btn-group * { + margin: 0; + border-radius: 0; + float: left; +} +.lg-btn-group > *:first-child { + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; +} +.lg-btn-group > *:last-child { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; +} +.lg-btn-group *[class^='lg-btn'][class*='-o'] + *[class^='lg-btn'][class*='-o'] { + border-left: none; +} +/* disable */ +*[class^="lg-btn"][disabled='disabled'] { + border-color: #e1e1e1 !important; + background-color: #e1e1e1 !important; +} +*[class^="lg-btn"][disabled='disabled']:hover { + border-color: #e1e1e1 !important; + background-color: #e1e1e1 !important; +} +*[class^="lg-btn-"][class*="-o"][disabled='disabled'] { + border-color: #e1e1e1 !important; + background-color: white !important; + color: #e1e1e1 !important; +} +*[class^="lg-btn-"][class*="-o"][disabled='disabled']:hover { + border-color: #e1e1e1 !important; + background-color: white !important; + color: #e1e1e1 !important; +} +/* text + textarea + select + checkbox + radio + switchbox */ +input, +select, +textarea { + outline: none; + border-radius: 3px; + font-size: 12px; +} +input, +select { + box-sizing: border-box; + width: 120px; + margin-right: 5px; + line-height: 22px; + -moz-appearance: textfield; +} +input::-webkit-inner-spin-button, +input::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} +label { + font-weight: normal; + margin: 0; +} +label.lg-require:before { + content: '*'; + color: red; +} +/* text */ +input[type='text'], +input[type='number'], +input[type='telephone'] { + border: 1px solid #e1e1e1; + padding: 3px 5px; + font-size: 12px; + color: #666; + height: 30px; +} +input[type='text']:active, +input[type='number']:active, +input[type='telephone']:active, +input[type='text']:focus, +input[type='number']:focus, +input[type='telephone']:focus { + border: 1px solid #5986e1; +} +/* textarea */ +textarea { + border: 1px solid #e1e1e1; + padding: 3px 5px; + font-size: 12px; + color: #666; + width: 80%; + min-height: 100px; + resize: none; +} +textarea:active, +textarea:focus { + border: 1px solid #5986e1; +} +/* select */ +select { + border: 1px solid #e1e1e1; + padding: 3px 5px; + font-size: 12px; + color: #666; +} +select:active, +select:focus { + border: 1px solid #5986e1; +} +select option:hover { + background-color: #5986e1; +} +select option[selected] { + background-color: #5986e1; +} +/* checkbox & radio */ +input[type='checkbox'], +input[type='radio'] { + opacity: 0; + z-index: 1; + height: 0; + width: 0; + margin: 0; +} +/* checkbox */ +.lg-checkbox label, +.lg-checkbox-all label, +.lg-checkbox-part label, +.lg-checkbox-plain label { + white-space: nowrap; +} +.lg-checkbox input[type='checkbox'] + label, +.lg-checkbox-all input[type='checkbox'] + label, +.lg-checkbox-part input[type='checkbox'] + label, +.lg-checkbox-plain input[type='checkbox'] + label { + cursor: pointer; + width: auto; + margin-right: 10px; + position: static; + display: inline !important; +} +.lg-checkbox input[type='checkbox'] + label:hover, +.lg-checkbox-all input[type='checkbox'] + label:hover, +.lg-checkbox-part input[type='checkbox'] + label:hover, +.lg-checkbox-plain input[type='checkbox'] + label:hover { + color: #ff8447; +} +.lg-checkbox input[type='checkbox'] + label:before, +.lg-checkbox-all input[type='checkbox'] + label:before, +.lg-checkbox-part input[type='checkbox'] + label:before, +.lg-checkbox-plain input[type='checkbox'] + label:before { + content: ''; + border: 1px solid #999; + border-radius: 4px; + margin-right: 6px; + width: 14px; + height: 14px; + display: inline-block; + vertical-align: text-top; + box-sizing: border-box; + font-size: 12px; +} +.lg-checkbox input[type='checkbox']:checked + label:before, +.lg-checkbox-all input[type='checkbox']:checked + label:before, +.lg-checkbox-part input[type='checkbox']:checked + label:before, +.lg-checkbox-plain input[type='checkbox']:checked + label:before { + color: #ff8447; + content: "\e65d"; + font-family: "iconfont" !important; + border-color: #ff8447; + line-height: 12px; +} +.lg-checkbox input[type='checkbox']:disabled + label, +.lg-checkbox-all input[type='checkbox']:disabled + label, +.lg-checkbox-part input[type='checkbox']:disabled + label, +.lg-checkbox-plain input[type='checkbox']:disabled + label { + color: #999; +} +.lg-checkbox input[type='checkbox']:disabled + label:before, +.lg-checkbox-all input[type='checkbox']:disabled + label:before, +.lg-checkbox-part input[type='checkbox']:disabled + label:before, +.lg-checkbox-plain input[type='checkbox']:disabled + label:before { + border-color: #999; +} +.lg-checkbox input[type='checkbox']:disabled + label:hover, +.lg-checkbox-all input[type='checkbox']:disabled + label:hover, +.lg-checkbox-part input[type='checkbox']:disabled + label:hover, +.lg-checkbox-plain input[type='checkbox']:disabled + label:hover { + color: #999; +} +.lg-checkbox input[type='checkbox']:disabled:checked + label, +.lg-checkbox-all input[type='checkbox']:disabled:checked + label, +.lg-checkbox-part input[type='checkbox']:disabled:checked + label, +.lg-checkbox-plain input[type='checkbox']:disabled:checked + label { + color: #999; +} +.lg-checkbox input[type='checkbox']:disabled:checked + label:before, +.lg-checkbox-all input[type='checkbox']:disabled:checked + label:before, +.lg-checkbox-part input[type='checkbox']:disabled:checked + label:before, +.lg-checkbox-plain input[type='checkbox']:disabled:checked + label:before { + color: #999; + background-color: transparent; + border-color: #999; +} +.lg-checkbox-all input[type='checkbox']:disabled:checked + label { + color: #999; +} +.lg-checkbox-all input[type='checkbox']:disabled:checked + label:before { + color: white; + background-color: #999; + border-color: #999; +} +.lg-checkbox-part input[type='checkbox']:checked + label:before { + color: #666; + background-color: transparent; + border-color: #666; +} +/* radio */ +.lg-radio label, +.lg-radio-plain label { + white-space: nowrap; +} +.lg-radio input[type='radio'] + label, +.lg-radio-plain input[type='radio'] + label { + cursor: pointer; + width: auto; + margin-right: 10px; + position: static; + display: inline !important; +} +.lg-radio input[type='radio'] + label:hover, +.lg-radio-plain input[type='radio'] + label:hover { + color: #ff8447; +} +.lg-radio input[type='radio'] + label:before, +.lg-radio-plain input[type='radio'] + label:before { + content: ''; + border: 1px solid #999; + border-radius: 8px; + margin-right: 6px; + width: 14px; + height: 14px; + display: inline-block; + vertical-align: text-top; + box-sizing: border-box; +} +.lg-radio input[type='radio']:checked + label, +.lg-radio-plain input[type='radio']:checked + label { + position: relative; +} +.lg-radio input[type='radio']:checked + label:before, +.lg-radio-plain input[type='radio']:checked + label:before { + border-color: #ff8447; +} +.lg-radio input[type='radio']:checked + label:after, +.lg-radio-plain input[type='radio']:checked + label:after { + content: ""; + width: 8px; + height: 8px; + background-color: #ff8447; + border-radius: 5px; + position: absolute; + top: 3px; + left: 3px; +} +.lg-radio input[type='radio']:disabled + label, +.lg-radio-plain input[type='radio']:disabled + label { + color: #999; +} +.lg-radio input[type='radio']:disabled + label:before, +.lg-radio-plain input[type='radio']:disabled + label:before { + border-color: #999; +} +.lg-radio input[type='radio']:disabled + label:hover, +.lg-radio-plain input[type='radio']:disabled + label:hover { + color: #999; +} +.lg-radio input[type='radio']:disabled:checked + label, +.lg-radio-plain input[type='radio']:disabled:checked + label { + color: #999; +} +.lg-radio input[type='radio']:disabled:checked + label:before, +.lg-radio-plain input[type='radio']:disabled:checked + label:before { + color: #999; + background-color: transparent; + border-color: #999; +} +.lg-radio input[type='radio']:disabled:checked + label:after, +.lg-radio-plain input[type='radio']:disabled:checked + label:after { + content: ""; + background-color: #999; +} +.lg-plain .lg-checkbox > label:before, +.lg-plain .lg-radio > label:before { + display: none !important; +} +.lg-plain .lg-checkbox > label:after, +.lg-plain .lg-radio > label:after { + display: none !important; +} +.lg-radio-plain input[type='radio'] + label:before, +.lg-checkbox-plain input[type='radio'] + label:before, +.lg-radio-plain input[type='checkbox'] + label:before, +.lg-checkbox-plain input[type='checkbox'] + label:before, +.lg-radio-plain input[type='radio'] + label:after, +.lg-checkbox-plain input[type='radio'] + label:after, +.lg-radio-plain input[type='checkbox'] + label:after, +.lg-checkbox-plain input[type='checkbox'] + label:after { + display: none; +} +.lg-radio-plain input[type='radio']:checked + label, +.lg-checkbox-plain input[type='radio']:checked + label, +.lg-radio-plain input[type='checkbox']:checked + label, +.lg-checkbox-plain input[type='checkbox']:checked + label { + color: #ff8447; +} +/* switchbox */ +.lg-switch input[type='checkbox'] + label { + color: white; + background-color: #e1e1e1; + height: 26px; + line-height: 26px; + border-radius: 20px; + display: inline-block !important; + padding: 2px 8px 2px 2px; + box-sizing: content-box; +} +.lg-switch input[type='checkbox'] + label:before { + content: ""; + height: 24px; + width: 24px; + margin-right: 6px; + border-radius: 11px; + background-color: white; + border-color: white; + line-height: 30px; + vertical-align: middle; + display: inline-block; + position: relative; + top: -1px; +} +.lg-switch input[type='checkbox'] + label + label { + display: none !important; +} +.lg-switch input[type='checkbox']:checked + label + label { + cursor: pointer; + color: white; + background-color: #8bb455; + height: 26px; + line-height: 26px; + border-radius: 20px; + display: inline-block !important; + padding: 2px 2px 2px 8px; + box-sizing: content-box; +} +.lg-switch input[type='checkbox']:checked + label + label:after { + content: ""; + height: 24px; + width: 24px; + margin-left: 6px; + border-radius: 11px; + background-color: white; + border-color: white; + line-height: 30px; + vertical-align: middle; + display: inline-block; + position: relative; + top: -1px; +} +.lg-switch input[type='checkbox']:checked + label { + display: none !important; +} +.lg-switch .lg-main:checked + label + label { + background-color: #464e78 !important; +} +.lg-tag { + border-radius: 13px; + background-color: #e1e1e1; + color: #666; + padding: 4px 12px; + margin-right: 15px; + cursor: pointer; + display: inline; + font-size: 14px; + position: relative; + white-space: nowrap; +} +.lg-tag.active, +.lg-tag.lg-fn-active { + color: #ff8447; + background-color: #fff0db; +} +.lg-tag.lg-diy:after { + content: '\e661'; + font-family: "iconfont" !important; + color: red; + position: absolute; + top: -5px; + right: -5px; +} +.lg-tag-add { + display: inline-block; +} +.lg-tag-add:before { + content: '\e670'; + font-family: "iconfont" !important; + color: #e1e1e1; + font-size: 25px; + vertical-align: sub; + margin-right: 5px; +} +.lg-tag-add .icon-zhengque { + color: #8bb455; +} +.lg-tag-add .icon-cuowu { + color: #ff8447; +} +.lg-tab { + display: block; + list-style: none; + height: 38px; + line-height: 40px; + background-color: #f7f9fe; + font-size: 14px; + border-bottom: 1px solid #ccdaf7; + box-sizing: content-box; +} +.lg-tab .lg-tab-li { + float: left; + color: #666; + padding: 0 27px; + position: relative; + cursor: pointer; + height: 38px; +} +.lg-tab .lg-tab-li:after { + content: ''; + border-right: 1px solid #e1e1e1; + height: 36%; + position: absolute; + top: 32%; + left: 0; +} +.lg-tab .lg-tab-li:first-child:after { + height: 0; +} +.lg-tab .lg-tab-li * { + color: #666; +} +.lg-tab .lg-active, +.lg-tab .lg-fn-active, +.lg-tab .active { + background-color: white; + border: 1px solid #ccdaf7; + border-bottom: none; + color: #6D77AA; + font-weight: bold; +} +.lg-tab .lg-active:after, +.lg-tab .lg-fn-active:after, +.lg-tab .active:after { + height: 0; +} +.lg-tab .lg-active *, +.lg-tab .lg-fn-active *, +.lg-tab .active * { + color: #6D77AA; +} +.lg-tab .lg-active + .lg-tab-li:after, +.lg-tab .active + .lg-tab-li:after, +.lg-tab .lg-fn-active + .lg-tab-li:after { + height: 0; +} +.lg-tab-body { + border: 1px solid #ccdaf7; + border-top: none; + padding: 5px; +} +/* toast & bubble & error & progress*/ +/* toast */ +.lg-toast { + display: inline-block; + max-width: 232px; + padding: 15px 20px; + margin: 10px; + border-radius: 4px; + box-shadow: 2px 2px 12px 2px #e1e1e1; + background-color: white; +} +/* bubble */ +.lg-toast, +.lg-bubble, +.lg-bubble-top, +.lg-bubble-bottom { + display: inline-block; + max-width: 232px; + padding: 15px 20px; + margin: 10px; + border-radius: 4px; + box-shadow: 2px 2px 12px 2px #e1e1e1; + background-color: white; +} +.lg-bubble, +.lg-bubble-top { + color: #ff8447; + position: relative; + box-shadow: 4px 4px 14px 1px #e1e1e1; +} +.lg-bubble:after, +.lg-bubble-top:after { + content: ''; + border: 8px solid transparent; + border-top: 8px solid white; + position: absolute; + bottom: -16px; + right: 50%; + margin-right: -8px; +} +.lg-bubble-bottom { + color: #ff8447; + position: relative; + box-shadow: -4px -4px 14px 1px #e1e1e1; +} +.lg-bubble-bottom:after { + content: ''; + border: 8px solid transparent; + border-bottom: 8px solid white; + position: absolute; + top: -15px; + right: 50%; + margin-right: -8px; +} +/* error */ +.lg-error { + color: #ff8447; +} +.lg-error-b { + color: #ff8447; + display: block; + line-height: 30px; +} +input:focus + .lg-error { + display: none; +} +input:focus + .lg-error-b { + visibility: hidden; +} +/* progress */ +.lg-progress { + height: 30px; + width: 200px; + overflow: hidden; + margin: 0 20px; + display: inline-block; + position: relative; + border-radius: 15px; + background-color: #ededed; +} +.lg-progress > * { + display: block; + height: 100%; + background-color: #5986e1; +} +.lg-table { + width: 100%; + border-collapse: collapse; + line-height: 36px; + text-align: center; + color: #666; + border-bottom: 1px solid #e1e1e1; +} +.lg-table thead tr { + background-color: #6d77aa; + color: white; + height: 40px; +} +.lg-table thead tr.lg-color-danger-bg { + background-color: #d05538; +} +.lg-table thead tr.lg-color-success-bg { + background-color: #8bb455; +} +.lg-table thead tr.lg-color-plain-bg { + background-color: #e1e1e1; +} +.lg-table thead tr.lg-color-highlight-bg { + background-color: #ff8447; +} +.lg-table thead th { + font-weight: normal; + position: relative; + text-align: center; + border: none; + font-size: 14px; + white-space: nowrap; +} +.lg-table thead th.lg-asc { + cursor: pointer; +} +.lg-table thead th.lg-asc:after { + content: '\e644'; + font-family: iconfont !important; + position: absolute; + top: -1px; + font-size: 12px; + margin: 0 5px; + color: #f8f8f8; +} +.lg-table thead th.lg-desc { + cursor: pointer; +} +.lg-table thead th.lg-desc:after { + content: '\e64a'; + font-family: iconfont !important; + position: absolute; + top: 2px; + font-size: 20px; + margin: 0 5px; + color: #f8f8f8; +} +.lg-table thead tr.lg-table-tr th { + border: 1px solid white; +} +.lg-table tr { + border: none; +} +.lg-table tbody tr:nth-child(2n) { + background-color: #f4f4f8; +} +.lg-table td { + border: none; + font-size: 12px; +} +.lg-table a.lg-dropdown { + color: #666; +} +.lg-table-scroll { + overflow-x: auto; +} +.lg-dropdown { + position: relative; + display: inline-block; +} +.lg-dropdown > ul { + display: none; + width: 100%; + position: absolute; + top: 100%; + width: auto; + overflow: hidden; +} +.lg-dropdown > ul li { + width: 100%; + box-sizing: border-box; +} +.lg-dropdown:hover > ul { + display: block; + border: 1px solid #e1e1e1; + list-style: none; + position: absolute; + top: 100%; + left: 0; + background-color: white; + z-index: 1; + float: left; +} +.lg-dropdown:hover > ul li { + border-bottom: 1px solid #e1e1e1; + padding: 4px 8px; + font-size: 12px; + line-height: 22px; + white-space: nowrap; + float: left; +} +.lg-dropdown:hover > ul li:hover { + color: #ff8447; +} +.lg-dropdown:hover > ul li:last-child { + border-bottom: none; +} +.lg-tree { + height: 100%; + max-height: 100%; + position: relative; + overflow-y: auto; + overflow-x: hidden; + border: 1px solid #e1e1e1; + border-bottom: none; + margin-bottom: 20px; +} +.lg-tree a { + cursor: pointer; + position: relative; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + border-bottom: 1px solid #ededed; + display: block; + color: #333; +} +.lg-tree a:hover { + background-color: #ededed; + color: #464e78; +} +.lg-tree a:hover:before, +.lg-tree a:hover:after { + color: #464e78; +} +.lg-tree a.current, +.lg-tree a.lg-fn-current { + background-color: #ededed; + color: #464e78; +} +.lg-tree ul { + display: none; +} +.lg-tree .lg-fn-active + ul, +.lg-tree .active + ul { + display: block; +} +.lg-tree > li > a { + padding-left: 20px; + line-height: 60px; + height: 60px; + font-size: 18px; + color: #333333; +} +.lg-tree > li > a > i, +.lg-tree > li > a > i:before, +.lg-tree > li > a > i:after { + font-size: 18px; +} +.lg-tree > li > ul > li > a { + padding-left: 40px; + line-height: 55px; + height: 55px; + font-size: 16.2px; + color: #404040; +} +.lg-tree > li > ul > li > a > i, +.lg-tree > li > ul > li > a > i:before, +.lg-tree > li > ul > li > a > i:after { + font-size: 16.2px; +} +.lg-tree > li > ul > li > ul > li > a { + padding-left: 60px; + line-height: 50px; + height: 50px; + font-size: 14.58px; + color: #4d4d4d; +} +.lg-tree > li > ul > li > ul > li > a > i, +.lg-tree > li > ul > li > ul > li > a > i:before, +.lg-tree > li > ul > li > ul > li > a > i:after { + font-size: 14.58px; +} +.lg-tree > li > ul > li > ul > li > ul > li > a { + padding-left: 80px; + line-height: 45px; + height: 45px; + font-size: 13.122px; + color: #595959; +} +.lg-tree > li > ul > li > ul > li > ul > li > a > i, +.lg-tree > li > ul > li > ul > li > ul > li > a > i:before, +.lg-tree > li > ul > li > ul > li > ul > li > a > i:after { + font-size: 13.122px; +} +.lg-tree > li > ul > li > ul > li > ul > li > ul > li > a { + padding-left: 100px; + line-height: 40px; + height: 40px; + font-size: 11.8098px; + color: #666666; +} +.lg-tree > li > ul > li > ul > li > ul > li > ul > li > a > i, +.lg-tree > li > ul > li > ul > li > ul > li > ul > li > a > i:before, +.lg-tree > li > ul > li > ul > li > ul > li > ul > li > a > i:after { + font-size: 11.8098px; +} +.lg-tree > li > ul > li > ul > li > ul > li > ul > li > ul > li > a { + padding-left: 120px; + line-height: 35px; + height: 35px; + font-size: 10.62882px; + color: #737373; +} +.lg-tree > li > ul > li > ul > li > ul > li > ul > li > ul > li > a > i, +.lg-tree > li > ul > li > ul > li > ul > li > ul > li > ul > li > a > i:before, +.lg-tree > li > ul > li > ul > li > ul > li > ul > li > ul > li > a > i:after { + font-size: 10.62882px; +} +.lg-table-scroll::-webkit-scrollbar { + border: 1px solid #e1e1e1; + border: none; + width: 8px; + height: 8px; +} +.lg-table-scroll::-webkit-scrollbar-thumb { + background-color: #c1c1c1; + border-radius: 10px; +} +.lg-table-scroll::-webkit-scrollbar-button:start:decrement, +.lg-table-scroll::-webkit-scrollbar-button:end:increment { + display: block; +} +.lg-table-scroll::-webkit-scrollbar-button:end:decrement, +.lg-table-scroll::-webkit-scrollbar-button:start:increment { + display: none; +} +.lg-breadcrumb { + width: 100%; + margin: 0; + padding-left: 15px; + list-style: none; + font-size: 14px; + z-index: 1000; +} +.lg-breadcrumb span { + font-size: 14px; +} +.lg-breadcrumb > * { + float: left; + color: #666; + display: table; +} +.lg-breadcrumb > *:before { + content: ">"; + font-family: consolas; + font-size: 18px; + padding: 0 8px; +} +.lg-breadcrumb > *:first-child { + padding-left: 0; +} +.lg-breadcrumb > *:first-child:before { + display: none; +} +.lg-breadcrumb > *:last-child { + padding-right: 0; +} +.lg-breadcrumb > * > * { + line-height: 24px; +} +.lg-breadcrumb > * > a { + cursor: pointer; + color: #666; +} +.lg-breadcrumb > * a:hover { + color: #5986e1; +} +.lg-form-line, +.lg-form-block, +.lg-form-box { + margin-top: 5px; + padding-left: 100px; + position: relative; + min-height: 30px; +} +.lg-form-line label, +.lg-form-block label, +.lg-form-box label { + width: 100px; + position: absolute; + top: 0; + left: 0; + line-height: 30px; + text-align: right; + font-size: 12px; +} +.lg-form-line input + span, +.lg-form-block input + span, +.lg-form-box input + span { + margin-right: 5px; +} +.lg-form-line label + span, +.lg-form-block label + span, +.lg-form-box label + span { + line-height: 30px; + margin-left: 5px; + display: inline-block; +} +.lg-form-line *[class^='lg-btn'], +.lg-form-block *[class^='lg-btn'], +.lg-form-box *[class^='lg-btn'] { + margin-top: 0; + margin-bottom: 0; +} +.lg-form-line span, +.lg-form-block span, +.lg-form-box span { + word-break: break-all; + margin-right: 5px; +} +.lg-condition { + padding: 0 16px; + border-top: 1px solid #e1e1e1; + border-bottom: 1px solid #e1e1e1; + background-color: #f8f8f8; + font-size: 12px; + margin-bottom: 16px; +} +.lg-condition .lg-condition-box, +.lg-condition .lg-condition-block { + border-top: 1px solid #e1e1e1; + padding: 10px 0; +} +.lg-condition .lg-condition-box:first-child, +.lg-condition .lg-condition-block:first-child { + border-top: none; +} +.lg-condition .lg-condition-box > li, +.lg-condition .lg-condition-block > li { + padding: 5px 0; +} +.lg-condition .lg-condition-box > li > .lg-label, +.lg-condition .lg-condition-block > li > .lg-label { + position: absolute; +} +.lg-condition .lg-condition-box .wp-condition-group, +.lg-condition .lg-condition-block .wp-condition-group { + line-height: 30px; +} +.lg-condition .lg-condition-box span, +.lg-condition .lg-condition-block span { + margin-right: 5px; + color: #999; +} +.lg-condition .lg-condition-box label, +.lg-condition .lg-condition-block label { + text-align: right; + line-height: 30px; + width: 100px; +} +.lg-condition .lg-condition-box tr td:first-child, +.lg-condition .lg-condition-block tr td:first-child { + text-align: right; + white-space: nowrap; + vertical-align: top; + line-height: 34px; +} +.lg-condition .lg-condition-box .lg-radio label, +.lg-condition .lg-condition-block .lg-radio label, +.lg-condition .lg-condition-box .lg-checkbox label, +.lg-condition .lg-condition-block .lg-checkbox label, +.lg-condition .lg-condition-box .lg-radio-plain label, +.lg-condition .lg-condition-block .lg-radio-plain label, +.lg-condition .lg-condition-box .lg-checkbox-plain label, +.lg-condition .lg-condition-block .lg-checkbox-plain label { + display: inline-block; + line-height: 30px; + margin: 0 15px 0 5px; + cursor: pointer; +} +.lg-condition .lg-condition-box .lg-radio input[type='radio']:checked + label, +.lg-condition .lg-condition-block .lg-radio input[type='radio']:checked + label, +.lg-condition .lg-condition-box .lg-checkbox input[type='checkbox']:checked + label, +.lg-condition .lg-condition-block .lg-checkbox input[type='checkbox']:checked + label { + color: #ff8447; +} +.lg-condition .lg-condition-box .lg-radio input[type='radio']:checked + label:after, +.lg-condition .lg-condition-block .lg-radio input[type='radio']:checked + label:after, +.lg-condition .lg-condition-box .lg-checkbox input[type='checkbox']:checked + label:after, +.lg-condition .lg-condition-block .lg-checkbox input[type='checkbox']:checked + label:after { + background-color: #ff8447; +} +.lg-condition .lg-condition-box .lg-radio input[type='radio']:checked + label:before, +.lg-condition .lg-condition-block .lg-radio input[type='radio']:checked + label:before, +.lg-condition .lg-condition-box .lg-checkbox input[type='checkbox']:checked + label:before, +.lg-condition .lg-condition-block .lg-checkbox input[type='checkbox']:checked + label:before { + border-color: #ff8447; +} +.lg-condition .lg-condition-box .lg-checkbox input[type='checkbox']:checked + label:before, +.lg-condition .lg-condition-block .lg-checkbox input[type='checkbox']:checked + label:before { + background-color: #ff8447; +} +.lg-condition .lg-condition-box .lg-radio-plain input[type='radio']:checked + label, +.lg-condition .lg-condition-block .lg-radio-plain input[type='radio']:checked + label, +.lg-condition .lg-condition-box .lg-checkbox-plain input[type='checkbox']:checked + label, +.lg-condition .lg-condition-block .lg-checkbox-plain input[type='checkbox']:checked + label { + color: #ff8447; +} +.lg-condition .lg-condition-box *[class^='lg-btn'], +.lg-condition .lg-condition-block *[class^='lg-btn'] { + margin-top: 0; + margin-bottom: 0; +} diff --git a/radio-group.js b/radio-group.js new file mode 100644 index 0000000..d97c530 --- /dev/null +++ b/radio-group.js @@ -0,0 +1,48 @@ +; +(function(factory) { + if (typeof module === 'object' && typeof module.exports == 'object') { + module.exports = factory( + require('vue') + ); + } else { + factory(window.Vue); + } +})(function(Vue) { + var radioGroup = {}; + radioGroup.install = function(Vue) { + Vue.component('radio-group', { + delimiters: ['${', '}'], + props: ['data', 'model', 'className', 'index'], + template: '', + methods: { + check: function() { + this.$emit('input', this.selected); + }, + name: function(name, index) { + if (index != undefined) { + return name + index; + } + return name; + }, + id: function(id, index) { + if (index != undefined) { + return id + index; + } + return id; + } + }, + data: function() { + return { + selected: this.model + } + }, + watch: { + model: function(val, oldVal) { + this.selected = val; + this.$emit('input', this.selected); + } + } + }) + } + Vue.use(radioGroup); +}); diff --git a/select-group.js b/select-group.js new file mode 100644 index 0000000..64d634a --- /dev/null +++ b/select-group.js @@ -0,0 +1,43 @@ +; +(function(factory) { + if (typeof module === 'object' && typeof module.exports == 'object') { + module.exports = factory( + require('vue') + ); + } else { + factory(window.Vue); + } +})(function(Vue) { + var selectGroup={}; + selectGroup.install = function(Vue) { + Vue.component('select-group',{ + delimiters: ['${', '}'], + props: ['data', 'model', 'keyset','defaultVal', 'hide'], + template: '', + methods: { + change: function(event) { + //if model is pased by object, components can set value by reference whitch is suggested when modify value only + if (typeof this.model == 'object') { + this.model[this.keyset] = this.selected; + } + //if model is pased by value,we cannot modify it directly,so we use $emit whitch is suggested when need callback + else { + this.$parent.$emit(this.keyset, this.selected,event.target['options'][event.target['selectedIndex']].label); + } + } + }, + data: function() { + return { + selected: this.defaultVal!=undefined ? this.defaultVal: this.data[0] ? this.data[0].val : '' + }; + }, + watch: { + data: function(val, oldVal) { + if(this.data[0]) + this.selected = this.defaultVal!=undefined ? this.defaultVal:this.data[0].val; + } + } + }) + } + Vue.use(selectGroup); +}); diff --git a/validate-rule.js b/validate-rule.js new file mode 100644 index 0000000..aeec6e2 --- /dev/null +++ b/validate-rule.js @@ -0,0 +1,52 @@ +; +(function(factory) { + if (typeof module === 'object' && typeof module.exports == 'object') { + module.exports = factory(); + } else { + window.validateRule=factory(); + } +})(function() { + return { + rules: { + required: /\S+/, + email: /^\w[\._\-\w]*@[\w_-]+(?:\.[\w_-]+)+$/i, + mobile: /^\d{11}$/, + idcard: /^(?:\d{14}|\d{17})[\dx]$/i, + number: /^(?:\d+(?:\.\d+)?)$/, + range: function(value, range) { + if (!value) return true; + + if (range[0] && value < range[0]) { + return false; + } + + if (range[1] && value > range[1]) { + return false; + } + + return true; + }, + length: function(value, range) { + if (value) { + return (new RegExp('^[\\s\\S]{' + range.join(',') + '}$')).test(value); + } + return true; + }, + remote: function(value, options) { + return $.ajax(options).then(function() { + return options.checker.apply(null, arguments); + }); + } + }, + + msgs: { + required: '该字段必填', + email: '邮箱格式错误', + mobile: '手机号码格式错误', + idcard: '身份证格式错误', + number: '该字段必须为数字', + range: '字段输入范围错误', + length: '字段输入长度错误' + } + }; +}); \ No newline at end of file diff --git a/validate.js b/validate.js new file mode 100644 index 0000000..0a58e3e --- /dev/null +++ b/validate.js @@ -0,0 +1,45 @@ +; +(function(factory) { + if (typeof module === 'object' && typeof module.exports == 'object') { + module.exports = factory( + require('vue'), require('vue-components/validate-rule') + ); + } else { + factory(window.Vue, window.validateRule); + } +})(function(Vue, defaultRules) { + Vue.prototype.validate = function(form, rules) { + var errorList = []; + rules.forEach(function(item, i) { + if (item.rule) { + if (typeof item.rule == 'object') { + for(var key in item.rule){ + errorList.push(check({ value: form[item.key], rule: key, arg: item.rule[key],key: item.key })) + } + } + } + }) + return errorList.filter(function(item) { + return item.hasError + }); + } + + function check(arg) { + var vTrim = (arg.value + '').replace(/(^\s*)|(\s*$)/g, ""); + var result, flag,message; + if (typeof defaultRules.rules[arg.rule] == 'function') { + flag = defaultRules.rules[arg.rule](vTrim,arg.arg.slice(1,3)); + } else if(defaultRules.rules[arg.rule]) { + flag = defaultRules.rules[arg.rule].test(vTrim); + } else{ + flag = arg.rule.test(vTrim); + } + result = { + hasError: !flag, + key: arg.key, + rule: arg.rule, + msg: arg.arg[0] ? arg.arg[0] : defaultRules.msgs[arg.rule] + }; + return result; + } +}); diff --git a/vdialog/bower.json b/vdialog/bower.json new file mode 100644 index 0000000..fe2ebd2 --- /dev/null +++ b/vdialog/bower.json @@ -0,0 +1,8 @@ +{ + "name": "vpager", + "desc": "vpui-pager", + "main": "index.js", + "version": "1.0.0", + "dependencies": { + } +} \ No newline at end of file diff --git a/vdialog/examples/index.html b/vdialog/examples/index.html new file mode 100644 index 0000000..0de28a0 --- /dev/null +++ b/vdialog/examples/index.html @@ -0,0 +1,102 @@ + + + + + +, or missing
. Bailing hydration and performing ' + + 'full client-side render.' + ); + } + } + // either not server-rendered, or hydration failed. + // create an empty node and replace it + oldVnode = emptyNodeAt(oldVnode); + } + // replacing existing element + var oldElm = oldVnode.elm; + var parentElm$1 = nodeOps.parentNode(oldElm); + createElm( + vnode, + insertedVnodeQueue, + // extremely rare edge case: do not insert if old element is in a + // leaving transition. Only happens when combining transition + + // keep-alive + HOCs. (#4590) + oldElm._leaveCb ? null : parentElm$1, + nodeOps.nextSibling(oldElm) + ); + + if (isDef(vnode.parent)) { + // component root element replaced. + // update parent placeholder node element, recursively + var ancestor = vnode.parent; + while (ancestor) { + ancestor.elm = vnode.elm; + ancestor = ancestor.parent; + } + if (isPatchable(vnode)) { + for (var i = 0; i < cbs.create.length; ++i) { + cbs.create[i](emptyNode, vnode.parent); + } + } + } + + if (isDef(parentElm$1)) { + removeVnodes(parentElm$1, [oldVnode], 0, 0); + } else if (isDef(oldVnode.tag)) { + invokeDestroyHook(oldVnode); + } + } + } + + invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch); + return vnode.elm + } +} + +/* */ + +var directives = { + create: updateDirectives, + update: updateDirectives, + destroy: function unbindDirectives (vnode) { + updateDirectives(vnode, emptyNode); + } +}; + +function updateDirectives (oldVnode, vnode) { + if (oldVnode.data.directives || vnode.data.directives) { + _update(oldVnode, vnode); + } +} + +function _update (oldVnode, vnode) { + var isCreate = oldVnode === emptyNode; + var isDestroy = vnode === emptyNode; + var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context); + var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context); + + var dirsWithInsert = []; + var dirsWithPostpatch = []; + + var key, oldDir, dir; + for (key in newDirs) { + oldDir = oldDirs[key]; + dir = newDirs[key]; + if (!oldDir) { + // new directive, bind + callHook$1(dir, 'bind', vnode, oldVnode); + if (dir.def && dir.def.inserted) { + dirsWithInsert.push(dir); + } + } else { + // existing directive, update + dir.oldValue = oldDir.value; + callHook$1(dir, 'update', vnode, oldVnode); + if (dir.def && dir.def.componentUpdated) { + dirsWithPostpatch.push(dir); + } + } + } + + if (dirsWithInsert.length) { + var callInsert = function () { + for (var i = 0; i < dirsWithInsert.length; i++) { + callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode); + } + }; + if (isCreate) { + mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert); + } else { + callInsert(); + } + } + + if (dirsWithPostpatch.length) { + mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () { + for (var i = 0; i < dirsWithPostpatch.length; i++) { + callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode); + } + }); + } + + if (!isCreate) { + for (key in oldDirs) { + if (!newDirs[key]) { + // no longer present, unbind + callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy); + } + } + } +} + +var emptyModifiers = Object.create(null); + +function normalizeDirectives$1 ( + dirs, + vm +) { + var res = Object.create(null); + if (!dirs) { + return res + } + var i, dir; + for (i = 0; i < dirs.length; i++) { + dir = dirs[i]; + if (!dir.modifiers) { + dir.modifiers = emptyModifiers; + } + res[getRawDirName(dir)] = dir; + dir.def = resolveAsset(vm.$options, 'directives', dir.name, true); + } + return res +} + +function getRawDirName (dir) { + return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.'))) +} + +function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) { + var fn = dir.def && dir.def[hook]; + if (fn) { + fn(vnode.elm, dir, vnode, oldVnode, isDestroy); + } +} + +var baseModules = [ + ref, + directives +]; + +/* */ + +function updateAttrs (oldVnode, vnode) { + if (!oldVnode.data.attrs && !vnode.data.attrs) { + return + } + var key, cur, old; + var elm = vnode.elm; + var oldAttrs = oldVnode.data.attrs || {}; + var attrs = vnode.data.attrs || {}; + // clone observed objects, as the user probably wants to mutate it + if (attrs.__ob__) { + attrs = vnode.data.attrs = extend({}, attrs); + } + + for (key in attrs) { + cur = attrs[key]; + old = oldAttrs[key]; + if (old !== cur) { + setAttr(elm, key, cur); + } + } + // #4391: in IE9, setting type can reset value for input[type=radio] + /* istanbul ignore if */ + if (isIE9 && attrs.value !== oldAttrs.value) { + setAttr(elm, 'value', attrs.value); + } + for (key in oldAttrs) { + if (attrs[key] == null) { + if (isXlink(key)) { + elm.removeAttributeNS(xlinkNS, getXlinkProp(key)); + } else if (!isEnumeratedAttr(key)) { + elm.removeAttribute(key); + } + } + } +} + +function setAttr (el, key, value) { + if (isBooleanAttr(key)) { + // set attribute for blank value + // e.g. + if (isFalsyAttrValue(value)) { + el.removeAttribute(key); + } else { + el.setAttribute(key, key); + } + } else if (isEnumeratedAttr(key)) { + el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true'); + } else if (isXlink(key)) { + if (isFalsyAttrValue(value)) { + el.removeAttributeNS(xlinkNS, getXlinkProp(key)); + } else { + el.setAttributeNS(xlinkNS, key, value); + } + } else { + if (isFalsyAttrValue(value)) { + el.removeAttribute(key); + } else { + el.setAttribute(key, value); + } + } +} + +var attrs = { + create: updateAttrs, + update: updateAttrs +}; + +/* */ + +function updateClass (oldVnode, vnode) { + var el = vnode.elm; + var data = vnode.data; + var oldData = oldVnode.data; + if (!data.staticClass && !data.class && + (!oldData || (!oldData.staticClass && !oldData.class))) { + return + } + + var cls = genClassForVnode(vnode); + + // handle transition classes + var transitionClass = el._transitionClasses; + if (transitionClass) { + cls = concat(cls, stringifyClass(transitionClass)); + } + + // set the class + if (cls !== el._prevClass) { + el.setAttribute('class', cls); + el._prevClass = cls; + } +} + +var klass = { + create: updateClass, + update: updateClass +}; + +/* */ + +var validDivisionCharRE = /[\w).+\-_$\]]/; + +function parseFilters (exp) { + var inSingle = false; + var inDouble = false; + var inTemplateString = false; + var inRegex = false; + var curly = 0; + var square = 0; + var paren = 0; + var lastFilterIndex = 0; + var c, prev, i, expression, filters; + + for (i = 0; i < exp.length; i++) { + prev = c; + c = exp.charCodeAt(i); + if (inSingle) { + if (c === 0x27 && prev !== 0x5C) { inSingle = false; } + } else if (inDouble) { + if (c === 0x22 && prev !== 0x5C) { inDouble = false; } + } else if (inTemplateString) { + if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; } + } else if (inRegex) { + if (c === 0x2f && prev !== 0x5C) { inRegex = false; } + } else if ( + c === 0x7C && // pipe + exp.charCodeAt(i + 1) !== 0x7C && + exp.charCodeAt(i - 1) !== 0x7C && + !curly && !square && !paren + ) { + if (expression === undefined) { + // first filter, end of expression + lastFilterIndex = i + 1; + expression = exp.slice(0, i).trim(); + } else { + pushFilter(); + } + } else { + switch (c) { + case 0x22: inDouble = true; break // " + case 0x27: inSingle = true; break // ' + case 0x60: inTemplateString = true; break // ` + case 0x28: paren++; break // ( + case 0x29: paren--; break // ) + case 0x5B: square++; break // [ + case 0x5D: square--; break // ] + case 0x7B: curly++; break // { + case 0x7D: curly--; break // } + } + if (c === 0x2f) { // / + var j = i - 1; + var p = (void 0); + // find first non-whitespace prev char + for (; j >= 0; j--) { + p = exp.charAt(j); + if (p !== ' ') { break } + } + if (!p || !validDivisionCharRE.test(p)) { + inRegex = true; + } + } + } + } + + if (expression === undefined) { + expression = exp.slice(0, i).trim(); + } else if (lastFilterIndex !== 0) { + pushFilter(); + } + + function pushFilter () { + (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim()); + lastFilterIndex = i + 1; + } + + if (filters) { + for (i = 0; i < filters.length; i++) { + expression = wrapFilter(expression, filters[i]); + } + } + + return expression +} + +function wrapFilter (exp, filter) { + var i = filter.indexOf('('); + if (i < 0) { + // _f: resolveFilter + return ("_f(\"" + filter + "\")(" + exp + ")") + } else { + var name = filter.slice(0, i); + var args = filter.slice(i + 1); + return ("_f(\"" + name + "\")(" + exp + "," + args) + } +} + +/* */ + +function baseWarn (msg) { + console.error(("[Vue compiler]: " + msg)); +} + +function pluckModuleFunction ( + modules, + key +) { + return modules + ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; }) + : [] +} + +function addProp (el, name, value) { + (el.props || (el.props = [])).push({ name: name, value: value }); +} + +function addAttr (el, name, value) { + (el.attrs || (el.attrs = [])).push({ name: name, value: value }); +} + +function addDirective ( + el, + name, + rawName, + value, + arg, + modifiers +) { + (el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers }); +} + +function addHandler ( + el, + name, + value, + modifiers, + important +) { + // check capture modifier + if (modifiers && modifiers.capture) { + delete modifiers.capture; + name = '!' + name; // mark the event as captured + } + if (modifiers && modifiers.once) { + delete modifiers.once; + name = '~' + name; // mark the event as once + } + var events; + if (modifiers && modifiers.native) { + delete modifiers.native; + events = el.nativeEvents || (el.nativeEvents = {}); + } else { + events = el.events || (el.events = {}); + } + var newHandler = { value: value, modifiers: modifiers }; + var handlers = events[name]; + /* istanbul ignore if */ + if (Array.isArray(handlers)) { + important ? handlers.unshift(newHandler) : handlers.push(newHandler); + } else if (handlers) { + events[name] = important ? [newHandler, handlers] : [handlers, newHandler]; + } else { + events[name] = newHandler; + } +} + +function getBindingAttr ( + el, + name, + getStatic +) { + var dynamicValue = + getAndRemoveAttr(el, ':' + name) || + getAndRemoveAttr(el, 'v-bind:' + name); + if (dynamicValue != null) { + return parseFilters(dynamicValue) + } else if (getStatic !== false) { + var staticValue = getAndRemoveAttr(el, name); + if (staticValue != null) { + return JSON.stringify(staticValue) + } + } +} + +function getAndRemoveAttr (el, name) { + var val; + if ((val = el.attrsMap[name]) != null) { + var list = el.attrsList; + for (var i = 0, l = list.length; i < l; i++) { + if (list[i].name === name) { + list.splice(i, 1); + break + } + } + } + return val +} + +/* */ + +/** + * Cross-platform code generation for component v-model + */ +function genComponentModel ( + el, + value, + modifiers +) { + var ref = modifiers || {}; + var number = ref.number; + var trim = ref.trim; + + var baseValueExpression = '$$v'; + var valueExpression = baseValueExpression; + if (trim) { + valueExpression = + "(typeof " + baseValueExpression + " === 'string'" + + "? " + baseValueExpression + ".trim()" + + ": " + baseValueExpression + ")"; + } + if (number) { + valueExpression = "_n(" + valueExpression + ")"; + } + var assignment = genAssignmentCode(value, valueExpression); + + el.model = { + value: ("(" + value + ")"), + expression: ("\"" + value + "\""), + callback: ("function (" + baseValueExpression + ") {" + assignment + "}") + }; +} + +/** + * Cross-platform codegen helper for generating v-model value assignment code. + */ +function genAssignmentCode ( + value, + assignment +) { + var modelRs = parseModel(value); + if (modelRs.idx === null) { + return (value + "=" + assignment) + } else { + return "var $$exp = " + (modelRs.exp) + ", $$idx = " + (modelRs.idx) + ";" + + "if (!Array.isArray($$exp)){" + + value + "=" + assignment + "}" + + "else{$$exp.splice($$idx, 1, " + assignment + ")}" + } +} + +/** + * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val) + * + * for loop possible cases: + * + * - test + * - test[idx] + * - test[test1[idx]] + * - test["a"][idx] + * - xxx.test[a[a].test1[idx]] + * - test.xxx.a["asa"][test1[idx]] + * + */ + +var len; +var str; +var chr; +var index$1; +var expressionPos; +var expressionEndPos; + +function parseModel (val) { + str = val; + len = str.length; + index$1 = expressionPos = expressionEndPos = 0; + + if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) { + return { + exp: val, + idx: null + } + } + + while (!eof()) { + chr = next(); + /* istanbul ignore if */ + if (isStringStart(chr)) { + parseString(chr); + } else if (chr === 0x5B) { + parseBracket(chr); + } + } + + return { + exp: val.substring(0, expressionPos), + idx: val.substring(expressionPos + 1, expressionEndPos) + } +} + +function next () { + return str.charCodeAt(++index$1) +} + +function eof () { + return index$1 >= len +} + +function isStringStart (chr) { + return chr === 0x22 || chr === 0x27 +} + +function parseBracket (chr) { + var inBracket = 1; + expressionPos = index$1; + while (!eof()) { + chr = next(); + if (isStringStart(chr)) { + parseString(chr); + continue + } + if (chr === 0x5B) { inBracket++; } + if (chr === 0x5D) { inBracket--; } + if (inBracket === 0) { + expressionEndPos = index$1; + break + } + } +} + +function parseString (chr) { + var stringQuote = chr; + while (!eof()) { + chr = next(); + if (chr === stringQuote) { + break + } + } +} + +/* */ + +var warn$1; + +// in some cases, the event used has to be determined at runtime +// so we used some reserved tokens during compile. +var RANGE_TOKEN = '__r'; +var CHECKBOX_RADIO_TOKEN = '__c'; + +function model ( + el, + dir, + _warn +) { + warn$1 = _warn; + var value = dir.value; + var modifiers = dir.modifiers; + var tag = el.tag; + var type = el.attrsMap.type; + + { + var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type']; + if (tag === 'input' && dynamicType) { + warn$1( + ":\n" + + "v-model does not support dynamic input types. Use v-if branches instead." + ); + } + // inputs with type="file" are read only and setting the input's + // value will throw an error. + if (tag === 'input' && type === 'file') { + warn$1( + "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" + + "File inputs are read only. Use a v-on:change listener instead." + ); + } + } + + if (tag === 'select') { + genSelect(el, value, modifiers); + } else if (tag === 'input' && type === 'checkbox') { + genCheckboxModel(el, value, modifiers); + } else if (tag === 'input' && type === 'radio') { + genRadioModel(el, value, modifiers); + } else if (tag === 'input' || tag === 'textarea') { + genDefaultModel(el, value, modifiers); + } else if (!config.isReservedTag(tag)) { + genComponentModel(el, value, modifiers); + // component v-model doesn't need extra runtime + return false + } else { + warn$1( + "<" + (el.tag) + " v-model=\"" + value + "\">: " + + "v-model is not supported on this element type. " + + 'If you are working with contenteditable, it\'s recommended to ' + + 'wrap a library dedicated for that purpose inside a custom component.' + ); + } + + // ensure runtime directive metadata + return true +} + +function genCheckboxModel ( + el, + value, + modifiers +) { + var number = modifiers && modifiers.number; + var valueBinding = getBindingAttr(el, 'value') || 'null'; + var trueValueBinding = getBindingAttr(el, 'true-value') || 'true'; + var falseValueBinding = getBindingAttr(el, 'false-value') || 'false'; + addProp(el, 'checked', + "Array.isArray(" + value + ")" + + "?_i(" + value + "," + valueBinding + ")>-1" + ( + trueValueBinding === 'true' + ? (":(" + value + ")") + : (":_q(" + value + "," + trueValueBinding + ")") + ) + ); + addHandler(el, CHECKBOX_RADIO_TOKEN, + "var $$a=" + value + "," + + '$$el=$event.target,' + + "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" + + 'if(Array.isArray($$a)){' + + "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," + + '$$i=_i($$a,$$v);' + + "if($$c){$$i<0&&(" + value + "=$$a.concat($$v))}" + + "else{$$i>-1&&(" + value + "=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}" + + "}else{" + value + "=$$c}", + null, true + ); +} + +function genRadioModel ( + el, + value, + modifiers +) { + var number = modifiers && modifiers.number; + var valueBinding = getBindingAttr(el, 'value') || 'null'; + valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding; + addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")")); + addHandler(el, CHECKBOX_RADIO_TOKEN, genAssignmentCode(value, valueBinding), null, true); +} + +function genSelect ( + el, + value, + modifiers +) { + var number = modifiers && modifiers.number; + var selectedVal = "Array.prototype.filter" + + ".call($event.target.options,function(o){return o.selected})" + + ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" + + "return " + (number ? '_n(val)' : 'val') + "})"; + + var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]'; + var code = "var $$selectedVal = " + selectedVal + ";"; + code = code + " " + (genAssignmentCode(value, assignment)); + addHandler(el, 'change', code, null, true); +} + +function genDefaultModel ( + el, + value, + modifiers +) { + var type = el.attrsMap.type; + var ref = modifiers || {}; + var lazy = ref.lazy; + var number = ref.number; + var trim = ref.trim; + var needCompositionGuard = !lazy && type !== 'range'; + var event = lazy + ? 'change' + : type === 'range' + ? RANGE_TOKEN + : 'input'; + + var valueExpression = '$event.target.value'; + if (trim) { + valueExpression = "$event.target.value.trim()"; + } + if (number) { + valueExpression = "_n(" + valueExpression + ")"; + } + + var code = genAssignmentCode(value, valueExpression); + if (needCompositionGuard) { + code = "if($event.target.composing)return;" + code; + } + + addProp(el, 'value', ("(" + value + ")")); + addHandler(el, event, code, null, true); + if (trim || number || type === 'number') { + addHandler(el, 'blur', '$forceUpdate()'); + } +} + +/* */ + +// normalize v-model event tokens that can only be determined at runtime. +// it's important to place the event as the first in the array because +// the whole point is ensuring the v-model callback gets called before +// user-attached handlers. +function normalizeEvents (on) { + var event; + /* istanbul ignore if */ + if (on[RANGE_TOKEN]) { + // IE input[type=range] only supports `change` event + event = isIE ? 'change' : 'input'; + on[event] = [].concat(on[RANGE_TOKEN], on[event] || []); + delete on[RANGE_TOKEN]; + } + if (on[CHECKBOX_RADIO_TOKEN]) { + // Chrome fires microtasks in between click/change, leads to #4521 + event = isChrome ? 'click' : 'change'; + on[event] = [].concat(on[CHECKBOX_RADIO_TOKEN], on[event] || []); + delete on[CHECKBOX_RADIO_TOKEN]; + } +} + +var target$1; + +function add$1 ( + event, + handler, + once, + capture +) { + if (once) { + var oldHandler = handler; + var _target = target$1; // save current target element in closure + handler = function (ev) { + var res = arguments.length === 1 + ? oldHandler(ev) + : oldHandler.apply(null, arguments); + if (res !== null) { + remove$2(event, handler, capture, _target); + } + }; + } + target$1.addEventListener(event, handler, capture); +} + +function remove$2 ( + event, + handler, + capture, + _target +) { + (_target || target$1).removeEventListener(event, handler, capture); +} + +function updateDOMListeners (oldVnode, vnode) { + if (!oldVnode.data.on && !vnode.data.on) { + return + } + var on = vnode.data.on || {}; + var oldOn = oldVnode.data.on || {}; + target$1 = vnode.elm; + normalizeEvents(on); + updateListeners(on, oldOn, add$1, remove$2, vnode.context); +} + +var events = { + create: updateDOMListeners, + update: updateDOMListeners +}; + +/* */ + +function updateDOMProps (oldVnode, vnode) { + if (!oldVnode.data.domProps && !vnode.data.domProps) { + return + } + var key, cur; + var elm = vnode.elm; + var oldProps = oldVnode.data.domProps || {}; + var props = vnode.data.domProps || {}; + // clone observed objects, as the user probably wants to mutate it + if (props.__ob__) { + props = vnode.data.domProps = extend({}, props); + } + + for (key in oldProps) { + if (props[key] == null) { + elm[key] = ''; + } + } + for (key in props) { + cur = props[key]; + // ignore children if the node has textContent or innerHTML, + // as these will throw away existing DOM nodes and cause removal errors + // on subsequent patches (#3360) + if (key === 'textContent' || key === 'innerHTML') { + if (vnode.children) { vnode.children.length = 0; } + if (cur === oldProps[key]) { continue } + } + + if (key === 'value') { + // store value as _value as well since + // non-string values will be stringified + elm._value = cur; + // avoid resetting cursor position when value is the same + var strCur = cur == null ? '' : String(cur); + if (shouldUpdateValue(elm, vnode, strCur)) { + elm.value = strCur; + } + } else { + elm[key] = cur; + } + } +} + +// check platforms/web/util/attrs.js acceptValue + + +function shouldUpdateValue ( + elm, + vnode, + checkVal +) { + return (!elm.composing && ( + vnode.tag === 'option' || + isDirty(elm, checkVal) || + isInputChanged(elm, checkVal) + )) +} + +function isDirty (elm, checkVal) { + // return true when textbox (.number and .trim) loses focus and its value is not equal to the updated value + return document.activeElement !== elm && elm.value !== checkVal +} + +function isInputChanged (elm, newVal) { + var value = elm.value; + var modifiers = elm._vModifiers; // injected by v-model runtime + if ((modifiers && modifiers.number) || elm.type === 'number') { + return toNumber(value) !== toNumber(newVal) + } + if (modifiers && modifiers.trim) { + return value.trim() !== newVal.trim() + } + return value !== newVal +} + +var domProps = { + create: updateDOMProps, + update: updateDOMProps +}; + +/* */ + +var parseStyleText = cached(function (cssText) { + var res = {}; + var listDelimiter = /;(?![^(]*\))/g; + var propertyDelimiter = /:(.+)/; + cssText.split(listDelimiter).forEach(function (item) { + if (item) { + var tmp = item.split(propertyDelimiter); + tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim()); + } + }); + return res +}); + +// merge static and dynamic style data on the same vnode +function normalizeStyleData (data) { + var style = normalizeStyleBinding(data.style); + // static style is pre-processed into an object during compilation + // and is always a fresh object, so it's safe to merge into it + return data.staticStyle + ? extend(data.staticStyle, style) + : style +} + +// normalize possible array / string values into Object +function normalizeStyleBinding (bindingStyle) { + if (Array.isArray(bindingStyle)) { + return toObject(bindingStyle) + } + if (typeof bindingStyle === 'string') { + return parseStyleText(bindingStyle) + } + return bindingStyle +} + +/** + * parent component style should be after child's + * so that parent component's style could override it + */ +function getStyle (vnode, checkChild) { + var res = {}; + var styleData; + + if (checkChild) { + var childNode = vnode; + while (childNode.componentInstance) { + childNode = childNode.componentInstance._vnode; + if (childNode.data && (styleData = normalizeStyleData(childNode.data))) { + extend(res, styleData); + } + } + } + + if ((styleData = normalizeStyleData(vnode.data))) { + extend(res, styleData); + } + + var parentNode = vnode; + while ((parentNode = parentNode.parent)) { + if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) { + extend(res, styleData); + } + } + return res +} + +/* */ + +var cssVarRE = /^--/; +var importantRE = /\s*!important$/; +var setProp = function (el, name, val) { + /* istanbul ignore if */ + if (cssVarRE.test(name)) { + el.style.setProperty(name, val); + } else if (importantRE.test(val)) { + el.style.setProperty(name, val.replace(importantRE, ''), 'important'); + } else { + el.style[normalize(name)] = val; + } +}; + +var prefixes = ['Webkit', 'Moz', 'ms']; + +var testEl; +var normalize = cached(function (prop) { + testEl = testEl || document.createElement('div'); + prop = camelize(prop); + if (prop !== 'filter' && (prop in testEl.style)) { + return prop + } + var upper = prop.charAt(0).toUpperCase() + prop.slice(1); + for (var i = 0; i < prefixes.length; i++) { + var prefixed = prefixes[i] + upper; + if (prefixed in testEl.style) { + return prefixed + } + } +}); + +function updateStyle (oldVnode, vnode) { + var data = vnode.data; + var oldData = oldVnode.data; + + if (!data.staticStyle && !data.style && + !oldData.staticStyle && !oldData.style) { + return + } + + var cur, name; + var el = vnode.elm; + var oldStaticStyle = oldVnode.data.staticStyle; + var oldStyleBinding = oldVnode.data.style || {}; + + // if static style exists, stylebinding already merged into it when doing normalizeStyleData + var oldStyle = oldStaticStyle || oldStyleBinding; + + var style = normalizeStyleBinding(vnode.data.style) || {}; + + vnode.data.style = style.__ob__ ? extend({}, style) : style; + + var newStyle = getStyle(vnode, true); + + for (name in oldStyle) { + if (newStyle[name] == null) { + setProp(el, name, ''); + } + } + for (name in newStyle) { + cur = newStyle[name]; + if (cur !== oldStyle[name]) { + // ie9 setting to null has no effect, must use empty string + setProp(el, name, cur == null ? '' : cur); + } + } +} + +var style = { + create: updateStyle, + update: updateStyle +}; + +/* */ + +/** + * Add class with compatibility for SVG since classList is not supported on + * SVG elements in IE + */ +function addClass (el, cls) { + /* istanbul ignore if */ + if (!cls || !(cls = cls.trim())) { + return + } + + /* istanbul ignore else */ + if (el.classList) { + if (cls.indexOf(' ') > -1) { + cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); }); + } else { + el.classList.add(cls); + } + } else { + var cur = " " + (el.getAttribute('class') || '') + " "; + if (cur.indexOf(' ' + cls + ' ') < 0) { + el.setAttribute('class', (cur + cls).trim()); + } + } +} + +/** + * Remove class with compatibility for SVG since classList is not supported on + * SVG elements in IE + */ +function removeClass (el, cls) { + /* istanbul ignore if */ + if (!cls || !(cls = cls.trim())) { + return + } + + /* istanbul ignore else */ + if (el.classList) { + if (cls.indexOf(' ') > -1) { + cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); }); + } else { + el.classList.remove(cls); + } + } else { + var cur = " " + (el.getAttribute('class') || '') + " "; + var tar = ' ' + cls + ' '; + while (cur.indexOf(tar) >= 0) { + cur = cur.replace(tar, ' '); + } + el.setAttribute('class', cur.trim()); + } +} + +/* */ + +function resolveTransition (def$$1) { + if (!def$$1) { + return + } + /* istanbul ignore else */ + if (typeof def$$1 === 'object') { + var res = {}; + if (def$$1.css !== false) { + extend(res, autoCssTransition(def$$1.name || 'v')); + } + extend(res, def$$1); + return res + } else if (typeof def$$1 === 'string') { + return autoCssTransition(def$$1) + } +} + +var autoCssTransition = cached(function (name) { + return { + enterClass: (name + "-enter"), + enterToClass: (name + "-enter-to"), + enterActiveClass: (name + "-enter-active"), + leaveClass: (name + "-leave"), + leaveToClass: (name + "-leave-to"), + leaveActiveClass: (name + "-leave-active") + } +}); + +var hasTransition = inBrowser && !isIE9; +var TRANSITION = 'transition'; +var ANIMATION = 'animation'; + +// Transition property/event sniffing +var transitionProp = 'transition'; +var transitionEndEvent = 'transitionend'; +var animationProp = 'animation'; +var animationEndEvent = 'animationend'; +if (hasTransition) { + /* istanbul ignore if */ + if (window.ontransitionend === undefined && + window.onwebkittransitionend !== undefined) { + transitionProp = 'WebkitTransition'; + transitionEndEvent = 'webkitTransitionEnd'; + } + if (window.onanimationend === undefined && + window.onwebkitanimationend !== undefined) { + animationProp = 'WebkitAnimation'; + animationEndEvent = 'webkitAnimationEnd'; + } +} + +// binding to window is necessary to make hot reload work in IE in strict mode +var raf = inBrowser && window.requestAnimationFrame + ? window.requestAnimationFrame.bind(window) + : setTimeout; + +function nextFrame (fn) { + raf(function () { + raf(fn); + }); +} + +function addTransitionClass (el, cls) { + (el._transitionClasses || (el._transitionClasses = [])).push(cls); + addClass(el, cls); +} + +function removeTransitionClass (el, cls) { + if (el._transitionClasses) { + remove(el._transitionClasses, cls); + } + removeClass(el, cls); +} + +function whenTransitionEnds ( + el, + expectedType, + cb +) { + var ref = getTransitionInfo(el, expectedType); + var type = ref.type; + var timeout = ref.timeout; + var propCount = ref.propCount; + if (!type) { return cb() } + var event = type === TRANSITION ? transitionEndEvent : animationEndEvent; + var ended = 0; + var end = function () { + el.removeEventListener(event, onEnd); + cb(); + }; + var onEnd = function (e) { + if (e.target === el) { + if (++ended >= propCount) { + end(); + } + } + }; + setTimeout(function () { + if (ended < propCount) { + end(); + } + }, timeout + 1); + el.addEventListener(event, onEnd); +} + +var transformRE = /\b(transform|all)(,|$)/; + +function getTransitionInfo (el, expectedType) { + var styles = window.getComputedStyle(el); + var transitionDelays = styles[transitionProp + 'Delay'].split(', '); + var transitionDurations = styles[transitionProp + 'Duration'].split(', '); + var transitionTimeout = getTimeout(transitionDelays, transitionDurations); + var animationDelays = styles[animationProp + 'Delay'].split(', '); + var animationDurations = styles[animationProp + 'Duration'].split(', '); + var animationTimeout = getTimeout(animationDelays, animationDurations); + + var type; + var timeout = 0; + var propCount = 0; + /* istanbul ignore if */ + if (expectedType === TRANSITION) { + if (transitionTimeout > 0) { + type = TRANSITION; + timeout = transitionTimeout; + propCount = transitionDurations.length; + } + } else if (expectedType === ANIMATION) { + if (animationTimeout > 0) { + type = ANIMATION; + timeout = animationTimeout; + propCount = animationDurations.length; + } + } else { + timeout = Math.max(transitionTimeout, animationTimeout); + type = timeout > 0 + ? transitionTimeout > animationTimeout + ? TRANSITION + : ANIMATION + : null; + propCount = type + ? type === TRANSITION + ? transitionDurations.length + : animationDurations.length + : 0; + } + var hasTransform = + type === TRANSITION && + transformRE.test(styles[transitionProp + 'Property']); + return { + type: type, + timeout: timeout, + propCount: propCount, + hasTransform: hasTransform + } +} + +function getTimeout (delays, durations) { + /* istanbul ignore next */ + while (delays.length < durations.length) { + delays = delays.concat(delays); + } + + return Math.max.apply(null, durations.map(function (d, i) { + return toMs(d) + toMs(delays[i]) + })) +} + +function toMs (s) { + return Number(s.slice(0, -1)) * 1000 +} + +/* */ + +function enter (vnode, toggleDisplay) { + var el = vnode.elm; + + // call leave callback now + if (el._leaveCb) { + el._leaveCb.cancelled = true; + el._leaveCb(); + } + + var data = resolveTransition(vnode.data.transition); + if (!data) { + return + } + + /* istanbul ignore if */ + if (el._enterCb || el.nodeType !== 1) { + return + } + + var css = data.css; + var type = data.type; + var enterClass = data.enterClass; + var enterToClass = data.enterToClass; + var enterActiveClass = data.enterActiveClass; + var appearClass = data.appearClass; + var appearToClass = data.appearToClass; + var appearActiveClass = data.appearActiveClass; + var beforeEnter = data.beforeEnter; + var enter = data.enter; + var afterEnter = data.afterEnter; + var enterCancelled = data.enterCancelled; + var beforeAppear = data.beforeAppear; + var appear = data.appear; + var afterAppear = data.afterAppear; + var appearCancelled = data.appearCancelled; + var duration = data.duration; + + // activeInstance will always be the