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