Skip to content

Commit 0b35959

Browse files
committed
Release 1.4.12
1 parent ef92587 commit 0b35959

Some content is hidden

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

74 files changed

+2673
-1218
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22
All notable changes to this project will be documented in this file.
33
This log tries to follow the good principles of [Keep a CHANGELOG](http://keepachangelog.com/).
44

5+
## 1.4.12 - 2020-10-23
6+
### Added
7+
- `odsAdvAnalysis`: A new widget that can be used to query an
8+
[API v2 `aggregates` endpoint](https://help.opendatasoft.com/apis/ods-search-v2/#aggregating-records) and expose the
9+
results in a variable, which can then be used by other widgets.
10+
- `odsAdvTable`: A new widget to display as a table the content of a variable (typically taken from the `odsAdvAnalysis`
11+
variable).
12+
- `odsSelect`: New `isLoading` parameter to trigger in advance the loading spinner. For example, it can be used to start
13+
the spinner at the very beginning of an `odsResults` query that will populate the `odsSelect` options, so that users
14+
get an explicit loading message the entire time.
15+
16+
### Changed
17+
- `odsMap`: The Mapbox basemap support has been updated to remove deprecated "Studio Classic styles", and add support
18+
for Mapbox Styles and Tilesets.
19+
- `odsMap`: The Jawg basemaps are now displayed in Retina on displays that support it (e.g. smartphones, tablets,
20+
high-density screens).
21+
22+
### Fixed
23+
- Fixed on issue on our minified build (`ods-widgets.min.js`) where several widgets were unusable.
24+
- `odsMap`, `odsSearchbox`: Fixed a number of accessibility issues
25+
- `odsSelect`: Various performance improvements when dealing with a large set of options.
26+
527
## 1.4.11 - 2020-08-07
628
### Fixed
729
- `odsColorGradient`: Replaced `odsColorGradientLogarithmicScaleFactor` parameter with a new `odsColorGradientPowExponent`

dist/libs/ods-map/ods-map.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ L.ODSMap = L.Map.extend({
5151
}
5252
layer.basemapLabel = basemap.label;
5353
layer.basemapId = basemap.id;
54+
55+
// Re-implement the accessibility changes present in modern Leaflet versions
56+
// https://github.com/Leaflet/Leaflet/blob/v1.7.0/src/layer/tile/TileLayer.js#L146-L156
57+
layer.on('tileload', function(e) {
58+
e.tile.alt = "";
59+
e.tile.setAttribute('role', 'presentation');
60+
});
61+
5462
layers.push(layer);
5563
}
5664

@@ -79,4 +87,4 @@ L.ODSMap = L.Map.extend({
7987
}
8088

8189
}
82-
});
90+
});

