@veritree/ui 0.46.0 → 0.47.0
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
|
@@ -70,6 +70,12 @@ export const formControlStyleMixin = {
|
|
|
70
70
|
: this.name === 'textarea'
|
|
71
71
|
? 'min-h-10' // limit it because input type number height can be different from other input types
|
|
72
72
|
: 'h-10',
|
|
73
|
+
// disabled styles
|
|
74
|
+
this.disabled
|
|
75
|
+
? this.headless
|
|
76
|
+
? `${this.name}--disabled`
|
|
77
|
+
: 'bg-gray-100'
|
|
78
|
+
: null,
|
|
73
79
|
];
|
|
74
80
|
},
|
|
75
81
|
},
|
package/package.json
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="relative">
|
|
3
|
+
<input
|
|
4
|
+
type="date"
|
|
5
|
+
:class="classComputed"
|
|
6
|
+
:value="date"
|
|
7
|
+
:disabled="disabled"
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
v-on="listeners"
|
|
10
|
+
/>
|
|
11
|
+
<span
|
|
12
|
+
class="absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"
|
|
13
|
+
:class="[disabled ? 'bg-gray-100' : 'bg-white']"
|
|
14
|
+
><IconCalendar class="-z-0 scale-90 text-gray-500"
|
|
15
|
+
/></span>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
import {
|
|
21
|
+
formControlMixin,
|
|
22
|
+
formControlStyleMixin,
|
|
23
|
+
} from '../../../mixins/form-control';
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
name: 'VTInputDate',
|
|
27
|
+
|
|
28
|
+
mixins: [formControlMixin, formControlStyleMixin],
|
|
29
|
+
|
|
30
|
+
computed: {
|
|
31
|
+
date: {
|
|
32
|
+
get() {
|
|
33
|
+
return this.value ? this.$date.format(this.value, 'YYYY-MM-DD') : null;
|
|
34
|
+
},
|
|
35
|
+
set(newDate) {
|
|
36
|
+
this.$emit('input', newDate);
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<style scoped lang="postcss">
|
|
44
|
+
input[type='date']::-webkit-calendar-picker-indicator {
|
|
45
|
+
@apply absolute right-0 z-10 h-10 w-10 cursor-pointer opacity-0;
|
|
46
|
+
}
|
|
47
|
+
</style>
|