@salutejs/plasma-new-hope 0.78.0-canary.1194.8928682263.0 → 0.78.0-canary.1194.8939441533.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/cjs/components/Slider/Slider.js +4 -4
  2. package/cjs/components/Slider/Slider.js.map +1 -1
  3. package/cjs/components/Slider/components/Double/Double.js +8 -8
  4. package/cjs/components/Slider/components/Double/Double.js.map +1 -1
  5. package/cjs/components/Slider/components/Single/Single.js +5 -5
  6. package/cjs/components/Slider/components/Single/Single.js.map +1 -1
  7. package/cjs/engines/common.js.map +1 -1
  8. package/cjs/engines/index.js.map +1 -1
  9. package/es/components/Slider/Slider.js +4 -4
  10. package/es/components/Slider/Slider.js.map +1 -1
  11. package/es/components/Slider/components/Double/Double.js +8 -8
  12. package/es/components/Slider/components/Double/Double.js.map +1 -1
  13. package/es/components/Slider/components/Single/Single.js +5 -5
  14. package/es/components/Slider/components/Single/Single.js.map +1 -1
  15. package/es/engines/common.js.map +1 -1
  16. package/es/engines/index.js.map +1 -1
  17. package/package.json +2 -3
  18. package/styled-components/cjs/components/Slider/Slider.js +4 -4
  19. package/styled-components/cjs/components/Slider/components/Double/Double.js +8 -8
  20. package/styled-components/cjs/components/Slider/components/Single/Single.js +5 -5
  21. package/styled-components/es/components/Slider/Slider.js +4 -4
  22. package/styled-components/es/components/Slider/components/Double/Double.js +8 -8
  23. package/styled-components/es/components/Slider/components/Single/Single.js +5 -5
  24. package/types/components/Slider/Slider.d.ts +3 -7
  25. package/types/components/Slider/Slider.d.ts.map +1 -1
  26. package/types/components/Slider/components/Double/Double.types.d.ts +1 -1
  27. package/types/components/Slider/components/Double/Double.types.d.ts.map +1 -1
  28. package/types/components/Slider/components/Single/Single.types.d.ts +1 -1
  29. package/types/components/Slider/components/Single/Single.types.d.ts.map +1 -1
  30. package/types/engines/common.d.ts +2 -2
  31. package/types/engines/common.d.ts.map +1 -1
  32. package/types/engines/index.d.ts +1 -1
  33. package/types/engines/index.d.ts.map +1 -1
  34. package/types/engines/types.d.ts +3 -0
  35. package/types/engines/types.d.ts.map +1 -1
@@ -10,14 +10,14 @@ var base$2 = require('./variations/_disabled/base.js');
10
10
  var Single = require('./components/Single/Single.js');
11
11
  var Double = require('./components/Double/Double.js');
12
12
 
13
- var isSingleValueProps = function isSingleValueProps(props) {
14
- return typeof props.value === 'number';
15
- };
16
-
17
13
  /**
18
14
  * Слайдер позволяет определить числовое значение в пределах указанного промежутка.
19
15
  * Можно указать два значения.
20
16
  */
17
+
18
+ var isSingleValueProps = function isSingleValueProps(props) {
19
+ return typeof props.value === 'number';
20
+ };
21
21
  var sliderRoot = function sliderRoot(Root) {
22
22
  return /*#__PURE__*/React.forwardRef(function (props, ref) {
23
23
  if (isSingleValueProps(props)) {
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport type { RootProps } from '../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { SingleSlider, DoubleSlider } from './components';\nimport type { SingleSliderProps } from './components';\nimport { SliderProps } from './Slider.types';\n\nconst isSingleValueProps = (props: SliderProps): props is SingleSliderProps => typeof props.value === 'number';\n\n/**\n * Слайдер позволяет определить числовое значение в пределах указанного промежутка.\n * Можно указать два значения.\n */\nexport const sliderRoot = (Root: RootProps<HTMLDivElement, SliderProps>) =>\n forwardRef<HTMLDivElement, SliderProps>((props, ref) => {\n if (isSingleValueProps(props)) {\n return (\n <Root ref={ref} {...props}>\n <SingleSlider {...props} />\n </Root>\n );\n }\n return (\n <Root ref={ref} {...props}>\n <DoubleSlider {...props} />\n </Root>\n );\n });\n\nexport const sliderConfig = {\n name: 'Slider',\n tag: 'div',\n layout: sliderRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["isSingleValueProps","props","value","sliderRoot","Root","forwardRef","ref","React","createElement","_extends","SingleSlider","DoubleSlider","sliderConfig","name","tag","layout","base","variations","view","css","viewCSS","size","sizeCSS","disabled","disabledCSS","attrs","defaults"],"mappings":";;;;;;;;;;;;AAWA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,KAAkB,EAAA;AAAA,EAAA,OAAiC,OAAOA,KAAK,CAACC,KAAK,KAAK,QAAQ,CAAA;AAAA,CAAA,CAAA;;AAE9G;AACA;AACA;AACA;IACaC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAA4C,EAAA;AAAA,EAAA,oBACnEC,gBAAU,CAA8B,UAACJ,KAAK,EAAEK,GAAG,EAAK;AACpD,IAAA,IAAIN,kBAAkB,CAACC,KAAK,CAAC,EAAE;AAC3B,MAAA,oBACIM,KAAA,CAAAC,aAAA,CAACJ,IAAI,EAAAK,iCAAA,CAAA;AAACH,QAAAA,GAAG,EAAEA,GAAAA;OAASL,EAAAA,KAAK,CACrBM,eAAAA,KAAA,CAAAC,aAAA,CAACE,mBAAY,EAAKT,KAAQ,CACxB,CAAC,CAAA;AAEf,KAAA;AACA,IAAA,oBACIM,KAAA,CAAAC,aAAA,CAACJ,IAAI,EAAAK,iCAAA,CAAA;AAACH,MAAAA,GAAG,EAAEA,GAAAA;KAASL,EAAAA,KAAK,CACrBM,eAAAA,KAAA,CAAAC,aAAA,CAACG,mBAAY,EAAKV,KAAQ,CACxB,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMW,YAAY,GAAG;AACxBC,EAAAA,IAAI,EAAE,QAAQ;AACdC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEZ,UAAU;AAClBa,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDC,IAAAA,IAAI,EAAE;AACFF,MAAAA,GAAG,EAAEG,WAAAA;KACR;AACDC,IAAAA,QAAQ,EAAE;AACNJ,MAAAA,GAAG,EAAEK,WAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNR,IAAAA,IAAI,EAAE,SAAS;AACfG,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"Slider.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport type { RootPropsOmitOnChange } from '../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { SingleSlider, DoubleSlider } from './components';\nimport type { SingleSliderProps } from './components';\nimport { SliderProps } from './Slider.types';\n\n/**\n * Слайдер позволяет определить числовое значение в пределах указанного промежутка.\n * Можно указать два значения.\n */\n\nconst isSingleValueProps = (props: SliderProps): props is SingleSliderProps => typeof props.value === 'number';\nexport const sliderRoot = (Root: RootPropsOmitOnChange<HTMLDivElement, SliderProps>) =>\n forwardRef<HTMLDivElement, SliderProps>((props, ref) => {\n if (isSingleValueProps(props)) {\n return (\n <Root ref={ref} {...props}>\n <SingleSlider {...props} />\n </Root>\n );\n }\n return (\n <Root ref={ref} {...props}>\n <DoubleSlider {...props} />\n </Root>\n );\n });\n\nexport const sliderConfig = {\n name: 'Slider',\n tag: 'div',\n layout: sliderRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["isSingleValueProps","props","value","sliderRoot","Root","forwardRef","ref","React","createElement","_extends","SingleSlider","DoubleSlider","sliderConfig","name","tag","layout","base","variations","view","css","viewCSS","size","size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,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNR,IAAAA,IAAI,EAAE,SAAS;AACfG,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
@@ -13,7 +13,7 @@ var Slider_tokens = require('../../Slider.tokens.js');
13
13
  var Double_styles = require('./Double.styles.js');
14
14
  var isNumber = require('../../../../utils/isNumber.js');
15
15
 
16
- var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "onChangeCommitted", "onChangeDrag", "ariaLabel", "multipleStepSize"];
16
+ var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "onChangeCommitted", "onChange", "ariaLabel", "multipleStepSize"];
17
17
  function getXCenterHandle(handle) {
18
18
  var _handle$parentElement;
19
19
  var containerX = ((_handle$parentElement = handle.parentElement) === null || _handle$parentElement === void 0 || (_handle$parentElement = _handle$parentElement.getBoundingClientRect()) === null || _handle$parentElement === void 0 ? void 0 : _handle$parentElement.x) || 0;
@@ -31,7 +31,7 @@ var DoubleSlider = function DoubleSlider(_ref) {
31
31
  _ref$size = _ref.size,
32
32
  size = _ref$size === void 0 ? 'm' : _ref$size,
33
33
  onChangeCommitted = _ref.onChangeCommitted,
34
- onChangeDrag = _ref.onChangeDrag,
34
+ onChange = _ref.onChange,
35
35
  ariaLabel = _ref.ariaLabel,
36
36
  _ref$multipleStepSize = _ref.multipleStepSize,
37
37
  multipleStepSize = _ref$multipleStepSize === void 0 ? 10 : _ref$multipleStepSize,
@@ -108,11 +108,11 @@ var DoubleSlider = function DoubleSlider(_ref) {
108
108
  railFillXPosition: newHandleXPosition
109
109
  });
110
110
  });
111
- if (onChangeDrag) {
112
- onChangeDrag([handleValue, value[1]]);
111
+ if (onChange) {
112
+ onChange([handleValue, value[1]]);
113
113
  }
114
114
  }
115
- }, [onChangeDrag, value]);
115
+ }, [onChange, value]);
116
116
  var onFirstHandleChangeCommitted = React.useCallback(function (handleValue, data) {
117
117
  setFirstValue(handleValue);
118
118
  onChangeCommitted && onChangeCommitted([handleValue, value[1]]);
@@ -156,11 +156,11 @@ var DoubleSlider = function DoubleSlider(_ref) {
156
156
  railFillXPosition: firstXHandleXPosition
157
157
  });
158
158
  });
159
- if (onChangeDrag) {
160
- onChangeDrag([value[0], handleValue]);
159
+ if (onChange) {
160
+ onChange([value[0], handleValue]);
161
161
  }
162
162
  }
