@mailstep/design-system 0.7.21 → 0.7.22-beta.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/package.json +1 -1
- package/ui/Blocks/CommonGrid/styles.js +1 -1
- package/ui/Blocks/Scheduler/Scheduler.d.ts +3 -0
- package/ui/Blocks/Scheduler/Scheduler.js +27 -0
- package/ui/Blocks/Scheduler/components/CurrentTimeMarker/hooks/useCurrentTime.d.ts +5 -0
- package/ui/Blocks/Scheduler/components/CurrentTimeMarker/hooks/useCurrentTime.js +17 -0
- package/ui/Blocks/Scheduler/components/CurrentTimeMarker/index.d.ts +2 -0
- package/ui/Blocks/Scheduler/components/CurrentTimeMarker/index.js +9 -0
- package/ui/Blocks/Scheduler/components/CurrentTimeMarker/styles.d.ts +5 -0
- package/ui/Blocks/Scheduler/components/CurrentTimeMarker/styles.js +13 -0
- package/ui/Blocks/Scheduler/components/DateChanger/index.d.ts +14 -0
- package/ui/Blocks/Scheduler/components/DateChanger/index.js +19 -0
- package/ui/Blocks/Scheduler/components/DateChanger/styles.d.ts +4 -0
- package/ui/Blocks/Scheduler/components/DateChanger/styles.js +11 -0
- package/ui/Blocks/Scheduler/components/Groups/index.d.ts +7 -0
- package/ui/Blocks/Scheduler/components/Groups/index.js +6 -0
- package/ui/Blocks/Scheduler/components/Groups/styles.d.ts +6 -0
- package/ui/Blocks/Scheduler/components/Groups/styles.js +16 -0
- package/ui/Blocks/Scheduler/components/TimeSlots/hooks/useRangeSelection.d.ts +12 -0
- package/ui/Blocks/Scheduler/components/TimeSlots/hooks/useRangeSelection.js +47 -0
- package/ui/Blocks/Scheduler/components/TimeSlots/hooks/useScroll.d.ts +6 -0
- package/ui/Blocks/Scheduler/components/TimeSlots/hooks/useScroll.js +16 -0
- package/ui/Blocks/Scheduler/components/TimeSlots/index.d.ts +13 -0
- package/ui/Blocks/Scheduler/components/TimeSlots/index.js +29 -0
- package/ui/Blocks/Scheduler/components/TimeSlots/styles.d.ts +14 -0
- package/ui/Blocks/Scheduler/components/TimeSlots/styles.js +33 -0
- package/ui/Blocks/Scheduler/hooks/useChangeDate.d.ts +15 -0
- package/ui/Blocks/Scheduler/hooks/useChangeDate.js +34 -0
- package/ui/Blocks/Scheduler/index.d.ts +2 -0
- package/ui/Blocks/Scheduler/index.js +1 -0
- package/ui/Blocks/Scheduler/stories/Scheduler.stories.d.ts +7 -0
- package/ui/Blocks/Scheduler/stories/Scheduler.stories.js +35 -0
- package/ui/Blocks/Scheduler/styles.d.ts +1 -0
- package/ui/Blocks/Scheduler/styles.js +7 -0
- package/ui/Blocks/Scheduler/types.d.ts +29 -0
- package/ui/Blocks/Scheduler/types.js +1 -0
- package/ui/Blocks/Scheduler/utils/constants.d.ts +6 -0
- package/ui/Blocks/Scheduler/utils/constants.js +6 -0
- package/ui/Blocks/Scheduler/utils/convertDateToTime.d.ts +1 -0
- package/ui/Blocks/Scheduler/utils/convertDateToTime.js +5 -0
- package/ui/Blocks/Scheduler/utils/convertIndexToISOString.d.ts +1 -0
- package/ui/Blocks/Scheduler/utils/convertIndexToISOString.js +9 -0
- package/ui/Blocks/Scheduler/utils/formatDate.d.ts +1 -0
- package/ui/Blocks/Scheduler/utils/formatDate.js +4 -0
- package/ui/Blocks/Scheduler/utils/generateTimeArray.d.ts +1 -0
- package/ui/Blocks/Scheduler/utils/generateTimeArray.js +16 -0
- package/ui/Blocks/Scheduler/utils/getClosestStep.d.ts +1 -0
- package/ui/Blocks/Scheduler/utils/getClosestStep.js +9 -0
- package/ui/Blocks/Scheduler/utils/getMinutesFromString.d.ts +1 -0
- package/ui/Blocks/Scheduler/utils/getMinutesFromString.js +3 -0
- package/ui/Blocks/Scheduler/utils/getMinutesFromTime.d.ts +1 -0
- package/ui/Blocks/Scheduler/utils/getMinutesFromTime.js +4 -0
- package/ui/Blocks/Scheduler/utils/isActiveTime.d.ts +8 -0
- package/ui/Blocks/Scheduler/utils/isActiveTime.js +10 -0
- package/ui/Blocks/Scheduler/utils/isToday.d.ts +1 -0
- package/ui/Blocks/Scheduler/utils/isToday.js +4 -0
- package/ui/index.d.ts +3 -1
- package/ui/index.es.js +25623 -21576
- package/ui/index.js +3 -1
- package/ui/index.umd.js +781 -629
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { stepInMinutes } from './constants';
|
|
2
|
+
export var convertIndexToISOString = function (index) {
|
|
3
|
+
var totalMinutes = stepInMinutes * index;
|
|
4
|
+
var hours = Math.floor(totalMinutes / 60);
|
|
5
|
+
var minutes = totalMinutes % 60;
|
|
6
|
+
var today = new Date();
|
|
7
|
+
today.setHours(hours, minutes, 0, 0);
|
|
8
|
+
return today.toISOString();
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatDate: (date: Date, locale?: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateTimeArray: () => string[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { stepInMinutes } from './constants';
|
|
2
|
+
export var generateTimeArray = function () {
|
|
3
|
+
var times = [];
|
|
4
|
+
var hours = 0;
|
|
5
|
+
var minutes = 0;
|
|
6
|
+
while (hours < 24 || (hours === 24 && minutes === 0)) {
|
|
7
|
+
var time = "".concat(String(hours).padStart(2, '0'), ":").concat(String(minutes).padStart(2, '0'));
|
|
8
|
+
times.push(time);
|
|
9
|
+
minutes += stepInMinutes;
|
|
10
|
+
if (minutes === 60) {
|
|
11
|
+
minutes = 0;
|
|
12
|
+
hours += 1;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return times;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getClosestStep: (date: string) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { stepInMinutes } from './constants';
|
|
2
|
+
import { getMinutesFromString } from './getMinutesFromString';
|
|
3
|
+
export var getClosestStep = function (date) {
|
|
4
|
+
var totalMinutes = getMinutesFromString(date);
|
|
5
|
+
var closestStep = Math.round(totalMinutes / stepInMinutes) * stepInMinutes;
|
|
6
|
+
var hours = Math.floor(closestStep / 60);
|
|
7
|
+
var minutes = closestStep % 60;
|
|
8
|
+
return "".concat(String(hours).padStart(2, '0'), ":").concat(String(minutes).padStart(2, '0'));
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getMinutesFromString: (date: string) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getMinutesFromTime: (time: string) => number;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getMinutesFromTime } from './getMinutesFromTime';
|
|
2
|
+
export var isActiveTime = function (_a) {
|
|
3
|
+
var activeHours = _a.activeHours, time = _a.time;
|
|
4
|
+
if (!activeHours)
|
|
5
|
+
return true;
|
|
6
|
+
var startMinutes = getMinutesFromTime(activeHours.start);
|
|
7
|
+
var endMinutes = getMinutesFromTime(activeHours.end);
|
|
8
|
+
var timeInMinutes = getMinutesFromTime(time);
|
|
9
|
+
return timeInMinutes >= startMinutes && timeInMinutes <= endMinutes;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isToday: (date: Date) => boolean;
|
package/ui/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import LightBox from './Blocks/LightBox';
|
|
|
6
6
|
import LoginPage from './Blocks/LoginPage';
|
|
7
7
|
import Modal from './Blocks/Modal';
|
|
8
8
|
import Popover from './Blocks/Popover';
|
|
9
|
+
import Scheduler from './Blocks/Scheduler';
|
|
9
10
|
import SideMenu from './Blocks/SideMenu';
|
|
10
11
|
import Stepper from './Blocks/Stepper';
|
|
11
12
|
import Tabs from './Blocks/Tabs';
|
|
@@ -44,10 +45,11 @@ import RadioButton from './Forms/RadioButton';
|
|
|
44
45
|
import TextArea from './Forms/TextArea';
|
|
45
46
|
import ThemeProvider from './ThemeProvider';
|
|
46
47
|
import utils from './utils';
|
|
47
|
-
export { DropdownSelect, DatePicker, CommonGrid, Popover, SingleSelect, MultiSelect, Select, Card, CornerDialog, ImageList, LightBox, Modal, Tabs, Alert, Avatar, Badge, BorderedBox, Button, Dropdown, ErrorMessage, Icon, Image, Label, Line, Link, Logo, Pagination, Portal, ProgressBar, SimpleLink, SpaceAround, Spinner, Tag, Toast, Toggle, Typography, Checkbox, Input, RadioButton, ThemeProvider, utils, TextArea, LoginPage, LanguageSwitch, SideMenu, Stepper };
|
|
48
|
+
export { DropdownSelect, DatePicker, CommonGrid, Popover, SingleSelect, MultiSelect, Select, Card, CornerDialog, ImageList, LightBox, Modal, Tabs, Alert, Avatar, Badge, BorderedBox, Button, Dropdown, ErrorMessage, Icon, Image, Label, Line, Link, Logo, Pagination, Portal, ProgressBar, SimpleLink, SpaceAround, Spinner, Tag, Toast, Toggle, Typography, Checkbox, Input, RadioButton, ThemeProvider, utils, TextArea, LoginPage, LanguageSwitch, SideMenu, Stepper, Scheduler };
|
|
48
49
|
export * from './Blocks/CornerDialog';
|
|
49
50
|
export * from './Blocks/ImageList';
|
|
50
51
|
export * from './Blocks/LightBox';
|
|
52
|
+
export * from './Blocks/Scheduler';
|
|
51
53
|
export * from './Blocks/Modal';
|
|
52
54
|
export * from './Blocks/Tabs';
|
|
53
55
|
export * from './Elements/Alert';
|