Skip to content
Snippets Groups Projects

Main

Closed Eryk Mika requested to merge main into just_for_review
All threads resolved!

Files

+ 24
11
@@ -43,7 +43,8 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
@@ -43,7 +43,8 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
bodyBackground,
bodyBackground,
multipleBodyBackground,
multipleBodyBackground,
bodyBackgroundOdd,
bodyBackgroundEven,
 
bodyTextColorEven,
bodyTextColor,
bodyTextColor,
bodyTextAlign,
bodyTextAlign,
bodyFontWeight,
bodyFontWeight,
@@ -235,13 +236,13 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
@@ -235,13 +236,13 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
</PanelBody>
</PanelBody>
<PanelBody title={__('Body appearance', 'flexible-invoices-core')}>
<PanelBody title={__('Body appearance', 'flexible-invoices-core')}>
<ColorSelector
<ColorSelector
label={__('Text Color', 'flexible-invoices-core')}
label={__('Text color', 'flexible-invoices-core')}
value={bodyTextColor}
value={bodyTextColor}
enableAlpha={false}
enableAlpha={false}
onChange={(value) => setAttributes({bodyTextColor: value})}
onChange={(value) => setAttributes({bodyTextColor: value})}
/>
/>
<ColorSelector
<ColorSelector
label={__('Background Color', 'flexible-invoices-core')}
label={__('Background color', 'flexible-invoices-core')}
value={bodyBackground}
value={bodyBackground}
enableAlpha={false}
enableAlpha={false}
onChange={(value) => setAttributes({bodyBackground: value})}
onChange={(value) => setAttributes({bodyBackground: value})}
@@ -253,11 +254,23 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
@@ -253,11 +254,23 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
onChange={(newValue) => setAttributes({multipleBodyBackground: newValue})}
onChange={(newValue) => setAttributes({multipleBodyBackground: newValue})}
/>
/>
{multipleBodyBackground ? <ColorSelector
{multipleBodyBackground ?
label={__('Background color (odd rows)', 'flexible-invoices-core')}
<>
value={bodyBackgroundOdd}
<ColorSelector
onChange={(value) => setAttributes({bodyBackgroundOdd: value})}
label={__('Background color (even rows)', 'flexible-invoices-core')}
/> : ''}
value={bodyBackgroundEven}
 
onChange={(value) => setAttributes({bodyBackgroundEven: value})}
 
/>
 
<ColorSelector
 
label={__('Text color (even rows)', 'flexible-invoices-core')}
 
value={bodyTextColorEven}
 
enableAlpha={false}
 
onChange={(value) => setAttributes({bodyTextColorEven: value})}
 
/>
 
</>
 
: ''
 
 
}
<NumberWithUnit
<NumberWithUnit
label={__('Font size', 'flexible-invoices-core')}
label={__('Font size', 'flexible-invoices-core')}
@@ -372,9 +385,9 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
@@ -372,9 +385,9 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
</thead>
</thead>
<tbody className={"fitb-item-table-body"}>
<tbody className={"fitb-item-table-body"}>
{Array.from({length: 2}).map((_, index) => (
{Array.from({length: 2}).map((_, trIndex) => (
<tr className={"fitb-item-table-row"} style={{
<tr className={"fitb-item-table-row"} style={{
background: (multipleBodyBackground && index === 1) ? bodyBackgroundOdd : bodyBackground,
background: (multipleBodyBackground && trIndex === 1) ? bodyBackgroundEven : bodyBackground,
borderStyle: "solid",
borderStyle: "solid",
borderColor: bodyBorderRowColor,
borderColor: bodyBorderRowColor,
borderTopWidth: bodyBorderRowWidthTop,
borderTopWidth: bodyBorderRowWidthTop,
@@ -398,7 +411,7 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
@@ -398,7 +411,7 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
key={index}
key={index}
value={row}
value={row}
style={{
style={{
color: bodyTextColor,
color: (multipleBodyBackground && trIndex === 1) ? bodyTextColorEven : bodyTextColor,
textAlign: bodyTextAlign,
textAlign: bodyTextAlign,
fontStyle: bodyFontStyle,
fontStyle: bodyFontStyle,
fontSize: bodyFontSize,
fontSize: bodyFontSize,
Loading