File tree Expand file tree Collapse file tree 7 files changed +43
-21
lines changed Expand file tree Collapse file tree 7 files changed +43
-21
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,10 @@ module.exports = {
55
55
'/^(click):[a-z]+[a-zA-Z]+$/' ,
56
56
] ,
57
57
} ] ,
58
+ 'vue/component-name-in-template-casing' : [ 'error' , 'PascalCase' , {
59
+ registeredComponentsOnly : false ,
60
+ ignores : [ ] ,
61
+ } ] ,
58
62
59
63
// Vue
60
64
'vue/require-default-prop' : 'off' ,
Original file line number Diff line number Diff line change 1
1
<script lang="ts" setup>
2
- import { AIcon } from ' @/components ' ;
3
- import { useLayer , useProps as useLayerProps } from ' @/composables/useLayer ' ;
4
- import { configurable as configurableProp } from ' @/composables/useProps ' ;
5
- import type { ExtractPropTypes } from ' vue ' ;
2
+ import type { ExtractPropTypes } from ' vue '
3
+ import { AIcon } from ' @/components '
4
+ import { useLayer , useProps as useLayerProps } from ' @/composables/useLayer '
5
+ import { configurable as configurableProp } from ' @/composables/useProps '
6
6
7
7
const props = defineProps ({
8
8
@@ -83,14 +83,15 @@ const handleAppendIconClick = () => {
83
83
}
84
84
85
85
const appendIconBindings = computed (() => {
86
- if (props .dismissible )
86
+ if (props .dismissible ) {
87
87
return {
88
88
icon: appendIcon ,
89
- ariaLabel: ' close'
89
+ ariaLabel: ' close' ,
90
90
}
91
+ }
91
92
92
93
return {
93
- class: appendIcon
94
+ class: appendIcon ,
94
95
}
95
96
})
96
97
</script >
@@ -109,14 +110,17 @@ const appendIconBindings = computed(() => {
109
110
<div v-if =" props.icon" >
110
111
<i :class =" props.icon" />
111
112
</div >
112
- <div class =" flex-grow" >
113
+ <div
114
+ class =" flex-grow"
115
+ data-no-reference
116
+ >
113
117
<slot />
114
118
</div >
115
119
<div >
116
120
<slot name =" append" >
117
121
<Component
118
- v-if =" appendIcon"
119
122
:is =" props.dismissible ? AIcon : 'i'"
123
+ v-if =" appendIcon"
120
124
class =" align-text-top"
121
125
v-bind =" appendIconBindings"
122
126
@click =" handleAppendIconClick"
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ const { styles, classes } = getLayerClasses(
46
46
/>
47
47
<div
48
48
class =" a-btn-content"
49
+ data-no-reference
49
50
:class =" [props.loading && 'opacity-0']"
50
51
>
51
52
<i
Original file line number Diff line number Diff line change @@ -65,7 +65,10 @@ const dotPosition = computed(() => {
65
65
>
66
66
67
67
<!-- 👉 Label -->
68
- <div class =" a-switch-label" >
68
+ <div
69
+ class =" a-switch-label"
70
+ data-no-reference
71
+ >
69
72
<slot >{{ props.label }}</slot >
70
73
</div >
71
74
Original file line number Diff line number Diff line change 1
1
<script lang="ts" setup>
2
- import type { Middleware } from ' @floating-ui/vue' ;
2
+ import type { Middleware } from ' @floating-ui/vue'
3
3
4
4
// import { arrow } from '@floating-ui/vue'
5
- import { AFloating } from ' @/components/ floating' ;
6
- import { useParent } from ' @/composables ' ;
7
- import { flip , offset , shift } from ' @floating-ui/vue ' ;
8
- import { tooltipProps } from ' ./props ' ;
5
+ import { flip , offset , shift } from ' @floating-ui/vue '
6
+ import { tooltipProps } from ' ./props '
7
+ import { AFloating } from ' @/components/floating '
8
+ import { useParent } from ' @/composables '
9
9
10
10
const props = defineProps (tooltipProps )
11
11
@@ -44,9 +44,11 @@ const floatingMiddleware = [
44
44
:middleware =" () => floatingMiddleware"
45
45
>
46
46
<div class =" a-tooltip" >
47
- <slot >
48
- <span class =" a-tooltip-text" >{{ props.text }}</span >
49
- </slot >
47
+ <span class =" a-tooltip-text" >
48
+ <slot >
49
+ {{ props.text }}
50
+ </slot >
51
+ </span >
50
52
<!-- <div
51
53
ref="arrowEl"
52
54
class="a-tooltip-arrow absolute"
Original file line number Diff line number Diff line change 1
- export function useParent ( ) {
1
+ export function useParent ( ) {
2
2
const parentEl = ref ( )
3
+
3
4
onMounted ( ( ) => {
4
5
const vm = getCurrentInstance ( )
5
- if ( vm ?. proxy ?. $parent )
6
- parentEl . value = unrefElement ( vm ?. proxy ?. $parent )
6
+ let parent : ParentNode | null = vm ?. proxy ?. $el . parentNode
7
+
8
+ // TODO: Fix types
9
+ // @ts -expect-error hasAttribute doesn't exist on parentNode type
10
+ while ( parent && parent . hasAttribute ( 'data-no-reference' ) )
11
+ parent = parent . parentNode
12
+
13
+ parentEl . value = parent
7
14
} )
8
15
9
16
return parentEl
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ declare module 'vue' {
12
12
ADialog : typeof import ( 'anu-vue' ) [ 'ADialog' ]
13
13
ADrawer : typeof import ( 'anu-vue' ) [ 'ADrawer' ]
14
14
AFloating : typeof import ( 'anu-vue' ) [ 'AFloating' ]
15
+ AIcon : typeof import ( 'anu-vue' ) [ 'AIcon' ]
15
16
AInput : typeof import ( 'anu-vue' ) [ 'AInput' ]
16
17
AList : typeof import ( 'anu-vue' ) [ 'AList' ]
17
18
AListItem : typeof import ( 'anu-vue' ) [ 'AListItem' ]
You can’t perform that action at this time.
0 commit comments