Skip to content

Commit

Permalink
Updates to release v2.2.1 fixes #334 fixes #332
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Jun 9, 2021
1 parent 05ed365 commit b30936d
Show file tree
Hide file tree
Showing 24 changed files with 38 additions and 49 deletions.
4 changes: 3 additions & 1 deletion CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ Change Log: `yii2-widget-select2`

## Version 2.2.1

**Date:** _under development_
**Date:** 09-Jun-2021

- (enh #334): Correct multiple select placeholder styles.
- (enh #332): Enhance Select2 required attribute validation when used with model.
- Fix Krajee BS themes styling for multiple select.

## Version 2.2.0
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 - 2020, Kartik Visweswaran
Copyright (c) 2014 - 2021, Kartik Visweswaran
Krajee.com
All rights reserved.

Expand Down
17 changes: 6 additions & 11 deletions src/Select2.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.2.1
Expand Down Expand Up @@ -128,7 +128,8 @@ class Select2 extends InputWidget
* - `unselectLabel`: _string_, the markup to be shown to unselect all records. Defaults to:
* `<i class="glyphicon glyphicon-checked"></i> Unselect all`.
* - `selectOptions`: _array_, the HTML attributes for the container wrapping the select label. Defaults to `[]`.
* - `unselectOptions`: _array_, the HTML attributes for the container wrapping the unselect label. Defaults to `[]`.
* - `unselectOptions`: _array_, the HTML attributes for the container wrapping the unselect label. Defaults to
* `[]`.
* - `options`: _array_, the HTML attributes for the toggle button container. Defaults to:
* `['class' => 's2-togall-button']`.
*/
Expand Down Expand Up @@ -458,15 +459,9 @@ protected function isRequired()
}
$validators = $this->model->getActiveValidators($this->attribute);
foreach ($validators as $validator) {
if ($validator instanceof RequiredValidator) {
if (is_callable($validator->when)) {
if (call_user_func($validator->when, $this->model, $this->attribute)) {
return true;
}
} else {
return true;
}

if ($validator instanceof RequiredValidator && (!is_callable($validator->when) ||
call_user_func($validator->when, $this->model, $this->attribute))) {
return true;
}
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/Select2Asset.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.2.1
Expand Down
2 changes: 1 addition & 1 deletion src/Select2KrajeeAsset.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.2.1
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeAsset.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.2.1
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeBootstrapAsset.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.2.1
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeClassicAsset.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.2.1
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeDefaultAsset.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.2.1
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeKrajeeAsset.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.2.1
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeKrajeeBs4Asset.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.2.1
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeMaterialAsset.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @package yii2-widgets
* @subpackage yii2-widget-select2
* @version 2.2.1
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,5 +1,5 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @version 2.2.1
*
* 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,5 +1,5 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @version 2.2.1
*
* Additional CSS for Select2 for extra functionalities added by Krajee
Expand Down
5 changes: 2 additions & 3 deletions src/assets/css/select2-bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
}
.select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field {
background: transparent;
padding: 0 3px;
padding: 6px;
height: 32px;
line-height: 1.428571429;
margin-top: 0;
Expand Down Expand Up @@ -374,7 +374,6 @@
padding: 0 5px;
}
.select2-container--bootstrap.input-sm .select2-selection--multiple .select2-search--inline .select2-search__field, .input-group-sm .select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field, .form-group-sm .select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field {
padding: 0 10px;
font-size: 12px;
height: 28px;
line-height: 1.5;
Expand Down Expand Up @@ -410,7 +409,7 @@
padding: 0 10px;
}
.select2-container--bootstrap.input-lg .select2-selection--multiple .select2-search--inline .select2-search__field, .input-group-lg .select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field, .form-group-lg .select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field {
padding: 0 16px;
padding: 12px;
font-size: 18px;
height: 44px;
line-height: 1.3333333;
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-bootstrap.min.css

Large diffs are not rendered by default.

19 changes: 6 additions & 13 deletions src/assets/css/select2-krajee-bs4.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @version 2.2.1
*
* Krajee Bootstrap 4.x Theme for Select2
Expand Down Expand Up @@ -52,16 +52,8 @@
outline: 0;
}

.select2-container--krajee-bs4 .select2-search__field::-webkit-input-placeholder,
.select2-container--krajee-bs4 .select2-search__field:-moz-placeholder,
.select2-container--krajee-bs4 .select2-search__field::-moz-placeholder,
.select2-container--krajee-bs4 .select2-search__field:-ms-input-placeholder {
.select2-container--krajee-bs4 .select2-search__field::placeholder {
color: #999;

}

.select2-container--krajee-bs4 .select2-search__field::-moz-placeholder {
opacity: 1;
}

.select2-container--krajee-bs4 .select2-dropdown[dir="rtl"] .select2-search__field {
Expand Down Expand Up @@ -358,7 +350,7 @@

.select2-container--krajee-bs4 .select2-selection--multiple .select2-search--inline .select2-search__field {
background: transparent;
padding: 0 0.2rem;
padding: 0.5rem;
height: 2.25rem;
line-height: 1.5;
margin-top: 0;
Expand Down Expand Up @@ -493,7 +485,7 @@ select.is-valid + .select2-container--krajee-bs4 .select2-selection--single,

.input-sm.select2-container--krajee-bs4 .select2-selection--multiple .select2-search--inline .select2-search__field,
.input-group-sm .select2-container--krajee-bs4 .select2-selection--multiple .select2-search--inline .select2-search__field {
padding: 0 0.625rem;
padding: 0.35rem;
font-size: 0.875rem;
height: calc(1.875rem - 1px);
line-height: 1.5;
Expand Down Expand Up @@ -533,7 +525,8 @@ select.is-valid + .select2-container--krajee-bs4 .select2-selection--single,

.input-lg.select2-container--krajee-bs4 .select2-selection--multiple .select2-search--inline .select2-search__field,
.input-group-lg .select2-container--krajee-bs4 .select2-selection--multiple .select2-search--inline .select2-search__field {
margin: 0.25rem;
font-size: 1.25rem;
padding: 0.5625rem;
font-size: 1.25rem;
}

Expand Down
4 changes: 2 additions & 2 deletions src/assets/css/select2-krajee-bs4.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/css/select2-krajee.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @version 2.2.1
*
* 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/css/select2-material.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @version 2.2.1
*
* Material Theme for Select2
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/select2-material.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,5 +1,5 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2020
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
* @version 2.2.1
*
* 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 b30936d

Please sign in to comment.