??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/am1atec.co.uk/wp-content/plugins/latepoint/blocks/controls/PaddingBoxControl.js
⬅ Kembali
import { __ } from '@wordpress/i18n';
import { __experimentalBoxControl as BoxControl } from '@wordpress/components';
import React from "react";
const PaddingBoxControl = ({ label, paddingAttribute, attributes, setAttributes }) => {
const defaultPadding = {
top: '',
right: '',
bottom: '',
left: ''
};
const handleBoxControlChange = (newValues) => {
setAttributes({ [paddingAttribute]: paddingToString(newValues) });
};
const paddingValues = () => {
if (!attributes[paddingAttribute]) return defaultPadding;
const values = attributes[paddingAttribute].split(' ');
const positions = ['top', 'right', 'bottom', 'left'];
return positions.reduce((acc, position, index) => {
acc[position] = values[index] || '';
return acc;
}, {});
};
const paddingToString = (padding) => {
if (!padding.top && !padding.right && !padding.bottom && !padding.left) {
return '';
}
return [
padding.top || '0',
padding.right || '0',
padding.bottom || '0',
padding.left || '0',
].join(' ').trim();
};
return (
<div className="lb-boxcontrol">
<BoxControl
label={__(label)}
values={paddingValues()}
onChange={handleBoxControlChange}
resetValues={defaultPadding}
/>
</div>
);
};
export default PaddingBoxControl;
Nama
Tipe
Ukuran
Diubah
Aksi
📜 BorderControl.js
js
4.1 KB
2025-01-29 06:25
📜 BoxShadowControl.js
js
3.2 KB
2025-01-29 06:25
📜 ColorSelectorControl.js
js
1.3 KB
2025-01-29 06:25
📜 FontSizeControl.js
js
2.8 KB
2025-01-29 06:25
📜 LatepointIcons.js
js
1.7 KB
2025-01-29 06:25
📜 LetterSpacingControl.js
js
2.5 KB
2025-01-29 06:25
📜 LineHeightControl.js
js
2.8 KB
2025-01-29 06:25
📜 PaddingBoxControl.js
js
1.5 KB
2025-01-29 06:25
📜 TypographyControl.js
js
4.1 KB
2025-01-29 06:25