@chayns-components/date 5.0.0-beta.433

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.
Files changed (90) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +34 -0
  3. package/lib/components/calendar/Calendar.d.ts +36 -0
  4. package/lib/components/calendar/Calendar.js +141 -0
  5. package/lib/components/calendar/Calendar.js.map +1 -0
  6. package/lib/components/calendar/Calendar.styles.d.ts +4 -0
  7. package/lib/components/calendar/Calendar.styles.js +20 -0
  8. package/lib/components/calendar/Calendar.styles.js.map +1 -0
  9. package/lib/components/calendar/month-wrapper/MonthWrapper.d.ts +17 -0
  10. package/lib/components/calendar/month-wrapper/MonthWrapper.js +137 -0
  11. package/lib/components/calendar/month-wrapper/MonthWrapper.js.map +1 -0
  12. package/lib/components/calendar/month-wrapper/MonthWrapper.styles.d.ts +271 -0
  13. package/lib/components/calendar/month-wrapper/MonthWrapper.styles.js +24 -0
  14. package/lib/components/calendar/month-wrapper/MonthWrapper.styles.js.map +1 -0
  15. package/lib/components/calendar/month-wrapper/month/Month.d.ts +14 -0
  16. package/lib/components/calendar/month-wrapper/month/Month.js +43 -0
  17. package/lib/components/calendar/month-wrapper/month/Month.js.map +1 -0
  18. package/lib/components/calendar/month-wrapper/month/Month.styles.d.ts +4 -0
  19. package/lib/components/calendar/month-wrapper/month/Month.styles.js +23 -0
  20. package/lib/components/calendar/month-wrapper/month/Month.styles.js.map +1 -0
  21. package/lib/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.d.ts +12 -0
  22. package/lib/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js +60 -0
  23. package/lib/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js.map +1 -0
  24. package/lib/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.d.ts +2 -0
  25. package/lib/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js +17 -0
  26. package/lib/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js.map +1 -0
  27. package/lib/components/calendar/month-wrapper/month/day-wrapper/day/Day.d.ts +12 -0
  28. package/lib/components/calendar/month-wrapper/month/day-wrapper/day/Day.js +66 -0
  29. package/lib/components/calendar/month-wrapper/month/day-wrapper/day/Day.js.map +1 -0
  30. package/lib/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.d.ts +15 -0
  31. package/lib/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js +75 -0
  32. package/lib/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js.map +1 -0
  33. package/lib/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.d.ts +6 -0
  34. package/lib/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js +20 -0
  35. package/lib/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js.map +1 -0
  36. package/lib/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.d.ts +7 -0
  37. package/lib/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js +21 -0
  38. package/lib/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js.map +1 -0
  39. package/lib/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.d.ts +7 -0
  40. package/lib/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js +45 -0
  41. package/lib/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js.map +1 -0
  42. package/lib/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.d.ts +2 -0
  43. package/lib/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js +16 -0
  44. package/lib/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js.map +1 -0
  45. package/lib/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.d.ts +6 -0
  46. package/lib/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js +18 -0
  47. package/lib/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js.map +1 -0
  48. package/lib/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.d.ts +4 -0
  49. package/lib/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js +19 -0
  50. package/lib/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js.map +1 -0
  51. package/lib/components/date-info/DateInfo.d.ts +37 -0
  52. package/lib/components/date-info/DateInfo.js +110 -0
  53. package/lib/components/date-info/DateInfo.js.map +1 -0
  54. package/lib/components/opening-times/OpeningTimes.d.ts +27 -0
  55. package/lib/components/opening-times/OpeningTimes.js +135 -0
  56. package/lib/components/opening-times/OpeningTimes.js.map +1 -0
  57. package/lib/components/opening-times/OpeningTimes.styles.d.ts +8 -0
  58. package/lib/components/opening-times/OpeningTimes.styles.js +19 -0
  59. package/lib/components/opening-times/OpeningTimes.styles.js.map +1 -0
  60. package/lib/components/opening-times/opening-inputs/OpeningInputs.d.ts +12 -0
  61. package/lib/components/opening-times/opening-inputs/OpeningInputs.js +94 -0
  62. package/lib/components/opening-times/opening-inputs/OpeningInputs.js.map +1 -0
  63. package/lib/components/opening-times/opening-inputs/OpeningInputs.styles.d.ts +2 -0
  64. package/lib/components/opening-times/opening-inputs/OpeningInputs.styles.js +13 -0
  65. package/lib/components/opening-times/opening-inputs/OpeningInputs.styles.js.map +1 -0
  66. package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.d.ts +14 -0
  67. package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.js +100 -0
  68. package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.js.map +1 -0
  69. package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.d.ts +274 -0
  70. package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js +46 -0
  71. package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js.map +1 -0
  72. package/lib/constants/dateInfo.d.ts +22 -0
  73. package/lib/constants/dateInfo.js +629 -0
  74. package/lib/constants/dateInfo.js.map +1 -0
  75. package/lib/index.d.ts +5 -0
  76. package/lib/index.js +28 -0
  77. package/lib/index.js.map +1 -0
  78. package/lib/types/calendar.d.ts +32 -0
  79. package/lib/types/calendar.js +22 -0
  80. package/lib/types/calendar.js.map +1 -0
  81. package/lib/types/openingTimes.d.ts +28 -0
  82. package/lib/types/openingTimes.js +13 -0
  83. package/lib/types/openingTimes.js.map +1 -0
  84. package/lib/utils/calendar.d.ts +15 -0
  85. package/lib/utils/calendar.js +58 -0
  86. package/lib/utils/calendar.js.map +1 -0
  87. package/lib/utils/dateInfo.d.ts +55 -0
  88. package/lib/utils/dateInfo.js +364 -0
  89. package/lib/utils/dateInfo.js.map +1 -0
  90. package/package.json +69 -0
