Skip to content

Commit 8d6855c

Browse files
Merge branch 'branch-4.0-dev-local' into branch-4.0-dev-dist
2 parents b601f48 + 88d2200 commit 8d6855c

File tree

51 files changed

+694
-91
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+694
-91
lines changed

Gruntfile.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ module.exports = function (grunt) {
193193
src: ['modals/**/*.html'],
194194
dest: 'templates/modals.js'
195195
},
196+
'patternfly.select': {
197+
cwd: 'src/',
198+
src: ['select/**/*.html'],
199+
dest: 'templates/select.js'
200+
},
196201
'patternfly.sort': {
197202
cwd: 'src/',
198203
src: ['sort/**/*.html'],

dist/angular-patternfly.js

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ angular.module('patternfly', [
6868
'patternfly.modals',
6969
'patternfly.navigation',
7070
'patternfly.notification',
71+
'patternfly.select',
7172
'patternfly.sort',
7273
'patternfly.toolbars',
7374
'patternfly.utils',
@@ -76,6 +77,14 @@ angular.module('patternfly', [
7677
'patternfly.wizard'
7778
]);
7879

80+
;/**
81+
* @name patternfly card
82+
*
83+
* @description
84+
* Select module for patternfly.
85+
*
86+
*/
87+
angular.module('patternfly.select', ['ui.bootstrap']);
7988
;/**
8089
* @name patternfly card
8190
*
@@ -6630,6 +6639,114 @@ angular.module( 'patternfly.notification' ).directive('pfToastNotification', fun
66306639
}
66316640
};
66326641
});
6642+
;/**
6643+
* @ngdoc directive
6644+
* @name patternfly.select.component:pfSelect
6645+
* @restrict E
6646+
*
6647+
* @param {string} ngModel Model binding using the {@link https://docs.angularjs.org/api/ng/type/ngModel.NgModelController/ NgModelController} is mandatory.
6648+
* @param {string=} ngOptions The `{@link https://docs.angularjs.org/api/ng/directive/select/ ngOptions}` attribute can be used to dynamically generate a list of `<option>` elements
6649+
*
6650+
* @description
6651+
* The pfSelect component provides a wrapper for the angular ui bootstrap dropdown container allowing for use of ng-model and ng-options
6652+
*
6653+
* @example
6654+
<example module="patternfly.select">
6655+
<file name="index.html">
6656+
<div ng-controller="SelectDemoCtrl">
6657+
<form class="form-horizontal">
6658+
<div class="form-group">
6659+
<label class="col-sm-2 control-label">Preferred pet:</label>
6660+
<div class="col-sm-10">
6661+
<pf-select selected="pet" empty-value="{{noPet}}" options="pets"></pf-select>
6662+
</div>
6663+
</div>
6664+
<div class="form-group">
6665+
<label class="col-sm-2 control-label">Preferred fruit:</label>
6666+
<div class="col-sm-10">
6667+
<pf-select selected="fruit" options="fruits" display-field="title"></pf-select>
6668+
</div>
6669+
</div>
6670+
<div class="form-group">
6671+
<label class="col-sm-2 control-label">Preferred drink:</label>
6672+
<div class="col-sm-10">
6673+
<pf-select selected="drink" empty-value="{{noDrink}}" options="drinks" display-field="name"></pf-select>
6674+
</div>
6675+
</div>
6676+
</form>
6677+
<p>Your preferred pet is {{pet || noPet}}.</p>
6678+
<p>Your preferred drink is {{fruit.name}}.</p>
6679+
<p>Your preferred drink is {{drink ? drink.name : noDrink}}.</p>
6680+
</div>
6681+
</file>
6682+
<file name="script.js">
6683+
angular.module( 'patternfly.select' ).controller( 'SelectDemoCtrl', function( $scope ) {
6684+
$scope.pets = ['Dog', 'Cat', 'Chicken'];
6685+
$scope.noPet = "No pet selected";
6686+
6687+
$scope.fruits = [
6688+
{ id: 1, name:'orange', title: 'Oranges - fresh from Florida'},
6689+
{ id: 2, name:'apple', title: 'Apples - Macintosh, great for pies.'},
6690+
{ id: 3, name:'banana', title: 'Bananas - you will go ape for them!' }
6691+
];
6692+
$scope.fruit = $scope.fruits[0];
6693+
6694+
$scope.drinks = [
6695+
{ id: 1, name:'tea'},
6696+
{ id: 2, name:'coffee'},
6697+
{ id: 3, name:'water'},
6698+
{ id: 4, name:'wine'},
6699+
{ id: 5, name:'beer'}
6700+
];
6701+
$scope.drink = $scope.drinks[0];
6702+
$scope.noDrink = "No drink selected";
6703+
});
6704+
</file>
6705+
</example>
6706+
*/
6707+
;angular.module('patternfly.select').component('pfSelect', {
6708+
6709+
bindings: {
6710+
selected: '=',
6711+
options: '<',
6712+
displayField: '@',
6713+
emptyValue: '@',
6714+
onSelect: '<'
6715+
},
6716+
templateUrl: 'select/select.html',
6717+
controller: function () {
6718+
'use strict';
6719+
6720+
var ctrl = this;
6721+
6722+
ctrl.$onInit = function () {
6723+
angular.extend(ctrl, {
6724+
showEmpty: angular.isDefined(ctrl.emptyValue),
6725+
getDisplayValue: getDisplayValue,
6726+
selectItem: selectItem
6727+
});
6728+
};
6729+
6730+
function getDisplayValue (item) {
6731+
var value;
6732+
6733+
if (item !== ctrl.emptyValue && angular.isString(ctrl.displayField)) {
6734+
value = item[ctrl.displayField];
6735+
} else {
6736+
value = item;
6737+
}
6738+
6739+
return value;
6740+
}
6741+
6742+
function selectItem (item) {
6743+
ctrl.selected = item;
6744+
if (angular.isFunction(ctrl.onSelect)) {
6745+
ctrl.onSelect(item);
6746+
}
6747+
}
6748+
}
6749+
});
66336750
;/**
66346751
* @ngdoc directive
66356752
* @name patternfly.sort.component:pfSort
@@ -10175,6 +10292,14 @@ angular.module('patternfly.wizard').component('pfWizard', {
1017510292
"<div class=\"toast-pf alert alert-{{notificationType}}\" ng-class=\"{'alert-dismissable': showCloseButton}\" ng-mouseenter=handleEnter() ng-mouseleave=handleLeave()><div uib-dropdown class=\"pull-right dropdown-kebab-pf\" ng-if=\"menuActions && menuActions.length > 0\"><button uib-dropdown-toggle class=\"btn btn-link\" type=button id=dropdownKebabRight><span class=\"fa fa-ellipsis-v\"></span></button><ul uib-dropdown-menu class=dropdown-menu-right aria-labelledby=dropdownKebabRight><li ng-repeat=\"menuAction in menuActions\" role=\"{{menuAction.isSeparator === true ? 'separator' : 'menuitem'}}\" ng-class=\"{'divider': menuAction.isSeparator === true, 'disabled': menuAction.isDisabled === true}\"><a ng-if=\"menuAction.isSeparator !== true\" class=secondary-action title={{menuAction.title}} ng-click=handleMenuAction(menuAction)>{{menuAction.name}}</a></li></ul></div><button ng-if=showCloseButton type=button class=close aria-hidden=true ng-click=handleClose()><span class=\"pficon pficon-close\"></span></button><div class=\"pull-right toast-pf-action\" ng-if=actionTitle><a ng-click=handleAction()>{{actionTitle}}</a></div><span class=\"pficon pficon-ok\" ng-if=\"notificationType === 'success'\"></span> <span class=\"pficon pficon-info\" ng-if=\"notificationType === 'info'\"></span> <span class=\"pficon pficon-error-circle-o\" ng-if=\"notificationType === 'danger'\"></span> <span class=\"pficon pficon-warning-triangle-o\" ng-if=\"notificationType === 'warning'\"></span> <span ng-if=header><strong>{{header}}</strong> {{message}}</span> <span ng-if=!header>{{message}}</span></div>"
1017610293
);
1017710294

10295+
}]);
10296+
;angular.module('patternfly.select').run(['$templateCache', function($templateCache) {
10297+
'use strict';
10298+
10299+
$templateCache.put('select/select.html',
10300+
"<div uib-dropdown class=btn-group><button uib-dropdown-toggle type=button class=\"btn btn-default\">{{$ctrl.getDisplayValue($ctrl.selected || $ctrl.emptyValue)}} <span class=caret></span></button><ul uib-dropdown-menu><li ng-if=$ctrl.emptyValue ng-class=\"{'selected': !$ctrl.selected}\"><a href=javascript:void(0); role=menuitem tabindex=-1 ng-click=$ctrl.selectItem()>{{$ctrl.emptyValue}}</a></li><li ng-repeat=\"item in $ctrl.options\" ng-class=\"{'selected': item === $ctrl.selected}\"><a href=javascript:void(0); role=menuitem tabindex=-1 ng-click=$ctrl.selectItem(item)>{{$ctrl.getDisplayValue(item)}}</a></li></ul></div>"
10301+
);
10302+
1017810303
}]);
1017910304
;angular.module('patternfly.sort').run(['$templateCache', function($templateCache) {
1018010305
'use strict';

dist/angular-patternfly.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/docs/grunt-scripts/angular-patternfly.js

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ angular.module('patternfly', [
6868
'patternfly.modals',
6969
'patternfly.navigation',
7070
'patternfly.notification',
71+
'patternfly.select',
7172
'patternfly.sort',
7273
'patternfly.toolbars',
7374
'patternfly.utils',
@@ -76,6 +77,14 @@ angular.module('patternfly', [
7677
'patternfly.wizard'
7778
]);
7879

80+
;/**
81+
* @name patternfly card
82+
*
83+
* @description
84+
* Select module for patternfly.
85+
*
86+
*/
87+
angular.module('patternfly.select', ['ui.bootstrap']);
7988
;/**
8089
* @name patternfly card
8190
*
@@ -6630,6 +6639,114 @@ angular.module( 'patternfly.notification' ).directive('pfToastNotification', fun
66306639
}
66316640
};
66326641
});
6642+
;/**
6643+
* @ngdoc directive
6644+
* @name patternfly.select.component:pfSelect
6645+
* @restrict E
6646+
*
6647+
* @param {string} ngModel Model binding using the {@link https://docs.angularjs.org/api/ng/type/ngModel.NgModelController/ NgModelController} is mandatory.
6648+
* @param {string=} ngOptions The `{@link https://docs.angularjs.org/api/ng/directive/select/ ngOptions}` attribute can be used to dynamically generate a list of `<option>` elements
6649+
*
6650+
* @description
6651+
* The pfSelect component provides a wrapper for the angular ui bootstrap dropdown container allowing for use of ng-model and ng-options
6652+
*
6653+
* @example
6654+
<example module="patternfly.select">
6655+
<file name="index.html">
6656+
<div ng-controller="SelectDemoCtrl">
6657+
<form class="form-horizontal">
6658+
<div class="form-group">
6659+
<label class="col-sm-2 control-label">Preferred pet:</label>
6660+
<div class="col-sm-10">
6661+
<pf-select selected="pet" empty-value="{{noPet}}" options="pets"></pf-select>
6662+
</div>
6663+
</div>
6664+
<div class="form-group">
6665+
<label class="col-sm-2 control-label">Preferred fruit:</label>
6666+
<div class="col-sm-10">
6667+
<pf-select selected="fruit" options="fruits" display-field="title"></pf-select>
6668+
</div>
6669+
</div>
6670+
<div class="form-group">
6671+
<label class="col-sm-2 control-label">Preferred drink:</label>
6672+
<div class="col-sm-10">
6673+
<pf-select selected="drink" empty-value="{{noDrink}}" options="drinks" display-field="name"></pf-select>
6674+
</div>
6675+
</div>
6676+
</form>
6677+
<p>Your preferred pet is {{pet || noPet}}.</p>
6678+
<p>Your preferred drink is {{fruit.name}}.</p>
6679+
<p>Your preferred drink is {{drink ? drink.name : noDrink}}.</p>
6680+
</div>
6681+
</file>
6682+
<file name="script.js">
6683+
angular.module( 'patternfly.select' ).controller( 'SelectDemoCtrl', function( $scope ) {
6684+
$scope.pets = ['Dog', 'Cat', 'Chicken'];
6685+
$scope.noPet = "No pet selected";
6686+
6687+
$scope.fruits = [
6688+
{ id: 1, name:'orange', title: 'Oranges - fresh from Florida'},
6689+
{ id: 2, name:'apple', title: 'Apples - Macintosh, great for pies.'},
6690+
{ id: 3, name:'banana', title: 'Bananas - you will go ape for them!' }
6691+
];
6692+
$scope.fruit = $scope.fruits[0];
6693+
6694+
$scope.drinks = [
6695+
{ id: 1, name:'tea'},
6696+
{ id: 2, name:'coffee'},
6697+
{ id: 3, name:'water'},
6698+
{ id: 4, name:'wine'},
6699+
{ id: 5, name:'beer'}
6700+
];
6701+
$scope.drink = $scope.drinks[0];
6702+
$scope.noDrink = "No drink selected";
6703+
});
6704+
</file>
6705+
</example>
6706+
*/
6707+
;angular.module('patternfly.select').component('pfSelect', {
6708+
6709+
bindings: {
6710+
selected: '=',
6711+
options: '<',
6712+
displayField: '@',
6713+
emptyValue: '@',
6714+
onSelect: '<'
6715+
},
6716+
templateUrl: 'select/select.html',
6717+
controller: function () {
6718+
'use strict';
6719+
6720+
var ctrl = this;
6721+
6722+
ctrl.$onInit = function () {
6723+
angular.extend(ctrl, {
6724+
showEmpty: angular.isDefined(ctrl.emptyValue),
6725+
getDisplayValue: getDisplayValue,
6726+
selectItem: selectItem
6727+
});
6728+
};
6729+
6730+
function getDisplayValue (item) {
6731+
var value;
6732+
6733+
if (item !== ctrl.emptyValue && angular.isString(ctrl.displayField)) {
6734+
value = item[ctrl.displayField];
6735+
} else {
6736+
value = item;
6737+
}
6738+
6739+
return value;
6740+
}
6741+
6742+
function selectItem (item) {
6743+
ctrl.selected = item;
6744+
if (angular.isFunction(ctrl.onSelect)) {
6745+
ctrl.onSelect(item);
6746+
}
6747+
}
6748+
}
6749+
});
66336750
;/**
66346751
* @ngdoc directive
66356752
* @name patternfly.sort.component:pfSort
@@ -10175,6 +10292,14 @@ angular.module('patternfly.wizard').component('pfWizard', {
1017510292
"<div class=\"toast-pf alert alert-{{notificationType}}\" ng-class=\"{'alert-dismissable': showCloseButton}\" ng-mouseenter=handleEnter() ng-mouseleave=handleLeave()><div uib-dropdown class=\"pull-right dropdown-kebab-pf\" ng-if=\"menuActions && menuActions.length > 0\"><button uib-dropdown-toggle class=\"btn btn-link\" type=button id=dropdownKebabRight><span class=\"fa fa-ellipsis-v\"></span></button><ul uib-dropdown-menu class=dropdown-menu-right aria-labelledby=dropdownKebabRight><li ng-repeat=\"menuAction in menuActions\" role=\"{{menuAction.isSeparator === true ? 'separator' : 'menuitem'}}\" ng-class=\"{'divider': menuAction.isSeparator === true, 'disabled': menuAction.isDisabled === true}\"><a ng-if=\"menuAction.isSeparator !== true\" class=secondary-action title={{menuAction.title}} ng-click=handleMenuAction(menuAction)>{{menuAction.name}}</a></li></ul></div><button ng-if=showCloseButton type=button class=close aria-hidden=true ng-click=handleClose()><span class=\"pficon pficon-close\"></span></button><div class=\"pull-right toast-pf-action\" ng-if=actionTitle><a ng-click=handleAction()>{{actionTitle}}</a></div><span class=\"pficon pficon-ok\" ng-if=\"notificationType === 'success'\"></span> <span class=\"pficon pficon-info\" ng-if=\"notificationType === 'info'\"></span> <span class=\"pficon pficon-error-circle-o\" ng-if=\"notificationType === 'danger'\"></span> <span class=\"pficon pficon-warning-triangle-o\" ng-if=\"notificationType === 'warning'\"></span> <span ng-if=header><strong>{{header}}</strong> {{message}}</span> <span ng-if=!header>{{message}}</span></div>"
1017610293
);
1017710294

10295+
}]);
10296+
;angular.module('patternfly.select').run(['$templateCache', function($templateCache) {
10297+
'use strict';
10298+
10299+
$templateCache.put('select/select.html',
10300+
"<div uib-dropdown class=btn-group><button uib-dropdown-toggle type=button class=\"btn btn-default\">{{$ctrl.getDisplayValue($ctrl.selected || $ctrl.emptyValue)}} <span class=caret></span></button><ul uib-dropdown-menu><li ng-if=$ctrl.emptyValue ng-class=\"{'selected': !$ctrl.selected}\"><a href=javascript:void(0); role=menuitem tabindex=-1 ng-click=$ctrl.selectItem()>{{$ctrl.emptyValue}}</a></li><li ng-repeat=\"item in $ctrl.options\" ng-class=\"{'selected': item === $ctrl.selected}\"><a href=javascript:void(0); role=menuitem tabindex=-1 ng-click=$ctrl.selectItem(item)>{{$ctrl.getDisplayValue(item)}}</a></li></ul></div>"
10301+
);
10302+
1017810303
}]);
1017910304
;angular.module('patternfly.sort').run(['$templateCache', function($templateCache) {
1018010305
'use strict';

dist/docs/js/docs-setup.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/docs/partials/api/patternfly.autofocus.pfFocused.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/autofocus/autofocus.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/bc090c9/src/autofocus/autofocus.js#L39" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfFocused</code>
1+
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/autofocus/autofocus.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/9184457/src/autofocus/autofocus.js#L39" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfFocused</code>
22
<div><span class="hint">directive in module <code ng:non-bindable="">patternfly</code>
33
</span>
44
</div>

dist/docs/partials/api/patternfly.card.component.pfAggregateStatusCard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/aggregate-status/aggregate-status-card.component.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/bc090c9/src/card/aggregate-status/aggregate-status-card.component.js#L132" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfAggregateStatusCard</code>
1+
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/aggregate-status/aggregate-status-card.component.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/9184457/src/card/aggregate-status/aggregate-status-card.component.js#L132" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfAggregateStatusCard</code>
22
<div><span class="hint">directive in module <code ng:non-bindable="">patternfly.card</code>
33
</span>
44
</div>

dist/docs/partials/api/patternfly.card.component.pfCard - Timeframe Filters.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/examples/card-timeframe.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/bc090c9/src/card/examples/card-timeframe.js#L82" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCard - Timeframe Filters</code>
1+
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/examples/card-timeframe.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/9184457/src/card/examples/card-timeframe.js#L82" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCard - Timeframe Filters</code>
22
<div><span class="hint">directive in module <code ng:non-bindable="">patternfly.card</code>
33
</span>
44
</div>

dist/docs/partials/api/patternfly.card.component.pfCard - Trends.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/examples/card-trend.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/bc090c9/src/card/examples/card-trend.js#L146" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCard - Trends</code>
1+
<a href="https://github.com/patternfly/angular-patternfly/edit/master/src/card/examples/card-trend.js" class="improve-docs"><i class="icon-edit"> </i>Improve this doc</a><a href="https://github.com/patternfly/angular-patternfly/blob/9184457/src/card/examples/card-trend.js#L146" class="view-source"><i class="icon-eye-open"> </i>View source</a><h1><code ng:non-bindable="">pfCard - Trends</code>
22
<div><span class="hint">directive in module <code ng:non-bindable="">patternfly.card</code>
33
</span>
44
</div>

0 commit comments

Comments
 (0)