Skip to content

Commit

Permalink
Updates to release v2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Sep 7, 2018
1 parent 1adea55 commit f1ae98b
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 22 deletions.
6 changes: 6 additions & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log: `yii2-widget-select2`
=================================

## Version 2.1.3

**Date:** 07-Sep-2018

- Enhancements for Bootstrap 4.x Support.

## Version 2.1.2

**Date:** 17-Aug-2018
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
],
"require": {
"kartik-v/yii2-krajee-base": "~1.9"
"kartik-v/yii2-krajee-base": ">=1.9"
},
"autoload": {
"psr-4": {
Expand Down
20 changes: 14 additions & 6 deletions src/Select2.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.2
* @version 2.1.3
*/

namespace kartik\select2;

use kartik\base\AddonTrait;
use kartik\base\InputWidget;
use Yii;
use yii\base\InvalidConfigException;
use yii\helpers\Html;
use yii\helpers\Inflector;
use yii\helpers\ArrayHelper;
Expand All @@ -22,7 +23,7 @@
/**
* Select2 widget is a Yii2 wrapper for the Select2 jQuery plugin. This input widget is a jQuery based replacement for
* select boxes. It supports searching, remote data sets, and infinite scrolling of results. The widget is specially
* styled for Bootstrap 3.
* styled for Bootstrap 3.x and Bootstrap 4.x.
*
* @author Kartik Visweswaran <[email protected]>
* @since 1.0
Expand Down Expand Up @@ -190,6 +191,8 @@ class Select2 extends InputWidget

/**
* @inheritdoc
* @throws \ReflectionException
* @throws \yii\base\InvalidConfigException
*/
public function run()
{
Expand All @@ -199,6 +202,8 @@ public function run()

/**
* Initializes and renders the widget
* @throws \ReflectionException
* @throws \yii\base\InvalidConfigException
*/
public function renderWidget()
{
Expand All @@ -213,7 +218,7 @@ public function renderWidget()
$this->options['multiple'] = $multiple;
if (empty($this->pluginOptions['width'])) {
if ($this->theme !== self::THEME_KRAJEE_BS4) {
$this->pluginOptions['width'] = '100%';
$this->pluginOptions['width'] = '100%';
} elseif (empty($this->addon)) {
$this->pluginOptions['width'] = 'auto';
}
Expand Down Expand Up @@ -243,11 +248,12 @@ public function renderWidget()

/**
* Initializes and render the toggle all button
* @throws \yii\base\InvalidConfigException
*/
protected function renderToggleAll()
{
// disable select all toggle feature for a single select, or when the showToggleALl is false, or
if (!$this->options['multiple'] || !$this->showToggleAll ) {
if (!$this->options['multiple'] || !$this->showToggleAll) {
return;
}
$unchecked = '<i class="glyphicon glyphicon-unchecked"></i>';
Expand All @@ -261,7 +267,7 @@ protected function renderToggleAll()
'unselectLabel' => $checked . Yii::t('kvselect', 'Unselect all'),
'selectOptions' => [],
'unselectOptions' => [],
'options' => ['class' => 's2-togall-button']
'options' => ['class' => 's2-togall-button'],
], $this->toggleAllSettings);
$sOptions = $settings['selectOptions'];
$uOptions = $settings['unselectOptions'];
Expand All @@ -279,7 +285,7 @@ protected function renderToggleAll()
echo Html::tag('button', '', [
'accesskey' => $accesskey,
'style' => 'background: transparent;border: none !important;font-size:0;',
'onfocus' => '$("#' . $this->options['id'] . '").select2("open");'
'onfocus' => '$("#' . $this->options['id'] . '").select2("open");',
]);
}
echo Html::tag('span', $out, ['id' => 'parent-' . $options['id'], 'style' => 'display:none']);
Expand Down Expand Up @@ -313,6 +319,7 @@ protected function initPlaceholder()
* @param string $input
*
* @return string
* @throws InvalidConfigException
*/
protected function embedAddon($input)
{
Expand Down Expand Up @@ -347,6 +354,7 @@ protected function embedAddon($input)
/**
* Renders the source Input for the Select2 plugin. Graceful fallback to a normal HTML select dropdown or text
* input - in case JQuery is not supported by the browser
* @throws InvalidConfigException
*/
protected function renderInput()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Select2Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.2
* @version 2.1.3
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.2
* @version 2.1.3
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeBootstrapAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.2
* @version 2.1.3
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeClassicAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.2
* @version 2.1.3
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeDefaultAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.2
* @version 2.1.3
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeKrajeeAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.2
* @version 2.1.3
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeKrajeeBs4Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.1.2
* @version 2.1.3
*/

namespace kartik\select2;
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-addl.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @version 2.1.2
* @version 2.1.3
*
* Additional CSS for Select2 for extra functionalities added by Krajee
*
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-addl.min.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @version 2.1.2
* @version 2.1.3
*
* Additional CSS for Select2 for extra functionalities added by Krajee
*
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-krajee-bs4.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @version 2.1.2
* @version 2.1.3
*
* Krajee Bootstrap 4.x Theme for Select2
*
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-krajee-bs4.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/assets/css/select2-krajee.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @version 2.1.2
* @version 2.1.3
*
* Krajee Bootstrap 3.x Theme for Select2
*
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-krajee.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/assets/js/select2-krajee.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @version 2.1.2
* @version 2.1.3
*
* Additional enhancements for Select2 widget extension for Yii 2.0.
*
Expand Down
2 changes: 1 addition & 1 deletion src/assets/js/select2-krajee.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f1ae98b

Please sign in to comment.