vueless 0.0.320 → 0.0.321
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/package.json +1 -1
- package/ui.form-calendar/components/DayView.vue +6 -7
- package/ui.form-calendar/components/MonthView.vue +60 -5
- package/ui.form-calendar/components/YearView.vue +53 -5
- package/ui.form-calendar/configs/default.config.js +5 -4
- package/ui.form-calendar/index.vue +5 -1
- package/ui.form-date-picker-range/configs/default.config.js +12 -4
- package/ui.form-date-picker-range/index.vue +64 -7
- package/web-types.json +37 -5
package/package.json
CHANGED
|
@@ -99,9 +99,6 @@ const {
|
|
|
99
99
|
currentDayAttrs,
|
|
100
100
|
anotherMonthDayAttrs,
|
|
101
101
|
dayAttrs,
|
|
102
|
-
inRangeFirstDayAttrs,
|
|
103
|
-
inRangeLastDayAttrs,
|
|
104
|
-
inRangeDayAttrs,
|
|
105
102
|
} = useAttrs(props);
|
|
106
103
|
|
|
107
104
|
const localSelectedDate = computed(() => {
|
|
@@ -227,25 +224,27 @@ function getDayClasses(day) {
|
|
|
227
224
|
(!isSelectedDay(day) && !isSelectedToDay(day)) || props.selectedDate === null;
|
|
228
225
|
|
|
229
226
|
if (isToday(day) && isNotSelectedDate) {
|
|
230
|
-
return cx([isDayInRange &&
|
|
227
|
+
return cx([isDayInRange && props.config.inRangeDate, currentDayAttrs.value.class]);
|
|
231
228
|
}
|
|
232
229
|
|
|
233
230
|
if (props.range && isSelectedDay(day)) {
|
|
234
231
|
return cx([
|
|
235
232
|
isAnotherMothDay(day, activeMonthDate.value) && anotherMonthDayAttrs.value.class,
|
|
236
|
-
|
|
233
|
+
props.config.inRangeEdgeDate,
|
|
234
|
+
props.config.inRangeFirstDate,
|
|
237
235
|
]);
|
|
238
236
|
}
|
|
239
237
|
|
|
240
238
|
if (props.range && isSelectedToDay(day)) {
|
|
241
239
|
return cx([
|
|
242
240
|
isAnotherMothDay(day, activeMonthDate.value) && anotherMonthDayAttrs.value.class,
|
|
243
|
-
|
|
241
|
+
props.config.inRangeEdgeDate,
|
|
242
|
+
props.config.inRangeLastDate,
|
|
244
243
|
]);
|
|
245
244
|
}
|
|
246
245
|
|
|
247
246
|
if (isDayInRange) {
|
|
248
|
-
return
|
|
247
|
+
return props.config.inRangeDate;
|
|
249
248
|
}
|
|
250
249
|
|
|
251
250
|
if (isSelectedDay(day)) {
|
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
<script setup>
|
|
19
19
|
import { computed } from "vue";
|
|
20
|
+
|
|
20
21
|
import { formatDate, dateIsOutOfRange } from "../services/calendar.service";
|
|
21
22
|
import { isSameMonth, getDateWithoutTime, isCurrentMoth } from "../services/date.service";
|
|
23
|
+
import { cx } from "../../service.ui";
|
|
22
24
|
|
|
23
25
|
import useAttrs from "../composables/attrs.composable";
|
|
24
26
|
|
|
@@ -32,6 +34,11 @@ const props = defineProps({
|
|
|
32
34
|
required: true,
|
|
33
35
|
},
|
|
34
36
|
|
|
37
|
+
selectedDateTo: {
|
|
38
|
+
type: [Date, null],
|
|
39
|
+
default: undefined,
|
|
40
|
+
},
|
|
41
|
+
|
|
35
42
|
activeDate: {
|
|
36
43
|
type: [Date, null],
|
|
37
44
|
required: true,
|
|
@@ -49,7 +56,12 @@ const props = defineProps({
|
|
|
49
56
|
|
|
50
57
|
dateFormat: {
|
|
51
58
|
type: String,
|
|
52
|
-
|
|
59
|
+
default: undefined,
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
range: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false,
|
|
53
65
|
},
|
|
54
66
|
|
|
55
67
|
maxDate: {
|
|
@@ -101,26 +113,69 @@ function getMonth(monthNumber) {
|
|
|
101
113
|
}
|
|
102
114
|
|
|
103
115
|
function getMonthClasses(month) {
|
|
116
|
+
const isMonthInRange =
|
|
117
|
+
props.range &&
|
|
118
|
+
localSelectedDate.value &&
|
|
119
|
+
props.selectedDateTo &&
|
|
120
|
+
!dateIsOutOfRange(
|
|
121
|
+
month,
|
|
122
|
+
props.selectedDate,
|
|
123
|
+
props.selectedDateTo,
|
|
124
|
+
props.locale,
|
|
125
|
+
props.dateFormat,
|
|
126
|
+
);
|
|
127
|
+
|
|
104
128
|
const isNotSelectedDate =
|
|
105
129
|
(!isSelectedMonth(month) && !isSelectedMonth(month)) || props.selectedDate === null;
|
|
106
130
|
|
|
131
|
+
const isMoreThenOneMonthRange =
|
|
132
|
+
props.selectedDateTo && isMoreThanOneMonthDiff(props.selectedDate, props.selectedDateTo);
|
|
133
|
+
|
|
107
134
|
if (isCurrentMoth(month) && isNotSelectedDate) {
|
|
108
|
-
return [currentMothAttrs.value.class];
|
|
135
|
+
return cx([currentMothAttrs.value.class, isMonthInRange && props.config.inRangeDate]);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (props.range && isSelectedMonth(month) && isMoreThenOneMonthRange) {
|
|
139
|
+
return cx([props.config.inRangeEdgeDate, props.config.inRangeFirstDate]);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (props.range && isSelectedToMonth(month) && isMoreThenOneMonthRange) {
|
|
143
|
+
return cx([props.config.inRangeEdgeDate, props.config.inRangeLastDate]);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (props.range && isSelectedMonth(month) && !isMoreThenOneMonthRange) {
|
|
147
|
+
return cx([props.config.inRangeDate, "rounded-dynamic"]);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (isMonthInRange) {
|
|
151
|
+
return props.config.inRangeDate;
|
|
109
152
|
}
|
|
110
153
|
|
|
111
154
|
if (isSelectedMonth(month)) {
|
|
112
|
-
return
|
|
155
|
+
return selectedMonthAttrs.value.class;
|
|
113
156
|
}
|
|
114
157
|
|
|
115
|
-
if (isSameMonth(props.activeMonth, month)) {
|
|
116
|
-
return
|
|
158
|
+
if (isSameMonth(props.activeMonth, month) && !props.range) {
|
|
159
|
+
return activeMonthAttrs.value.class;
|
|
117
160
|
}
|
|
118
161
|
}
|
|
119
162
|
|
|
163
|
+
function isMoreThanOneMonthDiff(date, dateTo) {
|
|
164
|
+
const yearDiff = Math.abs(dateTo.getFullYear() - date.getFullYear());
|
|
165
|
+
const monthDiff = Math.abs(dateTo.getMonth() - date.getMonth());
|
|
166
|
+
const dayDiff = Math.abs(dateTo.getDate() - date.getDate());
|
|
167
|
+
|
|
168
|
+
return yearDiff > 0 || monthDiff > 1 || (monthDiff === 1 && dayDiff > 0);
|
|
169
|
+
}
|
|
170
|
+
|
|
120
171
|
function isSelectedMonth(month) {
|
|
121
172
|
return isSameMonth(month, localSelectedDate.value);
|
|
122
173
|
}
|
|
123
174
|
|
|
175
|
+
function isSelectedToMonth(month) {
|
|
176
|
+
return isSameMonth(month, props.selectedDateTo);
|
|
177
|
+
}
|
|
178
|
+
|
|
124
179
|
function onClickMonth(month) {
|
|
125
180
|
emit("input", month);
|
|
126
181
|
}
|
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
<script setup>
|
|
19
19
|
import { computed } from "vue";
|
|
20
|
+
|
|
20
21
|
import { formatDate, getYearsRange, dateIsOutOfRange } from "../services/calendar.service";
|
|
21
22
|
import { isSameMonth, getDateWithoutTime, isCurrentYear } from "../services/date.service";
|
|
23
|
+
import { cx } from "../../service.ui";
|
|
22
24
|
|
|
23
25
|
import useAttrs from "../composables/attrs.composable";
|
|
24
26
|
|
|
@@ -32,6 +34,11 @@ const props = defineProps({
|
|
|
32
34
|
required: true,
|
|
33
35
|
},
|
|
34
36
|
|
|
37
|
+
selectedDateTo: {
|
|
38
|
+
type: [Date, null],
|
|
39
|
+
default: undefined,
|
|
40
|
+
},
|
|
41
|
+
|
|
35
42
|
activeDate: {
|
|
36
43
|
type: [Date, null],
|
|
37
44
|
required: true,
|
|
@@ -49,7 +56,12 @@ const props = defineProps({
|
|
|
49
56
|
|
|
50
57
|
dateFormat: {
|
|
51
58
|
type: String,
|
|
52
|
-
|
|
59
|
+
default: undefined,
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
range: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false,
|
|
53
65
|
},
|
|
54
66
|
|
|
55
67
|
maxDate: {
|
|
@@ -105,19 +117,55 @@ function getYear(year) {
|
|
|
105
117
|
}
|
|
106
118
|
|
|
107
119
|
function getYearClasses(year) {
|
|
120
|
+
const isYearInRange =
|
|
121
|
+
props.range &&
|
|
122
|
+
localSelectedDate.value &&
|
|
123
|
+
props.selectedDateTo &&
|
|
124
|
+
!dateIsOutOfRange(
|
|
125
|
+
year,
|
|
126
|
+
props.selectedDate,
|
|
127
|
+
props.selectedDateTo,
|
|
128
|
+
props.locale,
|
|
129
|
+
props.dateFormat,
|
|
130
|
+
);
|
|
131
|
+
|
|
108
132
|
const isNotSelectedDate =
|
|
109
133
|
(!isSelectedMonth(year) && !isSelectedMonth(year)) || props.selectedDate === null;
|
|
110
134
|
|
|
135
|
+
const isMoreThanOneYearRange =
|
|
136
|
+
props.selectedDateTo &&
|
|
137
|
+
props.selectedDateTo.getFullYear() - props.selectedDate.getFullYear() > 1;
|
|
138
|
+
|
|
139
|
+
const isFirstYear = year.getFullYear() === props.selectedDate.getFullYear();
|
|
140
|
+
const isLastYear =
|
|
141
|
+
props.selectedDateTo && year.getFullYear() === props.selectedDateTo.getFullYear();
|
|
142
|
+
|
|
111
143
|
if (isCurrentYear(year) && isNotSelectedDate) {
|
|
112
|
-
return [currentYearAttrs.value.class];
|
|
144
|
+
return cx([currentYearAttrs.value.class, isYearInRange && props.config.inRangeDate]);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (props.range && isFirstYear && isMoreThanOneYearRange) {
|
|
148
|
+
return cx([props.config.inRangeEdgeDate, props.config.inRangeFirstDate]);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (props.range && isLastYear && isMoreThanOneYearRange) {
|
|
152
|
+
return cx([props.config.inRangeEdgeDate, props.config.inRangeLastDate]);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (props.range && isFirstYear && !isMoreThanOneYearRange) {
|
|
156
|
+
return cx([props.config.inRangeDate, "rounded-dynamic"]);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (isYearInRange) {
|
|
160
|
+
return props.config.inRangeDate;
|
|
113
161
|
}
|
|
114
162
|
|
|
115
163
|
if (isSelectedMonth(year)) {
|
|
116
|
-
return
|
|
164
|
+
return selectedYearAttrs.value.class;
|
|
117
165
|
}
|
|
118
166
|
|
|
119
|
-
if (isSameMonth(props.activeMonth, year)) {
|
|
120
|
-
return
|
|
167
|
+
if (isSameMonth(props.activeMonth, year) && !props.range) {
|
|
168
|
+
return activeYearAttrs.value.class;
|
|
121
169
|
}
|
|
122
170
|
}
|
|
123
171
|
|
|
@@ -17,15 +17,16 @@ export default /*tw*/ {
|
|
|
17
17
|
days: "grid grid-cols-7",
|
|
18
18
|
day: "mx-auto size-8 rounded-dynamic text-sm hover:bg-brand-100 hover:text-brand-600 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
19
19
|
activeDay: "bg-brand-100 hover:bg-brand-100",
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
inRangeDate: "bg-brand-100 text-brand-900 hover:!bg-brand-200 rounded-none",
|
|
21
|
+
inRangeEdgeDate: "rounded-dynamic bg-brand-200 text-brand-900 hover:bg-brand-200",
|
|
22
|
+
inRangeFirstDate: "rounded-r-none",
|
|
23
|
+
inRangeLastDate: "rounded-l-none",
|
|
23
24
|
selectedDay: "bg-brand-600 text-white hover:bg-brand-600 hover:text-white",
|
|
24
25
|
currentDay: "hover:bg-brand-100 border-2 border-brand-600",
|
|
25
26
|
anotherMonthDay: "hover:bg-brand-100 text-gray-400",
|
|
26
27
|
monthView: "grid grid-cols-4 items-center justify-center",
|
|
27
28
|
month: "{UButton} mx-auto flex h-12 w-full rounded-dynamic",
|
|
28
|
-
selectedMonth: "bg-brand-
|
|
29
|
+
selectedMonth: "bg-brand-600 hover:bg-brand-900 text-white",
|
|
29
30
|
activeMonth: "bg-brand-100",
|
|
30
31
|
currentMoth: "border-2 border-brand-900",
|
|
31
32
|
yearView: "grid grid-cols-4 items-center justify-center",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
no-ring
|
|
12
12
|
size="sm"
|
|
13
13
|
variant="thirdary"
|
|
14
|
-
:right-icon="isCurrentView.day
|
|
14
|
+
:right-icon="isCurrentView.day ? config.defaults.viewSwitchIcon : undefined"
|
|
15
15
|
v-bind="viewSwitchButtonAttrs"
|
|
16
16
|
@mousedown.prevent.capture
|
|
17
17
|
@click="onClickViewSwitch"
|
|
@@ -69,6 +69,8 @@
|
|
|
69
69
|
<MonthView
|
|
70
70
|
v-if="isCurrentView.month"
|
|
71
71
|
:selected-date="selectedDate"
|
|
72
|
+
:selected-date-to="selectedDateTo"
|
|
73
|
+
:range="range"
|
|
72
74
|
:active-month="activeMonth"
|
|
73
75
|
:active-date="activeDate"
|
|
74
76
|
:min-date="minDate"
|
|
@@ -82,6 +84,8 @@
|
|
|
82
84
|
<YearView
|
|
83
85
|
v-if="isCurrentView.year"
|
|
84
86
|
:selected-date="selectedDate"
|
|
87
|
+
:selected-date-to="selectedDateTo"
|
|
88
|
+
:range="range"
|
|
85
89
|
:active-month="activeMonth"
|
|
86
90
|
:active-date="activeDate"
|
|
87
91
|
:min-date="minDate"
|
|
@@ -44,20 +44,28 @@ export default /*tw*/ {
|
|
|
44
44
|
periodDateYearList: "grid grid-cols-3 grid-rows-1 gap-0.5",
|
|
45
45
|
periodDateQuarterList: "",
|
|
46
46
|
periodDate: "w-full",
|
|
47
|
+
periodDateInRange: "bg-brand-100 text-brand-900 hover:!bg-brand-200 rounded-none",
|
|
48
|
+
edgePeriodDate: "rounded-dynamic bg-brand-200 text-brand-900 hover:bg-brand-200",
|
|
49
|
+
firstPeriodGridDate: "rounded-r-none",
|
|
50
|
+
lastPeriodGridDate: "rounded-l-none",
|
|
51
|
+
firstPeriodListDate: "rounded-b-none",
|
|
52
|
+
lastPeriodListDate: "rounded-t-none",
|
|
47
53
|
periodDateActive: "bg-gray-100",
|
|
48
|
-
rangeInputWrapper: "flex mt-4 -space-x-px",
|
|
54
|
+
rangeInputWrapper: "flex mt-4 -space-x-px group/range-input-wrapper",
|
|
55
|
+
rangeInputFirst: "group/range-input-first",
|
|
56
|
+
rangeInputLast: "group/range-input-last",
|
|
49
57
|
rangeInput: {
|
|
50
58
|
component: "{UInput}",
|
|
51
59
|
label: {
|
|
52
60
|
component: "{ULabel}",
|
|
53
|
-
wrapper: "
|
|
61
|
+
wrapper: "w-full hover:z-10 focus:z-10",
|
|
54
62
|
description: "hidden",
|
|
55
63
|
},
|
|
56
64
|
block: `
|
|
57
65
|
focus-within:z-10 focus-within:ring-0
|
|
58
|
-
group-
|
|
66
|
+
group-[]/range-input-first:rounded-r-none group-[]/range-input-last:rounded-l-none
|
|
59
67
|
`,
|
|
60
|
-
input: "group-
|
|
68
|
+
input: "group-[]/range-input-first:rounded-r-none group-[]/range-input-last:rounded-l-none",
|
|
61
69
|
},
|
|
62
70
|
inputRangeError: "text-xs font-normal leading-none mt-2 text-center text-red-500",
|
|
63
71
|
calendar: {
|
|
@@ -163,13 +163,13 @@
|
|
|
163
163
|
|
|
164
164
|
<div v-bind="periodDateListAttrs(getPeriodDateListClasses())">
|
|
165
165
|
<UButton
|
|
166
|
-
v-for="date in periodDateList"
|
|
166
|
+
v-for="(date, index) in periodDateList"
|
|
167
167
|
:key="date.title"
|
|
168
168
|
no-ring
|
|
169
169
|
size="sm"
|
|
170
170
|
variant="thirdary"
|
|
171
171
|
:disabled="isDatePeriodOutOfRange(date)"
|
|
172
|
-
v-bind="periodDateAttrs(getPeriodDateClasses(date))"
|
|
172
|
+
v-bind="periodDateAttrs(getPeriodDateClasses(date, index))"
|
|
173
173
|
:label="String(date.title)"
|
|
174
174
|
@click="selectDate(date), toggleMenu()"
|
|
175
175
|
/>
|
|
@@ -183,6 +183,7 @@
|
|
|
183
183
|
:error="inputRangeFromError"
|
|
184
184
|
size="md"
|
|
185
185
|
v-bind="rangeInputAttrs"
|
|
186
|
+
:class="cx([rangeInputAttrs.class, config.rangeInputFirst])"
|
|
186
187
|
:name="rangeInputName"
|
|
187
188
|
@input="onInputRangeInput($event, INPUT_RANGE_TYPE.start)"
|
|
188
189
|
/>
|
|
@@ -193,6 +194,7 @@
|
|
|
193
194
|
:error="inputRangeToError"
|
|
194
195
|
size="md"
|
|
195
196
|
v-bind="rangeInputAttrs"
|
|
197
|
+
:class="cx([rangeInputAttrs.class, config.rangeInputLast])"
|
|
196
198
|
:name="rangeInputName"
|
|
197
199
|
@input="onInputRangeInput($event, INPUT_RANGE_TYPE.end)"
|
|
198
200
|
/>
|
|
@@ -229,7 +231,7 @@ import { LOCALE_TYPE } from "../ui.form-calendar/constants";
|
|
|
229
231
|
|
|
230
232
|
import vClickOutside from "../directive.clickOutside";
|
|
231
233
|
|
|
232
|
-
import { getRandomId, getDefault } from "../service.ui";
|
|
234
|
+
import { getRandomId, getDefault, cx } from "../service.ui";
|
|
233
235
|
|
|
234
236
|
import {
|
|
235
237
|
addDays,
|
|
@@ -811,8 +813,6 @@ function onClickPeriodButton(periodName) {
|
|
|
811
813
|
|
|
812
814
|
period.value = PERIOD.year;
|
|
813
815
|
}
|
|
814
|
-
|
|
815
|
-
selectDate(periodDateList.value.at(0));
|
|
816
816
|
}
|
|
817
817
|
|
|
818
818
|
function onClickOwnRange() {
|
|
@@ -862,7 +862,7 @@ function onClickShiftDatesList(action) {
|
|
|
862
862
|
|
|
863
863
|
if (isPeriod.value.week) {
|
|
864
864
|
activeDate.value = addMonths(activeDate.value, defaultRange);
|
|
865
|
-
periodDateList.value = getWeekDateList(activeDate.value,
|
|
865
|
+
periodDateList.value = getWeekDateList(activeDate.value, locale.value.months.shorthand);
|
|
866
866
|
}
|
|
867
867
|
|
|
868
868
|
if (isPeriod.value.month) {
|
|
@@ -885,7 +885,64 @@ function getPeriodButtonsClasses(periodName) {
|
|
|
885
885
|
return period.value === periodName ? config.value.periodButtonActive : "";
|
|
886
886
|
}
|
|
887
887
|
|
|
888
|
-
function getPeriodDateClasses(date) {
|
|
888
|
+
function getPeriodDateClasses(date, index) {
|
|
889
|
+
const localStart = new Date(localValue.value.from);
|
|
890
|
+
const localEnd = new Date(localValue.value.to);
|
|
891
|
+
const isListType = isPeriod.value.quarter || isPeriod.value.week;
|
|
892
|
+
const firstInRangeClasses = cx([
|
|
893
|
+
config.value.edgePeriodDate,
|
|
894
|
+
isListType ? config.value.firstPeriodListDate : config.value.firstPeriodGridDate,
|
|
895
|
+
]);
|
|
896
|
+
const lastInRangeClasses = cx([
|
|
897
|
+
config.value.edgePeriodDate,
|
|
898
|
+
isListType ? config.value.lastPeriodListDate : config.value.lastPeriodGridDate,
|
|
899
|
+
]);
|
|
900
|
+
|
|
901
|
+
if (isPeriod.value.year) {
|
|
902
|
+
localStart.setMonth(0, 1);
|
|
903
|
+
localEnd.setMonth(11, 31);
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
localStart.setHours(0, 0, 0, 0);
|
|
907
|
+
localEnd.setHours(23, 59, 59, 999);
|
|
908
|
+
|
|
909
|
+
const startDateInRangeIndex = periodDateList.value.findIndex((periodDate) => {
|
|
910
|
+
return localStart <= periodDate.endRange && localStart >= periodDate.startRange;
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
const endDateInRangeIndex = periodDateList.value.findIndex((periodDate) => {
|
|
914
|
+
return localEnd >= periodDate.startRange && localEnd <= periodDate.endRange;
|
|
915
|
+
});
|
|
916
|
+
|
|
917
|
+
let isInRange = index >= startDateInRangeIndex && index <= endDateInRangeIndex;
|
|
918
|
+
|
|
919
|
+
if (!~startDateInRangeIndex || !~endDateInRangeIndex) {
|
|
920
|
+
isInRange =
|
|
921
|
+
(index >= startDateInRangeIndex && startDateInRangeIndex > -1) ||
|
|
922
|
+
(index <= endDateInRangeIndex && endDateInRangeIndex > -1);
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
if (
|
|
926
|
+
!~startDateInRangeIndex &&
|
|
927
|
+
periodDateList.value.at(0).startRange > localStart &&
|
|
928
|
+
!~endDateInRangeIndex &&
|
|
929
|
+
periodDateList.value.at(0).endRange < localEnd
|
|
930
|
+
) {
|
|
931
|
+
isInRange = true;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
const isSingleItem =
|
|
935
|
+
startDateInRangeIndex === endDateInRangeIndex && ~endDateInRangeIndex && ~startDateInRangeIndex;
|
|
936
|
+
|
|
937
|
+
if (isInRange) {
|
|
938
|
+
return cx([
|
|
939
|
+
config.value.periodDateInRange,
|
|
940
|
+
startDateInRangeIndex === index && firstInRangeClasses,
|
|
941
|
+
endDateInRangeIndex === index && lastInRangeClasses,
|
|
942
|
+
isSingleItem && "rounded-dynamic",
|
|
943
|
+
]);
|
|
944
|
+
}
|
|
945
|
+
|
|
889
946
|
return localValue.value.from === date.startRange ? config.value.periodDateActive : "";
|
|
890
947
|
}
|
|
891
948
|
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.321",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -114,6 +114,14 @@
|
|
|
114
114
|
"type": "date|null"
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
|
+
{
|
|
118
|
+
"name": "selectedDateTo",
|
|
119
|
+
"value": {
|
|
120
|
+
"kind": "expression",
|
|
121
|
+
"type": "date|null"
|
|
122
|
+
},
|
|
123
|
+
"default": "undefined"
|
|
124
|
+
},
|
|
117
125
|
{
|
|
118
126
|
"name": "activeDate",
|
|
119
127
|
"required": true,
|
|
@@ -140,11 +148,19 @@
|
|
|
140
148
|
},
|
|
141
149
|
{
|
|
142
150
|
"name": "dateFormat",
|
|
143
|
-
"required": true,
|
|
144
151
|
"value": {
|
|
145
152
|
"kind": "expression",
|
|
146
153
|
"type": "string"
|
|
147
|
-
}
|
|
154
|
+
},
|
|
155
|
+
"default": "undefined"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"name": "range",
|
|
159
|
+
"value": {
|
|
160
|
+
"kind": "expression",
|
|
161
|
+
"type": "boolean"
|
|
162
|
+
},
|
|
163
|
+
"default": "false"
|
|
148
164
|
},
|
|
149
165
|
{
|
|
150
166
|
"name": "maxDate",
|
|
@@ -8791,6 +8807,14 @@
|
|
|
8791
8807
|
"type": "date|null"
|
|
8792
8808
|
}
|
|
8793
8809
|
},
|
|
8810
|
+
{
|
|
8811
|
+
"name": "selectedDateTo",
|
|
8812
|
+
"value": {
|
|
8813
|
+
"kind": "expression",
|
|
8814
|
+
"type": "date|null"
|
|
8815
|
+
},
|
|
8816
|
+
"default": "undefined"
|
|
8817
|
+
},
|
|
8794
8818
|
{
|
|
8795
8819
|
"name": "activeDate",
|
|
8796
8820
|
"required": true,
|
|
@@ -8817,11 +8841,19 @@
|
|
|
8817
8841
|
},
|
|
8818
8842
|
{
|
|
8819
8843
|
"name": "dateFormat",
|
|
8820
|
-
"required": true,
|
|
8821
8844
|
"value": {
|
|
8822
8845
|
"kind": "expression",
|
|
8823
8846
|
"type": "string"
|
|
8824
|
-
}
|
|
8847
|
+
},
|
|
8848
|
+
"default": "undefined"
|
|
8849
|
+
},
|
|
8850
|
+
{
|
|
8851
|
+
"name": "range",
|
|
8852
|
+
"value": {
|
|
8853
|
+
"kind": "expression",
|
|
8854
|
+
"type": "boolean"
|
|
8855
|
+
},
|
|
8856
|
+
"default": "false"
|
|
8825
8857
|
},
|
|
8826
8858
|
{
|
|
8827
8859
|
"name": "maxDate",
|