163
- }, [onChangeDrag, value]);
163
+ }, [onChange, value]);
164
164
  var onSecondHandleChangeCommitted = React.useCallback(function (handleValue, data) {
165
165
  onChangeCommitted && onChangeCommitted([value[0], handleValue]);
166
166
  setSecondValue(handleValue);
@@ -1 +1 @@
1
- {"version":3,"file":"Double.js","sources":["../../../../../src/components/Slider/components/Double/Double.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport type { FC, ChangeEvent } from 'react';\n\nimport { SliderBase } from '../SliderBase/SliderBase';\nimport { Handle } from '../../ui';\nimport type { HandleProps } from '../../ui';\nimport { sizeData } from '../../utils';\nimport { cx, isNumber } from '../../../../utils';\nimport { classes } from '../../Slider.tokens';\n\nimport { DoubleSliderProps } from './Double.types';\nimport {\n SliderWrapper,\n InputsWrapper,\n Label,\n LabelContentLeft,\n LabelWrapper,\n StyledInput,\n DoubleWrapper,\n} from './Double.styles';\n\nfunction getXCenterHandle(handle: HTMLDivElement) {\n const containerX = handle.parentElement?.getBoundingClientRect()?.x || 0;\n const handleRect = handle.getBoundingClientRect();\n const handlePosition = handleRect.x;\n return handlePosition - containerX;\n}\n\nexport const DoubleSlider: FC<DoubleSliderProps> = ({\n min,\n max,\n value,\n disabled,\n label,\n labelContentLeft,\n size = 'm',\n onChangeCommitted,\n onChangeDrag,\n ariaLabel,\n multipleStepSize = 10,\n ...rest\n}) => {\n const [state, setState] = useState({\n stepSize: 0,\n railFillWidth: 0,\n railFillXPosition: 0,\n xFirstHandle: 0,\n xSecondHandle: 0,\n firstHandleZIndex: 100,\n secondHandleZIndex: 101,\n firstValue: value[0],\n secondValue: value[1],\n });\n const [firstInputActive, setFirstInputActive] = useState(false);\n const [secondInputActive, setSecondInputActive] = useState(false);\n\n const firstHandleRef = useRef<HTMLDivElement | null>(null);\n const secondHandleRef = useRef<HTMLDivElement | null>(null);\n\n const firstHandleValue = useRef<number>(value[0]);\n const secondHandleValue = useRef<number>(value[1]);\n\n const [firstValue, setFirstValue] = useState<number>(value[0]);\n const [secondValue, setSecondValue] = useState<number>(value[1]);\n\n const { stepSize } = state;\n\n const hasLabelContent = label || labelContentLeft;\n const firstInputActiveClass = firstInputActive && !disabled ? classes.textFieldActive : undefined;\n const secondInputActiveClass = secondInputActive && !disabled ? classes.textFieldActive : undefined;\n\n useEffect(() => {\n const firstLocalValue = Math.min(Math.max(value[0], min), max) - min;\n const secondLocalValue = Math.min(Math.max(value[1], min), max) - min;\n setState((prevState) => ({\n ...prevState,\n railFillXPosition: stepSize * firstLocalValue,\n railFillWidth: stepSize * secondLocalValue - stepSize * firstLocalValue,\n xFirstHandle: stepSize * firstLocalValue,\n xSecondHandle: stepSize * secondLocalValue,\n }));\n }, [value, stepSize, min, max]);\n\n const setStepSize = useCallback((newStepSize: number) => {\n setState((prevState) => ({\n ...prevState,\n stepSize: newStepSize,\n }));\n }, []);\n\n const onFirstHandleChange = useCallback<NonNullable<HandleProps['onChange']>>(\n (handleValue, data) => {\n if (secondHandleRef?.current) {\n const newHandleXPosition = data.x;\n const secondHandleXPosition = getXCenterHandle(secondHandleRef.current);\n const fillWidth = secondHandleXPosition - newHandleXPosition;\n\n firstHandleValue.current = handleValue;\n\n setFirstValue(handleValue);\n\n setState((prevState) => ({\n ...prevState,\n firstHandleZIndex: 101,\n secondHandleZIndex: 100,\n railFillWidth: fillWidth < 0 ? 0 : fillWidth,\n railFillXPosition: newHandleXPosition,\n }));\n if (onChangeDrag) {\n onChangeDrag([handleValue, value[1]]);\n }\n }\n },\n [onChangeDrag, value],\n );\n\n const onFirstHandleChangeCommitted = useCallback<NonNullable<HandleProps['onChangeCommitted']>>(\n (handleValue, data) => {\n setFirstValue(handleValue);\n onChangeCommitted && onChangeCommitted([handleValue, value[1]]);\n\n setState((prevState) => ({\n ...prevState,\n firstValue: handleValue,\n xFirstHandle: data.lastX,\n }));\n },\n [onChangeCommitted, value],\n );\n\n const onFirstTextfieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!isNumber(event.target.value)) return;\n\n const handleValue = Number(event.target.value);\n\n setFirstValue(handleValue);\n },\n [isNumber, setFirstValue],\n );\n\n const onFirstTextfieldEnter = useCallback(\n (newValue: string) => {\n if (!isNumber(newValue)) return;\n\n const handleValue = Math.min(Math.max(Number(newValue), min), value[1]);\n const handleValueLocal = Math.min(Math.max(handleValue, min), max) - min;\n\n setFirstValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n firstValue: handleValue,\n xFirstHandle: handleValueLocal * stepSize,\n }));\n\n onChangeCommitted && onChangeCommitted([handleValue, value[1]]);\n },\n [isNumber, onChangeCommitted, setFirstValue, value, min, max, stepSize],\n );\n\n const onSecondHandleChange = useCallback<NonNullable<HandleProps['onChange']>>(\n (handleValue, data) => {\n if (firstHandleRef?.current) {\n const firstXHandleXPosition = getXCenterHandle(firstHandleRef.current);\n\n const newHandleXPosition = data.x;\n const fillWidth = newHandleXPosition - firstXHandleXPosition;\n\n secondHandleValue.current = handleValue;\n\n setSecondValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n firstHandleZIndex: 100,\n secondHandleZIndex: 101,\n railFillWidth: fillWidth < 0 ? 0 : fillWidth,\n railFillXPosition: firstXHandleXPosition,\n }));\n if (onChangeDrag) {\n onChangeDrag([value[0], handleValue]);\n }\n }\n },\n [onChangeDrag, value],\n );\n\n const onSecondHandleChangeCommitted = useCallback<NonNullable<HandleProps['onChangeCommitted']>>(\n (handleValue, data) => {\n onChangeCommitted && onChangeCommitted([value[0], handleValue]);\n setSecondValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n secondValue: handleValue,\n xSecondHandle: data.lastX,\n }));\n },\n [onChangeCommitted, value],\n );\n\n const onSecondTextfieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!isNumber(event.target.value)) return;\n\n const handleValue = Number(event.target.value);\n\n setSecondValue(handleValue);\n },\n [isNumber, setSecondValue],\n );\n\n const onSecondTextfieldEnter = useCallback(\n (newValue: string) => {\n if (!isNumber(newValue)) return;\n\n const handleValue = Math.max(Math.min(Number(newValue), max), value[0]);\n const handleValueLocal = Math.min(Math.max(handleValue, min), max) - min;\n\n setSecondValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n secondValue: handleValue,\n xSecondHandle: handleValueLocal * stepSize,\n }));\n\n onChangeCommitted && onChangeCommitted([value[0], handleValue]);\n },\n [isNumber, setSecondValue, onChangeCommitted, value, min, max, stepSize],\n );\n\n const [ariaLabelLeft, ariaLabelRight] = ariaLabel || [];\n const currentFirstSliderValue = Math.max(state.firstValue, min);\n\n return (\n <DoubleWrapper>\n {hasLabelContent && (\n <LabelWrapper>\n {labelContentLeft && <LabelContentLeft>{labelContentLeft}</LabelContentLeft>}\n {label && <Label>{label}</Label>}\n </LabelWrapper>\n )}\n <SliderWrapper>\n <SliderBase\n min={min}\n max={max}\n disabled={disabled}\n setStepSize={setStepSize}\n railFillWidth={state.railFillWidth}\n settings={sizeData[size]}\n railFillXPosition={state.railFillXPosition}\n {...rest}\n >\n <Handle\n ref={firstHandleRef}\n stepSize={state.stepSize}\n multipleStepSize={multipleStepSize}\n onChangeCommitted={onFirstHandleChangeCommitted}\n onChange={onFirstHandleChange}\n min={min}\n max={state.secondValue}\n disabled={disabled}\n bounds={[min, state.secondValue]}\n side=\"left\"\n xPosition={state.xFirstHandle}\n zIndex={state.firstHandleZIndex}\n value={currentFirstSliderValue}\n ariaLabel={ariaLabelLeft}\n onMouseEnter={() => setFirstInputActive(true)}\n onMouseLeave={() => setFirstInputActive(false)}\n />\n <Handle\n ref={secondHandleRef}\n stepSize={state.stepSize}\n multipleStepSize={multipleStepSize}\n onChangeCommitted={onSecondHandleChangeCommitted}\n onChange={onSecondHandleChange}\n min={min}\n ariaValueMin={currentFirstSliderValue}\n max={max}\n disabled={disabled}\n bounds={[state.firstValue, max]}\n side=\"right\"\n xPosition={state.xSecondHandle}\n zIndex={state.secondHandleZIndex}\n value={Math.max(state.secondValue, min)}\n ariaLabel={ariaLabelRight}\n onMouseEnter={() => setSecondInputActive(true)}\n onMouseLeave={() => setSecondInputActive(false)}\n />\n </SliderBase>\n\n <InputsWrapper>\n <StyledInput\n className={cx(classes.firstTextField, firstInputActiveClass)}\n enumerationType=\"plain\"\n disabled={disabled}\n value={firstValue}\n onChange={(e) => onFirstTextfieldChange(e)}\n onSearch={(e) => onFirstTextfieldEnter(e)}\n />\n <StyledInput\n className={cx(classes.secondTextField, secondInputActiveClass)}\n enumerationType=\"plain\"\n disabled={disabled}\n value={secondValue}\n onChange={(e) => onSecondTextfieldChange(e)}\n onSearch={(e) => onSecondTextfieldEnter(e)}\n />\n </InputsWrapper>\n </SliderWrapper>\n </DoubleWrapper>\n );\n};\n"],"names":["getXCenterHandle","handle","_handle$parentElement","containerX","parentElement","getBoundingClientRect","x","handleRect","handlePosition","DoubleSlider","_ref","min","max","value","disabled","label","labelContentLeft","_ref$size","size","onChangeCommitted","onChangeDrag","ariaLabel","_ref$multipleStepSize","multipleStepSize","rest","_objectWithoutProperties","_excluded","_useState","useState","stepSize","railFillWidth","railFillXPosition","xFirstHandle","xSecondHandle","firstHandleZIndex","secondHandleZIndex","firstValue","secondValue","_useState2","_slicedToArray","state","setState","_useState3","_useState4","firstInputActive","setFirstInputActive","_useState5","_useState6","secondInputActive","setSecondInputActive","firstHandleRef","useRef","secondHandleRef","firstHandleValue","secondHandleValue","_useState7","_useState8","setFirstValue","_useState9","_useState10","setSecondValue","hasLabelContent","firstInputActiveClass","classes","textFieldActive","undefined","secondInputActiveClass","useEffect","firstLocalValue","Math","secondLocalValue","prevState","_objectSpread","setStepSize","useCallback","newStepSize","onFirstHandleChange","handleValue","data","current","newHandleXPosition","secondHandleXPosition","fillWidth","onFirstHandleChangeCommitted","lastX","onFirstTextfieldChange","event","isNumber","target","Number","onFirstTextfieldEnter","newValue","handleValueLocal","onSecondHandleChange","firstXHandleXPosition","onSecondHandleChangeCommitted","onSecondTextfieldChange","onSecondTextfieldEnter","_ref2","_ref3","ariaLabelLeft","ariaLabelRight","currentFirstSliderValue","React","createElement","DoubleWrapper","LabelWrapper","LabelContentLeft","Label","SliderWrapper","SliderBase","_extends","settings","sizeData","Handle","ref","onChange","bounds","side","xPosition","zIndex","onMouseEnter","onMouseLeave","ariaValueMin","InputsWrapper","StyledInput","className","cx","firstTextField","enumerationType","e","onSearch","secondTextField"],"mappings":";;;;;;;;;;;;;;;;AAqBA,SAASA,gBAAgBA,CAACC,MAAsB,EAAE;AAAA,EAAA,IAAAC,qBAAA,CAAA;EAC9C,IAAMC,UAAU,GAAG,CAAA,CAAAD,qBAAA,GAAAD,MAAM,CAACG,aAAa,MAAAF,IAAAA,IAAAA,qBAAA,KAAAA,KAAAA,CAAAA,IAAAA,CAAAA,qBAAA,GAApBA,qBAAA,CAAsBG,qBAAqB,EAAE,MAAA,IAAA,IAAAH,qBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAA7CA,qBAAA,CAA+CI,CAAC,KAAI,CAAC,CAAA;AACxE,EAAA,IAAMC,UAAU,GAAGN,MAAM,CAACI,qBAAqB,EAAE,CAAA;AACjD,EAAA,IAAMG,cAAc,GAAGD,UAAU,CAACD,CAAC,CAAA;EACnC,OAAOE,cAAc,GAAGL,UAAU,CAAA;AACtC,CAAA;IAEaM,YAAmC,GAAG,SAAtCA,YAAmCA,CAAAC,IAAA,EAa1C;AAAA,EAAA,IAZFC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IACR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slider/components/Double/Double.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport type { FC, ChangeEvent } from 'react';\n\nimport { SliderBase } from '../SliderBase/SliderBase';\nimport { Handle } from '../../ui';\nimport type { HandleProps } from '../../ui';\nimport { sizeData } from '../../utils';\nimport { cx, isNumber } from '../../../../utils';\nimport { classes } from '../../Slider.tokens';\n\nimport { DoubleSliderProps } from './Double.types';\nimport {\n SliderWrapper,\n InputsWrapper,\n Label,\n LabelContentLeft,\n LabelWrapper,\n StyledInput,\n DoubleWrapper,\n} from './Double.styles';\n\nfunction getXCenterHandle(handle: HTMLDivElement) {\n const containerX = handle.parentElement?.getBoundingClientRect()?.x || 0;\n const handleRect = handle.getBoundingClientRect();\n const handlePosition = handleRect.x;\n return handlePosition - containerX;\n}\n\nexport const DoubleSlider: FC<DoubleSliderProps> = ({\n min,\n max,\n value,\n disabled,\n label,\n labelContentLeft,\n size = 'm',\n onChangeCommitted,\n onChange,\n ariaLabel,\n multipleStepSize = 10,\n ...rest\n}) => {\n const [state, setState] = useState({\n stepSize: 0,\n railFillWidth: 0,\n railFillXPosition: 0,\n xFirstHandle: 0,\n xSecondHandle: 0,\n firstHandleZIndex: 100,\n secondHandleZIndex: 101,\n firstValue: value[0],\n secondValue: value[1],\n });\n const [firstInputActive, setFirstInputActive] = useState(false);\n const [secondInputActive, setSecondInputActive] = useState(false);\n\n const firstHandleRef = useRef<HTMLDivElement | null>(null);\n const secondHandleRef = useRef<HTMLDivElement | null>(null);\n\n const firstHandleValue = useRef<number>(value[0]);\n const secondHandleValue = useRef<number>(value[1]);\n\n const [firstValue, setFirstValue] = useState<number>(value[0]);\n const [secondValue, setSecondValue] = useState<number>(value[1]);\n\n const { stepSize } = state;\n\n const hasLabelContent = label || labelContentLeft;\n const firstInputActiveClass = firstInputActive && !disabled ? classes.textFieldActive : undefined;\n const secondInputActiveClass = secondInputActive && !disabled ? classes.textFieldActive : undefined;\n\n useEffect(() => {\n const firstLocalValue = Math.min(Math.max(value[0], min), max) - min;\n const secondLocalValue = Math.min(Math.max(value[1], min), max) - min;\n setState((prevState) => ({\n ...prevState,\n railFillXPosition: stepSize * firstLocalValue,\n railFillWidth: stepSize * secondLocalValue - stepSize * firstLocalValue,\n xFirstHandle: stepSize * firstLocalValue,\n xSecondHandle: stepSize * secondLocalValue,\n }));\n }, [value, stepSize, min, max]);\n\n const setStepSize = useCallback((newStepSize: number) => {\n setState((prevState) => ({\n ...prevState,\n stepSize: newStepSize,\n }));\n }, []);\n\n const onFirstHandleChange = useCallback<NonNullable<HandleProps['onChange']>>(\n (handleValue, data) => {\n if (secondHandleRef?.current) {\n const newHandleXPosition = data.x;\n const secondHandleXPosition = getXCenterHandle(secondHandleRef.current);\n const fillWidth = secondHandleXPosition - newHandleXPosition;\n\n firstHandleValue.current = handleValue;\n\n setFirstValue(handleValue);\n\n setState((prevState) => ({\n ...prevState,\n firstHandleZIndex: 101,\n secondHandleZIndex: 100,\n railFillWidth: fillWidth < 0 ? 0 : fillWidth,\n railFillXPosition: newHandleXPosition,\n }));\n if (onChange) {\n onChange([handleValue, value[1]]);\n }\n }\n },\n [onChange, value],\n );\n\n const onFirstHandleChangeCommitted = useCallback<NonNullable<HandleProps['onChangeCommitted']>>(\n (handleValue, data) => {\n setFirstValue(handleValue);\n onChangeCommitted && onChangeCommitted([handleValue, value[1]]);\n\n setState((prevState) => ({\n ...prevState,\n firstValue: handleValue,\n xFirstHandle: data.lastX,\n }));\n },\n [onChangeCommitted, value],\n );\n\n const onFirstTextfieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!isNumber(event.target.value)) return;\n\n const handleValue = Number(event.target.value);\n\n setFirstValue(handleValue);\n },\n [isNumber, setFirstValue],\n );\n\n const onFirstTextfieldEnter = useCallback(\n (newValue: string) => {\n if (!isNumber(newValue)) return;\n\n const handleValue = Math.min(Math.max(Number(newValue), min), value[1]);\n const handleValueLocal = Math.min(Math.max(handleValue, min), max) - min;\n\n setFirstValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n firstValue: handleValue,\n xFirstHandle: handleValueLocal * stepSize,\n }));\n\n onChangeCommitted && onChangeCommitted([handleValue, value[1]]);\n },\n [isNumber, onChangeCommitted, setFirstValue, value, min, max, stepSize],\n );\n\n const onSecondHandleChange = useCallback<NonNullable<HandleProps['onChange']>>(\n (handleValue, data) => {\n if (firstHandleRef?.current) {\n const firstXHandleXPosition = getXCenterHandle(firstHandleRef.current);\n\n const newHandleXPosition = data.x;\n const fillWidth = newHandleXPosition - firstXHandleXPosition;\n\n secondHandleValue.current = handleValue;\n\n setSecondValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n firstHandleZIndex: 100,\n secondHandleZIndex: 101,\n railFillWidth: fillWidth < 0 ? 0 : fillWidth,\n railFillXPosition: firstXHandleXPosition,\n }));\n if (onChange) {\n onChange([value[0], handleValue]);\n }\n }\n },\n [onChange, value],\n );\n\n const onSecondHandleChangeCommitted = useCallback<NonNullable<HandleProps['onChangeCommitted']>>(\n (handleValue, data) => {\n onChangeCommitted && onChangeCommitted([value[0], handleValue]);\n setSecondValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n secondValue: handleValue,\n xSecondHandle: data.lastX,\n }));\n },\n [onChangeCommitted, value],\n );\n\n const onSecondTextfieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!isNumber(event.target.value)) return;\n\n const handleValue = Number(event.target.value);\n\n setSecondValue(handleValue);\n },\n [isNumber, setSecondValue],\n );\n\n const onSecondTextfieldEnter = useCallback(\n (newValue: string) => {\n if (!isNumber(newValue)) return;\n\n const handleValue = Math.max(Math.min(Number(newValue), max), value[0]);\n const handleValueLocal = Math.min(Math.max(handleValue, min), max) - min;\n\n setSecondValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n secondValue: handleValue,\n xSecondHandle: handleValueLocal * stepSize,\n }));\n\n onChangeCommitted && onChangeCommitted([value[0], handleValue]);\n },\n [isNumber, setSecondValue, onChangeCommitted, value, min, max, stepSize],\n );\n\n const [ariaLabelLeft, ariaLabelRight] = ariaLabel || [];\n const currentFirstSliderValue = Math.max(state.firstValue, min);\n\n return (\n <DoubleWrapper>\n {hasLabelContent && (\n <LabelWrapper>\n {labelContentLeft && <LabelContentLeft>{labelContentLeft}</LabelContentLeft>}\n {label && <Label>{label}</Label>}\n </LabelWrapper>\n )}\n <SliderWrapper>\n <SliderBase\n min={min}\n max={max}\n disabled={disabled}\n setStepSize={setStepSize}\n railFillWidth={state.railFillWidth}\n settings={sizeData[size]}\n railFillXPosition={state.railFillXPosition}\n {...rest}\n >\n <Handle\n ref={firstHandleRef}\n stepSize={state.stepSize}\n multipleStepSize={multipleStepSize}\n onChangeCommitted={onFirstHandleChangeCommitted}\n onChange={onFirstHandleChange}\n min={min}\n max={state.secondValue}\n disabled={disabled}\n bounds={[min, state.secondValue]}\n side=\"left\"\n xPosition={state.xFirstHandle}\n zIndex={state.firstHandleZIndex}\n value={currentFirstSliderValue}\n ariaLabel={ariaLabelLeft}\n onMouseEnter={() => setFirstInputActive(true)}\n onMouseLeave={() => setFirstInputActive(false)}\n />\n <Handle\n ref={secondHandleRef}\n stepSize={state.stepSize}\n multipleStepSize={multipleStepSize}\n onChangeCommitted={onSecondHandleChangeCommitted}\n onChange={onSecondHandleChange}\n min={min}\n ariaValueMin={currentFirstSliderValue}\n max={max}\n disabled={disabled}\n bounds={[state.firstValue, max]}\n side=\"right\"\n xPosition={state.xSecondHandle}\n zIndex={state.secondHandleZIndex}\n value={Math.max(state.secondValue, min)}\n ariaLabel={ariaLabelRight}\n onMouseEnter={() => setSecondInputActive(true)}\n onMouseLeave={() => setSecondInputActive(false)}\n />\n </SliderBase>\n\n <InputsWrapper>\n <StyledInput\n className={cx(classes.firstTextField, firstInputActiveClass)}\n enumerationType=\"plain\"\n disabled={disabled}\n value={firstValue}\n onChange={(e) => onFirstTextfieldChange(e)}\n onSearch={(e) => onFirstTextfieldEnter(e)}\n />\n <StyledInput\n className={cx(classes.secondTextField, secondInputActiveClass)}\n enumerationType=\"plain\"\n disabled={disabled}\n value={secondValue}\n onChange={(e) => onSecondTextfieldChange(e)}\n onSearch={(e) => onSecondTextfieldEnter(e)}\n />\n </InputsWrapper>\n </SliderWrapper>\n </DoubleWrapper>\n );\n};\n"],"names":["getXCenterHandle","handle","_handle$parentElement","containerX","parentElement","getBoundingClientRect","x","handleRect","handlePosition","DoubleSlider","_ref","min","max","value","disabled","label","labelContentLeft","_ref$size","size","onChangeCommitted","onChange","ariaLabel","_ref$multipleStepSize","multipleStepSize","rest","_objectWithoutProperties","_excluded","_useState","useState","stepSize","railFillWidth","railFillXPosition","xFirstHandle","xSecondHandle","firstHandleZIndex","secondHandleZIndex","firstValue","secondValue","_useState2","_slicedToArray","state","setState","_useState3","_useState4","firstInputActive","setFirstInputActive","_useState5","_useState6","secondInputActive","setSecondInputActive","firstHandleRef","useRef","secondHandleRef","firstHandleValue","secondHandleValue","_useState7","_useState8","setFirstValue","_useState9","_useState10","setSecondValue","hasLabelContent","firstInputActiveClass","classes","textFieldActive","undefined","secondInputActiveClass","useEffect","firstLocalValue","Math","secondLocalValue","prevState","_objectSpread","setStepSize","useCallback","newStepSize","onFirstHandleChange","handleValue","data","current","newHandleXPosition","secondHandleXPosition","fillWidth","onFirstHandleChangeCommitted","lastX","onFirstTextfieldChange","event","isNumber","target","Number","onFirstTextfieldEnter","newValue","handleValueLocal","onSecondHandleChange","firstXHandleXPosition","onSecondHandleChangeCommitted","onSecondTextfieldChange","onSecondTextfieldEnter","_ref2","_ref3","ariaLabelLeft","ariaLabelRight","currentFirstSliderValue","React","createElement","DoubleWrapper","LabelWrapper","LabelContentLeft","Label","SliderWrapper","SliderBase","_extends","settings","sizeData","Handle","ref","bounds","side","xPosition","zIndex","onMouseEnter","onMouseLeave","ariaValueMin","InputsWrapper","StyledInput","className","cx","firstTextField","enumerationType","e","onSearch","secondTextField"],"mappings":";;;;;;;;;;;;;;;;AAqBA,SAASA,gBAAgBA,CAACC,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AAAA,CAAC6G,CAAC,EAAA;MAAA,OAAK5C,sBAAsB,CAAC4C,CAAC,CAAC,CAAA;KAAC;IAC3CC,QAAQ,EAAE,SAAAA,QAAAA,CAACD,CAAC,EAAA;MAAA,OAAKvC,qBAAqB,CAACuC,CAAC,CAAC,CAAA;AAAA,KAAA;AAAC,GAC7C,CAAC,eACF1B,KAAA,CAAAC,aAAA,CAACoB,yBAAW,EAAA;IACRC,SAAS,EAAEC,UAAE,CAAC/D,qBAAO,CAACoE,eAAe,EAAEjE,sBAAsB,CAAE;AAC/D8D,IAAAA,eAAe,EAAC,OAAO;AACvBlH,IAAAA,QAAQ,EAAEA,QAAS;AACnBD,IAAAA,KAAK,EAAEwB,WAAY;IACnBjB,QAAQ,EAAE,SAAAA,QAAAA,CAAC6G,CAAC,EAAA;MAAA,OAAKjC,uBAAuB,CAACiC,CAAC,CAAC,CAAA;KAAC;IAC5CC,QAAQ,EAAE,SAAAA,QAAAA,CAACD,CAAC,EAAA;MAAA,OAAKhC,sBAAsB,CAACgC,CAAC,CAAC,CAAA;AAAA,KAAA;GAC7C,CACU,CACJ,CACJ,CAAC,CAAA;AAExB;;;;"}
@@ -13,14 +13,14 @@ var Slider_tokens = require('../../Slider.tokens.js');
13
13
  var Single_styles = require('./Single.styles.js');
14
14
  var isNumber = require('../../../../utils/isNumber.js');
15
15
 
16
- var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChangeDrag", "ariaLabel", "label", "labelContentLeft", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "multipleStepSize", "size"];
16
+ var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChange", "ariaLabel", "label", "labelContentLeft", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "multipleStepSize", "size"];
17
17
  var SingleSlider = function SingleSlider(_ref) {
18
18
  var min = _ref.min,
19
19
  max = _ref.max,
20
20
  value = _ref.value,
21
21
  disabled = _ref.disabled,
22
22
  onChangeCommitted = _ref.onChangeCommitted,
23
- onChangeDrag = _ref.onChangeDrag,
23
+ onChange = _ref.onChange,
24
24
  ariaLabel = _ref.ariaLabel,
25
25
  label = _ref.label,
26
26
  labelContentLeft = _ref.labelContentLeft,
@@ -104,11 +104,11 @@ var SingleSlider = function SingleSlider(_ref) {
104
104
  railFillWidth: newHandleXPosition
105
105
  });
106
106
  });
