Skip to content

Commit ff78e17

Browse files
Merge branch 'master-local' into master-dist
2 parents 3eaa54a + 8473a0f commit ff78e17

File tree

66 files changed

+481
-147
lines changed

Some content is hidden

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

66 files changed

+481
-147
lines changed

dist/angular-patternfly.js

Lines changed: 83 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7352,8 +7352,12 @@ angular.module('patternfly.charts').component('pfUtilizationTrendChart', {
73527352
* <li>.id - (String) Optional unique Id for the filter field, useful for comparisons
73537353
* <li>.title - (String) The title to display for the filter field
73547354
* <li>.placeholder - (String) Text to display when no filter value has been entered
7355-
* <li>.filterType - (String) The filter input field type (any html input type, or 'select' for a single select box)
7356-
* <li>.filterValues - (Array) List of valid select values used when filterType is 'select'
7355+
* <li>.filterMultiselect - (Boolean) In `complex-select`, allow selection of multiple values per category. Optional, default is `false`
7356+
* <li>.filterType - (String) The filter input field type (any html input type, or 'select' for a single select box or 'complex-select' for a category select box)
7357+
* <li>.filterValues - (Array) List of valid select values used when filterType is 'select' or 'complex-select' (in where these values serve as case insensitve keys for .filterCategories objects)
7358+
* <li>.filterCategories - (Array of (Objects)) For 'complex-select' only, array of objects whoes keys (case insensitive) match the .filterValues, these objects include each of the filter fields above (sans .placeholder)
7359+
* <li>.filterCategoriesPlaceholder - (String) Text to display in `complex-select` category value select when no filter value has been entered, Optional
7360+
* <li>.filterDelimiter - (String) Delimiter separating 'complex-select' category and value. Optional, default is a space, ' '
73577361
* </ul>
73587362
* <li>.appliedFilters - (Array) List of the currently applied filters
73597363
* <li>.resultsCount - (int) The number of results returned after the current applied filters have been applied
@@ -7383,6 +7387,9 @@ angular.module('patternfly.charts').component('pfUtilizationTrendChart', {
73837387
<div class="col-md-2">
73847388
<span>{{item.birthMonth}}</span>
73857389
</div>
7390+
<div class="col-md-4">
7391+
<span>{{item.car}}</span>
7392+
</div>
73867393
</div>
73877394
</div>
73887395
</div>
@@ -7405,27 +7412,33 @@ angular.module('patternfly.charts').component('pfUtilizationTrendChart', {
74057412
{
74067413
name: "Fred Flintstone",
74077414
address: "20 Dinosaur Way, Bedrock, Washingstone",
7408-
birthMonth: 'February'
7415+
birthMonth: 'February',
7416+
car: 'Toyota-Echo'
74097417
},
74107418
{
74117419
name: "John Smith",
74127420
address: "415 East Main Street, Norfolk, Virginia",
7413-
birthMonth: 'October'
7421+
birthMonth: 'October',
7422+
car: 'Subaru-Outback'
7423+
74147424
},
74157425
{
74167426
name: "Frank Livingston",
74177427
address: "234 Elm Street, Pittsburgh, Pennsylvania",
7418-
birthMonth: 'March'
7428+
birthMonth: 'March',
7429+
car: 'Toyota-Prius'
74197430
},
74207431
{
74217432
name: "Judy Green",
74227433
address: "2 Apple Boulevard, Cincinatti, Ohio",
7423-
birthMonth: 'December'
7434+
birthMonth: 'December',
7435+
car: 'Subaru-Impreza'
74247436
},
74257437
{
74267438
name: "Pat Thomas",
74277439
address: "50 Second Street, New York, New York",
7428-
birthMonth: 'February'
7440+
birthMonth: 'February',
7441+
car: 'Subaru-Outback'
74297442
}
74307443
];
74317444
$scope.items = $scope.allItems;
@@ -7440,6 +7453,8 @@ angular.module('patternfly.charts').component('pfUtilizationTrendChart', {
74407453
match = item.address.match(re) !== null;
74417454
} else if (filter.id === 'birthMonth') {
74427455
match = item.birthMonth === filter.value;
7456+
} else if (filter.id === 'car') {
7457+
match = item.car === filter.value;
74437458
}
74447459
return match;
74457460
};
@@ -7498,6 +7513,24 @@ angular.module('patternfly.charts').component('pfUtilizationTrendChart', {
74987513
placeholder: 'Filter by Birth Month',
74997514
filterType: 'select',
75007515
filterValues: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
7516+
},
7517+
{
7518+
id: 'car',
7519+
title: 'Car',
7520+
placeholder: 'Filter by Car Make',
7521+
filterType: 'complex-select',
7522+
filterValues: ['Subaru', 'Toyota'],
7523+
filterDelimiter: '-',
7524+
filterCategoriesPlaceholder: 'Filter by Car Model',
7525+
filterCategories: {subaru: {
7526+
id: 'subaru',
7527+
title: 'Subaru',
7528+
filterValues: ['Outback', 'Crosstrek', 'Impreza']},
7529+
toyota: {
7530+
id: 'toyota',
7531+
title: 'Toyota',
7532+
filterValues: ['Prius', 'Corolla', 'Echo']}
7533+
}
75017534
}
75027535
],
75037536
resultsCount: $scope.items.length,
@@ -7623,8 +7656,17 @@ angular.module('patternfly.filters').component('pfFilterPanelResults', {
76237656
};
76247657

76257658
function filterExists (filter) {
7626-
var foundFilter = _.find(ctrl.config.appliedFilters, {title: filter.title, value: filter.value});
7627-
return foundFilter !== undefined;
7659+
return angular.isDefined(_.find(ctrl.config.appliedFilters, {title: filter.title, value: filter.value}));
7660+
}
7661+
7662+
function findDuplicateCategory (field, value) {
7663+
var duplicateValue;
7664+
7665+
function searchAppliedFilters (item) {
7666+
return _.includes(item.value, _.split(value, field.filterDelimiter, 1)) ? duplicateValue = item : null;
7667+
}
7668+
7669+
return _.some(ctrl.config.appliedFilters, searchAppliedFilters) ? duplicateValue : null;
76287670
}
76297671

76307672
function enforceSingleSelect (filter) {
@@ -7638,12 +7680,17 @@ angular.module('patternfly.filters').component('pfFilterPanelResults', {
76387680
type: field.filterType,
76397681
value: value
76407682
};
7683+
76417684
if (!filterExists(newFilter)) {
76427685

76437686
if (newFilter.type === 'select') {
76447687
enforceSingleSelect(newFilter);
76457688
}
76467689

7690+
if (field.filterType === 'complex-select' && !field.filterMultiselect && findDuplicateCategory(field, value)) {
7691+
_.remove(ctrl.config.appliedFilters, findDuplicateCategory(field, value));
7692+
}
7693+
76477694
ctrl.config.appliedFilters.push(newFilter);
76487695

76497696
if (ctrl.config.onFilterChange) {
@@ -7669,8 +7716,12 @@ angular.module('patternfly.filters').component('pfFilterPanelResults', {
76697716
* <li>.id - (String) Optional unique Id for the filter field, useful for comparisons
76707717
* <li>.title - (String) The title to display for the filter field
76717718
* <li>.placeholder - (String) Text to display when no filter value has been entered
7672-
* <li>.filterType - (String) The filter input field type (any html input type, or 'select' for a select box)
7673-
* <li>.filterValues - (Array) List of valid select values used when filterType is 'select'
7719+
* <li>.filterMultiselect - (Boolean) In `complex-select`, allow selection of multiple values per category. Optional, default is `false`
7720+
* <li>.filterType - (String) The filter input field type (any html input type, or 'select' for a single select box or 'complex-select' for a category select box)
7721+
* <li>.filterValues - (Array) List of valid select values used when filterType is 'select' or 'complex-select' (in where these values serve as case insensitve keys for .filterCategories objects)
7722+
* <li>.filterCategories - (Array of (Objects)) For 'complex-select' only, array of objects whoes keys (case insensitive) match the .filterValues, these objects include each of the filter fields above (sans .placeholder)
7723+
* <li>.filterCategoriesPlaceholder - (String) Text to display in `complex-select` category value select when no filter value has been entered, Optional
7724+
* <li>.filterDelimiter - (String) Delimiter separating 'complex-select' category and value. Optional, default is a space, ' '
76747725
* </ul>
76757726
* <li>.appliedFilters - (Array) List of the currently applied filters
76767727
* </ul>
@@ -7709,13 +7760,29 @@ angular.module('patternfly.filters').component('pfFilterFields', {
77097760

77107761
function selectField (item) {
77117762
ctrl.currentField = item;
7763+
ctrl.currentField.filterDelimiter = ctrl.currentField.filterDelimiter || ' ';
77127764
ctrl.currentValue = null;
77137765
}
77147766

7715-
function selectValue (filterValue) {
7716-
if (angular.isDefined(filterValue)) {
7717-
ctrl.addFilterFn(ctrl.currentField, filterValue);
7718-
ctrl.currentValue = null;
7767+
function selectValue (filterValue, valueType) {
7768+
if (angular.isDefined (filterValue)) {
7769+
if (ctrl.currentField.filterType === 'complex-select') {
7770+
switch (valueType) {
7771+
case 'filter-category':
7772+
ctrl.filterCategory = filterValue;
7773+
ctrl.filterValue = null;
7774+
break;
7775+
case 'filter-value':
7776+
ctrl.filterValue = filterValue;
7777+
break;
7778+
}
7779+
if (ctrl.filterCategory && ctrl.filterValue) {
7780+
ctrl.addFilterFn(ctrl.currentField, ctrl.filterCategory + ctrl.currentField.filterDelimiter + ctrl.filterValue);
7781+
}
7782+
} else {
7783+
ctrl.addFilterFn(ctrl.currentField, filterValue);
7784+
ctrl.currentValue = null;
7785+
}
77197786
}
77207787
}
77217788

@@ -17372,7 +17439,7 @@ angular.module('patternfly.wizard').component('pfWizard', {
1737217439

1737317440

1737417441
$templateCache.put('filters/simple-filter/filter-fields.html',
17375-
"<div class=\"filter-pf filter-fields\"><div class=\"input-group form-group\"><div uib-dropdown class=input-group-btn><button uib-dropdown-toggle type=button class=\"btn btn-default filter-fields\" uib-tooltip=\"Filter by\" tooltip-placement=top tooltip-append-to-body=true>{{$ctrl.currentField.title}} <span class=caret></span></button><ul uib-dropdown-menu><li ng-repeat=\"item in $ctrl.config.fields\"><a class=filter-field role=menuitem tabindex=-1 ng-click=$ctrl.selectField(item)>{{item.title}}</a></li></ul></div><div ng-if=\"$ctrl.currentField.filterType !== 'select'\"><input class=form-control type={{$ctrl.currentField.filterType}} ng-model=$ctrl.currentValue placeholder={{$ctrl.currentField.placeholder}} ng-keypress=\"$ctrl.onValueKeyPress($event)\"></div><div ng-if=\"$ctrl.currentField.filterType === 'select'\"><div class=\"btn-group bootstrap-select form-control filter-select\" uib-dropdown><button type=button uib-dropdown-toggle class=\"btn btn-default dropdown-toggle\"><span class=\"filter-option pull-left\">{{$ctrl.currentValue || $ctrl.currentField.placeholder}}</span> <span class=caret></span></button><ul uib-dropdown-menu class=dropdown-menu-right role=menu><li ng-if=$ctrl.currentField.placeholder><a role=menuitem tabindex=-1 ng-click=$ctrl.selectValue()>{{$ctrl.currentField.placeholder}}</a></li><li ng-repeat=\"filterValue in $ctrl.currentField.filterValues\" ng-class=\"{'selected': filterValue === $ctrl.currentValue}\"><a role=menuitem tabindex=-1 ng-click=$ctrl.selectValue(filterValue)>{{filterValue}}</a></li></ul></div></div></div></div>"
17442+
"<div class=\"filter-pf filter-fields\"><div class=\"input-group form-group\"><div uib-dropdown class=input-group-btn><button uib-dropdown-toggle type=button class=\"btn btn-default filter-fields\" uib-tooltip=\"Filter by\" tooltip-placement=top tooltip-append-to-body=true>{{$ctrl.currentField.title}} <span class=caret></span></button><ul uib-dropdown-menu><li ng-repeat=\"item in $ctrl.config.fields\"><a class=filter-field role=menuitem tabindex=-1 ng-click=$ctrl.selectField(item)>{{item.title}}</a></li></ul></div><div ng-if=\"$ctrl.currentField.filterType !== 'select' && $ctrl.currentField.filterType !== 'complex-select'\"><input class=form-control type={{$ctrl.currentField.filterType}} ng-model=$ctrl.currentValue placeholder={{$ctrl.currentField.placeholder}} ng-keypress=\"$ctrl.onValueKeyPress($event)\"></div><div ng-if=\"$ctrl.currentField.filterType === 'select'\"><div class=\"btn-group bootstrap-select form-control filter-select\" uib-dropdown><button type=button uib-dropdown-toggle class=\"btn btn-default dropdown-toggle\"><span class=\"filter-option pull-left\">{{$ctrl.currentValue || $ctrl.currentField.placeholder}}</span> <span class=caret></span></button><ul uib-dropdown-menu class=dropdown-menu-right role=menu><li ng-if=$ctrl.currentField.placeholder><a role=menuitem tabindex=-1 ng-click=$ctrl.selectValue()>{{$ctrl.currentField.placeholder}}</a></li><li ng-repeat=\"filterValue in $ctrl.currentField.filterValues\" ng-class=\"{'selected': filterValue === $ctrl.currentValue}\"><a role=menuitem tabindex=-1 ng-click=$ctrl.selectValue(filterValue)>{{filterValue}}</a></li></ul></div></div><div ng-if=\"$ctrl.currentField.filterType === 'complex-select'\" class=category-select><div class=\"btn-group bootstrap-select form-control filter-select\" uib-dropdown><button type=button uib-dropdown-toggle class=\"btn btn-default dropdown-toggle\"><span class=\"filter-option pull-left\">{{$ctrl.filterCategory || $ctrl.currentField.placeholder}}</span> <span class=caret></span></button><ul uib-dropdown-menu class=dropdown-menu-right role=menu><li ng-if=$ctrl.currentField.placeholder><a role=menuitem tabindex=-1 ng-click=$ctrl.selectValue()>{{$ctrl.currentField.placeholder}}</a></li><li ng-repeat=\"filterCategory in $ctrl.currentField.filterValues\" ng-class=\"{'selected': filterCategory === $ctrl.filterCategory}\"><a role=menuitem tabindex=-1 ng-click=\"$ctrl.selectValue(filterCategory, 'filter-category')\">{{filterCategory}}</a></li></ul></div><div class=\"btn-group bootstrap-select form-control filter-select\" uib-dropdown><button type=button uib-dropdown-toggle class=\"btn btn-default dropdown-toggle category-select-value\"><span class=\"filter-option pull-left\">{{$ctrl.filterValue || $ctrl.currentField.filterCategoriesPlaceholder}}</span> <span class=caret></span></button><ul uib-dropdown-menu class=dropdown-menu-right role=menu><li ng-if=$ctrl.currentField.placeholder><a role=menuitem tabindex=-1 ng-click=$ctrl.selectValue()>{{$ctrl.currentField.filterCategoriesPlaceholder}}</a></li><li ng-repeat=\"filterValue in $ctrl.currentField.filterCategories[$ctrl.filterCategory.toLowerCase()].filterValues\" ng-class=\"{'selected': filterValue === $ctrl.filterValue}\"><a role=menuitem tabindex=-1 ng-click=\"$ctrl.selectValue(filterValue, 'filter-value')\">{{filterValue}}</a></li></ul></div></div></div></div>"
1737617443
);
1737717444

1737817445

dist/angular-patternfly.min.js

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

dist/docs/css/angular-patternfly.css

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,17 @@ pf-topology {
480480
.filter-pf a {
481481
cursor: pointer;
482482
}
483+
.filter-pf .input-group .input-group-btn .dropdown-menu > .selected > a {
484+
background-color: #0088ce !important;
485+
border-color: #0076b7 !important;
486+
color: #fff !important;
487+
}
488+
.filter-pf .category-select {
489+
display: flex;
490+
}
491+
.filter-pf .category-select-value {
492+
border-left-width: 0 !important;
493+
}
483494
.filter-pf.filter-fields .form-group {
484495
padding-left: 0;
485496
width: 275px;
@@ -492,11 +503,6 @@ pf-topology {
492503
font-style: italic;
493504
font-weight: 400;
494505
}
495-
.input-group .input-group-btn .dropdown-menu > .selected > a {
496-
background-color: #0088ce !important;
497-
border-color: #0076b7 !important;
498-
color: #fff !important;
499-
}
500506
pf-filter-panel .dropdown > .dropdown-menu,
501507
pf-filter-panel .input-group-btn > .dropdown-menu {
502508
margin-top: 5px;

0 commit comments

Comments
 (0)