@opentiny/vue-loading
Advanced tools
Comparing version 3.1.0-alpha.0 to 3.4.7
103
lib/index.js
import PopupManager from '@opentiny/vue-renderless/common/deps/popup-manager'; | ||
import { addClass, getStyle, removeClass } from '@opentiny/vue-renderless/common/deps/dom'; | ||
import { $prefix, setup, createComponent, hooks, directive as directive$1, setupComponent } from '@opentiny/vue-common'; | ||
import { renderless, api } from '@opentiny/vue-renderless/loading/vue'; | ||
import { createElementVNode, openBlock, createBlock, Transition, withCtx, withDirectives, normalizeClass, normalizeStyle, createElementBlock, resolveDynamicComponent, toDisplayString, createCommentVNode, vShow } from 'vue'; | ||
import { $prefix, $props, $setup, createComponent, hooks, directive as directive$1, setupComponent } from '@opentiny/vue-common'; | ||
import PCTemplate from './pc'; | ||
import MobileTemplate from './mobile'; | ||
import afterLeave from '@opentiny/vue-renderless/common/deps/after-leave'; | ||
@@ -59,15 +59,33 @@ import '@opentiny/vue-theme/loading/index.css'; | ||
var script = { | ||
inheritAttrs: false, | ||
var template = function template() { | ||
if (process.env.TINY_MODE === 'pc') { | ||
return PCTemplate; | ||
} else if (process.env.TINY_MODE === 'mobile') { | ||
return MobileTemplate; | ||
} else { | ||
return tinyMode === 'mobile' ? MobileTemplate : PCTemplate; | ||
} | ||
}; | ||
var Loading = { | ||
name: $prefix + 'Loading', | ||
props: { | ||
_constants: Object | ||
}, | ||
setup: function setup$1(props, context) { | ||
return setup({ | ||
emits: [], | ||
props: _objectSpread2(_objectSpread2({}, $props), {}, { | ||
type: { | ||
type: String, | ||
validator: function validator(value) { | ||
return ~['primary', 'simple'].indexOf(value); | ||
} | ||
}, | ||
loadtext: { | ||
type: String, | ||
default: function _default() { | ||
return constants.LOAD_ICON_TEXT; | ||
} | ||
} | ||
}), | ||
setup: function setup(props, context) { | ||
return $setup({ | ||
props: props, | ||
context: context, | ||
renderless: renderless, | ||
api: api, | ||
mono: true | ||
template: template | ||
}); | ||
@@ -77,46 +95,2 @@ } | ||
var _hoisted_1 = { | ||
class: "tiny-loading__spinner" | ||
}; | ||
var _hoisted_2 = { | ||
key: 0, | ||
class: "circular", | ||
viewBox: "25 25 50 50" | ||
}; | ||
var _hoisted_3 = createElementVNode("circle", { | ||
class: "path", | ||
cx: "50", | ||
cy: "50", | ||
r: "24", | ||
fill: "none" | ||
}, null, -1); | ||
var _hoisted_4 = [_hoisted_3]; | ||
var _hoisted_5 = { | ||
key: 2, | ||
class: "tiny-loading__text" | ||
}; | ||
function render(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createBlock(Transition, { | ||
name: "tiny-loading-fade", | ||
onAfterLeave: _ctx.handleAfterLeave | ||
}, { | ||
default: withCtx(function () { | ||
return [withDirectives(createElementVNode("div", { | ||
class: normalizeClass(["tiny-loading__mask", [_ctx.state.customClass, { | ||
'is-fullscreen': _ctx.state.fullscreen | ||
}]]), | ||
style: normalizeStyle({ | ||
backgroundColor: _ctx.state.background || '' | ||
}) | ||
}, [createElementVNode("div", _hoisted_1, [!_ctx.state.spinner ? (openBlock(), createElementBlock("svg", _hoisted_2, _hoisted_4)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.state.spinner), { | ||
key: 1, | ||
class: "tiny-icon-loading" | ||
})), _ctx.state.text ? (openBlock(), createElementBlock("p", _hoisted_5, toDisplayString(_ctx.state.text), 1)) : createCommentVNode("", true)])], 6), [[vShow, _ctx.state.visible]])]; | ||
}), | ||
_: 1 | ||
}, 8, ["onAfterLeave"]); | ||
} | ||
script.render = render; | ||
var defaults = { | ||
@@ -127,5 +101,8 @@ text: null, | ||
customClass: '', | ||
fullscreen: true | ||
fullscreen: true, | ||
type: 'primary', | ||
tiny_mode: 'pc' | ||
}; | ||
var fullscreenLoading = null; | ||
var tinyMode = null; | ||
var constants = { | ||
@@ -138,3 +115,4 @@ TEXT_ATTR: 'tiny-loading__text', | ||
PARENT_HIDDEN_CLS: 'tiny-loading__parent-hidden', | ||
PARENT_RELATIVE_CLS: 'tiny-loading__parent-relative' | ||
PARENT_RELATIVE_CLS: 'tiny-loading__parent-relative', | ||
LOAD_ICON_TEXT: 'ui.load.dot' | ||
}; | ||
@@ -169,2 +147,3 @@ var addStyle = function addStyle(options, parent, instance) { | ||
configs = _objectSpread2(_objectSpread2({}, defaults), configs); | ||
tinyMode = configs.tiny_mode; | ||
if (typeof configs.target === 'string') { | ||
@@ -184,3 +163,3 @@ configs.target = document.querySelector(configs.target); | ||
var instance = createComponent({ | ||
component: script, | ||
component: Loading, | ||
propsData: { | ||
@@ -295,3 +274,3 @@ _constants: constants | ||
var mask = createComponent({ | ||
component: script, | ||
component: Loading, | ||
propsData: { | ||
@@ -350,4 +329,4 @@ _constants: constants | ||
Loadings.directive = directive; | ||
Loadings.version = '3.1.0-alpha.0'; | ||
Loadings.version = '3.4.7'; | ||
export { Loadings as default }; |
{ | ||
"name": "@opentiny/vue-loading", | ||
"version": "3.1.0-alpha.0", | ||
"version": "3.4.7", | ||
"description": "", | ||
@@ -12,11 +12,12 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@opentiny/vue-common": "~3.1.0-alpha.0", | ||
"@opentiny/vue-icon": "~3.1.0-alpha.0", | ||
"@opentiny/vue-renderless": "~3.1.0-alpha.0", | ||
"@opentiny/vue-locale": "~3.1.0-alpha.0", | ||
"@opentiny/vue-theme": "~3.1.0-alpha.0", | ||
"@opentiny/vue-theme-mobile": "~3.1.0-alpha.0" | ||
"@opentiny/vue-common": "~3.4.7", | ||
"@opentiny/vue-icon": "~3.4.7", | ||
"@opentiny/vue-renderless": "~3.4.0", | ||
"@opentiny/vue-locale": "~3.4.7", | ||
"@opentiny/vue-theme": "~3.4.0", | ||
"@opentiny/vue-theme-mobile": "~3.4.0" | ||
}, | ||
"license": "MIT", | ||
"types": "index.d.ts", | ||
"sideEffects": false | ||
} |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
18640
8
489
1
3
+ Added@babel/runtime@7.18.3(transitive)
+ Added@opentiny/vue-common@3.4.7(transitive)
+ Added@opentiny/vue-icon@3.4.8(transitive)
+ Added@opentiny/vue-locale@3.4.7(transitive)
+ Added@opentiny/vue-renderless@3.4.7(transitive)
+ Added@opentiny/vue-theme@3.4.7(transitive)
+ Added@opentiny/vue-theme-mobile@3.4.7(transitive)
+ Addedregenerator-runtime@0.13.11(transitive)
- Removed@babel/runtime@7.26.9(transitive)
- Removed@opentiny/vue-common@3.1.0-alpha.0(transitive)
- Removed@opentiny/vue-icon@3.1.0-alpha.0(transitive)
- Removed@opentiny/vue-locale@3.1.0-alpha.0(transitive)
- Removed@opentiny/vue-renderless@3.1.0-alpha.0(transitive)
- Removed@opentiny/vue-theme@3.1.0-alpha.1(transitive)
- Removed@opentiny/vue-theme-mobile@3.1.0-alpha.0(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
Updated@opentiny/vue-common@~3.4.7
Updated@opentiny/vue-icon@~3.4.7
Updated@opentiny/vue-locale@~3.4.7
Updated@opentiny/vue-theme@~3.4.0