107
- if (onChangeDrag) {
108
- onChangeDrag(handleValue);
107
+ if (onChange) {
108
+ onChange(handleValue);
109
109
  }
110
110
  setDragValue(handleValue);
111
- }, [onChangeDrag, setDragValue]);
111
+ }, [onChange, setDragValue]);
112
112
  var onHandleChangeCommitted = React.useCallback(function (handleValue, data) {
113
113
  onChangeCommitted && onChangeCommitted(handleValue);
114
114
  setState(function (prevState) {
@@ -1 +1 @@
1
- {"version":3,"file":"Single.js","sources":["../../../../../src/components/Slider/components/Single/Single.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState, useRef } from 'react';\nimport type { FC } from 'react';\n\nimport { SliderBase } from '../SliderBase/SliderBase';\nimport { Handle } from '../../ui';\nimport { sizeData } from '../../utils';\nimport type { HandleProps } from '../../ui';\nimport { cx, isNumber } from '../../../../utils';\nimport { classes } from '../../Slider.tokens';\n\nimport type { SingleSliderProps } from './Single.types';\nimport {\n Label,\n LabelContentLeft,\n LabelWrapper,\n SingleWrapper,\n SliderBaseWrapper,\n StyledRangeValue,\n} from './Single.styles';\n\nexport const SingleSlider: FC<SingleSliderProps> = ({\n min,\n max,\n value,\n disabled,\n onChangeCommitted,\n onChangeDrag,\n ariaLabel,\n label,\n labelContentLeft,\n showRangeValues,\n showCurrentValue,\n hideMinValueDiff,\n hideMaxValueDiff,\n labelPlacement = 'outer',\n rangeValuesPlacement = 'outer',\n multipleStepSize = 10,\n size = 'm',\n ...rest\n}) => {\n const [state, setState] = useState({\n xHandle: 0,\n stepSize: 0,\n railFillWidth: 0,\n });\n\n const { stepSize } = state;\n\n const hasLabelContent = label || labelContentLeft;\n const labelPlacementClass = labelPlacement === 'outer' ? classes.labelPlacementOuter : classes.labelPlacementInner;\n const rangeValuesPlacementClass =\n rangeValuesPlacement === 'outer' ? classes.rangeValuesPlacementOuter : classes.rangeValuesPlacementInner;\n const hideMinValueDiffClass = hideMinValueDiff && value - min <= hideMinValueDiff ? classes.hideMinValue : '';\n const hideMaxValueDiffClass = hideMaxValueDiff && max - value <= hideMaxValueDiff ? classes.hideMaxValue : '';\n\n const startLabelRef = useRef<HTMLDivElement>(null);\n const endLabelRef = useRef<HTMLDivElement>(null);\n\n const [startOffset, setStartOffset] = useState(0);\n const [endOffset, setEndOffset] = useState(0);\n\n const [dragValue, setDragValue] = useState(value);\n\n const activeFirstValue = dragValue === min ? classes.activeRangeValue : undefined;\n const activeSecondValue = dragValue === max ? classes.activeRangeValue : undefined;\n\n useEffect(() => {\n const localValue = Math.min(Math.max(value, min), max) - min;\n\n if (rangeValuesPlacement === 'outer') {\n const startWidth = startLabelRef.current?.offsetWidth;\n if (isNumber(startWidth)) {\n setStartOffset(Number(startWidth));\n }\n\n const endWidth = endLabelRef.current?.offsetWidth;\n if (isNumber(endWidth)) {\n setEndOffset(Number(endWidth));\n }\n } else {\n setStartOffset(1);\n setEndOffset(1);\n }\n\n setState((prevState) => ({\n ...prevState,\n xHandle: stepSize * localValue,\n railFillWidth: stepSize * localValue,\n }));\n }, [value, labelPlacement, stepSize, rangeValuesPlacement, min, max, setStartOffset, setEndOffset]);\n\n const setStepSize = useCallback((newStepSize: number) => {\n setState((prevState) => ({\n ...prevState,\n stepSize: newStepSize,\n }));\n }, []);\n\n const onHandleChange = useCallback<NonNullable<HandleProps['onChange']>>(\n (handleValue, data) => {\n const newHandleXPosition = data.x;\n setState((prevState) => ({\n ...prevState,\n railFillWidth: newHandleXPosition,\n }));\n\n if (onChangeDrag) {\n onChangeDrag(handleValue);\n }\n\n setDragValue(handleValue);\n },\n [onChangeDrag, setDragValue],\n );\n\n const onHandleChangeCommitted = useCallback<NonNullable<HandleProps['onChangeCommitted']>>(\n (handleValue, data) => {\n onChangeCommitted && onChangeCommitted(handleValue);\n setState((prevState) => ({\n ...prevState,\n xHandle: data.lastX,\n railFillWidth: data.lastX,\n }));\n\n setDragValue(handleValue);\n },\n [onChangeCommitted, setDragValue],\n );\n\n return (\n <SingleWrapper className={labelPlacementClass}>\n {hasLabelContent && (\n <LabelWrapper>\n {labelContentLeft && <LabelContentLeft>{labelContentLeft}</LabelContentLeft>}\n {label && <Label>{label}</Label>}\n </LabelWrapper>\n )}\n <SliderBaseWrapper className={rangeValuesPlacementClass}>\n {showRangeValues && (\n <StyledRangeValue ref={startLabelRef} className={cx(hideMinValueDiffClass, activeFirstValue)}>\n {min}\n </StyledRangeValue>\n )}\n <SliderBase\n min={min}\n max={max}\n disabled={disabled}\n setStepSize={setStepSize}\n onChange={onHandleChangeCommitted}\n railFillWidth={state.railFillWidth}\n settings={sizeData[size]}\n labelPlacement={labelPlacement}\n rangeValuesPlacement={rangeValuesPlacement}\n {...rest}\n >\n <Handle\n stepSize={state.stepSize}\n onChangeCommitted={onHandleChangeCommitted}\n onChange={onHandleChange}\n xPosition={state.xHandle}\n min={min}\n max={max}\n startOffset={startOffset}\n endOffset={endOffset}\n value={value}\n disabled={disabled}\n ariaLabel={ariaLabel}\n multipleStepSize={multipleStepSize}\n showCurrentValue={showCurrentValue}\n />\n </SliderBase>\n {showRangeValues && (\n <StyledRangeValue\n ref={endLabelRef}\n className={cx(classes.maxRangeValue, hideMaxValueDiffClass, activeSecondValue)}\n >\n {max}\n </StyledRangeValue>\n )}\n </SliderBaseWrapper>\n </SingleWrapper>\n );\n};\n"],"names":["SingleSlider","_ref","min","max","value","disabled","onChangeCommitted","onChangeDrag","ariaLabel","label","labelContentLeft","showRangeValues","showCurrentValue","hideMinValueDiff","hideMaxValueDiff","_ref$labelPlacement","labelPlacement","_ref$rangeValuesPlace","rangeValuesPlacement","_ref$multipleStepSize","multipleStepSize","_ref$size","size","rest","_objectWithoutProperties","_excluded","_useState","useState","xHandle","stepSize","railFillWidth","_useState2","_slicedToArray","state","setState","hasLabelContent","labelPlacementClass","classes","labelPlacementOuter","labelPlacementInner","rangeValuesPlacementClass","rangeValuesPlacementOuter","rangeValuesPlacementInner","hideMinValueDiffClass","hideMinValue","hideMaxValueDiffClass","hideMaxValue","startLabelRef","useRef","endLabelRef","_useState3","_useState4","startOffset","setStartOffset","_useState5","_useState6","endOffset","setEndOffset","_useState7","_useState8","dragValue","setDragValue","activeFirstValue","activeRangeValue","undefined","activeSecondValue","useEffect","localValue","Math","_startLabelRef$curren","_endLabelRef$current","startWidth","current","offsetWidth","isNumber","Number","endWidth","prevState","_objectSpread","setStepSize","useCallback","newStepSize","onHandleChange","handleValue","data","newHandleXPosition","x","onHandleChangeCommitted","lastX","React","createElement","SingleWrapper","className","LabelWrapper","LabelContentLeft","Label","SliderBaseWrapper","StyledRangeValue","ref","cx","SliderBase","_extends","onChange","settings","sizeData","Handle","xPosition","maxRangeValue"],"mappings":";;;;;;;;;;;;;;;;IAoBaA,YAAmC,GAAG,SAAtCA,YAAmCA,CAAAC,IAAA,EAmB1C;AAAA,EAAA,IAlBFC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IACRC,iBAAiB,GAAAL,IAAA,CAAjBK,iBAAiB;IACjBC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,SAAS,GAAAP,IAAA,CAATO,SAAS;IACTC,KAAK,GAAAR,IAAA,CAALQ,KAAK;IACLC,gBAAgB,GAAAT,IAAA,CAAhBS,gBAAgB;IAChBC,eAAe,GAAAV,IAAA,CAAfU,eAAe;IACfC,gBAAgB,GAAAX,IAAA,CAAhBW,gBAAgB;IAChBC,gBAAgB,GAAAZ,IAAA,CAAhBY,gBAAg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,IAAAA,QAAQ,EAAEA,QAAS;AACnB0E,IAAAA,WAAW,EAAEA,WAAY;AACzBuB,IAAAA,QAAQ,EAAEf,uBAAwB;IAClCzD,aAAa,EAAEG,KAAK,CAACH,aAAc;AACnCyE,IAAAA,QAAQ,EAAEC,gBAAQ,CAAClF,IAAI,CAAE;AACzBN,IAAAA,cAAc,EAAEA,cAAe;AAC/BE,IAAAA,oBAAoB,EAAEA,oBAAAA;AAAqB,GAAA,EACvCK,IAAI,CAERkE,eAAAA,KAAA,CAAAC,aAAA,CAACe,aAAM,EAAA;IACH5E,QAAQ,EAAEI,KAAK,CAACJ,QAAS;AACzBvB,IAAAA,iBAAiB,EAAEiF,uBAAwB;AAC3Ce,IAAAA,QAAQ,EAAEpB,cAAe;IACzBwB,SAAS,EAAEzE,KAAK,CAACL,OAAQ;AACzB1B,IAAAA,GAAG,EAAEA,GAAI;AACTC,IAAAA,GAAG,EAAEA,GAAI;AACTiD,IAAAA,WAAW,EAAEA,WAAY;AACzBI,IAAAA,SAAS,EAAEA,SAAU;AACrBpD,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,QAAQ,EAAEA,QAAS;AACnBG,IAAAA,SAAS,EAAEA,SAAU;AACrBY,IAAAA,gBAAgB,EAAEA,gBAAiB;AACnCR,IAAAA,gBAAgB,EAAEA,gBAAAA;GACrB,CACO,CAAC,EACZD,eAAe,iBACZ8E,KAAA,CAAAC,aAAA,CAACO,8BAAgB,EAAA;AACbC,IAAAA,GAAG,EAAEjD,WAAY;IACjB2C,SAAS,EAAEO,QAAE,CAAC9D,qBAAO,CAACsE,aAAa,EAAE9D,qBAAqB,EAAEoB,iBAAiB,CAAA;GAE5E9D,EAAAA,GACa,CAEP,CACR,CAAC,CAAA;AAExB;;;;"}
1
+ {"version":3,"file":"Single.js","sources":["../../../../../src/components/Slider/components/Single/Single.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState, useRef } from 'react';\nimport type { FC } from 'react';\n\nimport { SliderBase } from '../SliderBase/SliderBase';\nimport { Handle } from '../../ui';\nimport { sizeData } from '../../utils';\nimport type { HandleProps } from '../../ui';\nimport { cx, isNumber } from '../../../../utils';\nimport { classes } from '../../Slider.tokens';\n\nimport type { SingleSliderProps } from './Single.types';\nimport {\n Label,\n LabelContentLeft,\n LabelWrapper,\n SingleWrapper,\n SliderBaseWrapper,\n StyledRangeValue,\n} from './Single.styles';\n\nexport const SingleSlider: FC<SingleSliderProps> = ({\n min,\n max,\n value,\n disabled,\n onChangeCommitted,\n onChange,\n ariaLabel,\n label,\n labelContentLeft,\n showRangeValues,\n showCurrentValue,\n hideMinValueDiff,\n hideMaxValueDiff,\n labelPlacement = 'outer',\n rangeValuesPlacement = 'outer',\n multipleStepSize = 10,\n size = 'm',\n ...rest\n}) => {\n const [state, setState] = useState({\n xHandle: 0,\n stepSize: 0,\n railFillWidth: 0,\n });\n\n const { stepSize } = state;\n\n const hasLabelContent = label || labelContentLeft;\n const labelPlacementClass = labelPlacement === 'outer' ? classes.labelPlacementOuter : classes.labelPlacementInner;\n const rangeValuesPlacementClass =\n rangeValuesPlacement === 'outer' ? classes.rangeValuesPlacementOuter : classes.rangeValuesPlacementInner;\n const hideMinValueDiffClass = hideMinValueDiff && value - min <= hideMinValueDiff ? classes.hideMinValue : '';\n const hideMaxValueDiffClass = hideMaxValueDiff && max - value <= hideMaxValueDiff ? classes.hideMaxValue : '';\n\n const startLabelRef = useRef<HTMLDivElement>(null);\n const endLabelRef = useRef<HTMLDivElement>(null);\n\n const [startOffset, setStartOffset] = useState(0);\n const [endOffset, setEndOffset] = useState(0);\n\n const [dragValue, setDragValue] = useState(value);\n\n const activeFirstValue = dragValue === min ? classes.activeRangeValue : undefined;\n const activeSecondValue = dragValue === max ? classes.activeRangeValue : undefined;\n\n useEffect(() => {\n const localValue = Math.min(Math.max(value, min), max) - min;\n\n if (rangeValuesPlacement === 'outer') {\n const startWidth = startLabelRef.current?.offsetWidth;\n if (isNumber(startWidth)) {\n setStartOffset(Number(startWidth));\n }\n\n const endWidth = endLabelRef.current?.offsetWidth;\n if (isNumber(endWidth)) {\n setEndOffset(Number(endWidth));\n }\n } else {\n setStartOffset(1);\n setEndOffset(1);\n }\n\n setState((prevState) => ({\n ...prevState,\n xHandle: stepSize * localValue,\n railFillWidth: stepSize * localValue,\n }));\n }, [value, labelPlacement, stepSize, rangeValuesPlacement, min, max, setStartOffset, setEndOffset]);\n\n const setStepSize = useCallback((newStepSize: number) => {\n setState((prevState) => ({\n ...prevState,\n stepSize: newStepSize,\n }));\n }, []);\n\n const onHandleChange = useCallback<NonNullable<HandleProps['onChange']>>(\n (handleValue, data) => {\n const newHandleXPosition = data.x;\n setState((prevState) => ({\n ...prevState,\n railFillWidth: newHandleXPosition,\n }));\n\n if (onChange) {\n onChange(handleValue);\n }\n\n setDragValue(handleValue);\n },\n [onChange, setDragValue],\n );\n\n const onHandleChangeCommitted = useCallback<NonNullable<HandleProps['onChangeCommitted']>>(\n (handleValue, data) => {\n onChangeCommitted && onChangeCommitted(handleValue);\n setState((prevState) => ({\n ...prevState,\n xHandle: data.lastX,\n railFillWidth: data.lastX,\n }));\n\n setDragValue(handleValue);\n },\n [onChangeCommitted, setDragValue],\n );\n\n return (\n <SingleWrapper className={labelPlacementClass}>\n {hasLabelContent && (\n <LabelWrapper>\n {labelContentLeft && <LabelContentLeft>{labelContentLeft}</LabelContentLeft>}\n {label && <Label>{label}</Label>}\n </LabelWrapper>\n )}\n <SliderBaseWrapper className={rangeValuesPlacementClass}>\n {showRangeValues && (\n <StyledRangeValue ref={startLabelRef} className={cx(hideMinValueDiffClass, activeFirstValue)}>\n {min}\n </StyledRangeValue>\n )}\n <SliderBase\n min={min}\n max={max}\n disabled={disabled}\n setStepSize={setStepSize}\n onChange={onHandleChangeCommitted}\n railFillWidth={state.railFillWidth}\n settings={sizeData[size]}\n labelPlacement={labelPlacement}\n rangeValuesPlacement={rangeValuesPlacement}\n {...rest}\n >\n <Handle\n stepSize={state.stepSize}\n onChangeCommitted={onHandleChangeCommitted}\n onChange={onHandleChange}\n xPosition={state.xHandle}\n min={min}\n max={max}\n startOffset={startOffset}\n endOffset={endOffset}\n value={value}\n disabled={disabled}\n ariaLabel={ariaLabel}\n multipleStepSize={multipleStepSize}\n showCurrentValue={showCurrentValue}\n />\n </SliderBase>\n {showRangeValues && (\n <StyledRangeValue\n ref={endLabelRef}\n className={cx(classes.maxRangeValue, hideMaxValueDiffClass, activeSecondValue)}\n >\n {max}\n </StyledRangeValue>\n )}\n </SliderBaseWrapper>\n </SingleWrapper>\n );\n};\n"],"names":["SingleSlider","_ref","min","max","value","disabled","onChangeCommitted","onChange","ariaLabel","label","labelContentLeft","showRangeValues","showCurrentValue","hideMinValueDiff","hideMaxValueDiff","_ref$labelPlacement","labelPlacement","_ref$rangeValuesPlace","rangeValuesPlacement","_ref$multipleStepSize","multipleStepSize","_ref$size","size","rest","_objectWithoutProperties","_excluded","_useState","useState","xHandle","stepSize","railFillWidth","_useState2","_slicedToArray","state","setState","hasLabelContent","labelPlacementClass","classes","labelPlacementOuter","labelPlacementInner","rangeValuesPlacementClass","rangeValuesPlacementOuter","rangeValuesPlacementInner","hideMinValueDiffClass","hideMinValue","hideMaxValueDiffClass","hideMaxValue","startLabelRef","useRef","endLabelRef","_useState3","_useState4","startOffset","setStartOffset","_useState5","_useState6","endOffset","setEndOffset","_useState7","_useState8","dragValue","setDragValue","activeFirstValue","activeRangeValue","undefined","activeSecondValue","useEffect","localValue","Math","_startLabelRef$curren","_endLabelRef$current","startWidth","current","offsetWidth","isNumber","Number","endWidth","prevState","_objectSpread","setStepSize","useCallback","newStepSize","onHandleChange","handleValue","data","newHandleXPosition","x","onHandleChangeCommitted","lastX","React","createElement","SingleWrapper","className","LabelWrapper","LabelContentLeft","Label","SliderBaseWrapper","StyledRangeValue","ref","cx","SliderBase","_extends","settings","sizeData","Handle","xPosition","maxRangeValue"],"mappings":";;;;;;;;;;;;;;;;IAoBaA,YAAmC,GAAG,SAAtCA,YAAmCA,CAA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EA,QAAS;AACnBG,IAAAA,SAAS,EAAEA,SAAU;AACrBY,IAAAA,gBAAgB,EAAEA,gBAAiB;AACnCR,IAAAA,gBAAgB,EAAEA,gBAAAA;GACrB,CACO,CAAC,EACZD,eAAe,iBACZ8E,KAAA,CAAAC,aAAA,CAACO,8BAAgB,EAAA;AACbC,IAAAA,GAAG,EAAEjD,WAAY;IACjB2C,SAAS,EAAEO,QAAE,CAAC9D,qBAAO,CAACqE,aAAa,EAAE7D,qBAAqB,EAAEoB,iBAAiB,CAAA;GAE5E9D,EAAAA,GACa,CAEP,CACR,CAAC,CAAA;AAExB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type { ComponentConfig, HTMLAnyAttributes, HTMLTagList, PropsType, Variants } from './types';\n\nexport const getStaticVariants = (config: ComponentConfig) => {\n if (!config.variations) {\n return [];\n }\n const res = [];\n const { variations } = config;\n\n // eslint-disable-next-line guard-for-in\n for (const key in variations) {\n const { css } = variations[key];\n css && res.push(css);\n }\n\n return res;\n};\n\nexport const getDynamicVariants = (config: ComponentConfig) => {\n return (props: HTMLAnyAttributes) => {\n const res = [];\n\n // eslint-disable-next-line guard-for-in\n for (const key in config.variations) {\n if (key in props) {\n const variant = config.variations[key];\n\n const css = variant[props[key]];\n // no css for { modifier: true }\n css && Array.isArray(css) ? res.push(...css) : res.push(css);\n }\n }\n\n return res;\n };\n};\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends React.HTMLAttributes<HTMLElement>,\n LayoutPropsUser extends React.HTMLAttributes<HTMLElement> | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\nexport function component<\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutProps extends React.HTMLAttributes<HTMLElement>\n>(\n config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>,\n): React.FunctionComponent<VariantsProps & LayoutProps> {\n const Comp = config.layout(_component((config as unknown) as ComponentConfig));\n\n return React.forwardRef<VariantsProps & LayoutProps, any>((props, ref) => (\n <Comp {...config?.defaults} {...props} ref={ref} />\n ));\n}\n"],"names":["getStaticVariants","config","variations","res","key","css","push","getDynamicVariants","props","variant","Array","isArray","apply","_toConsumableArray","mergeConfig","baseConfig","userConfig","_objectSpread","attrs","defaults","component","Comp","layout","_component","React","forwardRef","ref","createElement","_extends"],"mappings":";;;;;;;;IAKaA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,MAAuB,EAAK;AAC1D,EAAA,IAAI,CAACA,MAAM,CAACC,UAAU,EAAE;AACpB,IAAA,OAAO,EAAE,CAAA;AACb,GAAA;EACA,IAAMC,GAAG,GAAG,EAAE,CAAA;AACd,EAAA,IAAQD,UAAU,GAAKD,MAAM,CAArBC,UAAU,CAAA;;AAElB;AACA,EAAA,KAAK,IAAME,GAAG,IAAIF,UAAU,EAAE;AAC1B,IAAA,IAAQ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AAI,EAAAO,iCAAA,CAAA,EAAA,EAAK3B,MAAM,KAAA,IAAA,IAANA,MAAM,KAANA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,MAAM,CAAEkB,QAAQ,EAAMX,KAAK,EAAA;AAAEkB,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CAAC,CAAA;AAAA,GACtD,CAAC,CAAA;AACN;;;;;;;"}
1
+ {"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type { ComponentConfig, HTMLAnyAttributes, HTMLTagList, PropsType, Variants } from './types';\n\nexport const getStaticVariants = (config: ComponentConfig) => {\n if (!config.variations) {\n return [];\n }\n const res = [];\n const { variations } = config;\n\n // eslint-disable-next-line guard-for-in\n for (const key in variations) {\n const { css } = variations[key];\n css && res.push(css);\n }\n\n return res;\n};\n\nexport const getDynamicVariants = (config: ComponentConfig) => {\n return (props: HTMLAnyAttributes) => {\n const res = [];\n\n // eslint-disable-next-line guard-for-in\n for (const key in config.variations) {\n if (key in props) {\n const variant = config.variations[key];\n\n const css = variant[props[key]];\n // no css for { modifier: true }\n css && Array.isArray(css) ? res.push(...css) : res.push(css);\n }\n }\n\n return res;\n };\n};\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends React.HTMLAttributes<HTMLElement> | Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>,\n LayoutPropsUser extends\n | React.HTMLAttributes<HTMLElement>\n | Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>\n | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\nexport function component<\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutProps extends React.HTMLAttributes<HTMLElement> | Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>\n>(\n config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>,\n): React.FunctionComponent<VariantsProps & LayoutProps> {\n const Comp = config.layout(_component((config as unknown) as ComponentConfig));\n\n return React.forwardRef<VariantsProps & LayoutProps, any>((props, ref) => (\n <Comp {...config?.defaults} {...props} ref={ref} />\n ));\n}\n"],"names":["getStaticVariants","config","variations","res","key","css","push","getDynamicVariants","props","variant","Array","isArray","apply","_toConsumableArray","mergeConfig","baseConfig","userConfig","_objectSpread","attrs","defaults","component","Comp","layout","_component","React","forwardRef","ref","createElement","_extends"],"mappings":";;;;;;;;IAKaA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,MAAuB,EAAK;AAC1D,EAAA,IAAI,CAACA,MAAM,CAACC,UAAU,EAAE;AACpB,IAAA,OAAO,EAAE,CAAA;AACb,GAAA;EACA,IAAMC,GAAG,GAAG,EAAE,CAAA;AACd,EAAA,IAAQD,UAAU,GAAKD,MAAM,CAArBC,UAAU,CAAA;;AAElB;AACA,EAAA,KAAK,IAAME,GAAG,IAAIF,UAAU,EAAE;AAC1B,IAAA,IAAQG,GAAG,GAAK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CAAA,CAAA,EAAA,EAAK3B,MAAM,KAAA,IAAA,IAANA,MAAM,KAANA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,MAAM,CAAEkB,QAAQ,EAAMX,KAAK,EAAA;AAAEkB,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CAAC,CAAA;AAAA,GACtD,CAAC,CAAA;AACN;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/engines/index.ts"],"sourcesContent":["import { css as cssLibrary } from '@linaria/core';\n\nimport type { CSS } from './types';\n\nexport const css = cssLibrary as CSS;\nexport { mergeConfig, component } from './common';\n\nexport type { Variant, ComponentConfig, RootProps, CSS } from './types';\n"],"names":["css","cssLibrary"],"mappings":";;;;;;;;AAIO,IAAMA,GAAG,GAAGC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/engines/index.ts"],"sourcesContent":["import { css as cssLibrary } from '@linaria/core';\n\nimport type { CSS } from './types';\n\nexport const css = cssLibrary as CSS;\nexport { mergeConfig, component } from './common';\n\nexport type { Variant, ComponentConfig, RootProps, CSS, RootPropsOmitOnChange } from './types';\n"],"names":["css","cssLibrary"],"mappings":";;;;;;;;AAIO,IAAMA,GAAG,GAAGC;;;;"}
@@ -6,14 +6,14 @@ import { base as base$2 } from './variations/_disabled/base.js';
6
6
  import { SingleSlider } from './components/Single/Single.js';
