vue-stack-tabs 0.1.9 → 0.1.11

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.
Files changed (83) hide show
  1. package/README.md +2 -2
  2. package/dist/favicon.svg +9 -9
  3. package/dist/style.css +1 -1
  4. package/dist/vue-stack-tabs.es.js +891 -889
  5. package/dist/vue-stack-tabs.umd.js +10 -10
  6. package/package.json +4 -4
  7. package/src/lib/StackTabs.vue +126 -126
  8. package/src/lib/assets/style/common/mixins.scss +45 -45
  9. package/src/lib/assets/style/common/var.scss +65 -65
  10. package/src/lib/assets/style/icon.scss +93 -93
  11. package/src/lib/assets/style/index.scss +4 -4
  12. package/src/lib/assets/style/overlayer.scss +40 -40
  13. package/src/lib/assets/style/stackTab.scss +395 -395
  14. package/src/lib/assets/style/transition.scss +40 -40
  15. package/src/lib/banner.ts +51 -51
  16. package/src/lib/components/ContextMenu/ContextMenuItem.vue +15 -15
  17. package/src/lib/components/ContextMenu/index.vue +129 -128
  18. package/src/lib/components/OverlayLoading/Component.vue +191 -188
  19. package/src/lib/components/OverlayLoading/api.ts +31 -31
  20. package/src/lib/components/OverlayLoading/helpers.ts +31 -31
  21. package/src/lib/components/OverlayLoading/index.ts +12 -12
  22. package/src/lib/components/OverlayLoading/loaders/bars.vue +79 -79
  23. package/src/lib/components/OverlayLoading/loaders/dots.vue +92 -92
  24. package/src/lib/components/OverlayLoading/loaders/index.ts +9 -9
  25. package/src/lib/components/OverlayLoading/loaders/spinner.vue +41 -41
  26. package/src/lib/components/TabHeader/TabHeaderButton.vue +35 -35
  27. package/src/lib/components/TabHeader/TabHeaderItem.vue +63 -63
  28. package/src/lib/components/TabHeader/TabHeaderScroll.vue +240 -240
  29. package/src/lib/components/TabHeader/index.vue +135 -134
  30. package/src/lib/hooks/useContextMenu.ts +50 -50
  31. package/src/lib/hooks/useStackTab.ts +65 -65
  32. package/src/lib/hooks/useTabLoading.ts +34 -35
  33. package/src/lib/hooks/useTabRouter.ts +94 -95
  34. package/src/lib/hooks/useTabpanel.tsx +491 -490
  35. package/src/lib/i18n/index.ts +72 -72
  36. package/src/lib/i18n/lang/en.ts +15 -15
  37. package/src/lib/i18n/lang/zh-CN.ts +15 -15
  38. package/src/lib/iframe.vue +7 -7
  39. package/src/lib/index.ts +23 -23
  40. package/src/lib/model/TabModel.ts +169 -182
  41. package/src/lib/utils/TabIdHelper.ts +70 -70
  42. package/src/lib/utils/TabScrollHelper.ts +104 -104
  43. package/src/lib/utils/UriHelper.ts +22 -22
  44. package/types/index.d.ts +3 -11
  45. package/types/src/lib/StackTabs.vue.d.ts +122 -0
  46. package/types/src/lib/components/ContextMenu/ContextMenuItem.vue.d.ts +17 -0
  47. package/types/src/lib/components/ContextMenu/index.vue.d.ts +45 -0
  48. package/types/src/lib/components/OverlayLoading/Component.vue.d.ts +100 -0
  49. package/types/src/lib/components/OverlayLoading/api.d.ts +5 -0
  50. package/types/src/lib/components/OverlayLoading/helpers.d.ts +7 -0
  51. package/types/src/lib/components/OverlayLoading/index.d.ts +6 -0
  52. package/types/src/lib/components/OverlayLoading/loaders/bars.vue.d.ts +39 -0
  53. package/types/src/lib/components/OverlayLoading/loaders/dots.vue.d.ts +39 -0
  54. package/types/src/lib/components/OverlayLoading/loaders/index.d.ts +96 -0
  55. package/types/src/lib/components/OverlayLoading/loaders/spinner.vue.d.ts +39 -0
  56. package/types/src/lib/components/TabHeader/TabHeaderButton.vue.d.ts +48 -0
  57. package/types/src/lib/components/TabHeader/TabHeaderItem.vue.d.ts +21 -0
  58. package/types/src/lib/components/TabHeader/TabHeaderScroll.vue.d.ts +49 -0
  59. package/types/src/lib/components/TabHeader/index.vue.d.ts +64 -0
  60. package/types/{hooks → src/lib/hooks}/useContextMenu.d.ts +8 -2
  61. package/types/src/lib/hooks/useStackTab.d.ts +8 -0
  62. package/types/{hooks → src/lib/hooks}/useTabRouter.d.ts +2 -1
  63. package/types/src/lib/hooks/useTabpanel.d.ts +68 -0
  64. package/types/src/lib/i18n/index.d.ts +4 -0
  65. package/types/src/lib/i18n/lang/en.d.ts +16 -0
  66. package/types/src/lib/i18n/lang/zh-CN.d.ts +16 -0
  67. package/types/src/lib/iframe.vue.d.ts +2 -0
  68. package/types/src/lib/index.d.ts +13 -0
  69. package/types/{model → src/lib/model}/TabModel.d.ts +0 -20
  70. package/types/{utils → src/lib/utils}/TabScrollHelper.d.ts +3 -3
  71. package/types/StackTabs.vue.d.ts +0 -2
  72. package/types/components/ContextMenu/ContextMenuItem.vue.d.ts +0 -2
  73. package/types/components/ContextMenu/index.vue.d.ts +0 -2
  74. package/types/components/TabHeader/TabHeaderButton.vue.d.ts +0 -2
  75. package/types/components/TabHeader/TabHeaderItem.vue.d.ts +0 -2
  76. package/types/components/TabHeader/TabHeaderScroll.vue.d.ts +0 -2
  77. package/types/components/TabHeader/index.vue.d.ts +0 -2
  78. package/types/hooks/useStackTab.d.ts +0 -9
  79. package/types/iframe.vue.d.ts +0 -2
  80. /package/types/{banner.d.ts → src/lib/banner.d.ts} +0 -0
  81. /package/types/{hooks → src/lib/hooks}/useTabLoading.d.ts +0 -0
  82. /package/types/{utils → src/lib/utils}/TabIdHelper.d.ts +0 -0
  83. /package/types/{utils → src/lib/utils}/UriHelper.d.ts +0 -0
