intelliwaketssveltekitv25 0.1.189 → 0.1.191
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/Calendar.svelte
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import {
|
|
3
3
|
CleanSubtractNumbers,
|
|
4
|
-
DateComponent,
|
|
4
|
+
DateComponent,
|
|
5
|
+
DateDiff,
|
|
5
6
|
DateOnly,
|
|
6
7
|
DeepEqual,
|
|
7
8
|
GreaterNumber,
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
selectRange = 'Single',
|
|
24
25
|
minYear = 1970,
|
|
25
26
|
maxYear = new Date().getUTCFullYear() + 1,
|
|
26
|
-
maxWidth =
|
|
27
|
+
maxWidth = '25em'
|
|
27
28
|
}: {
|
|
28
29
|
baseDate?: string
|
|
29
30
|
dateRangeString?: TDateRangeString | null
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
if (!applyRangeToSecondDate) {
|
|
62
63
|
applyRangeToSecondDate = true
|
|
63
64
|
let days = !!dateRangeString?.start && !!dateRangeString?.end ? DateDiff(dateRangeString.start, dateRangeString.end, 'day') ?? 0 : 0
|
|
64
|
-
return CreateCustomDateRange(date, DateOnly(date, {days: days}))
|
|
65
|
+
return CreateCustomDateRange(date, DateOnly(date, { days: days }))
|
|
65
66
|
} else {
|
|
66
67
|
applyRangeToSecondDate = false
|
|
67
68
|
return CreateCustomDateRange(dateRangeString?.start ?? date, date)
|
|
@@ -91,21 +92,21 @@
|
|
|
91
92
|
<div
|
|
92
93
|
class="@container text-xs [&_*]:cursor-pointer mx-auto"
|
|
93
94
|
style={!maxWidth ? undefined : `max-width: ${maxWidth}; min-width: 14em;`}>
|
|
94
|
-
<div class="grid grid-cols-[1fr_3fr_2fr_1fr] gap-
|
|
95
|
+
<div class="grid grid-cols-[1fr_3fr_2fr_1fr] gap-1 @min-[25em]:text-lg @min-[35em]:text-xl">
|
|
95
96
|
<button
|
|
96
97
|
class="btnLink"
|
|
97
98
|
onclick={() => setDate(DateOnly(baseDate, selectRange === 'Week' ? {weeks: -1} : {months: -1}), false)}>
|
|
98
99
|
◀
|
|
99
100
|
</button>
|
|
100
101
|
<select
|
|
101
|
-
class="border-none p-0 w-full !bg-transparent dark:text-slate-100 text-center"
|
|
102
|
+
class="border-none p-0 w-full !bg-transparent dark:text-slate-100 text-center text-xs @min-[25em]:text-lg @min-[35em]:text-xl"
|
|
102
103
|
onchange={e => setDate(DateOnly(baseDate, {months: CleanSubtractNumbers(0, e.target?.value, currentMonth)}), false)}>
|
|
103
104
|
{#each MonthNames as month, idx (month)}
|
|
104
105
|
<option value={idx + 1} selected={currentMonth === idx + 1}>{month}</option>
|
|
105
106
|
{/each}
|
|
106
107
|
</select>
|
|
107
108
|
<select
|
|
108
|
-
class="border-none p-0 w-full !bg-transparent dark:text-slate-100 text-center"
|
|
109
|
+
class="border-none p-0 w-full !bg-transparent dark:text-slate-100 text-center text-xs @min-[25em]:text-lg @min-[35em]:text-xl"
|
|
109
110
|
class:bg-transparent={true}
|
|
110
111
|
onchange={e => setDate(DateOnly(baseDate, {years: CleanSubtractNumbers(0, e.target?.value, currentYear)}), false)}>
|
|
111
112
|
{#each years as year (year)}
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
role="button">
|
|
95
95
|
<ListGroupItems {listItems} />
|
|
96
96
|
{#if !!customDateRange}
|
|
97
|
-
<div class="overflow-hidden ml-4">
|
|
97
|
+
<div class="overflow-hidden ml-4 mr-2">
|
|
98
98
|
<div class="grid grid-cols-[1fr_auto_1fr] gap-1 my-2 overflow-hidden">
|
|
99
99
|
<div class="mx-auto border-b-2 border-transparent"
|
|
100
100
|
class:border-b-secondary-light={!applyRangeToSecondDate}>{DateOnly(customDateRange.start, { formatLocale: true })}</div>
|