dist/libs/ods-map/ods-tilelayer.js

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,26 @@ L.ODSTileLayer = L.TileLayer.extend({
2828
this.options.prependAttribution,
2929
this.options.appendAttribution);
3030
},
31-
_mapboxUrl: function(mapId, accessToken) {
32-
var url = '//{s}.tiles.mapbox.com/v4/' + mapId + '/{z}/{x}/{y}';
31+
_mapboxTilesetUrl: function(mapId, accessToken) {
32+
// Tiles served by the Raster Tiles API, from Tilesets
33+
var url = '//api.mapbox.com/v4/' + mapId + '/{z}/{x}/{y}';
3334
if (L.Browser.retina) {
3435
url += '@2x';
3536
}
3637
url += '.png';
3738
url += '?access_token=' + accessToken;
3839
return url;
3940
},
41+
_mapboxStylesUrl: function(mapId, accessToken) {
42+
// Tiles served by the Static Tiles API, from Mapbox styles
43+
var url = '//api.mapbox.com/styles/v1/' + mapId + '/tiles/{z}/{x}/{y}';
44+
if (L.Browser.retina) {
45+
url += '@2x';
46+
}
47+
url += '?access_token=' + accessToken;
48+
49+
return url;
50+
},
4051
_initLayer: function(basemap, disableAttribution, prependAttribution, appendAttribution) {
4152
var layerOptions = {};
4253
var attrib = this._addAttributionPart('', prependAttribution);
@@ -68,16 +79,39 @@ L.ODSTileLayer = L.TileLayer.extend({
6879
attribution: !disableAttribution ? attrib : '',
6980
subdomains: "abc"
7081
});
71-
} else if (basemap.provider.indexOf('mapbox.') === 0) {
82+
} else if (basemap.provider === 'mapbox_style' || basemap.provider.indexOf('mapbox.') === 0) {
83+
var mapId;
84+
if (basemap.provider.indexOf('mapbox.') === 0) {
85+
// Standard mapbox styles, with the former dot-based notation
86+
87+
// Mapping short style names to the full ones (https://docs.mapbox.com/api/maps/#mapbox-styles)
88+
var fullStyles = {
89+
'streets': 'streets-v11',
90+
'outdoors': 'outdoors-v11',
91+
'light': 'light-v10',
92+
'dark': 'dark-v10',
93+
'satellite': 'satellite-v9',
94+
'streets-satellite': 'satellite-streets-v11'
95+
};
96+
97+
var mapStyle = basemap.provider.substring(7);
98+
mapId = 'mapbox/' + fullStyles[mapStyle];
99+
} else {
100+
// Custom style
101+
mapId = basemap.mapid
102+
}
103+
72104
attrib = this._addAttributionPart(attrib, 'Map data © <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> contributors');
73105
attrib = this._addAttributionPart(attrib, appendAttribution);
74106
layerOptions = {
75107
minZoom: 2,
76108
maxZoom: 21,
77109
attribution: !disableAttribution ? attrib : '',
78-
subdomains: "abcd"
110+
subdomains: "abcd",
111+
tileSize: 512,
112+
zoomOffset: -1
79113
};
80-
L.TileLayer.prototype.initialize.call(this, this._mapboxUrl(basemap.provider, basemap.mapbox_access_token), layerOptions);
114+
L.TileLayer.prototype.initialize.call(this, this._mapboxStylesUrl(mapId, basemap.mapbox_access_token), layerOptions);
81115
} else if (basemap.provider === 'mapbox') {
82116
attrib = this._addAttributionPart(attrib, 'Map data © <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> contributors');
83117
attrib = this._addAttributionPart(attrib, appendAttribution);
@@ -93,7 +127,7 @@ L.ODSTileLayer = L.TileLayer.extend({
93127
if (basemap.maxZoom) {
94128
layerOptions.maxZoom = basemap.maxZoom;
95129
}
96-
L.TileLayer.prototype.initialize.call(this, this._mapboxUrl(basemap.mapid, basemap.mapbox_access_token), layerOptions);
130+
L.TileLayer.prototype.initialize.call(this, this._mapboxTilesetUrl(basemap.mapid, basemap.mapbox_access_token), layerOptions);
97131
} else if (basemap.provider.indexOf('stamen.') === 0) {
98132
var stamenMap = basemap.provider.substring(7);
99133
var stamenUrl = '//stamen-tiles-{s}.a.ssl.fastly.net/' + stamenMap + '/{z}/{x}/{y}.png';
@@ -120,7 +154,7 @@ L.ODSTileLayer = L.TileLayer.extend({
120154
'sunny': 'd4246bc4-e98a-4976-b621-681f3f3f4230',
121155
'matrix': '26e378b1-bfeb-48b2-8b32-69f484522bb8',
122156
'transports': 'jawg-transports'
123-
}
157+
};
124158
var jawgUrl = 'https://tiles.jawg.io/';
125159
var jawgMap;
126160

@@ -133,9 +167,9 @@ L.ODSTileLayer = L.TileLayer.extend({
133167
jawgUrl += jawgMap + '/';
134168

135169
jawgUrl += '{z}/{x}/{y}';
136-
//if (L.Browser.retina) {
137-
// jawgUrl += '@2x';
138-
//}
170+
if (L.Browser.retina) {
171+
jawgUrl += '@2x';
172+
}
139173
jawgUrl += '.png';
140174
if (basemap.jawg_apikey) {
141175
jawgUrl += '?api-key=' + basemap.jawg_apikey;
@@ -145,9 +179,9 @@ L.ODSTileLayer = L.TileLayer.extend({
145179
}
146180

147181
if (basemap.shortAttribution) {
148-
attrib = this._addAttributionPart(attrib, '<a href="https://www.jawg.io" target="_blank">jawg</a> <img src="https://www.jawg.io/images/favicon.png" width="16" height="16"> - Map data © <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a>');
182+
attrib = this._addAttributionPart(attrib, '<a href="https://www.jawg.io" target="_blank">jawg</a> <img src="https://www.jawg.io/images/favicon.png" width="16" height="16" alt="Jawg"> - Map data © <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a>');
149183
} else {
150-
attrib = this._addAttributionPart(attrib, 'Tiles Courtesy of <a href="https://www.jawg.io" target="_blank">jawg</a> <img src="https://www.jawg.io/images/favicon.png" width="16" height="16"> - Map data © <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> contributors');
184+
attrib = this._addAttributionPart(attrib, 'Tiles Courtesy of <a href="https://www.jawg.io" target="_blank">jawg</a> <img src="https://www.jawg.io/images/favicon.png" width="16" height="16" alt="Jawg"> - Map data © <a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> contributors');
151185
}
152186
attrib = this._addAttributionPart(attrib, appendAttribution);
153187

dist/ods-widgets.css

Lines changed: 69 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
height: 1px;
5555
overflow: hidden;
5656
}
57+
html[dir=rtl] .ods-aria-instructions {
58+
right: -10000px;
59+
left: auto;
60+
}
5761
[dir=rtl] .fa-wheelchair,
5862
[dir=rtl] .fa-wheelchair-alt,
5963
[dir=rtl] .fa-random,
@@ -3606,9 +3610,11 @@ html[dir=rtl] .odswidget-geo-navigation__choice {
36063610
border-radius: 4px;
36073611
}
36083612
.odswidget-select .odswidget-select-dropdown .odswidget-select-input-container .odswidget-select-input {
3613+
box-sizing: border-box;
36093614
padding: 5px 9px;
36103615
margin: 0;
36113616
width: 100%;
3617+
height: 100%;
36123618
border: 1px solid #33629C;
36133619
border-radius: 4px;
36143620
background-color: #ffffff;
@@ -3630,12 +3636,12 @@ html[dir=rtl] .odswidget-geo-navigation__choice {
36303636
}
36313637
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu {
36323638
position: absolute;
3633-
z-index: 1;
3639+
z-index: 1000;
36343640
border: 1px solid #cccccc;
36353641
border-radius: 4px;
36363642
background-color: #ffffff;
36373643
background-size: cover;
3638-
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.13);
3644+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
36393645
max-height: 0;
36403646
width: 100%;
36413647
opacity: 0;
@@ -3685,23 +3691,38 @@ html[dir=rtl] .odswidget-geo-navigation__choice {
36853691
margin: 0 13px;
36863692
border-bottom: 1px solid #cccccc;
36873693
}
3688-
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i {
3694+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-square-o,
3695+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-check-square,
3696+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-minus-square,
3697+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-times-circle {
36893698
width: 16px;
36903699
height: 16px;
36913700
text-align: center;
36923701
font-size: 18px;
36933702
position: absolute;
36943703
}
3695-
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-square-o {
3704+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-square-o.fa-square-o,
3705+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-check-square.fa-square-o,
3706+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-minus-square.fa-square-o,
3707+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-times-circle.fa-square-o {
36963708
color: #cccccc;
36973709
}
3698-
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-check-square {
3710+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-square-o.fa-check-square,
3711+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-check-square.fa-check-square,
3712+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-minus-square.fa-check-square,
3713+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-times-circle.fa-check-square {
36993714
color: #00C7B1;
37003715
}
3701-
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-minus-square {
3716+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-square-o.fa-minus-square,
3717+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-check-square.fa-minus-square,
3718+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-minus-square.fa-minus-square,
3719+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-times-circle.fa-minus-square {
37023720
color: #00C7B1;
37033721
}
3704-
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-times-circle {
3722+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-square-o.fa-times-circle,
3723+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-check-square.fa-times-circle,
3724+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-minus-square.fa-times-circle,
3725+
.odswidget-select .odswidget-select-dropdown .odswidget-select-dropdown-menu .odswidget-select-dropdown-menu-list > li i.fa-times-circle.fa-times-circle {
37053726
right: 10px;
37063727
width: 14px;
37073728
height: 14px;
@@ -3797,94 +3818,92 @@ html[dir=rtl] .odswidget-geo-navigation__choice {
37973818
color: #0088cc;
37983819
border-bottom-color: #0088cc;
37993820
}
3800-
div.odswidget-adv-table-container {
3821+
div.odswidget-adv-table__container {
38013822
display: -ms-flexbox;
38023823
display: flex;
38033824
-ms-flex-flow: column;
38043825
flex-flow: column;
38053826
padding: 5px;
38063827
border-radius: 4px;
38073828
background-color: #ffffff;
3808-
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15);
3829+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
38093830
}
3810-
div.odswidget-adv-table-container table {
3831+
div.odswidget-adv-table__container table {
38113832
table-layout: auto;
38123833
width: 100%;
38133834
border-collapse: collapse;
3814-
z-index: 2;
38153835
}
3816-
div.odswidget-adv-table-container table.odswidget-adv-table-sticky {
3817-
position: relative;
3836+
div.odswidget-adv-table__container table.odswidget-adv-table__table__sticky-header,
3837+
div.odswidget-adv-table__container table.odswidget-adv-table__table__sticky-first-column,
3838+
div.odswidget-adv-table__container table.odswidget-adv-table__table__sticky-first-header-column {
3839+
position: absolute;
3840+
width: auto;
38183841
}
3819-
div.odswidget-adv-table-container table.odswidget-adv-table-sticky.horizontally-scrolled tbody tr td:first-child,
3820-
div.odswidget-adv-table-container table.odswidget-adv-table-sticky.horizontally-scrolled thead tr th:first-child {
3842+
div.odswidget-adv-table__container table.odswidget-adv-table__table__sticky-header.horizontally-scrolled,
3843+
div.odswidget-adv-table__container table.odswidget-adv-table__table__sticky-first-column.horizontally-scrolled,
3844+
div.odswidget-adv-table__container table.odswidget-adv-table__table__sticky-first-header-column.horizontally-scrolled {
38213845
box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, 0.07);
38223846
transition: box-shadow 0.3s ease-in-out;
38233847
}
3824-
div.odswidget-adv-table-container table.odswidget-adv-table-sticky tr {
3825-
z-index: 1;
3848+
div.odswidget-adv-table__container table.odswidget-adv-table__table__sticky-header {
3849+
width: 100%;
3850+
}
3851+
div.odswidget-adv-table__container table.odswidget-adv-table__table__sticky-header thead {
38263852
display: -ms-flexbox;
38273853
display: flex;
3854+
-ms-flex: 1 1 auto;
3855+
flex: 1 1 auto;
3856+
overflow-y: visible;
38283857
}
3829-
div.odswidget-adv-table-container table.odswidget-adv-table-sticky tbody tr td:first-child {
3830-
z-index: 0;
3831-
background-color: #ffffff;
3858+
div.odswidget-adv-table__container table.odswidget-adv-table__table__sticky-header thead tr {
3859+
-ms-flex-negative: 0;
3860+
flex-shrink: 0;
38323861
}
3833-
div.odswidget-adv-table-container table tr:last-child td {
3862+
div.odswidget-adv-table__container table tr:last-child td {
38343863
border-bottom: none;
38353864
}
3836-
div.odswidget-adv-table-container table tr td,
3837-
div.odswidget-adv-table-container table tr th {
3865+
div.odswidget-adv-table__container table tr td,
3866+
div.odswidget-adv-table__container table tr th {
38383867
padding: 10px;
3839-
border-bottom: 1px solid #dee5ef;
3840-
color: #565656;
3868+
border-bottom: 1px solid #e5e5e5;
3869+
color: #666666;
38413870
vertical-align: top;
38423871
text-align: left;
38433872
white-space: nowrap;
38443873
}
3845-
div.odswidget-adv-table-container table tr th {
3874+
div.odswidget-adv-table__container table tr th {
38463875
padding: 7px 10px;
3847-
background-color: #f6f8fb;
3848-
color: #142e7b;
3876+
background-color: #F6F8FB;
3877+
color: #0088cc;
38493878
font-weight: normal;
38503879
}
3851-
div.odswidget-adv-table-container table tr th:first-child {
3880+
div.odswidget-adv-table__container table tr th:first-child {
38523881
border-top-left-radius: 4px;
38533882
}
3854-
div.odswidget-adv-table-container table tr th:last-child {
3883+
div.odswidget-adv-table__container table tr th:last-child {
38553884
border-top-right-radius: 4px;
38563885
}
3857-
div.odswidget-adv-table-container table tr th i.fa {
3886+
div.odswidget-adv-table__container table tr th i.fa {
38583887
padding-left: 5px;
38593888
font-size: 0.8rem;
38603889
}
3861-
.odswidget-adv-table-totals td {
3862-
border-top: 1px solid #dee5ef;
3890+
div.odswidget-adv-table__container table tr td {
3891+
background-color: #ffffff;
3892+
}
3893+
.odswidget-adv-table__totals td {
3894+
border-top: 2px solid #e5e5e5;
38633895
font-weight: 600;
38643896
}
3865-
span.odswidget-adv-table-total-legend {
3866-
color: #142e7b;
3897+
span.odswidget-adv-table__total__legend {
3898+
color: #666666;
38673899
font-size: 0.8rem;
38683900
vertical-align: text-bottom;
38693901
text-transform: uppercase;
38703902
}
3871-
.odswidget-adv-table-wrapper {
3903+
.odswidget-adv-table__wrapper {
3904+
position: relative;
38723905
overflow: auto;
38733906
}
3874-
.odswidget-adv-table-clear-styles table {
3875-
position: static !important;
3876-
table-layout: auto !important;
3877-
width: 100% !important;
3878-
}
3879-
.odswidget-adv-table-clear-styles table tr {
3880-
position: static !important;
3881-
display: table-row !important;
3882-
}
3883-
.odswidget-adv-table-clear-styles table tr td,
3884-
.odswidget-adv-table-clear-styles table tr th {
3885-
position: static !important;
3886-
display: table-cell !important;
3887-
}
38883907
.odswidget.odswidget-imagified {
38893908
max-width: 100% !important;
38903909
}

0 commit comments

Comments
 (0)