@chayns-components/core 5.0.0-beta.866 → 5.0.0-beta.869
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/cjs/components/slider-button/SliderButton.js +44 -8
- package/lib/cjs/components/slider-button/SliderButton.js.map +1 -1
- package/lib/cjs/components/slider-button/SliderButton.styles.js +5 -1
- package/lib/cjs/components/slider-button/SliderButton.styles.js.map +1 -1
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/components/slider-button/SliderButton.js +59 -20
- package/lib/esm/components/slider-button/SliderButton.js.map +1 -1
- package/lib/esm/components/slider-button/SliderButton.styles.js +18 -11
- package/lib/esm/components/slider-button/SliderButton.styles.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/types/components/slider-button/SliderButton.styles.d.ts +4 -1
- package/lib/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -30,6 +30,9 @@ const SliderButton = ({
|
|
|
30
30
|
const [sliderSize, setSliderSize] = (0, _react.useState)({
|
|
31
31
|
width: 0
|
|
32
32
|
});
|
|
33
|
+
const [currentId, setCurrentId] = (0, _react.useState)('');
|
|
34
|
+
const [currentPopupId, setCurrentPopupId] = (0, _react.useState)('');
|
|
35
|
+
const [currentIndex, setCurrentIndex] = (0, _react.useState)(0);
|
|
33
36
|
const sliderButtonRef = (0, _react.useRef)(null);
|
|
34
37
|
const sliderButtonWrapperRef = (0, _react.useRef)(null);
|
|
35
38
|
const popupRef = (0, _react.useRef)(null);
|
|
@@ -39,14 +42,37 @@ const SliderButton = ({
|
|
|
39
42
|
(0, _react.useEffect)(() => {
|
|
40
43
|
if (elementSize) setSliderSize(elementSize);
|
|
41
44
|
}, [elementSize]);
|
|
45
|
+
const setPopupId = (0, _react.useCallback)(selectedId => {
|
|
46
|
+
const ids = items.slice(shownItemsCount - 1).map(({
|
|
47
|
+
id
|
|
48
|
+
}) => id);
|
|
49
|
+
const newId = ids.find(id => id === selectedId);
|
|
50
|
+
if (newId) {
|
|
51
|
+
setCurrentId('more');
|
|
52
|
+
setCurrentPopupId(newId);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
setCurrentId(selectedId);
|
|
56
|
+
}, [items, shownItemsCount]);
|
|
42
57
|
const isSliderBigger = (0, _react.useMemo)(() => sliderSize && Math.floor(sliderSize.width / initialItemWidth) < items.length - 1, [initialItemWidth, items.length, sliderSize]);
|
|
58
|
+
const maxShownItemsCount = (0, _react.useMemo)(() => {
|
|
59
|
+
let totalWidth = 0;
|
|
60
|
+
let count = 0;
|
|
61
|
+
while (count < items.length) {
|
|
62
|
+
const visibleItems = items.slice(0, count + 1);
|
|
63
|
+
const currentMaxWidth = (0, _calculate.calculateBiggestWidth)(visibleItems) + 8;
|
|
64
|
+
if (totalWidth + currentMaxWidth > sliderSize.width) break;
|
|
65
|
+
totalWidth += currentMaxWidth;
|
|
66
|
+
count++;
|
|
67
|
+
}
|
|
68
|
+
return count;
|
|
69
|
+
}, [items, sliderSize.width]);
|
|
43
70
|
const itemWidth = (0, _react.useMemo)(() => {
|
|
44
71
|
const sliderWidth = (sliderSize === null || sliderSize === void 0 ? void 0 : sliderSize.width) || 0;
|
|
45
|
-
const maxShownItemsCount = Math.floor(sliderWidth / initialItemWidth);
|
|
46
72
|
const itemCount = items.length || 1;
|
|
47
73
|
setShownItemsCount(isSliderBigger ? maxShownItemsCount : itemCount);
|
|
48
74
|
return sliderWidth / (isSliderBigger ? maxShownItemsCount : itemCount);
|
|
49
|
-
}, [
|
|
75
|
+
}, [isSliderBigger, items.length, maxShownItemsCount, sliderSize === null || sliderSize === void 0 ? void 0 : sliderSize.width]);
|
|
50
76
|
(0, _react.useEffect)(() => {
|
|
51
77
|
if (sliderSize) {
|
|
52
78
|
const sliderWidth = itemWidth * (items.length - 1);
|
|
@@ -66,6 +92,7 @@ const SliderButton = ({
|
|
|
66
92
|
});
|
|
67
93
|
}, [animate, scope]);
|
|
68
94
|
const setItemPosition = (0, _react.useCallback)(index => {
|
|
95
|
+
setCurrentIndex(index);
|
|
69
96
|
void animation(itemWidth * index);
|
|
70
97
|
}, [animation, itemWidth]);
|
|
71
98
|
(0, _react.useEffect)(() => {
|
|
@@ -73,6 +100,8 @@ const SliderButton = ({
|
|
|
73
100
|
let index = items.findIndex(({
|
|
74
101
|
id
|
|
75
102
|
}) => id === selectedButtonId);
|
|
103
|
+
setCurrentId(selectedButtonId);
|
|
104
|
+
setPopupId(selectedButtonId);
|
|
76
105
|
if (items.length > shownItemsCount && index > shownItemsCount - 1) {
|
|
77
106
|
index = shownItemsCount - 1;
|
|
78
107
|
}
|
|
@@ -80,11 +109,12 @@ const SliderButton = ({
|
|
|
80
109
|
setItemPosition(index);
|
|
81
110
|
}
|
|
82
111
|
}
|
|
83
|
-
}, [animation, dragRange.right, isSliderBigger, itemWidth, items, selectedButtonId, setItemPosition, shownItemsCount]);
|
|
112
|
+
}, [animation, dragRange.right, isSliderBigger, itemWidth, items, selectedButtonId, setItemPosition, setPopupId, shownItemsCount]);
|
|
84
113
|
const handleClick = (0, _react.useCallback)((id, index) => {
|
|
85
114
|
if (isDisabled) {
|
|
86
115
|
return;
|
|
87
116
|
}
|
|
117
|
+
setPopupId(id);
|
|
88
118
|
if (typeof onChange === 'function' && id !== 'more') {
|
|
89
119
|
onChange(id);
|
|
90
120
|
}
|
|
@@ -96,7 +126,7 @@ const SliderButton = ({
|
|
|
96
126
|
}
|
|
97
127
|
}
|
|
98
128
|
setItemPosition(index);
|
|
99
|
-
}, [isDisabled, onChange, setItemPosition]);
|
|
129
|
+
}, [isDisabled, onChange, setItemPosition, setPopupId]);
|
|
100
130
|
const buttons = (0, _react.useMemo)(() => {
|
|
101
131
|
if (items.length > shownItemsCount) {
|
|
102
132
|
const newItems = items.slice(0, shownItemsCount - 1);
|
|
@@ -114,7 +144,8 @@ const SliderButton = ({
|
|
|
114
144
|
text
|
|
115
145
|
}) => /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonPopupContentItem, {
|
|
116
146
|
key: `slider-button-${id}`,
|
|
117
|
-
onClick: () => handleClick(id, newItems.length)
|
|
147
|
+
onClick: () => handleClick(id, newItems.length),
|
|
148
|
+
$isSelected: id === currentPopupId
|
|
118
149
|
}, text));
|
|
119
150
|
const id = 'more';
|
|
120
151
|
elements.push(/*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonItem, {
|
|
@@ -136,7 +167,7 @@ const SliderButton = ({
|
|
|
136
167
|
$width: itemWidth,
|
|
137
168
|
key: `slider-button-${id}`
|
|
138
169
|
}, text));
|
|
139
|
-
}, [handleClick, itemWidth, items, shownItemsCount]);
|
|
170
|
+
}, [currentPopupId, handleClick, itemWidth, items, shownItemsCount]);
|
|
140
171
|
const pseudoButtons = (0, _react.useMemo)(() => {
|
|
141
172
|
if (items.length > shownItemsCount) {
|
|
142
173
|
const newItems = items.slice(0, shownItemsCount - 1);
|
|
@@ -178,6 +209,9 @@ const SliderButton = ({
|
|
|
178
209
|
}
|
|
179
210
|
return points;
|
|
180
211
|
}, [itemWidth, items.length]);
|
|
212
|
+
const handleDragStart = (0, _react.useCallback)(() => {
|
|
213
|
+
void (0, _chaynsApi.setRefreshScrollEnabled)(false);
|
|
214
|
+
}, []);
|
|
181
215
|
const handleDragEnd = (0, _react.useCallback)(() => {
|
|
182
216
|
void (0, _chaynsApi.setRefreshScrollEnabled)(true);
|
|
183
217
|
const position = (0, _sliderButton.getThumbPosition)({
|
|
@@ -251,12 +285,14 @@ const SliderButton = ({
|
|
|
251
285
|
...dragRange
|
|
252
286
|
},
|
|
253
287
|
$width: itemWidth,
|
|
254
|
-
onDragEnd: handleDragEnd
|
|
288
|
+
onDragEnd: handleDragEnd,
|
|
289
|
+
onDragStart: handleDragStart,
|
|
290
|
+
onClick: () => handleClick(currentId, currentIndex)
|
|
255
291
|
}), /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonWrapper, {
|
|
256
292
|
$isDisabled: isDisabled,
|
|
257
293
|
$width: !isSliderBigger ? dragRange.right + itemWidth : dragRange.right,
|
|
258
294
|
ref: sliderButtonWrapperRef
|
|
259
|
-
}, /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, null, /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonButtonsWrapper, null, buttons)))), [buttons, dragRange, handleDragEnd, isDisabled, isSliderBigger, itemWidth, pseudoButtons, scope]);
|
|
295
|
+
}, /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, null, /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonButtonsWrapper, null, buttons)))), [buttons, currentId, currentIndex, dragRange, handleClick, handleDragEnd, handleDragStart, isDisabled, isSliderBigger, itemWidth, pseudoButtons, scope]);
|
|
260
296
|
};
|
|
261
297
|
SliderButton.displayName = 'SliderButton';
|
|
262
298
|
var _default = exports.default = SliderButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderButton.js","names":["_chaynsApi","require","_framerMotion","_react","_interopRequireWildcard","_useElementSize","_calculate","_sliderButton","_Icon","_interopRequireDefault","_Popup","_SliderButton","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SliderButton","selectedButtonId","isDisabled","items","onChange","dragRange","setDragRange","useState","left","right","shownItemsCount","setShownItemsCount","length","sliderSize","setSliderSize","width","sliderButtonRef","useRef","sliderButtonWrapperRef","popupRef","scope","animate","useAnimate","initialItemWidth","useMemo","calculateBiggestWidth","elementSize","useElementSize","useEffect","isSliderBigger","Math","floor","itemWidth","sliderWidth","maxShownItemsCount","itemCount","count","animation","useCallback","x","current","type","duration","setItemPosition","index","findIndex","id","handleClick","show","hide","buttons","newItems","slice","otherItems","elements","map","text","createElement","StyledSliderButtonItem","$width","key","onClick","popupContent","StyledSliderButtonPopupContentItem","push","ref","content","StyledSliderButtonPopupContent","icons","color","pseudoButtons","snapPoints","points","handleDragEnd","setRefreshScrollEnabled","position","getThumbPosition","middle","scrollLeft","getNearestPoint","nearestPoint","nearestIndex","_items$nearestIndex","StyledSliderButton","$isDisabled","StyledSliderButtonButtonsWrapper","$isInvisible","StyledMotionSliderButtonThumb","drag","dragElastic","dragConstraints","onDragEnd","StyledSliderButtonWrapper","AnimatePresence","displayName","_default","exports"],"sources":["../../../../src/components/slider-button/SliderButton.tsx"],"sourcesContent":["import { setRefreshScrollEnabled } from 'chayns-api';\nimport { AnimatePresence, useAnimate } from 'framer-motion';\nimport React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useElementSize } from '../../hooks/useElementSize';\nimport { PopupRef } from '../../types/popup';\nimport type { SliderButtonItem } from '../../types/slider-button';\nimport { calculateBiggestWidth } from '../../utils/calculate';\nimport { getNearestPoint, getThumbPosition } from '../../utils/sliderButton';\nimport Icon from '../icon/Icon';\nimport Popup from '../popup/Popup';\nimport {\n StyledMotionSliderButtonThumb,\n StyledSliderButton,\n StyledSliderButtonButtonsWrapper,\n StyledSliderButtonItem,\n StyledSliderButtonPopupContent,\n StyledSliderButtonPopupContentItem,\n StyledSliderButtonWrapper,\n} from './SliderButton.styles';\n\nexport type SliderButtonProps = {\n /**\n * Whether the button is disabled.\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when a button is selected.\n * @param id\n */\n onChange?: (id: string) => void;\n /**\n * The buttons that are slidable.\n */\n items: SliderButtonItem[];\n /**\n * The id of a button that should be selected.\n */\n selectedButtonId?: string;\n};\n\nconst SliderButton: FC<SliderButtonProps> = ({ selectedButtonId, isDisabled, items, onChange }) => {\n const [dragRange, setDragRange] = useState({ left: 0, right: 0 });\n const [shownItemsCount, setShownItemsCount] = useState(items.length);\n const [sliderSize, setSliderSize] = useState({ width: 0 });\n\n const sliderButtonRef = useRef<HTMLDivElement>(null);\n const sliderButtonWrapperRef = useRef<HTMLDivElement>(null);\n const popupRef = useRef<PopupRef>(null);\n\n const [scope, animate] = useAnimate();\n\n const initialItemWidth = useMemo(() => calculateBiggestWidth(items), [items]);\n const elementSize = useElementSize(sliderButtonRef);\n\n useEffect(() => {\n if (elementSize) setSliderSize(elementSize);\n }, [elementSize]);\n\n const isSliderBigger = useMemo(\n () => sliderSize && Math.floor(sliderSize.width / initialItemWidth) < items.length - 1,\n [initialItemWidth, items.length, sliderSize],\n );\n\n const itemWidth = useMemo(() => {\n const sliderWidth = sliderSize?.width || 0;\n const maxShownItemsCount = Math.floor(sliderWidth / initialItemWidth);\n const itemCount = items.length || 1;\n\n setShownItemsCount(isSliderBigger ? maxShownItemsCount : itemCount);\n\n return sliderWidth / (isSliderBigger ? maxShownItemsCount : itemCount);\n }, [initialItemWidth, isSliderBigger, items.length, sliderSize?.width]);\n\n useEffect(() => {\n if (sliderSize) {\n const sliderWidth = itemWidth * (items.length - 1);\n\n const count = Math.floor(sliderSize.width / itemWidth);\n\n setDragRange({ left: 0, right: isSliderBigger ? itemWidth * count : sliderWidth });\n }\n }, [isSliderBigger, itemWidth, items.length, sliderSize]);\n\n const animation = useCallback(\n async (x: number) => {\n await animate(\n scope.current,\n { x },\n {\n type: 'tween',\n duration: 0.2,\n },\n );\n },\n [animate, scope],\n );\n\n const setItemPosition = useCallback(\n (index: number) => {\n void animation(itemWidth * index);\n },\n [animation, itemWidth],\n );\n\n useEffect(() => {\n if (typeof selectedButtonId === 'string') {\n let index = items.findIndex(({ id }) => id === selectedButtonId);\n\n if (items.length > shownItemsCount && index > shownItemsCount - 1) {\n index = shownItemsCount - 1;\n }\n\n if (index >= 0) {\n setItemPosition(index);\n }\n }\n }, [\n animation,\n dragRange.right,\n isSliderBigger,\n itemWidth,\n items,\n selectedButtonId,\n setItemPosition,\n shownItemsCount,\n ]);\n\n const handleClick = useCallback(\n (id: string, index: number) => {\n if (isDisabled) {\n return;\n }\n\n if (typeof onChange === 'function' && id !== 'more') {\n onChange(id);\n }\n\n if (popupRef.current) {\n if (id === 'more') {\n popupRef.current.show();\n } else {\n popupRef.current.hide();\n }\n }\n\n setItemPosition(index);\n },\n [isDisabled, onChange, setItemPosition],\n );\n\n const buttons = useMemo(() => {\n if (items.length > shownItemsCount) {\n const newItems = items.slice(0, shownItemsCount - 1);\n const otherItems = items.slice(shownItemsCount - 1);\n\n const elements = newItems.map(({ id, text }, index) => (\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n >\n {text}\n </StyledSliderButtonItem>\n ));\n\n const popupContent = otherItems.map(({ id, text }) => (\n <StyledSliderButtonPopupContentItem\n key={`slider-button-${id}`}\n onClick={() => handleClick(id, newItems.length)}\n >\n {text}\n </StyledSliderButtonPopupContentItem>\n ));\n\n const id = 'more';\n\n elements.push(\n <StyledSliderButtonItem $width={itemWidth} key={`slider-button-${id}`}>\n <Popup\n ref={popupRef}\n content={\n <StyledSliderButtonPopupContent>\n {popupContent}\n </StyledSliderButtonPopupContent>\n }\n >\n <Icon icons={['fa fa-ellipsis']} color=\"white\" />\n </Popup>\n </StyledSliderButtonItem>,\n );\n\n return elements;\n }\n return items.map(({ id, text }) => (\n <StyledSliderButtonItem $width={itemWidth} key={`slider-button-${id}`}>\n {text}\n </StyledSliderButtonItem>\n ));\n }, [handleClick, itemWidth, items, shownItemsCount]);\n\n const pseudoButtons = useMemo(() => {\n if (items.length > shownItemsCount) {\n const newItems = items.slice(0, shownItemsCount - 1);\n\n const elements = newItems.map(({ id, text }, index) => (\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`pseudo-slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n >\n {text}\n </StyledSliderButtonItem>\n ));\n\n const id = 'more';\n\n elements.push(\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`pseudo-slider-button-${id}`}\n onClick={() => handleClick(id, newItems.length)}\n >\n <Icon icons={['fa fa-ellipsis']} />\n </StyledSliderButtonItem>,\n );\n\n return elements;\n }\n return items.map(({ id, text }, index) => (\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`pseudo-slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n >\n {text}\n </StyledSliderButtonItem>\n ));\n }, [handleClick, itemWidth, items, shownItemsCount]);\n\n /**\n * Creates an array with the snap points relative to the width of the items\n */\n const snapPoints = useMemo(() => {\n const points = [0];\n\n for (let i = 1; i < items.length; i++) {\n points.push(itemWidth * i);\n }\n\n return points;\n }, [itemWidth, items.length]);\n\n const handleDragEnd = useCallback(() => {\n void setRefreshScrollEnabled(true);\n\n const position = getThumbPosition({ scope, itemWidth });\n\n if (!position) {\n return;\n }\n\n const { middle, left } = position;\n\n let scrollLeft = 0;\n\n if (sliderButtonWrapperRef.current) {\n scrollLeft = sliderButtonWrapperRef.current.scrollLeft;\n\n sliderButtonWrapperRef.current.scrollLeft = getNearestPoint({\n snapPoints,\n position: middle,\n scrollLeft: scrollLeft - left,\n }).nearestPoint;\n }\n\n const { nearestIndex } = getNearestPoint({\n snapPoints,\n position: middle,\n scrollLeft,\n });\n\n const { nearestPoint } = getNearestPoint({\n snapPoints,\n position: middle,\n scrollLeft: 0,\n });\n\n if (nearestPoint >= 0 && nearestIndex >= 0) {\n void animation(nearestPoint);\n\n let id;\n\n if (nearestIndex === shownItemsCount - 1) {\n id = 'more';\n } else {\n id = items[nearestIndex]?.id;\n }\n\n if (popupRef.current) {\n if (id === 'more') {\n popupRef.current.show();\n } else {\n popupRef.current.hide();\n }\n }\n\n if (typeof onChange === 'function' && id && id !== 'more') {\n onChange(id);\n }\n }\n }, [animation, itemWidth, items, onChange, scope, shownItemsCount, snapPoints]);\n\n return useMemo(\n () => (\n <StyledSliderButton $isDisabled={isDisabled} ref={sliderButtonRef}>\n <StyledSliderButtonButtonsWrapper $isInvisible>\n {pseudoButtons}\n </StyledSliderButtonButtonsWrapper>\n <StyledMotionSliderButtonThumb\n ref={scope}\n drag={isDisabled ? false : 'x'}\n dragElastic={0}\n dragConstraints={\n isSliderBigger\n ? { ...dragRange, right: dragRange.right - itemWidth }\n : { ...dragRange }\n }\n $width={itemWidth}\n onDragEnd={handleDragEnd}\n />\n <StyledSliderButtonWrapper\n $isDisabled={isDisabled}\n $width={!isSliderBigger ? dragRange.right + itemWidth : dragRange.right}\n ref={sliderButtonWrapperRef}\n >\n <AnimatePresence>\n <StyledSliderButtonButtonsWrapper>\n {buttons}\n </StyledSliderButtonButtonsWrapper>\n </AnimatePresence>\n </StyledSliderButtonWrapper>\n </StyledSliderButton>\n ),\n [\n buttons,\n dragRange,\n handleDragEnd,\n isDisabled,\n isSliderBigger,\n itemWidth,\n pseudoButtons,\n scope,\n ],\n );\n};\n\nSliderButton.displayName = 'SliderButton';\n\nexport default SliderButton;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AAGA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AAQ+B,SAAAQ,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,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AAC;AACL,CAAC;AAEDpB,YAAY,CAAC8F,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlH,OAAA,GAE3BkB,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"SliderButton.js","names":["_chaynsApi","require","_framerMotion","_react","_interopRequireWildcard","_useElementSize","_calculate","_sliderButton","_Icon","_interopRequireDefault","_Popup","_SliderButton","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SliderButton","selectedButtonId","isDisabled","items","onChange","dragRange","setDragRange","useState","left","right","shownItemsCount","setShownItemsCount","length","sliderSize","setSliderSize","width","currentId","setCurrentId","currentPopupId","setCurrentPopupId","currentIndex","setCurrentIndex","sliderButtonRef","useRef","sliderButtonWrapperRef","popupRef","scope","animate","useAnimate","initialItemWidth","useMemo","calculateBiggestWidth","elementSize","useElementSize","useEffect","setPopupId","useCallback","selectedId","ids","slice","map","id","newId","find","isSliderBigger","Math","floor","maxShownItemsCount","totalWidth","count","visibleItems","currentMaxWidth","itemWidth","sliderWidth","itemCount","animation","x","current","type","duration","setItemPosition","index","findIndex","handleClick","show","hide","buttons","newItems","otherItems","elements","text","createElement","StyledSliderButtonItem","$width","key","onClick","popupContent","StyledSliderButtonPopupContentItem","$isSelected","push","ref","content","StyledSliderButtonPopupContent","icons","color","pseudoButtons","snapPoints","points","handleDragStart","setRefreshScrollEnabled","handleDragEnd","position","getThumbPosition","middle","scrollLeft","getNearestPoint","nearestPoint","nearestIndex","_items$nearestIndex","StyledSliderButton","$isDisabled","StyledSliderButtonButtonsWrapper","$isInvisible","StyledMotionSliderButtonThumb","drag","dragElastic","dragConstraints","onDragEnd","onDragStart","StyledSliderButtonWrapper","AnimatePresence","displayName","_default","exports"],"sources":["../../../../src/components/slider-button/SliderButton.tsx"],"sourcesContent":["import { setRefreshScrollEnabled } from 'chayns-api';\nimport { AnimatePresence, useAnimate } from 'framer-motion';\nimport React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useElementSize } from '../../hooks/useElementSize';\nimport { PopupRef } from '../../types/popup';\nimport type { SliderButtonItem } from '../../types/slider-button';\nimport { calculateBiggestWidth } from '../../utils/calculate';\nimport { getNearestPoint, getThumbPosition } from '../../utils/sliderButton';\nimport Icon from '../icon/Icon';\nimport Popup from '../popup/Popup';\nimport {\n StyledMotionSliderButtonThumb,\n StyledSliderButton,\n StyledSliderButtonButtonsWrapper,\n StyledSliderButtonItem,\n StyledSliderButtonPopupContent,\n StyledSliderButtonPopupContentItem,\n StyledSliderButtonWrapper,\n} from './SliderButton.styles';\n\nexport type SliderButtonProps = {\n /**\n * Whether the button is disabled.\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when a button is selected.\n * @param id\n */\n onChange?: (id: string) => void;\n /**\n * The buttons that are slidable.\n */\n items: SliderButtonItem[];\n /**\n * The id of a button that should be selected.\n */\n selectedButtonId?: string;\n};\n\nconst SliderButton: FC<SliderButtonProps> = ({ selectedButtonId, isDisabled, items, onChange }) => {\n const [dragRange, setDragRange] = useState({ left: 0, right: 0 });\n const [shownItemsCount, setShownItemsCount] = useState(items.length);\n const [sliderSize, setSliderSize] = useState({ width: 0 });\n const [currentId, setCurrentId] = useState('');\n const [currentPopupId, setCurrentPopupId] = useState('');\n const [currentIndex, setCurrentIndex] = useState(0);\n\n const sliderButtonRef = useRef<HTMLDivElement>(null);\n const sliderButtonWrapperRef = useRef<HTMLDivElement>(null);\n const popupRef = useRef<PopupRef>(null);\n\n const [scope, animate] = useAnimate();\n\n const initialItemWidth = useMemo(() => calculateBiggestWidth(items), [items]);\n const elementSize = useElementSize(sliderButtonRef);\n\n useEffect(() => {\n if (elementSize) setSliderSize(elementSize);\n }, [elementSize]);\n\n const setPopupId = useCallback(\n (selectedId: string) => {\n const ids = items.slice(shownItemsCount - 1).map(({ id }) => id);\n\n const newId = ids.find((id) => id === selectedId);\n\n if (newId) {\n setCurrentId('more');\n setCurrentPopupId(newId);\n\n return;\n }\n\n setCurrentId(selectedId);\n },\n [items, shownItemsCount],\n );\n\n const isSliderBigger = useMemo(\n () => sliderSize && Math.floor(sliderSize.width / initialItemWidth) < items.length - 1,\n [initialItemWidth, items.length, sliderSize],\n );\n\n const maxShownItemsCount = useMemo(() => {\n let totalWidth = 0;\n let count = 0;\n\n while (count < items.length) {\n const visibleItems = items.slice(0, count + 1);\n const currentMaxWidth = calculateBiggestWidth(visibleItems) + 8;\n\n if (totalWidth + currentMaxWidth > sliderSize.width) break;\n\n totalWidth += currentMaxWidth;\n count++;\n }\n\n return count;\n }, [items, sliderSize.width]);\n\n const itemWidth = useMemo(() => {\n const sliderWidth = sliderSize?.width || 0;\n const itemCount = items.length || 1;\n\n setShownItemsCount(isSliderBigger ? maxShownItemsCount : itemCount);\n\n return sliderWidth / (isSliderBigger ? maxShownItemsCount : itemCount);\n }, [isSliderBigger, items.length, maxShownItemsCount, sliderSize?.width]);\n\n useEffect(() => {\n if (sliderSize) {\n const sliderWidth = itemWidth * (items.length - 1);\n\n const count = Math.floor(sliderSize.width / itemWidth);\n\n setDragRange({ left: 0, right: isSliderBigger ? itemWidth * count : sliderWidth });\n }\n }, [isSliderBigger, itemWidth, items.length, sliderSize]);\n\n const animation = useCallback(\n async (x: number) => {\n await animate(\n scope.current,\n { x },\n {\n type: 'tween',\n duration: 0.2,\n },\n );\n },\n [animate, scope],\n );\n\n const setItemPosition = useCallback(\n (index: number) => {\n setCurrentIndex(index);\n\n void animation(itemWidth * index);\n },\n [animation, itemWidth],\n );\n\n useEffect(() => {\n if (typeof selectedButtonId === 'string') {\n let index = items.findIndex(({ id }) => id === selectedButtonId);\n\n setCurrentId(selectedButtonId);\n\n setPopupId(selectedButtonId);\n\n if (items.length > shownItemsCount && index > shownItemsCount - 1) {\n index = shownItemsCount - 1;\n }\n\n if (index >= 0) {\n setItemPosition(index);\n }\n }\n }, [\n animation,\n dragRange.right,\n isSliderBigger,\n itemWidth,\n items,\n selectedButtonId,\n setItemPosition,\n setPopupId,\n shownItemsCount,\n ]);\n\n const handleClick = useCallback(\n (id: string, index: number) => {\n if (isDisabled) {\n return;\n }\n\n setPopupId(id);\n\n if (typeof onChange === 'function' && id !== 'more') {\n onChange(id);\n }\n\n if (popupRef.current) {\n if (id === 'more') {\n popupRef.current.show();\n } else {\n popupRef.current.hide();\n }\n }\n\n setItemPosition(index);\n },\n [isDisabled, onChange, setItemPosition, setPopupId],\n );\n\n const buttons = useMemo(() => {\n if (items.length > shownItemsCount) {\n const newItems = items.slice(0, shownItemsCount - 1);\n const otherItems = items.slice(shownItemsCount - 1);\n\n const elements = newItems.map(({ id, text }, index) => (\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n >\n {text}\n </StyledSliderButtonItem>\n ));\n\n const popupContent = otherItems.map(({ id, text }) => (\n <StyledSliderButtonPopupContentItem\n key={`slider-button-${id}`}\n onClick={() => handleClick(id, newItems.length)}\n $isSelected={id === currentPopupId}\n >\n {text}\n </StyledSliderButtonPopupContentItem>\n ));\n\n const id = 'more';\n\n elements.push(\n <StyledSliderButtonItem $width={itemWidth} key={`slider-button-${id}`}>\n <Popup\n ref={popupRef}\n content={\n <StyledSliderButtonPopupContent>\n {popupContent}\n </StyledSliderButtonPopupContent>\n }\n >\n <Icon icons={['fa fa-ellipsis']} color=\"white\" />\n </Popup>\n </StyledSliderButtonItem>,\n );\n\n return elements;\n }\n return items.map(({ id, text }) => (\n <StyledSliderButtonItem $width={itemWidth} key={`slider-button-${id}`}>\n {text}\n </StyledSliderButtonItem>\n ));\n }, [currentPopupId, handleClick, itemWidth, items, shownItemsCount]);\n\n const pseudoButtons = useMemo(() => {\n if (items.length > shownItemsCount) {\n const newItems = items.slice(0, shownItemsCount - 1);\n\n const elements = newItems.map(({ id, text }, index) => (\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`pseudo-slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n >\n {text}\n </StyledSliderButtonItem>\n ));\n\n const id = 'more';\n\n elements.push(\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`pseudo-slider-button-${id}`}\n onClick={() => handleClick(id, newItems.length)}\n >\n <Icon icons={['fa fa-ellipsis']} />\n </StyledSliderButtonItem>,\n );\n\n return elements;\n }\n return items.map(({ id, text }, index) => (\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`pseudo-slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n >\n {text}\n </StyledSliderButtonItem>\n ));\n }, [handleClick, itemWidth, items, shownItemsCount]);\n\n /**\n * Creates an array with the snap points relative to the width of the items\n */\n const snapPoints = useMemo(() => {\n const points = [0];\n\n for (let i = 1; i < items.length; i++) {\n points.push(itemWidth * i);\n }\n\n return points;\n }, [itemWidth, items.length]);\n\n const handleDragStart = useCallback(() => {\n void setRefreshScrollEnabled(false);\n }, []);\n\n const handleDragEnd = useCallback(() => {\n void setRefreshScrollEnabled(true);\n\n const position = getThumbPosition({ scope, itemWidth });\n\n if (!position) {\n return;\n }\n\n const { middle, left } = position;\n\n let scrollLeft = 0;\n\n if (sliderButtonWrapperRef.current) {\n scrollLeft = sliderButtonWrapperRef.current.scrollLeft;\n\n sliderButtonWrapperRef.current.scrollLeft = getNearestPoint({\n snapPoints,\n position: middle,\n scrollLeft: scrollLeft - left,\n }).nearestPoint;\n }\n\n const { nearestIndex } = getNearestPoint({\n snapPoints,\n position: middle,\n scrollLeft,\n });\n\n const { nearestPoint } = getNearestPoint({\n snapPoints,\n position: middle,\n scrollLeft: 0,\n });\n\n if (nearestPoint >= 0 && nearestIndex >= 0) {\n void animation(nearestPoint);\n\n let id;\n\n if (nearestIndex === shownItemsCount - 1) {\n id = 'more';\n } else {\n id = items[nearestIndex]?.id;\n }\n\n if (popupRef.current) {\n if (id === 'more') {\n popupRef.current.show();\n } else {\n popupRef.current.hide();\n }\n }\n\n if (typeof onChange === 'function' && id && id !== 'more') {\n onChange(id);\n }\n }\n }, [animation, itemWidth, items, onChange, scope, shownItemsCount, snapPoints]);\n\n return useMemo(\n () => (\n <StyledSliderButton $isDisabled={isDisabled} ref={sliderButtonRef}>\n <StyledSliderButtonButtonsWrapper $isInvisible>\n {pseudoButtons}\n </StyledSliderButtonButtonsWrapper>\n <StyledMotionSliderButtonThumb\n ref={scope}\n drag={isDisabled ? false : 'x'}\n dragElastic={0}\n dragConstraints={\n isSliderBigger\n ? { ...dragRange, right: dragRange.right - itemWidth }\n : { ...dragRange }\n }\n $width={itemWidth}\n onDragEnd={handleDragEnd}\n onDragStart={handleDragStart}\n onClick={() => handleClick(currentId, currentIndex)}\n />\n <StyledSliderButtonWrapper\n $isDisabled={isDisabled}\n $width={!isSliderBigger ? dragRange.right + itemWidth : dragRange.right}\n ref={sliderButtonWrapperRef}\n >\n <AnimatePresence>\n <StyledSliderButtonButtonsWrapper>\n {buttons}\n </StyledSliderButtonButtonsWrapper>\n </AnimatePresence>\n </StyledSliderButtonWrapper>\n </StyledSliderButton>\n ),\n [\n buttons,\n currentId,\n currentIndex,\n dragRange,\n handleClick,\n handleDragEnd,\n handleDragStart,\n isDisabled,\n isSliderBigger,\n itemWidth,\n pseudoButtons,\n scope,\n ],\n );\n};\n\nSliderButton.displayName = 'SliderButton';\n\nexport default SliderButton;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AAGA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AAQ+B,SAAAQ,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD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AAG,GAAI;IAC/BuG,WAAW,EAAE,CAAE;IACfC,eAAe,EACX9D,cAAc,GACR;MAAE,GAAGvC,SAAS;MAAEI,KAAK,EAAEJ,SAAS,CAACI,KAAK,GAAG2C;IAAU,CAAC,GACpD;MAAE,GAAG/C;IAAU,CACxB;IACDoE,MAAM,EAAErB,SAAU;IAClBuD,SAAS,EAAEjB,aAAc;IACzBkB,WAAW,EAAEpB,eAAgB;IAC7Bb,OAAO,EAAEA,CAAA,KAAMZ,WAAW,CAAC/C,SAAS,EAAEI,YAAY;EAAE,CACvD,CAAC,eACFjD,MAAA,CAAAW,OAAA,CAAAyF,aAAA,CAAC5F,aAAA,CAAAkI,yBAAyB;IACtBT,WAAW,EAAElG,UAAW;IACxBuE,MAAM,EAAE,CAAC7B,cAAc,GAAGvC,SAAS,CAACI,KAAK,GAAG2C,SAAS,GAAG/C,SAAS,CAACI,KAAM;IACxEuE,GAAG,EAAExD;EAAuB,gBAE5BrD,MAAA,CAAAW,OAAA,CAAAyF,aAAA,CAACrG,aAAA,CAAA4I,eAAe,qBACZ3I,MAAA,CAAAW,OAAA,CAAAyF,aAAA,CAAC5F,aAAA,CAAA0H,gCAAgC,QAC5BnC,OAC6B,CACrB,CACM,CACX,CACvB,EACD,CACIA,OAAO,EACPlD,SAAS,EACTI,YAAY,EACZf,SAAS,EACT0D,WAAW,EACX2B,aAAa,EACbF,eAAe,EACftF,UAAU,EACV0C,cAAc,EACdQ,SAAS,EACTiC,aAAa,EACb3D,KAAK,CAEb,CAAC;AACL,CAAC;AAED1B,YAAY,CAAC+G,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAnI,OAAA,GAE3BkB,YAAY","ignoreList":[]}
|
|
@@ -69,12 +69,16 @@ const StyledSliderButtonItem = exports.StyledSliderButtonItem = _styledComponent
|
|
|
69
69
|
const StyledSliderButtonPopupContent = exports.StyledSliderButtonPopupContent = _styledComponents.default.div`
|
|
70
70
|
display: flex;
|
|
71
71
|
flex-direction: column;
|
|
72
|
-
padding: 7px 12px;
|
|
73
72
|
`;
|
|
74
73
|
const StyledSliderButtonPopupContentItem = exports.StyledSliderButtonPopupContentItem = _styledComponents.default.div`
|
|
75
74
|
font-size: 110%;
|
|
76
75
|
font-family: 'Roboto Medium', serif;
|
|
77
76
|
cursor: pointer;
|
|
77
|
+
background-color: ${({
|
|
78
|
+
$isSelected,
|
|
79
|
+
theme
|
|
80
|
+
}) => $isSelected ? theme['secondary-102'] : undefined};
|
|
81
|
+
padding: 4px 12px;
|
|
78
82
|
`;
|
|
79
83
|
const StyledSliderButtonButtonsWrapper = exports.StyledSliderButtonButtonsWrapper = _styledComponents.default.div`
|
|
80
84
|
position: absolute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderButton.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledSliderButton","exports","styled","div","$isDisabled","StyledSliderButtonWrapper","theme","$width","StyledSliderButtonItem","StyledSliderButtonPopupContent","StyledSliderButtonPopupContentItem","StyledSliderButtonButtonsWrapper","$isInvisible","StyledMotionSliderButtonThumb","motion"],"sources":["../../../../src/components/slider-button/SliderButton.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledSliderButtonProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledSliderButton = styled.div<StyledSliderButtonProps>`\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n width: 100%;\n touch-action: none;\n`;\n\ntype StyledSliderButtonWrapperProps = WithTheme<{ $width: number; $isDisabled?: boolean }>;\n\nexport const StyledSliderButtonWrapper = styled.div<StyledSliderButtonWrapperProps>`\n align-items: center;\n background-color: ${({ theme }: StyledMotionSliderButtonThumbProps) => theme['408']};\n border-radius: 3px;\n border: none;\n color: white;\n cursor: pointer;\n display: inline-flex;\n line-height: 1.15;\n height: 32px;\n position: relative;\n user-select: none;\n transition: opacity 0.3s ease;\n\n width: ${({ $width }) => $width}px;\n\n max-width: 100%;\n overflow-x: ${({ $isDisabled }) => ($isDisabled ? 'hidden' : 'scroll')};\n overflow-y: hidden;\n\n // Chrome\n &::-webkit-scrollbar {\n display: none;\n }\n\n // IE and Edge\n -ms-overflow-style: none;\n\n // Firefox\n scrollbar-width: none;\n`;\n\ntype StyledSliderButtonItemProps = WithTheme<{ $width: number }>;\n\nexport const StyledSliderButtonItem = styled.div<StyledSliderButtonItemProps>`\n font-size: 110%;\n font-family: 'Roboto Medium', serif;\n padding: 7px 12px;\n min-width: ${({ $width }) => $width}px;\n max-width: ${({ $width }) => $width}px;\n display: flex;\n white-space: nowrap;\n justify-content: center;\n color: white;\n`;\n\nexport const StyledSliderButtonPopupContent = styled.div`\n display: flex;\n flex-direction: column;\n
|
|
1
|
+
{"version":3,"file":"SliderButton.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledSliderButton","exports","styled","div","$isDisabled","StyledSliderButtonWrapper","theme","$width","StyledSliderButtonItem","StyledSliderButtonPopupContent","StyledSliderButtonPopupContentItem","$isSelected","undefined","StyledSliderButtonButtonsWrapper","$isInvisible","StyledMotionSliderButtonThumb","motion"],"sources":["../../../../src/components/slider-button/SliderButton.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledSliderButtonProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledSliderButton = styled.div<StyledSliderButtonProps>`\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n width: 100%;\n touch-action: none;\n`;\n\ntype StyledSliderButtonWrapperProps = WithTheme<{ $width: number; $isDisabled?: boolean }>;\n\nexport const StyledSliderButtonWrapper = styled.div<StyledSliderButtonWrapperProps>`\n align-items: center;\n background-color: ${({ theme }: StyledMotionSliderButtonThumbProps) => theme['408']};\n border-radius: 3px;\n border: none;\n color: white;\n cursor: pointer;\n display: inline-flex;\n line-height: 1.15;\n height: 32px;\n position: relative;\n user-select: none;\n transition: opacity 0.3s ease;\n\n width: ${({ $width }) => $width}px;\n\n max-width: 100%;\n overflow-x: ${({ $isDisabled }) => ($isDisabled ? 'hidden' : 'scroll')};\n overflow-y: hidden;\n\n // Chrome\n &::-webkit-scrollbar {\n display: none;\n }\n\n // IE and Edge\n -ms-overflow-style: none;\n\n // Firefox\n scrollbar-width: none;\n`;\n\ntype StyledSliderButtonItemProps = WithTheme<{ $width: number }>;\n\nexport const StyledSliderButtonItem = styled.div<StyledSliderButtonItemProps>`\n font-size: 110%;\n font-family: 'Roboto Medium', serif;\n padding: 7px 12px;\n min-width: ${({ $width }) => $width}px;\n max-width: ${({ $width }) => $width}px;\n display: flex;\n white-space: nowrap;\n justify-content: center;\n color: white;\n`;\n\nexport const StyledSliderButtonPopupContent = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\ntype StyledSliderButtonPopupContentItemProps = WithTheme<{ $isSelected?: boolean }>;\n\nexport const StyledSliderButtonPopupContentItem = styled.div<StyledSliderButtonPopupContentItemProps>`\n font-size: 110%;\n font-family: 'Roboto Medium', serif;\n cursor: pointer;\n background-color: ${({ $isSelected, theme }: StyledSliderButtonPopupContentItemProps) =>\n $isSelected ? theme['secondary-102'] : undefined};\n padding: 4px 12px;\n`;\n\ntype StyledSliderButtonButtonsWrapperProps = WithTheme<{ $isInvisible?: boolean }>;\n\nexport const StyledSliderButtonButtonsWrapper = styled.div<StyledSliderButtonButtonsWrapperProps>`\n position: absolute;\n z-index: ${({ $isInvisible }) => ($isInvisible ? '2' : '4')};\n opacity: ${({ $isInvisible }) => ($isInvisible ? 0 : 1)};\n display: flex;\n cursor: pointer;\n align-items: center;\n pointer-events: ${({ $isInvisible }) => ($isInvisible ? 'auto' : 'none')};\n`;\n\ntype StyledMotionSliderButtonThumbProps = WithTheme<{ $width: number }>;\n\nexport const StyledMotionSliderButtonThumb = styled(motion.div)<StyledMotionSliderButtonThumbProps>`\n font-size: 110%;\n font-family: 'Roboto Medium', serif;\n background-color: ${({ theme }: StyledSliderButtonProps) => theme['405']};\n opacity: 1;\n width: ${({ $width }) => $width - 8}px;\n position: absolute;\n border-radius: 2px;\n top: 4px;\n left: 4px;\n white-space: nowrap;\n z-index: 3;\n height: 24px;\n padding: 7px 12px;\n display: flex;\n color: white;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKhC,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAGE,yBAAM,CAACC,GAA4B;AACrE,eAAe,CAAC;EAAEC;AAAY,CAAC,KAAMA,WAAW,GAAG,GAAG,GAAG,CAAE;AAC3D;AACA;AACA,CAAC;AAIM,MAAMC,yBAAyB,GAAAJ,OAAA,CAAAI,yBAAA,GAAGH,yBAAM,CAACC,GAAmC;AACnF;AACA,wBAAwB,CAAC;EAAEG;AAA0C,CAAC,KAAKA,KAAK,CAAC,KAAK,CAAC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,CAAC;EAAEC;AAAO,CAAC,KAAKA,MAAM;AACnC;AACA;AACA,kBAAkB,CAAC;EAAEH;AAAY,CAAC,KAAMA,WAAW,GAAG,QAAQ,GAAG,QAAS;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAIM,MAAMI,sBAAsB,GAAAP,OAAA,CAAAO,sBAAA,GAAGN,yBAAM,CAACC,GAAgC;AAC7E;AACA;AACA;AACA,iBAAiB,CAAC;EAAEI;AAAO,CAAC,KAAKA,MAAM;AACvC,iBAAiB,CAAC;EAAEA;AAAO,CAAC,KAAKA,MAAM;AACvC;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAME,8BAA8B,GAAAR,OAAA,CAAAQ,8BAAA,GAAGP,yBAAM,CAACC,GAAG;AACxD;AACA;AACA,CAAC;AAIM,MAAMO,kCAAkC,GAAAT,OAAA,CAAAS,kCAAA,GAAGR,yBAAM,CAACC,GAA4C;AACrG;AACA;AACA;AACA,wBAAwB,CAAC;EAAEQ,WAAW;EAAEL;AAA+C,CAAC,KAChFK,WAAW,GAAGL,KAAK,CAAC,eAAe,CAAC,GAAGM,SAAS;AACxD;AACA,CAAC;AAIM,MAAMC,gCAAgC,GAAAZ,OAAA,CAAAY,gCAAA,GAAGX,yBAAM,CAACC,GAA0C;AACjG;AACA,eAAe,CAAC;EAAEW;AAAa,CAAC,KAAMA,YAAY,GAAG,GAAG,GAAG,GAAI;AAC/D,eAAe,CAAC;EAAEA;AAAa,CAAC,KAAMA,YAAY,GAAG,CAAC,GAAG,CAAE;AAC3D;AACA;AACA;AACA,sBAAsB,CAAC;EAAEA;AAAa,CAAC,KAAMA,YAAY,GAAG,MAAM,GAAG,MAAO;AAC5E,CAAC;AAIM,MAAMC,6BAA6B,GAAAd,OAAA,CAAAc,6BAAA,GAAG,IAAAb,yBAAM,EAACc,oBAAM,CAACb,GAAG,CAAqC;AACnG;AACA;AACA,wBAAwB,CAAC;EAAEG;AAA+B,CAAC,KAAKA,KAAK,CAAC,KAAK,CAAC;AAC5E;AACA,aAAa,CAAC;EAAEC;AAAO,CAAC,KAAKA,MAAM,GAAG,CAAC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -129,6 +129,12 @@ Object.defineProperty(exports, "FileInput", {
|
|
|
129
129
|
return _FileInput.default;
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
|
+
Object.defineProperty(exports, "FilterButton", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _FilterButton.default;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
132
138
|
Object.defineProperty(exports, "FilterButtonItemShape", {
|
|
133
139
|
enumerable: true,
|
|
134
140
|
get: function () {
|
|
@@ -397,6 +403,7 @@ var _ContentCard = _interopRequireDefault(require("./components/content-card/Con
|
|
|
397
403
|
var _ContextMenu = _interopRequireDefault(require("./components/context-menu/ContextMenu"));
|
|
398
404
|
var _ExpandableContent = _interopRequireDefault(require("./components/expandable-content/ExpandableContent"));
|
|
399
405
|
var _FileInput = _interopRequireDefault(require("./components/file-input/FileInput"));
|
|
406
|
+
var _FilterButton = _interopRequireDefault(require("./components/filter-buttons/filter-button/FilterButton"));
|
|
400
407
|
var _FilterButtons = _interopRequireDefault(require("./components/filter-buttons/FilterButtons"));
|
|
401
408
|
var _GridImage = _interopRequireDefault(require("./components/grid-image/GridImage"));
|
|
402
409
|
var _Icon = _interopRequireDefault(require("./components/icon/Icon"));
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_AreaContextProvider","_interopRequireWildcard","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_ComboBox","_ContentCard","_ContextMenu","_ExpandableContent","_FileInput","_FilterButtons","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_MentionFinder","_NumberInput","_PageProvider","_Popup","_PopupContent","_ProgressBar","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SelectButton","_SetupWizardItem","_SetupWizard","_SharingBar","_Signature","_SliderButton","_Slider","_SmallWaitCursor","_TagInput","_TextArea","_Tooltip","_Truncation","_mentionFinder","_useElementSize","_comboBox","_contentCard","_contextMenu","_filterButtons","_truncation","_environment","_fileDialog","_isTobitEmployee","_pageProvider","_uploadFile","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type {\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport {\n default as ComboBox,\n type IComboBoxItem as ComboBoxItem,\n type IComboBoxItems as ComboBoxItems,\n} from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu, type ContextMenuRef } from './components/context-menu/ContextMenu';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport { default as FileInput, type FileInputRef } from './components/file-input/FileInput';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n} from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/useElementSize';\nexport { ComboBoxDirection } from './types/comboBox';\nexport { ContentCardType } from './types/contentCard';\nexport { ContextMenuAlignment } from './types/contextMenu';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport { ClampPosition } from './types/truncation';\nexport { getIsTouch } from './utils/environment';\nexport { getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,eAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,oBAAA,GAAAC,uBAAA,CAAAP,OAAA;AAIA,IAAAQ,MAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAA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IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAAA,SAAArE,uBAAA6D,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAI,UAAA,GAAAJ,CAAA,KAAAK,OAAA,EAAAL,CAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_AreaContextProvider","_interopRequireWildcard","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_ComboBox","_ContentCard","_ContextMenu","_ExpandableContent","_FileInput","_FilterButton","_FilterButtons","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_MentionFinder","_NumberInput","_PageProvider","_Popup","_PopupContent","_ProgressBar","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SelectButton","_SetupWizardItem","_SetupWizard","_SharingBar","_Signature","_SliderButton","_Slider","_SmallWaitCursor","_TagInput","_TextArea","_Tooltip","_Truncation","_mentionFinder","_useElementSize","_comboBox","_contentCard","_contextMenu","_filterButtons","_truncation","_environment","_fileDialog","_isTobitEmployee","_pageProvider","_uploadFile","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type {\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport {\n default as ComboBox,\n type IComboBoxItem as ComboBoxItem,\n type IComboBoxItems as ComboBoxItems,\n} from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu, type ContextMenuRef } from './components/context-menu/ContextMenu';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport { default as FileInput, type FileInputRef } from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n} from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/useElementSize';\nexport { ComboBoxDirection } from './types/comboBox';\nexport { ContentCardType } from './types/contentCard';\nexport { ContextMenuAlignment } from './types/contextMenu';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport { ClampPosition } from './types/truncation';\nexport { getIsTouch } from './utils/environment';\nexport { getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBA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,IAAAA,CAAA,CAAAI,UAAA,GAAAJ,CAAA,KAAAK,OAAA,EAAAL,CAAA","ignoreList":[]}
|
|
@@ -22,6 +22,9 @@ const SliderButton = _ref => {
|
|
|
22
22
|
const [sliderSize, setSliderSize] = useState({
|
|
23
23
|
width: 0
|
|
24
24
|
});
|
|
25
|
+
const [currentId, setCurrentId] = useState('');
|
|
26
|
+
const [currentPopupId, setCurrentPopupId] = useState('');
|
|
27
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
25
28
|
const sliderButtonRef = useRef(null);
|
|
26
29
|
const sliderButtonWrapperRef = useRef(null);
|
|
27
30
|
const popupRef = useRef(null);
|
|
@@ -31,14 +34,40 @@ const SliderButton = _ref => {
|
|
|
31
34
|
useEffect(() => {
|
|
32
35
|
if (elementSize) setSliderSize(elementSize);
|
|
33
36
|
}, [elementSize]);
|
|
37
|
+
const setPopupId = useCallback(selectedId => {
|
|
38
|
+
const ids = items.slice(shownItemsCount - 1).map(_ref2 => {
|
|
39
|
+
let {
|
|
40
|
+
id
|
|
41
|
+
} = _ref2;
|
|
42
|
+
return id;
|
|
43
|
+
});
|
|
44
|
+
const newId = ids.find(id => id === selectedId);
|
|
45
|
+
if (newId) {
|
|
46
|
+
setCurrentId('more');
|
|
47
|
+
setCurrentPopupId(newId);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
setCurrentId(selectedId);
|
|
51
|
+
}, [items, shownItemsCount]);
|
|
34
52
|
const isSliderBigger = useMemo(() => sliderSize && Math.floor(sliderSize.width / initialItemWidth) < items.length - 1, [initialItemWidth, items.length, sliderSize]);
|
|
53
|
+
const maxShownItemsCount = useMemo(() => {
|
|
54
|
+
let totalWidth = 0;
|
|
55
|
+
let count = 0;
|
|
56
|
+
while (count < items.length) {
|
|
57
|
+
const visibleItems = items.slice(0, count + 1);
|
|
58
|
+
const currentMaxWidth = calculateBiggestWidth(visibleItems) + 8;
|
|
59
|
+
if (totalWidth + currentMaxWidth > sliderSize.width) break;
|
|
60
|
+
totalWidth += currentMaxWidth;
|
|
61
|
+
count++;
|
|
62
|
+
}
|
|
63
|
+
return count;
|
|
64
|
+
}, [items, sliderSize.width]);
|
|
35
65
|
const itemWidth = useMemo(() => {
|
|
36
66
|
const sliderWidth = sliderSize?.width || 0;
|
|
37
|
-
const maxShownItemsCount = Math.floor(sliderWidth / initialItemWidth);
|
|
38
67
|
const itemCount = items.length || 1;
|
|
39
68
|
setShownItemsCount(isSliderBigger ? maxShownItemsCount : itemCount);
|
|
40
69
|
return sliderWidth / (isSliderBigger ? maxShownItemsCount : itemCount);
|
|
41
|
-
}, [
|
|
70
|
+
}, [isSliderBigger, items.length, maxShownItemsCount, sliderSize?.width]);
|
|
42
71
|
useEffect(() => {
|
|
43
72
|
if (sliderSize) {
|
|
44
73
|
const sliderWidth = itemWidth * (items.length - 1);
|
|
@@ -58,16 +87,19 @@ const SliderButton = _ref => {
|
|
|
58
87
|
});
|
|
59
88
|
}, [animate, scope]);
|
|
60
89
|
const setItemPosition = useCallback(index => {
|
|
90
|
+
setCurrentIndex(index);
|
|
61
91
|
void animation(itemWidth * index);
|
|
62
92
|
}, [animation, itemWidth]);
|
|
63
93
|
useEffect(() => {
|
|
64
94
|
if (typeof selectedButtonId === 'string') {
|
|
65
|
-
let index = items.findIndex(
|
|
95
|
+
let index = items.findIndex(_ref3 => {
|
|
66
96
|
let {
|
|
67
97
|
id
|
|
68
|
-
} =
|
|
98
|
+
} = _ref3;
|
|
69
99
|
return id === selectedButtonId;
|
|
70
100
|
});
|
|
101
|
+
setCurrentId(selectedButtonId);
|
|
102
|
+
setPopupId(selectedButtonId);
|
|
71
103
|
if (items.length > shownItemsCount && index > shownItemsCount - 1) {
|
|
72
104
|
index = shownItemsCount - 1;
|
|
73
105
|
}
|
|
@@ -75,11 +107,12 @@ const SliderButton = _ref => {
|
|
|
75
107
|
setItemPosition(index);
|
|
76
108
|
}
|
|
77
109
|
}
|
|
78
|
-
}, [animation, dragRange.right, isSliderBigger, itemWidth, items, selectedButtonId, setItemPosition, shownItemsCount]);
|
|
110
|
+
}, [animation, dragRange.right, isSliderBigger, itemWidth, items, selectedButtonId, setItemPosition, setPopupId, shownItemsCount]);
|
|
79
111
|
const handleClick = useCallback((id, index) => {
|
|
80
112
|
if (isDisabled) {
|
|
81
113
|
return;
|
|
82
114
|
}
|
|
115
|
+
setPopupId(id);
|
|
83
116
|
if (typeof onChange === 'function' && id !== 'more') {
|
|
84
117
|
onChange(id);
|
|
85
118
|
}
|
|
@@ -91,30 +124,31 @@ const SliderButton = _ref => {
|
|
|
91
124
|
}
|
|
92
125
|
}
|
|
93
126
|
setItemPosition(index);
|
|
94
|
-
}, [isDisabled, onChange, setItemPosition]);
|
|
127
|
+
}, [isDisabled, onChange, setItemPosition, setPopupId]);
|
|
95
128
|
const buttons = useMemo(() => {
|
|
96
129
|
if (items.length > shownItemsCount) {
|
|
97
130
|
const newItems = items.slice(0, shownItemsCount - 1);
|
|
98
131
|
const otherItems = items.slice(shownItemsCount - 1);
|
|
99
|
-
const elements = newItems.map((
|
|
132
|
+
const elements = newItems.map((_ref4, index) => {
|
|
100
133
|
let {
|
|
101
134
|
id,
|
|
102
135
|
text
|
|
103
|
-
} =
|
|
136
|
+
} = _ref4;
|
|
104
137
|
return /*#__PURE__*/React.createElement(StyledSliderButtonItem, {
|
|
105
138
|
$width: itemWidth,
|
|
106
139
|
key: `slider-button-${id}`,
|
|
107
140
|
onClick: () => handleClick(id, index)
|
|
108
141
|
}, text);
|
|
109
142
|
});
|
|
110
|
-
const popupContent = otherItems.map(
|
|
143
|
+
const popupContent = otherItems.map(_ref5 => {
|
|
111
144
|
let {
|
|
112
145
|
id,
|
|
113
146
|
text
|
|
114
|
-
} =
|
|
147
|
+
} = _ref5;
|
|
115
148
|
return /*#__PURE__*/React.createElement(StyledSliderButtonPopupContentItem, {
|
|
116
149
|
key: `slider-button-${id}`,
|
|
117
|
-
onClick: () => handleClick(id, newItems.length)
|
|
150
|
+
onClick: () => handleClick(id, newItems.length),
|
|
151
|
+
$isSelected: id === currentPopupId
|
|
118
152
|
}, text);
|
|
119
153
|
});
|
|
120
154
|
const id = 'more';
|
|
@@ -130,25 +164,25 @@ const SliderButton = _ref => {
|
|
|
130
164
|
}))));
|
|
131
165
|
return elements;
|
|
132
166
|
}
|
|
133
|
-
return items.map(
|
|
167
|
+
return items.map(_ref6 => {
|
|
134
168
|
let {
|
|
135
169
|
id,
|
|
136
170
|
text
|
|
137
|
-
} =
|
|
171
|
+
} = _ref6;
|
|
138
172
|
return /*#__PURE__*/React.createElement(StyledSliderButtonItem, {
|
|
139
173
|
$width: itemWidth,
|
|
140
174
|
key: `slider-button-${id}`
|
|
141
175
|
}, text);
|
|
142
176
|
});
|
|
143
|
-
}, [handleClick, itemWidth, items, shownItemsCount]);
|
|
177
|
+
}, [currentPopupId, handleClick, itemWidth, items, shownItemsCount]);
|
|
144
178
|
const pseudoButtons = useMemo(() => {
|
|
145
179
|
if (items.length > shownItemsCount) {
|
|
146
180
|
const newItems = items.slice(0, shownItemsCount - 1);
|
|
147
|
-
const elements = newItems.map((
|
|
181
|
+
const elements = newItems.map((_ref7, index) => {
|
|
148
182
|
let {
|
|
149
183
|
id,
|
|
150
184
|
text
|
|
151
|
-
} =
|
|
185
|
+
} = _ref7;
|
|
152
186
|
return /*#__PURE__*/React.createElement(StyledSliderButtonItem, {
|
|
153
187
|
$width: itemWidth,
|
|
154
188
|
key: `pseudo-slider-button-${id}`,
|
|
@@ -165,11 +199,11 @@ const SliderButton = _ref => {
|
|
|
165
199
|
})));
|
|
166
200
|
return elements;
|
|
167
201
|
}
|
|
168
|
-
return items.map((
|
|
202
|
+
return items.map((_ref8, index) => {
|
|
169
203
|
let {
|
|
170
204
|
id,
|
|
171
205
|
text
|
|
172
|
-
} =
|
|
206
|
+
} = _ref8;
|
|
173
207
|
return /*#__PURE__*/React.createElement(StyledSliderButtonItem, {
|
|
174
208
|
$width: itemWidth,
|
|
175
209
|
key: `pseudo-slider-button-${id}`,
|
|
@@ -188,6 +222,9 @@ const SliderButton = _ref => {
|
|
|
188
222
|
}
|
|
189
223
|
return points;
|
|
190
224
|
}, [itemWidth, items.length]);
|
|
225
|
+
const handleDragStart = useCallback(() => {
|
|
226
|
+
void setRefreshScrollEnabled(false);
|
|
227
|
+
}, []);
|
|
191
228
|
const handleDragEnd = useCallback(() => {
|
|
192
229
|
void setRefreshScrollEnabled(true);
|
|
193
230
|
const position = getThumbPosition({
|
|
@@ -260,12 +297,14 @@ const SliderButton = _ref => {
|
|
|
260
297
|
...dragRange
|
|
261
298
|
},
|
|
262
299
|
$width: itemWidth,
|
|
263
|
-
onDragEnd: handleDragEnd
|
|
300
|
+
onDragEnd: handleDragEnd,
|
|
301
|
+
onDragStart: handleDragStart,
|
|
302
|
+
onClick: () => handleClick(currentId, currentIndex)
|
|
264
303
|
}), /*#__PURE__*/React.createElement(StyledSliderButtonWrapper, {
|
|
265
304
|
$isDisabled: isDisabled,
|
|
266
305
|
$width: !isSliderBigger ? dragRange.right + itemWidth : dragRange.right,
|
|
267
306
|
ref: sliderButtonWrapperRef
|
|
268
|
-
}, /*#__PURE__*/React.createElement(AnimatePresence, null, /*#__PURE__*/React.createElement(StyledSliderButtonButtonsWrapper, null, buttons)))), [buttons, dragRange, handleDragEnd, isDisabled, isSliderBigger, itemWidth, pseudoButtons, scope]);
|
|
307
|
+
}, /*#__PURE__*/React.createElement(AnimatePresence, null, /*#__PURE__*/React.createElement(StyledSliderButtonButtonsWrapper, null, buttons)))), [buttons, currentId, currentIndex, dragRange, handleClick, handleDragEnd, handleDragStart, isDisabled, isSliderBigger, itemWidth, pseudoButtons, scope]);
|
|
269
308
|
};
|
|
270
309
|
SliderButton.displayName = 'SliderButton';
|
|
271
310
|
export default SliderButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderButton.js","names":["setRefreshScrollEnabled","AnimatePresence","useAnimate","React","useCallback","useEffect","useMemo","useRef","useState","useElementSize","calculateBiggestWidth","getNearestPoint","getThumbPosition","Icon","Popup","StyledMotionSliderButtonThumb","StyledSliderButton","StyledSliderButtonButtonsWrapper","StyledSliderButtonItem","StyledSliderButtonPopupContent","StyledSliderButtonPopupContentItem","StyledSliderButtonWrapper","SliderButton","_ref","selectedButtonId","isDisabled","items","onChange","dragRange","setDragRange","left","right","shownItemsCount","setShownItemsCount","length","sliderSize","setSliderSize","width","sliderButtonRef","sliderButtonWrapperRef","popupRef","scope","animate","initialItemWidth","elementSize","isSliderBigger","Math","floor","itemWidth","sliderWidth","maxShownItemsCount","itemCount","count","animation","x","current","type","duration","setItemPosition","index","findIndex","_ref2","id","handleClick","show","hide","buttons","newItems","slice","otherItems","elements","map","_ref3","text","createElement","$width","key","onClick","popupContent","_ref4","push","ref","content","icons","color","_ref5","pseudoButtons","_ref6","_ref7","snapPoints","points","i","handleDragEnd","position","middle","scrollLeft","nearestPoint","nearestIndex","$isDisabled","$isInvisible","drag","dragElastic","dragConstraints","onDragEnd","displayName"],"sources":["../../../../src/components/slider-button/SliderButton.tsx"],"sourcesContent":["import { setRefreshScrollEnabled } from 'chayns-api';\nimport { AnimatePresence, useAnimate } from 'framer-motion';\nimport React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useElementSize } from '../../hooks/useElementSize';\nimport { PopupRef } from '../../types/popup';\nimport type { SliderButtonItem } from '../../types/slider-button';\nimport { calculateBiggestWidth } from '../../utils/calculate';\nimport { getNearestPoint, getThumbPosition } from '../../utils/sliderButton';\nimport Icon from '../icon/Icon';\nimport Popup from '../popup/Popup';\nimport {\n StyledMotionSliderButtonThumb,\n StyledSliderButton,\n StyledSliderButtonButtonsWrapper,\n StyledSliderButtonItem,\n StyledSliderButtonPopupContent,\n StyledSliderButtonPopupContentItem,\n StyledSliderButtonWrapper,\n} from './SliderButton.styles';\n\nexport type SliderButtonProps = {\n /**\n * Whether the button is disabled.\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when a button is selected.\n * @param id\n */\n onChange?: (id: string) => void;\n /**\n * The buttons that are slidable.\n */\n items: SliderButtonItem[];\n /**\n * The id of a button that should be selected.\n */\n selectedButtonId?: string;\n};\n\nconst SliderButton: FC<SliderButtonProps> = ({ selectedButtonId, isDisabled, items, onChange }) => {\n const [dragRange, setDragRange] = useState({ left: 0, right: 0 });\n const [shownItemsCount, setShownItemsCount] = useState(items.length);\n const [sliderSize, setSliderSize] = useState({ width: 0 });\n\n const sliderButtonRef = useRef<HTMLDivElement>(null);\n const sliderButtonWrapperRef = useRef<HTMLDivElement>(null);\n const popupRef = useRef<PopupRef>(null);\n\n const [scope, animate] = useAnimate();\n\n const initialItemWidth = useMemo(() => calculateBiggestWidth(items), [items]);\n const elementSize = useElementSize(sliderButtonRef);\n\n useEffect(() => {\n if (elementSize) setSliderSize(elementSize);\n }, [elementSize]);\n\n const isSliderBigger = useMemo(\n () => sliderSize && Math.floor(sliderSize.width / initialItemWidth) < items.length - 1,\n [initialItemWidth, items.length, sliderSize],\n );\n\n const itemWidth = useMemo(() => {\n const sliderWidth = sliderSize?.width || 0;\n const maxShownItemsCount = Math.floor(sliderWidth / initialItemWidth);\n const itemCount = items.length || 1;\n\n setShownItemsCount(isSliderBigger ? maxShownItemsCount : itemCount);\n\n return sliderWidth / (isSliderBigger ? maxShownItemsCount : itemCount);\n }, [initialItemWidth, isSliderBigger, items.length, sliderSize?.width]);\n\n useEffect(() => {\n if (sliderSize) {\n const sliderWidth = itemWidth * (items.length - 1);\n\n const count = Math.floor(sliderSize.width / itemWidth);\n\n setDragRange({ left: 0, right: isSliderBigger ? itemWidth * count : sliderWidth });\n }\n }, [isSliderBigger, itemWidth, items.length, sliderSize]);\n\n const animation = useCallback(\n async (x: number) => {\n await animate(\n scope.current,\n { x },\n {\n type: 'tween',\n duration: 0.2,\n },\n );\n },\n [animate, scope],\n );\n\n const setItemPosition = useCallback(\n (index: number) => {\n void animation(itemWidth * index);\n },\n [animation, itemWidth],\n );\n\n useEffect(() => {\n if (typeof selectedButtonId === 'string') {\n let index = items.findIndex(({ id }) => id === selectedButtonId);\n\n if (items.length > shownItemsCount && index > shownItemsCount - 1) {\n index = shownItemsCount - 1;\n }\n\n if (index >= 0) {\n setItemPosition(index);\n }\n }\n }, [\n animation,\n dragRange.right,\n isSliderBigger,\n itemWidth,\n items,\n selectedButtonId,\n setItemPosition,\n shownItemsCount,\n ]);\n\n const handleClick = useCallback(\n (id: string, index: number) => {\n if (isDisabled) {\n return;\n }\n\n if (typeof onChange === 'function' && id !== 'more') {\n onChange(id);\n }\n\n if (popupRef.current) {\n if (id === 'more') {\n popupRef.current.show();\n } else {\n popupRef.current.hide();\n }\n }\n\n setItemPosition(index);\n },\n [isDisabled, onChange, setItemPosition],\n );\n\n const buttons = useMemo(() => {\n if (items.length > shownItemsCount) {\n const newItems = items.slice(0, shownItemsCount - 1);\n const otherItems = items.slice(shownItemsCount - 1);\n\n const elements = newItems.map(({ id, text }, index) => (\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n >\n {text}\n </StyledSliderButtonItem>\n ));\n\n const popupContent = otherItems.map(({ id, text }) => (\n <StyledSliderButtonPopupContentItem\n key={`slider-button-${id}`}\n onClick={() => handleClick(id, newItems.length)}\n >\n {text}\n </StyledSliderButtonPopupContentItem>\n ));\n\n const id = 'more';\n\n elements.push(\n <StyledSliderButtonItem $width={itemWidth} key={`slider-button-${id}`}>\n <Popup\n ref={popupRef}\n content={\n <StyledSliderButtonPopupContent>\n {popupContent}\n </StyledSliderButtonPopupContent>\n }\n >\n <Icon icons={['fa fa-ellipsis']} color=\"white\" />\n </Popup>\n </StyledSliderButtonItem>,\n );\n\n return elements;\n }\n return items.map(({ id, text }) => (\n <StyledSliderButtonItem $width={itemWidth} key={`slider-button-${id}`}>\n {text}\n </StyledSliderButtonItem>\n ));\n }, [handleClick, itemWidth, items, shownItemsCount]);\n\n const pseudoButtons = useMemo(() => {\n if (items.length > shownItemsCount) {\n const newItems = items.slice(0, shownItemsCount - 1);\n\n const elements = newItems.map(({ id, text }, index) => (\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`pseudo-slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n >\n {text}\n </StyledSliderButtonItem>\n ));\n\n const id = 'more';\n\n elements.push(\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`pseudo-slider-button-${id}`}\n onClick={() => handleClick(id, newItems.length)}\n >\n <Icon icons={['fa fa-ellipsis']} />\n </StyledSliderButtonItem>,\n );\n\n return elements;\n }\n return items.map(({ id, text }, index) => (\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`pseudo-slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n >\n {text}\n </StyledSliderButtonItem>\n ));\n }, [handleClick, itemWidth, items, shownItemsCount]);\n\n /**\n * Creates an array with the snap points relative to the width of the items\n */\n const snapPoints = useMemo(() => {\n const points = [0];\n\n for (let i = 1; i < items.length; i++) {\n points.push(itemWidth * i);\n }\n\n return points;\n }, [itemWidth, items.length]);\n\n const handleDragEnd = useCallback(() => {\n void setRefreshScrollEnabled(true);\n\n const position = getThumbPosition({ scope, itemWidth });\n\n if (!position) {\n return;\n }\n\n const { middle, left } = position;\n\n let scrollLeft = 0;\n\n if (sliderButtonWrapperRef.current) {\n scrollLeft = sliderButtonWrapperRef.current.scrollLeft;\n\n sliderButtonWrapperRef.current.scrollLeft = getNearestPoint({\n snapPoints,\n position: middle,\n scrollLeft: scrollLeft - left,\n }).nearestPoint;\n }\n\n const { nearestIndex } = getNearestPoint({\n snapPoints,\n position: middle,\n scrollLeft,\n });\n\n const { nearestPoint } = getNearestPoint({\n snapPoints,\n position: middle,\n scrollLeft: 0,\n });\n\n if (nearestPoint >= 0 && nearestIndex >= 0) {\n void animation(nearestPoint);\n\n let id;\n\n if (nearestIndex === shownItemsCount - 1) {\n id = 'more';\n } else {\n id = items[nearestIndex]?.id;\n }\n\n if (popupRef.current) {\n if (id === 'more') {\n popupRef.current.show();\n } else {\n popupRef.current.hide();\n }\n }\n\n if (typeof onChange === 'function' && id && id !== 'more') {\n onChange(id);\n }\n }\n }, [animation, itemWidth, items, onChange, scope, shownItemsCount, snapPoints]);\n\n return useMemo(\n () => (\n <StyledSliderButton $isDisabled={isDisabled} ref={sliderButtonRef}>\n <StyledSliderButtonButtonsWrapper $isInvisible>\n {pseudoButtons}\n </StyledSliderButtonButtonsWrapper>\n <StyledMotionSliderButtonThumb\n ref={scope}\n drag={isDisabled ? false : 'x'}\n dragElastic={0}\n dragConstraints={\n isSliderBigger\n ? { ...dragRange, right: dragRange.right - itemWidth }\n : { ...dragRange }\n }\n $width={itemWidth}\n onDragEnd={handleDragEnd}\n />\n <StyledSliderButtonWrapper\n $isDisabled={isDisabled}\n $width={!isSliderBigger ? dragRange.right + itemWidth : dragRange.right}\n ref={sliderButtonWrapperRef}\n >\n <AnimatePresence>\n <StyledSliderButtonButtonsWrapper>\n {buttons}\n </StyledSliderButtonButtonsWrapper>\n </AnimatePresence>\n </StyledSliderButtonWrapper>\n </StyledSliderButton>\n ),\n [\n buttons,\n dragRange,\n handleDragEnd,\n isDisabled,\n isSliderBigger,\n itemWidth,\n pseudoButtons,\n scope,\n ],\n );\n};\n\nSliderButton.displayName = 'SliderButton';\n\nexport default SliderButton;\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,YAAY;AACpD,SAASC,eAAe,EAAEC,UAAU,QAAQ,eAAe;AAC3D,OAAOC,KAAK,IAAQC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACpF,SAASC,cAAc,QAAQ,4BAA4B;AAG3D,SAASC,qBAAqB,QAAQ,uBAAuB;AAC7D,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,0BAA0B;AAC5E,OAAOC,IAAI,MAAM,cAAc;AAC/B,OAAOC,KAAK,MAAM,gBAAgB;AAClC,SACIC,6BAA6B,EAC7BC,kBAAkB,EAClBC,gCAAgC,EAChCC,sBAAsB,EACtBC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,CACM,CACX,CACvB,EACD,CACIA,OAAO,EACPtC,SAAS,EACTgE,aAAa,EACbnE,UAAU,EACVoB,cAAc,EACdG,SAAS,EACTsC,aAAa,EACb7C,KAAK,CAEb,CAAC;AACL,CAAC;AAEDnB,YAAY,CAACkF,WAAW,GAAG,cAAc;AAEzC,eAAelF,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"SliderButton.js","names":["setRefreshScrollEnabled","AnimatePresence","useAnimate","React","useCallback","useEffect","useMemo","useRef","useState","useElementSize","calculateBiggestWidth","getNearestPoint","getThumbPosition","Icon","Popup","StyledMotionSliderButtonThumb","StyledSliderButton","StyledSliderButtonButtonsWrapper","StyledSliderButtonItem","StyledSliderButtonPopupContent","StyledSliderButtonPopupContentItem","StyledSliderButtonWrapper","SliderButton","_ref","selectedButtonId","isDisabled","items","onChange","dragRange","setDragRange","left","right","shownItemsCount","setShownItemsCount","length","sliderSize","setSliderSize","width","currentId","setCurrentId","currentPopupId","setCurrentPopupId","currentIndex","setCurrentIndex","sliderButtonRef","sliderButtonWrapperRef","popupRef","scope","animate","initialItemWidth","elementSize","setPopupId","selectedId","ids","slice","map","_ref2","id","newId","find","isSliderBigger","Math","floor","maxShownItemsCount","totalWidth","count","visibleItems","currentMaxWidth","itemWidth","sliderWidth","itemCount","animation","x","current","type","duration","setItemPosition","index","findIndex","_ref3","handleClick","show","hide","buttons","newItems","otherItems","elements","_ref4","text","createElement","$width","key","onClick","popupContent","_ref5","$isSelected","push","ref","content","icons","color","_ref6","pseudoButtons","_ref7","_ref8","snapPoints","points","i","handleDragStart","handleDragEnd","position","middle","scrollLeft","nearestPoint","nearestIndex","$isDisabled","$isInvisible","drag","dragElastic","dragConstraints","onDragEnd","onDragStart","displayName"],"sources":["../../../../src/components/slider-button/SliderButton.tsx"],"sourcesContent":["import { setRefreshScrollEnabled } from 'chayns-api';\nimport { AnimatePresence, useAnimate } from 'framer-motion';\nimport React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useElementSize } from '../../hooks/useElementSize';\nimport { PopupRef } from '../../types/popup';\nimport type { SliderButtonItem } from '../../types/slider-button';\nimport { calculateBiggestWidth } from '../../utils/calculate';\nimport { getNearestPoint, getThumbPosition } from '../../utils/sliderButton';\nimport Icon from '../icon/Icon';\nimport Popup from '../popup/Popup';\nimport {\n StyledMotionSliderButtonThumb,\n StyledSliderButton,\n StyledSliderButtonButtonsWrapper,\n StyledSliderButtonItem,\n StyledSliderButtonPopupContent,\n StyledSliderButtonPopupContentItem,\n StyledSliderButtonWrapper,\n} from './SliderButton.styles';\n\nexport type SliderButtonProps = {\n /**\n * Whether the button is disabled.\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when a button is selected.\n * @param id\n */\n onChange?: (id: string) => void;\n /**\n * The buttons that are slidable.\n */\n items: SliderButtonItem[];\n /**\n * The id of a button that should be selected.\n */\n selectedButtonId?: string;\n};\n\nconst SliderButton: FC<SliderButtonProps> = ({ selectedButtonId, isDisabled, items, onChange }) => {\n const [dragRange, setDragRange] = useState({ left: 0, right: 0 });\n const [shownItemsCount, setShownItemsCount] = useState(items.length);\n const [sliderSize, setSliderSize] = useState({ width: 0 });\n const [currentId, setCurrentId] = useState('');\n const [currentPopupId, setCurrentPopupId] = useState('');\n const [currentIndex, setCurrentIndex] = useState(0);\n\n const sliderButtonRef = useRef<HTMLDivElement>(null);\n const sliderButtonWrapperRef = useRef<HTMLDivElement>(null);\n const popupRef = useRef<PopupRef>(null);\n\n const [scope, animate] = useAnimate();\n\n const initialItemWidth = useMemo(() => calculateBiggestWidth(items), [items]);\n const elementSize = useElementSize(sliderButtonRef);\n\n useEffect(() => {\n if (elementSize) setSliderSize(elementSize);\n }, [elementSize]);\n\n const setPopupId = useCallback(\n (selectedId: string) => {\n const ids = items.slice(shownItemsCount - 1).map(({ id }) => id);\n\n const newId = ids.find((id) => id === selectedId);\n\n if (newId) {\n setCurrentId('more');\n setCurrentPopupId(newId);\n\n return;\n }\n\n setCurrentId(selectedId);\n },\n [items, shownItemsCount],\n );\n\n const isSliderBigger = useMemo(\n () => sliderSize && Math.floor(sliderSize.width / initialItemWidth) < items.length - 1,\n [initialItemWidth, items.length, sliderSize],\n );\n\n const maxShownItemsCount = useMemo(() => {\n let totalWidth = 0;\n let count = 0;\n\n while (count < items.length) {\n const visibleItems = items.slice(0, count + 1);\n const currentMaxWidth = calculateBiggestWidth(visibleItems) + 8;\n\n if (totalWidth + currentMaxWidth > sliderSize.width) break;\n\n totalWidth += currentMaxWidth;\n count++;\n }\n\n return count;\n }, [items, sliderSize.width]);\n\n const itemWidth = useMemo(() => {\n const sliderWidth = sliderSize?.width || 0;\n const itemCount = items.length || 1;\n\n setShownItemsCount(isSliderBigger ? maxShownItemsCount : itemCount);\n\n return sliderWidth / (isSliderBigger ? maxShownItemsCount : itemCount);\n }, [isSliderBigger, items.length, maxShownItemsCount, sliderSize?.width]);\n\n useEffect(() => {\n if (sliderSize) {\n const sliderWidth = itemWidth * (items.length - 1);\n\n const count = Math.floor(sliderSize.width / itemWidth);\n\n setDragRange({ left: 0, right: isSliderBigger ? itemWidth * count : sliderWidth });\n }\n }, [isSliderBigger, itemWidth, items.length, sliderSize]);\n\n const animation = useCallback(\n async (x: number) => {\n await animate(\n scope.current,\n { x },\n {\n type: 'tween',\n duration: 0.2,\n },\n );\n },\n [animate, scope],\n );\n\n const setItemPosition = useCallback(\n (index: number) => {\n setCurrentIndex(index);\n\n void animation(itemWidth * index);\n },\n [animation, itemWidth],\n );\n\n useEffect(() => {\n if (typeof selectedButtonId === 'string') {\n let index = items.findIndex(({ id }) => id === selectedButtonId);\n\n setCurrentId(selectedButtonId);\n\n setPopupId(selectedButtonId);\n\n if (items.length > shownItemsCount && index > shownItemsCount - 1) {\n index = shownItemsCount - 1;\n }\n\n if (index >= 0) {\n setItemPosition(index);\n }\n }\n }, [\n animation,\n dragRange.right,\n isSliderBigger,\n itemWidth,\n items,\n selectedButtonId,\n setItemPosition,\n setPopupId,\n shownItemsCount,\n ]);\n\n const handleClick = useCallback(\n (id: string, index: number) => {\n if (isDisabled) {\n return;\n }\n\n setPopupId(id);\n\n if (typeof onChange === 'function' && id !== 'more') {\n onChange(id);\n }\n\n if (popupRef.current) {\n if (id === 'more') {\n popupRef.current.show();\n } else {\n popupRef.current.hide();\n }\n }\n\n setItemPosition(index);\n },\n [isDisabled, onChange, setItemPosition, setPopupId],\n );\n\n const buttons = useMemo(() => {\n if (items.length > shownItemsCount) {\n const newItems = items.slice(0, shownItemsCount - 1);\n const otherItems = items.slice(shownItemsCount - 1);\n\n const elements = newItems.map(({ id, text }, index) => (\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n >\n {text}\n </StyledSliderButtonItem>\n ));\n\n const popupContent = otherItems.map(({ id, text }) => (\n <StyledSliderButtonPopupContentItem\n key={`slider-button-${id}`}\n onClick={() => handleClick(id, newItems.length)}\n $isSelected={id === currentPopupId}\n >\n {text}\n </StyledSliderButtonPopupContentItem>\n ));\n\n const id = 'more';\n\n elements.push(\n <StyledSliderButtonItem $width={itemWidth} key={`slider-button-${id}`}>\n <Popup\n ref={popupRef}\n content={\n <StyledSliderButtonPopupContent>\n {popupContent}\n </StyledSliderButtonPopupContent>\n }\n >\n <Icon icons={['fa fa-ellipsis']} color=\"white\" />\n </Popup>\n </StyledSliderButtonItem>,\n );\n\n return elements;\n }\n return items.map(({ id, text }) => (\n <StyledSliderButtonItem $width={itemWidth} key={`slider-button-${id}`}>\n {text}\n </StyledSliderButtonItem>\n ));\n }, [currentPopupId, handleClick, itemWidth, items, shownItemsCount]);\n\n const pseudoButtons = useMemo(() => {\n if (items.length > shownItemsCount) {\n const newItems = items.slice(0, shownItemsCount - 1);\n\n const elements = newItems.map(({ id, text }, index) => (\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`pseudo-slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n >\n {text}\n </StyledSliderButtonItem>\n ));\n\n const id = 'more';\n\n elements.push(\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`pseudo-slider-button-${id}`}\n onClick={() => handleClick(id, newItems.length)}\n >\n <Icon icons={['fa fa-ellipsis']} />\n </StyledSliderButtonItem>,\n );\n\n return elements;\n }\n return items.map(({ id, text }, index) => (\n <StyledSliderButtonItem\n $width={itemWidth}\n key={`pseudo-slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n >\n {text}\n </StyledSliderButtonItem>\n ));\n }, [handleClick, itemWidth, items, shownItemsCount]);\n\n /**\n * Creates an array with the snap points relative to the width of the items\n */\n const snapPoints = useMemo(() => {\n const points = [0];\n\n for (let i = 1; i < items.length; i++) {\n points.push(itemWidth * i);\n }\n\n return points;\n }, [itemWidth, items.length]);\n\n const handleDragStart = useCallback(() => {\n void setRefreshScrollEnabled(false);\n }, []);\n\n const handleDragEnd = useCallback(() => {\n void setRefreshScrollEnabled(true);\n\n const position = getThumbPosition({ scope, itemWidth });\n\n if (!position) {\n return;\n }\n\n const { middle, left } = position;\n\n let scrollLeft = 0;\n\n if (sliderButtonWrapperRef.current) {\n scrollLeft = sliderButtonWrapperRef.current.scrollLeft;\n\n sliderButtonWrapperRef.current.scrollLeft = getNearestPoint({\n snapPoints,\n position: middle,\n scrollLeft: scrollLeft - left,\n }).nearestPoint;\n }\n\n const { nearestIndex } = getNearestPoint({\n snapPoints,\n position: middle,\n scrollLeft,\n });\n\n const { nearestPoint } = getNearestPoint({\n snapPoints,\n position: middle,\n scrollLeft: 0,\n });\n\n if (nearestPoint >= 0 && nearestIndex >= 0) {\n void animation(nearestPoint);\n\n let id;\n\n if (nearestIndex === shownItemsCount - 1) {\n id = 'more';\n } else {\n id = items[nearestIndex]?.id;\n }\n\n if (popupRef.current) {\n if (id === 'more') {\n popupRef.current.show();\n } else {\n popupRef.current.hide();\n }\n }\n\n if (typeof onChange === 'function' && id && id !== 'more') {\n onChange(id);\n }\n }\n }, [animation, itemWidth, items, onChange, scope, shownItemsCount, snapPoints]);\n\n return useMemo(\n () => (\n <StyledSliderButton $isDisabled={isDisabled} ref={sliderButtonRef}>\n <StyledSliderButtonButtonsWrapper $isInvisible>\n {pseudoButtons}\n </StyledSliderButtonButtonsWrapper>\n <StyledMotionSliderButtonThumb\n ref={scope}\n drag={isDisabled ? false : 'x'}\n dragElastic={0}\n dragConstraints={\n isSliderBigger\n ? { ...dragRange, right: dragRange.right - itemWidth }\n : { ...dragRange }\n }\n $width={itemWidth}\n onDragEnd={handleDragEnd}\n onDragStart={handleDragStart}\n onClick={() => handleClick(currentId, currentIndex)}\n />\n <StyledSliderButtonWrapper\n $isDisabled={isDisabled}\n $width={!isSliderBigger ? dragRange.right + itemWidth : dragRange.right}\n ref={sliderButtonWrapperRef}\n >\n <AnimatePresence>\n <StyledSliderButtonButtonsWrapper>\n {buttons}\n </StyledSliderButtonButtonsWrapper>\n </AnimatePresence>\n </StyledSliderButtonWrapper>\n </StyledSliderButton>\n ),\n [\n buttons,\n currentId,\n currentIndex,\n dragRange,\n handleClick,\n handleDragEnd,\n handleDragStart,\n isDisabled,\n isSliderBigger,\n itemWidth,\n pseudoButtons,\n scope,\n ],\n );\n};\n\nSliderButton.displayName = 'SliderButton';\n\nexport default SliderButton;\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,YAAY;AACpD,SAASC,eAAe,EAAEC,UAAU,QAAQ,eAAe;AAC3D,OAAOC,KAAK,IAAQC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACpF,SAASC,cAAc,QAAQ,4BAA4B;AAG3D,SAASC,qBAAqB,QAAQ,uBAAuB;AAC7D,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,0BAA0B;AAC5E,OAAOC,IAAI,MAAM,cAAc;AAC/B,OAAOC,KAAK,MAAM,gBAAgB;AAClC,SACIC,6BAA6B,EAC7BC,kBAAkB,EAClBC,gCAAgC,EAChCC,sBAAsB,EACtBC,8BAA8B,EAC9BC,kCAAkC,EAClC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;MAAE,GAAGxC;IAAU,CACxB;IACD8D,MAAM,EAAEtB,SAAU;IAClBoD,SAAS,EAAEX,aAAc;IACzBY,WAAW,EAAEb,eAAgB;IAC7BhB,OAAO,EAAEA,CAAA,KAAMZ,WAAW,CAAC1C,SAAS,EAAEI,YAAY;EAAE,CACvD,CAAC,eACFvC,KAAA,CAAAsF,aAAA,CAACpE,yBAAyB;IACtB8F,WAAW,EAAE1F,UAAW;IACxBiE,MAAM,EAAE,CAAC9B,cAAc,GAAGhC,SAAS,CAACG,KAAK,GAAGqC,SAAS,GAAGxC,SAAS,CAACG,KAAM;IACxEkE,GAAG,EAAEpD;EAAuB,gBAE5B1C,KAAA,CAAAsF,aAAA,CAACxF,eAAe,qBACZE,KAAA,CAAAsF,aAAA,CAACxE,gCAAgC,QAC5BkE,OAC6B,CACrB,CACM,CACX,CACvB,EACD,CACIA,OAAO,EACP7C,SAAS,EACTI,YAAY,EACZd,SAAS,EACToD,WAAW,EACX6B,aAAa,EACbD,eAAe,EACfnF,UAAU,EACVmC,cAAc,EACdQ,SAAS,EACTkC,aAAa,EACbvD,KAAK,CAEb,CAAC;AACL,CAAC;AAEDzB,YAAY,CAACoG,WAAW,GAAG,cAAc;AAEzC,eAAepG,YAAY","ignoreList":[]}
|
|
@@ -80,51 +80,58 @@ export const StyledSliderButtonItem = styled.div`
|
|
|
80
80
|
export const StyledSliderButtonPopupContent = styled.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
flex-direction: column;
|
|
83
|
-
padding: 7px 12px;
|
|
84
83
|
`;
|
|
85
84
|
export const StyledSliderButtonPopupContentItem = styled.div`
|
|
86
85
|
font-size: 110%;
|
|
87
86
|
font-family: 'Roboto Medium', serif;
|
|
88
87
|
cursor: pointer;
|
|
88
|
+
background-color: ${_ref7 => {
|
|
89
|
+
let {
|
|
90
|
+
$isSelected,
|
|
91
|
+
theme
|
|
92
|
+
} = _ref7;
|
|
93
|
+
return $isSelected ? theme['secondary-102'] : undefined;
|
|
94
|
+
}};
|
|
95
|
+
padding: 4px 12px;
|
|
89
96
|
`;
|
|
90
97
|
export const StyledSliderButtonButtonsWrapper = styled.div`
|
|
91
98
|
position: absolute;
|
|
92
|
-
z-index: ${
|
|
99
|
+
z-index: ${_ref8 => {
|
|
93
100
|
let {
|
|
94
101
|
$isInvisible
|
|
95
|
-
} =
|
|
102
|
+
} = _ref8;
|
|
96
103
|
return $isInvisible ? '2' : '4';
|
|
97
104
|
}};
|
|
98
|
-
opacity: ${
|
|
105
|
+
opacity: ${_ref9 => {
|
|
99
106
|
let {
|
|
100
107
|
$isInvisible
|
|
101
|
-
} =
|
|
108
|
+
} = _ref9;
|
|
102
109
|
return $isInvisible ? 0 : 1;
|
|
103
110
|
}};
|
|
104
111
|
display: flex;
|
|
105
112
|
cursor: pointer;
|
|
106
113
|
align-items: center;
|
|
107
|
-
pointer-events: ${
|
|
114
|
+
pointer-events: ${_ref10 => {
|
|
108
115
|
let {
|
|
109
116
|
$isInvisible
|
|
110
|
-
} =
|
|
117
|
+
} = _ref10;
|
|
111
118
|
return $isInvisible ? 'auto' : 'none';
|
|
112
119
|
}};
|
|
113
120
|
`;
|
|
114
121
|
export const StyledMotionSliderButtonThumb = styled(motion.div)`
|
|
115
122
|
font-size: 110%;
|
|
116
123
|
font-family: 'Roboto Medium', serif;
|
|
117
|
-
background-color: ${
|
|
124
|
+
background-color: ${_ref11 => {
|
|
118
125
|
let {
|
|
119
126
|
theme
|
|
120
|
-
} =
|
|
127
|
+
} = _ref11;
|
|
121
128
|
return theme['405'];
|
|
122
129
|
}};
|
|
123
130
|
opacity: 1;
|
|
124
|
-
width: ${
|
|
131
|
+
width: ${_ref12 => {
|
|
125
132
|
let {
|
|
126
133
|
$width
|
|
127
|
-
} =
|
|
134
|
+
} = _ref12;
|
|
128
135
|
return $width - 8;
|
|
129
136
|
}}px;
|
|
130
137
|
position: absolute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderButton.styles.js","names":["motion","styled","StyledSliderButton","div","_ref","$isDisabled","StyledSliderButtonWrapper","_ref2","theme","_ref3","$width","_ref4","StyledSliderButtonItem","_ref5","_ref6","StyledSliderButtonPopupContent","StyledSliderButtonPopupContentItem","StyledSliderButtonButtonsWrapper","
|
|
1
|
+
{"version":3,"file":"SliderButton.styles.js","names":["motion","styled","StyledSliderButton","div","_ref","$isDisabled","StyledSliderButtonWrapper","_ref2","theme","_ref3","$width","_ref4","StyledSliderButtonItem","_ref5","_ref6","StyledSliderButtonPopupContent","StyledSliderButtonPopupContentItem","_ref7","$isSelected","undefined","StyledSliderButtonButtonsWrapper","_ref8","$isInvisible","_ref9","_ref10","StyledMotionSliderButtonThumb","_ref11","_ref12"],"sources":["../../../../src/components/slider-button/SliderButton.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledSliderButtonProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledSliderButton = styled.div<StyledSliderButtonProps>`\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n width: 100%;\n touch-action: none;\n`;\n\ntype StyledSliderButtonWrapperProps = WithTheme<{ $width: number; $isDisabled?: boolean }>;\n\nexport const StyledSliderButtonWrapper = styled.div<StyledSliderButtonWrapperProps>`\n align-items: center;\n background-color: ${({ theme }: StyledMotionSliderButtonThumbProps) => theme['408']};\n border-radius: 3px;\n border: none;\n color: white;\n cursor: pointer;\n display: inline-flex;\n line-height: 1.15;\n height: 32px;\n position: relative;\n user-select: none;\n transition: opacity 0.3s ease;\n\n width: ${({ $width }) => $width}px;\n\n max-width: 100%;\n overflow-x: ${({ $isDisabled }) => ($isDisabled ? 'hidden' : 'scroll')};\n overflow-y: hidden;\n\n // Chrome\n &::-webkit-scrollbar {\n display: none;\n }\n\n // IE and Edge\n -ms-overflow-style: none;\n\n // Firefox\n scrollbar-width: none;\n`;\n\ntype StyledSliderButtonItemProps = WithTheme<{ $width: number }>;\n\nexport const StyledSliderButtonItem = styled.div<StyledSliderButtonItemProps>`\n font-size: 110%;\n font-family: 'Roboto Medium', serif;\n padding: 7px 12px;\n min-width: ${({ $width }) => $width}px;\n max-width: ${({ $width }) => $width}px;\n display: flex;\n white-space: nowrap;\n justify-content: center;\n color: white;\n`;\n\nexport const StyledSliderButtonPopupContent = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\ntype StyledSliderButtonPopupContentItemProps = WithTheme<{ $isSelected?: boolean }>;\n\nexport const StyledSliderButtonPopupContentItem = styled.div<StyledSliderButtonPopupContentItemProps>`\n font-size: 110%;\n font-family: 'Roboto Medium', serif;\n cursor: pointer;\n background-color: ${({ $isSelected, theme }: StyledSliderButtonPopupContentItemProps) =>\n $isSelected ? theme['secondary-102'] : undefined};\n padding: 4px 12px;\n`;\n\ntype StyledSliderButtonButtonsWrapperProps = WithTheme<{ $isInvisible?: boolean }>;\n\nexport const StyledSliderButtonButtonsWrapper = styled.div<StyledSliderButtonButtonsWrapperProps>`\n position: absolute;\n z-index: ${({ $isInvisible }) => ($isInvisible ? '2' : '4')};\n opacity: ${({ $isInvisible }) => ($isInvisible ? 0 : 1)};\n display: flex;\n cursor: pointer;\n align-items: center;\n pointer-events: ${({ $isInvisible }) => ($isInvisible ? 'auto' : 'none')};\n`;\n\ntype StyledMotionSliderButtonThumbProps = WithTheme<{ $width: number }>;\n\nexport const StyledMotionSliderButtonThumb = styled(motion.div)<StyledMotionSliderButtonThumbProps>`\n font-size: 110%;\n font-family: 'Roboto Medium', serif;\n background-color: ${({ theme }: StyledSliderButtonProps) => theme['405']};\n opacity: 1;\n width: ${({ $width }) => $width - 8}px;\n position: absolute;\n border-radius: 2px;\n top: 4px;\n left: 4px;\n white-space: nowrap;\n z-index: 3;\n height: 24px;\n padding: 7px 12px;\n display: flex;\n color: white;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n`;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,eAAe;AACtC,O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GAAAS,KAAA;EAAA,OAChFC,WAAW,GAAGV,KAAK,CAAC,eAAe,CAAC,GAAGW,SAAS;AAAA;AACxD;AACA,CAAC;AAID,OAAO,MAAMC,gCAAgC,GAAGnB,MAAM,CAACE,GAA0C;AACjG;AACA,eAAekB,KAAA;EAAA,IAAC;IAAEC;EAAa,CAAC,GAAAD,KAAA;EAAA,OAAMC,YAAY,GAAG,GAAG,GAAG,GAAG;AAAA,CAAC;AAC/D,eAAeC,KAAA;EAAA,IAAC;IAAED;EAAa,CAAC,GAAAC,KAAA;EAAA,OAAMD,YAAY,GAAG,CAAC,GAAG,CAAC;AAAA,CAAC;AAC3D;AACA;AACA;AACA,sBAAsBE,MAAA;EAAA,IAAC;IAAEF;EAAa,CAAC,GAAAE,MAAA;EAAA,OAAMF,YAAY,GAAG,MAAM,GAAG,MAAM;AAAA,CAAC;AAC5E,CAAC;AAID,OAAO,MAAMG,6BAA6B,GAAGxB,MAAM,CAACD,MAAM,CAACG,GAAG,CAAqC;AACnG;AACA;AACA,wBAAwBuB,MAAA;EAAA,IAAC;IAAElB;EAA+B,CAAC,GAAAkB,MAAA;EAAA,OAAKlB,KAAK,CAAC,KAAK,CAAC;AAAA;AAC5E;AACA,aAAamB,MAAA;EAAA,IAAC;IAAEjB;EAAO,CAAC,GAAAiB,MAAA;EAAA,OAAKjB,MAAM,GAAG,CAAC;AAAA;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
package/lib/esm/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { default as ContentCard } from './components/content-card/ContentCard';
|
|
|
15
15
|
export { default as ContextMenu } from './components/context-menu/ContextMenu';
|
|
16
16
|
export { default as ExpandableContent } from './components/expandable-content/ExpandableContent';
|
|
17
17
|
export { default as FileInput } from './components/file-input/FileInput';
|
|
18
|
+
export { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';
|
|
18
19
|
export { default as FilterButtons } from './components/filter-buttons/FilterButtons';
|
|
19
20
|
export { default as GridImage } from './components/grid-image/GridImage';
|
|
20
21
|
export { default as Icon } from './components/icon/Icon';
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","Accordion","AccordionContent","AccordionGroup","AccordionIntro","AccordionItem","AmountControl","AreaContext","AreaProvider","Badge","Button","Checkbox","ColorSchemeProvider","ComboBox","ContentCard","ContextMenu","ExpandableContent","FileInput","FilterButtons","GridImage","Icon","Input","List","ListItemContent","ListItem","MentionFinder","NumberInput","PageProvider","Popup","PopupContent","ProgressBar","RadioButtonGroup","RadioButton","ScrollView","SearchBox","SearchInput","SelectButton","SetupWizardItem","SetupWizard","SharingBar","Signature","SliderButton","Slider","SmallWaitCursor","SmallWaitCursorSize","SmallWaitCursorSpeed","TagInput","TextArea","Tooltip","Truncation","MentionFinderPopupAlignment","useElementSize","ComboBoxDirection","ContentCardType","ContextMenuAlignment","FilterButtonItemShape","FilterButtonSize","ClampPosition","getIsTouch","getFileAsArrayBuffer","selectFiles","isTobitEmployee","getUsableHeight","uploadFile"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type {\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport {\n default as ComboBox,\n type IComboBoxItem as ComboBoxItem,\n type IComboBoxItems as ComboBoxItems,\n} from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu, type ContextMenuRef } from './components/context-menu/ContextMenu';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport { default as FileInput, type FileInputRef } from './components/file-input/FileInput';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n} from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/useElementSize';\nexport { ComboBoxDirection } from './types/comboBox';\nexport { ContentCardType } from './types/contentCard';\nexport { ContextMenuAlignment } from './types/contextMenu';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport { ClampPosition } from './types/truncation';\nexport { getIsTouch } from './utils/environment';\nexport { getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\n"],"mappings":"AAAA;AACA,SAASA,OAAO,IAAIC,SAAS,QAAQ,kCAAkC;AACvE,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,2DAA2D;AACvG,SAASF,OAAO,IAAIG,cAAc,QAAQ,uDAAuD;AACjG,SAASH,OAAO,IAAII,cAAc,QAAQ,uDAAuD;AACjG,SAASJ,OAAO,IAAIK,aAAa,QAAQ,qDAAqD;AAC9F,SAASL,OAAO,IAAIM,aAAa,QAAQ,2CAA2C;AACpF,SACIC,WAAW,EACXP,OAAO,IAAIQ,YAAY,QACpB,gDAAgD;AACvD,SAASR,OAAO,IAAIS,KAAK,QAAQ,0BAA0B;AAC3D,SAAST,OAAO,IAAIU,MAAM,QAAQ,4BAA4B;AAC9D,SAASV,OAAO,IAAIW,QAAQ,QAAQ,gCAAgC;AACpE,SAASX,OAAO,IAAIY,mBAAmB,QAAQ,wDAAwD;AAKvG,SACIZ,OAAO,IAAIa,QAAQ,QAGhB,gCAAgC;AACvC,SAASb,OAAO,IAAIc,WAAW,QAAQ,uCAAuC;AAC9E,SAASd,OAAO,IAAIe,WAAW,QAA6B,uCAAuC;AACnG,SAASf,OAAO,IAAIgB,iBAAiB,QAAQ,mDAAmD;AAChG,SAAShB,OAAO,IAAIiB,SAAS,QAA2B,mCAAmC;AAC3F,SAASjB,OAAO,IAAIkB,aAAa,QAAQ,2CAA2C;AACpF,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","Accordion","AccordionContent","AccordionGroup","AccordionIntro","AccordionItem","AmountControl","AreaContext","AreaProvider","Badge","Button","Checkbox","ColorSchemeProvider","ComboBox","ContentCard","ContextMenu","ExpandableContent","FileInput","FilterButton","FilterButtons","GridImage","Icon","Input","List","ListItemContent","ListItem","MentionFinder","NumberInput","PageProvider","Popup","PopupContent","ProgressBar","RadioButtonGroup","RadioButton","ScrollView","SearchBox","SearchInput","SelectButton","SetupWizardItem","SetupWizard","SharingBar","Signature","SliderButton","Slider","SmallWaitCursor","SmallWaitCursorSize","SmallWaitCursorSpeed","TagInput","TextArea","Tooltip","Truncation","MentionFinderPopupAlignment","useElementSize","ComboBoxDirection","ContentCardType","ContextMenuAlignment","FilterButtonItemShape","FilterButtonSize","ClampPosition","getIsTouch","getFileAsArrayBuffer","selectFiles","isTobitEmployee","getUsableHeight","uploadFile"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type {\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport {\n default as ComboBox,\n type IComboBoxItem as ComboBoxItem,\n type IComboBoxItems as ComboBoxItems,\n} from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu, type ContextMenuRef } from './components/context-menu/ContextMenu';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport { default as FileInput, type FileInputRef } from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n} from './components/list/list-item/ListItem';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/useElementSize';\nexport { ComboBoxDirection } from './types/comboBox';\nexport { ContentCardType } from './types/contentCard';\nexport { ContextMenuAlignment } from './types/contextMenu';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport { ClampPosition } from './types/truncation';\nexport { getIsTouch } from './utils/environment';\nexport { getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\n"],"mappings":"AAAA;AACA,SAASA,OAAO,IAAIC,SAAS,QAAQ,kCAAkC;AACvE,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,2DAA2D;AACvG,SAASF,OAAO,IAAIG,cAAc,QAAQ,uDAAuD;AACjG,SAASH,OAAO,IAAII,cAAc,QAAQ,uDAAuD;AACjG,SAASJ,OAAO,IAAIK,aAAa,QAAQ,qDAAqD;AAC9F,SAASL,OAAO,IAAIM,aAAa,QAAQ,2CAA2C;AACpF,SACIC,WAAW,EACXP,OAAO,IAAIQ,YAAY,QACpB,gDAAgD;AACvD,SAASR,OAAO,IAAIS,KAAK,QAAQ,0BAA0B;AAC3D,SAAST,OAAO,IAAIU,MAAM,QAAQ,4BAA4B;AAC9D,SAASV,OAAO,IAAIW,QAAQ,QAAQ,gCAAgC;AACpE,SAASX,OAAO,IAAIY,mBAAmB,QAAQ,wDAAwD;AAKvG,SACIZ,OAAO,IAAIa,QAAQ,QAGhB,gCAAgC;AACvC,SAASb,OAAO,IAAIc,WAAW,QAAQ,uCAAuC;AAC9E,SAASd,OAAO,IAAIe,WAAW,QAA6B,uCAAuC;AACnG,SAASf,OAAO,IAAIgB,iBAAiB,QAAQ,mDAAmD;AAChG,SAAShB,OAAO,IAAIiB,SAAS,QAA2B,mCAAmC;AAC3F,SAASjB,OAAO,IAAIkB,YAAY,QAAQ,wDAAwD;AAChG,SAASlB,OAAO,IAAImB,aAAa,QAAQ,2CAA2C;AACpF,SAASnB,OAAO,IAAIoB,SAAS,QAAQ,mCAAmC;AACxE,SAASpB,OAAO,IAAIqB,IAAI,QAAQ,wBAAwB;AACxD,SAASrB,OAAO,IAAIsB,KAAK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AAIgD,QAAQ,QAAQ,iCAAiC;AACrE,SAAShD,OAAO,IAAIiD,OAAO,QAAQ,8BAA8B;AACjE,SAASjD,OAAO,IAAIkD,UAAU,QAAQ,oCAAoC;AAC1E,SAASC,2BAA2B,QAAQ,2BAA2B;AACvE,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,iBAAiB,QAAQ,kBAAkB;AACpD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,oBAAoB,QAAQ,qBAAqB;AAG1D,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ,uBAAuB;AAW/E,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,QAAQ,qBAAqB;AAChD,SAASC,oBAAoB,EAAEC,WAAW,QAAQ,oBAAoB;AACtE,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,UAAU,QAAQ,oBAAoB","ignoreList":[]}
|
|
@@ -13,7 +13,10 @@ type StyledSliderButtonItemProps = WithTheme<{
|
|
|
13
13
|
}>;
|
|
14
14
|
export declare const StyledSliderButtonItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSliderButtonItemProps>> & string;
|
|
15
15
|
export declare const StyledSliderButtonPopupContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
16
|
-
|
|
16
|
+
type StyledSliderButtonPopupContentItemProps = WithTheme<{
|
|
17
|
+
$isSelected?: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const StyledSliderButtonPopupContentItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSliderButtonPopupContentItemProps>> & string;
|
|
17
20
|
type StyledSliderButtonButtonsWrapperProps = WithTheme<{
|
|
18
21
|
$isInvisible?: boolean;
|
|
19
22
|
}>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export { default as ContentCard } from './components/content-card/ContentCard';
|
|
|
15
15
|
export { default as ContextMenu, type ContextMenuRef } from './components/context-menu/ContextMenu';
|
|
16
16
|
export { default as ExpandableContent } from './components/expandable-content/ExpandableContent';
|
|
17
17
|
export { default as FileInput, type FileInputRef } from './components/file-input/FileInput';
|
|
18
|
+
export { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';
|
|
18
19
|
export { default as FilterButtons } from './components/filter-buttons/FilterButtons';
|
|
19
20
|
export { default as GridImage } from './components/grid-image/GridImage';
|
|
20
21
|
export { default as Icon } from './components/icon/Icon';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.869",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "3df329643210c5cad39d37b4d5c30d825ce038d3"
|
|
91
91
|
}
|