@antify/ui 4.1.9 → 4.1.11
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.
|
@@ -170,7 +170,7 @@ onMounted(() => {
|
|
|
170
170
|
<div
|
|
171
171
|
v-for="day in weekDays"
|
|
172
172
|
:key="day"
|
|
173
|
-
class="text-for-white-bg-font text-center
|
|
173
|
+
class="text-for-white-bg-font p-2 text-center"
|
|
174
174
|
>
|
|
175
175
|
<AntSkeleton
|
|
176
176
|
:visible="skeleton"
|
|
@@ -194,11 +194,12 @@ onMounted(() => {
|
|
|
194
194
|
>
|
|
195
195
|
<AntTooltip :delay="300">
|
|
196
196
|
<div
|
|
197
|
-
class="rounded-md flex items-center justify-center p-2 font-semibold cursor-pointer transition-colors
|
|
197
|
+
class="rounded-md flex items-center justify-center p-2 font-semibold cursor-pointer transition-colors w-full h-full"
|
|
198
198
|
:class="{
|
|
199
199
|
'text-base-400': !day.isCurrentMonth,
|
|
200
200
|
'text-for-white-bg-font': day.isCurrentMonth,
|
|
201
201
|
'outline outline-primary-500': day.isToday,
|
|
202
|
+
'bg-primary-100': day.isWeekend,
|
|
202
203
|
'hover:bg-base-200 hover:text-base-200-font': day.date !== format(modelValue, 'yyyy-MM-dd'),
|
|
203
204
|
'!bg-primary-500 !text-primary-500-font hover:bg-primary-300 hover:text-primary-300-font': day.date === format(modelValue, 'yyyy-MM-dd'),
|
|
204
205
|
}"
|
|
@@ -233,8 +234,8 @@ onMounted(() => {
|
|
|
233
234
|
>
|
|
234
235
|
<AntButton
|
|
235
236
|
:skeleton="skeleton"
|
|
236
|
-
@click="() => $emit('update:modelValue', Date.now())"
|
|
237
237
|
data-e2e="today-button"
|
|
238
|
+
@click="() => $emit('update:modelValue', Date.now())"
|
|
238
239
|
>
|
|
239
240
|
Heute
|
|
240
241
|
</AntButton>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import {
|
|
3
|
-
onMounted,
|
|
3
|
+
onMounted, computed,
|
|
4
4
|
} from 'vue';
|
|
5
5
|
import AntField from '../forms/AntField.vue';
|
|
6
6
|
import AntBaseInput from './Elements/AntBaseInput.vue';
|
|
7
|
+
import AntButton from '../AntButton.vue';
|
|
8
|
+
import AntIcon from '../AntIcon.vue';
|
|
7
9
|
import {
|
|
8
10
|
Size,
|
|
9
11
|
} from '../../enums/Size.enum';
|
|
@@ -17,11 +19,14 @@ import {
|
|
|
17
19
|
useVModel,
|
|
18
20
|
} from '@vueuse/core';
|
|
19
21
|
import {
|
|
20
|
-
InputState,
|
|
22
|
+
InputState, Grouped, State,
|
|
21
23
|
} from '../../enums';
|
|
22
24
|
import {
|
|
23
25
|
BaseInputType,
|
|
24
26
|
} from './Elements/__types';
|
|
27
|
+
import {
|
|
28
|
+
faMultiply,
|
|
29
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
25
30
|
|
|
26
31
|
defineOptions({
|
|
27
32
|
inheritAttrs: false,
|
|
@@ -48,6 +53,7 @@ const props = withDefaults(defineProps<{
|
|
|
48
53
|
limiter?: boolean;
|
|
49
54
|
max?: number;
|
|
50
55
|
messages?: string[];
|
|
56
|
+
nullable?: boolean;
|
|
51
57
|
}>(), {
|
|
52
58
|
state: InputState.base,
|
|
53
59
|
inputRef: null,
|
|
@@ -58,10 +64,12 @@ const props = withDefaults(defineProps<{
|
|
|
58
64
|
type: TextInputType.text,
|
|
59
65
|
limiter: false,
|
|
60
66
|
messages: () => [],
|
|
67
|
+
nullable: false,
|
|
61
68
|
});
|
|
62
69
|
|
|
63
70
|
const _value = useVModel(props, 'modelValue', emit);
|
|
64
71
|
const _inputRef = useVModel(props, 'inputRef', emit);
|
|
72
|
+
const _nullable = computed(() => props.nullable && _value.value);
|
|
65
73
|
|
|
66
74
|
onMounted(() => {
|
|
67
75
|
handleEnumValidation(props.size, Size, 'size');
|
|
@@ -82,20 +90,33 @@ onMounted(() => {
|
|
|
82
90
|
:messages="messages"
|
|
83
91
|
data-e2e="text-input"
|
|
84
92
|
>
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
<div class="flex">
|
|
94
|
+
<AntBaseInput
|
|
95
|
+
v-model="_value"
|
|
96
|
+
v-model:input-ref="_inputRef"
|
|
97
|
+
:type="type as unknown as BaseInputType"
|
|
98
|
+
wrapper-class="grow"
|
|
99
|
+
:state="state"
|
|
100
|
+
:size="size"
|
|
101
|
+
:skeleton="skeleton"
|
|
102
|
+
:disabled="disabled"
|
|
103
|
+
:readonly="readonly"
|
|
104
|
+
:placeholder="placeholder !== undefined ? placeholder : label"
|
|
105
|
+
:show-icon="true"
|
|
106
|
+
v-bind="$attrs"
|
|
107
|
+
@validate="val => $emit('validate', val)"
|
|
108
|
+
:grouped="_nullable ? Grouped.left : Grouped.none"
|
|
109
|
+
/>
|
|
110
|
+
<AntButton
|
|
111
|
+
v-if="_nullable"
|
|
112
|
+
:disabled="disabled"
|
|
113
|
+
:icon-left="faMultiply"
|
|
114
|
+
:grouped="Grouped.right"
|
|
115
|
+
:state="state as unknown as State"
|
|
116
|
+
:skeleton="skeleton"
|
|
117
|
+
:size="size"
|
|
118
|
+
@click="_value = null" data-e2e="clear-button"
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
100
121
|
</AntField>
|
|
101
122
|
</template>
|