@salutejs/plasma-new-hope 0.85.0-canary.1208.9245279695.0 → 0.85.0-canary.1208.9252417590.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,12 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
6
6
  var React = require('react');
7
- var index$1 = require('../../utils/index.js');
7
+ var index = require('../../utils/index.js');
8
8
  var base$1 = require('./variations/_size/base.js');
9
9
  var base = require('./variations/_view/base.js');
10
10
  var base$2 = require('./variations/_disabled/base.js');
11
11
  var base$3 = require('./variations/_readonly/base.js');
12
- var index = require('./utils/index.js');
12
+ var index$1 = require('./utils/index.js');
13
13
  var Range_styles = require('./Range.styles.js');
14
14
  var Range_tokens = require('./Range.tokens.js');
15
15
 
@@ -62,10 +62,10 @@ var rangeRoot = function rangeRoot(Root) {
62
62
  var rangeSuccessClass = firstValueSuccess && secondValueSuccess ? Range_tokens.classes.rangeSuccess : undefined;
63
63
  var firstValueSuccessClass = !rangeSuccessClass && firstValueSuccess ? Range_tokens.classes.rangeValueSuccess : undefined;
64
64
  var secondValueSuccessClass = !rangeSuccessClass && secondValueSuccess ? Range_tokens.classes.rangeValueSuccess : undefined;
65
- var handleChangeFirstValue = React.useCallback(index.getChangeHandler(onChangeFirstValue, disabled, readOnly), [onChangeFirstValue, disabled, readOnly]);
66
- var handleChangeSecondValue = React.useCallback(index.getChangeHandler(onChangeSecondValue, disabled, readOnly), [onChangeSecondValue, disabled, readOnly]);
67
- var handleSearchFirstValue = React.useCallback(index.getSearchHandler(onSearchFirstValue, disabled, readOnly), [onSearchFirstValue, disabled, readOnly]);
68
- var handleSearchSecondValue = React.useCallback(index.getSearchHandler(onSearchSecondValue, disabled, readOnly), [onSearchFirstValue, disabled, readOnly]);
65
+ var handleChangeFirstValue = index$1.getChangeHandler(onChangeFirstValue, disabled, readOnly);
66
+ var handleChangeSecondValue = index$1.getChangeHandler(onChangeSecondValue, disabled, readOnly);
67
+ var handleSearchFirstValue = index$1.getSearchHandler(onSearchFirstValue, disabled, readOnly);
68
+ var handleSearchSecondValue = index$1.getSearchHandler(onSearchSecondValue, disabled, readOnly);
69
69
  var Divider = React.useMemo(function () {
70
70
  if (dividerVariant === 'none') {
71
71
  return null;
@@ -82,9 +82,9 @@ var rangeRoot = function rangeRoot(Root) {
82
82
  readOnly: !disabled && readOnly,
83
83
  ref: ref
84
84
  }, rest), label && /*#__PURE__*/React.createElement(Range_styles.StyledLabel, null, label), /*#__PURE__*/React.createElement(Range_styles.ContentWrapper, {
85
- className: index$1.cx(rangeErrorClass, rangeSuccessClass)
85
+ className: index.cx(rangeErrorClass, rangeSuccessClass)
86
86
  }, contentLeft && /*#__PURE__*/React.createElement(Range_styles.StyledContentLeft, null, contentLeft), /*#__PURE__*/React.createElement(Range_styles.StyledInput, {
87
- className: index$1.cx(firstValueErrorClass, firstValueSuccessClass),
87
+ className: index.cx(firstValueErrorClass, firstValueSuccessClass),
88
88
  value: firstValue,
89
89
  readOnly: readOnly,
90
90
  disabled: disabled,
@@ -98,7 +98,7 @@ var rangeRoot = function rangeRoot(Root) {
98
98
  onFocus: onFocusFirstTextfield,
99
99
  onBlur: onBlurFirstTextfield
100
100
  }), Divider, /*#__PURE__*/React.createElement(Range_styles.StyledInput, {
101
- className: index$1.cx(secondValueErrorClass, secondValueSuccessClass),
101
+ className: index.cx(secondValueErrorClass, secondValueSuccessClass),
102
102
  value: secondValue,
103
103
  readOnly: readOnly,
104
104
  disabled: disabled,
@@ -1 +1 @@
1
- {"version":3,"file":"Range.js","sources":["../../../src/components/Range/Range.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport type { RangeProps } from './Range.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readOnlyCSS } from './variations/_readonly/base';\nimport { getChangeHandler, getSearchHandler } from './utils';\nimport {\n ContentWrapper,\n LeftHelper,\n StyledContentLeft,\n StyledContentRight,\n StyledDivider,\n StyledInput,\n StyledLabel,\n base,\n} from './Range.styles';\nimport { classes } from './Range.tokens';\n\nexport const rangeRoot = (Root: RootProps<HTMLDivElement, RangeProps>) =>\n forwardRef<HTMLInputElement, RangeProps>(\n (\n {\n label,\n leftHelper,\n contentLeft,\n contentRight,\n view,\n size,\n readOnly = false,\n disabled = false,\n\n dividerVariant = 'dash',\n dividerIcon,\n\n firstValue,\n secondValue,\n firstValueError,\n secondValueError,\n firstValueSuccess,\n secondValueSuccess,\n firstPlaceholder,\n secondPlaceholder,\n firstTextfieldContentLeft,\n firstTextfieldContentRight,\n secondTextfieldContentLeft,\n secondTextfieldContentRight,\n firstTextfieldTextBefore,\n secondTextfieldTextBefore,\n firstTextfieldTextAfter,\n secondTextfieldTextAfter,\n\n onChangeFirstValue,\n onChangeSecondValue,\n onSearchFirstValue,\n onSearchSecondValue,\n onFocusFirstTextfield,\n onFocusSecondTextfield,\n onBlurFirstTextfield,\n onBlurSecondTextfield,\n\n ...rest\n },\n ref,\n ) => {\n const rangeErrorClass = firstValueError && secondValueError ? classes.rangeError : undefined;\n const firstValueErrorClass = !rangeErrorClass && firstValueError ? classes.rangeValueError : undefined;\n const secondValueErrorClass = !rangeErrorClass && secondValueError ? classes.rangeValueError : undefined;\n const rangeSuccessClass = firstValueSuccess && secondValueSuccess ? classes.rangeSuccess : undefined;\n const firstValueSuccessClass =\n !rangeSuccessClass && firstValueSuccess ? classes.rangeValueSuccess : undefined;\n const secondValueSuccessClass =\n !rangeSuccessClass && secondValueSuccess ? classes.rangeValueSuccess : undefined;\n\n const handleChangeFirstValue = useCallback(getChangeHandler(onChangeFirstValue, disabled, readOnly), [\n onChangeFirstValue,\n disabled,\n readOnly,\n ]);\n\n const handleChangeSecondValue = useCallback(getChangeHandler(onChangeSecondValue, disabled, readOnly), [\n onChangeSecondValue,\n disabled,\n readOnly,\n ]);\n\n const handleSearchFirstValue = useCallback(getSearchHandler(onSearchFirstValue, disabled, readOnly), [\n onSearchFirstValue,\n disabled,\n readOnly,\n ]);\n\n const handleSearchSecondValue = useCallback(getSearchHandler(onSearchSecondValue, disabled, readOnly), [\n onSearchFirstValue,\n disabled,\n readOnly,\n ]);\n\n const Divider = useMemo(() => {\n if (dividerVariant === 'none') {\n return null;\n }\n\n if (dividerVariant === 'dash') {\n return <StyledDivider>–</StyledDivider>;\n }\n\n return <StyledDivider>{dividerIcon}</StyledDivider>;\n }, [dividerVariant, dividerIcon]);\n\n return (\n <Root view={view} size={size} disabled={disabled} readOnly={!disabled && readOnly} ref={ref} {...rest}>\n {label && <StyledLabel>{label}</StyledLabel>}\n <ContentWrapper className={cx(rangeErrorClass, rangeSuccessClass)}>\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n <StyledInput\n className={cx(firstValueErrorClass, firstValueSuccessClass)}\n value={firstValue}\n readOnly={readOnly}\n disabled={disabled}\n placeholder={firstPlaceholder}\n contentLeft={firstTextfieldContentLeft}\n contentRight={firstTextfieldContentRight}\n textBefore={firstTextfieldTextBefore}\n textAfter={firstTextfieldTextAfter}\n onChange={handleChangeFirstValue}\n onSearch={handleSearchFirstValue}\n onFocus={onFocusFirstTextfield}\n onBlur={onBlurFirstTextfield}\n />\n {Divider}\n <StyledInput\n className={cx(secondValueErrorClass, secondValueSuccessClass)}\n value={secondValue}\n readOnly={readOnly}\n disabled={disabled}\n placeholder={secondPlaceholder}\n contentLeft={secondTextfieldContentLeft}\n contentRight={secondTextfieldContentRight}\n textBefore={secondTextfieldTextBefore}\n textAfter={secondTextfieldTextAfter}\n onChange={handleChangeSecondValue}\n onSearch={handleSearchSecondValue}\n onFocus={onFocusSecondTextfield}\n onBlur={onBlurSecondTextfield}\n />\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n </ContentWrapper>\n {leftHelper && <LeftHelper>{leftHelper}</LeftHelper>}\n </Root>\n );\n },\n );\n\nexport const rangeConfig = {\n name: 'Range',\n tag: 'div',\n layout: rangeRoot,\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 readOnly: {\n css: readOnlyCSS,\n attrs: true,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["rangeRoot","Root","forwardRef","_ref","ref","_StyledDivider2","label","leftHelper","contentLeft","contentRight","view","size","_ref$readOnly","readOnly","_ref$disabled","disabled","_ref$dividerVariant","dividerVariant","dividerIcon","firstValue","secondValue","firstValueError","secondValueError","firstValueSuccess","secondValueSuccess","firstPlaceholder","secondPlaceholder","firstTextfieldContentLeft","firstTextfieldContentRight","secondTextfieldContentLeft","secondTextfieldContentRight","firstTextfieldTextBefore","secondTextfieldTextBefore","firstTextfieldTextAfter","secondTextfieldTextAfter","onChangeFirstValue","onChangeSecondValue","onSearchFirstValue","onSearchSecondValue","onFocusFirstTextfield","onFocusSecondTextfield","onBlurFirstTextfield","onBlurSecondTextfield","rest","_objectWithoutProperties","_excluded","rangeErrorClass","classes","rangeError","undefined","firstValueErrorClass","rangeValueError","secondValueErrorClass","rangeSuccessClass","rangeSuccess","firstValueSuccessClass","rangeValueSuccess","secondValueSuccessClass","handleChangeFirstValue","useCallback","getChangeHandler","handleChangeSecondValue","handleSearchFirstValue","getSearchHandler","handleSearchSecondValue","Divider","useMemo","_StyledDivider","React","createElement","StyledDivider","_extends","StyledLabel","ContentWrapper","className","cx","StyledContentLeft","StyledInput","value","placeholder","textBefore","textAfter","onChange","onSearch","onFocus","onBlur","StyledContentRight","LeftHelper","rangeConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","disabledCSS","attrs","readOnlyCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;IAuBaA,SAAS,GAAG,SAAZA,SAASA,CAAIC,IAA2C,EAAA;AAAA,EAAA,oBACjEC,gBAAU,CACN,UAAAC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,QAAQ,EAAE;AACNiF,MAAAA,GAAG,EAAEK,WAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDE,EAAAA,QAAQ,EAAE;AACNzF,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;;"}
1
+ {"version":3,"file":"Range.js","sources":["../../../src/components/Range/Range.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport type { RangeProps } from './Range.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readOnlyCSS } from './variations/_readonly/base';\nimport { getChangeHandler, getSearchHandler } from './utils';\nimport {\n ContentWrapper,\n LeftHelper,\n StyledContentLeft,\n StyledContentRight,\n StyledDivider,\n StyledInput,\n StyledLabel,\n base,\n} from './Range.styles';\nimport { classes } from './Range.tokens';\n\nexport const rangeRoot = (Root: RootProps<HTMLDivElement, RangeProps>) =>\n forwardRef<HTMLInputElement, RangeProps>(\n (\n {\n label,\n leftHelper,\n contentLeft,\n contentRight,\n view,\n size,\n readOnly = false,\n disabled = false,\n\n dividerVariant = 'dash',\n dividerIcon,\n\n firstValue,\n secondValue,\n firstValueError,\n secondValueError,\n firstValueSuccess,\n secondValueSuccess,\n firstPlaceholder,\n secondPlaceholder,\n firstTextfieldContentLeft,\n firstTextfieldContentRight,\n secondTextfieldContentLeft,\n secondTextfieldContentRight,\n firstTextfieldTextBefore,\n secondTextfieldTextBefore,\n firstTextfieldTextAfter,\n secondTextfieldTextAfter,\n\n onChangeFirstValue,\n onChangeSecondValue,\n onSearchFirstValue,\n onSearchSecondValue,\n onFocusFirstTextfield,\n onFocusSecondTextfield,\n onBlurFirstTextfield,\n onBlurSecondTextfield,\n\n ...rest\n },\n ref,\n ) => {\n const rangeErrorClass = firstValueError && secondValueError ? classes.rangeError : undefined;\n const firstValueErrorClass = !rangeErrorClass && firstValueError ? classes.rangeValueError : undefined;\n const secondValueErrorClass = !rangeErrorClass && secondValueError ? classes.rangeValueError : undefined;\n const rangeSuccessClass = firstValueSuccess && secondValueSuccess ? classes.rangeSuccess : undefined;\n const firstValueSuccessClass =\n !rangeSuccessClass && firstValueSuccess ? classes.rangeValueSuccess : undefined;\n const secondValueSuccessClass =\n !rangeSuccessClass && secondValueSuccess ? classes.rangeValueSuccess : undefined;\n\n const handleChangeFirstValue = getChangeHandler(onChangeFirstValue, disabled, readOnly);\n const handleChangeSecondValue = getChangeHandler(onChangeSecondValue, disabled, readOnly);\n const handleSearchFirstValue = getSearchHandler(onSearchFirstValue, disabled, readOnly);\n const handleSearchSecondValue = getSearchHandler(onSearchSecondValue, disabled, readOnly);\n\n const Divider = useMemo(() => {\n if (dividerVariant === 'none') {\n return null;\n }\n\n if (dividerVariant === 'dash') {\n return <StyledDivider>–</StyledDivider>;\n }\n\n return <StyledDivider>{dividerIcon}</StyledDivider>;\n }, [dividerVariant, dividerIcon]);\n\n return (\n <Root view={view} size={size} disabled={disabled} readOnly={!disabled && readOnly} ref={ref} {...rest}>\n {label && <StyledLabel>{label}</StyledLabel>}\n <ContentWrapper className={cx(rangeErrorClass, rangeSuccessClass)}>\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n <StyledInput\n className={cx(firstValueErrorClass, firstValueSuccessClass)}\n value={firstValue}\n readOnly={readOnly}\n disabled={disabled}\n placeholder={firstPlaceholder}\n contentLeft={firstTextfieldContentLeft}\n contentRight={firstTextfieldContentRight}\n textBefore={firstTextfieldTextBefore}\n textAfter={firstTextfieldTextAfter}\n onChange={handleChangeFirstValue}\n onSearch={handleSearchFirstValue}\n onFocus={onFocusFirstTextfield}\n onBlur={onBlurFirstTextfield}\n />\n {Divider}\n <StyledInput\n className={cx(secondValueErrorClass, secondValueSuccessClass)}\n value={secondValue}\n readOnly={readOnly}\n disabled={disabled}\n placeholder={secondPlaceholder}\n contentLeft={secondTextfieldContentLeft}\n contentRight={secondTextfieldContentRight}\n textBefore={secondTextfieldTextBefore}\n textAfter={secondTextfieldTextAfter}\n onChange={handleChangeSecondValue}\n onSearch={handleSearchSecondValue}\n onFocus={onFocusSecondTextfield}\n onBlur={onBlurSecondTextfield}\n />\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n </ContentWrapper>\n {leftHelper && <LeftHelper>{leftHelper}</LeftHelper>}\n </Root>\n );\n },\n );\n\nexport const rangeConfig = {\n name: 'Range',\n tag: 'div',\n layout: rangeRoot,\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 readOnly: {\n css: readOnlyCSS,\n attrs: true,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["rangeRoot","Root","forwardRef","_ref","ref","_StyledDivider2","label","leftHelper","contentLeft","contentRight","view","size","_ref$readOnly","readOnly","_ref$disabled","disabled","_ref$dividerVariant","dividerVariant","dividerIcon","firstValue","secondValue","firstValueError","secondValueError","firstValueSuccess","secondValueSuccess","firstPlaceholder","secondPlaceholder","firstTextfieldContentLeft","firstTextfieldContentRight","secondTextfieldContentLeft","secondTextfieldContentRight","firstTextfieldTextBefore","secondTextfieldTextBefore","firstTextfieldTextAfter","secondTextfieldTextAfter","onChangeFirstValue","onChangeSecondValue","onSearchFirstValue","onSearchSecondValue","onFocusFirstTextfield","onFocusSecondTextfield","onBlurFirstTextfield","onBlurSecondTextfield","rest","_objectWithoutProperties","_excluded","rangeErrorClass","classes","rangeError","undefined","firstValueErrorClass","rangeValueError","secondValueErrorClass","rangeSuccessClass","rangeSuccess","firstValueSuccessClass","rangeValueSuccess","secondValueSuccessClass","handleChangeFirstValue","getChangeHandler","handleChangeSecondValue","handleSearchFirstValue","getSearchHandler","handleSearchSecondValue","Divider","useMemo","_StyledDivider","React","createElement","StyledDivider","_extends","StyledLabel","ContentWrapper","className","cx","StyledContentLeft","StyledInput","value","placeholder","textBefore","textAfter","onChange","onSearch","onFocus","onBlur","StyledContentRight","LeftHelper","rangeConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","disabledCSS","attrs","readOnlyCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;IAuBaA,SAAS,GAAG,SAAZA,SAASA,CAAIC,IAA2C,EAAA;AAAA,EAAA,oBACjEC,gBAAU,CACN,UAAAC,IAAA,EA0CIC,GAAG,EACF;AAAA,IAAA,IAAAC,eAAA,CAAA;AAAA,IAAA,IAzCGC,KAAK,GAAAH,IAAA,CAALG,KAAK;MACLC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;MACVC,WAAW,GAAAL,IAAA,CAAXK,WAAW;MACXC,YAAY,GAAAN,IAAA,CAAZM,YAAY;MACZC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MACJC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MAAAC,aAAA,GAAAT,IAAA,CACJU,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MAAAE,aAAA,GAAAX,IAAA,CAChBY,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MAAAE,mBAAA,GAAAb,IAAA,CAEhBc,cAAc;AAAdA,MAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,mBAAA;MACvBE,WAAW,GAAAf,IAAA,CAAXe,WAAW;MAEXC,UAAU,GAAAhB,IAAA,CAAVgB,UAAU;MACVC,WAAW,GAAAjB,IAAA,CAAXiB,WAAW;MACXC,eAAe,GAAAlB,IAAA,CAAfkB,eAAe;MACfC,gBAAgB,GAAAnB,IAAA,CAAhBmB,gBAAgB;MAChBC,iBAAiB,GAAApB,IAAA,CAAjBoB,iBAAiB;MACjBC,kBAAkB,GAAAr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,EAAE;AACNgF,MAAAA,GAAG,EAAEK,WAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDE,EAAAA,QAAQ,EAAE;AACNxF,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
- import React, { forwardRef, useCallback, useMemo } from 'react';
2
+ import React, { forwardRef, useMemo } from 'react';
3
3
  import { cx } from '../../utils/index.js';
4
4
  import { base as base$2 } from './variations/_size/base.js';
5
5
  import { base as base$1 } from './variations/_view/base.js';
@@ -58,10 +58,10 @@ var rangeRoot = function rangeRoot(Root) {
58
58
  var rangeSuccessClass = firstValueSuccess && secondValueSuccess ? classes.rangeSuccess : undefined;
59
59
  var firstValueSuccessClass = !rangeSuccessClass && firstValueSuccess ? classes.rangeValueSuccess : undefined;
60
60
  var secondValueSuccessClass = !rangeSuccessClass && secondValueSuccess ? classes.rangeValueSuccess : undefined;
61
- var handleChangeFirstValue = useCallback(getChangeHandler(onChangeFirstValue, disabled, readOnly), [onChangeFirstValue, disabled, readOnly]);
62
- var handleChangeSecondValue = useCallback(getChangeHandler(onChangeSecondValue, disabled, readOnly), [onChangeSecondValue, disabled, readOnly]);
63
- var handleSearchFirstValue = useCallback(getSearchHandler(onSearchFirstValue, disabled, readOnly), [onSearchFirstValue, disabled, readOnly]);
64
- var handleSearchSecondValue = useCallback(getSearchHandler(onSearchSecondValue, disabled, readOnly), [onSearchFirstValue, disabled, readOnly]);
61
+ var handleChangeFirstValue = getChangeHandler(onChangeFirstValue, disabled, readOnly);
62
+ var handleChangeSecondValue = getChangeHandler(onChangeSecondValue, disabled, readOnly);
63
+ var handleSearchFirstValue = getSearchHandler(onSearchFirstValue, disabled, readOnly);
64
+ var handleSearchSecondValue = getSearchHandler(onSearchSecondValue, disabled, readOnly);
65
65
  var Divider = useMemo(function () {
66
66
  if (dividerVariant === 'none') {
67
67
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"Range.js","sources":["../../../src/components/Range/Range.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport type { RangeProps } from './Range.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readOnlyCSS } from './variations/_readonly/base';\nimport { getChangeHandler, getSearchHandler } from './utils';\nimport {\n ContentWrapper,\n LeftHelper,\n StyledContentLeft,\n StyledContentRight,\n StyledDivider,\n StyledInput,\n StyledLabel,\n base,\n} from './Range.styles';\nimport { classes } from './Range.tokens';\n\nexport const rangeRoot = (Root: RootProps<HTMLDivElement, RangeProps>) =>\n forwardRef<HTMLInputElement, RangeProps>(\n (\n {\n label,\n leftHelper,\n contentLeft,\n contentRight,\n view,\n size,\n readOnly = false,\n disabled = false,\n\n dividerVariant = 'dash',\n dividerIcon,\n\n firstValue,\n secondValue,\n firstValueError,\n secondValueError,\n firstValueSuccess,\n secondValueSuccess,\n firstPlaceholder,\n secondPlaceholder,\n firstTextfieldContentLeft,\n firstTextfieldContentRight,\n secondTextfieldContentLeft,\n secondTextfieldContentRight,\n firstTextfieldTextBefore,\n secondTextfieldTextBefore,\n firstTextfieldTextAfter,\n secondTextfieldTextAfter,\n\n onChangeFirstValue,\n onChangeSecondValue,\n onSearchFirstValue,\n onSearchSecondValue,\n onFocusFirstTextfield,\n onFocusSecondTextfield,\n onBlurFirstTextfield,\n onBlurSecondTextfield,\n\n ...rest\n },\n ref,\n ) => {\n const rangeErrorClass = firstValueError && secondValueError ? classes.rangeError : undefined;\n const firstValueErrorClass = !rangeErrorClass && firstValueError ? classes.rangeValueError : undefined;\n const secondValueErrorClass = !rangeErrorClass && secondValueError ? classes.rangeValueError : undefined;\n const rangeSuccessClass = firstValueSuccess && secondValueSuccess ? classes.rangeSuccess : undefined;\n const firstValueSuccessClass =\n !rangeSuccessClass && firstValueSuccess ? classes.rangeValueSuccess : undefined;\n const secondValueSuccessClass =\n !rangeSuccessClass && secondValueSuccess ? classes.rangeValueSuccess : undefined;\n\n const handleChangeFirstValue = useCallback(getChangeHandler(onChangeFirstValue, disabled, readOnly), [\n onChangeFirstValue,\n disabled,\n readOnly,\n ]);\n\n const handleChangeSecondValue = useCallback(getChangeHandler(onChangeSecondValue, disabled, readOnly), [\n onChangeSecondValue,\n disabled,\n readOnly,\n ]);\n\n const handleSearchFirstValue = useCallback(getSearchHandler(onSearchFirstValue, disabled, readOnly), [\n onSearchFirstValue,\n disabled,\n readOnly,\n ]);\n\n const handleSearchSecondValue = useCallback(getSearchHandler(onSearchSecondValue, disabled, readOnly), [\n onSearchFirstValue,\n disabled,\n readOnly,\n ]);\n\n const Divider = useMemo(() => {\n if (dividerVariant === 'none') {\n return null;\n }\n\n if (dividerVariant === 'dash') {\n return <StyledDivider>–</StyledDivider>;\n }\n\n return <StyledDivider>{dividerIcon}</StyledDivider>;\n }, [dividerVariant, dividerIcon]);\n\n return (\n <Root view={view} size={size} disabled={disabled} readOnly={!disabled && readOnly} ref={ref} {...rest}>\n {label && <StyledLabel>{label}</StyledLabel>}\n <ContentWrapper className={cx(rangeErrorClass, rangeSuccessClass)}>\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n <StyledInput\n className={cx(firstValueErrorClass, firstValueSuccessClass)}\n value={firstValue}\n readOnly={readOnly}\n disabled={disabled}\n placeholder={firstPlaceholder}\n contentLeft={firstTextfieldContentLeft}\n contentRight={firstTextfieldContentRight}\n textBefore={firstTextfieldTextBefore}\n textAfter={firstTextfieldTextAfter}\n onChange={handleChangeFirstValue}\n onSearch={handleSearchFirstValue}\n onFocus={onFocusFirstTextfield}\n onBlur={onBlurFirstTextfield}\n />\n {Divider}\n <StyledInput\n className={cx(secondValueErrorClass, secondValueSuccessClass)}\n value={secondValue}\n readOnly={readOnly}\n disabled={disabled}\n placeholder={secondPlaceholder}\n contentLeft={secondTextfieldContentLeft}\n contentRight={secondTextfieldContentRight}\n textBefore={secondTextfieldTextBefore}\n textAfter={secondTextfieldTextAfter}\n onChange={handleChangeSecondValue}\n onSearch={handleSearchSecondValue}\n onFocus={onFocusSecondTextfield}\n onBlur={onBlurSecondTextfield}\n />\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n </ContentWrapper>\n {leftHelper && <LeftHelper>{leftHelper}</LeftHelper>}\n </Root>\n );\n },\n );\n\nexport const rangeConfig = {\n name: 'Range',\n tag: 'div',\n layout: rangeRoot,\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 readOnly: {\n css: readOnlyCSS,\n attrs: true,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["rangeRoot","Root","forwardRef","_ref","ref","_StyledDivider2","label","leftHelper","contentLeft","contentRight","view","size","_ref$readOnly","readOnly","_ref$disabled","disabled","_ref$dividerVariant","dividerVariant","dividerIcon","firstValue","secondValue","firstValueError","secondValueError","firstValueSuccess","secondValueSuccess","firstPlaceholder","secondPlaceholder","firstTextfieldContentLeft","firstTextfieldContentRight","secondTextfieldContentLeft","secondTextfieldContentRight","firstTextfieldTextBefore","secondTextfieldTextBefore","firstTextfieldTextAfter","secondTextfieldTextAfter","onChangeFirstValue","onChangeSecondValue","onSearchFirstValue","onSearchSecondValue","onFocusFirstTextfield","onFocusSecondTextfield","onBlurFirstTextfield","onBlurSecondTextfield","rest","_objectWithoutProperties","_excluded","rangeErrorClass","classes","rangeError","undefined","firstValueErrorClass","rangeValueError","secondValueErrorClass","rangeSuccessClass","rangeSuccess","firstValueSuccessClass","rangeValueSuccess","secondValueSuccessClass","handleChangeFirstValue","useCallback","getChangeHandler","handleChangeSecondValue","handleSearchFirstValue","getSearchHandler","handleSearchSecondValue","Divider","useMemo","_StyledDivider","React","createElement","StyledDivider","_extends","StyledLabel","ContentWrapper","className","cx","StyledContentLeft","StyledInput","value","placeholder","textBefore","textAfter","onChange","onSearch","onFocus","onBlur","StyledContentRight","LeftHelper","rangeConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","disabledCSS","attrs","readOnlyCSS","defaults"],"mappings":";;;;;;;;;;;;;IAuBaA,SAAS,GAAG,SAAZA,SAASA,CAAIC,IAA2C,EAAA;AAAA,EAAA,oBACjEC,UAAU,CACN,UAAAC,IAAA,EA0CIC,GAAG,EACF;AAAA,IAAA,IAAAC,eAAA,CAAA;AAAA,IAAA,IAzCGC,KAAK,GAAAH,IAAA,CAALG,KAAK;MACLC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;MACVC,WAAW,GAAAL,IAAA,CAAXK,WAAW;MACXC,YAAY,GAAAN,IAAA,CAAZM,YAAY;MACZC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MACJC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MAAAC,aAAA,GAAAT,IAAA,CACJU,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MAAAE,aAAA,GAAAX,IAAA,CAChBY,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MAAAE,mBAAA,GAAAb,IAAA,CAEhBc,cAAc;AAAdA,MAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,mBAAA;MACvBE,WAAW,GAAAf,IAAA,CAAXe,WAAW;MAEXC,UAAU,GAAAhB,IAAA,CAAVgB,UAAU;MACVC,WAAW,GAAAjB,IAAA,CAAXiB,WAAW;MACXC,eAAe,GAAAlB,IAAA,CAAfkB,eAAe;MACfC,gBAAgB,GAAAnB,IAAA,CAAhBmB,gBAAgB;MAChBC,iBAAiB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AAM,EAAE3F,SAAS;AACjB4F,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACRnF,IAAAA,IAAI,EAAE;AACFoF,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACDpF,IAAAA,IAAI,EAAE;AACFmF,MAAAA,GAAG,EAAEE,MAAAA;KACR;AACDjF,IAAAA,QAAQ,EAAE;AACN+E,MAAAA,GAAG,EAAEG,MAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;KACV;AACDrF,IAAAA,QAAQ,EAAE;AACNiF,MAAAA,GAAG,EAAEK,MAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDE,EAAAA,QAAQ,EAAE;AACNzF,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
1
+ {"version":3,"file":"Range.js","sources":["../../../src/components/Range/Range.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { cx } from '../../utils';\n\nimport type { RangeProps } from './Range.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readOnlyCSS } from './variations/_readonly/base';\nimport { getChangeHandler, getSearchHandler } from './utils';\nimport {\n ContentWrapper,\n LeftHelper,\n StyledContentLeft,\n StyledContentRight,\n StyledDivider,\n StyledInput,\n StyledLabel,\n base,\n} from './Range.styles';\nimport { classes } from './Range.tokens';\n\nexport const rangeRoot = (Root: RootProps<HTMLDivElement, RangeProps>) =>\n forwardRef<HTMLInputElement, RangeProps>(\n (\n {\n label,\n leftHelper,\n contentLeft,\n contentRight,\n view,\n size,\n readOnly = false,\n disabled = false,\n\n dividerVariant = 'dash',\n dividerIcon,\n\n firstValue,\n secondValue,\n firstValueError,\n secondValueError,\n firstValueSuccess,\n secondValueSuccess,\n firstPlaceholder,\n secondPlaceholder,\n firstTextfieldContentLeft,\n firstTextfieldContentRight,\n secondTextfieldContentLeft,\n secondTextfieldContentRight,\n firstTextfieldTextBefore,\n secondTextfieldTextBefore,\n firstTextfieldTextAfter,\n secondTextfieldTextAfter,\n\n onChangeFirstValue,\n onChangeSecondValue,\n onSearchFirstValue,\n onSearchSecondValue,\n onFocusFirstTextfield,\n onFocusSecondTextfield,\n onBlurFirstTextfield,\n onBlurSecondTextfield,\n\n ...rest\n },\n ref,\n ) => {\n const rangeErrorClass = firstValueError && secondValueError ? classes.rangeError : undefined;\n const firstValueErrorClass = !rangeErrorClass && firstValueError ? classes.rangeValueError : undefined;\n const secondValueErrorClass = !rangeErrorClass && secondValueError ? classes.rangeValueError : undefined;\n const rangeSuccessClass = firstValueSuccess && secondValueSuccess ? classes.rangeSuccess : undefined;\n const firstValueSuccessClass =\n !rangeSuccessClass && firstValueSuccess ? classes.rangeValueSuccess : undefined;\n const secondValueSuccessClass =\n !rangeSuccessClass && secondValueSuccess ? classes.rangeValueSuccess : undefined;\n\n const handleChangeFirstValue = getChangeHandler(onChangeFirstValue, disabled, readOnly);\n const handleChangeSecondValue = getChangeHandler(onChangeSecondValue, disabled, readOnly);\n const handleSearchFirstValue = getSearchHandler(onSearchFirstValue, disabled, readOnly);\n const handleSearchSecondValue = getSearchHandler(onSearchSecondValue, disabled, readOnly);\n\n const Divider = useMemo(() => {\n if (dividerVariant === 'none') {\n return null;\n }\n\n if (dividerVariant === 'dash') {\n return <StyledDivider>–</StyledDivider>;\n }\n\n return <StyledDivider>{dividerIcon}</StyledDivider>;\n }, [dividerVariant, dividerIcon]);\n\n return (\n <Root view={view} size={size} disabled={disabled} readOnly={!disabled && readOnly} ref={ref} {...rest}>\n {label && <StyledLabel>{label}</StyledLabel>}\n <ContentWrapper className={cx(rangeErrorClass, rangeSuccessClass)}>\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n <StyledInput\n className={cx(firstValueErrorClass, firstValueSuccessClass)}\n value={firstValue}\n readOnly={readOnly}\n disabled={disabled}\n placeholder={firstPlaceholder}\n contentLeft={firstTextfieldContentLeft}\n contentRight={firstTextfieldContentRight}\n textBefore={firstTextfieldTextBefore}\n textAfter={firstTextfieldTextAfter}\n onChange={handleChangeFirstValue}\n onSearch={handleSearchFirstValue}\n onFocus={onFocusFirstTextfield}\n onBlur={onBlurFirstTextfield}\n />\n {Divider}\n <StyledInput\n className={cx(secondValueErrorClass, secondValueSuccessClass)}\n value={secondValue}\n readOnly={readOnly}\n disabled={disabled}\n placeholder={secondPlaceholder}\n contentLeft={secondTextfieldContentLeft}\n contentRight={secondTextfieldContentRight}\n textBefore={secondTextfieldTextBefore}\n textAfter={secondTextfieldTextAfter}\n onChange={handleChangeSecondValue}\n onSearch={handleSearchSecondValue}\n onFocus={onFocusSecondTextfield}\n onBlur={onBlurSecondTextfield}\n />\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n </ContentWrapper>\n {leftHelper && <LeftHelper>{leftHelper}</LeftHelper>}\n </Root>\n );\n },\n );\n\nexport const rangeConfig = {\n name: 'Range',\n tag: 'div',\n layout: rangeRoot,\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 readOnly: {\n css: readOnlyCSS,\n attrs: true,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["rangeRoot","Root","forwardRef","_ref","ref","_StyledDivider2","label","leftHelper","contentLeft","contentRight","view","size","_ref$readOnly","readOnly","_ref$disabled","disabled","_ref$dividerVariant","dividerVariant","dividerIcon","firstValue","secondValue","firstValueError","secondValueError","firstValueSuccess","secondValueSuccess","firstPlaceholder","secondPlaceholder","firstTextfieldContentLeft","firstTextfieldContentRight","secondTextfieldContentLeft","secondTextfieldContentRight","firstTextfieldTextBefore","secondTextfieldTextBefore","firstTextfieldTextAfter","secondTextfieldTextAfter","onChangeFirstValue","onChangeSecondValue","onSearchFirstValue","onSearchSecondValue","onFocusFirstTextfield","onFocusSecondTextfield","onBlurFirstTextfield","onBlurSecondTextfield","rest","_objectWithoutProperties","_excluded","rangeErrorClass","classes","rangeError","undefined","firstValueErrorClass","rangeValueError","secondValueErrorClass","rangeSuccessClass","rangeSuccess","firstValueSuccessClass","rangeValueSuccess","secondValueSuccessClass","handleChangeFirstValue","getChangeHandler","handleChangeSecondValue","handleSearchFirstValue","getSearchHandler","handleSearchSecondValue","Divider","useMemo","_StyledDivider","React","createElement","StyledDivider","_extends","StyledLabel","ContentWrapper","className","cx","StyledContentLeft","StyledInput","value","placeholder","textBefore","textAfter","onChange","onSearch","onFocus","onBlur","StyledContentRight","LeftHelper","rangeConfig","name","tag","layout","base","variations","css","viewCSS","sizeCSS","disabledCSS","attrs","readOnlyCSS","defaults"],"mappings":";;;;;;;;;;;;;IAuBaA,SAAS,GAAG,SAAZA,SAASA,CAAIC,IAA2C,EAAA;AAAA,EAAA,oBACjEC,UAAU,CACN,UAAAC,IAAA,EA0CIC,GAAG,EACF;AAAA,IAAA,IAAAC,eAAA,CAAA;AAAA,IAAA,IAzCGC,KAAK,GAAAH,IAAA,CAALG,KAAK;MACLC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;MACVC,WAAW,GAAAL,IAAA,CAAXK,WAAW;MACXC,YAAY,GAAAN,IAAA,CAAZM,YAAY;MACZC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MACJC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;MAAAC,aAAA,GAAAT,IAAA,CACJU,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MAAAE,aAAA,GAAAX,IAAA,CAChBY,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MAAAE,mBAAA,GAAAb,IAAA,CAEhBc,cAAc;AAAdA,MAAAA,cAAc,GAAAD,mBAAA,KAAG,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A,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACRlF,IAAAA,IAAI,EAAE;AACFmF,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACDnF,IAAAA,IAAI,EAAE;AACFkF,MAAAA,GAAG,EAAEE,MAAAA;KACR;AACDhF,IAAAA,QAAQ,EAAE;AACN8E,MAAAA,GAAG,EAAEG,MAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;KACV;AACDpF,IAAAA,QAAQ,EAAE;AACNgF,MAAAA,GAAG,EAAEK,MAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDE,EAAAA,QAAQ,EAAE;AACNxF,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salutejs/plasma-new-hope",
3
- "version": "0.85.0-canary.1208.9245279695.0",
3
+ "version": "0.85.0-canary.1208.9252417590.0",
4
4
  "description": "Salute Design System blueprint",
5
5
  "main": "cjs/index.js",
6
6
  "module": "es/index.js",
@@ -103,5 +103,5 @@
103
103
  "react-popper": "2.3.0",
104
104
  "storeon": "3.1.5"
105
105
  },
106
- "gitHead": "92dbd52afaf89fa19d6d14e17271263f911b6eeb"
106
+ "gitHead": "072ba798cfc393eec54ea9cad6dfd1f996f9c460"
107
107
  }
@@ -68,10 +68,10 @@ var rangeRoot = exports.rangeRoot = function rangeRoot(Root) {
68
68
  var rangeSuccessClass = firstValueSuccess && secondValueSuccess ? _Range2.classes.rangeSuccess : undefined;
69
69
  var firstValueSuccessClass = !rangeSuccessClass && firstValueSuccess ? _Range2.classes.rangeValueSuccess : undefined;
70
70
  var secondValueSuccessClass = !rangeSuccessClass && secondValueSuccess ? _Range2.classes.rangeValueSuccess : undefined;
71
- var handleChangeFirstValue = (0, _react.useCallback)((0, _utils2.getChangeHandler)(onChangeFirstValue, disabled, readOnly), [onChangeFirstValue, disabled, readOnly]);
72
- var handleChangeSecondValue = (0, _react.useCallback)((0, _utils2.getChangeHandler)(onChangeSecondValue, disabled, readOnly), [onChangeSecondValue, disabled, readOnly]);
73
- var handleSearchFirstValue = (0, _react.useCallback)((0, _utils2.getSearchHandler)(onSearchFirstValue, disabled, readOnly), [onSearchFirstValue, disabled, readOnly]);
74
- var handleSearchSecondValue = (0, _react.useCallback)((0, _utils2.getSearchHandler)(onSearchSecondValue, disabled, readOnly), [onSearchFirstValue, disabled, readOnly]);
71
+ var handleChangeFirstValue = (0, _utils2.getChangeHandler)(onChangeFirstValue, disabled, readOnly);
72
+ var handleChangeSecondValue = (0, _utils2.getChangeHandler)(onChangeSecondValue, disabled, readOnly);
73
+ var handleSearchFirstValue = (0, _utils2.getSearchHandler)(onSearchFirstValue, disabled, readOnly);
74
+ var handleSearchSecondValue = (0, _utils2.getSearchHandler)(onSearchSecondValue, disabled, readOnly);
75
75
  var Divider = (0, _react.useMemo)(function () {
76
76
  if (dividerVariant === 'none') {
77
77
  return null;
@@ -3,7 +3,7 @@ var _excluded = ["label", "leftHelper", "contentLeft", "contentRight", "view", "
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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
5
5
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
- import React, { forwardRef, useCallback, useMemo } from 'react';
6
+ import React, { forwardRef, useMemo } from 'react';
7
7
  import { cx } from '../../utils';
8
8
  import { base as sizeCSS } from './variations/_size/base';
9
9
  import { base as viewCSS } from './variations/_view/base';
@@ -59,10 +59,10 @@ export var rangeRoot = function rangeRoot(Root) {
59
59
  var rangeSuccessClass = firstValueSuccess && secondValueSuccess ? classes.rangeSuccess : undefined;
60
60
  var firstValueSuccessClass = !rangeSuccessClass && firstValueSuccess ? classes.rangeValueSuccess : undefined;
61
61
  var secondValueSuccessClass = !rangeSuccessClass && secondValueSuccess ? classes.rangeValueSuccess : undefined;
62
- var handleChangeFirstValue = useCallback(getChangeHandler(onChangeFirstValue, disabled, readOnly), [onChangeFirstValue, disabled, readOnly]);
63
- var handleChangeSecondValue = useCallback(getChangeHandler(onChangeSecondValue, disabled, readOnly), [onChangeSecondValue, disabled, readOnly]);
64
- var handleSearchFirstValue = useCallback(getSearchHandler(onSearchFirstValue, disabled, readOnly), [onSearchFirstValue, disabled, readOnly]);
65
- var handleSearchSecondValue = useCallback(getSearchHandler(onSearchSecondValue, disabled, readOnly), [onSearchFirstValue, disabled, readOnly]);
62
+ var handleChangeFirstValue = getChangeHandler(onChangeFirstValue, disabled, readOnly);
63
+ var handleChangeSecondValue = getChangeHandler(onChangeSecondValue, disabled, readOnly);
64
+ var handleSearchFirstValue = getSearchHandler(onSearchFirstValue, disabled, readOnly);
65
+ var handleSearchSecondValue = getSearchHandler(onSearchSecondValue, disabled, readOnly);
66
66
  var Divider = useMemo(function () {
67
67
  if (dividerVariant === 'none') {
68
68
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"Range.d.ts","sourceRoot":"","sources":["../../../src/components/Range/Range.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAkBhD,eAAO,MAAM,SAAS,SAAU,UAAU,cAAc,EAAE,UAAU,CAAC,wFAqIhE,CAAC;AAEN,eAAO,MAAM,WAAW;;;mBAvIQ,UAAU,cAAc,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;CAgKpE,CAAC"}
1
+ {"version":3,"file":"Range.d.ts","sourceRoot":"","sources":["../../../src/components/Range/Range.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAkBhD,eAAO,MAAM,SAAS,SAAU,UAAU,cAAc,EAAE,UAAU,CAAC,wFAkHhE,CAAC;AAEN,eAAO,MAAM,WAAW;;;mBApHQ,UAAU,cAAc,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;CA6IpE,CAAC"}