@ta-interaktiv/react-municipality-search 1.4.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/index.js +70 -79
- package/dist/index.js.map +1 -1
- package/dist/municipalitySearch.d.ts.map +1 -1
- package/es/index.js +70 -79
- package/es/index.js.map +1 -1
- package/es/municipalitySearch.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/municipalitySearch.tsx +169 -72
- package/src/styles.module.scss +0 -64
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.5.2](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.5.1...@ta-interaktiv/react-municipality-search@1.5.2) (2022-06-20)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- try to publish ([55709f9](https://gitlab.com/ta-interaktiv/packages/commit/55709f97a752e5753430f8068e2edc858b22a84b))
|
|
10
|
+
|
|
11
|
+
### Reverts
|
|
12
|
+
|
|
13
|
+
- Revert "Publish" ([627f67e](https://gitlab.com/ta-interaktiv/packages/commit/627f67ed0bb983a9213d344c699c6c1518f1a2a7))
|
|
14
|
+
- Revert "Publish" ([5f254e3](https://gitlab.com/ta-interaktiv/packages/commit/5f254e3d553853fa050f2635afc8fa36186b517c))
|
|
15
|
+
|
|
16
|
+
## [1.5.1](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.5.1...@ta-interaktiv/react-municipality-search@1.5.1) (2022-06-20)
|
|
17
|
+
|
|
18
|
+
### Reverts
|
|
19
|
+
|
|
20
|
+
- Revert "Publish" ([627f67e](https://gitlab.com/ta-interaktiv/packages/commit/627f67ed0bb983a9213d344c699c6c1518f1a2a7))
|
|
21
|
+
- Revert "Publish" ([5f254e3](https://gitlab.com/ta-interaktiv/packages/commit/5f254e3d553853fa050f2635afc8fa36186b517c))
|
|
22
|
+
|
|
23
|
+
# [1.5.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.4.1...@ta-interaktiv/react-municipality-search@1.5.0) (2022-06-01)
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
- muniSearch refactor to styledComponents ([603fadd](https://gitlab.com/ta-interaktiv/packages/commit/603fadd02ff8280c20eab454d0cae28d88a505ba))
|
|
28
|
+
|
|
29
|
+
## [1.4.1](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.4.0...@ta-interaktiv/react-municipality-search@1.4.1) (2022-06-01)
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
- muniSearch switched to css module ([10dbc07](https://gitlab.com/ta-interaktiv/packages/commit/10dbc074f415bdd3fb1d1ab85d47d62eb57b93d5))
|
|
34
|
+
|
|
5
35
|
# [1.4.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.3.0...@ta-interaktiv/react-municipality-search@1.4.0) (2022-05-18)
|
|
6
36
|
|
|
7
37
|
### Features
|
package/dist/index.js
CHANGED
|
@@ -9,28 +9,19 @@ var React__default = _interopDefault(React);
|
|
|
9
9
|
require('@ta-interaktiv/semantic-ui/semantic/dist/components/icon.css');
|
|
10
10
|
require('@ta-interaktiv/semantic-ui/semantic/dist/components/input.css');
|
|
11
11
|
require('@ta-interaktiv/semantic-ui/semantic/dist/components/label.css');
|
|
12
|
+
var styled = _interopDefault(require('styled-components'));
|
|
12
13
|
var reactSpring = require('react-spring');
|
|
13
14
|
var IntlMessageFormat = _interopDefault(require('intl-messageformat'));
|
|
14
15
|
|
|
15
|
-
/*! *****************************************************************************
|
|
16
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
17
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
18
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
19
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
21
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
22
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
23
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
24
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
25
|
-
and limitations under the License.
|
|
26
|
-
***************************************************************************** */
|
|
27
16
|
var extendStatics = function(d, b) {
|
|
28
17
|
extendStatics = Object.setPrototypeOf ||
|
|
29
18
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
30
|
-
function (d, b) { for (var p in b) if (
|
|
19
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
31
20
|
return extendStatics(d, b);
|
|
32
21
|
};
|
|
33
22
|
function __extends(d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null)
|
|
24
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
34
25
|
extendStatics(d, b);
|
|
35
26
|
function __() { this.constructor = d; }
|
|
36
27
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -56,34 +47,11 @@ function __spread() {
|
|
|
56
47
|
ar = ar.concat(__read(arguments[i]));
|
|
57
48
|
return ar;
|
|
58
49
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var insertAt = ref.insertAt;
|
|
63
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
64
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
65
|
-
var style = document.createElement('style');
|
|
66
|
-
style.type = 'text/css';
|
|
67
|
-
if (insertAt === 'top') {
|
|
68
|
-
if (head.firstChild) {
|
|
69
|
-
head.insertBefore(style, head.firstChild);
|
|
70
|
-
} else {
|
|
71
|
-
head.appendChild(style);
|
|
72
|
-
}
|
|
73
|
-
} else {
|
|
74
|
-
head.appendChild(style);
|
|
75
|
-
}
|
|
76
|
-
if (style.styleSheet) {
|
|
77
|
-
style.styleSheet.cssText = css;
|
|
78
|
-
} else {
|
|
79
|
-
style.appendChild(document.createTextNode(css));
|
|
80
|
-
}
|
|
50
|
+
function __makeTemplateObject(cooked, raw) {
|
|
51
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
52
|
+
return cooked;
|
|
81
53
|
}
|
|
82
54
|
|
|
83
|
-
var css_248z = "/* IDENTIFICATOR STYLES */\n.styles-module_flexInput__UKuph {\n display: flex; }\n\n.styles-module_inputRow__2d_ug {\n display: flex;\n flex-direction: row;\n align-items: center; }\n @media screen and (max-width: 599px) {\n .styles-module_inputRow__2d_ug {\n flex-direction: column; }\n .styles-module_inputRow__2d_ug .ui.input {\n width: 100%;\n max-width: 100%; } }\n\n.styles-module_results__3PGlX {\n margin-top: 1ex;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));\n grid-gap: 0;\n font-family: var(--ui-font-stack); }\n\n.styles-module_result__3usMx {\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: 0.2ex;\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n color: rgba(0, 0, 0, 0.9);\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n background-color: transparent; }\n .styles-module_result__3usMx:hover, .styles-module_result__3usMx:focus {\n box-shadow: 0 0 0.5ex rgba(0, 0, 0, 0.2), 0 0 0 1px #007abf inset;\n background-color: rgba(255, 255, 255, 0.95); }\n\n.styles-module_resultHeader__1JwTX {\n font-weight: 700; }\n\n.styles-module_resultPlz__3ZHjS {\n opacity: 0.5;\n font-weight: 400; }\n\n.styles-module_resultMeta__2pscu {\n opacity: 0.66;\n font-size: 0.9em; }\n";
|
|
84
|
-
var styles = {"flexInput":"styles-module_flexInput__UKuph","inputRow":"styles-module_inputRow__2d_ug","results":"styles-module_results__3PGlX","result":"styles-module_result__3usMx","resultHeader":"styles-module_resultHeader__1JwTX","resultPlz":"styles-module_resultPlz__3ZHjS","resultMeta":"styles-module_resultMeta__2pscu"};
|
|
85
|
-
styleInject(css_248z);
|
|
86
|
-
|
|
87
55
|
var data = { meta:{ forComponent:"MunicipalitySearch",
|
|
88
56
|
language:"German" },
|
|
89
57
|
label:"Suchen Sie nach einer Postleitzahl oder dem Gemeindenamen",
|
|
@@ -139,13 +107,13 @@ var MunicipalitySearch = (function (_super) {
|
|
|
139
107
|
results: [],
|
|
140
108
|
value: '',
|
|
141
109
|
error: null,
|
|
142
|
-
municipalities: []
|
|
110
|
+
municipalities: []
|
|
143
111
|
};
|
|
144
112
|
_this.resetComponent = function () {
|
|
145
113
|
_this.setState({
|
|
146
114
|
isLoading: false,
|
|
147
115
|
results: [],
|
|
148
|
-
value: ''
|
|
116
|
+
value: ''
|
|
149
117
|
});
|
|
150
118
|
};
|
|
151
119
|
_this.filterList = function (searchTerm) {
|
|
@@ -188,7 +156,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
188
156
|
window.dataLayer.push({
|
|
189
157
|
event: 'Interactions',
|
|
190
158
|
event_action: 'input',
|
|
191
|
-
event_label: "search:for_" + searchTerm + ":results_" + results.length
|
|
159
|
+
event_label: "search:for_" + searchTerm + ":results_" + results.length
|
|
192
160
|
});
|
|
193
161
|
}
|
|
194
162
|
return _this.removeDuplicates(results, searchTerm);
|
|
@@ -213,7 +181,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
213
181
|
.fetch(url, {
|
|
214
182
|
method: 'GET',
|
|
215
183
|
mode: 'no-cors',
|
|
216
|
-
credentials: 'include'
|
|
184
|
+
credentials: 'include'
|
|
217
185
|
})
|
|
218
186
|
.then(function (response) {
|
|
219
187
|
console.log(response);
|
|
@@ -224,19 +192,26 @@ var MunicipalitySearch = (function (_super) {
|
|
|
224
192
|
};
|
|
225
193
|
_this.pushToLocalStorageArray = function (newMuni) {
|
|
226
194
|
var _a;
|
|
195
|
+
var prevSelectedMunicipalities;
|
|
196
|
+
var newArray = [];
|
|
227
197
|
var localStorageItemName = 'selectedMunicipalities_' + _this.props.municipalityData;
|
|
228
|
-
|
|
229
|
-
|
|
198
|
+
try {
|
|
199
|
+
prevSelectedMunicipalities = (_a = localStorage.getItem(localStorageItemName)) !== null && _a !== void 0 ? _a : JSON.stringify([]);
|
|
200
|
+
newArray = JSON.parse(prevSelectedMunicipalities);
|
|
201
|
+
}
|
|
202
|
+
catch (_b) {
|
|
203
|
+
console.warn('🗄 localStorage is not available');
|
|
204
|
+
}
|
|
230
205
|
var slicedArray = newArray.slice(0, 15);
|
|
231
206
|
slicedArray.unshift(newMuni);
|
|
232
207
|
localStorage.setItem(localStorageItemName, JSON.stringify(__spread(new Map(slicedArray.map(function (muni) { return [
|
|
233
208
|
muni.ORTNAME + muni.GDENR,
|
|
234
|
-
muni
|
|
209
|
+
muni
|
|
235
210
|
]; })).values())));
|
|
236
211
|
};
|
|
237
212
|
_this.getMunicipalitiesData = function () {
|
|
238
213
|
_this.setState({
|
|
239
|
-
isLoading: true
|
|
214
|
+
isLoading: true
|
|
240
215
|
});
|
|
241
216
|
return fetch("https://interaktiv.tagesanzeiger.ch/static/gemeindesuche/" + _this.props.municipalityData + ".json")
|
|
242
217
|
.then(function (res) {
|
|
@@ -248,7 +223,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
248
223
|
.then(function (data) {
|
|
249
224
|
_this.setState({
|
|
250
225
|
isLoading: false,
|
|
251
|
-
municipalities: data
|
|
226
|
+
municipalities: data
|
|
252
227
|
});
|
|
253
228
|
})
|
|
254
229
|
.catch(function (error) {
|
|
@@ -258,7 +233,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
258
233
|
console.info('Read more about the data generation in the "data" directory in the project repository for the MunicipalitySearch React component.');
|
|
259
234
|
_this.setState({
|
|
260
235
|
isLoading: false,
|
|
261
|
-
error: 'error.municipalitiesNotDownloaded'
|
|
236
|
+
error: 'error.municipalitiesNotDownloaded'
|
|
262
237
|
});
|
|
263
238
|
}
|
|
264
239
|
else {
|
|
@@ -300,7 +275,13 @@ var MunicipalitySearch = (function (_super) {
|
|
|
300
275
|
};
|
|
301
276
|
MunicipalitySearch.prototype.componentDidMount = function () {
|
|
302
277
|
var _a;
|
|
303
|
-
var locallyStoredMunicipalitiesArray
|
|
278
|
+
var locallyStoredMunicipalitiesArray;
|
|
279
|
+
try {
|
|
280
|
+
locallyStoredMunicipalitiesArray = localStorage.getItem('selectedMunicipalities_' + this.props.municipalityData);
|
|
281
|
+
}
|
|
282
|
+
catch (_b) {
|
|
283
|
+
console.warn('🗄 localStorage is not available!');
|
|
284
|
+
}
|
|
304
285
|
if (this.props.showLastSelectedMunicipalities &&
|
|
305
286
|
locallyStoredMunicipalitiesArray) {
|
|
306
287
|
var parsed = JSON.parse(locallyStoredMunicipalitiesArray);
|
|
@@ -327,49 +308,59 @@ var MunicipalitySearch = (function (_super) {
|
|
|
327
308
|
.matches
|
|
328
309
|
? 'top pointing'
|
|
329
310
|
: 'left pointing';
|
|
330
|
-
return (React__default.createElement(
|
|
331
|
-
React__default.createElement(
|
|
311
|
+
return (React__default.createElement(MunicipalitySearchContainer, { className: 'municipality-search' },
|
|
312
|
+
React__default.createElement(InputRow, { className: 'inputRow' },
|
|
332
313
|
React__default.createElement("div", { className: 'ui left icon input' },
|
|
333
|
-
React__default.createElement(
|
|
334
|
-
React__default.createElement(
|
|
314
|
+
React__default.createElement(FlexInput, { id: 'search', type: 'text', className: 'prompt flexInput', placeholder: this.props.placeholder || t('placeholder'), value: value, disabled: this.state.error === 'error.municipalitiesNotDownloaded', onChange: this.handleSearchChange }),
|
|
315
|
+
React__default.createElement(Icon, null,
|
|
316
|
+
React__default.createElement("svg", { width: '18', height: '18', viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', stroke: 'black', strokeWidth: '3' },
|
|
317
|
+
React__default.createElement("circle", { cx: '7.5', cy: '7.5', r: '6' }),
|
|
318
|
+
React__default.createElement("line", { x1: '11', y1: '11', x2: '17', y2: '17' })))),
|
|
335
319
|
!this.props.hideTooltip && (React__default.createElement("div", null,
|
|
336
320
|
React__default.createElement("label", { htmlFor: 'search', className: "ui " + (this.state.error ? 'red' : 'basic grey') + " " + labelDirection + " label" }, labelContent())))),
|
|
337
|
-
showResults(results) && (React__default.createElement(
|
|
321
|
+
showResults(results) && (React__default.createElement(Results, { className: 'results' }, showResults(results) && (React__default.createElement(reactSpring.Transition, { native: true, items: results, keys: function (result) {
|
|
338
322
|
return result.PLZ4 + result.GDENR + result.ORTNAME;
|
|
339
|
-
}, from: { transform: 'translate(0,-20px)', opacity: 0 }, enter: { transform: 'translate(0,0px)', opacity: 1 }, leave: { transform: 'translate(0, 60px)', opacity: 0 }, config: reactSpring.config.gentle }, function (values, result) {
|
|
340
|
-
|
|
323
|
+
}, from: { transform: 'translate(0,-20px)', opacity: 0 }, enter: { transform: 'translate(0,0px)', opacity: 1 }, leave: { transform: 'translate(0, 60px)', opacity: 0 }, config: reactSpring.config.gentle }, function (values, result) { return (React__default.createElement(reactSpring.animated.div, { onClick: function () {
|
|
324
|
+
_this.props.onSelectionHandler(result);
|
|
325
|
+
if (_this.props.showLastSelectedMunicipalities) {
|
|
326
|
+
_this.pushToLocalStorageArray(result);
|
|
327
|
+
}
|
|
328
|
+
if (_this.props.resetOnSelect) {
|
|
329
|
+
_this.resetComponent();
|
|
330
|
+
}
|
|
331
|
+
}, onKeyUp: function (e) {
|
|
332
|
+
if (e.key === 'Enter' || e.key === 'Space') {
|
|
341
333
|
_this.props.onSelectionHandler(result);
|
|
342
|
-
if (_this.props.showLastSelectedMunicipalities) {
|
|
343
|
-
_this.pushToLocalStorageArray(result);
|
|
344
|
-
}
|
|
345
334
|
if (_this.props.resetOnSelect) {
|
|
346
335
|
_this.resetComponent();
|
|
347
336
|
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
' ',
|
|
359
|
-
result.ORTNAME),
|
|
360
|
-
React__default.createElement("div", { className: styles.resultMeta },
|
|
361
|
-
t('list.municipalityPrefix'),
|
|
362
|
-
" ",
|
|
363
|
-
result.GDENAMK)));
|
|
364
|
-
}))))));
|
|
337
|
+
}
|
|
338
|
+
}, className: 'result', style: values, tabIndex: 0 },
|
|
339
|
+
React__default.createElement(ResultHeader, { className: 'resultHeader' },
|
|
340
|
+
React__default.createElement(ResultPlz, { className: 'resultPlz' }, result.PLZ4),
|
|
341
|
+
' ',
|
|
342
|
+
result.ORTNAME),
|
|
343
|
+
React__default.createElement(ResultMeta, { className: 'resultMeta' },
|
|
344
|
+
t('list.municipalityPrefix'),
|
|
345
|
+
" ",
|
|
346
|
+
result.GDENAMK))); }))))));
|
|
365
347
|
};
|
|
366
348
|
MunicipalitySearch.defaultProps = {
|
|
367
349
|
municipalityData: '2021v3',
|
|
368
350
|
locale: 'de',
|
|
369
|
-
numberOfLastSelectedMunicipalities: 1
|
|
351
|
+
numberOfLastSelectedMunicipalities: 1
|
|
370
352
|
};
|
|
371
353
|
return MunicipalitySearch;
|
|
372
|
-
}(React.Component));
|
|
354
|
+
}(React.Component));
|
|
355
|
+
var Icon = styled.i(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n padding-left: 0.8em;\n opacity: .5;\n transition: opacity 0.5s ease-in-out;\n"], ["\n\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n padding-left: 0.8em;\n opacity: .5;\n transition: opacity 0.5s ease-in-out;\n"])));
|
|
356
|
+
var MunicipalitySearchContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\n"], ["\n\n"])));
|
|
357
|
+
var InputRow = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n input:focus ~ i {\n opacity: 1;\n}\n @media screen and (max-width: 599px) {\n flex-direction: column;\n .ui.input {\n width: 100%;\n max-width: 100%;\n }\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n input:focus ~ i {\n opacity: 1;\n}\n @media screen and (max-width: 599px) {\n flex-direction: column;\n .ui.input {\n width: 100%;\n max-width: 100%;\n }\n }\n"])));
|
|
358
|
+
var FlexInput = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
359
|
+
var Results = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-top: 1ex;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));\n grid-gap: 0;\n font-family: var(--ui-font-stack);\n .result {\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: 0.2ex;\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n //border: 1px solid #007abf;\n color: rgba(0, 0, 0, 0.9);\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n background-color: transparent;\n\n &:hover,\n &:focus {\n box-shadow: 0 0 0.5ex rgba(0, 0, 0, 0.2), 0 0 0 1px #007abf inset;\n background-color: $backgroundColor;\n }\n }\n"], ["\n margin-top: 1ex;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));\n grid-gap: 0;\n font-family: var(--ui-font-stack);\n .result {\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: 0.2ex;\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n //border: 1px solid #007abf;\n color: rgba(0, 0, 0, 0.9);\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n background-color: transparent;\n\n &:hover,\n &:focus {\n box-shadow: 0 0 0.5ex rgba(0, 0, 0, 0.2), 0 0 0 1px #007abf inset;\n background-color: $backgroundColor;\n }\n }\n"])));
|
|
360
|
+
var ResultHeader = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-weight: 700;\n"], ["\n font-weight: 700;\n"])));
|
|
361
|
+
var ResultPlz = styled.span(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n opacity: 0.5;\n font-weight: 400;\n"], ["\n opacity: 0.5;\n font-weight: 400;\n"])));
|
|
362
|
+
var ResultMeta = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n opacity: 0.66;\n font-size: 0.9em;\n"], ["\n opacity: 0.66;\n font-size: 0.9em;\n"])));
|
|
363
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
373
364
|
|
|
374
365
|
exports.MunicipalitySearch = MunicipalitySearch;
|
|
375
366
|
exports.default = MunicipalitySearch;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU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,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AAEH,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/tslib/tslib.es6.js"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgBA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1G,IAAI,OAAO,aAAa,CAAC,CAAC,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"municipalitySearch.d.ts","sourceRoot":"","sources":["src/municipalitySearch.tsx"],"names":[],"mappings":"AACA,OAAc,EAAe,SAAS,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,8DAA8D,CAAA;AACrE,OAAO,+DAA+D,CAAA;AACtE,OAAO,+DAA+D,CAAA;
|
|
1
|
+
{"version":3,"file":"municipalitySearch.d.ts","sourceRoot":"","sources":["src/municipalitySearch.tsx"],"names":[],"mappings":"AACA,OAAc,EAAe,SAAS,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,8DAA8D,CAAA;AACrE,OAAO,+DAA+D,CAAA;AACtE,OAAO,+DAA+D,CAAA;AAmBtE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,KAAK;IAGpB,gBAAgB,EAAE,MAAM,CAAA;IAGxB,MAAM,CAAC,EAAE,OAAO,CAAA;IAGhB,WAAW,CAAC,EAAE,OAAO,CAAA;IAGrB,aAAa,CAAC,EAAE,OAAO,CAAA;IAGvB,kBAAkB,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAA;IAGxD,MAAM,EAAE,IAAI,GAAG,IAAI,CAAA;IAGnB,WAAW,CAAC,EAAE,MAAM,CAAA;IAGpB,8BAA8B,CAAC,EAAE,OAAO,CAAA;IAGxC,kCAAkC,CAAC,EAAE,MAAM,CAAA;CAC5C;AAED,UAAU,KAAK;IACb,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EACD,IAAI,GACJ,sBAAsB,GACtB,uBAAuB,GACvB,mCAAmC,CAAA;IACvC,cAAc,EAAE,YAAY,EAAE,CAAA;CAC/B;AAsDD,qBAAa,kBAAmB,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IAC7D,OAAc,YAAY;;;;MAIzB;IAEM,KAAK;;;;;;MAMX;IAED,OAAO,CAAC,cAAc,CAMrB;IAED,OAAO,CAAC,UAAU,CA0DjB;IAED,OAAO,CAAC,gBAAgB;IAkCxB,OAAO,CAAC,kBAAkB,CAezB;IAOD,OAAO,CAAC,kBAAkB,CAgBzB;IAED,OAAO,CAAC,uBAAuB,CA4B9B;IAED,OAAO,CAAC,qBAAqB,CAuC5B;IAEM,kBAAkB,CAAC,SAAS,EAAE,KAAK;IAUnC,iBAAiB;IA0BjB,MAAM;CAgJd"}
|
package/es/index.js
CHANGED
|
@@ -2,28 +2,19 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import '@ta-interaktiv/semantic-ui/semantic/dist/components/icon.css';
|
|
3
3
|
import '@ta-interaktiv/semantic-ui/semantic/dist/components/input.css';
|
|
4
4
|
import '@ta-interaktiv/semantic-ui/semantic/dist/components/label.css';
|
|
5
|
+
import styled from 'styled-components';
|
|
5
6
|
import { Transition, config, animated } from 'react-spring';
|
|
6
7
|
import IntlMessageFormat from 'intl-messageformat';
|
|
7
8
|
|
|
8
|
-
/*! *****************************************************************************
|
|
9
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
11
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
12
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
15
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
16
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
17
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
18
|
-
and limitations under the License.
|
|
19
|
-
***************************************************************************** */
|
|
20
9
|
var extendStatics = function(d, b) {
|
|
21
10
|
extendStatics = Object.setPrototypeOf ||
|
|
22
11
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
23
|
-
function (d, b) { for (var p in b) if (
|
|
12
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
24
13
|
return extendStatics(d, b);
|
|
25
14
|
};
|
|
26
15
|
function __extends(d, b) {
|
|
16
|
+
if (typeof b !== "function" && b !== null)
|
|
17
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
27
18
|
extendStatics(d, b);
|
|
28
19
|
function __() { this.constructor = d; }
|
|
29
20
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -49,34 +40,11 @@ function __spread() {
|
|
|
49
40
|
ar = ar.concat(__read(arguments[i]));
|
|
50
41
|
return ar;
|
|
51
42
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var insertAt = ref.insertAt;
|
|
56
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
57
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
58
|
-
var style = document.createElement('style');
|
|
59
|
-
style.type = 'text/css';
|
|
60
|
-
if (insertAt === 'top') {
|
|
61
|
-
if (head.firstChild) {
|
|
62
|
-
head.insertBefore(style, head.firstChild);
|
|
63
|
-
} else {
|
|
64
|
-
head.appendChild(style);
|
|
65
|
-
}
|
|
66
|
-
} else {
|
|
67
|
-
head.appendChild(style);
|
|
68
|
-
}
|
|
69
|
-
if (style.styleSheet) {
|
|
70
|
-
style.styleSheet.cssText = css;
|
|
71
|
-
} else {
|
|
72
|
-
style.appendChild(document.createTextNode(css));
|
|
73
|
-
}
|
|
43
|
+
function __makeTemplateObject(cooked, raw) {
|
|
44
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
45
|
+
return cooked;
|
|
74
46
|
}
|
|
75
47
|
|
|
76
|
-
var css_248z = "/* IDENTIFICATOR STYLES */\n.styles-module_flexInput__UKuph {\n display: flex; }\n\n.styles-module_inputRow__2d_ug {\n display: flex;\n flex-direction: row;\n align-items: center; }\n @media screen and (max-width: 599px) {\n .styles-module_inputRow__2d_ug {\n flex-direction: column; }\n .styles-module_inputRow__2d_ug .ui.input {\n width: 100%;\n max-width: 100%; } }\n\n.styles-module_results__3PGlX {\n margin-top: 1ex;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));\n grid-gap: 0;\n font-family: var(--ui-font-stack); }\n\n.styles-module_result__3usMx {\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: 0.2ex;\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n color: rgba(0, 0, 0, 0.9);\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n background-color: transparent; }\n .styles-module_result__3usMx:hover, .styles-module_result__3usMx:focus {\n box-shadow: 0 0 0.5ex rgba(0, 0, 0, 0.2), 0 0 0 1px #007abf inset;\n background-color: rgba(255, 255, 255, 0.95); }\n\n.styles-module_resultHeader__1JwTX {\n font-weight: 700; }\n\n.styles-module_resultPlz__3ZHjS {\n opacity: 0.5;\n font-weight: 400; }\n\n.styles-module_resultMeta__2pscu {\n opacity: 0.66;\n font-size: 0.9em; }\n";
|
|
77
|
-
var styles = {"flexInput":"styles-module_flexInput__UKuph","inputRow":"styles-module_inputRow__2d_ug","results":"styles-module_results__3PGlX","result":"styles-module_result__3usMx","resultHeader":"styles-module_resultHeader__1JwTX","resultPlz":"styles-module_resultPlz__3ZHjS","resultMeta":"styles-module_resultMeta__2pscu"};
|
|
78
|
-
styleInject(css_248z);
|
|
79
|
-
|
|
80
48
|
var data = { meta:{ forComponent:"MunicipalitySearch",
|
|
81
49
|
language:"German" },
|
|
82
50
|
label:"Suchen Sie nach einer Postleitzahl oder dem Gemeindenamen",
|
|
@@ -132,13 +100,13 @@ var MunicipalitySearch = (function (_super) {
|
|
|
132
100
|
results: [],
|
|
133
101
|
value: '',
|
|
134
102
|
error: null,
|
|
135
|
-
municipalities: []
|
|
103
|
+
municipalities: []
|
|
136
104
|
};
|
|
137
105
|
_this.resetComponent = function () {
|
|
138
106
|
_this.setState({
|
|
139
107
|
isLoading: false,
|
|
140
108
|
results: [],
|
|
141
|
-
value: ''
|
|
109
|
+
value: ''
|
|
142
110
|
});
|
|
143
111
|
};
|
|
144
112
|
_this.filterList = function (searchTerm) {
|
|
@@ -181,7 +149,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
181
149
|
window.dataLayer.push({
|
|
182
150
|
event: 'Interactions',
|
|
183
151
|
event_action: 'input',
|
|
184
|
-
event_label: "search:for_" + searchTerm + ":results_" + results.length
|
|
152
|
+
event_label: "search:for_" + searchTerm + ":results_" + results.length
|
|
185
153
|
});
|
|
186
154
|
}
|
|
187
155
|
return _this.removeDuplicates(results, searchTerm);
|
|
@@ -206,7 +174,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
206
174
|
.fetch(url, {
|
|
207
175
|
method: 'GET',
|
|
208
176
|
mode: 'no-cors',
|
|
209
|
-
credentials: 'include'
|
|
177
|
+
credentials: 'include'
|
|
210
178
|
})
|
|
211
179
|
.then(function (response) {
|
|
212
180
|
console.log(response);
|
|
@@ -217,19 +185,26 @@ var MunicipalitySearch = (function (_super) {
|
|
|
217
185
|
};
|
|
218
186
|
_this.pushToLocalStorageArray = function (newMuni) {
|
|
219
187
|
var _a;
|
|
188
|
+
var prevSelectedMunicipalities;
|
|
189
|
+
var newArray = [];
|
|
220
190
|
var localStorageItemName = 'selectedMunicipalities_' + _this.props.municipalityData;
|
|
221
|
-
|
|
222
|
-
|
|
191
|
+
try {
|
|
192
|
+
prevSelectedMunicipalities = (_a = localStorage.getItem(localStorageItemName)) !== null && _a !== void 0 ? _a : JSON.stringify([]);
|
|
193
|
+
newArray = JSON.parse(prevSelectedMunicipalities);
|
|
194
|
+
}
|
|
195
|
+
catch (_b) {
|
|
196
|
+
console.warn('🗄 localStorage is not available');
|
|
197
|
+
}
|
|
223
198
|
var slicedArray = newArray.slice(0, 15);
|
|
224
199
|
slicedArray.unshift(newMuni);
|
|
225
200
|
localStorage.setItem(localStorageItemName, JSON.stringify(__spread(new Map(slicedArray.map(function (muni) { return [
|
|
226
201
|
muni.ORTNAME + muni.GDENR,
|
|
227
|
-
muni
|
|
202
|
+
muni
|
|
228
203
|
]; })).values())));
|
|
229
204
|
};
|
|
230
205
|
_this.getMunicipalitiesData = function () {
|
|
231
206
|
_this.setState({
|
|
232
|
-
isLoading: true
|
|
207
|
+
isLoading: true
|
|
233
208
|
});
|
|
234
209
|
return fetch("https://interaktiv.tagesanzeiger.ch/static/gemeindesuche/" + _this.props.municipalityData + ".json")
|
|
235
210
|
.then(function (res) {
|
|
@@ -241,7 +216,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
241
216
|
.then(function (data) {
|
|
242
217
|
_this.setState({
|
|
243
218
|
isLoading: false,
|
|
244
|
-
municipalities: data
|
|
219
|
+
municipalities: data
|
|
245
220
|
});
|
|
246
221
|
})
|
|
247
222
|
.catch(function (error) {
|
|
@@ -251,7 +226,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
251
226
|
console.info('Read more about the data generation in the "data" directory in the project repository for the MunicipalitySearch React component.');
|
|
252
227
|
_this.setState({
|
|
253
228
|
isLoading: false,
|
|
254
|
-
error: 'error.municipalitiesNotDownloaded'
|
|
229
|
+
error: 'error.municipalitiesNotDownloaded'
|
|
255
230
|
});
|
|
256
231
|
}
|
|
257
232
|
else {
|
|
@@ -293,7 +268,13 @@ var MunicipalitySearch = (function (_super) {
|
|
|
293
268
|
};
|
|
294
269
|
MunicipalitySearch.prototype.componentDidMount = function () {
|
|
295
270
|
var _a;
|
|
296
|
-
var locallyStoredMunicipalitiesArray
|
|
271
|
+
var locallyStoredMunicipalitiesArray;
|
|
272
|
+
try {
|
|
273
|
+
locallyStoredMunicipalitiesArray = localStorage.getItem('selectedMunicipalities_' + this.props.municipalityData);
|
|
274
|
+
}
|
|
275
|
+
catch (_b) {
|
|
276
|
+
console.warn('🗄 localStorage is not available!');
|
|
277
|
+
}
|
|
297
278
|
if (this.props.showLastSelectedMunicipalities &&
|
|
298
279
|
locallyStoredMunicipalitiesArray) {
|
|
299
280
|
var parsed = JSON.parse(locallyStoredMunicipalitiesArray);
|
|
@@ -320,49 +301,59 @@ var MunicipalitySearch = (function (_super) {
|
|
|
320
301
|
.matches
|
|
321
302
|
? 'top pointing'
|
|
322
303
|
: 'left pointing';
|
|
323
|
-
return (React.createElement(
|
|
324
|
-
React.createElement(
|
|
304
|
+
return (React.createElement(MunicipalitySearchContainer, { className: 'municipality-search' },
|
|
305
|
+
React.createElement(InputRow, { className: 'inputRow' },
|
|
325
306
|
React.createElement("div", { className: 'ui left icon input' },
|
|
326
|
-
React.createElement(
|
|
327
|
-
React.createElement(
|
|
307
|
+
React.createElement(FlexInput, { id: 'search', type: 'text', className: 'prompt flexInput', placeholder: this.props.placeholder || t('placeholder'), value: value, disabled: this.state.error === 'error.municipalitiesNotDownloaded', onChange: this.handleSearchChange }),
|
|
308
|
+
React.createElement(Icon, null,
|
|
309
|
+
React.createElement("svg", { width: '18', height: '18', viewBox: '0 0 18 18', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', stroke: 'black', strokeWidth: '3' },
|
|
310
|
+
React.createElement("circle", { cx: '7.5', cy: '7.5', r: '6' }),
|
|
311
|
+
React.createElement("line", { x1: '11', y1: '11', x2: '17', y2: '17' })))),
|
|
328
312
|
!this.props.hideTooltip && (React.createElement("div", null,
|
|
329
313
|
React.createElement("label", { htmlFor: 'search', className: "ui " + (this.state.error ? 'red' : 'basic grey') + " " + labelDirection + " label" }, labelContent())))),
|
|
330
|
-
showResults(results) && (React.createElement(
|
|
314
|
+
showResults(results) && (React.createElement(Results, { className: 'results' }, showResults(results) && (React.createElement(Transition, { native: true, items: results, keys: function (result) {
|
|
331
315
|
return result.PLZ4 + result.GDENR + result.ORTNAME;
|
|
332
|
-
}, from: { transform: 'translate(0,-20px)', opacity: 0 }, enter: { transform: 'translate(0,0px)', opacity: 1 }, leave: { transform: 'translate(0, 60px)', opacity: 0 }, config: config.gentle }, function (values, result) {
|
|
333
|
-
|
|
316
|
+
}, from: { transform: 'translate(0,-20px)', opacity: 0 }, enter: { transform: 'translate(0,0px)', opacity: 1 }, leave: { transform: 'translate(0, 60px)', opacity: 0 }, config: config.gentle }, function (values, result) { return (React.createElement(animated.div, { onClick: function () {
|
|
317
|
+
_this.props.onSelectionHandler(result);
|
|
318
|
+
if (_this.props.showLastSelectedMunicipalities) {
|
|
319
|
+
_this.pushToLocalStorageArray(result);
|
|
320
|
+
}
|
|
321
|
+
if (_this.props.resetOnSelect) {
|
|
322
|
+
_this.resetComponent();
|
|
323
|
+
}
|
|
324
|
+
}, onKeyUp: function (e) {
|
|
325
|
+
if (e.key === 'Enter' || e.key === 'Space') {
|
|
334
326
|
_this.props.onSelectionHandler(result);
|
|
335
|
-
if (_this.props.showLastSelectedMunicipalities) {
|
|
336
|
-
_this.pushToLocalStorageArray(result);
|
|
337
|
-
}
|
|
338
327
|
if (_this.props.resetOnSelect) {
|
|
339
328
|
_this.resetComponent();
|
|
340
329
|
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
' ',
|
|
352
|
-
result.ORTNAME),
|
|
353
|
-
React.createElement("div", { className: styles.resultMeta },
|
|
354
|
-
t('list.municipalityPrefix'),
|
|
355
|
-
" ",
|
|
356
|
-
result.GDENAMK)));
|
|
357
|
-
}))))));
|
|
330
|
+
}
|
|
331
|
+
}, className: 'result', style: values, tabIndex: 0 },
|
|
332
|
+
React.createElement(ResultHeader, { className: 'resultHeader' },
|
|
333
|
+
React.createElement(ResultPlz, { className: 'resultPlz' }, result.PLZ4),
|
|
334
|
+
' ',
|
|
335
|
+
result.ORTNAME),
|
|
336
|
+
React.createElement(ResultMeta, { className: 'resultMeta' },
|
|
337
|
+
t('list.municipalityPrefix'),
|
|
338
|
+
" ",
|
|
339
|
+
result.GDENAMK))); }))))));
|
|
358
340
|
};
|
|
359
341
|
MunicipalitySearch.defaultProps = {
|
|
360
342
|
municipalityData: '2021v3',
|
|
361
343
|
locale: 'de',
|
|
362
|
-
numberOfLastSelectedMunicipalities: 1
|
|
344
|
+
numberOfLastSelectedMunicipalities: 1
|
|
363
345
|
};
|
|
364
346
|
return MunicipalitySearch;
|
|
365
|
-
}(Component));
|
|
347
|
+
}(Component));
|
|
348
|
+
var Icon = styled.i(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n padding-left: 0.8em;\n opacity: .5;\n transition: opacity 0.5s ease-in-out;\n"], ["\n\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n padding-left: 0.8em;\n opacity: .5;\n transition: opacity 0.5s ease-in-out;\n"])));
|
|
349
|
+
var MunicipalitySearchContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\n"], ["\n\n"])));
|
|
350
|
+
var InputRow = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n input:focus ~ i {\n opacity: 1;\n}\n @media screen and (max-width: 599px) {\n flex-direction: column;\n .ui.input {\n width: 100%;\n max-width: 100%;\n }\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n input:focus ~ i {\n opacity: 1;\n}\n @media screen and (max-width: 599px) {\n flex-direction: column;\n .ui.input {\n width: 100%;\n max-width: 100%;\n }\n }\n"])));
|
|
351
|
+
var FlexInput = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
352
|
+
var Results = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-top: 1ex;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));\n grid-gap: 0;\n font-family: var(--ui-font-stack);\n .result {\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: 0.2ex;\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n //border: 1px solid #007abf;\n color: rgba(0, 0, 0, 0.9);\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n background-color: transparent;\n\n &:hover,\n &:focus {\n box-shadow: 0 0 0.5ex rgba(0, 0, 0, 0.2), 0 0 0 1px #007abf inset;\n background-color: $backgroundColor;\n }\n }\n"], ["\n margin-top: 1ex;\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));\n grid-gap: 0;\n font-family: var(--ui-font-stack);\n .result {\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: 0.2ex;\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n //border: 1px solid #007abf;\n color: rgba(0, 0, 0, 0.9);\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n background-color: transparent;\n\n &:hover,\n &:focus {\n box-shadow: 0 0 0.5ex rgba(0, 0, 0, 0.2), 0 0 0 1px #007abf inset;\n background-color: $backgroundColor;\n }\n }\n"])));
|
|
353
|
+
var ResultHeader = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-weight: 700;\n"], ["\n font-weight: 700;\n"])));
|
|
354
|
+
var ResultPlz = styled.span(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n opacity: 0.5;\n font-weight: 400;\n"], ["\n opacity: 0.5;\n font-weight: 400;\n"])));
|
|
355
|
+
var ResultMeta = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n opacity: 0.66;\n font-size: 0.9em;\n"], ["\n opacity: 0.66;\n font-size: 0.9em;\n"])));
|
|
356
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
366
357
|
|
|
367
358
|
export default MunicipalitySearch;
|
|
368
359
|
export { MunicipalitySearch };
|
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnF,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CA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,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AAEH,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/tslib/tslib.es6.js"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n"],"names":[],"mappings":";;;;;;;;AAgBA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1G,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEK,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;AAChC,IAAI,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,IAAI;AAC7C,QAAQ,MAAM,IAAI,SAAS,CAAC,sBAAsB,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,+BA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C,cAAc,EAAE,YAAY,EAAE,CAAA;CAC/B;AAsDD,qBAAa,kBAAmB,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IAC7D,OAAc,YAAY;;;;MAIzB;IAEM,KAAK;;;;;;MAMX;IAED,OAAO,CAAC,cAAc,CAMrB;IAED,OAAO,CAAC,UAAU,CA0DjB;IAED,OAAO,CAAC,gBAAgB;IAkCxB,OAAO,CAAC,kBAAkB,CAezB;IAOD,OAAO,CAAC,kBAAkB,CAgBzB;IAED,OAAO,CAAC,uBAAuB,CA4B9B;IAED,OAAO,CAAC,qBAAqB,CAuC5B;IAEM,kBAAkB,CAAC,SAAS,EAAE,KAAK;IAUnC,iBAAiB;IA0BjB,MAAM;CAgJd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ta-interaktiv/react-municipality-search",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "React component that allows searching for Swiss municipalities with either ZIP code or place names.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@ta-interaktiv/semantic-ui": "^3.3.3",
|
|
48
48
|
"intl-messageformat": "^2.2.0",
|
|
49
|
-
"react-spring": "^9.4.5"
|
|
49
|
+
"react-spring": "^9.4.5",
|
|
50
|
+
"styled-components": "^5.3.5"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
53
|
"@ta-interaktiv/semantic-ui": "^3.1.0",
|
|
@@ -56,5 +57,5 @@
|
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@react-spring/types": "^9.4.5"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "74e5a72da1618a79ea2d303a9494162491b6e11a"
|
|
60
61
|
}
|
|
@@ -3,12 +3,9 @@ import React, { ChangeEvent, Component } from 'react'
|
|
|
3
3
|
import '@ta-interaktiv/semantic-ui/semantic/dist/components/icon.css'
|
|
4
4
|
import '@ta-interaktiv/semantic-ui/semantic/dist/components/input.css'
|
|
5
5
|
import '@ta-interaktiv/semantic-ui/semantic/dist/components/label.css'
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
config as springConfig,
|
|
10
|
-
Transition,
|
|
11
|
-
} from 'react-spring'
|
|
6
|
+
// import './styles.scss'
|
|
7
|
+
import styled from 'styled-components'
|
|
8
|
+
import { animated, config as springConfig, Transition } from 'react-spring'
|
|
12
9
|
import IntlMessageFormat from 'intl-messageformat'
|
|
13
10
|
import de from './locales/de.yml'
|
|
14
11
|
import fr from './locales/fr.yml'
|
|
@@ -133,7 +130,7 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
133
130
|
public static defaultProps = {
|
|
134
131
|
municipalityData: '2021v3',
|
|
135
132
|
locale: 'de',
|
|
136
|
-
numberOfLastSelectedMunicipalities: 1
|
|
133
|
+
numberOfLastSelectedMunicipalities: 1
|
|
137
134
|
}
|
|
138
135
|
|
|
139
136
|
public state = {
|
|
@@ -141,14 +138,14 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
141
138
|
results: [],
|
|
142
139
|
value: '',
|
|
143
140
|
error: null,
|
|
144
|
-
municipalities: []
|
|
141
|
+
municipalities: []
|
|
145
142
|
}
|
|
146
143
|
|
|
147
144
|
private resetComponent = () => {
|
|
148
145
|
this.setState({
|
|
149
146
|
isLoading: false,
|
|
150
147
|
results: [],
|
|
151
|
-
value: ''
|
|
148
|
+
value: ''
|
|
152
149
|
})
|
|
153
150
|
}
|
|
154
151
|
|
|
@@ -205,7 +202,7 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
205
202
|
window.dataLayer.push({
|
|
206
203
|
event: 'Interactions',
|
|
207
204
|
event_action: 'input',
|
|
208
|
-
event_label: `search:for_${searchTerm}:results_${results.length}
|
|
205
|
+
event_label: `search:for_${searchTerm}:results_${results.length}`
|
|
209
206
|
})
|
|
210
207
|
}
|
|
211
208
|
|
|
@@ -217,7 +214,7 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
217
214
|
searchTerm: string
|
|
218
215
|
): Municipality[] {
|
|
219
216
|
const map = new Map()
|
|
220
|
-
arr.forEach(
|
|
217
|
+
arr.forEach(v => {
|
|
221
218
|
if (this.props.dedupe) {
|
|
222
219
|
map.set(v.ORTNAME + v.GDENR, v)
|
|
223
220
|
} else {
|
|
@@ -276,25 +273,32 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
276
273
|
.fetch(url, {
|
|
277
274
|
method: 'GET',
|
|
278
275
|
mode: 'no-cors',
|
|
279
|
-
credentials: 'include'
|
|
276
|
+
credentials: 'include'
|
|
280
277
|
})
|
|
281
|
-
.then(
|
|
278
|
+
.then(response => {
|
|
282
279
|
console.log(response)
|
|
283
280
|
})
|
|
284
|
-
.catch(
|
|
281
|
+
.catch(error => {
|
|
285
282
|
console.log(error)
|
|
286
283
|
})
|
|
287
284
|
}
|
|
288
285
|
|
|
289
286
|
private pushToLocalStorageArray = (newMuni: Municipality) => {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
287
|
+
let prevSelectedMunicipalities
|
|
288
|
+
let newArray: Municipality[] = []
|
|
289
|
+
const localStorageItemName =
|
|
290
|
+
'selectedMunicipalities_' + this.props.municipalityData
|
|
291
|
+
try{
|
|
292
|
+
|
|
293
|
+
prevSelectedMunicipalities =
|
|
294
|
+
localStorage.getItem(localStorageItemName) ?? JSON.stringify([])
|
|
295
|
+
newArray = JSON.parse(prevSelectedMunicipalities)
|
|
296
|
+
}catch{
|
|
297
|
+
console.warn('🗄 localStorage is not available')
|
|
298
|
+
}
|
|
299
|
+
// limit the number of stored municipalities
|
|
300
|
+
const slicedArray = newArray.slice(0, 15)
|
|
301
|
+
slicedArray.unshift(newMuni)
|
|
298
302
|
// deduplicate the array and stringify it for localStorage
|
|
299
303
|
localStorage.setItem(
|
|
300
304
|
localStorageItemName,
|
|
@@ -302,22 +306,22 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
302
306
|
...new Map(
|
|
303
307
|
slicedArray.map((muni: Municipality) => [
|
|
304
308
|
muni.ORTNAME + muni.GDENR,
|
|
305
|
-
muni
|
|
309
|
+
muni
|
|
306
310
|
])
|
|
307
|
-
).values()
|
|
311
|
+
).values()
|
|
308
312
|
])
|
|
309
313
|
)
|
|
310
314
|
}
|
|
311
315
|
|
|
312
316
|
private getMunicipalitiesData = () => {
|
|
313
317
|
this.setState({
|
|
314
|
-
isLoading: true
|
|
318
|
+
isLoading: true
|
|
315
319
|
})
|
|
316
320
|
|
|
317
321
|
return fetch(
|
|
318
322
|
`https://interaktiv.tagesanzeiger.ch/static/gemeindesuche/${this.props.municipalityData}.json`
|
|
319
323
|
)
|
|
320
|
-
.then(
|
|
324
|
+
.then(res => {
|
|
321
325
|
if (!res.ok) {
|
|
322
326
|
throw new MunicipalityDownloadError(
|
|
323
327
|
`Download error: ${res.status}: ${res.statusText}.`
|
|
@@ -325,13 +329,13 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
325
329
|
}
|
|
326
330
|
return res.json()
|
|
327
331
|
})
|
|
328
|
-
.then(
|
|
332
|
+
.then(data => {
|
|
329
333
|
this.setState({
|
|
330
334
|
isLoading: false,
|
|
331
|
-
municipalities: data
|
|
335
|
+
municipalities: data
|
|
332
336
|
})
|
|
333
337
|
})
|
|
334
|
-
.catch(
|
|
338
|
+
.catch(error => {
|
|
335
339
|
if (error instanceof MunicipalityDownloadError) {
|
|
336
340
|
console.log(error)
|
|
337
341
|
console.info(
|
|
@@ -342,7 +346,7 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
342
346
|
)
|
|
343
347
|
this.setState({
|
|
344
348
|
isLoading: false,
|
|
345
|
-
error: 'error.municipalitiesNotDownloaded'
|
|
349
|
+
error: 'error.municipalitiesNotDownloaded'
|
|
346
350
|
})
|
|
347
351
|
} else {
|
|
348
352
|
throw error
|
|
@@ -362,9 +366,14 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
362
366
|
/** Component mounting */
|
|
363
367
|
public componentDidMount() {
|
|
364
368
|
// set the municipalities from localStorage as results
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
369
|
+
let locallyStoredMunicipalitiesArray
|
|
370
|
+
try{
|
|
371
|
+
locallyStoredMunicipalitiesArray = localStorage.getItem(
|
|
372
|
+
'selectedMunicipalities_' + this.props.municipalityData
|
|
373
|
+
)
|
|
374
|
+
}catch{
|
|
375
|
+
console.warn('🗄 localStorage is not available!')
|
|
376
|
+
}
|
|
368
377
|
if (
|
|
369
378
|
this.props.showLastSelectedMunicipalities &&
|
|
370
379
|
locallyStoredMunicipalitiesArray
|
|
@@ -414,13 +423,13 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
414
423
|
: 'left pointing'
|
|
415
424
|
|
|
416
425
|
return (
|
|
417
|
-
<
|
|
418
|
-
<
|
|
426
|
+
<MunicipalitySearchContainer className='municipality-search'>
|
|
427
|
+
<InputRow className='inputRow'>
|
|
419
428
|
<div className='ui left icon input'>
|
|
420
|
-
<
|
|
429
|
+
<FlexInput
|
|
421
430
|
id='search'
|
|
422
431
|
type='text'
|
|
423
|
-
className=
|
|
432
|
+
className='prompt flexInput'
|
|
424
433
|
placeholder={
|
|
425
434
|
this.props.placeholder || (t('placeholder') as string)
|
|
426
435
|
}
|
|
@@ -430,7 +439,30 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
430
439
|
}
|
|
431
440
|
onChange={this.handleSearchChange}
|
|
432
441
|
/>
|
|
433
|
-
<
|
|
442
|
+
<Icon>
|
|
443
|
+
<svg
|
|
444
|
+
width='18'
|
|
445
|
+
height='18'
|
|
446
|
+
viewBox='0 0 18 18'
|
|
447
|
+
fill='none'
|
|
448
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
449
|
+
stroke='black'
|
|
450
|
+
strokeWidth='3'
|
|
451
|
+
>
|
|
452
|
+
<circle
|
|
453
|
+
cx='7.5'
|
|
454
|
+
cy='7.5'
|
|
455
|
+
r='6'
|
|
456
|
+
|
|
457
|
+
/>
|
|
458
|
+
<line
|
|
459
|
+
x1='11'
|
|
460
|
+
y1='11'
|
|
461
|
+
x2='17'
|
|
462
|
+
y2='17'
|
|
463
|
+
/>
|
|
464
|
+
</svg>
|
|
465
|
+
</Icon>
|
|
434
466
|
</div>
|
|
435
467
|
{!this.props.hideTooltip && (
|
|
436
468
|
<div>
|
|
@@ -444,9 +476,9 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
444
476
|
</label>
|
|
445
477
|
</div>
|
|
446
478
|
)}
|
|
447
|
-
</
|
|
479
|
+
</InputRow>
|
|
448
480
|
{showResults(results) && (
|
|
449
|
-
<
|
|
481
|
+
<Results className='results'>
|
|
450
482
|
{showResults(results) && (
|
|
451
483
|
<Transition
|
|
452
484
|
native
|
|
@@ -459,48 +491,113 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
459
491
|
leave={{ transform: 'translate(0, 60px)', opacity: 0 }}
|
|
460
492
|
config={springConfig.gentle}
|
|
461
493
|
>
|
|
462
|
-
{(values, result)
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
494
|
+
{(values, result) => (
|
|
495
|
+
<animated.div
|
|
496
|
+
onClick={() => {
|
|
497
|
+
this.props.onSelectionHandler(result)
|
|
498
|
+
// this.sendToDataPipeline(result.PLZ4)
|
|
499
|
+
if (this.props.showLastSelectedMunicipalities) {
|
|
500
|
+
this.pushToLocalStorageArray(result)
|
|
501
|
+
}
|
|
502
|
+
if (this.props.resetOnSelect) {
|
|
503
|
+
this.resetComponent()
|
|
504
|
+
}
|
|
505
|
+
}}
|
|
506
|
+
onKeyUp={e => {
|
|
507
|
+
if (e.key === 'Enter' || e.key === 'Space') {
|
|
466
508
|
this.props.onSelectionHandler(result)
|
|
467
509
|
// this.sendToDataPipeline(result.PLZ4)
|
|
468
|
-
if (this.props.showLastSelectedMunicipalities) {
|
|
469
|
-
this.pushToLocalStorageArray(result)
|
|
470
|
-
}
|
|
471
510
|
if (this.props.resetOnSelect) {
|
|
472
511
|
this.resetComponent()
|
|
473
512
|
}
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
<span className={styles.resultPlz}>{result.PLZ4}</span>{' '}
|
|
490
|
-
{result.ORTNAME}
|
|
491
|
-
</div>
|
|
492
|
-
<div className={styles.resultMeta}>
|
|
493
|
-
{t('list.municipalityPrefix')} {result.GDENAMK}
|
|
494
|
-
</div>
|
|
495
|
-
</animated.div>
|
|
496
|
-
)}
|
|
513
|
+
}
|
|
514
|
+
}}
|
|
515
|
+
className='result'
|
|
516
|
+
style={values}
|
|
517
|
+
tabIndex={0}
|
|
518
|
+
>
|
|
519
|
+
<ResultHeader className='resultHeader'>
|
|
520
|
+
<ResultPlz className='resultPlz'>{result.PLZ4}</ResultPlz>{' '}
|
|
521
|
+
{result.ORTNAME}
|
|
522
|
+
</ResultHeader>
|
|
523
|
+
<ResultMeta className='resultMeta'>
|
|
524
|
+
{t('list.municipalityPrefix')} {result.GDENAMK}
|
|
525
|
+
</ResultMeta>
|
|
526
|
+
</animated.div>
|
|
527
|
+
)}
|
|
497
528
|
</Transition>
|
|
498
529
|
)}
|
|
499
|
-
</
|
|
530
|
+
</Results>
|
|
500
531
|
)}
|
|
501
|
-
</
|
|
532
|
+
</MunicipalitySearchContainer>
|
|
502
533
|
)
|
|
503
534
|
}
|
|
504
535
|
|
|
505
536
|
// endregion
|
|
506
537
|
}
|
|
538
|
+
const Icon = styled.i`
|
|
539
|
+
|
|
540
|
+
position: absolute;
|
|
541
|
+
top: 50%;
|
|
542
|
+
transform: translateY(-50%);
|
|
543
|
+
display: flex;
|
|
544
|
+
padding-left: 0.8em;
|
|
545
|
+
opacity: .5;
|
|
546
|
+
transition: opacity 0.5s ease-in-out;
|
|
547
|
+
`
|
|
548
|
+
const MunicipalitySearchContainer = styled.div`
|
|
549
|
+
|
|
550
|
+
`
|
|
551
|
+
const InputRow = styled.div`
|
|
552
|
+
display: flex;
|
|
553
|
+
flex-direction: row;
|
|
554
|
+
align-items: center;
|
|
555
|
+
input:focus ~ i {
|
|
556
|
+
opacity: 1;
|
|
557
|
+
}
|
|
558
|
+
@media screen and (max-width: 599px) {
|
|
559
|
+
flex-direction: column;
|
|
560
|
+
.ui.input {
|
|
561
|
+
width: 100%;
|
|
562
|
+
max-width: 100%;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
`
|
|
566
|
+
const FlexInput = styled.input`
|
|
567
|
+
display: flex;
|
|
568
|
+
`
|
|
569
|
+
const Results = styled.div`
|
|
570
|
+
margin-top: 1ex;
|
|
571
|
+
display: grid;
|
|
572
|
+
grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
|
|
573
|
+
grid-gap: 0;
|
|
574
|
+
font-family: var(--ui-font-stack);
|
|
575
|
+
.result {
|
|
576
|
+
padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);
|
|
577
|
+
border-radius: 0.2ex;
|
|
578
|
+
box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);
|
|
579
|
+
//border: 1px solid #007abf;
|
|
580
|
+
color: rgba(0, 0, 0, 0.9);
|
|
581
|
+
line-height: 1.1em;
|
|
582
|
+
cursor: pointer;
|
|
583
|
+
transition: box-shadow 200ms ease-in-out;
|
|
584
|
+
background-color: transparent;
|
|
585
|
+
|
|
586
|
+
&:hover,
|
|
587
|
+
&:focus {
|
|
588
|
+
box-shadow: 0 0 0.5ex rgba(0, 0, 0, 0.2), 0 0 0 1px #007abf inset;
|
|
589
|
+
background-color: $backgroundColor;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
`
|
|
593
|
+
const ResultHeader = styled.div`
|
|
594
|
+
font-weight: 700;
|
|
595
|
+
`
|
|
596
|
+
const ResultPlz = styled.span`
|
|
597
|
+
opacity: 0.5;
|
|
598
|
+
font-weight: 400;
|
|
599
|
+
`
|
|
600
|
+
const ResultMeta = styled.div`
|
|
601
|
+
opacity: 0.66;
|
|
602
|
+
font-size: 0.9em;
|
|
603
|
+
`
|
package/src/styles.module.scss
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/* IDENTIFICATOR STYLES */
|
|
2
|
-
$backgroundColor: rgba(255, 255, 255, 0.95);
|
|
3
|
-
|
|
4
|
-
.flexInput {
|
|
5
|
-
display: flex;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.municipalitySearch {
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.inputRow {
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: row;
|
|
14
|
-
align-items: center;
|
|
15
|
-
|
|
16
|
-
@media screen and (max-width: 599px) {
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
|
|
19
|
-
:global .ui.input {
|
|
20
|
-
width: 100%;
|
|
21
|
-
max-width: 100%;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.results {
|
|
27
|
-
margin-top: 1ex;
|
|
28
|
-
display: grid;
|
|
29
|
-
grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
|
|
30
|
-
grid-gap: 0;
|
|
31
|
-
font-family: var(--ui-font-stack);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.result {
|
|
35
|
-
padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);
|
|
36
|
-
border-radius: 0.2ex;
|
|
37
|
-
box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);
|
|
38
|
-
//border: 1px solid #007abf;
|
|
39
|
-
color: rgba(0, 0, 0, 0.9);
|
|
40
|
-
line-height: 1.1em;
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
transition: box-shadow 200ms ease-in-out;
|
|
43
|
-
background-color: transparent;
|
|
44
|
-
|
|
45
|
-
&:hover,
|
|
46
|
-
&:focus {
|
|
47
|
-
box-shadow: 0 0 0.5ex rgba(0, 0, 0, 0.2), 0 0 0 1px #007abf inset;
|
|
48
|
-
background-color: $backgroundColor;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.resultHeader {
|
|
53
|
-
font-weight: 700;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.resultPlz {
|
|
57
|
-
opacity: 0.5;
|
|
58
|
-
font-weight: 400;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.resultMeta {
|
|
62
|
-
opacity: 0.66;
|
|
63
|
-
font-size: 0.9em;
|
|
64
|
-
}
|