7
7
  import { DoubleSlider } from './components/Double/Double.js';
8
8
 
9
- var isSingleValueProps = function isSingleValueProps(props) {
10
- return typeof props.value === 'number';
11
- };
12
-
13
9
  /**
14
10
  * Слайдер позволяет определить числовое значение в пределах указанного промежутка.
15
11
  * Можно указать два значения.
16
12
  */
13
+
14
+ var isSingleValueProps = function isSingleValueProps(props) {
15
+ return typeof props.value === 'number';
16
+ };
17
17
  var sliderRoot = function sliderRoot(Root) {
18
18
  return /*#__PURE__*/forwardRef(function (props, ref) {
19
19
  if (isSingleValueProps(props)) {
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport type { RootProps } from '../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { SingleSlider, DoubleSlider } from './components';\nimport type { SingleSliderProps } from './components';\nimport { SliderProps } from './Slider.types';\n\nconst isSingleValueProps = (props: SliderProps): props is SingleSliderProps => typeof props.value === 'number';\n\n/**\n * Слайдер позволяет определить числовое значение в пределах указанного промежутка.\n * Можно указать два значения.\n */\nexport const sliderRoot = (Root: RootProps<HTMLDivElement, SliderProps>) =>\n forwardRef<HTMLDivElement, SliderProps>((props, ref) => {\n if (isSingleValueProps(props)) {\n return (\n <Root ref={ref} {...props}>\n <SingleSlider {...props} />\n </Root>\n );\n }\n return (\n <Root ref={ref} {...props}>\n <DoubleSlider {...props} />\n </Root>\n );\n });\n\nexport const sliderConfig = {\n name: 'Slider',\n tag: 'div',\n layout: sliderRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["isSingleValueProps","props","value","sliderRoot","Root","forwardRef","ref","React","createElement","_extends","SingleSlider","DoubleSlider","sliderConfig","name","tag","layout","base","variations","view","css","viewCSS","size","sizeCSS","disabled","disabledCSS","attrs","defaults"],"mappings":";;;;;;;;AAWA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,KAAkB,EAAA;AAAA,EAAA,OAAiC,OAAOA,KAAK,CAACC,KAAK,KAAK,QAAQ,CAAA;AAAA,CAAA,CAAA;;AAE9G;AACA;AACA;AACA;IACaC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAA4C,EAAA;AAAA,EAAA,oBACnEC,UAAU,CAA8B,UAACJ,KAAK,EAAEK,GAAG,EAAK;AACpD,IAAA,IAAIN,kBAAkB,CAACC,KAAK,CAAC,EAAE;AAC3B,MAAA,oBACIM,KAAA,CAAAC,aAAA,CAACJ,IAAI,EAAAK,QAAA,CAAA;AAACH,QAAAA,GAAG,EAAEA,GAAAA;OAASL,EAAAA,KAAK,CACrBM,eAAAA,KAAA,CAAAC,aAAA,CAACE,YAAY,EAAKT,KAAQ,CACxB,CAAC,CAAA;AAEf,KAAA;AACA,IAAA,oBACIM,KAAA,CAAAC,aAAA,CAACJ,IAAI,EAAAK,QAAA,CAAA;AAACH,MAAAA,GAAG,EAAEA,GAAAA;KAASL,EAAAA,KAAK,CACrBM,eAAAA,KAAA,CAAAC,aAAA,CAACG,YAAY,EAAKV,KAAQ,CACxB,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMW,YAAY,GAAG;AACxBC,EAAAA,IAAI,EAAE,QAAQ;AACdC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEZ,UAAU;AAClBa,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,IAAAA;KACR;AACDC,IAAAA,IAAI,EAAE;AACFF,MAAAA,GAAG,EAAEG,MAAAA;KACR;AACDC,IAAAA,QAAQ,EAAE;AACNJ,MAAAA,GAAG,EAAEK,MAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNR,IAAAA,IAAI,EAAE,SAAS;AACfG,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
1
+ {"version":3,"file":"Slider.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport type { RootPropsOmitOnChange } from '../../engines';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { SingleSlider, DoubleSlider } from './components';\nimport type { SingleSliderProps } from './components';\nimport { SliderProps } from './Slider.types';\n\n/**\n * Слайдер позволяет определить числовое значение в пределах указанного промежутка.\n * Можно указать два значения.\n */\n\nconst isSingleValueProps = (props: SliderProps): props is SingleSliderProps => typeof props.value === 'number';\nexport const sliderRoot = (Root: RootPropsOmitOnChange<HTMLDivElement, SliderProps>) =>\n forwardRef<HTMLDivElement, SliderProps>((props, ref) => {\n if (isSingleValueProps(props)) {\n return (\n <Root ref={ref} {...props}>\n <SingleSlider {...props} />\n </Root>\n );\n }\n return (\n <Root ref={ref} {...props}>\n <DoubleSlider {...props} />\n </Root>\n );\n });\n\nexport const sliderConfig = {\n name: 'Slider',\n tag: 'div',\n layout: sliderRoot,\n base: '',\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["isSingleValueProps","props","value","sliderRoot","Root","forwardRef","ref","React","createElement","_extends","SingleSlider","DoubleSlider","sliderConfig","name","tag","layout","base","variations","view","css","viewCSS","size","sizeCSS","disabled","disabledCSS","attrs","defaults"],"mappings":";;;;;;;;AAWA;AACA;AACA;AACA;;AAEA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,KAAkB,EAAA;AAAA,EAAA,OAAiC,OAAOA,KAAK,CAACC,KAAK,KAAK,QAAQ,CAAA;AAAA,CAAA,CAAA;IACjGC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAwD,EAAA;AAAA,EAAA,oBAC/EC,UAAU,CAA8B,UAACJ,KAAK,EAAEK,GAAG,EAAK;AACpD,IAAA,IAAIN,kBAAkB,CAACC,KAAK,CAAC,EAAE;AAC3B,MAAA,oBACIM,KAAA,CAAAC,aAAA,CAACJ,IAAI,EAAAK,QAAA,CAAA;AAACH,QAAAA,GAAG,EAAEA,GAAAA;OAASL,EAAAA,KAAK,CACrBM,eAAAA,KAAA,CAAAC,aAAA,CAACE,YAAY,EAAKT,KAAQ,CACxB,CAAC,CAAA;AAEf,KAAA;AACA,IAAA,oBACIM,KAAA,CAAAC,aAAA,CAACJ,IAAI,EAAAK,QAAA,CAAA;AAACH,MAAAA,GAAG,EAAEA,GAAAA;KAASL,EAAAA,KAAK,CACrBM,eAAAA,KAAA,CAAAC,aAAA,CAACG,YAAY,EAAKV,KAAQ,CACxB,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMW,YAAY,GAAG;AACxBC,EAAAA,IAAI,EAAE,QAAQ;AACdC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAEZ,UAAU;AAClBa,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,IAAAA;KACR;AACDC,IAAAA,IAAI,EAAE;AACFF,MAAAA,GAAG,EAAEG,MAAAA;KACR;AACDC,IAAAA,QAAQ,EAAE;AACNJ,MAAAA,GAAG,EAAEK,MAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNR,IAAAA,IAAI,EAAE,SAAS;AACfG,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
@@ -9,7 +9,7 @@ import { classes } from '../../Slider.tokens.js';
9
9
  import { DoubleWrapper, LabelWrapper, LabelContentLeft, Label, SliderWrapper, InputsWrapper, StyledInput } from './Double.styles.js';
10
10
  import { isNumber } from '../../../../utils/isNumber.js';
11
11
 
12
- var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "onChangeCommitted", "onChangeDrag", "ariaLabel", "multipleStepSize"];
12
+ var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "onChangeCommitted", "onChange", "ariaLabel", "multipleStepSize"];
13
13
  function getXCenterHandle(handle) {
14
14
  var _handle$parentElement;
15
15
  var containerX = ((_handle$parentElement = handle.parentElement) === null || _handle$parentElement === void 0 || (_handle$parentElement = _handle$parentElement.getBoundingClientRect()) === null || _handle$parentElement === void 0 ? void 0 : _handle$parentElement.x) || 0;
@@ -27,7 +27,7 @@ var DoubleSlider = function DoubleSlider(_ref) {
27
27
  _ref$size = _ref.size,
28
28
  size = _ref$size === void 0 ? 'm' : _ref$size,
29
29
  onChangeCommitted = _ref.onChangeCommitted,
30
- onChangeDrag = _ref.onChangeDrag,
30
+ onChange = _ref.onChange,
31
31
  ariaLabel = _ref.ariaLabel,
32
32
  _ref$multipleStepSize = _ref.multipleStepSize,
33
33
  multipleStepSize = _ref$multipleStepSize === void 0 ? 10 : _ref$multipleStepSize,
@@ -104,11 +104,11 @@ var DoubleSlider = function DoubleSlider(_ref) {
104
104
  railFillXPosition: newHandleXPosition
105
105
  });
106
106
  });
107
- if (onChangeDrag) {
108
- onChangeDrag([handleValue, value[1]]);
107
+ if (onChange) {
108
+ onChange([handleValue, value[1]]);
109
109
  }
110
110
  }
111
- }, [onChangeDrag, value]);
111
+ }, [onChange, value]);
112
112
  var onFirstHandleChangeCommitted = useCallback(function (handleValue, data) {
113
113
  setFirstValue(handleValue);
114
114
  onChangeCommitted && onChangeCommitted([handleValue, value[1]]);
@@ -152,11 +152,11 @@ var DoubleSlider = function DoubleSlider(_ref) {
152
152
  railFillXPosition: firstXHandleXPosition
153
153
  });
154
154
  });
155
- if (onChangeDrag) {
156
- onChangeDrag([value[0], handleValue]);
155
+ if (onChange) {
156
+ onChange([value[0], handleValue]);
157
157
  }
158
158
  }
