ish-ui 1.0.19 → 1.0.21
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/actions/FieldProcessing.d.ts +10 -0
- package/dist/actions/FieldProcessing.js +17 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +8 -0
- package/dist/appBar/AppBarHelpMenu.d.ts +3 -0
- package/dist/appBar/AppBarHelpMenu.js +77 -0
- package/dist/appBar/index.d.ts +2 -0
- package/dist/appBar/index.js +9 -0
- package/dist/buttons/AddButton.d.ts +14 -0
- package/dist/buttons/AddButton.js +9 -0
- package/dist/buttons/TimetableButton.d.ts +3 -0
- package/dist/buttons/TimetableButton.js +12 -0
- package/dist/buttons/index.d.ts +4 -0
- package/dist/buttons/index.js +11 -0
- package/dist/colorPicker/ColorPicker.d.ts +4 -0
- package/dist/colorPicker/ColorPicker.js +138 -0
- package/dist/colorPicker/index.d.ts +2 -0
- package/dist/colorPicker/index.js +9 -0
- package/dist/dialog/BrowserWarning.d.ts +3 -0
- package/dist/dialog/BrowserWarning.js +16 -0
- package/dist/dialog/confirm/ConfirmBase.d.ts +7 -0
- package/dist/dialog/confirm/ConfirmBase.js +29 -0
- package/dist/dialog/index.d.ts +5 -0
- package/dist/dialog/index.js +12 -0
- package/dist/dialog/message/Message.d.ts +3 -0
- package/dist/dialog/message/Message.js +91 -0
- package/dist/documents/DocumentIconsChooser.d.ts +3 -0
- package/dist/documents/DocumentIconsChooser.js +51 -0
- package/dist/documents/index.d.ts +3 -0
- package/dist/documents/index.js +10 -0
- package/dist/documents/utils/index.d.ts +7 -0
- package/dist/documents/utils/index.js +61 -0
- package/dist/dynamicSizeList/DynamicSizeList.d.ts +17 -0
- package/dist/dynamicSizeList/DynamicSizeList.js +167 -0
- package/dist/dynamicSizeList/index.d.ts +2 -0
- package/dist/dynamicSizeList/index.js +9 -0
- package/dist/fieldMessage/ErrorMessage.d.ts +8 -0
- package/dist/fieldMessage/ErrorMessage.js +14 -0
- package/dist/fieldMessage/WarningMessage.d.ts +8 -0
- package/dist/fieldMessage/WarningMessage.js +14 -0
- package/dist/fieldMessage/index.d.ts +6 -0
- package/dist/fieldMessage/index.js +13 -0
- package/dist/fieldMessage/styles.d.ts +3 -0
- package/dist/fieldMessage/styles.js +18 -0
- package/dist/fileUploader/FileUploaderDialog.d.ts +15 -0
- package/dist/fileUploader/FileUploaderDialog.js +99 -0
- package/dist/fileUploader/index.d.ts +2 -0
- package/dist/fileUploader/index.js +9 -0
- package/dist/formFields/CheckboxField.d.ts +7 -0
- package/dist/formFields/CheckboxField.js +67 -0
- package/dist/formFields/CodeEditorField.d.ts +6 -0
- package/dist/formFields/CodeEditorField.js +69 -0
- package/dist/formFields/ColoredCheckBox.d.ts +3 -0
- package/dist/formFields/ColoredCheckBox.js +41 -0
- package/dist/formFields/DateTimeField.d.ts +2 -0
- package/dist/formFields/DateTimeField.js +27 -0
- package/dist/formFields/EditInPlaceDateTimeField.d.ts +10 -0
- package/dist/formFields/EditInPlaceDateTimeField.js +188 -0
- package/dist/formFields/EditInPlaceDurationField.d.ts +4 -0
- package/dist/formFields/EditInPlaceDurationField.js +63 -0
- package/dist/formFields/EditInPlaceField.d.ts +10 -0
- package/dist/formFields/EditInPlaceField.js +58 -0
- package/dist/formFields/EditInPlaceFieldBase.d.ts +28 -0
- package/dist/formFields/EditInPlaceFieldBase.js +123 -0
- package/dist/formFields/EditInPlaceFileField.d.ts +7 -0
- package/dist/formFields/EditInPlaceFileField.js +60 -0
- package/dist/formFields/EditInPlaceMoneyField.d.ts +9 -0
- package/dist/formFields/EditInPlaceMoneyField.js +37 -0
- package/dist/formFields/EditInPlacePhoneField.d.ts +4 -0
- package/dist/formFields/EditInPlacePhoneField.js +69 -0
- package/dist/formFields/EditInPlaceSearchSelect.d.ts +4 -0
- package/dist/formFields/EditInPlaceSearchSelect.js +321 -0
- package/dist/formFields/FieldAdornments.d.ts +13 -0
- package/dist/formFields/FieldAdornments.js +27 -0
- package/dist/formFields/FilePreview.d.ts +17 -0
- package/dist/formFields/FilePreview.js +77 -0
- package/dist/formFields/FormRadioButtons.d.ts +3 -0
- package/dist/formFields/FormRadioButtons.js +27 -0
- package/dist/formFields/SelectCustomComponents.d.ts +5 -0
- package/dist/formFields/SelectCustomComponents.js +182 -0
- package/dist/formFields/Switch.d.ts +7 -0
- package/dist/formFields/Switch.js +116 -0
- package/dist/formFields/TextField.d.ts +6 -0
- package/dist/formFields/TextField.js +42 -0
- package/dist/formFields/UneditableBase.d.ts +17 -0
- package/dist/formFields/UneditableBase.js +48 -0
- package/dist/formFields/index.d.ts +31 -0
- package/dist/formFields/index.js +38 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +25 -0
- package/dist/layout/InfoPill.d.ts +7 -0
- package/dist/layout/InfoPill.js +26 -0
- package/dist/layout/index.d.ts +4 -0
- package/dist/layout/index.js +11 -0
- package/dist/layout/resizable/ResizableWrapper.d.ts +14 -0
- package/dist/layout/resizable/ResizableWrapper.js +42 -0
- package/dist/markdownEditor/HtmlEditor.d.ts +15 -0
- package/dist/markdownEditor/HtmlEditor.js +18 -0
- package/dist/markdownEditor/WysiwygEditor.d.ts +8 -0
- package/dist/markdownEditor/WysiwygEditor.js +98 -0
- package/dist/markdownEditor/index.d.ts +5 -0
- package/dist/markdownEditor/index.js +12 -0
- package/dist/markdownEditor/utils/index.d.ts +9 -0
- package/dist/markdownEditor/utils/index.js +38 -0
- package/dist/model/AppBar.d.ts +11 -0
- package/dist/model/AppBar.js +8 -0
- package/dist/model/CommomObjects.d.ts +5 -0
- package/dist/model/CommomObjects.js +1 -0
- package/dist/model/CommonFunctions.d.ts +8 -0
- package/dist/model/CommonFunctions.js +5 -0
- package/dist/model/Confirm.d.ts +16 -0
- package/dist/model/Confirm.js +8 -0
- package/dist/model/Fields.d.ts +258 -0
- package/dist/model/Fields.js +8 -0
- package/dist/model/NestedEntity.d.ts +9 -0
- package/dist/model/NestedEntity.js +5 -0
- package/dist/model/Theme.d.ts +34 -0
- package/dist/model/Theme.js +18 -0
- package/dist/model/index.d.ts +7 -0
- package/dist/model/index.js +14 -0
- package/dist/styles/GlobalStylesProvider.d.ts +3 -0
- package/dist/styles/GlobalStylesProvider.js +417 -0
- package/dist/styles/StylesProviderCustom.d.ts +3 -0
- package/dist/styles/StylesProviderCustom.js +6 -0
- package/dist/styles/animateStyles.d.ts +3 -0
- package/dist/styles/animateStyles.js +33 -0
- package/dist/styles/bootstrap.d.ts +491 -0
- package/dist/styles/bootstrap.js +496 -0
- package/dist/styles/hooks.d.ts +6 -0
- package/dist/styles/hooks.js +38 -0
- package/dist/styles/index.d.ts +11 -0
- package/dist/styles/index.js +18 -0
- package/dist/styles/makeStyles.d.ts +3 -0
- package/dist/styles/makeStyles.js +9 -0
- package/dist/styles/mixins/common.d.ts +8 -0
- package/dist/styles/mixins/common.js +32 -0
- package/dist/styles/mixins/keyframes.d.ts +3 -0
- package/dist/styles/mixins/keyframes.js +9 -0
- package/dist/styles/mixins/prefixer.d.ts +1 -0
- package/dist/styles/mixins/prefixer.js +23 -0
- package/dist/tagsInput/AddTagMenu.d.ts +12 -0
- package/dist/tagsInput/AddTagMenu.js +36 -0
- package/dist/tagsInput/AddTagMenuItem.d.ts +11 -0
- package/dist/tagsInput/AddTagMenuItem.js +29 -0
- package/dist/tagsInput/TagInputList.d.ts +4 -0
- package/dist/tagsInput/TagInputList.js +273 -0
- package/dist/tagsInput/index.d.ts +6 -0
- package/dist/tagsInput/index.js +6 -0
- package/dist/themes/appTheme.d.ts +4 -0
- package/dist/themes/appTheme.js +322 -0
- package/dist/themes/index.d.ts +2 -0
- package/dist/themes/index.js +9 -0
- package/dist/themes/ishTheme.d.ts +8 -0
- package/dist/themes/ishTheme.js +351 -0
- package/dist/timetable/datePeriodFilter/DayPeriodIcons.d.ts +8 -0
- package/dist/timetable/datePeriodFilter/DayPeriodIcons.js +27 -0
- package/dist/timetable/datePeriodFilter/index.d.ts +1 -0
- package/dist/timetable/datePeriodFilter/index.js +8 -0
- package/dist/timetable/index.d.ts +2 -0
- package/dist/timetable/index.js +9 -0
- package/dist/timetable/miniCalendar/CalendarDay.d.ts +15 -0
- package/dist/timetable/miniCalendar/CalendarDay.js +64 -0
- package/dist/timetable/miniCalendar/CalendarHeader.d.ts +10 -0
- package/dist/timetable/miniCalendar/CalendarHeader.js +22 -0
- package/dist/timetable/miniCalendar/CalendarWeekPanel.d.ts +8 -0
- package/dist/timetable/miniCalendar/CalendarWeekPanel.js +18 -0
- package/dist/timetable/miniCalendar/WeekDay.d.ts +10 -0
- package/dist/timetable/miniCalendar/WeekDay.js +25 -0
- package/dist/timetable/miniCalendar/index.d.ts +8 -0
- package/dist/timetable/miniCalendar/index.js +15 -0
- package/dist/utils/DOM/Links.d.ts +1 -0
- package/dist/utils/DOM/Links.js +12 -0
- package/dist/utils/DOM/getCaretCoordinates.d.ts +6 -0
- package/dist/utils/DOM/getCaretCoordinates.js +109 -0
- package/dist/utils/DOM/getOS.d.ts +2 -0
- package/dist/utils/DOM/getOS.js +32 -0
- package/dist/utils/DOM/index.d.ts +5 -0
- package/dist/utils/DOM/index.js +32 -0
- package/dist/utils/dates/datesNormalizing.d.ts +1 -0
- package/dist/utils/dates/datesNormalizing.js +3 -0
- package/dist/utils/dates/format.d.ts +24 -0
- package/dist/utils/dates/format.js +28 -0
- package/dist/utils/dates/formatRelative.d.ts +1 -0
- package/dist/utils/dates/formatRelative.js +14 -0
- package/dist/utils/dates/formatString.d.ts +2 -0
- package/dist/utils/dates/formatString.js +195 -0
- package/dist/utils/dates/formatTimezone.d.ts +2 -0
- package/dist/utils/dates/formatTimezone.js +35 -0
- package/dist/utils/dates/index.d.ts +6 -0
- package/dist/utils/dates/index.js +13 -0
- package/dist/utils/dates/timetable.d.ts +5 -0
- package/dist/utils/dates/timetable.js +38 -0
- package/dist/utils/events/index.d.ts +2 -0
- package/dist/utils/events/index.js +6 -0
- package/dist/utils/fields/index.d.ts +1 -0
- package/dist/utils/fields/index.js +20 -0
- package/dist/utils/formatting/PhoneMasks.d.ts +304 -0
- package/dist/utils/formatting/PhoneMasks.js +318 -0
- package/dist/utils/formatting/index.d.ts +2 -0
- package/dist/utils/formatting/index.js +10 -0
- package/dist/utils/hooks/index.d.ts +1 -0
- package/dist/utils/hooks/index.js +15 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.js +16 -0
- package/dist/utils/numbers/decimalCalculation.d.ts +4 -0
- package/dist/utils/numbers/decimalCalculation.js +21 -0
- package/dist/utils/numbers/index.d.ts +2 -0
- package/dist/utils/numbers/index.js +9 -0
- package/dist/utils/numbers/numbersNormalizing.d.ts +10 -0
- package/dist/utils/numbers/numbersNormalizing.js +44 -0
- package/dist/utils/stubs/index.d.ts +3 -0
- package/dist/utils/stubs/index.js +10 -0
- package/dist/utils/tags/index.d.ts +3 -0
- package/dist/utils/tags/index.js +42 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
/* tslint:disable:max-line-length */
|
|
3
|
+
}
|
|
4
|
+
import React from "react";
|
|
5
|
+
export const MorningIcon = ({ className }) => (React.createElement("svg", { className: className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
6
|
+
React.createElement("path", { d: "M9 3C9 2.44772 9.44772 2 10 2C10.5523 2 11 2.44772 11 3V4C11 4.55228 10.5523 5 10 5C9.44772 5 9 4.55228 9 4V3Z", fill: "black" }),
|
|
7
|
+
React.createElement("path", { d: "M16.3638 7.05022C15.9733 7.44074 15.3402 7.44074 14.9496 7.05022C14.5591 6.65969 14.5591 6.02653 14.9496 5.636L15.6567 4.9289C16.0473 4.53837 16.6804 4.53837 17.071 4.9289C17.4615 5.31942 17.4615 5.95259 17.071 6.34311L16.3638 7.05022Z", fill: "black" }),
|
|
8
|
+
React.createElement("path", { d: "M5.04997 5.63603C5.4405 6.02656 5.4405 6.65972 5.04997 7.05025C4.65945 7.44077 4.02628 7.44077 3.63576 7.05025L2.92865 6.34314C2.53813 5.95262 2.53813 5.31945 2.92865 4.92893C3.31918 4.5384 3.95234 4.5384 4.34287 4.92893L5.04997 5.63603Z", fill: "black" }),
|
|
9
|
+
React.createElement("path", { d: "M12.8356 11.0181C13.0163 11.54 13.4477 12 14 12C14.5523 12 15.0104 11.5478 14.9013 11.0064C14.4405 8.72096 12.4212 7 9.99999 7C7.57878 7 5.55952 8.72096 5.09872 11.0064C4.98956 11.5478 5.44771 12 5.99999 12C6.55228 12 6.98368 11.54 7.16437 11.0181C7.57105 9.84347 8.68702 9 9.99999 9C11.313 9 12.4289 9.84347 12.8356 11.0181Z", fill: "black" }),
|
|
10
|
+
React.createElement("path", { d: "M0 15C0 14.4477 0.447715 14 1 14H19C19.5523 14 20 14.4477 20 15C20 15.5523 19.5523 16 19 16H1C0.447716 16 0 15.5523 0 15Z", fill: "black" })));
|
|
11
|
+
export const AfternoonIcon = ({ className }) => (React.createElement("svg", { className: className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
12
|
+
React.createElement("g", { clipPath: "url(#clip0)" },
|
|
13
|
+
React.createElement("path", { d: "M9 1C9 0.447715 9.44772 0 10 0C10.5523 0 11 0.447715 11 1V2C11 2.55228 10.5523 3 10 3C9.44772 3 9 2.55228 9 2V1Z", fill: "black" }),
|
|
14
|
+
React.createElement("path", { d: "M9 18C9 17.4477 9.44772 17 10 17C10.5523 17 11 17.4477 11 18V19C11 19.5523 10.5523 20 10 20C9.44772 20 9 19.5523 9 19V18Z", fill: "black" }),
|
|
15
|
+
React.createElement("path", { d: "M1 11C0.447715 11 2.41411e-08 10.5523 0 10C-2.41411e-08 9.44772 0.447715 9 1 9H2C2.55228 9 3 9.44772 3 10C3 10.5523 2.55228 11 2 11H1Z", fill: "black" }),
|
|
16
|
+
React.createElement("path", { d: "M18 11C17.4477 11 17 10.5523 17 10C17 9.44772 17.4477 9 18 9H19C19.5523 9 20 9.44772 20 10C20 10.5523 19.5523 11 19 11H18Z", fill: "black" }),
|
|
17
|
+
React.createElement("path", { d: "M4.34309 17.0711C3.95257 17.4616 3.3194 17.4616 2.92888 17.0711C2.53836 16.6806 2.53836 16.0474 2.92888 15.6569L3.63599 14.9498C4.02651 14.5592 4.65968 14.5592 5.0502 14.9498C5.44072 15.3403 5.44072 15.9735 5.0502 16.364L4.34309 17.0711Z", fill: "black" }),
|
|
18
|
+
React.createElement("path", { d: "M16.3638 5.05022C15.9733 5.44074 15.3402 5.44074 14.9496 5.05022C14.5591 4.65969 14.5591 4.02653 14.9496 3.636L15.6567 2.9289C16.0473 2.53837 16.6804 2.53837 17.071 2.9289C17.4615 3.31942 17.4615 3.95259 17.071 4.34311L16.3638 5.05022Z", fill: "black" }),
|
|
19
|
+
React.createElement("path", { d: "M17.071 15.6568C17.4615 16.0473 17.4615 16.6805 17.071 17.071C16.6804 17.4615 16.0473 17.4615 15.6568 17.071L14.9496 16.3639C14.5591 15.9734 14.5591 15.3402 14.9496 14.9497C15.3402 14.5592 15.9733 14.5592 16.3639 14.9497L17.071 15.6568Z", fill: "black" }),
|
|
20
|
+
React.createElement("path", { d: "M5.04997 3.63603C5.4405 4.02656 5.4405 4.65972 5.04997 5.05025C4.65945 5.44077 4.02628 5.44077 3.63576 5.05025L2.92865 4.34314C2.53813 3.95262 2.53813 3.31945 2.92865 2.92893C3.31918 2.5384 3.95234 2.5384 4.34287 2.92893L5.04997 3.63603Z", fill: "black" }),
|
|
21
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5C7.23858 5 5 7.23858 5 10C5 12.7614 7.23858 15 10 15ZM10 13C11.6569 13 13 11.6569 13 10C13 8.34315 11.6569 7 10 7C8.34315 7 7 8.34315 7 10C7 11.6569 8.34315 13 10 13Z", fill: "black" })),
|
|
22
|
+
React.createElement("defs", null,
|
|
23
|
+
React.createElement("clipPath", { id: "clip0" },
|
|
24
|
+
React.createElement("rect", { width: "20", height: "20", fill: "white" })))));
|
|
25
|
+
export const EveningIcon = ({ className }) => (React.createElement("svg", { className: className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
26
|
+
React.createElement("rect", { width: "20", height: "20", fill: "none" }),
|
|
27
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.38031 2.16405C8.28754 2.18313 8.19536 2.20381 8.10379 2.22606C4.6008 3.07753 2 6.23504 2 10C2 14.4183 5.58172 18 10 18C13.765 18 16.9225 15.3992 17.7739 11.8962C17.7962 11.8046 17.8169 11.7125 17.8359 11.6197C17.9102 11.2587 17.9601 10.8887 17.9839 10.5117C17.9946 10.3425 18 10.1719 18 10C18 9.65868 17.5651 9.52223 17.3093 9.74823C17.2098 9.83613 17.1068 9.92014 17.0005 10C16.7187 10.2117 16.4139 10.3943 16.0904 10.5434C16.0508 10.5616 16.0109 10.5794 15.9707 10.5966C15.366 10.8562 14.6998 11 14 11C11.2386 11 9 8.76142 9 6C9 5.30021 9.14376 4.634 9.40336 4.02929C9.4206 3.98912 9.43836 3.94922 9.45662 3.9096C9.6057 3.58611 9.78831 3.28127 10 2.99951C10.0799 2.89321 10.1639 2.7902 10.2518 2.69071C10.4778 2.43493 10.3413 2 10 2C9.8281 2 9.65747 2.00542 9.48826 2.0161C9.11126 2.0399 8.74135 2.08982 8.38031 2.16405ZM7.11363 4.73861C7.039 5.14795 7 5.56956 7 6C7 9.86599 10.134 13 14 13C14.4304 13 14.8521 12.961 15.2614 12.8864C14.2411 14.7423 12.2674 16 10 16C6.68629 16 4 13.3137 4 10C4 7.73257 5.25775 5.7589 7.11363 4.73861Z", fill: "black" })));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DayPeriodIcons';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
6
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
7
|
+
*/
|
|
8
|
+
export * from './DayPeriodIcons';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
6
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
7
|
+
*/
|
|
8
|
+
export * from './datePeriodFilter';
|
|
9
|
+
export * from './miniCalendar';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
day: number;
|
|
4
|
+
isToday?: boolean;
|
|
5
|
+
today?: any;
|
|
6
|
+
date: Date;
|
|
7
|
+
status: string;
|
|
8
|
+
selectedMonthSessionDays: number[];
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
theme?: any;
|
|
11
|
+
targetDay?: any;
|
|
12
|
+
setTargetDay?: any;
|
|
13
|
+
}
|
|
14
|
+
declare const CalendarDay: React.MemoExoticComponent<(props: Props) => React.JSX.Element>;
|
|
15
|
+
export default CalendarDay;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
6
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
7
|
+
*/
|
|
8
|
+
import React, { useMemo } from 'react';
|
|
9
|
+
import { Button } from '@mui/material';
|
|
10
|
+
import { isSameDay } from 'date-fns';
|
|
11
|
+
import clsx from 'clsx';
|
|
12
|
+
import { alpha } from '@mui/material/styles';
|
|
13
|
+
import { makeAppStyles } from '../../styles';
|
|
14
|
+
import { useAppTheme } from '../../themes';
|
|
15
|
+
const useStyles = makeAppStyles(theme => ({
|
|
16
|
+
root: {
|
|
17
|
+
padding: 0,
|
|
18
|
+
border: '2px solid transparent',
|
|
19
|
+
borderRadius: 4,
|
|
20
|
+
minWidth: 'initial',
|
|
21
|
+
boxShadow: 'none',
|
|
22
|
+
fontWeight: 'normal',
|
|
23
|
+
color: theme.palette.text.primary,
|
|
24
|
+
'&:active': {
|
|
25
|
+
boxShadow: 'none'
|
|
26
|
+
},
|
|
27
|
+
'&:focus': {
|
|
28
|
+
boxShadow: 'none'
|
|
29
|
+
},
|
|
30
|
+
'&::after': {
|
|
31
|
+
content: '\'\'',
|
|
32
|
+
position: 'absolute',
|
|
33
|
+
width: 4,
|
|
34
|
+
height: 4,
|
|
35
|
+
top: 4,
|
|
36
|
+
borderRadius: '100%'
|
|
37
|
+
},
|
|
38
|
+
'&$same': {
|
|
39
|
+
border: `2px solid ${theme.palette.text.primary}`
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
same: {}
|
|
43
|
+
}));
|
|
44
|
+
const CalendarDay = React.memo((props) => {
|
|
45
|
+
const { day, status, date, disabled, targetDay, setTargetDay, selectedMonthSessionDays } = props;
|
|
46
|
+
const classes = useStyles();
|
|
47
|
+
const theme = useAppTheme();
|
|
48
|
+
const isSame = isSameDay(targetDay, date);
|
|
49
|
+
const isToday = isSameDay(new Date(), date);
|
|
50
|
+
const style = useMemo(() => {
|
|
51
|
+
let result;
|
|
52
|
+
const dayIndexValue = selectedMonthSessionDays[day - 1];
|
|
53
|
+
if (selectedMonthSessionDays.length && status === 'current' && dayIndexValue !== 0) {
|
|
54
|
+
const backgroundColor = alpha(theme.palette.primary.main, dayIndexValue);
|
|
55
|
+
result = Object.assign(Object.assign({}, result || {}), { backgroundColor, color: theme.palette.getContrastText(backgroundColor) });
|
|
56
|
+
}
|
|
57
|
+
if (isToday) {
|
|
58
|
+
result = Object.assign(Object.assign({}, result || {}), { fontWeight: '900' });
|
|
59
|
+
}
|
|
60
|
+
return result;
|
|
61
|
+
}, [isToday, status, selectedMonthSessionDays, day, theme]);
|
|
62
|
+
return (React.createElement(Button, { className: clsx(classes.root, isSame && classes.same), onClick: () => setTargetDay(date), disabled: disabled, style: style }, day));
|
|
63
|
+
});
|
|
64
|
+
export default CalendarDay;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
month: string;
|
|
4
|
+
year: number;
|
|
5
|
+
previousMonth: () => void;
|
|
6
|
+
nextMonth: () => void;
|
|
7
|
+
classes?: any;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles").StyledComponentProps<never>>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconButton, Typography } from "@mui/material";
|
|
3
|
+
import { createStyles, withStyles } from "@mui/styles";
|
|
4
|
+
import { KeyboardArrowLeft, KeyboardArrowRight } from "@mui/icons-material";
|
|
5
|
+
const styles = createStyles(theme => ({
|
|
6
|
+
root: {
|
|
7
|
+
display: "flex",
|
|
8
|
+
justifyContent: "space-between",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
padding: theme.spacing(0, 1)
|
|
11
|
+
}
|
|
12
|
+
}));
|
|
13
|
+
const CalendarHeader = ({ classes, month, year, previousMonth, nextMonth }) => (React.createElement("div", { className: classes.root },
|
|
14
|
+
React.createElement(IconButton, { onClick: previousMonth },
|
|
15
|
+
React.createElement(KeyboardArrowLeft, null)),
|
|
16
|
+
React.createElement(Typography, { align: "center" },
|
|
17
|
+
month,
|
|
18
|
+
" ",
|
|
19
|
+
year),
|
|
20
|
+
React.createElement(IconButton, { onClick: nextMonth },
|
|
21
|
+
React.createElement(KeyboardArrowRight, null))));
|
|
22
|
+
export default withStyles(styles)(CalendarHeader);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
classes?: any;
|
|
4
|
+
switchWeekDays: (dayId: number) => void;
|
|
5
|
+
selectedWeekDays: boolean[];
|
|
6
|
+
}
|
|
7
|
+
declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles").StyledComponentProps<"root">>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { createStyles, withStyles } from "@mui/styles";
|
|
3
|
+
import WeekDay from "./WeekDay";
|
|
4
|
+
const styles = theme => createStyles({
|
|
5
|
+
root: {
|
|
6
|
+
display: "grid",
|
|
7
|
+
gridTemplateColumns: `repeat(7, ${theme.spacing(4)})`,
|
|
8
|
+
gridColumnGap: 1,
|
|
9
|
+
padding: theme.spacing(0, 1),
|
|
10
|
+
marginBottom: theme.spacing(1),
|
|
11
|
+
justifyContent: "center"
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const week = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
15
|
+
const CalendarWeekPanel = ({ classes, switchWeekDays, selectedWeekDays }) => {
|
|
16
|
+
return (React.createElement("div", { className: classes.root }, week.map((el, id) => (React.createElement(WeekDay, { key: id, id: id, name: el, selected: selectedWeekDays[id], click: switchWeekDays })))));
|
|
17
|
+
};
|
|
18
|
+
export default withStyles(styles)(CalendarWeekPanel);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
name: string;
|
|
4
|
+
selected: boolean;
|
|
5
|
+
click: (id: any) => void;
|
|
6
|
+
id: number;
|
|
7
|
+
classes?: any;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.JSXElementConstructor<Omit<Props, "classes"> & import("@mui/styles").StyledComponentProps<"weekButton" | "selectedWeekDay" | "weekDayText">>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button, Typography } from "@mui/material";
|
|
3
|
+
import { createStyles, withStyles } from "@mui/styles";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
const styles = theme => createStyles({
|
|
6
|
+
weekButton: {
|
|
7
|
+
padding: theme.spacing(0.5),
|
|
8
|
+
minWidth: "initial",
|
|
9
|
+
textTransform: "capitalize"
|
|
10
|
+
},
|
|
11
|
+
selectedWeekDay: {
|
|
12
|
+
boxShadow: "none",
|
|
13
|
+
"&:active": {
|
|
14
|
+
boxShadow: "none"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
weekDayText: {
|
|
18
|
+
color: theme.palette.common.white
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const WeekDay = ({ classes, name, selected, click, id }) => (React.createElement(Button, { className: clsx(classes.weekButton, {
|
|
22
|
+
[classes.selectedWeekDay]: selected
|
|
23
|
+
}), onClick: () => click(id), variant: selected ? "contained" : "text", color: selected ? "primary" : "inherit" },
|
|
24
|
+
React.createElement(Typography, { variant: "caption", align: "center", className: selected ? classes.weekDayText : "" }, name)));
|
|
25
|
+
export default withStyles(styles)(WeekDay);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './CalendarHeader';
|
|
2
|
+
export * from './CalendarDay';
|
|
3
|
+
export * from './CalendarWeekPanel';
|
|
4
|
+
export * from './WeekDay';
|
|
5
|
+
export { default as CalendarHeader } from './CalendarHeader';
|
|
6
|
+
export { default as CalendarDay } from './CalendarDay';
|
|
7
|
+
export { default as CalendarWeekPanel } from './CalendarWeekPanel';
|
|
8
|
+
export { default as WeekDay } from './WeekDay';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
6
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
7
|
+
*/
|
|
8
|
+
export * from './CalendarHeader';
|
|
9
|
+
export * from './CalendarDay';
|
|
10
|
+
export * from './CalendarWeekPanel';
|
|
11
|
+
export * from './WeekDay';
|
|
12
|
+
export { default as CalendarHeader } from './CalendarHeader';
|
|
13
|
+
export { default as CalendarDay } from './CalendarDay';
|
|
14
|
+
export { default as CalendarWeekPanel } from './CalendarWeekPanel';
|
|
15
|
+
export { default as WeekDay } from './WeekDay';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const openInternalLink: (link: any) => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
6
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
7
|
+
*/
|
|
8
|
+
export const openInternalLink = link => {
|
|
9
|
+
if (link) {
|
|
10
|
+
window.open((link.includes('http') ? '' : window.location.origin) + link, '_blank');
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
6
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
7
|
+
*/
|
|
8
|
+
const properties = [
|
|
9
|
+
'direction',
|
|
10
|
+
'boxSizing',
|
|
11
|
+
'width',
|
|
12
|
+
'height',
|
|
13
|
+
'overflowX',
|
|
14
|
+
'overflowY',
|
|
15
|
+
'borderTopWidth',
|
|
16
|
+
'borderRightWidth',
|
|
17
|
+
'borderBottomWidth',
|
|
18
|
+
'borderLeftWidth',
|
|
19
|
+
'borderStyle',
|
|
20
|
+
'paddingTop',
|
|
21
|
+
'paddingRight',
|
|
22
|
+
'paddingBottom',
|
|
23
|
+
'paddingLeft',
|
|
24
|
+
'fontStyle',
|
|
25
|
+
'fontVariant',
|
|
26
|
+
'fontWeight',
|
|
27
|
+
'fontStretch',
|
|
28
|
+
'fontSize',
|
|
29
|
+
'fontSizeAdjust',
|
|
30
|
+
'lineHeight',
|
|
31
|
+
'fontFamily',
|
|
32
|
+
'textAlign',
|
|
33
|
+
'textTransform',
|
|
34
|
+
'textIndent',
|
|
35
|
+
'textDecoration',
|
|
36
|
+
'letterSpacing',
|
|
37
|
+
'wordSpacing',
|
|
38
|
+
'tabSize',
|
|
39
|
+
'MozTabSize'
|
|
40
|
+
];
|
|
41
|
+
const getCaretCoordinates = (element, position, options) => {
|
|
42
|
+
if (!element)
|
|
43
|
+
return null;
|
|
44
|
+
const debug = (options && options.debug) || false;
|
|
45
|
+
if (debug) {
|
|
46
|
+
const el = document.querySelector('#input-textarea-caret-position-mirror-div');
|
|
47
|
+
if (el)
|
|
48
|
+
el.parentNode.removeChild(el);
|
|
49
|
+
}
|
|
50
|
+
const div = document.createElement('div');
|
|
51
|
+
div.id = 'input-textarea-caret-position-mirror-div';
|
|
52
|
+
document.body.appendChild(div);
|
|
53
|
+
const style = div.style;
|
|
54
|
+
const computed = window.getComputedStyle ? window.getComputedStyle(element) : element.currentStyle; // currentStyle for IE < 9
|
|
55
|
+
const isInput = element.nodeName === 'INPUT';
|
|
56
|
+
style.whiteSpace = 'pre-wrap';
|
|
57
|
+
if (!isInput)
|
|
58
|
+
style.wordWrap = 'break-word';
|
|
59
|
+
style.position = 'absolute';
|
|
60
|
+
if (!debug)
|
|
61
|
+
style.visibility = 'hidden';
|
|
62
|
+
properties.forEach(function (prop) {
|
|
63
|
+
if (isInput && prop === 'lineHeight') {
|
|
64
|
+
if (computed.boxSizing === 'border-box') {
|
|
65
|
+
const height = parseInt(computed.height);
|
|
66
|
+
const outerHeight = parseInt(computed.paddingTop) +
|
|
67
|
+
parseInt(computed.paddingBottom) +
|
|
68
|
+
parseInt(computed.borderTopWidth) +
|
|
69
|
+
parseInt(computed.borderBottomWidth);
|
|
70
|
+
const targetHeight = outerHeight + parseInt(computed.lineHeight);
|
|
71
|
+
if (height > targetHeight) {
|
|
72
|
+
style.lineHeight = height - outerHeight + 'px';
|
|
73
|
+
}
|
|
74
|
+
else if (height === targetHeight) {
|
|
75
|
+
style.lineHeight = computed.lineHeight;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
style.lineHeight = '0';
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
style.lineHeight = computed.height;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
style[prop] = computed[prop];
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
style.overflow = 'hidden';
|
|
90
|
+
div.textContent = element.value.substring(0, position);
|
|
91
|
+
if (isInput)
|
|
92
|
+
div.textContent = div.textContent.replace(/\s/g, '\u00a0');
|
|
93
|
+
const span = document.createElement('span');
|
|
94
|
+
span.textContent = element.value.substring(position) || '.';
|
|
95
|
+
div.appendChild(span);
|
|
96
|
+
const coordinates = {
|
|
97
|
+
top: span.offsetTop + parseInt(computed['borderTopWidth']),
|
|
98
|
+
left: span.offsetLeft + parseInt(computed['borderLeftWidth']),
|
|
99
|
+
height: parseInt(computed['lineHeight'])
|
|
100
|
+
};
|
|
101
|
+
if (debug) {
|
|
102
|
+
span.style.backgroundColor = '#aaa';
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
document.body.removeChild(div);
|
|
106
|
+
}
|
|
107
|
+
return coordinates;
|
|
108
|
+
};
|
|
109
|
+
export default getCaretCoordinates;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
6
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
7
|
+
*/
|
|
8
|
+
const getOS = () => {
|
|
9
|
+
const userAgent = window.navigator.userAgent;
|
|
10
|
+
const platform = window.navigator.platform;
|
|
11
|
+
const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'];
|
|
12
|
+
const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];
|
|
13
|
+
const iosPlatforms = ['iPhone', 'iPad', 'iPod'];
|
|
14
|
+
let os = null;
|
|
15
|
+
if (macosPlatforms.indexOf(platform) !== -1) {
|
|
16
|
+
os = 'Mac OS';
|
|
17
|
+
}
|
|
18
|
+
else if (iosPlatforms.indexOf(platform) !== -1) {
|
|
19
|
+
os = 'iOS';
|
|
20
|
+
}
|
|
21
|
+
else if (windowsPlatforms.indexOf(platform) !== -1) {
|
|
22
|
+
os = 'Windows';
|
|
23
|
+
}
|
|
24
|
+
else if (/Android/.test(userAgent)) {
|
|
25
|
+
os = 'Android';
|
|
26
|
+
}
|
|
27
|
+
else if (!os && /Linux/.test(platform)) {
|
|
28
|
+
os = 'Linux';
|
|
29
|
+
}
|
|
30
|
+
return os;
|
|
31
|
+
};
|
|
32
|
+
export default getOS;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
6
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
7
|
+
*/
|
|
8
|
+
export const countLines = (el) => {
|
|
9
|
+
if (!el)
|
|
10
|
+
return null;
|
|
11
|
+
const divHeight = el.offsetHeight;
|
|
12
|
+
const lineHeight = parseInt(getComputedStyle(el).lineHeight);
|
|
13
|
+
return Math.round(divHeight / lineHeight);
|
|
14
|
+
};
|
|
15
|
+
export const countWidth = (el, container) => {
|
|
16
|
+
const testContainer = document.createElement('span');
|
|
17
|
+
const containerStyles = getComputedStyle(container);
|
|
18
|
+
testContainer.style['height'] = containerStyles['height'];
|
|
19
|
+
testContainer.style['fontSize'] = containerStyles['fontSize'];
|
|
20
|
+
testContainer.style['fontWeight'] = containerStyles['fontWeight'];
|
|
21
|
+
testContainer.style['fontFeatureSettings'] = containerStyles['fontFeatureSettings'];
|
|
22
|
+
testContainer.style.position = 'absolute';
|
|
23
|
+
testContainer.style.zIndex = '-10000';
|
|
24
|
+
testContainer.innerHTML = el;
|
|
25
|
+
document.body.appendChild(testContainer);
|
|
26
|
+
const width = testContainer.offsetWidth;
|
|
27
|
+
document.body.removeChild(testContainer);
|
|
28
|
+
return width;
|
|
29
|
+
};
|
|
30
|
+
export * from './getCaretCoordinates';
|
|
31
|
+
export * from './getOS';
|
|
32
|
+
export * from './Links';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatToDateOnly: (v: any) => any;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const YYYYMMDD_KKMMSS_MINUSED = "yyyMMdd-kkmmss";
|
|
2
|
+
export declare const YYYY_MM_DD_MINUSED = "yyyy-MM-dd";
|
|
3
|
+
export declare const D_III = "d iii";
|
|
4
|
+
export declare const D_MMM = "d MMM";
|
|
5
|
+
export declare const DD_MMM_YYYY_MINUSED = "dd-MMM-yyyy";
|
|
6
|
+
export declare const III_DD_MMM_YYYY_HH_MM_SPECIAL = "iii, dd MMM yyyy HH:mm";
|
|
7
|
+
export declare const III_DD_MMM_YYYY_HH_MM_AAAA_SPECIAL = "iii, dd MMM yyyy hh:mm aaaa";
|
|
8
|
+
export declare const III_DD_MMM_YYYY = "iii dd MMM yyyy";
|
|
9
|
+
export declare const III_DD_MMM_YYYY_HH_MM = "iii dd MMM yyyy HH:mm";
|
|
10
|
+
export declare const III_DD_MMM_YYYY_HH_MM_SS = "iii dd MMM yyyy HH:mm:ss";
|
|
11
|
+
export declare const EEE_D_MMM_YYYY = "eee d MMM yyyy";
|
|
12
|
+
export declare const D_MMM_YYYY = "d MMM yyyy";
|
|
13
|
+
export declare const DD_MMM_YYYY = "dd MMM yyyy";
|
|
14
|
+
export declare const DD_MMM_YYYY_HH_MM = "dd MMM yyyy HH:mm";
|
|
15
|
+
export declare const DD_MMM_YYYY_HH_MM_SS = "dd MMM yyyy HH:mm:ss";
|
|
16
|
+
export declare const DD_MM_YYYY_SLASHED = "dd/MM/yyyy";
|
|
17
|
+
export declare const HH_MM_COLONED = "HH:mm";
|
|
18
|
+
export declare const HA = "ha";
|
|
19
|
+
export declare const DD_MM_YYYY_HH_MM_SPECIAL = "dd.MM.yyyy HH:mm";
|
|
20
|
+
export declare const KK_MM_AAAA_EEE_DD_MMM_YYYY_SPECIAL = "kk:mmaaaa eee dd MMM yyyy";
|
|
21
|
+
export declare const DD_MMM_YYYY_AT_HH_MM_A_SPECIAL = "dd MMM yyyy 'at' hh:mm a";
|
|
22
|
+
export declare const DD_MMM_YYYY_AT_HH_MM_AAAA_SPECIAL = "dd MMM yyyy 'at' hh:mm aaaa";
|
|
23
|
+
export declare const III_DD_MMM_YYYY_HH_MM_AAAA = "iii d MMM yyyy h:mm aaaa";
|
|
24
|
+
export declare const H_MMAAA = "h:mmaaa";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd. All rights reserved. https://www.ish.com.au
|
|
3
|
+
* No copying or use of this code is allowed without permission in writing from ish.
|
|
4
|
+
*/
|
|
5
|
+
export const YYYYMMDD_KKMMSS_MINUSED = 'yyyMMdd-kkmmss';
|
|
6
|
+
export const YYYY_MM_DD_MINUSED = 'yyyy-MM-dd';
|
|
7
|
+
export const D_III = 'd iii';
|
|
8
|
+
export const D_MMM = 'd MMM';
|
|
9
|
+
export const DD_MMM_YYYY_MINUSED = 'dd-MMM-yyyy';
|
|
10
|
+
export const III_DD_MMM_YYYY_HH_MM_SPECIAL = 'iii, dd MMM yyyy HH:mm';
|
|
11
|
+
export const III_DD_MMM_YYYY_HH_MM_AAAA_SPECIAL = 'iii, dd MMM yyyy hh:mm aaaa';
|
|
12
|
+
export const III_DD_MMM_YYYY = 'iii dd MMM yyyy';
|
|
13
|
+
export const III_DD_MMM_YYYY_HH_MM = 'iii dd MMM yyyy HH:mm';
|
|
14
|
+
export const III_DD_MMM_YYYY_HH_MM_SS = 'iii dd MMM yyyy HH:mm:ss';
|
|
15
|
+
export const EEE_D_MMM_YYYY = 'eee d MMM yyyy';
|
|
16
|
+
export const D_MMM_YYYY = 'd MMM yyyy';
|
|
17
|
+
export const DD_MMM_YYYY = 'dd MMM yyyy';
|
|
18
|
+
export const DD_MMM_YYYY_HH_MM = 'dd MMM yyyy HH:mm';
|
|
19
|
+
export const DD_MMM_YYYY_HH_MM_SS = 'dd MMM yyyy HH:mm:ss';
|
|
20
|
+
export const DD_MM_YYYY_SLASHED = 'dd/MM/yyyy';
|
|
21
|
+
export const HH_MM_COLONED = 'HH:mm';
|
|
22
|
+
export const HA = 'ha';
|
|
23
|
+
export const DD_MM_YYYY_HH_MM_SPECIAL = 'dd.MM.yyyy HH:mm';
|
|
24
|
+
export const KK_MM_AAAA_EEE_DD_MMM_YYYY_SPECIAL = 'kk:mmaaaa eee dd MMM yyyy';
|
|
25
|
+
export const DD_MMM_YYYY_AT_HH_MM_A_SPECIAL = 'dd MMM yyyy \'at\' hh:mm a';
|
|
26
|
+
export const DD_MMM_YYYY_AT_HH_MM_AAAA_SPECIAL = 'dd MMM yyyy \'at\' hh:mm aaaa';
|
|
27
|
+
export const III_DD_MMM_YYYY_HH_MM_AAAA = 'iii d MMM yyyy h:mm aaaa';
|
|
28
|
+
export const H_MMAAA = 'h:mmaaa';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatRelativeDate: (date: Date, baseDate: Date, formatString: string, excludeTime?: boolean, addDistance?: boolean) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { formatRelative, formatDistanceStrict, format } from 'date-fns';
|
|
2
|
+
export const formatRelativeDate = (date, baseDate, formatString, excludeTime, addDistance) => {
|
|
3
|
+
let result = formatRelative(date, baseDate);
|
|
4
|
+
if (result.match(/\d\d\/\d\d\/\d\d\d\d/)) {
|
|
5
|
+
result = format(date, formatString).replace(/\./g, '');
|
|
6
|
+
if (addDistance) {
|
|
7
|
+
return formatDistanceStrict(date, baseDate) + ' ago';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
if (excludeTime) {
|
|
11
|
+
result = result.replace(/at\s\d:\d\d\s([AP])M/, '');
|
|
12
|
+
}
|
|
13
|
+
return result;
|
|
14
|
+
};
|