UNPKG

@vuesax-alpha/nightly

Version:
191 lines (186 loc) • 6.96 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); require('../../../hooks/index.js'); var index$3 = require('../../icon/index.js'); require('../../../utils/index.js'); var loading = require('./loading.js'); var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js'); var index = require('../../../hooks/use-global-config/index.js'); var index$1 = require('../../../hooks/use-common-props/index.js'); var index$2 = require('../../../hooks/use-prop/index.js'); var color = require('../../../utils/color.js'); const __default__ = vue.defineComponent({ name: "VsLoading" }); const _sfc_main = vue.defineComponent({ ...__default__, props: loading.loadingProps, setup(__props, { expose: __expose }) { const props = __props; const { ns, zIndex } = index.useGlobalComponentSettings("loading"); const { currentZIndex } = zIndex; const loadingRef = vue.ref(); const color$1 = index$1.useColor("primary"); const background = index$2.useProp("background"); const type = index$2.useProp("type"); const loadingKls = vue.computed(() => [ ns.b(), type.value && ns.m(type.value), ns.is("has-target", !!vue.unref(props.target)) ]); const loadingStyles = vue.computed(() => [ ns.cssVar({ color: color.getVsColor(color$1), background: color.getVsColor(background), opacity: `${vue.unref(props.opacity)}` }), { zIndex: vue.unref(currentZIndex) } ]); const close = () => { var _a; (_a = loadingRef.value) == null ? void 0 : _a.remove(); }; __expose({ close }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock( "div", { ref_key: "loadingRef", ref: loadingRef, class: vue.normalizeClass(loadingKls.value), style: vue.normalizeStyle(loadingStyles.value) }, [ vue.createElementVNode( "div", { class: vue.normalizeClass(vue.unref(ns).e("load")), style: vue.normalizeStyle([{ transform: `scale(${vue.unref(_ctx.scale)})` }]) }, [ vue.createElementVNode( "div", { class: vue.normalizeClass(vue.unref(ns).e("animation")) }, [ vue.unref(_ctx.percent) ? (vue.openBlock(), vue.createElementBlock( "div", { key: 0, class: vue.normalizeClass(vue.unref(ns).em("load", "percent")) }, vue.toDisplayString(vue.unref(_ctx.percent)), 3 )) : vue.createCommentVNode("v-if", true), vue.unref(vue.unref(type)) === "default" ? (vue.openBlock(), vue.createBlock(vue.unref(index$3.IconLoading), { key: 1 })) : vue.createCommentVNode("v-if", true), vue.createElementVNode( "div", { class: vue.normalizeClass([vue.unref(ns).em("animation", "item"), vue.unref(ns).em("animation", "item-1")]) }, null, 2 ), vue.createElementVNode( "div", { class: vue.normalizeClass([vue.unref(ns).em("animation", "item"), vue.unref(ns).em("animation", "item-2")]) }, null, 2 ), vue.createElementVNode( "div", { class: vue.normalizeClass([vue.unref(ns).em("animation", "item"), vue.unref(ns).em("animation", "item-3")]) }, null, 2 ), vue.unref(vue.unref(type)) === "ball" ? (vue.openBlock(), vue.createElementBlock( vue.Fragment, { key: 2 }, [ vue.createElementVNode( "div", { class: vue.normalizeClass([ vue.unref(ns).em("animation", "shadow"), vue.unref(ns).em("animation", "shadow-1") ]) }, null, 2 ), vue.createElementVNode( "div", { class: vue.normalizeClass([ vue.unref(ns).em("animation", "shadow"), vue.unref(ns).em("animation", "shadow-2") ]) }, null, 2 ), vue.createElementVNode( "div", { class: vue.normalizeClass([ vue.unref(ns).em("animation", "shadow"), vue.unref(ns).em("animation", "shadow-3") ]) }, null, 2 ) ], 64 )) : vue.createCommentVNode("v-if", true) ], 2 ), vue.unref(_ctx.text) ? (vue.openBlock(), vue.createElementBlock( "div", { key: 0, class: vue.normalizeClass(vue.unref(ns).e("text")) }, vue.toDisplayString(vue.unref(_ctx.text)), 3 )) : vue.createCommentVNode("v-if", true) ], 6 ), vue.unref(_ctx.progress) ? (vue.openBlock(), vue.createElementBlock( "div", { key: 0, class: vue.normalizeClass(vue.unref(ns).e("progress")) }, [ vue.createElementVNode( "div", { class: vue.normalizeClass(vue.unref(ns).e("progress-bar")), style: vue.normalizeStyle([{ width: `${vue.unref(_ctx.progress)}%` }]) }, null, 6 ) ], 2 )) : vue.createCommentVNode("v-if", true) ], 6 ); }; } }); var LoadingConstructor = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/vuesax-alpha/vuesax-alpha/packages/components/loading/src/loading.vue"]]); exports["default"] = LoadingConstructor; //# sourceMappingURL=loading2.js.map