@antify/ui 3.2.2 → 3.3.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/dist/components/AntButton.vue +1 -0
- package/dist/components/calendar/AntDatePicker.vue +35 -15
- package/dist/components/calendar/AntDateSwitcher.vue +5 -0
- package/dist/components/calendar/__stories/AntDatePicker.stories.js +1 -1
- package/dist/components/calendar/__stories/AntDatePicker.stories.mjs +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +7 -0
- package/dist/components/index.mjs +2 -0
- package/package.json +1 -1
|
@@ -6,11 +6,14 @@ import {
|
|
|
6
6
|
subDays,
|
|
7
7
|
} from 'date-fns';
|
|
8
8
|
import {
|
|
9
|
+
ref,
|
|
10
|
+
watch,
|
|
9
11
|
computed,
|
|
10
|
-
defineEmits,
|
|
12
|
+
defineEmits,
|
|
11
13
|
} from 'vue';
|
|
12
14
|
import AntDateSwitcher from './AntDateSwitcher.vue';
|
|
13
15
|
import AntButton from '../AntButton.vue';
|
|
16
|
+
import AntSkeleton from '../AntSkeleton.vue';
|
|
14
17
|
|
|
15
18
|
const props = withDefaults(defineProps<{
|
|
16
19
|
/**
|
|
@@ -20,11 +23,13 @@ const props = withDefaults(defineProps<{
|
|
|
20
23
|
modelValue: number;
|
|
21
24
|
showWeekend?: boolean;
|
|
22
25
|
showTodayButton?: boolean;
|
|
26
|
+
skeleton?: boolean;
|
|
23
27
|
}>(), {
|
|
24
28
|
showWeekend: false,
|
|
25
29
|
showTodayButton: true,
|
|
30
|
+
skeleton: false,
|
|
26
31
|
});
|
|
27
|
-
|
|
32
|
+
defineEmits([
|
|
28
33
|
'select',
|
|
29
34
|
'update:modelValue',
|
|
30
35
|
]);
|
|
@@ -109,6 +114,7 @@ watch(() => props.modelValue, (val) => {
|
|
|
109
114
|
<AntDateSwitcher
|
|
110
115
|
v-model:month="currentMonthIndex"
|
|
111
116
|
v-model:year="currentYear"
|
|
117
|
+
:skeleton="skeleton"
|
|
112
118
|
/>
|
|
113
119
|
|
|
114
120
|
<div
|
|
@@ -123,28 +129,41 @@ watch(() => props.modelValue, (val) => {
|
|
|
123
129
|
:key="day"
|
|
124
130
|
class="text-for-white-bg-font text-center p-2"
|
|
125
131
|
>
|
|
126
|
-
|
|
132
|
+
<AntSkeleton
|
|
133
|
+
:visible="skeleton"
|
|
134
|
+
rounded
|
|
135
|
+
>
|
|
136
|
+
{{ day }}
|
|
137
|
+
</AntSkeleton>
|
|
127
138
|
</div>
|
|
128
139
|
|
|
129
140
|
<template
|
|
130
141
|
v-for="week in matrix"
|
|
131
142
|
:key="week"
|
|
132
143
|
>
|
|
133
|
-
<
|
|
144
|
+
<template
|
|
134
145
|
v-for="day in week"
|
|
135
146
|
:key="day.date"
|
|
136
|
-
class="rounded-md flex items-center justify-center p-2 font-semibold cursor-pointer transition-colors"
|
|
137
|
-
:class="{
|
|
138
|
-
'text-base-400': !day.isCurrentMonth,
|
|
139
|
-
'text-for-white-bg-font': day.isCurrentMonth,
|
|
140
|
-
'outline outline-primary-500': day.isToday,
|
|
141
|
-
'hover:bg-base-200 hover:text-base-200-font': day.date !== format(modelValue, 'yyyy-MM-dd'),
|
|
142
|
-
'bg-primary-500 text-primary-500-font hover:bg-primary-300 hover:text-primary-300-font': day.date === format(modelValue, 'yyyy-MM-dd'),
|
|
143
|
-
}"
|
|
144
|
-
@click="() => $emit('update:modelValue', new Date(day.date).getTime())"
|
|
145
147
|
>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
+
<AntSkeleton
|
|
149
|
+
:visible="skeleton"
|
|
150
|
+
rounded
|
|
151
|
+
>
|
|
152
|
+
<div
|
|
153
|
+
class="rounded-md flex items-center justify-center p-2 font-semibold cursor-pointer transition-colors"
|
|
154
|
+
:class="{
|
|
155
|
+
'text-base-400': !day.isCurrentMonth,
|
|
156
|
+
'text-for-white-bg-font': day.isCurrentMonth,
|
|
157
|
+
'outline outline-primary-500': day.isToday,
|
|
158
|
+
'hover:bg-base-200 hover:text-base-200-font': day.date !== format(modelValue, 'yyyy-MM-dd'),
|
|
159
|
+
'bg-primary-500 text-primary-500-font hover:bg-primary-300 hover:text-primary-300-font': day.date === format(modelValue, 'yyyy-MM-dd'),
|
|
160
|
+
}"
|
|
161
|
+
@click="() => $emit('update:modelValue', new Date(day.date).getTime())"
|
|
162
|
+
>
|
|
163
|
+
{{ day.label }}
|
|
164
|
+
</div>
|
|
165
|
+
</AntSkeleton>
|
|
166
|
+
</template>
|
|
148
167
|
</template>
|
|
149
168
|
</div>
|
|
150
169
|
|
|
@@ -153,6 +172,7 @@ watch(() => props.modelValue, (val) => {
|
|
|
153
172
|
class="flex items-center justify-center p-2"
|
|
154
173
|
>
|
|
155
174
|
<AntButton
|
|
175
|
+
:skeleton="skeleton"
|
|
156
176
|
@click="() => $emit('update:modelValue', Date.now())"
|
|
157
177
|
>
|
|
158
178
|
Heute
|
|
@@ -21,6 +21,7 @@ const props = defineProps<{
|
|
|
21
21
|
*/
|
|
22
22
|
month: number;
|
|
23
23
|
year: number;
|
|
24
|
+
skeleton: boolean;
|
|
24
25
|
}>();
|
|
25
26
|
const emit = defineEmits([
|
|
26
27
|
'update:month',
|
|
@@ -87,6 +88,7 @@ function onClickNext() {
|
|
|
87
88
|
<AntButton
|
|
88
89
|
:icon-left="faChevronLeft"
|
|
89
90
|
:grouped="Grouped.left"
|
|
91
|
+
:skeleton="skeleton"
|
|
90
92
|
@click="onClickPrevious"
|
|
91
93
|
/>
|
|
92
94
|
<AntDropdown
|
|
@@ -96,6 +98,7 @@ function onClickNext() {
|
|
|
96
98
|
>
|
|
97
99
|
<AntButton
|
|
98
100
|
:grouped="Grouped.center"
|
|
101
|
+
:skeleton="skeleton"
|
|
99
102
|
expanded
|
|
100
103
|
@click="showMonthDropdown = !showMonthDropdown"
|
|
101
104
|
>
|
|
@@ -119,6 +122,7 @@ function onClickNext() {
|
|
|
119
122
|
>
|
|
120
123
|
<AntButton
|
|
121
124
|
:grouped="Grouped.center"
|
|
125
|
+
:skeleton="skeleton"
|
|
122
126
|
expanded
|
|
123
127
|
@click="showYearDropdown = !showYearDropdown"
|
|
124
128
|
>
|
|
@@ -141,6 +145,7 @@ function onClickNext() {
|
|
|
141
145
|
<AntButton
|
|
142
146
|
:icon-left="faChevronRight"
|
|
143
147
|
:grouped="Grouped.right"
|
|
148
|
+
:skeleton="skeleton"
|
|
144
149
|
@click="onClickNext"
|
|
145
150
|
/>
|
|
146
151
|
</div>
|
|
@@ -9,7 +9,7 @@ var _AntDateSwitcher = _interopRequireDefault(require("../AntDateSwitcher.vue"))
|
|
|
9
9
|
var _vue = require("vue");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
const meta = {
|
|
12
|
-
title: "Components/
|
|
12
|
+
title: "Components/Date Picker",
|
|
13
13
|
component: _AntDatePicker.default,
|
|
14
14
|
parameters: {
|
|
15
15
|
controls: {
|
|
@@ -38,6 +38,7 @@ import AntAccordionItem from './AntAccordionItem.vue';
|
|
|
38
38
|
import AntAlert from './AntAlert.vue';
|
|
39
39
|
import AntCard from './AntCard.vue';
|
|
40
40
|
import AntContent from './AntContent.vue';
|
|
41
|
+
import AntDatePicker from './calendar/AntDatePicker.vue';
|
|
41
42
|
import AntDropdown from './AntDropdown.vue';
|
|
42
43
|
import AntIcon from './AntIcon.vue';
|
|
43
44
|
import AntKeycap from './AntKeycap.vue';
|
|
@@ -52,4 +53,4 @@ import AntTag from './AntTag.vue';
|
|
|
52
53
|
import AntToast from './AntToast.vue';
|
|
53
54
|
import AntToaster from './AntToaster.vue';
|
|
54
55
|
import AntTooltip from './AntTooltip.vue';
|
|
55
|
-
export { AntButton, AntDialog, AntField, AntFormGroup, AntFormGroupLabel, AntBaseInput, AntSelectMenu, AntInputDescription, AntInputLabel, AntInputLimiter, AntCheckbox, AntCheckboxGroup, AntDateInput, AntNumberInput, AntPasswordInput, AntRadio, AntRadioGroup, AntRangeSlider, AntSearch, AntSelect, AntSwitch, AntSwitcher, AntTagInput, AntTextarea, AntTextInput, AntUnitInput, AntImageInput, AntNavLeftLayout, AntNavbar, AntNavbarItem, AntTable, AntTabs, AntTransitionCollapseHeight, AntAccordion, AntAccordionItem, AntAlert, AntCard, AntContent, AntDropdown, AntIcon, AntKeycap, AntListGroup, AntListGroupItem, AntModal, AntPagination, AntPopover, AntSkeleton, AntSpinner, AntTag, AntToast, AntToaster, AntTooltip, AntColorInput, AntMultiSelect, };
|
|
56
|
+
export { AntButton, AntDatePicker, AntDialog, AntField, AntFormGroup, AntFormGroupLabel, AntBaseInput, AntSelectMenu, AntInputDescription, AntInputLabel, AntInputLimiter, AntCheckbox, AntCheckboxGroup, AntDateInput, AntNumberInput, AntPasswordInput, AntRadio, AntRadioGroup, AntRangeSlider, AntSearch, AntSelect, AntSwitch, AntSwitcher, AntTagInput, AntTextarea, AntTextInput, AntUnitInput, AntImageInput, AntNavLeftLayout, AntNavbar, AntNavbarItem, AntTable, AntTabs, AntTransitionCollapseHeight, AntAccordion, AntAccordionItem, AntAlert, AntCard, AntContent, AntDropdown, AntIcon, AntKeycap, AntListGroup, AntListGroupItem, AntModal, AntPagination, AntPopover, AntSkeleton, AntSpinner, AntTag, AntToast, AntToaster, AntTooltip, AntColorInput, AntMultiSelect, };
|
package/dist/components/index.js
CHANGED
|
@@ -69,6 +69,12 @@ Object.defineProperty(exports, "AntDateInput", {
|
|
|
69
69
|
return _AntDateInput.default;
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
+
Object.defineProperty(exports, "AntDatePicker", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _AntDatePicker.default;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
72
78
|
Object.defineProperty(exports, "AntDialog", {
|
|
73
79
|
enumerable: true,
|
|
74
80
|
get: function () {
|
|
@@ -367,6 +373,7 @@ var _AntAccordionItem = _interopRequireDefault(require("./AntAccordionItem.vue")
|
|
|
367
373
|
var _AntAlert = _interopRequireDefault(require("./AntAlert.vue"));
|
|
368
374
|
var _AntCard = _interopRequireDefault(require("./AntCard.vue"));
|
|
369
375
|
var _AntContent = _interopRequireDefault(require("./AntContent.vue"));
|
|
376
|
+
var _AntDatePicker = _interopRequireDefault(require("./calendar/AntDatePicker.vue"));
|
|
370
377
|
var _AntDropdown = _interopRequireDefault(require("./AntDropdown.vue"));
|
|
371
378
|
var _AntIcon = _interopRequireDefault(require("./AntIcon.vue"));
|
|
372
379
|
var _AntKeycap = _interopRequireDefault(require("./AntKeycap.vue"));
|
|
@@ -38,6 +38,7 @@ import AntAccordionItem from "./AntAccordionItem.vue";
|
|
|
38
38
|
import AntAlert from "./AntAlert.vue";
|
|
39
39
|
import AntCard from "./AntCard.vue";
|
|
40
40
|
import AntContent from "./AntContent.vue";
|
|
41
|
+
import AntDatePicker from "./calendar/AntDatePicker.vue";
|
|
41
42
|
import AntDropdown from "./AntDropdown.vue";
|
|
42
43
|
import AntIcon from "./AntIcon.vue";
|
|
43
44
|
import AntKeycap from "./AntKeycap.vue";
|
|
@@ -54,6 +55,7 @@ import AntToaster from "./AntToaster.vue";
|
|
|
54
55
|
import AntTooltip from "./AntTooltip.vue";
|
|
55
56
|
export {
|
|
56
57
|
AntButton,
|
|
58
|
+
AntDatePicker,
|
|
57
59
|
AntDialog,
|
|
58
60
|
AntField,
|
|
59
61
|
AntFormGroup,
|