-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop'
- Loading branch information
Showing
35 changed files
with
1,229 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
|
||
/** | ||
* MaterializeAsset provides the required Materialize CSS files. | ||
* | ||
* | ||
* @author Christoph Erdmann <[email protected]> | ||
* @package assets | ||
*/ | ||
|
@@ -33,6 +33,6 @@ class MaterializeAsset extends AssetBundle | |
* @var array list of bundle class names that this bundle depends on. | ||
*/ | ||
public $depends = [ | ||
'macgyer\yii2materializecss\assets\MaterializeFontAsset', | ||
MaterializeFontAsset::class, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
|
||
/** | ||
* MaterializePluginAsset provides the Materialize JS files. | ||
* | ||
* | ||
* @author Christoph Erdmann <[email protected]> | ||
* @package assets | ||
*/ | ||
|
@@ -21,18 +21,11 @@ class MaterializePluginAsset extends AssetBundle | |
* @var string the directory that contains the source asset files for this asset bundle. | ||
*/ | ||
public $sourcePath = '@bower/materialize/dist'; | ||
|
||
/** | ||
* @var array list of JS files that this bundle contains. | ||
*/ | ||
public $js = [ | ||
'js/materialize.min.js' | ||
]; | ||
|
||
/** | ||
* @var array list of bundle class names that this bundle depends on. | ||
*/ | ||
public $depends = [ | ||
'yii\web\JqueryAsset' | ||
]; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
* | ||
* The button can be displayed with an optional icon. This class uses the [[Icon|Icon]] widget to show icons. | ||
* | ||
* @see http://materializecss.com/buttons.html | ||
* @see https://materializecss.com/buttons.html | ||
* @author Christoph Erdmann <[email protected]> | ||
* @package widgets | ||
*/ | ||
|
@@ -42,6 +42,21 @@ class Button extends BaseWidget | |
*/ | ||
const TYPE_FLAT = 'flat'; | ||
|
||
/** | ||
* Sets the [[size]] of the button to the default size. | ||
*/ | ||
const SIZE_DEFAULT = 'default'; | ||
|
||
/** | ||
* Sets the [[size]] of the button to "small". | ||
*/ | ||
const SIZE_SMALL = 'small'; | ||
|
||
/** | ||
* Sets the [[size]] of the button to "large". | ||
*/ | ||
const SIZE_LARGE = 'large'; | ||
|
||
/** | ||
* @var string the tag used to render the button. | ||
*/ | ||
|
@@ -88,9 +103,17 @@ class Button extends BaseWidget | |
public $type = self::TYPE_RAISED; | ||
|
||
/** | ||
* @var boolean whether the button shall be of larger size. | ||
* @var string the size of button to be rendered. | ||
* | ||
* The following options are supported: | ||
* - default | ||
* - small | ||
* - large | ||
* | ||
* This property defaults to "default". To set the type, use the corresponding `TYPE_*` constant of this class. | ||
* If no type from this range is given, the button will be of the "default" type. | ||
*/ | ||
public $large = false; | ||
public $size = self::SIZE_DEFAULT; | ||
|
||
/** | ||
* @var boolean whether the button shall be disabled. | ||
|
@@ -113,10 +136,17 @@ public function init() | |
break; | ||
} | ||
|
||
if ($this->large) { | ||
Html::addCssClass($this->options, ['btn_size' => 'btn-large']); | ||
switch ($this->size) { | ||
case self::SIZE_SMALL: | ||
case self::SIZE_LARGE: | ||
Html::addCssClass($this->options, ['btn_size' => "btn-$this->size"]); | ||
break; | ||
} | ||
|
||
// if ($this->large) { | ||
// Html::addCssClass($this->options, ['btn_size' => 'btn-large']); | ||
// } | ||
|
||
if ($this->disabled) { | ||
Html::addCssClass($this->options, ['btn_disabled' => 'disabled']); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,13 +44,14 @@ | |
* 'tag' => 'p', | ||
* 'data-body-category' => 'example', | ||
* ], | ||
* 'options' => ['class' => 'active'], // to make this item pre-selected | ||
* ], | ||
* ] | ||
* ``` | ||
* @author Christoph Erdmann <[email protected]> | ||
* @package widgets | ||
* | ||
* @see http://materializecss.com/collapsible.html | ||
* @see https://materializecss.com/collapsible.html | ||
*/ | ||
class Collapsible extends BaseWidget | ||
{ | ||
|
@@ -91,7 +92,12 @@ public function init() | |
if ($this->isPopoutStyle) { | ||
Html::addCssClass($this->options, ['popout' => 'popout']); | ||
} | ||
$this->options['data-collapsible'] = $this->type; | ||
|
||
if ($this->type == self::TYPE_EXPANDABLE) { | ||
$this->clientOptions['accordion'] = false; | ||
} | ||
|
||
$this->registerPlugin('Collapsible'); | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,20 +18,20 @@ | |
* Please note that the Materialize icons are shipped in a separate font file. This font file is automatically registered | ||
* by the [[\macgyer\yii2materializecss\assets\MaterializeAsset|MaterializeAsset]]. | ||
* | ||
* If you do not load the default [[\macgyer\yii2materializecss\assets\MaterializeAsset|MaterializeAsset]] make sure to at least load | ||
* [[\macgyer\yii2materializecss\assets\MaterializeFontAsset|MaterializeFontAsset]] (or another source providing the font file) to correctly | ||
* If you do not load the default [[\macgyer\yii2materializecss\assets\MaterializeAsset|MaterializeAsset]] make sure to at least load | ||
* [[\macgyer\yii2materializecss\assets\MaterializeFontAsset|MaterializeFontAsset]] (or another source providing the font file) to correctly | ||
* display the icons. | ||
* | ||
* @author Christoph Erdmann <[email protected]> | ||
* @package widgets | ||
* @see http://materializecss.com/icons.html | ||
* @see https://materializecss.com/icons.html | ||
*/ | ||
class Icon extends BaseWidget | ||
{ | ||
/** | ||
* @var string the name of the icon. | ||
* | ||
* @see http://materializecss.com/icons.html | ||
* @see https://materializecss.com/icons.html | ||
*/ | ||
public $name; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ | |
* ``` | ||
* @author Christoph Erdmann <[email protected]> | ||
* @package widgets | ||
* @see http://materializecss.com/modals.html | ||
* @see https://materializecss.com/modals.html | ||
*/ | ||
class Modal extends BaseWidget | ||
{ | ||
|
@@ -107,7 +107,7 @@ class Modal extends BaseWidget | |
* - fixedFooter | ||
* - bottomSheet | ||
* | ||
* @see http://materializecss.com/modals.html | ||
* @see https://materializecss.com/modals.html | ||
*/ | ||
public $modalType = self::TYPE_LEAN; | ||
|
||
|
@@ -173,6 +173,41 @@ class Modal extends BaseWidget | |
*/ | ||
public $footerOptions = []; | ||
|
||
/** | ||
* @var float the opacity of the Modal overlay. Valid values are 0 through 1. | ||
*/ | ||
public $overlayOpacity = 0.5; | ||
|
||
/** | ||
* @var int duration of the opening transition in ms. | ||
*/ | ||
public $inDuration = 250; | ||
|
||
/** | ||
* @var int duration of the closing transition in ms. | ||
*/ | ||
public $outDuration = 250; | ||
|
||
/** | ||
* @var boolean whether the page scrolling is disabled when the Modal is open. | ||
*/ | ||
public $preventScrolling = true; | ||
|
||
/** | ||
* @var boolean whether the Modal can be closed by keyboard or click. | ||
*/ | ||
public $dismissible = true; | ||
|
||
/** | ||
* @var string|mixed the starting top offset. | ||
*/ | ||
public $startingTopOffset = '4%'; | ||
|
||
/** | ||
* @var string|mixed the ending top offset. | ||
*/ | ||
public $endingTopOffset = '10%'; | ||
|
||
/** | ||
* Initializes the widget. | ||
* @uses [[renderCloseButton()]] | ||
|
@@ -203,7 +238,7 @@ public function init() | |
|
||
echo $html; | ||
|
||
$this->registerPlugin('modal'); | ||
$this->registerPlugin('Modal'); | ||
} | ||
|
||
/** | ||
|
@@ -346,8 +381,12 @@ protected function initDefaults() | |
], $this->toggleButton); | ||
} | ||
|
||
if ($this->clientOptions !== false) { | ||
$this->clientOptions = ArrayHelper::merge(['show' => false], $this->clientOptions); | ||
} | ||
$this->clientOptions['opacity'] = $this->overlayOpacity; | ||
$this->clientOptions['inDuration'] = $this->inDuration; | ||
$this->clientOptions['outDuration'] = $this->outDuration; | ||
$this->clientOptions['preventScrolling'] = $this->preventScrolling; | ||
$this->clientOptions['dismissible'] = $this->dismissible; | ||
$this->clientOptions['startingTop'] = $this->startingTopOffset; | ||
$this->clientOptions['endingTop'] = $this->endingTopOffset; | ||
} | ||
} |
Oops, something went wrong.