vue-loading-skeleton
Advanced tools
Comparing version 1.1.9 to 2.0.0-beta.1
@@ -6,5 +6,10 @@ module.exports = { | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 8, | ||
"sourceType": "module" | ||
}, | ||
extends: [ | ||
'plugin:vue/essential', | ||
'@vue/airbnb' | ||
"@vue/typescript/recommended", | ||
'plugin:vue/vue3-recommended', | ||
"prettier" | ||
], | ||
@@ -14,7 +19,5 @@ rules: { | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'comma-dangle': ['error', 'never'] | ||
}, | ||
parserOptions: { | ||
parser: 'babel-eslint' | ||
} | ||
}; |
@@ -1,527 +0,11 @@ | ||
(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["vue-loading-skeleton"] = factory(); | ||
else | ||
root["vue-loading-skeleton"] = factory(); | ||
})((typeof self !== 'undefined' ? self : 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; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ // define __esModule on exports | ||
/******/ __webpack_require__.r = function(exports) { | ||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | ||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/******/ } | ||
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/******/ }; | ||
/******/ | ||
/******/ // create a fake namespace object | ||
/******/ // mode & 1: value is a module id, require it | ||
/******/ // mode & 2: merge all properties of value into the ns | ||
/******/ // mode & 4: return value when already ns object | ||
/******/ // mode & 8|1: behave like require | ||
/******/ __webpack_require__.t = function(value, mode) { | ||
/******/ if(mode & 1) value = __webpack_require__(value); | ||
/******/ if(mode & 8) return value; | ||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; | ||
/******/ var ns = Object.create(null); | ||
/******/ __webpack_require__.r(ns); | ||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); | ||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); | ||
/******/ return ns; | ||
/******/ }; | ||
/******/ | ||
/******/ // 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 = "fb15"); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ({ | ||
/***/ "1cd4": | ||
/***/ (function(module, exports, __webpack_require__) { | ||
// extracted by mini-css-extract-plugin | ||
/***/ }), | ||
/***/ "5b22": | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_10_oneOf_1_0_node_modules_css_loader_index_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_10_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_skeleton_vue_vue_type_style_index_0_lang_less___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1cd4"); | ||
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_10_oneOf_1_0_node_modules_css_loader_index_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_10_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_skeleton_vue_vue_type_style_index_0_lang_less___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_10_oneOf_1_0_node_modules_css_loader_index_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_10_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_skeleton_vue_vue_type_style_index_0_lang_less___WEBPACK_IMPORTED_MODULE_0__); | ||
/* unused harmony reexport * */ | ||
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_10_oneOf_1_0_node_modules_css_loader_index_js_ref_10_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_10_oneOf_1_2_node_modules_less_loader_dist_cjs_js_ref_10_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_skeleton_vue_vue_type_style_index_0_lang_less___WEBPACK_IMPORTED_MODULE_0___default.a); | ||
/***/ }), | ||
/***/ "f6fd": | ||
/***/ (function(module, exports) { | ||
// document.currentScript polyfill by Adam Miller | ||
// MIT license | ||
(function(document){ | ||
var currentScript = "currentScript", | ||
scripts = document.getElementsByTagName('script'); // Live NodeList collection | ||
// If browser needs currentScript polyfill, add get currentScript() to the document object | ||
if (!(currentScript in document)) { | ||
Object.defineProperty(document, currentScript, { | ||
get: function(){ | ||
// IE 6-10 supports script readyState | ||
// IE 10+ support stack trace | ||
try { throw new Error(); } | ||
catch (err) { | ||
// Find the second match for the "at" string to get file src url from stack. | ||
// Specifically works with the format of stack traces in IE. | ||
var i, res = ((/.*at [^\(]*\((.*):.+:.+\)$/ig).exec(err.stack) || [false])[1]; | ||
// For all scripts on the page, if src matches or if ready state is interactive, return the script tag | ||
for(i in scripts){ | ||
if(scripts[i].src == res || scripts[i].readyState == "interactive"){ | ||
return scripts[i]; | ||
} | ||
} | ||
// If no match, return null | ||
return null; | ||
} | ||
} | ||
}); | ||
} | ||
})(document); | ||
/***/ }), | ||
/***/ "fb15": | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js | ||
// This file is imported into lib/wc client bundles. | ||
if (typeof window !== 'undefined') { | ||
if (true) { | ||
__webpack_require__("f6fd") | ||
} | ||
var i | ||
if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) { | ||
__webpack_require__.p = i[1] // eslint-disable-line | ||
} | ||
} | ||
// Indicate to webpack that this file can be concatenated | ||
/* harmony default export */ var setPublicPath = (null); | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/skeleton-theme.vue?vue&type=script&lang=jsx& | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
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 DEFAULT_BACKGROUND = '#eeeeee'; | ||
var DEFAULT_HIGHLIGHT = '#f5f5f5'; | ||
var SkeletonStyle = { | ||
backgroundColor: DEFAULT_BACKGROUND, | ||
backgroundImage: "linear-gradient(\n 90deg,\n ".concat(DEFAULT_BACKGROUND, ",\n ").concat(DEFAULT_HIGHLIGHT, ",\n ").concat(DEFAULT_BACKGROUND, "\n )") | ||
}; | ||
/* harmony default export */ var skeleton_themevue_type_script_lang_jsx_ = ({ | ||
name: 'PuSkeletonTheme', | ||
provide: function provide() { | ||
return { | ||
_themeStyle: this.themeStyle, | ||
_skeletonTheme: this | ||
}; | ||
}, | ||
props: { | ||
color: { | ||
type: String, | ||
default: DEFAULT_BACKGROUND | ||
}, | ||
highlight: { | ||
type: String, | ||
default: DEFAULT_HIGHLIGHT | ||
}, | ||
duration: { | ||
type: Number, | ||
default: 1.5 | ||
}, | ||
tag: { | ||
type: String, | ||
default: 'div' | ||
}, | ||
loading: { | ||
type: Boolean, | ||
default: undefined | ||
} | ||
}, | ||
data: function data() { | ||
return { | ||
themeStyle: _objectSpread({}, SkeletonStyle) | ||
}; | ||
}, | ||
render: function render(h) { | ||
var color = this.color, | ||
highlight = this.highlight, | ||
duration = this.duration; | ||
this.themeStyle.backgroundColor = color; | ||
this.themeStyle.backgroundImage = "linear-gradient(\n 90deg,\n ".concat(color, ",\n ").concat(highlight, ",\n ").concat(color, "\n )"); | ||
if (duration) { | ||
this.themeStyle.animation = "SkeletonLoading ".concat(duration, "s ease-in-out infinite"); | ||
} else { | ||
this.themeStyle.animation = ''; | ||
this.themeStyle.backgroundImage = ''; | ||
} | ||
if (this.tag) { | ||
return h(this.tag, this.$slots.default); | ||
} | ||
return this.$slots.default[0]; | ||
} | ||
}); | ||
// CONCATENATED MODULE: ./src/skeleton-theme.vue?vue&type=script&lang=jsx& | ||
/* harmony default export */ var src_skeleton_themevue_type_script_lang_jsx_ = (skeleton_themevue_type_script_lang_jsx_); | ||
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js | ||
/* globals __VUE_SSR_CONTEXT__ */ | ||
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules). | ||
// This module is a runtime utility for cleaner component module output and will | ||
// be included in the final webpack user bundle. | ||
function normalizeComponent ( | ||
scriptExports, | ||
render, | ||
staticRenderFns, | ||
functionalTemplate, | ||
injectStyles, | ||
scopeId, | ||
moduleIdentifier, /* server only */ | ||
shadowMode /* vue-cli only */ | ||
) { | ||
// Vue.extend constructor export interop | ||
var options = typeof scriptExports === 'function' | ||
? scriptExports.options | ||
: scriptExports | ||
// render functions | ||
if (render) { | ||
options.render = render | ||
options.staticRenderFns = staticRenderFns | ||
options._compiled = true | ||
} | ||
// functional template | ||
if (functionalTemplate) { | ||
options.functional = true | ||
} | ||
// scopedId | ||
if (scopeId) { | ||
options._scopeId = 'data-v-' + 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 = shadowMode | ||
? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } | ||
: injectStyles | ||
} | ||
if (hook) { | ||
if (options.functional) { | ||
// for template-only hot-reload because in that case the render fn doesn't | ||
// go through the normalizer | ||
options._injectStyles = hook | ||
// register for functioal component in vue file | ||
var originalRender = options.render | ||
options.render = function renderWithStyleInjection (h, context) { | ||
hook.call(context) | ||
return originalRender(h, context) | ||
} | ||
} else { | ||
// inject component registration as beforeCreate hook | ||
var existing = options.beforeCreate | ||
options.beforeCreate = existing | ||
? [].concat(existing, hook) | ||
: [hook] | ||
} | ||
} | ||
return { | ||
exports: scriptExports, | ||
options: options | ||
} | ||
} | ||
// CONCATENATED MODULE: ./src/skeleton-theme.vue | ||
var render, staticRenderFns | ||
/* normalize component */ | ||
var component = normalizeComponent( | ||
src_skeleton_themevue_type_script_lang_jsx_, | ||
render, | ||
staticRenderFns, | ||
false, | ||
null, | ||
null, | ||
null | ||
) | ||
/* harmony default export */ var skeleton_theme = (component.exports); | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/skeleton.vue?vue&type=script&lang=jsx& | ||
function skeletonvue_type_script_lang_jsx_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { skeletonvue_type_script_lang_jsx_defineProperty(target, key, source[key]); }); } return target; } | ||
function skeletonvue_type_script_lang_jsx_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; } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } | ||
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
var isEmptyVNode = function isEmptyVNode(children) { | ||
if (!children) return true; | ||
var _children = _slicedToArray(children, 1), | ||
firstNode = _children[0]; | ||
var str = firstNode.text; | ||
if (str) { | ||
// remove all line-break and space character | ||
str = str.replace(/(\n|\r\n|\s)/g, ''); | ||
} | ||
return typeof firstNode.tag === 'undefined' && !str; | ||
}; | ||
/* harmony default export */ var skeletonvue_type_script_lang_jsx_ = ({ | ||
name: 'PuSkeleton', | ||
inject: { | ||
themeStyle: { | ||
from: '_themeStyle', | ||
default: SkeletonStyle | ||
}, | ||
theme: { | ||
from: '_skeletonTheme', | ||
default: {} | ||
} | ||
}, | ||
props: { | ||
prefix: { | ||
type: String, | ||
default: 'pu' | ||
}, | ||
count: { | ||
type: Number, | ||
default: 1 | ||
}, | ||
duration: { | ||
type: Number, | ||
default: 1.5 | ||
}, | ||
tag: { | ||
type: String, | ||
default: 'span' | ||
}, | ||
width: [String, Number], | ||
height: [String, Number], | ||
circle: Boolean, | ||
loading: undefined | ||
}, | ||
computed: { | ||
isLoading: function isLoading() { | ||
return typeof this.theme.loading !== 'undefined' ? this.theme.loading : this.loading; | ||
} | ||
}, | ||
render: function render(h) { | ||
var width = this.width, | ||
height = this.height, | ||
duration = this.duration, | ||
prefix = this.prefix, | ||
circle = this.circle, | ||
count = this.count, | ||
tag = this.tag, | ||
isLoading = this.isLoading; | ||
var classes = ["".concat(prefix, "-skeleton")]; | ||
var elements = []; | ||
var styles = skeletonvue_type_script_lang_jsx_objectSpread({}, this.themeStyle); | ||
if (duration) { | ||
styles.animation = "SkeletonLoading ".concat(duration, "s ease-in-out infinite"); | ||
} else { | ||
styles.backgroundImage = ''; | ||
} | ||
if (width) styles.width = width; | ||
if (height) styles.height = height; | ||
if (circle) styles.borderRadius = '50%'; | ||
for (var i = 0; i < count; i += 1) { | ||
elements.push(h("span", { | ||
"key": i, | ||
"class": classes, | ||
"style": styles | ||
}, ["\u200C"])); | ||
} | ||
var showLoading = typeof isLoading !== 'undefined' ? isLoading : isEmptyVNode(this.$slots.default); | ||
if (tag) { | ||
return h(tag, !showLoading ? this.$slots.default : elements); | ||
} | ||
return !showLoading ? this.$slots.default : h("span", [elements]); | ||
} | ||
}); | ||
// CONCATENATED MODULE: ./src/skeleton.vue?vue&type=script&lang=jsx& | ||
/* harmony default export */ var src_skeletonvue_type_script_lang_jsx_ = (skeletonvue_type_script_lang_jsx_); | ||
// EXTERNAL MODULE: ./src/skeleton.vue?vue&type=style&index=0&lang=less& | ||
var skeletonvue_type_style_index_0_lang_less_ = __webpack_require__("5b22"); | ||
// CONCATENATED MODULE: ./src/skeleton.vue | ||
var skeleton_render, skeleton_staticRenderFns | ||
/* normalize component */ | ||
var skeleton_component = normalizeComponent( | ||
src_skeletonvue_type_script_lang_jsx_, | ||
skeleton_render, | ||
skeleton_staticRenderFns, | ||
false, | ||
null, | ||
null, | ||
null | ||
) | ||
/* harmony default export */ var skeleton = (skeleton_component.exports); | ||
// CONCATENATED MODULE: ./src/index.js | ||
/* harmony default export */ var src = ({ | ||
install: function install(Vue) { | ||
Vue.component(skeleton.name, skeleton); | ||
Vue.component(skeleton_theme.name, skeleton_theme); | ||
} | ||
}); | ||
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js | ||
/* concated harmony reexport Skeleton */__webpack_require__.d(__webpack_exports__, "Skeleton", function() { return skeleton; }); | ||
/* concated harmony reexport SkeletonTheme */__webpack_require__.d(__webpack_exports__, "SkeletonTheme", function() { return skeleton_theme; }); | ||
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (src); | ||
/***/ }) | ||
/******/ }); | ||
}); | ||
//# sourceMappingURL=vue-loading-skeleton.umd.js.map | ||
var w=Object.defineProperty;var p=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var _=(n,e,i)=>e in n?w(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i,f=(n,e)=>{for(var i in e||(e={}))I.call(e,i)&&_(n,i,e[i]);if(p)for(var i of p(e))A.call(e,i)&&_(n,i,e[i]);return n};(function(n,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis!="undefined"?globalThis:n||self,e(n["vue-loading-skeleton"]={},n.Vue))})(this,function(n,e){"use strict";const i="#eeeeee",y="#f5f5f5",s={animation:"",backgroundColor:i,backgroundImage:`linear-gradient( | ||
90deg, | ||
${i}, | ||
${y}, | ||
${i} | ||
)`},S=Symbol("_themeStyle"),$=Symbol("_theme");function v(){return $}const k=v(),L=e.defineComponent({name:"PuSkeletonTheme",props:{color:{type:String,default:i},highlight:{type:String,default:y},duration:{type:Number,default:1.5},tag:{type:String,default:"div"},loading:{type:Boolean,default:void 0}},setup(t,{slots:o}){const r=e.computed(()=>{const{color:a,highlight:l,duration:c}=t,u=f({},s);return u.backgroundColor=a,u.backgroundImage=`linear-gradient( | ||
90deg, | ||
${a}, | ||
${l}, | ||
${a} | ||
)`,c?u.animation=`SkeletonLoading ${c}s ease-in-out infinite`:(u.animation="",u.backgroundImage=""),u});return e.provide(S,r),e.provide(k,t),()=>{var a,l;return t.tag?e.h(t.tag,(a=o.default)==null?void 0:a.call(o)):(l=o.default)==null?void 0:l.call(o)[0]}}});var B="";const N=t=>{if(!t)return!0;const[o]=t;let r=o.children;return!o.el&&!r},g=e.defineComponent({name:"PuSkeleton",props:{prefix:{type:String,default:"pu"},count:{type:Number,default:1},duration:{type:Number,default:1.5},tag:{type:String,default:"span"},width:{type:[String,Number],default:0},height:{type:[String,Number],default:0},circle:Boolean,loading:{type:[Boolean,Object,Array],default:void 0}},setup(t,{slots:o}){const r=e.inject(k,{}),a=e.inject(S,{value:f({},s)}),l=e.computed(()=>typeof(r==null?void 0:r.loading)!="undefined"?r.loading:t.loading),c=e.computed(()=>[`${t.prefix}-skeleton`]),u=e.computed(()=>{if(!a)return{};const d=f({},a==null?void 0:a.value);return t.duration?d.animation=`SkeletonLoading ${t.duration}s ease-in-out infinite`:d.backgroundImage="",t.width&&(d.width=t.width),t.height&&(d.height=t.height),t.circle&&(d.borderRadius="50%"),d});return()=>{var T;const d=(T=o.default)==null?void 0:T.call(o),h=typeof l.value!="undefined"?l.value:N(d),b=Array(h?t.count:0).fill(0).map((D,j)=>e.h("span",{key:j,class:c.value,style:u.value,innerHTML:"‌"}));return t.tag?e.h(t.tag,h?b:d):h?e.h("span",b):d}}}),m=L;var P={install(t){t.component(g.name,g),t.component(m.name,m)}};n.Skeleton=g,n.SkeletonTheme=m,n.default=P,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"}); |
{ | ||
"name": "vue-loading-skeleton", | ||
"version": "1.1.9", | ||
"main": "dist/vue-loading-skeleton.umd.js", | ||
"module": "dist/vue-loading-skeleton.esm.js", | ||
"version": "2.0.0-beta.1", | ||
"main": "dist/vue-loading-skeleton.cjs.js", | ||
"module": "dist/vue-loading-skeleton.es.js", | ||
"description": "Make beautiful loading skeleton that automatically adapt your vue app.", | ||
@@ -13,8 +13,6 @@ "keywords": [ | ||
"types": "types/index.d.ts", | ||
"style": "dist/vue-loading.skeleton.css", | ||
"style": "dist/style.css", | ||
"license": "MIT", | ||
"scripts": { | ||
"build:common": "vue-cli-service build --target lib --name vue-loading-skeleton src/index.js", | ||
"build:es": "rollup --config rollup.config.js", | ||
"build": "npm run build:common && npm run build:es", | ||
"build": "vite build", | ||
"deploy": "npm run lint && npm run test:unit && npm run build && npm run build-storybook", | ||
@@ -24,41 +22,41 @@ "lint": "vue-cli-service lint", | ||
"storybook": "start-storybook -p 6006", | ||
"build-storybook": "build-storybook -o ./docs" | ||
"build:storybook": "build-storybook --modern -o ./docs" | ||
}, | ||
"dependencies": { | ||
"core-js": "2" | ||
"@vue/compat": "^3.1.0", | ||
"core-js": "2", | ||
"vue": "^3.1.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.4.5", | ||
"@storybook/addon-actions": "^5.0.11", | ||
"@storybook/addon-links": "^5.0.11", | ||
"@storybook/addon-storyshots": "^5.0.11", | ||
"@storybook/addon-storysource": "^5.0.11", | ||
"@storybook/addons": "^5.0.11", | ||
"@storybook/vue": "^5.0.11", | ||
"@vue/cli-plugin-babel": "^3.8.0", | ||
"@vue/cli-plugin-eslint": "^3.8.0", | ||
"@vue/cli-plugin-unit-jest": "^3.8.0", | ||
"@vue/cli-service": "^3.8.0", | ||
"@vue/eslint-config-airbnb": "^4.0.0", | ||
"@vue/test-utils": "1.0.0-beta.29", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-eslint": "^10.0.1", | ||
"babel-jest": "^23.6.0", | ||
"babel-loader": "^8.0.6", | ||
"babel-plugin-require-context-hook": "^1.0.0", | ||
"babel-preset-vue": "^2.0.2", | ||
"eslint": "^5.16.0", | ||
"eslint-plugin-vue": "^5.0.0", | ||
"less": "^3.9.0", | ||
"less-loader": "^5.0.0", | ||
"rollup": "^1.32.0", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-vue": "^5.1.6", | ||
"vue": "^2.6.11", | ||
"vue-template-compiler": "^2.6.10" | ||
"@babel/core": "^7.17.5", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-node-resolve": "^13.1.3", | ||
"@storybook/addon-actions": "^6.4.19", | ||
"@storybook/addon-essentials": "^6.4.19", | ||
"@storybook/addon-links": "^6.4.19", | ||
"@storybook/vue3": "^6.4.19", | ||
"@typescript-eslint/eslint-plugin": "^5.12.0", | ||
"@typescript-eslint/parser": "^5.12.0", | ||
"@vitejs/plugin-vue": "^2.2.0", | ||
"@vue/cli-plugin-babel": "^5.0.1", | ||
"@vue/cli-plugin-eslint": "^5.0.1", | ||
"@vue/compiler-sfc": "^3.2.31", | ||
"@vue/eslint-config-typescript": "^10.0.0", | ||
"@vue/test-utils": "2.0.0-rc.18", | ||
"babel-loader": "^8.2.3", | ||
"eslint": "^8.9.0", | ||
"eslint-config-prettier": "^8.4.0", | ||
"eslint-plugin-vue": "^8.4.1", | ||
"prettier": "^2.5.1", | ||
"rollup": "^2.67.3", | ||
"rollup-plugin-css-only": "^3.1.0", | ||
"rollup-plugin-vue": "^6.0.0-beta.10", | ||
"typescript": "^4.5.5", | ||
"vite": "^2.8.4", | ||
"vue-loader": "^16.8.3", | ||
"vue-tsc": "^0.29.8" | ||
}, | ||
"peerDependencies": { | ||
"vue": "^2.6.11" | ||
} | ||
"bowserslist": [ | ||
"defaults" | ||
] | ||
} |
@@ -14,2 +14,3 @@ # 💅🏻 Vue-loading-skeleton | ||
import { Skeleton } from 'vue-loading-skeleton'; | ||
import "vue-loading-skeleton/dist/style.css" | ||
@@ -26,2 +27,3 @@ // In jsx template | ||
import Skeleton from 'vue-loading-skeleton'; | ||
import "vue-loading-skeleton/dist/style.css" | ||
@@ -28,0 +30,0 @@ Vue.use(Skeleton); |
@@ -9,2 +9,8 @@ # 💅🏻 Vue-loading-skeleton | ||
## Install | ||
yarn | ||
`yarn add vue-loading-skeleton@next` | ||
or npm | ||
`npm install vue-loading-skeleton@next` | ||
## Base usage | ||
@@ -15,2 +21,3 @@ Install by `npm`/`yarn` with vue-loading-skeleton | ||
import { Skeleton } from 'vue-loading-skeleton'; | ||
import "vue-loading-skeleton/dist/style.css" | ||
@@ -27,2 +34,3 @@ // In jsx template | ||
import Skeleton from 'vue-loading-skeleton'; | ||
import "vue-loading-skeleton/dist/style.css" | ||
@@ -29,0 +37,0 @@ Vue.use(Skeleton) |
@@ -1,9 +0,130 @@ | ||
import Vue, { PluginObject, PluginFunction } from 'vue'; | ||
import PuSkeleton from './skeleton'; | ||
import PuSkeletonTheme from './skeleton-theme'; | ||
export class Skeleton extends PuSkeleton {} | ||
export class SkeletonTheme extends PuSkeletonTheme {} | ||
declare const SkeletonPlugin: PluginObject<never> | ||
export default SkeletonPlugin | ||
import { App } from 'vue'; | ||
export declare const Skeleton: import("vue").DefineComponent<{ | ||
prefix: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
count: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
duration: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
tag: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
width: { | ||
type: (StringConstructor | NumberConstructor)[]; | ||
default: number; | ||
}; | ||
height: { | ||
type: (StringConstructor | NumberConstructor)[]; | ||
default: number; | ||
}; | ||
circle: BooleanConstructor; | ||
loading: { | ||
type: import("vue").PropType<any>; | ||
default: any; | ||
}; | ||
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { | ||
[key: string]: any; | ||
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { | ||
[key: string]: any; | ||
}>[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
prefix: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
count: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
duration: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
tag: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
width: { | ||
type: (StringConstructor | NumberConstructor)[]; | ||
default: number; | ||
}; | ||
height: { | ||
type: (StringConstructor | NumberConstructor)[]; | ||
default: number; | ||
}; | ||
circle: BooleanConstructor; | ||
loading: { | ||
type: import("vue").PropType<any>; | ||
default: any; | ||
}; | ||
}>>, { | ||
height: string | number; | ||
width: string | number; | ||
loading: any; | ||
circle: boolean; | ||
prefix: string; | ||
tag: string; | ||
duration: number; | ||
count: number; | ||
}>; | ||
export declare const SkeletonTheme: import("vue").DefineComponent<{ | ||
color: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
highlight: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
duration: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
tag: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
loading: { | ||
type: BooleanConstructor; | ||
default: any; | ||
}; | ||
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, { | ||
[key: string]: any; | ||
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
color: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
highlight: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
duration: { | ||
type: NumberConstructor; | ||
default: number; | ||
}; | ||
tag: { | ||
type: StringConstructor; | ||
default: string; | ||
}; | ||
loading: { | ||
type: BooleanConstructor; | ||
default: any; | ||
}; | ||
}>>, { | ||
color: string; | ||
loading: boolean; | ||
tag: string; | ||
duration: number; | ||
highlight: string; | ||
}>; | ||
declare const _default: { | ||
install(Vue: App): void; | ||
}; | ||
export default _default; |
Sorry, the diff of this file is not supported yet
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
27
22
156
37913
3
620
4
1
+ Added@vue/compat@^3.1.0
+ Addedvue@^3.1.0
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@vue/compat@3.5.13(transitive)
+ Added@vue/compiler-core@3.5.13(transitive)
+ Added@vue/compiler-dom@3.5.13(transitive)
+ Added@vue/compiler-sfc@3.5.13(transitive)
+ Added@vue/compiler-ssr@3.5.13(transitive)
+ Added@vue/reactivity@3.5.13(transitive)
+ Added@vue/runtime-core@3.5.13(transitive)
+ Added@vue/runtime-dom@3.5.13(transitive)
+ Added@vue/server-renderer@3.5.13(transitive)
+ Added@vue/shared@3.5.13(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedestree-walker@2.0.2(transitive)
+ Addedmagic-string@0.30.17(transitive)
+ Addedvue@3.5.13(transitive)
- Removed@vue/compiler-sfc@2.7.16(transitive)
- Removedprettier@2.8.8(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedvue@2.7.16(transitive)