@saasmakers/ui 2.0.70 → 2.0.72
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/app/components/bases/BaseChip.vue +19 -19
- package/app/composables/useDialog.ts +2 -20
- package/app/types/bases.d.ts +17 -17
- package/package.json +1 -1
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
import type { BaseChip } from '../../types/bases'
|
|
3
3
|
|
|
4
4
|
const props = withDefaults(defineProps<BaseChip>(), {
|
|
5
|
-
active: false,
|
|
6
|
-
activeHighlight: 'gray',
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
as: 'button',
|
|
10
|
-
disabled: false,
|
|
11
|
-
hoverable: false,
|
|
12
|
-
icon: undefined,
|
|
13
|
-
iconLeading: false,
|
|
14
|
-
iconSize: undefined,
|
|
15
|
-
id: undefined,
|
|
16
|
-
maxWidth: false,
|
|
17
|
-
normalCase: false,
|
|
18
|
-
removable: false,
|
|
19
|
-
role: undefined,
|
|
20
|
-
text: '',
|
|
21
|
-
variant: 'outline',
|
|
5
|
+
'active': false,
|
|
6
|
+
'activeHighlight': 'gray',
|
|
7
|
+
'aria-label': undefined,
|
|
8
|
+
'aria-selected': undefined,
|
|
9
|
+
'as': 'button',
|
|
10
|
+
'disabled': false,
|
|
11
|
+
'hoverable': false,
|
|
12
|
+
'icon': undefined,
|
|
13
|
+
'iconLeading': false,
|
|
14
|
+
'iconSize': undefined,
|
|
15
|
+
'id': undefined,
|
|
16
|
+
'maxWidth': false,
|
|
17
|
+
'normalCase': false,
|
|
18
|
+
'removable': false,
|
|
19
|
+
'role': undefined,
|
|
20
|
+
'text': '',
|
|
21
|
+
'variant': 'outline',
|
|
22
22
|
})
|
|
23
23
|
|
|
24
24
|
const emit = defineEmits<{
|
|
@@ -86,8 +86,8 @@ function onMouseEnter(event: MouseEvent) {
|
|
|
86
86
|
'base-border border-dashed px-2 py-1 bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300': variant === 'dashed' && active && activeHighlight === 'gray',
|
|
87
87
|
'base-highlight-indigo border-indigo-600/35 border-dashed px-2 py-1 text-gray-900 dark:text-gray-100': variant === 'dashed' && active && activeHighlight === 'indigo',
|
|
88
88
|
}"
|
|
89
|
-
:aria-label="
|
|
90
|
-
:aria-selected="
|
|
89
|
+
:aria-label="props['aria-label']"
|
|
90
|
+
:aria-selected="props['aria-selected']"
|
|
91
91
|
:disabled="as === 'button' ? disabled : undefined"
|
|
92
92
|
:role="role"
|
|
93
93
|
:type="as === 'button' ? 'button' : undefined"
|
|
@@ -67,28 +67,10 @@ export default function useDialog(
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
watch(visible,
|
|
70
|
+
watch(visible, (isVisible) => {
|
|
71
71
|
if (import.meta.client && isVisible) {
|
|
72
72
|
lockBodyScroll()
|
|
73
|
-
|
|
74
|
-
await nextTick()
|
|
75
|
-
|
|
76
|
-
if (panelRef.value) {
|
|
77
|
-
const focusableElements = getFocusableElements(panelRef.value)
|
|
78
|
-
const autofocusTarget = panelRef.value.querySelector<HTMLElement>('[data-autofocus]')
|
|
79
|
-
|
|
80
|
-
if (autofocusTarget) {
|
|
81
|
-
autofocusTarget.focus()
|
|
82
|
-
}
|
|
83
|
-
else if (focusableElements.length > 0) {
|
|
84
|
-
focusableElements[0].focus()
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
panelRef.value.focus()
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
window.addEventListener('keydown', onFocusTrap)
|
|
91
|
-
}
|
|
73
|
+
window.addEventListener('keydown', onFocusTrap)
|
|
92
74
|
}
|
|
93
75
|
}, { immediate: true })
|
|
94
76
|
|
package/app/types/bases.d.ts
CHANGED
|
@@ -119,23 +119,23 @@ export interface BaseChart {
|
|
|
119
119
|
export type BaseChartType = 'bar' | 'line' | 'pie'
|
|
120
120
|
|
|
121
121
|
export interface BaseChip {
|
|
122
|
-
active?: boolean
|
|
123
|
-
activeHighlight?: BaseChipActiveHighlight
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
as?: BaseChipAs
|
|
127
|
-
disabled?: boolean
|
|
128
|
-
hoverable?: boolean
|
|
129
|
-
icon?: string
|
|
130
|
-
iconLeading?: boolean
|
|
131
|
-
iconSize?: BaseSize
|
|
132
|
-
id?: string
|
|
133
|
-
maxWidth?: boolean
|
|
134
|
-
normalCase?: boolean
|
|
135
|
-
removable?: boolean
|
|
136
|
-
role?: string
|
|
137
|
-
text?: BaseTextText
|
|
138
|
-
variant?: BaseChipVariant
|
|
122
|
+
'active'?: boolean
|
|
123
|
+
'activeHighlight'?: BaseChipActiveHighlight
|
|
124
|
+
'aria-label'?: string
|
|
125
|
+
'aria-selected'?: boolean
|
|
126
|
+
'as'?: BaseChipAs
|
|
127
|
+
'disabled'?: boolean
|
|
128
|
+
'hoverable'?: boolean
|
|
129
|
+
'icon'?: string
|
|
130
|
+
'iconLeading'?: boolean
|
|
131
|
+
'iconSize'?: BaseSize
|
|
132
|
+
'id'?: string
|
|
133
|
+
'maxWidth'?: boolean
|
|
134
|
+
'normalCase'?: boolean
|
|
135
|
+
'removable'?: boolean
|
|
136
|
+
'role'?: string
|
|
137
|
+
'text'?: BaseTextText
|
|
138
|
+
'variant'?: BaseChipVariant
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
export type BaseChipActiveHighlight = 'gray' | 'indigo'
|