@meistrari/tela-build 1.57.2 → 1.57.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.
|
@@ -308,7 +308,7 @@ const computedWidthContent = computed(() => {
|
|
|
308
308
|
<template v-if="variant === 'default'">
|
|
309
309
|
<div aria-hidden h-24px w-0.5px class="bg-white/16" />
|
|
310
310
|
|
|
311
|
-
<div
|
|
311
|
+
<div px-8px>
|
|
312
312
|
<TelaTooltipGroupTrigger variant="multiline">
|
|
313
313
|
<TelaButton size="sm" variant="dark" :disabled="!fileUrl" @click="fileUrl && download(fileUrl)">
|
|
314
314
|
{{ barLabels.download }}
|
|
@@ -40,18 +40,31 @@ const defaultLabels: Required<import('./types').PreviewSelectVariableLabels> = {
|
|
|
40
40
|
const labels = computed(() => ({ ...defaultLabels, ...props.labels }))
|
|
41
41
|
|
|
42
42
|
const search = ref('')
|
|
43
|
-
const innerValue = ref<string>('')
|
|
44
43
|
const isOpen = ref(false)
|
|
45
44
|
|
|
45
|
+
const selectedValue = computed({
|
|
46
|
+
get: () => props.modelValue ?? '',
|
|
47
|
+
set: (value) => {
|
|
48
|
+
if (!value)
|
|
49
|
+
return
|
|
50
|
+
|
|
51
|
+
emit('update:modelValue', value)
|
|
52
|
+
|
|
53
|
+
isOpen.value = false
|
|
54
|
+
},
|
|
55
|
+
})
|
|
56
|
+
|
|
46
57
|
const selectedOption = computed(() =>
|
|
47
|
-
props.options.find(option => option.value === props.modelValue
|
|
58
|
+
props.options.find(option => option.value === props.modelValue),
|
|
48
59
|
)
|
|
49
60
|
|
|
50
61
|
const filteredOptions = computed(() => {
|
|
51
62
|
if (!search.value.trim()) {
|
|
52
63
|
return props.options
|
|
53
64
|
}
|
|
65
|
+
|
|
54
66
|
const searchLower = search.value.toLowerCase()
|
|
67
|
+
|
|
55
68
|
return props.options.filter(option =>
|
|
56
69
|
option.variable.toLowerCase().includes(searchLower)
|
|
57
70
|
|| option.file.toLowerCase().includes(searchLower),
|
|
@@ -81,6 +94,7 @@ function handleDeleteSearchValue() {
|
|
|
81
94
|
|
|
82
95
|
const firstColumnWidth = computed(() => {
|
|
83
96
|
const allVariableNames = [...new Set(props.options.map(opt => opt.variable))]
|
|
97
|
+
|
|
84
98
|
const allTexts = [
|
|
85
99
|
selectedOption.value?.variable || props.placeholder,
|
|
86
100
|
labels.value.variablesLabel,
|
|
@@ -116,30 +130,17 @@ function onOpenChange(open: boolean) {
|
|
|
116
130
|
}
|
|
117
131
|
}
|
|
118
132
|
|
|
119
|
-
watch(innerValue, (value) => {
|
|
120
|
-
if (!value) {
|
|
121
|
-
return
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const option = props.options.find(option => option.value === value)
|
|
125
|
-
|
|
126
|
-
if (option) {
|
|
127
|
-
innerValue.value = ''
|
|
128
|
-
emit('update:modelValue', value)
|
|
129
|
-
isOpen.value = false
|
|
130
|
-
}
|
|
131
|
-
})
|
|
132
|
-
|
|
133
133
|
function iconSrc(option: PreviewVariableOption): string {
|
|
134
134
|
if (option.icon)
|
|
135
135
|
return option.icon
|
|
136
|
+
|
|
136
137
|
return '/files/generic.svg'
|
|
137
138
|
}
|
|
138
139
|
</script>
|
|
139
140
|
|
|
140
141
|
<template>
|
|
141
142
|
<TelaComboboxRoot
|
|
142
|
-
v-model="
|
|
143
|
+
v-model="selectedValue"
|
|
143
144
|
by="value"
|
|
144
145
|
:open="isOpen"
|
|
145
146
|
:disabled="disabled"
|
|
@@ -150,7 +151,7 @@ function iconSrc(option: PreviewVariableOption): string {
|
|
|
150
151
|
<TelaComboboxTrigger
|
|
151
152
|
as="button"
|
|
152
153
|
tabindex="0"
|
|
153
|
-
class="w-full bg border-[0.5px] border-strong rounded-10px
|
|
154
|
+
class="w-full bg border-[0.5px] border-strong rounded-10px pl-13.2px pr-12px py-7px flex items-center justify-between gap-10px"
|
|
154
155
|
>
|
|
155
156
|
<div class="grid items-center gap-22px w-full min-w-0 grid-cols-[var(--first-col-width,minmax(82px,auto))_1fr]">
|
|
156
157
|
<p body-14-semibold text-start text-primary min-w-0>
|
|
@@ -171,6 +172,7 @@ function iconSrc(option: PreviewVariableOption): string {
|
|
|
171
172
|
v-model="search"
|
|
172
173
|
class="rounded-b-none"
|
|
173
174
|
:placeholder="labels.searchPlaceholder"
|
|
175
|
+
:display-value="() => ''"
|
|
174
176
|
>
|
|
175
177
|
<template v-if="search.length > 0" #deleteSearchValue>
|
|
176
178
|
<button class="flex items-center justify-center" @mousedown.prevent @click.stop="handleDeleteSearchValue">
|
|
@@ -217,13 +219,13 @@ function iconSrc(option: PreviewVariableOption): string {
|
|
|
217
219
|
<div v-for="group in groupedOptions" :key="group.heading" mx-12px>
|
|
218
220
|
<TelaComboboxGroup
|
|
219
221
|
:heading="group.heading"
|
|
220
|
-
class="overflow-visible mx--12px
|
|
222
|
+
class="overflow-visible mx--12px"
|
|
221
223
|
>
|
|
222
224
|
<TelaComboboxItem
|
|
223
225
|
v-for="(item, index) in group.children"
|
|
224
226
|
:key="item.value"
|
|
225
227
|
:value="item.value"
|
|
226
|
-
class="grid items-center gap-22px grid-cols-[var(--first-col-width,minmax(82px,auto))_minmax(0,1fr)] h-32px w-full"
|
|
228
|
+
class="grid items-center gap-22px grid-cols-[var(--first-col-width,minmax(82px,auto))_minmax(0,1fr)] pl-[9px] h-32px w-full"
|
|
227
229
|
>
|
|
228
230
|
<span v-if="index === 0" body-14-semibold text-primary min-w-0>{{ group.heading }}</span>
|
|
229
231
|
<span v-else />
|
|
@@ -235,7 +237,7 @@ function iconSrc(option: PreviewVariableOption): string {
|
|
|
235
237
|
<span flex-shrink-0>{{ item.file.includes('.') ? (item.file.match(/[^.]+$/)?.[0] ?? '') : '' }}</span>
|
|
236
238
|
</p>
|
|
237
239
|
</div>
|
|
238
|
-
<div
|
|
240
|
+
<div class="flex gap-2 items-center">
|
|
239
241
|
<TelaComboboxIndicator>
|
|
240
242
|
<TelaIcon name="i-ph-check-bold" size="14px" color="icon-secondary" />
|
|
241
243
|
</TelaComboboxIndicator>
|