adata-ui 2.1.40-beta.10 → 2.1.40-beta.12
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/.claude/settings.local.json +19 -0
- package/assets/styles/index.scss +67 -5
- package/components/elements/a-select-row/ASelectRowV2.vue +8 -8
- package/components/elements/a-select-row/index.vue +3 -5
- package/components/elements/accordion/AAccordion.vue +5 -3
- package/components/elements/accordion/AAccordionGroup/AAccordionGroup.vue +3 -3
- package/components/elements/alert/AAlert.vue +34 -47
- package/components/elements/bg-block/ABgBlock.vue +1 -1
- package/components/elements/button/AButton.vue +3 -3
- package/components/elements/button/AButtonV2.vue +7 -5
- package/components/elements/button-login/index.vue +1 -1
- package/components/elements/chip-wrapper/AChipWrapper.vue +1 -1
- package/components/elements/chips/AChips.vue +2 -2
- package/components/elements/digit-badge/ADigitBadge.vue +21 -19
- package/components/elements/feature-description/AFeatureDescription.vue +1 -1
- package/components/elements/leave-note/ALeaveNote.vue +1 -1
- package/components/elements/pagination/APagination.vue +7 -7
- package/components/elements/segmented/ASegmentedV2.vue +103 -10
- package/components/elements/select/ASelect.vue +4 -4
- package/components/elements/select/ASelectMobile.vue +2 -2
- package/components/elements/select/ASelectV2.vue +10 -11
- package/components/elements/select/ui/select-button.vue +1 -1
- package/components/elements/status-badge/AStatusBadge.vue +22 -19
- package/components/elements/status-badge-v2/StatusBadgeV2.vue +1 -3
- package/components/elements/table/ATable.vue +1 -1
- package/components/elements/table/table.config.ts +2 -2
- package/components/elements/tree-select/ATreeSelect.vue +97 -113
- package/components/elements/tree-select/TreeService.ts +142 -207
- package/components/elements/tree-select/components/ATreeSelectNode.vue +104 -0
- package/components/elements/tree-select/types.ts +40 -11
- package/components/elements/tree-select/utils.ts +30 -0
- package/components/elements/tree-select-modal/ATreeSelectModal.vue +217 -0
- package/components/features/color-mode/AColorMode.client.vue +1 -1
- package/components/features/dropdown/ADropdownV2.vue +1 -2
- package/components/features/lang-switcher/lang-switcher.vue +9 -4
- package/components/features/payment/banner/BasicPlusLimitBanner.vue +3 -3
- package/components/features/payment/banner/PaymentBanner.vue +3 -3
- package/components/features/payment/banner/UpSellBanner.vue +3 -3
- package/components/features/payment/process/PaymentKaspiQrSidePanel.vue +43 -27
- package/components/features/payment/process/PaymentKaspiRedirectSidePanel.vue +34 -23
- package/components/features/payment/process/PaymentMethodSidePanel.vue +61 -49
- package/components/features/payment/process/PaymentProcess.vue +6 -6
- package/components/features/payment/process/PaymentTopUpSidePanel.vue +44 -63
- package/components/features/pk-mobile-services/APkMobileServices.vue +1 -1
- package/components/features//321/201hange-version/AChangeVersion.vue +2 -2
- package/components/forms/checkbox/ACheckbox.vue +1 -1
- package/components/forms/checkbox/ACheckboxV2.vue +5 -5
- package/components/forms/input/AInputV2.vue +4 -4
- package/components/forms/input/date/AInputDate.vue +2 -2
- package/components/forms/input/password/AInputPassword.vue +8 -2
- package/components/forms/input/standard/AInputStandard.vue +3 -3
- package/components/forms/input/textarea/ATextarea.vue +2 -2
- package/components/forms/toggle/AToggle.vue +2 -3
- package/components/forms/toggle/AToggleV2.vue +3 -3
- package/components/modals/AnotherDeviceModal.vue +1 -1
- package/components/modals/ContactsMobileModel.vue +1 -1
- package/components/modals/ContentNavigationModal.vue +77 -333
- package/components/modals/Insufficient-funds-modal.vue +1 -1
- package/components/modals/PaymentMethodModal.vue +1 -1
- package/components/modals/id/IdBanner.vue +3 -3
- package/components/modals/id/IdRecoveryModal.vue +1 -1
- package/components/navigation/bottom-navigation/ABottomNavigation.vue +1 -1
- package/components/navigation/breadcrumbs/ABreadcrumbs.vue +106 -45
- package/components/navigation/breadcrumbs/types.ts +3 -0
- package/components/navigation/footer/AFooter.vue +39 -40
- package/components/navigation/footer/ui/a-footer-accordion.vue +9 -9
- package/components/navigation/header/AHeader.vue +13 -19
- package/components/navigation/header/AlmatyContacts.vue +78 -78
- package/components/navigation/header/CardGallery.vue +4 -4
- package/components/navigation/header/HeaderUsage.vue +4 -6
- package/components/navigation/header/ListItem.vue +2 -2
- package/components/navigation/header/NavCard.vue +1 -1
- package/components/navigation/header/NavList.vue +2 -2
- package/components/navigation/header/NotificationsMenu.vue +2 -3
- package/components/navigation/header/ProductMenu.vue +7 -7
- package/components/navigation/header/ProfileMenu.vue +26 -35
- package/components/navigation/header/SystemNotification.vue +1 -3
- package/components/navigation/pill-tabs/APillTabs.vue +2 -2
- package/components/navigation/pill-tabs/APillTabsV2.vue +22 -6
- package/components/overlays/drawer/ADrawerV2.vue +335 -0
- package/components/overlays/modal/AModal.vue +4 -4
- package/components/overlays/modal/AModalV2.vue +7 -4
- package/components/overlays/side-panel/ASidePanel.vue +6 -6
- package/components/overlays/sideover/ASlideover.vue +6 -6
- package/components/overlays/tooltip/ATooltip.vue +1 -1
- package/components/overlays/tooltip/ATooltipV2.vue +2 -12
- package/components/transitions/ATransitionHeight.vue +1 -1
- package/composables/useHeaderNavigationLinks.ts +100 -94
- package/icons/archive.vue +16 -0
- package/icons/arrow/arrows-in.vue +11 -0
- package/icons/arrow/arrows-out.vue +11 -0
- package/icons/arrow/arrows-resize-in.vue +38 -0
- package/icons/arrow/arrows-resize-out.vue +17 -0
- package/icons/bot.vue +52 -0
- package/icons/clock-time.vue +24 -0
- package/icons/compare-outlined.vue +8 -0
- package/icons/dots-horizontal.vue +31 -0
- package/icons/download-line.vue +13 -0
- package/icons/egov.vue +41 -0
- package/icons/elicense.vue +38 -0
- package/icons/favourite-bookmark-outline.vue +17 -0
- package/icons/file-pen.vue +31 -0
- package/icons/file-stack.vue +31 -0
- package/icons/file-types/excel.vue +131 -0
- package/icons/file-types/html.vue +13 -0
- package/icons/file-types/jpeg.vue +16 -0
- package/icons/file-types/pdf.vue +11 -0
- package/icons/file-types/png.vue +11 -0
- package/icons/file-types/rar.vue +11 -0
- package/icons/file-types/word.vue +50 -0
- package/icons/file-types/zip.vue +11 -0
- package/icons/git-compare.vue +38 -0
- package/icons/graduation-cap.vue +31 -0
- package/icons/graph-loading.vue +34 -0
- package/icons/help-question-circle.vue +26 -0
- package/icons/in-row-type.vue +46 -0
- package/icons/in-table-type.vue +29 -0
- package/icons/message-dotted.vue +30 -0
- package/icons/notification-error.vue +17 -0
- package/icons/person.vue +22 -0
- package/icons/settings.vue +26 -0
- package/icons/shield-alert.vue +31 -0
- package/icons/socials/facebook-color.vue +16 -0
- package/icons/socials/globe-color.vue +16 -0
- package/icons/socials/instagram-color.vue +46 -0
- package/icons/socials/linkedin-color.vue +14 -0
- package/icons/socials/telegram-color.vue +16 -0
- package/icons/socials/tiktok-color.vue +14 -0
- package/icons/socials/vk-color.vue +16 -0
- package/icons/socials/youtube-color.vue +16 -0
- package/icons/view-eye-open.vue +13 -0
- package/lang/en.ts +1 -0
- package/lang/kk.ts +1 -0
- package/lang/ru.ts +1 -0
- package/package.json +1 -1
- package/plugins/toast.client.ts +38 -55
- package/tailwind.config.ts +147 -116
- package/utils/twMerge.ts +34 -0
- package/components/elements/tree-select/components/tree-select-nodes.vue +0 -91
|
@@ -1,23 +1,106 @@
|
|
|
1
1
|
<script generic="T extends string | number" lang="ts" setup>
|
|
2
|
+
type Color = 'gray' | 'blue' | 'green' | 'yellow' | 'red'
|
|
3
|
+
type View = 'outline' | 'solid'
|
|
4
|
+
|
|
2
5
|
interface Option {
|
|
3
6
|
value: T
|
|
4
7
|
label: string
|
|
5
8
|
disabled?: boolean
|
|
6
|
-
count?: number
|
|
9
|
+
count?: number | string
|
|
10
|
+
color?: Color
|
|
7
11
|
dotColor?: string
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
const props = withDefaults(defineProps<{
|
|
11
15
|
options: Option[]
|
|
12
16
|
size?: 'sm' | 'md'
|
|
17
|
+
view?: View
|
|
18
|
+
color?: Color
|
|
13
19
|
deselectable?: boolean
|
|
20
|
+
withDot?: boolean
|
|
21
|
+
neutral?: boolean
|
|
14
22
|
}>(), {
|
|
15
23
|
size: 'md',
|
|
24
|
+
view: 'outline',
|
|
25
|
+
color: 'gray',
|
|
16
26
|
deselectable: true,
|
|
27
|
+
withDot: false,
|
|
28
|
+
neutral: false,
|
|
17
29
|
})
|
|
18
30
|
|
|
31
|
+
defineSlots<{
|
|
32
|
+
prepend?: (props: { option: Option, selected: boolean }) => any
|
|
33
|
+
count?: (props: { option: Option, selected: boolean }) => any
|
|
34
|
+
}>()
|
|
35
|
+
|
|
19
36
|
const modelValue = defineModel<T | undefined | null>()
|
|
20
37
|
|
|
38
|
+
const CHIP_CLASS: Record<Color, Record<View | 'selected', string>> = {
|
|
39
|
+
gray: {
|
|
40
|
+
outline: 'border-[#D1D5DC] bg-white text-[#4A5565] hover:bg-[#F3F4F6] dark:bg-gray-900 dark:border-[#4A5565]/50 dark:text-gray-300 dark:hover:bg-[#4A5565]/10',
|
|
41
|
+
solid: 'border-transparent bg-[#F3F4F6] text-[#4A5565] hover:bg-[#D1D5DC] dark:bg-[#4A5565]/10 dark:text-gray-300 dark:hover:bg-[#4A5565]/20',
|
|
42
|
+
selected: 'border-transparent bg-[#4A5565] text-white dark:border-[#4A5565]/50 dark:bg-[#4A5565]/30 dark:text-gray-100',
|
|
43
|
+
},
|
|
44
|
+
blue: {
|
|
45
|
+
outline: 'border-[#B3DCFF] bg-white text-[#068DFF] hover:bg-[#F0F8FF] dark:bg-gray-900 dark:border-[#068DFF]/50 dark:text-blue-400 dark:hover:bg-[#068DFF]/10',
|
|
46
|
+
solid: 'border-transparent bg-[#F0F8FF] text-[#068DFF] hover:bg-[#B3DCFF] dark:bg-[#068DFF]/10 dark:text-blue-400 dark:hover:bg-[#068DFF]/20',
|
|
47
|
+
selected: 'border-transparent bg-[#068DFF] text-white dark:border-[#068DFF]/50 dark:bg-[#068DFF]/30 dark:text-blue-100',
|
|
48
|
+
},
|
|
49
|
+
green: {
|
|
50
|
+
outline: 'border-[#7BF1A8] bg-white text-[#00A63E] hover:bg-[#DCFCE7] dark:bg-gray-900 dark:border-[#00A63E]/50 dark:text-green-400 dark:hover:bg-[#00A63E]/10',
|
|
51
|
+
solid: 'border-transparent bg-[#DCFCE7] text-[#00A63E] hover:bg-[#7BF1A8] dark:bg-[#00A63E]/10 dark:text-green-400 dark:hover:bg-[#00A63E]/20',
|
|
52
|
+
selected: 'border-transparent bg-[#00A63E] text-white dark:border-[#00A63E]/50 dark:bg-[#00A63E]/30 dark:text-green-100',
|
|
53
|
+
},
|
|
54
|
+
yellow: {
|
|
55
|
+
outline: 'border-[#FFD230] bg-white text-[#E17100] hover:bg-[#FEF3C6] dark:bg-gray-900 dark:border-[#E17100]/50 dark:text-orange-400 dark:hover:bg-[#E17100]/10',
|
|
56
|
+
solid: 'border-transparent bg-[#FEF3C6] text-[#E17100] hover:bg-[#FFD230] dark:bg-[#E17100]/10 dark:text-orange-400 dark:hover:bg-[#E17100]/20',
|
|
57
|
+
selected: 'border-transparent bg-[#E17100] text-white dark:border-[#E17100]/50 dark:bg-[#E17100]/30 dark:text-orange-100',
|
|
58
|
+
},
|
|
59
|
+
red: {
|
|
60
|
+
outline: 'border-[#FFA2A2] bg-white text-[#E7000B] hover:bg-[#FFE2E2] dark:bg-gray-900 dark:border-[#E7000B]/50 dark:text-red-400 dark:hover:bg-[#E7000B]/10',
|
|
61
|
+
solid: 'border-transparent bg-[#FFE2E2] text-[#E7000B] hover:bg-[#FFA2A2] dark:bg-[#E7000B]/10 dark:text-red-400 dark:hover:bg-[#E7000B]/20',
|
|
62
|
+
selected: 'border-transparent bg-[#E7000B] text-white dark:border-[#E7000B]/50 dark:bg-[#E7000B]/30 dark:text-red-100',
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const DOT_CLASS: Record<Color, Record<View, string>> = {
|
|
67
|
+
gray: { outline: 'bg-[#4A5565] dark:bg-gray-400', solid: 'bg-[#4A5565] dark:bg-gray-400' },
|
|
68
|
+
blue: { outline: 'bg-[#068DFF] dark:bg-blue-400', solid: 'bg-[#068DFF] dark:bg-blue-400' },
|
|
69
|
+
green: { outline: 'bg-[#00A63E] dark:bg-green-400', solid: 'bg-[#00A63E] dark:bg-green-400' },
|
|
70
|
+
yellow: { outline: 'bg-[#E17100] dark:bg-orange-400', solid: 'bg-[#E17100] dark:bg-orange-400' },
|
|
71
|
+
red: { outline: 'bg-[#E7000B] dark:bg-red-400', solid: 'bg-[#E7000B] dark:bg-red-400' },
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const DOT_SELECTED_CLASS = 'bg-white dark:bg-gray-100'
|
|
75
|
+
|
|
76
|
+
function dotColorName(option: Option): Color {
|
|
77
|
+
return option.color ?? props.color
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function chipColorName(option: Option): Color {
|
|
81
|
+
return props.neutral ? 'gray' : dotColorName(option)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function isSelected(option: Option): boolean {
|
|
85
|
+
return modelValue.value === option.value
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function chipClass(option: Option): string {
|
|
89
|
+
return isSelected(option)
|
|
90
|
+
? `${CHIP_CLASS[dotColorName(option)].selected} font-medium`
|
|
91
|
+
: CHIP_CLASS[chipColorName(option)][props.view]
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function showDot(option: Option): boolean {
|
|
95
|
+
return props.withDot || Boolean(option.color || option.dotColor)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function dotClass(option: Option): string {
|
|
99
|
+
return isSelected(option)
|
|
100
|
+
? DOT_SELECTED_CLASS
|
|
101
|
+
: DOT_CLASS[dotColorName(option)][props.view]
|
|
102
|
+
}
|
|
103
|
+
|
|
21
104
|
function select(option: Option) {
|
|
22
105
|
if (option.disabled) return
|
|
23
106
|
if (props.deselectable && modelValue.value === option.value) {
|
|
@@ -37,22 +120,32 @@ function select(option: Option) {
|
|
|
37
120
|
:disabled="option.disabled"
|
|
38
121
|
class="inline-flex items-center gap-1.5 rounded-full border transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 disabled:cursor-not-allowed disabled:opacity-50"
|
|
39
122
|
:class="[
|
|
40
|
-
size === 'sm' ? 'px-3 py-1 text-
|
|
41
|
-
|
|
42
|
-
? 'border-transparent bg-blue-700 font-medium text-white dark:bg-blue-500 dark:text-gray-900'
|
|
43
|
-
: 'border-gray-300 bg-transparent text-gray-700 hover:border-gray-400 dark:border-gray-600 dark:text-gray-300 dark:hover:border-gray-500',
|
|
123
|
+
size === 'sm' ? 'px-3 py-1 text-body-sm' : 'px-3.5 py-1.5 text-body-md',
|
|
124
|
+
chipClass(option),
|
|
44
125
|
]"
|
|
45
126
|
@click="select(option)"
|
|
46
127
|
>
|
|
128
|
+
<slot
|
|
129
|
+
name="prepend"
|
|
130
|
+
:option="option"
|
|
131
|
+
:selected="isSelected(option)"
|
|
132
|
+
/>
|
|
47
133
|
<span
|
|
48
|
-
v-if="option
|
|
134
|
+
v-if="showDot(option)"
|
|
49
135
|
class="size-2 shrink-0 rounded-full"
|
|
50
|
-
:
|
|
136
|
+
:class="!option.dotColor || option.color || isSelected(option) ? dotClass(option) : undefined"
|
|
137
|
+
:style="option.dotColor && !option.color && !isSelected(option) ? { backgroundColor: option.dotColor } : undefined"
|
|
51
138
|
/>
|
|
52
139
|
<span>{{ option.label }}</span>
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
140
|
+
<slot
|
|
141
|
+
name="count"
|
|
142
|
+
:option="option"
|
|
143
|
+
:selected="isSelected(option)"
|
|
144
|
+
>
|
|
145
|
+
<span v-if="option.count != null" class="tabular-nums opacity-70">
|
|
146
|
+
{{ option.count }}
|
|
147
|
+
</span>
|
|
148
|
+
</slot>
|
|
56
149
|
</button>
|
|
57
150
|
</div>
|
|
58
151
|
</template>
|
|
@@ -279,7 +279,7 @@ watch(() => isOpen.value, (open) => {
|
|
|
279
279
|
onUnmounted(() => cleanup?.())
|
|
280
280
|
</script>
|
|
281
281
|
<template>
|
|
282
|
-
<div ref="wrapper" class="relative w-full rounded-
|
|
282
|
+
<div ref="wrapper" class="relative w-full rounded-sm text-sm">
|
|
283
283
|
<button
|
|
284
284
|
ref="reference"
|
|
285
285
|
:class="[
|
|
@@ -293,7 +293,7 @@ onUnmounted(() => cleanup?.())
|
|
|
293
293
|
buttonBg,
|
|
294
294
|
]"
|
|
295
295
|
:disabled="disabled"
|
|
296
|
-
class="hover:border-blue-700 focus-visible:outline-blue relative flex h-8 w-full items-center gap-2 rounded-
|
|
296
|
+
class="hover:border-blue-700 focus-visible:outline-blue relative flex h-8 w-full items-center gap-2 rounded-sm border border-solid py-1.5 pl-4 focus-visible:shadow-[0_0_0_4px#1B64B3] dark:hover:border-blue-500"
|
|
297
297
|
@click="toggleOpen()"
|
|
298
298
|
>
|
|
299
299
|
<span
|
|
@@ -356,7 +356,7 @@ onUnmounted(() => cleanup?.())
|
|
|
356
356
|
<div
|
|
357
357
|
v-if="isOpen"
|
|
358
358
|
ref="floating"
|
|
359
|
-
class="z-[10000] rounded-
|
|
359
|
+
class="z-[10000] rounded-sm bg-white shadow-[0_1px_8px_0_rgba(139,146,156,0.3)] dark:bg-gray-900"
|
|
360
360
|
:style="{
|
|
361
361
|
position: strategy,
|
|
362
362
|
left: x != null ? `${x}px` : '',
|
|
@@ -411,7 +411,7 @@ onUnmounted(() => cleanup?.())
|
|
|
411
411
|
</slot>
|
|
412
412
|
<div
|
|
413
413
|
v-if="props.hasButtons"
|
|
414
|
-
class="-mb-2 flex w-full flex-col gap-2 rounded-
|
|
414
|
+
class="-mb-2 flex w-full flex-col gap-2 rounded-sm p-4 shadow-[0_-2px_8px_0#9DA3AC3D] xl:flex-row"
|
|
415
415
|
>
|
|
416
416
|
<slot name="buttons">
|
|
417
417
|
<a-button view="outline" variant="gray" block @click="onClear"> Сбросить </a-button>
|
|
@@ -130,7 +130,7 @@ defineExpose({
|
|
|
130
130
|
</template>
|
|
131
131
|
<div class="flex flex-col justify-between ">
|
|
132
132
|
<div
|
|
133
|
-
class="mt-1 w-full h-full bg-white p-2 border rounded-
|
|
133
|
+
class="mt-1 w-full h-full bg-white p-2 border rounded-sm dark:bg-gray-900 overflow-y-auto"
|
|
134
134
|
>
|
|
135
135
|
<slot
|
|
136
136
|
name="options"
|
|
@@ -171,7 +171,7 @@ defineExpose({
|
|
|
171
171
|
</a-slideover>
|
|
172
172
|
<div
|
|
173
173
|
ref="wrapper"
|
|
174
|
-
class="relative w-full rounded-
|
|
174
|
+
class="relative w-full rounded-sm text-sm"
|
|
175
175
|
>
|
|
176
176
|
<a-select-row
|
|
177
177
|
v-model:selected-items="selectedData"
|
|
@@ -182,7 +182,6 @@ const valueToShow = computed<T | T[] | null>(() => {
|
|
|
182
182
|
if (!Array.isArray(modelValue.value) || modelValue.value.length === 0) return null
|
|
183
183
|
if (props.getOnlyKey) {
|
|
184
184
|
const keys = modelValue.value as any[]
|
|
185
|
-
// map over model keys (not options) so chips keep the selection order
|
|
186
185
|
const found = keys
|
|
187
186
|
.map(k => props.options.find(opt => isEqual(k, opt[props.keyToSelect as keyof T])))
|
|
188
187
|
.filter((opt): opt is T => opt != null)
|
|
@@ -296,7 +295,7 @@ const isDefaultSelection = computed(() => {
|
|
|
296
295
|
</script>
|
|
297
296
|
|
|
298
297
|
<template>
|
|
299
|
-
<div ref="wrapper" class="select-v2 relative w-full text-
|
|
298
|
+
<div ref="wrapper" class="select-v2 relative w-full text-body-md">
|
|
300
299
|
<button
|
|
301
300
|
ref="reference"
|
|
302
301
|
:disabled="disabled"
|
|
@@ -340,20 +339,20 @@ const isDefaultSelection = computed(() => {
|
|
|
340
339
|
<span
|
|
341
340
|
v-for="(item, index) in (valueToShow as any[]).slice(0, visibleChipCount)"
|
|
342
341
|
:key="index"
|
|
343
|
-
class="select-v2__chip inline-flex min-w-0 items-center gap-1 rounded-
|
|
342
|
+
class="select-v2__chip inline-flex min-w-0 items-center gap-1 rounded-sm bg-[#F0F8FF] px-2 py-0.5 text-body-sm text-blue-600 dark:bg-blue-600/15 dark:text-blue-400"
|
|
344
343
|
@click.stop="canChipRemove ? onClearFromMulti(item) : (isOpen = true)"
|
|
345
344
|
>
|
|
346
345
|
<span class="truncate">{{ item[keyToShow] }}</span>
|
|
347
346
|
<button
|
|
348
347
|
v-if="canChipRemove"
|
|
349
|
-
class="flex shrink-0 items-center justify-center rounded-full p-0.5 transition-colors hover:bg-
|
|
348
|
+
class="flex shrink-0 items-center justify-center rounded-full p-0.5 transition-colors hover:bg-blue-100 dark:hover:bg-blue-500/20"
|
|
350
349
|
>
|
|
351
350
|
<a-icon-x-mark class="size-2.5" />
|
|
352
351
|
</button>
|
|
353
352
|
</span>
|
|
354
353
|
<span
|
|
355
354
|
v-if="hiddenChipCount > 0"
|
|
356
|
-
class="inline-flex shrink-0 items-center whitespace-nowrap rounded-
|
|
355
|
+
class="inline-flex shrink-0 items-center whitespace-nowrap rounded-sm bg-[#DBEFFF] px-2 py-0.5 text-body-sm-medium text-[#0066BD] dark:bg-blue-600/25 dark:text-blue-300"
|
|
357
356
|
>
|
|
358
357
|
+{{ hiddenChipCount }}
|
|
359
358
|
</span>
|
|
@@ -367,7 +366,7 @@ const isDefaultSelection = computed(() => {
|
|
|
367
366
|
<span
|
|
368
367
|
v-for="(item, index) in (valueToShow as any[])"
|
|
369
368
|
:key="`measure-${index}`"
|
|
370
|
-
class="inline-flex items-center gap-1 whitespace-nowrap rounded-
|
|
369
|
+
class="inline-flex items-center gap-1 whitespace-nowrap rounded-sm bg-gray-50 px-2 py-0.5 text-body-sm"
|
|
371
370
|
>
|
|
372
371
|
<span>{{ item[keyToShow] }}</span>
|
|
373
372
|
<span
|
|
@@ -377,7 +376,7 @@ const isDefaultSelection = computed(() => {
|
|
|
377
376
|
<a-icon-x-mark class="size-2.5" />
|
|
378
377
|
</span>
|
|
379
378
|
</span>
|
|
380
|
-
<span class="inline-flex shrink-0 items-center whitespace-nowrap rounded-
|
|
379
|
+
<span class="inline-flex shrink-0 items-center whitespace-nowrap rounded-sm px-2 py-0.5 text-body-sm-medium">
|
|
381
380
|
+{{ selectedCount }}
|
|
382
381
|
</span>
|
|
383
382
|
</span>
|
|
@@ -413,7 +412,7 @@ const isDefaultSelection = computed(() => {
|
|
|
413
412
|
<div
|
|
414
413
|
v-if="isOpen"
|
|
415
414
|
ref="floating"
|
|
416
|
-
class="select-v2__dropdown z-[10000] rounded-
|
|
415
|
+
class="select-v2__dropdown z-[10000] rounded-lg border border-gray-200 bg-white shadow-lg shadow-gray-900/10 dark:border-gray-700 dark:bg-gray-900 dark:shadow-black/30"
|
|
417
416
|
:style="{
|
|
418
417
|
position: strategy,
|
|
419
418
|
left: x != null ? `${x}px` : '',
|
|
@@ -446,7 +445,7 @@ const isDefaultSelection = computed(() => {
|
|
|
446
445
|
<button
|
|
447
446
|
:disabled="!multiple && isItemSelected(option)"
|
|
448
447
|
:class="{ 'select-v2__option--selected': isItemSelected(option) }"
|
|
449
|
-
class="select-v2__option flex w-full items-center justify-between rounded-
|
|
448
|
+
class="select-v2__option flex w-full items-center justify-between rounded-md px-3 py-2 text-start text-body-md transition-colors duration-100 hover:bg-gray-50 dark:hover:bg-gray-800/60"
|
|
450
449
|
@click="onSelect(option)"
|
|
451
450
|
>
|
|
452
451
|
<span>
|
|
@@ -543,11 +542,11 @@ const isDefaultSelection = computed(() => {
|
|
|
543
542
|
}
|
|
544
543
|
|
|
545
544
|
.select-v2__chip:hover {
|
|
546
|
-
background-color: theme('colors.
|
|
545
|
+
background-color: theme('colors.blue.100');
|
|
547
546
|
}
|
|
548
547
|
|
|
549
548
|
:is(.dark) .select-v2__chip:hover {
|
|
550
|
-
background-color: rgb(
|
|
549
|
+
background-color: rgb(6 141 255 / 0.25);
|
|
551
550
|
}
|
|
552
551
|
|
|
553
552
|
.select-v2__option {
|
|
@@ -62,7 +62,7 @@ const onClear = () => {
|
|
|
62
62
|
<!-- <pre>{{ items }} items</pre>-->
|
|
63
63
|
<button
|
|
64
64
|
ref="buttonElement"
|
|
65
|
-
class="hover:border-blue focus-visible:outline-blue relative flex justify-between w-full items-center gap-2 rounded-
|
|
65
|
+
class="hover:border-blue focus-visible:outline-blue relative flex justify-between w-full items-center gap-2 rounded-sm border border-solid border-deepblue-50 bg-deepblue-50 px-4 py-1.5 focus-visible:shadow-[0_0_0_4px#1B64B3] dark:border-gray-900 dark:bg-gray-900 dark:hover:border-blue-700 dark:bg-[#E3E5E80D]"
|
|
66
66
|
:class="[disabledStyles]"
|
|
67
67
|
:disabled="disabled"
|
|
68
68
|
@click="isOpen = !isOpen"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {twMerge} from
|
|
2
|
+
import {twMerge} from '#adata-ui/utils/twMerge';
|
|
3
3
|
|
|
4
4
|
defineOptions({ name: 'AStatusBadge' })
|
|
5
5
|
|
|
@@ -19,34 +19,37 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
19
19
|
|
|
20
20
|
const classes = computed(() =>
|
|
21
21
|
[
|
|
22
|
-
'text-
|
|
22
|
+
'text-body-md rounded-sm select-none inline-flex gap-[5.5px] justify-center items-center border',
|
|
23
23
|
typeSwitchValues[props.view][props.type],
|
|
24
|
-
props.size === 'xs'? 'px-4 py-[2px] text-
|
|
25
|
-
props.size === 'sm'? 'text-
|
|
24
|
+
props.size === 'xs'? 'px-4 py-[2px] text-body-sm font-bold' : '',
|
|
25
|
+
props.size === 'sm'? 'text-body-sm font-semibold px-4 py-[2px] h-6' : '',
|
|
26
26
|
props.size === 'lg'? 'px-4 py-[7.5px] font-semibold' : '',
|
|
27
27
|
])
|
|
28
28
|
|
|
29
|
-
|
|
30
29
|
const typeSwitchValues: ViewType = {
|
|
31
30
|
default: {
|
|
32
|
-
primary: 'bg-
|
|
33
|
-
success: 'bg-
|
|
34
|
-
danger: 'bg-
|
|
35
|
-
warning: 'bg-
|
|
36
|
-
gray: 'bg-
|
|
37
|
-
orange: 'bg-
|
|
31
|
+
primary: 'bg-[#068DFF] text-white border-transparent dark:bg-[#068DFF]/30 dark:text-blue-100',
|
|
32
|
+
success: 'bg-[#00A63E] text-white border-transparent dark:bg-[#00A63E]/30 dark:text-green-100',
|
|
33
|
+
danger: 'bg-[#E7000B] text-white border-transparent dark:bg-[#E7000B]/30 dark:text-red-100',
|
|
34
|
+
warning: 'bg-[#E17100] text-white border-transparent dark:bg-[#E17100]/30 dark:text-orange-100',
|
|
35
|
+
gray: 'bg-[#4A5565] text-white border-transparent dark:bg-[#4A5565]/30 dark:text-gray-100',
|
|
36
|
+
orange: 'bg-[#E17100] text-white border-transparent dark:bg-[#E17100]/30 dark:text-orange-100'
|
|
38
37
|
},
|
|
39
38
|
inverted: {
|
|
40
|
-
primary: 'bg-
|
|
41
|
-
success: 'bg-
|
|
42
|
-
danger: 'bg-
|
|
43
|
-
warning: 'bg-
|
|
44
|
-
gray: 'bg-
|
|
45
|
-
orange: 'bg-
|
|
39
|
+
primary: 'bg-[#F0F8FF] text-[#068DFF] border-transparent dark:bg-[#068DFF]/10 dark:text-blue-400',
|
|
40
|
+
success: 'bg-[#DCFCE7] text-[#00A63E] border-transparent dark:bg-[#00A63E]/10 dark:text-green-400',
|
|
41
|
+
danger: 'bg-[#FFE2E2] text-[#E7000B] border-transparent dark:bg-[#E7000B]/10 dark:text-red-400',
|
|
42
|
+
warning: 'bg-[#FEF3C6] text-[#E17100] border-transparent dark:bg-[#E17100]/10 dark:text-orange-400',
|
|
43
|
+
gray: 'bg-[#F3F4F6] text-[#4A5565] border-transparent dark:bg-[#4A5565]/10 dark:text-gray-300',
|
|
44
|
+
orange: 'bg-[#FEF3C6] text-[#E17100] border-transparent dark:bg-[#E17100]/10 dark:text-orange-400'
|
|
46
45
|
},
|
|
47
46
|
transparent: {
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
primary: 'bg-white border-[#B3DCFF] text-[#068DFF] dark:bg-transparent dark:border-[#068DFF]/50 dark:text-blue-400',
|
|
48
|
+
success: 'bg-white border-[#7BF1A8] text-[#00A63E] dark:bg-transparent dark:border-[#00A63E]/50 dark:text-green-400',
|
|
49
|
+
danger: 'bg-white border-[#FFA2A2] text-[#E7000B] dark:bg-transparent dark:border-[#E7000B]/50 dark:text-red-400',
|
|
50
|
+
warning: 'bg-white border-[#FFD230] text-[#E17100] dark:bg-transparent dark:border-[#E17100]/50 dark:text-orange-400',
|
|
51
|
+
gray: 'bg-white border-[#D1D5DC] text-[#4A5565] dark:bg-transparent dark:border-[#4A5565]/50 dark:text-gray-300',
|
|
52
|
+
orange: 'bg-white border-[#FFD230] text-[#E17100] dark:bg-transparent dark:border-[#E17100]/50 dark:text-orange-400'
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { twMerge } from '
|
|
2
|
+
import { twMerge } from '#adata-ui/utils/twMerge'
|
|
3
3
|
|
|
4
4
|
defineOptions({ name: 'StatusBadgeV2', inheritAttrs: false })
|
|
5
5
|
|
|
@@ -58,8 +58,6 @@ const typeClasses: Record<BadgeView, Partial<Record<BadgeType, string>>> = {
|
|
|
58
58
|
|
|
59
59
|
const attrs = useAttrs()
|
|
60
60
|
|
|
61
|
-
// twMerge resolves Tailwind conflicts: any class passed via `class` wins over
|
|
62
|
-
// the defaults below, so padding / rounded / bg / text can all be overridden.
|
|
63
61
|
const classes = computed(() =>
|
|
64
62
|
twMerge(
|
|
65
63
|
base,
|
|
@@ -14,7 +14,7 @@ export const ui = {
|
|
|
14
14
|
padding: 'px-4 py-3.5',
|
|
15
15
|
color: 'text-deepblue-900 dark:text-gray-200',
|
|
16
16
|
font: 'font-semibold',
|
|
17
|
-
size: 'text-
|
|
17
|
+
size: 'text-body-sm',
|
|
18
18
|
},
|
|
19
19
|
td: {
|
|
20
20
|
base: '',
|
|
@@ -24,7 +24,7 @@ export const ui = {
|
|
|
24
24
|
},
|
|
25
25
|
color: 'text-deepblue-900 dark:text-gray-200',
|
|
26
26
|
font: '',
|
|
27
|
-
size: 'text-
|
|
27
|
+
size: 'text-body-md',
|
|
28
28
|
},
|
|
29
29
|
progress: {
|
|
30
30
|
wrapper: 'absolute h-[2px] bg-deepblue-700 inset-x-0 animate-pulse',
|