@chayns-components/date 5.0.0-beta.556 → 5.0.0-beta.558
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/opening-times/opening-inputs/OpeningInputs.js +10 -2
- package/lib/components/opening-times/opening-inputs/OpeningInputs.js.map +1 -1
- package/lib/components/opening-times/opening-inputs/OpeningInputs.styles.d.ts +264 -1
- package/lib/components/opening-times/opening-inputs/OpeningInputs.styles.js +3 -2
- package/lib/components/opening-times/opening-inputs/OpeningInputs.styles.js.map +1 -1
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.js +4 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.js.map +1 -1
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js +1 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js.map +1 -1
- package/package.json +3 -3
|
@@ -124,9 +124,17 @@ const OpeningInputs = _ref => {
|
|
|
124
124
|
});
|
|
125
125
|
return items;
|
|
126
126
|
}, [closedText, editMode, handleAdd, handleChange, handleRemove, id, invalidTimes, isDisabled, newTimes, times.length]);
|
|
127
|
-
return useMemo(() => /*#__PURE__*/React.createElement(StyledOpeningInputs,
|
|
127
|
+
return useMemo(() => /*#__PURE__*/React.createElement(StyledOpeningInputs, {
|
|
128
|
+
key: `opening-inputs__${id}`,
|
|
129
|
+
animate: {
|
|
130
|
+
gap: newTimes && newTimes.length > 1 ? '8px' : 0
|
|
131
|
+
},
|
|
132
|
+
initial: {
|
|
133
|
+
gap: 0
|
|
134
|
+
}
|
|
135
|
+
}, /*#__PURE__*/React.createElement(AnimatePresence, {
|
|
128
136
|
initial: false
|
|
129
|
-
}, content)), [content]);
|
|
137
|
+
}, content)), [content, id, newTimes]);
|
|
130
138
|
};
|
|
131
139
|
OpeningInputs.displayName = 'OpeningInputs';
|
|
132
140
|
export default OpeningInputs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpeningInputs.js","names":["AnimatePresence","React","useCallback","useEffect","useMemo","useState","v4","uuidV4","OpeningTimesButtonType","OpeningInput","StyledOpeningInputPreview","StyledOpeningInputs","OpeningInputs","_ref","times","isDisabled","onRemove","onAdd","onInvalid","id","onChange","editMode","closedText","newTimes","setNewTimes","invalidTimes","setInvalidTimes","handleAdd","defaultTime","start","end","prevState","handleRemove","timeId","filter","time","result","i","length","currentTime","prevTime","currStart","Date","currEnd","push","prevEnd","invalidTimeIds","map","_ref2","invalidId","handleChange","newTime","updatedTimes","content","items","forEach","_ref3","index","text","createElement","key","buttonType","NONE","ADD","REMOVE","isInvalid","includes","initial","displayName"],"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 { StyledOpeningInputPreview, 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 onInvalid?: (openingTimeId: string, timeIds: string[]) => void;\n id: string;\n editMode: boolean;\n closedText: string;\n};\n\nconst OpeningInputs: FC<OpeningInputsProps> = ({\n times,\n isDisabled,\n onRemove,\n onAdd,\n onInvalid,\n id,\n onChange,\n editMode,\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}\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 editMode,\n handleAdd,\n handleChange,\n handleRemove,\n id,\n invalidTimes,\n isDisabled,\n newTimes,\n times.length,\n ]);\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,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,KAAK,IAAQC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAA2B,OAAO;AAC/F,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AACnC,SAASC,sBAAsB,QAAmB,6BAA6B;AAC/E,OAAOC,YAAY,MAAM,8BAA8B;AACvD,SAASC,yBAAyB,EAAEC,mBAAmB,QAAQ,wBAAwB;AAcvF,MAAMC,aAAqC,GAAGC,IAAA,IAUxC;EAAA,IAVyC;IAC3CC,KAAK;IACLC,UAAU;IACVC,QAAQ;IACRC,KAAK;IACLC,SAAS;IACTC,EAAE;IACFC,QAAQ;IACRC,QAAQ;IACRC;EACJ,CAAC,GAAAT,IAAA;EACG,MAAM,CAACU,QAAQ,EAAEC,WAAW,CAAC,GAAGnB,QAAQ,CAAS,CAAC;EAClD,MAAM,CAACoB,YAAY,EAAEC,eAAe,CAAC,GAAGrB,QAAQ,CAAW,EAAE,CAAC;EAE9DF,SAAS,CAAC,MAAM;IACZqB,WAAW,CAACV,KAAK,CAAC;EACtB,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC;EAEX,MAAMa,SAAS,GAAGzB,WAAW,CAAC,M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AMgB,YAAY,CAACC,MAAM;MAAE,CACxC,CACL,CAAC;IACL,CAAC,CAAC;IAEF,OAAOqB,KAAK;EAChB,CAAC,EAAE,CACChC,UAAU,EACVD,QAAQ,EACRM,SAAS,EACTuB,YAAY,EACZlB,YAAY,EACZb,EAAE,EACFM,YAAY,EACZV,UAAU,EACVQ,QAAQ,EACRT,KAAK,CAACwB,MAAM,CACf,CAAC;EAEF,OAAOlC,OAAO,CACV,mBACIH,KAAA,CAAA0D,aAAA,CAAChD,mBAAmB,qBAChBV,KAAA,CAAA0D,aAAA,CAAC3D,eAAe;IAACmE,OAAO,EAAE;EAAM,GAAEd,OAAyB,CAC1C,CACxB,EACD,CAACA,OAAO,CACZ,CAAC;AACL,CAAC;AAEDzC,aAAa,CAACwD,WAAW,GAAG,eAAe;AAE3C,eAAexD,aAAa"}
|
|
1
|
+
{"version":3,"file":"OpeningInputs.js","names":["AnimatePresence","React","useCallback","useEffect","useMemo","useState","v4","uuidV4","OpeningTimesButtonType","OpeningInput","StyledOpeningInputPreview","StyledOpeningInputs","OpeningInputs","_ref","times","isDisabled","onRemove","onAdd","onInvalid","id","onChange","editMode","closedText","newTimes","setNewTimes","invalidTimes","setInvalidTimes","handleAdd","defaultTime","start","end","prevState","handleRemove","timeId","filter","time","result","i","length","currentTime","prevTime","currStart","Date","currEnd","push","prevEnd","invalidTimeIds","map","_ref2","invalidId","handleChange","newTime","updatedTimes","content","items","forEach","_ref3","index","text","createElement","key","buttonType","NONE","ADD","REMOVE","isInvalid","includes","animate","gap","initial","displayName"],"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 { StyledOpeningInputPreview, 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 onInvalid?: (openingTimeId: string, timeIds: string[]) => void;\n id: string;\n editMode: boolean;\n closedText: string;\n};\n\nconst OpeningInputs: FC<OpeningInputsProps> = ({\n times,\n isDisabled,\n onRemove,\n onAdd,\n onInvalid,\n id,\n onChange,\n editMode,\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}\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 editMode,\n handleAdd,\n handleChange,\n handleRemove,\n id,\n invalidTimes,\n isDisabled,\n newTimes,\n times.length,\n ]);\n\n return useMemo(\n () => (\n <StyledOpeningInputs\n key={`opening-inputs__${id}`}\n animate={{ gap: newTimes && newTimes.length > 1 ? '8px' : 0 }}\n initial={{ gap: 0 }}\n >\n <AnimatePresence initial={false}>{content}</AnimatePresence>\n </StyledOpeningInputs>\n ),\n [content, id, newTimes],\n );\n};\n\nOpeningInputs.displayName = 'OpeningInputs';\n\nexport default OpeningInputs;\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,KAAK,IAAQC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAA2B,OAAO;AAC/F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AO,EAAE;EAAM,GAAEhB,OAAyB,CAC1C,CACxB,EACD,CAACA,OAAO,EAAElC,EAAE,EAAEI,QAAQ,CAC1B,CAAC;AACL,CAAC;AAEDX,aAAa,CAAC0D,WAAW,GAAG,eAAe;AAE3C,eAAe1D,aAAa"}
|
|
@@ -1,3 +1,266 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
export declare const StyledOpeningInputs: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<{
|
|
4
|
+
color?: string | undefined;
|
|
5
|
+
defaultChecked?: boolean | undefined;
|
|
6
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
7
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
8
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
9
|
+
accessKey?: string | undefined;
|
|
10
|
+
autoFocus?: boolean | undefined;
|
|
11
|
+
className?: string | undefined;
|
|
12
|
+
contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
|
|
13
|
+
contextMenu?: string | undefined;
|
|
14
|
+
dir?: string | undefined;
|
|
15
|
+
draggable?: (boolean | "false" | "true") | undefined;
|
|
16
|
+
hidden?: boolean | undefined;
|
|
17
|
+
id?: string | undefined;
|
|
18
|
+
lang?: string | undefined;
|
|
19
|
+
nonce?: string | undefined;
|
|
20
|
+
slot?: string | undefined;
|
|
21
|
+
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
22
|
+
tabIndex?: number | undefined;
|
|
23
|
+
title?: string | undefined;
|
|
24
|
+
translate?: "yes" | "no" | undefined;
|
|
25
|
+
radioGroup?: string | undefined;
|
|
26
|
+
role?: import("react").AriaRole | undefined;
|
|
27
|
+
about?: string | undefined;
|
|
28
|
+
content?: string | undefined;
|
|
29
|
+
datatype?: string | undefined;
|
|
30
|
+
inlist?: any;
|
|
31
|
+
prefix?: string | undefined;
|
|
32
|
+
property?: string | undefined;
|
|
33
|
+
rel?: string | undefined;
|
|
34
|
+
resource?: string | undefined;
|
|
35
|
+
rev?: string | undefined;
|
|
36
|
+
typeof?: string | undefined;
|
|
37
|
+
vocab?: string | undefined;
|
|
38
|
+
autoCapitalize?: string | undefined;
|
|
39
|
+
autoCorrect?: string | undefined;
|
|
40
|
+
autoSave?: string | undefined;
|
|
41
|
+
itemProp?: string | undefined;
|
|
42
|
+
itemScope?: boolean | undefined;
|
|
43
|
+
itemType?: string | undefined;
|
|
44
|
+
itemID?: string | undefined;
|
|
45
|
+
itemRef?: string | undefined;
|
|
46
|
+
results?: number | undefined;
|
|
47
|
+
security?: string | undefined;
|
|
48
|
+
unselectable?: "on" | "off" | undefined;
|
|
49
|
+
inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
50
|
+
is?: string | undefined;
|
|
51
|
+
"aria-activedescendant"?: string | undefined;
|
|
52
|
+
"aria-atomic"?: (boolean | "false" | "true") | undefined;
|
|
53
|
+
"aria-autocomplete"?: "none" | "list" | "both" | "inline" | undefined;
|
|
54
|
+
"aria-braillelabel"?: string | undefined;
|
|
55
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
56
|
+
"aria-busy"?: (boolean | "false" | "true") | undefined;
|
|
57
|
+
"aria-checked"?: boolean | "mixed" | "false" | "true" | undefined;
|
|
58
|
+
"aria-colcount"?: number | undefined;
|
|
59
|
+
"aria-colindex"?: number | undefined;
|
|
60
|
+
"aria-colindextext"?: string | undefined;
|
|
61
|
+
"aria-colspan"?: number | undefined;
|
|
62
|
+
"aria-controls"?: string | undefined;
|
|
63
|
+
"aria-current"?: boolean | "time" | "step" | "page" | "false" | "true" | "date" | "location" | undefined;
|
|
64
|
+
"aria-describedby"?: string | undefined;
|
|
65
|
+
"aria-description"?: string | undefined;
|
|
66
|
+
"aria-details"?: string | undefined;
|
|
67
|
+
"aria-disabled"?: (boolean | "false" | "true") | undefined;
|
|
68
|
+
"aria-dropeffect"?: "none" | "link" | "copy" | "move" | "execute" | "popup" | undefined;
|
|
69
|
+
"aria-errormessage"?: string | undefined;
|
|
70
|
+
"aria-expanded"?: (boolean | "false" | "true") | undefined;
|
|
71
|
+
"aria-flowto"?: string | undefined;
|
|
72
|
+
"aria-grabbed"?: (boolean | "false" | "true") | undefined;
|
|
73
|
+
"aria-haspopup"?: boolean | "dialog" | "menu" | "listbox" | "grid" | "false" | "true" | "tree" | undefined;
|
|
74
|
+
"aria-hidden"?: (boolean | "false" | "true") | undefined;
|
|
75
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
76
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
77
|
+
"aria-label"?: string | undefined;
|
|
78
|
+
"aria-labelledby"?: string | undefined;
|
|
79
|
+
"aria-level"?: number | undefined;
|
|
80
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
81
|
+
"aria-modal"?: (boolean | "false" | "true") | undefined;
|
|
82
|
+
"aria-multiline"?: (boolean | "false" | "true") | undefined;
|
|
83
|
+
"aria-multiselectable"?: (boolean | "false" | "true") | undefined;
|
|
84
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
85
|
+
"aria-owns"?: string | undefined;
|
|
86
|
+
"aria-placeholder"?: string | undefined;
|
|
87
|
+
"aria-posinset"?: number | undefined;
|
|
88
|
+
"aria-pressed"?: boolean | "mixed" | "false" | "true" | undefined;
|
|
89
|
+
"aria-readonly"?: (boolean | "false" | "true") | undefined;
|
|
90
|
+
"aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
91
|
+
"aria-required"?: (boolean | "false" | "true") | undefined;
|
|
92
|
+
"aria-roledescription"?: string | undefined;
|
|
93
|
+
"aria-rowcount"?: number | undefined;
|
|
94
|
+
"aria-rowindex"?: number | undefined;
|
|
95
|
+
"aria-rowindextext"?: string | undefined;
|
|
96
|
+
"aria-rowspan"?: number | undefined;
|
|
97
|
+
"aria-selected"?: (boolean | "false" | "true") | undefined;
|
|
98
|
+
"aria-setsize"?: number | undefined;
|
|
99
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
100
|
+
"aria-valuemax"?: number | undefined;
|
|
101
|
+
"aria-valuemin"?: number | undefined;
|
|
102
|
+
"aria-valuenow"?: number | undefined;
|
|
103
|
+
"aria-valuetext"?: string | undefined;
|
|
104
|
+
dangerouslySetInnerHTML?: {
|
|
105
|
+
__html: string | TrustedHTML;
|
|
106
|
+
} | undefined;
|
|
107
|
+
onCopy?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
108
|
+
onCopyCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
109
|
+
onCut?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
110
|
+
onCutCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
111
|
+
onPaste?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
112
|
+
onPasteCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
113
|
+
onCompositionEnd?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
114
|
+
onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
115
|
+
onCompositionStart?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
116
|
+
onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
117
|
+
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
118
|
+
onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
119
|
+
onFocus?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
120
|
+
onFocusCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
121
|
+
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
122
|
+
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
123
|
+
onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
124
|
+
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
125
|
+
onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
126
|
+
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
127
|
+
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
128
|
+
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
129
|
+
onReset?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
130
|
+
onResetCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
131
|
+
onSubmit?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
132
|
+
onSubmitCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
133
|
+
onInvalid?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
134
|
+
onInvalidCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
135
|
+
onLoad?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
136
|
+
onLoadCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
137
|
+
onError?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
138
|
+
onErrorCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
139
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
140
|
+
onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
141
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
142
|
+
onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
143
|
+
onKeyUp?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
144
|
+
onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
145
|
+
onAbort?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
146
|
+
onAbortCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
147
|
+
onCanPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
148
|
+
onCanPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
149
|
+
onCanPlayThrough?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
150
|
+
onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
151
|
+
onDurationChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
152
|
+
onDurationChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
153
|
+
onEmptied?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
154
|
+
onEmptiedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
155
|
+
onEncrypted?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
156
|
+
onEncryptedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
157
|
+
onEnded?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
158
|
+
onEndedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
159
|
+
onLoadedData?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
160
|
+
onLoadedDataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
161
|
+
onLoadedMetadata?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
162
|
+
onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
163
|
+
onLoadStart?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
164
|
+
onLoadStartCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
165
|
+
onPause?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
166
|
+
onPauseCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
167
|
+
onPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
168
|
+
onPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
169
|
+
onPlaying?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
170
|
+
onPlayingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
171
|
+
onProgress?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
172
|
+
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
173
|
+
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
174
|
+
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
175
|
+
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
176
|
+
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
177
|
+
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
178
|
+
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
179
|
+
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
180
|
+
onSeekingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
181
|
+
onStalled?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
182
|
+
onStalledCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
183
|
+
onSuspend?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
184
|
+
onSuspendCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
185
|
+
onTimeUpdate?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
186
|
+
onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
187
|
+
onVolumeChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
188
|
+
onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
189
|
+
onWaiting?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
190
|
+
onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
191
|
+
onAuxClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
192
|
+
onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
193
|
+
onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
194
|
+
onClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
195
|
+
onContextMenu?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
196
|
+
onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
197
|
+
onDoubleClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
198
|
+
onDoubleClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
199
|
+
onDragCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
200
|
+
onDragEndCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
201
|
+
onDragEnter?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
202
|
+
onDragEnterCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
203
|
+
onDragExit?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
204
|
+
onDragExitCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
205
|
+
onDragLeave?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
206
|
+
onDragLeaveCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
207
|
+
onDragOver?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
208
|
+
onDragOverCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
209
|
+
onDragStartCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
210
|
+
onDrop?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
211
|
+
onDropCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
212
|
+
onMouseDown?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
213
|
+
onMouseDownCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
214
|
+
onMouseEnter?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
215
|
+
onMouseLeave?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
216
|
+
onMouseMove?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
217
|
+
onMouseMoveCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
218
|
+
onMouseOut?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
219
|
+
onMouseOutCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
220
|
+
onMouseOver?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
221
|
+
onMouseOverCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
222
|
+
onMouseUp?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
223
|
+
onMouseUpCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
224
|
+
onSelect?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
225
|
+
onSelectCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
226
|
+
onTouchCancel?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
227
|
+
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
228
|
+
onTouchEnd?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
229
|
+
onTouchEndCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
230
|
+
onTouchMove?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
231
|
+
onTouchMoveCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
232
|
+
onTouchStart?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
233
|
+
onTouchStartCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
234
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
235
|
+
onPointerDownCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
236
|
+
onPointerMove?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
237
|
+
onPointerMoveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
238
|
+
onPointerUp?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
239
|
+
onPointerUpCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
240
|
+
onPointerCancel?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
241
|
+
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
242
|
+
onPointerEnter?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
243
|
+
onPointerEnterCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
244
|
+
onPointerLeave?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
245
|
+
onPointerLeaveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
246
|
+
onPointerOver?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
247
|
+
onPointerOverCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
248
|
+
onPointerOut?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
249
|
+
onPointerOutCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
250
|
+
onGotPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
251
|
+
onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
252
|
+
onLostPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
253
|
+
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
254
|
+
onScroll?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
255
|
+
onScrollCapture?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
256
|
+
onWheel?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
257
|
+
onWheelCapture?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
258
|
+
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
259
|
+
onAnimationEnd?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
260
|
+
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
261
|
+
onAnimationIteration?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
262
|
+
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
263
|
+
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
264
|
+
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
265
|
+
} & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLDivElement>, never>> & Omit<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
3
266
|
export declare const StyledOpeningInputPreview: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { motion } from 'framer-motion';
|
|
1
2
|
import styled from 'styled-components';
|
|
2
|
-
export const StyledOpeningInputs = styled.div`
|
|
3
|
+
export const StyledOpeningInputs = styled(motion.div)`
|
|
3
4
|
display: flex;
|
|
4
5
|
flex-direction: column;
|
|
5
|
-
gap: 8px;
|
|
6
|
+
//gap: 8px;
|
|
6
7
|
`;
|
|
7
8
|
export const StyledOpeningInputPreview = styled.div``;
|
|
8
9
|
//# sourceMappingURL=OpeningInputs.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpeningInputs.styles.js","names":["styled","StyledOpeningInputs","div","StyledOpeningInputPreview"],"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 gap: 8px;\n`;\n\nexport const StyledOpeningInputPreview = styled.div``;\n"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"OpeningInputs.styles.js","names":["motion","styled","StyledOpeningInputs","div","StyledOpeningInputPreview"],"sources":["../../../../src/components/opening-times/opening-inputs/OpeningInputs.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled from 'styled-components';\n\nexport const StyledOpeningInputs = styled(motion.div)`\n display: flex;\n flex-direction: column;\n //gap: 8px;\n`;\n\nexport const StyledOpeningInputPreview = styled.div``;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,eAAe;AACtC,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,OAAO,MAAMC,mBAAmB,GAAGD,MAAM,CAACD,MAAM,CAACG,GAAG,CAAE;AACtD;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,yBAAyB,GAAGH,MAAM,CAACE,GAAI,EAAC"}
|
|
@@ -71,6 +71,10 @@ const OpeningInput = _ref => {
|
|
|
71
71
|
exit: {
|
|
72
72
|
opacity: 0,
|
|
73
73
|
height: 0
|
|
74
|
+
},
|
|
75
|
+
transition: {
|
|
76
|
+
duration: 0.2,
|
|
77
|
+
type: 'tween'
|
|
74
78
|
}
|
|
75
79
|
}, /*#__PURE__*/React.createElement(StyledOpeningInputWrapper, null, /*#__PURE__*/React.createElement(NumberInput, {
|
|
76
80
|
shouldShowOnlyBottomBorder: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpeningInput.js","names":["Icon","NumberInput","React","useCallback","useMemo","useState","OpeningTimesButtonType","StyledOpeningInput","StyledOpeningInputButtonWrapper","StyledOpeningInputPseudoButton","StyledOpeningInputText","StyledOpeningInputWrapper","OpeningInput","_ref","end","start","isDisabled","isInvalid","buttonType","onRemove","onAdd","onChange","id","startTime","setStartTime","endTime","setEndTime","button","ADD","createElement","onClick","icons","size","REMOVE","handleStartTimeBlur","value","isTimeInvalid","handleEndTimeBlur","key","animate","opacity","height","initial","exit","shouldShowOnlyBottomBorder","isTimeInput","onBlur","$isDisabled","displayName"],"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 >\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,SAASA,IAAI,EAAEC,WAAW,QAAQ,yBAAyB;AAC3D,OAAOC,KAAK,IAAQC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACjE,SAASC,sBAAsB,QAAmB,gCAAgC;AAClF,SACIC,kBAAkB,EAClBC,+BAA+B,E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A,KAAK,EAAE;MACtD;IACJ;IAEAX,YAAY,CAACW,KAAK,CAAC;IAEnBd,QAAQ,CAAC;MAAEP,GAAG,EAAEW,OAAO;MAAEV,KAAK,EAAEoB,KAAK;MAAEb;IAAG,CAAC,CAAC;EAChD,CAAC,EACD,CAACG,OAAO,EAAEH,EAAE,EAAED,QAAQ,CAC1B,CAAC;EAED,MAAMgB,iBAAiB,GAAGlC,WAAW,CACjC,CAACgC,KAA6B,EAAEC,aAAsB,KAAK;IACvD,IAAIA,aAAa,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAI,CAACA,KAAK,EAAE;MACtD;IACJ;IAEAT,UAAU,CAACS,KAAK,CAAC;IAEjBd,QAAQ,CAAC;MAAEP,GAAG,EAAEqB,KAAK;MAAEpB,KAAK,EAAEQ,SAAS;MAAED;IAAG,CAAC,CAAC;EAClD,CAAC,EACD,CAACA,EAAE,EAAED,QAAQ,EAAEE,SAAS,CAC5B,CAAC;EAED,OAAOnB,OAAO,CACV,mBACIF,KAAA,CAAA2B,aAAA,CAACtB,kBAAkB;IACf+B,GAAG,EAAEhB,EAAG;IACRiB,OAAO,EAAE;MAAEC,OAAO,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAO,CAAE;IACxCC,OAAO,EAAE;MAAEF,OAAO,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAE;IACnCE,IAAI,EAAE;MAAEH,OAAO,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE;EAAE,
|
|
1
|
+
{"version":3,"file":"OpeningInput.js","names":["Icon","NumberInput","React","useCallback","useMemo","useState","OpeningTimesButtonType","StyledOpeningInput","StyledOpeningInputButtonWrapper","StyledOpeningInputPseudoButton","StyledOpeningInputText","StyledOpeningInputWrapper","OpeningInput","_ref","end","start","isDisabled","isInvalid","buttonType","onRemove","onAdd","onChange","id","startTime","setStartTime","endTime","setEndTime","button","ADD","createElement","onClick","icons","size","REMOVE","handleStartTimeBlur","value","isTimeInvalid","handleEndTimeBlur","key","animate","opacity","height","initial","exit","transition","duration","type","shouldShowOnlyBottomBorder","isTimeInput","onBlur","$isDisabled","displayName"],"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,SAASA,IAAI,EAAEC,WAAW,QAAQ,yBAAyB;AAC3D,OAAOC,KAAK,IAAQC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACjE,SAASC,sBAAsB,QAAmB,gCAAgC;AAClF,SACIC,kBAAkB,EAClBC,+BAA+B,EAC/BC,8BAA8B,EAC9BC,sBAAsB,EACtBC,yBAAyB,QACtB,uBAAuB;AAc9B,MAAMC,YAAmC,GAAGC,IAAA,IAUtC;EAAA,IAVuC;IACzCC,GAAG;IACHC,KAAK;IACLC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC,QAAQ;IACRC,KAAK;IACLC,QAAQ;IACRC;EACJ,CAAC,GAAAT,IAAA;EACG,MAAM,CAACU,SAAS,EAAE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AAQ;IACfwB,MAAM,EAAEZ,iBAAkB;IAC1BrB,UAAU,EAAEA;EAAW,CAC1B,CACsB,CAAC,EAC3BW,MACe,CACvB,EACD,CACIA,MAAM,EACNF,OAAO,EACPY,iBAAiB,EACjBH,mBAAmB,EACnBZ,EAAE,EACFN,UAAU,EACVC,SAAS,EACTM,SAAS,CAEjB,CAAC;AACL,CAAC;AAEDX,YAAY,CAACuC,WAAW,GAAG,cAAc;AAEzC,eAAevC,YAAY"}
|
package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpeningInput.styles.js","names":["motion","styled","StyledOpeningInput","div","StyledOpeningInputWrapper","StyledOpeningInputText","_ref","$isDisabled","StyledOpeningInputButtonWrapper","_ref2","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`;\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,SAASA,MAAM,QAAQ,eAAe;AACtC,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,OAAO,MAAMC,kBAAkB,GAAGD,MAAM,CAACD,MAAM,CAACG,GAAG,CAAE;AACrD;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,yBAAyB,GAAGH,MAAM,CAACE,GAAI;AACpD;AACA,CAAC;AAID,OAAO,MAAME,sBAAsB,GAAGJ,MAAM,CAACE,GAAiC;AAC9E,eAAeG,IAAA;EAAA,IAAC;IAAEC;EAAY,CAAC,GAAAD,IAAA;EAAA,OAAMC,WAAW,GAAG,GAAG,GAAG,CAAC;AAAA,CAAE;AAC5D,CAAC;AAID,OAAO,MAAMC,+BAA+B,GAAGP,MAAM,CAACE,GAAI;AAC1D;AACA;AACA,wBAAwBM,KAAA;EAAA,IAAC;IAAEC;EAA4C,CAAC,GAAAD,KAAA;EAAA,OAAKC,KAAK,CAAC,KAAK,CAAC;AAAA,CAAC;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,8BAA8B,GAAGV,MAAM,CAACE,GAAI;AACzD;AACA,CAAC"}
|
|
1
|
+
{"version":3,"file":"OpeningInput.styles.js","names":["motion","styled","StyledOpeningInput","div","StyledOpeningInputWrapper","StyledOpeningInputText","_ref","$isDisabled","StyledOpeningInputButtonWrapper","_ref2","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,SAASA,MAAM,QAAQ,eAAe;AACtC,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,OAAO,MAAMC,kBAAkB,GAAGD,MAAM,CAACD,MAAM,CAACG,GAAG,CAAE;AACrD;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,yBAAyB,GAAGH,MAAM,CAACE,GAAI;AACpD;AACA,CAAC;AAID,OAAO,MAAME,sBAAsB,GAAGJ,MAAM,CAACE,GAAiC;AAC9E,eAAeG,IAAA;EAAA,IAAC;IAAEC;EAAY,CAAC,GAAAD,IAAA;EAAA,OAAMC,WAAW,GAAG,GAAG,GAAG,CAAC;AAAA,CAAE;AAC5D,CAAC;AAID,OAAO,MAAMC,+BAA+B,GAAGP,MAAM,CAACE,GAAI;AAC1D;AACA;AACA,wBAAwBM,KAAA;EAAA,IAAC;IAAEC;EAA4C,CAAC,GAAAD,KAAA;EAAA,OAAKC,KAAK,CAAC,KAAK,CAAC;AAAA,CAAC;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,8BAA8B,GAAGV,MAAM,CAACE,GAAI;AACzD;AACA,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/date",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.558",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"typescript": "^5.3.3"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@chayns-components/core": "^5.0.0-beta.
|
|
60
|
+
"@chayns-components/core": "^5.0.0-beta.558",
|
|
61
61
|
"date-fns": "^2.30.0",
|
|
62
62
|
"uuid": "^9.0.1"
|
|
63
63
|
},
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "0a63c8bc92ed0fbd2e9bedcdf131f4ffda91a6c3"
|
|
75
75
|
}
|