@bagelink/vue 0.0.1218 → 0.0.1220
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/Calendar/Index.vue.d.ts +510 -0
- package/dist/components/Calendar/Index.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/header/Header.vue.d.ts +117 -0
- package/dist/components/Calendar/components/header/Header.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/month/AgendaEventTile.vue.d.ts +37 -0
- package/dist/components/Calendar/components/month/AgendaEventTile.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/month/AgendaEvents.vue.d.ts +37 -0
- package/dist/components/Calendar/components/month/AgendaEvents.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/month/Day.vue.d.ts +84 -0
- package/dist/components/Calendar/components/month/Day.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/month/Event.vue.d.ts +69 -0
- package/dist/components/Calendar/components/month/Event.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/month/Month.vue.d.ts +134 -0
- package/dist/components/Calendar/components/month/Month.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/month/WeekDay.vue.d.ts +7 -0
- package/dist/components/Calendar/components/month/WeekDay.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/partials/EventFlyout.vue.d.ts +122 -0
- package/dist/components/Calendar/components/partials/EventFlyout.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/week/Day.vue.d.ts +152 -0
- package/dist/components/Calendar/components/week/Day.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/week/DayEvent.vue.d.ts +136 -0
- package/dist/components/Calendar/components/week/DayEvent.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/week/DayTimeline.vue.d.ts +23 -0
- package/dist/components/Calendar/components/week/DayTimeline.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/week/FullDayEvent.vue.d.ts +42 -0
- package/dist/components/Calendar/components/week/FullDayEvent.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/week/Week.vue.d.ts +196 -0
- package/dist/components/Calendar/components/week/Week.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/week/WeekTimeline.vue.d.ts +21 -0
- package/dist/components/Calendar/components/week/WeekTimeline.vue.d.ts.map +1 -0
- package/dist/components/Calendar/constants.d.ts +13 -0
- package/dist/components/Calendar/constants.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/DayIntervals.d.ts +17 -0
- package/dist/components/Calendar/helpers/DayIntervals.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/EDate.d.ts +10 -0
- package/dist/components/Calendar/helpers/EDate.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/Errors.d.ts +18 -0
- package/dist/components/Calendar/helpers/Errors.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/EventChange.d.ts +19 -0
- package/dist/components/Calendar/helpers/EventChange.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/EventConcurrency.d.ts +12 -0
- package/dist/components/Calendar/helpers/EventConcurrency.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/EventFlyoutPosition.d.ts +14 -0
- package/dist/components/Calendar/helpers/EventFlyoutPosition.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/EventPosition.d.ts +11 -0
- package/dist/components/Calendar/helpers/EventPosition.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/EventsFilter.d.ts +11 -0
- package/dist/components/Calendar/helpers/EventsFilter.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/Helpers.d.ts +19 -0
- package/dist/components/Calendar/helpers/Helpers.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/Time.d.ts +118 -0
- package/dist/components/Calendar/helpers/Time.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/Week.d.ts +10 -0
- package/dist/components/Calendar/helpers/Week.d.ts.map +1 -0
- package/dist/components/Calendar/index.d.ts +4 -0
- package/dist/components/Calendar/index.d.ts.map +1 -0
- package/dist/components/Calendar/language/index.d.ts +6 -0
- package/dist/components/Calendar/language/index.d.ts.map +1 -0
- package/dist/components/Calendar/language/keys.d.ts +90 -0
- package/dist/components/Calendar/language/keys.d.ts.map +1 -0
- package/dist/components/Calendar/models/Event.d.ts +50 -0
- package/dist/components/Calendar/models/Event.d.ts.map +1 -0
- package/dist/components/Calendar/typings/config.interface.d.ts +77 -0
- package/dist/components/Calendar/typings/config.interface.d.ts.map +1 -0
- package/dist/components/Calendar/typings/interfaces/day.interface.d.ts +10 -0
- package/dist/components/Calendar/typings/interfaces/day.interface.d.ts.map +1 -0
- package/dist/components/Calendar/typings/interfaces/event.interface.d.ts +32 -0
- package/dist/components/Calendar/typings/interfaces/event.interface.d.ts.map +1 -0
- package/dist/components/Calendar/typings/interfaces/full-day-events-week.type.d.ts +7 -0
- package/dist/components/Calendar/typings/interfaces/full-day-events-week.type.d.ts.map +1 -0
- package/dist/components/Calendar/typings/interfaces/period.interface.d.ts +6 -0
- package/dist/components/Calendar/typings/interfaces/period.interface.d.ts.map +1 -0
- package/dist/components/Calendar/typings/interfaces/time-modes.d.ts +6 -0
- package/dist/components/Calendar/typings/interfaces/time-modes.d.ts.map +1 -0
- package/dist/components/Calendar/typings/types.d.ts +21 -0
- package/dist/components/Calendar/typings/types.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePick.vue.d.ts +8 -0
- package/dist/components/form/inputs/DatePick.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/NumberInput.vue.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/directives/index.d.ts +2 -0
- package/dist/directives/index.d.ts.map +1 -1
- package/dist/directives/vResize.d.ts +18 -0
- package/dist/directives/vResize.d.ts.map +1 -0
- package/dist/index.cjs +3583 -111
- package/dist/index.mjs +3584 -112
- package/dist/style.css +843 -77
- package/package.json +2 -1
- package/src/components/Calendar/Index.vue +420 -0
- package/src/components/Calendar/assets/base.css +60 -0
- package/src/components/Calendar/components/header/Header.vue +274 -0
- package/src/components/Calendar/components/month/AgendaEventTile.vue +137 -0
- package/src/components/Calendar/components/month/AgendaEvents.vue +107 -0
- package/src/components/Calendar/components/month/Day.vue +271 -0
- package/src/components/Calendar/components/month/Event.vue +221 -0
- package/src/components/Calendar/components/month/Month.vue +278 -0
- package/src/components/Calendar/components/month/WeekDay.vue +25 -0
- package/src/components/Calendar/components/partials/EventFlyout.vue +429 -0
- package/src/components/Calendar/components/week/Day.vue +212 -0
- package/src/components/Calendar/components/week/DayEvent.vue +585 -0
- package/src/components/Calendar/components/week/DayTimeline.vue +86 -0
- package/src/components/Calendar/components/week/FullDayEvent.vue +121 -0
- package/src/components/Calendar/components/week/Week.vue +414 -0
- package/src/components/Calendar/components/week/WeekTimeline.vue +126 -0
- package/src/components/Calendar/constants.ts +13 -0
- package/src/components/Calendar/env.d.ts +8 -0
- package/src/components/Calendar/helpers/DayIntervals.ts +48 -0
- package/src/components/Calendar/helpers/EDate.ts +18 -0
- package/src/components/Calendar/helpers/Errors.ts +69 -0
- package/src/components/Calendar/helpers/EventChange.ts +88 -0
- package/src/components/Calendar/helpers/EventConcurrency.ts +69 -0
- package/src/components/Calendar/helpers/EventFlyoutPosition.ts +96 -0
- package/src/components/Calendar/helpers/EventPosition.ts +154 -0
- package/src/components/Calendar/helpers/EventsFilter.ts +50 -0
- package/src/components/Calendar/helpers/Helpers.ts +86 -0
- package/src/components/Calendar/helpers/Time.ts +588 -0
- package/src/components/Calendar/helpers/Week.ts +37 -0
- package/src/components/Calendar/index.ts +4 -0
- package/src/components/Calendar/language/index.ts +37 -0
- package/src/components/Calendar/language/keys.ts +90 -0
- package/src/components/Calendar/models/Event.ts +112 -0
- package/src/components/Calendar/styles/_mixins.css +21 -0
- package/src/components/Calendar/styles/_variables.css +51 -0
- package/src/components/Calendar/typings/config.interface.ts +87 -0
- package/src/components/Calendar/typings/interfaces/day.interface.ts +10 -0
- package/src/components/Calendar/typings/interfaces/event.interface.ts +32 -0
- package/src/components/Calendar/typings/interfaces/full-day-events-week.type.ts +8 -0
- package/src/components/Calendar/typings/interfaces/period.interface.ts +5 -0
- package/src/components/Calendar/typings/interfaces/time-modes.ts +9 -0
- package/src/components/Calendar/typings/types.ts +23 -0
- package/src/components/DataTable/DataTable.vue +4 -0
- package/src/components/form/inputs/DatePick.vue +189 -152
- package/src/components/form/inputs/NumberInput.vue +1 -3
- package/src/components/index.ts +3 -6
- package/src/directives/index.ts +2 -0
- package/src/directives/vResize.ts +205 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { modeType } from '../../Calendar/typings/types'
|
|
3
|
+
import { Btn, NumberInput, Dropdown } from '@bagelink/vue'
|
|
4
|
+
import Time, { WEEK_START_DAY } from '../../Calendar/helpers/Time'
|
|
4
5
|
|
|
5
6
|
const props = withDefaults(
|
|
6
7
|
defineProps<{
|
|
@@ -13,12 +14,18 @@ const props = withDefaults(
|
|
|
13
14
|
min?: string | Date
|
|
14
15
|
max?: string | Date
|
|
15
16
|
timezone?: string
|
|
17
|
+
mode?: modeType
|
|
18
|
+
firstDayOfWeek?: WEEK_START_DAY
|
|
19
|
+
locale?: string
|
|
16
20
|
}>(),
|
|
17
21
|
{
|
|
18
22
|
enableTime: false,
|
|
19
23
|
editMode: true,
|
|
20
24
|
small: false,
|
|
21
|
-
timezone: 'UTC'
|
|
25
|
+
timezone: 'UTC',
|
|
26
|
+
mode: 'day',
|
|
27
|
+
firstDayOfWeek: WEEK_START_DAY.MONDAY,
|
|
28
|
+
locale: ''
|
|
22
29
|
},
|
|
23
30
|
)
|
|
24
31
|
|
|
@@ -28,7 +35,30 @@ let currentMonth = $ref(new Date())
|
|
|
28
35
|
type ViewMode = 'days' | 'months' | 'years'
|
|
29
36
|
let currentView = $ref<ViewMode>('days')
|
|
30
37
|
|
|
31
|
-
const
|
|
38
|
+
const time = new Time(props.firstDayOfWeek, props.locale)
|
|
39
|
+
|
|
40
|
+
function formatDisplayDate(date: Date | string | undefined): string {
|
|
41
|
+
if (!date) return ''
|
|
42
|
+
const dateObj = typeof date === 'string' ? new Date(date) : date
|
|
43
|
+
|
|
44
|
+
if (props.enableTime) {
|
|
45
|
+
return dateObj.toLocaleString(props.locale || undefined, {
|
|
46
|
+
year: 'numeric',
|
|
47
|
+
month: 'short',
|
|
48
|
+
day: 'numeric',
|
|
49
|
+
hour: '2-digit',
|
|
50
|
+
minute: '2-digit',
|
|
51
|
+
timeZone: props.timezone
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return dateObj.toLocaleString(props.locale || undefined, {
|
|
56
|
+
year: 'numeric',
|
|
57
|
+
month: 'short',
|
|
58
|
+
day: 'numeric',
|
|
59
|
+
timeZone: props.timezone
|
|
60
|
+
})
|
|
61
|
+
}
|
|
32
62
|
|
|
33
63
|
function formatDate(date: Date | string | undefined): string {
|
|
34
64
|
if (!date) return ''
|
|
@@ -36,7 +66,7 @@ function formatDate(date: Date | string | undefined): string {
|
|
|
36
66
|
return props.enableTime ? dateObj.toISOString().slice(0, 16) : dateObj.toISOString().split('T')[0]
|
|
37
67
|
}
|
|
38
68
|
|
|
39
|
-
const
|
|
69
|
+
const formattedDisplayValue = $computed(() => formatDisplayDate(props.modelValue))
|
|
40
70
|
const formattedMin = $computed(() => formatDate(props.min))
|
|
41
71
|
const formattedMax = $computed(() => formatDate(props.max))
|
|
42
72
|
|
|
@@ -48,34 +78,26 @@ const selectedDate = $computed(() => {
|
|
|
48
78
|
const currentMonthDays = $computed(() => {
|
|
49
79
|
const year = currentMonth.getFullYear()
|
|
50
80
|
const month = currentMonth.getMonth()
|
|
51
|
-
|
|
52
|
-
const lastDay = new Date(year, month + 1, 0)
|
|
53
|
-
const days = []
|
|
54
|
-
|
|
55
|
-
for (let i = 0; i < firstDay.getDay(); i++) days.push(null)
|
|
56
|
-
for (let i = 1; i <= lastDay.getDate(); i++) days.push(new Date(year, month, i))
|
|
57
|
-
|
|
58
|
-
return days
|
|
81
|
+
return time.getCalendarMonthSplitInWeeks(year, month).flat()
|
|
59
82
|
})
|
|
60
83
|
|
|
61
84
|
const currentMonthValue = $computed(() => ({
|
|
62
85
|
month: currentMonth.getMonth(),
|
|
63
86
|
year: currentMonth.getFullYear(),
|
|
64
87
|
formatted: {
|
|
65
|
-
month:
|
|
66
|
-
year: currentMonth.
|
|
88
|
+
month: time.getLocalizedNameOfMonth(currentMonth, 'long'),
|
|
89
|
+
year: time.getLocalizedDateString(currentMonth).split('/').pop() // Get just the year part
|
|
67
90
|
}
|
|
68
91
|
}))
|
|
69
92
|
|
|
70
93
|
const months = $computed(() => Array.from({ length: 12 }, (_, i) => {
|
|
71
94
|
const date = new Date(currentMonthValue.year, i, 1)
|
|
72
95
|
return {
|
|
73
|
-
name:
|
|
96
|
+
name: time.getLocalizedNameOfMonth(date, 'short'),
|
|
74
97
|
value: i,
|
|
75
98
|
disabled: isDateDisabled(date)
|
|
76
99
|
}
|
|
77
|
-
})
|
|
78
|
-
)
|
|
100
|
+
}))
|
|
79
101
|
|
|
80
102
|
const years = $computed(() => {
|
|
81
103
|
const startYear = currentMonthValue.year - 10
|
|
@@ -85,6 +107,16 @@ const years = $computed(() => {
|
|
|
85
107
|
}))
|
|
86
108
|
})
|
|
87
109
|
|
|
110
|
+
const weekDays = $computed(() => {
|
|
111
|
+
const weekStart = new Date()
|
|
112
|
+
weekStart.setDate(weekStart.getDate() - weekStart.getDay() + (props.firstDayOfWeek === WEEK_START_DAY.MONDAY ? 1 : 0))
|
|
113
|
+
return Array.from({ length: 7 }, (_, i) => {
|
|
114
|
+
const day = new Date(weekStart)
|
|
115
|
+
day.setDate(weekStart.getDate() + i)
|
|
116
|
+
return time.getLocalizedNameOfWeekday(day, 'short')
|
|
117
|
+
})
|
|
118
|
+
})
|
|
119
|
+
|
|
88
120
|
function isDateDisabled(date: Date | null) {
|
|
89
121
|
if (!date) return true
|
|
90
122
|
const minDate = props.min ? new Date(props.min) : null
|
|
@@ -144,11 +176,10 @@ function selectDate(date: Date | null) {
|
|
|
144
176
|
const currentMinutes = selectedDate?.getMinutes() ?? new Date().getMinutes()
|
|
145
177
|
newDate.setHours(currentHours)
|
|
146
178
|
newDate.setMinutes(currentMinutes)
|
|
147
|
-
emit('update:modelValue', newDate.toISOString())
|
|
148
179
|
} else {
|
|
149
|
-
emit('update:modelValue', newDate.toISOString().split('T')[0])
|
|
150
180
|
isOpen = false
|
|
151
181
|
}
|
|
182
|
+
emit('update:modelValue', newDate)
|
|
152
183
|
}
|
|
153
184
|
|
|
154
185
|
function handleInput(event: Event) {
|
|
@@ -186,7 +217,7 @@ function isSelected(date: Date | null) {
|
|
|
186
217
|
|
|
187
218
|
function isToday(date: Date | null) {
|
|
188
219
|
if (!date) return false
|
|
189
|
-
return
|
|
220
|
+
return time.dateIsToday(date)
|
|
190
221
|
}
|
|
191
222
|
|
|
192
223
|
const timezoneDisplay = $computed(() => {
|
|
@@ -200,6 +231,10 @@ const timezoneDisplay = $computed(() => {
|
|
|
200
231
|
return 'UTC'
|
|
201
232
|
}
|
|
202
233
|
})
|
|
234
|
+
|
|
235
|
+
function isNotInMonth(date: Date) {
|
|
236
|
+
return time.isTrailingOrLeadingDate(date, currentMonth.getMonth())
|
|
237
|
+
}
|
|
203
238
|
</script>
|
|
204
239
|
|
|
205
240
|
<template>
|
|
@@ -209,153 +244,151 @@ const timezoneDisplay = $computed(() => {
|
|
|
209
244
|
<span v-if="required" class="required">*</span>
|
|
210
245
|
</label>
|
|
211
246
|
|
|
212
|
-
<
|
|
247
|
+
<Dropdown
|
|
213
248
|
:shown="isOpen"
|
|
214
|
-
:triggers="[]"
|
|
215
249
|
placement="bottom-start"
|
|
216
|
-
:distance="4"
|
|
217
250
|
@apply-show="isOpen = true"
|
|
218
251
|
@apply-hide="isOpen = false"
|
|
219
252
|
>
|
|
220
|
-
<
|
|
221
|
-
<
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
<div
|
|
236
|
-
class="
|
|
237
|
-
flex gap-075 p-05 m_flex-wrap calendar-container justify-content-center h-100p"
|
|
238
|
-
>
|
|
239
|
-
<div class="calendar-section border-end m_border-none pe-05 m_p-0">
|
|
240
|
-
<div class="flex space-between pb-1">
|
|
241
|
-
<template v-if="currentView === 'days'">
|
|
242
|
-
<Btn flat icon="chevron_left" @click="previousMonth" />
|
|
243
|
-
<div class="flex gap-05">
|
|
244
|
-
<Btn flat class="month-btn" @click="currentView = 'months'">
|
|
245
|
-
{{ currentMonthValue.formatted.month }}
|
|
246
|
-
</Btn>
|
|
247
|
-
<Btn flat class="year-btn" @click="currentView = 'years'">
|
|
248
|
-
{{ currentMonthValue.formatted.year }}
|
|
249
|
-
</Btn>
|
|
250
|
-
</div>
|
|
251
|
-
<Btn flat icon="chevron_right" @click="nextMonth" />
|
|
252
|
-
</template>
|
|
253
|
-
<template v-else>
|
|
254
|
-
<Btn flat icon="chevron_left" @click="previousYear" />
|
|
255
|
-
<span class="month-year">{{ currentMonthValue.formatted.year }}</span>
|
|
256
|
-
<Btn flat icon="chevron_right" @click="nextYear" />
|
|
257
|
-
</template>
|
|
258
|
-
</div>
|
|
253
|
+
<template #trigger>
|
|
254
|
+
<div class="date-picker-container">
|
|
255
|
+
<input
|
|
256
|
+
type="text"
|
|
257
|
+
:value="formattedDisplayValue"
|
|
258
|
+
:min="formattedMin"
|
|
259
|
+
:max="formattedMax"
|
|
260
|
+
:required="required"
|
|
261
|
+
:disabled="!editMode"
|
|
262
|
+
class="date-input"
|
|
263
|
+
readonly
|
|
264
|
+
@click="isOpen = true"
|
|
265
|
+
>
|
|
266
|
+
</div>
|
|
267
|
+
</template>
|
|
259
268
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
269
|
+
<div class="flex gap-075 p-05 m_flex-wrap calendar-container justify-content-center h-100p">
|
|
270
|
+
<div class="calendar-section m_border-none pe-05 m_p-0">
|
|
271
|
+
<div class="flex space-between pb-1">
|
|
272
|
+
<template v-if="currentView === 'days'">
|
|
273
|
+
<Btn flat icon="chevron_left" @click="previousMonth" />
|
|
274
|
+
<div class="flex gap-05">
|
|
275
|
+
<Btn flat class="month-btn" @click="currentView = 'months'">
|
|
276
|
+
{{ currentMonthValue.formatted.month }}
|
|
277
|
+
</Btn>
|
|
278
|
+
<Btn flat class="year-btn" @click="currentView = 'years'">
|
|
279
|
+
{{ currentMonthValue.formatted.year }}
|
|
280
|
+
</Btn>
|
|
266
281
|
</div>
|
|
282
|
+
<Btn flat icon="chevron_right" @click="nextMonth" />
|
|
283
|
+
</template>
|
|
284
|
+
<template v-else>
|
|
285
|
+
<Btn flat icon="chevron_left" @click="previousYear" />
|
|
286
|
+
<span class="month-year">{{ currentMonthValue.formatted.year }}</span>
|
|
287
|
+
<Btn flat icon="chevron_right" @click="nextYear" />
|
|
288
|
+
</template>
|
|
289
|
+
</div>
|
|
267
290
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
today: isToday(date),
|
|
276
|
-
disabled: isDateDisabled(date),
|
|
277
|
-
}"
|
|
278
|
-
:disabled="isDateDisabled(date)"
|
|
279
|
-
@click="selectDate(date)"
|
|
280
|
-
>
|
|
281
|
-
{{ date?.getDate() }}
|
|
282
|
-
</button>
|
|
291
|
+
<div v-if="currentView === 'days'" class="calendar-grid grid gap-025">
|
|
292
|
+
<div
|
|
293
|
+
v-for="day in weekDays"
|
|
294
|
+
:key="day"
|
|
295
|
+
class="txt-center txt-12 opacity-6"
|
|
296
|
+
>
|
|
297
|
+
{{ day }}
|
|
283
298
|
</div>
|
|
284
299
|
|
|
285
|
-
<
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
:
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
+
<button
|
|
301
|
+
v-for="date in currentMonthDays"
|
|
302
|
+
:key="date?.toISOString()"
|
|
303
|
+
type="button"
|
|
304
|
+
class="day aspect-ratio-1 flex align-items-center justify-content-center pointer round txt14 p-0"
|
|
305
|
+
:class="{
|
|
306
|
+
'selected': isSelected(date),
|
|
307
|
+
'today': isToday(date),
|
|
308
|
+
'disabled': isDateDisabled(date),
|
|
309
|
+
'not-in-month': isNotInMonth(date),
|
|
310
|
+
}"
|
|
311
|
+
:disabled="isDateDisabled(date)"
|
|
312
|
+
@click="selectDate(date)"
|
|
313
|
+
>
|
|
314
|
+
{{ date?.getDate() }}
|
|
315
|
+
</button>
|
|
316
|
+
</div>
|
|
300
317
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
</div>
|
|
318
|
+
<div v-else-if="currentView === 'months'" class="month-grid grid gap-05 p-05">
|
|
319
|
+
<button
|
|
320
|
+
v-for="month in months"
|
|
321
|
+
:key="month.value"
|
|
322
|
+
class="month-item flex align-items-center justify-content-center pointer rounded p-05 txt14 border-none"
|
|
323
|
+
:class="{
|
|
324
|
+
selected: month.value === currentMonthValue.month,
|
|
325
|
+
disabled: month.disabled,
|
|
326
|
+
}"
|
|
327
|
+
:disabled="month.disabled"
|
|
328
|
+
@click="selectMonth(month.value)"
|
|
329
|
+
>
|
|
330
|
+
{{ month.name }}
|
|
331
|
+
</button>
|
|
316
332
|
</div>
|
|
317
333
|
|
|
318
|
-
<div v-
|
|
319
|
-
<
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
:
|
|
325
|
-
:
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
</p>
|
|
333
|
-
<NumberInput
|
|
334
|
-
center
|
|
335
|
-
:model-value="minutes"
|
|
336
|
-
:disabled="!selectedDate"
|
|
337
|
-
:min="0"
|
|
338
|
-
:max="59"
|
|
339
|
-
:padZero="2"
|
|
340
|
-
layout="vertical"
|
|
341
|
-
@update:model-value="handleMinuteInput"
|
|
342
|
-
/>
|
|
343
|
-
</div>
|
|
344
|
-
<span class="txt-center opacity-6 txt14">{{ timezoneDisplay }}</span>
|
|
345
|
-
<Btn v-if="selectedDate" flat @click="isOpen = false">
|
|
346
|
-
Done
|
|
347
|
-
</Btn>
|
|
334
|
+
<div v-else class="year-grid grid gap-05 p-0">
|
|
335
|
+
<button
|
|
336
|
+
v-for="year in years"
|
|
337
|
+
:key="year.value"
|
|
338
|
+
class="year-item flex align-items-center justify-content-center pointer rounded p-05 txt14 border-none"
|
|
339
|
+
:class="{
|
|
340
|
+
selected: year.value === currentMonthValue.year,
|
|
341
|
+
disabled: year.disabled,
|
|
342
|
+
}"
|
|
343
|
+
:disabled="year.disabled"
|
|
344
|
+
@click="selectYear(year.value)"
|
|
345
|
+
>
|
|
346
|
+
{{ year.value }}
|
|
347
|
+
</button>
|
|
348
348
|
</div>
|
|
349
349
|
</div>
|
|
350
|
-
|
|
351
|
-
|
|
350
|
+
|
|
351
|
+
<div v-if="enableTime && currentView === 'days'" class="time-picker border-start flex column gap-1 w-120px">
|
|
352
|
+
<div class="flex gap-025">
|
|
353
|
+
<NumberInput
|
|
354
|
+
center
|
|
355
|
+
:model-value="hours"
|
|
356
|
+
:disabled="!selectedDate"
|
|
357
|
+
:min="0"
|
|
358
|
+
:max="23"
|
|
359
|
+
layout="vertical"
|
|
360
|
+
:padZero="2"
|
|
361
|
+
@update:model-value="handleHourInput"
|
|
362
|
+
/>
|
|
363
|
+
<p class="pb-075">
|
|
364
|
+
:
|
|
365
|
+
</p>
|
|
366
|
+
<NumberInput
|
|
367
|
+
center
|
|
368
|
+
:model-value="minutes"
|
|
369
|
+
:disabled="!selectedDate"
|
|
370
|
+
:min="0"
|
|
371
|
+
:max="59"
|
|
372
|
+
:padZero="2"
|
|
373
|
+
layout="vertical"
|
|
374
|
+
@update:model-value="handleMinuteInput"
|
|
375
|
+
/>
|
|
376
|
+
</div>
|
|
377
|
+
<span class="txt-center opacity-6 txt14">{{ timezoneDisplay }}</span>
|
|
378
|
+
<Btn v-if="selectedDate" flat @click="isOpen = false">
|
|
379
|
+
Done
|
|
380
|
+
</Btn>
|
|
381
|
+
</div>
|
|
382
|
+
</div>
|
|
383
|
+
</Dropdown>
|
|
352
384
|
</div>
|
|
353
385
|
</template>
|
|
354
386
|
|
|
355
387
|
<style scoped>
|
|
356
|
-
.calendar-container{
|
|
388
|
+
.calendar-container {
|
|
357
389
|
max-width: 90vw;
|
|
358
390
|
}
|
|
391
|
+
|
|
359
392
|
.calendar-section {
|
|
360
393
|
min-width: 280px;
|
|
361
394
|
}
|
|
@@ -383,13 +416,13 @@ const timezoneDisplay = $computed(() => {
|
|
|
383
416
|
.month-item:hover:not(.disabled),
|
|
384
417
|
.year-item:hover:not(.disabled) {
|
|
385
418
|
background: var(--bgl-box-bg);
|
|
386
|
-
filter:var(--bgl-hover-filter);
|
|
419
|
+
filter: var(--bgl-hover-filter);
|
|
387
420
|
}
|
|
388
421
|
|
|
389
422
|
.month-item:active:not(.disabled),
|
|
390
423
|
.year-item:active:not(.disabled) {
|
|
391
424
|
background: var(--bgl-box-bg);
|
|
392
|
-
filter:var(--bgl-active-filter);
|
|
425
|
+
filter: var(--bgl-active-filter);
|
|
393
426
|
}
|
|
394
427
|
|
|
395
428
|
.month-item.selected,
|
|
@@ -424,8 +457,12 @@ const timezoneDisplay = $computed(() => {
|
|
|
424
457
|
}
|
|
425
458
|
|
|
426
459
|
.day.disabled {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
460
|
+
opacity: 0.6;
|
|
461
|
+
filter: grayscale(0.3);
|
|
462
|
+
cursor: not-allowed;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.day.not-in-month {
|
|
466
|
+
opacity: 0.4;
|
|
430
467
|
}
|
|
431
468
|
</style>
|
|
@@ -101,10 +101,8 @@ function formatNumber(num: number) {
|
|
|
101
101
|
let formattedValue = $ref('')
|
|
102
102
|
function inputHandler() {
|
|
103
103
|
let numeric = formattedValue.replace(/[^\d.-]/g, '')
|
|
104
|
-
if (numeric === '-.' || numeric.endsWith('.')) return
|
|
105
104
|
const emptyValue = ['', '-', '.'].includes(numeric)
|
|
106
|
-
|
|
107
|
-
if (emptyValue) numeric = `${min}`
|
|
105
|
+
if (numeric === '-.' || numeric.endsWith('.') || emptyValue) return
|
|
108
106
|
|
|
109
107
|
numberValue = Number.parseFloat(numeric)
|
|
110
108
|
formattedValue = emptyValue ? '' : formatNumber(numberValue)
|
package/src/components/index.ts
CHANGED
|
@@ -7,12 +7,14 @@ export { default as Badge } from './Badge.vue'
|
|
|
7
7
|
export { default as BglComponent } from './BglComponent.vue'
|
|
8
8
|
export { default as BglVideo } from './BglVideo.vue'
|
|
9
9
|
export { default as Btn } from './Btn.vue'
|
|
10
|
+
// export { default as CalendarExample } from './Calendar/CalendarExample.vue'
|
|
11
|
+
export { default as Calendar } from './Calendar/Index.vue'
|
|
10
12
|
export { default as Card } from './Card.vue'
|
|
11
13
|
export { default as Carousel } from './Carousel.vue'
|
|
12
14
|
export * from './dashboard'
|
|
13
15
|
export { default as DataPreview } from './DataPreview.vue'
|
|
14
16
|
export { default as DataTable } from './DataTable/DataTable.vue'
|
|
15
|
-
/** @deprecated Use DataTable instead
|
|
17
|
+
/** @deprecated Use DataTable instead. TableSchema is an alias that will be removed in a future version. */
|
|
16
18
|
export { default as TableSchema } from './DataTable/DataTable.vue'
|
|
17
19
|
export { Draggable, useDraggable, vDraggable } from './Draggable'
|
|
18
20
|
export { default as Dropdown } from './Dropdown.vue'
|
|
@@ -24,7 +26,6 @@ export { default as IframeVue } from './IframeVue.vue'
|
|
|
24
26
|
export { default as Image } from './Image.vue'
|
|
25
27
|
export * from './layout'
|
|
26
28
|
export { default as ListItem } from './ListItem.vue'
|
|
27
|
-
|
|
28
29
|
export { default as ListView } from './ListView.vue'
|
|
29
30
|
export { default as Loading } from './Loading.vue'
|
|
30
31
|
export { default as MapEmbed } from './MapEmbed.vue'
|
|
@@ -33,13 +34,9 @@ export { default as ModalConfirm } from './ModalConfirm.vue'
|
|
|
33
34
|
export { default as ModalForm } from './ModalForm.vue'
|
|
34
35
|
export { default as NavBar } from './NavBar.vue'
|
|
35
36
|
export { default as PageTitle } from './PageTitle.vue'
|
|
36
|
-
|
|
37
37
|
export { default as Pill } from './Pill.vue'
|
|
38
38
|
export { default as RouterWrapper } from './RouterWrapper.vue'
|
|
39
|
-
|
|
40
39
|
export { default as Title } from './Title.vue'
|
|
41
40
|
export { default as ToolBar } from './ToolBar.vue'
|
|
42
|
-
|
|
43
41
|
export { default as TopBar } from './TopBar.vue'
|
|
44
|
-
|
|
45
42
|
export { default as Zoomer } from './Zoomer.vue'
|
package/src/directives/index.ts
CHANGED