Animation.php
1 year ago
Background.php
1 year ago
BackgroundImage.php
1 year ago
Border.php
2 years ago
BoxShadow.php
1 year ago
ColumnWidth.php
1 year ago
CustomHeight.php
1 year ago
CustomSize.php
4 years ago
Gap.php
1 year ago
Height.php
1 year ago
JustifyContent.php
1 year ago
MaxWidth.php
1 year ago
MultipleImage.php
1 year ago
ObjectCss.php
1 year ago
Opacity.php
1 year ago
Property.php
1 year ago
PropertyBase.php
1 year ago
Size.php
1 year ago
Stroke.php
1 year ago
TBLR.php
1 year ago
TextShadow.php
1 year ago
Transform.php
2 years ago
Transition.php
1 year ago
Typography.php
1 month ago
UnitValuePercentage.php
1 year ago
UnitValuePx.php
1 year ago
ValueProxy.php
4 years ago
Width.php
1 year ago
ColumnWidth.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Kubio\Core\StyleManager\Props; |
| 5 | |
| 6 | use Kubio\Core\LodashBasic; |
| 7 | use Kubio\Core\StyleManager\ParserUtils; |
| 8 | |
| 9 | class ColumnWidth extends PropertyBase { |
| 10 | public function parse( $value, $options ) { |
| 11 | $mergedValue = (object) $this->valueWithDefault( $value ); |
| 12 | |
| 13 | // to implement (navigation sticky state) |
| 14 | $htmlSupport = false; |
| 15 | |
| 16 | $types = $this->config( 'enums.types' ); |
| 17 | $typeToStyle = $this->config( 'enums.typeToStyle' ); |
| 18 | |
| 19 | switch ( $mergedValue->type ) { |
| 20 | case $types['CUSTOM']: |
| 21 | $customStyle = array(); |
| 22 | ParserUtils::addValueUnitString( $customStyle, 'width', $mergedValue->{$types['CUSTOM']} ); |
| 23 | $customStyle = LodashBasic::merge( |
| 24 | array(), |
| 25 | $customStyle, |
| 26 | array( |
| 27 | 'flex' => '0 0 auto', |
| 28 | '-ms-flex' => '0 0 auto', |
| 29 | ) |
| 30 | ); |
| 31 | return $customStyle; |
| 32 | case $types['FLEX_GROW']: |
| 33 | case $types['FIT_TO_CONTENT']: |
| 34 | if ( ! $htmlSupport ) { |
| 35 | return $typeToStyle[ $mergedValue->type ]; |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 |