@koine/react 1.0.9 → 1.0.12
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/Alert/Alert.js +7 -13
- package/Animations/Reveal.js +12 -10
- package/Animations/Underline.js +3 -13
- package/Animations/useReveal.js +18 -17
- package/Autocomplete/AutocompleteDownshift.js +1 -1
- package/Autocomplete/AutocompleteDownshiftMultiselect.js +1 -1
- package/Autocomplete/AutocompleteMui.js +61 -56
- package/Autocomplete/AutocompleteReach.js +1 -1
- package/Autocomplete/components.js +17 -72
- package/Autocomplete/helpers.js +1 -1
- package/Bg/BgColor.js +14 -24
- package/Bg/BgPhoto.js +11 -54
- package/Bg/BgSvg.js +6 -9
- package/Breadcrumbs/Breadcrumbs.js +14 -54
- package/Buttons/Button.js +8 -73
- package/Buttons/ButtonComposite.js +20 -41
- package/Buttons/ButtonFab.js +4 -6
- package/Buttons/ButtonLink.js +7 -6
- package/Buttons/IconButton.js +5 -17
- package/Calendar/CalendarDaygridCell.js +20 -14
- package/Calendar/CalendarDaygridNav.js +10 -9
- package/Calendar/CalendarDaygridTable.js +32 -30
- package/Calendar/CalendarLegend.js +7 -2
- package/Calendar/calendar-api-google.js +101 -68
- package/Calendar/useCalendar.js +114 -113
- package/Calendar/utils.js +73 -74
- package/Carousel/Carousel.js +1 -1
- package/Carousel/CarouselCss.js +14 -27
- package/Collapsable/Collapsable.d.ts +1 -1
- package/Collapsable/Collapsable.js +1 -1
- package/Collapsable/CollapsableReach.d.ts +4 -64
- package/Collapsable/CollapsableReach.js +247 -129
- package/Collapsable/index.d.ts +1 -1
- package/Collapsable/index.js +2 -1
- package/Debug/Debug.js +5 -17
- package/Details/Details.d.ts +114 -0
- package/Details/Details.js +65 -0
- package/Details/index.d.ts +1 -0
- package/Details/index.js +1 -0
- package/{Forms/Form → Details}/package.json +1 -1
- package/Dialog/DialogMui.d.ts +1 -1
- package/Dialog/DialogMui.js +22 -20
- package/Dialog/css/bare.js +17 -15
- package/Dialog/m/bare.js +17 -13
- package/Dialog/m/basic.js +2 -2
- package/Dialog/m/index.js +4 -4
- package/Dialog/sc/bare.js +25 -43
- package/Dialog/sc/framer.js +6 -6
- package/Dialog/sc/framerMaterial.js +6 -6
- package/Dialog/sc/material.js +17 -37
- package/Dialog/tw/bare.js +25 -19
- package/Dialog/tw/elegant.js +17 -15
- package/Dialog/tw/framer.js +6 -6
- package/Dialog/tw/framerMaterial.js +6 -6
- package/Dialog/tw/material.js +17 -15
- package/Editor/Editor--tiptap.js +14 -11
- package/Editor/components.js +6 -24
- package/Favicon/FaviconTags.js +2 -1
- package/Form/Form.d.ts +111 -0
- package/Form/Form.js +61 -0
- package/{Forms/Form → Form}/index.d.ts +0 -0
- package/{Forms/Form → Form}/index.js +0 -0
- package/Form/package.json +6 -0
- package/Form/sc/bare.d.ts +33 -0
- package/Form/sc/bare.js +20 -0
- package/Forms/Checkbox/Checkbox.js +9 -15
- package/Forms/Feedback/Feedback.js +6 -7
- package/Forms/Field/Field.js +15 -26
- package/Forms/Field/FieldControl.js +19 -15
- package/Forms/Field/FieldHint.js +3 -5
- package/Forms/Input/Input.js +10 -16
- package/Forms/InputGroup/InputGroup.js +9 -36
- package/Forms/Label/Label.js +5 -23
- package/Forms/Password/Password.js +10 -23
- package/Forms/Radio/Radio.js +15 -18
- package/Forms/Switch/Switch.js +9 -39
- package/Forms/Textarea/Textarea.js +6 -7
- package/Forms/Textarea/TextareaRich.js +10 -24
- package/Forms/Toggle/Toggle.js +21 -68
- package/Forms/Toggle/useToggle.js +29 -29
- package/Forms/antispam.js +12 -12
- package/Forms/helpers.js +8 -7
- package/Forms/index.d.ts +0 -1
- package/Forms/index.js +0 -1
- package/Forms/styles.js +12 -43
- package/Gauge/Gauge.js +1 -1
- package/Grid/Grid.js +25 -51
- package/Hamburger/Hamburger.js +35 -47
- package/Header/useHeader.js +12 -12
- package/Hidden/Hidden.js +9 -13
- package/Img/sc/bare.js +3 -1
- package/Link/Link.js +3 -1
- package/Link/LinkBlank.js +8 -17
- package/Menu/Menu.js +3 -10
- package/MenuItem/MenuItem.js +3 -19
- package/Meta/Meta.js +3 -2
- package/NoJs/NoJs.js +2 -2
- package/Pagination/PaginationNav.js +26 -48
- package/Pagination/PaginationResults.js +7 -6
- package/Pill/Pill.js +6 -36
- package/Progress/ProgressCircular.js +9 -30
- package/Progress/ProgressLinear.js +8 -16
- package/Progress/ProgressOverlay.js +11 -27
- package/Rating/Rating.js +26 -45
- package/Rating/index.js +19 -15
- package/Select/SelectDownshift.js +1 -1
- package/Select/components.js +6 -12
- package/Sidebar/Sidebar.js +13 -38
- package/Spacing/Spacing.js +12 -12
- package/Sticky/Sticky.js +1 -1
- package/Sticky/StickyCss.js +4 -2
- package/Tabs/TabsMui.d.ts +244 -0
- package/Tabs/TabsMui.js +46 -0
- package/Tabs/index.d.ts +1 -1
- package/Tabs/index.js +1 -1
- package/Tabs/sc/bare.d.ts +5 -0
- package/Tabs/sc/bare.js +87 -0
- package/Tabs/tw/bare.d.ts +248 -0
- package/Tabs/tw/bare.js +17 -0
- package/Tabs/tw/material.d.ts +472 -0
- package/Tabs/tw/material.js +18 -0
- package/Tabs/useTabs.d.ts +43 -0
- package/Tabs/useTabs.js +44 -0
- package/Typography/CopyPasteVisible.js +3 -5
- package/Typography/Native.js +12 -45
- package/Typography/ReadMore.js +26 -52
- package/Typography/TextLoop.js +19 -22
- package/Typography/TypeStairs.js +20 -16
- package/css/index.js +1 -0
- package/helpers/classed.js +22 -18
- package/helpers/extend-component.js +6 -6
- package/hooks/index.d.ts +8 -0
- package/hooks/index.js +8 -0
- package/hooks/types.d.ts +8 -0
- package/hooks/types.js +1 -0
- package/hooks/useAsyncFn.d.ts +26 -0
- package/hooks/useAsyncFn.js +36 -0
- package/hooks/useDateLocale.js +22 -13
- package/hooks/useEffectOnce.d.ts +5 -0
- package/hooks/useEffectOnce.js +8 -0
- package/hooks/useFirstMountState.d.ts +4 -0
- package/hooks/useFirstMountState.js +12 -0
- package/hooks/useFocus.js +3 -3
- package/hooks/useId.d.ts +4 -0
- package/hooks/useId.js +8 -0
- package/hooks/useIsomorphicLayoutEffect.d.ts +5 -0
- package/hooks/useIsomorphicLayoutEffect.js +8 -0
- package/hooks/useMount.d.ts +4 -0
- package/hooks/useMount.js +9 -0
- package/hooks/useMountedState.d.ts +4 -0
- package/hooks/useMountedState.js +15 -0
- package/hooks/usePrevious.js +2 -2
- package/hooks/useScrollPosition.js +21 -16
- package/hooks/useScrollTo.js +7 -5
- package/hooks/useTraceUpdate.js +4 -3
- package/hooks/useUpdateEffect.d.ts +5 -0
- package/hooks/useUpdateEffect.js +14 -0
- package/hooks/useWindowSize.js +3 -3
- package/m/MotionProvider.js +4 -2
- package/node/Alert/Alert.js +9 -16
- package/node/Alert/index.js +1 -1
- package/node/Animations/Reveal.js +15 -13
- package/node/Animations/Underline.js +5 -16
- package/node/Animations/index.js +1 -1
- package/node/Animations/useReveal.js +19 -18
- package/node/Autocomplete/AutocompleteMui.js +69 -64
- package/node/Autocomplete/components.js +26 -82
- package/node/Autocomplete/helpers.js +2 -2
- package/node/Bg/BgColor.js +18 -29
- package/node/Bg/BgPhoto.js +15 -59
- package/node/Bg/BgSvg.js +8 -12
- package/node/Bg/index.js +1 -1
- package/node/Breadcrumbs/Breadcrumbs.js +20 -61
- package/node/Breadcrumbs/index.js +1 -1
- package/node/Buttons/Button.js +10 -76
- package/node/Buttons/ButtonComposite.js +23 -45
- package/node/Buttons/ButtonFab.js +6 -9
- package/node/Buttons/ButtonLink.js +10 -10
- package/node/Buttons/IconButton.js +7 -20
- package/node/Buttons/index.js +1 -1
- package/node/Calendar/CalendarDaygridCell.js +24 -18
- package/node/Calendar/CalendarDaygridNav.js +14 -13
- package/node/Calendar/CalendarDaygridTable.js +39 -38
- package/node/Calendar/CalendarLegend.js +8 -3
- package/node/Calendar/calendar-api-google.js +105 -73
- package/node/Calendar/index.js +1 -1
- package/node/Calendar/useCalendar.js +117 -116
- package/node/Calendar/utils.js +82 -84
- package/node/Carousel/CarouselCss.js +17 -31
- package/node/Carousel/index.js +1 -1
- package/node/Collapsable/Collapsable.js +2 -2
- package/node/Collapsable/CollapsableReach.js +246 -134
- package/node/Collapsable/index.js +3 -2
- package/node/Debug/Debug.js +7 -20
- package/node/Debug/index.js +1 -1
- package/node/Details/Details.js +67 -0
- package/node/Details/index.js +4 -0
- package/node/Dialog/DialogMui.js +12 -11
- package/node/Dialog/css/bare.js +11 -10
- package/node/Dialog/m/bare.js +18 -14
- package/node/Dialog/m/basic.js +1 -1
- package/node/Dialog/m/index.js +4 -4
- package/node/Dialog/sc/bare.js +22 -41
- package/node/Dialog/sc/framer.js +5 -5
- package/node/Dialog/sc/framerMaterial.js +5 -5
- package/node/Dialog/sc/material.js +12 -33
- package/node/Dialog/tw/bare.js +19 -14
- package/node/Dialog/tw/elegant.js +11 -9
- package/node/Dialog/tw/framer.js +5 -5
- package/node/Dialog/tw/framerMaterial.js +5 -5
- package/node/Dialog/tw/material.js +11 -9
- package/node/Editor/Editor--tiptap.js +19 -17
- package/node/Editor/components.js +9 -28
- package/node/Editor/index.js +1 -1
- package/node/Favicon/FaviconTags.js +3 -2
- package/node/Favicon/index.js +1 -1
- package/node/Form/Form.js +65 -0
- package/node/{Forms/Form → Form}/index.js +1 -1
- package/node/Form/sc/bare.js +23 -0
- package/node/Forms/Checkbox/Checkbox.js +13 -20
- package/node/Forms/Checkbox/index.js +1 -1
- package/node/Forms/Feedback/Feedback.js +8 -10
- package/node/Forms/Feedback/index.js +1 -1
- package/node/Forms/Field/Field.js +18 -30
- package/node/Forms/Field/FieldControl.js +26 -22
- package/node/Forms/Field/FieldHint.js +4 -7
- package/node/Forms/Field/index.js +1 -1
- package/node/Forms/Input/Input.js +15 -22
- package/node/Forms/Input/index.js +1 -1
- package/node/Forms/InputGroup/InputGroup.js +14 -42
- package/node/Forms/InputGroup/index.js +1 -1
- package/node/Forms/Label/Label.js +6 -25
- package/node/Forms/Label/index.js +1 -1
- package/node/Forms/Password/Password.js +16 -30
- package/node/Forms/Password/index.js +1 -1
- package/node/Forms/Radio/Radio.js +21 -25
- package/node/Forms/Radio/index.js +1 -1
- package/node/Forms/Switch/Switch.js +15 -46
- package/node/Forms/Switch/index.js +1 -1
- package/node/Forms/Textarea/Textarea.js +11 -13
- package/node/Forms/Textarea/TextareaRich.js +16 -31
- package/node/Forms/Textarea/index.js +1 -1
- package/node/Forms/Toggle/Toggle.js +24 -72
- package/node/Forms/Toggle/index.js +1 -1
- package/node/Forms/Toggle/useToggle.js +33 -33
- package/node/Forms/antispam.js +14 -14
- package/node/Forms/helpers.js +9 -8
- package/node/Forms/index.js +1 -2
- package/node/Forms/styles.js +16 -48
- package/node/Gauge/Gauge.js +1 -1
- package/node/Grid/Grid.js +24 -51
- package/node/Grid/index.js +1 -1
- package/node/Hamburger/Hamburger.js +37 -50
- package/node/Hamburger/index.js +1 -1
- package/node/Header/index.js +1 -1
- package/node/Header/useHeader.js +16 -16
- package/node/Hidden/Hidden.js +10 -15
- package/node/Hidden/index.js +1 -1
- package/node/Img/index.js +1 -1
- package/node/Img/sc/bare.js +4 -3
- package/node/Link/Link.js +4 -3
- package/node/Link/LinkBlank.js +11 -21
- package/node/Link/index.js +1 -1
- package/node/Menu/Menu.js +4 -12
- package/node/Menu/index.js +1 -1
- package/node/MenuItem/MenuItem.js +4 -21
- package/node/MenuItem/index.js +1 -1
- package/node/Meta/Meta.js +4 -3
- package/node/Meta/index.js +1 -1
- package/node/NoJs/NoJs.js +3 -3
- package/node/NoJs/index.js +1 -1
- package/node/Pagination/PaginationNav.js +30 -53
- package/node/Pagination/PaginationResults.js +10 -10
- package/node/Pagination/index.js +1 -1
- package/node/Pill/Pill.js +7 -38
- package/node/Pill/index.js +1 -1
- package/node/Progress/ProgressCircular.js +11 -33
- package/node/Progress/ProgressLinear.js +11 -20
- package/node/Progress/ProgressOverlay.js +18 -35
- package/node/Progress/index.js +1 -1
- package/node/Rating/Rating.js +28 -48
- package/node/Rating/index.js +20 -16
- package/node/Select/components.js +11 -18
- package/node/Sidebar/Sidebar.js +21 -47
- package/node/Sidebar/index.js +1 -1
- package/node/Spacing/Spacing.js +16 -17
- package/node/Spacing/index.js +1 -1
- package/node/Sticky/StickyCss.js +5 -3
- package/node/Sticky/index.js +1 -1
- package/node/Tabs/TabsMui.js +49 -0
- package/node/Tabs/index.js +2 -2
- package/node/Tabs/sc/bare.js +87 -0
- package/node/Tabs/tw/bare.js +20 -0
- package/node/Tabs/tw/material.js +21 -0
- package/node/Tabs/useTabs.js +48 -0
- package/node/Typography/CopyPasteVisible.js +4 -7
- package/node/Typography/Native.js +14 -48
- package/node/Typography/ReadMore.js +30 -57
- package/node/Typography/TextLoop.js +22 -25
- package/node/Typography/TypeStairs.js +22 -18
- package/node/Typography/index.js +1 -1
- package/node/css/index.js +2 -1
- package/node/helpers/classed.js +23 -19
- package/node/helpers/extend-component.js +7 -7
- package/node/helpers/index.js +1 -1
- package/node/hooks/index.js +9 -1
- package/node/hooks/types.js +2 -0
- package/node/hooks/useAsyncFn.js +40 -0
- package/node/hooks/useDateLocale.js +23 -37
- package/node/hooks/useEffectOnce.js +12 -0
- package/node/hooks/useFirstMountState.js +16 -0
- package/node/hooks/useFocus.js +4 -4
- package/node/hooks/useId.js +12 -0
- package/node/hooks/useIsomorphicLayoutEffect.js +11 -0
- package/node/hooks/useMount.js +13 -0
- package/node/hooks/useMountedState.js +19 -0
- package/node/hooks/usePrevious.js +3 -3
- package/node/hooks/useScrollPosition.js +23 -19
- package/node/hooks/useScrollTo.js +9 -7
- package/node/hooks/useTraceUpdate.js +5 -4
- package/node/hooks/useUpdateEffect.js +18 -0
- package/node/hooks/useWindowSize.js +4 -4
- package/node/index.js +1 -1
- package/node/m/MotionProvider.js +6 -4
- package/node/m/index.js +1 -1
- package/node/m/lite.js +1 -1
- package/node/m/max.js +1 -1
- package/node/sc/index.js +4 -2
- package/node/scm/index.js +2 -1
- package/node/shared/index.js +1 -1
- package/node/styles/Body.js +5 -10
- package/node/styles/Global.js +5 -37
- package/node/styles/index.js +1 -1
- package/node/styles/media.js +42 -38
- package/node/styles/spacing.js +15 -16
- package/node/styles/styled.js +7 -21
- package/node/styles/theme--vanilla.js +21 -19
- package/node/styles/theme.js +9 -9
- package/node/tw/index.js +2 -1
- package/node/twm/index.js +2 -1
- package/package.json +20 -9
- package/sc/index.d.ts +1 -0
- package/sc/index.js +1 -0
- package/scm/index.js +1 -0
- package/styles/Body.js +4 -8
- package/styles/Global.js +4 -36
- package/styles/media.js +41 -36
- package/styles/spacing.js +15 -16
- package/styles/styled.js +7 -21
- package/styles/theme--vanilla.js +21 -19
- package/styles/theme.js +11 -11
- package/tw/index.js +1 -0
- package/twm/index.js +1 -0
- package/Forms/Form/Form.d.ts +0 -31
- package/Forms/Form/Form.js +0 -62
- package/Tabs/Tabs.d.ts +0 -27
- package/Tabs/Tabs.js +0 -62
- package/node/Forms/Form/Form.js +0 -67
- package/node/Tabs/Tabs.js +0 -67
package/Calendar/utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
1
2
|
import isWithinInterval from "date-fns/isWithinInterval";
|
|
2
3
|
import endOfMonth from "date-fns/endOfMonth";
|
|
3
4
|
import startOfWeek from "date-fns/startOfWeek";
|
|
@@ -8,7 +9,7 @@ import subWeeks from "date-fns/subWeeks";
|
|
|
8
9
|
import addWeeks from "date-fns/addWeeks";
|
|
9
10
|
import addDays from "date-fns/addDays";
|
|
10
11
|
export function getEventTimestamp(dateLike) {
|
|
11
|
-
|
|
12
|
+
var date = new Date(dateLike);
|
|
12
13
|
date.setHours(0, 0, 0, 0);
|
|
13
14
|
return date.valueOf() / 1000;
|
|
14
15
|
}
|
|
@@ -29,7 +30,7 @@ export function getStartDate(date, view) {
|
|
|
29
30
|
return date;
|
|
30
31
|
}
|
|
31
32
|
export function getEndDate(start, view) {
|
|
32
|
-
|
|
33
|
+
var end = start;
|
|
33
34
|
if (view === "month") {
|
|
34
35
|
end = endOfMonth(start);
|
|
35
36
|
}
|
|
@@ -52,152 +53,150 @@ export function getNextDate(date, view) {
|
|
|
52
53
|
return addWeeks(date, 1);
|
|
53
54
|
}
|
|
54
55
|
export function isTodayInView(start, end) {
|
|
55
|
-
return isWithinInterval(new Date(), { start, end });
|
|
56
|
+
return isWithinInterval(new Date(), { start: start, end: end });
|
|
56
57
|
}
|
|
57
58
|
export function mergeCalendarEvents(first, second) {
|
|
58
|
-
|
|
59
|
+
var all = {};
|
|
59
60
|
addCalendarEvents(first, all);
|
|
60
61
|
addCalendarEvents(second, all);
|
|
61
62
|
return all;
|
|
62
63
|
}
|
|
63
64
|
export function addCalendarEvents(toAdd, toExtend) {
|
|
64
|
-
for (
|
|
65
|
-
|
|
66
|
-
toExtend[id] =
|
|
65
|
+
for (var id in toAdd) {
|
|
66
|
+
var event_1 = toAdd[id];
|
|
67
|
+
toExtend[id] = event_1;
|
|
67
68
|
}
|
|
68
69
|
return toExtend;
|
|
69
70
|
}
|
|
70
71
|
function getEventsByTimestamp(events) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
var output = {};
|
|
73
|
+
var _loop_1 = function (uid) {
|
|
74
|
+
var event_2 = events[uid];
|
|
75
|
+
event_2.days.forEach(function (timestamp) {
|
|
75
76
|
output[timestamp] = (output[timestamp] || {});
|
|
76
|
-
output[timestamp][uid] =
|
|
77
|
+
output[timestamp][uid] = event_2;
|
|
77
78
|
});
|
|
79
|
+
};
|
|
80
|
+
for (var uid in events) {
|
|
81
|
+
_loop_1(uid);
|
|
78
82
|
}
|
|
79
83
|
return output;
|
|
80
84
|
}
|
|
81
85
|
function getSortedEvents(events) {
|
|
82
|
-
|
|
83
|
-
for (
|
|
86
|
+
var output = [];
|
|
87
|
+
for (var uid in events) {
|
|
84
88
|
output.push(events[uid]);
|
|
85
89
|
}
|
|
86
90
|
// sort events first multi, then all day then by start then by created date
|
|
87
|
-
output.sort((a, b)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
output.sort(function (a, b) {
|
|
92
|
+
var multi = Number(b.multi) - Number(a.multi);
|
|
93
|
+
var allDay = Number(b.allDay) - Number(a.allDay);
|
|
94
|
+
var start = a.start.getTime() - b.start.getTime();
|
|
95
|
+
var created = a.created.getTime() - b.created.getTime();
|
|
92
96
|
return multi || allDay || start || created;
|
|
93
97
|
});
|
|
94
98
|
return output;
|
|
95
99
|
}
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
var FREE_SLOT = 0;
|
|
101
|
+
var BUSY_SLOT = 1;
|
|
98
102
|
export function processEventsInView(eventsMap, calendarView, month, weeks) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
props: { key:
|
|
103
|
+
var eventsByTimestamp = getEventsByTimestamp(eventsMap);
|
|
104
|
+
var eventsList = getSortedEvents(eventsMap);
|
|
105
|
+
var todayDate = new Date();
|
|
106
|
+
var todayTimestamp = getEventTimestamp(todayDate);
|
|
107
|
+
var startedAtTopMap = {};
|
|
108
|
+
var viewWeeks = [];
|
|
109
|
+
var _loop_2 = function (weekIdx) {
|
|
110
|
+
var viewWeek = {
|
|
111
|
+
props: { key: "week.".concat(weekIdx) },
|
|
108
112
|
days: [],
|
|
109
113
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
for (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
$isToday,
|
|
121
|
-
$isOutOfRange,
|
|
114
|
+
var weekStartDate = weeks[weekIdx];
|
|
115
|
+
var weekStartDay = weekStartDate.getDate();
|
|
116
|
+
var weekStartTimestamp = getEventTimestamp(new Date(weekStartDate));
|
|
117
|
+
var weekEndTimestamp = getEventTimestamp(addDays(new Date(weekStartDate), 6));
|
|
118
|
+
for (var dayNumber = 0; dayNumber < 7; dayNumber++) {
|
|
119
|
+
var dayDate = new Date(new Date(weekStartDate).setDate(weekStartDay + dayNumber));
|
|
120
|
+
var dayTimestamp = getEventTimestamp(dayDate);
|
|
121
|
+
var $isToday = todayTimestamp === dayTimestamp;
|
|
122
|
+
var $isOutOfRange = calendarView === "month" && dayDate.getMonth() !== month;
|
|
123
|
+
var contextualProps = {
|
|
124
|
+
$isToday: $isToday,
|
|
125
|
+
$isOutOfRange: $isOutOfRange,
|
|
122
126
|
};
|
|
123
|
-
|
|
124
|
-
props: { key:
|
|
127
|
+
var viewDay = {
|
|
128
|
+
props: __assign({ key: "day.".concat(dayTimestamp) }, contextualProps),
|
|
125
129
|
timestamp: dayTimestamp + "",
|
|
126
130
|
label: dayDate.getDate() + "",
|
|
127
131
|
events: [],
|
|
128
132
|
};
|
|
129
133
|
// check that we have events in this day
|
|
130
|
-
if (eventsByTimestamp
|
|
131
|
-
|
|
132
|
-
for (
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (!
|
|
134
|
+
if (eventsByTimestamp === null || eventsByTimestamp === void 0 ? void 0 : eventsByTimestamp[dayTimestamp]) {
|
|
135
|
+
var verticalSlots = Object.keys(eventsByTimestamp[dayTimestamp]).map(function () { return FREE_SLOT; });
|
|
136
|
+
for (var eventIdx = 0; eventIdx < eventsList.length; eventIdx++) {
|
|
137
|
+
var event_3 = eventsList[eventIdx];
|
|
138
|
+
var width = 1;
|
|
139
|
+
var top_1 = 0;
|
|
140
|
+
var firstOfMulti = void 0;
|
|
141
|
+
if (!event_3.daysMap[dayTimestamp]) {
|
|
138
142
|
continue;
|
|
139
143
|
}
|
|
140
144
|
// only for multi days events:
|
|
141
|
-
if (
|
|
145
|
+
if (event_3.multi) {
|
|
142
146
|
// filter out the days outside of the current week view to avoid
|
|
143
147
|
// making a multi-days event chip wider than the week row or shorter
|
|
144
148
|
// than it should be (when event spans across weeks)
|
|
145
|
-
width =
|
|
149
|
+
width = event_3.days.filter(function (t) { return t >= weekStartTimestamp && t <= weekEndTimestamp; }).length;
|
|
146
150
|
// flag the first day of multi-days events, consider that an event
|
|
147
151
|
// might start in a day earlier (hence outside) of the current
|
|
148
152
|
// week/month view, so we always check for Mondays (dayNumber === 0)
|
|
149
|
-
if (
|
|
153
|
+
if (event_3.days.indexOf(dayTimestamp) === 0 || dayNumber === 0) {
|
|
150
154
|
firstOfMulti = true;
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
157
|
// if we already have the information on when the event has been
|
|
154
158
|
// vertically positioned use that index
|
|
155
|
-
if (startedAtTopMap[
|
|
156
|
-
|
|
159
|
+
if (startedAtTopMap[event_3.uid]) {
|
|
160
|
+
top_1 = startedAtTopMap[event_3.uid];
|
|
157
161
|
}
|
|
158
162
|
else {
|
|
159
163
|
// now look for a free slot and use its index as `top`
|
|
160
|
-
for (
|
|
161
|
-
|
|
164
|
+
for (var verticalIdx = 0; verticalIdx < verticalSlots.length; verticalIdx++) {
|
|
165
|
+
var freeOrBusy = verticalSlots[verticalIdx];
|
|
162
166
|
if (freeOrBusy !== BUSY_SLOT) {
|
|
163
|
-
|
|
167
|
+
top_1 = verticalIdx;
|
|
164
168
|
break;
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
}
|
|
168
172
|
// now mark the slot as busy
|
|
169
|
-
verticalSlots[
|
|
173
|
+
verticalSlots[top_1] = BUSY_SLOT;
|
|
170
174
|
// store the slot vertical position consistently for multi-days events
|
|
171
175
|
if (firstOfMulti) {
|
|
172
|
-
startedAtTopMap[
|
|
176
|
+
startedAtTopMap[event_3.uid] = top_1;
|
|
173
177
|
}
|
|
174
178
|
// push the event, they will be sorted later
|
|
175
|
-
viewDay.events.push({
|
|
176
|
-
key: `event.${dayTimestamp}-${top}`,
|
|
177
|
-
...contextualProps,
|
|
178
|
-
...event,
|
|
179
|
-
isPast: todayDate > event.end,
|
|
180
|
-
firstOfMulti,
|
|
181
|
-
top,
|
|
182
|
-
width,
|
|
183
|
-
});
|
|
179
|
+
viewDay.events.push(__assign(__assign(__assign({ key: "event.".concat(dayTimestamp, "-").concat(top_1) }, contextualProps), event_3), { isPast: todayDate > event_3.end, firstOfMulti: firstOfMulti, top: top_1, width: width }));
|
|
184
180
|
}
|
|
185
181
|
// fill the empty slots with events' placeholders
|
|
186
|
-
for (
|
|
182
|
+
for (var i = 0; i < verticalSlots.length; i++) {
|
|
187
183
|
if (verticalSlots[i] !== BUSY_SLOT) {
|
|
188
184
|
viewDay.events.push({
|
|
189
|
-
key:
|
|
185
|
+
key: "event.".concat(dayTimestamp, "-").concat(i, "}"),
|
|
190
186
|
placeholder: true,
|
|
191
187
|
top: i,
|
|
192
188
|
});
|
|
193
189
|
}
|
|
194
190
|
}
|
|
195
191
|
// sort events and events placeholders by top position
|
|
196
|
-
viewDay.events.sort((a, b)
|
|
192
|
+
viewDay.events.sort(function (a, b) { return a.top - b.top; });
|
|
197
193
|
}
|
|
198
194
|
viewWeek.days.push(viewDay);
|
|
199
195
|
}
|
|
200
196
|
viewWeeks.push(viewWeek);
|
|
197
|
+
};
|
|
198
|
+
for (var weekIdx = 0; weekIdx < weeks.length; weekIdx++) {
|
|
199
|
+
_loop_2(weekIdx);
|
|
201
200
|
}
|
|
202
201
|
return viewWeeks;
|
|
203
202
|
}
|
package/Carousel/Carousel.js
CHANGED
package/Carousel/CarouselCss.js
CHANGED
|
@@ -1,36 +1,23 @@
|
|
|
1
|
+
import { __assign, __makeTemplateObject, __rest } from "tslib";
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Children, useId } from "react";
|
|
3
|
+
import { Children /* , useId */ } from "react";
|
|
3
4
|
import styled from "styled-components";
|
|
4
5
|
import { Row, Col, GRID_GUTTER_DEFAULT as DF, } from "../Grid";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
margin-right:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`}
|
|
12
|
-
|
|
13
|
-
scroll-behavior: smooth;
|
|
14
|
-
scroll-snap-type: x;
|
|
15
|
-
-ms-overflow-style: none;
|
|
16
|
-
scrollbar-width: none;
|
|
17
|
-
|
|
18
|
-
&::-webkit-scrollbar {
|
|
19
|
-
display: none;
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
22
|
-
export const CarouselCssCol = styled(Col) `
|
|
23
|
-
${(p) => p.$width && `flex-basis: ${p.$width}px; min-width: ${p.$width}px;`}
|
|
24
|
-
position: relative;
|
|
25
|
-
scroll-snap-align: ${(p) => p.$snap};
|
|
26
|
-
`;
|
|
6
|
+
import { useId } from "../hooks/useId";
|
|
7
|
+
export var CarouselCssRow = styled(Row)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n\n scroll-behavior: smooth;\n scroll-snap-type: x;\n -ms-overflow-style: none;\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"], ["\n ", "\n\n scroll-behavior: smooth;\n scroll-snap-type: x;\n -ms-overflow-style: none;\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"])), function (_a) {
|
|
8
|
+
var cs = _a.$gutter, gutter = _a.theme.gutter;
|
|
9
|
+
return "\n margin-left: -".concat(cs === DF ? gutter[DF] : (gutter[DF] - gutter[cs]) * 2, "px;\n margin-right: -").concat(cs === DF ? gutter[DF] : (gutter[DF] - gutter[cs]) * 2, "px;\n padding-left: ").concat(cs === DF ? gutter[DF] : gutter[DF] - gutter[cs], "px;\n padding-right: ").concat(cs === DF ? gutter[DF] : gutter[DF] - gutter[cs], "px;\n ");
|
|
10
|
+
});
|
|
11
|
+
export var CarouselCssCol = styled(Col)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n position: relative;\n scroll-snap-align: ", ";\n"], ["\n ", "\n position: relative;\n scroll-snap-align: ", ";\n"])), function (p) { return p.$width && "flex-basis: ".concat(p.$width, "px; min-width: ").concat(p.$width, "px;"); }, function (p) { return p.$snap; });
|
|
27
12
|
/**
|
|
28
13
|
* For programmatic usage an example here @see https://stackoverflow.com/a/65902068/9122820
|
|
29
14
|
*/
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
export var KoineCarouselCss = function (_a) {
|
|
16
|
+
var items = _a.items, $gutterRow = _a.$gutterRow, $gutterCol = _a.$gutterCol, _b = _a.$gutter, $gutter = _b === void 0 ? "quarter" : _b, $proportion = _a.$proportion, _c = _a.$snap, $snap = _c === void 0 ? "center" : _c, width = _a.width, children = _a.children, colProps = __rest(_a, ["items", "$gutterRow", "$gutterCol", "$gutter", "$proportion", "$snap", "width", "children"]);
|
|
17
|
+
var slides = children ? Children.toArray(children) : items;
|
|
18
|
+
var id = useId();
|
|
33
19
|
if (!slides)
|
|
34
20
|
return null;
|
|
35
|
-
return (_jsx(CarouselCssRow, { "$noWrap": true, "$gutter": $gutterRow || $gutter, children: slides.map((_slide, idx)
|
|
21
|
+
return (_jsx(CarouselCssRow, __assign({ "$noWrap": true, "$gutter": $gutterRow || $gutter }, { children: slides.map(function (_slide, idx) { return (_jsx(CarouselCssCol, __assign({}, colProps, { "$gutter": $gutterCol || $gutter, "$width": width }, { children: slides[idx] }), "CarouselCssCol-".concat(id, "-").concat(idx))); }) })));
|
|
36
22
|
};
|
|
23
|
+
var templateObject_1, templateObject_2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const Collapsable: null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var Collapsable = null;
|
|
@@ -1,66 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/// <reference types="@reach/utils/dist/declarations/src/polymorphic" />
|
|
3
|
-
import { MotionProps } from "framer-motion";
|
|
4
|
-
export declare type CollapsableStyledProps = {
|
|
5
|
-
$expanded?: boolean;
|
|
6
|
-
};
|
|
7
1
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
2
|
+
* @file
|
|
3
|
+
*
|
|
4
|
+
* Maybe do a simplified version following this example:
|
|
5
|
+
* https://codesandbox.io/s/framer-motion-accordion-qx958?file=/src/Example.tsx
|
|
10
6
|
*/
|
|
11
|
-
export declare const CollapsableRoot: import("styled-components").StyledComponent<import("react").FC<import("@reach/disclosure/dist/declarations/src").DisclosureProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
-
export declare const CollapsableHeadRoot: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLLabelElement, import("framer-motion").HTMLMotionProps<"label">>, import("styled-components").DefaultTheme, {
|
|
13
|
-
htmlFor: `${string}-input`;
|
|
14
|
-
} & Pick<CollapsableStyledProps, "$expanded">, "htmlFor">;
|
|
15
|
-
export declare const CollapsableHeadSpace: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
16
|
-
export declare const CollapsableHeadAction: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
17
|
-
export declare const CollaspableHeadLine: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, {}, never>;
|
|
18
|
-
export declare const collapsableHeadLineMotion: {
|
|
19
|
-
hover: {
|
|
20
|
-
width: string;
|
|
21
|
-
transition: {
|
|
22
|
-
duration: number;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export declare const CollapsableHeadText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
27
|
-
export declare const CollapsableHeadIcon: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, {}, never>;
|
|
28
|
-
export declare type CollapsableHeadProps = React.PropsWithChildren<Pick<CollapsableStyledProps, "$expanded"> & CollapsableComponents & {
|
|
29
|
-
id: CollapsableProps["id"];
|
|
30
|
-
onClick: (...args: any) => any;
|
|
31
|
-
}>;
|
|
32
|
-
export declare const CollapsableHead: ({ $expanded, id, onClick, HeadRoot, HeadAction, HeadIcon, children, }: CollapsableHeadProps) => JSX.Element;
|
|
33
|
-
export declare const CollapsableInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {
|
|
34
|
-
type: "checkbox";
|
|
35
|
-
}, "type">;
|
|
36
|
-
export declare const CollasableBodyWrap: import("styled-components").StyledComponent<import("@reach/utils/dist/declarations/src/polymorphic").ForwardRefComponent<"div", import("@reach/disclosure/dist/declarations/src").DisclosurePanelProps>, import("styled-components").DefaultTheme, CollapsableStyledProps, never>;
|
|
37
|
-
export declare const CollapsableBodyRoot: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, import("styled-components").DefaultTheme, {}, never>;
|
|
38
|
-
export declare type CollapsableBodyProps = MotionProps & Pick<CollapsableStyledProps, "$expanded"> & {
|
|
39
|
-
children?: React.ReactNode;
|
|
40
|
-
style?: React.CSSProperties;
|
|
41
|
-
};
|
|
42
|
-
export declare const CollapsableBody: import("react").ForwardRefExoticComponent<MotionProps & Pick<CollapsableStyledProps, "$expanded"> & {
|
|
43
|
-
children?: React.ReactNode;
|
|
44
|
-
style?: import("react").CSSProperties | undefined;
|
|
45
|
-
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
46
|
-
export declare type CollapsableComponents = {
|
|
47
|
-
HeadRoot?: typeof CollapsableHeadRoot;
|
|
48
|
-
HeadAction?: null | typeof CollapsableHeadAction | React.FC<any>;
|
|
49
|
-
HeadIcon?: null | typeof CollapsableHeadIcon | React.FC<any>;
|
|
50
|
-
};
|
|
51
|
-
export declare type CollapsableProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
52
|
-
id?: string;
|
|
53
|
-
expanded?: boolean;
|
|
54
|
-
/** Used to trigger a recalculation effect */
|
|
55
|
-
recalc?: any;
|
|
56
|
-
onChange?: () => any;
|
|
57
|
-
head: null | React.ReactNode;
|
|
58
|
-
body: React.ReactNode;
|
|
59
|
-
/** Amount of milliseconds after which the component collapses */
|
|
60
|
-
components?: CollapsableComponents;
|
|
61
|
-
/** @default "Expand" */
|
|
62
|
-
ariaExpand?: string;
|
|
63
|
-
/** @default "Collapse" */
|
|
64
|
-
ariaCollapse?: string;
|
|
65
|
-
};
|
|
66
|
-
export declare const Collapsable: ({ expanded: propExpanded, recalc, onChange, id, head, body, components, ariaExpand, ariaCollapse, ...props }: CollapsableProps) => JSX.Element;
|