@@ -0,0 +1,135 @@
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 _core = require("@chayns-components/core");
9
+ var _OpeningInputs = _interopRequireDefault(require("./opening-inputs/OpeningInputs"));
10
+ var _OpeningTimes = require("./OpeningTimes.styles");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ 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); }
13
+ 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 && Object.prototype.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; }
14
+ const OpeningTimes = _ref => {
15
+ let {
16
+ openingTimes,
17
+ weekdays,
18
+ onChange,
19
+ onTimeAdd,
20
+ onTimeRemove
21
+ } = _ref;
22
+ const [newOpeningTimes, setNewOpeningTimes] = (0, _react.useState)();
23
+ (0, _react.useEffect)(() => {
24
+ setNewOpeningTimes(openingTimes);
25
+ }, [openingTimes]);
26
+ const handleCheckBoxChange = (0, _react.useCallback)(id => {
27
+ setNewOpeningTimes(prevOpeningTimes => {
28
+ const updatedOpeningTimes = (prevOpeningTimes ?? []).map(openingTime => {
29
+ if (openingTime.id === id) {
30
+ return {
31
+ ...openingTime,
32
+ isDisabled: !openingTime.isDisabled
33
+ };
34
+ }
35
+ return openingTime;
36
+ });
37
+ if (typeof onChange === 'function') {
38
+ onChange({
39
+ enabledDays: updatedOpeningTimes.filter(item => !item.isDisabled).map(item => item.id)
40
+ });
41
+ }
42
+ return updatedOpeningTimes;
43
+ });
44
+ }, [onChange]);
45
+ const handleChange = (0, _react.useCallback)((newTime, id) => {
46
+ setNewOpeningTimes(prevOpeningTimes => {
47
+ const updatedOpeningTimes = (prevOpeningTimes ?? []).map(openingTime => {
48
+ if (openingTime.id === id) {
49
+ const newTimes = openingTime.times.map(time => {
50
+ if (time.id === newTime.id) {
51
+ return newTime;
52
+ }
53
+ return time;
54
+ });
55
+ return {
56
+ ...openingTime,
57
+ times: newTimes
58
+ };
59
+ }
60
+ return openingTime;
61
+ });
62
+ if (typeof onChange === 'function') {
63
+ onChange({
64
+ time: newTime
65
+ });
66
+ }
67
+ return updatedOpeningTimes;
68
+ });
69
+ }, [onChange]);
70
+ const handleAdd = (0, _react.useCallback)((time, id) => {
71
+ setNewOpeningTimes(prevOpeningTimes => (prevOpeningTimes ?? []).map(openingTime => {
72
+ if (openingTime.id === id) {
73
+ return {
74
+ ...openingTime,
75
+ times: [...openingTime.times, time]
76
+ };
77
+ }
78
+ return openingTime;
79
+ }));
80
+ if (typeof onTimeAdd === 'function') {
81
+ onTimeAdd({
82
+ dayId: id,
83
+ time
84
+ });
85
+ }
86
+ }, [onTimeAdd]);
87
+ const handleRemove = (0, _react.useCallback)(id => {
88
+ setNewOpeningTimes(prevOpeningTimes => (prevOpeningTimes ?? []).map(openingTime => {
89
+ const newTimes = openingTime.times.filter(time => time.id !== id);
90
+ return {
91
+ ...openingTime,
92
+ times: newTimes
93
+ };
94
+ }));
95
+ if (typeof onTimeRemove === 'function') {
96
+ onTimeRemove(id);
97
+ }
98
+ }, [onTimeRemove]);
99
+ const content = (0, _react.useMemo)(() => {
100
+ const items = [];
101
+ if (!newOpeningTimes) {
102
+ return items;
103
+ }
104
+ newOpeningTimes.forEach(_ref2 => {
105
+ let {
106
+ times,
107
+ id,
108
+ weekdayId,
109
+ isDisabled
110
+ } = _ref2;
111
+ const weekday = weekdays.find(weekDay => weekDay.id === weekdayId)?.name;
112
+ if (!weekday) {
113
+ return;
114
+ }
115
+ items.push( /*#__PURE__*/_react.default.createElement(_OpeningTimes.StyledOpeningTimesWrapper, {
116
+ key: `openingTimes__${id}`
117
+ }, /*#__PURE__*/_react.default.createElement(_core.Checkbox, {
118
+ isChecked: !isDisabled,
119
+ onChange: () => handleCheckBoxChange(id)
120
+ }, weekday), /*#__PURE__*/_react.default.createElement(_OpeningInputs.default, {
121
+ id: id,
122
+ times: times,
123
+ isDisabled: isDisabled,
124
+ onChange: newTime => handleChange(newTime, id),
125
+ onRemove: handleRemove,
126
+ onAdd: handleAdd
127
+ })));
128
+ });
129
+ return items;
130
+ }, [handleAdd, handleChange, handleCheckBoxChange, handleRemove, newOpeningTimes, weekdays]);
131
+ return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_OpeningTimes.StyledOpeningTimes, null, content), [content]);
132
+ };
133
+ OpeningTimes.displayName = 'OpeningTimes';
134
+ var _default = exports.default = OpeningTimes;
135
+ //# sourceMappingURL=OpeningTimes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpeningTimes.js","names":["_react","_interopRequireWildcard","require","_core","_OpeningInputs","_interopRequireDefault","_OpeningTimes","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","OpeningTimes","_ref","openingTimes","weekdays","onChange","onTimeAdd","onTimeRemove","newOpeningTimes","setNewOpeningTimes","useState","useEffect","handleCheckBoxChange","useCallback","id","prevOpeningTimes","updatedOpeningTimes","map","openingTime","isDisabled","enabledDays","filter","item","handleChange","newTime","newTimes","times","time","handleAdd","dayId","handleRemove","content","useMemo","items","forEach","_ref2","weekdayId","weekday","find","weekDay","name","push","createElement","StyledOpeningTimesWrapper","key","Checkbox","isChecked","onRemove","onAdd","StyledOpeningTimes","displayName","_default","exports"],"sources":["../../../src/components/opening-times/OpeningTimes.tsx"],"sourcesContent":["import React, { FC, useCallback, useEffect, useMemo, useState, type ReactElement } from 'react';\nimport type { OnChange, OnTimeAdd, OpeningTime, Time, Weekday } from '../../types/openingTimes';\nimport { Checkbox } from '@chayns-components/core';\nimport OpeningInputs from './opening-inputs/OpeningInputs';\nimport { StyledOpeningTimes, StyledOpeningTimesWrapper } from './OpeningTimes.styles';\n\nexport type OpeningTimesProps = {\n /**\n * Function to be executed when a time is changed or a day is enabled/disabled.\n * @param openingTimes\n */\n onChange?: ({ time, enabledDays }: OnChange) => void;\n /**\n * Function to be executed when a time is added.\n */\n onTimeAdd?: ({ time, dayId }: OnTimeAdd) => void;\n /**\n * Function to be executed when a time is removed.\n */\n onTimeRemove?: (id: string) => void;\n /**\n * The opening times corresponding to its weekday.\n */\n openingTimes: OpeningTime[];\n /**\n * The weekdays that should be displayed.\n */\n weekdays: Weekday[];\n};\n\nconst OpeningTimes: FC<OpeningTimesProps> = ({\n openingTimes,\n weekdays,\n onChange,\n onTimeAdd,\n onTimeRemove,\n}) => {\n const [newOpeningTimes, setNewOpeningTimes] = useState<OpeningTime[]>();\n\n useEffect(() => {\n setNewOpeningTimes(openingTimes);\n }, [openingTimes]);\n\n const handleCheckBoxChange = useCallback(\n (id: string) => {\n setNewOpeningTimes((prevOpeningTimes) => {\n const updatedOpeningTimes = (prevOpeningTimes ?? []).map((openingTime) => {\n if (openingTime.id === id) {\n return { ...openingTime, isDisabled: !openingTime.isDisabled };\n }\n return openingTime;\n });\n\n if (typeof onChange === 'function') {\n onChange({\n enabledDays: updatedOpeningTimes\n .filter((item) => !item.isDisabled)\n .map((item) => item.id),\n });\n }\n\n return updatedOpeningTimes;\n });\n },\n [onChange],\n );\n\n const handleChange = useCallback(\n (newTime: Time, id: string) => {\n setNewOpeningTimes((prevOpeningTimes) => {\n const updatedOpeningTimes = (prevOpeningTimes ?? []).map((openingTime) => {\n if (openingTime.id === id) {\n const newTimes = openingTime.times.map((time) => {\n if (time.id === newTime.id) {\n return newTime;\n }\n\n return time;\n });\n\n return { ...openingTime, times: newTimes };\n }\n return openingTime;\n });\n\n if (typeof onChange === 'function') {\n onChange({ time: newTime });\n }\n\n return updatedOpeningTimes;\n });\n },\n [onChange],\n );\n\n const handleAdd = useCallback(\n (time: Time, id: string) => {\n setNewOpeningTimes((prevOpeningTimes) =>\n (prevOpeningTimes ?? []).map((openingTime) => {\n if (openingTime.id === id) {\n return { ...openingTime, times: [...openingTime.times, time] };\n }\n return openingTime;\n }),\n );\n\n if (typeof onTimeAdd === 'function') {\n onTimeAdd({ dayId: id, time });\n }\n },\n [onTimeAdd],\n );\n\n const handleRemove = useCallback(\n (id: string) => {\n setNewOpeningTimes((prevOpeningTimes) =>\n (prevOpeningTimes ?? []).map((openingTime) => {\n const newTimes = openingTime.times.filter((time) => time.id !== id);\n\n return { ...openingTime, times: newTimes };\n }),\n );\n\n if (typeof onTimeRemove === 'function') {\n onTimeRemove(id);\n }\n },\n [onTimeRemove],\n );\n\n const content = useMemo(() => {\n const items: ReactElement[] = [];\n\n if (!newOpeningTimes) {\n return items;\n }\n\n newOpeningTimes.forEach(({ times, id, weekdayId, isDisabled }) => {\n const weekday = weekdays.find((weekDay) => weekDay.id === weekdayId)?.name;\n\n if (!weekday) {\n return;\n }\n\n items.push(\n <StyledOpeningTimesWrapper key={`openingTimes__${id}`}>\n <Checkbox isChecked={!isDisabled} onChange={() => handleCheckBoxChange(id)}>\n {weekday}\n </Checkbox>\n <OpeningInputs\n id={id}\n times={times}\n isDisabled={isDisabled}\n onChange={(newTime) => handleChange(newTime, id)}\n onRemove={handleRemove}\n onAdd={handleAdd}\n />\n </StyledOpeningTimesWrapper>,\n );\n });\n\n return items;\n }, [handleAdd, handleChange, handleCheckBoxChange, handleRemove, newOpeningTimes, weekdays]);\n\n return useMemo(() => <StyledOpeningTimes>{content}</StyledOpeningTimes>, [content]);\n};\n\nOpeningTimes.displayName = 'OpeningTimes';\n\nexport default OpeningTimes;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAAsF,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,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,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAA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SliderButtonProps = WithTheme<{
4
+ isDisabled?: boolean;
5
+ }>;
6
+ export declare const StyledOpeningTimes: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSliderButtonProps>>;
7
+ export declare const StyledOpeningTimesWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
8
+ export {};
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledOpeningTimesWrapper = exports.StyledOpeningTimes = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const StyledOpeningTimes = exports.StyledOpeningTimes = _styledComponents.default.div`
10
+ display: flex;
11
+ flex-direction: column;
12
+ gap: 8px;
13
+ `;
14
+ const StyledOpeningTimesWrapper = exports.StyledOpeningTimesWrapper = _styledComponents.default.div`
15
+ display: flex;
16
+ align-items: baseline;
17
+ justify-content: space-between;
18
+ `;
19
+ //# sourceMappingURL=OpeningTimes.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpeningTimes.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledOpeningTimes","exports","styled","div","StyledOpeningTimesWrapper"],"sources":["../../../src/components/opening-times/OpeningTimes.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport type { WithTheme } from '@chayns-components/core';\n\ntype StyledSliderButtonProps = WithTheme<{ isDisabled?: boolean }>;\n\nexport const StyledOpeningTimes = styled.div<StyledSliderButtonProps>`\n display: flex;\n flex-direction: column;\n gap: 8px;\n`;\n\nexport const StyledOpeningTimesWrapper = styled.div`\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAKhC,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAGE,yBAAM,CAACC,GAA6B;AACtE;AACA;AACA;AACA,CAAC;AAEM,MAAMC,yBAAyB,GAAAH,OAAA,CAAAG,yBAAA,GAAGF,yBAAM,CAACC,GAAI;AACpD;AACA;AACA;AACA,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { type Time } from '../../../types/openingTimes';
3
+ export type OpeningInputsProps = {
4
+ times: Time[];
5
+ isDisabled?: boolean;
6
+ onChange: (time: Time) => void;
7
+ onAdd: (time: Time, id: string) => void;
8
+ onRemove: (id: Time['id']) => void;
9
+ id: string;
10
+ };
11
+ declare const OpeningInputs: FC<OpeningInputsProps>;
12
+ export default OpeningInputs;
@@ -0,0 +1,94 @@
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(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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 && Object.prototype.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 = _ref => {
17
+ let {
18
+ times,
19
+ isDisabled,
20
+ onRemove,
21
+ onAdd,
22
+ id,
23
+ onChange
24
+ } = _ref;
25
+ const [newTimes, setNewTimes] = (0, _react.useState)();
26
+ (0, _react.useEffect)(() => {
27
+ setNewTimes(times);
28
+ }, [times]);
29
+ const handleAdd = (0, _react.useCallback)(() => {
30
+ const defaultTime = {
31
+ start: '08:00',
32
+ end: '18:00',
33
+ id: (0, _uuid.v4)()
34
+ };
35
+ setNewTimes(prevState => prevState ? [...prevState, defaultTime] : [defaultTime]);
36
+ onAdd(defaultTime, id);
37
+ }, [id, onAdd]);
38
+ const handleRemove = (0, _react.useCallback)(timeId => {
39
+ setNewTimes(prevState => (prevState ?? []).filter(time => time.id !== timeId));
40
+ onRemove(timeId);
41
+ }, [onRemove]);
42
+ const handleChange = (0, _react.useCallback)(newTime => {
43
+ setNewTimes(prevState => {
44
+ const updatedTimes = (prevState ?? []).map(time => {
45
+ if (time.id === newTime.id) {
46
+ return newTime;
47
+ }
48
+ return time;
49
+ });
50
+ onChange(newTime);
51
+ return updatedTimes;
52
+ });
53
+ }, [onChange]);
54
+ const content = (0, _react.useMemo)(() => {
55
+ const items = [];
56
+ if (!newTimes) {
57
+ return items;
58
+ }
59
+ newTimes.forEach((_ref2, index) => {
60
+ let {
61
+ end,
62
+ start,
63
+ id: timeId
64
+ } = _ref2;
65
+ if (index > 1) {
66
+ return;
67
+ }
68
+ let buttonType = _openingTimes.OpeningTimesButtonType.NONE;
69
+ if (index === 0 && times.length === 1 && !isDisabled) {
70
+ buttonType = _openingTimes.OpeningTimesButtonType.ADD;
71
+ } else if (index === 1 && !isDisabled) {
72
+ buttonType = _openingTimes.OpeningTimesButtonType.REMOVE;
73
+ }
74
+ items.push( /*#__PURE__*/_react.default.createElement(_OpeningInput.default, {
75
+ key: `opening-times-input__${id}.${timeId}`,
76
+ start: start,
77
+ id: timeId,
78
+ end: end,
79
+ isDisabled: isDisabled,
80
+ buttonType: buttonType,
81
+ onAdd: handleAdd,
82
+ onChange: time => handleChange(time),
83
+ onRemove: () => handleRemove(timeId)
84
+ }));
85
+ });
86
+ return items;
87
+ }, [handleAdd, handleChange, handleRemove, id, isDisabled, newTimes, times.length]);
88
+ return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_OpeningInputs.StyledOpeningInputs, null, /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
89
+ initial: false
90
+ }, content)), [content]);
91
+ };
92
+ OpeningInputs.displayName = 'OpeningInputs';
93
+ var _default = exports.default = OpeningInputs;
94
+ //# sourceMappingURL=OpeningInputs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpeningInputs.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_uuid","_openingTimes","_OpeningInput","_interopRequireDefault","_OpeningInputs","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","OpeningInputs","_ref","times","isDisabled","onRemove","onAdd","id","onChange","newTimes","setNewTimes","useState","useEffect","handleAdd","useCallback","defaultTime","start","end","uuidV4","prevState","handleRemove","timeId","filter","time","handleChange","newTime","updatedTimes","map","content","useMemo","items","forEach","_ref2","index","buttonType","OpeningTimesButtonType","NONE","length","ADD","REMOVE","push","createElement","key","StyledOpeningInputs","AnimatePresence","initial","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 Time } from '../../../types/openingTimes';\nimport OpeningInput from './opening-input/OpeningInput';\nimport { StyledOpeningInputs } from './OpeningInputs.styles';\n\nexport type OpeningInputsProps = {\n times: Time[];\n isDisabled?: boolean;\n onChange: (time: Time) => void;\n onAdd: (time: Time, id: string) => void;\n onRemove: (id: Time['id']) => void;\n id: string;\n};\n\nconst OpeningInputs: FC<OpeningInputsProps> = ({\n times,\n isDisabled,\n onRemove,\n onAdd,\n id,\n onChange,\n}) => {\n const [newTimes, setNewTimes] = useState<Time[]>();\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 onAdd(defaultTime, id);\n }, [id, onAdd]);\n\n const handleRemove = useCallback(\n (timeId: string) => {\n setNewTimes((prevState) => (prevState ?? []).filter((time) => time.id !== timeId));\n\n onRemove(timeId);\n },\n [onRemove],\n );\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 onChange(newTime);\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 (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 buttonType={buttonType}\n onAdd={handleAdd}\n onChange={(time) => handleChange(time)}\n onRemove={() => handleRemove(timeId)}\n />,\n );\n });\n\n return items;\n }, [handleAdd, handleChange, handleRemove, id, isDisabled, newTimes, times.length]);\n\n return useMemo(\n () => (\n <StyledOpeningInputs>\n <AnimatePresence initial={false}>{content}</AnimatePresence>\n </StyledOpeningInputs>\n ),\n [content],\n );\n};\n\nOpeningInputs.displayName = 'OpeningInputs';\n\nexport default OpeningInputs;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AAA6D,SAAAM,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,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,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAZ,CAAA,oBAAAY,CAAA,IAAAH,MAAA,C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C8B,UAAU,GAAGC,oCAAsB,CAACI,MAAM;MAC9C;MAEAT,KAAK,CAACU,IAAI,eACNpE,MAAA,CAAAS,OAAA,CAAA4D,aAAA,CAACjE,aAAA,CAAAK,OAAY;QACT6D,GAAG,EAAG,wBAAuBnC,EAAG,IAAGc,MAAO,EAAE;QAC5CL,KAAK,EAAEA,KAAM;QACbT,EAAE,EAAEc,MAAO;QACXJ,GAAG,EAAEA,GAAI;QACTb,UAAU,EAAEA,UAAW;QACvB8B,UAAU,EAAEA,UAAW;QACvB5B,KAAK,EAAEO,SAAU;QACjBL,QAAQ,EAAGe,IAAI,IAAKC,YAAY,CAACD,IAAI,CAAE;QACvClB,QAAQ,EAAEA,CAAA,KAAMe,YAAY,CAACC,MAAM;MAAE,CACxC,CACL,CAAC;IACL,CAAC,CAAC;IAEF,OAAOS,KAAK;EAChB,CAAC,EAAE,CAACjB,SAAS,EAAEW,YAAY,EAAEJ,YAAY,EAAEb,EAAE,EAAEH,UAAU,EAAEK,QAAQ,EAAEN,KAAK,CAACkC,MAAM,CAAC,CAAC;EAEnF,OAAO,IAAAR,cAAO,EACV,mBACIzD,MAAA,CAAAS,OAAA,CAAA4D,aAAA,CAAC/D,cAAA,CAAAiE,mBAAmB,qBAChBvE,MAAA,CAAAS,OAAA,CAAA4D,aAAA,CAACvE,aAAA,CAAA0E,eAAe;IAACC,OAAO,EAAE;EAAM,GAAEjB,OAAyB,CAC1C,CACxB,EACD,CAACA,OAAO,CACZ,CAAC;AACL,CAAC;AAED3B,aAAa,CAAC6C,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAnE,OAAA,GAE7BoB,aAAa"}
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledOpeningInputs: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledOpeningInputs = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const StyledOpeningInputs = exports.StyledOpeningInputs = _styledComponents.default.div`
10
+ display: flex;
11
+ flex-direction: column;
12
+ `;
13
+ //# sourceMappingURL=OpeningInputs.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpeningInputs.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledOpeningInputs","exports","styled","div"],"sources":["../../../../src/components/opening-times/opening-inputs/OpeningInputs.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledOpeningInputs = styled.div`\n display: flex;\n flex-direction: column;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhC,MAAMG,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,yBAAM,CAACC,GAAI;AAC9C;AACA;AACA,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { FC } from 'react';
2
+ import { OpeningTimesButtonType, type Time } from '../../../../types/openingTimes';
3
+ export type OpeningInputProps = {
4
+ start: Time['start'];
5
+ end: Time['end'];
6
+ isDisabled?: boolean;
7
+ id: string;
8
+ buttonType: OpeningTimesButtonType;
9
+ onAdd: () => void;
10
+ onRemove: () => void;
11
+ onChange: (time: Time) => void;
12
+ };
13
+ declare const OpeningInput: FC<OpeningInputProps>;
14
+ export default OpeningInput;
@@ -0,0 +1,100 @@
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 _openingTimes = require("../../../../types/openingTimes");
9
+ var _core = require("@chayns-components/core");
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 && Object.prototype.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 = _ref => {
14
+ let {
15
+ end,
16
+ start,
17
+ isDisabled,
18
+ buttonType,
19
+ onRemove,
20
+ onAdd,
21
+ onChange,
22
+ id
23
+ } = _ref;
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, isInvalid) => {
47
+ if (isInvalid || 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, isInvalid) => {
58
+ if (isInvalid || 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
+ }, /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInputWrapper, null, /*#__PURE__*/_react.default.createElement(_core.NumberInput, {
83
+ shouldShowOnlyBottomBorder: true,
84
+ isTimeInput: true,
85
+ value: startTime,
86
+ onBlur: handleStartTimeBlur,
87
+ isDisabled: isDisabled
88
+ })), /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInputText, {
89
+ isDisabled: isDisabled
90
+ }, "-"), /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInputWrapper, null, /*#__PURE__*/_react.default.createElement(_core.NumberInput, {
91
+ shouldShowOnlyBottomBorder: true,
92
+ isTimeInput: true,
93
+ value: endTime,
94
+ onBlur: handleEndTimeBlur,
95
+ isDisabled: isDisabled
96
+ })), button), [button, endTime, handleEndTimeBlur, handleStartTimeBlur, id, isDisabled, startTime]);
97
+ };
98
+ OpeningInput.displayName = 'OpeningInput';
99
+ var _default = exports.default = OpeningInput;
100
+ //# sourceMappingURL=OpeningInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpeningInput.js","names":["_react","_interopRequireWildcard","require","_openingTimes","_core","_OpeningInput","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","OpeningInput","_ref","end","start","isDisabled","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","isInvalid","handleEndTimeBlur","StyledOpeningInput","key","animate","opacity","height","initial","exit","StyledOpeningInputWrapper","NumberInput","shouldShowOnlyBottomBorder","isTimeInput","onBlur","StyledOpeningInputText","displayName","_default","exports"],"sources":["../../../../../src/components/opening-times/opening-inputs/opening-input/OpeningInput.tsx"],"sourcesContent":["import React, { FC, useCallback, useMemo, useState } from 'react';\nimport { OpeningTimesButtonType, type Time } from '../../../../types/openingTimes';\nimport { Icon, NumberInput } from '@chayns-components/core';\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 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 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, isInvalid: boolean) => {\n if (isInvalid || 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, isInvalid: boolean) => {\n if (isInvalid || 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 >\n <StyledOpeningInputWrapper>\n <NumberInput\n shouldShowOnlyBottomBorder\n isTimeInput\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 value={endTime}\n onBlur={handleEndTimeBlur}\n isDisabled={isDisabled}\n />\n </StyledOpeningInputWrapper>\n {button}\n </StyledOpeningInput>\n ),\n [button, endTime, handleEndTimeBlur, handleStartTimeBlur, id, isDisabled, startTime],\n );\n};\n\nOpeningInput.displayName = 'OpeningInput';\n\nexport default OpeningInput;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAA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