vueless 0.0.215 → 0.0.217
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/MonthView.vue +13 -5
- package/ui.form-calendar/components/YearView.vue +13 -5
- package/ui.form-calendar/configs/default.config.js +2 -0
- package/ui.form-calendar/services/date.service.js +8 -0
- package/ui.text-block/index.stories.js +30 -28
- package/web-types.json +1 -1
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<script setup>
|
|
18
18
|
import { computed } from "vue";
|
|
19
19
|
import { formatDate, dateIsOutOfRange } from "../services/calendar.service";
|
|
20
|
-
import { isSameMonth, getDateWithoutTime } from "../services/date.service";
|
|
20
|
+
import { isSameMonth, getDateWithoutTime, isCurrentMoth } from "../services/date.service";
|
|
21
21
|
|
|
22
22
|
import useAttrs from "../composables/attrs.composable";
|
|
23
23
|
|
|
@@ -69,7 +69,8 @@ const props = defineProps({
|
|
|
69
69
|
|
|
70
70
|
const emit = defineEmits(["input"]);
|
|
71
71
|
|
|
72
|
-
const { monthViewAttrs, selectedMonthAttrs, activeMonthAttrs, monthAttrs } =
|
|
72
|
+
const { monthViewAttrs, selectedMonthAttrs, activeMonthAttrs, monthAttrs, currentMothAttrs } =
|
|
73
|
+
useAttrs(props);
|
|
73
74
|
|
|
74
75
|
const localSelectedDate = computed(() => {
|
|
75
76
|
return props.selectedDate === null ? getDateWithoutTime() : props.selectedDate;
|
|
@@ -98,12 +99,19 @@ function getMonth(monthNumber) {
|
|
|
98
99
|
return newDate;
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
function getMonthClasses(
|
|
102
|
-
|
|
102
|
+
function getMonthClasses(month) {
|
|
103
|
+
const isNotSelectedDate =
|
|
104
|
+
(!isSelectedMonth(month) && !isSelectedMonth(month)) || props.selectedDate === null;
|
|
105
|
+
|
|
106
|
+
if (isCurrentMoth(month) && isNotSelectedDate) {
|
|
107
|
+
return [currentMothAttrs.value.class];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (isSelectedMonth(month)) {
|
|
103
111
|
return [selectedMonthAttrs.value.class];
|
|
104
112
|
}
|
|
105
113
|
|
|
106
|
-
if (isSameMonth(props.activeMonth,
|
|
114
|
+
if (isSameMonth(props.activeMonth, month)) {
|
|
107
115
|
return [activeMonthAttrs.value.class];
|
|
108
116
|
}
|
|
109
117
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<script setup>
|
|
18
18
|
import { computed } from "vue";
|
|
19
19
|
import { formatDate, getYearsRange, dateIsOutOfRange } from "../services/calendar.service";
|
|
20
|
-
import { isSameMonth, getDateWithoutTime } from "../services/date.service";
|
|
20
|
+
import { isSameMonth, getDateWithoutTime, isCurrentYear } from "../services/date.service";
|
|
21
21
|
|
|
22
22
|
import useAttrs from "../composables/attrs.composable";
|
|
23
23
|
|
|
@@ -69,7 +69,8 @@ const props = defineProps({
|
|
|
69
69
|
|
|
70
70
|
const emit = defineEmits(["input"]);
|
|
71
71
|
|
|
72
|
-
const { yearViewAttrs, selectedYearAttrs, activeYearAttrs, yearAttrs } =
|
|
72
|
+
const { yearViewAttrs, selectedYearAttrs, activeYearAttrs, yearAttrs, currentYearAttrs } =
|
|
73
|
+
useAttrs(props);
|
|
73
74
|
|
|
74
75
|
const localSelectedDate = computed(() => {
|
|
75
76
|
return props.selectedDate === null ? getDateWithoutTime() : props.selectedDate;
|
|
@@ -102,12 +103,19 @@ function getYear(year) {
|
|
|
102
103
|
return newDate;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
function getYearClasses(
|
|
106
|
-
|
|
106
|
+
function getYearClasses(year) {
|
|
107
|
+
const isNotSelectedDate =
|
|
108
|
+
(!isSelectedMonth(year) && !isSelectedMonth(year)) || props.selectedDate === null;
|
|
109
|
+
|
|
110
|
+
if (isCurrentYear(year) && isNotSelectedDate) {
|
|
111
|
+
return [currentYearAttrs.value.class];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (isSelectedMonth(year)) {
|
|
107
115
|
return [selectedYearAttrs.value.class];
|
|
108
116
|
}
|
|
109
117
|
|
|
110
|
-
if (isSameMonth(props.activeMonth,
|
|
118
|
+
if (isSameMonth(props.activeMonth, year)) {
|
|
111
119
|
return [activeYearAttrs.value.class];
|
|
112
120
|
}
|
|
113
121
|
}
|
|
@@ -35,8 +35,10 @@ export default /*tw*/ {
|
|
|
35
35
|
month: "{UButton} mx-auto flex h-12 w-full rounded-lg hover:!bg-brand-900 hover:text-white",
|
|
36
36
|
selectedMonth: "bg-brand-900 hover:bg-brand-900 text-white",
|
|
37
37
|
activeMonth: "bg-brand-100",
|
|
38
|
+
currentMoth: "border-2 border-brand-900",
|
|
38
39
|
yearView: "grid grid-cols-4 items-center justify-center",
|
|
39
40
|
year: "{UButton} mx-auto flex h-12 w-full rounded-lg hover:!bg-brand-900 hover:text-white",
|
|
41
|
+
currentYear: "border-2 border-brand-900",
|
|
40
42
|
selectedYear: "bg-brand-900 hover:bg-brand-900 text-white",
|
|
41
43
|
activeYear: "bg-brand-100",
|
|
42
44
|
timepicker: "mt-2 pl-1 pt-3 text-sm flex items-center justify-between gap-2 border-t border-brand-200",
|
|
@@ -255,6 +255,14 @@ export function isToday(date) {
|
|
|
255
255
|
return isSameDay(date, new Date());
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
+
export function isCurrentMoth(date) {
|
|
259
|
+
return isSameMonth(date, new Date());
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export function isCurrentYear(date) {
|
|
263
|
+
return date.getFullYear() === new Date().getFullYear();
|
|
264
|
+
}
|
|
265
|
+
|
|
258
266
|
export function getLastDayOfMonth(date) {
|
|
259
267
|
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
260
268
|
}
|
|
@@ -19,8 +19,8 @@ export default {
|
|
|
19
19
|
const defaultTemplate = `
|
|
20
20
|
<template #default>
|
|
21
21
|
<p>
|
|
22
|
-
<b>
|
|
23
|
-
|
|
22
|
+
<b>To proceed with your registration</b>, please enter your
|
|
23
|
+
<u>email address</u> in the field below. <i>A verification link</i> will be sent to your inbox shortly.
|
|
24
24
|
<a href="https://uk.wikipedia.org/wiki/Lorem_ipsum" target="_blank">Wikipedia</a>
|
|
25
25
|
</p>
|
|
26
26
|
</template>
|
|
@@ -73,43 +73,45 @@ paragraphs.args = {
|
|
|
73
73
|
slotTemplate: `
|
|
74
74
|
<template #default>
|
|
75
75
|
<p>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
culpa qui officia deserunt mollit anim id est laborum.
|
|
76
|
+
In a world where technology evolves at an unprecedented pace, staying
|
|
77
|
+
updated with the latest advancements is crucial for success. Companies
|
|
78
|
+
that adapt quickly to new trends often find themselves at the forefront
|
|
79
|
+
of their industries, leading to increased innovation and productivity.
|
|
80
|
+
However, it's not just about adopting new tools but also about integrating
|
|
81
|
+
them seamlessly into existing workflows to maximize their potential.
|
|
83
82
|
</p>
|
|
84
83
|
|
|
85
84
|
<p>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
Employees must be encouraged to continuously learn and develop new skills,
|
|
86
|
+
ensuring they can leverage these technological advancements effectively.
|
|
87
|
+
This not only enhances their professional growth but also contributes to
|
|
88
|
+
the overall success of the organization. By fostering a culture of
|
|
89
|
+
continuous improvement, businesses can navigate the challenges of a
|
|
90
|
+
rapidly changing landscape and emerge stronger and more competitive.
|
|
91
91
|
</p>
|
|
92
92
|
</template>
|
|
93
|
+
|
|
93
94
|
`,
|
|
94
95
|
};
|
|
95
96
|
|
|
96
97
|
export const list = DefaultTemplate.bind({});
|
|
97
98
|
list.args = {
|
|
98
99
|
slotTemplate: `
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
<template #default>
|
|
101
|
+
<URow gap="2xl">
|
|
102
|
+
<ul>
|
|
103
|
+
<li>Ensure your password is strong</li>
|
|
104
|
+
<li>Update your profile information</li>
|
|
105
|
+
<li>Check your email for updates</li>
|
|
106
|
+
</ul>
|
|
106
107
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
|
|
109
|
+
<ol>
|
|
110
|
+
<li>Create an account by signing up</li>
|
|
111
|
+
<li>Verify your email address</li>
|
|
112
|
+
<li>Log in to access your dashboard</li>
|
|
113
|
+
</ol>
|
|
114
|
+
</URow>
|
|
115
|
+
</template>
|
|
114
116
|
`,
|
|
115
117
|
};
|