forked from akveo/blur-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
424 additions
and
137 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
39 changes: 39 additions & 0 deletions
39
src/app/pages/form/inputs/widgets/oldSelect/OldSelectpickerPanelCtrl.js
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* @author v.lugovsky | ||
* created on 22.04.2016 | ||
* @deprecated | ||
*/ | ||
(function () { | ||
'use strict'; | ||
|
||
angular.module('BlurAdmin.pages.form') | ||
.controller('OldSelectpickerPanelCtrl', OldSelectpickerPanelCtrl); | ||
|
||
/** @ngInject */ | ||
function OldSelectpickerPanelCtrl() { | ||
var vm = this; | ||
|
||
vm.standardSelectItems = [ | ||
{ label: 'Option 1', value: 1 }, | ||
{ label: 'Option 2', value: 2 }, | ||
{ label: 'Option 3', value: 3 }, | ||
{ label: 'Option 4', value: 4 }, | ||
]; | ||
|
||
vm.selectWithSearchItems = [ | ||
{ label: 'Hot Dog, Fries and a Soda', value: 1 }, | ||
{ label: 'Burger, Shake and a Smile', value: 2 }, | ||
{ label: 'Sugar, Spice and all things nice', value: 3 }, | ||
{ label: 'Baby Back Ribs', value: 4 }, | ||
]; | ||
|
||
vm.groupedSelectItems = [ | ||
{ label: 'Group 1 - Option 1', value: 1, group: 'Group 1' }, | ||
{ label: 'Group 2 - Option 2', value: 2, group: 'Group 2' }, | ||
{ label: 'Group 1 - Option 3', value: 3, group: 'Group 1' }, | ||
{ label: 'Group 2 - Option 4', value: 4, group: 'Group 2' }, | ||
]; | ||
|
||
} | ||
|
||
})(); |
134 changes: 134 additions & 0 deletions
134
src/app/pages/form/inputs/widgets/oldSelect/select.html
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 |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<div ng-controller="OldSelectpickerPanelCtrl as selectpickerVm"> | ||
<div class="form-group"> | ||
<select class="form-control selectpicker" selectpicker title="Standard Select" | ||
ng-model="selectpickerVm.standardSelected" | ||
ng-options="item as item.label for item in selectpickerVm.standardSelectItems"> | ||
</select> | ||
</div> | ||
<div class="form-group"> | ||
<select class="form-control selectpicker with-search" data-live-search="true" title="Select With Search" | ||
selectpicker | ||
ng-model="selectpickerVm.searchSelectedItem" | ||
ng-options="item as item.label for item in selectpickerVm.selectWithSearchItems"> | ||
</select> | ||
</div> | ||
<div class="form-group"> | ||
<select class="form-control selectpicker" title="Option Types" selectpicker> | ||
<option>Standard option</option> | ||
<option data-subtext="option subtext">Option with subtext</option> | ||
<option disabled>Disabled Option</option> | ||
<option data-icon="glyphicon-heart">Option with cion</option> | ||
</select> | ||
</div> | ||
<div class="form-group"> | ||
<select class="form-control selectpicker" disabled title="Disabled Select" selectpicker> | ||
<option>Option 1</option> | ||
<option>Option 2</option> | ||
<option>Option 3</option> | ||
</select> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-sm-6"> | ||
<div class="form-group"> | ||
<select class="form-control" title="Select with Option Groups" selectpicker | ||
ng-model="selectpickerVm.groupedSelectedItem" | ||
ng-options="item as item.label group by item.group for item in selectpickerVm.groupedSelectItems"> | ||
</select> | ||
</div> | ||
</div> | ||
<div class="col-sm-6"> | ||
<div class="form-group"> | ||
<select class="form-control" title="Select with Divider" selectpicker> | ||
<option>Group 1 - Option 1</option> | ||
<option>Group 1 - Option 2</option> | ||
<option data-divider="true"></option> | ||
<option>Group 2 - Option 1</option> | ||
<option>Group 2 - Option 2</option> | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<select class="form-control" title="Multiple Select" multiple selectpicker | ||
ng-model="selectpickerVm.multipleSelectedItems" | ||
ng-options="item as item.label for item in selectpickerVm.standardSelectItems"> | ||
<option>Option 1</option> | ||
<option>Option 2</option> | ||
<option>Option 3</option> | ||
</select> | ||
</div> | ||
<div class="form-group"> | ||
<select class="form-control" title="Multiple Select with Limit" multiple data-max-options="2" selectpicker | ||
ng-model="selectpickerVm.multipleSelectedItems2" | ||
ng-options="item as item.label for item in selectpickerVm.standardSelectItems"> | ||
<option>Option 1</option> | ||
<option>Option 2</option> | ||
<option>Option 3</option> | ||
</select> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-sm-6"> | ||
<div class="form-group"> | ||
<select class="form-control" title="Primary Select" data-style="btn-primary" data-container="body" | ||
selectpicker> | ||
<option>Option 1</option> | ||
<option>Option 2</option> | ||
<option>Option 3</option> | ||
<option>Option 4</option> | ||
</select> | ||
</div> | ||
<div class="form-group"> | ||
<select class="form-control" title="Success Select" data-style="btn-success" data-container="body" | ||
selectpicker> | ||
<option>Option 1</option> | ||
<option>Option 2</option> | ||
<option>Option 3</option> | ||
<option>Option 4</option> | ||
</select> | ||
</div> | ||
<div class="form-group"> | ||
<select class="form-control" title="Warning Select" data-style="btn-warning" data-container="body" | ||
selectpicker> | ||
<option>Option 1</option> | ||
<option>Option 2</option> | ||
<option>Option 3</option> | ||
<option>Option 4</option> | ||
</select> | ||
</div> | ||
</div> | ||
<div class="col-sm-6"> | ||
<div class="form-group"> | ||
<select class="form-control" title="Info Select" data-style="btn-info" data-container="body" | ||
selectpicker> | ||
<option>Option 1</option> | ||
<option>Option 2</option> | ||
<option>Option 3</option> | ||
<option>Option 4</option> | ||
</select> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<select class="form-control" title="Danger Select" data-style="btn-danger" data-container="body" | ||
selectpicker> | ||
<option>Option 1</option> | ||
<option>Option 2</option> | ||
<option>Option 3</option> | ||
<option>Option 4</option> | ||
</select> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<select class="form-control" title="Inverse Select" data-style="btn-inverse" data-container="body" | ||
selectpicker> | ||
<option>Option 1</option> | ||
<option>Option 2</option> | ||
<option>Option 3</option> | ||
<option>Option 4</option> | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
1 change: 1 addition & 0 deletions
1
.../widgets/select/selectpicker.directive.js → ...dgets/oldSelect/selectpicker.directive.js
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/** | ||
* @author v.lugovksy | ||
* created on 16.12.2015 | ||
* @deprecated | ||
*/ | ||
(function () { | ||
'use strict'; | ||
|
44 changes: 44 additions & 0 deletions
44
src/app/pages/form/inputs/widgets/select/GroupSelectpickerOptions.js
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* @author p.maslava | ||
* created on 28.11.2016 | ||
*/ | ||
|
||
(function() { | ||
'use strict'; | ||
|
||
angular.module('BlurAdmin.pages.form') | ||
.filter('groupSelectpickerOptions', GroupSelectpickerOptions); | ||
|
||
/** @ngInject */ | ||
function GroupSelectpickerOptions() { | ||
return function (items, props) { | ||
var out = []; | ||
|
||
if (angular.isArray(items)) { | ||
var keys = Object.keys(props); | ||
|
||
items.forEach(function (item) { | ||
var itemMatches = false; | ||
|
||
for (var i = 0; i < keys.length; i++) { | ||
var prop = keys[i]; | ||
var text = props[prop].toLowerCase(); | ||
if (item[prop].toString().toLowerCase().indexOf(text) !== -1) { | ||
itemMatches = true; | ||
break; | ||
} | ||
} | ||
|
||
if (itemMatches) { | ||
out.push(item); | ||
} | ||
}); | ||
} else { | ||
// Let the output be the input untouched | ||
out = items; | ||
} | ||
|
||
return out; | ||
}; | ||
} | ||
})(); |
88 changes: 71 additions & 17 deletions
88
src/app/pages/form/inputs/widgets/select/SelectpickerPanelCtrl.js
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 |
---|---|---|
@@ -1,38 +1,92 @@ | ||
/** | ||
* @author v.lugovsky | ||
* created on 22.04.2016 | ||
* @author p.maslava | ||
* created on 28.11.2016 | ||
*/ | ||
(function () { | ||
'use strict'; | ||
|
||
angular.module('BlurAdmin.pages.form') | ||
.controller('SelectpickerPanelCtrl', SelectpickerPanelCtrl); | ||
.controller('SelectpickerPanelCtrl', SelectpickerPanelCtrl); | ||
|
||
/** @ngInject */ | ||
function SelectpickerPanelCtrl() { | ||
|
||
var vm = this; | ||
vm.disabled = undefined; | ||
|
||
|
||
vm.standardItem = {}; | ||
vm.standardSelectItems = [ | ||
{ label: 'Option 1', value: 1 }, | ||
{ label: 'Option 2', value: 2 }, | ||
{ label: 'Option 3', value: 3 }, | ||
{ label: 'Option 4', value: 4 }, | ||
{label: 'Option 1', value: 1}, | ||
{label: 'Option 2', value: 2}, | ||
{label: 'Option 3', value: 3}, | ||
{label: 'Option 4', value: 4} | ||
]; | ||
|
||
vm.withSearchItem = {}; | ||
|
||
vm.selectWithSearchItems = [ | ||
{ label: 'Hot Dog, Fries and a Soda', value: 1 }, | ||
{ label: 'Burger, Shake and a Smile', value: 2 }, | ||
{ label: 'Sugar, Spice and all things nice', value: 3 }, | ||
{ label: 'Baby Back Ribs', value: 4 }, | ||
{label: 'Hot Dog, Fries and a Soda', value: 1}, | ||
{label: 'Burger, Shake and a Smile', value: 2}, | ||
{label: 'Sugar, Spice and all things nice', value: 3}, | ||
{label: 'Baby Back Ribs', value: 4} | ||
]; | ||
|
||
vm.groupedItem = {}; | ||
vm.groupedSelectItems = [ | ||
{ label: 'Group 1 - Option 1', value: 1, group: 'Group 1' }, | ||
{ label: 'Group 2 - Option 2', value: 2, group: 'Group 2' }, | ||
{ label: 'Group 1 - Option 3', value: 3, group: 'Group 1' }, | ||
{ label: 'Group 2 - Option 4', value: 4, group: 'Group 2' }, | ||
{label: 'Group 1 - Option 1', value: 1, group: 'Group 1'}, | ||
{label: 'Group 2 - Option 2', value: 2, group: 'Group 2'}, | ||
{label: 'Group 1 - Option 3', value: 3, group: 'Group 1'}, | ||
{label: 'Group 2 - Option 4', value: 4, group: 'Group 2'} | ||
]; | ||
|
||
} | ||
vm.groupedByItem = {}; | ||
vm.groupedBySelectItems = [ | ||
{name: 'Adam', country: 'United States'}, | ||
{name: 'Amalie', country: 'Argentina'}, | ||
{name: 'Estefanía', country: 'Argentina'}, | ||
{name: 'Adrian', country: 'Ecuador'}, | ||
{name: 'Wladimir', country: 'Ecuador'}, | ||
{name: 'Samantha', country: 'United States'}, | ||
{name: 'Nicole', country: 'Colombia'}, | ||
{name: 'Natasha', country: 'Ecuador'}, | ||
{name: 'Michael', country: 'Colombia'}, | ||
{name: 'Nicolás', country: 'Colombia'} | ||
]; | ||
vm.someGroupFn = function (item) { | ||
|
||
if (item.name[0] >= 'A' && item.name[0] <= 'M') | ||
return 'From A - M'; | ||
if (item.name[0] >= 'N' && item.name[0] <= 'Z') | ||
return 'From N - Z'; | ||
}; | ||
|
||
vm.disableItem = {}; | ||
vm.disableItems = []; | ||
|
||
vm.multipleItem = {}; | ||
vm.multipleSelectItems = [ | ||
{label: 'Option 1', value: 1}, | ||
{label: 'Option 2', value: 2}, | ||
{label: 'Option 3', value: 3}, | ||
{label: 'Option 4', value: 4}, | ||
{label: 'Option 5', value: 5}, | ||
{label: 'Option 6', value: 6}, | ||
{label: 'Option 7', value: 7}, | ||
{label: 'Option 8', value: 8} | ||
]; | ||
vm.withDeleteItem = {}; | ||
vm.withDeleteSelectItems = [ | ||
{label: 'Option 1', value: 1}, | ||
{label: 'Option 2', value: 2}, | ||
{label: 'Option 3', value: 3}, | ||
{label: 'Option 4', value: 4}, | ||
{label: 'Option 5', value: 5}, | ||
{label: 'Option 6', value: 6}, | ||
{label: 'Option 7', value: 7}, | ||
{label: 'Option 8', value: 8} | ||
]; | ||
|
||
} | ||
})(); | ||
|
||
|
Oops, something went wrong.