weex-plugin-weex-actionsheet
Advanced tools
Comparing version 1.2.2 to 1.2.3
{ | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"platform": [ | ||
"ios" | ||
], | ||
"description": "weex actionsheet", | ||
"description": "weex actionSheet", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "weex", |
1235
web/index.js
@@ -0,4 +1,1233 @@ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(); | ||
else if(typeof define === 'function' && define.amd) | ||
define([], factory); | ||
else { | ||
var a = factory(); | ||
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; | ||
} | ||
})(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 = 15); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ (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() { | ||
var list = []; | ||
// return the list of modules as css string | ||
list.toString = function toString() { | ||
var result = []; | ||
for(var i = 0; i < this.length; i++) { | ||
var item = this[i]; | ||
if(item[2]) { | ||
result.push("@media " + item[2] + "{" + item[1] + "}"); | ||
} else { | ||
result.push(item[1]); | ||
} | ||
} | ||
return result.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; | ||
}; | ||
/***/ }), | ||
/* 1 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = { | ||
actionSheet: [{ | ||
name: 'create', | ||
args: ['object', 'string'] | ||
}] | ||
}; | ||
/***/ }), | ||
/* 2 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var CANCEL_TYPE = 1; | ||
exports.default = { | ||
findCancel: function findCancel(arr) { | ||
var flag = false; | ||
for (var i = 0; i < arr.length; i++) { | ||
if (arr[i].type === CANCEL_TYPE) { | ||
flag = arr[i]['message']; | ||
} | ||
} | ||
return flag; | ||
}, | ||
filterData: function filterData(arr) { | ||
var data = []; | ||
arr.forEach(function (item) { | ||
if (item.type !== CANCEL_TYPE) { | ||
data.push(item); | ||
} | ||
}); | ||
return data; | ||
} | ||
}; | ||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var GLOBAL_CLASS_PREFIX = 'as-'; | ||
var TYPE_WARNING = 2; | ||
__webpack_require__(9); | ||
var ActionSheet = function () { | ||
function ActionSheet(opts) { | ||
_classCallCheck(this, ActionSheet); | ||
var options = opts.data(); | ||
this.clickHandle = options.callback; | ||
var container = document.createElement('div'); | ||
container.className = 'as-container'; | ||
var dialog = this.createEle('dialog'); | ||
this.createTitle(options.title, options.message, dialog); | ||
this.createList(options.items, dialog); | ||
if (options.hasCancel) { | ||
this.createCancelButton(dialog, options.hasCancel); | ||
} | ||
container.appendChild(dialog); | ||
this.$el = container; | ||
} | ||
_createClass(ActionSheet, [{ | ||
key: 'createTitle', | ||
value: function createTitle(title, message, container) { | ||
var hd = this.createEle('hd'); | ||
hd.appendChild(this.createEle('title', title)); | ||
hd.appendChild(this.createEle('message', message)); | ||
container.appendChild(hd); | ||
} | ||
}, { | ||
key: 'createEle', | ||
value: function createEle(className, text) { | ||
var el = document.createElement('div'); | ||
el.className = className ? GLOBAL_CLASS_PREFIX + className : ''; | ||
if (text) { | ||
el.appendChild(document.createTextNode(text)); | ||
} | ||
return el; | ||
} | ||
}, { | ||
key: 'createList', | ||
value: function createList(data, container) { | ||
var _this = this; | ||
data.forEach(function (item, index) { | ||
var btn = _this.createEle('btn'); | ||
if (index === data.length - 1) { | ||
btn.classList.add(GLOBAL_CLASS_PREFIX + 'btn-last'); | ||
} | ||
var btnText = document.createElement('p'); | ||
btnText.className = GLOBAL_CLASS_PREFIX + 'btn-text'; | ||
btnText.appendChild(document.createTextNode(item.message)); | ||
if (item.type === TYPE_WARNING) { | ||
btnText.classList.add(GLOBAL_CLASS_PREFIX + 'text-warn'); | ||
} | ||
btn.appendChild(btnText); | ||
_this.addEvent(btn, index, item.message); | ||
container.appendChild(btn); | ||
}); | ||
} | ||
}, { | ||
key: 'createCancelButton', | ||
value: function createCancelButton(container, text) { | ||
var _this2 = this; | ||
var btn = this.createEle('btn'); | ||
btn.classList.add(GLOBAL_CLASS_PREFIX + 'cancel'); | ||
var btnText = document.createElement('p'); | ||
btnText.className = GLOBAL_CLASS_PREFIX + 'btn-text'; | ||
btnText.appendChild(document.createTextNode(text)); | ||
btn.appendChild(btnText); | ||
btn.addEventListener('click', function () { | ||
_this2.cancel(); | ||
}, false); | ||
container.appendChild(btn); | ||
} | ||
}, { | ||
key: 'addEvent', | ||
value: function addEvent(btn, index, msg) { | ||
var _this3 = this; | ||
btn.addEventListener('click', function () { | ||
console.log(index); | ||
_this3.clickHandle({ | ||
result: 'success', | ||
data: { | ||
message: msg, | ||
index: index | ||
} | ||
}); | ||
_this3.cancel(); | ||
}, false); | ||
} | ||
}, { | ||
key: 'cancel', | ||
value: function cancel() { | ||
var el = document.querySelector('.as-container'); | ||
if (el) { | ||
el.remove(); | ||
} | ||
} | ||
}]); | ||
return ActionSheet; | ||
}(); | ||
module.exports = ActionSheet; | ||
/***/ }), | ||
/* 4 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/* styles */ | ||
__webpack_require__(12) | ||
var Component = __webpack_require__(10)( | ||
/* script */ | ||
__webpack_require__(5), | ||
/* template */ | ||
__webpack_require__(11), | ||
/* scopeId */ | ||
null, | ||
/* cssModules */ | ||
null | ||
) | ||
Component.options.__file = "/Users/ali-130257n/www/weex-actionSheet/web/src/vue/action-sheet.vue" | ||
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")} | ||
if (Component.options.functional) {console.error("[vue-loader] action-sheet.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-18fee04b", Component.options) | ||
} else { | ||
hotAPI.reload("data-v-18fee04b", Component.options) | ||
} | ||
})()} | ||
module.exports = Component.exports | ||
/***/ }), | ||
/* 5 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
// | ||
module.exports = { | ||
data: function data() { | ||
return { | ||
message: 'your message', | ||
title: 'title' | ||
}; | ||
}, | ||
methods: { | ||
cancel: function cancel() { | ||
var el = document.querySelector('.as-container'); | ||
if (el) { | ||
el.remove(); | ||
} | ||
}, | ||
ok: function ok(index) { | ||
this.callback({ | ||
result: 'success', | ||
data: { | ||
message: this.message, | ||
index: index | ||
} | ||
}); | ||
this.cancel(); | ||
} | ||
} | ||
}; | ||
/***/ }), | ||
/* 6 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
exports = module.exports = __webpack_require__(0)(); | ||
// imports | ||
// module | ||
exports.push([module.i, "\n.as-container{\n flex:1;\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: rgba(0,0,0,.5);\n}\n.as-dialog{\n position: absolute;\n left: 10px;\n right: 10px;\n bottom: 10px;\n padding: 20px;\n}\n.as-hd{\n padding: 20px 0;\n background-color: #fff;\n align-items: center;\n border-top-left-radius: 15px;\n border-top-right-radius: 15px;\n}\n.as-title{\n font-size: 26px;\n margin-bottom: 15px;\n}\n.as-message{\n font-size: 24px;\n}\n.as-btn{\n font-size: 30px;\n padding: 30px 0;\n background-color: #fff;\n border-top: 1px solid #ddd;\n}\n.as-btn-text{\n flex:1;\n text-align: center;\n color: #1ba1e2;\n}\n.as-btn-last{\n border-bottom-right-radius: 15px;\n border-bottom-left-radius: 15px;\n}\n.as-text-warn{\n color: red;\n}\n.as-cancel{\n margin-top: 30px;\n border-radius: 15px;\n}\n", ""]); | ||
// exports | ||
/***/ }), | ||
/* 7 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
exports = module.exports = __webpack_require__(0)(); | ||
// imports | ||
// module | ||
exports.push([module.i, ".as-container{\n flex:1;\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: rgba(0,0,0,.5); \n }\n .as-dialog{\n position: absolute;\n left: 10px;\n right: 10px;\n bottom: 10px;\n padding: 20px;\n \n }\n .as-hd{\n padding: 20px 0;\n background-color: #fff;\n align-items: center;\n border-top-left-radius: 15px;\n border-top-right-radius: 15px;\n text-align: center;\n }\n .as-title{\n font-size: 26px;\n margin-bottom: 15px;\n \n }\n .as-message{\n font-size: 24px;\n }\n .as-btn{\n font-size: 30px;\n padding: 30px 0;\n background-color: #fff;\n border-top: 1px solid #ddd;\n \n }\n .as-btn-text{\n flex:1;\n text-align: center;\n color: #1ba1e2;\n }\n .as-btn-last{\n border-bottom-right-radius: 15px;\n border-bottom-left-radius: 15px;\n }\n .as-text-warn{\n color: red;\n }\n .as-cancel{\n margin-top: 30px;\n border-radius: 15px;\n }", ""]); | ||
// exports | ||
/***/ }), | ||
/* 8 */ | ||
/***/ (function(module, exports) { | ||
/* | ||
MIT License http://www.opensource.org/licenses/mit-license.php | ||
Author Tobias Koppers @sokra | ||
*/ | ||
var stylesInDom = {}, | ||
memoize = function(fn) { | ||
var memo; | ||
return function () { | ||
if (typeof memo === "undefined") memo = fn.apply(this, arguments); | ||
return memo; | ||
}; | ||
}, | ||
isOldIE = memoize(function() { | ||
return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase()); | ||
}), | ||
getHeadElement = memoize(function () { | ||
return document.head || document.getElementsByTagName("head")[0]; | ||
}), | ||
singletonElement = null, | ||
singletonCounter = 0, | ||
styleElementsInsertedAtTop = []; | ||
module.exports = function(list, options) { | ||
if(typeof DEBUG !== "undefined" && DEBUG) { | ||
if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); | ||
} | ||
options = options || {}; | ||
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style> | ||
// tags it will allow on a page | ||
if (typeof options.singleton === "undefined") options.singleton = isOldIE(); | ||
// By default, add <style> tags to the bottom of <head>. | ||
if (typeof options.insertAt === "undefined") options.insertAt = "bottom"; | ||
var styles = listToStyles(list); | ||
addStylesToDom(styles, options); | ||
return function update(newList) { | ||
var mayRemove = []; | ||
for(var i = 0; i < styles.length; i++) { | ||
var item = styles[i]; | ||
var domStyle = stylesInDom[item.id]; | ||
domStyle.refs--; | ||
mayRemove.push(domStyle); | ||
} | ||
if(newList) { | ||
var newStyles = listToStyles(newList); | ||
addStylesToDom(newStyles, options); | ||
} | ||
for(var i = 0; i < mayRemove.length; i++) { | ||
var domStyle = mayRemove[i]; | ||
if(domStyle.refs === 0) { | ||
for(var j = 0; j < domStyle.parts.length; j++) | ||
domStyle.parts[j](); | ||
delete stylesInDom[domStyle.id]; | ||
} | ||
} | ||
}; | ||
} | ||
function addStylesToDom(styles, options) { | ||
for(var i = 0; i < styles.length; i++) { | ||
var item = styles[i]; | ||
var domStyle = stylesInDom[item.id]; | ||
if(domStyle) { | ||
domStyle.refs++; | ||
for(var j = 0; j < domStyle.parts.length; j++) { | ||
domStyle.parts[j](item.parts[j]); | ||
} | ||
for(; j < item.parts.length; j++) { | ||
domStyle.parts.push(addStyle(item.parts[j], options)); | ||
} | ||
} else { | ||
var parts = []; | ||
for(var j = 0; j < item.parts.length; j++) { | ||
parts.push(addStyle(item.parts[j], options)); | ||
} | ||
stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts}; | ||
} | ||
} | ||
} | ||
function listToStyles(list) { | ||
var styles = []; | ||
var newStyles = {}; | ||
for(var i = 0; i < list.length; i++) { | ||
var item = list[i]; | ||
var id = item[0]; | ||
var css = item[1]; | ||
var media = item[2]; | ||
var sourceMap = item[3]; | ||
var part = {css: css, media: media, sourceMap: sourceMap}; | ||
if(!newStyles[id]) | ||
styles.push(newStyles[id] = {id: id, parts: [part]}); | ||
else | ||
newStyles[id].parts.push(part); | ||
} | ||
return styles; | ||
} | ||
function insertStyleElement(options, styleElement) { | ||
var head = getHeadElement(); | ||
var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1]; | ||
if (options.insertAt === "top") { | ||
if(!lastStyleElementInsertedAtTop) { | ||
head.insertBefore(styleElement, head.firstChild); | ||
} else if(lastStyleElementInsertedAtTop.nextSibling) { | ||
head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling); | ||
} else { | ||
head.appendChild(styleElement); | ||
} | ||
styleElementsInsertedAtTop.push(styleElement); | ||
} else if (options.insertAt === "bottom") { | ||
head.appendChild(styleElement); | ||
} else { | ||
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'."); | ||
} | ||
} | ||
function removeStyleElement(styleElement) { | ||
styleElement.parentNode.removeChild(styleElement); | ||
var idx = styleElementsInsertedAtTop.indexOf(styleElement); | ||
if(idx >= 0) { | ||
styleElementsInsertedAtTop.splice(idx, 1); | ||
} | ||
} | ||
function createStyleElement(options) { | ||
var styleElement = document.createElement("style"); | ||
styleElement.type = "text/css"; | ||
insertStyleElement(options, styleElement); | ||
return styleElement; | ||
} | ||
function createLinkElement(options) { | ||
var linkElement = document.createElement("link"); | ||
linkElement.rel = "stylesheet"; | ||
insertStyleElement(options, linkElement); | ||
return linkElement; | ||
} | ||
function addStyle(obj, options) { | ||
var styleElement, update, remove; | ||
if (options.singleton) { | ||
var styleIndex = singletonCounter++; | ||
styleElement = singletonElement || (singletonElement = createStyleElement(options)); | ||
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false); | ||
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true); | ||
} else if(obj.sourceMap && | ||
typeof URL === "function" && | ||
typeof URL.createObjectURL === "function" && | ||
typeof URL.revokeObjectURL === "function" && | ||
typeof Blob === "function" && | ||
typeof btoa === "function") { | ||
styleElement = createLinkElement(options); | ||
update = updateLink.bind(null, styleElement); | ||
remove = function() { | ||
removeStyleElement(styleElement); | ||
if(styleElement.href) | ||
URL.revokeObjectURL(styleElement.href); | ||
}; | ||
} else { | ||
styleElement = createStyleElement(options); | ||
update = applyToTag.bind(null, styleElement); | ||
remove = function() { | ||
removeStyleElement(styleElement); | ||
}; | ||
} | ||
update(obj); | ||
return function updateStyle(newObj) { | ||
if(newObj) { | ||
if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) | ||
return; | ||
update(obj = newObj); | ||
} else { | ||
remove(); | ||
} | ||
}; | ||
} | ||
var replaceText = (function () { | ||
var textStore = []; | ||
return function (index, replacement) { | ||
textStore[index] = replacement; | ||
return textStore.filter(Boolean).join('\n'); | ||
}; | ||
})(); | ||
function applyToSingletonTag(styleElement, index, remove, obj) { | ||
var css = remove ? "" : obj.css; | ||
if (styleElement.styleSheet) { | ||
styleElement.styleSheet.cssText = replaceText(index, css); | ||
} else { | ||
var cssNode = document.createTextNode(css); | ||
var childNodes = styleElement.childNodes; | ||
if (childNodes[index]) styleElement.removeChild(childNodes[index]); | ||
if (childNodes.length) { | ||
styleElement.insertBefore(cssNode, childNodes[index]); | ||
} else { | ||
styleElement.appendChild(cssNode); | ||
} | ||
} | ||
} | ||
function applyToTag(styleElement, obj) { | ||
var css = obj.css; | ||
var media = obj.media; | ||
if(media) { | ||
styleElement.setAttribute("media", media) | ||
} | ||
if(styleElement.styleSheet) { | ||
styleElement.styleSheet.cssText = css; | ||
} else { | ||
while(styleElement.firstChild) { | ||
styleElement.removeChild(styleElement.firstChild); | ||
} | ||
styleElement.appendChild(document.createTextNode(css)); | ||
} | ||
} | ||
function updateLink(linkElement, obj) { | ||
var css = obj.css; | ||
var sourceMap = obj.sourceMap; | ||
if(sourceMap) { | ||
// http://stackoverflow.com/a/26603875 | ||
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"; | ||
} | ||
var blob = new Blob([css], { type: "text/css" }); | ||
var oldSrc = linkElement.href; | ||
linkElement.href = URL.createObjectURL(blob); | ||
if(oldSrc) | ||
URL.revokeObjectURL(oldSrc); | ||
} | ||
/***/ }), | ||
/* 9 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
// style-loader: Adds some css to the DOM by adding a <style> tag | ||
// load the styles | ||
var content = __webpack_require__(7); | ||
if(typeof content === 'string') content = [[module.i, content, '']]; | ||
// add the styles to the DOM | ||
var update = __webpack_require__(8)(content, {}); | ||
if(content.locals) module.exports = content.locals; | ||
// Hot Module Replacement | ||
if(false) { | ||
// When the styles change, update the <style> tags | ||
if(!content.locals) { | ||
module.hot.accept("!!./../../../node_modules/css-loader/index.js!./style.css", function() { | ||
var newContent = require("!!./../../../node_modules/css-loader/index.js!./style.css"); | ||
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; | ||
update(newContent); | ||
}); | ||
} | ||
// When the module is disposed, remove the <style> tags | ||
module.hot.dispose(function() { update(); }); | ||
} | ||
/***/ }), | ||
/* 10 */ | ||
/***/ (function(module, exports) { | ||
module.exports = function normalizeComponent ( | ||
rawScriptExports, | ||
compiledTemplate, | ||
scopeId, | ||
cssModules | ||
) { | ||
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 | ||
} | ||
// inject cssModules | ||
if (cssModules) { | ||
var computed = options.computed || (options.computed = {}) | ||
Object.keys(cssModules).forEach(function (key) { | ||
var module = cssModules[key] | ||
computed[key] = function () { return module } | ||
}) | ||
} | ||
return { | ||
esModule: esModule, | ||
exports: scriptExports, | ||
options: options | ||
} | ||
} | ||
/***/ }), | ||
/* 11 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; | ||
return _c('div', { | ||
staticClass: "as-container" | ||
}, [_c('div', { | ||
staticClass: "as-dialog" | ||
}, [_c('div', { | ||
staticClass: "as-hd" | ||
}, [_c('div', { | ||
staticClass: "as-title" | ||
}, [_vm._v(_vm._s(_vm.title))]), _vm._v(" "), _c('div', { | ||
staticClass: "as-message" | ||
}, [_vm._v(_vm._s(_vm.message))])]), _vm._v(" "), _vm._l((_vm.items), function(item, index) { | ||
return _c('div', { | ||
staticClass: "as-btn", | ||
class: { | ||
'as-btn-last': index == _vm.items.length - 1 | ||
}, | ||
on: { | ||
"click": function($event) { | ||
_vm.ok(index) | ||
} | ||
} | ||
}, [_c('text', { | ||
staticClass: "as-btn-text", | ||
class: { | ||
'as-text-warn': item.type == 2 | ||
} | ||
}, [_vm._v(_vm._s(item.message))])]) | ||
}), _vm._v(" "), (_vm.hasCancel) ? _c('div', { | ||
staticClass: "as-btn as-cancel", | ||
on: { | ||
"click": _vm.cancel | ||
} | ||
}, [_c('text', { | ||
staticClass: "as-btn-text" | ||
}, [_vm._v("取消")])]) : _vm._e()], 2)]) | ||
},staticRenderFns: []} | ||
module.exports.render._withStripped = true | ||
if (false) { | ||
module.hot.accept() | ||
if (module.hot.data) { | ||
require("vue-hot-reload-api").rerender("data-v-18fee04b", module.exports) | ||
} | ||
} | ||
/***/ }), | ||
/* 12 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
// style-loader: Adds some css to the DOM by adding a <style> tag | ||
// load the styles | ||
var content = __webpack_require__(6); | ||
if(typeof content === 'string') content = [[module.i, content, '']]; | ||
if(content.locals) module.exports = content.locals; | ||
// add the styles to the DOM | ||
var update = __webpack_require__(13)("188935cc", content, false); | ||
// Hot Module Replacement | ||
if(false) { | ||
// When the styles change, update the <style> tags | ||
if(!content.locals) { | ||
module.hot.accept("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-18fee04b!./../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./action-sheet.vue", function() { | ||
var newContent = require("!!./../../../node_modules/css-loader/index.js!./../../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-18fee04b!./../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./action-sheet.vue"); | ||
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; | ||
update(newContent); | ||
}); | ||
} | ||
// When the module is disposed, remove the <style> tags | ||
module.hot.dispose(function() { update(); }); | ||
} | ||
/***/ }), | ||
/* 13 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/* | ||
MIT License http://www.opensource.org/licenses/mit-license.php | ||
Author Tobias Koppers @sokra | ||
Modified by Evan You @yyx990803 | ||
*/ | ||
var hasDocument = typeof document !== 'undefined' | ||
if (typeof DEBUG !== 'undefined' && DEBUG) { | ||
if (!hasDocument) { | ||
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 listToStyles = __webpack_require__(14) | ||
/* | ||
type StyleObject = { | ||
id: number; | ||
parts: Array<StyleObjectPart> | ||
} | ||
type StyleObjectPart = { | ||
css: string; | ||
media: string; | ||
sourceMap: ?string | ||
} | ||
*/ | ||
var stylesInDom = {/* | ||
[id: number]: { | ||
id: number, | ||
refs: number, | ||
parts: Array<(obj?: StyleObjectPart) => void> | ||
} | ||
*/} | ||
var head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) | ||
var singletonElement = null | ||
var singletonCounter = 0 | ||
var isProduction = false | ||
var noop = function () {} | ||
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style> | ||
// tags it will allow on a page | ||
var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase()) | ||
module.exports = function (parentId, list, _isProduction) { | ||
isProduction = _isProduction | ||
var styles = listToStyles(parentId, list) | ||
addStylesToDom(styles) | ||
return function update (newList) { | ||
var mayRemove = [] | ||
for (var i = 0; i < styles.length; i++) { | ||
var item = styles[i] | ||
var domStyle = stylesInDom[item.id] | ||
domStyle.refs-- | ||
mayRemove.push(domStyle) | ||
} | ||
if (newList) { | ||
styles = listToStyles(parentId, newList) | ||
addStylesToDom(styles) | ||
} else { | ||
styles = [] | ||
} | ||
for (var i = 0; i < mayRemove.length; i++) { | ||
var domStyle = mayRemove[i] | ||
if (domStyle.refs === 0) { | ||
for (var j = 0; j < domStyle.parts.length; j++) { | ||
domStyle.parts[j]() | ||
} | ||
delete stylesInDom[domStyle.id] | ||
} | ||
} | ||
} | ||
} | ||
function addStylesToDom (styles /* Array<StyleObject> */) { | ||
for (var i = 0; i < styles.length; i++) { | ||
var item = styles[i] | ||
var domStyle = stylesInDom[item.id] | ||
if (domStyle) { | ||
domStyle.refs++ | ||
for (var j = 0; j < domStyle.parts.length; j++) { | ||
domStyle.parts[j](item.parts[j]) | ||
} | ||
for (; j < item.parts.length; j++) { | ||
domStyle.parts.push(addStyle(item.parts[j])) | ||
} | ||
if (domStyle.parts.length > item.parts.length) { | ||
domStyle.parts.length = item.parts.length | ||
} | ||
} else { | ||
var parts = [] | ||
for (var j = 0; j < item.parts.length; j++) { | ||
parts.push(addStyle(item.parts[j])) | ||
} | ||
stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts } | ||
} | ||
} | ||
} | ||
function listToStyles (parentId, list) { | ||
var styles = [] | ||
var newStyles = {} | ||
for (var i = 0; i < list.length; i++) { | ||
var item = list[i] | ||
var id = item[0] | ||
var css = item[1] | ||
var media = item[2] | ||
var sourceMap = item[3] | ||
var part = { css: css, media: media, sourceMap: sourceMap } | ||
if (!newStyles[id]) { | ||
part.id = parentId + ':0' | ||
styles.push(newStyles[id] = { id: id, parts: [part] }) | ||
} else { | ||
part.id = parentId + ':' + newStyles[id].parts.length | ||
newStyles[id].parts.push(part) | ||
} | ||
} | ||
return styles | ||
} | ||
function createStyleElement () { | ||
var styleElement = document.createElement('style') | ||
styleElement.type = 'text/css' | ||
head.appendChild(styleElement) | ||
return styleElement | ||
} | ||
function addStyle (obj /* StyleObjectPart */) { | ||
var update, remove | ||
var styleElement = document.querySelector('style[data-vue-ssr-id~="' + obj.id + '"]') | ||
var hasSSR = styleElement != null | ||
// if in production mode and style is already provided by SSR, | ||
// simply do nothing. | ||
if (hasSSR && isProduction) { | ||
return noop | ||
} | ||
if (isOldIE) { | ||
// use singleton mode for IE9. | ||
var styleIndex = singletonCounter++ | ||
styleElement = singletonElement || (singletonElement = createStyleElement()) | ||
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false) | ||
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true) | ||
} else { | ||
// use multi-style-tag mode in all other cases | ||
styleElement = styleElement || createStyleElement() | ||
update = applyToTag.bind(null, styleElement) | ||
remove = function () { | ||
styleElement.parentNode.removeChild(styleElement) | ||
} | ||
} | ||
if (!hasSSR) { | ||
update(obj) | ||
} | ||
return function updateStyle (newObj /* StyleObjectPart */) { | ||
if (newObj) { | ||
if (newObj.css === obj.css && | ||
newObj.media === obj.media && | ||
newObj.sourceMap === obj.sourceMap) { | ||
return | ||
} | ||
update(obj = newObj) | ||
} else { | ||
remove() | ||
} | ||
} | ||
} | ||
var replaceText = (function () { | ||
var textStore = [] | ||
return function (index, replacement) { | ||
textStore[index] = replacement | ||
return textStore.filter(Boolean).join('\n') | ||
} | ||
})() | ||
function applyToSingletonTag (styleElement, index, remove, obj) { | ||
var css = remove ? '' : obj.css | ||
if (styleElement.styleSheet) { | ||
styleElement.styleSheet.cssText = replaceText(index, css) | ||
} else { | ||
var cssNode = document.createTextNode(css) | ||
var childNodes = styleElement.childNodes | ||
if (childNodes[index]) styleElement.removeChild(childNodes[index]) | ||
if (childNodes.length) { | ||
styleElement.insertBefore(cssNode, childNodes[index]) | ||
} else { | ||
styleElement.appendChild(cssNode) | ||
} | ||
} | ||
} | ||
function applyToTag (styleElement, obj) { | ||
var css = obj.css | ||
var media = obj.media | ||
var sourceMap = obj.sourceMap | ||
if (media) { | ||
styleElement.setAttribute('media', media) | ||
} | ||
if (sourceMap) { | ||
// https://developer.chrome.com/devtools/docs/javascript-debugging | ||
// this makes source maps inside style tags work properly in Chrome | ||
css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */' | ||
// http://stackoverflow.com/a/26603875 | ||
css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */' | ||
} | ||
if (styleElement.styleSheet) { | ||
styleElement.styleSheet.cssText = css | ||
} else { | ||
while (styleElement.firstChild) { | ||
styleElement.removeChild(styleElement.firstChild) | ||
} | ||
styleElement.appendChild(document.createTextNode(css)) | ||
} | ||
} | ||
/***/ }), | ||
/* 14 */ | ||
/***/ (function(module, exports) { | ||
/** | ||
* Translates the list format produced by css-loader into something | ||
* easier to manipulate. | ||
*/ | ||
module.exports = function listToStyles (parentId, list) { | ||
var styles = [] | ||
var newStyles = {} | ||
for (var i = 0; i < list.length; i++) { | ||
var item = list[i] | ||
var id = item[0] | ||
var css = item[1] | ||
var media = item[2] | ||
var sourceMap = item[3] | ||
var part = { | ||
id: parentId + ':' + i, | ||
css: css, | ||
media: media, | ||
sourceMap: sourceMap | ||
} | ||
if (!newStyles[id]) { | ||
styles.push(newStyles[id] = { id: id, parts: [part] }) | ||
} else { | ||
newStyles[id].parts.push(part) | ||
} | ||
} | ||
return styles | ||
} | ||
/***/ }), | ||
/* 15 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
var _actionSheet = __webpack_require__(4); | ||
var _actionSheet2 = _interopRequireDefault(_actionSheet); | ||
var _actionSheet3 = __webpack_require__(3); | ||
var _actionSheet4 = _interopRequireDefault(_actionSheet3); | ||
var _meta = __webpack_require__(1); | ||
var _meta2 = _interopRequireDefault(_meta); | ||
var _vendor = __webpack_require__(2); | ||
var _vendor2 = _interopRequireDefault(_vendor); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// weex-actionSheet-web | ||
weex.registerModule('actionSheet', { | ||
}) | ||
var actionSheet = { | ||
create: function create(options, callbackID) { | ||
var _this = this; | ||
var defaultOPtions = { | ||
title: '提示', | ||
message: '', | ||
items: [], | ||
callback: function callback() {}, | ||
hasCancel: true | ||
}; | ||
var opts = Object.assign({}, defaultOPtions, options); | ||
if (opts.items.length > 1) { | ||
opts.hasCancel = _vendor2.default.findCancel(options.items); | ||
opts.items = _vendor2.default.filterData(options.items); | ||
} | ||
if (typeof callbackID === 'function') { | ||
(function () { | ||
var self = _this; | ||
opts.callback = function (res) { | ||
self.sender.performCallback(callbackID, res); | ||
}; | ||
})(); | ||
} | ||
var ActionSheet = null; | ||
if (window.Vue) { | ||
console.log(window.Vue); | ||
ActionSheet = Vue.extend(_actionSheet2.default); | ||
} else { | ||
ActionSheet = _actionSheet4.default; | ||
} | ||
var vueActionSheetInstance = new ActionSheet({ | ||
el: document.createElement('div'), | ||
data: function data() { | ||
return opts; | ||
} | ||
}); | ||
document.body.appendChild(vueActionSheetInstance.$el); | ||
} | ||
}; | ||
function init(weex) { | ||
weex.registerApiModule('actionSheet', actionSheet, _meta2.default); | ||
} | ||
module.exports = { | ||
init: init | ||
}; | ||
/***/ }) | ||
/******/ ]); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
431746
26
1325
1