-
-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #993: Enhancements to support Bootstrap v5.x
- Loading branch information
Showing
50 changed files
with
207 additions
and
177 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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* @package yii2-grid | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2021 | ||
* @version 3.3.6 | ||
*/ | ||
|
||
|
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 |
---|---|---|
|
@@ -3,13 +3,15 @@ | |
/** | ||
* @package yii2-grid | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2021 | ||
* @version 3.3.6 | ||
*/ | ||
|
||
namespace kartik\grid; | ||
|
||
use Exception; | ||
use Yii; | ||
use yii\base\InvalidConfigException; | ||
use yii\helpers\Html; | ||
|
||
/** | ||
|
@@ -67,7 +69,7 @@ class BooleanColumn extends DataColumn | |
|
||
/** | ||
* @inheritdoc | ||
* @throws \yii\base\InvalidConfigException | ||
* @throws InvalidConfigException | ||
*/ | ||
public function init() | ||
{ | ||
|
@@ -83,7 +85,7 @@ public function init() | |
} | ||
$this->filter = [true => $this->trueLabel, false => $this->falseLabel]; | ||
if (empty($this->trueIcon)) { | ||
$this->trueIcon = $this->getIconMarkup('true'); | ||
$this->trueIcon = $this->getIconMarkup(); | ||
} | ||
|
||
if (empty($this->falseIcon)) { | ||
|
@@ -96,20 +98,20 @@ public function init() | |
* Get icon HTML markup | ||
* @param string $type the type of markup `true` or `false` | ||
* @return string | ||
* @throws \yii\base\InvalidConfigException | ||
* @throws InvalidConfigException|Exception | ||
*/ | ||
protected function getIconMarkup($type = 'true') | ||
{ | ||
$label = $type === 'false' ? $this->falseLabel: $this->trueLabel; | ||
if (!$this->grid->bootstrap) { | ||
return $label; | ||
} | ||
$isBs4 = $this->grid->isBs4(); | ||
$notBs3 = !$this->grid->isBs(3); | ||
if ($type === 'true') { | ||
return ($isBs4 ? GridView::ICON_ACTIVE_BS4 : GridView::ICON_ACTIVE) . | ||
return ($notBs3 ? GridView::ICON_ACTIVE_BS4 : GridView::ICON_ACTIVE) . | ||
Html::tag('span', $this->trueLabel, ['class' => 'kv-grid-boolean']); | ||
} | ||
return ($isBs4 ? GridView::ICON_INACTIVE_BS4 : GridView::ICON_INACTIVE) . | ||
return ($notBs3 ? GridView::ICON_INACTIVE_BS4 : GridView::ICON_INACTIVE) . | ||
Html::tag('span', $this->falseLabel, ['class' => 'kv-grid-boolean']); | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* @package yii2-grid | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2021 | ||
* @version 3.3.6 | ||
*/ | ||
|
||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* @package yii2-grid | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2021 | ||
* @version 3.3.6 | ||
*/ | ||
|
||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* @package yii2-grid | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2021 | ||
* @version 3.3.6 | ||
*/ | ||
|
||
|
@@ -209,8 +209,6 @@ public function renderHeaderCell() | |
Html::addCssClass($this->headerOptions, 'kv-merged-header'); | ||
} | ||
$this->headerOptions['data-col-seq'] = array_search($this, $this->grid->columns); | ||
/** @noinspection PhpUndefinedClassInspection */ | ||
/** @noinspection PhpUndefinedMethodInspection */ | ||
return parent::renderHeaderCell(); | ||
} | ||
|
||
|
@@ -225,8 +223,6 @@ public function renderFilterCell() | |
return null; | ||
} | ||
$this->filterOptions['data-col-seq'] = array_search($this, $this->grid->columns); | ||
/** @noinspection PhpUndefinedClassInspection */ | ||
/** @noinspection PhpUndefinedMethodInspection */ | ||
return parent::renderFilterCell(); | ||
} | ||
|
||
|
@@ -262,8 +258,8 @@ public function parseExcelFormats(&$options, $model, $key, $index) | |
if (isset($this->xlFormat)) { | ||
$fmt = $this->xlFormat; | ||
} elseif ($autoFormat && isset($this->format)) { | ||
$tSep = isset($formatter->thousandSeparator) ? $formatter->thousandSeparator : ','; | ||
$dSep = isset($formatter->decimalSeparator) ? $formatter->decimalSeparator : '.'; | ||
$tSep = $formatter->thousandSeparator ?? ','; | ||
$dSep = $formatter->decimalSeparator ?? '.'; | ||
switch ($format) { | ||
case 'text': | ||
case 'html': | ||
|
@@ -337,7 +333,7 @@ protected function renderPageSummaryCellContent() | |
} | ||
$content = $this->getPageSummaryCellContent(); | ||
if ($this->pageSummary === true) { | ||
$format = isset($this->pageSummaryFormat) ? $this->pageSummaryFormat : $this->format; | ||
$format = $this->pageSummaryFormat ?? $this->format; | ||
return $this->grid->formatter->format($content, $format); | ||
} | ||
return ($content === null) ? $this->grid->emptyCell : $content; | ||
|
@@ -490,7 +486,7 @@ protected function isValidAlignment($type = 'hAlign') | |
$this->hAlign === GridView::ALIGN_RIGHT || | ||
$this->hAlign === GridView::ALIGN_CENTER | ||
); | ||
} elseif ($type = 'vAlign') { | ||
} elseif ($type === 'vAlign') { | ||
return ( | ||
$this->vAlign === GridView::ALIGN_TOP || | ||
$this->vAlign === GridView::ALIGN_MIDDLE || | ||
|
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 |
---|---|---|
|
@@ -3,13 +3,16 @@ | |
/** | ||
* @package yii2-grid | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2021 | ||
* @version 3.3.6 | ||
*/ | ||
|
||
namespace kartik\grid; | ||
|
||
use Closure; | ||
use Exception; | ||
use kartik\base\Widget; | ||
use yii\base\InvalidConfigException; | ||
use yii\grid\DataColumn as YiiDataColumn; | ||
use kartik\base\Config; | ||
use yii\helpers\Html; | ||
|
@@ -211,7 +214,7 @@ class DataColumn extends YiiDataColumn | |
|
||
/** | ||
* @inheritdoc | ||
* @throws \yii\base\InvalidConfigException | ||
* @throws InvalidConfigException | ||
*/ | ||
public function init() | ||
{ | ||
|
@@ -246,7 +249,7 @@ public function renderDataCell($model, $key, $index) | |
* Renders filter inputs based on the `filterType` | ||
* | ||
* @return string | ||
* @throws \Exception | ||
* @throws Exception | ||
*/ | ||
protected function renderFilterCellContent() | ||
{ | ||
|
@@ -282,7 +285,7 @@ protected function renderFilterCellContent() | |
return Html::activeCheckbox($this->grid->filterModel, $this->attribute, $this->filterInputOptions); | ||
} | ||
$options = array_replace_recursive($this->filterWidgetOptions, $options); | ||
/** @var \kartik\base\Widget $widgetClass */ | ||
/** @var Widget $widgetClass */ | ||
return $widgetClass::widget($options); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* @package yii2-grid | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2021 | ||
* @version 3.3.6 | ||
*/ | ||
|
||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* @package yii2-grid | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2021 | ||
* @version 3.3.6 | ||
*/ | ||
|
||
|
@@ -154,7 +154,7 @@ public function renderDataCellContent($model, $key, $index) | |
$id = $this->grid->options['id']; | ||
$this->_view->registerJs("kvRefreshEC('{$id}','{$this->_css}');"); | ||
} | ||
$editableClass = ArrayHelper::remove($this->_editableOptions, 'class', Editable::className()); | ||
$editableClass = ArrayHelper::remove($this->_editableOptions, 'class', Editable::class); | ||
if (!isset($this->_editableOptions['inlineSettings']['options'])) { | ||
$this->_editableOptions['inlineSettings']['options']['class'] = 'skip-export'; | ||
} else { | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* @package yii2-grid | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2021 | ||
* @version 3.3.6 | ||
*/ | ||
|
||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* @package yii2-grid | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2021 | ||
* @version 3.3.6 | ||
*/ | ||
|
||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* @package yii2-grid | ||
* @author Kartik Visweswaran <[email protected]> | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2020 | ||
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2021 | ||
* @version 3.3.6 | ||
*/ | ||
|
||
|
Oops, something went wrong.