UNPKG

c-mobile

Version:

Vue 手机端组件,支持 megalo

1,888 lines (1,691 loc) 184 kB
import Vue from 'vue'; /* eslint-disable */ var isBrowser = false; var isMiniProgram = false; var Megalo = typeof Megalo === 'undefined' ? (typeof wx === 'undefined' ? false : wx) : Megalo; if (typeof window !== 'undefined') { isBrowser = true; } else if (Megalo && Megalo.getSystemInfoSync()) { isMiniProgram = true; if (Megalo.getSystemInfoSync().model.indexOf('iPhone X') > -1) ; } else if (typeof global === 'object' && global['process']) ; Megalo = isMiniProgram ? Megalo : false; var getObjectType = function (v) { return Object.prototype.toString.call(v).slice(8, -1); }; var isTelPhone = function (v) { return getObjectType(v) === 'String' && v.indexOf('tel:') === 0; }; var noop = function () {}; var createQueryUrl = function (to) { var toType = getObjectType(to); if (toType === 'String') { return to } if ( toType === 'Object' && to.path ) { var url = to.path; var search = ''; if ( getObjectType(to.query) === 'Object' && Object.keys(to.query).length > 0 ) { Object.keys(to.query).forEach(function (key, index) { search += "" + (index === 0 && url.indexOf('?') === -1 ? '?' : '&') + key + "=" + (to.query[key]); }); } return ("" + url + search) } return '' }; /* eslint-disable */ function to (ref) { var vm = ref.vm; var to = ref.to; var replace = ref.replace; var success = ref.success; var fail = ref.fail; var complete = ref.complete; if (to) { var toType = getObjectType(to); if (toType === 'String') { to = to.trim(); } if (isBrowser) { // 浏览器 if (toType === 'Number') { vm.$router.go(to); } else if ( toType === 'String' && ( to.indexOf('//') === 0 || to.indexOf('http://') === 0 || to.indexOf('https://') === 0 ) ) { // 字符串 to = to.indexOf('.') > -1 ? to : to.substring(1); if (replace) { window.location.replace(to); } else { window.location.href = to; } } else { if ( toType === 'String' && to.indexOf('/') === 0 ) { // Vue router 操作 if (vm) { if (replace) { vm.$router.replace(to); } else { vm.$router.push(to); } } else { console.error('Require vm'); } } else if (toType === 'Object') { // 其他,如:拨打电话、发送邮件 if ( to.path.indexOf('//') === 0 || to.path.indexOf('http://') === 0 || to.path.indexOf('https://') === 0 ) { to = createQueryUrl(to); if (replace) { window.location.replace(to); } else { window.location.href = to; } } else { if (replace) { vm.$router.replace(to); } else { vm.$router.push(to); } } } else { if (replace) { window.location.replace(to); } else { window.location.href = to; } } } } else if (isMiniProgram) { // 小程序 if (toType === 'Number') { Megalo.navigateBack({ delta: to > 0 ? to : -to }); } else if (isTelPhone(to)) { // 拨打电话 Megalo.makePhoneCall({ phoneNumber: to.replace('tel:', '') }); } else { to = { url: createQueryUrl(to), success: success ? success : noop, fail: fail ? fail : noop, complete: complete ? complete : noop }; if (replace) { Megalo.redirectTo(to); } else { Megalo.navigateTo(to); } } } } else { vm.$emit('click'); } } // var script = { name: 'CButton', props: { type: { type: String, default: '' }, o: { type: Boolean, default: false }, disabled: { type: Boolean, default: false }, small: { type: Boolean, default: false }, loading: { type: Boolean, default: false }, borderRadius: { type: Number, default: null }, to: { type: [String, Object], default: null }, icon: { type: [Boolean, String], default: false }, openType: { // 仅小程序支持 type: String, default: null }, formType: { // 仅小程序支持 type: String, default: null }, coverView: { // 仅小程序支持 type: Boolean, default: false } }, methods: { onClick: function onClick () { if (this._disabled) { return } to({ vm: this, to: this.to }); }, onGetphonenumber: function onGetphonenumber (v) { this.$emit('getphonenumber', v); } }, mounted: function mounted () { /* eslint-disable */ if (this._coverView && this.loading) { console.warn('c-button cover-view 状态不支持 loading'); } /* eslint-disable */ }, computed: { _borderRadius: function _borderRadius () { return this.borderRadius === null ? this.borderRadius : ((this.borderRadius) + "px") }, _icon: function _icon () { if (typeof this.icon === 'boolean' && this.icon) { return 'left' } else { if (this.icon) { return this.icon } else { return false } } }, _disabled: function _disabled () { return this.disabled || this.loading }, _coverView: { get: function get () { return this.coverView || this.$parent.coverView || false } } } }; /* script */ var __vue_script__ = script; /* template */ var __vue_render__ = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _vm._coverView ? _c( "cover-view", { staticClass: "c-button", class: [ _vm.type ? "c-button__" + _vm.type : "", _vm.icon ? "c-button__icon-" + _vm.icon : "", { "c-button__o": _vm.o, "c-button__disabled": _vm._disabled, "c-button__small": _vm.small, "c-button__loading": _vm.loading } ], style: { borderRadius: _vm._borderRadius }, attrs: { "open-type": _vm.openType, "form-type": _vm.formType, "hover-class": "c-button-hover" }, on: { click: _vm.onClick } }, [ _c( "cover-view", { staticClass: "c-button__text" }, [_vm._t("default")], 2 ) ], 1 ) : _c( "button", { staticClass: "c-button", class: [ _vm.type ? "c-button__" + _vm.type : "", _vm.icon ? "c-button__icon-" + _vm.icon : "", { "c-button__o": _vm.o, "c-button__disabled": _vm._disabled, "c-button__small": _vm.small, "c-button__loading": _vm.loading } ], style: { borderRadius: _vm._borderRadius }, attrs: { "open-type": _vm.openType, "form-type": _vm.formType, "hover-class": "c-button-hover" }, on: { click: _vm.onClick, getphonenumber: _vm.onGetphonenumber } }, [_c("span", { staticClass: "c-button__text" }, [_vm._t("default")], 2)] ) }; var __vue_staticRenderFns__ = []; __vue_render__._withStripped = true; /* style */ var __vue_inject_styles__ = undefined; /* scoped */ var __vue_scope_id__ = undefined; /* module identifier */ var __vue_module_identifier__ = undefined; /* functional template */ var __vue_is_functional_template__ = false; /* component normalizer */ function __vue_normalize__( template, style, script$$1, scope, functional, moduleIdentifier, createInjector, createInjectorSSR ) { var component = (typeof script$$1 === 'function' ? script$$1.options : script$$1) || {}; // For security concerns, we use only base name in production mode. component.__file = "/Users/zhuning/Chooin/github/c-mobile/packages/components/button/button.vue"; if (!component.render) { component.render = template.render; component.staticRenderFns = template.staticRenderFns; component._compiled = true; if (functional) { component.functional = true; } } component._scopeId = scope; return component } /* style inject */ function __vue_create_injector__() { var head = document.head || document.getElementsByTagName('head')[0]; var styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {}); var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); return function addStyle(id, css) { if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present. var group = isOldIE ? css.media || 'default' : id; var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined }); if (!style.ids.includes(id)) { var code = css.source; var index = style.ids.length; style.ids.push(id); if (isOldIE) { style.element = style.element || document.querySelector('style[data-group=' + group + ']'); } if (!style.element) { var el = style.element = document.createElement('style'); el.type = 'text/css'; if (css.media) { el.setAttribute('media', css.media); } if (isOldIE) { el.setAttribute('data-group', group); el.setAttribute('data-next-index', '0'); } head.appendChild(el); } if (isOldIE) { index = parseInt(style.element.getAttribute('data-next-index')); style.element.setAttribute('data-next-index', index + 1); } if (style.element.styleSheet) { style.parts.push(code); style.element.styleSheet.cssText = style.parts .filter(Boolean) .join('\n'); } else { var textNode = document.createTextNode(code); var nodes = style.element.childNodes; if (nodes[index]) { style.element.removeChild(nodes[index]); } if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); } else { style.element.appendChild(textNode); } } } } } /* style inject SSR */ var Button = __vue_normalize__( { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, __vue_create_injector__, undefined ); // var script$1 = { name: 'cFlex', props: { gutter: { type: Number, default: 0 }, to: { type: [String, Object], default: null }, coverView: { type: Boolean, default: false }, className: { type: String, default: null } }, methods: { onClick: function onClick () { to({ vm: this, to: this.to }); } } }; /* script */ var __vue_script__$1 = script$1; /* template */ var __vue_render__$1 = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _vm.coverView ? _c( "cover-view", { staticClass: "c-flex", class: [_vm.className], on: { click: _vm.onClick } }, [_vm._t("default")], 2 ) : _c( "div", { staticClass: "c-flex", class: [_vm.className], on: { click: _vm.onClick } }, [_vm._t("default")], 2 ) }; var __vue_staticRenderFns__$1 = []; __vue_render__$1._withStripped = true; /* style */ var __vue_inject_styles__$1 = undefined; /* scoped */ var __vue_scope_id__$1 = undefined; /* module identifier */ var __vue_module_identifier__$1 = undefined; /* functional template */ var __vue_is_functional_template__$1 = false; /* component normalizer */ function __vue_normalize__$1( template, style, script, scope, functional, moduleIdentifier, createInjector, createInjectorSSR ) { var component = (typeof script === 'function' ? script.options : script) || {}; // For security concerns, we use only base name in production mode. component.__file = "/Users/zhuning/Chooin/github/c-mobile/packages/components/flex/flex.vue"; if (!component.render) { component.render = template.render; component.staticRenderFns = template.staticRenderFns; component._compiled = true; if (functional) { component.functional = true; } } component._scopeId = scope; return component } /* style inject */ function __vue_create_injector__$1() { var head = document.head || document.getElementsByTagName('head')[0]; var styles = __vue_create_injector__$1.styles || (__vue_create_injector__$1.styles = {}); var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); return function addStyle(id, css) { if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present. var group = isOldIE ? css.media || 'default' : id; var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined }); if (!style.ids.includes(id)) { var code = css.source; var index = style.ids.length; style.ids.push(id); if (isOldIE) { style.element = style.element || document.querySelector('style[data-group=' + group + ']'); } if (!style.element) { var el = style.element = document.createElement('style'); el.type = 'text/css'; if (css.media) { el.setAttribute('media', css.media); } if (isOldIE) { el.setAttribute('data-group', group); el.setAttribute('data-next-index', '0'); } head.appendChild(el); } if (isOldIE) { index = parseInt(style.element.getAttribute('data-next-index')); style.element.setAttribute('data-next-index', index + 1); } if (style.element.styleSheet) { style.parts.push(code); style.element.styleSheet.cssText = style.parts .filter(Boolean) .join('\n'); } else { var textNode = document.createTextNode(code); var nodes = style.element.childNodes; if (nodes[index]) { style.element.removeChild(nodes[index]); } if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); } else { style.element.appendChild(textNode); } } } } } /* style inject SSR */ var Flex = __vue_normalize__$1( { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 }, __vue_inject_styles__$1, __vue_script__$1, __vue_scope_id__$1, __vue_is_functional_template__$1, __vue_module_identifier__$1, __vue_create_injector__$1, undefined ); // var script$2 = { name: 'cFlexItem', props: { flex: { type: Number, default: 1 }, to: { type: [String, Object], default: null } }, methods: { onClick: function onClick () { to({ vm: this, to: this.to }); } }, computed: { gutter: { get: function get () { return this.$parent.gutter || 0 } }, coverView: { get: function get () { return this.$parent.coverView || false } } } }; /* script */ var __vue_script__$2 = script$2; /* template */ var __vue_render__$2 = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _vm.coverView ? _c( "cover-view", { staticClass: "c-flex-item", style: { flex: _vm.flex, margin: "0 " + _vm.gutter / 2 + "px" }, on: { click: _vm.onClick } }, [_vm._t("default")], 2 ) : _c( "div", { staticClass: "c-flex-item", style: { flex: _vm.flex, margin: "0 " + _vm.gutter / 2 + "px" }, on: { click: _vm.onClick } }, [_vm._t("default")], 2 ) }; var __vue_staticRenderFns__$2 = []; __vue_render__$2._withStripped = true; /* style */ var __vue_inject_styles__$2 = undefined; /* scoped */ var __vue_scope_id__$2 = undefined; /* module identifier */ var __vue_module_identifier__$2 = undefined; /* functional template */ var __vue_is_functional_template__$2 = false; /* component normalizer */ function __vue_normalize__$2( template, style, script, scope, functional, moduleIdentifier, createInjector, createInjectorSSR ) { var component = (typeof script === 'function' ? script.options : script) || {}; // For security concerns, we use only base name in production mode. component.__file = "/Users/zhuning/Chooin/github/c-mobile/packages/components/flex/flex-item.vue"; if (!component.render) { component.render = template.render; component.staticRenderFns = template.staticRenderFns; component._compiled = true; if (functional) { component.functional = true; } } component._scopeId = scope; return component } /* style inject */ function __vue_create_injector__$2() { var head = document.head || document.getElementsByTagName('head')[0]; var styles = __vue_create_injector__$2.styles || (__vue_create_injector__$2.styles = {}); var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); return function addStyle(id, css) { if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present. var group = isOldIE ? css.media || 'default' : id; var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined }); if (!style.ids.includes(id)) { var code = css.source; var index = style.ids.length; style.ids.push(id); if (isOldIE) { style.element = style.element || document.querySelector('style[data-group=' + group + ']'); } if (!style.element) { var el = style.element = document.createElement('style'); el.type = 'text/css'; if (css.media) { el.setAttribute('media', css.media); } if (isOldIE) { el.setAttribute('data-group', group); el.setAttribute('data-next-index', '0'); } head.appendChild(el); } if (isOldIE) { index = parseInt(style.element.getAttribute('data-next-index')); style.element.setAttribute('data-next-index', index + 1); } if (style.element.styleSheet) { style.parts.push(code); style.element.styleSheet.cssText = style.parts .filter(Boolean) .join('\n'); } else { var textNode = document.createTextNode(code); var nodes = style.element.childNodes; if (nodes[index]) { style.element.removeChild(nodes[index]); } if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); } else { style.element.appendChild(textNode); } } } } } /* style inject SSR */ var FlexItem = __vue_normalize__$2( { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 }, __vue_inject_styles__$2, __vue_script__$2, __vue_scope_id__$2, __vue_is_functional_template__$2, __vue_module_identifier__$2, __vue_create_injector__$2, undefined ); // var script$3 = { name: 'cHeader', data: function data () { return { defaultTitle: '', paddingTop: null, paddingRight: null, paddingBottom: null, paddingLeft: null } }, props: { autoTitle: { type: Boolean, default: true }, type: { type: String, default: '' }, left: { type: Object, default: function () {} }, right: { type: Object, default: function () {} }, noborderBottom: { type: Boolean, default: false }, noborder: { type: Boolean, default: false }, className: { type: String, default: null } }, methods: { componentInit: function componentInit () { var this$1 = this; if (Megalo) { Megalo.getSystemInfo({ success: function (getSystemInfo) { var menuButton = Megalo.getMenuButtonBoundingClientRect(); this$1.paddingTop = (menuButton.top) + "px"; this$1.paddingRight = (menuButton.width + (getSystemInfo.windowWidth - menuButton.right) * 2) + "px"; this$1.paddingBottom = '9px'; this$1.paddingLeft = (menuButton.width + (getSystemInfo.windowWidth - menuButton.right) * 2) + "px"; } }); } }, onLeft: function onLeft () { if (this._left.to) { to({ vm: this, to: this._left.to }); } else if (typeof this._left.click === 'function') { this._left.click(); } else if (this._left.back) { to({ vm: this, to: -1 }); } }, onRight: function onRight () { if (this._right.to) { to({ vm: this, to: this._right.to }); } else if (typeof this._right.click === 'function') { this._right.click(); } }, onClose: function onClose () { if (typeof this._left.close === 'function') { this._left.close(); } } }, computed: { _left: { get: function get () { return Object.assign({ text: null, to: null, color: null, back: false, close: null, click: null }, this.left) } }, _right: { get: function get () { return Object.assign({ text: null, to: null, color: null, click: function click () {} }, this.right) } } }, mounted: function mounted () { var this$1 = this; if (this.autoTitle) { if (isBrowser) { this.$nextTick(function () { this$1.defaultTitle = document && document.title; }); } } this.componentInit(); } }; /* script */ var __vue_script__$3 = script$3; /* template */ var __vue_render__$3 = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _c( "div", { staticClass: "c-header", class: [ _vm.type ? "c-header__" + _vm.type : "", { "c-header__noborder-bottom": _vm.noborderBottom || _vm.noborder } ], style: { paddingTop: _vm.paddingTop, paddingRight: _vm.paddingRight, paddingBottom: _vm.paddingBottom, paddingLeft: _vm.paddingLeft } }, [ _vm.$slots.left ? _c("span", { staticClass: "c-header__left" }, [_vm._t("left")], 2) : _vm._left.text || _vm._left.back ? _c( "span", { staticClass: "c-header__left", class: { "c-header__back": _vm._left.back }, style: { color: _vm._left.color, bottom: _vm._left.back ? _vm.paddingBottom : null }, on: { click: _vm.onLeft } }, [ _vm._v( "\n " + _vm._s(_vm._left.close ? "" : _vm._left.text) + "\n " ) ] ) : _vm._e(), _vm._v(" "), _vm._left.close ? _c( "span", { staticClass: "c-header__close", on: { click: _vm.onClose } }, [_c("i")] ) : _vm._e(), _vm._v(" "), _vm.$slots.default ? [_vm._t("default")] : _vm.defaultTitle ? [_vm._v(_vm._s(_vm.defaultTitle))] : _vm._e(), _vm._v(" "), _vm.$slots.right ? _c("span", { staticClass: "c-header__right" }, [_vm._t("right")], 2) : _vm._right.text ? _c( "span", { staticClass: "c-header__right", style: { color: _vm._right.color }, on: { click: _vm.onRight } }, [_vm._v("\n " + _vm._s(_vm._right.text) + "\n ")] ) : _vm._e() ], 2 ) }; var __vue_staticRenderFns__$3 = []; __vue_render__$3._withStripped = true; /* style */ var __vue_inject_styles__$3 = undefined; /* scoped */ var __vue_scope_id__$3 = undefined; /* module identifier */ var __vue_module_identifier__$3 = undefined; /* functional template */ var __vue_is_functional_template__$3 = false; /* component normalizer */ function __vue_normalize__$3( template, style, script, scope, functional, moduleIdentifier, createInjector, createInjectorSSR ) { var component = (typeof script === 'function' ? script.options : script) || {}; // For security concerns, we use only base name in production mode. component.__file = "/Users/zhuning/Chooin/github/c-mobile/packages/components/header/header.vue"; if (!component.render) { component.render = template.render; component.staticRenderFns = template.staticRenderFns; component._compiled = true; if (functional) { component.functional = true; } } component._scopeId = scope; return component } /* style inject */ function __vue_create_injector__$3() { var head = document.head || document.getElementsByTagName('head')[0]; var styles = __vue_create_injector__$3.styles || (__vue_create_injector__$3.styles = {}); var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); return function addStyle(id, css) { if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present. var group = isOldIE ? css.media || 'default' : id; var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined }); if (!style.ids.includes(id)) { var code = css.source; var index = style.ids.length; style.ids.push(id); if (isOldIE) { style.element = style.element || document.querySelector('style[data-group=' + group + ']'); } if (!style.element) { var el = style.element = document.createElement('style'); el.type = 'text/css'; if (css.media) { el.setAttribute('media', css.media); } if (isOldIE) { el.setAttribute('data-group', group); el.setAttribute('data-next-index', '0'); } head.appendChild(el); } if (isOldIE) { index = parseInt(style.element.getAttribute('data-next-index')); style.element.setAttribute('data-next-index', index + 1); } if (style.element.styleSheet) { style.parts.push(code); style.element.styleSheet.cssText = style.parts .filter(Boolean) .join('\n'); } else { var textNode = document.createTextNode(code); var nodes = style.element.childNodes; if (nodes[index]) { style.element.removeChild(nodes[index]); } if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); } else { style.element.appendChild(textNode); } } } } } /* style inject SSR */ var Header = __vue_normalize__$3( { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 }, __vue_inject_styles__$3, __vue_script__$3, __vue_scope_id__$3, __vue_is_functional_template__$3, __vue_module_identifier__$3, __vue_create_injector__$3, undefined ); // var script$4 = { name: 'cIcon', props: { name: { type: String, default: '', required: true }, type: { type: String, default: '' }, color: { type: String, default: '' }, backgroundColor: { type: String, default: '' }, size: { type: String, default: '' }, borderRadius: { type: String }, to: { type: [String, Object], default: null } }, methods: { onClick: function onClick () { to({ vm: this, to: this.to }); } } }; /* script */ var __vue_script__$4 = script$4; /* template */ var __vue_render__$4 = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _c("i", { staticClass: "c-icon", class: [ "icon-" + _vm.name, _vm.type ? "c-icon__" + _vm.type : "", { "c-icon__background": _vm.backgroundColor } ], style: { width: _vm.size, height: _vm.size, fontSize: _vm.size, backgroundColor: _vm.backgroundColor, color: _vm.color, borderRadius: _vm.borderRadius }, on: { click: _vm.onClick } }) }; var __vue_staticRenderFns__$4 = []; __vue_render__$4._withStripped = true; /* style */ var __vue_inject_styles__$4 = undefined; /* scoped */ var __vue_scope_id__$4 = undefined; /* module identifier */ var __vue_module_identifier__$4 = undefined; /* functional template */ var __vue_is_functional_template__$4 = false; /* component normalizer */ function __vue_normalize__$4( template, style, script, scope, functional, moduleIdentifier, createInjector, createInjectorSSR ) { var component = (typeof script === 'function' ? script.options : script) || {}; // For security concerns, we use only base name in production mode. component.__file = "/Users/zhuning/Chooin/github/c-mobile/packages/components/icon/icon.vue"; if (!component.render) { component.render = template.render; component.staticRenderFns = template.staticRenderFns; component._compiled = true; if (functional) { component.functional = true; } } component._scopeId = scope; return component } /* style inject */ function __vue_create_injector__$4() { var head = document.head || document.getElementsByTagName('head')[0]; var styles = __vue_create_injector__$4.styles || (__vue_create_injector__$4.styles = {}); var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); return function addStyle(id, css) { if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present. var group = isOldIE ? css.media || 'default' : id; var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined }); if (!style.ids.includes(id)) { var code = css.source; var index = style.ids.length; style.ids.push(id); if (isOldIE) { style.element = style.element || document.querySelector('style[data-group=' + group + ']'); } if (!style.element) { var el = style.element = document.createElement('style'); el.type = 'text/css'; if (css.media) { el.setAttribute('media', css.media); } if (isOldIE) { el.setAttribute('data-group', group); el.setAttribute('data-next-index', '0'); } head.appendChild(el); } if (isOldIE) { index = parseInt(style.element.getAttribute('data-next-index')); style.element.setAttribute('data-next-index', index + 1); } if (style.element.styleSheet) { style.parts.push(code); style.element.styleSheet.cssText = style.parts .filter(Boolean) .join('\n'); } else { var textNode = document.createTextNode(code); var nodes = style.element.childNodes; if (nodes[index]) { style.element.removeChild(nodes[index]); } if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); } else { style.element.appendChild(textNode); } } } } } /* style inject SSR */ var Icon = __vue_normalize__$4( { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 }, __vue_inject_styles__$4, __vue_script__$4, __vue_scope_id__$4, __vue_is_functional_template__$4, __vue_module_identifier__$4, __vue_create_injector__$4, undefined ); // // // // // // // // // // // // // // // // // // // // // // // // // var script$5 = { name: 'cInputGroup', props: { title: { type: String, default: null }, type: { type: String, default: null }, noborder: { type: Boolean, default: false }, noborderTop: { type: Boolean, default: false }, noborderBottom: { type: Boolean, default: false }, labelWidth: { type: String, default: '110px' }, className: { type: String, default: null } } }; /* script */ var __vue_script__$5 = script$5; /* template */ var __vue_render__$5 = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _c( "div", { staticClass: "c-input-group", class: [_vm.className] }, [ _vm.title ? _c( "h5", { staticClass: "c-input-group__title", class: [_vm.type ? "c-input-group__title-" + _vm.type : ""] }, [_vm._v("\n " + _vm._s(_vm.title) + "\n ")] ) : _vm._e(), _vm._v(" "), _c( "div", { staticClass: "c-input-group__content", class: { "c-input-group__noborder-top": _vm.noborderTop || _vm.noborder, "c-input-group__noborder-bottom": _vm.noborderBottom || _vm.noborder } }, [_vm._t("default")], 2 ) ] ) }; var __vue_staticRenderFns__$5 = []; __vue_render__$5._withStripped = true; /* style */ var __vue_inject_styles__$5 = undefined; /* scoped */ var __vue_scope_id__$5 = undefined; /* module identifier */ var __vue_module_identifier__$5 = undefined; /* functional template */ var __vue_is_functional_template__$5 = false; /* component normalizer */ function __vue_normalize__$5( template, style, script, scope, functional, moduleIdentifier, createInjector, createInjectorSSR ) { var component = (typeof script === 'function' ? script.options : script) || {}; // For security concerns, we use only base name in production mode. component.__file = "/Users/zhuning/Chooin/github/c-mobile/packages/components/input-group/input-group.vue"; if (!component.render) { component.render = template.render; component.staticRenderFns = template.staticRenderFns; component._compiled = true; if (functional) { component.functional = true; } } component._scopeId = scope; return component } /* style inject */ function __vue_create_injector__$5() { var head = document.head || document.getElementsByTagName('head')[0]; var styles = __vue_create_injector__$5.styles || (__vue_create_injector__$5.styles = {}); var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); return function addStyle(id, css) { if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present. var group = isOldIE ? css.media || 'default' : id; var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined }); if (!style.ids.includes(id)) { var code = css.source; var index = style.ids.length; style.ids.push(id); if (isOldIE) { style.element = style.element || document.querySelector('style[data-group=' + group + ']'); } if (!style.element) { var el = style.element = document.createElement('style'); el.type = 'text/css'; if (css.media) { el.setAttribute('media', css.media); } if (isOldIE) { el.setAttribute('data-group', group); el.setAttribute('data-next-index', '0'); } head.appendChild(el); } if (isOldIE) { index = parseInt(style.element.getAttribute('data-next-index')); style.element.setAttribute('data-next-index', index + 1); } if (style.element.styleSheet) { style.parts.push(code); style.element.styleSheet.cssText = style.parts .filter(Boolean) .join('\n'); } else { var textNode = document.createTextNode(code); var nodes = style.element.childNodes; if (nodes[index]) { style.element.removeChild(nodes[index]); } if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); } else { style.element.appendChild(textNode); } } } } } /* style inject SSR */ var InputGroup = __vue_normalize__$5( { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 }, __vue_inject_styles__$5, __vue_script__$5, __vue_scope_id__$5, __vue_is_functional_template__$5, __vue_module_identifier__$5, __vue_create_injector__$5, undefined ); // var script$6 = { name: 'cInput', props: { addon: { type: Boolean, default: false }, useDiv: { // switch 组件父级是不允许使用 label 标签的 type: Boolean, default: false }, useButton: { // 仅小程序支持 type: Boolean, default: false }, openType: { // 仅小程序支持 type: String, default: null }, next: { type: Boolean, default: null }, icon: { type: Boolean, default: false }, checked: { type: Boolean, default: false }, to: { type: [String, Object], default: null }, noborderTop: { type: Boolean, default: false }, className: { type: String, default: null }, required: { type: Boolean, default: false }, visible: { type: Boolean, default: true }, active: { type: Boolean, default: false }, direction: { type: String, default: 'row' // ? row, column } }, methods: { onClick: function onClick () { if (this.next === false) { return } to({ vm: this, to: this.to }); } }, computed: { labelWidth: function labelWidth () { return this.$parent.labelWidth }, _useButton: function _useButton () { if (this.useButton) { return true } if (this.openType) { return true } return false } } }; /* script */ var __vue_script__$6 = script$6; /* template */ var __vue_render__$6 = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _vm.useDiv && _vm.visible ? _c( "div", { staticClass: "c-input", class: [ _vm.className, { "c-input__addon": _vm.addon, "c-input__next": _vm.next, "c-input__active": _vm.active, "c-input__icon": _vm.icon, "c-input__checked": _vm.checked, "c-input__noborder-top": _vm.noborderTop, "c-input__direction-column": _vm.direction === "column" } ], on: { touchstart: function() {}, click: _vm.onClick } }, [_vm._t("default")], 2 ) : _vm._useButton && _vm.visible ? _c( "button", { staticClass: "c-input", class: [ _vm.className, { "c-input__addon": _vm.addon, "c-input__next": _vm.next, "c-input__active": _vm.active, "c-input__icon": _vm.icon, "c-input__checked": _vm.checked, "c-input__noborder-top": _vm.noborderTop, "c-input__direction-column": _vm.direction === "column" } ], attrs: { "open-type": _vm.openType }, on: { click: _vm.onClick } }, [_vm._t("default")], 2 ) : _vm.visible ? _c( "label", { staticClass: "c-input", class: [ _vm.className, { "c-input__addon": _vm.addon, "c-input__next": _vm.next, "c-input__active": _vm.active, "c-input__icon": _vm.icon, "c-input__checked": _vm.checked, "c-input__noborder-top": _vm.noborderTop, "c-input__direction-column": _vm.direction === "column" } ], on: { touchstart: function() {}, click: _vm.onClick } }, [_vm._t("default")], 2 ) : _vm._e() }; var __vue_staticRenderFns__$6 = []; __vue_render__$6._withStripped = true; /* style */ var __vue_inject_styles__$6 = undefined; /* scoped */ var __vue_scope_id__$6 = undefined; /* module identifier */ var __vue_module_identifier__$6 = undefined; /* functional template */ var __vue_is_functional_template__$6 = false; /* component normalizer */ function __vue_normalize__$6( template, style, script, scope, functional, moduleIdentifier, createInjector, createInjectorSSR ) { var component = (typeof script === 'function' ? script.options : script) || {}; // For security concerns, we use only base name in production mode. component.__file = "/Users/zhuning/Chooin/github/c-mobile/packages/components/input-group/input.vue"; if (!component.render) { component.render = template.render; component.staticRenderFns = template.staticRenderFns; component._compiled = true; if (functional) { component.functional = true; } } component._scopeId = scope; return component } /* style inject */ function __vue_create_injector__$6() { var head = document.head || document.getElementsByTagName('head')[0]; var styles = __vue_create_injector__$6.styles || (__vue_create_injector__$6.styles = {}); var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); return function addStyle(id, css) { if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present. var group = isOldIE ? css.media || 'default' : id; var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined }); if (!style.ids.includes(id)) { var code = css.source; var index = style.ids.length; style.ids.push(id); if (isOldIE) { style.element = style.element || document.querySelector('style[data-group=' + group + ']'); } if (!style.element) { var el = style.element = document.createElement('style'); el.type = 'text/css'; if (css.media) { el.setAttribute('media', css.media); } if (isOldIE) { el.setAttribute('data-group', group); el.setAttribute('data-next-index', '0'); } head.appendChild(el); } if (isOldIE) { index = parseInt(style.element.getAttribute('data-next-index')); style.element.setAttribute('data-next-index', index + 1); } if (style.element.styleSheet) { style.parts.push(code); style.element.styleSheet.cssText = style.parts .filter(Boolean) .join('\n'); } else { var textNode = document.createTextNode(code); var nodes = style.element.childNodes; if (nodes[index]) { style.element.removeChild(nodes[index]); } if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); } else { style.element.appendChild(textNode); } } } } } /* style inject SSR */ var Input = __vue_normalize__$6( { render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 }, __vue_inject_styles__$6, __vue_script__$6, __vue_scope_id__$6, __vue_is_functional_template__$6, __vue_module_identifier__$6, __vue_create_injector__$6, undefined ); // var script$7 = { name: 'cInputHead', props: { to: { type: [String, Object], default: null } }, methods: { onClick: function onClick () { to({ vm: this, to: this.to }); } }, computed: { labelWidth: function labelWidth () { return this.$parent.labelWidth || '110px' }, required: function required () { return this.$parent.required } } }; /* script */ var __vue_script__$7 = script$7; /* template */ var __vue_render__$7 = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _c( "div", { staticClass: "c-input-head", style: { "min-width": _vm.labelWidth }, on: { click: _vm.onClick } }, [ _vm.required ? _c("span", { staticStyle: { color: "#f00" } }, [_vm._v("*")]) : _vm._e(), _vm._v(" "), _vm._t("default") ], 2 ) }; var __vue_staticRenderFns__$7 = []; __vue_render__$7._withStripped = true; /* style */ var __vue_inject_styles__$7 = undefined; /* scoped */ var __vue_scope_id__$7 = undefined; /* module identifier */ var __vue_module_identifier__$7 = undefined; /* functional template */ var __vue_is_functional_template__$7 = false; /* component normalizer */ function __vue_normalize__$7( template, style, script, scope, functional, moduleIdentifier, createInjector, createInjectorSSR ) { var component = (typeof script === 'function' ? script.options : script) || {}; // For security concerns, we use only base name in production mode. component.__file = "/Users/zhuning/Chooin/github/c-mobile/packages/components/input-group/input-head.vue"; if (!component.render) { component.render = template.render; component.staticRenderFns = template.staticRenderFns; component._compiled = true; if (functional) { component.functional = true; } } component._scopeId = scope; return component } /* style inject */ function __vue_create_injector__$7() { var head = document.head || document.getElementsByTagName('head')[0]; var styles = __vue_create_injector__$7.styles || (__vue_create_injector__$7.styles = {}); var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); return function addStyle(id, css) { if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present. var group = isOldIE ? css.media || 'default' : id; var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined }); if (!style.ids.includes(id)) { var code = css.source; var index = style.ids.length; style.ids.push(id); if (isOldIE) { style.element = style.element || document.querySelector('style[data-group=' + group + ']'); } if (!style.element) { var el = style.element = document.createElement('style'); el.type = 'text/css'; if (css.media) { el.setAttribute('media', css.media); } if (isOldIE) { el.setAttribute('data-group', group); el.setAttribute('data-next-index', '0'); } head.appendChild(el); } if (isOldIE) { index = parseInt(style.element.getAttribute('data-next-index')); style.element.setAttribute('data-next-index', index + 1); } if (style.element.styleSheet) { style.parts.push(code); style.element.styleSheet.cssText = style.parts .filter(Boolean) .join('\n'); } else { var textNode = document.createTextNode(code); var nodes = style.element.childNodes; if (nodes[index]) { style.element.removeChild(nodes[index]); } if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); } else { style.element.appendChild(textNode); } } } } } /* style inject SSR */ var InputHead = __vue_normalize__$7( { render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 }, __vue_inject_styles__$7, __vue_script__$7, __vue_scope_id__$7, __vue_is_functional_template__$7, __vue_module_identifier__$7,