@chayns-components/date 5.0.0-beta.1000
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/LICENSE +21 -0
- package/README.md +34 -0
- package/lib/cjs/components/calendar/Calendar.js +314 -0
- package/lib/cjs/components/calendar/Calendar.js.map +1 -0
- package/lib/cjs/components/calendar/Calendar.styles.js +34 -0
- package/lib/cjs/components/calendar/Calendar.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/MonthWrapper.js +158 -0
- package/lib/cjs/components/calendar/month-wrapper/MonthWrapper.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/MonthWrapper.styles.js +23 -0
- package/lib/cjs/components/calendar/month-wrapper/MonthWrapper.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/Month.js +65 -0
- package/lib/cjs/components/calendar/month-wrapper/month/Month.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/Month.styles.js +26 -0
- package/lib/cjs/components/calendar/month-wrapper/month/Month.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js +129 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js +16 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/Day.js +63 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/Day.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js +114 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js +17 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js +18 -0
- package/lib/cjs/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js +42 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js +16 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js +15 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js.map +1 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js +17 -0
- package/lib/cjs/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js.map +1 -0
- package/lib/cjs/components/calendar/month-year-pickers/MonthYearPickers.js +86 -0
- package/lib/cjs/components/calendar/month-year-pickers/MonthYearPickers.js.map +1 -0
- package/lib/cjs/components/date-info/DateInfo.js +35 -0
- package/lib/cjs/components/date-info/DateInfo.js.map +1 -0
- package/lib/cjs/components/opening-times/OpeningTimes.js +246 -0
- package/lib/cjs/components/opening-times/OpeningTimes.js.map +1 -0
- package/lib/cjs/components/opening-times/OpeningTimes.styles.js +28 -0
- package/lib/cjs/components/opening-times/OpeningTimes.styles.js.map +1 -0
- package/lib/cjs/components/opening-times/hint-text/HintText.js +19 -0
- package/lib/cjs/components/opening-times/hint-text/HintText.js.map +1 -0
- package/lib/cjs/components/opening-times/hint-text/HintText.styles.js +24 -0
- package/lib/cjs/components/opening-times/hint-text/HintText.styles.js.map +1 -0
- package/lib/cjs/components/opening-times/opening-inputs/OpeningInputs.js +153 -0
- package/lib/cjs/components/opening-times/opening-inputs/OpeningInputs.js.map +1 -0
- package/lib/cjs/components/opening-times/opening-inputs/OpeningInputs.styles.js +24 -0
- package/lib/cjs/components/opening-times/opening-inputs/OpeningInputs.styles.js.map +1 -0
- package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.js +106 -0
- package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.js.map +1 -0
- package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js +41 -0
- package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js.map +1 -0
- package/lib/cjs/hooks/useDateInfo.js +63 -0
- package/lib/cjs/hooks/useDateInfo.js.map +1 -0
- package/lib/cjs/index.js +177 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/types/calendar.js +28 -0
- package/lib/cjs/types/calendar.js.map +1 -0
- package/lib/cjs/types/dateinfo.js +2 -0
- package/lib/cjs/types/dateinfo.js.map +1 -0
- package/lib/cjs/types/openingTimes.js +18 -0
- package/lib/cjs/types/openingTimes.js.map +1 -0
- package/lib/cjs/utils/calendar.js +73 -0
- package/lib/cjs/utils/calendar.js.map +1 -0
- package/lib/cjs/utils/date.js +114 -0
- package/lib/cjs/utils/date.js.map +1 -0
- package/lib/cjs/utils/dateInfo.js +126 -0
- package/lib/cjs/utils/dateInfo.js.map +1 -0
- package/lib/esm/components/calendar/Calendar.js +306 -0
- package/lib/esm/components/calendar/Calendar.js.map +1 -0
- package/lib/esm/components/calendar/Calendar.styles.js +33 -0
- package/lib/esm/components/calendar/Calendar.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/MonthWrapper.js +150 -0
- package/lib/esm/components/calendar/month-wrapper/MonthWrapper.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/MonthWrapper.styles.js +22 -0
- package/lib/esm/components/calendar/month-wrapper/MonthWrapper.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/Month.js +61 -0
- package/lib/esm/components/calendar/month-wrapper/month/Month.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/Month.styles.js +22 -0
- package/lib/esm/components/calendar/month-wrapper/month/Month.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js +121 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js +9 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/Day.js +54 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/Day.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js +123 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js +13 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js +14 -0
- package/lib/esm/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js +34 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js +9 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js +11 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js.map +1 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js +13 -0
- package/lib/esm/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js.map +1 -0
- package/lib/esm/components/calendar/month-year-pickers/MonthYearPickers.js +79 -0
- package/lib/esm/components/calendar/month-year-pickers/MonthYearPickers.js.map +1 -0
- package/lib/esm/components/date-info/DateInfo.js +28 -0
- package/lib/esm/components/date-info/DateInfo.js.map +1 -0
- package/lib/esm/components/opening-times/OpeningTimes.js +240 -0
- package/lib/esm/components/opening-times/OpeningTimes.js.map +1 -0
- package/lib/esm/components/opening-times/OpeningTimes.styles.js +24 -0
- package/lib/esm/components/opening-times/OpeningTimes.styles.js.map +1 -0
- package/lib/esm/components/opening-times/hint-text/HintText.js +12 -0
- package/lib/esm/components/opening-times/hint-text/HintText.js.map +1 -0
- package/lib/esm/components/opening-times/hint-text/HintText.styles.js +23 -0
- package/lib/esm/components/opening-times/hint-text/HintText.styles.js.map +1 -0
- package/lib/esm/components/opening-times/opening-inputs/OpeningInputs.js +149 -0
- package/lib/esm/components/opening-times/opening-inputs/OpeningInputs.js.map +1 -0
- package/lib/esm/components/opening-times/opening-inputs/OpeningInputs.styles.js +22 -0
- package/lib/esm/components/opening-times/opening-inputs/OpeningInputs.styles.js.map +1 -0
- package/lib/esm/components/opening-times/opening-inputs/opening-input/OpeningInput.js +99 -0
- package/lib/esm/components/opening-times/opening-inputs/opening-input/OpeningInput.js.map +1 -0
- package/lib/esm/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js +40 -0
- package/lib/esm/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js.map +1 -0
- package/lib/esm/hooks/useDateInfo.js +57 -0
- package/lib/esm/hooks/useDateInfo.js.map +1 -0
- package/lib/esm/index.js +15 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/types/calendar.js +22 -0
- package/lib/esm/types/calendar.js.map +1 -0
- package/lib/esm/types/dateinfo.js +2 -0
- package/lib/esm/types/dateinfo.js.map +1 -0
- package/lib/esm/types/openingTimes.js +12 -0
- package/lib/esm/types/openingTimes.js.map +1 -0
- package/lib/esm/utils/calendar.js +63 -0
- package/lib/esm/utils/calendar.js.map +1 -0
- package/lib/esm/utils/date.js +89 -0
- package/lib/esm/utils/date.js.map +1 -0
- package/lib/esm/utils/dateInfo.js +120 -0
- package/lib/esm/utils/dateInfo.js.map +1 -0
- package/lib/types/components/calendar/Calendar.d.ts +97 -0
- package/lib/types/components/calendar/Calendar.styles.d.ts +8 -0
- package/lib/types/components/calendar/month-wrapper/MonthWrapper.d.ts +26 -0
- package/lib/types/components/calendar/month-wrapper/MonthWrapper.styles.d.ts +274 -0
- package/lib/types/components/calendar/month-wrapper/month/Month.d.ts +26 -0
- package/lib/types/components/calendar/month-wrapper/month/Month.styles.d.ts +8 -0
- package/lib/types/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.d.ts +20 -0
- package/lib/types/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.d.ts +1 -0
- package/lib/types/components/calendar/month-wrapper/month/day-wrapper/day/Day.d.ts +19 -0
- package/lib/types/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.d.ts +20 -0
- package/lib/types/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.d.ts +6 -0
- package/lib/types/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.d.ts +7 -0
- package/lib/types/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.d.ts +7 -0
- package/lib/types/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.d.ts +1 -0
- package/lib/types/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.d.ts +6 -0
- package/lib/types/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.d.ts +3 -0
- package/lib/types/components/calendar/month-year-pickers/MonthYearPickers.d.ts +19 -0
- package/lib/types/components/date-info/DateInfo.d.ts +5 -0
- package/lib/types/components/opening-times/OpeningTimes.d.ts +51 -0
- package/lib/types/components/opening-times/OpeningTimes.styles.d.ts +11 -0
- package/lib/types/components/opening-times/hint-text/HintText.d.ts +6 -0
- package/lib/types/components/opening-times/hint-text/HintText.styles.d.ts +3 -0
- package/lib/types/components/opening-times/opening-inputs/OpeningInputs.d.ts +46 -0
- package/lib/types/components/opening-times/opening-inputs/OpeningInputs.styles.d.ts +272 -0
- package/lib/types/components/opening-times/opening-inputs/opening-input/OpeningInput.d.ts +15 -0
- package/lib/types/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.d.ts +273 -0
- package/lib/types/hooks/useDateInfo.d.ts +2 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/types/calendar.d.ts +55 -0
- package/lib/types/types/dateinfo.d.ts +34 -0
- package/lib/types/types/openingTimes.d.ts +33 -0
- package/lib/types/utils/calendar.d.ts +18 -0
- package/lib/types/utils/date.d.ts +27 -0
- package/lib/types/utils/dateInfo.d.ts +14 -0
- package/package.json +86 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _HintText = require("./HintText.styles");
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
const HintText = ({
|
|
12
|
+
text
|
|
13
|
+
}) => {
|
|
14
|
+
const [newHintText, setNewHintText] = (0, _react.useState)();
|
|
15
|
+
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_HintText.StyledHintText, null, text), [text]);
|
|
16
|
+
};
|
|
17
|
+
HintText.displayName = 'HintText';
|
|
18
|
+
var _default = exports.default = HintText;
|
|
19
|
+
//# sourceMappingURL=HintText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HintText.js","names":["_react","_interopRequireWildcard","require","_HintText","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","HintText","text","newHintText","setNewHintText","useState","useMemo","createElement","StyledHintText","displayName","_default","exports"],"sources":["../../../../../src/components/opening-times/hint-text/HintText.tsx"],"sourcesContent":["import React, { FC, useMemo, useState } from 'react';\nimport { StyledHintText } from './HintText.styles';\n\nexport type HintTextProps = {\n text: string;\n};\n\nconst HintText: FC<HintTextProps> = ({ text }) => {\n const [newHintText, setNewHintText] = useState<string>();\n\n return useMemo(() => <StyledHintText>{text}</StyledHintText>, [text]);\n};\n\nHintText.displayName = 'HintText';\n\nexport default HintText;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAAmD,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,C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
|
+
exports.StyledHintText = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const StyledHintText = exports.StyledHintText = _styledComponents.default.div`
|
|
10
|
+
border-width: 1px;
|
|
11
|
+
border-style: solid;
|
|
12
|
+
border-color: #9f5f00;
|
|
13
|
+
background-color: #fff3e0;
|
|
14
|
+
color: #222;
|
|
15
|
+
padding: 8px 12px;
|
|
16
|
+
|
|
17
|
+
border-radius: ${({
|
|
18
|
+
theme
|
|
19
|
+
}) => theme.cardBorderRadius}px;
|
|
20
|
+
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, ${({
|
|
21
|
+
theme
|
|
22
|
+
}) => theme.cardShadow});
|
|
23
|
+
`;
|
|
24
|
+
//# sourceMappingURL=HintText.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HintText.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledHintText","exports","styled","div","theme","cardBorderRadius","cardShadow"],"sources":["../../../../../src/components/opening-times/hint-text/HintText.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport styled from 'styled-components';\n\ntype StyledHintTextProp = WithTheme<unknown>;\n\nexport const StyledHintText = styled.div<StyledHintTextProp>`\n border-width: 1px;\n border-style: solid;\n border-color: #9f5f00;\n background-color: #fff3e0;\n color: #222;\n padding: 8px 12px;\n\n border-radius: ${({ theme }: StyledHintTextProp) => theme.cardBorderRadius}px;\n box-shadow: 0 2px 6px 0 rgba(0, 0, 0, ${({ theme }: StyledHintTextProp) => theme.cardShadow});\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIhC,MAAMG,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAGE,yBAAM,CAACC,GAAuB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,CAAC;EAAEC;AAA0B,CAAC,KAAKA,KAAK,CAACC,gBAAgB;AAC9E,4CAA4C,CAAC;EAAED;AAA0B,CAAC,KAAKA,KAAK,CAACE,UAAU;AAC/F,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _framerMotion = require("framer-motion");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _uuid = require("uuid");
|
|
10
|
+
var _openingTimes = require("../../../types/openingTimes");
|
|
11
|
+
var _OpeningInput = _interopRequireDefault(require("./opening-input/OpeningInput"));
|
|
12
|
+
var _OpeningInputs = require("./OpeningInputs.styles");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
const OpeningInputs = ({
|
|
17
|
+
times,
|
|
18
|
+
isDisabled,
|
|
19
|
+
onRemove,
|
|
20
|
+
onAdd,
|
|
21
|
+
onInvalid,
|
|
22
|
+
id,
|
|
23
|
+
onChange,
|
|
24
|
+
currentDayId,
|
|
25
|
+
editMode = false,
|
|
26
|
+
closedText = ''
|
|
27
|
+
}) => {
|
|
28
|
+
const [newTimes, setNewTimes] = (0, _react.useState)();
|
|
29
|
+
const [invalidTimes, setInvalidTimes] = (0, _react.useState)([]);
|
|
30
|
+
(0, _react.useEffect)(() => {
|
|
31
|
+
setNewTimes(times);
|
|
32
|
+
}, [times]);
|
|
33
|
+
const handleAdd = (0, _react.useCallback)(() => {
|
|
34
|
+
const defaultTime = {
|
|
35
|
+
start: '08:00',
|
|
36
|
+
end: '18:00',
|
|
37
|
+
id: (0, _uuid.v4)()
|
|
38
|
+
};
|
|
39
|
+
setNewTimes(prevState => prevState ? [...prevState, defaultTime] : [defaultTime]);
|
|
40
|
+
if (typeof onAdd === 'function') {
|
|
41
|
+
onAdd(defaultTime, id);
|
|
42
|
+
}
|
|
43
|
+
}, [id, onAdd]);
|
|
44
|
+
const handleRemove = (0, _react.useCallback)(timeId => {
|
|
45
|
+
setNewTimes(prevState => (prevState ?? []).filter(time => time.id !== timeId));
|
|
46
|
+
if (typeof onRemove === 'function') {
|
|
47
|
+
onRemove(timeId);
|
|
48
|
+
}
|
|
49
|
+
}, [onRemove]);
|
|
50
|
+
(0, _react.useEffect)(() => {
|
|
51
|
+
const result = [];
|
|
52
|
+
for (let i = 0; i < times.length; i++) {
|
|
53
|
+
const currentTime = times[i];
|
|
54
|
+
const prevTime = times[i - 1];
|
|
55
|
+
if (currentTime) {
|
|
56
|
+
const currStart = new Date(`2000-01-01T${currentTime.start}`);
|
|
57
|
+
const currEnd = new Date(`2000-01-01T${currentTime.end}`);
|
|
58
|
+
if (currStart >= currEnd) {
|
|
59
|
+
result.push(currentTime);
|
|
60
|
+
}
|
|
61
|
+
if (prevTime) {
|
|
62
|
+
const prevEnd = new Date(`2000-01-01T${prevTime.end}`);
|
|
63
|
+
if (prevEnd > currStart) {
|
|
64
|
+
result.push(prevTime, currentTime);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const invalidTimeIds = result.map(({
|
|
70
|
+
id: invalidId
|
|
71
|
+
}) => invalidId);
|
|
72
|
+
setInvalidTimes(invalidTimeIds);
|
|
73
|
+
if (typeof onInvalid === 'function') {
|
|
74
|
+
onInvalid(id, invalidTimeIds);
|
|
75
|
+
}
|
|
76
|
+
}, [id, onInvalid, times]);
|
|
77
|
+
const handleChange = (0, _react.useCallback)(newTime => {
|
|
78
|
+
setNewTimes(prevState => {
|
|
79
|
+
const updatedTimes = (prevState ?? []).map(time => {
|
|
80
|
+
if (time.id === newTime.id) {
|
|
81
|
+
return newTime;
|
|
82
|
+
}
|
|
83
|
+
return time;
|
|
84
|
+
});
|
|
85
|
+
if (typeof onChange === 'function') {
|
|
86
|
+
onChange(newTime);
|
|
87
|
+
}
|
|
88
|
+
return updatedTimes;
|
|
89
|
+
});
|
|
90
|
+
}, [onChange]);
|
|
91
|
+
const content = (0, _react.useMemo)(() => {
|
|
92
|
+
const items = [];
|
|
93
|
+
if (!newTimes) {
|
|
94
|
+
return items;
|
|
95
|
+
}
|
|
96
|
+
newTimes.forEach(({
|
|
97
|
+
end,
|
|
98
|
+
start,
|
|
99
|
+
id: timeId
|
|
100
|
+
}, index) => {
|
|
101
|
+
if (!editMode) {
|
|
102
|
+
const text = isDisabled ? closedText : `${start} - ${end}`;
|
|
103
|
+
items.push(/*#__PURE__*/_react.default.createElement(_OpeningInputs.StyledOpeningInputPreview, {
|
|
104
|
+
key: `opening-times-preview__${id}.${timeId}`
|
|
105
|
+
}, `${text}${currentDayId && newTimes.length > 1 && index === 0 ? ', ' : ''}`));
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (index > 1) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
let buttonType = _openingTimes.OpeningTimesButtonType.NONE;
|
|
112
|
+
if (index === 0 && times.length === 1 && !isDisabled) {
|
|
113
|
+
buttonType = _openingTimes.OpeningTimesButtonType.ADD;
|
|
114
|
+
} else if (index === 1 && !isDisabled) {
|
|
115
|
+
buttonType = _openingTimes.OpeningTimesButtonType.REMOVE;
|
|
116
|
+
}
|
|
117
|
+
items.push(/*#__PURE__*/_react.default.createElement(_OpeningInput.default, {
|
|
118
|
+
key: `opening-times-input__${id}.${timeId}`,
|
|
119
|
+
start: start,
|
|
120
|
+
id: timeId,
|
|
121
|
+
end: end,
|
|
122
|
+
isDisabled: isDisabled,
|
|
123
|
+
isInvalid: invalidTimes.includes(timeId),
|
|
124
|
+
buttonType: buttonType,
|
|
125
|
+
onAdd: handleAdd,
|
|
126
|
+
onChange: time => handleChange(time),
|
|
127
|
+
onRemove: () => handleRemove(timeId)
|
|
128
|
+
}));
|
|
129
|
+
});
|
|
130
|
+
return items;
|
|
131
|
+
}, [closedText, currentDayId, editMode, handleAdd, handleChange, handleRemove, id, invalidTimes, isDisabled, newTimes, times.length]);
|
|
132
|
+
const gap = (0, _react.useMemo)(() => {
|
|
133
|
+
if (newTimes && newTimes.length > 1 && editMode || !editMode && currentDayId) {
|
|
134
|
+
return '8px';
|
|
135
|
+
}
|
|
136
|
+
return 0;
|
|
137
|
+
}, [currentDayId, editMode, newTimes]);
|
|
138
|
+
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_OpeningInputs.StyledOpeningInputs, {
|
|
139
|
+
$editMode: !currentDayId,
|
|
140
|
+
key: `opening-inputs__${id}`,
|
|
141
|
+
animate: {
|
|
142
|
+
gap
|
|
143
|
+
},
|
|
144
|
+
initial: {
|
|
145
|
+
gap: 0
|
|
146
|
+
}
|
|
147
|
+
}, /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
|
|
148
|
+
initial: false
|
|
149
|
+
}, content)), [content, currentDayId, gap, id]);
|
|
150
|
+
};
|
|
151
|
+
OpeningInputs.displayName = 'OpeningInputs';
|
|
152
|
+
var _default = exports.default = OpeningInputs;
|
|
153
|
+
//# sourceMappingURL=OpeningInputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpeningInputs.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_uuid","_openingTimes","_OpeningInput","_interopRequireDefault","_OpeningInputs","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","OpeningInputs","times","isDisabled","onRemove","onAdd","onInvalid","id","onChange","currentDayId","editMode","closedText","newTimes","setNewTimes","useState","invalidTimes","setInvalidTimes","useEffect","handleAdd","useCallback","defaultTime","start","end","uuidV4","prevState","handleRemove","timeId","filter","time","result","length","currentTime","prevTime","currStart","Date","currEnd","push","prevEnd","invalidTimeIds","map","invalidId","handleChange","newTime","updatedTimes","content","useMemo","items","forEach","index","text","createElement","StyledOpeningInputPreview","key","buttonType","OpeningTimesButtonType","NONE","ADD","REMOVE","isInvalid","includes","gap","StyledOpeningInputs","$editMode","animate","initial","AnimatePresence","displayName","_default","exports"],"sources":["../../../../../src/components/opening-times/opening-inputs/OpeningInputs.tsx"],"sourcesContent":["import { AnimatePresence } from 'framer-motion';\nimport React, { FC, useCallback, useEffect, useMemo, useState, type ReactElement } from 'react';\nimport { v4 as uuidV4 } from 'uuid';\nimport { OpeningTimesButtonType, type OpeningTime, type Time } from '../../../types/openingTimes';\nimport OpeningInput from './opening-input/OpeningInput';\nimport { StyledOpeningInputPreview, StyledOpeningInputs } from './OpeningInputs.styles';\n\nexport type OpeningInputsProps = {\n /**\n * Array of opening times\n */\n times: Time[];\n /**\n * If the inputs are disabled\n */\n isDisabled?: boolean;\n /**\n * Function that is called when a time is changed\n */\n onChange?: (time: Time) => void;\n /**\n * Function that is called when a new time is added\n */\n onAdd?: (time: Time, id: string) => void;\n /**\n * Function that is called when a time is removed\n */\n onRemove?: (id: Time['id']) => void;\n /**\n * Function that is called when the times are invalid\n */\n onInvalid?: (openingTimeId: string, timeIds: string[]) => void;\n /**\n * The id of the opening time\n */\n id: string;\n /**\n * The id of the current day\n */\n currentDayId?: OpeningTime['id'];\n /**\n * If the edit mode is enabled\n */\n editMode?: boolean;\n /**\n * The text to show when the inputs are disabled\n */\n closedText?: string;\n};\n\nconst OpeningInputs: FC<OpeningInputsProps> = ({\n times,\n isDisabled,\n onRemove,\n onAdd,\n onInvalid,\n id,\n onChange,\n currentDayId,\n editMode = false,\n closedText = '',\n}) => {\n const [newTimes, setNewTimes] = useState<Time[]>();\n const [invalidTimes, setInvalidTimes] = useState<string[]>([]);\n\n useEffect(() => {\n setNewTimes(times);\n }, [times]);\n\n const handleAdd = useCallback(() => {\n const defaultTime: Time = { start: '08:00', end: '18:00', id: uuidV4() };\n\n setNewTimes((prevState) => (prevState ? [...prevState, defaultTime] : [defaultTime]));\n\n if (typeof onAdd === 'function') {\n onAdd(defaultTime, id);\n }\n }, [id, onAdd]);\n\n const handleRemove = useCallback(\n (timeId: string) => {\n setNewTimes((prevState) => (prevState ?? []).filter((time) => time.id !== timeId));\n\n if (typeof onRemove === 'function') {\n onRemove(timeId);\n }\n },\n [onRemove],\n );\n\n useEffect(() => {\n const result: Time[] = [];\n\n for (let i = 0; i < times.length; i++) {\n const currentTime = times[i];\n const prevTime = times[i - 1];\n\n if (currentTime) {\n const currStart = new Date(`2000-01-01T${currentTime.start}`);\n const currEnd = new Date(`2000-01-01T${currentTime.end}`);\n\n if (currStart >= currEnd) {\n result.push(currentTime);\n }\n\n if (prevTime) {\n const prevEnd = new Date(`2000-01-01T${prevTime.end}`);\n\n if (prevEnd > currStart) {\n result.push(prevTime, currentTime);\n }\n }\n }\n }\n\n const invalidTimeIds = result.map(({ id: invalidId }) => invalidId);\n\n setInvalidTimes(invalidTimeIds);\n\n if (typeof onInvalid === 'function') {\n onInvalid(id, invalidTimeIds);\n }\n }, [id, onInvalid, times]);\n\n const handleChange = useCallback(\n (newTime: Time) => {\n setNewTimes((prevState) => {\n const updatedTimes = (prevState ?? []).map((time) => {\n if (time.id === newTime.id) {\n return newTime;\n }\n return time;\n });\n\n if (typeof onChange === 'function') {\n onChange(newTime);\n }\n\n return updatedTimes;\n });\n },\n [onChange],\n );\n\n const content = useMemo(() => {\n const items: ReactElement[] = [];\n\n if (!newTimes) {\n return items;\n }\n\n newTimes.forEach(({ end, start, id: timeId }, index) => {\n if (!editMode) {\n const text = isDisabled ? closedText : `${start} - ${end}`;\n\n items.push(\n <StyledOpeningInputPreview key={`opening-times-preview__${id}.${timeId}`}>\n {`${text}${currentDayId && newTimes.length > 1 && index === 0 ? ', ' : ''}`}\n </StyledOpeningInputPreview>,\n );\n\n return;\n }\n\n if (index > 1) {\n return;\n }\n\n let buttonType = OpeningTimesButtonType.NONE;\n\n if (index === 0 && times.length === 1 && !isDisabled) {\n buttonType = OpeningTimesButtonType.ADD;\n } else if (index === 1 && !isDisabled) {\n buttonType = OpeningTimesButtonType.REMOVE;\n }\n\n items.push(\n <OpeningInput\n key={`opening-times-input__${id}.${timeId}`}\n start={start}\n id={timeId}\n end={end}\n isDisabled={isDisabled}\n isInvalid={invalidTimes.includes(timeId)}\n buttonType={buttonType}\n onAdd={handleAdd}\n onChange={(time) => handleChange(time)}\n onRemove={() => handleRemove(timeId)}\n />,\n );\n });\n\n return items;\n }, [\n closedText,\n currentDayId,\n editMode,\n handleAdd,\n handleChange,\n handleRemove,\n id,\n invalidTimes,\n isDisabled,\n newTimes,\n times.length,\n ]);\n\n const gap = useMemo(() => {\n if ((newTimes && newTimes.length > 1 && editMode) || (!editMode && currentDayId)) {\n return '8px';\n }\n\n return 0;\n }, [currentDayId, editMode, newTimes]);\n\n return useMemo(\n () => (\n <StyledOpeningInputs\n $editMode={!currentDayId}\n key={`opening-inputs__${id}`}\n animate={{ gap }}\n initial={{ gap: 0 }}\n >\n <AnimatePresence initial={false}>{content}</AnimatePresence>\n </StyledOpeningInputs>\n ),\n [content, currentDayId, gap, id],\n );\n};\n\nOpeningInputs.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,GAAG,CAAC,IAAIpB,QAAQ,IAAM,CAACA,QAAQ,IAAID,YAAa,EAAE;MAC9E,OAAO,KAAK;IAChB;IAEA,OAAO,CAAC;EACZ,CAAC,EAAE,CAACA,YAAY,EAAEC,QAAQ,EAAEE,QAAQ,CAAC,CAAC;EAEtC,OAAO,IAAAiC,cAAO,EACV,mBACIvE,MAAA,CAAAS,OAAA,CAAAmE,aAAA,CAACtE,cAAA,CAAAiF,mBAAmB;IAChBC,SAAS,EAAE,CAACrD,YAAa;IACzB2C,GAAG,EAAE,mBAAmB7C,EAAE,EAAG;IAC7BwD,OAAO,EAAE;MAAEH;IAAI,CAAE;IACjBI,OAAO,EAAE;MAAEJ,GAAG,EAAE;IAAE;EAAE,gBAEpBtF,MAAA,CAAAS,OAAA,CAAAmE,aAAA,CAAC9E,aAAA,CAAA6F,eAAe;IAACD,OAAO,EAAE;EAAM,GAAEpB,OAAyB,CAC1C,CACxB,EACD,CAACA,OAAO,EAAEnC,YAAY,EAAEmD,GAAG,EAAErD,EAAE,CACnC,CAAC;AACL,CAAC;AAEDN,aAAa,CAACiE,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArF,OAAA,GAE7BkB,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledOpeningInputs = exports.StyledOpeningInputPreview = void 0;
|
|
7
|
+
var _framerMotion = require("framer-motion");
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
const StyledOpeningInputs = exports.StyledOpeningInputs = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
12
|
+
display: flex;
|
|
13
|
+
${({
|
|
14
|
+
$editMode
|
|
15
|
+
}) => $editMode && (0, _styledComponents.css)`
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
`}
|
|
18
|
+
`;
|
|
19
|
+
const StyledOpeningInputPreview = exports.StyledOpeningInputPreview = _styledComponents.default.div`
|
|
20
|
+
color: ${({
|
|
21
|
+
theme
|
|
22
|
+
}) => theme.text};
|
|
23
|
+
`;
|
|
24
|
+
//# sourceMappingURL=OpeningInputs.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpeningInputs.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","StyledOpeningInputs","exports","styled","motion","div","$editMode","css","StyledOpeningInputPreview","theme","text"],"sources":["../../../../../src/components/opening-times/opening-inputs/OpeningInputs.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport { motion } from 'framer-motion';\nimport styled, { css } from 'styled-components';\n\ntype StyledOpeningInputsProps = WithTheme<{ $editMode: boolean }>;\n\nexport const StyledOpeningInputs = styled(motion.div)<StyledOpeningInputsProps>`\n display: flex;\n ${({ $editMode }) =>\n $editMode &&\n css`\n flex-direction: column;\n `}\n`;\n\ntype StyledOpeningInputPreviewProps = WithTheme<unknown>;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B,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAIzC,MAAMW,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,yBAAM,EAACC,oBAAM,CAACC,GAAG,CAA2B;AAC/E;AACA,MAAM,CAAC;EAAEC;AAAU,CAAC,KACZA,SAAS,IACT,IAAAC,qBAAG;AACX;AACA,SAAS;AACT,CAAC;AAIM,MAAMC,yBAAyB,GAAAN,OAAA,CAAAM,yBAAA,GAAGL,yBAAM,CAACE,GAAmC;AACnF,aAAa,CAAC;EAAEI;AAAsC,CAAC,KAAKA,KAAK,CAACC,IAAI;AACtE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _core = require("@chayns-components/core");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _openingTimes = require("../../../../types/openingTimes");
|
|
10
|
+
var _OpeningInput = require("./OpeningInput.styles");
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
const OpeningInput = ({
|
|
14
|
+
end,
|
|
15
|
+
start,
|
|
16
|
+
isDisabled,
|
|
17
|
+
isInvalid,
|
|
18
|
+
buttonType,
|
|
19
|
+
onRemove,
|
|
20
|
+
onAdd,
|
|
21
|
+
onChange,
|
|
22
|
+
id
|
|
23
|
+
}) => {
|
|
24
|
+
const [startTime, setStartTime] = (0, _react.useState)(start);
|
|
25
|
+
const [endTime, setEndTime] = (0, _react.useState)(end);
|
|
26
|
+
const button = (0, _react.useMemo)(() => {
|
|
27
|
+
switch (buttonType) {
|
|
28
|
+
case _openingTimes.OpeningTimesButtonType.ADD:
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInputButtonWrapper, {
|
|
30
|
+
onClick: onAdd
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Icon, {
|
|
32
|
+
icons: ['ts-plus'],
|
|
33
|
+
size: 15
|
|
34
|
+
}));
|
|
35
|
+
case _openingTimes.OpeningTimesButtonType.REMOVE:
|
|
36
|
+
return /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInputButtonWrapper, {
|
|
37
|
+
onClick: onRemove
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Icon, {
|
|
39
|
+
icons: ['ts-wrong'],
|
|
40
|
+
size: 15
|
|
41
|
+
}));
|
|
42
|
+
default:
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInputPseudoButton, null);
|
|
44
|
+
}
|
|
45
|
+
}, [buttonType, onAdd, onRemove]);
|
|
46
|
+
const handleStartTimeBlur = (0, _react.useCallback)((value, isTimeInvalid) => {
|
|
47
|
+
if (isTimeInvalid || typeof value === 'number' || !value) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
setStartTime(value);
|
|
51
|
+
onChange({
|
|
52
|
+
end: endTime,
|
|
53
|
+
start: value,
|
|
54
|
+
id
|
|
55
|
+
});
|
|
56
|
+
}, [endTime, id, onChange]);
|
|
57
|
+
const handleEndTimeBlur = (0, _react.useCallback)((value, isTimeInvalid) => {
|
|
58
|
+
if (isTimeInvalid || typeof value === 'number' || !value) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
setEndTime(value);
|
|
62
|
+
onChange({
|
|
63
|
+
end: value,
|
|
64
|
+
start: startTime,
|
|
65
|
+
id
|
|
66
|
+
});
|
|
67
|
+
}, [id, onChange, startTime]);
|
|
68
|
+
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInput, {
|
|
69
|
+
key: id,
|
|
70
|
+
animate: {
|
|
71
|
+
opacity: 1,
|
|
72
|
+
height: 'auto'
|
|
73
|
+
},
|
|
74
|
+
initial: {
|
|
75
|
+
opacity: 0,
|
|
76
|
+
height: 0
|
|
77
|
+
},
|
|
78
|
+
exit: {
|
|
79
|
+
opacity: 0,
|
|
80
|
+
height: 0
|
|
81
|
+
},
|
|
82
|
+
transition: {
|
|
83
|
+
duration: 0.2,
|
|
84
|
+
type: 'tween'
|
|
85
|
+
}
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInputWrapper, null, /*#__PURE__*/_react.default.createElement(_core.NumberInput, {
|
|
87
|
+
shouldShowOnlyBottomBorder: true,
|
|
88
|
+
isTimeInput: true,
|
|
89
|
+
isInvalid: isInvalid,
|
|
90
|
+
value: startTime,
|
|
91
|
+
onBlur: handleStartTimeBlur,
|
|
92
|
+
isDisabled: isDisabled
|
|
93
|
+
})), /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInputText, {
|
|
94
|
+
$isDisabled: isDisabled
|
|
95
|
+
}, "-"), /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInputWrapper, null, /*#__PURE__*/_react.default.createElement(_core.NumberInput, {
|
|
96
|
+
shouldShowOnlyBottomBorder: true,
|
|
97
|
+
isTimeInput: true,
|
|
98
|
+
isInvalid: isInvalid,
|
|
99
|
+
value: endTime,
|
|
100
|
+
onBlur: handleEndTimeBlur,
|
|
101
|
+
isDisabled: isDisabled
|
|
102
|
+
})), button), [button, endTime, handleEndTimeBlur, handleStartTimeBlur, id, isDisabled, isInvalid, startTime]);
|
|
103
|
+
};
|
|
104
|
+
OpeningInput.displayName = 'OpeningInput';
|
|
105
|
+
var _default = exports.default = OpeningInput;
|
|
106
|
+
//# sourceMappingURL=OpeningInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpeningInput.js","names":["_core","require","_react","_interopRequireWildcard","_openingTimes","_OpeningInput","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","OpeningInput","end","start","isDisabled","isInvalid","buttonType","onRemove","onAdd","onChange","id","startTime","setStartTime","useState","endTime","setEndTime","button","useMemo","OpeningTimesButtonType","ADD","createElement","StyledOpeningInputButtonWrapper","onClick","Icon","icons","size","REMOVE","StyledOpeningInputPseudoButton","handleStartTimeBlur","useCallback","value","isTimeInvalid","handleEndTimeBlur","StyledOpeningInput","key","animate","opacity","height","initial","exit","transition","duration","type","StyledOpeningInputWrapper","NumberInput","shouldShowOnlyBottomBorder","isTimeInput","onBlur","StyledOpeningInputText","$isDisabled","displayName","_default","exports"],"sources":["../../../../../../src/components/opening-times/opening-inputs/opening-input/OpeningInput.tsx"],"sourcesContent":["import { Icon, NumberInput } from '@chayns-components/core';\nimport React, { FC, useCallback, useMemo, useState } from 'react';\nimport { OpeningTimesButtonType, type Time } from '../../../../types/openingTimes';\nimport {\n StyledOpeningInput,\n StyledOpeningInputButtonWrapper,\n StyledOpeningInputPseudoButton,\n StyledOpeningInputText,\n StyledOpeningInputWrapper,\n} from './OpeningInput.styles';\n\nexport type OpeningInputProps = {\n start: Time['start'];\n end: Time['end'];\n isDisabled?: boolean;\n isInvalid?: boolean;\n id: string;\n buttonType: OpeningTimesButtonType;\n onAdd: () => void;\n onRemove: () => void;\n onChange: (time: Time) => void;\n};\n\nconst OpeningInput: FC<OpeningInputProps> = ({\n end,\n start,\n isDisabled,\n isInvalid,\n buttonType,\n onRemove,\n onAdd,\n onChange,\n id,\n}) => {\n const [startTime, setStartTime] = useState(start);\n const [endTime, setEndTime] = useState(end);\n\n const button = useMemo(() => {\n switch (buttonType) {\n case OpeningTimesButtonType.ADD:\n return (\n <StyledOpeningInputButtonWrapper onClick={onAdd}>\n <Icon icons={['ts-plus']} size={15} />\n </StyledOpeningInputButtonWrapper>\n );\n case OpeningTimesButtonType.REMOVE:\n return (\n <StyledOpeningInputButtonWrapper onClick={onRemove}>\n <Icon icons={['ts-wrong']} size={15} />\n </StyledOpeningInputButtonWrapper>\n );\n default:\n return <StyledOpeningInputPseudoButton />;\n }\n }, [buttonType, onAdd, onRemove]);\n\n const handleStartTimeBlur = useCallback(\n (value: string | number | null, isTimeInvalid: boolean) => {\n if (isTimeInvalid || typeof value === 'number' || !value) {\n return;\n }\n\n setStartTime(value);\n\n onChange({ end: endTime, start: value, id });\n },\n [endTime, id, onChange],\n );\n\n const handleEndTimeBlur = useCallback(\n (value: string | number | null, isTimeInvalid: boolean) => {\n if (isTimeInvalid || typeof value === 'number' || !value) {\n return;\n }\n\n setEndTime(value);\n\n onChange({ end: value, start: startTime, id });\n },\n [id, onChange, startTime],\n );\n\n return useMemo(\n () => (\n <StyledOpeningInput\n key={id}\n animate={{ opacity: 1, height: 'auto' }}\n initial={{ opacity: 0, height: 0 }}\n exit={{ opacity: 0, height: 0 }}\n transition={{ duration: 0.2, type: 'tween' }}\n >\n <StyledOpeningInputWrapper>\n <NumberInput\n shouldShowOnlyBottomBorder\n isTimeInput\n isInvalid={isInvalid}\n value={startTime}\n onBlur={handleStartTimeBlur}\n isDisabled={isDisabled}\n />\n </StyledOpeningInputWrapper>\n <StyledOpeningInputText $isDisabled={isDisabled}>-</StyledOpeningInputText>\n <StyledOpeningInputWrapper>\n <NumberInput\n shouldShowOnlyBottomBorder\n isTimeInput\n isInvalid={isInvalid}\n value={endTime}\n onBlur={handleEndTimeBlur}\n isDisabled={isDisabled}\n />\n </StyledOpeningInputWrapper>\n {button}\n </StyledOpeningInput>\n ),\n [\n button,\n endTime,\n handleEndTimeBlur,\n handleStartTimeBlur,\n id,\n isDisabled,\n isInvalid,\n startTime,\n ],\n );\n};\n\nOpeningInput.displayName = 'OpeningInput';\n\nexport default OpeningInput;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAM+B,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAA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E;MAAEC,QAAQ,EAAE,GAAG;MAAEC,IAAI,EAAE;IAAQ;EAAE,gBAE7CjE,MAAA,CAAAU,OAAA,CAAAiC,aAAA,CAACxC,aAAA,CAAA+D,yBAAyB,qBACtBlE,MAAA,CAAAU,OAAA,CAAAiC,aAAA,CAAC7C,KAAA,CAAAqE,WAAW;IACRC,0BAA0B;IAC1BC,WAAW;IACXzC,SAAS,EAAEA,SAAU;IACrByB,KAAK,EAAEnB,SAAU;IACjBoC,MAAM,EAAEnB,mBAAoB;IAC5BxB,UAAU,EAAEA;EAAW,CAC1B,CACsB,CAAC,eAC5B3B,MAAA,CAAAU,OAAA,CAAAiC,aAAA,CAACxC,aAAA,CAAAoE,sBAAsB;IAACC,WAAW,EAAE7C;EAAW,GAAC,GAAyB,CAAC,eAC3E3B,MAAA,CAAAU,OAAA,CAAAiC,aAAA,CAACxC,aAAA,CAAA+D,yBAAyB,qBACtBlE,MAAA,CAAAU,OAAA,CAAAiC,aAAA,CAAC7C,KAAA,CAAAqE,WAAW;IACRC,0BAA0B;IAC1BC,WAAW;IACXzC,SAAS,EAAEA,SAAU;IACrByB,KAAK,EAAEhB,OAAQ;IACfiC,MAAM,EAAEf,iBAAkB;IAC1B5B,UAAU,EAAEA;EAAW,CAC1B,CACsB,CAAC,EAC3BY,MACe,CACvB,EACD,CACIA,MAAM,EACNF,OAAO,EACPkB,iBAAiB,EACjBJ,mBAAmB,EACnBlB,EAAE,EACFN,UAAU,EACVC,SAAS,EACTM,SAAS,CAEjB,CAAC;AACL,CAAC;AAEDV,YAAY,CAACiD,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjE,OAAA,GAE3Bc,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledOpeningInputWrapper = exports.StyledOpeningInputText = exports.StyledOpeningInputPseudoButton = exports.StyledOpeningInputButtonWrapper = exports.StyledOpeningInput = void 0;
|
|
7
|
+
var _framerMotion = require("framer-motion");
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const StyledOpeningInput = exports.StyledOpeningInput = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: 6px;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
`;
|
|
16
|
+
const StyledOpeningInputWrapper = exports.StyledOpeningInputWrapper = _styledComponents.default.div`
|
|
17
|
+
width: 60px;
|
|
18
|
+
`;
|
|
19
|
+
const StyledOpeningInputText = exports.StyledOpeningInputText = _styledComponents.default.div`
|
|
20
|
+
opacity: ${({
|
|
21
|
+
$isDisabled
|
|
22
|
+
}) => $isDisabled ? 0.5 : 1};
|
|
23
|
+
`;
|
|
24
|
+
const StyledOpeningInputButtonWrapper = exports.StyledOpeningInputButtonWrapper = _styledComponents.default.div`
|
|
25
|
+
width: 20px;
|
|
26
|
+
height: 20px;
|
|
27
|
+
background-color: ${({
|
|
28
|
+
theme
|
|
29
|
+
}) => theme['202']};
|
|
30
|
+
border-radius: 3px;
|
|
31
|
+
box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.2);
|
|
32
|
+
border: none;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
`;
|
|
38
|
+
const StyledOpeningInputPseudoButton = exports.StyledOpeningInputPseudoButton = _styledComponents.default.div`
|
|
39
|
+
width: 20px;
|
|
40
|
+
`;
|
|
41
|
+
//# sourceMappingURL=OpeningInput.styles.js.map
|
package/lib/cjs/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpeningInput.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledOpeningInput","exports","styled","motion","div","StyledOpeningInputWrapper","StyledOpeningInputText","$isDisabled","StyledOpeningInputButtonWrapper","theme","StyledOpeningInputPseudoButton"],"sources":["../../../../../../src/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport { motion } from 'framer-motion';\nimport styled from 'styled-components';\n\nexport const StyledOpeningInput = styled(motion.div)`\n display: flex;\n align-items: center;\n gap: 6px;\n overflow: hidden;\n`;\n\nexport const StyledOpeningInputWrapper = styled.div`\n width: 60px;\n`;\n\ntype StyledOpeningInputTextProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledOpeningInputText = styled.div<StyledOpeningInputTextProps>`\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n`;\n\ntype StyledOpeningInputButtonWrapperProps = WithTheme<unknown>;\n\nexport const StyledOpeningInputButtonWrapper = styled.div`\n width: 20px;\n height: 20px;\n background-color: ${({ theme }: StyledOpeningInputButtonWrapperProps) => theme['202']};\n border-radius: 3px;\n box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.2);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const StyledOpeningInputPseudoButton = styled.div`\n width: 20px;\n`;\n"],"mappings":";;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,yBAAM,EAACC,oBAAM,CAACC,GAAG,CAAC;AACpD;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,yBAAyB,GAAAJ,OAAA,CAAAI,yBAAA,GAAGH,yBAAM,CAACE,GAAG;AACnD;AACA,CAAC;AAIM,MAAME,sBAAsB,GAAAL,OAAA,CAAAK,sBAAA,GAAGJ,yBAAM,CAACE,GAAgC;AAC7E,eAAe,CAAC;EAAEG;AAAY,CAAC,KAAMA,WAAW,GAAG,GAAG,GAAG,CAAE;AAC3D,CAAC;AAIM,MAAMC,+BAA+B,GAAAP,OAAA,CAAAO,+BAAA,GAAGN,yBAAM,CAACE,GAAG;AACzD;AACA;AACA,wBAAwB,CAAC;EAAEK;AAA4C,CAAC,KAAKA,KAAK,CAAC,KAAK,CAAC;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,8BAA8B,GAAAT,OAAA,CAAAS,8BAAA,GAAGR,yBAAM,CAACE,GAAG;AACxD;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDateInfo = void 0;
|
|
7
|
+
var _chaynsApi = require("chayns-api");
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _dateInfo = require("../utils/dateInfo");
|
|
10
|
+
const useDateInfo = ({
|
|
11
|
+
date,
|
|
12
|
+
shouldShowDateToNowDifference,
|
|
13
|
+
shouldShowRelativeDayOfWeek,
|
|
14
|
+
shouldShowDayOfWeek,
|
|
15
|
+
shouldShowTime,
|
|
16
|
+
shouldUseShortText,
|
|
17
|
+
shouldShowYear,
|
|
18
|
+
preText
|
|
19
|
+
}) => {
|
|
20
|
+
const {
|
|
21
|
+
active: language
|
|
22
|
+
} = (0, _chaynsApi.getLanguage)();
|
|
23
|
+
const [formattedDate, setFormattedDate] = (0, _react.useState)(date.toLocaleDateString());
|
|
24
|
+
const [currentDate, setCurrentDate] = (0, _react.useState)(new Date());
|
|
25
|
+
(0, _react.useEffect)(() => {
|
|
26
|
+
if (shouldShowDateToNowDifference) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
setFormattedDate((0, _dateInfo.getDateInfo)({
|
|
30
|
+
date,
|
|
31
|
+
shouldShowYear,
|
|
32
|
+
shouldShowTime,
|
|
33
|
+
shouldUseShortText,
|
|
34
|
+
shouldShowDayOfWeek,
|
|
35
|
+
shouldShowRelativeDayOfWeek
|
|
36
|
+
}));
|
|
37
|
+
}, [date, shouldShowDateToNowDifference, shouldShowDayOfWeek, shouldShowRelativeDayOfWeek, shouldShowTime, shouldShowYear, shouldUseShortText]);
|
|
38
|
+
(0, _react.useEffect)(() => {
|
|
39
|
+
if (!shouldShowDateToNowDifference) return () => {};
|
|
40
|
+
const updateCurrentDate = () => setCurrentDate(new Date());
|
|
41
|
+
const now = new Date();
|
|
42
|
+
const timeDiffInMs = Math.abs(date.getTime() - now.getTime());
|
|
43
|
+
const updateInterval = timeDiffInMs < 60000 ? 1000 : 60000 - now.getSeconds() * 1000;
|
|
44
|
+
const intervalId = setInterval(updateCurrentDate, 1000);
|
|
45
|
+
const timeout = setTimeout(updateCurrentDate, updateInterval);
|
|
46
|
+
return () => {
|
|
47
|
+
clearTimeout(timeout);
|
|
48
|
+
clearInterval(intervalId);
|
|
49
|
+
};
|
|
50
|
+
}, [date, shouldShowDateToNowDifference]);
|
|
51
|
+
(0, _react.useEffect)(() => {
|
|
52
|
+
if (shouldShowDateToNowDifference) {
|
|
53
|
+
setFormattedDate((0, _dateInfo.getTimeTillNow)({
|
|
54
|
+
date,
|
|
55
|
+
currentDate,
|
|
56
|
+
language
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
}, [date, currentDate, language, shouldShowDateToNowDifference]);
|
|
60
|
+
return (0, _react.useMemo)(() => `${preText ? `${preText.trim()} ` : ''}${formattedDate}`, [formattedDate, preText]);
|
|
61
|
+
};
|
|
62
|
+
exports.useDateInfo = useDateInfo;
|
|
63
|
+
//# sourceMappingURL=useDateInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDateInfo.js","names":["_chaynsApi","require","_react","_dateInfo","useDateInfo","date","shouldShowDateToNowDifference","shouldShowRelativeDayOfWeek","shouldShowDayOfWeek","shouldShowTime","shouldUseShortText","shouldShowYear","preText","active","language","getLanguage","formattedDate","setFormattedDate","useState","toLocaleDateString","currentDate","setCurrentDate","Date","useEffect","getDateInfo","updateCurrentDate","now","timeDiffInMs","Math","abs","getTime","updateInterval","getSeconds","intervalId","setInterval","timeout","setTimeout","clearTimeout","clearInterval","getTimeTillNow","useMemo","trim","exports"],"sources":["../../../src/hooks/useDateInfo.ts"],"sourcesContent":["import { getLanguage } from 'chayns-api';\nimport { useEffect, useMemo, useState } from 'react';\nimport { UseDateInfoOptions } from '../types/dateinfo';\nimport { getDateInfo, getTimeTillNow } from '../utils/dateInfo';\n\nexport const useDateInfo = ({\n date,\n shouldShowDateToNowDifference,\n shouldShowRelativeDayOfWeek,\n shouldShowDayOfWeek,\n shouldShowTime,\n shouldUseShortText,\n shouldShowYear,\n preText,\n}: UseDateInfoOptions) => {\n const { active: language } = getLanguage();\n\n const [formattedDate, setFormattedDate] = useState(date.toLocaleDateString());\n const [currentDate, setCurrentDate] = useState(new Date());\n\n useEffect(() => {\n if (shouldShowDateToNowDifference) {\n return;\n }\n\n setFormattedDate(\n getDateInfo({\n date,\n shouldShowYear,\n shouldShowTime,\n shouldUseShortText,\n shouldShowDayOfWeek,\n shouldShowRelativeDayOfWeek,\n }),\n );\n }, [\n date,\n shouldShowDateToNowDifference,\n shouldShowDayOfWeek,\n shouldShowRelativeDayOfWeek,\n shouldShowTime,\n shouldShowYear,\n shouldUseShortText,\n ]);\n\n useEffect(() => {\n if (!shouldShowDateToNowDifference) return () => {};\n\n const updateCurrentDate = () => setCurrentDate(new Date());\n const now = new Date();\n const timeDiffInMs = Math.abs(date.getTime() - now.getTime());\n\n const updateInterval = timeDiffInMs < 60000 ? 1000 : 60000 - now.getSeconds() * 1000;\n\n const intervalId = setInterval(updateCurrentDate, 1000);\n const timeout = setTimeout(updateCurrentDate, updateInterval);\n\n return () => {\n clearTimeout(timeout);\n clearInterval(intervalId);\n };\n }, [date, shouldShowDateToNowDifference]);\n\n useEffect(() => {\n if (shouldShowDateToNowDifference) {\n setFormattedDate(getTimeTillNow({ date, currentDate, language }));\n }\n }, [date, currentDate, language, shouldShowDateToNowDifference]);\n\n return useMemo(\n () => `${preText ? `${preText.trim()} ` : ''}${formattedDate}`,\n [formattedDate, preText],\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAEO,MAAMG,WAAW,GAAGA,CAAC;EACxBC,IAAI;EACJC,6BAA6B;EAC7BC,2BAA2B;EAC3BC,mBAAmB;EACnBC,cAAc;EACdC,kBAAkB;EAClBC,cAAc;EACdC;AACgB,CAAC,KAAK;EACtB,MAAM;IAAEC,MAAM,EAAEC;EAAS,CAAC,GAAG,IAAAC,sBAAW,EAAC,CAAC;EAE1C,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAG,IAAAC,eAAQ,EAACb,IAAI,CAACc,kBAAkB,CAAC,CAAC,CAAC;EAC7E,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAG,IAAAH,eAAQ,EAAC,IAAII,IAAI,CAAC,CAAC,CAAC;EAE1D,IAAAC,gBAAS,EAAC,MAAM;IACZ,IAAIjB,6BAA6B,EAAE;MAC/B;IACJ;IAEAW,gBAAgB,CACZ,IAAAO,qBAAW,EAAC;MACRnB,IAAI;MACJM,cAAc;MACdF,cAAc;MACdC,kBAAkB;MAClBF,mBAAmB;MACnBD;IACJ,CAAC,CACL,CAAC;EACL,CAAC,EAAE,CACCF,IAAI,EACJC,6BAA6B,EAC7BE,mBAAmB,EACnBD,2BAA2B,EAC3BE,cAAc,EACd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