UNPKG

ys-ui-test3

Version:

A rich interaction, lightweight, high performance UI library based on Weex

1,517 lines (1,289 loc) 86.9 kB
// { "framework": "Vue" } (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["npm/ys-ui-test3/index"] = factory(); else root["npm/ys-ui-test3/index"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // identity function for calling harmony imports with the correct context /******/ __webpack_require__.i = function(value) { return value; }; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/"; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 5); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var _urlParse = __webpack_require__(10); var _urlParse2 = _interopRequireDefault(_urlParse); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Utils = { UrlParser: _urlParse2.default, _typeof: function _typeof(obj) { return Object.prototype.toString.call(obj).slice(8, -1).toLowerCase(); }, isPlainObject: function isPlainObject(obj) { return Utils._typeof(obj) === 'object'; }, isString: function isString(obj) { return typeof obj === 'string'; }, isNonEmptyArray: function isNonEmptyArray() { var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; return obj && obj.length > 0 && Array.isArray(obj) && typeof obj !== 'undefined'; }, isObject: function isObject(item) { return item && (typeof item === 'undefined' ? 'undefined' : _typeof2(item)) === 'object' && !Array.isArray(item); }, isEmptyObject: function isEmptyObject(obj) { return Object.keys(obj).length === 0 && obj.constructor === Object; }, decodeIconFont: function decodeIconFont(text) { // 正则匹配 图标和文字混排 eg: 我去上学校&#xe600;,天天不&#xe600;迟到 var regExp = /&#x[a-z|0-9]{4,5};?/g; if (regExp.test(text)) { return text.replace(new RegExp(regExp, 'g'), function (iconText) { var replace = iconText.replace(/&#x/, '0x').replace(/;$/, ''); return String.fromCharCode(replace); }); } else { return text; } }, mergeDeep: function mergeDeep(target) { for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { sources[_key - 1] = arguments[_key]; } if (!sources.length) return target; var source = sources.shift(); if (Utils.isObject(target) && Utils.isObject(source)) { for (var key in source) { if (Utils.isObject(source[key])) { if (!target[key]) { Object.assign(target, _defineProperty({}, key, {})); } Utils.mergeDeep(target[key], source[key]); } else { Object.assign(target, _defineProperty({}, key, source[key])); } } } return Utils.mergeDeep.apply(Utils, [target].concat(sources)); }, appendProtocol: function appendProtocol(url) { if (/^\/\//.test(url)) { var bundleUrl = weex.config.bundleUrl; return 'http' + (/^https:/.test(bundleUrl) ? 's' : '') + ':' + url; } return url; }, encodeURLParams: function encodeURLParams(url) { var parsedUrl = new _urlParse2.default(url, true); return parsedUrl.toString(); }, goToH5Page: function goToH5Page(jumpUrl) { var animated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; var Navigator = weex.requireModule('navigator'); var jumpUrlObj = new Utils.UrlParser(jumpUrl, true); var url = Utils.appendProtocol(jumpUrlObj.toString()); Navigator.push({ url: Utils.encodeURLParams(url), animated: animated.toString() }, callback); }, env: { isTaobao: function isTaobao() { var appName = weex.config.env.appName; return (/(tb|taobao|淘宝)/i.test(appName) ); }, isTrip: function isTrip() { var appName = weex.config.env.appName; return appName === 'LX'; }, isBoat: function isBoat() { var appName = weex.config.env.appName; return appName === 'Boat' || appName === 'BoatPlayground'; }, isWeb: function isWeb() { var platform = weex.config.env.platform; return (typeof window === 'undefined' ? 'undefined' : _typeof2(window)) === 'object' && platform.toLowerCase() === 'web'; }, isIOS: function isIOS() { var platform = weex.config.env.platform; return platform.toLowerCase() === 'ios'; }, /** * 是否为 iPhone X or iPhoneXS or iPhoneXR or iPhoneXS Max * @returns {boolean} */ isIPhoneX: function isIPhoneX() { var deviceHeight = weex.config.env.deviceHeight; if (Utils.env.isWeb()) { return (typeof window === 'undefined' ? 'undefined' : _typeof2(window)) !== undefined && window.screen && window.screen.width && window.screen.height && (parseInt(window.screen.width, 10) === 375 && parseInt(window.screen.height, 10) === 812 || parseInt(window.screen.width, 10) === 414 && parseInt(window.screen.height, 10) === 896); } return Utils.env.isIOS() && (deviceHeight === 2436 || deviceHeight === 2688 || deviceHeight === 1792 || deviceHeight === 1624); }, isAndroid: function isAndroid() { var platform = weex.config.env.platform; return platform.toLowerCase() === 'android'; }, isTmall: function isTmall() { var appName = weex.config.env.appName; return (/(tm|tmall|天猫)/i.test(appName) ); }, isAliWeex: function isAliWeex() { return Utils.env.isTmall() || Utils.env.isTrip() || Utils.env.isTaobao(); }, /** * 获取weex屏幕真实的设置高度,需要减去导航栏高度 * @returns {Number} */ getPageHeight: function getPageHeight() { var env = weex.config.env; var navHeight = Utils.env.isWeb() ? 0 : Utils.env.isIPhoneX() ? 176 : 132; return env.deviceHeight / env.deviceWidth * 750 - navHeight; }, /** * 获取weex屏幕真实的设置高度 * @returns {Number} */ getScreenHeight: function getScreenHeight() { var env = weex.config.env; return env.deviceHeight / env.deviceWidth * 750; } }, /** * 版本号比较 * @memberOf Utils * @param currVer {string} * @param promoteVer {string} * @returns {boolean} * @example * * const { Utils } = require('@ali/wx-bridge'); * const { compareVersion } = Utils; * console.log(compareVersion('0.1.100', '0.1.11')); // 'true' */ compareVersion: function compareVersion() { var currVer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '0.0.0'; var promoteVer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0.0.0'; if (currVer === promoteVer) return true; var currVerArr = currVer.split('.'); var promoteVerArr = promoteVer.split('.'); var len = Math.max(currVerArr.length, promoteVerArr.length); for (var i = 0; i < len; i++) { var proVal = ~~promoteVerArr[i]; var curVal = ~~currVerArr[i]; if (proVal < curVal) { return true; } else if (proVal > curVal) { return false; } } return false; }, /** * 分割数组 * @param arr 被分割数组 * @param size 分割数组的长度 * @returns {Array} */ arrayChunk: function arrayChunk() { var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4; var groups = []; if (arr && arr.length > 0) { groups = arr.map(function (e, i) { return i % size === 0 ? arr.slice(i, i + size) : null; }).filter(function (e) { return e; }); } return groups; }, /* * 截断字符串 * @param str 传入字符串 * @param len 截断长度 * @param hasDot 末尾是否... * @returns {String} */ truncateString: function truncateString(str, len) { var hasDot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; var newLength = 0; var newStr = ''; var singleChar = ''; var chineseRegex = /[^\x00-\xff]/g; var strLength = str.replace(chineseRegex, '**').length; for (var i = 0; i < strLength; i++) { singleChar = str.charAt(i).toString(); if (singleChar.match(chineseRegex) !== null) { newLength += 2; } else { newLength++; } if (newLength > len) { break; } newStr += singleChar; } if (hasDot && strLength > len) { newStr += '...'; } return newStr; }, /* * 转换 obj 为 url params参数 * @param obj 传入字符串 * @returns {String} */ objToParams: function objToParams(obj) { var str = ''; for (var key in obj) { if (str !== '') { str += '&'; } str += key + '=' + encodeURIComponent(obj[key]); } return str; }, /* * 转换 url params参数为obj * @param str 传入url参数字符串 * @returns {Object} */ paramsToObj: function paramsToObj(str) { var obj = {}; try { obj = JSON.parse('{"' + decodeURI(str).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}'); } catch (e) { console.log(e); } return obj; }, animation: { /** * 返回定义页面转场动画起初的位置 * @param ref * @param transform 运动类型 * @param status * @param callback 回调函数 */ pageTransitionAnimation: function pageTransitionAnimation(ref, transform, status, callback) { var animation = weex.requireModule('animation'); animation.transition(ref, { styles: { transform: transform }, duration: status ? 250 : 300, // ms timingFunction: status ? 'ease-in' : 'ease-out', delay: 0 // ms }, function () { callback && callback(); }); } }, uiStyle: { /** * 返回定义页面转场动画起初的位置 * @param animationType 页面转场动画的类型 push,model * @param size 分割数组的长度 * @returns {} */ pageTransitionAnimationStyle: function pageTransitionAnimationStyle(animationType) { if (animationType === 'push') { return { left: '750px', top: '0px', height: weex.config.env.deviceHeight / weex.config.env.deviceWidth * 750 + 'px' }; } else if (animationType === 'model') { return { top: weex.config.env.deviceHeight / weex.config.env.deviceWidth * 750 + 'px', left: '0px', height: weex.config.env.deviceHeight / weex.config.env.deviceWidth * 750 + 'px' }; } return {}; } } }; exports.default = Utils; /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _bindEnv = __webpack_require__(7); Object.defineProperty(exports, 'default', { enumerable: true, get: function get() { return _interopRequireDefault(_bindEnv).default; } }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _index = __webpack_require__(11); Object.defineProperty(exports, 'default', { enumerable: true, get: function get() { return _interopRequireDefault(_index).default; } }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(4)(true); // imports // module exports.push([module.i, "\n.ys-fixed[data-v-2105a679] {\n width: 10rem;\n position: fixed;\n z-index: 1;\n}\n.ys-mask[data-v-2105a679]{\n left:0;\n top:0;\n z-index:99999;\n}\n.ys-overlay[data-v-2105a679]{\n width: 10rem;\n position: fixed;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n opacity: 1;\n background-color: rgba(0, 0, 0, 0.6);\n}\n.ys-mask-body[data-v-2105a679]{\n top:0.66667rem;\n}\n.wxc-mask-content[data-v-2105a679]{\n -webkit-box-align: center;\n -webkit-align-items: center;\n align-items: center;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n}\n.ys-mask-img[data-v-2105a679] {\n position: relative;\n width: 8.69333rem;\n height: 11.46667rem;\n border-radius: 0.10667rem;\n}\n.ys-mask-close[data-v-2105a679]{\n margin-top:0.26667rem;\n width:1.33333rem;\n height:1.33333rem;\n background-size: 100%;\n}\n", "", {"version":3,"sources":["/李宁宁/npm-package/packages/ys-mask/index.vue?004bc33e"],"names":[],"mappings":";AA8DA;EACA,aAAA;IACA,gBAAA;IACA,WAAA;CACA;AACA;IACA,OAAA;IACA,MAAA;IACA,cAAA;CACA;AACA;EACA,aAAA;IACA,gBAAA;IACA,UAAA;IACA,SAAA;IACA,YAAA;IACA,WAAA;IACA,WAAA;IACA,qCAAA;CACA;AACA;EACA,eAAA;CACA;AACA;EACA,0BAAA;EAAA,4BAAA;UAAA,oBAAA;EACA,yBAAA;EAAA,gCAAA;UAAA,wBAAA;CACA;AACA;IACA,mBAAA;IACA,kBAAA;IACA,oBAAA;IACA,0BAAA;CACA;AACA;EACA,sBAAA;EACA,iBAAA;EACA,kBAAA;EACA,sBAAA;CACA","file":"index.vue","sourcesContent":["<template>\n <div class=\"ys-fixed ys-mask\" v-if=\"show\">\n <div class=\"ys-overlay\">\n <div class=\"ys-mask-body\">\n <div class=\"wxc-mask-content\">\n <image class=\"ys-mask-img\" :src=\"imgUrl\" ></image>\n </div>\n <div class=\"wxc-mask-content\" v-if=\"showClose\">\n <image @click=\"hideMask()\" class=\"ys-mask-close\" :src=\"closeImg\" ></image>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n\n<script>\n\n \n export default {\n props:{\n maskStyle:{ \n type:Object,\n default:{\n height:\"860\",\n width:\"652\",\n borderRadius:\"40\",\n maskBgColor:\"rgba(0, 0, 0, 0.5)\"\n }\n },\n closeImg:{\n type:String,\n default:\"https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1872499223,1735817819&fm=26&gp=0.jpg\"\n },\n imgUrl:{\n type:String,\n default:\"https://oss-upload.hz5800.com/common/weex/lzcj/image/2020/3/19/1584613666546655833.png\"\n },\n show:{\n type:Boolean,\n default:false\n },\n showClose:{\n type:Boolean,\n default:true\n }\n\n },\n data(){\n return {\n \n }\n },\n methods: {\n hideMask(){\n this.$emit('hideMask',false)\n }\n }\n };\n</script>\n\n<style scoped>\n .ys-fixed {\n width: 750px;\n position: fixed;\n z-index: 1;\n }\n .ys-mask{\n left:0;\n top:0;\n z-index:99999;\n }\n .ys-overlay{\n width: 750px;\n position: fixed;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n opacity: 1;\n background-color: rgba(0, 0, 0, 0.6);\n }\n .ys-mask-body{\n top:50px;\n }\n .wxc-mask-content{\n align-items: center;\n justify-content: center;\n }\n .ys-mask-img {\n position: relative;\n width: 652px;\n height: 860px;\n border-radius: 8px;\n }\n .ys-mask-close{\n margin-top:20px;\n width:100px;\n height:100px;\n background-size: 100%;\n }\n</style>"],"sourceRoot":""}]); // exports /***/ }), /* 4 */ /***/ (function(module, exports) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function(useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if(item[2]) { return "@media " + item[2] + "{" + content + "}"; } else { return content; } }).join(""); }; // import a list of modules into the list list.i = function(modules, mediaQuery) { if(typeof modules === "string") modules = [[null, modules, ""]]; var alreadyImportedModules = {}; for(var i = 0; i < this.length; i++) { var id = this[i][0]; if(typeof id === "number") alreadyImportedModules[id] = true; } for(i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { if(mediaQuery && !item[2]) { item[2] = mediaQuery; } else if(mediaQuery) { item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; } /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.YsMask = exports.Utils = exports.BindEnv = undefined; var _bindEnv = __webpack_require__(1); var _bindEnv2 = _interopRequireDefault(_bindEnv); var _utils = __webpack_require__(0); var _utils2 = _interopRequireDefault(_utils); var _ysMask = __webpack_require__(2); var _ysMask2 = _interopRequireDefault(_ysMask); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.BindEnv = _bindEnv2.default; exports.Utils = _utils2.default; exports.YsMask = _ysMask2.default; /** * Created by Tw93 on 17/09/25 */ /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // // // // // // // // // // // // // // // // exports.default = { props: { maskStyle: { type: Object, default: { height: "860", width: "652", borderRadius: "40", maskBgColor: "rgba(0, 0, 0, 0.5)" } }, closeImg: { type: String, default: "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1872499223,1735817819&fm=26&gp=0.jpg" }, imgUrl: { type: String, default: "https://oss-upload.hz5800.com/common/weex/lzcj/image/2020/3/19/1584613666546655833.png" }, show: { type: Boolean, default: false }, showClose: { type: Boolean, default: true } }, data: function data() { return {}; }, methods: { hideMask: function hideMask() { this.$emit('hideMask', false); } } }; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _indexWeex = __webpack_require__(17); var _indexWeex2 = _interopRequireDefault(_indexWeex); var _index = __webpack_require__(0); var _index2 = _interopRequireDefault(_index); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ var BindEnv = { supportsEB: function supportsEB() { return _indexWeex2.default.isSupportBinding && !_index2.default.env.isWeb(); }, /** * 判断Android容器是否支持是否支持expressionBinding(处理方式很不一致) * @returns {boolean} */ supportsEBForAndroid: function supportsEBForAndroid() { return _index2.default.env.isAndroid() && BindEnv.supportsEB(); }, /** * 判断IOS容器是否支持是否支持expressionBinding * @returns {boolean} */ supportsEBForIos: function supportsEBForIos() { return _index2.default.env.isIOS() && BindEnv.supportsEB(); } }; exports.default = BindEnv; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var has = Object.prototype.hasOwnProperty , undef; /** * Decode a URI encoded string. * * @param {String} input The URI encoded string. * @returns {String|Null} The decoded string. * @api private */ function decode(input) { try { return decodeURIComponent(input.replace(/\+/g, ' ')); } catch (e) { return null; } } /** * Attempts to encode a given input. * * @param {String} input The string that needs to be encoded. * @returns {String|Null} The encoded string. * @api private */ function encode(input) { try { return encodeURIComponent(input); } catch (e) { return null; } } /** * Simple query string parser. * * @param {String} query The query string that needs to be parsed. * @returns {Object} * @api public */ function querystring(query) { var parser = /([^=?&]+)=?([^&]*)/g , result = {} , part; while (part = parser.exec(query)) { var key = decode(part[1]) , value = decode(part[2]); // // Prevent overriding of existing properties. This ensures that build-in // methods like `toString` or __proto__ are not overriden by malicious // querystrings. // // In the case if failed decoding, we want to omit the key/value pairs // from the result. // if (key === null || value === null || key in result) continue; result[key] = value; } return result; } /** * Transform a query string to an object. * * @param {Object} obj Object that should be transformed. * @param {String} prefix Optional prefix. * @returns {String} * @api public */ function querystringify(obj, prefix) { prefix = prefix || ''; var pairs = [] , value , key; // // Optionally prefix with a '?' if needed // if ('string' !== typeof prefix) prefix = '?'; for (key in obj) { if (has.call(obj, key)) { value = obj[key]; // // Edge cases where we actually want to encode the value to an empty // string instead of the stringified value. // if (!value && (value === null || value === undef || isNaN(value))) { value = ''; } key = encodeURIComponent(key); value = encodeURIComponent(value); // // If we failed to encode the strings, we should bail out as we don't // want to add invalid strings to the query. // if (key === null || value === null) continue; pairs.push(key +'='+ value); } } return pairs.length ? prefix + pairs.join('&') : ''; } // // Expose the module. // exports.stringify = querystringify; exports.parse = querystring; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Check if we're required to add a port number. * * @see https://url.spec.whatwg.org/#default-port * @param {Number|String} port Port number we need to check * @param {String} protocol Protocol we need to check against. * @returns {Boolean} Is it a default port for the given protocol * @api private */ module.exports = function required(port, protocol) { protocol = protocol.split(':')[0]; port = +port; if (!port) return false; switch (protocol) { case 'http': case 'ws': return port !== 80; case 'https': case 'wss': return port !== 443; case 'ftp': return port !== 21; case 'gopher': return port !== 70; case 'file': return false; } return port !== 0; }; /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var required = __webpack_require__(9) , qs = __webpack_require__(8) , protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//; /** * These are the parse rules for the URL parser, it informs the parser * about: * * 0. The char it Needs to parse, if it's a string it should be done using * indexOf, RegExp using exec and NaN means set as current value. * 1. The property we should set when parsing this value. * 2. Indication if it's backwards or forward parsing, when set as number it's * the value of extra chars that should be split off. * 3. Inherit from location if non existing in the parser. * 4. `toLowerCase` the resulting value. */ var rules = [ ['#', 'hash'], // Extract from the back. ['?', 'query'], // Extract from the back. function sanitize(address) { // Sanitize what is left of the address return address.replace('\\', '/'); }, ['/', 'pathname'], // Extract from the back. ['@', 'auth', 1], // Extract from the front. [NaN, 'host', undefined, 1, 1], // Set left over value. [/:(\d+)$/, 'port', undefined, 1], // RegExp the back. [NaN, 'hostname', undefined, 1, 1] // Set left over. ]; /** * These properties should not be copied or inherited from. This is only needed * for all non blob URL's as a blob URL does not include a hash, only the * origin. * * @type {Object} * @private */ var ignore = { hash: 1, query: 1 }; /** * The location object differs when your code is loaded through a normal page, * Worker or through a worker using a blob. And with the blobble begins the * trouble as the location object will contain the URL of the blob, not the * location of the page where our code is loaded in. The actual origin is * encoded in the `pathname` so we can thankfully generate a good "default" * location from it so we can generate proper relative URL's again. * * @param {Object|String} loc Optional default location object. * @returns {Object} lolcation object. * @public */ function lolcation(loc) { var globalVar; if (typeof window !== 'undefined') globalVar = window; else if (typeof {} !== 'undefined') globalVar = {}; else if (typeof self !== 'undefined') globalVar = self; else globalVar = {}; var location = globalVar.location || {}; loc = loc || location; var finaldestination = {} , type = typeof loc , key; if ('blob:' === loc.protocol) { finaldestination = new Url(unescape(loc.pathname), {}); } else if ('string' === type) { finaldestination = new Url(loc, {}); for (key in ignore) delete finaldestination[key]; } else if ('object' === type) { for (key in loc) { if (key in ignore) continue; finaldestination[key] = loc[key]; } if (finaldestination.slashes === undefined) { finaldestination.slashes = slashes.test(loc.href); } } return finaldestination; } /** * @typedef ProtocolExtract * @type Object * @property {String} protocol Protocol matched in the URL, in lowercase. * @property {Boolean} slashes `true` if protocol is followed by "//", else `false`. * @property {String} rest Rest of the URL that is not part of the protocol. */ /** * Extract protocol information from a URL with/without double slash ("//"). * * @param {String} address URL we want to extract from. * @return {ProtocolExtract} Extracted information. * @private */ function extractProtocol(address) { var match = protocolre.exec(address); return { protocol: match[1] ? match[1].toLowerCase() : '', slashes: !!match[2], rest: match[3] }; } /** * Resolve a relative URL pathname against a base URL pathname. * * @param {String} relative Pathname of the relative URL. * @param {String} base Pathname of the base URL. * @return {String} Resolved pathname. * @private */ function resolve(relative, base) { var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/')) , i = path.length , last = path[i - 1] , unshift = false , up = 0; while (i--) { if (path[i] === '.') { path.splice(i, 1); } else if (path[i] === '..') { path.splice(i, 1); up++; } else if (up) { if (i === 0) unshift = true; path.splice(i, 1); up--; } } if (unshift) path.unshift(''); if (last === '.' || last === '..') path.push(''); return path.join('/'); } /** * The actual URL instance. Instead of returning an object we've opted-in to * create an actual constructor as it's much more memory efficient and * faster and it pleases my OCD. * * It is worth noting that we should not use `URL` as class name to prevent * clashes with the global URL instance that got introduced in browsers. * * @constructor * @param {String} address URL we want to parse. * @param {Object|String} [location] Location defaults for relative paths. * @param {Boolean|Function} [parser] Parser for the query string. * @private */ function Url(address, location, parser) { if (!(this instanceof Url)) { return new Url(address, location, parser); } var relative, extracted, parse, instruction, index, key , instructions = rules.slice() , type = typeof location , url = this , i = 0; // // The following if statements allows this module two have compatibility with // 2 different API: // // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments // where the boolean indicates that the query string should also be parsed. // // 2. The `URL` interface of the browser which accepts a URL, object as // arguments. The supplied object will be used as default values / fall-back // for relative paths. // if ('object' !== type && 'string' !== type) { parser = location; location = null; } if (parser && 'function' !== typeof parser) parser = qs.parse; location = lolcation(location); // // Extract protocol information before running the instructions. // extracted = extractProtocol(address || ''); relative = !extracted.protocol && !extracted.slashes; url.slashes = extracted.slashes || relative && location.slashes; url.protocol = extracted.protocol || location.protocol || ''; address = extracted.rest; // // When the authority component is absent the URL starts with a path // component. // if (!extracted.slashes) instructions[3] = [/(.*)/, 'pathname']; for (; i < instructions.length; i++) { instruction = instructions[i]; if (typeof instruction === 'function') { address = instruction(address); continue; } parse = instruction[0]; key = instruction[1]; if (parse !== parse) { url[key] = address; } else if ('string' === typeof parse) { if (~(index = address.indexOf(parse))) { if ('number' === typeof instruction[2]) { url[key] = address.slice(0, index); address = address.slice(index + instruction[2]); } else { url[key] = address.slice(index); address = address.slice(0, index); } } } else if ((index = parse.exec(address))) { url[key] = index[1]; address = address.slice(0, index.index); } url[key] = url[key] || ( relative && instruction[3] ? location[key] || '' : '' ); // // Hostname, host and protocol should be lowercased so they can be used to // create a proper `origin`. // if (instruction[4]) url[key] = url[key].toLowerCase(); } // // Also parse the supplied query string in to an object. If we're supplied // with a custom parser as function use that instead of the default build-in // parser. // if (parser) url.query = parser(url.query); // // If the URL is relative, resolve the pathname against the base URL. // if ( relative && location.slashes && url.pathname.charAt(0) !== '/' && (url.pathname !== '' || location.pathname !== '') ) { url.pathname = resolve(url.pathname, location.pathname); } // // We should not add port numbers if they are already the default port number // for a given protocol. As the host also contains the port number we're going // override it with the hostname which contains no port number. // if (!required(url.port, url.protocol)) { url.host = url.hostname; url.port = ''; } // // Parse down the `auth` for the username and password. // url.username = url.password = ''; if (url.auth) { instruction = url.auth.split(':'); url.username = instruction[0] || ''; url.password = instruction[1] || ''; } url.origin = url.protocol && url.host && url.protocol !== 'file:' ? url.protocol +'//'+ url.host : 'null'; // // The href is just the compiled result. // url.href = url.toString(); } /** * This is convenience method for changing properties in the URL instance to * insure that they all propagate correctly. * * @param {String} part Property we need to adjust. * @param {Mixed} value The newly assigned value. * @param {Boolean|Function} fn When setting the query, it will be the function * used to parse the query. * When setting the protocol, double slash will be * removed from the final url if it is true. * @returns {URL} URL instance for chaining. * @public */ function set(part, value, fn) { var url = this; switch (part) { case 'query': if ('string' === typeof value && value.length) { value = (fn || qs.parse)(value); } url[part] = value; break; case 'port': url[part] = value; if (!required(value, url.protocol)) { url.host = url.hostname; url[part] = ''; } else if (value) { url.host = url.hostname +':'+ value; } break; case 'hostname': url[part] = value; if (url.port) value += ':'+ url.port; url.host = value; break; case 'host': url[part] = value; if (/:\d+$/.test(value)) { value = value.split(':'); url.port = value.pop(); url.hostname = value.join(':'); } else { url.hostname = value; url.port = ''; } break; case 'protocol': url.protocol = value.toLowerCase(); url.slashes = !fn; break; case 'pathname': case 'hash': if (value) { var char = part === 'pathname' ? '/' : '#'; url[part] = value.charAt(0) !== char ? char + value : value; } else { url[part] = value; } break; default: url[part] = value; } for (var i = 0; i < rules.length; i++) { var ins = rules[i]; if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase(); } url.origin = url.protocol && url.host && url.protocol !== 'file:' ? url.protocol +'//'+ url.host : 'null'; url.href = url.toString(); return url; } /** * Transform the properties back in to a valid and full URL string. * * @param {Function} stringify Optional query stringify function. * @returns {String} Compiled version of the URL. * @public */ function toString(stringify) { if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify; var query , url = this , protocol = url.protocol; if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':'; var result = protocol + (url.slashes ? '//' : ''); if (url.username) { result += url.username; if (url.password) result += ':'+ url.password; result += '@'; } result += url.host + url.pathname; query = 'object' === typeof url.query ? stringify(url.query) : url.query; if (query) result += '?' !== query.charAt(0) ? '?'+ query : query; if (url.hash) result += url.hash; return result; } Url.prototype = { set: set, toString: toString }; // // Expose the URL parser and some additional properties that might be useful for // others or testing. // Url.extractProtocol = extractProtocol; Url.location = lolcation; Url.qs = qs; module.exports = Url; /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { var disposed = false function injectStyle (ssrContext) { if (disposed) return __webpack_require__(14) } var Component = __webpack_require__(12)( /* script */ __webpack_require__(6), /* template */ __webpack_require__(13), /* styles */ injectStyle, /* scopeId */ "data-v-2105a679", /* moduleIdentifier (server only) */ null ) Component.options.__file = "/李宁宁/npm-package/packages/ys-mask/index.vue" if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")} if (Component.options.functional) {console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions.")} /* hot reload */ if (false) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), false) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-2105a679", Component.options) } else { hotAPI.reload("data-v-2105a679", Component.options) } module.hot.dispose(function (data) { disposed = true }) })()} module.exports = Component.exports /***/ }), /* 12 */ /***/ (function(module, exports) { /* globals __VUE_SSR_CONTEXT__ */ // this module is a runtime utility for cleaner component module output and will // be included in the final webpack user bundle module.exports = function normalizeComponent ( rawScriptExports, compiledTemplate, injectStyles, scopeId, moduleIdentifier /* server only */ ) { var esModule var scriptExports = rawScriptExports = rawScriptExports || {} // ES6 modules interop var type = typeof rawScriptExports.default if (type === 'object' || type === 'function') { esModule = rawScriptExports scriptExports = rawScriptExports.default } // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // render functions if (compiledTemplate) { options.render = compiledTemplate.render options.staticRenderFns = compiledTemplate.staticRenderFns } // scopedId if (scopeId) { options._scopeId = scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = injectStyles } if (hook) { var functional = options.functional var existing = functional ? options.render : options.beforeCreate if (!functional) { // inject component registration as beforeCreate hook options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } else { // register for functioal component in vue file options.render = function renderWithStyleInjection (h, context) { hook.call(context) return existing(h, context) } } } return { esModule: esModule, exports: scriptExports, options: options } } /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return (_vm.show) ? _c('div', { staticClass: "ys-fixed ys-mask weex-ct weex-div", attrs: { "weex-type": "div" } }, [_c('div', { staticClass: "ys-overlay weex-ct weex-div", attrs: { "weex-type": "div" } }, [_c('div', { staticClass: "ys-mask-body weex-ct weex-div", attrs: {