159
- }, [onChangeDrag, value]);
159
+ }, [onChange, value]);
160
160
  var onSecondHandleChangeCommitted = useCallback(function (handleValue, data) {
161
161
  onChangeCommitted && onChangeCommitted([value[0], handleValue]);
162
162
  setSecondValue(handleValue);
@@ -1 +1 @@
1
- {"version":3,"file":"Double.js","sources":["../../../../../src/components/Slider/components/Double/Double.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport type { FC, ChangeEvent } from 'react';\n\nimport { SliderBase } from '../SliderBase/SliderBase';\nimport { Handle } from '../../ui';\nimport type { HandleProps } from '../../ui';\nimport { sizeData } from '../../utils';\nimport { cx, isNumber } from '../../../../utils';\nimport { classes } from '../../Slider.tokens';\n\nimport { DoubleSliderProps } from './Double.types';\nimport {\n SliderWrapper,\n InputsWrapper,\n Label,\n LabelContentLeft,\n LabelWrapper,\n StyledInput,\n DoubleWrapper,\n} from './Double.styles';\n\nfunction getXCenterHandle(handle: HTMLDivElement) {\n const containerX = handle.parentElement?.getBoundingClientRect()?.x || 0;\n const handleRect = handle.getBoundingClientRect();\n const handlePosition = handleRect.x;\n return handlePosition - containerX;\n}\n\nexport const DoubleSlider: FC<DoubleSliderProps> = ({\n min,\n max,\n value,\n disabled,\n label,\n labelContentLeft,\n size = 'm',\n onChangeCommitted,\n onChangeDrag,\n ariaLabel,\n multipleStepSize = 10,\n ...rest\n}) => {\n const [state, setState] = useState({\n stepSize: 0,\n railFillWidth: 0,\n railFillXPosition: 0,\n xFirstHandle: 0,\n xSecondHandle: 0,\n firstHandleZIndex: 100,\n secondHandleZIndex: 101,\n firstValue: value[0],\n secondValue: value[1],\n });\n const [firstInputActive, setFirstInputActive] = useState(false);\n const [secondInputActive, setSecondInputActive] = useState(false);\n\n const firstHandleRef = useRef<HTMLDivElement | null>(null);\n const secondHandleRef = useRef<HTMLDivElement | null>(null);\n\n const firstHandleValue = useRef<number>(value[0]);\n const secondHandleValue = useRef<number>(value[1]);\n\n const [firstValue, setFirstValue] = useState<number>(value[0]);\n const [secondValue, setSecondValue] = useState<number>(value[1]);\n\n const { stepSize } = state;\n\n const hasLabelContent = label || labelContentLeft;\n const firstInputActiveClass = firstInputActive && !disabled ? classes.textFieldActive : undefined;\n const secondInputActiveClass = secondInputActive && !disabled ? classes.textFieldActive : undefined;\n\n useEffect(() => {\n const firstLocalValue = Math.min(Math.max(value[0], min), max) - min;\n const secondLocalValue = Math.min(Math.max(value[1], min), max) - min;\n setState((prevState) => ({\n ...prevState,\n railFillXPosition: stepSize * firstLocalValue,\n railFillWidth: stepSize * secondLocalValue - stepSize * firstLocalValue,\n xFirstHandle: stepSize * firstLocalValue,\n xSecondHandle: stepSize * secondLocalValue,\n }));\n }, [value, stepSize, min, max]);\n\n const setStepSize = useCallback((newStepSize: number) => {\n setState((prevState) => ({\n ...prevState,\n stepSize: newStepSize,\n }));\n }, []);\n\n const onFirstHandleChange = useCallback<NonNullable<HandleProps['onChange']>>(\n (handleValue, data) => {\n if (secondHandleRef?.current) {\n const newHandleXPosition = data.x;\n const secondHandleXPosition = getXCenterHandle(secondHandleRef.current);\n const fillWidth = secondHandleXPosition - newHandleXPosition;\n\n firstHandleValue.current = handleValue;\n\n setFirstValue(handleValue);\n\n setState((prevState) => ({\n ...prevState,\n firstHandleZIndex: 101,\n secondHandleZIndex: 100,\n railFillWidth: fillWidth < 0 ? 0 : fillWidth,\n railFillXPosition: newHandleXPosition,\n }));\n if (onChangeDrag) {\n onChangeDrag([handleValue, value[1]]);\n }\n }\n },\n [onChangeDrag, value],\n );\n\n const onFirstHandleChangeCommitted = useCallback<NonNullable<HandleProps['onChangeCommitted']>>(\n (handleValue, data) => {\n setFirstValue(handleValue);\n onChangeCommitted && onChangeCommitted([handleValue, value[1]]);\n\n setState((prevState) => ({\n ...prevState,\n firstValue: handleValue,\n xFirstHandle: data.lastX,\n }));\n },\n [onChangeCommitted, value],\n );\n\n const onFirstTextfieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!isNumber(event.target.value)) return;\n\n const handleValue = Number(event.target.value);\n\n setFirstValue(handleValue);\n },\n [isNumber, setFirstValue],\n );\n\n const onFirstTextfieldEnter = useCallback(\n (newValue: string) => {\n if (!isNumber(newValue)) return;\n\n const handleValue = Math.min(Math.max(Number(newValue), min), value[1]);\n const handleValueLocal = Math.min(Math.max(handleValue, min), max) - min;\n\n setFirstValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n firstValue: handleValue,\n xFirstHandle: handleValueLocal * stepSize,\n }));\n\n onChangeCommitted && onChangeCommitted([handleValue, value[1]]);\n },\n [isNumber, onChangeCommitted, setFirstValue, value, min, max, stepSize],\n );\n\n const onSecondHandleChange = useCallback<NonNullable<HandleProps['onChange']>>(\n (handleValue, data) => {\n if (firstHandleRef?.current) {\n const firstXHandleXPosition = getXCenterHandle(firstHandleRef.current);\n\n const newHandleXPosition = data.x;\n const fillWidth = newHandleXPosition - firstXHandleXPosition;\n\n secondHandleValue.current = handleValue;\n\n setSecondValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n firstHandleZIndex: 100,\n secondHandleZIndex: 101,\n railFillWidth: fillWidth < 0 ? 0 : fillWidth,\n railFillXPosition: firstXHandleXPosition,\n }));\n if (onChangeDrag) {\n onChangeDrag([value[0], handleValue]);\n }\n }\n },\n [onChangeDrag, value],\n );\n\n const onSecondHandleChangeCommitted = useCallback<NonNullable<HandleProps['onChangeCommitted']>>(\n (handleValue, data) => {\n onChangeCommitted && onChangeCommitted([value[0], handleValue]);\n setSecondValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n secondValue: handleValue,\n xSecondHandle: data.lastX,\n }));\n },\n [onChangeCommitted, value],\n );\n\n const onSecondTextfieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!isNumber(event.target.value)) return;\n\n const handleValue = Number(event.target.value);\n\n setSecondValue(handleValue);\n },\n [isNumber, setSecondValue],\n );\n\n const onSecondTextfieldEnter = useCallback(\n (newValue: string) => {\n if (!isNumber(newValue)) return;\n\n const handleValue = Math.max(Math.min(Number(newValue), max), value[0]);\n const handleValueLocal = Math.min(Math.max(handleValue, min), max) - min;\n\n setSecondValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n secondValue: handleValue,\n xSecondHandle: handleValueLocal * stepSize,\n }));\n\n onChangeCommitted && onChangeCommitted([value[0], handleValue]);\n },\n [isNumber, setSecondValue, onChangeCommitted, value, min, max, stepSize],\n );\n\n const [ariaLabelLeft, ariaLabelRight] = ariaLabel || [];\n const currentFirstSliderValue = Math.max(state.firstValue, min);\n\n return (\n <DoubleWrapper>\n {hasLabelContent && (\n <LabelWrapper>\n {labelContentLeft && <LabelContentLeft>{labelContentLeft}</LabelContentLeft>}\n {label && <Label>{label}</Label>}\n </LabelWrapper>\n )}\n <SliderWrapper>\n <SliderBase\n min={min}\n max={max}\n disabled={disabled}\n setStepSize={setStepSize}\n railFillWidth={state.railFillWidth}\n settings={sizeData[size]}\n railFillXPosition={state.railFillXPosition}\n {...rest}\n >\n <Handle\n ref={firstHandleRef}\n stepSize={state.stepSize}\n multipleStepSize={multipleStepSize}\n onChangeCommitted={onFirstHandleChangeCommitted}\n onChange={onFirstHandleChange}\n min={min}\n max={state.secondValue}\n disabled={disabled}\n bounds={[min, state.secondValue]}\n side=\"left\"\n xPosition={state.xFirstHandle}\n zIndex={state.firstHandleZIndex}\n value={currentFirstSliderValue}\n ariaLabel={ariaLabelLeft}\n onMouseEnter={() => setFirstInputActive(true)}\n onMouseLeave={() => setFirstInputActive(false)}\n />\n <Handle\n ref={secondHandleRef}\n stepSize={state.stepSize}\n multipleStepSize={multipleStepSize}\n onChangeCommitted={onSecondHandleChangeCommitted}\n onChange={onSecondHandleChange}\n min={min}\n ariaValueMin={currentFirstSliderValue}\n max={max}\n disabled={disabled}\n bounds={[state.firstValue, max]}\n side=\"right\"\n xPosition={state.xSecondHandle}\n zIndex={state.secondHandleZIndex}\n value={Math.max(state.secondValue, min)}\n ariaLabel={ariaLabelRight}\n onMouseEnter={() => setSecondInputActive(true)}\n onMouseLeave={() => setSecondInputActive(false)}\n />\n </SliderBase>\n\n <InputsWrapper>\n <StyledInput\n className={cx(classes.firstTextField, firstInputActiveClass)}\n enumerationType=\"plain\"\n disabled={disabled}\n value={firstValue}\n onChange={(e) => onFirstTextfieldChange(e)}\n onSearch={(e) => onFirstTextfieldEnter(e)}\n />\n <StyledInput\n className={cx(classes.secondTextField, secondInputActiveClass)}\n enumerationType=\"plain\"\n disabled={disabled}\n value={secondValue}\n onChange={(e) => onSecondTextfieldChange(e)}\n onSearch={(e) => onSecondTextfieldEnter(e)}\n />\n </InputsWrapper>\n </SliderWrapper>\n </DoubleWrapper>\n );\n};\n"],"names":["getXCenterHandle","handle","_handle$parentElement","containerX","parentElement","getBoundingClientRect","x","handleRect","handlePosition","DoubleSlider","_ref","min","max","value","disabled","label","labelContentLeft","_ref$size","size","onChangeCommitted","onChangeDrag","ariaLabel","_ref$multipleStepSize","multipleStepSize","rest","_objectWithoutProperties","_excluded","_useState","useState","stepSize","railFillWidth","railFillXPosition","xFirstHandle","xSecondHandle","firstHandleZIndex","secondHandleZIndex","firstValue","secondValue","_useState2","_slicedToArray","state","setState","_useState3","_useState4","firstInputActive","setFirstInputActive","_useState5","_useState6","secondInputActive","setSecondInputActive","firstHandleRef","useRef","secondHandleRef","firstHandleValue","secondHandleValue","_useState7","_useState8","setFirstValue","_useState9","_useState10","setSecondValue","hasLabelContent","firstInputActiveClass","classes","textFieldActive","undefined","secondInputActiveClass","useEffect","firstLocalValue","Math","secondLocalValue","prevState","_objectSpread","setStepSize","useCallback","newStepSize","onFirstHandleChange","handleValue","data","current","newHandleXPosition","secondHandleXPosition","fillWidth","onFirstHandleChangeCommitted","lastX","onFirstTextfieldChange","event","isNumber","target","Number","onFirstTextfieldEnter","newValue","handleValueLocal","onSecondHandleChange","firstXHandleXPosition","onSecondHandleChangeCommitted","onSecondTextfieldChange","onSecondTextfieldEnter","_ref2","_ref3","ariaLabelLeft","ariaLabelRight","currentFirstSliderValue","React","createElement","DoubleWrapper","LabelWrapper","LabelContentLeft","Label","SliderWrapper","SliderBase","_extends","settings","sizeData","Handle","ref","onChange","bounds","side","xPosition","zIndex","onMouseEnter","onMouseLeave","ariaValueMin","InputsWrapper","StyledInput","className","cx","firstTextField","enumerationType","e","onSearch","secondTextField"],"mappings":";;;;;;;;;;;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AsB,CAAC6C,CAAC,CAAC,CAAA;KAAC;IAC3CC,QAAQ,EAAE,SAAAA,QAAAA,CAACD,CAAC,EAAA;MAAA,OAAKxC,qBAAqB,CAACwC,CAAC,CAAC,CAAA;AAAA,KAAA;AAAC,GAC7C,CAAC,eACF3B,KAAA,CAAAC,aAAA,CAACqB,WAAW,EAAA;IACRC,SAAS,EAAEC,EAAE,CAAChE,OAAO,CAACqE,eAAe,EAAElE,sBAAsB,CAAE;AAC/D+D,IAAAA,eAAe,EAAC,OAAO;AACvBnH,IAAAA,QAAQ,EAAEA,QAAS;AACnBD,IAAAA,KAAK,EAAEwB,WAAY;IACnB+E,QAAQ,EAAE,SAAAA,QAAAA,CAACc,CAAC,EAAA;MAAA,OAAKlC,uBAAuB,CAACkC,CAAC,CAAC,CAAA;KAAC;IAC5CC,QAAQ,EAAE,SAAAA,QAAAA,CAACD,CAAC,EAAA;MAAA,OAAKjC,sBAAsB,CAACiC,CAAC,CAAC,CAAA;AAAA,KAAA;GAC7C,CACU,CACJ,CACJ,CAAC,CAAA;AAExB;;;;"}
1
+ {"version":3,"file":"Double.js","sources":["../../../../../src/components/Slider/components/Double/Double.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport type { FC, ChangeEvent } from 'react';\n\nimport { SliderBase } from '../SliderBase/SliderBase';\nimport { Handle } from '../../ui';\nimport type { HandleProps } from '../../ui';\nimport { sizeData } from '../../utils';\nimport { cx, isNumber } from '../../../../utils';\nimport { classes } from '../../Slider.tokens';\n\nimport { DoubleSliderProps } from './Double.types';\nimport {\n SliderWrapper,\n InputsWrapper,\n Label,\n LabelContentLeft,\n LabelWrapper,\n StyledInput,\n DoubleWrapper,\n} from './Double.styles';\n\nfunction getXCenterHandle(handle: HTMLDivElement) {\n const containerX = handle.parentElement?.getBoundingClientRect()?.x || 0;\n const handleRect = handle.getBoundingClientRect();\n const handlePosition = handleRect.x;\n return handlePosition - containerX;\n}\n\nexport const DoubleSlider: FC<DoubleSliderProps> = ({\n min,\n max,\n value,\n disabled,\n label,\n labelContentLeft,\n size = 'm',\n onChangeCommitted,\n onChange,\n ariaLabel,\n multipleStepSize = 10,\n ...rest\n}) => {\n const [state, setState] = useState({\n stepSize: 0,\n railFillWidth: 0,\n railFillXPosition: 0,\n xFirstHandle: 0,\n xSecondHandle: 0,\n firstHandleZIndex: 100,\n secondHandleZIndex: 101,\n firstValue: value[0],\n secondValue: value[1],\n });\n const [firstInputActive, setFirstInputActive] = useState(false);\n const [secondInputActive, setSecondInputActive] = useState(false);\n\n const firstHandleRef = useRef<HTMLDivElement | null>(null);\n const secondHandleRef = useRef<HTMLDivElement | null>(null);\n\n const firstHandleValue = useRef<number>(value[0]);\n const secondHandleValue = useRef<number>(value[1]);\n\n const [firstValue, setFirstValue] = useState<number>(value[0]);\n const [secondValue, setSecondValue] = useState<number>(value[1]);\n\n const { stepSize } = state;\n\n const hasLabelContent = label || labelContentLeft;\n const firstInputActiveClass = firstInputActive && !disabled ? classes.textFieldActive : undefined;\n const secondInputActiveClass = secondInputActive && !disabled ? classes.textFieldActive : undefined;\n\n useEffect(() => {\n const firstLocalValue = Math.min(Math.max(value[0], min), max) - min;\n const secondLocalValue = Math.min(Math.max(value[1], min), max) - min;\n setState((prevState) => ({\n ...prevState,\n railFillXPosition: stepSize * firstLocalValue,\n railFillWidth: stepSize * secondLocalValue - stepSize * firstLocalValue,\n xFirstHandle: stepSize * firstLocalValue,\n xSecondHandle: stepSize * secondLocalValue,\n }));\n }, [value, stepSize, min, max]);\n\n const setStepSize = useCallback((newStepSize: number) => {\n setState((prevState) => ({\n ...prevState,\n stepSize: newStepSize,\n }));\n }, []);\n\n const onFirstHandleChange = useCallback<NonNullable<HandleProps['onChange']>>(\n (handleValue, data) => {\n if (secondHandleRef?.current) {\n const newHandleXPosition = data.x;\n const secondHandleXPosition = getXCenterHandle(secondHandleRef.current);\n const fillWidth = secondHandleXPosition - newHandleXPosition;\n\n firstHandleValue.current = handleValue;\n\n setFirstValue(handleValue);\n\n setState((prevState) => ({\n ...prevState,\n firstHandleZIndex: 101,\n secondHandleZIndex: 100,\n railFillWidth: fillWidth < 0 ? 0 : fillWidth,\n railFillXPosition: newHandleXPosition,\n }));\n if (onChange) {\n onChange([handleValue, value[1]]);\n }\n }\n },\n [onChange, value],\n );\n\n const onFirstHandleChangeCommitted = useCallback<NonNullable<HandleProps['onChangeCommitted']>>(\n (handleValue, data) => {\n setFirstValue(handleValue);\n onChangeCommitted && onChangeCommitted([handleValue, value[1]]);\n\n setState((prevState) => ({\n ...prevState,\n firstValue: handleValue,\n xFirstHandle: data.lastX,\n }));\n },\n [onChangeCommitted, value],\n );\n\n const onFirstTextfieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!isNumber(event.target.value)) return;\n\n const handleValue = Number(event.target.value);\n\n setFirstValue(handleValue);\n },\n [isNumber, setFirstValue],\n );\n\n const onFirstTextfieldEnter = useCallback(\n (newValue: string) => {\n if (!isNumber(newValue)) return;\n\n const handleValue = Math.min(Math.max(Number(newValue), min), value[1]);\n const handleValueLocal = Math.min(Math.max(handleValue, min), max) - min;\n\n setFirstValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n firstValue: handleValue,\n xFirstHandle: handleValueLocal * stepSize,\n }));\n\n onChangeCommitted && onChangeCommitted([handleValue, value[1]]);\n },\n [isNumber, onChangeCommitted, setFirstValue, value, min, max, stepSize],\n );\n\n const onSecondHandleChange = useCallback<NonNullable<HandleProps['onChange']>>(\n (handleValue, data) => {\n if (firstHandleRef?.current) {\n const firstXHandleXPosition = getXCenterHandle(firstHandleRef.current);\n\n const newHandleXPosition = data.x;\n const fillWidth = newHandleXPosition - firstXHandleXPosition;\n\n secondHandleValue.current = handleValue;\n\n setSecondValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n firstHandleZIndex: 100,\n secondHandleZIndex: 101,\n railFillWidth: fillWidth < 0 ? 0 : fillWidth,\n railFillXPosition: firstXHandleXPosition,\n }));\n if (onChange) {\n onChange([value[0], handleValue]);\n }\n }\n },\n [onChange, value],\n );\n\n const onSecondHandleChangeCommitted = useCallback<NonNullable<HandleProps['onChangeCommitted']>>(\n (handleValue, data) => {\n onChangeCommitted && onChangeCommitted([value[0], handleValue]);\n setSecondValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n secondValue: handleValue,\n xSecondHandle: data.lastX,\n }));\n },\n [onChangeCommitted, value],\n );\n\n const onSecondTextfieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n if (!isNumber(event.target.value)) return;\n\n const handleValue = Number(event.target.value);\n\n setSecondValue(handleValue);\n },\n [isNumber, setSecondValue],\n );\n\n const onSecondTextfieldEnter = useCallback(\n (newValue: string) => {\n if (!isNumber(newValue)) return;\n\n const handleValue = Math.max(Math.min(Number(newValue), max), value[0]);\n const handleValueLocal = Math.min(Math.max(handleValue, min), max) - min;\n\n setSecondValue(handleValue);\n setState((prevState) => ({\n ...prevState,\n secondValue: handleValue,\n xSecondHandle: handleValueLocal * stepSize,\n }));\n\n onChangeCommitted && onChangeCommitted([value[0], handleValue]);\n },\n [isNumber, setSecondValue, onChangeCommitted, value, min, max, stepSize],\n );\n\n const [ariaLabelLeft, ariaLabelRight] = ariaLabel || [];\n const currentFirstSliderValue = Math.max(state.firstValue, min);\n\n return (\n <DoubleWrapper>\n {hasLabelContent && (\n <LabelWrapper>\n {labelContentLeft && <LabelContentLeft>{labelContentLeft}</LabelContentLeft>}\n {label && <Label>{label}</Label>}\n </LabelWrapper>\n )}\n <SliderWrapper>\n <SliderBase\n min={min}\n max={max}\n disabled={disabled}\n setStepSize={setStepSize}\n railFillWidth={state.railFillWidth}\n settings={sizeData[size]}\n railFillXPosition={state.railFillXPosition}\n {...rest}\n >\n <Handle\n ref={firstHandleRef}\n stepSize={state.stepSize}\n multipleStepSize={multipleStepSize}\n onChangeCommitted={onFirstHandleChangeCommitted}\n onChange={onFirstHandleChange}\n min={min}\n max={state.secondValue}\n disabled={disabled}\n bounds={[min, state.secondValue]}\n side=\"left\"\n xPosition={state.xFirstHandle}\n zIndex={state.firstHandleZIndex}\n value={currentFirstSliderValue}\n ariaLabel={ariaLabelLeft}\n onMouseEnter={() => setFirstInputActive(true)}\n onMouseLeave={() => setFirstInputActive(false)}\n />\n <Handle\n ref={secondHandleRef}\n stepSize={state.stepSize}\n multipleStepSize={multipleStepSize}\n onChangeCommitted={onSecondHandleChangeCommitted}\n onChange={onSecondHandleChange}\n min={min}\n ariaValueMin={currentFirstSliderValue}\n max={max}\n disabled={disabled}\n bounds={[state.firstValue, max]}\n side=\"right\"\n xPosition={state.xSecondHandle}\n zIndex={state.secondHandleZIndex}\n value={Math.max(state.secondValue, min)}\n ariaLabel={ariaLabelRight}\n onMouseEnter={() => setSecondInputActive(true)}\n onMouseLeave={() => setSecondInputActive(false)}\n />\n </SliderBase>\n\n <InputsWrapper>\n <StyledInput\n className={cx(classes.firstTextField, firstInputActiveClass)}\n enumerationType=\"plain\"\n disabled={disabled}\n value={firstValue}\n onChange={(e) => onFirstTextfieldChange(e)}\n onSearch={(e) => onFirstTextfieldEnter(e)}\n />\n <StyledInput\n className={cx(classes.secondTextField, secondInputActiveClass)}\n enumerationType=\"plain\"\n disabled={disabled}\n value={secondValue}\n onChange={(e) => onSecondTextfieldChange(e)}\n onSearch={(e) => onSecondTextfieldEnter(e)}\n />\n </InputsWrapper>\n </SliderWrapper>\n </DoubleWrapper>\n );\n};\n"],"names":["getXCenterHandle","handle","_handle$parentElement","containerX","parentElement","getBoundingClientRect","x","handleRect","handlePosition","DoubleSlider","_ref","min","max","value","disabled","label","labelContentLeft","_ref$size","size","onChangeCommitted","onChange","ariaLabel","_ref$multipleStepSize","multipleStepSize","rest","_objectWithoutProperties","_excluded","_useState","useState","stepSize","railFillWidth","railFillXPosition","xFirstHandle","xSecondHandle","firstHandleZIndex","secondHandleZIndex","firstValue","secondValue","_useState2","_slicedToArray","state","setState","_useState3","_useState4","firstInputActive","setFirstInputActive","_useState5","_useState6","secondInputActive","setSecondInputActive","firstHandleRef","useRef","secondHandleRef","firstHandleValue","secondHandleValue","_useState7","_useState8","setFirstValue","_useState9","_useState10","setSecondValue","hasLabelContent","firstInputActiveClass","classes","textFieldActive","undefined","secondInputActiveClass","useEffect","firstLocalValue","Math","secondLocalValue","prevState","_objectSpread","setStepSize","useCallback","newStepSize","onFirstHandleChange","handleValue","data","current","newHandleXPosition","secondHandleXPosition","fillWidth","onFirstHandleChangeCommitted","lastX","onFirstTextfieldChange","event","isNumber","target","Number","onFirstTextfieldEnter","newValue","handleValueLocal","onSecondHandleChange","firstXHandleXPosition","onSecondHandleChangeCommitted","onSecondTextfieldChange","onSecondTextfieldEnter","_ref2","_ref3","ariaLabelLeft","ariaLabelRight","currentFirstSliderValue","React","createElement","DoubleWrapper","LabelWrapper","LabelContentLeft","Label","SliderWrapper","SliderBase","_extends","settings","sizeData","Handle","ref","bounds","side","xPosition","zIndex","onMouseEnter","onMouseLeave","ariaValueMin","InputsWrapper","StyledInput","className","cx","firstTextField","enumerationType","e","onSearch","secondTextField"],"mappings":";;;;;;;;;;;;AAqBA,SAASA,gBAAgBA,CAACC,MAAsB,EAAE;AAAA,EAAA,IAAAC,qBAAA,CAAA;EAC9C,IAAMC,UAAU,GAAG,CAAA,CAAAD,qBAAA,GAAAD,MAAM,CAACG,aAAa,MAAAF,IAAAA,IAAAA,qBAAA,KAAAA,KAAAA,CAAAA,IAAAA,CAAAA,qBAAA,GAApBA,qBAAA,CAAsBG,qBAAqB,EAAE,MAAA,IAAA,IAAAH,qBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAA7CA,qBAAA,CAA+CI,CAAC,KAAI,CAAC,CAAA;AACxE,EAAA,IAAMC,UAAU,GAAGN,MAAM,CAACI,qBAAqB,EAAE,CAAA;AACjD,EAAA,IAAMG,cAAc,GAAGD,UAAU,CAACD,CAAC,CAAA;EACnC,OAAOE,cAAc,GAAGL,UAAU,CAAA;AACtC,CAAA;IAEaM,YAAmC,GAAG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CAACD,CAAC,EAAA;MAAA,OAAKhC,sBAAsB,CAACgC,CAAC,CAAC,CAAA;AAAA,KAAA;GAC7C,CACU,CACJ,CACJ,CAAC,CAAA;AAExB;;;;"}
@@ -9,14 +9,14 @@ import { classes } from '../../Slider.tokens.js';
9
9
  import { SingleWrapper, LabelWrapper, LabelContentLeft, Label, SliderBaseWrapper, StyledRangeValue } from './Single.styles.js';
10
10
  import { isNumber } from '../../../../utils/isNumber.js';
11
11
 
12
- var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChangeDrag", "ariaLabel", "label", "labelContentLeft", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "multipleStepSize", "size"];
12
+ var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChange", "ariaLabel", "label", "labelContentLeft", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "multipleStepSize", "size"];
13
13
  var SingleSlider = function SingleSlider(_ref) {
14
14
  var min = _ref.min,
15
15
  max = _ref.max,
16
16
  value = _ref.value,
17
17
  disabled = _ref.disabled,
18
18
  onChangeCommitted = _ref.onChangeCommitted,
19
- onChangeDrag = _ref.onChangeDrag,
19
+ onChange = _ref.onChange,
20
20
  ariaLabel = _ref.ariaLabel,
21
21
  label = _ref.label,
22
22
  labelContentLeft = _ref.labelContentLeft,
@@ -100,11 +100,11 @@ var SingleSlider = function SingleSlider(_ref) {
100
100
  railFillWidth: newHandleXPosition
101
101
  });
102
102
  });
