{"version":3,"file":"loading2.mjs","sources":["../../../../../../packages/components/loading/src/loading.vue"],"sourcesContent":["<template>\n  <div ref=\"loadingRef\" :class=\"loadingKls\" :style=\"loadingStyles\">\n    <div\n      :class=\"ns.e('load')\"\n      :style=\"[{ transform: `scale(${unref(scale)})` }]\"\n    >\n      <div :class=\"ns.e('animation')\">\n        <div v-if=\"unref(percent)\" :class=\"ns.em('load', 'percent')\">\n          {{ unref(percent) }}\n        </div>\n\n        <template v-if=\"unref(type) === 'default'\">\n          <icon-loading />\n        </template>\n\n        <div\n          :class=\"[ns.em('animation', 'item'), ns.em('animation', 'item-1')]\"\n        />\n        <div\n          :class=\"[ns.em('animation', 'item'), ns.em('animation', 'item-2')]\"\n        />\n        <div\n          :class=\"[ns.em('animation', 'item'), ns.em('animation', 'item-3')]\"\n        />\n\n        <template v-if=\"unref(type) === 'ball'\">\n          <div\n            :class=\"[\n              ns.em('animation', 'shadow'),\n              ns.em('animation', 'shadow-1'),\n            ]\"\n          />\n          <div\n            :class=\"[\n              ns.em('animation', 'shadow'),\n              ns.em('animation', 'shadow-2'),\n            ]\"\n          />\n          <div\n            :class=\"[\n              ns.em('animation', 'shadow'),\n              ns.em('animation', 'shadow-3'),\n            ]\"\n          />\n        </template>\n      </div>\n\n      <div v-if=\"unref(text)\" :class=\"ns.e('text')\">{{ unref(text) }}</div>\n    </div>\n\n    <div v-if=\"unref(progress)\" :class=\"ns.e('progress')\">\n      <div\n        :class=\"ns.e('progress-bar')\"\n        :style=\"[{ width: `${unref(progress)}%` }]\"\n      />\n    </div>\n  </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, ref, unref } from 'vue'\nimport {\n  useColor,\n  useGlobalComponentSettings,\n  useProp,\n} from '@vuesax-alpha/hooks'\nimport { IconLoading } from '@vuesax-alpha/components/icon'\nimport { getVsColor } from '@vuesax-alpha/utils'\nimport { loadingProps } from './loading'\nimport type { Color } from '@vuesax-alpha/constants'\n\ndefineOptions({\n  name: 'VsLoading',\n})\n\nconst props = defineProps(loadingProps)\n\nconst { ns, zIndex } = useGlobalComponentSettings('loading')\n\nconst { currentZIndex } = zIndex\n\nconst loadingRef = ref<HTMLElement>()\nconst color = useColor('primary')\nconst background = useProp<Color>('background')\nconst type = useProp<string>('type')\n\nconst loadingKls = computed(() => [\n  ns.b(),\n  type.value && ns.m(type.value),\n  ns.is('has-target', !!unref(props.target)),\n])\nconst loadingStyles = computed(() => [\n  ns.cssVar({\n    color: getVsColor(color),\n    background: getVsColor(background),\n    opacity: `${unref(props.opacity)}`,\n  }),\n  { zIndex: unref(currentZIndex) },\n])\n\nconst close = () => {\n  loadingRef.value?.remove()\n}\n\ndefineExpose({\n  close,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;mCAuEc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAA,MAAM,EAAE,EAAA,EAAI,MAAO,EAAA,GAAI,2BAA2B,SAAS,CAAA,CAAA;AAErD,IAAA,MAAA,EAAE,eAAkB,GAAA,MAAA,CAAA;AAE1B,IAAA,MAAM,aAAa,GAAiB,EAAA,CAAA;AAC9B,IAAA,MAAA,KAAA,GAAQ,SAAS,SAAS,CAAA,CAAA;AAC1B,IAAA,MAAA,UAAA,GAAa,QAAe,YAAY,CAAA,CAAA;AACxC,IAAA,MAAA,IAAA,GAAO,QAAgB,MAAM,CAAA,CAAA;AAE7B,IAAA,MAAA,UAAA,GAAa,SAAS,MAAM;AAAA,MAChC,GAAG,CAAE,EAAA;AAAA,MACL,IAAK,CAAA,KAAA,IAAS,EAAG,CAAA,CAAA,CAAE,KAAK,KAAK,CAAA;AAAA,MAC7B,EAAA,CAAG,GAAG,YAAc,EAAA,CAAC,CAAC,KAAM,CAAA,KAAA,CAAM,MAAM,CAAC,CAAA;AAAA,KAC1C,CAAA,CAAA;AACK,IAAA,MAAA,aAAA,GAAgB,SAAS,MAAM;AAAA,MACnC,GAAG,MAAO,CAAA;AAAA,QAC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