@saasmakers/ui 2.0.36 → 2.0.38
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.
|
@@ -29,7 +29,7 @@ function onKeyDown(event: KeyboardEvent) {
|
|
|
29
29
|
|
|
30
30
|
<template>
|
|
31
31
|
<span
|
|
32
|
-
class="flex items-center justify-center transition"
|
|
32
|
+
class="flex select-none items-center justify-center transition"
|
|
33
33
|
:class="{
|
|
34
34
|
'relative': legend,
|
|
35
35
|
'border base-border': hasBox,
|
|
@@ -59,7 +59,8 @@ function onKeyDown(event: KeyboardEvent) {
|
|
|
59
59
|
>
|
|
60
60
|
<img
|
|
61
61
|
v-if="emoji"
|
|
62
|
-
class="pointer-events-none block"
|
|
62
|
+
class="pointer-events-none block select-none"
|
|
63
|
+
draggable="false"
|
|
63
64
|
:class="{
|
|
64
65
|
'h-2.5 w-2.5': size === '3xs',
|
|
65
66
|
'h-3 w-3': size === '2xs',
|
|
@@ -10,6 +10,7 @@ const props = withDefaults(defineProps<Omit<FieldSelect, 'modelValue'>>(), {
|
|
|
10
10
|
description: '',
|
|
11
11
|
direction: 'bottom',
|
|
12
12
|
disabled: false,
|
|
13
|
+
hideCaret: false,
|
|
13
14
|
hideError: false,
|
|
14
15
|
hideLabel: false,
|
|
15
16
|
label: '',
|
|
@@ -23,6 +24,7 @@ const props = withDefaults(defineProps<Omit<FieldSelect, 'modelValue'>>(), {
|
|
|
23
24
|
searchable: false,
|
|
24
25
|
searchPlaceholder: '',
|
|
25
26
|
size: 'base',
|
|
27
|
+
square: false,
|
|
26
28
|
validation: undefined,
|
|
27
29
|
})
|
|
28
30
|
|
|
@@ -189,7 +191,7 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
189
191
|
<template>
|
|
190
192
|
<div
|
|
191
193
|
class="flex flex-col"
|
|
192
|
-
:class="{ 'w-fit': hideLabel }"
|
|
194
|
+
:class="{ 'w-fit': hideLabel || square }"
|
|
193
195
|
>
|
|
194
196
|
<FieldLabel
|
|
195
197
|
v-if="label"
|
|
@@ -209,14 +211,14 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
209
211
|
:class="{
|
|
210
212
|
'field-disabled': disabled,
|
|
211
213
|
'cursor-pointer': !disabled,
|
|
212
|
-
'w-fit': hideLabel,
|
|
214
|
+
'w-fit': hideLabel || square,
|
|
213
215
|
}"
|
|
214
216
|
>
|
|
215
217
|
<div
|
|
216
218
|
class="relative"
|
|
217
219
|
:class="{
|
|
218
220
|
'shadow-sm': border === 'full',
|
|
219
|
-
'w-fit': hideLabel,
|
|
221
|
+
'w-fit': hideLabel || square,
|
|
220
222
|
}"
|
|
221
223
|
>
|
|
222
224
|
<div
|
|
@@ -228,12 +230,15 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
228
230
|
'base-border-active': opened,
|
|
229
231
|
'base-border-hover': !opened && !disabled,
|
|
230
232
|
'base-border-interactive-focus-visible': !disabled,
|
|
231
|
-
'px-3': padding && !hideLabel,
|
|
232
|
-
'px-2': padding && hideLabel,
|
|
233
233
|
'text-xs h-10': size === 'sm',
|
|
234
234
|
'text-sm h-12': size === 'base',
|
|
235
235
|
'text-base h-14': size === 'lg',
|
|
236
|
-
'
|
|
236
|
+
'px-3': padding && !hideLabel && !square,
|
|
237
|
+
'px-2': padding && hideLabel && !square,
|
|
238
|
+
'inline-flex w-fit gap-1': hideLabel && !square,
|
|
239
|
+
'justify-center w-10': square && size === 'sm',
|
|
240
|
+
'justify-center w-12': square && size === 'base',
|
|
241
|
+
'justify-center w-14': square && size === 'lg',
|
|
237
242
|
}"
|
|
238
243
|
role="button"
|
|
239
244
|
:aria-disabled="disabled"
|
|
@@ -249,7 +254,7 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
249
254
|
<BaseEmoji
|
|
250
255
|
v-if="selectedOption.emoji"
|
|
251
256
|
class="pointer-events-none shrink-0"
|
|
252
|
-
:class="{ 'mr-2': !hideLabel }"
|
|
257
|
+
:class="{ 'mr-2': !hideLabel && !square }"
|
|
253
258
|
:clickable="false"
|
|
254
259
|
:emoji="selectedOption.emoji"
|
|
255
260
|
size="sm"
|
|
@@ -258,13 +263,13 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
258
263
|
<BaseIcon
|
|
259
264
|
v-else-if="selectedOption.icon"
|
|
260
265
|
class="pointer-events-none"
|
|
261
|
-
:class="{ 'mr-2': !hideLabel }"
|
|
266
|
+
:class="{ 'mr-2': !hideLabel && !square }"
|
|
262
267
|
:color="selectedOption.iconColor"
|
|
263
268
|
:icon="selectedOption.icon"
|
|
264
269
|
/>
|
|
265
270
|
|
|
266
271
|
<span
|
|
267
|
-
v-if="selectedOption.text && !hideLabel"
|
|
272
|
+
v-if="selectedOption.text && !hideLabel && !square"
|
|
268
273
|
class="flex-1 truncate font-medium"
|
|
269
274
|
>
|
|
270
275
|
{{ selectedOption.text }}
|
|
@@ -279,7 +284,7 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
279
284
|
</span>
|
|
280
285
|
|
|
281
286
|
<BaseIcon
|
|
282
|
-
v-if="caret"
|
|
287
|
+
v-if="caret && !hideCaret && !square"
|
|
283
288
|
class="flex-initial"
|
|
284
289
|
:class="{
|
|
285
290
|
'ml-2': !hideLabel,
|
package/app/types/fields.d.ts
CHANGED
|
@@ -121,6 +121,7 @@ export interface FieldSelect {
|
|
|
121
121
|
description?: BaseTextText
|
|
122
122
|
direction?: FieldSelectDirection
|
|
123
123
|
disabled?: boolean
|
|
124
|
+
hideCaret?: boolean
|
|
124
125
|
hideError?: boolean
|
|
125
126
|
hideLabel?: boolean
|
|
126
127
|
label?: BaseTextText
|
|
@@ -135,6 +136,7 @@ export interface FieldSelect {
|
|
|
135
136
|
searchable?: boolean
|
|
136
137
|
searchPlaceholder?: string
|
|
137
138
|
size?: FieldSize
|
|
139
|
+
square?: boolean
|
|
138
140
|
validation?: VuelidateValidation
|
|
139
141
|
}
|
|
140
142
|
|