103
- if (onChangeDrag) {
104
- onChangeDrag(handleValue);
103
+ if (onChange) {
104
+ onChange(handleValue);
105
105
  }
106
106
  setDragValue(handleValue);
107
- }, [onChangeDrag, setDragValue]);
107
+ }, [onChange, setDragValue]);
108
108
  var onHandleChangeCommitted = useCallback(function (handleValue, data) {
109
109
  onChangeCommitted && onChangeCommitted(handleValue);
110
110
  setState(function (prevState) {
@@ -1 +1 @@
1
- {"version":3,"file":"Single.js","sources":["../../../../../src/components/Slider/components/Single/Single.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState, useRef } from 'react';\nimport type { FC } from 'react';\n\nimport { SliderBase } from '../SliderBase/SliderBase';\nimport { Handle } from '../../ui';\nimport { sizeData } from '../../utils';\nimport type { HandleProps } from '../../ui';\nimport { cx, isNumber } from '../../../../utils';\nimport { classes } from '../../Slider.tokens';\n\nimport type { SingleSliderProps } from './Single.types';\nimport {\n Label,\n LabelContentLeft,\n LabelWrapper,\n SingleWrapper,\n SliderBaseWrapper,\n StyledRangeValue,\n} from './Single.styles';\n\nexport const SingleSlider: FC<SingleSliderProps> = ({\n min,\n max,\n value,\n disabled,\n onChangeCommitted,\n onChangeDrag,\n ariaLabel,\n label,\n labelContentLeft,\n showRangeValues,\n showCurrentValue,\n hideMinValueDiff,\n hideMaxValueDiff,\n labelPlacement = 'outer',\n rangeValuesPlacement = 'outer',\n multipleStepSize = 10,\n size = 'm',\n ...rest\n}) => {\n const [state, setState] = useState({\n xHandle: 0,\n stepSize: 0,\n railFillWidth: 0,\n });\n\n const { stepSize } = state;\n\n const hasLabelContent = label || labelContentLeft;\n const labelPlacementClass = labelPlacement === 'outer' ? classes.labelPlacementOuter : classes.labelPlacementInner;\n const rangeValuesPlacementClass =\n rangeValuesPlacement === 'outer' ? classes.rangeValuesPlacementOuter : classes.rangeValuesPlacementInner;\n const hideMinValueDiffClass = hideMinValueDiff && value - min <= hideMinValueDiff ? classes.hideMinValue : '';\n const hideMaxValueDiffClass = hideMaxValueDiff && max - value <= hideMaxValueDiff ? classes.hideMaxValue : '';\n\n const startLabelRef = useRef<HTMLDivElement>(null);\n const endLabelRef = useRef<HTMLDivElement>(null);\n\n const [startOffset, setStartOffset] = useState(0);\n const [endOffset, setEndOffset] = useState(0);\n\n const [dragValue, setDragValue] = useState(value);\n\n const activeFirstValue = dragValue === min ? classes.activeRangeValue : undefined;\n const activeSecondValue = dragValue === max ? classes.activeRangeValue : undefined;\n\n useEffect(() => {\n const localValue = Math.min(Math.max(value, min), max) - min;\n\n if (rangeValuesPlacement === 'outer') {\n const startWidth = startLabelRef.current?.offsetWidth;\n if (isNumber(startWidth)) {\n setStartOffset(Number(startWidth));\n }\n\n const endWidth = endLabelRef.current?.offsetWidth;\n if (isNumber(endWidth)) {\n setEndOffset(Number(endWidth));\n }\n } else {\n setStartOffset(1);\n setEndOffset(1);\n }\n\n setState((prevState) => ({\n ...prevState,\n xHandle: stepSize * localValue,\n railFillWidth: stepSize * localValue,\n }));\n }, [value, labelPlacement, stepSize, rangeValuesPlacement, min, max, setStartOffset, setEndOffset]);\n\n const setStepSize = useCallback((newStepSize: number) => {\n setState((prevState) => ({\n ...prevState,\n stepSize: newStepSize,\n }));\n }, []);\n\n const onHandleChange = useCallback<NonNullable<HandleProps['onChange']>>(\n (handleValue, data) => {\n const newHandleXPosition = data.x;\n setState((prevState) => ({\n ...prevState,\n railFillWidth: newHandleXPosition,\n }));\n\n if (onChangeDrag) {\n onChangeDrag(handleValue);\n }\n\n setDragValue(handleValue);\n },\n [onChangeDrag, setDragValue],\n );\n\n const onHandleChangeCommitted = useCallback<NonNullable<HandleProps['onChangeCommitted']>>(\n (handleValue, data) => {\n onChangeCommitted && onChangeCommitted(handleValue);\n setState((prevState) => ({\n ...prevState,\n xHandle: data.lastX,\n railFillWidth: data.lastX,\n }));\n\n setDragValue(handleValue);\n },\n [onChangeCommitted, setDragValue],\n );\n\n return (\n <SingleWrapper className={labelPlacementClass}>\n {hasLabelContent && (\n <LabelWrapper>\n {labelContentLeft && <LabelContentLeft>{labelContentLeft}</LabelContentLeft>}\n {label && <Label>{label}</Label>}\n </LabelWrapper>\n )}\n <SliderBaseWrapper className={rangeValuesPlacementClass}>\n {showRangeValues && (\n <StyledRangeValue ref={startLabelRef} className={cx(hideMinValueDiffClass, activeFirstValue)}>\n {min}\n </StyledRangeValue>\n )}\n <SliderBase\n min={min}\n max={max}\n disabled={disabled}\n setStepSize={setStepSize}\n onChange={onHandleChangeCommitted}\n railFillWidth={state.railFillWidth}\n settings={sizeData[size]}\n labelPlacement={labelPlacement}\n rangeValuesPlacement={rangeValuesPlacement}\n {...rest}\n >\n <Handle\n stepSize={state.stepSize}\n onChangeCommitted={onHandleChangeCommitted}\n onChange={onHandleChange}\n xPosition={state.xHandle}\n min={min}\n max={max}\n startOffset={startOffset}\n endOffset={endOffset}\n value={value}\n disabled={disabled}\n ariaLabel={ariaLabel}\n multipleStepSize={multipleStepSize}\n showCurrentValue={showCurrentValue}\n />\n </SliderBase>\n {showRangeValues && (\n <StyledRangeValue\n ref={endLabelRef}\n className={cx(classes.maxRangeValue, hideMaxValueDiffClass, activeSecondValue)}\n >\n {max}\n </StyledRangeValue>\n )}\n </SliderBaseWrapper>\n </SingleWrapper>\n );\n};\n"],"names":["SingleSlider","_ref","min","max","value","disabled","onChangeCommitted","onChangeDrag","ariaLabel","label","labelContentLeft","showRangeValues","showCurrentValue","hideMinValueDiff","hideMaxValueDiff","_ref$labelPlacement","labelPlacement","_ref$rangeValuesPlace","rangeValuesPlacement","_ref$multipleStepSize","multipleStepSize","_ref$size","size","rest","_objectWithoutProperties","_excluded","_useState","useState","xHandle","stepSize","railFillWidth","_useState2","_slicedToArray","state","setState","hasLabelContent","labelPlacementClass","classes","labelPlacementOuter","labelPlacementInner","rangeValuesPlacementClass","rangeValuesPlacementOuter","rangeValuesPlacementInner","hideMinValueDiffClass","hideMinValue","hideMaxValueDiffClass","hideMaxValue","startLabelRef","useRef","endLabelRef","_useState3","_useState4","startOffset","setStartOffset","_useState5","_useState6","endOffset","setEndOffset","_useState7","_useState8","dragValue","setDragValue","activeFirstValue","activeRangeValue","undefined","activeSecondValue","useEffect","localValue","Math","_startLabelRef$curren","_endLabelRef$current","startWidth","current","offsetWidth","isNumber","Number","endWidth","prevState","_objectSpread","setStepSize","useCallback","newStepSize","onHandleChange","handleValue","data","newHandleXPosition","x","onHandleChangeCommitted","lastX","React","createElement","SingleWrapper","className","LabelWrapper","LabelContentLeft","Label","SliderBaseWrapper","StyledRangeValue","ref","cx","SliderBase","_extends","onChange","settings","sizeData","Handle","xPosition","maxRangeValue"],"mappings":";;;;;;;;;;;;IAoBaA,YAAmC,GAAG,SAAtCA,YAAmCA,CAAAC,IAAA,EAmB1C;AAAA,EAAA,IAlBFC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IACRC,iBAAiB,GAAAL,IAAA,CAAjBK,iBAAiB;IACjBC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,SAAS,GAAAP,IAAA,CAATO,SAAS;IACTC,KAAK,GAAAR,IAAA,CAALQ,KAAK;IACLC,gBAAgB,GAAAT,IAAA,CAAhBS,gBAAgB;IAChBC,eAAe,GAAAV,IAAA,CAAfU,eAAe;IACfC,gBAAgB,GAAAX,IAAA,CAAhBW,gBAAgB;IAChBC,gBAAgB,GAAAZ,IAAA,CAAhBY,gBAAgB;IAChBC,gBAAgB,GAAAb,IAAA,CAAhBa,gBAAgB;IAAAC,mBAAA,GAAAd,IAAA,CAChBe,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,mBAAA;IAAAE,qBAAA,GAAAhB,IAAA,CACxBiB,oBAAoB;AAApBA,IAAAA,oBAAoB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,qBAAA;IAAAE,qBAAA,GAAAlB,IAAA,CAC9BmB,gBAAgB;AAAhBA,IAAAA,gBAAgB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,qBAAA;IAAAE,SAAA,GAAApB,IAAA,CACrBqB,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,GAAG,GAAAA,SAAA;AACPE,IA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AAAA,WAAW,EAAEA,WAAY;AACzBI,IAAAA,SAAS,EAAEA,SAAU;AACrBpD,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,QAAQ,EAAEA,QAAS;AACnBG,IAAAA,SAAS,EAAEA,SAAU;AACrBY,IAAAA,gBAAgB,EAAEA,gBAAiB;AACnCR,IAAAA,gBAAgB,EAAEA,gBAAAA;GACrB,CACO,CAAC,EACZD,eAAe,iBACZ8E,KAAA,CAAAC,aAAA,CAACO,gBAAgB,EAAA;AACbC,IAAAA,GAAG,EAAEjD,WAAY;IACjB2C,SAAS,EAAEO,EAAE,CAAC9D,OAAO,CAACsE,aAAa,EAAE9D,qBAAqB,EAAEoB,iBAAiB,CAAA;GAE5E9D,EAAAA,GACa,CAEP,CACR,CAAC,CAAA;AAExB;;;;"}
1
+ {"version":3,"file":"Single.js","sources":["../../../../../src/components/Slider/components/Single/Single.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState, useRef } from 'react';\nimport type { FC } from 'react';\n\nimport { SliderBase } from '../SliderBase/SliderBase';\nimport { Handle } from '../../ui';\nimport { sizeData } from '../../utils';\nimport type { HandleProps } from '../../ui';\nimport { cx, isNumber } from '../../../../utils';\nimport { classes } from '../../Slider.tokens';\n\nimport type { SingleSliderProps } from './Single.types';\nimport {\n Label,\n LabelContentLeft,\n LabelWrapper,\n SingleWrapper,\n SliderBaseWrapper,\n StyledRangeValue,\n} from './Single.styles';\n\nexport const SingleSlider: FC<SingleSliderProps> = ({\n min,\n max,\n value,\n disabled,\n onChangeCommitted,\n onChange,\n ariaLabel,\n label,\n labelContentLeft,\n showRangeValues,\n showCurrentValue,\n hideMinValueDiff,\n hideMaxValueDiff,\n labelPlacement = 'outer',\n rangeValuesPlacement = 'outer',\n multipleStepSize = 10,\n size = 'm',\n ...rest\n}) => {\n const [state, setState] = useState({\n xHandle: 0,\n stepSize: 0,\n railFillWidth: 0,\n });\n\n const { stepSize } = state;\n\n const hasLabelContent = label || labelContentLeft;\n const labelPlacementClass = labelPlacement === 'outer' ? classes.labelPlacementOuter : classes.labelPlacementInner;\n const rangeValuesPlacementClass =\n rangeValuesPlacement === 'outer' ? classes.rangeValuesPlacementOuter : classes.rangeValuesPlacementInner;\n const hideMinValueDiffClass = hideMinValueDiff && value - min <= hideMinValueDiff ? classes.hideMinValue : '';\n const hideMaxValueDiffClass = hideMaxValueDiff && max - value <= hideMaxValueDiff ? classes.hideMaxValue : '';\n\n const startLabelRef = useRef<HTMLDivElement>(null);\n const endLabelRef = useRef<HTMLDivElement>(null);\n\n const [startOffset, setStartOffset] = useState(0);\n const [endOffset, setEndOffset] = useState(0);\n\n const [dragValue, setDragValue] = useState(value);\n\n const activeFirstValue = dragValue === min ? classes.activeRangeValue : undefined;\n const activeSecondValue = dragValue === max ? classes.activeRangeValue : undefined;\n\n useEffect(() => {\n const localValue = Math.min(Math.max(value, min), max) - min;\n\n if (rangeValuesPlacement === 'outer') {\n const startWidth = startLabelRef.current?.offsetWidth;\n if (isNumber(startWidth)) {\n setStartOffset(Number(startWidth));\n }\n\n const endWidth = endLabelRef.current?.offsetWidth;\n if (isNumber(endWidth)) {\n setEndOffset(Number(endWidth));\n }\n } else {\n setStartOffset(1);\n setEndOffset(1);\n }\n\n setState((prevState) => ({\n ...prevState,\n xHandle: stepSize * localValue,\n railFillWidth: stepSize * localValue,\n }));\n }, [value, labelPlacement, stepSize, rangeValuesPlacement, min, max, setStartOffset, setEndOffset]);\n\n const setStepSize = useCallback((newStepSize: number) => {\n setState((prevState) => ({\n ...prevState,\n stepSize: newStepSize,\n }));\n }, []);\n\n const onHandleChange = useCallback<NonNullable<HandleProps['onChange']>>(\n (handleValue, data) => {\n const newHandleXPosition = data.x;\n setState((prevState) => ({\n ...prevState,\n railFillWidth: newHandleXPosition,\n }));\n\n if (onChange) {\n onChange(handleValue);\n }\n\n setDragValue(handleValue);\n },\n [onChange, setDragValue],\n );\n\n const onHandleChangeCommitted = useCallback<NonNullable<HandleProps['onChangeCommitted']>>(\n (handleValue, data) => {\n onChangeCommitted && onChangeCommitted(handleValue);\n setState((prevState) => ({\n ...prevState,\n xHandle: data.lastX,\n railFillWidth: data.lastX,\n }));\n\n setDragValue(handleValue);\n },\n [onChangeCommitted, setDragValue],\n );\n\n return (\n <SingleWrapper className={labelPlacementClass}>\n {hasLabelContent && (\n <LabelWrapper>\n {labelContentLeft && <LabelContentLeft>{labelContentLeft}</LabelContentLeft>}\n {label && <Label>{label}</Label>}\n </LabelWrapper>\n )}\n <SliderBaseWrapper className={rangeValuesPlacementClass}>\n {showRangeValues && (\n <StyledRangeValue ref={startLabelRef} className={cx(hideMinValueDiffClass, activeFirstValue)}>\n {min}\n </StyledRangeValue>\n )}\n <SliderBase\n min={min}\n max={max}\n disabled={disabled}\n setStepSize={setStepSize}\n onChange={onHandleChangeCommitted}\n railFillWidth={state.railFillWidth}\n settings={sizeData[size]}\n labelPlacement={labelPlacement}\n rangeValuesPlacement={rangeValuesPlacement}\n {...rest}\n >\n <Handle\n stepSize={state.stepSize}\n onChangeCommitted={onHandleChangeCommitted}\n onChange={onHandleChange}\n xPosition={state.xHandle}\n min={min}\n max={max}\n startOffset={startOffset}\n endOffset={endOffset}\n value={value}\n disabled={disabled}\n ariaLabel={ariaLabel}\n multipleStepSize={multipleStepSize}\n showCurrentValue={showCurrentValue}\n />\n </SliderBase>\n {showRangeValues && (\n <StyledRangeValue\n ref={endLabelRef}\n className={cx(classes.maxRangeValue, hideMaxValueDiffClass, activeSecondValue)}\n >\n {max}\n </StyledRangeValue>\n )}\n </SliderBaseWrapper>\n </SingleWrapper>\n );\n};\n"],"names":["SingleSlider","_ref","min","max","value","disabled","onChangeCommitted","onChange","ariaLabel","label","labelContentLeft","showRangeValues","showCurrentValue","hideMinValueDiff","hideMaxValueDiff","_ref$labelPlacement","labelPlacement","_ref$rangeValuesPlace","rangeValuesPlacement","_ref$multipleStepSize","multipleStepSize","_ref$size","size","rest","_objectWithoutProperties","_excluded","_useState","useState","xHandle","stepSize","railFillWidth","_useState2","_slicedToArray","state","setState","hasLabelContent","labelPlacementClass","classes","labelPlacementOuter","labelPlacementInner","rangeValuesPlacementClass","rangeValuesPlacementOuter","rangeValuesPlacementInner","hideMinValueDiffClass","hideMinValue","hideMaxValueDiffClass","hideMaxValue","startLabelRef","useRef","endLabelRef","_useState3","_useState4","startOffset","setStartOffset","_useState5","_useState6","endOffset","setEndOffset","_useState7","_useState8","dragValue","setDragValue","activeFirstValue","activeRangeValue","undefined","activeSecondValue","useEffect","localValue","Math","_startLabelRef$curren","_endLabelRef$current","startWidth","current","offsetWidth","isNumber","Number","endWidth","prevState","_objectSpread","setStepSize","useCallback","newStepSize","onHandleChange","handleValue","data","newHandleXPosition","x","onHandleChangeCommitted","lastX","React","createElement","SingleWrapper","className","LabelWrapper","LabelContentLeft","Label","SliderBaseWrapper","StyledRangeValue","ref","cx","SliderBase","_extends","settings","sizeData","Handle","xPosition","maxRangeValue"],"mappings":";;;;;;;;;;;;IAoBaA,YAAmC,GAAG,SAAtCA,YAAmCA,CAAAC,IAAA,EAmB1C;AAAA,EAAA,IAlBFC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IACRC,iBAAiB,GAAAL,IAAA,CAAjBK,iBAAiB;IACjBC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;IACRC,SAAS,GAAAP,IAAA,CAATO,SAAS;IACTC,KAAK,GAAAR,IAAA,CAALQ,KAAK;IACLC,gBAAgB,GAAAT,IAAA,CAAhBS,gBAAgB;IAChBC,eAAe,GAAAV,IAAA,CAAfU,eAAe;IACfC,gBAAgB,GAAAX,IAAA,CAAhBW,gBAAgB;IAChBC,gBAAgB,GAAAZ,IAAA,CAAhBY,gBAAgB;IAChBC,gBAAgB,GAAAb,IAAA,CAAhBa,gBAAgB;IAAAC,mBAAA,GAAAd,IAA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CzD,aAAa,EAAEG,KAAK,CAACH,aAAc;AACnCwE,IAAAA,QAAQ,EAAEC,QAAQ,CAACjF,IAAI,CAAE;AACzBN,IAAAA,cAAc,EAAEA,cAAe;AAC/BE,IAAAA,oBAAoB,EAAEA,oBAAAA;AAAqB,GAAA,EACvCK,IAAI,CAERkE,eAAAA,KAAA,CAAAC,aAAA,CAACc,MAAM,EAAA;IACH3E,QAAQ,EAAEI,KAAK,CAACJ,QAAS;AACzBvB,IAAAA,iBAAiB,EAAEiF,uBAAwB;AAC3ChF,IAAAA,QAAQ,EAAE2E,cAAe;IACzBuB,SAAS,EAAExE,KAAK,CAACL,OAAQ;AACzB1B,IAAAA,GAAG,EAAEA,GAAI;AACTC,IAAAA,GAAG,EAAEA,GAAI;AACTiD,IAAAA,WAAW,EAAEA,WAAY;AACzBI,IAAAA,SAAS,EAAEA,SAAU;AACrBpD,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,QAAQ,EAAEA,QAAS;AACnBG,IAAAA,SAAS,EAAEA,SAAU;AACrBY,IAAAA,gBAAgB,EAAEA,gBAAiB;AACnCR,IAAAA,gBAAgB,EAAEA,gBAAAA;GACrB,CACO,CAAC,EACZD,eAAe,iBACZ8E,KAAA,CAAAC,aAAA,CAACO,gBAAgB,EAAA;AACbC,IAAAA,GAAG,EAAEjD,WAAY;IACjB2C,SAAS,EAAEO,EAAE,CAAC9D,OAAO,CAACqE,aAAa,EAAE7D,qBAAqB,EAAEoB,iBAAiB,CAAA;GAE5E9D,EAAAA,GACa,CAEP,CACR,CAAC,CAAA;AAExB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type { ComponentConfig, HTMLAnyAttributes, HTMLTagList, PropsType, Variants } from './types';\n\nexport const getStaticVariants = (config: ComponentConfig) => {\n if (!config.variations) {\n return [];\n }\n const res = [];\n const { variations } = config;\n\n // eslint-disable-next-line guard-for-in\n for (const key in variations) {\n const { css } = variations[key];\n css && res.push(css);\n }\n\n return res;\n};\n\nexport const getDynamicVariants = (config: ComponentConfig) => {\n return (props: HTMLAnyAttributes) => {\n const res = [];\n\n // eslint-disable-next-line guard-for-in\n for (const key in config.variations) {\n if (key in props) {\n const variant = config.variations[key];\n\n const css = variant[props[key]];\n // no css for { modifier: true }\n css && Array.isArray(css) ? res.push(...css) : res.push(css);\n }\n }\n\n return res;\n };\n};\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends React.HTMLAttributes<HTMLElement>,\n LayoutPropsUser extends React.HTMLAttributes<HTMLElement> | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\nexport function component<\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutProps extends React.HTMLAttributes<HTMLElement>\n>(\n config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>,\n): React.FunctionComponent<VariantsProps & LayoutProps> {\n const Comp = config.layout(_component((config as unknown) as ComponentConfig));\n\n return React.forwardRef<VariantsProps & LayoutProps, any>((props, ref) => (\n <Comp {...config?.defaults} {...props} ref={ref} />\n ));\n}\n"],"names":["getStaticVariants","config","variations","res","key","css","push","getDynamicVariants","props","variant","Array","isArray","apply","_toConsumableArray","mergeConfig","baseConfig","userConfig","_objectSpread","attrs","defaults","component","Comp","layout","_component","React","forwardRef","ref","createElement","_extends"],"mappings":";;;;IAKaA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,MAAuB,EAAK;AAC1D,EAAA,IAAI,CAACA,MAAM,CAACC,UAAU,EAAE;AACpB,IAAA,OAAO,EAAE,CAAA;AACb,GAAA;EACA,IAAMC,GAAG,GAAG,EAAE,CAAA;AACd,EAAA,IAAQD,UAAU,GAAKD,MAAM,CAArBC,UAAU,CAAA;;AAElB;AACA,EAAA,KAAK,IAAME,GAAG,IAAIF,UAAU,EAAE;AAC1B,IAAA,IAAQG,GAAG,GAAKH,UAAU,CAACE,GAAG,CAAC,CAAvBC,GAAG,CAAA;AACXA,IAAAA,GAAG,IAAIF,GAAG,CAACG,IAAI,CAACD,GAAG,CAAC,CAAA;AACxB,GAAA;AAEA,EAAA,OAAOF,GAAG,CAAA;AACd,EAAC;IAEYI,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIN,MAAuB,EAAK;EAC3D,OAAO,UAACO,KAAwB,EAAK;IACjC,IAAML,GAAG,GAAG,EAAE,CAAA;;AAEd;AACA,IAAA,KAAK,IAAMC,GAAG,IAAIH,MAAM,CAACC,UAAU,EAAE;MACjC,IAAIE,GAAG,IAAII,KAAK,EAAE;AACd,QAAA,IAAMC,OAAO,GAAGR,MAAM,CAACC,UAAU,CAACE,GAAG,CAAC,CAAA;QAEtC,IAAMC,GAAG,GAAGI,OAAO,CAACD,KAAK,CAACJ,GAAG,CAAC,CAAC,CAAA;AAC/B;QACAC,GAAG,IAAIK,KAAK,CAACC,OAAO,CAACN,GAAG,CAAC,GAAGF,GA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A;AACJ,GAAA;;AAEA;EACA,KAAK,IAAMd,IAAG,IAAIW,UAAU,CAACI,QAAQ,IAAI,EAAE,EAAE;AACzC,IAAA,IAAI,EAAEf,IAAG,IAAID,GAAG,CAACgB,QAAQ,CAAC,EAAE;MACxBhB,GAAG,CAACgB,QAAQ,CAACf,IAAG,CAAC,GAAGW,UAAU,CAACI,QAAQ,CAACf,IAAG,CAAC,CAAA;AAChD,KAAA;AACJ,GAAA;AAEA,EAAA,OAAOD,GAAG,CAAA;AAMd,EAAC;AAEM,SAASiB,SAASA,CAMrBnB,MAAqE,EACjB;EACpD,IAAMoB,IAAI,GAAGpB,MAAM,CAACqB,MAAM,CAACC,UAAU,CAAEtB,MAAqC,CAAC,CAAC,CAAA;AAE9E,EAAA,oBAAOuB,KAAK,CAACC,UAAU,CAAmC,UAACjB,KAAK,EAAEkB,GAAG,EAAA;AAAA,IAAA,oBACjEF,KAAA,CAAAG,aAAA,CAACN,IAAI,EAAAO,QAAA,CAAA,EAAA,EAAK3B,MAAM,KAAA,IAAA,IAANA,MAAM,KAANA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,MAAM,CAAEkB,QAAQ,EAAMX,KAAK,EAAA;AAAEkB,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CAAC,CAAA;AAAA,GACtD,CAAC,CAAA;AACN;;;;"}
1
+ {"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type { ComponentConfig, HTMLAnyAttributes, HTMLTagList, PropsType, Variants } from './types';\n\nexport const getStaticVariants = (config: ComponentConfig) => {\n if (!config.variations) {\n return [];\n }\n const res = [];\n const { variations } = config;\n\n // eslint-disable-next-line guard-for-in\n for (const key in variations) {\n const { css } = variations[key];\n css && res.push(css);\n }\n\n return res;\n};\n\nexport const getDynamicVariants = (config: ComponentConfig) => {\n return (props: HTMLAnyAttributes) => {\n const res = [];\n\n // eslint-disable-next-line guard-for-in\n for (const key in config.variations) {\n if (key in props) {\n const variant = config.variations[key];\n\n const css = variant[props[key]];\n // no css for { modifier: true }\n css && Array.isArray(css) ? res.push(...css) : res.push(css);\n }\n }\n\n return res;\n };\n};\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends React.HTMLAttributes<HTMLElement> | Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>,\n LayoutPropsUser extends\n | React.HTMLAttributes<HTMLElement>\n | Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>\n | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\nexport function component<\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutProps extends React.HTMLAttributes<HTMLElement> | Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>\n>(\n config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>,\n): React.FunctionComponent<VariantsProps & LayoutProps> {\n const Comp = config.layout(_component((config as unknown) as ComponentConfig));\n\n return React.forwardRef<VariantsProps & LayoutProps, any>((props, ref) => (\n <Comp {...config?.defaults} {...props} ref={ref} />\n ));\n}\n"],"names":["getStaticVariants","config","variations","res","key","css","push","getDynamicVariants","props","variant","Array","isArray","apply","_toConsumableArray","mergeConfig","baseConfig","userConfig","_objectSpread","attrs","defaults","component","Comp","layout","_component","React","forwardRef","ref","createElement","_extends"],"mappings":";;;;IAKaA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,MAAuB,EAAK;AAC1D,EAAA,IAAI,CAACA,MAAM,CAACC,UAAU,EAAE;AACpB,IAAA,OAAO,EAAE,CAAA;AACb,GAAA;EACA,IAAMC,GAAG,GAAG,EAAE,CAAA;AACd,EAAA,IAAQD,UAAU,GAAKD,MAAM,CAArBC,UAAU,CAAA;;AAElB;AACA,EAAA,KAAK,IAAME,GAAG,IAAIF,UAAU,EAAE;AAC1B,IAAA,IAAQG,GAAG,GAAKH,UAAU,CAACE,GAAG,CAAC,CAAvBC,GAAG,CAAA;AACXA,IAAAA,GAAG,IAAIF,GAAG,CAACG,IAAI,CAACD,GAAG,CAAC,CAAA;AACxB,GAAA;AAEA,EAAA,OAAOF,GAAG,CAAA;AACd,EAAC;IAEYI,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIN,MAAuB,EAAK;EAC3D,OAAO,UAACO,KAAwB,EAAK;IACjC,IAAML,GAAG,GAAG,EAAE,CAAA;;AAEd;AACA,IAAA,KAAK,IAAMC,GAAG,IAAIH,MAAM,CAACC,UAAU,EAAE;MACjC,IAAIE,GAAG,IAAII,KAAK,EAAE;AACd,QAAA,IAAMC,OAAO,GAAGR,MAAM,CAACC,UAAU,CAACE,GAAG,CAAC,CAAA;QAEtC,IAAMC,GAAG,GAAGI,OAAO,CAACD,KAAK,CAACJ,GAAG,CAAC,CAAC,CAAA;AAC/B;QACAC,GAAG,IAAIK,KAAK,CAACC,OAAO,CAACN,GAAG,CAAC,GAAGF,GAAG,CAACG,IAAI,CAAAM,KAA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KAAK,IAAMd,IAAG,IAAIW,UAAU,CAACI,QAAQ,IAAI,EAAE,EAAE;AACzC,IAAA,IAAI,EAAEf,IAAG,IAAID,GAAG,CAACgB,QAAQ,CAAC,EAAE;MACxBhB,GAAG,CAACgB,QAAQ,CAACf,IAAG,CAAC,GAAGW,UAAU,CAACI,QAAQ,CAACf,IAAG,CAAC,CAAA;AAChD,KAAA;AACJ,GAAA;AAEA,EAAA,OAAOD,GAAG,CAAA;AAMd,EAAC;AAEM,SAASiB,SAASA,CAMrBnB,MAAqE,EACjB;EACpD,IAAMoB,IAAI,GAAGpB,MAAM,CAACqB,MAAM,CAACC,UAAU,CAAEtB,MAAqC,CAAC,CAAC,CAAA;AAE9E,EAAA,oBAAOuB,KAAK,CAACC,UAAU,CAAmC,UAACjB,KAAK,EAAEkB,GAAG,EAAA;AAAA,IAAA,oBACjEF,KAAA,CAAAG,aAAA,CAACN,IAAI,EAAAO,QAAA,CAAA,EAAA,EAAK3B,MAAM,KAAA,IAAA,IAANA,MAAM,KAANA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,MAAM,CAAEkB,QAAQ,EAAMX,KAAK,EAAA;AAAEkB,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CAAC,CAAA;AAAA,GACtD,CAAC,CAAA;AACN;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/engines/index.ts"],"sourcesContent":["import { css as cssLibrary } from '@linaria/core';\n\nimport type { CSS } from './types';\n\nexport const css = cssLibrary as CSS;\nexport { mergeConfig, component } from './common';\n\nexport type { Variant, ComponentConfig, RootProps, CSS } from './types';\n"],"names":["css","cssLibrary"],"mappings":";;;;AAIO,IAAMA,GAAG,GAAGC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/engines/index.ts"],"sourcesContent":["import { css as cssLibrary } from '@linaria/core';\n\nimport type { CSS } from './types';\n\nexport const css = cssLibrary as CSS;\nexport { mergeConfig, component } from './common';\n\nexport type { Variant, ComponentConfig, RootProps, CSS, RootPropsOmitOnChange } from './types';\n"],"names":["css","cssLibrary"],"mappings":";;;;AAIO,IAAMA,GAAG,GAAGC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salutejs/plasma-new-hope",
3
- "version": "0.78.0-canary.1194.8928682263.0",
3
+ "version": "0.78.0-canary.1194.8939441533.0",
4
4
  "description": "Salute Design System blueprint",
5
5
  "main": "cjs/index.js",
6
6
  "module": "es/index.js",
@@ -87,7 +87,6 @@
87
87
  "default-browser-id": "2.0.0",
88
88
  "react": "18.2.0",
89
89
  "react-dom": "18.2.0",
90
- "react-draggable": "4.4.3",
91
90
  "rollup": "^3.28.0",
92
91
  "storybook": "7.6.17",
93
92
  "styled-components": "5.3.1",
@@ -104,5 +103,5 @@
104
103
  "react-popper": "2.3.0",
105
104
  "storeon": "3.1.5"
106
105
  },
