@salutejs/plasma-new-hope 0.78.0-canary.1194.8928682263.0 → 0.78.0-canary.1195.8924860991.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Button/Button.styles.js +1 -0
- package/cjs/components/Button/Button.styles.js.map +1 -1
- package/cjs/components/Combobox/hooks/useFocusController.js +0 -1
- package/cjs/components/Combobox/hooks/useFocusController.js.map +1 -1
- package/cjs/components/Drawer/Drawer.js +1 -0
- package/cjs/components/Drawer/Drawer.js.map +1 -1
- package/cjs/components/IconButton/IconButton.css +24 -0
- package/cjs/components/IconButton/IconButton.js +50 -0
- package/cjs/components/IconButton/IconButton.js.map +1 -0
- package/cjs/components/IconButton/IconButton.styles.js +16 -0
- package/cjs/components/IconButton/IconButton.styles.js.map +1 -0
- package/cjs/components/IconButton/IconButton.styles_1hknr37.css +1 -0
- package/cjs/components/IconButton/IconButton.tokens.js +32 -0
- package/cjs/components/IconButton/IconButton.tokens.js.map +1 -0
- package/cjs/components/TextField/TextField.js +2 -6
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/index.css +2 -25
- package/cjs/index.js +5 -14
- package/cjs/index.js.map +1 -1
- package/cjs/utils/index.js.map +1 -1
- package/es/components/Button/Button.styles.js +1 -0
- package/es/components/Button/Button.styles.js.map +1 -1
- package/es/components/Combobox/hooks/useFocusController.js +0 -1
- package/es/components/Combobox/hooks/useFocusController.js.map +1 -1
- package/es/components/Drawer/Drawer.js +1 -0
- package/es/components/Drawer/Drawer.js.map +1 -1
- package/es/components/IconButton/IconButton.css +24 -0
- package/es/components/IconButton/IconButton.js +45 -0
- package/es/components/IconButton/IconButton.js.map +1 -0
- package/es/components/IconButton/IconButton.styles.js +12 -0
- package/es/components/IconButton/IconButton.styles.js.map +1 -0
- package/es/components/IconButton/IconButton.styles_1hknr37.css +1 -0
- package/es/components/IconButton/IconButton.tokens.js +28 -0
- package/es/components/IconButton/IconButton.tokens.js.map +1 -0
- package/es/components/TextField/TextField.js +2 -6
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/index.css +2 -25
- package/es/index.js +2 -8
- package/es/index.js.map +1 -1
- package/es/utils/index.js.map +1 -1
- package/package.json +2 -4
- package/styled-components/cjs/components/Button/Button.styles.js +10 -2
- package/styled-components/cjs/components/IconButton/IconButton.js +47 -0
- package/styled-components/cjs/components/IconButton/IconButton.styles.js +12 -0
- package/styled-components/cjs/components/IconButton/IconButton.tokens.js +31 -0
- package/styled-components/cjs/components/IconButton/index.js +25 -0
- package/styled-components/cjs/components/TextField/TextField.js +2 -6
- package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.config.js +46 -0
- package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/IconButton/IconButton.stories.tsx +69 -0
- package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.config.js +46 -0
- package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.js +11 -0
- package/styled-components/cjs/examples/plasma_web/components/IconButton/IconButton.stories.tsx +69 -0
- package/styled-components/cjs/hooks/index.js +1 -8
- package/styled-components/cjs/index.js +11 -11
- package/styled-components/cjs/utils/index.js +0 -7
- package/styled-components/es/components/Button/Button.styles.js +10 -2
- package/styled-components/es/components/IconButton/IconButton.js +41 -0
- package/styled-components/es/components/IconButton/IconButton.styles.js +6 -0
- package/styled-components/es/components/IconButton/IconButton.tokens.js +25 -0
- package/styled-components/es/components/IconButton/index.js +2 -0
- package/styled-components/es/components/TextField/TextField.js +2 -6
- package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.config.js +40 -0
- package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.js +5 -0
- package/styled-components/es/examples/plasma_b2c/components/IconButton/IconButton.stories.tsx +69 -0
- package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.config.js +40 -0
- package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.js +5 -0
- package/styled-components/es/examples/plasma_web/components/IconButton/IconButton.stories.tsx +69 -0
- package/styled-components/es/hooks/index.js +1 -2
- package/styled-components/es/index.js +2 -2
- package/styled-components/es/utils/index.js +0 -1
- package/types/components/Button/Button.styles.d.ts +1 -0
- package/types/components/Button/Button.styles.d.ts.map +1 -1
- package/types/components/IconButton/IconButton.d.ts +35 -0
- package/types/components/IconButton/IconButton.d.ts.map +1 -0
- package/types/components/IconButton/IconButton.styles.d.ts +3 -0
- package/types/components/IconButton/IconButton.styles.d.ts.map +1 -0
- package/types/components/IconButton/IconButton.tokens.d.ts +26 -0
- package/types/components/IconButton/IconButton.tokens.d.ts.map +1 -0
- package/types/components/IconButton/index.d.ts +3 -0
- package/types/components/IconButton/index.d.ts.map +1 -0
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/IconButton/IconButton.config.d.ts +39 -0
- package/types/examples/plasma_b2c/components/IconButton/IconButton.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/IconButton/IconButton.d.ts +33 -0
- package/types/examples/plasma_b2c/components/IconButton/IconButton.d.ts.map +1 -0
- package/types/examples/plasma_web/components/IconButton/IconButton.config.d.ts +39 -0
- package/types/examples/plasma_web/components/IconButton/IconButton.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/IconButton/IconButton.d.ts +33 -0
- package/types/examples/plasma_web/components/IconButton/IconButton.d.ts.map +1 -0
- package/types/hooks/index.d.ts +0 -1
- package/types/hooks/index.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/utils/index.d.ts +0 -1
- package/types/utils/index.d.ts.map +1 -1
- package/cjs/components/Slider/Slider.css +0 -69
- package/cjs/components/Slider/Slider.js +0 -58
- package/cjs/components/Slider/Slider.js.map +0 -1
- package/cjs/components/Slider/Slider.tokens.js +0 -79
- package/cjs/components/Slider/Slider.tokens.js.map +0 -1
- package/cjs/components/Slider/components/Double/Double.css +0 -62
- package/cjs/components/Slider/components/Double/Double.js +0 -274
- package/cjs/components/Slider/components/Double/Double.js.map +0 -1
- package/cjs/components/Slider/components/Double/Double.styles.js +0 -61
- package/cjs/components/Slider/components/Double/Double.styles.js.map +0 -1
- package/cjs/components/Slider/components/Double/Double.styles_1jhda4u.css +0 -7
- package/cjs/components/Slider/components/Single/Single.css +0 -16
- package/cjs/components/Slider/components/Single/Single.js +0 -160
- package/cjs/components/Slider/components/Single/Single.js.map +0 -1
- package/cjs/components/Slider/components/Single/Single.styles.js +0 -45
- package/cjs/components/Slider/components/Single/Single.styles.js.map +0 -1
- package/cjs/components/Slider/components/Single/Single.styles_1r9f1e0.css +0 -6
- package/cjs/components/Slider/components/SliderBase/SliderBase.css +0 -4
- package/cjs/components/Slider/components/SliderBase/SliderBase.js +0 -82
- package/cjs/components/Slider/components/SliderBase/SliderBase.js.map +0 -1
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +0 -33
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles.js.map +0 -1
- package/cjs/components/Slider/components/SliderBase/SliderBase.styles_7is2ll.css +0 -4
- package/cjs/components/Slider/ui/Handle/Handle.css +0 -4
- package/cjs/components/Slider/ui/Handle/Handle.js +0 -174
- package/cjs/components/Slider/ui/Handle/Handle.js.map +0 -1
- package/cjs/components/Slider/ui/Handle/Handle.styles.js +0 -21
- package/cjs/components/Slider/ui/Handle/Handle.styles.js.map +0 -1
- package/cjs/components/Slider/ui/Handle/Handle.styles_16a5sl.css +0 -2
- package/cjs/components/Slider/ui/Thumb/Thumb.css +0 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.js +0 -31
- package/cjs/components/Slider/ui/Thumb/Thumb.js.map +0 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.styles.js +0 -15
- package/cjs/components/Slider/ui/Thumb/Thumb.styles.js.map +0 -1
- package/cjs/components/Slider/ui/Thumb/Thumb.styles_zwgsh8.css +0 -1
- package/cjs/components/Slider/utils/index.js +0 -56
- package/cjs/components/Slider/utils/index.js.map +0 -1
- package/cjs/components/Slider/variations/_disabled/base.js +0 -9
- package/cjs/components/Slider/variations/_disabled/base.js.map +0 -1
- package/cjs/components/Slider/variations/_disabled/base_x642ct.css +0 -1
- package/cjs/components/Slider/variations/_size/base.js +0 -9
- package/cjs/components/Slider/variations/_size/base.js.map +0 -1
- package/cjs/components/Slider/variations/_size/base_x642ct.css +0 -1
- package/cjs/components/Slider/variations/_view/base.js +0 -9
- package/cjs/components/Slider/variations/_view/base.js.map +0 -1
- package/cjs/components/Slider/variations/_view/base_x642ct.css +0 -1
- package/cjs/hooks/useIsomorphicLayoutEffect.js +0 -15
- package/cjs/hooks/useIsomorphicLayoutEffect.js.map +0 -1
- package/cjs/utils/canUseDOM.js +0 -12
- package/cjs/utils/canUseDOM.js.map +0 -1
- package/es/components/Slider/Slider.css +0 -69
- package/es/components/Slider/Slider.js +0 -53
- package/es/components/Slider/Slider.js.map +0 -1
- package/es/components/Slider/Slider.tokens.js +0 -74
- package/es/components/Slider/Slider.tokens.js.map +0 -1
- package/es/components/Slider/components/Double/Double.css +0 -62
- package/es/components/Slider/components/Double/Double.js +0 -270
- package/es/components/Slider/components/Double/Double.js.map +0 -1
- package/es/components/Slider/components/Double/Double.styles.js +0 -51
- package/es/components/Slider/components/Double/Double.styles.js.map +0 -1
- package/es/components/Slider/components/Double/Double.styles_1jhda4u.css +0 -7
- package/es/components/Slider/components/Single/Single.css +0 -16
- package/es/components/Slider/components/Single/Single.js +0 -156
- package/es/components/Slider/components/Single/Single.js.map +0 -1
- package/es/components/Slider/components/Single/Single.styles.js +0 -36
- package/es/components/Slider/components/Single/Single.styles.js.map +0 -1
- package/es/components/Slider/components/Single/Single.styles_1r9f1e0.css +0 -6
- package/es/components/Slider/components/SliderBase/SliderBase.css +0 -4
- package/es/components/Slider/components/SliderBase/SliderBase.js +0 -78
- package/es/components/Slider/components/SliderBase/SliderBase.js.map +0 -1
- package/es/components/Slider/components/SliderBase/SliderBase.styles.js +0 -26
- package/es/components/Slider/components/SliderBase/SliderBase.styles.js.map +0 -1
- package/es/components/Slider/components/SliderBase/SliderBase.styles_7is2ll.css +0 -4
- package/es/components/Slider/ui/Handle/Handle.css +0 -4
- package/es/components/Slider/ui/Handle/Handle.js +0 -170
- package/es/components/Slider/ui/Handle/Handle.js.map +0 -1
- package/es/components/Slider/ui/Handle/Handle.styles.js +0 -16
- package/es/components/Slider/ui/Handle/Handle.styles.js.map +0 -1
- package/es/components/Slider/ui/Handle/Handle.styles_16a5sl.css +0 -2
- package/es/components/Slider/ui/Thumb/Thumb.css +0 -1
- package/es/components/Slider/ui/Thumb/Thumb.js +0 -27
- package/es/components/Slider/ui/Thumb/Thumb.js.map +0 -1
- package/es/components/Slider/ui/Thumb/Thumb.styles.js +0 -11
- package/es/components/Slider/ui/Thumb/Thumb.styles.js.map +0 -1
- package/es/components/Slider/ui/Thumb/Thumb.styles_zwgsh8.css +0 -1
- package/es/components/Slider/utils/index.js +0 -50
- package/es/components/Slider/utils/index.js.map +0 -1
- package/es/components/Slider/variations/_disabled/base.js +0 -5
- package/es/components/Slider/variations/_disabled/base.js.map +0 -1
- package/es/components/Slider/variations/_disabled/base_x642ct.css +0 -1
- package/es/components/Slider/variations/_size/base.js +0 -5
- package/es/components/Slider/variations/_size/base.js.map +0 -1
- package/es/components/Slider/variations/_size/base_x642ct.css +0 -1
- package/es/components/Slider/variations/_view/base.js +0 -5
- package/es/components/Slider/variations/_view/base.js.map +0 -1
- package/es/components/Slider/variations/_view/base_x642ct.css +0 -1
- package/es/hooks/useIsomorphicLayoutEffect.js +0 -11
- package/es/hooks/useIsomorphicLayoutEffect.js.map +0 -1
- package/es/utils/canUseDOM.js +0 -8
- package/es/utils/canUseDOM.js.map +0 -1
- package/styled-components/cjs/components/Slider/Slider.js +0 -57
- package/styled-components/cjs/components/Slider/Slider.tokens.js +0 -77
- package/styled-components/cjs/components/Slider/Slider.types.js +0 -5
- package/styled-components/cjs/components/Slider/components/Double/Double.js +0 -286
- package/styled-components/cjs/components/Slider/components/Double/Double.styles.js +0 -36
- package/styled-components/cjs/components/Slider/components/Double/Double.types.js +0 -5
- package/styled-components/cjs/components/Slider/components/Single/Single.js +0 -172
- package/styled-components/cjs/components/Slider/components/Single/Single.styles.js +0 -27
- package/styled-components/cjs/components/Slider/components/Single/Single.types.js +0 -5
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.js +0 -83
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.styles.js +0 -21
- package/styled-components/cjs/components/Slider/components/SliderBase/SliderBase.types.js +0 -5
- package/styled-components/cjs/components/Slider/components/index.js +0 -27
- package/styled-components/cjs/components/Slider/index.js +0 -32
- package/styled-components/cjs/components/Slider/ui/Handle/Handle.js +0 -183
- package/styled-components/cjs/components/Slider/ui/Handle/Handle.styles.js +0 -15
- package/styled-components/cjs/components/Slider/ui/Handle/Handle.types.js +0 -5
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.js +0 -32
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.styles.js +0 -12
- package/styled-components/cjs/components/Slider/ui/Thumb/Thumb.types.js +0 -5
- package/styled-components/cjs/components/Slider/ui/index.js +0 -63
- package/styled-components/cjs/components/Slider/utils/index.js +0 -55
- package/styled-components/cjs/components/Slider/variations/_disabled/base.js +0 -8
- package/styled-components/cjs/components/Slider/variations/_disabled/tokens.json +0 -4
- package/styled-components/cjs/components/Slider/variations/_size/base.js +0 -8
- package/styled-components/cjs/components/Slider/variations/_size/tokens.json +0 -0
- package/styled-components/cjs/components/Slider/variations/_view/base.js +0 -8
- package/styled-components/cjs/components/Slider/variations/_view/tokens.json +0 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.config.js +0 -29
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.js +0 -11
- package/styled-components/cjs/examples/plasma_b2c/components/Slider/Slider.stories.tsx +0 -131
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.config.js +0 -29
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.js +0 -11
- package/styled-components/cjs/examples/plasma_web/components/Slider/Slider.stories.tsx +0 -131
- package/styled-components/cjs/hooks/useIsomorphicLayoutEffect.js +0 -12
- package/styled-components/cjs/utils/canUseDOM.js +0 -11
- package/styled-components/es/components/Slider/Slider.js +0 -48
- package/styled-components/es/components/Slider/Slider.tokens.js +0 -71
- package/styled-components/es/components/Slider/Slider.types.js +0 -1
- package/styled-components/es/components/Slider/components/Double/Double.js +0 -278
- package/styled-components/es/components/Slider/components/Double/Double.styles.js +0 -29
- package/styled-components/es/components/Slider/components/Double/Double.types.js +0 -1
- package/styled-components/es/components/Slider/components/Single/Single.js +0 -164
- package/styled-components/es/components/Slider/components/Single/Single.styles.js +0 -20
- package/styled-components/es/components/Slider/components/Single/Single.types.js +0 -1
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.js +0 -74
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.styles.js +0 -14
- package/styled-components/es/components/Slider/components/SliderBase/SliderBase.types.js +0 -1
- package/styled-components/es/components/Slider/components/index.js +0 -3
- package/styled-components/es/components/Slider/index.js +0 -3
- package/styled-components/es/components/Slider/ui/Handle/Handle.js +0 -174
- package/styled-components/es/components/Slider/ui/Handle/Handle.styles.js +0 -8
- package/styled-components/es/components/Slider/ui/Handle/Handle.types.js +0 -1
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.js +0 -25
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.styles.js +0 -5
- package/styled-components/es/components/Slider/ui/Thumb/Thumb.types.js +0 -1
- package/styled-components/es/components/Slider/ui/index.js +0 -5
- package/styled-components/es/components/Slider/utils/index.js +0 -47
- package/styled-components/es/components/Slider/variations/_disabled/base.js +0 -2
- package/styled-components/es/components/Slider/variations/_disabled/tokens.json +0 -4
- package/styled-components/es/components/Slider/variations/_size/base.js +0 -2
- package/styled-components/es/components/Slider/variations/_size/tokens.json +0 -0
- package/styled-components/es/components/Slider/variations/_view/base.js +0 -2
- package/styled-components/es/components/Slider/variations/_view/tokens.json +0 -0
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.config.js +0 -23
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.js +0 -5
- package/styled-components/es/examples/plasma_b2c/components/Slider/Slider.stories.tsx +0 -131
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.config.js +0 -23
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.js +0 -5
- package/styled-components/es/examples/plasma_web/components/Slider/Slider.stories.tsx +0 -131
- package/styled-components/es/hooks/useIsomorphicLayoutEffect.js +0 -7
- package/styled-components/es/utils/canUseDOM.js +0 -5
- package/types/components/Slider/Slider.d.ts +0 -31
- package/types/components/Slider/Slider.d.ts.map +0 -1
- package/types/components/Slider/Slider.tokens.d.ts +0 -72
- package/types/components/Slider/Slider.tokens.d.ts.map +0 -1
- package/types/components/Slider/Slider.types.d.ts +0 -3
- package/types/components/Slider/Slider.types.d.ts.map +0 -1
- package/types/components/Slider/components/Double/Double.d.ts +0 -4
- package/types/components/Slider/components/Double/Double.d.ts.map +0 -1
- package/types/components/Slider/components/Double/Double.styles.d.ts +0 -43
- package/types/components/Slider/components/Double/Double.styles.d.ts.map +0 -1
- package/types/components/Slider/components/Double/Double.types.d.ts +0 -60
- package/types/components/Slider/components/Double/Double.types.d.ts.map +0 -1
- package/types/components/Slider/components/Single/Single.d.ts +0 -4
- package/types/components/Slider/components/Single/Single.d.ts.map +0 -1
- package/types/components/Slider/components/Single/Single.styles.d.ts +0 -8
- package/types/components/Slider/components/Single/Single.styles.d.ts.map +0 -1
- package/types/components/Slider/components/Single/Single.types.d.ts +0 -62
- package/types/components/Slider/components/Single/Single.types.d.ts.map +0 -1
- package/types/components/Slider/components/SliderBase/SliderBase.d.ts +0 -4
- package/types/components/Slider/components/SliderBase/SliderBase.d.ts.map +0 -1
- package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts +0 -6
- package/types/components/Slider/components/SliderBase/SliderBase.styles.d.ts.map +0 -1
- package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts +0 -45
- package/types/components/Slider/components/SliderBase/SliderBase.types.d.ts.map +0 -1
- package/types/components/Slider/components/index.d.ts +0 -6
- package/types/components/Slider/components/index.d.ts.map +0 -1
- package/types/components/Slider/index.d.ts +0 -6
- package/types/components/Slider/index.d.ts.map +0 -1
- package/types/components/Slider/ui/Handle/Handle.d.ts +0 -9
- package/types/components/Slider/ui/Handle/Handle.d.ts.map +0 -1
- package/types/components/Slider/ui/Handle/Handle.styles.d.ts +0 -4
- package/types/components/Slider/ui/Handle/Handle.styles.d.ts.map +0 -1
- package/types/components/Slider/ui/Handle/Handle.types.d.ts +0 -24
- package/types/components/Slider/ui/Handle/Handle.types.d.ts.map +0 -1
- package/types/components/Slider/ui/Thumb/Thumb.d.ts +0 -4
- package/types/components/Slider/ui/Thumb/Thumb.d.ts.map +0 -1
- package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts +0 -5
- package/types/components/Slider/ui/Thumb/Thumb.styles.d.ts.map +0 -1
- package/types/components/Slider/ui/Thumb/Thumb.types.d.ts +0 -12
- package/types/components/Slider/ui/Thumb/Thumb.types.d.ts.map +0 -1
- package/types/components/Slider/ui/index.d.ts +0 -6
- package/types/components/Slider/ui/index.d.ts.map +0 -1
- package/types/components/Slider/utils/index.d.ts +0 -33
- package/types/components/Slider/utils/index.d.ts.map +0 -1
- package/types/components/Slider/variations/_disabled/base.d.ts +0 -2
- package/types/components/Slider/variations/_disabled/base.d.ts.map +0 -1
- package/types/components/Slider/variations/_size/base.d.ts +0 -2
- package/types/components/Slider/variations/_size/base.d.ts.map +0 -1
- package/types/components/Slider/variations/_view/base.d.ts +0 -2
- package/types/components/Slider/variations/_view/base.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts +0 -22
- package/types/examples/plasma_b2c/components/Slider/Slider.config.d.ts.map +0 -1
- package/types/examples/plasma_b2c/components/Slider/Slider.d.ts +0 -17
- package/types/examples/plasma_b2c/components/Slider/Slider.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Slider/Slider.config.d.ts +0 -22
- package/types/examples/plasma_web/components/Slider/Slider.config.d.ts.map +0 -1
- package/types/examples/plasma_web/components/Slider/Slider.d.ts +0 -17
- package/types/examples/plasma_web/components/Slider/Slider.d.ts.map +0 -1
- package/types/hooks/useIsomorphicLayoutEffect.d.ts +0 -6
- package/types/hooks/useIsomorphicLayoutEffect.d.ts.map +0 -1
- package/types/utils/canUseDOM.d.ts +0 -6
- package/types/utils/canUseDOM.d.ts.map +0 -1
@@ -1,2 +0,0 @@
|
|
1
|
-
.hhwq33d{cursor:pointer;position:absolute;z-index:1;top:0;left:0;}
|
2
|
-
.shurctf{position:absolute;z-index:1;top:var(--plasma-slider-current-value-top-offset);text-align:center;width:100%;margin-left:-2px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;font-family:var(--plasma-slider-current-value-font-family);font-size:var(--plasma-slider-current-value-font-size);font-style:var(--plasma-slider-current-value-font-style);font-weight:var(--plasma-slider-current-value-font-weight);-webkit-letter-spacing:var(--plasma-slider-current-value-letter-spacing);-moz-letter-spacing:var(--plasma-slider-current-value-letter-spacing);-ms-letter-spacing:var(--plasma-slider-current-value-letter-spacing);letter-spacing:var(--plasma-slider-current-value-letter-spacing);line-height:var(--plasma-slider-current-value-line-height);}
|
@@ -1 +0,0 @@
|
|
1
|
-
.Thumb_styles_zwgsh8_tqbdf8b__6eb13971{width:var(--plasma-slider-thumb-size);height:var(--plasma-slider-thumb-size);position:relative;left:-2px;top:-2px;border-radius:50%;box-sizing:border-box;background:var(--plasma-slider-thumb-background-color);margin:2px;-webkit-transition:border-color 0.1s ease-in-out;transition:border-color 0.1s ease-in-out;}.Thumb_styles_zwgsh8_tqbdf8b__6eb13971:after{background:var(--plasma-slider-thumb-border-color);margin:-2px;content:'';position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;border-radius:inherit;}.Thumb_styles_zwgsh8_tqbdf8b__6eb13971:not([disabled]):hover:after,.Thumb_styles_zwgsh8_tqbdf8b__6eb13971:not([disabled]):active:after{background:var(--plasma-slider-thumb-focus-border-color);}.Thumb_styles_zwgsh8_tqbdf8b__6eb13971:focus{outline:none;}.Thumb_styles_zwgsh8_tqbdf8b__6eb13971:not([disabled]).Thumb_styles_zwgsh8_focusVisible__6eb13971,.Thumb_styles_zwgsh8_tqbdf8b__6eb13971:not([disabled])[data-focus-visible-added]{border-color:var(--plasma-slider-thumb-focus-border-color);}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
|
-
import React from 'react';
|
3
|
-
import { ThumbBase } from './Thumb.styles.js';
|
4
|
-
|
5
|
-
var _excluded = ["min", "max", "value", "ariaValueMin", "ariaLabel", "disabled"];
|
6
|
-
var Thumb = function Thumb(_ref) {
|
7
|
-
var min = _ref.min,
|
8
|
-
max = _ref.max,
|
9
|
-
value = _ref.value,
|
10
|
-
_ref$ariaValueMin = _ref.ariaValueMin,
|
11
|
-
ariaValueMin = _ref$ariaValueMin === void 0 ? min : _ref$ariaValueMin,
|
12
|
-
ariaLabel = _ref.ariaLabel,
|
13
|
-
disabled = _ref.disabled,
|
14
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
15
|
-
return /*#__PURE__*/React.createElement(ThumbBase, _extends({
|
16
|
-
role: "slider",
|
17
|
-
"aria-label": ariaLabel,
|
18
|
-
"aria-valuemin": ariaValueMin,
|
19
|
-
"aria-valuemax": max,
|
20
|
-
"aria-valuenow": value,
|
21
|
-
disabled: disabled,
|
22
|
-
"aria-orientation": "horizontal"
|
23
|
-
}, rest));
|
24
|
-
};
|
25
|
-
|
26
|
-
export { Thumb };
|
27
|
-
//# sourceMappingURL=Thumb.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Thumb.js","sources":["../../../../../src/components/Slider/ui/Thumb/Thumb.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { ThumbProps } from './Thumb.types';\nimport { ThumbBase } from './Thumb.styles';\n\nexport const Thumb = ({ min, max, value, ariaValueMin = min, ariaLabel, disabled, ...rest }: ThumbProps) => {\n return (\n <ThumbBase\n role=\"slider\"\n aria-label={ariaLabel}\n aria-valuemin={ariaValueMin}\n aria-valuemax={max}\n aria-valuenow={value}\n disabled={disabled}\n aria-orientation=\"horizontal\"\n {...rest}\n />\n );\n};\n"],"names":["Thumb","_ref","min","max","value","_ref$ariaValueMin","ariaValueMin","ariaLabel","disabled","rest","_objectWithoutProperties","_excluded","React","createElement","ThumbBase","_extends","role"],"mappings":";;;;;IAKaA,KAAK,GAAG,SAARA,KAAKA,CAAAC,IAAA,EAA0F;AAAA,EAAA,IAApFC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IAAEC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IAAEC,KAAK,GAAAH,IAAA,CAALG,KAAK;IAAAC,iBAAA,GAAAJ,IAAA,CAAEK,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAGH,KAAAA,CAAAA,GAAAA,GAAG,GAAAG,iBAAA;IAAEE,SAAS,GAAAN,IAAA,CAATM,SAAS;IAAEC,QAAQ,GAAAP,IAAA,CAARO,QAAQ;AAAKC,IAAAA,IAAI,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA,CAAA,CAAA;AACrF,EAAA,oBACIC,KAAA,CAAAC,aAAA,CAACC,SAAS,EAAAC,QAAA,CAAA;AACNC,IAAAA,IAAI,EAAC,QAAQ;AACb,IAAA,YAAA,EAAYT,SAAU;AACtB,IAAA,eAAA,EAAeD,YAAa;AAC5B,IAAA,eAAA,EAAeH,GAAI;AACnB,IAAA,eAAA,EAAeC,KAAM;AACrBI,IAAAA,QAAQ,EAAEA,QAAS;IACnB,kBAAiB,EAAA,YAAA;GACbC,EAAAA,IAAI,CACX,CAAC,CAAA;AAEV;;;;"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import './Thumb.styles_zwgsh8.css';
|
2
|
-
import { styled } from '@linaria/react';
|
3
|
-
|
4
|
-
var ThumbBase = /*#__PURE__*/styled('div')({
|
5
|
-
name: "ThumbBase",
|
6
|
-
"class": "tqbdf8b",
|
7
|
-
propsAsIs: false
|
8
|
-
});
|
9
|
-
|
10
|
-
export { ThumbBase };
|
11
|
-
//# sourceMappingURL=Thumb.styles.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Thumb.styles.js","sources":["../../../../../src/components/Slider/ui/Thumb/Thumb.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\n\nimport { tokens } from '../../Slider.tokens';\n\nexport const ThumbBase = styled.div<{ disabled?: boolean }>`\n width: var(${tokens.thumbSize});\n height: var(${tokens.thumbSize});\n position: relative;\n left: -2px;\n top: -2px;\n border-radius: 50%;\n box-sizing: border-box;\n background: var(${tokens.thumbBackgroundColor});\n margin: 2px;\n transition: border-color 0.1s ease-in-out;\n\n &:after {\n background: var(${tokens.thumbBorderColor});\n margin: -2px;\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: -1;\n border-radius: inherit;\n }\n\n &:not([disabled]):hover:after,\n &:not([disabled]):active:after {\n background: var(${tokens.thumbFocusBorderColor});\n }\n\n &:focus {\n outline: none;\n }\n\n &:not([disabled]) {\n &.focus-visible,\n &[data-focus-visible-added] {\n border-color: var(${tokens.thumbFocusBorderColor});\n }\n }\n`;\n"],"names":["ThumbBase","styled","name","class","propsAsIs"],"mappings":";;AAIO,IAAMA,SAAS,gBAAGC,MAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,WAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAwC9B;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
.tqbdf8b{width:var(--plasma-slider-thumb-size);height:var(--plasma-slider-thumb-size);position:relative;left:-2px;top:-2px;border-radius:50%;box-sizing:border-box;background:var(--plasma-slider-thumb-background-color);margin:2px;-webkit-transition:border-color 0.1s ease-in-out;transition:border-color 0.1s ease-in-out;}.tqbdf8b:after{background:var(--plasma-slider-thumb-border-color);margin:-2px;content:'';position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;border-radius:inherit;}.tqbdf8b:not([disabled]):hover:after,.tqbdf8b:not([disabled]):active:after{background:var(--plasma-slider-thumb-focus-border-color);}.tqbdf8b:focus{outline:none;}.tqbdf8b:not([disabled]).focus-visible,.tqbdf8b:not([disabled])[data-focus-visible-added]{border-color:var(--plasma-slider-thumb-focus-border-color);}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Расчитать значение слайдера с учетом его координат и шага изменений.
|
3
|
-
* @param {number} handleCenterXRelative
|
4
|
-
* @param {number} stepSize
|
5
|
-
* @param {number} min
|
6
|
-
* @param {number} max
|
7
|
-
* @return {number}
|
8
|
-
*/
|
9
|
-
function getSliderThumbValue(handleCenterXRelative, stepSize, min, max) {
|
10
|
-
var newValue = Math.round(handleCenterXRelative / stepSize) + min;
|
11
|
-
return Math.min(Math.max(newValue, min), max);
|
12
|
-
}
|
13
|
-
|
14
|
-
/**
|
15
|
-
* Расчитывает значение отступа слайдера на основе его положения (справа, слева) на отрезке слайдера.
|
16
|
-
* Значение используется для правильного расчета ограничения движения слайдера.
|
17
|
-
* @param ref
|
18
|
-
* @param {'left' | 'right'} side
|
19
|
-
* @return Array<number>
|
20
|
-
*/
|
21
|
-
function getOffsets(ref, side) {
|
22
|
-
if (!ref || !('current' in ref) || !ref.current || !side) {
|
23
|
-
return [0, 0];
|
24
|
-
}
|
25
|
-
var size = ref.current.clientWidth;
|
26
|
-
if (side === 'left') {
|
27
|
-
return [0, size];
|
28
|
-
}
|
29
|
-
if (side === 'right') {
|
30
|
-
return [size, 0];
|
31
|
-
}
|
32
|
-
return [0, 0];
|
33
|
-
}
|
34
|
-
var sizeData = {
|
35
|
-
s: {
|
36
|
-
indent: 0.5,
|
37
|
-
fontSizeMultiplier: 16
|
38
|
-
},
|
39
|
-
m: {
|
40
|
-
indent: 0.75,
|
41
|
-
fontSizeMultiplier: 16
|
42
|
-
},
|
43
|
-
l: {
|
44
|
-
indent: 0.75,
|
45
|
-
fontSizeMultiplier: 16
|
46
|
-
}
|
47
|
-
};
|
48
|
-
|
49
|
-
export { getOffsets, getSliderThumbValue, sizeData };
|
50
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Slider/utils/index.ts"],"sourcesContent":["import { MutableRefObject } from 'react';\n\n/**\n * Расчитать значение слайдера с учетом его координат и шага изменений.\n * @param {number} handleCenterXRelative\n * @param {number} stepSize\n * @param {number} min\n * @param {number} max\n * @return {number}\n */\nexport function getSliderThumbValue(handleCenterXRelative: number, stepSize: number, min: number, max: number) {\n const newValue = Math.round(handleCenterXRelative / stepSize) + min;\n\n return Math.min(Math.max(newValue, min), max);\n}\n\n/**\n * Расчитывает значение отступа слайдера на основе его положения (справа, слева) на отрезке слайдера.\n * Значение используется для правильного расчета ограничения движения слайдера.\n * @param ref\n * @param {'left' | 'right'} side\n * @return Array<number>\n */\nexport function getOffsets(\n ref: ((instance: HTMLDivElement | null) => void) | MutableRefObject<HTMLDivElement | null> | null,\n side?: 'left' | 'right',\n): number[] {\n if (!ref || !('current' in ref) || !ref.current || !side) {\n return [0, 0];\n }\n\n const size = ref.current.clientWidth;\n\n if (side === 'left') {\n return [0, size];\n }\n\n if (side === 'right') {\n return [size, 0];\n }\n\n return [0, 0];\n}\n\nexport const sizeData = {\n s: {\n indent: 0.5,\n fontSizeMultiplier: 16,\n },\n m: {\n indent: 0.75,\n fontSizeMultiplier: 16,\n },\n l: {\n indent: 0.75,\n fontSizeMultiplier: 16,\n },\n};\n"],"names":["getSliderThumbValue","handleCenterXRelative","stepSize","min","max","newValue","Math","round","getOffsets","ref","side","current","size","clientWidth","sizeData","s","indent","fontSizeMultiplier","m","l"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,mBAAmBA,CAACC,qBAA6B,EAAEC,QAAgB,EAAEC,GAAW,EAAEC,GAAW,EAAE;EAC3G,IAAMC,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACN,qBAAqB,GAAGC,QAAQ,CAAC,GAAGC,GAAG,CAAA;AAEnE,EAAA,OAAOG,IAAI,CAACH,GAAG,CAACG,IAAI,CAACF,GAAG,CAACC,QAAQ,EAAEF,GAAG,CAAC,EAAEC,GAAG,CAAC,CAAA;AACjD,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,UAAUA,CACtBC,GAAiG,EACjGC,IAAuB,EACf;AACR,EAAA,IAAI,CAACD,GAAG,IAAI,EAAE,SAAS,IAAIA,GAAG,CAAC,IAAI,CAACA,GAAG,CAACE,OAAO,IAAI,CAACD,IAAI,EAAE;AACtD,IAAA,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACjB,GAAA;AAEA,EAAA,IAAME,IAAI,GAAGH,GAAG,CAACE,OAAO,CAACE,WAAW,CAAA;EAEpC,IAAIH,IAAI,KAAK,MAAM,EAAE;AACjB,IAAA,OAAO,CAAC,CAAC,EAAEE,IAAI,CAAC,CAAA;AACpB,GAAA;EAEA,IAAIF,IAAI,KAAK,OAAO,EAAE;AAClB,IAAA,OAAO,CAACE,IAAI,EAAE,CAAC,CAAC,CAAA;AACpB,GAAA;AAEA,EAAA,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACjB,CAAA;AAEO,IAAME,QAAQ,GAAG;AACpBC,EAAAA,CAAC,EAAE;AACCC,IAAAA,MAAM,EAAE,GAAG;AACXC,IAAAA,kBAAkB,EAAE,EAAA;GACvB;AACDC,EAAAA,CAAC,EAAE;AACCF,IAAAA,MAAM,EAAE,IAAI;AACZC,IAAAA,kBAAkB,EAAE,EAAA;GACvB;AACDE,EAAAA,CAAC,EAAE;AACCH,IAAAA,MAAM,EAAE,IAAI;AACZC,IAAAA,kBAAkB,EAAE,EAAA;AACxB,GAAA;AACJ;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/Slider/variations/_disabled/base.tsx"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":"AAEO,IAAMA,IAAI,GAAQ;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/Slider/variations/_size/base.tsx"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":"AAEO,IAAMA,IAAI,GAAQ;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/Slider/variations/_view/base.tsx"],"sourcesContent":["import { css } from '@linaria/core';\n\nexport const base = css``;\n"],"names":["base"],"mappings":"AAEO,IAAMA,IAAI,GAAQ;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { useLayoutEffect, useEffect } from 'react';
|
2
|
-
import { canUseDOM } from '../utils/canUseDOM.js';
|
3
|
-
import '../utils/react.js';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Runs effect safely on server.
|
7
|
-
*/
|
8
|
-
var useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;
|
9
|
-
|
10
|
-
export { useIsomorphicLayoutEffect };
|
11
|
-
//# sourceMappingURL=useIsomorphicLayoutEffect.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useIsomorphicLayoutEffect.js","sources":["../../src/hooks/useIsomorphicLayoutEffect.ts"],"sourcesContent":["import { useLayoutEffect, useEffect } from 'react';\n\nimport { canUseDOM } from '../utils';\n\n/**\n * Runs effect safely on server.\n */\nexport const useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;\n"],"names":["useIsomorphicLayoutEffect","canUseDOM","useLayoutEffect","useEffect"],"mappings":";;;;AAIA;AACA;AACA;IACaA,yBAAyB,GAAGC,SAAS,GAAGC,eAAe,GAAGC;;;;"}
|
package/es/utils/canUseDOM.js
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This constant tells you whether can DOM be used.
|
3
|
-
* https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js
|
4
|
-
*/
|
5
|
-
var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
|
6
|
-
|
7
|
-
export { canUseDOM };
|
8
|
-
//# sourceMappingURL=canUseDOM.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"canUseDOM.js","sources":["../../src/utils/canUseDOM.ts"],"sourcesContent":["/**\n * This constant tells you whether can DOM be used.\n * https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js\n */\nexport const canUseDOM = !!(\n typeof window !== 'undefined' &&\n typeof window.document !== 'undefined' &&\n typeof window.document.createElement !== 'undefined'\n);\n"],"names":["canUseDOM","window","document","createElement"],"mappings":"AAAA;AACA;AACA;AACA;AACO,IAAMA,SAAS,GAAG,CAAC,EACtB,OAAOC,MAAM,KAAK,WAAW,IAC7B,OAAOA,MAAM,CAACC,QAAQ,KAAK,WAAW,IACtC,OAAOD,MAAM,CAACC,QAAQ,CAACC,aAAa,KAAK,WAAW;;;;"}
|
@@ -1,57 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
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); }
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports.sliderRoot = exports.sliderConfig = void 0;
|
8
|
-
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var _base = /*#__PURE__*/require("./variations/_view/base");
|
10
|
-
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
11
|
-
var _base3 = /*#__PURE__*/require("./variations/_disabled/base");
|
12
|
-
var _components = /*#__PURE__*/require("./components");
|
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
|
-
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
|
-
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
|
-
/**
|
21
|
-
* Слайдер позволяет определить числовое значение в пределах указанного промежутка.
|
22
|
-
* Можно указать два значения.
|
23
|
-
*/
|
24
|
-
var sliderRoot = exports.sliderRoot = function sliderRoot(Root) {
|
25
|
-
return /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
26
|
-
if (isSingleValueProps(props)) {
|
27
|
-
return /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
28
|
-
ref: ref
|
29
|
-
}, props), /*#__PURE__*/_react["default"].createElement(_components.SingleSlider, props));
|
30
|
-
}
|
31
|
-
return /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
32
|
-
ref: ref
|
33
|
-
}, props), /*#__PURE__*/_react["default"].createElement(_components.DoubleSlider, props));
|
34
|
-
});
|
35
|
-
};
|
36
|
-
var sliderConfig = exports.sliderConfig = {
|
37
|
-
name: 'Slider',
|
38
|
-
tag: 'div',
|
39
|
-
layout: sliderRoot,
|
40
|
-
base: '',
|
41
|
-
variations: {
|
42
|
-
view: {
|
43
|
-
css: _base.base
|
44
|
-
},
|
45
|
-
size: {
|
46
|
-
css: _base2.base
|
47
|
-
},
|
48
|
-
disabled: {
|
49
|
-
css: _base3.base,
|
50
|
-
attrs: true
|
51
|
-
}
|
52
|
-
},
|
53
|
-
defaults: {
|
54
|
-
view: 'default',
|
55
|
-
size: 'm'
|
56
|
-
}
|
57
|
-
};
|
@@ -1,77 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.tokens = exports.classes = void 0;
|
7
|
-
var classes = exports.classes = {
|
8
|
-
labelPlacementOuter: 'slider-label-placement-outer',
|
9
|
-
labelPlacementInner: 'slider-label-placement-inner',
|
10
|
-
rangeValuesPlacementOuter: 'slider-range-values-placement-outer',
|
11
|
-
rangeValuesPlacementInner: 'slider-range-values-placement-inner',
|
12
|
-
maxRangeValue: 'slider-max-range-value',
|
13
|
-
hideMinValue: 'slider-hide-min-value',
|
14
|
-
hideMaxValue: 'slider-hide-max-value',
|
15
|
-
textFieldActive: 'slider-text-field-active',
|
16
|
-
firstTextField: 'slider-first-text-field',
|
17
|
-
secondTextField: 'slider-second-text-field',
|
18
|
-
activeRangeValue: 'slider-active-range-value'
|
19
|
-
};
|
20
|
-
var tokens = exports.tokens = {
|
21
|
-
height: '--plasma-slider-height',
|
22
|
-
labelWrapperGap: '--plasma-slider-label-wrapper-gap',
|
23
|
-
labelWrapperMarginBottom: '--plasma-slider-label-wrapper-margin-bottom',
|
24
|
-
labelWrapperMarginRight: '--plasma-slider-label-wrapper-margin-right',
|
25
|
-
labelColor: '--plasma-slider-label-color',
|
26
|
-
labelFontFamily: '--plasma-slider-label-font-family',
|
27
|
-
labelFontSize: '--plasma-slider-label-font-size',
|
28
|
-
labelFontStyle: '--plasma-slider-label-font-style',
|
29
|
-
labelFontWeight: '--plasma-slider-label-font-weight',
|
30
|
-
labelLetterSpacing: '--plasma-slider-label-letter-spacing',
|
31
|
-
labelLineHeight: '--plasma-slider-label-line-height',
|
32
|
-
rangeMinValueMargin: '--plasma-slider-range-min-value-margin',
|
33
|
-
rangeMaxValueMargin: '--plasma-slider-range-max-value-margin',
|
34
|
-
rangeValueBottomOffset: '--plasma-slider-range-value-bottom-offset',
|
35
|
-
rangeValueColor: '--plasma-slider-range-value-color',
|
36
|
-
rangeValueFontFamily: '--plasma-slider-range-value-font-family',
|
37
|
-
rangeValueFontSize: '--plasma-slider-range-value-font-size',
|
38
|
-
rangeValueFontStyle: '--plasma-slider-range-value-font-style',
|
39
|
-
rangeValueFontWeight: '--plasma-slider-range-value-font-weight',
|
40
|
-
rangeValueLetterSpacing: '--plasma-slider-range-value-letter-spacing',
|
41
|
-
rangeValueLineHeight: '--plasma-slider-range-value-line-height',
|
42
|
-
doubleWrapperGap: '--plasma-slider-double-wrapper-gap',
|
43
|
-
thumbSize: '--plasma-slider-thumb-size',
|
44
|
-
thumbBorder: '--plasma-slider-thumb-border',
|
45
|
-
thumbBorderColor: '--plasma-slider-thumb-border-color',
|
46
|
-
thumbBackgroundColor: '--plasma-slider-thumb-background-color',
|
47
|
-
thumbFocusBorderColor: '--plasma-slider-thumb-focus-border-color',
|
48
|
-
currentValueTopOffset: '--plasma-slider-current-value-top-offset',
|
49
|
-
currentValueFontFamily: '--plasma-slider-current-value-font-family',
|
50
|
-
currentValueFontSize: '--plasma-slider-current-value-font-size',
|
51
|
-
currentValueFontStyle: '--plasma-slider-current-value-font-style',
|
52
|
-
currentValueFontWeight: '--plasma-slider-current-value-font-weight',
|
53
|
-
currentValueLetterSpacing: '--plasma-slider-current-value-letter-spacing',
|
54
|
-
currentValueLineHeight: '--plasma-slider-current-value-line-height',
|
55
|
-
railBackgroundColor: '--plasma-slider-rail-background-color',
|
56
|
-
railHeight: '--plasma-slider-rail-height',
|
57
|
-
railBorderRadius: '--plasma-slider-rail-border-radius',
|
58
|
-
railIndent: '--plasma-slider-rail-indent',
|
59
|
-
fillColor: '--plasma-slider-fill-color',
|
60
|
-
textFieldWrapperGap: '--plasma-slider-text-field-wrapper-gap',
|
61
|
-
textFieldFontFamily: '--plasma-slider-text-field-font-family',
|
62
|
-
textFieldFontSize: '--plasma-slider-text-field-font-size',
|
63
|
-
textFieldFontStyle: '--plasma-slider-text-field-font-style',
|
64
|
-
textFieldFontWeight: '--plasma-slider-text-field-font-weight',
|
65
|
-
textFieldLetterSpacing: '--plasma-slider-text-field-letter-spacing',
|
66
|
-
textFieldLineHeight: '--plasma-slider-text-field-line-height',
|
67
|
-
textFieldHeight: '--plasma-slider-text-field-height',
|
68
|
-
textFieldPadding: '--plasma-slider-text-field-padding',
|
69
|
-
textFieldBorderRadius: '--plasma-slider-text-field-border-radius',
|
70
|
-
textFieldColor: '--plasma-slider-text-field-color',
|
71
|
-
textFieldActiveColor: '--plasma-slider-text-field-active-color',
|
72
|
-
textFieldBackgroundColor: '--plasma-slider-text-field-background-color',
|
73
|
-
textFieldCaretColor: '--plasma-slider-text-field-caret-color',
|
74
|
-
textFieldPlaceholderColor: '--plasma-slider-text-field-placeholder-color',
|
75
|
-
textFiledFocusColor: '--plasma-slider-text-field-focus-color',
|
76
|
-
disabledOpacity: '--plasma-slider-disabled-opacity'
|
77
|
-
};
|
@@ -1,286 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
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); }
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports.DoubleSlider = void 0;
|
8
|
-
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var _SliderBase = /*#__PURE__*/require("../SliderBase/SliderBase");
|
10
|
-
var _ui = /*#__PURE__*/require("../../ui");
|
11
|
-
var _utils = /*#__PURE__*/require("../../utils");
|
12
|
-
var _utils2 = /*#__PURE__*/require("../../../../utils");
|
13
|
-
var _Slider = /*#__PURE__*/require("../../Slider.tokens");
|
14
|
-
var _Double = /*#__PURE__*/require("./Double.styles");
|
15
|
-
var _excluded = ["min", "max", "value", "disabled", "label", "labelContentLeft", "size", "onChangeCommitted", "onChangeDrag", "ariaLabel", "multipleStepSize"];
|
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
|
-
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
|
-
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); }
|
19
|
-
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; }
|
20
|
-
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; }
|
21
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
22
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
23
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
24
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
25
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
26
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
27
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
28
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
29
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
30
|
-
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; }
|
31
|
-
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; }
|
32
|
-
function getXCenterHandle(handle) {
|
33
|
-
var _handle$parentElement;
|
34
|
-
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;
|
35
|
-
var handleRect = handle.getBoundingClientRect();
|
36
|
-
var handlePosition = handleRect.x;
|
37
|
-
return handlePosition - containerX;
|
38
|
-
}
|
39
|
-
var DoubleSlider = exports.DoubleSlider = function DoubleSlider(_ref) {
|
40
|
-
var min = _ref.min,
|
41
|
-
max = _ref.max,
|
42
|
-
value = _ref.value,
|
43
|
-
disabled = _ref.disabled,
|
44
|
-
label = _ref.label,
|
45
|
-
labelContentLeft = _ref.labelContentLeft,
|
46
|
-
_ref$size = _ref.size,
|
47
|
-
size = _ref$size === void 0 ? 'm' : _ref$size,
|
48
|
-
onChangeCommitted = _ref.onChangeCommitted,
|
49
|
-
onChangeDrag = _ref.onChangeDrag,
|
50
|
-
ariaLabel = _ref.ariaLabel,
|
51
|
-
_ref$multipleStepSize = _ref.multipleStepSize,
|
52
|
-
multipleStepSize = _ref$multipleStepSize === void 0 ? 10 : _ref$multipleStepSize,
|
53
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
54
|
-
var _useState = (0, _react.useState)({
|
55
|
-
stepSize: 0,
|
56
|
-
railFillWidth: 0,
|
57
|
-
railFillXPosition: 0,
|
58
|
-
xFirstHandle: 0,
|
59
|
-
xSecondHandle: 0,
|
60
|
-
firstHandleZIndex: 100,
|
61
|
-
secondHandleZIndex: 101,
|
62
|
-
firstValue: value[0],
|
63
|
-
secondValue: value[1]
|
64
|
-
}),
|
65
|
-
_useState2 = _slicedToArray(_useState, 2),
|
66
|
-
state = _useState2[0],
|
67
|
-
setState = _useState2[1];
|
68
|
-
var _useState3 = (0, _react.useState)(false),
|
69
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
70
|
-
firstInputActive = _useState4[0],
|
71
|
-
setFirstInputActive = _useState4[1];
|
72
|
-
var _useState5 = (0, _react.useState)(false),
|
73
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
74
|
-
secondInputActive = _useState6[0],
|
75
|
-
setSecondInputActive = _useState6[1];
|
76
|
-
var firstHandleRef = (0, _react.useRef)(null);
|
77
|
-
var secondHandleRef = (0, _react.useRef)(null);
|
78
|
-
var firstHandleValue = (0, _react.useRef)(value[0]);
|
79
|
-
var secondHandleValue = (0, _react.useRef)(value[1]);
|
80
|
-
var _useState7 = (0, _react.useState)(value[0]),
|
81
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
82
|
-
firstValue = _useState8[0],
|
83
|
-
setFirstValue = _useState8[1];
|
84
|
-
var _useState9 = (0, _react.useState)(value[1]),
|
85
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
86
|
-
secondValue = _useState10[0],
|
87
|
-
setSecondValue = _useState10[1];
|
88
|
-
var stepSize = state.stepSize;
|
89
|
-
var hasLabelContent = label || labelContentLeft;
|
90
|
-
var firstInputActiveClass = firstInputActive && !disabled ? _Slider.classes.textFieldActive : undefined;
|
91
|
-
var secondInputActiveClass = secondInputActive && !disabled ? _Slider.classes.textFieldActive : undefined;
|
92
|
-
(0, _react.useEffect)(function () {
|
93
|
-
var firstLocalValue = Math.min(Math.max(value[0], min), max) - min;
|
94
|
-
var secondLocalValue = Math.min(Math.max(value[1], min), max) - min;
|
95
|
-
setState(function (prevState) {
|
96
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
97
|
-
railFillXPosition: stepSize * firstLocalValue,
|
98
|
-
railFillWidth: stepSize * secondLocalValue - stepSize * firstLocalValue,
|
99
|
-
xFirstHandle: stepSize * firstLocalValue,
|
100
|
-
xSecondHandle: stepSize * secondLocalValue
|
101
|
-
});
|
102
|
-
});
|
103
|
-
}, [value, stepSize, min, max]);
|
104
|
-
var setStepSize = (0, _react.useCallback)(function (newStepSize) {
|
105
|
-
setState(function (prevState) {
|
106
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
107
|
-
stepSize: newStepSize
|
108
|
-
});
|
109
|
-
});
|
110
|
-
}, []);
|
111
|
-
var onFirstHandleChange = (0, _react.useCallback)(function (handleValue, data) {
|
112
|
-
if (secondHandleRef !== null && secondHandleRef !== void 0 && secondHandleRef.current) {
|
113
|
-
var newHandleXPosition = data.x;
|
114
|
-
var secondHandleXPosition = getXCenterHandle(secondHandleRef.current);
|
115
|
-
var fillWidth = secondHandleXPosition - newHandleXPosition;
|
116
|
-
firstHandleValue.current = handleValue;
|
117
|
-
setFirstValue(handleValue);
|
118
|
-
setState(function (prevState) {
|
119
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
120
|
-
firstHandleZIndex: 101,
|
121
|
-
secondHandleZIndex: 100,
|
122
|
-
railFillWidth: fillWidth < 0 ? 0 : fillWidth,
|
123
|
-
railFillXPosition: newHandleXPosition
|
124
|
-
});
|
125
|
-
});
|
126
|
-
if (onChangeDrag) {
|
127
|
-
onChangeDrag([handleValue, value[1]]);
|
128
|
-
}
|
129
|
-
}
|
130
|
-
}, [onChangeDrag, value]);
|
131
|
-
var onFirstHandleChangeCommitted = (0, _react.useCallback)(function (handleValue, data) {
|
132
|
-
setFirstValue(handleValue);
|
133
|
-
onChangeCommitted && onChangeCommitted([handleValue, value[1]]);
|
134
|
-
setState(function (prevState) {
|
135
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
136
|
-
firstValue: handleValue,
|
137
|
-
xFirstHandle: data.lastX
|
138
|
-
});
|
139
|
-
});
|
140
|
-
}, [onChangeCommitted, value]);
|
141
|
-
var onFirstTextfieldChange = (0, _react.useCallback)(function (event) {
|
142
|
-
if (!(0, _utils2.isNumber)(event.target.value)) return;
|
143
|
-
var handleValue = Number(event.target.value);
|
144
|
-
setFirstValue(handleValue);
|
145
|
-
}, [_utils2.isNumber, setFirstValue]);
|
146
|
-
var onFirstTextfieldEnter = (0, _react.useCallback)(function (newValue) {
|
147
|
-
if (!(0, _utils2.isNumber)(newValue)) return;
|
148
|
-
var handleValue = Math.min(Math.max(Number(newValue), min), value[1]);
|
149
|
-
var handleValueLocal = Math.min(Math.max(handleValue, min), max) - min;
|
150
|
-
setFirstValue(handleValue);
|
151
|
-
setState(function (prevState) {
|
152
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
153
|
-
firstValue: handleValue,
|
154
|
-
xFirstHandle: handleValueLocal * stepSize
|
155
|
-
});
|
156
|
-
});
|
157
|
-
onChangeCommitted && onChangeCommitted([handleValue, value[1]]);
|
158
|
-
}, [_utils2.isNumber, onChangeCommitted, setFirstValue, value, min, max, stepSize]);
|
159
|
-
var onSecondHandleChange = (0, _react.useCallback)(function (handleValue, data) {
|
160
|
-
if (firstHandleRef !== null && firstHandleRef !== void 0 && firstHandleRef.current) {
|
161
|
-
var firstXHandleXPosition = getXCenterHandle(firstHandleRef.current);
|
162
|
-
var newHandleXPosition = data.x;
|
163
|
-
var fillWidth = newHandleXPosition - firstXHandleXPosition;
|
164
|
-
secondHandleValue.current = handleValue;
|
165
|
-
setSecondValue(handleValue);
|
166
|
-
setState(function (prevState) {
|
167
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
168
|
-
firstHandleZIndex: 100,
|
169
|
-
secondHandleZIndex: 101,
|
170
|
-
railFillWidth: fillWidth < 0 ? 0 : fillWidth,
|
171
|
-
railFillXPosition: firstXHandleXPosition
|
172
|
-
});
|
173
|
-
});
|
174
|
-
if (onChangeDrag) {
|
175
|
-
onChangeDrag([value[0], handleValue]);
|
176
|
-
}
|
177
|
-
}
|
178
|
-
}, [onChangeDrag, value]);
|
179
|
-
var onSecondHandleChangeCommitted = (0, _react.useCallback)(function (handleValue, data) {
|
180
|
-
onChangeCommitted && onChangeCommitted([value[0], handleValue]);
|
181
|
-
setSecondValue(handleValue);
|
182
|
-
setState(function (prevState) {
|
183
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
184
|
-
secondValue: handleValue,
|
185
|
-
xSecondHandle: data.lastX
|
186
|
-
});
|
187
|
-
});
|
188
|
-
}, [onChangeCommitted, value]);
|
189
|
-
var onSecondTextfieldChange = (0, _react.useCallback)(function (event) {
|
190
|
-
if (!(0, _utils2.isNumber)(event.target.value)) return;
|
191
|
-
var handleValue = Number(event.target.value);
|
192
|
-
setSecondValue(handleValue);
|
193
|
-
}, [_utils2.isNumber, setSecondValue]);
|
194
|
-
var onSecondTextfieldEnter = (0, _react.useCallback)(function (newValue) {
|
195
|
-
if (!(0, _utils2.isNumber)(newValue)) return;
|
196
|
-
var handleValue = Math.max(Math.min(Number(newValue), max), value[0]);
|
197
|
-
var handleValueLocal = Math.min(Math.max(handleValue, min), max) - min;
|
198
|
-
setSecondValue(handleValue);
|
199
|
-
setState(function (prevState) {
|
200
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
201
|
-
secondValue: handleValue,
|
202
|
-
xSecondHandle: handleValueLocal * stepSize
|
203
|
-
});
|
204
|
-
});
|
205
|
-
onChangeCommitted && onChangeCommitted([value[0], handleValue]);
|
206
|
-
}, [_utils2.isNumber, setSecondValue, onChangeCommitted, value, min, max, stepSize]);
|
207
|
-
var _ref2 = ariaLabel || [],
|
208
|
-
_ref3 = _slicedToArray(_ref2, 2),
|
209
|
-
ariaLabelLeft = _ref3[0],
|
210
|
-
ariaLabelRight = _ref3[1];
|
211
|
-
var currentFirstSliderValue = Math.max(state.firstValue, min);
|
212
|
-
return /*#__PURE__*/_react["default"].createElement(_Double.DoubleWrapper, null, hasLabelContent && /*#__PURE__*/_react["default"].createElement(_Double.LabelWrapper, null, labelContentLeft && /*#__PURE__*/_react["default"].createElement(_Double.LabelContentLeft, null, labelContentLeft), label && /*#__PURE__*/_react["default"].createElement(_Double.Label, null, label)), /*#__PURE__*/_react["default"].createElement(_Double.SliderWrapper, null, /*#__PURE__*/_react["default"].createElement(_SliderBase.SliderBase, _extends({
|
213
|
-
min: min,
|
214
|
-
max: max,
|
215
|
-
disabled: disabled,
|
216
|
-
setStepSize: setStepSize,
|
217
|
-
railFillWidth: state.railFillWidth,
|
218
|
-
settings: _utils.sizeData[size],
|
219
|
-
railFillXPosition: state.railFillXPosition
|
220
|
-
}, rest), /*#__PURE__*/_react["default"].createElement(_ui.Handle, {
|
221
|
-
ref: firstHandleRef,
|
222
|
-
stepSize: state.stepSize,
|
223
|
-
multipleStepSize: multipleStepSize,
|
224
|
-
onChangeCommitted: onFirstHandleChangeCommitted,
|
225
|
-
onChange: onFirstHandleChange,
|
226
|
-
min: min,
|
227
|
-
max: state.secondValue,
|
228
|
-
disabled: disabled,
|
229
|
-
bounds: [min, state.secondValue],
|
230
|
-
side: "left",
|
231
|
-
xPosition: state.xFirstHandle,
|
232
|
-
zIndex: state.firstHandleZIndex,
|
233
|
-
value: currentFirstSliderValue,
|
234
|
-
ariaLabel: ariaLabelLeft,
|
235
|
-
onMouseEnter: function onMouseEnter() {
|
236
|
-
return setFirstInputActive(true);
|
237
|
-
},
|
238
|
-
onMouseLeave: function onMouseLeave() {
|
239
|
-
return setFirstInputActive(false);
|
240
|
-
}
|
241
|
-
}), /*#__PURE__*/_react["default"].createElement(_ui.Handle, {
|
242
|
-
ref: secondHandleRef,
|
243
|
-
stepSize: state.stepSize,
|
244
|
-
multipleStepSize: multipleStepSize,
|
245
|
-
onChangeCommitted: onSecondHandleChangeCommitted,
|
246
|
-
onChange: onSecondHandleChange,
|
247
|
-
min: min,
|
248
|
-
ariaValueMin: currentFirstSliderValue,
|
249
|
-
max: max,
|
250
|
-
disabled: disabled,
|
251
|
-
bounds: [state.firstValue, max],
|
252
|
-
side: "right",
|
253
|
-
xPosition: state.xSecondHandle,
|
254
|
-
zIndex: state.secondHandleZIndex,
|
255
|
-
value: Math.max(state.secondValue, min),
|
256
|
-
ariaLabel: ariaLabelRight,
|
257
|
-
onMouseEnter: function onMouseEnter() {
|
258
|
-
return setSecondInputActive(true);
|
259
|
-
},
|
260
|
-
onMouseLeave: function onMouseLeave() {
|
261
|
-
return setSecondInputActive(false);
|
262
|
-
}
|
263
|
-
})), /*#__PURE__*/_react["default"].createElement(_Double.InputsWrapper, null, /*#__PURE__*/_react["default"].createElement(_Double.StyledInput, {
|
264
|
-
className: (0, _utils2.cx)(_Slider.classes.firstTextField, firstInputActiveClass),
|
265
|
-
enumerationType: "plain",
|
266
|
-
disabled: disabled,
|
267
|
-
value: firstValue,
|
268
|
-
onChange: function onChange(e) {
|
269
|
-
return onFirstTextfieldChange(e);
|
270
|
-
},
|
271
|
-
onSearch: function onSearch(e) {
|
272
|
-
return onFirstTextfieldEnter(e);
|
273
|
-
}
|
274
|
-
}), /*#__PURE__*/_react["default"].createElement(_Double.StyledInput, {
|
275
|
-
className: (0, _utils2.cx)(_Slider.classes.secondTextField, secondInputActiveClass),
|
276
|
-
enumerationType: "plain",
|
277
|
-
disabled: disabled,
|
278
|
-
value: secondValue,
|
279
|
-
onChange: function onChange(e) {
|
280
|
-
return onSecondTextfieldChange(e);
|
281
|
-
},
|
282
|
-
onSearch: function onSearch(e) {
|
283
|
-
return onSecondTextfieldEnter(e);
|
284
|
-
}
|
285
|
-
}))));
|
286
|
-
};
|