Skip to content

Commit 683341d

Browse files
Merge pull request #219 from patternfly/bump-v3.3.2
Bumped version number to 3.3.2.
2 parents d1d926c + 615e4ac commit 683341d

36 files changed

+561
-183
lines changed

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-patternfly",
3-
"version": "3.3.1",
3+
"version": "3.3.2",
44
"authors": [
55
"Red Hat"
66
],
@@ -39,7 +39,7 @@
3939
"angular-sanitize": "1.3.0 - 1.5.*",
4040
"angular-bootstrap": "0.13.x",
4141
"lodash": "3.x",
42-
"patternfly": "~3.3.1"
42+
"patternfly": "~3.3.2"
4343
},
4444
"devDependencies": {
4545
"angular-mocks": "1.3.0 - 1.5.*"

dist/docs/css/patternfly-additions.css

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

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.5.2
2+
* @license AngularJS v1.5.3
33
* (c) 2010-2016 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -2225,6 +2225,11 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
22252225
});
22262226

22272227
rules.cancel.push(function(element, newAnimation, currentAnimation) {
2228+
// cancel the animation if classes added / removed in both animation cancel each other out,
2229+
// but only if the current animation isn't structural
2230+
2231+
if (currentAnimation.structural) return false;
2232+
22282233
var nA = newAnimation.addClass;
22292234
var nR = newAnimation.removeClass;
22302235
var cA = currentAnimation.addClass;

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

Lines changed: 235 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,8 @@ angular.module('patternfly.card').directive('pfCard', function () {
573573
getDefaultSparklineLegend: patternflyDefaults.getDefaultSparklineLegend,
574574
getDefaultSparklinePoint: patternflyDefaults.getDefaultSparklinePoint,
575575
getDefaultSparklineTooltip: patternflyDefaults.getDefaultSparklineTooltip,
576-
getDefaultSparklineConfig: patternflyDefaults.getDefaultSparklineConfig
576+
getDefaultSparklineConfig: patternflyDefaults.getDefaultSparklineConfig,
577+
getDefaultLineConfig: patternflyDefaults.getDefaultLineConfig
577578
});
578579
})();
579580
;/**
@@ -942,14 +943,14 @@ angular.module('patternfly.charts').directive('pfDonutPctChart', ["pfUtils", "$t
942943
}
943944

944945
$scope.getStatusColor = function (used, thresholds) {
945-
var color = '#0088CE';
946+
var color = pfUtils.colorPalette.blue;
946947

947948
if (thresholds) {
948-
color = '#3f9c35';
949+
color = pfUtils.colorPalette.green;
949950
if (used >= thresholds.error) {
950-
color = '#CC0000';
951+
color = pfUtils.colorPalette.red;
951952
} else if (used >= thresholds.warning) {
952-
color = '#EC7A08';
953+
color = pfUtils.colorPalette.orange;
953954
}
954955
}
955956

@@ -962,7 +963,7 @@ angular.module('patternfly.charts').directive('pfDonutPctChart', ["pfUtils", "$t
962963
color = { pattern: [] };
963964
percentUsed = scope.data.used / scope.data.total * 100.0;
964965
color.pattern[0] = $scope.getStatusColor(percentUsed, scope.config.thresholds);
965-
color.pattern[1] = '#D1D1D1';
966+
color.pattern[1] = pfUtils.colorPalette.black300;
966967
return color;
967968
};
968969

@@ -1463,6 +1464,225 @@ angular.module('patternfly.charts').directive('pfHeatmap', ["$compile", function
14631464
}
14641465
};
14651466
}]);
1467+
;/**
1468+
* @ngdoc directive
1469+
* @name patternfly.charts.directive:pfLineChart
1470+
*
1471+
* @description
1472+
* Directive for rendering a line chart.
1473+
* <br><br>
1474+
* See http://c3js.org/reference.html for a full list of C3 chart options.
1475+
*
1476+
* @param {object} config configuration settings for the line chart:<br/>
1477+
* <ul style='list-style-type: none'>
1478+
* <li>.chartId - the ID of the container that the chart should bind to
1479+
* <li>.units - unit label for values, ex: 'MHz','GB', etc..
1480+
* <li>.tooltipFn - (optional) override the tooltip contents generation functions. Should take a data point and
1481+
* return HTML markup for the tooltip contents. Setting this overrides the tooltipType value.
1482+
* <li>.area - (optional) overrides the default Area properties of the C3 chart
1483+
* <li>.size - (optional) overrides the default Size properties of the C3 chart
1484+
* <li>.axis - (optional) overrides the default Axis properties of the C3 chart
1485+
* <li>.color - (optional) overrides the default Color properties of the C3 chart
1486+
* <li>.legend - (optional) overrides the default Legend properties of the C3 chart
1487+
* <li>.point - (optional) overrides the default Point properties of the C3 chart
1488+
* </ul>
1489+
*
1490+
* @param {object} chartData the data to be shown as an area chart<br/>
1491+
* First and second Array elements, xData and yData, must exist, next data arrays are optional.<br/>
1492+
* <ul style='list-style-type: none'>
1493+
* <li>.xData - Array, X values for the data points, first element must be the name of the data
1494+
* <li>.yData - Array, Y Values for the data points, first element must be the name of the data
1495+
* <li>.yData1 - Array, Y Values for the data points, first element must be the name of the data
1496+
* <li>.[...] - Array, Y Values for the data points, first element must be the name of the data
1497+
* </ul>
1498+
*
1499+
* @param {boolean=} showXAxis override config settings for showing the X Axis
1500+
* @param {boolean=} showYAxis override config settings for showing the Y Axis
1501+
* @param {boolean=} setAreaChart override config settings for showing area type chart
1502+
1503+
* @example
1504+
<example module="patternfly.charts">
1505+
<file name="index.html">
1506+
<div ng-controller="ChartCtrl" class="row" style="display:inline-block; width: 100%;">
1507+
<div class="col-md-12">
1508+
<div pf-line-chart config="config" chart-data="data" set-area-chart="custAreaChart" show-x-axis="custShowXAxis" show-y-axis="custShowYAxis"></div>
1509+
</div>
1510+
<hr class="col-md-12">
1511+
<div class="col-md-12">
1512+
<div class="row">
1513+
<div class="col-md-6">
1514+
<form role="form"">
1515+
<div class="form-group">
1516+
<label class="checkbox-inline">
1517+
<input type="checkbox" ng-model="custShowXAxis">X Axis</input>
1518+
</label>
1519+
<label class="checkbox-inline">
1520+
<input type="checkbox" ng-model="custShowYAxis">Y Axis</input>
1521+
</label>
1522+
<label class="checkbox-inline">
1523+
<input type="checkbox" ng-model="custAreaChart">Area Chart</input>
1524+
</label>
1525+
</div>
1526+
</form>
1527+
</div>
1528+
<div class="col-md-3">
1529+
<button ng-click="addDataPoint()">Add Data Point</button>
1530+
</div>
1531+
</div>
1532+
</div>
1533+
</div>
1534+
</file>
1535+
1536+
<file name="script.js">
1537+
angular.module( 'patternfly.charts' ).controller( 'ChartCtrl', function( $scope, pfUtils ) {
1538+
1539+
$scope.config = {
1540+
chartId: 'exampleLine',
1541+
grid: {y: {show: false}},
1542+
point: {r: 1},
1543+
color: {pattern: [pfUtils.colorPalette.blue, pfUtils.colorPalette.green]}
1544+
};
1545+
1546+
var today = new Date();
1547+
var dates = ['dates'];
1548+
for (var d = 20 - 1; d >= 0; d--) {
1549+
dates.push(new Date(today.getTime() - (d * 24 * 60 * 60 * 1000)));
1550+
}
1551+
1552+
$scope.data = {
1553+
xData: dates,
1554+
yData0: ['Created', 12, 10,10, 62, 17, 10, 15, 13, 17, 10, 12, 10, 10, 12, 17, 16, 15, 13, 17, 10],
1555+
yData1: ['Deleted', 10, 17, 76,14, 10, 10, 10, 10, 10, 10, 10, 17, 17, 14, 10, 10, 10, 10, 10, 10]
1556+
};
1557+
1558+
$scope.custShowXAxis = false;
1559+
$scope.custShowYAxis = false;
1560+
$scope.custAreaChart = false;
1561+
1562+
$scope.addDataPoint = function () {
1563+
$scope.data.xData.push(new Date($scope.data.xData[$scope.data.xData.length - 1].getTime() + (24 * 60 * 60 * 1000)));
1564+
$scope.data.yData0.push(Math.round(Math.random() * 100));
1565+
$scope.data.yData1.push(Math.round(Math.random() * 100));
1566+
};
1567+
});
1568+
</file>
1569+
</example>
1570+
*/
1571+
angular.module('patternfly.charts').directive('pfLineChart', ["pfUtils", function (pfUtils) {
1572+
'use strict';
1573+
return {
1574+
restrict: 'A',
1575+
scope: {
1576+
config: '=',
1577+
chartData: '=',
1578+
showXAxis: '=?',
1579+
showYAxis: '=?',
1580+
setAreaChart: '=?'
1581+
},
1582+
replace: true,
1583+
templateUrl: 'charts/line/line-chart.html',
1584+
controller: ['$scope',
1585+
function ($scope) {
1586+
1587+
// Create an ID for the chart based on the chartId in the config if given
1588+
$scope.lineChartId = 'lineChart';
1589+
if ($scope.config.chartId) {
1590+
$scope.lineChartId = $scope.config.chartId + $scope.lineChartId;
1591+
}
1592+
1593+
/*
1594+
* Convert the config data to C3 Data
1595+
*/
1596+
$scope.getLineData = function (chartData) {
1597+
var lineData = {
1598+
type: $scope.setAreaChart ? "area" : "line"
1599+
};
1600+
1601+
if (chartData && chartData.dataAvailable !== false && chartData.xData) {
1602+
lineData.x = chartData.xData[0];
1603+
// Convert the chartData dictionary into a C3 columns data arrays
1604+
lineData.columns = Object.keys (chartData).map (function (key) {
1605+
return chartData[key];
1606+
});
1607+
}
1608+
1609+
return lineData;
1610+
};
1611+
1612+
/*
1613+
* Setup Axis options. Default is to not show either axis. This can be overridden in two ways:
1614+
* 1) in the config, setting showAxis to true will show both axes
1615+
* 2) in the attributes showXAxis and showYAxis will override the config if set
1616+
*
1617+
* By default only line and the tick marks are shown, no labels. This is a line and should be used
1618+
* only to show a brief idea of trending. This can be overridden by setting the config.axis options per C3
1619+
*/
1620+
1621+
if ($scope.showXAxis === undefined) {
1622+
$scope.showXAxis = ($scope.config.showAxis !== undefined) && $scope.config.showAxis;
1623+
}
1624+
1625+
if ($scope.showYAxis === undefined) {
1626+
$scope.showYAxis = ($scope.config.showAxis !== undefined) && $scope.config.showAxis;
1627+
}
1628+
1629+
$scope.defaultConfig = $().c3ChartDefaults().getDefaultLineConfig();
1630+
$scope.defaultConfig.axis = {
1631+
x: {
1632+
show: $scope.showXAxis === true,
1633+
type: 'timeseries',
1634+
tick: {
1635+
format: function () {
1636+
return '';
1637+
}
1638+
}
1639+
},
1640+
y: {
1641+
show: $scope.showYAxis === true,
1642+
tick: {
1643+
format: function () {
1644+
return '';
1645+
}
1646+
}
1647+
}
1648+
};
1649+
1650+
/*
1651+
* Setup Chart type option. Default is Line Chart.
1652+
*/
1653+
if ($scope.setAreaChart === undefined) {
1654+
$scope.setAreaChart = ($scope.config.setAreaChart !== undefined) && $scope.config.setAreaChart;
1655+
}
1656+
1657+
// Convert the given data to C3 chart format
1658+
$scope.config.data = pfUtils.merge($scope.config.data, $scope.getLineData($scope.chartData));
1659+
1660+
// Override defaults with callers specifications
1661+
$scope.defaultConfig = pfUtils.merge($scope.defaultConfig, $scope.config);
1662+
}
1663+
],
1664+
1665+
link: function (scope) {
1666+
scope.$watch('config', function () {
1667+
scope.config.data = pfUtils.merge(scope.config.data, scope.getLineData(scope.chartData));
1668+
scope.chartConfig = pfUtils.merge(scope.config, scope.defaultConfig);
1669+
}, true);
1670+
scope.$watch('showXAxis', function () {
1671+
scope.chartConfig.axis.x.show = scope.showXAxis === true;
1672+
});
1673+
scope.$watch('showYAxis', function () {
1674+
scope.chartConfig.axis.y.show = scope.showYAxis === true;
1675+
});
1676+
scope.$watch('setAreaChart', function () {
1677+
scope.chartConfig.data.type = scope.setAreaChart ? "area" : "line";
1678+
});
1679+
scope.$watch('chartData', function () {
1680+
scope.chartConfig.data = pfUtils.merge(scope.chartConfig.data, scope.getLineData(scope.chartData));
1681+
}, true);
1682+
}
1683+
};
1684+
}]
1685+
);
14661686
;/**
14671687
* @ngdoc directive
14681688
* @name patternfly.charts.directive:pfSparklineChart
@@ -4470,7 +4690,9 @@ angular
44704690
},
44714691
mergeDeep: function (source1, source2) {
44724692
return mergeDeep({}, angular.copy(source1), angular.copy(source2));
4473-
}
4693+
},
4694+
4695+
colorPalette: $.pfPaletteColors
44744696
});
44754697
})();
44764698

@@ -5568,6 +5790,11 @@ angular.module('patternfly.views').directive('pfListView', ["$timeout", "$window
55685790
);
55695791

55705792

5793+
$templateCache.put('charts/line/line-chart.html',
5794+
"<span><div pf-c3-chart id={{lineChartId}} config=chartConfig></div></span>"
5795+
);
5796+
5797+
55715798
$templateCache.put('charts/sparkline/sparkline-chart.html',
55725799
"<span><div pf-c3-chart id={{sparklineChartId}} config=chartConfig></div></span>"
55735800
);
@@ -5647,7 +5874,7 @@ angular.module('patternfly.views').directive('pfListView', ["$timeout", "$window
56475874
'use strict';
56485875

56495876
$templateCache.put('sort/sort.html',
5650-
"<div class=sort-pf><form><div class=form-group><div class=\"dropdown btn-group\"><button type=button class=\"btn btn-default dropdown-toggle\" data-toggle=dropdown aria-haspopup=true aria-expanded=false tooltip=\"Sort by\" tooltip-placement=bottom>{{config.currentField.title}} <span class=caret></span></button><ul class=dropdown-menu><li ng-repeat=\"item in config.fields\" ng-class=\"{'selected': item === config.currentField}\"><a class=sort-field role=menuitem tabindex=-1 ng-click=selectField(item)>{{item.title}}</a></li></ul></div><button class=\"btn btn-link\" type=button ng-click=changeDirection()><span class=sort-direction ng-class=getSortIconClass()></span></button></div></form></div>"
5877+
"<div class=sort-pf><form><div class=form-group><div class=\"dropdown btn-group\"><button type=button class=\"btn btn-default dropdown-toggle\" data-toggle=dropdown aria-haspopup=true aria-expanded=false tooltip=\"Sort by\" tooltip-placement=bottom>{{config.currentField.title}} <span class=caret></span></button><ul class=dropdown-menu><li ng-repeat=\"item in config.fields\" ng-class=\"{'selected': item === config.currentField}\"><a href=javascript:void(0); class=sort-field role=menuitem tabindex=-1 ng-click=selectField(item)>{{item.title}}</a></li></ul></div><button class=\"btn btn-link\" type=button ng-click=changeDirection()><span class=sort-direction ng-class=getSortIconClass()></span></button></div></form></div>"
56515878
);
56525879

56535880
}]);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.5.2
2+
* @license AngularJS v1.5.3
33
* (c) 2010-2016 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/

0 commit comments

Comments
 (0)