| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
use ABlocks\Controls\Alignment; |
| 7 |
use ABlocks\Controls\TextShadow; |
| 8 |
use ABlocks\Controls\Typography; |
| 9 |
use ABlocks\Controls\Range; |
| 10 |
use ABlocks\Controls\Dimensions; |
| 11 |
use ABlocks\Controls\Icon; |
| 12 |
use ABlocks\Components\ButtonGroup; |
| 13 |
$attributes = [ |
| 14 |
'block_id' => [ |
| 15 |
'type' => 'string', |
| 16 |
'default' => '', |
| 17 |
], |
| 18 |
'blockVersion' => [ |
| 19 |
'type' => 'number', |
| 20 |
'default' => '', |
| 21 |
], |
| 22 |
'isShowIcon' => [ |
| 23 |
'type' => 'boolean', |
| 24 |
'default' => true, |
| 25 |
], |
| 26 |
'mediaPosition' => [ |
| 27 |
'type' => 'string', |
| 28 |
'default' => 'top', |
| 29 |
], |
| 30 |
'startNumber' => [ |
| 31 |
'type' => 'number', |
| 32 |
'default' => 0, |
| 33 |
], |
| 34 |
'endNumber' => [ |
| 35 |
'type' => 'number', |
| 36 |
'default' => 80, |
| 37 |
], |
| 38 |
'totalNumber' => [ |
| 39 |
'type' => 'number', |
| 40 |
'default' => 100, |
| 41 |
], |
| 42 |
|
| 43 |
'animationRepeat' => [ |
| 44 |
'type' => 'boolean', |
| 45 |
'default' => false, |
| 46 |
], |
| 47 |
'counterPrefix' => [ |
| 48 |
'type' => 'string', |
| 49 |
'default' => '', |
| 50 |
], |
| 51 |
'counterSuffix' => [ |
| 52 |
'type' => 'string', |
| 53 |
'default' => '%', |
| 54 |
], |
| 55 |
'separator' => [ |
| 56 |
'type' => 'string', |
| 57 |
'default' => ',', |
| 58 |
], |
| 59 |
'counterTitle' => [ |
| 60 |
'type' => 'string', |
| 61 |
'default' => 'Enter your title', |
| 62 |
], |
| 63 |
'numberColor' => [ |
| 64 |
'type' => 'string', |
| 65 |
'default' => '#08fd00ff', |
| 66 |
], |
| 67 |
'headingColor' => [ |
| 68 |
'type' => 'string', |
| 69 |
'default' => '#4B4F58', |
| 70 |
], |
| 71 |
'circleProgressColor' => [ |
| 72 |
'type' => 'string', |
| 73 |
'default' => 'black', |
| 74 |
], |
| 75 |
'circleBackgroundColor' => [ |
| 76 |
'type' => 'string', |
| 77 |
'default' => '#dadada', |
| 78 |
], |
| 79 |
'barProgressColor' => [ |
| 80 |
'type' => 'string', |
| 81 |
'default' => 'black', |
| 82 |
], |
| 83 |
'barBackgroundColor' => [ |
| 84 |
'type' => 'string', |
| 85 |
'default' => '#dadada', |
| 86 |
], |
| 87 |
'barHeadingPosition' => [ |
| 88 |
'type' => 'string', |
| 89 |
'default' => 'top' |
| 90 |
], |
| 91 |
|
| 92 |
]; |
| 93 |
$attributes = array_merge( |
| 94 |
Dimensions::get_attribute( 'numberMargin', true ), |
| 95 |
Dimensions::get_attribute( 'headingMargin', true ), |
| 96 |
Alignment::get_attribute( 'alignment', true, [ 'value' => 'center' ] ), |
| 97 |
Typography::get_attribute( 'numberTypography', true ), |
| 98 |
Typography::get_attribute( 'headingTypography', true ), |
| 99 |
ButtonGroup::get_attribute( 'layout', false, [ |
| 100 |
'value' => 'number', |
| 101 |
] ), |
| 102 |
Range::get_attribute( [ |
| 103 |
'attributeName' => 'duration', |
| 104 |
'isResponsive' => false, |
| 105 |
'defaultValue' => 1000, |
| 106 |
] ), |
| 107 |
Range::get_attribute( [ |
| 108 |
'attributeName' => 'decimalPlaces', |
| 109 |
'isResponsive' => false, |
| 110 |
'defaultValue' => 0, |
| 111 |
] ), |
| 112 |
Range::get_attribute( [ |
| 113 |
'attributeName' => 'circleSize', |
| 114 |
'isResponsive' => false, |
| 115 |
'defaultValue' => 220, |
| 116 |
] ), |
| 117 |
Range::get_attribute( [ |
| 118 |
'attributeName' => 'circleStrokeSize', |
| 119 |
'isResponsive' => false, |
| 120 |
'defaultValue' => 20, |
| 121 |
]), |
| 122 |
Range::get_attribute( [ |
| 123 |
'attributeName' => 'barSize', |
| 124 |
'isResponsive' => true, |
| 125 |
'defaultValue' => 30, |
| 126 |
'hasUnit' => true, |
| 127 |
'unitDefaultValue' => 'px', |
| 128 |
'copyStyle' => true, |
| 129 |
] ), |
| 130 |
Range::get_attribute( [ |
| 131 |
'attributeName' => 'iconSize', |
| 132 |
'isResponsive' => true, |
| 133 |
'attributeObjectKey' => 'value', |
| 134 |
'defaultValue' => 30, |
| 135 |
]), |
| 136 |
Range::get_attribute( [ |
| 137 |
'attributeName' => 'iconRotate', |
| 138 |
'isResponsive' => false, |
| 139 |
'defaultValue' => 0, |
| 140 |
]), |
| 141 |
Icon::get_attribute(), |
| 142 |
$attributes |
| 143 |
); |
| 144 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 145 |
|
| 146 |
|