@tactics/toddle-styleguide 2.0.4 → 3.0.1
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/App.tsx +0 -12
- package/app.json +1 -0
- package/babel.config.js +14 -1
- package/index.d.ts +1 -5
- package/index.tsx +0 -8
- package/metro.config.js +11 -0
- package/package.json +1 -1
- package/src/components/atoms/backdrop/backdrop.component.d.ts +4 -7
- package/src/components/atoms/calendar/calendar.component.d.ts +6 -11
- package/src/components/atoms/check-switch/check-switch.component.d.ts +3 -6
- package/src/components/atoms/count/count.component.d.ts +3 -6
- package/src/components/atoms/footer/footer.component.d.ts +3 -9
- package/src/components/atoms/footer/footer.component.tsx +5 -7
- package/src/components/atoms/footer/footer.preview.tsx +0 -17
- package/src/components/atoms/footer/footer.styles.js +2 -2
- package/src/components/atoms/heading-components/all-caps-heading/all-caps-heading.component.d.ts +2 -10
- package/src/components/atoms/heading-components/heading1/heading1.component.d.ts +2 -10
- package/src/components/atoms/heading-components/heading2/heading2.component.d.ts +2 -10
- package/src/components/atoms/heading-components/heading3/heading3.component.d.ts +2 -10
- package/src/components/atoms/heading-components/heading4/heading4.component.d.ts +2 -10
- package/src/components/atoms/heading-components/index.d.ts +6 -6
- package/src/components/atoms/image-bubble/image-bubble.component.d.ts +6 -9
- package/src/components/atoms/increment-input/increment-input.component.d.ts +4 -8
- package/src/components/atoms/line/line.component.d.ts +4 -8
- package/src/components/atoms/logo/logo.component.d.ts +4 -4
- package/src/components/atoms/paragraph-components/index.d.ts +4 -4
- package/src/components/atoms/paragraph-components/paragraph/paragraph.component.d.ts +2 -10
- package/src/components/atoms/paragraph-components/small-text/small-text.component.d.ts +2 -10
- package/src/components/atoms/paragraph-components/tiny-text/tiny-text.component.d.ts +2 -10
- package/src/components/atoms/quick-message/quick-message.component.d.ts +5 -10
- package/src/components/atoms/split-container/split-container.component.d.ts +4 -7
- package/src/components/atoms/static-wave/static-wave.component.d.ts +6 -11
- package/src/components/atoms/text-input/text-input.component.d.ts +6 -10
- package/src/components/atoms/text-input/text-input.preview.d.ts +1 -1
- package/src/components/molecules/amount/amount.component.d.ts +8 -15
- package/src/components/molecules/avatar/avatar.component.d.ts +12 -20
- package/src/components/molecules/bare-time-picker/bare-time-picker.component.d.ts +5 -10
- package/src/components/molecules/bare-time-picker/bare-time-picker.component.native.tsx +78 -0
- package/src/components/molecules/bare-time-picker/bare-time-picker.component.tsx +16 -42
- package/src/components/molecules/bare-time-picker/bare-time-picker.styles.d.ts +12 -6
- package/src/components/molecules/bare-time-picker/bare-time-picker.styles.js +6 -0
- package/src/components/molecules/blocked-message/blocked-message.component.d.ts +2 -4
- package/src/components/molecules/button/button.component.d.ts +11 -20
- package/src/components/molecules/calendar-select/calendar-select.component.d.ts +7 -12
- package/src/components/molecules/cancel-link/cancel-link.component.d.ts +4 -7
- package/src/components/molecules/checkbox/checkbox.component.d.ts +5 -9
- package/src/components/molecules/contact-role/contact-role.component.d.ts +3 -6
- package/src/components/molecules/context-label/context-label.component.d.ts +4 -7
- package/src/components/molecules/date-input/date-input.component.d.ts +4 -7
- package/src/components/molecules/default-select/default-select.component.d.ts +3 -6
- package/src/components/molecules/department_logo/department-logo.component.d.ts +3 -5
- package/src/components/molecules/failed-to-send/failed-bubble.component.d.ts +6 -11
- package/src/components/molecules/filter-range/filter-range.component.d.ts +7 -14
- package/src/components/molecules/filter-tab/filter-tab.component.d.ts +7 -11
- package/src/components/molecules/info/info.component.d.ts +5 -9
- package/src/components/molecules/inline-error/inline-error.component.d.ts +3 -3
- package/src/components/molecules/inline-notice/inline-notice.component.d.ts +3 -3
- package/src/components/molecules/language-button/language-button.component.d.ts +4 -8
- package/src/components/molecules/message-input/message-input.component.d.ts +6 -10
- package/src/components/molecules/more-info-button/more-info-button.component.d.ts +4 -8
- package/src/components/molecules/password-input/password-input.component.d.ts +5 -9
- package/src/components/molecules/pill/pill.component.d.ts +5 -5
- package/src/components/molecules/pressable-icon/pressable-icon.component.d.ts +5 -10
- package/src/components/molecules/quick-filter/quick-filter.component.d.ts +9 -16
- package/src/components/molecules/search-input/search.component.d.ts +7 -12
- package/src/components/molecules/search-input/search.preview.d.ts +1 -1
- package/src/components/molecules/select-link/select-link.component.d.ts +4 -7
- package/src/components/molecules/select-list-item/select-list-item.component.d.ts +9 -16
- package/src/components/molecules/select-picker/select-picker.component.d.ts +8 -13
- package/src/components/molecules/selectable-list-item/selectable-list-item.component.d.ts +8 -15
- package/src/components/molecules/send-bubble/send-text-bubble.component.d.ts +7 -13
- package/src/components/molecules/snackbar/snackbar.component.d.ts +5 -8
- package/src/components/molecules/swipe/swipe.component.d.ts +5 -8
- package/src/components/molecules/swipe/swipe.component.native.tsx +78 -0
- package/src/components/molecules/swipe/swipe.component.tsx +5 -63
- package/src/components/molecules/tag/tag.component.d.ts +6 -11
- package/src/components/molecules/time-picker/time-picker.component.d.ts +5 -10
- package/src/components/molecules/time-tracker/time-tracker.component.d.ts +6 -10
- package/src/components/molecules/timeline/timeline.component.d.ts +3 -6
- package/src/components/molecules/timestamp/timestamp.component.d.ts +4 -7
- package/src/components/molecules/wave-background/wave.component.d.ts +2 -7
- package/src/components/molecules/wide-button/wide-button.component.d.ts +6 -11
- package/src/components/organisms/child-list-item/child-list-item.component.d.ts +20 -38
- package/src/components/organisms/child-list-item/components/child-list-tag.component.d.ts +3 -6
- package/src/components/organisms/contact-item/contact-item.component.d.ts +6 -11
- package/src/components/organisms/journal-entry/components/entry-type-indicator/entry-type-indicator.component.d.ts +3 -6
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.d.ts +7 -13
- package/src/components/organisms/journal-entry/journal-entry.component.d.ts +16 -30
- package/src/components/organisms/loading-indicator/animation-style.animate.d.ts +3 -13
- package/src/components/organisms/loading-indicator/dot.component.d.ts +3 -3
- package/src/components/organisms/loading-indicator/loading-indicator.component.d.ts +2 -9
- package/src/components/organisms/my-child-list-item/my-child-list-item.component.d.ts +9 -16
- package/src/components/organisms/person-info-card/person-info-card.component.d.ts +10 -18
- package/src/components/organisms/text-bubble/text-bubble.component.d.ts +12 -21
- package/src/components/organisms/timetable-edit/timetable-edit.component.d.ts +13 -25
- package/src/components/organisms/timetable-editor/components/timetable-edit-wrapper.d.ts +8 -14
- package/src/components/organisms/timetable-editor/timetable-editor-staff.component.d.ts +4 -7
- package/src/components/organisms/timetable-editor/timetable-editor.component.d.ts +4 -7
- package/src/components/templates/modal/components/fade-panel.component.d.ts +7 -14
- package/src/components/templates/modal/modal.component.d.ts +6 -12
- package/src/components/templates/popover/components/foreground/foreground.component.d.ts +4 -6
- package/src/components/templates/popover/components/modal/close/close.component.d.ts +4 -4
- package/src/components/templates/popover/components/modal/heading/heading.component.d.ts +4 -7
- package/src/components/templates/popover/components/modal/modal.component.d.ts +9 -17
- package/src/components/templates/popover/components/modal/scroll-content/scroll-content.component.d.ts +3 -5
- package/src/components/templates/popover/popover.component.d.ts +8 -15
- package/src/components/templates/popover-action/popover-action.component.tsx +1 -0
- package/src/context/loading-dots.context.d.ts +6 -9
- package/src/context/theme.context.d.ts +65 -65
- package/src/gradients/main/main.gradient.d.ts +2 -4
- package/src/icons/index.d.ts +2 -7
- package/src/icons/outline/calendar/calendar.icon.d.ts +2 -5
- package/src/icons/outline/chat/chat.icon.d.ts +2 -5
- package/src/icons/outline/chat-alt/chat-alt.icon.d.ts +2 -5
- package/src/icons/outline/check-circle/check-circle.icon.d.ts +2 -5
- package/src/icons/outline/chevron-left/chevron-left.icon.d.ts +2 -5
- package/src/icons/outline/chevron-right/chevron-right.icon.d.ts +2 -5
- package/src/icons/outline/clock/clock.icon.d.ts +2 -5
- package/src/icons/outline/cloud-download/cloud-download.icon.d.ts +2 -5
- package/src/icons/outline/currency-euro/currency-euro.icon.d.ts +2 -5
- package/src/icons/outline/document-text/document-text.icon.d.ts +2 -5
- package/src/icons/outline/exclamation/exclamation.icon.d.ts +2 -5
- package/src/icons/outline/exclamation-circle/exclamation-circle.icon.d.ts +2 -5
- package/src/icons/outline/eye/eye.icon.d.ts +2 -5
- package/src/icons/outline/eye-off/eye-off.icon.d.ts +2 -5
- package/src/icons/outline/filter/filter.icon.d.ts +2 -5
- package/src/icons/outline/information-circle/information-circle.icon.d.ts +2 -5
- package/src/icons/outline/logout/logout.icon.d.ts +2 -5
- package/src/icons/outline/mail/mail.icon.d.ts +2 -5
- package/src/icons/outline/mail-open/mail-open.icon.d.ts +2 -5
- package/src/icons/outline/menu/menu.icon.d.ts +2 -5
- package/src/icons/outline/minus-sm/minus-sm.icon.d.ts +2 -5
- package/src/icons/outline/office-building/office-building.icon.d.ts +2 -5
- package/src/icons/outline/outline.d.ts +2 -6
- package/src/icons/outline/paper-airplane/paper-airplane.icon.d.ts +2 -5
- package/src/icons/outline/paperclip/paperclip.icon.d.ts +2 -5
- package/src/icons/outline/pencil/pencil.icon.d.ts +2 -5
- package/src/icons/outline/phone/phone.icon.d.ts +2 -5
- package/src/icons/outline/photograph/photograph.icon.d.ts +2 -5
- package/src/icons/outline/plus/plus.icon.d.ts +2 -5
- package/src/icons/outline/plus-sm/plus-sm.icon.d.ts +2 -5
- package/src/icons/outline/qrcode/qrcode.icon.d.ts +2 -5
- package/src/icons/outline/refresh/refresh.icon.d.ts +2 -5
- package/src/icons/outline/search/search.icon.d.ts +2 -5
- package/src/icons/outline/selector/selector.icon.d.ts +2 -5
- package/src/icons/outline/share/share.icon.d.ts +2 -5
- package/src/icons/outline/sm-view-grid-add/sm-view-grid-add.icon.d.ts +2 -5
- package/src/icons/outline/status-online/status-online.icon.d.ts +2 -5
- package/src/icons/outline/thumb-up/thumb-up.icon.d.ts +2 -5
- package/src/icons/outline/trash/trash.icon.d.ts +2 -5
- package/src/icons/outline/user/user.icon.d.ts +2 -5
- package/src/icons/outline/user-group/user-group.icon.d.ts +2 -5
- package/src/icons/outline/users/users.icon.d.ts +2 -5
- package/src/icons/outline/xmark/xmark.icon.d.ts +2 -5
- package/src/icons/solid/calendar/calendar.icon.d.ts +2 -5
- package/src/icons/solid/chat/chat.icon.d.ts +2 -5
- package/src/icons/solid/chat-alt/chat-alt-solid.icon.d.ts +2 -5
- package/src/icons/solid/check-circle/check-circle.icon.d.ts +2 -5
- package/src/icons/solid/chevron-left/chevron-left.icon.d.ts +2 -5
- package/src/icons/solid/chevron-right/chevron-right.icon.d.ts +2 -5
- package/src/icons/solid/clock/clock-solid.icon.d.ts +2 -5
- package/src/icons/solid/cloud-download/cloud-download.icon.d.ts +2 -5
- package/src/icons/solid/currency-euro/currency-euro.icon.d.ts +2 -5
- package/src/icons/solid/document-text/document-text-solid.icon.d.ts +2 -5
- package/src/icons/solid/exclamation/exclamation.icon.d.ts +2 -5
- package/src/icons/solid/exclamation-circle/exclamation-circle.icon.d.ts +2 -5
- package/src/icons/solid/eye/eye.icon.d.ts +2 -5
- package/src/icons/solid/eye-off/eye-off.icon.d.ts +2 -5
- package/src/icons/solid/filter/filter.icon.d.ts +2 -5
- package/src/icons/solid/information-circle/information-circle-solid.icon.d.ts +2 -5
- package/src/icons/solid/logout/logout.icon.d.ts +2 -5
- package/src/icons/solid/mail/mail.icon.d.ts +2 -5
- package/src/icons/solid/mail-open/mail-open.icon.d.ts +2 -5
- package/src/icons/solid/menu/menu.icon.d.ts +2 -5
- package/src/icons/solid/minus-sm/minus-sm.icon.d.ts +2 -5
- package/src/icons/solid/office-building/office-building.icon.d.ts +2 -5
- package/src/icons/solid/paper-airplane/paper-airplane.icon.d.ts +2 -5
- package/src/icons/solid/paperclip/paperclip.icon.d.ts +2 -5
- package/src/icons/solid/pencil/pencil-solid.icon.d.ts +2 -5
- package/src/icons/solid/phone/phone-solid.icon.d.ts +2 -5
- package/src/icons/solid/photograph/photograph-solid.icon.d.ts +2 -5
- package/src/icons/solid/plus/plus.icon.d.ts +2 -5
- package/src/icons/solid/plus-sm/plus-sm.icon.d.ts +2 -5
- package/src/icons/solid/qrcode/qrcode.icon.d.ts +2 -5
- package/src/icons/solid/refresh/refresh-solid.icon.d.ts +2 -5
- package/src/icons/solid/search/search.icon.d.ts +2 -5
- package/src/icons/solid/selector/selector.icon.d.ts +2 -5
- package/src/icons/solid/share/share.icon.d.ts +2 -5
- package/src/icons/solid/sm-view-grid-add/sm-view-grid-add.icon.d.ts +2 -5
- package/src/icons/solid/solid.d.ts +2 -6
- package/src/icons/solid/status-online/status-online-solid.icon.d.ts +2 -5
- package/src/icons/solid/thumb-up/thumb-up.icon.d.ts +2 -5
- package/src/icons/solid/trash/trash-solid.icon.d.ts +2 -5
- package/src/icons/solid/user/user.icon.d.ts +2 -5
- package/src/icons/solid/user-group/user-group.icon.d.ts +2 -5
- package/src/icons/solid/users/users-solid.icon.d.ts +2 -5
- package/src/icons/solid/xmark/xmark.icon.d.ts +2 -5
- package/src/interfaces/icon.interface.d.ts +5 -5
- package/src/models/hex-color.model.d.ts +4 -4
- package/src/models/initials.model.d.ts +5 -5
- package/src/models/time-slot-record.d.ts +11 -11
- package/src/models/time-slot-sequence.d.ts +13 -15
- package/src/theme/font/font.d.ts +70 -70
- package/src/theme/font/index.d.ts +3 -3
- package/src/theme/provider/index.d.ts +3 -3
- package/src/theme/provider/parent.theme.d.ts +63 -63
- package/src/theme/provider/staff-member.theme.d.ts +63 -63
- package/src/theme/responsive/index.d.ts +2 -5
- package/src/theme/responsive/index.ts +1 -1
- package/src/theme/scale/index.d.ts +10 -10
- package/src/types/bubble-alignment.enum.d.ts +2 -2
- package/src/types/icontype.type.d.ts +1 -43
- package/src/types/keyboard-types.enum.d.ts +7 -7
- package/src/types/loading-dots.type.d.ts +6 -6
- package/src/types/size.enum.d.ts +3 -3
- package/src/types/state.enum.d.ts +4 -4
- package/src/types/text-properties.type.d.ts +8 -8
- package/src/types/timetable-edit.enum.d.ts +3 -3
- package/src/types/visual-state.enum.d.ts +5 -5
- package/src/utilities/color-handler/color-handler.d.ts +4 -12
- package/src/utilities/toddle-datetime/interfaces/duration.interface.d.ts +18 -18
- package/src/utilities/toddle-datetime/interfaces/toddle-datetime.interface.d.ts +16 -16
- package/src/utilities/toddle-datetime/toddle-datetime.class.d.ts +46 -103
- package/src/utilities/toddle-datetime/types/duration.type.d.ts +1 -1
- package/src/utilities/toddle-datetime/types/toddle-datetime.type.d.ts +2 -11
- package/tsconfig.json +2 -1
- package/src/components/organisms/day-select/day-select.component.d.ts +0 -13
- package/src/components/organisms/day-select/day-select.component.tsx +0 -122
- package/src/components/organisms/day-select/day-select.preview.d.ts +0 -2
- package/src/components/organisms/day-select/day-select.preview.tsx +0 -23
- package/src/components/organisms/day-select/day-select.styles.d.ts +0 -18
- package/src/components/organisms/day-select/day-select.styles.js +0 -22
- package/src/components/organisms/tab-view/__snapshots__/tab-view.test.js.snap +0 -421
- package/src/components/organisms/tab-view/tab-view.component.d.ts +0 -16
- package/src/components/organisms/tab-view/tab-view.component.tsx +0 -49
- package/src/components/organisms/tab-view/tab-view.preview.d.ts +0 -2
- package/src/components/organisms/tab-view/tab-view.preview.tsx +0 -37
- package/src/components/organisms/tab-view/tab-view.styles.d.ts +0 -10
- package/src/components/organisms/tab-view/tab-view.styles.js +0 -14
- package/src/components/organisms/tab-view/tab-view.test.js +0 -37
|
@@ -1,107 +1,50 @@
|
|
|
1
|
-
import {Duration as LuxonDuration} from 'luxon';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from './interfaces/toddle-datetime.interface';
|
|
7
|
-
import {DurationLike, DurationUnits} from './types/duration.type';
|
|
8
|
-
import {
|
|
9
|
-
DateTimeFormatOptions,
|
|
10
|
-
DateTimeJSOptions,
|
|
11
|
-
DateTimeUnit,
|
|
12
|
-
} from './types/toddle-datetime.type';
|
|
13
|
-
import {DurationObjectUnits} from './interfaces/duration.interface';
|
|
1
|
+
import { Duration as LuxonDuration } from 'luxon';
|
|
2
|
+
import { LocaleOptions, DateTimeOptions, DiffOptions } from './interfaces/toddle-datetime.interface';
|
|
3
|
+
import { DurationLike, DurationUnits } from './types/duration.type';
|
|
4
|
+
import { DateTimeFormatOptions, DateTimeJSOptions, DateTimeUnit } from './types/toddle-datetime.type';
|
|
5
|
+
import { DurationObjectUnits } from './interfaces/duration.interface';
|
|
14
6
|
export declare class Duration {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
private duration;
|
|
8
|
+
constructor(duration: LuxonDuration);
|
|
9
|
+
toObject(): DurationObjectUnits;
|
|
18
10
|
}
|
|
19
11
|
export declare class ToddleDateTime {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
year: number,
|
|
34
|
-
month: number,
|
|
35
|
-
opts?: DateTimeJSOptions
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
static local(
|
|
59
|
-
year: number,
|
|
60
|
-
month: number,
|
|
61
|
-
day: number,
|
|
62
|
-
hour: number,
|
|
63
|
-
minute: number,
|
|
64
|
-
second: number,
|
|
65
|
-
opts?: DateTimeJSOptions
|
|
66
|
-
): ToddleDateTime;
|
|
67
|
-
static local(
|
|
68
|
-
year: number,
|
|
69
|
-
month: number,
|
|
70
|
-
day: number,
|
|
71
|
-
hour: number,
|
|
72
|
-
minute: number,
|
|
73
|
-
second: number,
|
|
74
|
-
milliseconds: number,
|
|
75
|
-
opts?: DateTimeJSOptions
|
|
76
|
-
): ToddleDateTime;
|
|
77
|
-
static fromISO(date: string, options?: DateTimeOptions): ToddleDateTime;
|
|
78
|
-
static fromSeconds(
|
|
79
|
-
seconds: number,
|
|
80
|
-
options?: DateTimeJSOptions
|
|
81
|
-
): ToddleDateTime;
|
|
82
|
-
static get DATE_MED(): DateTimeFormatOptions;
|
|
83
|
-
get hour(): number;
|
|
84
|
-
get minute(): number;
|
|
85
|
-
get second(): number;
|
|
86
|
-
get millisecond(): number;
|
|
87
|
-
get day(): number;
|
|
88
|
-
get weekdayShort(): string;
|
|
89
|
-
plus(duration: DurationLike): ToddleDateTime;
|
|
90
|
-
minus(duration: DurationLike): ToddleDateTime;
|
|
91
|
-
startOf(unit: DateTimeUnit): ToddleDateTime;
|
|
92
|
-
endOf(unit: DateTimeUnit): ToddleDateTime;
|
|
93
|
-
toFormat(format: string, options?: LocaleOptions): string;
|
|
94
|
-
toISO(): string | null;
|
|
95
|
-
toISODate(): string | null;
|
|
96
|
-
toString(): string;
|
|
97
|
-
toLocaleString(
|
|
98
|
-
formatOptions?: DateTimeFormatOptions,
|
|
99
|
-
options?: LocaleOptions
|
|
100
|
-
): string;
|
|
101
|
-
timestamp(): number;
|
|
102
|
-
diff(
|
|
103
|
-
otherDateTime: ToddleDateTime,
|
|
104
|
-
unit?: DurationUnits,
|
|
105
|
-
options?: DiffOptions
|
|
106
|
-
): Duration;
|
|
12
|
+
private dateTime;
|
|
13
|
+
private constructor();
|
|
14
|
+
/**
|
|
15
|
+
* Create a ToddleDateTime for the current instant, in the system's time zone.
|
|
16
|
+
*
|
|
17
|
+
* Use Settings to override these default values if needed.
|
|
18
|
+
* @example
|
|
19
|
+
* ToddleDateTime.now().toISO() //~> now in the ISO format
|
|
20
|
+
*/
|
|
21
|
+
static now(): ToddleDateTime;
|
|
22
|
+
static local(opts?: DateTimeJSOptions): ToddleDateTime;
|
|
23
|
+
static local(year: number, opts?: DateTimeJSOptions): ToddleDateTime;
|
|
24
|
+
static local(year: number, month: number, opts?: DateTimeJSOptions): ToddleDateTime;
|
|
25
|
+
static local(year: number, month: number, day: number, opts?: DateTimeJSOptions): ToddleDateTime;
|
|
26
|
+
static local(year: number, month: number, day: number, hour: number, opts?: DateTimeJSOptions): ToddleDateTime;
|
|
27
|
+
static local(year: number, month: number, day: number, hour: number, minute: number, opts?: DateTimeJSOptions): ToddleDateTime;
|
|
28
|
+
static local(year: number, month: number, day: number, hour: number, minute: number, second: number, opts?: DateTimeJSOptions): ToddleDateTime;
|
|
29
|
+
static local(year: number, month: number, day: number, hour: number, minute: number, second: number, milliseconds: number, opts?: DateTimeJSOptions): ToddleDateTime;
|
|
30
|
+
static fromISO(date: string, options?: DateTimeOptions): ToddleDateTime;
|
|
31
|
+
static fromSeconds(seconds: number, options?: DateTimeJSOptions): ToddleDateTime;
|
|
32
|
+
static get DATE_MED(): DateTimeFormatOptions;
|
|
33
|
+
get hour(): number;
|
|
34
|
+
get minute(): number;
|
|
35
|
+
get second(): number;
|
|
36
|
+
get millisecond(): number;
|
|
37
|
+
get day(): number;
|
|
38
|
+
get weekdayShort(): string;
|
|
39
|
+
plus(duration: DurationLike): ToddleDateTime;
|
|
40
|
+
minus(duration: DurationLike): ToddleDateTime;
|
|
41
|
+
startOf(unit: DateTimeUnit): ToddleDateTime;
|
|
42
|
+
endOf(unit: DateTimeUnit): ToddleDateTime;
|
|
43
|
+
toFormat(format: string, options?: LocaleOptions): string;
|
|
44
|
+
toISO(): string | null;
|
|
45
|
+
toISODate(): string | null;
|
|
46
|
+
toString(): string;
|
|
47
|
+
toLocaleString(formatOptions?: DateTimeFormatOptions, options?: LocaleOptions): string;
|
|
48
|
+
timestamp(): number;
|
|
49
|
+
diff(otherDateTime: ToddleDateTime, unit?: DurationUnits, options?: DiffOptions): Duration;
|
|
107
50
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {DurationLikeObject} from '../interfaces/duration.interface';
|
|
1
|
+
import { DurationLikeObject } from '../interfaces/duration.interface';
|
|
2
2
|
export type DurationUnit = keyof DurationLikeObject;
|
|
3
3
|
export type DurationUnits = DurationUnit | DurationUnit[];
|
|
4
4
|
export type DurationLike = DurationLikeObject | number;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {DateTimeOptions} from '../interfaces/toddle-datetime.interface';
|
|
1
|
+
import { DateTimeOptions } from '../interfaces/toddle-datetime.interface';
|
|
2
2
|
export type DateTimeFormatOptions = Intl.DateTimeFormatOptions;
|
|
3
|
-
export type DateTimeUnit =
|
|
4
|
-
| 'year'
|
|
5
|
-
| 'quarter'
|
|
6
|
-
| 'month'
|
|
7
|
-
| 'week'
|
|
8
|
-
| 'day'
|
|
9
|
-
| 'hour'
|
|
10
|
-
| 'minute'
|
|
11
|
-
| 'second'
|
|
12
|
-
| 'millisecond';
|
|
3
|
+
export type DateTimeUnit = 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond';
|
|
13
4
|
export type DateTimeJSOptions = Omit<DateTimeOptions, 'setZone'>;
|
|
14
5
|
export type ConversionAccuracy = 'casual' | 'longterm';
|
package/tsconfig.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {ToddleDateTime} from '../../../utilities/toddle-datetime/toddle-datetime.class';
|
|
3
|
-
type DaySelectProps = {
|
|
4
|
-
onSelectDate: (date: ToddleDateTime) => void;
|
|
5
|
-
startDate: ToddleDateTime;
|
|
6
|
-
selectedDate: ToddleDateTime;
|
|
7
|
-
};
|
|
8
|
-
declare const DaySelect: ({
|
|
9
|
-
onSelectDate,
|
|
10
|
-
selectedDate,
|
|
11
|
-
startDate,
|
|
12
|
-
}: DaySelectProps) => React.JSX.Element;
|
|
13
|
-
export {DaySelect as DaySelect};
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import React, {useContext, useEffect, useRef, useState} from 'react';
|
|
2
|
-
import {GestureHandlerRootView} from 'react-native-gesture-handler';
|
|
3
|
-
import {View} from 'react-native';
|
|
4
|
-
import {ToddleDateTime} from '../../../utilities/toddle-datetime/toddle-datetime.class';
|
|
5
|
-
import {ThemeCtx} from '../../../context/theme.context';
|
|
6
|
-
import {Stylesheet} from './day-select.styles';
|
|
7
|
-
import {Day} from '../../molecules/day/day.component';
|
|
8
|
-
import Swipeable from 'react-native-gesture-handler/Swipeable';
|
|
9
|
-
import {Icon} from '../../../icons';
|
|
10
|
-
|
|
11
|
-
type DaySelectProps = {
|
|
12
|
-
onSelectDate: (date: ToddleDateTime) => void;
|
|
13
|
-
startDate: ToddleDateTime;
|
|
14
|
-
selectedDate: ToddleDateTime;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const DaySelect = ({onSelectDate, selectedDate, startDate}: DaySelectProps) => {
|
|
18
|
-
const context = useContext(ThemeCtx);
|
|
19
|
-
const styles = Stylesheet(context);
|
|
20
|
-
const swipeableRef = useRef<Swipeable>(null);
|
|
21
|
-
|
|
22
|
-
const createWeekDays = (day: ToddleDateTime) => {
|
|
23
|
-
let week = [];
|
|
24
|
-
for (let i = 0; i <= 6; i++) {
|
|
25
|
-
week.push(day.plus({days: i}));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return week;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const [weekData, setWeekData] = useState(
|
|
32
|
-
createWeekDays(startDate.startOf('week'))
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
setWeekData(createWeekDays(startDate.startOf('week')));
|
|
37
|
-
}, [startDate]);
|
|
38
|
-
|
|
39
|
-
const onSwipeLeft = () => {
|
|
40
|
-
let firstDayOfWeek = weekData.shift();
|
|
41
|
-
if (!firstDayOfWeek) return;
|
|
42
|
-
onSelectDate(selectedDate.minus({weeks: 1}));
|
|
43
|
-
setWeekData(createWeekDays(firstDayOfWeek.minus({weeks: 1})));
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const onSwipeRight = () => {
|
|
47
|
-
let firstDayOfWeek = weekData.shift();
|
|
48
|
-
if (!firstDayOfWeek) return;
|
|
49
|
-
onSelectDate(selectedDate.plus({weeks: 1}));
|
|
50
|
-
setWeekData(createWeekDays(firstDayOfWeek.plus({weeks: 1})));
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const isThisDaySelected = (date: ToddleDateTime) => {
|
|
54
|
-
return date.toFormat('yyyy-MM-dd') === selectedDate.toFormat('yyyy-MM-dd');
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const onClick = (date: ToddleDateTime) => {
|
|
58
|
-
onSelectDate(date);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const renderLeftActions = () => {
|
|
62
|
-
return (
|
|
63
|
-
<View style={styles.actionContainer}>
|
|
64
|
-
<Icon
|
|
65
|
-
name={'chevron-left'}
|
|
66
|
-
style="regular"
|
|
67
|
-
color={context.colors.ui.grey}
|
|
68
|
-
/>
|
|
69
|
-
</View>
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const renderRightActions = () => {
|
|
74
|
-
return (
|
|
75
|
-
<View style={styles.actionContainer}>
|
|
76
|
-
<Icon
|
|
77
|
-
name={'chevron-right'}
|
|
78
|
-
style="regular"
|
|
79
|
-
color={context.colors.ui.grey}
|
|
80
|
-
/>
|
|
81
|
-
</View>
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
const onSwipeOpen = (direction: string) => {
|
|
86
|
-
if (direction == 'left') {
|
|
87
|
-
onSwipeLeft();
|
|
88
|
-
} else if (direction == 'right') {
|
|
89
|
-
onSwipeRight();
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (swipeableRef.current) {
|
|
93
|
-
swipeableRef.current.close();
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
return (
|
|
98
|
-
<GestureHandlerRootView>
|
|
99
|
-
<Swipeable
|
|
100
|
-
ref={swipeableRef}
|
|
101
|
-
renderLeftActions={renderLeftActions}
|
|
102
|
-
renderRightActions={renderRightActions}
|
|
103
|
-
onSwipeableOpen={onSwipeOpen}
|
|
104
|
-
containerStyle={styles.container}
|
|
105
|
-
childrenContainerStyle={styles.childrenContainer}
|
|
106
|
-
overshootFriction={8}
|
|
107
|
-
>
|
|
108
|
-
{weekData.map((weekday, index) => {
|
|
109
|
-
return (
|
|
110
|
-
<Day
|
|
111
|
-
key={index}
|
|
112
|
-
date={weekday}
|
|
113
|
-
onSelect={onClick}
|
|
114
|
-
isSelected={isThisDaySelected(weekday)}
|
|
115
|
-
/>
|
|
116
|
-
);
|
|
117
|
-
})}
|
|
118
|
-
</Swipeable>
|
|
119
|
-
</GestureHandlerRootView>
|
|
120
|
-
);
|
|
121
|
-
};
|
|
122
|
-
export {DaySelect as DaySelect};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React, {useState} from 'react';
|
|
2
|
-
import {DaySelect} from './day-select.component';
|
|
3
|
-
import {View} from 'react-native';
|
|
4
|
-
|
|
5
|
-
import {ToddleDateTime} from '../../../utilities/toddle-datetime/toddle-datetime.class';
|
|
6
|
-
|
|
7
|
-
export const DaySelectPreview = ({}: {}) => {
|
|
8
|
-
const [startOfWeek, setStartOfWeek] = useState(ToddleDateTime.local());
|
|
9
|
-
|
|
10
|
-
const [selectedDate, setSelectedDate] = useState<ToddleDateTime>(
|
|
11
|
-
ToddleDateTime.local()
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<View>
|
|
16
|
-
<DaySelect
|
|
17
|
-
startDate={startOfWeek}
|
|
18
|
-
onSelectDate={setSelectedDate}
|
|
19
|
-
selectedDate={selectedDate}
|
|
20
|
-
/>
|
|
21
|
-
</View>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export function Stylesheet(context: any): {
|
|
2
|
-
container: {
|
|
3
|
-
backgroundColor: any;
|
|
4
|
-
padding: number;
|
|
5
|
-
flexDirection: 'row';
|
|
6
|
-
justifyContent: 'space-evenly';
|
|
7
|
-
borderRadius: number;
|
|
8
|
-
overflow: 'hidden';
|
|
9
|
-
};
|
|
10
|
-
childrenContainer: {
|
|
11
|
-
flexDirection: 'row';
|
|
12
|
-
justifyContent: 'space-evenly';
|
|
13
|
-
};
|
|
14
|
-
actionContainer: {
|
|
15
|
-
flexDirection: 'row';
|
|
16
|
-
alignItems: 'center';
|
|
17
|
-
};
|
|
18
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {StyleSheet} from 'react-native';
|
|
2
|
-
import {Scale} from '../../../theme/scale';
|
|
3
|
-
|
|
4
|
-
export const Stylesheet = (context) =>
|
|
5
|
-
StyleSheet.create({
|
|
6
|
-
container: {
|
|
7
|
-
backgroundColor: context.colors.ui.xlightgrey,
|
|
8
|
-
padding: Scale.s,
|
|
9
|
-
flexDirection: 'row',
|
|
10
|
-
justifyContent: 'space-evenly',
|
|
11
|
-
borderRadius: Scale.m,
|
|
12
|
-
overflow: 'hidden',
|
|
13
|
-
},
|
|
14
|
-
childrenContainer: {
|
|
15
|
-
flexDirection: 'row',
|
|
16
|
-
justifyContent: 'space-evenly',
|
|
17
|
-
},
|
|
18
|
-
actionContainer: {
|
|
19
|
-
flexDirection: 'row',
|
|
20
|
-
alignItems: 'center',
|
|
21
|
-
},
|
|
22
|
-
});
|