PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.3.0
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.3.0
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
cartflows / modules / gutenberg / src / components / typography / range-typography.js

range-typography.js in CartFlows – Funnel Builder & Checkout Plugin for WooCommerce 3.3.0, at modules/gutenberg/src/components/typography/range-typography.js

88 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies
3 */
4 import Range from '@Components/range/Range.js';
5 // Extend component
6 import { useSelect } from '@wordpress/data';
7 /**
8 * Build the Measure controls
9 *
10 * @param {Object[]} props
11 * @return {Object} Measure settings.
12 */
13 export default function RangeTypographyControl( props ) {
14 const deviceType = useSelect( ( select ) => {
15 return select( 'core/edit-post' )?.__experimentalGetPreviewDeviceType();
16 }, [] );
17
18 const output = {};
19
20 output.Desktop = (
21 <>
22 <Range
23 { ...props }
24 label={ props.sizeText }
25 value={ props.size.value || '' }
26 min={ 0 }
27 max={ 200 }
28 unit={ props.type }
29 responsive={ true }
30 setAttributes={props.setAttributes}
31 data={ {
32 value: props.size.value,
33 label: props.sizeLabel,
34 } }
35 step={ props?.step }
36 />
37 </>
38 );
39 output.Tablet = (
40 <>
41 <Range
42 { ...props }
43 label={ props.sizeTabletText }
44 value={ props.sizeTablet.value }
45 min={ 0 }
46 max={ 200 }
47 unit={ props.type }
48 responsive={ true }
49 setAttributes={props.setAttributes}
50 data={ {
51 value: props.sizeTablet.value,
52 label: props.sizeTabletLabel,
53 } }
54 step={ props?.step }
55 />
56 </>
57 );
58 output.Mobile = (
59 <>
60 <Range
61 { ...props }
62 label={ props.sizeMobileText }
63 value={ props.sizeMobile.value }
64 min={ 0 }
65 max={ 200 }
66 unit={ props.type }
67 responsive={ true }
68 setAttributes={props.setAttributes}
69 data={ {
70 value: props.sizeMobile.value,
71 label: props.sizeMobileLabel,
72 } }
73 step={ props?.step }
74 />
75 </>
76 );
77
78 return (
79 <div className="uagb-size-type-field-tabs">
80 <div className="uagb-responsive-control-inner">
81 { output[ deviceType ]
82 ? output[ deviceType ]
83 : output.Desktop }
84 </div>
85 </div>
86 );
87 }
88