vue-stack-tabs 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-stack-tabs",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Vue.js component for router tab.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -34,7 +34,7 @@ import {
34
34
  watch
35
35
  } from 'vue'
36
36
  import { removeElement } from './helpers'
37
- import Loaders from '../loaders'
37
+ import Loaders from './loaders'
38
38
 
39
39
  const props = withDefaults(
40
40
  defineProps<{
@@ -42,7 +42,7 @@ const props = withDefaults(
42
42
  programmatic: boolean
43
43
  container: HTMLElement | Object | Function
44
44
  isFullPage: boolean
45
- enforceFocus: boolean
45
+ enforceFocus?: boolean
46
46
  lockScroll: boolean
47
47
  transition: string
48
48
  /**
@@ -182,4 +182,7 @@ onBeforeUnmount(() => {
182
182
  document.removeEventListener('keyup', keyPress)
183
183
  document.removeEventListener('focusin', focusIn)
184
184
  })
185
+ defineExpose({
186
+ hide
187
+ })
185
188
  </script>
@@ -12,8 +12,9 @@ export const useLoading = (globalProps = {}, globalSlots = {}) => {
12
12
  }
13
13
 
14
14
  const propsData = { ...globalProps, ...props, ...forceProps }
15
+ // @ts-ignore
15
16
  let container = propsData.container
16
-
17
+ // @ts-ignore
17
18
  if (!propsData.container) {
18
19
  container = document.body
19
20
  propsData.isFullPage = true
@@ -23,7 +24,7 @@ export const useLoading = (globalProps = {}, globalSlots = {}) => {
23
24
  const instance = createComponent(LoadingComponent, propsData, container, mergedSlots)
24
25
 
25
26
  return {
26
- hide: instance.ctx.hide
27
+ hide: instance!.exposed!.hide
27
28
  }
28
29
  }
29
30
  }
@@ -1,6 +1,6 @@
1
1
  import { h, render } from 'vue'
2
2
 
3
- export const removeElement = (el) => {
3
+ export const removeElement = (el: HTMLElement) => {
4
4
  if (typeof el.remove !== 'undefined') {
5
5
  el.remove()
6
6
  } else {
@@ -9,7 +9,12 @@ export const removeElement = (el) => {
9
9
  }
10
10
 
11
11
  // Taken from https://github.com/moyoujun/vue3-loading-overlay/blob/master/src/index.ts
12
- export function createComponent(component, props, parentContainer, slots = {}) {
12
+ export function createComponent(
13
+ component: any,
14
+ props: any,
15
+ parentContainer: HTMLElement,
16
+ slots = {}
17
+ ) {
13
18
  const vNode = h(component, props, slots)
14
19
  const container = document.createElement('div')
15
20
  container.classList.add('vld-container')
@@ -1,5 +1,5 @@
1
- import { useLoading } from './js/api'
2
- import Component from './js/Component.vue'
1
+ import { useLoading } from './api'
2
+ import Component from './Component.vue'
3
3
  import type { App } from 'vue'
4
4
 
5
5
  const LoadingPlugin = (app: App, props = {}, slots = {}) => {