@@ -1,79 +1,79 @@
1
- <template>
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- viewBox="0 0 30 30"
5
- :height="height"
6
- :width="width"
7
- :fill="color"
8
- >
9
- <rect x="0" y="13" width="4" height="5">
10
- <animate
11
- attributeName="height"
12
- attributeType="XML"
13
- values="5;21;5"
14
- begin="0s"
15
- dur="0.6s"
16
- repeatCount="indefinite"
17
- />
18
- <animate
19
- attributeName="y"
20
- attributeType="XML"
21
- values="13; 5; 13"
22
- begin="0s"
23
- dur="0.6s"
24
- repeatCount="indefinite"
25
- />
26
- </rect>
27
- <rect x="10" y="13" width="4" height="5">
28
- <animate
29
- attributeName="height"
30
- attributeType="XML"
31
- values="5;21;5"
32
- begin="0.15s"
33
- dur="0.6s"
34
- repeatCount="indefinite"
35
- />
36
- <animate
37
- attributeName="y"
38
- attributeType="XML"
39
- values="13; 5; 13"
40
- begin="0.15s"
41
- dur="0.6s"
42
- repeatCount="indefinite"
43
- />
44
- </rect>
45
- <rect x="20" y="13" width="4" height="5">
46
- <animate
47
- attributeName="height"
48
- attributeType="XML"
49
- values="5;21;5"
50
- begin="0.3s"
51
- dur="0.6s"
52
- repeatCount="indefinite"
53
- />
54
- <animate
55
- attributeName="y"
56
- attributeType="XML"
57
- values="13; 5; 13"
58
- begin="0.3s"
59
- dur="0.6s"
60
- repeatCount="indefinite"
61
- />
62
- </rect>
63
- </svg>
64
- </template>
65
- <script lang="ts" setup>
66
- import { defineProps, withDefaults } from 'vue'
67
- withDefaults(
68
- defineProps<{
69
- color?: string
70
- height?: number
71
- width?: number
72
- }>(),
73
- {
74
- color: '#000',
75
- height: 40,
76
- width: 40
77
- }
78
- )
79
- </script>
1
+ <template>
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ viewBox="0 0 30 30"
5
+ :height="height"
6
+ :width="width"
7
+ :fill="color"
8
+ >
9
+ <rect x="0" y="13" width="4" height="5">
10
+ <animate
11
+ attributeName="height"
12
+ attributeType="XML"
13
+ values="5;21;5"
14
+ begin="0s"
15
+ dur="0.6s"
16
+ repeatCount="indefinite"
17
+ />
18
+ <animate
19
+ attributeName="y"
20
+ attributeType="XML"
21
+ values="13; 5; 13"
22
+ begin="0s"
23
+ dur="0.6s"
24
+ repeatCount="indefinite"
25
+ />
26
+ </rect>
27
+ <rect x="10" y="13" width="4" height="5">
28
+ <animate
29
+ attributeName="height"
30
+ attributeType="XML"
31
+ values="5;21;5"
32
+ begin="0.15s"
33
+ dur="0.6s"
34
+ repeatCount="indefinite"
35
+ />
36
+ <animate
37
+ attributeName="y"
38
+ attributeType="XML"
39
+ values="13; 5; 13"
40
+ begin="0.15s"
41
+ dur="0.6s"
42
+ repeatCount="indefinite"
43
+ />
44
+ </rect>
45
+ <rect x="20" y="13" width="4" height="5">
46
+ <animate
47
+ attributeName="height"
48
+ attributeType="XML"
49
+ values="5;21;5"
50
+ begin="0.3s"
51
+ dur="0.6s"
52
+ repeatCount="indefinite"
53
+ />
54
+ <animate
55
+ attributeName="y"
56
+ attributeType="XML"
57
+ values="13; 5; 13"
58
+ begin="0.3s"
59
+ dur="0.6s"
60
+ repeatCount="indefinite"
61
+ />
62
+ </rect>
63
+ </svg>
64
+ </template>
65
+ <script lang="ts" setup>
66
+ import { defineProps, withDefaults } from 'vue'
67
+ withDefaults(
68
+ defineProps<{
69
+ color?: string
70
+ height?: number
71
+ width?: number
72
+ }>(),
73
+ {
74
+ color: '#000',
75
+ height: 40,
76
+ width: 40
77
+ }
78
+ )
79
+ </script>
@@ -1,92 +1,92 @@
1
- <template>
2
- <svg
3
- viewBox="0 0 120 30"
4
- xmlns="http://www.w3.org/2000/svg"
5
- :fill="color"
6
- :width="width"
7
- :height="height"
8
- >
9
- <circle cx="15" cy="15" r="15">
10
- <animate
11
- attributeName="r"
12
- from="15"
13
- to="15"
14
- begin="0s"
15
- dur="0.8s"
16
- values="15;9;15"
17
- calcMode="linear"
18
- repeatCount="indefinite"
19
- />
20
- <animate
21
- attributeName="fill-opacity"
22
- from="1"
23
- to="1"
24
- begin="0s"
25
- dur="0.8s"
26
- values="1;.5;1"
27
- calcMode="linear"
28
- repeatCount="indefinite"
29
- />
30
- </circle>
31
- <circle cx="60" cy="15" r="9" fill-opacity="0.3">
32
- <animate
33
- attributeName="r"
34
- from="9"
35
- to="9"
36
- begin="0s"
37
- dur="0.8s"
38
- values="9;15;9"
39
- calcMode="linear"
40
- repeatCount="indefinite"
41
- />
42
- <animate
43
- attributeName="fill-opacity"
44
- from="0.5"
45
- to="0.5"
46
- begin="0s"
47
- dur="0.8s"
48
- values=".5;1;.5"
49
- calcMode="linear"
50
- repeatCount="indefinite"
51
- />
52
- </circle>
53
- <circle cx="105" cy="15" r="15">
54
- <animate
55
- attributeName="r"
56
- from="15"
57
- to="15"
58
- begin="0s"
59
- dur="0.8s"
60
- values="15;9;15"
61
- calcMode="linear"
62
- repeatCount="indefinite"
63
- />
64
- <animate
65
- attributeName="fill-opacity"
66
- from="1"
67
- to="1"
68
- begin="0s"
69
- dur="0.8s"
70
- values="1;.5;1"
71
- calcMode="linear"
72
- repeatCount="indefinite"
73
- />
74
- </circle>
75
- </svg>
76
- </template>
77
-
78
- <script lang="ts" setup>
79
- import { defineProps, withDefaults } from 'vue'
80
- withDefaults(
81
- defineProps<{
82
- color?: string
83
- height?: number
84
- width?: number
85
- }>(),
86
- {
87
- color: '#000',
88
- height: 240,
89
- width: 60
90
- }
91
- )
92
- </script>
1
+ <template>
2
+ <svg
3
+ viewBox="0 0 120 30"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ :fill="color"
6
+ :width="width"
7
+ :height="height"
8
+ >
9
+ <circle cx="15" cy="15" r="15">
10
+ <animate
11
+ attributeName="r"
12
+ from="15"
13
+ to="15"
14
+ begin="0s"
15
+ dur="0.8s"
16
+ values="15;9;15"
17
+ calcMode="linear"
18
+ repeatCount="indefinite"
19
+ />
20
+ <animate
21
+ attributeName="fill-opacity"
22
+ from="1"
23
+ to="1"
24
+ begin="0s"
25
+ dur="0.8s"
26
+ values="1;.5;1"
27
+ calcMode="linear"
28
+ repeatCount="indefinite"
29
+ />
30
+ </circle>
31
+ <circle cx="60" cy="15" r="9" fill-opacity="0.3">
32
+ <animate
33
+ attributeName="r"
34
+ from="9"
35
+ to="9"
36
+ begin="0s"
37
+ dur="0.8s"
38
+ values="9;15;9"
39
+ calcMode="linear"
40
+ repeatCount="indefinite"
41
+ />
42
+ <animate
43
+ attributeName="fill-opacity"
44
+ from="0.5"
45
+ to="0.5"
46
+ begin="0s"
47
+ dur="0.8s"
48
+ values=".5;1;.5"
49
+ calcMode="linear"
50
+ repeatCount="indefinite"
51
+ />
52
+ </circle>
53
+ <circle cx="105" cy="15" r="15">
54
+ <animate
55
+ attributeName="r"
56
+ from="15"
57
+ to="15"
58
+ begin="0s"
59
+ dur="0.8s"
60
+ values="15;9;15"
61
+ calcMode="linear"
62
+ repeatCount="indefinite"
63
+ />
64
+ <animate
65
+ attributeName="fill-opacity"
66
+ from="1"
67
+ to="1"
68
+ begin="0s"
69
+ dur="0.8s"
70
+ values="1;.5;1"
71
+ calcMode="linear"
72
+ repeatCount="indefinite"
73
+ />
74
+ </circle>
75
+ </svg>
76
+ </template>
77
+
78
+ <script lang="ts" setup>
79
+ import { defineProps, withDefaults } from 'vue'
80
+ withDefaults(
81
+ defineProps<{
82
+ color?: string
83
+ height?: number
84
+ width?: number
85
+ }>(),
86
+ {
87
+ color: '#000',
88
+ height: 240,
89
+ width: 60
90
+ }
91
+ )
92
+ </script>
@@ -1,9 +1,9 @@
1
- import Spinner from './spinner.vue'
2
- import Dots from './dots.vue'
3
- import Bars from './bars.vue'
4
-
5
- export default {
6
- spinner: Spinner,
7
- dots: Dots,
8
- bars: Bars
9
- }
1
+ import Spinner from './spinner.vue'
2
+ import Dots from './dots.vue'
3
+ import Bars from './bars.vue'
4
+
5
+ export default {
6
+ spinner: Spinner,
7
+ dots: Dots,
8
+ bars: Bars
9
+ }
@@ -1,41 +1,41 @@
1
- <template>
2
- <svg
3
- viewBox="0 0 38 38"
4
- xmlns="http://www.w3.org/2000/svg"
5
- :width="width"
6
- :height="height"
7
- :stroke="color"
8
- >
9
- <g fill="none" fill-rule="evenodd">
10
- <g transform="translate(1 1)" stroke-width="2">
11
- <circle stroke-opacity=".25" cx="18" cy="18" r="18" />
12
- <path d="M36 18c0-9.94-8.06-18-18-18">
13
- <animateTransform
14
- attributeName="transform"
15
- type="rotate"
16
- from="0 18 18"
17
- to="360 18 18"
18
- dur="0.8s"
19
- repeatCount="indefinite"
20
- />
21
- </path>
22
- </g>
23
- </g>
24
- </svg>
25
- </template>
26
-
27
- <script lang="ts" setup>
28
- import { defineProps, withDefaults } from 'vue'
29
- withDefaults(
30
- defineProps<{
31
- color?: string
32
- height?: number
33
- width?: number
34
- }>(),
35
- {
36
- color: '#000',
37
- height: 64,
38
- width: 64
39
- }
40
- )
41
- </script>
1
+ <template>
2
+ <svg
3
+ viewBox="0 0 38 38"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ :width="width"
6
+ :height="height"
7
+ :stroke="color"
8
+ >
9
+ <g fill="none" fill-rule="evenodd">
10
+ <g transform="translate(1 1)" stroke-width="2">
11
+ <circle stroke-opacity=".25" cx="18" cy="18" r="18" />
12
+ <path d="M36 18c0-9.94-8.06-18-18-18">
13
+ <animateTransform
14
+ attributeName="transform"
15
+ type="rotate"
16
+ from="0 18 18"
17
+ to="360 18 18"
18
+ dur="0.8s"
19
+ repeatCount="indefinite"
20
+ />
21
+ </path>
22
+ </g>
23
+ </g>
24
+ </svg>
25
+ </template>
26
+
27
+ <script lang="ts" setup>
28
+ import { defineProps, withDefaults } from 'vue'
29
+ withDefaults(
30
+ defineProps<{
31
+ color?: string
32
+ height?: number
33
+ width?: number
34
+ }>(),
35
+ {
36
+ color: '#000',
37
+ height: 64,
38
+ width: 64
39
+ }
40
+ )
41
+ </script>
@@ -1,35 +1,35 @@
1
- <template>
2
- <div
3
- class="stack-tab__header-button"
4
- :class="{
5
- 'stack-tab__shadow-right': shadow === 'right',
6
- 'stack-tab__shadow-left': shadow === 'left'
7
- }"
8
- :disabled="disabled ? 'disabled' : null"
9
- :title="title"
10
- >
11
- <div v-if="!('icon' in $slots)" class="stack-tab__mask-button" :class="iconClass" />
12
- <div v-if="'icon' in $slots" class="stack-tab__button">
13
- <slot name="icon" />
14
- </div>
15
- </div>
16
- </template>
17
-
18
- <script lang="ts" setup>
19
- withDefaults(
20
- defineProps<{
21
- // 是否禁用
22
- disabled?: boolean
23
- shadow?: string | null
24
- iconClass?: string
25
- title?: string
26
- }>(),
27
- {
28
- disabled: false,
29
- shadow: null,
30
- iconClass: ''
31
- }
32
- )
33
- </script>
34
-
35
- <style scoped></style>
1
+ <template>
2
+ <div
3
+ class="stack-tab__header-button"
4
+ :class="{
5
+ 'stack-tab__shadow-right': shadow === 'right',
6
+ 'stack-tab__shadow-left': shadow === 'left'
7
+ }"
8
+ :disabled="disabled ? 'disabled' : null"
9
+ :title="title"
10
+ >
11
+ <div v-if="!('icon' in $slots)" class="stack-tab__mask-button" :class="iconClass" />
12
+ <div v-if="'icon' in $slots" class="stack-tab__button">
13
+ <slot name="icon" />
14
+ </div>
15
+ </div>
16
+ </template>
17
+
18
+ <script lang="ts" setup>
19
+ withDefaults(
20
+ defineProps<{
21
+ // 是否禁用
22
+ disabled?: boolean
23
+ shadow?: string | null
24
+ iconClass?: string
25
+ title?: string
26
+ }>(),
27
+ {
28
+ disabled: false,
29
+ shadow: null,
30
+ iconClass: ''
31
+ }
32
+ )
33
+ </script>
34
+
35
+ <style scoped></style>
@@ -1,63 +1,63 @@
1
- <template>
2
- <li
3
- ref="curtab"
4
- class="stack-tab__item"
5
- :class="{
6
- 'is-active': item.active,
7
- 'is-icon': item.closable
8
- }"
9
- @click="activeTab"
10
- >
11
- <!-- <div v-if="!!icon" class="stack-tab__item-icon" :class="icon"></div>-->
12
- <div class="stack-tab__item-title">
13
- <div class="stack-tab__item-title-content" :title="title">
14
- {{ title }}
15
- </div>
16
- </div>
17
- <div
18
- v-if="item.closable"
19
- class="stack-tab__icon-close-fill stack-tab__item-button"
20
- :title="t('VueStackTab.close')"
21
- @click.stop="closeTab"
22
- />
23
- </li>
24
- </template>
25
-
26
- <script setup lang="ts" name="TabHeaderItem">
27
- import { computed, ref, watch } from 'vue'
28
- import type { ITabItem } from '@/lib/model/TabModel'
29
- import localeI18n from '@/lib/i18n'
30
- // 消息
31
- const emit = defineEmits(['close', 'active'])
32
-
33
- const { t } = localeI18n().getI18n()
34
- const curtab = ref<HTMLElement>()
35
- const props = defineProps<{
36
- item: ITabItem
37
- }>()
38
- /**
39
- * 如果Active为true,就看看
40
- */
41
- watch(
42
- () => props.item.active,
43
- (val) => {
44
- if (val) {
45
- activeTab()
46
- }
47
- }
48
- )
49
- const title = computed<string>(() => {
50
- return props.item.title || t('undefined')
51
- })
52
-
53
- const closeTab = () => {
54
- emit('close', props.item)
55
- }
56
- const activeTab = () => {
57
- // if (!props.active) {
58
- emit('active', props.item, curtab)
59
- // }
60
- }
61
- </script>
62
-
63
- <style lang="scss" scoped></style>
1
+ <template>
2
+ <li
3
+ ref="curtab"
4
+ class="stack-tab__item"
5
+ :class="{
6
+ 'is-active': item.active,
7
+ 'is-icon': item.closable
8
+ }"
9
+ @click="activeTab"
10
+ >
11
+ <!-- <div v-if="!!icon" class="stack-tab__item-icon" :class="icon"></div>-->
12
+ <div class="stack-tab__item-title">
13
+ <div class="stack-tab__item-title-content" :title="title">
14
+ {{ title }}
15
+ </div>
16
+ </div>
17
+ <div
18
+ v-if="item.closable"
19
+ class="stack-tab__icon-close-fill stack-tab__item-button"
20
+ :title="t('VueStackTab.close')"
21
+ @click.stop="closeTab"
22
+ />
23
+ </li>
24
+ </template>
25
+
26
+ <script setup lang="ts" name="TabHeaderItem">
27
+ import { computed, ref, watch } from 'vue'
28
+ import type { ITabItem } from '@/lib/model/TabModel'
29
+ import localeI18n from '@/lib/i18n'
30
+ // 消息
31
+ const emit = defineEmits(['close', 'active'])
32
+
33
+ const { t } = localeI18n().getI18n()
34
+ const curtab = ref<HTMLElement>()
35
+ const props = defineProps<{
36
+ item: ITabItem
37
+ }>()
38
+ /**
39
+ * 如果Active为true,就看看
40
+ */
41
+ watch(
42
+ () => props.item.active,
43
+ (val) => {
44
+ if (val) {
45
+ activeTab()
46
+ }
47
+ }
48
+ )
49
+ const title = computed<string>(() => {
50
+ return props.item.title || t('undefined')
51
+ })
52
+
53
+ const closeTab = () => {
54
+ emit('close', props.item)
55
+ }
56
+ const activeTab = () => {
57
+ // if (!props.active) {
58
+ emit('active', props.item, curtab)
59
+ // }
60
+ }
61
+ </script>
62
+
63
+ <style lang="scss" scoped></style>