@veritree/ui 0.94.0 → 0.94.2
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/mixins/form-control.js
CHANGED
|
@@ -76,11 +76,11 @@ export const formControlStyleMixin = {
|
|
|
76
76
|
classComputed() {
|
|
77
77
|
return [
|
|
78
78
|
this.headless
|
|
79
|
-
? `${this.name}`
|
|
79
|
+
? `${this.name ? this.name : ''}`
|
|
80
80
|
: 'leading-0 bg-white has-[:disabled]:bg-gray-200 disabled:bg-gray-200 flex w-full max-w-full relative appearance-none placeholder:font-light placeholder:text-gray-500 items-center justify-between rounded border border-solid px-3 py-2 font-inherit text-inherit file:hidden focus-within:border-gray-600 focus:border-gray-600 focus-within:placeholder:text-gray-400 focus:placeholder:text-gray-400 has-[:disabled]:text-gray-500 disabled:text-gray-500',
|
|
81
81
|
// variant styles
|
|
82
82
|
this.headless
|
|
83
|
-
? `${this.name}
|
|
83
|
+
? `${this.name ? this.name : ''}${this.variant ? '--' + this.variant : ''}`
|
|
84
84
|
: this.isError
|
|
85
85
|
? 'border-error-300'
|
|
86
86
|
: this.isSuccess
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<VTPopover>
|
|
2
|
+
<VTPopover :placement="placement">
|
|
3
3
|
<VTPopoverTrigger ref="trigger">
|
|
4
4
|
<button
|
|
5
5
|
:id="id"
|
|
@@ -9,13 +9,29 @@
|
|
|
9
9
|
@click.prevent
|
|
10
10
|
>
|
|
11
11
|
<span v-if="valueModel">{{ valueModelFormatted }}</span>
|
|
12
|
-
<
|
|
12
|
+
<slot v-else name="label">
|
|
13
|
+
<span
|
|
14
|
+
:class="{
|
|
15
|
+
'text-gray-500': !headless,
|
|
16
|
+
}"
|
|
17
|
+
>{{ label || format }}</span
|
|
18
|
+
>
|
|
19
|
+
</slot>
|
|
13
20
|
<span
|
|
14
21
|
v-if="!iconless"
|
|
15
|
-
class="
|
|
16
|
-
:class="[
|
|
22
|
+
class=""
|
|
23
|
+
:class="[
|
|
24
|
+
headless ? '' : disabled ? 'bg-gray-200' : 'bg-white',
|
|
25
|
+
headless
|
|
26
|
+
? ''
|
|
27
|
+
: 'pointer-events-none absolute right-3 top-1/2 -translate-y-1/2',
|
|
28
|
+
]"
|
|
17
29
|
>
|
|
18
|
-
<IconCalendar
|
|
30
|
+
<IconCalendar
|
|
31
|
+
:class="{
|
|
32
|
+
'-z-0 h-5 w-5 scale-90 text-gray-600': !headless,
|
|
33
|
+
}"
|
|
34
|
+
/>
|
|
19
35
|
</span>
|
|
20
36
|
</button>
|
|
21
37
|
</VTPopoverTrigger>
|
|
@@ -89,6 +105,10 @@ export default {
|
|
|
89
105
|
type: [Function, Object],
|
|
90
106
|
default: null,
|
|
91
107
|
},
|
|
108
|
+
label: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: null,
|
|
111
|
+
},
|
|
92
112
|
format: {
|
|
93
113
|
type: String,
|
|
94
114
|
default: 'YYYY-MM-DD',
|
|
@@ -125,6 +145,10 @@ export default {
|
|
|
125
145
|
type: Boolean,
|
|
126
146
|
default: false,
|
|
127
147
|
},
|
|
148
|
+
placement: {
|
|
149
|
+
type: String,
|
|
150
|
+
default: 'bottom-start',
|
|
151
|
+
},
|
|
128
152
|
},
|
|
129
153
|
|
|
130
154
|
computed: {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
v-model="search"
|
|
6
6
|
v-bind="$attrs"
|
|
7
7
|
type="text"
|
|
8
|
-
class="leading-0 font-inherit w-full max-w-full appearance-none border-b border-solid border-gray-300 py-2 px-3 text-base text-inherit"
|
|
8
|
+
class="leading-0 hidden sm:block font-inherit w-full max-w-full appearance-none border-b border-solid border-gray-300 py-2 px-3 text-base text-inherit"
|
|
9
9
|
@input="onChange"
|
|
10
10
|
@click.stop
|
|
11
11
|
@keydown.down.prevent="focusNextItem"
|