107
- "gitHead": "616a76b0b6ec5b6d8698b135fb7a46759ec99d80"
106
+ "gitHead": "9c13cc7e6417e32738c4d67bb9ec177884014e0e"
108
107
  }
@@ -13,14 +13,14 @@ var _components = /*#__PURE__*/require("./components");
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
15
15
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
- var isSingleValueProps = function isSingleValueProps(props) {
17
- return typeof props.value === 'number';
18
- };
19
-
20
16
  /**
21
17
  * Слайдер позволяет определить числовое значение в пределах указанного промежутка.
22
18
  * Можно указать два значения.
23
19
  */
20
+
21
+ var isSingleValueProps = function isSingleValueProps(props) {
22
+ return typeof props.value === 'number';
23
+ };
24
24
  var sliderRoot = exports.sliderRoot = function sliderRoot(Root) {
25
25
  return /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
26
26
  if (isSingleValueProps(props)) {
@@ -12,7 +12,7 @@ var _utils = /*#__PURE__*/require("../../utils");
12
12
  var _utils2 = /*#__PURE__*/require("../../../../utils");
13
13
  var _Slider = /*#__PURE__*/require("../../Slider.tokens");
14
14
  var _Double = /*#__PURE__*/require("./Double.styles");
15
- var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "onChangeCommitted", "onChangeDrag", "ariaLabel", "multipleStepSize"];
15
+ var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "onChangeCommitted", "onChange", "ariaLabel", "multipleStepSize"];
16
16
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
18
18
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -46,7 +46,7 @@ var DoubleSlider = exports.DoubleSlider = function DoubleSlider(_ref) {
46
46
  _ref$size = _ref.size,
47
47
  size = _ref$size === void 0 ? 'm' : _ref$size,
48
48
  onChangeCommitted = _ref.onChangeCommitted,
49
- onChangeDrag = _ref.onChangeDrag,
49
+ onChange = _ref.onChange,
50
50
  ariaLabel = _ref.ariaLabel,
51
51
  _ref$multipleStepSize = _ref.multipleStepSize,
52
52
  multipleStepSize = _ref$multipleStepSize === void 0 ? 10 : _ref$multipleStepSize,
@@ -123,11 +123,11 @@ var DoubleSlider = exports.DoubleSlider = function DoubleSlider(_ref) {
123
123
  railFillXPosition: newHandleXPosition
124
124
  });
