weex-flymeui
Version:
A Flyme Style UI library based on Weex for Creator.
3 lines (2 loc) • 11.6 kB
JavaScript
// { "framework": "Vue" }
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["npm/weex-flymeui/components/fm-rcy-check/index"]=t():e["npm/weex-flymeui/components/fm-rcy-check/index"]=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=167)}({0:function(e,t){e.exports=function(e,t,n,i,r){var s,o=e=e||{},c=typeof e.default;"object"!==c&&"function"!==c||(s=e,o=e.default);var a,l="function"==typeof o?o.options:o;if(t&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns),i&&(l._scopeId=i),r?(a=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},l._ssrRegister=a):n&&(a=n),a){var d=l.functional,u=d?l.render:l.beforeCreate;d?l.render=function(e,t){return a.call(t),u(e,t)}:l.beforeCreate=u?[].concat(u,a):[a]}return{esModule:s,exports:o,options:l}}},1:function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var r=function(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}(i),s=i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"});return[n].concat(s).concat([r]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},r=0;r<this.length;r++){var s=this[r][0];"number"==typeof s&&(i[s]=!0)}for(r=0;r<e.length;r++){var o=e[r];"number"==typeof o[0]&&i[o[0]]||(n&&!o[2]?o[2]=n:n&&(o[2]="("+o[2]+") and ("+n+")"),t.push(o))}},t}},167:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(168);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(i).default}})},168:function(e,t,n){var i=!1;var r=n(0)(n(171),n(172),function(e){i||n(169)},"data-v-fb2a1758",null);r.options.__file="/Users/suen/Documents/develop/project/weex-flymeui/packages/fm-rcy-check/index.vue",r.esModule&&Object.keys(r.esModule).some(function(e){return"default"!==e&&"__"!==e.substr(0,2)})&&console.error("named exports are not supported in *.vue files."),r.options.functional&&console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions."),e.exports=r.exports},169:function(e,t,n){var i=n(170);"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);n(2)("81ea7240",i,!1,{})},170:function(e,t,n){(e.exports=n(1)(!1)).push([e.i,"\n.cell[data-v-fb2a1758] {\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n -webkit-box-pack: justify;\n -webkit-justify-content: space-between;\n justify-content: space-between;\n -webkit-box-align: center;\n -webkit-align-items: center;\n align-items: center;\n padding: 0 0.18519rem;\n width: 3.33333rem;\n height: 0.85185rem;\n}\n.check-wrap[data-v-fb2a1758] {\n width: 0.22222rem;\n height: 0.22222rem;\n}\n.unchecked[data-v-fb2a1758] {\n width: 0.22222rem;\n height: 0.22222rem;\n}\n.checked[data-v-fb2a1758] {\n position: absolute;\n left: 0;\n top: 0;\n width: 0.22222rem;\n height: 0.22222rem;\n -webkit-transform: scale(0);\n transform: scale(0);\n border-radius: 0.11111rem;\n}\n.loading[data-v-fb2a1758] {\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n}\n",""])},171:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:{dataSource:{type:Array,default:function(){return[]}},loadData:Function},data:function(){return{checking:!1,end:!1}},computed:{recycleList:function(){return this.$refs.rcy}},methods:{$onCellLongpress:function(e){var t=this;if(!this.checking){var n=e.index,i=[];this.recycleList.getListDataSize(function(e){t.checking=!0,t.recycleList.resetLoadmore(),t.recycleList.setPullLoadEnable(!1);for(var r=0;r<e;r++)t.dataSource[r].checking=t.checking,i.push(t.dataSource[r]);i[n].checked=!0,t.dataSource=i,t.recycleList.setListData(t.dataSource),t.$emit("fmRcyCheckStateChange",!0)})}},$onCellCheck:function(e,t){e.checking?(e.checked=!e.checked,this.dataSource[t]=e,this.recycleList.updateData(this.dataSource[t],t),this.$emit("fmRcyCheckValueChange",this.dataSource)):this.$emit("fmRcyCheckCellBeClick",{value:e,index:t})},$onLoadMore:function(){var e=this;this.checking||this.end||this.loadData&&"function"==typeof this.loadData&&this.loadData(),this.checked?this.end||setTimeout(function(){e.recycleList.setLoadingDisplay("hide"),e.recycleList.setPullLoadEnable(!0),e.recycleList.resetLoadmore()},400):(this.recycleList.setLoadingDisplay("hide"),this.recycleList.setPullLoadEnable(!1))},finish:function(){var e=this;this.checking&&this.recycleList.getListDataSize(function(t){var n=[],i=[],r=[];e.checking=!1,e.recycleList.setPullLoadEnable(!0),e.recycleList.resetLoadmore();for(var s=0;s<t;s++)e.dataSource[s].checking=e.checking,e.dataSource[s].checked&&i.push(e.dataSource[s])&&r.push(s),n.push(e.dataSource[s]);e.dataSource=n,e.recycleList.setListData(e.dataSource),e.$emit("fmRcyCheckFinish",{indexs:r,values:i}),e.$emit("fmRcyCheckStateChange",!1)})},toggleAll:function(e){var t=this;if(this.checking){var n=[];this.recycleList.getListDataSize(function(i){for(var r=0;r<i;r++)t.dataSource[r].checked=e,n.push(t.dataSource[r]);t.dataSource=n,t.recycleList.setListData(t.dataSource),t.$emit("fmRcyCheckValueChange",t.dataSource)})}},appendData:function(e){this.dataSource=this.dataSource.concat(e),this.recycleList.appendData(e)},removeData:function(e){this.dataSource=this.dataSource.filter(function(t,n){return e.indexOf(n)<0}),this.recycleList.removeData(e),this.$emit("fmRcyCheckValueChange",this.dataSource)},resetLoading:function(){this.recycleList.setLoadingDisplay("hide")},loadingEnd:function(e){var t=this;this.end=!0,this.$refs.loadText.setAttr("value",e,!1),setTimeout(function(){t.recycleList.setLoadingDisplay("hide"),t.recycleList.setPullLoadEnable(!0),t.recycleList.resetLoadmore()},400)},resetLoadMore:function(){this.end=!0,this.recycleList.setPullLoadEnable(!0),this.recycleList.resetLoadmore()}}}},172:function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("recycle-list",{ref:"rcy",staticStyle:e.$processStyle({width:"360px"}),style:e.$processStyle(void 0),attrs:{"template-key":"type",alias:"item",index:"i",append:"tree",showScrollbar:"true",for:"(item, i) in dataSource"},on:{loadmore:function(t){e.$onLoadMore()},mlongclick:e.$onCellLongpress}},[n("cell-slot",{staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0),attrs:{"template-type":"check-cell",itemId:e.item.itemId,ripple:"normal"},on:{click:function(t){e.$onCellCheck(e.item,e.i)}}},[n("div",[n("div",{staticClass:"cell",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0)},[n("div",{staticClass:"content",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0)},[n("text",[e._v(e._s(e.item.itemId))]),e._v(" "),e._m(0)]),e._v(" "),e.item.checking?n("div",{staticClass:"check-wrap",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0)},[n("image",{staticClass:"unchecked",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0),attrs:{src:"http://design.flyme.cn/weexui/assets/mz_btn_check_button_square_off.png"}}),e._v(" "),e.item.checked?n("image",{staticClass:"checked",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0),attrs:{src:e.item.disabled?"http://design.flyme.cn/weexui/assets/mz_btn_check_button_square_on_disable.png":"http://design.flyme.cn/weexui/assets/mz_btn_check_button_square_on.png"}}):e._e()]):e._e()])])]),e._v(" "),n("loading",{staticClass:"loading",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0),attrs:{display:"hide"},on:{loading:e.onloading}},[n("text",{ref:"loadText",staticClass:"indicator",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0)},[e._v("正在加载中 ..")])])],1)},staticRenderFns:[function(){var e=this.$createElement;return(this._self._c||e)("text",{staticStyle:this.$processStyle(void 0),style:this.$processStyle(void 0),attrs:{a:this.i}},[this._v(this._s(this.i))])}]},e.exports.render._withStripped=!0},2:function(e,t,n){var i="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!i)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var r=n(3),s={},o=i&&(document.head||document.getElementsByTagName("head")[0]),c=null,a=0,l=!1,d=function(){},u=null,f="data-vue-ssr-id",p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function h(e){for(var t=0;t<e.length;t++){var n=e[t],i=s[n.id];if(i){i.refs++;for(var r=0;r<i.parts.length;r++)i.parts[r](n.parts[r]);for(;r<n.parts.length;r++)i.parts.push(m(n.parts[r]));i.parts.length>n.parts.length&&(i.parts.length=n.parts.length)}else{var o=[];for(r=0;r<n.parts.length;r++)o.push(m(n.parts[r]));s[n.id]={id:n.id,refs:1,parts:o}}}}function y(){var e=document.createElement("style");return e.type="text/css",o.appendChild(e),e}function m(e){var t,n,i=document.querySelector("style["+f+'~="'+e.id+'"]');if(i){if(l)return d;i.parentNode.removeChild(i)}if(p){var r=a++;i=c||(c=y()),t=g.bind(null,i,r,!1),n=g.bind(null,i,r,!0)}else i=y(),t=function(e,t){var n=t.css,i=t.media,r=t.sourceMap;i&&e.setAttribute("media",i);u.ssrId&&e.setAttribute(f,t.id);r&&(n+="\n/*# sourceURL="+r.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,i),n=function(){i.parentNode.removeChild(i)};return t(e),function(i){if(i){if(i.css===e.css&&i.media===e.media&&i.sourceMap===e.sourceMap)return;t(e=i)}else n()}}e.exports=function(e,t,n,i){l=n,u=i||{};var o=r(e,t);return h(o),function(t){for(var n=[],i=0;i<o.length;i++){var c=o[i];(a=s[c.id]).refs--,n.push(a)}t?h(o=r(e,t)):o=[];for(i=0;i<n.length;i++){var a;if(0===(a=n[i]).refs){for(var l=0;l<a.parts.length;l++)a.parts[l]();delete s[a.id]}}}};var v=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function g(e,t,n,i){var r=n?"":i.css;if(e.styleSheet)e.styleSheet.cssText=v(t,r);else{var s=document.createTextNode(r),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(s,o[t]):e.appendChild(s)}}},3:function(e,t){e.exports=function(e,t){for(var n=[],i={},r=0;r<t.length;r++){var s=t[r],o=s[0],c={id:e+":"+r,css:s[1],media:s[2],sourceMap:s[3]};i[o]?i[o].parts.push(c):n.push(i[o]={id:o,parts:[c]})}return n}}})});