@vitality-ds/components 4.12.0 → 4.15.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/AuditTrail/components/AuditItem/index.spec.js +0 -28
- package/dist/AuditTrail/logic.js +9 -10
- package/dist/AuditTrail/logic.spec.js +2 -2
- package/dist/Input/DatePicker/components/Calendar/index.js +3 -3
- package/dist/Input/DatePicker/components/Calendar/logic.js +18 -20
- package/dist/Input/DatePicker/components/Calendar/logic.spec.js +12 -10
- package/dist/Input/DatePicker/components/Calendar/styles/BaseCalendar.styles.js +0 -1
- package/dist/Input/DatePicker/constants.js +2 -2
- package/dist/Input/DatePicker/index.js +4 -4
- package/dist/Input/DatePicker/logic.js +10 -7
- package/dist/Input/DatePicker/logic.spec.js +1 -1
- package/dist/Input/DateRangePicker/constants.js +40 -36
- package/dist/Input/DateRangePicker/helpers/determineFinancialYear.js +46 -36
- package/dist/Input/DateRangePicker/helpers/determineFinancialYear.spec.js +31 -79
- package/dist/Input/DateRangePicker/logic.js +7 -4
- package/dist/Input/DurationInput/logic.js +11 -19
- package/dist/Input/DurationInput/logic.spec.js +0 -22
- package/dist/Input/TimePicker/logic.js +22 -28
- package/dist/components/src/Form/FormField/constants.d.ts +1 -1
- package/dist/components/src/Input/DatePicker/components/Calendar/logic.d.ts +7 -6
- package/dist/components/src/Input/DatePicker/components/Calendar/types.d.ts +2 -2
- package/dist/components/src/Input/DatePicker/constants.d.ts +2 -2
- package/dist/components/src/Input/DatePicker/logic.d.ts +3 -3
- package/dist/components/src/Input/DateRangePicker/constants.d.ts +24 -24
- package/dist/components/src/Input/DateRangePicker/helpers/determineFinancialYear.d.ts +2 -2
- package/dist/components/src/Input/DurationInput/logic.d.ts +1 -1
- package/dist/components/src/Input/TimePicker/index.d.ts +1 -1
- package/dist/components/src/Input/TimePicker/logic.d.ts +4 -4
- package/dist/components/src/Input/TimePicker/types.d.ts +8 -3
- package/dist/esm/AuditTrail/components/AuditItem/index.spec.js +0 -28
- package/dist/esm/AuditTrail/logic.js +8 -10
- package/dist/esm/AuditTrail/logic.spec.js +2 -2
- package/dist/esm/Input/DatePicker/components/Calendar/index.js +4 -4
- package/dist/esm/Input/DatePicker/components/Calendar/logic.js +17 -19
- package/dist/esm/Input/DatePicker/components/Calendar/logic.spec.js +12 -11
- package/dist/esm/Input/DatePicker/components/Calendar/styles/BaseCalendar.styles.js +0 -1
- package/dist/esm/Input/DatePicker/constants.js +2 -2
- package/dist/esm/Input/DatePicker/index.js +4 -4
- package/dist/esm/Input/DatePicker/logic.js +9 -7
- package/dist/esm/Input/DatePicker/logic.spec.js +1 -1
- package/dist/esm/Input/DateRangePicker/constants.js +39 -36
- package/dist/esm/Input/DateRangePicker/helpers/determineFinancialYear.js +45 -36
- package/dist/esm/Input/DateRangePicker/helpers/determineFinancialYear.spec.js +30 -79
- package/dist/esm/Input/DateRangePicker/logic.js +5 -2
- package/dist/esm/Input/DurationInput/logic.js +9 -19
- package/dist/esm/Input/DurationInput/logic.spec.js +0 -22
- package/dist/esm/Input/TimePicker/logic.js +21 -28
- package/dist/icons/src/Location.d.ts +4 -0
- package/dist/icons/src/index.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function determineThisFinancialYear(toOrFrom:
|
|
2
|
-
export declare function determineLastFinancialYear(toOrFrom:
|
|
1
|
+
export declare function determineThisFinancialYear(toOrFrom: "to" | "from"): string;
|
|
2
|
+
export declare function determineLastFinancialYear(toOrFrom: "to" | "from"): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function format(duration:
|
|
1
|
+
export declare function format(duration: string): string;
|
|
@@ -7,7 +7,7 @@ declare const TimePicker: React.ForwardRefExoticComponent<{
|
|
|
7
7
|
as?: never;
|
|
8
8
|
asChild?: never;
|
|
9
9
|
} & Omit<import("../Select/Select/primitives/types").SelectPrimitiveProps, "value" | "onChange" | "isMulti" | "valueRenderType"> & {
|
|
10
|
-
onChange: (value: import("./types").
|
|
10
|
+
onChange: (value: import("./types").EventObject) => void;
|
|
11
11
|
interval: number;
|
|
12
12
|
endTime?: "0:00" | "0:02" | "0:01" | "0:07" | "0:03" | "0:04" | "0:05" | "0:09" | "0:06" | "0:08" | "0:20" | "0:22" | "0:21" | "0:27" | "0:23" | "0:24" | "0:25" | "0:29" | "0:26" | "0:28" | "0:10" | "0:12" | "0:11" | "0:17" | "0:13" | "0:14" | "0:15" | "0:19" | "0:16" | "0:18" | "0:30" | "0:32" | "0:31" | "0:37" | "0:33" | "0:34" | "0:35" | "0:39" | "0:36" | "0:38" | "0:40" | "0:42" | "0:41" | "0:47" | "0:43" | "0:44" | "0:45" | "0:49" | "0:46" | "0:48" | "0:50" | "0:52" | "0:51" | "0:57" | "0:53" | "0:54" | "0:55" | "0:59" | "0:56" | "0:58" | "2:00" | "2:02" | "2:01" | "2:07" | "2:03" | "2:04" | "2:05" | "2:09" | "2:06" | "2:08" | "2:20" | "2:22" | "2:21" | "2:27" | "2:23" | "2:24" | "2:25" | "2:29" | "2:26" | "2:28" | "2:10" | "2:12" | "2:11" | "2:17" | "2:13" | "2:14" | "2:15" | "2:19" | "2:16" | "2:18" | "2:30" | "2:32" | "2:31" | "2:37" | "2:33" | "2:34" | "2:35" | "2:39" | "2:36" | "2:38" | "2:40" | "2:42" | "2:41" | "2:47" | "2:43" | "2:44" | "2:45" | "2:49" | "2:46" | "2:48" | "2:50" | "2:52" | "2:51" | "2:57" | "2:53" | "2:54" | "2:55" | "2:59" | "2:56" | "2:58" | "1:00" | "1:02" | "1:01" | "1:07" | "1:03" | "1:04" | "1:05" | "1:09" | "1:06" | "1:08" | "1:20" | "1:22" | "1:21" | "1:27" | "1:23" | "1:24" | "1:25" | "1:29" | "1:26" | "1:28" | "1:10" | "1:12" | "1:11" | "1:17" | "1:13" | "1:14" | "1:15" | "1:19" | "1:16" | "1:18" | "1:30" | "1:32" | "1:31" | "1:37" | "1:33" | "1:34" | "1:35" | "1:39" | "1:36" | "1:38" | "1:40" | "1:42" | "1:41" | "1:47" | "1:43" | "1:44" | "1:45" | "1:49" | "1:46" | "1:48" | "1:50" | "1:52" | "1:51" | "1:57" | "1:53" | "1:54" | "1:55" | "1:59" | "1:56" | "1:58" | "7:00" | "7:02" | "7:01" | "7:07" | "7:03" | "7:04" | "7:05" | "7:09" | "7:06" | "7:08" | "7:20" | "7:22" | "7:21" | "7:27" | "7:23" | "7:24" | "7:25" | "7:29" | "7:26" | "7:28" | "7:10" | "7:12" | "7:11" | "7:17" | "7:13" | "7:14" | "7:15" | "7:19" | "7:16" | "7:18" | "7:30" | "7:32" | "7:31" | "7:37" | "7:33" | "7:34" | "7:35" | "7:39" | "7:36" | "7:38" | "7:40" | "7:42" | "7:41" | "7:47" | "7:43" | "7:44" | "7:45" | "7:49" | "7:46" | "7:48" | "7:50" | "7:52" | "7:51" | "7:57" | "7:53" | "7:54" | "7:55" | "7:59" | "7:56" | "7:58" | "12:00" | "12:02" | "12:01" | "12:07" | "12:03" | "12:04" | "12:05" | "12:09" | "12:06" | "12:08" | "12:20" | "12:22" | "12:21" | "12:27" | "12:23" | "12:24" | "12:25" | "12:29" | "12:26" | "12:28" | "12:10" | "12:12" | "12:11" | "12:17" | "12:13" | "12:14" | "12:15" | "12:19" | "12:16" | "12:18" | "12:30" | "12:32" | "12:31" | "12:37" | "12:33" | "12:34" | "12:35" | "12:39" | "12:36" | "12:38" | "12:40" | "12:42" | "12:41" | "12:47" | "12:43" | "12:44" | "12:45" | "12:49" | "12:46" | "12:48" | "12:50" | "12:52" | "12:51" | "12:57" | "12:53" | "12:54" | "12:55" | "12:59" | "12:56" | "12:58" | "20:00" | "20:02" | "20:01" | "20:07" | "20:03" | "20:04" | "20:05" | "20:09" | "20:06" | "20:08" | "20:20" | "20:22" | "20:21" | "20:27" | "20:23" | "20:24" | "20:25" | "20:29" | "20:26" | "20:28" | "20:10" | "20:12" | "20:11" | "20:17" | "20:13" | "20:14" | "20:15" | "20:19" | "20:16" | "20:18" | "20:30" | "20:32" | "20:31" | "20:37" | "20:33" | "20:34" | "20:35" | "20:39" | "20:36" | "20:38" | "20:40" | "20:42" | "20:41" | "20:47" | "20:43" | "20:44" | "20:45" | "20:49" | "20:46" | "20:48" | "20:50" | "20:52" | "20:51" | "20:57" | "20:53" | "20:54" | "20:55" | "20:59" | "20:56" | "20:58" | "14:00" | "14:02" | "14:01" | "14:07" | "14:03" | "14:04" | "14:05" | "14:09" | "14:06" | "14:08" | "14:20" | "14:22" | "14:21" | "14:27" | "14:23" | "14:24" | "14:25" | "14:29" | "14:26" | "14:28" | "14:10" | "14:12" | "14:11" | "14:17" | "14:13" | "14:14" | "14:15" | "14:19" | "14:16" | "14:18" | "14:30" | "14:32" | "14:31" | "14:37" | "14:33" | "14:34" | "14:35" | "14:39" | "14:36" | "14:38" | "14:40" | "14:42" | "14:41" | "14:47" | "14:43" | "14:44" | "14:45" | "14:49" | "14:46" | "14:48" | "14:50" | "14:52" | "14:51" | "14:57" | "14:53" | "14:54" | "14:55" | "14:59" | "14:56" | "14:58" | "22:00" | "22:02" | "22:01" | "22:07" | "22:03" | "22:04" | "22:05" | "22:09" | "22:06" | "22:08" | "22:20" | "22:22" | "22:21" | "22:27" | "22:23" | "22:24" | "22:25" | "22:29" | "22:26" | "22:28" | "22:10" | "22:12" | "22:11" | "22:17" | "22:13" | "22:14" | "22:15" | "22:19" | "22:16" | "22:18" | "22:30" | "22:32" | "22:31" | "22:37" | "22:33" | "22:34" | "22:35" | "22:39" | "22:36" | "22:38" | "22:40" | "22:42" | "22:41" | "22:47" | "22:43" | "22:44" | "22:45" | "22:49" | "22:46" | "22:48" | "22:50" | "22:52" | "22:51" | "22:57" | "22:53" | "22:54" | "22:55" | "22:59" | "22:56" | "22:58" | "16:00" | "16:02" | "16:01" | "16:07" | "16:03" | "16:04" | "16:05" | "16:09" | "16:06" | "16:08" | "16:20" | "16:22" | "16:21" | "16:27" | "16:23" | "16:24" | "16:25" | "16:29" | "16:26" | "16:28" | "16:10" | "16:12" | "16:11" | "16:17" | "16:13" | "16:14" | "16:15" | "16:19" | "16:16" | "16:18" | "16:30" | "16:32" | "16:31" | "16:37" | "16:33" | "16:34" | "16:35" | "16:39" | "16:36" | "16:38" | "16:40" | "16:42" | "16:41" | "16:47" | "16:43" | "16:44" | "16:45" | "16:49" | "16:46" | "16:48" | "16:50" | "16:52" | "16:51" | "16:57" | "16:53" | "16:54" | "16:55" | "16:59" | "16:56" | "16:58" | "18:00" | "18:02" | "18:01" | "18:07" | "18:03" | "18:04" | "18:05" | "18:09" | "18:06" | "18:08" | "18:20" | "18:22" | "18:21" | "18:27" | "18:23" | "18:24" | "18:25" | "18:29" | "18:26" | "18:28" | "18:10" | "18:12" | "18:11" | "18:17" | "18:13" | "18:14" | "18:15" | "18:19" | "18:16" | "18:18" | "18:30" | "18:32" | "18:31" | "18:37" | "18:33" | "18:34" | "18:35" | "18:39" | "18:36" | "18:38" | "18:40" | "18:42" | "18:41" | "18:47" | "18:43" | "18:44" | "18:45" | "18:49" | "18:46" | "18:48" | "18:50" | "18:52" | "18:51" | "18:57" | "18:53" | "18:54" | "18:55" | "18:59" | "18:56" | "18:58" | "19:00" | "19:02" | "19:01" | "19:07" | "19:03" | "19:04" | "19:05" | "19:09" | "19:06" | "19:08" | "19:20" | "19:22" | "19:21" | "19:27" | "19:23" | "19:24" | "19:25" | "19:29" | "19:26" | "19:28" | "19:10" | "19:12" | "19:11" | "19:17" | "19:13" | "19:14" | "19:15" | "19:19" | "19:16" | "19:18" | "19:30" | "19:32" | "19:31" | "19:37" | "19:33" | "19:34" | "19:35" | "19:39" | "19:36" | "19:38" | "19:40" | "19:42" | "19:41" | "19:47" | "19:43" | "19:44" | "19:45" | "19:49" | "19:46" | "19:48" | "19:50" | "19:52" | "19:51" | "19:57" | "19:53" | "19:54" | "19:55" | "19:59" | "19:56" | "19:58" | "3:00" | "3:02" | "3:01" | "3:07" | "3:03" | "3:04" | "3:05" | "3:09" | "3:06" | "3:08" | "3:20" | "3:22" | "3:21" | "3:27" | "3:23" | "3:24" | "3:25" | "3:29" | "3:26" | "3:28" | "3:10" | "3:12" | "3:11" | "3:17" | "3:13" | "3:14" | "3:15" | "3:19" | "3:16" | "3:18" | "3:30" | "3:32" | "3:31" | "3:37" | "3:33" | "3:34" | "3:35" | "3:39" | "3:36" | "3:38" | "3:40" | "3:42" | "3:41" | "3:47" | "3:43" | "3:44" | "3:45" | "3:49" | "3:46" | "3:48" | "3:50" | "3:52" | "3:51" | "3:57" | "3:53" | "3:54" | "3:55" | "3:59" | "3:56" | "3:58" | "4:00" | "4:02" | "4:01" | "4:07" | "4:03" | "4:04" | "4:05" | "4:09" | "4:06" | "4:08" | "4:20" | "4:22" | "4:21" | "4:27" | "4:23" | "4:24" | "4:25" | "4:29" | "4:26" | "4:28" | "4:10" | "4:12" | "4:11" | "4:17" | "4:13" | "4:14" | "4:15" | "4:19" | "4:16" | "4:18" | "4:30" | "4:32" | "4:31" | "4:37" | "4:33" | "4:34" | "4:35" | "4:39" | "4:36" | "4:38" | "4:40" | "4:42" | "4:41" | "4:47" | "4:43" | "4:44" | "4:45" | "4:49" | "4:46" | "4:48" | "4:50" | "4:52" | "4:51" | "4:57" | "4:53" | "4:54" | "4:55" | "4:59" | "4:56" | "4:58" | "5:00" | "5:02" | "5:01" | "5:07" | "5:03" | "5:04" | "5:05" | "5:09" | "5:06" | "5:08" | "5:20" | "5:22" | "5:21" | "5:27" | "5:23" | "5:24" | "5:25" | "5:29" | "5:26" | "5:28" | "5:10" | "5:12" | "5:11" | "5:17" | "5:13" | "5:14" | "5:15" | "5:19" | "5:16" | "5:18" | "5:30" | "5:32" | "5:31" | "5:37" | "5:33" | "5:34" | "5:35" | "5:39" | "5:36" | "5:38" | "5:40" | "5:42" | "5:41" | "5:47" | "5:43" | "5:44" | "5:45" | "5:49" | "5:46" | "5:48" | "5:50" | "5:52" | "5:51" | "5:57" | "5:53" | "5:54" | "5:55" | "5:59" | "5:56" | "5:58" | "10:00" | "10:02" | "10:01" | "10:07" | "10:03" | "10:04" | "10:05" | "10:09" | "10:06" | "10:08" | "10:20" | "10:22" | "10:21" | "10:27" | "10:23" | "10:24" | "10:25" | "10:29" | "10:26" | "10:28" | "10:10" | "10:12" | "10:11" | "10:17" | "10:13" | "10:14" | "10:15" | "10:19" | "10:16" | "10:18" | "10:30" | "10:32" | "10:31" | "10:37" | "10:33" | "10:34" | "10:35" | "10:39" | "10:36" | "10:38" | "10:40" | "10:42" | "10:41" | "10:47" | "10:43" | "10:44" | "10:45" | "10:49" | "10:46" | "10:48" | "10:50" | "10:52" | "10:51" | "10:57" | "10:53" | "10:54" | "10:55" | "10:59" | "10:56" | "10:58" | "9:00" | "9:02" | "9:01" | "9:07" | "9:03" | "9:04" | "9:05" | "9:09" | "9:06" | "9:08" | "9:20" | "9:22" | "9:21" | "9:27" | "9:23" | "9:24" | "9:25" | "9:29" | "9:26" | "9:28" | "9:10" | "9:12" | "9:11" | "9:17" | "9:13" | "9:14" | "9:15" | "9:19" | "9:16" | "9:18" | "9:30" | "9:32" | "9:31" | "9:37" | "9:33" | "9:34" | "9:35" | "9:39" | "9:36" | "9:38" | "9:40" | "9:42" | "9:41" | "9:47" | "9:43" | "9:44" | "9:45" | "9:49" | "9:46" | "9:48" | "9:50" | "9:52" | "9:51" | "9:57" | "9:53" | "9:54" | "9:55" | "9:59" | "9:56" | "9:58" | "11:00" | "11:02" | "11:01" | "11:07" | "11:03" | "11:04" | "11:05" | "11:09" | "11:06" | "11:08" | "11:20" | "11:22" | "11:21" | "11:27" | "11:23" | "11:24" | "11:25" | "11:29" | "11:26" | "11:28" | "11:10" | "11:12" | "11:11" | "11:17" | "11:13" | "11:14" | "11:15" | "11:19" | "11:16" | "11:18" | "11:30" | "11:32" | "11:31" | "11:37" | "11:33" | "11:34" | "11:35" | "11:39" | "11:36" | "11:38" | "11:40" | "11:42" | "11:41" | "11:47" | "11:43" | "11:44" | "11:45" | "11:49" | "11:46" | "11:48" | "11:50" | "11:52" | "11:51" | "11:57" | "11:53" | "11:54" | "11:55" | "11:59" | "11:56" | "11:58" | "6:00" | "6:02" | "6:01" | "6:07" | "6:03" | "6:04" | "6:05" | "6:09" | "6:06" | "6:08" | "6:20" | "6:22" | "6:21" | "6:27" | "6:23" | "6:24" | "6:25" | "6:29" | "6:26" | "6:28" | "6:10" | "6:12" | "6:11" | "6:17" | "6:13" | "6:14" | "6:15" | "6:19" | "6:16" | "6:18" | "6:30" | "6:32" | "6:31" | "6:37" | "6:33" | "6:34" | "6:35" | "6:39" | "6:36" | "6:38" | "6:40" | "6:42" | "6:41" | "6:47" | "6:43" | "6:44" | "6:45" | "6:49" | "6:46" | "6:48" | "6:50" | "6:52" | "6:51" | "6:57" | "6:53" | "6:54" | "6:55" | "6:59" | "6:56" | "6:58" | "8:00" | "8:02" | "8:01" | "8:07" | "8:03" | "8:04" | "8:05" | "8:09" | "8:06" | "8:08" | "8:20" | "8:22" | "8:21" | "8:27" | "8:23" | "8:24" | "8:25" | "8:29" | "8:26" | "8:28" | "8:10" | "8:12" | "8:11" | "8:17" | "8:13" | "8:14" | "8:15" | "8:19" | "8:16" | "8:18" | "8:30" | "8:32" | "8:31" | "8:37" | "8:33" | "8:34" | "8:35" | "8:39" | "8:36" | "8:38" | "8:40" | "8:42" | "8:41" | "8:47" | "8:43" | "8:44" | "8:45" | "8:49" | "8:46" | "8:48" | "8:50" | "8:52" | "8:51" | "8:57" | "8:53" | "8:54" | "8:55" | "8:59" | "8:56" | "8:58" | "13:00" | "13:02" | "13:01" | "13:07" | "13:03" | "13:04" | "13:05" | "13:09" | "13:06" | "13:08" | "13:20" | "13:22" | "13:21" | "13:27" | "13:23" | "13:24" | "13:25" | "13:29" | "13:26" | "13:28" | "13:10" | "13:12" | "13:11" | "13:17" | "13:13" | "13:14" | "13:15" | "13:19" | "13:16" | "13:18" | "13:30" | "13:32" | "13:31" | "13:37" | "13:33" | "13:34" | "13:35" | "13:39" | "13:36" | "13:38" | "13:40" | "13:42" | "13:41" | "13:47" | "13:43" | "13:44" | "13:45" | "13:49" | "13:46" | "13:48" | "13:50" | "13:52" | "13:51" | "13:57" | "13:53" | "13:54" | "13:55" | "13:59" | "13:56" | "13:58" | "15:00" | "15:02" | "15:01" | "15:07" | "15:03" | "15:04" | "15:05" | "15:09" | "15:06" | "15:08" | "15:20" | "15:22" | "15:21" | "15:27" | "15:23" | "15:24" | "15:25" | "15:29" | "15:26" | "15:28" | "15:10" | "15:12" | "15:11" | "15:17" | "15:13" | "15:14" | "15:15" | "15:19" | "15:16" | "15:18" | "15:30" | "15:32" | "15:31" | "15:37" | "15:33" | "15:34" | "15:35" | "15:39" | "15:36" | "15:38" | "15:40" | "15:42" | "15:41" | "15:47" | "15:43" | "15:44" | "15:45" | "15:49" | "15:46" | "15:48" | "15:50" | "15:52" | "15:51" | "15:57" | "15:53" | "15:54" | "15:55" | "15:59" | "15:56" | "15:58" | "17:00" | "17:02" | "17:01" | "17:07" | "17:03" | "17:04" | "17:05" | "17:09" | "17:06" | "17:08" | "17:20" | "17:22" | "17:21" | "17:27" | "17:23" | "17:24" | "17:25" | "17:29" | "17:26" | "17:28" | "17:10" | "17:12" | "17:11" | "17:17" | "17:13" | "17:14" | "17:15" | "17:19" | "17:16" | "17:18" | "17:30" | "17:32" | "17:31" | "17:37" | "17:33" | "17:34" | "17:35" | "17:39" | "17:36" | "17:38" | "17:40" | "17:42" | "17:41" | "17:47" | "17:43" | "17:44" | "17:45" | "17:49" | "17:46" | "17:48" | "17:50" | "17:52" | "17:51" | "17:57" | "17:53" | "17:54" | "17:55" | "17:59" | "17:56" | "17:58" | "23:00" | "23:02" | "23:01" | "23:07" | "23:03" | "23:04" | "23:05" | "23:09" | "23:06" | "23:08" | "23:20" | "23:22" | "23:21" | "23:27" | "23:23" | "23:24" | "23:25" | "23:29" | "23:26" | "23:28" | "23:10" | "23:12" | "23:11" | "23:17" | "23:13" | "23:14" | "23:15" | "23:19" | "23:16" | "23:18" | "23:30" | "23:32" | "23:31" | "23:37" | "23:33" | "23:34" | "23:35" | "23:39" | "23:36" | "23:38" | "23:40" | "23:42" | "23:41" | "23:47" | "23:43" | "23:44" | "23:45" | "23:49" | "23:46" | "23:48" | "23:50" | "23:52" | "23:51" | "23:57" | "23:53" | "23:54" | "23:55" | "23:59" | "23:56" | "23:58" | "21:00" | "21:02" | "21:01" | "21:07" | "21:03" | "21:04" | "21:05" | "21:09" | "21:06" | "21:08" | "21:20" | "21:22" | "21:21" | "21:27" | "21:23" | "21:24" | "21:25" | "21:29" | "21:26" | "21:28" | "21:10" | "21:12" | "21:11" | "21:17" | "21:13" | "21:14" | "21:15" | "21:19" | "21:16" | "21:18" | "21:30" | "21:32" | "21:31" | "21:37" | "21:33" | "21:34" | "21:35" | "21:39" | "21:36" | "21:38" | "21:40" | "21:42" | "21:41" | "21:47" | "21:43" | "21:44" | "21:45" | "21:49" | "21:46" | "21:48" | "21:50" | "21:52" | "21:51" | "21:57" | "21:53" | "21:54" | "21:55" | "21:59" | "21:56" | "21:58";
|
|
13
13
|
startTime?: "0:00" | "0:02" | "0:01" | "0:07" | "0:03" | "0:04" | "0:05" | "0:09" | "0:06" | "0:08" | "0:20" | "0:22" | "0:21" | "0:27" | "0:23" | "0:24" | "0:25" | "0:29" | "0:26" | "0:28" | "0:10" | "0:12" | "0:11" | "0:17" | "0:13" | "0:14" | "0:15" | "0:19" | "0:16" | "0:18" | "0:30" | "0:32" | "0:31" | "0:37" | "0:33" | "0:34" | "0:35" | "0:39" | "0:36" | "0:38" | "0:40" | "0:42" | "0:41" | "0:47" | "0:43" | "0:44" | "0:45" | "0:49" | "0:46" | "0:48" | "0:50" | "0:52" | "0:51" | "0:57" | "0:53" | "0:54" | "0:55" | "0:59" | "0:56" | "0:58" | "2:00" | "2:02" | "2:01" | "2:07" | "2:03" | "2:04" | "2:05" | "2:09" | "2:06" | "2:08" | "2:20" | "2:22" | "2:21" | "2:27" | "2:23" | "2:24" | "2:25" | "2:29" | "2:26" | "2:28" | "2:10" | "2:12" | "2:11" | "2:17" | "2:13" | "2:14" | "2:15" | "2:19" | "2:16" | "2:18" | "2:30" | "2:32" | "2:31" | "2:37" | "2:33" | "2:34" | "2:35" | "2:39" | "2:36" | "2:38" | "2:40" | "2:42" | "2:41" | "2:47" | "2:43" | "2:44" | "2:45" | "2:49" | "2:46" | "2:48" | "2:50" | "2:52" | "2:51" | "2:57" | "2:53" | "2:54" | "2:55" | "2:59" | "2:56" | "2:58" | "1:00" | "1:02" | "1:01" | "1:07" | "1:03" | "1:04" | "1:05" | "1:09" | "1:06" | "1:08" | "1:20" | "1:22" | "1:21" | "1:27" | "1:23" | "1:24" | "1:25" | "1:29" | "1:26" | "1:28" | "1:10" | "1:12" | "1:11" | "1:17" | "1:13" | "1:14" | "1:15" | "1:19" | "1:16" | "1:18" | "1:30" | "1:32" | "1:31" | "1:37" | "1:33" | "1:34" | "1:35" | "1:39" | "1:36" | "1:38" | "1:40" | "1:42" | "1:41" | "1:47" | "1:43" | "1:44" | "1:45" | "1:49" | "1:46" | "1:48" | "1:50" | "1:52" | "1:51" | "1:57" | "1:53" | "1:54" | "1:55" | "1:59" | "1:56" | "1:58" | "7:00" | "7:02" | "7:01" | "7:07" | "7:03" | "7:04" | "7:05" | "7:09" | "7:06" | "7:08" | "7:20" | "7:22" | "7:21" | "7:27" | "7:23" | "7:24" | "7:25" | "7:29" | "7:26" | "7:28" | "7:10" | "7:12" | "7:11" | "7:17" | "7:13" | "7:14" | "7:15" | "7:19" | "7:16" | "7:18" | "7:30" | "7:32" | "7:31" | "7:37" | "7:33" | "7:34" | "7:35" | "7:39" | "7:36" | "7:38" | "7:40" | "7:42" | "7:41" | "7:47" | "7:43" | "7:44" | "7:45" | "7:49" | "7:46" | "7:48" | "7:50" | "7:52" | "7:51" | "7:57" | "7:53" | "7:54" | "7:55" | "7:59" | "7:56" | "7:58" | "12:00" | "12:02" | "12:01" | "12:07" | "12:03" | "12:04" | "12:05" | "12:09" | "12:06" | "12:08" | "12:20" | "12:22" | "12:21" | "12:27" | "12:23" | "12:24" | "12:25" | "12:29" | "12:26" | "12:28" | "12:10" | "12:12" | "12:11" | "12:17" | "12:13" | "12:14" | "12:15" | "12:19" | "12:16" | "12:18" | "12:30" | "12:32" | "12:31" | "12:37" | "12:33" | "12:34" | "12:35" | "12:39" | "12:36" | "12:38" | "12:40" | "12:42" | "12:41" | "12:47" | "12:43" | "12:44" | "12:45" | "12:49" | "12:46" | "12:48" | "12:50" | "12:52" | "12:51" | "12:57" | "12:53" | "12:54" | "12:55" | "12:59" | "12:56" | "12:58" | "20:00" | "20:02" | "20:01" | "20:07" | "20:03" | "20:04" | "20:05" | "20:09" | "20:06" | "20:08" | "20:20" | "20:22" | "20:21" | "20:27" | "20:23" | "20:24" | "20:25" | "20:29" | "20:26" | "20:28" | "20:10" | "20:12" | "20:11" | "20:17" | "20:13" | "20:14" | "20:15" | "20:19" | "20:16" | "20:18" | "20:30" | "20:32" | "20:31" | "20:37" | "20:33" | "20:34" | "20:35" | "20:39" | "20:36" | "20:38" | "20:40" | "20:42" | "20:41" | "20:47" | "20:43" | "20:44" | "20:45" | "20:49" | "20:46" | "20:48" | "20:50" | "20:52" | "20:51" | "20:57" | "20:53" | "20:54" | "20:55" | "20:59" | "20:56" | "20:58" | "14:00" | "14:02" | "14:01" | "14:07" | "14:03" | "14:04" | "14:05" | "14:09" | "14:06" | "14:08" | "14:20" | "14:22" | "14:21" | "14:27" | "14:23" | "14:24" | "14:25" | "14:29" | "14:26" | "14:28" | "14:10" | "14:12" | "14:11" | "14:17" | "14:13" | "14:14" | "14:15" | "14:19" | "14:16" | "14:18" | "14:30" | "14:32" | "14:31" | "14:37" | "14:33" | "14:34" | "14:35" | "14:39" | "14:36" | "14:38" | "14:40" | "14:42" | "14:41" | "14:47" | "14:43" | "14:44" | "14:45" | "14:49" | "14:46" | "14:48" | "14:50" | "14:52" | "14:51" | "14:57" | "14:53" | "14:54" | "14:55" | "14:59" | "14:56" | "14:58" | "22:00" | "22:02" | "22:01" | "22:07" | "22:03" | "22:04" | "22:05" | "22:09" | "22:06" | "22:08" | "22:20" | "22:22" | "22:21" | "22:27" | "22:23" | "22:24" | "22:25" | "22:29" | "22:26" | "22:28" | "22:10" | "22:12" | "22:11" | "22:17" | "22:13" | "22:14" | "22:15" | "22:19" | "22:16" | "22:18" | "22:30" | "22:32" | "22:31" | "22:37" | "22:33" | "22:34" | "22:35" | "22:39" | "22:36" | "22:38" | "22:40" | "22:42" | "22:41" | "22:47" | "22:43" | "22:44" | "22:45" | "22:49" | "22:46" | "22:48" | "22:50" | "22:52" | "22:51" | "22:57" | "22:53" | "22:54" | "22:55" | "22:59" | "22:56" | "22:58" | "16:00" | "16:02" | "16:01" | "16:07" | "16:03" | "16:04" | "16:05" | "16:09" | "16:06" | "16:08" | "16:20" | "16:22" | "16:21" | "16:27" | "16:23" | "16:24" | "16:25" | "16:29" | "16:26" | "16:28" | "16:10" | "16:12" | "16:11" | "16:17" | "16:13" | "16:14" | "16:15" | "16:19" | "16:16" | "16:18" | "16:30" | "16:32" | "16:31" | "16:37" | "16:33" | "16:34" | "16:35" | "16:39" | "16:36" | "16:38" | "16:40" | "16:42" | "16:41" | "16:47" | "16:43" | "16:44" | "16:45" | "16:49" | "16:46" | "16:48" | "16:50" | "16:52" | "16:51" | "16:57" | "16:53" | "16:54" | "16:55" | "16:59" | "16:56" | "16:58" | "18:00" | "18:02" | "18:01" | "18:07" | "18:03" | "18:04" | "18:05" | "18:09" | "18:06" | "18:08" | "18:20" | "18:22" | "18:21" | "18:27" | "18:23" | "18:24" | "18:25" | "18:29" | "18:26" | "18:28" | "18:10" | "18:12" | "18:11" | "18:17" | "18:13" | "18:14" | "18:15" | "18:19" | "18:16" | "18:18" | "18:30" | "18:32" | "18:31" | "18:37" | "18:33" | "18:34" | "18:35" | "18:39" | "18:36" | "18:38" | "18:40" | "18:42" | "18:41" | "18:47" | "18:43" | "18:44" | "18:45" | "18:49" | "18:46" | "18:48" | "18:50" | "18:52" | "18:51" | "18:57" | "18:53" | "18:54" | "18:55" | "18:59" | "18:56" | "18:58" | "19:00" | "19:02" | "19:01" | "19:07" | "19:03" | "19:04" | "19:05" | "19:09" | "19:06" | "19:08" | "19:20" | "19:22" | "19:21" | "19:27" | "19:23" | "19:24" | "19:25" | "19:29" | "19:26" | "19:28" | "19:10" | "19:12" | "19:11" | "19:17" | "19:13" | "19:14" | "19:15" | "19:19" | "19:16" | "19:18" | "19:30" | "19:32" | "19:31" | "19:37" | "19:33" | "19:34" | "19:35" | "19:39" | "19:36" | "19:38" | "19:40" | "19:42" | "19:41" | "19:47" | "19:43" | "19:44" | "19:45" | "19:49" | "19:46" | "19:48" | "19:50" | "19:52" | "19:51" | "19:57" | "19:53" | "19:54" | "19:55" | "19:59" | "19:56" | "19:58" | "3:00" | "3:02" | "3:01" | "3:07" | "3:03" | "3:04" | "3:05" | "3:09" | "3:06" | "3:08" | "3:20" | "3:22" | "3:21" | "3:27" | "3:23" | "3:24" | "3:25" | "3:29" | "3:26" | "3:28" | "3:10" | "3:12" | "3:11" | "3:17" | "3:13" | "3:14" | "3:15" | "3:19" | "3:16" | "3:18" | "3:30" | "3:32" | "3:31" | "3:37" | "3:33" | "3:34" | "3:35" | "3:39" | "3:36" | "3:38" | "3:40" | "3:42" | "3:41" | "3:47" | "3:43" | "3:44" | "3:45" | "3:49" | "3:46" | "3:48" | "3:50" | "3:52" | "3:51" | "3:57" | "3:53" | "3:54" | "3:55" | "3:59" | "3:56" | "3:58" | "4:00" | "4:02" | "4:01" | "4:07" | "4:03" | "4:04" | "4:05" | "4:09" | "4:06" | "4:08" | "4:20" | "4:22" | "4:21" | "4:27" | "4:23" | "4:24" | "4:25" | "4:29" | "4:26" | "4:28" | "4:10" | "4:12" | "4:11" | "4:17" | "4:13" | "4:14" | "4:15" | "4:19" | "4:16" | "4:18" | "4:30" | "4:32" | "4:31" | "4:37" | "4:33" | "4:34" | "4:35" | "4:39" | "4:36" | "4:38" | "4:40" | "4:42" | "4:41" | "4:47" | "4:43" | "4:44" | "4:45" | "4:49" | "4:46" | "4:48" | "4:50" | "4:52" | "4:51" | "4:57" | "4:53" | "4:54" | "4:55" | "4:59" | "4:56" | "4:58" | "5:00" | "5:02" | "5:01" | "5:07" | "5:03" | "5:04" | "5:05" | "5:09" | "5:06" | "5:08" | "5:20" | "5:22" | "5:21" | "5:27" | "5:23" | "5:24" | "5:25" | "5:29" | "5:26" | "5:28" | "5:10" | "5:12" | "5:11" | "5:17" | "5:13" | "5:14" | "5:15" | "5:19" | "5:16" | "5:18" | "5:30" | "5:32" | "5:31" | "5:37" | "5:33" | "5:34" | "5:35" | "5:39" | "5:36" | "5:38" | "5:40" | "5:42" | "5:41" | "5:47" | "5:43" | "5:44" | "5:45" | "5:49" | "5:46" | "5:48" | "5:50" | "5:52" | "5:51" | "5:57" | "5:53" | "5:54" | "5:55" | "5:59" | "5:56" | "5:58" | "10:00" | "10:02" | "10:01" | "10:07" | "10:03" | "10:04" | "10:05" | "10:09" | "10:06" | "10:08" | "10:20" | "10:22" | "10:21" | "10:27" | "10:23" | "10:24" | "10:25" | "10:29" | "10:26" | "10:28" | "10:10" | "10:12" | "10:11" | "10:17" | "10:13" | "10:14" | "10:15" | "10:19" | "10:16" | "10:18" | "10:30" | "10:32" | "10:31" | "10:37" | "10:33" | "10:34" | "10:35" | "10:39" | "10:36" | "10:38" | "10:40" | "10:42" | "10:41" | "10:47" | "10:43" | "10:44" | "10:45" | "10:49" | "10:46" | "10:48" | "10:50" | "10:52" | "10:51" | "10:57" | "10:53" | "10:54" | "10:55" | "10:59" | "10:56" | "10:58" | "9:00" | "9:02" | "9:01" | "9:07" | "9:03" | "9:04" | "9:05" | "9:09" | "9:06" | "9:08" | "9:20" | "9:22" | "9:21" | "9:27" | "9:23" | "9:24" | "9:25" | "9:29" | "9:26" | "9:28" | "9:10" | "9:12" | "9:11" | "9:17" | "9:13" | "9:14" | "9:15" | "9:19" | "9:16" | "9:18" | "9:30" | "9:32" | "9:31" | "9:37" | "9:33" | "9:34" | "9:35" | "9:39" | "9:36" | "9:38" | "9:40" | "9:42" | "9:41" | "9:47" | "9:43" | "9:44" | "9:45" | "9:49" | "9:46" | "9:48" | "9:50" | "9:52" | "9:51" | "9:57" | "9:53" | "9:54" | "9:55" | "9:59" | "9:56" | "9:58" | "11:00" | "11:02" | "11:01" | "11:07" | "11:03" | "11:04" | "11:05" | "11:09" | "11:06" | "11:08" | "11:20" | "11:22" | "11:21" | "11:27" | "11:23" | "11:24" | "11:25" | "11:29" | "11:26" | "11:28" | "11:10" | "11:12" | "11:11" | "11:17" | "11:13" | "11:14" | "11:15" | "11:19" | "11:16" | "11:18" | "11:30" | "11:32" | "11:31" | "11:37" | "11:33" | "11:34" | "11:35" | "11:39" | "11:36" | "11:38" | "11:40" | "11:42" | "11:41" | "11:47" | "11:43" | "11:44" | "11:45" | "11:49" | "11:46" | "11:48" | "11:50" | "11:52" | "11:51" | "11:57" | "11:53" | "11:54" | "11:55" | "11:59" | "11:56" | "11:58" | "6:00" | "6:02" | "6:01" | "6:07" | "6:03" | "6:04" | "6:05" | "6:09" | "6:06" | "6:08" | "6:20" | "6:22" | "6:21" | "6:27" | "6:23" | "6:24" | "6:25" | "6:29" | "6:26" | "6:28" | "6:10" | "6:12" | "6:11" | "6:17" | "6:13" | "6:14" | "6:15" | "6:19" | "6:16" | "6:18" | "6:30" | "6:32" | "6:31" | "6:37" | "6:33" | "6:34" | "6:35" | "6:39" | "6:36" | "6:38" | "6:40" | "6:42" | "6:41" | "6:47" | "6:43" | "6:44" | "6:45" | "6:49" | "6:46" | "6:48" | "6:50" | "6:52" | "6:51" | "6:57" | "6:53" | "6:54" | "6:55" | "6:59" | "6:56" | "6:58" | "8:00" | "8:02" | "8:01" | "8:07" | "8:03" | "8:04" | "8:05" | "8:09" | "8:06" | "8:08" | "8:20" | "8:22" | "8:21" | "8:27" | "8:23" | "8:24" | "8:25" | "8:29" | "8:26" | "8:28" | "8:10" | "8:12" | "8:11" | "8:17" | "8:13" | "8:14" | "8:15" | "8:19" | "8:16" | "8:18" | "8:30" | "8:32" | "8:31" | "8:37" | "8:33" | "8:34" | "8:35" | "8:39" | "8:36" | "8:38" | "8:40" | "8:42" | "8:41" | "8:47" | "8:43" | "8:44" | "8:45" | "8:49" | "8:46" | "8:48" | "8:50" | "8:52" | "8:51" | "8:57" | "8:53" | "8:54" | "8:55" | "8:59" | "8:56" | "8:58" | "13:00" | "13:02" | "13:01" | "13:07" | "13:03" | "13:04" | "13:05" | "13:09" | "13:06" | "13:08" | "13:20" | "13:22" | "13:21" | "13:27" | "13:23" | "13:24" | "13:25" | "13:29" | "13:26" | "13:28" | "13:10" | "13:12" | "13:11" | "13:17" | "13:13" | "13:14" | "13:15" | "13:19" | "13:16" | "13:18" | "13:30" | "13:32" | "13:31" | "13:37" | "13:33" | "13:34" | "13:35" | "13:39" | "13:36" | "13:38" | "13:40" | "13:42" | "13:41" | "13:47" | "13:43" | "13:44" | "13:45" | "13:49" | "13:46" | "13:48" | "13:50" | "13:52" | "13:51" | "13:57" | "13:53" | "13:54" | "13:55" | "13:59" | "13:56" | "13:58" | "15:00" | "15:02" | "15:01" | "15:07" | "15:03" | "15:04" | "15:05" | "15:09" | "15:06" | "15:08" | "15:20" | "15:22" | "15:21" | "15:27" | "15:23" | "15:24" | "15:25" | "15:29" | "15:26" | "15:28" | "15:10" | "15:12" | "15:11" | "15:17" | "15:13" | "15:14" | "15:15" | "15:19" | "15:16" | "15:18" | "15:30" | "15:32" | "15:31" | "15:37" | "15:33" | "15:34" | "15:35" | "15:39" | "15:36" | "15:38" | "15:40" | "15:42" | "15:41" | "15:47" | "15:43" | "15:44" | "15:45" | "15:49" | "15:46" | "15:48" | "15:50" | "15:52" | "15:51" | "15:57" | "15:53" | "15:54" | "15:55" | "15:59" | "15:56" | "15:58" | "17:00" | "17:02" | "17:01" | "17:07" | "17:03" | "17:04" | "17:05" | "17:09" | "17:06" | "17:08" | "17:20" | "17:22" | "17:21" | "17:27" | "17:23" | "17:24" | "17:25" | "17:29" | "17:26" | "17:28" | "17:10" | "17:12" | "17:11" | "17:17" | "17:13" | "17:14" | "17:15" | "17:19" | "17:16" | "17:18" | "17:30" | "17:32" | "17:31" | "17:37" | "17:33" | "17:34" | "17:35" | "17:39" | "17:36" | "17:38" | "17:40" | "17:42" | "17:41" | "17:47" | "17:43" | "17:44" | "17:45" | "17:49" | "17:46" | "17:48" | "17:50" | "17:52" | "17:51" | "17:57" | "17:53" | "17:54" | "17:55" | "17:59" | "17:56" | "17:58" | "23:00" | "23:02" | "23:01" | "23:07" | "23:03" | "23:04" | "23:05" | "23:09" | "23:06" | "23:08" | "23:20" | "23:22" | "23:21" | "23:27" | "23:23" | "23:24" | "23:25" | "23:29" | "23:26" | "23:28" | "23:10" | "23:12" | "23:11" | "23:17" | "23:13" | "23:14" | "23:15" | "23:19" | "23:16" | "23:18" | "23:30" | "23:32" | "23:31" | "23:37" | "23:33" | "23:34" | "23:35" | "23:39" | "23:36" | "23:38" | "23:40" | "23:42" | "23:41" | "23:47" | "23:43" | "23:44" | "23:45" | "23:49" | "23:46" | "23:48" | "23:50" | "23:52" | "23:51" | "23:57" | "23:53" | "23:54" | "23:55" | "23:59" | "23:56" | "23:58" | "21:00" | "21:02" | "21:01" | "21:07" | "21:03" | "21:04" | "21:05" | "21:09" | "21:06" | "21:08" | "21:20" | "21:22" | "21:21" | "21:27" | "21:23" | "21:24" | "21:25" | "21:29" | "21:26" | "21:28" | "21:10" | "21:12" | "21:11" | "21:17" | "21:13" | "21:14" | "21:15" | "21:19" | "21:16" | "21:18" | "21:30" | "21:32" | "21:31" | "21:37" | "21:33" | "21:34" | "21:35" | "21:39" | "21:36" | "21:38" | "21:40" | "21:42" | "21:41" | "21:47" | "21:43" | "21:44" | "21:45" | "21:49" | "21:46" | "21:48" | "21:50" | "21:52" | "21:51" | "21:57" | "21:53" | "21:54" | "21:55" | "21:59" | "21:56" | "21:58";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function timeIntervals(interval:
|
|
3
|
-
export declare function validateTime(time:
|
|
4
|
-
export declare function createEventObject(inputTime:
|
|
1
|
+
import { EventObject, SemanticTime, TimeList } from "./types";
|
|
2
|
+
export declare function timeIntervals(interval: number, startTime: SemanticTime, endTime: SemanticTime, disabledTimes: string[]): TimeList;
|
|
3
|
+
export declare function validateTime(time: string): boolean;
|
|
4
|
+
export declare function createEventObject(inputTime: string, disabledTimes: string[]): EventObject;
|
|
5
5
|
export declare const parseTimeString: (timeStringParam: any) => {
|
|
6
6
|
hours: number;
|
|
7
7
|
minutes: number;
|
|
@@ -4,18 +4,23 @@ import { ERROR_MESSAGES } from "./constants";
|
|
|
4
4
|
declare type MinuteSmall = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
5
5
|
declare type MinuteBig = 0 | 1 | 2 | 3 | 4 | 5;
|
|
6
6
|
declare type Hour = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23;
|
|
7
|
-
declare type SemanticTime = `${Hour}:${MinuteBig}${MinuteSmall}`;
|
|
7
|
+
export declare type SemanticTime = `${Hour}:${MinuteBig}${MinuteSmall}`;
|
|
8
8
|
export declare type ErrorMessageType = (typeof ERROR_MESSAGES)[keyof typeof ERROR_MESSAGES] | null;
|
|
9
|
-
export declare type
|
|
9
|
+
export declare type EventObject = {
|
|
10
10
|
value: string;
|
|
11
11
|
isValid: boolean;
|
|
12
12
|
errorMessage: ErrorMessageType;
|
|
13
13
|
};
|
|
14
|
+
export declare type TimeList = {
|
|
15
|
+
label: string;
|
|
16
|
+
value: string;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
}[];
|
|
14
19
|
export declare type TimePickerProps = ExcludedProps & Omit<SelectPrimitiveProps, "onChange" | "value" | "isMulti" | "valueRenderType"> & {
|
|
15
20
|
/**
|
|
16
21
|
* The function that will be called when the value of the input changes
|
|
17
22
|
*/
|
|
18
|
-
onChange: (value:
|
|
23
|
+
onChange: (value: EventObject) => void;
|
|
19
24
|
/**
|
|
20
25
|
* The time difference (in minutes) for each suggested time
|
|
21
26
|
*/
|
|
@@ -252,20 +252,6 @@ describe("<AuditItem />", function () {
|
|
|
252
252
|
});
|
|
253
253
|
});
|
|
254
254
|
});
|
|
255
|
-
describe("and dateTime is invalid because date is impossible", function () {
|
|
256
|
-
var item = {
|
|
257
|
-
action: "create",
|
|
258
|
-
dateTime: "2024-22-22 15:30:00"
|
|
259
|
-
};
|
|
260
|
-
it("does not render the date time or leading text", function () {
|
|
261
|
-
render(/*#__PURE__*/React.createElement(AuditItem, {
|
|
262
|
-
item: item
|
|
263
|
-
}));
|
|
264
|
-
|
|
265
|
-
// this regex should match any word that isn't Created
|
|
266
|
-
expect(screen.queryAllByText(/\b(?!Created)\w+\b/)).toHaveLength(0);
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
255
|
});
|
|
270
256
|
describe("and dateTime is invalid because not resembling a date", function () {
|
|
271
257
|
var item = {
|
|
@@ -277,20 +263,6 @@ describe("<AuditItem />", function () {
|
|
|
277
263
|
item: item
|
|
278
264
|
}));
|
|
279
265
|
|
|
280
|
-
// this regex should match any word that isn't Created
|
|
281
|
-
expect(screen.queryAllByText(/\b(?!Created)\w+\b/)).toHaveLength(0);
|
|
282
|
-
});
|
|
283
|
-
});
|
|
284
|
-
describe("and dateTime is not given", function () {
|
|
285
|
-
var item = {
|
|
286
|
-
action: "create",
|
|
287
|
-
dateTime: "2024-22-22 15:30:00"
|
|
288
|
-
};
|
|
289
|
-
it("does not render the date time or leading text", function () {
|
|
290
|
-
render(/*#__PURE__*/React.createElement(AuditItem, {
|
|
291
|
-
item: item
|
|
292
|
-
}));
|
|
293
|
-
|
|
294
266
|
// this regex should match any word that isn't Created
|
|
295
267
|
expect(screen.queryAllByText(/\b(?!Created)\w+\b/)).toHaveLength(0);
|
|
296
268
|
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
import relativeTime from "dayjs/plugin/relativeTime";
|
|
2
3
|
import { APPLICATION_ICON_TRIGGERS, BRAND_ICONS, TITLES_TO_IGNORE } from "./constants";
|
|
4
|
+
dayjs.extend(relativeTime);
|
|
3
5
|
export var getTimes = function getTimes(timestamp) {
|
|
4
6
|
if (!timestamp) {
|
|
5
7
|
return {
|
|
@@ -9,19 +11,15 @@ export var getTimes = function getTimes(timestamp) {
|
|
|
9
11
|
invalidTime: null
|
|
10
12
|
};
|
|
11
13
|
}
|
|
12
|
-
var dateTime =
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var time = dateTime.toFormat("tt", {
|
|
17
|
-
locale: "en-US"
|
|
18
|
-
});
|
|
19
|
-
var humanTime = dateTime.toRelative();
|
|
14
|
+
var dateTime = dayjs(timestamp);
|
|
15
|
+
var date = dateTime.format("DD/MM/YYYY");
|
|
16
|
+
var time = dateTime.format("h:mm:ss A");
|
|
17
|
+
var humanTime = dateTime.isValid() ? dateTime.fromNow() : null;
|
|
20
18
|
return {
|
|
21
19
|
date: date,
|
|
22
20
|
time: time,
|
|
23
21
|
humanTime: humanTime,
|
|
24
|
-
invalidTime: dateTime.
|
|
22
|
+
invalidTime: !dateTime.isValid()
|
|
25
23
|
};
|
|
26
24
|
};
|
|
27
25
|
export var getBrand = function getBrand(name) {
|
|
@@ -23,8 +23,8 @@ describe("auditTrail logic", function () {
|
|
|
23
23
|
test("should return null for date, time, and human time and true for invalid when timestamp is invalid", function () {
|
|
24
24
|
var timestamp = "invalid_timestamp";
|
|
25
25
|
var result = getTimes(timestamp);
|
|
26
|
-
expect(result.date).toBe("Invalid
|
|
27
|
-
expect(result.time).toBe("Invalid
|
|
26
|
+
expect(result.date).toBe("Invalid Date");
|
|
27
|
+
expect(result.time).toBe("Invalid Date");
|
|
28
28
|
expect(result.humanTime).toBeNull();
|
|
29
29
|
expect(result.invalidTime).toBeTruthy();
|
|
30
30
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { ChevronLeft, ChevronRight } from "@vitality-ds/icons";
|
|
3
|
-
import
|
|
3
|
+
import dayjs from "dayjs";
|
|
4
4
|
import React, { useReducer } from "react";
|
|
5
5
|
import { MonthView } from "react-calendar";
|
|
6
6
|
import IconButton from "../../../../IconButton";
|
|
7
7
|
import { Select } from "../../../Select";
|
|
8
8
|
import { CALENDAR_CONSTANTS } from "./constants";
|
|
9
9
|
import useCalendar from "./hooks/useCalendar";
|
|
10
|
-
import {
|
|
10
|
+
import { convertYearMonthStateToDate, dateObjectToShortHand, determineSelectedDate, generateMonths, generateYears, getInitialState, stateManager } from "./logic";
|
|
11
11
|
import { BaseCalendar, TopBarContainer } from "./styled";
|
|
12
12
|
export default function Calendar(_ref) {
|
|
13
13
|
var minYear = _ref.minYear,
|
|
@@ -19,7 +19,7 @@ export default function Calendar(_ref) {
|
|
|
19
19
|
onSelectedDateChange = _ref.onSelectedDateChange;
|
|
20
20
|
var _useReducer = useReducer(function (reducerState, action) {
|
|
21
21
|
return stateManager(reducerState, action, minYear, maxYear);
|
|
22
|
-
}, getInitialState(
|
|
22
|
+
}, getInitialState(dayjs(), determineSelectedDate(selectedDate, showFirstDateInRangeOnOpen))),
|
|
23
23
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
24
24
|
state = _useReducer2[0],
|
|
25
25
|
dispatch = _useReducer2[1];
|
|
@@ -73,7 +73,7 @@ export default function Calendar(_ref) {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
})), /*#__PURE__*/React.createElement(MonthView, {
|
|
76
|
-
activeStartDate:
|
|
76
|
+
activeStartDate: convertYearMonthStateToDate(state.selectedYear.yearInt, state.selectedMonth.monthInt),
|
|
77
77
|
onMouseOver: handleMouseOver,
|
|
78
78
|
hover: Array.isArray(selectedDate) && hoverValue,
|
|
79
79
|
value: selectedDate,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import
|
|
3
|
+
import dayjs from "dayjs";
|
|
4
4
|
import { MONTHS, TOOLTIP_TEXTS } from "./constants";
|
|
5
5
|
export function generateYears(minYear, maxYear) {
|
|
6
6
|
var arr = [];
|
|
@@ -22,7 +22,7 @@ export function generateMonths() {
|
|
|
22
22
|
}
|
|
23
23
|
return arr;
|
|
24
24
|
}
|
|
25
|
-
export function
|
|
25
|
+
export function convertYearMonthStateToDate(year, month) {
|
|
26
26
|
return new Date(year, month);
|
|
27
27
|
}
|
|
28
28
|
export var determineSelectedDate = function determineSelectedDate(selectedDate, showFirstDateInRangeOnOpen) {
|
|
@@ -42,47 +42,45 @@ export var determineSelectedDate = function determineSelectedDate(selectedDate,
|
|
|
42
42
|
};
|
|
43
43
|
export function getInitialState(currentTime, selectedDate) {
|
|
44
44
|
if (selectedDate) {
|
|
45
|
-
var
|
|
45
|
+
var selectedDateAsDayjs = dayjs(selectedDate);
|
|
46
46
|
return {
|
|
47
47
|
selectedMonth: {
|
|
48
|
-
// -1 to align the luxon current time with Date constructor and array indexes
|
|
49
48
|
value: {
|
|
50
|
-
value: MONTHS[
|
|
51
|
-
label: MONTHS[
|
|
49
|
+
value: MONTHS[selectedDateAsDayjs.month()],
|
|
50
|
+
label: MONTHS[selectedDateAsDayjs.month()]
|
|
52
51
|
},
|
|
53
|
-
monthInt:
|
|
52
|
+
monthInt: selectedDateAsDayjs.month()
|
|
54
53
|
},
|
|
55
54
|
selectedYear: {
|
|
56
55
|
value: {
|
|
57
|
-
value:
|
|
58
|
-
label:
|
|
56
|
+
value: selectedDateAsDayjs.year().toString(),
|
|
57
|
+
label: selectedDateAsDayjs.year().toString()
|
|
59
58
|
},
|
|
60
|
-
yearInt:
|
|
59
|
+
yearInt: selectedDateAsDayjs.year()
|
|
61
60
|
}
|
|
62
61
|
};
|
|
63
62
|
}
|
|
64
63
|
return {
|
|
65
64
|
selectedMonth: {
|
|
66
|
-
// -1 to align the luxon current time with Date constructor and array indexes
|
|
67
65
|
value: {
|
|
68
|
-
value: MONTHS[currentTime.month
|
|
69
|
-
label: MONTHS[currentTime.month
|
|
66
|
+
value: MONTHS[currentTime.month()],
|
|
67
|
+
label: MONTHS[currentTime.month()]
|
|
70
68
|
},
|
|
71
|
-
monthInt: currentTime.month
|
|
69
|
+
monthInt: currentTime.month()
|
|
72
70
|
},
|
|
73
71
|
selectedYear: {
|
|
74
72
|
value: {
|
|
75
|
-
value: currentTime.year.toString(),
|
|
76
|
-
label: currentTime.year.toString()
|
|
73
|
+
value: currentTime.year().toString(),
|
|
74
|
+
label: currentTime.year().toString()
|
|
77
75
|
},
|
|
78
|
-
yearInt: currentTime.year
|
|
76
|
+
yearInt: currentTime.year()
|
|
79
77
|
}
|
|
80
78
|
};
|
|
81
79
|
}
|
|
82
80
|
export function dateObjectToShortHand(date) {
|
|
83
81
|
if (date instanceof Date) {
|
|
84
|
-
var time =
|
|
85
|
-
return time.
|
|
82
|
+
var time = dayjs(date);
|
|
83
|
+
return time.format("DD/MM/YYYY");
|
|
86
84
|
}
|
|
87
85
|
throw new Error("Parsed value is not an instance of the JS Date object, and therefore cannot be converted, ensure inputted value is an instance of Date");
|
|
88
86
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
import objectSupport from "dayjs/plugin/objectSupport";
|
|
2
3
|
import { MONTHS, TOOLTIP_TEXTS } from "./constants";
|
|
3
|
-
import {
|
|
4
|
+
import { convertYearMonthStateToDate, dateObjectToShortHand, determineSelectedDate, generateMonths, generateYears, getInitialState, getTooltipContents, stateManager } from "./logic";
|
|
5
|
+
dayjs.extend(objectSupport);
|
|
4
6
|
describe("generateYears", function () {
|
|
5
7
|
it("should return an array of objects with label and value properties", function () {
|
|
6
8
|
var minYear = 2000;
|
|
@@ -70,17 +72,17 @@ describe("generateMonths", function () {
|
|
|
70
72
|
expect(monthValues).toEqual(["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]);
|
|
71
73
|
});
|
|
72
74
|
});
|
|
73
|
-
describe("
|
|
75
|
+
describe("convertYearMonthStateToDate", function () {
|
|
74
76
|
it("should return a valid Date object", function () {
|
|
75
77
|
var year = 2021;
|
|
76
78
|
var month = 0; // January
|
|
77
|
-
var date =
|
|
79
|
+
var date = convertYearMonthStateToDate(year, month);
|
|
78
80
|
expect(date instanceof Date).toBeTruthy();
|
|
79
81
|
});
|
|
80
82
|
it("should return the correct date for the given year and month", function () {
|
|
81
83
|
var year = 2020;
|
|
82
84
|
var month = 4; // May
|
|
83
|
-
var date =
|
|
85
|
+
var date = convertYearMonthStateToDate(year, month);
|
|
84
86
|
expect(date.getFullYear()).toBe(year);
|
|
85
87
|
expect(date.getMonth()).toBe(month);
|
|
86
88
|
});
|
|
@@ -89,7 +91,7 @@ describe("getInitialState", function () {
|
|
|
89
91
|
it("returns the correct initial state when selectedDate is provided", function () {
|
|
90
92
|
var selectedDate = new Date("2022-01-01");
|
|
91
93
|
// the currentTime call doesn't matter and doesn't need to remain consistant
|
|
92
|
-
var currentTime =
|
|
94
|
+
var currentTime = dayjs();
|
|
93
95
|
var initialState = getInitialState(currentTime, selectedDate);
|
|
94
96
|
expect(initialState).toEqual({
|
|
95
97
|
selectedMonth: {
|
|
@@ -109,10 +111,9 @@ describe("getInitialState", function () {
|
|
|
109
111
|
});
|
|
110
112
|
});
|
|
111
113
|
it("returns the correct initial state when selectedDate is not provided", function () {
|
|
112
|
-
|
|
113
|
-
var currentTime = DateTime.fromObject({
|
|
114
|
+
var currentTime = dayjs({
|
|
114
115
|
year: 2022,
|
|
115
|
-
month:
|
|
116
|
+
month: 4
|
|
116
117
|
});
|
|
117
118
|
var selectedDate = null;
|
|
118
119
|
var initialState = getInitialState(currentTime, selectedDate);
|
|
@@ -255,9 +256,9 @@ describe("stateManager", function () {
|
|
|
255
256
|
var minYear;
|
|
256
257
|
var maxYear;
|
|
257
258
|
beforeEach(function () {
|
|
258
|
-
state = getInitialState(
|
|
259
|
+
state = getInitialState(dayjs({
|
|
259
260
|
year: 2022,
|
|
260
|
-
month:
|
|
261
|
+
month: 0
|
|
261
262
|
}), null);
|
|
262
263
|
minYear = 2020;
|
|
263
264
|
maxYear = 2030;
|
|
@@ -56,7 +56,6 @@ export default css({
|
|
|
56
56
|
backgroundImage: "linear-gradient(to right, $$underlineColor, $$underlineColor)",
|
|
57
57
|
backgroundPosition: "4px 26px",
|
|
58
58
|
backgroundRepeat: "no-repeat",
|
|
59
|
-
backgroundClip: "content-box",
|
|
60
59
|
backgroundSize: "32px 2px",
|
|
61
60
|
"&:hover": {
|
|
62
61
|
backgroundColor: getColorScaleValueByUseCase("neutral", backgrounds.uiElement_hovered),
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["name", "value", "onChange", "minYear", "maxYear", "id", "disabled", "css", "style", "className", "as", "asChild", "calendarValue", "openCalendarOnFocus", "onSelectedDateChange", "showFirstDateInRangeOnOpen", "onKeyDown"];
|
|
4
4
|
import { Date } from "@vitality-ds/icons";
|
|
5
|
-
import
|
|
5
|
+
import dayjs from "dayjs";
|
|
6
6
|
import React from "react";
|
|
7
7
|
import Popover from "../../Popover";
|
|
8
8
|
import TextInput from "../TextInput";
|
|
@@ -40,7 +40,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
|
40
40
|
return null;
|
|
41
41
|
} : _ref$onKeyDown,
|
|
42
42
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
-
var currentTime =
|
|
43
|
+
var currentTime = dayjs();
|
|
44
44
|
var iconButtonId = "".concat(id, "IconButton");
|
|
45
45
|
var _useDatePicker = useDatePicker(onChange, onSelectedDateChange, value, openCalendarOnFocus, onKeyDown, id, iconButtonId),
|
|
46
46
|
onCalendarCallbackValueChange = _useDatePicker.onCalendarCallbackValueChange,
|
|
@@ -89,8 +89,8 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
|
|
|
89
89
|
selectedDate: calendarValue || shortHandToDateObject(textValue),
|
|
90
90
|
name: name,
|
|
91
91
|
id: id,
|
|
92
|
-
minYear: minYear || currentTime.year - 5,
|
|
93
|
-
maxYear: maxYear || currentTime.year + 5
|
|
92
|
+
minYear: minYear || currentTime.year() - 5,
|
|
93
|
+
maxYear: maxYear || currentTime.year() + 5
|
|
94
94
|
})
|
|
95
95
|
}));
|
|
96
96
|
});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
2
3
|
import { AUS_FORMAT, ERRORS, ISO_FORMAT } from "./constants";
|
|
4
|
+
dayjs.extend(customParseFormat);
|
|
3
5
|
export function shortHandToDateObject(date) {
|
|
4
6
|
if (date) {
|
|
5
|
-
var time =
|
|
6
|
-
if (time.isValid) {
|
|
7
|
-
return time.
|
|
7
|
+
var time = dayjs(date, AUS_FORMAT, true);
|
|
8
|
+
if (time.isValid()) {
|
|
9
|
+
return time.toDate();
|
|
8
10
|
}
|
|
9
11
|
}
|
|
10
12
|
return null;
|
|
@@ -28,16 +30,16 @@ export var handleOnInteractOutside = function handleOnInteractOutside(setIsOpen)
|
|
|
28
30
|
};
|
|
29
31
|
export var convertISOToAusDate = function convertISOToAusDate() {
|
|
30
32
|
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
31
|
-
return
|
|
33
|
+
return dayjs(date, ISO_FORMAT, true).format(AUS_FORMAT);
|
|
32
34
|
};
|
|
33
35
|
export var convertAusToISODate = function convertAusToISODate() {
|
|
34
36
|
var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
35
|
-
return
|
|
37
|
+
return dayjs(date, AUS_FORMAT, true).format(ISO_FORMAT);
|
|
36
38
|
};
|
|
37
39
|
export function createEventObject(textValue) {
|
|
38
40
|
var incompleteDate = textValue.includes("_");
|
|
39
41
|
var errorMessage = incompleteDate ? ERRORS.incomplete : ERRORS.invalid;
|
|
40
|
-
var validISO = convertAusToISODate(textValue) !== "Invalid
|
|
42
|
+
var validISO = convertAusToISODate(textValue) !== "Invalid Date";
|
|
41
43
|
var isoDate = validISO ? convertAusToISODate(textValue) : "";
|
|
42
44
|
var isValid = validISO;
|
|
43
45
|
isValid = textValue !== "" ? isValid : true;
|
|
@@ -9,7 +9,7 @@ describe("shortHandToDateObject", function () {
|
|
|
9
9
|
expect(shortHandToDateObject(dateString)).toEqual(expectedDateObject);
|
|
10
10
|
});
|
|
11
11
|
it("handles invalid date strings and returns null", function () {
|
|
12
|
-
var invalidDateString = "
|
|
12
|
+
var invalidDateString = "33/13/2021";
|
|
13
13
|
expect(shortHandToDateObject(invalidDateString)).toBeNull();
|
|
14
14
|
});
|
|
15
15
|
it("handles empty input and returns null", function () {
|