125
125
  });
126
- if (onChangeDrag) {
127
- onChangeDrag([handleValue, value[1]]);
126
+ if (onChange) {
127
+ onChange([handleValue, value[1]]);
128
128
  }
129
129
  }
130
- }, [onChangeDrag, value]);
130
+ }, [onChange, value]);
131
131
  var onFirstHandleChangeCommitted = (0, _react.useCallback)(function (handleValue, data) {
132
132
  setFirstValue(handleValue);
133
133
  onChangeCommitted && onChangeCommitted([handleValue, value[1]]);
@@ -171,11 +171,11 @@ var DoubleSlider = exports.DoubleSlider = function DoubleSlider(_ref) {
171
171
  railFillXPosition: firstXHandleXPosition
172
172
  });
173
173
  });
174
- if (onChangeDrag) {
175
- onChangeDrag([value[0], handleValue]);
174
+ if (onChange) {
175
+ onChange([value[0], handleValue]);
176
176
  }
177
177
  }
178
- }, [onChangeDrag, value]);
178
+ }, [onChange, value]);
179
179
  var onSecondHandleChangeCommitted = (0, _react.useCallback)(function (handleValue, data) {
180
180
  onChangeCommitted && onChangeCommitted([value[0], handleValue]);
181
181
  setSecondValue(handleValue);
@@ -12,7 +12,7 @@ var _utils = /*#__PURE__*/require("../../utils");
12
12
  var _utils2 = /*#__PURE__*/require("../../../../utils");
13
13
  var _Slider = /*#__PURE__*/require("../../Slider.tokens");
14
14
  var _Single = /*#__PURE__*/require("./Single.styles");
15
- var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChangeDrag", "ariaLabel", "label", "labelContentLeft", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "multipleStepSize", "size"];
15
+ var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChange", "ariaLabel", "label", "labelContentLeft", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "multipleStepSize", "size"];
16
16
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
18
18
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -35,7 +35,7 @@ var SingleSlider = exports.SingleSlider = function SingleSlider(_ref) {
35
35
  value = _ref.value,
36
36
  disabled = _ref.disabled,
37
37
  onChangeCommitted = _ref.onChangeCommitted,
38
- onChangeDrag = _ref.onChangeDrag,
38
+ onChange = _ref.onChange,
39
39
  ariaLabel = _ref.ariaLabel,
40
40
  label = _ref.label,
41
41
  labelContentLeft = _ref.labelContentLeft,
@@ -119,11 +119,11 @@ var SingleSlider = exports.SingleSlider = function SingleSlider(_ref) {
119
119
  railFillWidth: newHandleXPosition
120
120
  });
121
121
  });
122
- if (onChangeDrag) {
123
- onChangeDrag(handleValue);
122
+ if (onChange) {
123
+ onChange(handleValue);
124
124
  }
125
125
  setDragValue(handleValue);
126
- }, [onChangeDrag, setDragValue]);
126
+ }, [onChange, setDragValue]);
127
127
  var onHandleChangeCommitted = (0, _react.useCallback)(function (handleValue, data) {
128
128
  onChangeCommitted && onChangeCommitted(handleValue);
129
129
  setState(function (prevState) {
@@ -4,14 +4,14 @@ import { base as viewCSS } from './variations/_view/base';
4
4
  import { base as sizeCSS } from './variations/_size/base';
5
5
  import { base as disabledCSS } from './variations/_disabled/base';
6
6
  import { SingleSlider, DoubleSlider } from './components';
7
- var isSingleValueProps = function isSingleValueProps(props) {
8
- return typeof props.value === 'number';
9
- };
10
-
11
7
  /**
12
8
  * Слайдер позволяет определить числовое значение в пределах указанного промежутка.
13
9
  * Можно указать два значения.
14
10
  */
11
+
12
+ var isSingleValueProps = function isSingleValueProps(props) {
13
+ return typeof props.value === 'number';
14
+ };
15
15
  export var sliderRoot = function sliderRoot(Root) {
16
16
  return /*#__PURE__*/forwardRef(function (props, ref) {
17
17
  if (isSingleValueProps(props)) {
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "onChangeCommitted", "onChangeDrag", "ariaLabel", "multipleStepSize"];
2
+ var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "onChangeCommitted", "onChange", "ariaLabel", "multipleStepSize"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -38,7 +38,7 @@ export var DoubleSlider = function DoubleSlider(_ref) {
38
38
  _ref$size = _ref.size,
39
39
  size = _ref$size === void 0 ? 'm' : _ref$size,
40
40
  onChangeCommitted = _ref.onChangeCommitted,
41
- onChangeDrag = _ref.onChangeDrag,
41
+ onChange = _ref.onChange,
42
42
  ariaLabel = _ref.ariaLabel,
43
43
  _ref$multipleStepSize = _ref.multipleStepSize,
44
44
  multipleStepSize = _ref$multipleStepSize === void 0 ? 10 : _ref$multipleStepSize,
@@ -115,11 +115,11 @@ export var DoubleSlider = function DoubleSlider(_ref) {
115
115
  railFillXPosition: newHandleXPosition
116
116
  });
117
117
  });
118
- if (onChangeDrag) {
119
- onChangeDrag([handleValue, value[1]]);
118
+ if (onChange) {
119
+ onChange([handleValue, value[1]]);
120
120
  }
121
121
  }
122
- }, [onChangeDrag, value]);
122
+ }, [onChange, value]);
123
123
  var onFirstHandleChangeCommitted = useCallback(function (handleValue, data) {
124
124
  setFirstValue(handleValue);
125
125
  onChangeCommitted && onChangeCommitted([handleValue, value[1]]);
@@ -163,11 +163,11 @@ export var DoubleSlider = function DoubleSlider(_ref) {
163
163
  railFillXPosition: firstXHandleXPosition
164
164
  });
165
165
  });
166
- if (onChangeDrag) {
167
- onChangeDrag([value[0], handleValue]);
166
+ if (onChange) {
167
+ onChange([value[0], handleValue]);
168
168
  }
169
169
  }
170
- }, [onChangeDrag, value]);
170
+ }, [onChange, value]);
171
171
  var onSecondHandleChangeCommitted = useCallback(function (handleValue, data) {
172
172
  onChangeCommitted && onChangeCommitted([value[0], handleValue]);
173
173
  setSecondValue(handleValue);
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChangeDrag", "ariaLabel", "label", "labelContentLeft", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "multipleStepSize", "size"];
2
+ var _excluded = ["min", "max", "value", "disabled", "onChangeCommitted", "onChange", "ariaLabel", "label", "labelContentLeft", "showRangeValues", "showCurrentValue", "hideMinValueDiff", "hideMaxValueDiff", "labelPlacement", "rangeValuesPlacement", "multipleStepSize", "size"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -27,7 +27,7 @@ export var SingleSlider = function SingleSlider(_ref) {
27
27
  value = _ref.value,
28
28
  disabled = _ref.disabled,
29
29
  onChangeCommitted = _ref.onChangeCommitted,
30
- onChangeDrag = _ref.onChangeDrag,
30
+ onChange = _ref.onChange,
31
31
  ariaLabel = _ref.ariaLabel,
32
32
  label = _ref.label,
33
33
  labelContentLeft = _ref.labelContentLeft,
@@ -111,11 +111,11 @@ export var SingleSlider = function SingleSlider(_ref) {
111
111
  railFillWidth: newHandleXPosition
112
112
  });
113
113
  });
114
- if (onChangeDrag) {
115
- onChangeDrag(handleValue);
114
+ if (onChange) {
115
+ onChange(handleValue);
116
116
  }
117
117
  setDragValue(handleValue);
118
- }, [onChangeDrag, setDragValue]);
118
+ }, [onChange, setDragValue]);
119
119
  var onHandleChangeCommitted = useCallback(function (handleValue, data) {
120
120
  onChangeCommitted && onChangeCommitted(handleValue);
121
121
  setState(function (prevState) {
@@ -1,15 +1,11 @@
1
1
  import React from 'react';
2
- import type { RootProps } from '../../engines';
2
+ import type { RootPropsOmitOnChange } from '../../engines';
3
3
  import { SliderProps } from './Slider.types';
4
- /**
5
- * Слайдер позволяет определить числовое значение в пределах указанного промежутка.
6
- * Можно указать два значения.
7
- */
8
- export declare const sliderRoot: (Root: RootProps<HTMLDivElement, SliderProps>) => React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLDivElement>>;
4
+ export declare const sliderRoot: (Root: RootPropsOmitOnChange<HTMLDivElement, SliderProps>) => React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLDivElement>>;
9
5
  export declare const sliderConfig: {
10
6
  name: string;
11
7
  tag: string;
12
- layout: (Root: RootProps<HTMLDivElement, SliderProps>) => React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLDivElement>>;
8
+ layout: (Root: RootPropsOmitOnChange<HTMLDivElement, SliderProps>) => React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLDivElement>>;
13
9
  base: string;
14
10
  variations: {
15
11
  view: {
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAO/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C;;;GAGG;AACH,eAAO,MAAM,UAAU,SAAU,UAAU,cAAc,EAAE,WAAW,CAAC,uFAcjE,CAAC;AAEP,eAAO,MAAM,YAAY;;;mBAhBQ,UAAU,cAAc,EAAE,WAAW,CAAC;;;;;;;;;;;;;;;;;;CAqCtE,CAAC"}
1
+ {"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAO3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQ7C,eAAO,MAAM,UAAU,SAAU,sBAAsB,cAAc,EAAE,WAAW,CAAC,uFAc7E,CAAC;AAEP,eAAO,MAAM,YAAY;;;mBAhBQ,sBAAsB,cAAc,EAAE,WAAW,CAAC;;;;;;;;;;;;;;;;;;CAqClF,CAAC"}
@@ -12,7 +12,7 @@ export interface DoubleSliderProps extends SliderBaseProps, SliderInternalProps,
12
12
  /**
13
13
  * Вызывается при перемещении ползунка
14
14
  */
15
- onChangeDrag?: (value: number[]) => void;
15
+ onChange?: (value: number[]) => void;
16
16
  /**
17
17
  * Расположение значений минимума и максимума интервала.
18
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Double.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/Slider/components/Double/Double.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE3F,MAAM,WAAW,iBACb,SAAQ,eAAe,EACnB,mBAAmB,EACnB,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACpD;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,oBAAoB,CAAC,EAAE,KAAK,CAAC;IAC7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IAGH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAC1B"}
1
+ {"version":3,"file":"Double.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/Slider/components/Double/Double.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE3F,MAAM,WAAW,iBACb,SAAQ,eAAe,EACnB,mBAAmB,EACnB,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACpD;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,oBAAoB,CAAC,EAAE,KAAK,CAAC;IAC7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IAGH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAC1B"}
@@ -12,7 +12,7 @@ export interface SingleSliderProps extends SliderBaseProps, SliderInternalProps,
12
12
  /**
13
13
  * Вызывается при перемещении ползунка
14
14
  */
15
- onChangeDrag?: (value: number) => void;
15
+ onChange?: (value: number) => void;
16
16
  /**
17
17
  * Ярлык, определяющий назначение ползунка, например «Минимальная цена» [a11y].
18
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Single.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/Slider/components/Single/Single.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE3F,MAAM,WAAW,iBACb,SAAQ,eAAe,EACnB,mBAAmB,EACnB,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACpD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACnC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB;;OAEG;IAGH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAC1B"}
1
+ {"version":3,"file":"Single.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/Slider/components/Single/Single.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE3F,MAAM,WAAW,iBACb,SAAQ,eAAe,EACnB,mBAAmB,EACnB,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACpD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACnC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB;;OAEG;IAGH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAC1B"}
@@ -2,6 +2,6 @@ import React from 'react';
2
2
  import type { ComponentConfig, HTMLAnyAttributes, HTMLTagList, PropsType, Variants } from './types';
3
3
  export declare const getStaticVariants: (config: ComponentConfig) => string[];
4
4
  export declare const getDynamicVariants: (config: ComponentConfig) => (props: HTMLAnyAttributes) => any[];
5
- export declare const mergeConfig: <Tag extends HTMLTagList, VariantList extends Variants, VariantsProps extends PropsType<VariantList>, LayoutPropsBase extends React.HTMLAttributes<HTMLElement>, LayoutPropsUser extends React.HTMLAttributes<HTMLElement> | undefined = undefined>(baseConfig: ComponentConfig<Tag, Variants, PropsType<Variants> & LayoutPropsBase, LayoutPropsBase>, userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>> | undefined) => ComponentConfig<Tag, VariantList, PropsType<VariantList>, LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser>;
6
- export declare function component<Tag extends HTMLTagList, VariantList extends Variants, VariantsProps extends PropsType<VariantList>, LayoutProps extends React.HTMLAttributes<HTMLElement>>(config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>): React.FunctionComponent<VariantsProps & LayoutProps>;
5
+ export declare const mergeConfig: <Tag extends HTMLTagList, VariantList extends Variants, VariantsProps extends PropsType<VariantList>, LayoutPropsBase extends React.HTMLAttributes<HTMLElement> | Omit<React.HTMLAttributes<HTMLElement>, "onChange">, LayoutPropsUser extends React.HTMLAttributes<HTMLElement> | Omit<React.HTMLAttributes<HTMLElement>, "onChange"> | undefined = undefined>(baseConfig: ComponentConfig<Tag, Variants, PropsType<Variants> & LayoutPropsBase, LayoutPropsBase>, userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>> | undefined) => ComponentConfig<Tag, VariantList, PropsType<VariantList>, LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser>;
6
+ export declare function component<Tag extends HTMLTagList, VariantList extends Variants, VariantsProps extends PropsType<VariantList>, LayoutProps extends React.HTMLAttributes<HTMLElement> | Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>>(config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>): React.FunctionComponent<VariantsProps & LayoutProps>;
7
7
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/engines/common.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEpG,eAAO,MAAM,iBAAiB,WAAY,eAAe,aAcxD,CAAC;AAEF,eAAO,MAAM,kBAAkB,WAAY,eAAe,aACvC,iBAAiB,UAgBnC,CAAC;AAEF,eAAO,MAAM,WAAW,kkBA2CvB,CAAC;AAEF,wBAAgB,SAAS,CACrB,GAAG,SAAS,WAAW,EACvB,WAAW,SAAS,QAAQ,EAC5B,aAAa,SAAS,SAAS,CAAC,WAAW,CAAC,EAC5C,WAAW,SAAS,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAErD,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,GACtE,KAAK,CAAC,iBAAiB,CAAC,aAAa,GAAG,WAAW,CAAC,CAMtD"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/engines/common.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEpG,eAAO,MAAM,iBAAiB,WAAY,eAAe,aAcxD,CAAC;AAEF,eAAO,MAAM,kBAAkB,WAAY,eAAe,aACvC,iBAAiB,UAgBnC,CAAC;AAEF,eAAO,MAAM,WAAW,8qBA8CvB,CAAC;AAEF,wBAAgB,SAAS,CACrB,GAAG,SAAS,WAAW,EACvB,WAAW,SAAS,QAAQ,EAC5B,aAAa,SAAS,SAAS,CAAC,WAAW,CAAC,EAC5C,WAAW,SAAS,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,EAE3G,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,GACtE,KAAK,CAAC,iBAAiB,CAAC,aAAa,GAAG,WAAW,CAAC,CAMtD"}
@@ -1,5 +1,5 @@
1
1
  import type { CSS } from './types';
2
2
  export declare const css: CSS;
3
3
  export { mergeConfig, component } from './common';
4
- export type { Variant, ComponentConfig, RootProps, CSS } from './types';
4
+ export type { Variant, ComponentConfig, RootProps, CSS, RootPropsOmitOnChange } from './types';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engines/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAM,GAAG,KAAoB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAElD,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engines/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAM,GAAG,KAAoB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAElD,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
@@ -7,6 +7,9 @@ export declare type CSS = (strings: TemplateStringsArray, ...exprs: Array<string
7
7
  export declare type RootProps<RefElement extends HTMLElement, Element extends React.HTMLAttributes<HTMLElement>> = React.FunctionComponent<{
8
8
  children?: React.ReactNode;
9
9
  } & Element & React.RefAttributes<RefElement>>;
10
+ export declare type RootPropsOmitOnChange<RefElement extends HTMLElement, Element extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'>> = React.FunctionComponent<{
11
+ children?: React.ReactNode;
12
+ } & React.RefAttributes<RefElement> & Element>;
10
13
  export declare type Variant = {
11
14
  css?: PolymorphicClassName;
12
15
  attrs?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/engines/types.ts"],"names":[],"mappings":";AAAA,oBAAY,oBAAoB,GAAG,MAAM,CAAC;AAE1C,oBAAY,aAAa,GAAG;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC;CAClD,CAAC;AAEF,oBAAY,GAAG,GAAG,CACd,OAAO,EAAE,oBAAoB,EAC7B,GAAG,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,KAC/C,oBAAoB,CAAC;AAE1B,oBAAY,SAAS,CACjB,UAAU,SAAS,WAAW,EAC9B,OAAO,SAAS,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,IACjD,KAAK,CAAC,iBAAiB,CAAC;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,GAAG,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;AAExG,oBAAY,OAAO,GAAG;IAClB,GAAG,CAAC,EAAE,oBAAoB,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,oBAAoB,CAAC;CAC/B,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAErB,oBAAY,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE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