@veritree/ui 0.19.2-1 → 0.19.2-3

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": "@veritree/ui",
3
- "version": "0.19.2-1",
3
+ "version": "0.19.2-3",
4
4
  "description": "veritree ui library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -11,9 +11,9 @@
11
11
  "access": "public"
12
12
  },
13
13
  "dependencies": {
14
- "@veritree/icons": "^0.36.0"
14
+ "@veritree/icons": "^0.36.1-0"
15
15
  },
16
16
  "devDependencies": {
17
- "@nuxt/kit": "^3.0.0-rc.12"
17
+ "@nuxt/kit": "^3.0.0-rc.13"
18
18
  }
19
19
  }
@@ -32,7 +32,7 @@ import { keys } from '../../utils/keyboard';
32
32
  export default {
33
33
  name: 'VTTabItem',
34
34
 
35
- inject: ['api'],
35
+ inject: ['apiTabs'],
36
36
 
37
37
  props: {
38
38
  headless: {
@@ -43,7 +43,6 @@ export default {
43
43
 
44
44
  data() {
45
45
  return {
46
- api: this.api(),
47
46
  index: null,
48
47
  indexFocus: null,
49
48
  selected: false,
@@ -57,11 +56,11 @@ export default {
57
56
  },
58
57
 
59
58
  mounted() {
60
- this.api.registerTab(this);
59
+ this.apiTabs().registerTab(this);
61
60
  },
62
61
 
63
62
  beforeDestroy() {
64
- this.api.unregisterTab(this.index);
63
+ this.apiTabs().unregisterTab(this.index);
65
64
  },
66
65
 
67
66
  methods: {
@@ -78,11 +77,11 @@ export default {
78
77
  },
79
78
 
80
79
  focusFirstTab() {
81
- this.api.focusTab(0);
80
+ this.apiTabs().focusTab(0);
82
81
  },
83
82
 
84
83
  focusLastTab(lastTabIndex) {
85
- this.api.focusTab(lastTabIndex);
84
+ this.apiTabs().focusTab(lastTabIndex);
86
85
  },
87
86
 
88
87
  focusPreviousTab(lastTabIndex) {
@@ -91,7 +90,7 @@ export default {
91
90
  return;
92
91
  }
93
92
 
94
- this.api.focusTab(this.indexFocus - 1);
93
+ this.apiTabs().focusTab(this.indexFocus - 1);
95
94
  },
96
95
 
97
96
  focusNextTab(lastTabIndex) {
@@ -100,17 +99,17 @@ export default {
100
99
  return;
101
100
  }
102
101
 
103
- this.api.focusTab(this.indexFocus + 1);
102
+ this.apiTabs().focusTab(this.indexFocus + 1);
104
103
  },
105
104
 
106
105
  onClick() {
107
- this.api.selectTab(this.index);
106
+ this.apiTabs().selectTab(this.index);
108
107
  this.$emit('change');
109
108
  },
110
109
 
111
110
  onKeyDown(event) {
112
111
  const key = event.key;
113
- const lastTabIndex = this.api.getTabsLength() - 1;
112
+ const lastTabIndex = this.apiTabs().getTabsLength() - 1;
114
113
 
115
114
  if (this.indexFocus === null) {
116
115
  this.indexFocus = this.index;
@@ -5,10 +5,10 @@
5
5
  </template>
6
6
 
7
7
  <style scoped>
8
- .TabGroup.vertical{
8
+ .TabGroup.vertical {
9
9
  display: flex;
10
10
  }
11
- .TabGroup.vertical .TabList{
11
+ .TabGroup.vertical .TabList {
12
12
  display: flex;
13
13
  flex-direction: column;
14
14
  }
@@ -17,15 +17,17 @@
17
17
  <script>
18
18
  export default {
19
19
  name: 'VTTabGroup',
20
+
20
21
  props: {
21
- vertical: {
22
- type: Boolean,
23
- default: false
24
- }
22
+ vertical: {
23
+ type: Boolean,
24
+ default: false,
25
+ },
25
26
  },
27
+
26
28
  provide() {
27
29
  return {
28
- api: () => {
30
+ apiTabs: () => {
29
31
  const registerTab = (tab) => {
30
32
  _register(this.tabs, tab);
31
33
  if (tab.index === 0) tab.select();
@@ -14,11 +14,10 @@
14
14
  export default {
15
15
  name: 'VTTabPanel',
16
16
 
17
- inject: ['api'],
17
+ inject: ['apiTabs'],
18
18
 
19
19
  data() {
20
20
  return {
21
- api: this.api(),
22
21
  index: null,
23
22
  visible: false,
24
23
  };
@@ -31,11 +30,11 @@ export default {
31
30
  },
32
31
 
33
32
  mounted() {
34
- this.api.registerTabPanel(this);
33
+ this.apiTabs().registerTabPanel(this);
35
34
  },
36
35
 
37
36
  beforeDestroy() {
38
- this.api.unregisterTabPanel(this.id);
37
+ this.apiTabs().unregisterTabPanel(this.id);
39
38
  },
40
39
 
41
40
  methods: {
package/package-lock.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "name": "@veritree/ui",
3
- "version": "0.1.9",
4
- "lockfileVersion": 1,
5
- "requires": true,
6
- "dependencies": {
7
- "@veritree/icons": {
8
- "version": "0.12.0",
9
- "resolved": "https://registry.npmjs.org/@veritree/icons/-/icons-0.12.0.tgz",
10
- "integrity": "sha512-vunUKzvS9neslSf3R3y6RYQrcfRpxmp8PnhWWe2peYiyElLIJcb7zAsfCZ+I0Fg5PQ6GZG6StqWy0WF7MJ7VOg=="
11
- }
12
- }
13
- }
@@ -1,69 +0,0 @@
1
- <template>
2
- <transition
3
- enter-active-class="duration-300 ease-out"
4
- enter-class="transform opacity-0"
5
- enter-to-class="opacity-100"
6
- leave-active-class="duration-300 ease-in"
7
- leave-class="opacity-100"
8
- leave-to-class="transform opacity-0"
9
- @after-enter="afterEnter"
10
- @after-leave="afterLeave"
11
- >
12
- <div
13
- v-if="visible"
14
- class="fixed inset-0 z-50 flex flex-col justify-center bg-fd-700/75"
15
- tabindex="-1"
16
- @keyup.esc="close"
17
- @click="close"
18
- >
19
- <div
20
- class="relative mx-auto flex max-w-lg flex-col justify-center rounded bg-white"
21
- @click.stop
22
- >
23
- <div class="absolute right-4 top-4">
24
- <VTButton variant="icon" @click.prevent="close"
25
- ><IconClose class="h-4 w-4"
26
- /></VTButton>
27
- </div>
28
- <slot></slot>
29
- </div>
30
- </div>
31
- </transition>
32
- </template>
33
-
34
- <script>
35
- import { IconClose } from '@veritree/icons';
36
- import VTButton from '../Button/VTButton.vue';
37
-
38
- export default {
39
- name: 'VTModal',
40
-
41
- components: { IconClose, VTButton },
42
-
43
- model: {
44
- prop: 'visible',
45
- },
46
-
47
- props: {
48
- visible: {
49
- type: Boolean,
50
- default: false,
51
- },
52
- },
53
-
54
- methods: {
55
- close() {
56
- this.$emit('input', false);
57
- },
58
-
59
- afterEnter() {
60
- this.$emit('shown');
61
- this.$nextTick(() => this.$el.focus());
62
- },
63
-
64
- afterLeave() {
65
- this.$emit('hidden');
66
- },
67
- },
68
- };
69
- </script>