@chayns-components/core 5.0.0-beta.410 → 5.0.0-beta.413
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/lib/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/components/checkbox/Checkbox.js.map +1 -1
- package/lib/components/input/Input.d.ts +4 -0
- package/lib/components/input/Input.js +5 -3
- package/lib/components/input/Input.js.map +1 -1
- package/lib/components/input/Input.styles.d.ts +4 -1
- package/lib/components/input/Input.styles.js +29 -10
- package/lib/components/input/Input.styles.js.map +1 -1
- package/lib/components/number-input/NumberInput.d.ts +9 -1
- package/lib/components/number-input/NumberInput.js +40 -21
- package/lib/components/number-input/NumberInput.js.map +1 -1
- package/lib/components/number-input/constants/number.d.ts +1 -0
- package/lib/components/number-input/constants/number.js +3 -2
- package/lib/components/number-input/constants/number.js.map +1 -1
- package/lib/components/number-input/utils/number.d.ts +4 -2
- package/lib/components/number-input/utils/number.js +30 -2
- package/lib/components/number-input/utils/number.js.map +1 -1
- package/lib/components/opening-times/OpeningTimes.d.ts +19 -0
- package/lib/components/opening-times/OpeningTimes.js +92 -0
- package/lib/components/opening-times/OpeningTimes.js.map +1 -0
- package/lib/components/opening-times/OpeningTimes.styles.d.ts +8 -0
- package/lib/components/opening-times/OpeningTimes.styles.js +19 -0
- package/lib/components/opening-times/OpeningTimes.styles.js.map +1 -0
- package/lib/components/opening-times/opening-inputs/OpeningInputs.d.ts +10 -0
- package/lib/components/opening-times/opening-inputs/OpeningInputs.js +95 -0
- package/lib/components/opening-times/opening-inputs/OpeningInputs.js.map +1 -0
- package/lib/components/opening-times/opening-inputs/OpeningInputs.styles.d.ts +2 -0
- package/lib/components/opening-times/opening-inputs/OpeningInputs.styles.js +13 -0
- package/lib/components/opening-times/opening-inputs/OpeningInputs.styles.js.map +1 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.d.ts +14 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.js +100 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.js.map +1 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.d.ts +274 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js +46 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js.map +1 -0
- package/lib/components/progress-bar/ProgressBar.d.ts +2 -2
- package/lib/components/progress-bar/ProgressBar.js +2 -2
- package/lib/components/progress-bar/ProgressBar.js.map +1 -1
- package/lib/components/slider/Slider.d.ts +2 -2
- package/lib/components/slider/Slider.js +4 -4
- package/lib/components/slider/Slider.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -1
- package/lib/types/openingTimes.d.ts +19 -0
- package/lib/types/openingTimes.js +13 -0
- package/lib/types/openingTimes.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","names":["_number","require","parseFloatWithDecimals","_ref","stringValue","decimals","parsed","parseFloat","toFixed","exports","formateNumber","_ref2","number","isMoneyInput","toLocaleString","useGrouping","minimumFractionDigits","undefined","maximumFractionDigits","maximumSignificantDigits","isValidString","_ref3","isDecimalInput","string","isValid","DECIMAL_TEST","test","MONEY_TEST","
|
|
1
|
+
{"version":3,"file":"number.js","names":["_number","require","parseFloatWithDecimals","_ref","stringValue","decimals","parsed","parseFloat","toFixed","exports","formateNumber","_ref2","number","isMoneyInput","isTimeInput","hours","minutes","firstTwoNumbers","Number","substring","lastTwoNumbers","lastTwoNumbersLength","includes","length","hoursStr","minutesStr","toLocaleString","useGrouping","minimumFractionDigits","undefined","maximumFractionDigits","maximumSignificantDigits","isValidString","_ref3","isDecimalInput","string","isValid","DECIMAL_TEST","test","MONEY_TEST","TIME_TEST","INTEGER_TEST"],"sources":["../../../../src/components/number-input/utils/number.ts"],"sourcesContent":["import { DECIMAL_TEST, INTEGER_TEST, MONEY_TEST, TIME_TEST } from '../constants/number';\n\ninterface ParseFloatWithDecimals {\n ({ stringValue, decimals }: { stringValue: string; decimals?: number }): number;\n}\n\nexport const parseFloatWithDecimals: ParseFloatWithDecimals = ({ stringValue, decimals }) => {\n const parsed = parseFloat(stringValue);\n\n if (decimals) {\n return parseFloat(parsed.toFixed(decimals));\n }\n\n return parsed;\n};\n\ninterface FormateNumberOptions {\n number: number | string | null;\n isMoneyInput?: boolean;\n isTimeInput?: boolean;\n}\n\nexport const formateNumber = ({ number, isMoneyInput, isTimeInput }: FormateNumberOptions) => {\n if (isTimeInput && typeof number === 'string') {\n let hours = 0;\n let minutes = 0;\n\n const firstTwoNumbers = Number(number.substring(0, 2));\n let lastTwoNumbers = 0;\n let lastTwoNumbersLength = 0;\n\n if (number.includes(':')) {\n lastTwoNumbers = Number(number.substring(3, 5));\n lastTwoNumbersLength = number.substring(3, 5).length;\n } else {\n lastTwoNumbers = Number(number.substring(2, 4));\n lastTwoNumbersLength = number.substring(2, 4).length;\n }\n\n hours = firstTwoNumbers > 23 ? 23 : firstTwoNumbers;\n\n if (lastTwoNumbers < 7 && lastTwoNumbersLength === 1) {\n minutes = lastTwoNumbers * 10;\n } else {\n minutes = lastTwoNumbers > 59 ? 59 : lastTwoNumbers;\n }\n\n const hoursStr = hours < 10 ? `0${hours}` : `${hours}`;\n const minutesStr = minutes < 10 ? `0${minutes}` : `${minutes}`;\n\n return `${hoursStr}:${minutesStr}`;\n }\n\n if (typeof number !== 'number') {\n return '';\n }\n\n return number.toLocaleString('de-DE', {\n useGrouping: true,\n minimumFractionDigits: isMoneyInput ? 2 : undefined,\n maximumFractionDigits: isMoneyInput ? 2 : undefined,\n maximumSignificantDigits: !isMoneyInput ? 20 : undefined,\n });\n};\n\ninterface IsValidString {\n (config: {\n string: string;\n isDecimalInput?: boolean;\n isMoneyInput?: boolean;\n isTimeInput?: boolean;\n }): boolean;\n}\n\nexport const isValidString: IsValidString = ({\n isDecimalInput,\n isMoneyInput,\n isTimeInput,\n string,\n}) => {\n let isValid = false;\n\n // Allows numbers, one (comma/point) and any number of decimal places\n if (isDecimalInput && DECIMAL_TEST.test(string)) {\n isValid = true;\n }\n\n // Allows numbers but excludes numbers with leading 0\n if (isMoneyInput && MONEY_TEST.test(string)) {\n isValid = true;\n }\n\n if (isTimeInput && TIME_TEST) {\n isValid = true;\n }\n\n // Allows numbers but excludes numbers with leading 0\n if (!isDecimalInput && !isMoneyInput && !isTimeInput && INTEGER_TEST.test(string)) {\n isValid = true;\n }\n\n if (string.length === 0) {\n isValid = true;\n }\n\n return isValid;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAMO,MAAMC,sBAA8C,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC,WAAW;IAAEC;EAAS,CAAC,GAAAF,IAAA;EACpF,MAAMG,MAAM,GAAGC,UAAU,CAACH,WAAW,CAAC;EAEtC,IAAIC,QAAQ,EAAE;IACV,OAAOE,UAAU,CAACD,MAAM,CAACE,OAAO,CAACH,QAAQ,CAAC,CAAC;EAC/C;EAEA,OAAOC,MAAM;AACjB,CAAC;AAACG,OAAA,CAAAP,sBAAA,GAAAA,sBAAA;AAQK,MAAMQ,aAAa,GAAGC,KAAA,IAAiE;EAAA,IAAhE;IAAEC,MAAM;IAAEC,YAAY;IAAEC;EAAkC,CAAC,GAAAH,KAAA;EACrF,IAAIG,WAAW,IAAI,OAAOF,MAAM,KAAK,QAAQ,EAAE;IAC3C,IAAIG,KAAK,GAAG,CAAC;IACb,IAAIC,OAAO,GAAG,CAAC;IAEf,MAAMC,eAAe,GAAGC,MAAM,CAACN,MAAM,CAACO,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtD,IAAIC,cAAc,GAAG,CAAC;IACtB,IAAIC,oBAAoB,GAAG,CAAC;IAE5B,IAAIT,MAAM,CAACU,QAAQ,CAAC,GAAG,CAAC,EAAE;MACtBF,cAAc,GAAGF,MAAM,CAACN,MAAM,CAACO,SAAS,CA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KtC;EAAA,IALuC;IACzCC,cAAc;IACdrB,YAAY;IACZC,WAAW;IACXqB;EACJ,CAAC,GAAAF,KAAA;EACG,IAAIG,OAAO,GAAG,KAAK;;EAEnB;EACA,IAAIF,cAAc,IAAIG,oBAAY,CAACC,IAAI,CAACH,MAAM,CAAC,EAAE;IAC7CC,OAAO,GAAG,IAAI;EAClB;;EAEA;EACA,IAAIvB,YAAY,IAAI0B,kBAAU,CAACD,IAAI,CAACH,MAAM,CAAC,EAAE;IACzCC,OAAO,GAAG,IAAI;EAClB;EAEA,IAAItB,WAAW,IAAI0B,iBAAS,EAAE;IAC1BJ,OAAO,GAAG,IAAI;EAClB;;EAEA;EACA,IAAI,CAACF,cAAc,IAAI,CAACrB,YAAY,IAAI,CAACC,WAAW,IAAI2B,oBAAY,CAACH,IAAI,CAACH,MAAM,CAAC,EAAE;IAC/EC,OAAO,GAAG,IAAI;EAClB;EAEA,IAAID,MAAM,CAACZ,MAAM,KAAK,CAAC,EAAE;IACrBa,OAAO,GAAG,IAAI;EAClB;EAEA,OAAOA,OAAO;AAClB,CAAC;AAAC3B,OAAA,CAAAuB,aAAA,GAAAA,aAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import type { OpeningTime, Weekday } from '../../types/openingTimes';
|
|
3
|
+
export type OpeningTimesProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Function to be executed when a time is changed.
|
|
6
|
+
* @param openingTimes
|
|
7
|
+
*/
|
|
8
|
+
onChange?: (openingTimes: OpeningTime[]) => void;
|
|
9
|
+
/**
|
|
10
|
+
* The opening times corresponding to its weekday.
|
|
11
|
+
*/
|
|
12
|
+
openingTimes: OpeningTime[];
|
|
13
|
+
/**
|
|
14
|
+
* The weekdays that should be displayed.
|
|
15
|
+
*/
|
|
16
|
+
weekdays: Weekday[];
|
|
17
|
+
};
|
|
18
|
+
declare const OpeningTimes: FC<OpeningTimesProps>;
|
|
19
|
+
export default OpeningTimes;
|
|
@@ -0,0 +1,92 @@
|
|
|
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("./OpeningTimes.styles");
|
|
9
|
+
var _Checkbox = _interopRequireDefault(require("../checkbox/Checkbox"));
|
|
10
|
+
var _OpeningInputs = _interopRequireDefault(require("./opening-inputs/OpeningInputs"));
|
|
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
|
+
} = _ref;
|
|
20
|
+
const [newOpeningTimes, setNewOpeningTimes] = (0, _react.useState)();
|
|
21
|
+
(0, _react.useEffect)(() => {
|
|
22
|
+
setNewOpeningTimes(openingTimes);
|
|
23
|
+
}, [openingTimes]);
|
|
24
|
+
const handleCheckBoxChange = (0, _react.useCallback)(id => {
|
|
25
|
+
setNewOpeningTimes(prevOpeningTimes => {
|
|
26
|
+
const updatedOpeningTimes = (prevOpeningTimes ?? []).map(openingTime => {
|
|
27
|
+
if (openingTime.id === id) {
|
|
28
|
+
return {
|
|
29
|
+
...openingTime,
|
|
30
|
+
isDisabled: !openingTime.isDisabled
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return openingTime;
|
|
34
|
+
});
|
|
35
|
+
if (typeof onChange === 'function') {
|
|
36
|
+
onChange(updatedOpeningTimes);
|
|
37
|
+
}
|
|
38
|
+
return updatedOpeningTimes;
|
|
39
|
+
});
|
|
40
|
+
}, [onChange]);
|
|
41
|
+
const handleChange = (0, _react.useCallback)((newTimes, id) => {
|
|
42
|
+
setNewOpeningTimes(prevOpeningTimes => {
|
|
43
|
+
const updatedOpeningTimes = (prevOpeningTimes ?? []).map(openingTime => {
|
|
44
|
+
if (openingTime.id === id) {
|
|
45
|
+
return {
|
|
46
|
+
...openingTime,
|
|
47
|
+
times: newTimes
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return openingTime;
|
|
51
|
+
});
|
|
52
|
+
if (typeof onChange === 'function') {
|
|
53
|
+
onChange(updatedOpeningTimes);
|
|
54
|
+
}
|
|
55
|
+
return updatedOpeningTimes;
|
|
56
|
+
});
|
|
57
|
+
}, [onChange]);
|
|
58
|
+
const content = (0, _react.useMemo)(() => {
|
|
59
|
+
const items = [];
|
|
60
|
+
if (!newOpeningTimes) {
|
|
61
|
+
return items;
|
|
62
|
+
}
|
|
63
|
+
newOpeningTimes.forEach(_ref2 => {
|
|
64
|
+
let {
|
|
65
|
+
times,
|
|
66
|
+
id,
|
|
67
|
+
weekdayId,
|
|
68
|
+
isDisabled
|
|
69
|
+
} = _ref2;
|
|
70
|
+
const weekday = weekdays.find(weekDay => weekDay.id === weekdayId)?.name;
|
|
71
|
+
if (!weekday) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
items.push( /*#__PURE__*/_react.default.createElement(_OpeningTimes.StyledOpeningTimesWrapper, {
|
|
75
|
+
key: `openingTimes__${id}`
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement(_Checkbox.default, {
|
|
77
|
+
isChecked: !isDisabled,
|
|
78
|
+
onChange: () => handleCheckBoxChange(id)
|
|
79
|
+
}, weekday), /*#__PURE__*/_react.default.createElement(_OpeningInputs.default, {
|
|
80
|
+
id: id,
|
|
81
|
+
times: times,
|
|
82
|
+
isDisabled: isDisabled,
|
|
83
|
+
onChange: newTimes => handleChange(newTimes, id)
|
|
84
|
+
})));
|
|
85
|
+
});
|
|
86
|
+
return items;
|
|
87
|
+
}, [handleChange, handleCheckBoxChange, newOpeningTimes, weekdays]);
|
|
88
|
+
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_OpeningTimes.StyledOpeningTimes, null, content), [content]);
|
|
89
|
+
};
|
|
90
|
+
OpeningTimes.displayName = 'OpeningTimes';
|
|
91
|
+
var _default = exports.default = OpeningTimes;
|
|
92
|
+
//# sourceMappingURL=OpeningTimes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpeningTimes.js","names":["_react","_interopRequireWildcard","require","_OpeningTimes","_Checkbox","_interopRequireDefault","_OpeningInputs","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","newOpeningTimes","setNewOpeningTimes","useState","useEffect","handleCheckBoxChange","useCallback","id","prevOpeningTimes","updatedOpeningTimes","map","openingTime","isDisabled","handleChange","newTimes","times","content","useMemo","items","forEach","_ref2","weekdayId","weekday","find","weekDay","name","push","createElement","StyledOpeningTimesWrapper","key","isChecked","StyledOpeningTimes","displayName","_default","exports"],"sources":["../../../src/components/opening-times/OpeningTimes.tsx"],"sourcesContent":["import React, { FC, type ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { StyledOpeningTimes, StyledOpeningTimesWrapper } from './OpeningTimes.styles';\nimport type { OpeningTime, Time, Weekday } from '../../types/openingTimes';\nimport Checkbox from '../checkbox/Checkbox';\nimport OpeningInputs from './opening-inputs/OpeningInputs';\n\nexport type OpeningTimesProps = {\n /**\n * Function to be executed when a time is changed.\n * @param openingTimes\n */\n onChange?: (openingTimes: OpeningTime[]) => 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> = ({ openingTimes, weekdays, onChange }) => {\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(updatedOpeningTimes);\n }\n\n return updatedOpeningTimes;\n });\n },\n [onChange],\n );\n\n const handleChange = useCallback(\n (newTimes: Time[], id: string) => {\n setNewOpeningTimes((prevOpeningTimes) => {\n const updatedOpeningTimes = (prevOpeningTimes ?? []).map((openingTime) => {\n if (openingTime.id === id) {\n return { ...openingTime, times: newTimes };\n }\n return openingTime;\n });\n\n if (typeof onChange === 'function') {\n onChange(updatedOpeningTimes);\n }\n\n return updatedOpeningTimes;\n });\n },\n [onChange],\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={(newTimes) => handleChange(newTimes, id)}\n />\n </StyledOpeningTimesWrapper>,\n );\n });\n\n return items;\n }, [handleChange, handleCheckBoxChange, 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;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,cAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA2D,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,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAZ,CAAA,oBAAAY,CAAA,IAAAH,MAAA,CAAAI,SA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EAAE,CAAClB,UAAW;QAACZ,QAAQ,EAAEA,CAAA,KAAMK,oBAAoB,CAACE,EAAE;MAAE,GACtEe,OACK,CAAC,eACXvD,MAAA,CAAAS,OAAA,CAAAmD,aAAA,CAACtD,cAAA,CAAAG,OAAa;QACV+B,EAAE,EAAEA,EAAG;QACPQ,KAAK,EAAEA,KAAM;QACbH,UAAU,EAAEA,UAAW;QACvBZ,QAAQ,EAAGc,QAAQ,IAAKD,YAAY,CAACC,QAAQ,EAAEP,EAAE;MAAE,CACtD,CACsB,CAC/B,CAAC;IACL,CAAC,CAAC;IAEF,OAAOW,KAAK;EAChB,CAAC,EAAE,CAACL,YAAY,EAAER,oBAAoB,EAAEJ,eAAe,EAAEF,QAAQ,CAAC,CAAC;EAEnE,OAAO,IAAAkB,cAAO,EAAC,mBAAMlD,MAAA,CAAAS,OAAA,CAAAmD,aAAA,CAACzD,aAAA,CAAA6D,kBAAkB,QAAEf,OAA4B,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;AACvF,CAAC;AAEDpB,YAAY,CAACoC,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1D,OAAA,GAE3BoB,YAAY"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';
|
|
3
|
+
type StyledSliderButtonProps = 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 '../color-scheme-provider/ColorSchemeProvider';\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,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { type Time } from '../../../types/openingTimes';
|
|
3
|
+
export type OpeningInputsProps = {
|
|
4
|
+
times: Time[];
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
onChange: (times: Time[]) => void;
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
9
|
+
declare const OpeningInputs: FC<OpeningInputsProps>;
|
|
10
|
+
export default OpeningInputs;
|
|
@@ -0,0 +1,95 @@
|
|
|
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 _OpeningInputs = require("./OpeningInputs.styles");
|
|
10
|
+
var _OpeningInput = _interopRequireDefault(require("./opening-input/OpeningInput"));
|
|
11
|
+
var _framerMotion = require("framer-motion");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
const OpeningInputs = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
times,
|
|
18
|
+
isDisabled,
|
|
19
|
+
id,
|
|
20
|
+
onChange
|
|
21
|
+
} = _ref;
|
|
22
|
+
const [newTimes, setNewTimes] = (0, _react.useState)();
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
24
|
+
setNewTimes(times);
|
|
25
|
+
}, [times]);
|
|
26
|
+
const handleAdd = (0, _react.useCallback)(() => {
|
|
27
|
+
const defaultTime = {
|
|
28
|
+
start: '08:00',
|
|
29
|
+
end: '18:00'
|
|
30
|
+
};
|
|
31
|
+
setNewTimes(prevState => {
|
|
32
|
+
const updatedTimes = prevState ? [...prevState, defaultTime] : [defaultTime];
|
|
33
|
+
onChange(updatedTimes);
|
|
34
|
+
return updatedTimes;
|
|
35
|
+
});
|
|
36
|
+
}, [onChange]);
|
|
37
|
+
const handleRemove = (0, _react.useCallback)(indexToRemove => {
|
|
38
|
+
setNewTimes(prevState => {
|
|
39
|
+
const updatedTimes = (prevState ?? []).filter((_, index) => index !== indexToRemove);
|
|
40
|
+
onChange(updatedTimes);
|
|
41
|
+
return updatedTimes;
|
|
42
|
+
});
|
|
43
|
+
}, [onChange]);
|
|
44
|
+
const handleChange = (0, _react.useCallback)((newTime, indexToUpdate) => {
|
|
45
|
+
setNewTimes(prevState => {
|
|
46
|
+
const updatedTimes = (prevState ?? []).map((time, index) => {
|
|
47
|
+
if (index === indexToUpdate) {
|
|
48
|
+
return newTime;
|
|
49
|
+
}
|
|
50
|
+
return time;
|
|
51
|
+
});
|
|
52
|
+
onChange(updatedTimes);
|
|
53
|
+
return updatedTimes;
|
|
54
|
+
});
|
|
55
|
+
}, [onChange]);
|
|
56
|
+
const content = (0, _react.useMemo)(() => {
|
|
57
|
+
const items = [];
|
|
58
|
+
if (!newTimes) {
|
|
59
|
+
return items;
|
|
60
|
+
}
|
|
61
|
+
newTimes.forEach((_ref2, index) => {
|
|
62
|
+
let {
|
|
63
|
+
end,
|
|
64
|
+
start
|
|
65
|
+
} = _ref2;
|
|
66
|
+
if (index > 1) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
let buttonType = _openingTimes.OpeningTimesButtonType.NONE;
|
|
70
|
+
if (index === 0 && times.length === 1 && !isDisabled) {
|
|
71
|
+
buttonType = _openingTimes.OpeningTimesButtonType.ADD;
|
|
72
|
+
} else if (index === 1 && !isDisabled) {
|
|
73
|
+
buttonType = _openingTimes.OpeningTimesButtonType.REMOVE;
|
|
74
|
+
}
|
|
75
|
+
items.push( /*#__PURE__*/_react.default.createElement(_OpeningInput.default, {
|
|
76
|
+
key: `opening-times-input__${id}.${index}`,
|
|
77
|
+
start: start,
|
|
78
|
+
id: `opening-times__${id}.${index}`,
|
|
79
|
+
end: end,
|
|
80
|
+
isDisabled: isDisabled,
|
|
81
|
+
buttonType: buttonType,
|
|
82
|
+
onAdd: handleAdd,
|
|
83
|
+
onChange: time => handleChange(time, index),
|
|
84
|
+
onRemove: () => handleRemove(index)
|
|
85
|
+
}));
|
|
86
|
+
});
|
|
87
|
+
return items;
|
|
88
|
+
}, [handleAdd, handleChange, handleRemove, id, isDisabled, newTimes, times.length]);
|
|
89
|
+
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_OpeningInputs.StyledOpeningInputs, null, /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
|
|
90
|
+
initial: false
|
|
91
|
+
}, content)), [content]);
|
|
92
|
+
};
|
|
93
|
+
OpeningInputs.displayName = 'OpeningInputs';
|
|
94
|
+
var _default = exports.default = OpeningInputs;
|
|
95
|
+
//# sourceMappingURL=OpeningInputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpeningInputs.js","names":["_react","_interopRequireWildcard","require","_openingTimes","_OpeningInputs","_OpeningInput","_interopRequireDefault","_framerMotion","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","id","onChange","newTimes","setNewTimes","useState","useEffect","handleAdd","useCallback","defaultTime","start","end","prevState","updatedTimes","handleRemove","indexToRemove","filter","_","index","handleChange","newTime","indexToUpdate","map","time","content","useMemo","items","forEach","_ref2","buttonType","OpeningTimesButtonType","NONE","length","ADD","REMOVE","push","createElement","key","onAdd","onRemove","StyledOpeningInputs","AnimatePresence","initial","displayName","_default","exports"],"sources":["../../../../src/components/opening-times/opening-inputs/OpeningInputs.tsx"],"sourcesContent":["import React, { FC, type ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { OpeningTimesButtonType, type Time } from '../../../types/openingTimes';\nimport { StyledOpeningInputs } from './OpeningInputs.styles';\nimport OpeningInput from './opening-input/OpeningInput';\nimport { AnimatePresence } from 'framer-motion';\n\nexport type OpeningInputsProps = {\n times: Time[];\n isDisabled?: boolean;\n onChange: (times: Time[]) => void;\n id: string;\n};\n\nconst OpeningInputs: FC<OpeningInputsProps> = ({ times, isDisabled, id, onChange }) => {\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' };\n\n setNewTimes((prevState) => {\n const updatedTimes = prevState ? [...prevState, defaultTime] : [defaultTime];\n\n onChange(updatedTimes);\n\n return updatedTimes;\n });\n }, [onChange]);\n\n const handleRemove = useCallback(\n (indexToRemove: number) => {\n setNewTimes((prevState) => {\n const updatedTimes = (prevState ?? []).filter(\n (_, index) => index !== indexToRemove,\n );\n\n onChange(updatedTimes);\n\n return updatedTimes;\n });\n },\n [onChange],\n );\n\n const handleChange = useCallback(\n (newTime: Time, indexToUpdate: number) => {\n setNewTimes((prevState) => {\n const updatedTimes = (prevState ?? []).map((time, index) => {\n if (index === indexToUpdate) {\n return newTime;\n }\n return time;\n });\n\n onChange(updatedTimes);\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 }, 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}.${index}`}\n start={start}\n id={`opening-times__${id}.${index}`}\n end={end}\n isDisabled={isDisabled}\n buttonType={buttonType}\n onAdd={handleAdd}\n onChange={(time) => handleChange(time, index)}\n onRemove={() => handleRemove(index)}\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,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAAgD,SAAAI,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,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UAAU,EAAEG,QAAQ,EAAEJ,KAAK,CAACiC,MAAM,CAAC,CAAC;EAEnF,OAAO,IAAAP,cAAO,EACV,mBACI1D,MAAA,CAAAU,OAAA,CAAA2D,aAAA,CAACjE,cAAA,CAAAqE,mBAAmB,qBAChBzE,MAAA,CAAAU,OAAA,CAAA2D,aAAA,CAAC9D,aAAA,CAAAmE,eAAe;IAACC,OAAO,EAAE;EAAM,GAAElB,OAAyB,CAC1C,CACxB,EACD,CAACA,OAAO,CACZ,CAAC;AACL,CAAC;AAED3B,aAAa,CAAC8C,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAApE,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 _OpeningInput = require("./OpeningInput.styles");
|
|
10
|
+
var _NumberInput = _interopRequireDefault(require("../../../number-input/NumberInput"));
|
|
11
|
+
var _Icon = _interopRequireDefault(require("../../../icon/Icon"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
const OpeningInput = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
end,
|
|
18
|
+
start,
|
|
19
|
+
isDisabled,
|
|
20
|
+
buttonType,
|
|
21
|
+
onRemove,
|
|
22
|
+
onAdd,
|
|
23
|
+
onChange,
|
|
24
|
+
id
|
|
25
|
+
} = _ref;
|
|
26
|
+
const [startTime, setStartTime] = (0, _react.useState)(start);
|
|
27
|
+
const [endTime, setEndTime] = (0, _react.useState)(end);
|
|
28
|
+
const button = (0, _react.useMemo)(() => {
|
|
29
|
+
switch (buttonType) {
|
|
30
|
+
case _openingTimes.OpeningTimesButtonType.ADD:
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInputButtonWrapper, {
|
|
32
|
+
onClick: onAdd
|
|
33
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
34
|
+
icons: ['ts-plus'],
|
|
35
|
+
size: 15
|
|
36
|
+
}));
|
|
37
|
+
case _openingTimes.OpeningTimesButtonType.REMOVE:
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInputButtonWrapper, {
|
|
39
|
+
onClick: onRemove
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
41
|
+
icons: ['ts-wrong'],
|
|
42
|
+
size: 15
|
|
43
|
+
}));
|
|
44
|
+
default:
|
|
45
|
+
return /*#__PURE__*/_react.default.createElement(_OpeningInput.StyledOpeningInputPseudoButton, null);
|
|
46
|
+
}
|
|
47
|
+
}, [buttonType, onAdd, onRemove]);
|
|
48
|
+
const handleStartTimeBlur = (0, _react.useCallback)((value, isInvalid) => {
|
|
49
|
+
if (isInvalid || typeof value === 'number' || !value) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
setStartTime(value);
|
|
53
|
+
onChange({
|
|
54
|
+
end: endTime,
|
|
55
|
+
start: value
|
|
56
|
+
});
|
|
57
|
+
}, [endTime, onChange]);
|
|
58
|
+
const handleEndTimeBlur = (0, _react.useCallback)((value, isInvalid) => {
|
|
59
|
+
if (isInvalid || typeof value === 'number' || !value) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
setEndTime(value);
|
|
63
|
+
onChange({
|
|
64
|
+
end: value,
|
|
65
|
+
start: startTime
|
|
66
|
+
});
|
|
67
|
+
}, [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(_NumberInput.default, {
|
|
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(_NumberInput.default, {
|
|
91
|
+
shouldShowOnlyBottomBorder: true,
|
|
92
|
+
isTimeInput: true,
|
|
93
|
+
value: endTime,
|
|
94
|
+
onBlur: handleEndTimeBlur,
|
|
95
|
+
isDisabled: isDisabled
|
|
96
|
+
})), button), [button, endTime, handleEndTimeBlur, handleStartTimeBlur, 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","_OpeningInput","_NumberInput","_interopRequireDefault","_Icon","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","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","icons","size","REMOVE","StyledOpeningInputPseudoButton","handleStartTimeBlur","useCallback","value","isInvalid","handleEndTimeBlur","StyledOpeningInput","key","animate","opacity","height","initial","exit","StyledOpeningInputWrapper","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 {\n StyledOpeningInput,\n StyledOpeningInputButtonWrapper,\n StyledOpeningInputPseudoButton,\n StyledOpeningInputText,\n StyledOpeningInputWrapper,\n} from './OpeningInput.styles';\nimport NumberInput from '../../../number-input/NumberInput';\nimport Icon from '../../../icon/Icon';\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 });\n },\n [endTime, 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 });\n },\n [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, 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,aAAA,GAAAF,OAAA;AAOA,IAAAG,YAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAAsC,SAAAI,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,SAAAX,wBAAAW,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,CAA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