Skip to content
Snippets Groups Projects

Main

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

Files

+ 42
27
@@ -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,
@@ -204,10 +205,10 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
@@ -204,10 +205,10 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
label={__("Border row width", 'flexible-invoices-core')}
label={__("Border row width", 'flexible-invoices-core')}
values={
values={
{
{
headerBorderRowWidthTop: headerBorderRowWidthTop,
headerBorderRowWidthTop,
headerBorderRowWidthLeft: headerBorderRowWidthLeft,
headerBorderRowWidthLeft,
headerBorderRowWidthRight: headerBorderRowWidthRight,
headerBorderRowWidthRight,
headerBorderRowWidthBottom: headerBorderRowWidthBottom,
headerBorderRowWidthBottom,
}
}
}
}
onChange={handleMultipleAttributesChange}
onChange={handleMultipleAttributesChange}
@@ -223,10 +224,10 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
@@ -223,10 +224,10 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
label={__("Border cell width", 'flexible-invoices-core')}
label={__("Border cell width", 'flexible-invoices-core')}
values={
values={
{
{
headerBorderCellWidthTop: headerBorderCellWidthTop,
headerBorderCellWidthTop,
headerBorderCellWidthLeft: headerBorderCellWidthLeft,
headerBorderCellWidthLeft,
headerBorderCellWidthRight: headerBorderCellWidthRight,
headerBorderCellWidthRight,
headerBorderCellWidthBottom: headerBorderCellWidthBottom,
headerBorderCellWidthBottom,
}
}
}
}
onChange={handleMultipleAttributesChange}
onChange={handleMultipleAttributesChange}
@@ -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')}
@@ -288,16 +301,17 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
@@ -288,16 +301,17 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
label={__('Border row color', 'flexible-invoices-core')}
label={__('Border row color', 'flexible-invoices-core')}
value={bodyBorderRowColor}
value={bodyBorderRowColor}
enableAlpha={false}
enableAlpha={false}
 
returnFormat={'hex'}
onChange={(value) => setAttributes({bodyBorderRowColor: value})}
onChange={(value) => setAttributes({bodyBorderRowColor: value})}
/>
/>
<QuatroInput
<QuatroInput
label={__("Border row width", 'flexible-invoices-core')}
label={__("Border row width", 'flexible-invoices-core')}
values={
values={
{
{
bodyBorderRowWidthTop: bodyBorderRowWidthTop,
bodyBorderRowWidthTop,
bodyBorderRowWidthLeft: bodyBorderRowWidthLeft,
bodyBorderRowWidthLeft,
bodyBorderRowWidthRight: bodyBorderRowWidthRight,
bodyBorderRowWidthRight,
bodyBorderRowWidthBottom: bodyBorderRowWidthBottom,
bodyBorderRowWidthBottom,
}
}
}
}
onChange={handleMultipleAttributesChange}
onChange={handleMultipleAttributesChange}
@@ -306,16 +320,17 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
@@ -306,16 +320,17 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
label={__('Border cell color', 'flexible-invoices-core')}
label={__('Border cell color', 'flexible-invoices-core')}
value={bodyBorderCellColor}
value={bodyBorderCellColor}
enableAlpha={false}
enableAlpha={false}
 
returnFormat={'hex'}
onChange={(value) => setAttributes({bodyBorderCellColor: value})}
onChange={(value) => setAttributes({bodyBorderCellColor: value})}
/>
/>
<QuatroInput
<QuatroInput
label={__("Border cell width", 'flexible-invoices-core')}
label={__("Border cell width", 'flexible-invoices-core')}
values={
values={
{
{
bodyBorderCellWidthTop: bodyBorderCellWidthTop,
bodyBorderCellWidthTop,
bodyBorderCellWidthLeft: bodyBorderCellWidthLeft,
bodyBorderCellWidthLeft,
bodyBorderCellWidthRight: bodyBorderCellWidthRight,
bodyBorderCellWidthRight,
bodyBorderCellWidthBottom: bodyBorderCellWidthBottom,
bodyBorderCellWidthBottom,
}
}
}
}
onChange={handleMultipleAttributesChange}
onChange={handleMultipleAttributesChange}
@@ -372,9 +387,9 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
@@ -372,9 +387,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 +413,7 @@ export default function FlexibleTable({attributes, setAttributes, placeholders,
@@ -398,7 +413,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