@flightlesslabs/dodo-ui 0.10.2 → 0.11.0
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/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/stories/Home.mdx +1 -1
- package/dist/stories/components/Form/DatePicker/DatePicker.stories.svelte +16 -0
- package/dist/stories/components/Form/DatePicker/DatePicker.svelte +2 -1
- package/dist/stories/components/Form/DatePicker/DatePicker.svelte.d.ts +3 -1
- package/dist/stories/components/Form/DatePicker/Positions/AutoPosition/AutoPosition.stories.svelte +43 -0
- package/dist/stories/components/Form/DatePicker/Positions/AutoPosition/AutoPosition.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/DatePicker/Positions/Positions.stories.svelte +54 -0
- package/dist/stories/components/Form/DatePicker/Positions/Positions.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/Select/Options/OptionFormat.mdx +1 -1
- package/dist/stories/components/Info/Calendar/Calendar.stories.svelte +14 -0
- package/dist/stories/components/Info/Calendar/Calendar.svelte +2 -1
- package/dist/stories/components/Info/Calendar/Calendar.svelte.d.ts +3 -3
- package/dist/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDateChip/CalendarDateChip.svelte +2 -215
- package/dist/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDateChip/CalendarDateChip.svelte.d.ts +1 -7
- package/dist/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDateChip/utils/scss/mixins.scss +0 -46
- package/dist/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDatesChart.stories.svelte +14 -0
- package/dist/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDatesChart.svelte +3 -25
- package/dist/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDatesChart.svelte.d.ts +4 -5
- package/dist/stories/components/Info/Calendar/utils/createDateOfMonth/createDateOfMonth.d.ts +27 -0
- package/dist/stories/components/Info/Calendar/utils/createDateOfMonth/createDateOfMonth.js +72 -0
- package/dist/stories/components/Info/Calendar/utils/createDateOfMonth/index.mdx +121 -0
- package/dist/stories/components/Info/Calendar/utils/getDatesOfMonth/getDatesOfMonth.d.ts +10 -0
- package/dist/stories/components/Info/Calendar/utils/{getDatesOfMonth.js → getDatesOfMonth/getDatesOfMonth.js} +20 -13
- package/dist/stories/components/Info/Calendar/utils/getDatesOfMonth/index.mdx +37 -0
- package/dist/stories/components/Info/Calendar/utils/types.d.ts +0 -4
- package/dist/stories/components/Layout/Menu/DynamicMenu/Options/OptionFormat.mdx +1 -1
- package/dist/stories/developer tools/directives/clickOutside/index.mdx +1 -1
- package/dist/stories/developer tools/helpers/Numbers/cleanNumericString/index.mdx +1 -1
- package/dist/stories/developer tools/helpers/Numbers/isValidNumberValue/index.mdx +1 -1
- package/dist/stories/developer tools/helpers/Time/getMoment/getMoment.d.ts +10 -11
- package/dist/stories/developer tools/helpers/Time/getMoment/getMoment.js +8 -8
- package/dist/stories/developer tools/helpers/Time/getMoment/index.mdx +32 -5
- package/dist/stories/developer tools/helpers/logger/index.mdx +1 -1
- package/dist/stories/developer tools/philosophy/Colors/Colors.mdx +1 -1
- package/dist/stories/developer tools/philosophy/Themes.mdx +1 -1
- package/package.json +22 -26
- package/src/lib/index.ts +3 -3
- package/src/lib/stories/components/Form/DatePicker/DatePicker.svelte +10 -0
- package/src/lib/stories/components/Info/Calendar/Calendar.svelte +8 -2
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDateChip/CalendarDateChip.svelte +2 -25
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDateChip/utils/scss/mixins.scss +0 -46
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDatesChart.svelte +23 -53
- package/src/lib/stories/components/Info/Calendar/utils/createDateOfMonth/createDateOfMonth.ts +120 -0
- package/src/lib/stories/components/Info/Calendar/utils/{getDatesOfMonth.ts → getDatesOfMonth/getDatesOfMonth.ts} +30 -16
- package/src/lib/stories/components/Info/Calendar/utils/types.ts +0 -5
- package/src/lib/stories/developer tools/helpers/Time/getMoment/getMoment.ts +11 -12
- package/dist/stories/components/Info/Calendar/utils/createDateOfMonth.d.ts +0 -28
- package/dist/stories/components/Info/Calendar/utils/createDateOfMonth.js +0 -87
- package/dist/stories/components/Info/Calendar/utils/getDatesOfMonth.d.ts +0 -10
- package/dist/stories/components/Info/Calendar/utils/index.mdx +0 -64
- package/src/lib/stories/components/Info/Calendar/utils/createDateOfMonth.ts +0 -160
package/dist/index.d.ts
CHANGED
|
@@ -98,6 +98,6 @@ export type { CalendarYearChipProps } from './stories/components/Info/Calendar/S
|
|
|
98
98
|
export { default as CalendarYearChip } from './stories/components/Info/Calendar/SubComponents/CalendarYearList/CalendarYearChip/CalendarYearChip.svelte';
|
|
99
99
|
export type { DateOfMonth } from './stories/components/Info/Calendar/utils/types.js';
|
|
100
100
|
export { DAYS_OF_WEEK, MONTHS } from './stories/components/Info/Calendar/utils/types.js';
|
|
101
|
-
export { default as getDatesOfMonth } from './stories/components/Info/Calendar/utils/getDatesOfMonth.js';
|
|
102
|
-
export { default as createDateOfMonth } from './stories/components/Info/Calendar/utils/createDateOfMonth.js';
|
|
103
|
-
export type { CreateDatesOfMonthSettings, CreateDateOfMonthType, } from './stories/components/Info/Calendar/utils/createDateOfMonth.js';
|
|
101
|
+
export { default as getDatesOfMonth } from './stories/components/Info/Calendar/utils/getDatesOfMonth/getDatesOfMonth.js';
|
|
102
|
+
export { default as createDateOfMonth } from './stories/components/Info/Calendar/utils/createDateOfMonth/createDateOfMonth.js';
|
|
103
|
+
export type { CreateDatesOfMonthSettings, CreateDateOfMonthType, } from './stories/components/Info/Calendar/utils/createDateOfMonth/createDateOfMonth.js';
|
package/dist/index.js
CHANGED
|
@@ -58,5 +58,5 @@ export { default as CalendarMonthChip } from './stories/components/Info/Calendar
|
|
|
58
58
|
export { default as CalendarYearList } from './stories/components/Info/Calendar/SubComponents/CalendarYearList/CalendarYearList.svelte';
|
|
59
59
|
export { default as CalendarYearChip } from './stories/components/Info/Calendar/SubComponents/CalendarYearList/CalendarYearChip/CalendarYearChip.svelte';
|
|
60
60
|
export { DAYS_OF_WEEK, MONTHS } from './stories/components/Info/Calendar/utils/types.js';
|
|
61
|
-
export { default as getDatesOfMonth } from './stories/components/Info/Calendar/utils/getDatesOfMonth.js';
|
|
62
|
-
export { default as createDateOfMonth } from './stories/components/Info/Calendar/utils/createDateOfMonth.js';
|
|
61
|
+
export { default as getDatesOfMonth } from './stories/components/Info/Calendar/utils/getDatesOfMonth/getDatesOfMonth.js';
|
|
62
|
+
export { default as createDateOfMonth } from './stories/components/Info/Calendar/utils/createDateOfMonth/createDateOfMonth.js';
|
package/dist/stories/Home.mdx
CHANGED
|
@@ -4,6 +4,7 @@ import { componentRoundnessArray } from '../../../../types/roundness.js';
|
|
|
4
4
|
import { componentSizeArray } from '../../../../types/size.js';
|
|
5
5
|
import { componentColorArray } from '../../../../types/colors.js';
|
|
6
6
|
import Icon from '@iconify/svelte';
|
|
7
|
+
import { getMoment } from '../../../../index.js';
|
|
7
8
|
export const storyDatePickerArgTypes = {
|
|
8
9
|
roundness: {
|
|
9
10
|
control: { type: 'select' },
|
|
@@ -77,6 +78,21 @@ let value = $state(new Date());
|
|
|
77
78
|
<DatePicker {value} open={true} />
|
|
78
79
|
</Story>
|
|
79
80
|
|
|
81
|
+
<Story name="ManipulateDate" asChild>
|
|
82
|
+
<DatePicker
|
|
83
|
+
{value}
|
|
84
|
+
onselect={(val: Date) => (value = val)}
|
|
85
|
+
manipulateDate={(dateToModify: DateOfMonth) => {
|
|
86
|
+
// Disable all Fridays
|
|
87
|
+
if (getMoment(dateToModify.date, undefined).day() === 5) {
|
|
88
|
+
dateToModify.disabled = true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return dateToModify;
|
|
92
|
+
}}
|
|
93
|
+
/>
|
|
94
|
+
</Story>
|
|
95
|
+
|
|
80
96
|
<Story name="Custom calender icon" asChild>
|
|
81
97
|
<DatePicker {value}>
|
|
82
98
|
{#snippet customCalendarIcon()}
|
|
@@ -6,7 +6,7 @@ import UtilityButton from '../../../developer tools/components/UtilityButton/Uti
|
|
|
6
6
|
import Icon from '@iconify/svelte';
|
|
7
7
|
import { createDateOfMonth, DynamicInput, getMoment, Popper, } from '../../../../index.js';
|
|
8
8
|
import Calendar, {} from '../../Info/Calendar/Calendar.svelte';
|
|
9
|
-
let { size = 'normal', roundness = 1, outline = true, name, id, class: className = '', disabled = false, onchange, oninput, onselect, onblur, onfocus, onpaste, oncopy, oncut, onkeydown, onkeypress, onkeyup, before, after, error = false, value, placeholder, ref = $bindable(), readonly = false, editable = false, clearable = false, onclear, customInputContent: customInputContentInternal, customPopupContent: customPopupContentInternal, customCalendarIcon: customCalendarIconInternal, paperProps, popperProps, calendarIconPosition = 'after', popupPositionX, popupPositionY, lockPoistions, popperHeightForVerticalPosition, color, format = 'DD/MM/YYYY', formatEditable: formatEditableRaw, open = $bindable(false), startOfWeek = 'sun', timezone, utc, calendarDateChipProps, activeMonth, showSelected, showLastMonth, showNextMonth, showToday, today, minDate, maxDate, excludeDates, includeDates, customCalendarDateChipContent, customCalendarDateChip, customCalendarWeekContent, customCalendarWeek, weekendDays, weekendDaysColorDays, customCalendarControls, showCalendarControls, calendarMonthSelectorProps, customCalendarMonthSelector, customCalendarMonthSelectorContent, onMonthSelectorClick, calendarYearSelectorProps, customCalendarYearSelector, customCalendarYearSelectorContent, onYearSelectorClick, calendarNavigationProps, customCalendarNavigation, customCalendarNavigationNext, customCalendarNavigationPrev, customCalendarNavigationNextContent, customCalendarNavigationPrevContent, onCalendarNavigationNextClick, onCalendarNavigationPrevClick, disabledCalendarNavigationNext, disabledCalendarNavigationPrev, showCalendarMonthSelector, showCalendarYearSelector, showCalendarNavigator, onselectMonth, customCalendarMonthChipContent, customCalendarMonthChip, disabledMonths, calendarMonthChipProps, calendarYearChipProps, onselectYear, customCalendarYearChipContent, customCalendarYearChip, oncancelMonth, oncancelYear, showControlsMonthList, showControlsYearList, calendarProps, calendarTopContent, calendarBottomContent, } = $props();
|
|
9
|
+
let { size = 'normal', roundness = 1, outline = true, name, id, class: className = '', disabled = false, onchange, oninput, onselect, onblur, onfocus, onpaste, oncopy, oncut, onkeydown, onkeypress, onkeyup, before, after, error = false, value, placeholder, ref = $bindable(), readonly = false, editable = false, clearable = false, onclear, customInputContent: customInputContentInternal, customPopupContent: customPopupContentInternal, customCalendarIcon: customCalendarIconInternal, paperProps, popperProps, calendarIconPosition = 'after', popupPositionX, popupPositionY, lockPoistions, popperHeightForVerticalPosition, color, format = 'DD/MM/YYYY', formatEditable: formatEditableRaw, open = $bindable(false), startOfWeek = 'sun', timezone, utc, calendarDateChipProps, activeMonth, showSelected, showLastMonth, showNextMonth, showToday, today, minDate, maxDate, excludeDates, includeDates, customCalendarDateChipContent, customCalendarDateChip, customCalendarWeekContent, customCalendarWeek, weekendDays, weekendDaysColorDays, customCalendarControls, showCalendarControls, calendarMonthSelectorProps, customCalendarMonthSelector, customCalendarMonthSelectorContent, onMonthSelectorClick, calendarYearSelectorProps, customCalendarYearSelector, customCalendarYearSelectorContent, onYearSelectorClick, calendarNavigationProps, customCalendarNavigation, customCalendarNavigationNext, customCalendarNavigationPrev, customCalendarNavigationNextContent, customCalendarNavigationPrevContent, onCalendarNavigationNextClick, onCalendarNavigationPrevClick, disabledCalendarNavigationNext, disabledCalendarNavigationPrev, showCalendarMonthSelector, showCalendarYearSelector, showCalendarNavigator, onselectMonth, customCalendarMonthChipContent, customCalendarMonthChip, disabledMonths, calendarMonthChipProps, calendarYearChipProps, onselectYear, customCalendarYearChipContent, customCalendarYearChip, oncancelMonth, oncancelYear, showControlsMonthList, showControlsYearList, calendarProps, calendarTopContent, calendarBottomContent, manipulateDate, } = $props();
|
|
10
10
|
const formatEditable = $derived(formatEditableRaw || format);
|
|
11
11
|
let searchText = $derived(value ? getMoment(value, undefined, { timezone, utc }).format(format) : '');
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -266,6 +266,7 @@ function onclearMod(e) {
|
|
|
266
266
|
onselect={onselectMod}
|
|
267
267
|
{calendarTopContent}
|
|
268
268
|
{calendarBottomContent}
|
|
269
|
+
{manipulateDate}
|
|
269
270
|
{...calendarProps}
|
|
270
271
|
/>
|
|
271
272
|
</div>
|
|
@@ -206,8 +206,10 @@ export interface DatePickerProps {
|
|
|
206
206
|
calendarTopContent?: (activeSection: CalendarActiveSection) => Snippet;
|
|
207
207
|
/** calendar Bottom Content*/
|
|
208
208
|
calendarBottomContent?: (activeSection: CalendarActiveSection) => Snippet;
|
|
209
|
+
/** manipulate date callback */
|
|
210
|
+
manipulateDate?: (dateToModify: DateOfMonth, settings?: CreateDatesOfMonthSettings) => DateOfMonth;
|
|
209
211
|
}
|
|
210
|
-
import { type CalendarDateChipProps, type CalendarMonthChipProps, type CalendarMonthNames, type CalendarMonthOption, type CalendarMonthSelectorProps, type CalendarWeekNames, type CalendarWeekOption, type CalendarYearChipProps, type CalendarYearSelectorProps, type ComponentColor, type DateOfMonth, type PaperProps, type PopperProps, type PositionX, type PositionY } from '../../../../index.js';
|
|
212
|
+
import { type CalendarDateChipProps, type CalendarMonthChipProps, type CalendarMonthNames, type CalendarMonthOption, type CalendarMonthSelectorProps, type CalendarWeekNames, type CalendarWeekOption, type CalendarYearChipProps, type CalendarYearSelectorProps, type ComponentColor, type CreateDatesOfMonthSettings, type DateOfMonth, type PaperProps, type PopperProps, type PositionX, type PositionY } from '../../../../index.js';
|
|
211
213
|
import type { ButtonClickEvent } from '../Button/Button.svelte';
|
|
212
214
|
import { type CalendarActiveSection, type CalendarProps } from '../../Info/Calendar/Calendar.svelte';
|
|
213
215
|
declare const DatePicker: import("svelte").Component<DatePickerProps, {}, "ref" | "open">;
|
package/dist/stories/components/Form/DatePicker/Positions/AutoPosition/AutoPosition.stories.svelte
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script module lang="ts">import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
2
|
+
import { storyDatePickerArgTypes } from '../../DatePicker.stories.svelte';
|
|
3
|
+
import DatePicker from '../../DatePicker.svelte';
|
|
4
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
component: DatePicker,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: storyDatePickerArgTypes,
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
story: {
|
|
12
|
+
height: '200px',
|
|
13
|
+
inline: false,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
let value = $state(new Date());
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<Story name="PositionAutoAdjust" asChild>
|
|
22
|
+
<DatePicker {value} onselect={(val: Date) => (value = val)} />
|
|
23
|
+
</Story>
|
|
24
|
+
|
|
25
|
+
<!-- Positions will not auto adjust if you use `lockPoistions` -->
|
|
26
|
+
<Story name="LockPoistions" asChild>
|
|
27
|
+
<DatePicker
|
|
28
|
+
{value}
|
|
29
|
+
onselect={(val: Date) => (value = val)}
|
|
30
|
+
popupPositionY="top"
|
|
31
|
+
lockPoistions={true}
|
|
32
|
+
/>
|
|
33
|
+
</Story>
|
|
34
|
+
|
|
35
|
+
<!-- you can also adjust `popperHeightForVerticalPosition` to achive the same -->
|
|
36
|
+
<Story name="HeightForVerticalPosition" asChild>
|
|
37
|
+
<DatePicker
|
|
38
|
+
{value}
|
|
39
|
+
onselect={(val: Date) => (value = val)}
|
|
40
|
+
popupPositionY="top"
|
|
41
|
+
popperHeightForVerticalPosition={3}
|
|
42
|
+
/>
|
|
43
|
+
</Story>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const AutoPosition: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type AutoPosition = InstanceType<typeof AutoPosition>;
|
|
18
|
+
export default AutoPosition;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script module lang="ts">import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
2
|
+
import { storyDatePickerArgTypes } from '../DatePicker.stories.svelte';
|
|
3
|
+
import DatePicker from '../DatePicker.svelte';
|
|
4
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
component: DatePicker,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: storyDatePickerArgTypes,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
docs: {
|
|
12
|
+
story: {
|
|
13
|
+
height: '400px',
|
|
14
|
+
inline: false,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
let value = $state(new Date());
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Story name="BottomLeft" asChild>
|
|
23
|
+
<DatePicker {value} onselect={(val: Date) => (value = val)} />
|
|
24
|
+
</Story>
|
|
25
|
+
|
|
26
|
+
<Story name="BottomCenter" asChild>
|
|
27
|
+
<DatePicker {value} onselect={(val: Date) => (value = val)} popupPositionX="center" />
|
|
28
|
+
</Story>
|
|
29
|
+
|
|
30
|
+
<Story name="BottomRight" asChild>
|
|
31
|
+
<DatePicker {value} onselect={(val: Date) => (value = val)} popupPositionX="right" />
|
|
32
|
+
</Story>
|
|
33
|
+
|
|
34
|
+
<Story name="TopLeft" asChild>
|
|
35
|
+
<DatePicker {value} onselect={(val: Date) => (value = val)} popupPositionY="top" />
|
|
36
|
+
</Story>
|
|
37
|
+
|
|
38
|
+
<Story name="TopCenter" asChild>
|
|
39
|
+
<DatePicker
|
|
40
|
+
{value}
|
|
41
|
+
onselect={(val: Date) => (value = val)}
|
|
42
|
+
popupPositionY="top"
|
|
43
|
+
popupPositionX="center"
|
|
44
|
+
/>
|
|
45
|
+
</Story>
|
|
46
|
+
|
|
47
|
+
<Story name="TopRight" asChild>
|
|
48
|
+
<DatePicker
|
|
49
|
+
{value}
|
|
50
|
+
onselect={(val: Date) => (value = val)}
|
|
51
|
+
popupPositionY="top"
|
|
52
|
+
popupPositionX="right"
|
|
53
|
+
/>
|
|
54
|
+
</Story>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Positions: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Positions = InstanceType<typeof Positions>;
|
|
18
|
+
export default Positions;
|
|
@@ -99,3 +99,17 @@ let value = $state(getMoment().toDate());
|
|
|
99
99
|
showCalendarControls: false,
|
|
100
100
|
}}
|
|
101
101
|
/>
|
|
102
|
+
|
|
103
|
+
<Story
|
|
104
|
+
name="ManipulateDate"
|
|
105
|
+
args={{
|
|
106
|
+
manipulateDate: (dateToModify: DateOfMonth) => {
|
|
107
|
+
// Disable all Fridays
|
|
108
|
+
if (getMoment(dateToModify.date, undefined).day() === 5) {
|
|
109
|
+
dateToModify.disabled = true;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return dateToModify;
|
|
113
|
+
},
|
|
114
|
+
}}
|
|
115
|
+
/>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { CalendarDatesChart, CalendarControls, calendarMonthOptions, MONTHS, } from '../../../../index.js';
|
|
6
6
|
import CalendarMonthList from './SubComponents/CalendarMonthList/CalendarMonthList.svelte';
|
|
7
7
|
import CalendarYearList from './SubComponents/CalendarYearList/CalendarYearList.svelte';
|
|
8
|
-
let { class: className = '', ref = $bindable(), value, startOfWeek = 'sun', timezone, utc, calendarDateChipProps, activeMonth: activeMonthRaw, showSelected = true, showLastMonth = true, showNextMonth = true, showToday = true, today, minDate, maxDate, excludeDates, includeDates, onselect, customCalendarDateChipContent, customCalendarDateChip, color, customCalendarWeekContent, customCalendarWeek, size = 'normal', weekendDays, weekendDaysColorDays = true, customCalendarControls, showCalendarControls = true, calendarMonthSelectorProps, customCalendarMonthSelector, customCalendarMonthSelectorContent, onMonthSelectorClick, calendarYearSelectorProps, customCalendarYearSelector, customCalendarYearSelectorContent, onYearSelectorClick, calendarNavigationProps, customCalendarNavigation, customCalendarNavigationNext, customCalendarNavigationPrev, customCalendarNavigationNextContent, customCalendarNavigationPrevContent, onCalendarNavigationNextClick, onCalendarNavigationPrevClick, disabledCalendarNavigationNext: disabledCalendarNavigationNextRaw, disabledCalendarNavigationPrev: disabledCalendarNavigationPrevRaw, showCalendarMonthSelector, showCalendarYearSelector, showCalendarNavigator, onselectMonth, customCalendarMonthChipContent, customCalendarMonthChip, disabledMonths, calendarMonthChipProps, calendarYearChipProps, onselectYear, customCalendarYearChipContent, customCalendarYearChip, oncancelMonth, oncancelYear, showControlsMonthList = true, showControlsYearList = true, calendarTopContent: calendarTopContentInternal, calendarBottomContent: calendarBottomContentInternal, } = $props();
|
|
8
|
+
let { class: className = '', ref = $bindable(), value, startOfWeek = 'sun', timezone, utc, calendarDateChipProps, activeMonth: activeMonthRaw, showSelected = true, showLastMonth = true, showNextMonth = true, showToday = true, today, minDate, maxDate, excludeDates, includeDates, onselect, customCalendarDateChipContent, customCalendarDateChip, color, customCalendarWeekContent, customCalendarWeek, size = 'normal', weekendDays, weekendDaysColorDays = true, customCalendarControls, showCalendarControls = true, calendarMonthSelectorProps, customCalendarMonthSelector, customCalendarMonthSelectorContent, onMonthSelectorClick, calendarYearSelectorProps, customCalendarYearSelector, customCalendarYearSelectorContent, onYearSelectorClick, calendarNavigationProps, customCalendarNavigation, customCalendarNavigationNext, customCalendarNavigationPrev, customCalendarNavigationNextContent, customCalendarNavigationPrevContent, onCalendarNavigationNextClick, onCalendarNavigationPrevClick, disabledCalendarNavigationNext: disabledCalendarNavigationNextRaw, disabledCalendarNavigationPrev: disabledCalendarNavigationPrevRaw, showCalendarMonthSelector, showCalendarYearSelector, showCalendarNavigator, onselectMonth, customCalendarMonthChipContent, customCalendarMonthChip, disabledMonths, calendarMonthChipProps, calendarYearChipProps, onselectYear, customCalendarYearChipContent, customCalendarYearChip, oncancelMonth, oncancelYear, showControlsMonthList = true, showControlsYearList = true, calendarTopContent: calendarTopContentInternal, calendarBottomContent: calendarBottomContentInternal, manipulateDate, } = $props();
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
10
|
let calendarTopContentTyped = calendarTopContentInternal;
|
|
11
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -144,6 +144,7 @@ function oncancelYearMod(e) {
|
|
|
144
144
|
{size}
|
|
145
145
|
{weekendDays}
|
|
146
146
|
{weekendDaysColorDays}
|
|
147
|
+
{manipulateDate}
|
|
147
148
|
/>
|
|
148
149
|
{/snippet}
|
|
149
150
|
|
|
@@ -128,8 +128,8 @@ export interface CalendarProps {
|
|
|
128
128
|
calendarTopContent?: (activeSection: CalendarActiveSection) => Snippet;
|
|
129
129
|
/** calendar Bottom Content*/
|
|
130
130
|
calendarBottomContent?: (activeSection: CalendarActiveSection) => Snippet;
|
|
131
|
-
/**
|
|
132
|
-
|
|
131
|
+
/** manipulate date callback */
|
|
132
|
+
manipulateDate?: (dateToModify: DateOfMonth, settings?: CreateDatesOfMonthSettings) => DateOfMonth;
|
|
133
133
|
}
|
|
134
134
|
import type { ComponentColor } from '../../../../types/colors.js';
|
|
135
135
|
import type { Snippet } from 'svelte';
|
|
@@ -137,7 +137,7 @@ import type { ButtonClickEvent } from '../../Form/Button/Button.svelte';
|
|
|
137
137
|
import type { DateOfMonth } from './utils/types.js';
|
|
138
138
|
import type { ComponentSize } from '../../../../types/size.js';
|
|
139
139
|
import type { MouseEventHandler } from 'svelte/elements';
|
|
140
|
-
import { type CalendarWeekNames, type CalendarDateChipProps, type CalendarWeekOption, type CalendarMonthOption, type CalendarMonthSelectorProps, type CalendarYearSelectorProps, type CalendarMonthNames, type CalendarMonthChipProps, type CalendarYearChipProps } from '../../../../index.js';
|
|
140
|
+
import { type CalendarWeekNames, type CalendarDateChipProps, type CalendarWeekOption, type CalendarMonthOption, type CalendarMonthSelectorProps, type CalendarYearSelectorProps, type CalendarMonthNames, type CalendarMonthChipProps, type CalendarYearChipProps, type CreateDatesOfMonthSettings } from '../../../../index.js';
|
|
141
141
|
declare const Calendar: import("svelte").Component<CalendarProps, {}, "ref">;
|
|
142
142
|
type Calendar = ReturnType<typeof Calendar>;
|
|
143
143
|
export default Calendar;
|
|
@@ -2,22 +2,16 @@
|
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
4
|
<script lang="ts">import getMoment from '../../../../../../developer tools/helpers/Time/getMoment/getMoment.js';
|
|
5
|
-
let { class: className = '', dayOfMonth, roundness = 1, showLastMonth = true, showNextMonth = true, selected = false, showToday = true, color = 'primary', ref = $bindable(), customCalendarDateChipContent: customCalendarDateChipContentInternal, customCalendarDateChip: customCalendarDateChipInternal, onselect,
|
|
5
|
+
let { class: className = '', dayOfMonth, roundness = 1, showLastMonth = true, showNextMonth = true, selected = false, showToday = true, color = 'primary', ref = $bindable(), customCalendarDateChipContent: customCalendarDateChipContentInternal, customCalendarDateChip: customCalendarDateChipInternal, onselect, size = 'normal', weekend, timezone, utc, } = $props();
|
|
6
6
|
const dayNumber = Number(getMoment(dayOfMonth.date, undefined, { timezone, utc }).format('D'));
|
|
7
7
|
const disabled = dayOfMonth.disabled || false;
|
|
8
8
|
const today = showToday && dayOfMonth.today ? true : false;
|
|
9
|
-
const isRangeStart = rangeType === 'start' || false;
|
|
10
|
-
const isRangeEnd = rangeType === 'end' || false;
|
|
11
|
-
const inRange = dayOfMonth.inRange || false;
|
|
12
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
10
|
let customCalendarDateChipContentTyped = customCalendarDateChipContentInternal;
|
|
14
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
12
|
let customCalendarDateChipTyped = customCalendarDateChipInternal;
|
|
16
13
|
function onselectMod(e) {
|
|
17
|
-
if (
|
|
18
|
-
onselectRange(dayOfMonth.date, rangeType || 'start', dayOfMonth, e);
|
|
19
|
-
}
|
|
20
|
-
else if (onselect) {
|
|
14
|
+
if (onselect) {
|
|
21
15
|
onselect(dayOfMonth.date, dayOfMonth, e);
|
|
22
16
|
}
|
|
23
17
|
}
|
|
@@ -43,9 +37,6 @@ function onselectMod(e) {
|
|
|
43
37
|
class:showNextMonth
|
|
44
38
|
class:today
|
|
45
39
|
class:selected
|
|
46
|
-
class:isRangeStart
|
|
47
|
-
class:isRangeEnd
|
|
48
|
-
class:inRange
|
|
49
40
|
class:weekend
|
|
50
41
|
class={[
|
|
51
42
|
'dodo-ui-CalendarDateChip',
|
|
@@ -173,20 +164,6 @@ function onselectMod(e) {
|
|
|
173
164
|
--dodo-ui-CalendarDateChip-selected-neutral-active-bg: var(
|
|
174
165
|
--dodo-color-neutral-100
|
|
175
166
|
);
|
|
176
|
-
--dodo-ui-CalendarDateChip-isRangeStart-neutral-bg: var(--dodo-color-neutral-300);
|
|
177
|
-
--dodo-ui-CalendarDateChip-isRangeStart-neutral-hover-bg: var(
|
|
178
|
-
--dodo-color-neutral-200
|
|
179
|
-
);
|
|
180
|
-
--dodo-ui-CalendarDateChip-isRangeStart-neutral-active-bg: var(
|
|
181
|
-
--dodo-color-neutral-100
|
|
182
|
-
);
|
|
183
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-neutral-bg: var(--dodo-color-neutral-300);
|
|
184
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-neutral-hover-bg: var(
|
|
185
|
-
--dodo-color-neutral-200
|
|
186
|
-
);
|
|
187
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-neutral-active-bg: var(
|
|
188
|
-
--dodo-color-neutral-100
|
|
189
|
-
);
|
|
190
167
|
--dodo-ui-CalendarDateChip-primary-bg: transparent;
|
|
191
168
|
--dodo-ui-CalendarDateChip-primary-hover-bg: color-mix(
|
|
192
169
|
in oklab,
|
|
@@ -218,20 +195,6 @@ function onselectMod(e) {
|
|
|
218
195
|
--dodo-ui-CalendarDateChip-selected-primary-active-bg: var(
|
|
219
196
|
--dodo-color-primary-100
|
|
220
197
|
);
|
|
221
|
-
--dodo-ui-CalendarDateChip-isRangeStart-primary-bg: var(--dodo-color-primary-300);
|
|
222
|
-
--dodo-ui-CalendarDateChip-isRangeStart-primary-hover-bg: var(
|
|
223
|
-
--dodo-color-primary-200
|
|
224
|
-
);
|
|
225
|
-
--dodo-ui-CalendarDateChip-isRangeStart-primary-active-bg: var(
|
|
226
|
-
--dodo-color-primary-100
|
|
227
|
-
);
|
|
228
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-primary-bg: var(--dodo-color-primary-300);
|
|
229
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-primary-hover-bg: var(
|
|
230
|
-
--dodo-color-primary-200
|
|
231
|
-
);
|
|
232
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-primary-active-bg: var(
|
|
233
|
-
--dodo-color-primary-100
|
|
234
|
-
);
|
|
235
198
|
--dodo-ui-CalendarDateChip-secondary-bg: transparent;
|
|
236
199
|
--dodo-ui-CalendarDateChip-secondary-hover-bg: color-mix(
|
|
237
200
|
in oklab,
|
|
@@ -263,20 +226,6 @@ function onselectMod(e) {
|
|
|
263
226
|
--dodo-ui-CalendarDateChip-selected-secondary-active-bg: var(
|
|
264
227
|
--dodo-color-secondary-100
|
|
265
228
|
);
|
|
266
|
-
--dodo-ui-CalendarDateChip-isRangeStart-secondary-bg: var(--dodo-color-secondary-300);
|
|
267
|
-
--dodo-ui-CalendarDateChip-isRangeStart-secondary-hover-bg: var(
|
|
268
|
-
--dodo-color-secondary-200
|
|
269
|
-
);
|
|
270
|
-
--dodo-ui-CalendarDateChip-isRangeStart-secondary-active-bg: var(
|
|
271
|
-
--dodo-color-secondary-100
|
|
272
|
-
);
|
|
273
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-secondary-bg: var(--dodo-color-secondary-300);
|
|
274
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-secondary-hover-bg: var(
|
|
275
|
-
--dodo-color-secondary-200
|
|
276
|
-
);
|
|
277
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-secondary-active-bg: var(
|
|
278
|
-
--dodo-color-secondary-100
|
|
279
|
-
);
|
|
280
229
|
--dodo-ui-CalendarDateChip-safe-bg: transparent;
|
|
281
230
|
--dodo-ui-CalendarDateChip-safe-hover-bg: color-mix(
|
|
282
231
|
in oklab,
|
|
@@ -308,20 +257,6 @@ function onselectMod(e) {
|
|
|
308
257
|
--dodo-ui-CalendarDateChip-selected-safe-active-bg: var(
|
|
309
258
|
--dodo-color-safe-100
|
|
310
259
|
);
|
|
311
|
-
--dodo-ui-CalendarDateChip-isRangeStart-safe-bg: var(--dodo-color-safe-300);
|
|
312
|
-
--dodo-ui-CalendarDateChip-isRangeStart-safe-hover-bg: var(
|
|
313
|
-
--dodo-color-safe-200
|
|
314
|
-
);
|
|
315
|
-
--dodo-ui-CalendarDateChip-isRangeStart-safe-active-bg: var(
|
|
316
|
-
--dodo-color-safe-100
|
|
317
|
-
);
|
|
318
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-safe-bg: var(--dodo-color-safe-300);
|
|
319
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-safe-hover-bg: var(
|
|
320
|
-
--dodo-color-safe-200
|
|
321
|
-
);
|
|
322
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-safe-active-bg: var(
|
|
323
|
-
--dodo-color-safe-100
|
|
324
|
-
);
|
|
325
260
|
--dodo-ui-CalendarDateChip-warning-bg: transparent;
|
|
326
261
|
--dodo-ui-CalendarDateChip-warning-hover-bg: color-mix(
|
|
327
262
|
in oklab,
|
|
@@ -353,20 +288,6 @@ function onselectMod(e) {
|
|
|
353
288
|
--dodo-ui-CalendarDateChip-selected-warning-active-bg: var(
|
|
354
289
|
--dodo-color-warning-100
|
|
355
290
|
);
|
|
356
|
-
--dodo-ui-CalendarDateChip-isRangeStart-warning-bg: var(--dodo-color-warning-300);
|
|
357
|
-
--dodo-ui-CalendarDateChip-isRangeStart-warning-hover-bg: var(
|
|
358
|
-
--dodo-color-warning-200
|
|
359
|
-
);
|
|
360
|
-
--dodo-ui-CalendarDateChip-isRangeStart-warning-active-bg: var(
|
|
361
|
-
--dodo-color-warning-100
|
|
362
|
-
);
|
|
363
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-warning-bg: var(--dodo-color-warning-300);
|
|
364
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-warning-hover-bg: var(
|
|
365
|
-
--dodo-color-warning-200
|
|
366
|
-
);
|
|
367
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-warning-active-bg: var(
|
|
368
|
-
--dodo-color-warning-100
|
|
369
|
-
);
|
|
370
291
|
--dodo-ui-CalendarDateChip-danger-bg: transparent;
|
|
371
292
|
--dodo-ui-CalendarDateChip-danger-hover-bg: color-mix(
|
|
372
293
|
in oklab,
|
|
@@ -398,20 +319,6 @@ function onselectMod(e) {
|
|
|
398
319
|
--dodo-ui-CalendarDateChip-selected-danger-active-bg: var(
|
|
399
320
|
--dodo-color-danger-100
|
|
400
321
|
);
|
|
401
|
-
--dodo-ui-CalendarDateChip-isRangeStart-danger-bg: var(--dodo-color-danger-300);
|
|
402
|
-
--dodo-ui-CalendarDateChip-isRangeStart-danger-hover-bg: var(
|
|
403
|
-
--dodo-color-danger-200
|
|
404
|
-
);
|
|
405
|
-
--dodo-ui-CalendarDateChip-isRangeStart-danger-active-bg: var(
|
|
406
|
-
--dodo-color-danger-100
|
|
407
|
-
);
|
|
408
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-danger-bg: var(--dodo-color-danger-300);
|
|
409
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-danger-hover-bg: var(
|
|
410
|
-
--dodo-color-danger-200
|
|
411
|
-
);
|
|
412
|
-
--dodo-ui-CalendarDateChip-isRangeEnd-danger-active-bg: var(
|
|
413
|
-
--dodo-color-danger-100
|
|
414
|
-
);
|
|
415
322
|
}
|
|
416
323
|
|
|
417
324
|
.dodo-ui-CalendarDateChip {
|
|
@@ -482,26 +389,6 @@ function onselectMod(e) {
|
|
|
482
389
|
.dodo-ui-CalendarDateChip.color--neutral.selected .chip:not([disabled]):active {
|
|
483
390
|
background-color: var(--dodo-ui-CalendarDateChip-selected-neutral-active-bg);
|
|
484
391
|
}
|
|
485
|
-
.dodo-ui-CalendarDateChip.color--neutral.isRangeStart .chip:not([disabled]) {
|
|
486
|
-
color: var(--dodo-color-constant-white);
|
|
487
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-neutral-bg);
|
|
488
|
-
}
|
|
489
|
-
.dodo-ui-CalendarDateChip.color--neutral.isRangeStart .chip:not([disabled]):hover {
|
|
490
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-neutral-hover-bg);
|
|
491
|
-
}
|
|
492
|
-
.dodo-ui-CalendarDateChip.color--neutral.isRangeStart .chip:not([disabled]):active {
|
|
493
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-neutral-active-bg);
|
|
494
|
-
}
|
|
495
|
-
.dodo-ui-CalendarDateChip.color--neutral.isRangeEnd .chip:not([disabled]) {
|
|
496
|
-
color: var(--dodo-color-constant-white);
|
|
497
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-neutral-bg);
|
|
498
|
-
}
|
|
499
|
-
.dodo-ui-CalendarDateChip.color--neutral.isRangeEnd .chip:not([disabled]):hover {
|
|
500
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-neutral-hover-bg);
|
|
501
|
-
}
|
|
502
|
-
.dodo-ui-CalendarDateChip.color--neutral.isRangeEnd .chip:not([disabled]):active {
|
|
503
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-neutral-active-bg);
|
|
504
|
-
}
|
|
505
392
|
.dodo-ui-CalendarDateChip.color--primary .chip:not([disabled]) {
|
|
506
393
|
background-color: var(--dodo-ui-CalendarDateChip-primary-bg);
|
|
507
394
|
}
|
|
@@ -530,26 +417,6 @@ function onselectMod(e) {
|
|
|
530
417
|
.dodo-ui-CalendarDateChip.color--primary.selected .chip:not([disabled]):active {
|
|
531
418
|
background-color: var(--dodo-ui-CalendarDateChip-selected-primary-active-bg);
|
|
532
419
|
}
|
|
533
|
-
.dodo-ui-CalendarDateChip.color--primary.isRangeStart .chip:not([disabled]) {
|
|
534
|
-
color: var(--dodo-color-constant-white);
|
|
535
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-primary-bg);
|
|
536
|
-
}
|
|
537
|
-
.dodo-ui-CalendarDateChip.color--primary.isRangeStart .chip:not([disabled]):hover {
|
|
538
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-primary-hover-bg);
|
|
539
|
-
}
|
|
540
|
-
.dodo-ui-CalendarDateChip.color--primary.isRangeStart .chip:not([disabled]):active {
|
|
541
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-primary-active-bg);
|
|
542
|
-
}
|
|
543
|
-
.dodo-ui-CalendarDateChip.color--primary.isRangeEnd .chip:not([disabled]) {
|
|
544
|
-
color: var(--dodo-color-constant-white);
|
|
545
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-primary-bg);
|
|
546
|
-
}
|
|
547
|
-
.dodo-ui-CalendarDateChip.color--primary.isRangeEnd .chip:not([disabled]):hover {
|
|
548
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-primary-hover-bg);
|
|
549
|
-
}
|
|
550
|
-
.dodo-ui-CalendarDateChip.color--primary.isRangeEnd .chip:not([disabled]):active {
|
|
551
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-primary-active-bg);
|
|
552
|
-
}
|
|
553
420
|
.dodo-ui-CalendarDateChip.color--secondary .chip:not([disabled]) {
|
|
554
421
|
background-color: var(--dodo-ui-CalendarDateChip-secondary-bg);
|
|
555
422
|
}
|
|
@@ -578,26 +445,6 @@ function onselectMod(e) {
|
|
|
578
445
|
.dodo-ui-CalendarDateChip.color--secondary.selected .chip:not([disabled]):active {
|
|
579
446
|
background-color: var(--dodo-ui-CalendarDateChip-selected-secondary-active-bg);
|
|
580
447
|
}
|
|
581
|
-
.dodo-ui-CalendarDateChip.color--secondary.isRangeStart .chip:not([disabled]) {
|
|
582
|
-
color: var(--dodo-color-constant-white);
|
|
583
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-secondary-bg);
|
|
584
|
-
}
|
|
585
|
-
.dodo-ui-CalendarDateChip.color--secondary.isRangeStart .chip:not([disabled]):hover {
|
|
586
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-secondary-hover-bg);
|
|
587
|
-
}
|
|
588
|
-
.dodo-ui-CalendarDateChip.color--secondary.isRangeStart .chip:not([disabled]):active {
|
|
589
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-secondary-active-bg);
|
|
590
|
-
}
|
|
591
|
-
.dodo-ui-CalendarDateChip.color--secondary.isRangeEnd .chip:not([disabled]) {
|
|
592
|
-
color: var(--dodo-color-constant-white);
|
|
593
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-secondary-bg);
|
|
594
|
-
}
|
|
595
|
-
.dodo-ui-CalendarDateChip.color--secondary.isRangeEnd .chip:not([disabled]):hover {
|
|
596
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-secondary-hover-bg);
|
|
597
|
-
}
|
|
598
|
-
.dodo-ui-CalendarDateChip.color--secondary.isRangeEnd .chip:not([disabled]):active {
|
|
599
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-secondary-active-bg);
|
|
600
|
-
}
|
|
601
448
|
.dodo-ui-CalendarDateChip.color--safe .chip:not([disabled]) {
|
|
602
449
|
background-color: var(--dodo-ui-CalendarDateChip-safe-bg);
|
|
603
450
|
}
|
|
@@ -626,26 +473,6 @@ function onselectMod(e) {
|
|
|
626
473
|
.dodo-ui-CalendarDateChip.color--safe.selected .chip:not([disabled]):active {
|
|
627
474
|
background-color: var(--dodo-ui-CalendarDateChip-selected-safe-active-bg);
|
|
628
475
|
}
|
|
629
|
-
.dodo-ui-CalendarDateChip.color--safe.isRangeStart .chip:not([disabled]) {
|
|
630
|
-
color: var(--dodo-color-constant-white);
|
|
631
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-safe-bg);
|
|
632
|
-
}
|
|
633
|
-
.dodo-ui-CalendarDateChip.color--safe.isRangeStart .chip:not([disabled]):hover {
|
|
634
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-safe-hover-bg);
|
|
635
|
-
}
|
|
636
|
-
.dodo-ui-CalendarDateChip.color--safe.isRangeStart .chip:not([disabled]):active {
|
|
637
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-safe-active-bg);
|
|
638
|
-
}
|
|
639
|
-
.dodo-ui-CalendarDateChip.color--safe.isRangeEnd .chip:not([disabled]) {
|
|
640
|
-
color: var(--dodo-color-constant-white);
|
|
641
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-safe-bg);
|
|
642
|
-
}
|
|
643
|
-
.dodo-ui-CalendarDateChip.color--safe.isRangeEnd .chip:not([disabled]):hover {
|
|
644
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-safe-hover-bg);
|
|
645
|
-
}
|
|
646
|
-
.dodo-ui-CalendarDateChip.color--safe.isRangeEnd .chip:not([disabled]):active {
|
|
647
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-safe-active-bg);
|
|
648
|
-
}
|
|
649
476
|
.dodo-ui-CalendarDateChip.color--warning .chip:not([disabled]) {
|
|
650
477
|
background-color: var(--dodo-ui-CalendarDateChip-warning-bg);
|
|
651
478
|
}
|
|
@@ -674,26 +501,6 @@ function onselectMod(e) {
|
|
|
674
501
|
.dodo-ui-CalendarDateChip.color--warning.selected .chip:not([disabled]):active {
|
|
675
502
|
background-color: var(--dodo-ui-CalendarDateChip-selected-warning-active-bg);
|
|
676
503
|
}
|
|
677
|
-
.dodo-ui-CalendarDateChip.color--warning.isRangeStart .chip:not([disabled]) {
|
|
678
|
-
color: var(--dodo-color-constant-white);
|
|
679
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-warning-bg);
|
|
680
|
-
}
|
|
681
|
-
.dodo-ui-CalendarDateChip.color--warning.isRangeStart .chip:not([disabled]):hover {
|
|
682
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-warning-hover-bg);
|
|
683
|
-
}
|
|
684
|
-
.dodo-ui-CalendarDateChip.color--warning.isRangeStart .chip:not([disabled]):active {
|
|
685
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-warning-active-bg);
|
|
686
|
-
}
|
|
687
|
-
.dodo-ui-CalendarDateChip.color--warning.isRangeEnd .chip:not([disabled]) {
|
|
688
|
-
color: var(--dodo-color-constant-white);
|
|
689
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-warning-bg);
|
|
690
|
-
}
|
|
691
|
-
.dodo-ui-CalendarDateChip.color--warning.isRangeEnd .chip:not([disabled]):hover {
|
|
692
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-warning-hover-bg);
|
|
693
|
-
}
|
|
694
|
-
.dodo-ui-CalendarDateChip.color--warning.isRangeEnd .chip:not([disabled]):active {
|
|
695
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-warning-active-bg);
|
|
696
|
-
}
|
|
697
504
|
.dodo-ui-CalendarDateChip.color--danger .chip:not([disabled]) {
|
|
698
505
|
background-color: var(--dodo-ui-CalendarDateChip-danger-bg);
|
|
699
506
|
}
|
|
@@ -722,26 +529,6 @@ function onselectMod(e) {
|
|
|
722
529
|
.dodo-ui-CalendarDateChip.color--danger.selected .chip:not([disabled]):active {
|
|
723
530
|
background-color: var(--dodo-ui-CalendarDateChip-selected-danger-active-bg);
|
|
724
531
|
}
|
|
725
|
-
.dodo-ui-CalendarDateChip.color--danger.isRangeStart .chip:not([disabled]) {
|
|
726
|
-
color: var(--dodo-color-constant-white);
|
|
727
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-danger-bg);
|
|
728
|
-
}
|
|
729
|
-
.dodo-ui-CalendarDateChip.color--danger.isRangeStart .chip:not([disabled]):hover {
|
|
730
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-danger-hover-bg);
|
|
731
|
-
}
|
|
732
|
-
.dodo-ui-CalendarDateChip.color--danger.isRangeStart .chip:not([disabled]):active {
|
|
733
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeStart-danger-active-bg);
|
|
734
|
-
}
|
|
735
|
-
.dodo-ui-CalendarDateChip.color--danger.isRangeEnd .chip:not([disabled]) {
|
|
736
|
-
color: var(--dodo-color-constant-white);
|
|
737
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-danger-bg);
|
|
738
|
-
}
|
|
739
|
-
.dodo-ui-CalendarDateChip.color--danger.isRangeEnd .chip:not([disabled]):hover {
|
|
740
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-danger-hover-bg);
|
|
741
|
-
}
|
|
742
|
-
.dodo-ui-CalendarDateChip.color--danger.isRangeEnd .chip:not([disabled]):active {
|
|
743
|
-
background-color: var(--dodo-ui-CalendarDateChip-isRangeEnd-danger-active-bg);
|
|
744
|
-
}
|
|
745
532
|
.dodo-ui-CalendarDateChip.weekend .chip {
|
|
746
533
|
color: var(--dodo-color-danger-600);
|
|
747
534
|
}
|
|
@@ -19,8 +19,6 @@ export interface CalendarDateChipProps {
|
|
|
19
19
|
selected?: boolean;
|
|
20
20
|
/** onselect event handler */
|
|
21
21
|
onselect?: (value: Date, dayOfMonth: DateOfMonth, e: ButtonClickEvent) => void;
|
|
22
|
-
/** onselectRange event handler */
|
|
23
|
-
onselectRange?: (value: Date, type: DateRangeType, dayOfMonth: DateOfMonth, e: ButtonClickEvent) => void;
|
|
24
22
|
/** Custom Calendar Chip Content */
|
|
25
23
|
customCalendarDateChipContent?: (dayOfMonth: DateOfMonth) => Snippet;
|
|
26
24
|
/** Custom Calendar Chip Content */
|
|
@@ -33,17 +31,13 @@ export interface CalendarDateChipProps {
|
|
|
33
31
|
timezone?: string;
|
|
34
32
|
/** Whether to return the time in UTC. If true, overrides timezone. */
|
|
35
33
|
utc?: boolean;
|
|
36
|
-
/** Show Value Range */
|
|
37
|
-
showValueRange?: boolean;
|
|
38
|
-
/** Date Range Type */
|
|
39
|
-
rangeType?: DateRangeType;
|
|
40
34
|
}
|
|
41
35
|
import type { ComponentColor } from '../../../../../../../types/colors.js';
|
|
42
36
|
import type { ComponentRoundness } from '../../../../../../../types/roundness.js';
|
|
43
37
|
import type { Snippet } from 'svelte';
|
|
44
38
|
import type { ButtonClickEvent } from '../../../../../Form/Button/Button.svelte';
|
|
45
39
|
import type { ComponentSize } from '../../../../../../../types/size.js';
|
|
46
|
-
import type { DateOfMonth
|
|
40
|
+
import type { DateOfMonth } from '../../../utils/types.js';
|
|
47
41
|
declare const CalendarDateChip: import("svelte").Component<CalendarDateChipProps, {}, "ref">;
|
|
48
42
|
type CalendarDateChip = ReturnType<typeof CalendarDateChip>;
|
|
49
43
|
export default CalendarDateChip;
|