@imaginario27/air-ui-ds 1.13.2 → 1.13.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/CHANGELOG.md +11 -0
- package/components/cards/specific/TestimonialCard.vue +2 -2
- package/components/dropdowns/DropdownSelect.vue +2 -1
- package/components/dropdowns/DropdownSelectItem.vue +15 -4
- package/components/rating/Rating.vue +99 -60
- package/models/types/selects.ts +1 -0
- package/package.json +1 -1
- package/components/rating/InteractiveRating.vue +0 -94
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ All notable changes to this package are documented in this file.
|
|
|
5
5
|
Historical releases were reconstructed from git history (GitHub repository) and npm publish dates.
|
|
6
6
|
Future releases will include detailed entries generated with Changesets.
|
|
7
7
|
|
|
8
|
+
## 1.13.2 - 2026-05-20
|
|
9
|
+
|
|
10
|
+
Release type: patch.
|
|
11
|
+
Commits found in range: 0.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
1. Historical release reconstructed from npm publish metadata (no package commits found in this publish window).
|
|
16
|
+
|
|
17
|
+
- Package: @imaginario27/air-ui-ds.
|
|
18
|
+
|
|
8
19
|
## 1.13.1 - 2026-05-19
|
|
9
20
|
|
|
10
21
|
Release type: patch.
|
|
@@ -179,6 +179,7 @@
|
|
|
179
179
|
:activeStyle="activeStyle"
|
|
180
180
|
:to="option.to"
|
|
181
181
|
:isExternal="option.isExternal"
|
|
182
|
+
:disabled="option.disabled"
|
|
182
183
|
:class="[
|
|
183
184
|
hasSeparator && index !== filteredOptions.length - 1
|
|
184
185
|
? 'border-b border-border-default'
|
|
@@ -453,7 +454,7 @@ watch(() => props.modelValue, (newValue) => {
|
|
|
453
454
|
|
|
454
455
|
// Method
|
|
455
456
|
const handleOptionClick = (option: SelectOption) => {
|
|
456
|
-
if (props.disabled || props.isLoading) return
|
|
457
|
+
if (props.disabled || props.isLoading || option.disabled) return
|
|
457
458
|
|
|
458
459
|
const optionValue = option.value
|
|
459
460
|
|
|
@@ -6,12 +6,14 @@
|
|
|
6
6
|
'flex flex-col',
|
|
7
7
|
'px-3',
|
|
8
8
|
'text-sm',
|
|
9
|
-
'hover:cursor-pointer',
|
|
10
9
|
'w-full',
|
|
11
10
|
sizeClass,
|
|
12
|
-
|
|
11
|
+
disabled
|
|
12
|
+
? 'cursor-not-allowed opacity-disabled'
|
|
13
|
+
: 'hover:cursor-pointer',
|
|
14
|
+
!disabled && (isSelected && activeStyle === SelectActiveStyle.FILL ?
|
|
13
15
|
'bg-background-primary-brand-active hover:background-primary-brand-active hover:text-text-neutral-on-filled'
|
|
14
|
-
: 'hover:bg-background-neutral-hover-subtle',
|
|
16
|
+
: 'hover:bg-background-neutral-hover-subtle'),
|
|
15
17
|
]"
|
|
16
18
|
@click="emitClick"
|
|
17
19
|
>
|
|
@@ -126,6 +128,10 @@ const props = defineProps({
|
|
|
126
128
|
type: Boolean as PropType<boolean>,
|
|
127
129
|
default: false,
|
|
128
130
|
},
|
|
131
|
+
disabled: {
|
|
132
|
+
type: Boolean as PropType<boolean>,
|
|
133
|
+
default: false,
|
|
134
|
+
},
|
|
129
135
|
})
|
|
130
136
|
|
|
131
137
|
// States
|
|
@@ -133,7 +139,12 @@ const isImageLoaded = ref(true)
|
|
|
133
139
|
|
|
134
140
|
// Emits
|
|
135
141
|
const emit = defineEmits(['click'])
|
|
136
|
-
const emitClick = () => {
|
|
142
|
+
const emitClick = (event: MouseEvent) => {
|
|
143
|
+
if (props.disabled) {
|
|
144
|
+
event.preventDefault()
|
|
145
|
+
event.stopPropagation()
|
|
146
|
+
return
|
|
147
|
+
}
|
|
137
148
|
emit('click')
|
|
138
149
|
}
|
|
139
150
|
|
|
@@ -1,60 +1,99 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
)
|
|
60
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="flex gap-1"
|
|
4
|
+
@mouseleave="hoverIndex = null"
|
|
5
|
+
>
|
|
6
|
+
<RatingItem
|
|
7
|
+
v-for="(icon, index) in items"
|
|
8
|
+
:key="index"
|
|
9
|
+
:icon
|
|
10
|
+
:size
|
|
11
|
+
:color
|
|
12
|
+
:isInteractive
|
|
13
|
+
@click="isInteractive && handleClick(index)"
|
|
14
|
+
@mouseenter="isInteractive && onMouseEnter(index)"
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
// Props
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
modelValue: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 0,
|
|
25
|
+
},
|
|
26
|
+
size: {
|
|
27
|
+
type: String as PropType<RatingItemSize>,
|
|
28
|
+
default: RatingItemSize.SM,
|
|
29
|
+
validator: (value: RatingItemSize) => Object.values(RatingItemSize).includes(value),
|
|
30
|
+
},
|
|
31
|
+
color: {
|
|
32
|
+
type: String as PropType<RatingItemColor>,
|
|
33
|
+
default: RatingItemColor.GOLD,
|
|
34
|
+
validator: (value: RatingItemColor) => Object.values(RatingItemColor).includes(value),
|
|
35
|
+
},
|
|
36
|
+
emptyIndicatorIcon: {
|
|
37
|
+
type: String as PropType<string>,
|
|
38
|
+
default: 'mdi:star-outline'
|
|
39
|
+
},
|
|
40
|
+
halfIndicatorIcon: {
|
|
41
|
+
type: String as PropType<string>,
|
|
42
|
+
default: 'mdi:star-half-full'
|
|
43
|
+
},
|
|
44
|
+
fullIndicatorIcon: {
|
|
45
|
+
type: String as PropType<string>,
|
|
46
|
+
default: 'mdi:star'
|
|
47
|
+
},
|
|
48
|
+
isInteractive: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
hoverPreview: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
// Emits
|
|
59
|
+
const emit = defineEmits(['update:modelValue'])
|
|
60
|
+
|
|
61
|
+
// States
|
|
62
|
+
const hoverIndex = ref<number | null>(null)
|
|
63
|
+
|
|
64
|
+
// Handlers
|
|
65
|
+
const onMouseEnter = (index: number) => {
|
|
66
|
+
if (props.hoverPreview) {
|
|
67
|
+
hoverIndex.value = index
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const handleClick = (index: number) => {
|
|
72
|
+
const clickedValue = index + 1
|
|
73
|
+
|
|
74
|
+
if (clickedValue === props.modelValue) {
|
|
75
|
+
emit('update:modelValue', 0)
|
|
76
|
+
} else {
|
|
77
|
+
emit('update:modelValue', clickedValue)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Computed functions
|
|
82
|
+
// Normalize value: clamp between 0 and 5, round to nearest 0.5
|
|
83
|
+
const displayValue = computed(() => {
|
|
84
|
+
if (props.isInteractive && props.hoverPreview && hoverIndex.value !== null)
|
|
85
|
+
return hoverIndex.value + 1
|
|
86
|
+
|
|
87
|
+
if (!isFinite(props.modelValue) || isNaN(props.modelValue))
|
|
88
|
+
return 0
|
|
89
|
+
|
|
90
|
+
return Math.min(5, Math.max(0, Math.round(props.modelValue * 2) / 2))
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
const items = computed(() => getRatingIndicator(
|
|
94
|
+
displayValue.value,
|
|
95
|
+
props.emptyIndicatorIcon,
|
|
96
|
+
props.halfIndicatorIcon,
|
|
97
|
+
props.fullIndicatorIcon
|
|
98
|
+
))
|
|
99
|
+
</script>
|
package/models/types/selects.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="flex gap-1"
|
|
4
|
-
@mouseleave="hoverIndex = null"
|
|
5
|
-
>
|
|
6
|
-
<RatingItem
|
|
7
|
-
v-for="(icon, index) in items"
|
|
8
|
-
:key="index"
|
|
9
|
-
:icon="icon"
|
|
10
|
-
:size="size"
|
|
11
|
-
:color="color"
|
|
12
|
-
isInteractive
|
|
13
|
-
@click="handleClick(index)"
|
|
14
|
-
@mouseenter="onMouseEnter(index)"
|
|
15
|
-
/>
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script setup lang="ts">
|
|
20
|
-
const props = defineProps({
|
|
21
|
-
modelValue: {
|
|
22
|
-
type: Number,
|
|
23
|
-
required: true
|
|
24
|
-
},
|
|
25
|
-
size: {
|
|
26
|
-
type: String as PropType<RatingItemSize>,
|
|
27
|
-
default: RatingItemSize.SM,
|
|
28
|
-
validator: (value: RatingItemSize) => Object.values(RatingItemSize).includes(value),
|
|
29
|
-
},
|
|
30
|
-
color: {
|
|
31
|
-
type: String as PropType<RatingItemColor>,
|
|
32
|
-
default: RatingItemColor.GOLD,
|
|
33
|
-
validator: (value: RatingItemColor) => Object.values(RatingItemColor).includes(value),
|
|
34
|
-
},
|
|
35
|
-
emptyIndicatorIcon: {
|
|
36
|
-
type: String as PropType<string>,
|
|
37
|
-
default: 'mdi:star-outline'
|
|
38
|
-
},
|
|
39
|
-
halfIndicatorIcon: {
|
|
40
|
-
type: String as PropType<string>,
|
|
41
|
-
default: 'mdi:star-half-full'
|
|
42
|
-
},
|
|
43
|
-
fullIndicatorIcon: {
|
|
44
|
-
type: String as PropType<string>,
|
|
45
|
-
default: 'mdi:star'
|
|
46
|
-
},
|
|
47
|
-
hoverPreview: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
default: true
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
// States
|
|
54
|
-
const hoverIndex = ref<number | null>(null)
|
|
55
|
-
|
|
56
|
-
// Emits
|
|
57
|
-
const emit = defineEmits(['update:modelValue'])
|
|
58
|
-
|
|
59
|
-
// Handlers
|
|
60
|
-
const onMouseEnter = (index: number) => {
|
|
61
|
-
if (props.hoverPreview) {
|
|
62
|
-
hoverIndex.value = index
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const handleClick = (index: number) => {
|
|
67
|
-
const clickedValue = index + 1
|
|
68
|
-
|
|
69
|
-
if (clickedValue === props.modelValue) {
|
|
70
|
-
emit('update:modelValue', 0)
|
|
71
|
-
} else {
|
|
72
|
-
emit('update:modelValue', clickedValue)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Computed
|
|
77
|
-
// Get the value to render: either hover preview or actual value
|
|
78
|
-
const displayValue = computed(() => {
|
|
79
|
-
if (props.hoverPreview && hoverIndex.value !== null)
|
|
80
|
-
return hoverIndex.value + 1
|
|
81
|
-
|
|
82
|
-
if (!isFinite(props.modelValue) || isNaN(props.modelValue))
|
|
83
|
-
return 0
|
|
84
|
-
|
|
85
|
-
return Math.min(5, Math.max(0, Math.round(props.modelValue * 2) / 2))
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
const items = computed(() => getRatingIndicator(
|
|
89
|
-
displayValue.value,
|
|
90
|
-
props.emptyIndicatorIcon,
|
|
91
|
-
props.halfIndicatorIcon,
|
|
92
|
-
props.fullIndicatorIcon
|
|
93
|
-
))
|
|
94
|
-
</script>
|