@ta-interaktiv/react-municipality-search 2.1.4 → 2.2.1
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/dist/index.js +16 -17
- package/dist/index.js.map +1 -1
- package/dist/municipalitySearch.d.ts +3 -0
- package/dist/municipalitySearch.d.ts.map +1 -1
- package/es/index.js +16 -17
- package/es/index.js.map +1 -1
- package/es/municipalitySearch.d.ts +3 -0
- package/es/municipalitySearch.d.ts.map +1 -1
- package/package.json +2 -3
- package/src/municipalitySearch.tsx +8 -3
- package/CHANGELOG.md +0 -367
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
21
21
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
22
22
|
PERFORMANCE OF THIS SOFTWARE.
|
|
23
23
|
***************************************************************************** */
|
|
24
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
24
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
25
25
|
|
|
26
26
|
var extendStatics = function(d, b) {
|
|
27
27
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -173,7 +173,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
else if (startsWithNumber.test(searchTerm)) {
|
|
176
|
-
results = municipalities.filter(function (municipality) { var _a; return RegExp("^"
|
|
176
|
+
results = municipalities.filter(function (municipality) { var _a; return RegExp("^".concat(searchTerm)).test(((_a = municipality.PLZ4) !== null && _a !== void 0 ? _a : '').toString()); });
|
|
177
177
|
if (results.length < 1) {
|
|
178
178
|
_this.setState({ error: 'error.noResultsByZip' });
|
|
179
179
|
}
|
|
@@ -181,11 +181,12 @@ var MunicipalitySearch = (function (_super) {
|
|
|
181
181
|
else if (containsOnlyLetters.test(searchTerm)) {
|
|
182
182
|
var sanitizedSearchTerm = searchTerm.replace('.', '\\.');
|
|
183
183
|
var r_1 = RegExp(sanitizedSearchTerm, 'i');
|
|
184
|
-
var exactWordRegex_1 = RegExp("\\b"
|
|
184
|
+
var exactWordRegex_1 = RegExp("\\b".concat(sanitizedSearchTerm, "\\b"), 'i');
|
|
185
185
|
var rankResults = function (searchTerm, arrayToSort) {
|
|
186
186
|
return arrayToSort.sort(function (a, b) {
|
|
187
|
-
var
|
|
188
|
-
var
|
|
187
|
+
var _a, _b;
|
|
188
|
+
var aScore = scoreResult_1(searchTerm.toLowerCase(), a[(_a = _this.props.propertyToSearch) !== null && _a !== void 0 ? _a : MunicipalitySearch.defaultProps.propertyToSearch].toLowerCase());
|
|
189
|
+
var bScore = scoreResult_1(searchTerm.toLowerCase(), b[(_b = _this.props.propertyToSearch) !== null && _b !== void 0 ? _b : MunicipalitySearch.defaultProps.propertyToSearch].toLowerCase());
|
|
189
190
|
return bScore - aScore;
|
|
190
191
|
});
|
|
191
192
|
};
|
|
@@ -200,7 +201,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
200
201
|
return 0;
|
|
201
202
|
}
|
|
202
203
|
};
|
|
203
|
-
var notExactMatches = municipalities.filter(function (municipality) { return r_1.test(municipality.
|
|
204
|
+
var notExactMatches = municipalities.filter(function (municipality) { var _a; return r_1.test(municipality[(_a = _this.props.propertyToSearch) !== null && _a !== void 0 ? _a : MunicipalitySearch.defaultProps.propertyToSearch]); });
|
|
204
205
|
results = rankResults(sanitizedSearchTerm, notExactMatches).slice(0, _this.props.maxResults);
|
|
205
206
|
if (results.length < 1) {
|
|
206
207
|
_this.setState({ error: 'error.noResultsByName' });
|
|
@@ -210,7 +211,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
210
211
|
window.dataLayer.push({
|
|
211
212
|
event: 'Interactions',
|
|
212
213
|
event_action: 'input',
|
|
213
|
-
event_label: "search:for_"
|
|
214
|
+
event_label: "search:for_".concat(searchTerm, ":results_").concat(results.length),
|
|
214
215
|
});
|
|
215
216
|
}
|
|
216
217
|
return _this.removeDuplicates(results, searchTerm);
|
|
@@ -264,7 +265,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
264
265
|
console.log(e);
|
|
265
266
|
console.warn('🍪 cookies of selectedMunicipalities is not available');
|
|
266
267
|
}
|
|
267
|
-
var ordered = __spreadArray(__spreadArray([], __read(munisFromLocalStorage)), __read(munisFromCookies)).sort(function (a, b) {
|
|
268
|
+
var ordered = __spreadArray(__spreadArray([], __read(munisFromLocalStorage), false), __read(munisFromCookies), false).sort(function (a, b) {
|
|
268
269
|
if (b.timestamp && a.timestamp) {
|
|
269
270
|
return b.timestamp - a.timestamp;
|
|
270
271
|
}
|
|
@@ -308,7 +309,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
308
309
|
(_this.props.dedupe ? '' : muni.PLZ4),
|
|
309
310
|
muni,
|
|
310
311
|
];
|
|
311
|
-
})).values())).reverse()
|
|
312
|
+
})).values()), false).reverse()
|
|
312
313
|
.sort(function (a, b) {
|
|
313
314
|
if (b.timestamp && a.timestamp) {
|
|
314
315
|
return b.timestamp - a.timestamp;
|
|
@@ -337,10 +338,10 @@ var MunicipalitySearch = (function (_super) {
|
|
|
337
338
|
var API_BASE_URL = useLegacy
|
|
338
339
|
? 'https://interaktiv.tagesanzeiger.ch/static/gemeindesuche/'
|
|
339
340
|
: 'https://atm-municipality-search.s3.eu-west-1.amazonaws.com/';
|
|
340
|
-
return fetch(API_BASE_URL + (_this.props.municipalityData
|
|
341
|
+
return fetch(API_BASE_URL + "".concat(_this.props.municipalityData, ".json"))
|
|
341
342
|
.then(function (res) {
|
|
342
343
|
if (!res.ok) {
|
|
343
|
-
throw new MunicipalityDownloadError("Download error: "
|
|
344
|
+
throw new MunicipalityDownloadError("Download error: ".concat(res.status, ": ").concat(res.statusText, "."));
|
|
344
345
|
}
|
|
345
346
|
return res.json();
|
|
346
347
|
})
|
|
@@ -382,7 +383,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
382
383
|
map.set(((_b = v.PLZ4) !== null && _b !== void 0 ? _b : '') + ((_c = v.ORTNAME) !== null && _c !== void 0 ? _c : '') + v.GDENR, v);
|
|
383
384
|
}
|
|
384
385
|
});
|
|
385
|
-
var result = __spreadArray([], __read(map.values())).reduce(function (acc, cur) {
|
|
386
|
+
var result = __spreadArray([], __read(map.values()), false).reduce(function (acc, cur) {
|
|
386
387
|
var _a, _b;
|
|
387
388
|
if (((_a = cur.GDENAMK) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === searchTerm.toLowerCase() ||
|
|
388
389
|
((_b = cur.ORTNAME) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === searchTerm.toLowerCase()) {
|
|
@@ -492,23 +493,21 @@ var MunicipalitySearch = (function (_super) {
|
|
|
492
493
|
resultBackgroundColor: 'var(--site-background)',
|
|
493
494
|
inputBackgroundColor: 'var(--site-background)',
|
|
494
495
|
maxResults: 10,
|
|
496
|
+
propertyToSearch: "NORMGEMEINDE"
|
|
495
497
|
};
|
|
496
498
|
return MunicipalitySearch;
|
|
497
499
|
}(React.Component));
|
|
498
500
|
var Icon = styled.i(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: ", ";\n position: absolute;\n top: 50%;\n ", "\n padding-left: 0.8em;\n transform: translateY(-50%);\n display: flex;\n opacity: 0.5;\n transition: opacity 0.5s ease-in-out;\n animation: fromLeft 0.3s ease-in-out;\n @keyframes fromLeft {\n 0% {\n transform: translateY(-50%) translateX(-10px);\n opacity: 0;\n }\n 100% {\n transform: translateY(-50%) translateX(0);\n }\n }\n &#search-closing-icon {\n &:hover {\n opacity: 1;\n }\n animation: fromRight 0.3s ease-in-out;\n @keyframes fromRight {\n 0% {\n transform: translateY(-50%) translateX(10px);\n opacity: 0;\n }\n 100% {\n transform: translateY(-50%) translateX(0);\n }\n }\n }\n"], ["\n cursor: ", ";\n position: absolute;\n top: 50%;\n ", "\n padding-left: 0.8em;\n transform: translateY(-50%);\n display: flex;\n opacity: 0.5;\n transition: opacity 0.5s ease-in-out;\n animation: fromLeft 0.3s ease-in-out;\n @keyframes fromLeft {\n 0% {\n transform: translateY(-50%) translateX(-10px);\n opacity: 0;\n }\n 100% {\n transform: translateY(-50%) translateX(0);\n }\n }\n &#search-closing-icon {\n &:hover {\n opacity: 1;\n }\n animation: fromRight 0.3s ease-in-out;\n @keyframes fromRight {\n 0% {\n transform: translateY(-50%) translateX(10px);\n opacity: 0;\n }\n 100% {\n transform: translateY(-50%) translateX(0);\n }\n }\n }\n"])), function (props) { return (props.$isClickable ? 'pointer' : 'default'); }, function (props) { return (props.$isRight ? 'right: 0; padding-right: 0.8em;' : ''); });
|
|
499
501
|
var MunicipalitySearchContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n --border-radius: 0.3em;\n font-size: 18px;\n font-family: var(--font-plex);\n @media screen and (max-width: 599px) {\n max-width: 100%;\n }\n max-width: 300px;\n width: 100%;\n color: inherit;\n position: relative;\n"], ["\n --border-radius: 0.3em;\n font-size: 18px;\n font-family: var(--font-plex);\n @media screen and (max-width: 599px) {\n max-width: 100%;\n }\n max-width: 300px;\n width: 100%;\n color: inherit;\n position: relative;\n"])));
|
|
500
502
|
var InputRow = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: center;\n input:focus ~ i {\n opacity: 1;\n }\n .ui.input {\n width: 100%;\n max-width: 100%;\n transition: all 0.5s ease-in-out;\n }\n"], ["\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: center;\n input:focus ~ i {\n opacity: 1;\n }\n .ui.input {\n width: 100%;\n max-width: 100%;\n transition: all 0.5s ease-in-out;\n }\n"])));
|
|
501
|
-
var FlexInput = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n // reset the default input styles\n color: inherit;\n background-color: ", ";\n border: solid 1px #7e7e7e7e;\n border-radius: var(--border-radius);\n box-shadow: none;\n font-size: 1em;\n outline: none;\n transition: all 0.3s ease-in-out;\n padding: 0.5em;\n padding-left: ", ";\n margin: 0;\n width: 100%;\n display: flex;\n &:disabled {\n opacity: 0.5;\n }\n &::placeholder {\n color: inherit;\n opacity: 0.5;\n }\n"], ["\n // reset the default input styles\n color: inherit;\n background-color: ",
|
|
502
|
-
";\n border: solid 1px #7e7e7e7e;\n border-radius: var(--border-radius);\n box-shadow: none;\n font-size: 1em;\n outline: none;\n transition: all 0.3s ease-in-out;\n padding: 0.5em;\n padding-left: ",
|
|
503
|
-
";\n margin: 0;\n width: 100%;\n display: flex;\n &:disabled {\n opacity: 0.5;\n }\n &::placeholder {\n color: inherit;\n opacity: 0.5;\n }\n"])), function (_a) {
|
|
503
|
+
var FlexInput = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n // reset the default input styles\n color: inherit;\n background-color: ", ";\n border: solid 1px #7e7e7e7e;\n border-radius: var(--border-radius);\n box-shadow: none;\n font-size: 1em;\n outline: none;\n transition: all 0.3s ease-in-out;\n padding: 0.5em;\n padding-left: ", ";\n margin: 0;\n width: 100%;\n display: flex;\n &:disabled {\n opacity: 0.5;\n }\n &::placeholder {\n color: inherit;\n opacity: 0.5;\n }\n"], ["\n // reset the default input styles\n color: inherit;\n background-color: ", ";\n border: solid 1px #7e7e7e7e;\n border-radius: var(--border-radius);\n box-shadow: none;\n font-size: 1em;\n outline: none;\n transition: all 0.3s ease-in-out;\n padding: 0.5em;\n padding-left: ", ";\n margin: 0;\n width: 100%;\n display: flex;\n &:disabled {\n opacity: 0.5;\n }\n &::placeholder {\n color: inherit;\n opacity: 0.5;\n }\n"])), function (_a) {
|
|
504
504
|
var backgroundColor = _a.$backgroundColor;
|
|
505
505
|
return backgroundColor;
|
|
506
506
|
}, function (_a) {
|
|
507
507
|
var lessPaddingLeft = _a.$lessPaddingLeft;
|
|
508
508
|
return lessPaddingLeft ? '1em' : '2.4em';
|
|
509
509
|
});
|
|
510
|
-
var Results = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-top: 0.25em;\n display: grid;\n grid-template-columns: 1fr;\n grid-gap: 0;\n font-family: var(--font-plex);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n position: absolute;\n background-color: ", ";\n width: 100%;\n border-radius: var(--border-radius);\n @media screen and (min-width: 599px) {\n max-width: 300px;\n }\n .result {\n max-width: 100%;\n color: currentColor;\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: var(--border-radius);\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n //border: 1px solid #007abf;\n color: inherit;\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n &:hover,\n &:focus {\n box-shadow:\n 0 0 0.5ex rgba(0, 0, 0, 0.2),\n 0 0 0 1px #007abf inset;\n }\n }\n"], ["\n margin-top: 0.25em;\n display: grid;\n grid-template-columns: 1fr;\n grid-gap: 0;\n font-family: var(--font-plex);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n position: absolute;\n background-color: ",
|
|
511
|
-
";\n width: 100%;\n border-radius: var(--border-radius);\n @media screen and (min-width: 599px) {\n max-width: 300px;\n }\n .result {\n max-width: 100%;\n color: currentColor;\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: var(--border-radius);\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n //border: 1px solid #007abf;\n color: inherit;\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n &:hover,\n &:focus {\n box-shadow:\n 0 0 0.5ex rgba(0, 0, 0, 0.2),\n 0 0 0 1px #007abf inset;\n }\n }\n"])), function (_a) {
|
|
510
|
+
var Results = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-top: 0.25em;\n display: grid;\n grid-template-columns: 1fr;\n grid-gap: 0;\n font-family: var(--font-plex);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n position: absolute;\n background-color: ", ";\n width: 100%;\n border-radius: var(--border-radius);\n @media screen and (min-width: 599px) {\n max-width: 300px;\n }\n .result {\n max-width: 100%;\n color: currentColor;\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: var(--border-radius);\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n //border: 1px solid #007abf;\n color: inherit;\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n &:hover,\n &:focus {\n box-shadow:\n 0 0 0.5ex rgba(0, 0, 0, 0.2),\n 0 0 0 1px #007abf inset;\n }\n }\n"], ["\n margin-top: 0.25em;\n display: grid;\n grid-template-columns: 1fr;\n grid-gap: 0;\n font-family: var(--font-plex);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n position: absolute;\n background-color: ", ";\n width: 100%;\n border-radius: var(--border-radius);\n @media screen and (min-width: 599px) {\n max-width: 300px;\n }\n .result {\n max-width: 100%;\n color: currentColor;\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: var(--border-radius);\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n //border: 1px solid #007abf;\n color: inherit;\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n &:hover,\n &:focus {\n box-shadow:\n 0 0 0.5ex rgba(0, 0, 0, 0.2),\n 0 0 0 1px #007abf inset;\n }\n }\n"])), function (_a) {
|
|
512
511
|
var backgroundColor = _a.$backgroundColor;
|
|
513
512
|
return backgroundColor;
|
|
514
513
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -10,6 +10,7 @@ interface Municipality {
|
|
|
10
10
|
readonly NORMGEMEINDE: string;
|
|
11
11
|
readonly URL?: string;
|
|
12
12
|
timestamp?: number;
|
|
13
|
+
[x: string]: any;
|
|
13
14
|
}
|
|
14
15
|
export type { Municipality };
|
|
15
16
|
export interface Props {
|
|
@@ -29,6 +30,7 @@ export interface Props {
|
|
|
29
30
|
onCloseHandler?: () => void;
|
|
30
31
|
inputBackgroundColor?: string;
|
|
31
32
|
resultBackgroundColor?: string;
|
|
33
|
+
propertyToSearch?: keyof Municipality;
|
|
32
34
|
}
|
|
33
35
|
interface State {
|
|
34
36
|
isLoading: boolean;
|
|
@@ -45,6 +47,7 @@ export declare class MunicipalitySearch extends Component<Props, State> {
|
|
|
45
47
|
resultBackgroundColor: string;
|
|
46
48
|
inputBackgroundColor: string;
|
|
47
49
|
maxResults: number;
|
|
50
|
+
propertyToSearch: string;
|
|
48
51
|
};
|
|
49
52
|
state: {
|
|
50
53
|
isLoading: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"municipalitySearch.d.ts","sourceRoot":"","sources":["../src/municipalitySearch.tsx"],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AC,kBAAkB,CAezB;IAOD,OAAO,CAAC,kBAAkB,CAgBzB;IAKD,OAAO,CAAC,uBAAuB,CAkC9B;IAOD,OAAO,CAAC,4BAA4B,CAwBnC;IAQD,OAAO,CAAC,4BAA4B,CA6BnC;IAED,OAAO,CAAC,qBAAqB,CAiD5B;IAEM,kBAAkB,CAAC,SAAS,EAAE,KAAK;IAO1C,OAAO,CAAC,YAAY;IAIb,iBAAiB;IA2CjB,MAAM;CA8Id"}
|
package/es/index.js
CHANGED
|
@@ -17,7 +17,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
17
17
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
18
18
|
PERFORMANCE OF THIS SOFTWARE.
|
|
19
19
|
***************************************************************************** */
|
|
20
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
20
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
21
21
|
|
|
22
22
|
var extendStatics = function(d, b) {
|
|
23
23
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -169,7 +169,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
else if (startsWithNumber.test(searchTerm)) {
|
|
172
|
-
results = municipalities.filter(function (municipality) { var _a; return RegExp("^"
|
|
172
|
+
results = municipalities.filter(function (municipality) { var _a; return RegExp("^".concat(searchTerm)).test(((_a = municipality.PLZ4) !== null && _a !== void 0 ? _a : '').toString()); });
|
|
173
173
|
if (results.length < 1) {
|
|
174
174
|
_this.setState({ error: 'error.noResultsByZip' });
|
|
175
175
|
}
|
|
@@ -177,11 +177,12 @@ var MunicipalitySearch = (function (_super) {
|
|
|
177
177
|
else if (containsOnlyLetters.test(searchTerm)) {
|
|
178
178
|
var sanitizedSearchTerm = searchTerm.replace('.', '\\.');
|
|
179
179
|
var r_1 = RegExp(sanitizedSearchTerm, 'i');
|
|
180
|
-
var exactWordRegex_1 = RegExp("\\b"
|
|
180
|
+
var exactWordRegex_1 = RegExp("\\b".concat(sanitizedSearchTerm, "\\b"), 'i');
|
|
181
181
|
var rankResults = function (searchTerm, arrayToSort) {
|
|
182
182
|
return arrayToSort.sort(function (a, b) {
|
|
183
|
-
var
|
|
184
|
-
var
|
|
183
|
+
var _a, _b;
|
|
184
|
+
var aScore = scoreResult_1(searchTerm.toLowerCase(), a[(_a = _this.props.propertyToSearch) !== null && _a !== void 0 ? _a : MunicipalitySearch.defaultProps.propertyToSearch].toLowerCase());
|
|
185
|
+
var bScore = scoreResult_1(searchTerm.toLowerCase(), b[(_b = _this.props.propertyToSearch) !== null && _b !== void 0 ? _b : MunicipalitySearch.defaultProps.propertyToSearch].toLowerCase());
|
|
185
186
|
return bScore - aScore;
|
|
186
187
|
});
|
|
187
188
|
};
|
|
@@ -196,7 +197,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
196
197
|
return 0;
|
|
197
198
|
}
|
|
198
199
|
};
|
|
199
|
-
var notExactMatches = municipalities.filter(function (municipality) { return r_1.test(municipality.
|
|
200
|
+
var notExactMatches = municipalities.filter(function (municipality) { var _a; return r_1.test(municipality[(_a = _this.props.propertyToSearch) !== null && _a !== void 0 ? _a : MunicipalitySearch.defaultProps.propertyToSearch]); });
|
|
200
201
|
results = rankResults(sanitizedSearchTerm, notExactMatches).slice(0, _this.props.maxResults);
|
|
201
202
|
if (results.length < 1) {
|
|
202
203
|
_this.setState({ error: 'error.noResultsByName' });
|
|
@@ -206,7 +207,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
206
207
|
window.dataLayer.push({
|
|
207
208
|
event: 'Interactions',
|
|
208
209
|
event_action: 'input',
|
|
209
|
-
event_label: "search:for_"
|
|
210
|
+
event_label: "search:for_".concat(searchTerm, ":results_").concat(results.length),
|
|
210
211
|
});
|
|
211
212
|
}
|
|
212
213
|
return _this.removeDuplicates(results, searchTerm);
|
|
@@ -260,7 +261,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
260
261
|
console.log(e);
|
|
261
262
|
console.warn('🍪 cookies of selectedMunicipalities is not available');
|
|
262
263
|
}
|
|
263
|
-
var ordered = __spreadArray(__spreadArray([], __read(munisFromLocalStorage)), __read(munisFromCookies)).sort(function (a, b) {
|
|
264
|
+
var ordered = __spreadArray(__spreadArray([], __read(munisFromLocalStorage), false), __read(munisFromCookies), false).sort(function (a, b) {
|
|
264
265
|
if (b.timestamp && a.timestamp) {
|
|
265
266
|
return b.timestamp - a.timestamp;
|
|
266
267
|
}
|
|
@@ -304,7 +305,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
304
305
|
(_this.props.dedupe ? '' : muni.PLZ4),
|
|
305
306
|
muni,
|
|
306
307
|
];
|
|
307
|
-
})).values())).reverse()
|
|
308
|
+
})).values()), false).reverse()
|
|
308
309
|
.sort(function (a, b) {
|
|
309
310
|
if (b.timestamp && a.timestamp) {
|
|
310
311
|
return b.timestamp - a.timestamp;
|
|
@@ -333,10 +334,10 @@ var MunicipalitySearch = (function (_super) {
|
|
|
333
334
|
var API_BASE_URL = useLegacy
|
|
334
335
|
? 'https://interaktiv.tagesanzeiger.ch/static/gemeindesuche/'
|
|
335
336
|
: 'https://atm-municipality-search.s3.eu-west-1.amazonaws.com/';
|
|
336
|
-
return fetch(API_BASE_URL + (_this.props.municipalityData
|
|
337
|
+
return fetch(API_BASE_URL + "".concat(_this.props.municipalityData, ".json"))
|
|
337
338
|
.then(function (res) {
|
|
338
339
|
if (!res.ok) {
|
|
339
|
-
throw new MunicipalityDownloadError("Download error: "
|
|
340
|
+
throw new MunicipalityDownloadError("Download error: ".concat(res.status, ": ").concat(res.statusText, "."));
|
|
340
341
|
}
|
|
341
342
|
return res.json();
|
|
342
343
|
})
|
|
@@ -378,7 +379,7 @@ var MunicipalitySearch = (function (_super) {
|
|
|
378
379
|
map.set(((_b = v.PLZ4) !== null && _b !== void 0 ? _b : '') + ((_c = v.ORTNAME) !== null && _c !== void 0 ? _c : '') + v.GDENR, v);
|
|
379
380
|
}
|
|
380
381
|
});
|
|
381
|
-
var result = __spreadArray([], __read(map.values())).reduce(function (acc, cur) {
|
|
382
|
+
var result = __spreadArray([], __read(map.values()), false).reduce(function (acc, cur) {
|
|
382
383
|
var _a, _b;
|
|
383
384
|
if (((_a = cur.GDENAMK) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === searchTerm.toLowerCase() ||
|
|
384
385
|
((_b = cur.ORTNAME) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === searchTerm.toLowerCase()) {
|
|
@@ -488,23 +489,21 @@ var MunicipalitySearch = (function (_super) {
|
|
|
488
489
|
resultBackgroundColor: 'var(--site-background)',
|
|
489
490
|
inputBackgroundColor: 'var(--site-background)',
|
|
490
491
|
maxResults: 10,
|
|
492
|
+
propertyToSearch: "NORMGEMEINDE"
|
|
491
493
|
};
|
|
492
494
|
return MunicipalitySearch;
|
|
493
495
|
}(Component));
|
|
494
496
|
var Icon = styled.i(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n cursor: ", ";\n position: absolute;\n top: 50%;\n ", "\n padding-left: 0.8em;\n transform: translateY(-50%);\n display: flex;\n opacity: 0.5;\n transition: opacity 0.5s ease-in-out;\n animation: fromLeft 0.3s ease-in-out;\n @keyframes fromLeft {\n 0% {\n transform: translateY(-50%) translateX(-10px);\n opacity: 0;\n }\n 100% {\n transform: translateY(-50%) translateX(0);\n }\n }\n &#search-closing-icon {\n &:hover {\n opacity: 1;\n }\n animation: fromRight 0.3s ease-in-out;\n @keyframes fromRight {\n 0% {\n transform: translateY(-50%) translateX(10px);\n opacity: 0;\n }\n 100% {\n transform: translateY(-50%) translateX(0);\n }\n }\n }\n"], ["\n cursor: ", ";\n position: absolute;\n top: 50%;\n ", "\n padding-left: 0.8em;\n transform: translateY(-50%);\n display: flex;\n opacity: 0.5;\n transition: opacity 0.5s ease-in-out;\n animation: fromLeft 0.3s ease-in-out;\n @keyframes fromLeft {\n 0% {\n transform: translateY(-50%) translateX(-10px);\n opacity: 0;\n }\n 100% {\n transform: translateY(-50%) translateX(0);\n }\n }\n &#search-closing-icon {\n &:hover {\n opacity: 1;\n }\n animation: fromRight 0.3s ease-in-out;\n @keyframes fromRight {\n 0% {\n transform: translateY(-50%) translateX(10px);\n opacity: 0;\n }\n 100% {\n transform: translateY(-50%) translateX(0);\n }\n }\n }\n"])), function (props) { return (props.$isClickable ? 'pointer' : 'default'); }, function (props) { return (props.$isRight ? 'right: 0; padding-right: 0.8em;' : ''); });
|
|
495
497
|
var MunicipalitySearchContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n --border-radius: 0.3em;\n font-size: 18px;\n font-family: var(--font-plex);\n @media screen and (max-width: 599px) {\n max-width: 100%;\n }\n max-width: 300px;\n width: 100%;\n color: inherit;\n position: relative;\n"], ["\n --border-radius: 0.3em;\n font-size: 18px;\n font-family: var(--font-plex);\n @media screen and (max-width: 599px) {\n max-width: 100%;\n }\n max-width: 300px;\n width: 100%;\n color: inherit;\n position: relative;\n"])));
|
|
496
498
|
var InputRow = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: center;\n input:focus ~ i {\n opacity: 1;\n }\n .ui.input {\n width: 100%;\n max-width: 100%;\n transition: all 0.5s ease-in-out;\n }\n"], ["\n position: relative;\n display: flex;\n flex-direction: row;\n align-items: center;\n input:focus ~ i {\n opacity: 1;\n }\n .ui.input {\n width: 100%;\n max-width: 100%;\n transition: all 0.5s ease-in-out;\n }\n"])));
|
|
497
|
-
var FlexInput = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n // reset the default input styles\n color: inherit;\n background-color: ", ";\n border: solid 1px #7e7e7e7e;\n border-radius: var(--border-radius);\n box-shadow: none;\n font-size: 1em;\n outline: none;\n transition: all 0.3s ease-in-out;\n padding: 0.5em;\n padding-left: ", ";\n margin: 0;\n width: 100%;\n display: flex;\n &:disabled {\n opacity: 0.5;\n }\n &::placeholder {\n color: inherit;\n opacity: 0.5;\n }\n"], ["\n // reset the default input styles\n color: inherit;\n background-color: ",
|
|
498
|
-
";\n border: solid 1px #7e7e7e7e;\n border-radius: var(--border-radius);\n box-shadow: none;\n font-size: 1em;\n outline: none;\n transition: all 0.3s ease-in-out;\n padding: 0.5em;\n padding-left: ",
|
|
499
|
-
";\n margin: 0;\n width: 100%;\n display: flex;\n &:disabled {\n opacity: 0.5;\n }\n &::placeholder {\n color: inherit;\n opacity: 0.5;\n }\n"])), function (_a) {
|
|
499
|
+
var FlexInput = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n // reset the default input styles\n color: inherit;\n background-color: ", ";\n border: solid 1px #7e7e7e7e;\n border-radius: var(--border-radius);\n box-shadow: none;\n font-size: 1em;\n outline: none;\n transition: all 0.3s ease-in-out;\n padding: 0.5em;\n padding-left: ", ";\n margin: 0;\n width: 100%;\n display: flex;\n &:disabled {\n opacity: 0.5;\n }\n &::placeholder {\n color: inherit;\n opacity: 0.5;\n }\n"], ["\n // reset the default input styles\n color: inherit;\n background-color: ", ";\n border: solid 1px #7e7e7e7e;\n border-radius: var(--border-radius);\n box-shadow: none;\n font-size: 1em;\n outline: none;\n transition: all 0.3s ease-in-out;\n padding: 0.5em;\n padding-left: ", ";\n margin: 0;\n width: 100%;\n display: flex;\n &:disabled {\n opacity: 0.5;\n }\n &::placeholder {\n color: inherit;\n opacity: 0.5;\n }\n"])), function (_a) {
|
|
500
500
|
var backgroundColor = _a.$backgroundColor;
|
|
501
501
|
return backgroundColor;
|
|
502
502
|
}, function (_a) {
|
|
503
503
|
var lessPaddingLeft = _a.$lessPaddingLeft;
|
|
504
504
|
return lessPaddingLeft ? '1em' : '2.4em';
|
|
505
505
|
});
|
|
506
|
-
var Results = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-top: 0.25em;\n display: grid;\n grid-template-columns: 1fr;\n grid-gap: 0;\n font-family: var(--font-plex);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n position: absolute;\n background-color: ", ";\n width: 100%;\n border-radius: var(--border-radius);\n @media screen and (min-width: 599px) {\n max-width: 300px;\n }\n .result {\n max-width: 100%;\n color: currentColor;\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: var(--border-radius);\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n //border: 1px solid #007abf;\n color: inherit;\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n &:hover,\n &:focus {\n box-shadow:\n 0 0 0.5ex rgba(0, 0, 0, 0.2),\n 0 0 0 1px #007abf inset;\n }\n }\n"], ["\n margin-top: 0.25em;\n display: grid;\n grid-template-columns: 1fr;\n grid-gap: 0;\n font-family: var(--font-plex);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n position: absolute;\n background-color: ",
|
|
507
|
-
";\n width: 100%;\n border-radius: var(--border-radius);\n @media screen and (min-width: 599px) {\n max-width: 300px;\n }\n .result {\n max-width: 100%;\n color: currentColor;\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: var(--border-radius);\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n //border: 1px solid #007abf;\n color: inherit;\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n &:hover,\n &:focus {\n box-shadow:\n 0 0 0.5ex rgba(0, 0, 0, 0.2),\n 0 0 0 1px #007abf inset;\n }\n }\n"])), function (_a) {
|
|
506
|
+
var Results = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-top: 0.25em;\n display: grid;\n grid-template-columns: 1fr;\n grid-gap: 0;\n font-family: var(--font-plex);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n position: absolute;\n background-color: ", ";\n width: 100%;\n border-radius: var(--border-radius);\n @media screen and (min-width: 599px) {\n max-width: 300px;\n }\n .result {\n max-width: 100%;\n color: currentColor;\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: var(--border-radius);\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n //border: 1px solid #007abf;\n color: inherit;\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n &:hover,\n &:focus {\n box-shadow:\n 0 0 0.5ex rgba(0, 0, 0, 0.2),\n 0 0 0 1px #007abf inset;\n }\n }\n"], ["\n margin-top: 0.25em;\n display: grid;\n grid-template-columns: 1fr;\n grid-gap: 0;\n font-family: var(--font-plex);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n position: absolute;\n background-color: ", ";\n width: 100%;\n border-radius: var(--border-radius);\n @media screen and (min-width: 599px) {\n max-width: 300px;\n }\n .result {\n max-width: 100%;\n color: currentColor;\n padding: calc(11 / 16 * 1em) calc(14 / 16 * 1em);\n border-radius: var(--border-radius);\n box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);\n //border: 1px solid #007abf;\n color: inherit;\n line-height: 1.1em;\n cursor: pointer;\n transition: box-shadow 200ms ease-in-out;\n &:hover,\n &:focus {\n box-shadow:\n 0 0 0.5ex rgba(0, 0, 0, 0.2),\n 0 0 0 1px #007abf inset;\n }\n }\n"])), function (_a) {
|
|
508
507
|
var backgroundColor = _a.$backgroundColor;
|
|
509
508
|
return backgroundColor;
|
|
510
509
|
});
|
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -10,6 +10,7 @@ interface Municipality {
|
|
|
10
10
|
readonly NORMGEMEINDE: string;
|
|
11
11
|
readonly URL?: string;
|
|
12
12
|
timestamp?: number;
|
|
13
|
+
[x: string]: any;
|
|
13
14
|
}
|
|
14
15
|
export type { Municipality };
|
|
15
16
|
export interface Props {
|
|
@@ -29,6 +30,7 @@ export interface Props {
|
|
|
29
30
|
onCloseHandler?: () => void;
|
|
30
31
|
inputBackgroundColor?: string;
|
|
31
32
|
resultBackgroundColor?: string;
|
|
33
|
+
propertyToSearch?: keyof Municipality;
|
|
32
34
|
}
|
|
33
35
|
interface State {
|
|
34
36
|
isLoading: boolean;
|
|
@@ -45,6 +47,7 @@ export declare class MunicipalitySearch extends Component<Props, State> {
|
|
|
45
47
|
resultBackgroundColor: string;
|
|
46
48
|
inputBackgroundColor: string;
|
|
47
49
|
maxResults: number;
|
|
50
|
+
propertyToSearch: string;
|
|
48
51
|
};
|
|
49
52
|
state: {
|
|
50
53
|
isLoading: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"municipalitySearch.d.ts","sourceRoot":"","sources":["../src/municipalitySearch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAe,SAAS,EAAE,MAAM,OAAO,CAAA;AAkBpD,UAAU,YAAY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D,OAAO,CAAC,4BAA4B,CAwBnC;IAQD,OAAO,CAAC,4BAA4B,CA6BnC;IAED,OAAO,CAAC,qBAAqB,CAiD5B;IAEM,kBAAkB,CAAC,SAAS,EAAE,KAAK;IAO1C,OAAO,CAAC,YAAY;IAIb,iBAAiB;IA2CjB,MAAM;CA8Id"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ta-interaktiv/react-municipality-search",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "React component that allows searching for Swiss municipalities with either ZIP code or place names.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -51,6 +51,5 @@
|
|
|
51
51
|
"react": ">=16.8.0",
|
|
52
52
|
"react-dom": ">=16.8.0",
|
|
53
53
|
"styled-components": "^6.1.1"
|
|
54
|
-
}
|
|
55
|
-
"gitHead": "472138f1b5b382cb1d356fa7240c3e8f9c07026d"
|
|
54
|
+
}
|
|
56
55
|
}
|
|
@@ -28,6 +28,7 @@ interface LocalisedMessagesList {
|
|
|
28
28
|
readonly NORMGEMEINDE: string
|
|
29
29
|
readonly URL?: string
|
|
30
30
|
timestamp?: number
|
|
31
|
+
[x: string]: any
|
|
31
32
|
}
|
|
32
33
|
export type { Municipality }
|
|
33
34
|
export interface Props {
|
|
@@ -79,6 +80,9 @@ export interface Props {
|
|
|
79
80
|
|
|
80
81
|
/** result background color */
|
|
81
82
|
resultBackgroundColor?: string
|
|
83
|
+
|
|
84
|
+
/** property on your municipality you want to search for. The value of this key MUST be a string */
|
|
85
|
+
propertyToSearch?: keyof Municipality
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
interface State {
|
|
@@ -163,6 +167,7 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
163
167
|
resultBackgroundColor: 'var(--site-background)',
|
|
164
168
|
inputBackgroundColor: 'var(--site-background)',
|
|
165
169
|
maxResults: 10,
|
|
170
|
+
propertyToSearch: "NORMGEMEINDE"
|
|
166
171
|
}
|
|
167
172
|
|
|
168
173
|
public state = {
|
|
@@ -225,11 +230,11 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
225
230
|
return arrayToSort.sort((a, b) => {
|
|
226
231
|
const aScore = scoreResult(
|
|
227
232
|
searchTerm.toLowerCase(),
|
|
228
|
-
a.
|
|
233
|
+
a[this.props.propertyToSearch ?? MunicipalitySearch.defaultProps.propertyToSearch].toLowerCase(),
|
|
229
234
|
)
|
|
230
235
|
const bScore = scoreResult(
|
|
231
236
|
searchTerm.toLowerCase(),
|
|
232
|
-
b.
|
|
237
|
+
b[this.props.propertyToSearch ?? MunicipalitySearch.defaultProps.propertyToSearch].toLowerCase(),
|
|
233
238
|
)
|
|
234
239
|
return bScore - aScore
|
|
235
240
|
})
|
|
@@ -245,7 +250,7 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
245
250
|
}
|
|
246
251
|
}
|
|
247
252
|
const notExactMatches = municipalities.filter(
|
|
248
|
-
(municipality: Municipality) => r.test(municipality.
|
|
253
|
+
(municipality: Municipality) => r.test(municipality[this.props.propertyToSearch ?? MunicipalitySearch.defaultProps.propertyToSearch]),
|
|
249
254
|
)
|
|
250
255
|
// We need to sort the results by relevance so "bern" is higher ranked than "berneck"
|
|
251
256
|
results = rankResults(sanitizedSearchTerm, notExactMatches).slice(
|
package/CHANGELOG.md
DELETED
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [2.1.4](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@2.1.3...@ta-interaktiv/react-municipality-search@2.1.4) (2024-05-27)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* don't show plz when plz empty ([0e52030](https://gitlab.com/ta-interaktiv/packages/commit/0e52030f54ba4e745a008cc026711d8c9d8750e3))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## [2.1.3](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@2.1.2...@ta-interaktiv/react-municipality-search@2.1.3) (2024-05-21)
|
|
18
|
-
|
|
19
|
-
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## [2.1.2](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@2.1.1...@ta-interaktiv/react-municipality-search@2.1.2) (2024-05-21)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
### Bug Fixes
|
|
29
|
-
|
|
30
|
-
* bring this repo to the 21st century ([38af4bf](https://gitlab.com/ta-interaktiv/packages/commit/38af4bfe550eb6ced0410012153e5a69e7fcb0d7))
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
## [2.1.1](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@2.1.0...@ta-interaktiv/react-municipality-search@2.1.1) (2024-02-19)
|
|
37
|
-
|
|
38
|
-
### Bug Fixes
|
|
39
|
-
|
|
40
|
-
- able to search for wil ([92dd8e5](https://gitlab.com/ta-interaktiv/packages/commit/92dd8e59158c935e49c0d9aaeefb8156c377bdff))
|
|
41
|
-
|
|
42
|
-
# [2.1.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@2.0.0...@ta-interaktiv/react-municipality-search@2.1.0) (2023-11-08)
|
|
43
|
-
|
|
44
|
-
### Features
|
|
45
|
-
|
|
46
|
-
- selectedMunicipalityId ([ea50af2](https://gitlab.com/ta-interaktiv/packages/commit/ea50af2b76a6fe1dc82c334b9911c7013e0f5245))
|
|
47
|
-
|
|
48
|
-
# [2.0.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.11.3...@ta-interaktiv/react-municipality-search@2.0.0) (2023-11-08)
|
|
49
|
-
|
|
50
|
-
### Features
|
|
51
|
-
|
|
52
|
-
- upgrade to latest styled-components version ([a27639a](https://gitlab.com/ta-interaktiv/packages/commit/a27639a387a1188d5090b21e4d97f1f1815afc6b))
|
|
53
|
-
|
|
54
|
-
### BREAKING CHANGES
|
|
55
|
-
|
|
56
|
-
- new version of styled-components
|
|
57
|
-
|
|
58
|
-
## [1.11.3](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.11.2...@ta-interaktiv/react-municipality-search@1.11.3) (2023-11-02)
|
|
59
|
-
|
|
60
|
-
### Bug Fixes
|
|
61
|
-
|
|
62
|
-
- results same width as search ([e19a2e7](https://gitlab.com/ta-interaktiv/packages/commit/e19a2e7da39b4cca0f9301754aa0e49854b9b6d8))
|
|
63
|
-
|
|
64
|
-
## [1.11.2](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.11.1...@ta-interaktiv/react-municipality-search@1.11.2) (2023-11-02)
|
|
65
|
-
|
|
66
|
-
### Bug Fixes
|
|
67
|
-
|
|
68
|
-
- mobile removode flex column ([b7a91d5](https://gitlab.com/ta-interaktiv/packages/commit/b7a91d524a08de824358c593954f131d13dbd552))
|
|
69
|
-
|
|
70
|
-
## [1.11.1](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.11.0...@ta-interaktiv/react-municipality-search@1.11.1) (2023-11-02)
|
|
71
|
-
|
|
72
|
-
### Bug Fixes
|
|
73
|
-
|
|
74
|
-
- last selected munis for nozip ([cf680fd](https://gitlab.com/ta-interaktiv/packages/commit/cf680fda03321d45413748c5cc1587cd95e04e1a))
|
|
75
|
-
|
|
76
|
-
# [1.11.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.10.0...@ta-interaktiv/react-municipality-search@1.11.0) (2023-11-01)
|
|
77
|
-
|
|
78
|
-
### Bug Fixes
|
|
79
|
-
|
|
80
|
-
- typo ([5b5e922](https://gitlab.com/ta-interaktiv/packages/commit/5b5e922291b35aed88f8619f33ffbf5f1abfadc2))
|
|
81
|
-
|
|
82
|
-
### Features
|
|
83
|
-
|
|
84
|
-
- removed deps and better style ([dcfea21](https://gitlab.com/ta-interaktiv/packages/commit/dcfea210dfcc2f5d72d82699c59bc1d042098f3c))
|
|
85
|
-
|
|
86
|
-
# [1.10.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.9.3...@ta-interaktiv/react-municipality-search@1.10.0) (2023-10-31)
|
|
87
|
-
|
|
88
|
-
### Features
|
|
89
|
-
|
|
90
|
-
- municipalitysearch with municipalities only ([4336e3e](https://gitlab.com/ta-interaktiv/packages/commit/4336e3ebd6e8a1718a9d09d437a9fd7842eafe89))
|
|
91
|
-
|
|
92
|
-
## [1.9.3](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.9.2...@ta-interaktiv/react-municipality-search@1.9.3) (2023-04-18)
|
|
93
|
-
|
|
94
|
-
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
95
|
-
|
|
96
|
-
## [1.9.2](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.9.1...@ta-interaktiv/react-municipality-search@1.9.2) (2023-02-27)
|
|
97
|
-
|
|
98
|
-
### Bug Fixes
|
|
99
|
-
|
|
100
|
-
- downgrade react-spring ([cc66923](https://gitlab.com/ta-interaktiv/packages/commit/cc66923dc36e08ae060a781694006ce60618be05))
|
|
101
|
-
|
|
102
|
-
## [1.9.1](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.9.0...@ta-interaktiv/react-municipality-search@1.9.1) (2023-02-27)
|
|
103
|
-
|
|
104
|
-
### Bug Fixes
|
|
105
|
-
|
|
106
|
-
- updated react spring ([639fbe5](https://gitlab.com/ta-interaktiv/packages/commit/639fbe57e366bfb302e5f7a3b01b0ca6246102a6))
|
|
107
|
-
|
|
108
|
-
# [1.9.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.8.1...@ta-interaktiv/react-municipality-search@1.9.0) (2023-02-14)
|
|
109
|
-
|
|
110
|
-
### Features
|
|
111
|
-
|
|
112
|
-
- use new atm jsons if available ([70d5dae](https://gitlab.com/ta-interaktiv/packages/commit/70d5daed5294787f0fdf4c02bb94b440b1cfa7d6))
|
|
113
|
-
|
|
114
|
-
## [1.8.1](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.8.0...@ta-interaktiv/react-municipality-search@1.8.1) (2022-10-24)
|
|
115
|
-
|
|
116
|
-
### Bug Fixes
|
|
117
|
-
|
|
118
|
-
- changed boldness ([ef331e0](https://gitlab.com/ta-interaktiv/packages/commit/ef331e0ac5346f5b5c36b1e6215f5cf3231897e9))
|
|
119
|
-
|
|
120
|
-
# [1.8.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.7.1...@ta-interaktiv/react-municipality-search@1.8.0) (2022-10-17)
|
|
121
|
-
|
|
122
|
-
### Features
|
|
123
|
-
|
|
124
|
-
- maxResults and icon on right side ([bd3a029](https://gitlab.com/ta-interaktiv/packages/commit/bd3a0295517f6dae73015fc1fb7c5a8634a388d3))
|
|
125
|
-
|
|
126
|
-
## [1.7.1](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.7.0...@ta-interaktiv/react-municipality-search@1.7.1) (2022-09-20)
|
|
127
|
-
|
|
128
|
-
### Bug Fixes
|
|
129
|
-
|
|
130
|
-
- get data from cookies ([1a78a15](https://gitlab.com/ta-interaktiv/packages/commit/1a78a154c02f35b5213d1c7430817edf733854ae))
|
|
131
|
-
|
|
132
|
-
# [1.7.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.6.0...@ta-interaktiv/react-municipality-search@1.7.0) (2022-09-20)
|
|
133
|
-
|
|
134
|
-
### Features
|
|
135
|
-
|
|
136
|
-
- add scroller component ([3f854de](https://gitlab.com/ta-interaktiv/packages/commit/3f854deed1bc26c0801e26dafeeff871460bf1f8))
|
|
137
|
-
- cookie support for municipalitySearch ([3afac60](https://gitlab.com/ta-interaktiv/packages/commit/3afac602ad546f478e4de1fea26ee29e9beb7c8d))
|
|
138
|
-
|
|
139
|
-
# [1.6.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.5.4...@ta-interaktiv/react-municipality-search@1.6.0) (2022-08-17)
|
|
140
|
-
|
|
141
|
-
### Features
|
|
142
|
-
|
|
143
|
-
- upgraded most dependencies ⭐️ ([2d16e51](https://gitlab.com/ta-interaktiv/packages/commit/2d16e515bd8ac761eee50477a3ae4ebd78a591a1))
|
|
144
|
-
|
|
145
|
-
## [1.5.4](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.5.3...@ta-interaktiv/react-municipality-search@1.5.4) (2022-06-23)
|
|
146
|
-
|
|
147
|
-
### Bug Fixes
|
|
148
|
-
|
|
149
|
-
- dedupe lastSelected munis & suggeest Fetched munis ([e4b6ddc](https://gitlab.com/ta-interaktiv/packages/commit/e4b6ddc332f3656a92474262146b6e94eb46c522))
|
|
150
|
-
|
|
151
|
-
## [1.5.3](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.5.2...@ta-interaktiv/react-municipality-search@1.5.3) (2022-06-21)
|
|
152
|
-
|
|
153
|
-
### Bug Fixes
|
|
154
|
-
|
|
155
|
-
- municipaltiy search common localStorageName ([dc7439d](https://gitlab.com/ta-interaktiv/packages/commit/dc7439df6a6d7946c3d393f53de2d3cc4e5a0d62))
|
|
156
|
-
|
|
157
|
-
## [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)
|
|
158
|
-
|
|
159
|
-
### Bug Fixes
|
|
160
|
-
|
|
161
|
-
- try to publish ([55709f9](https://gitlab.com/ta-interaktiv/packages/commit/55709f97a752e5753430f8068e2edc858b22a84b))
|
|
162
|
-
|
|
163
|
-
### Reverts
|
|
164
|
-
|
|
165
|
-
- Revert "Publish" ([627f67e](https://gitlab.com/ta-interaktiv/packages/commit/627f67ed0bb983a9213d344c699c6c1518f1a2a7))
|
|
166
|
-
- Revert "Publish" ([5f254e3](https://gitlab.com/ta-interaktiv/packages/commit/5f254e3d553853fa050f2635afc8fa36186b517c))
|
|
167
|
-
|
|
168
|
-
## [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)
|
|
169
|
-
|
|
170
|
-
### Reverts
|
|
171
|
-
|
|
172
|
-
- Revert "Publish" ([627f67e](https://gitlab.com/ta-interaktiv/packages/commit/627f67ed0bb983a9213d344c699c6c1518f1a2a7))
|
|
173
|
-
- Revert "Publish" ([5f254e3](https://gitlab.com/ta-interaktiv/packages/commit/5f254e3d553853fa050f2635afc8fa36186b517c))
|
|
174
|
-
|
|
175
|
-
# [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)
|
|
176
|
-
|
|
177
|
-
### Features
|
|
178
|
-
|
|
179
|
-
- muniSearch refactor to styledComponents ([603fadd](https://gitlab.com/ta-interaktiv/packages/commit/603fadd02ff8280c20eab454d0cae28d88a505ba))
|
|
180
|
-
|
|
181
|
-
## [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)
|
|
182
|
-
|
|
183
|
-
### Bug Fixes
|
|
184
|
-
|
|
185
|
-
- muniSearch switched to css module ([10dbc07](https://gitlab.com/ta-interaktiv/packages/commit/10dbc074f415bdd3fb1d1ab85d47d62eb57b93d5))
|
|
186
|
-
|
|
187
|
-
# [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)
|
|
188
|
-
|
|
189
|
-
### Features
|
|
190
|
-
|
|
191
|
-
- updated to react-spring ^9.4.5 ([2e1c8a1](https://gitlab.com/ta-interaktiv/packages/commit/2e1c8a19acc0963bae2feb563a90286d2e24168c))
|
|
192
|
-
|
|
193
|
-
# [1.3.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.2.2...@ta-interaktiv/react-municipality-search@1.3.0) (2022-04-20)
|
|
194
|
-
|
|
195
|
-
### Bug Fixes
|
|
196
|
-
|
|
197
|
-
- remove console log ([c3e2566](https://gitlab.com/ta-interaktiv/packages/commit/c3e25662da69d3671aade242e8d700a95c259984))
|
|
198
|
-
|
|
199
|
-
### Features
|
|
200
|
-
|
|
201
|
-
- allow new municipalities data retrieval when the date prop is changed ([62e46d4](https://gitlab.com/ta-interaktiv/packages/commit/62e46d4ad710df131b44d8b1554bf89481bbd2b9))
|
|
202
|
-
|
|
203
|
-
## [1.2.2](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.2.1...@ta-interaktiv/react-municipality-search@1.2.2) (2022-04-19)
|
|
204
|
-
|
|
205
|
-
### Bug Fixes
|
|
206
|
-
|
|
207
|
-
- correct order in ms ([44dc573](https://gitlab.com/ta-interaktiv/packages/commit/44dc573c1d4dae990ae3984f4cd9ea901a7f40d9))
|
|
208
|
-
|
|
209
|
-
## [1.2.1](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.2.0...@ta-interaktiv/react-municipality-search@1.2.1) (2022-04-14)
|
|
210
|
-
|
|
211
|
-
### Bug Fixes
|
|
212
|
-
|
|
213
|
-
- show last selected municipalities ([adff1f9](https://gitlab.com/ta-interaktiv/packages/commit/adff1f9ec251be7ee948697dafbaf00ec3703ac9))
|
|
214
|
-
|
|
215
|
-
# [1.2.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.1.3...@ta-interaktiv/react-municipality-search@1.2.0) (2022-02-03)
|
|
216
|
-
|
|
217
|
-
### Features
|
|
218
|
-
|
|
219
|
-
- hideToooltip and resetOnSelect ([f5c1f8f](https://gitlab.com/ta-interaktiv/packages/commit/f5c1f8f9c6d6c86af1b82a995a2d8dcb98a8d87e))
|
|
220
|
-
|
|
221
|
-
## [1.1.3](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.1.2...@ta-interaktiv/react-municipality-search@1.1.3) (2021-09-17)
|
|
222
|
-
|
|
223
|
-
### Bug Fixes
|
|
224
|
-
|
|
225
|
-
- add placeholder prop to municipality search ([08c6fca](https://gitlab.com/ta-interaktiv/packages/commit/08c6fcad43c6197d548c82e81da311f4022de74b))
|
|
226
|
-
|
|
227
|
-
## [1.1.2](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.1.1...@ta-interaktiv/react-municipality-search@1.1.2) (2021-08-19)
|
|
228
|
-
|
|
229
|
-
### Bug Fixes
|
|
230
|
-
|
|
231
|
-
- add PLZ6 to municipality search results ([ec58935](https://gitlab.com/ta-interaktiv/packages/commit/ec58935f1f4b5e386fedb587e05888672fb381a0))
|
|
232
|
-
|
|
233
|
-
## [1.1.1](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.1.0...@ta-interaktiv/react-municipality-search@1.1.1) (2021-06-01)
|
|
234
|
-
|
|
235
|
-
### Bug Fixes
|
|
236
|
-
|
|
237
|
-
- Add dedupe prop to municipality search ([7fdc442](https://gitlab.com/ta-interaktiv/packages/commit/7fdc4429138738466c8b2a58d85c8a3a92138ad2))
|
|
238
|
-
- better source data set from swisstopo, added requirements ([1dda1df](https://gitlab.com/ta-interaktiv/packages/commit/1dda1df26342310bcf38ac80de6016cb1b656a1b))
|
|
239
|
-
- remove erroneous dependency ([fe10dba](https://gitlab.com/ta-interaktiv/packages/commit/fe10dba0b6a2df20a1ea79a89d33ecc4a442d27f))
|
|
240
|
-
|
|
241
|
-
# [1.1.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.0.1...@ta-interaktiv/react-municipality-search@1.1.0) (2021-04-08)
|
|
242
|
-
|
|
243
|
-
### Features
|
|
244
|
-
|
|
245
|
-
- added 2021 data ([8043b68](https://gitlab.com/ta-interaktiv/packages/commit/8043b688432552a2a4c78e6a849ffda06d1d7fe9))
|
|
246
|
-
|
|
247
|
-
## [1.0.1](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@1.0.0...@ta-interaktiv/react-municipality-search@1.0.1) (2020-11-23)
|
|
248
|
-
|
|
249
|
-
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
250
|
-
|
|
251
|
-
# [1.0.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.14...@ta-interaktiv/react-municipality-search@1.0.0) (2020-03-13)
|
|
252
|
-
|
|
253
|
-
### Features
|
|
254
|
-
|
|
255
|
-
- do not display paywall during development ([04801ff](https://gitlab.com/ta-interaktiv/packages/commit/04801ffe18498c9c1a4065b95cc66d2902fae448))
|
|
256
|
-
|
|
257
|
-
* Merge branch 'master' into 144-upgrade-react-components-to-use-new-apis ([8f052df](https://gitlab.com/ta-interaktiv/packages/commit/8f052df9ba3932204382eb9bcedff517c9aaf316))
|
|
258
|
-
|
|
259
|
-
### BREAKING CHANGES
|
|
260
|
-
|
|
261
|
-
- allow childs for image and svg, allow to place labels below image, oversized only via css, link with disco option, scrolltracking with multiple option
|
|
262
|
-
- allow childs for image and svg, allow to place labels below image, oversized only via css, link with disco option, scrolltracking with multiple option fix: accept child elements between sub and image, option for placing title and sub below image Publish fix: remove special URL for Facebook feat: do not display paywall during development feat: add properties to scrolltracking
|
|
263
|
-
- Rename Svg to InlineSvg
|
|
264
|
-
- Add annotationLayer, change ChapterNavigation props, exchange ScrollTracking Component, stories in mdx feat: add AnnotationLayer
|
|
265
|
-
|
|
266
|
-
## [0.2.14](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.13...@ta-interaktiv/react-municipality-search@0.2.14) (2020-02-21)
|
|
267
|
-
|
|
268
|
-
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
269
|
-
|
|
270
|
-
## [0.2.13](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.12...@ta-interaktiv/react-municipality-search@0.2.13) (2020-01-10)
|
|
271
|
-
|
|
272
|
-
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
273
|
-
|
|
274
|
-
## [0.2.12](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.11...@ta-interaktiv/react-municipality-search@0.2.12) (2019-12-10)
|
|
275
|
-
|
|
276
|
-
### Bug Fixes
|
|
277
|
-
|
|
278
|
-
- improve flexbox CSS so it works on iOS 10 ([26f9986](https://gitlab.com/ta-interaktiv/packages/commit/26f9986ccb4f8ba2810995c474e682f73635d2ea)), closes [#107](https://gitlab.com/ta-interaktiv/packages/issues/107)
|
|
279
|
-
- remove duplicate Canonical URL ([7d54376](https://gitlab.com/ta-interaktiv/packages/commit/7d5437642e640cfdb8cb49e35a86f494fe7afbc6)), closes [#117](https://gitlab.com/ta-interaktiv/packages/issues/117)
|
|
280
|
-
|
|
281
|
-
## [0.2.11](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.9...@ta-interaktiv/react-municipality-search@0.2.11) (2019-10-07)
|
|
282
|
-
|
|
283
|
-
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
284
|
-
|
|
285
|
-
## [0.2.10](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.9...@ta-interaktiv/react-municipality-search@0.2.10) (2019-10-07)
|
|
286
|
-
|
|
287
|
-
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
288
|
-
|
|
289
|
-
## [0.2.9](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.8...@ta-interaktiv/react-municipality-search@0.2.9) (2019-09-04)
|
|
290
|
-
|
|
291
|
-
### Bug Fixes
|
|
292
|
-
|
|
293
|
-
- localise input field placeholder text ([a536e26](https://gitlab.com/ta-interaktiv/packages/commit/a536e26))
|
|
294
|
-
|
|
295
|
-
## [0.2.8](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.7...@ta-interaktiv/react-municipality-search@0.2.8) (2019-06-24)
|
|
296
|
-
|
|
297
|
-
### Bug Fixes
|
|
298
|
-
|
|
299
|
-
- localise input field placeholder text ([b33f598](https://gitlab.com/ta-interaktiv/packages/commit/b33f598))
|
|
300
|
-
|
|
301
|
-
## [0.2.7](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.6...@ta-interaktiv/react-municipality-search@0.2.7) (2019-06-14)
|
|
302
|
-
|
|
303
|
-
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
304
|
-
|
|
305
|
-
## [0.2.6](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.5...@ta-interaktiv/react-municipality-search@0.2.6) (2019-06-05)
|
|
306
|
-
|
|
307
|
-
### Bug Fixes
|
|
308
|
-
|
|
309
|
-
- hide border when no objects are above it ([48a0d6f](https://gitlab.com/ta-interaktiv/packages/commit/48a0d6f))
|
|
310
|
-
- integration with other components ([0316883](https://gitlab.com/ta-interaktiv/packages/commit/0316883))
|
|
311
|
-
|
|
312
|
-
## [0.2.5](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.4...@ta-interaktiv/react-municipality-search@0.2.5) (2019-05-17)
|
|
313
|
-
|
|
314
|
-
### Bug Fixes
|
|
315
|
-
|
|
316
|
-
- larger label ([c04fd37](https://gitlab.com/ta-interaktiv/packages/commit/c04fd37))
|
|
317
|
-
- remove search type designation on input ([760464b](https://gitlab.com/ta-interaktiv/packages/commit/760464b))
|
|
318
|
-
|
|
319
|
-
## [0.2.4](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.3...@ta-interaktiv/react-municipality-search@0.2.4) (2019-05-15)
|
|
320
|
-
|
|
321
|
-
### Bug Fixes
|
|
322
|
-
|
|
323
|
-
- hide results box when there are no results. ([4a1c885](https://gitlab.com/ta-interaktiv/packages/commit/4a1c885))
|
|
324
|
-
|
|
325
|
-
## [0.2.3](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.2...@ta-interaktiv/react-municipality-search@0.2.3) (2019-05-15)
|
|
326
|
-
|
|
327
|
-
### Bug Fixes
|
|
328
|
-
|
|
329
|
-
- enhance background contrast of selected option ([796c114](https://gitlab.com/ta-interaktiv/packages/commit/796c114))
|
|
330
|
-
- improve contrast of label on coloured backgrounds ([8964d6e](https://gitlab.com/ta-interaktiv/packages/commit/8964d6e))
|
|
331
|
-
- remove white background from results ([a6d6534](https://gitlab.com/ta-interaktiv/packages/commit/a6d6534))
|
|
332
|
-
- switch domain when downloading article data ([60f0acb](https://gitlab.com/ta-interaktiv/packages/commit/60f0acb))
|
|
333
|
-
|
|
334
|
-
## [0.2.2](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.1...@ta-interaktiv/react-municipality-search@0.2.2) (2019-05-08)
|
|
335
|
-
|
|
336
|
-
### Bug Fixes
|
|
337
|
-
|
|
338
|
-
- remove Semantic UI icons ([80181e7](https://gitlab.com/ta-interaktiv/packages/commit/80181e7))
|
|
339
|
-
|
|
340
|
-
## [0.2.1](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.2.0...@ta-interaktiv/react-municipality-search@0.2.1) (2019-05-03)
|
|
341
|
-
|
|
342
|
-
### Bug Fixes
|
|
343
|
-
|
|
344
|
-
- made the component cuter ([a7c03d5](https://gitlab.com/ta-interaktiv/packages/commit/a7c03d5))
|
|
345
|
-
- reduce requirements of react peer dependencies ([b3fc7ba](https://gitlab.com/ta-interaktiv/packages/commit/b3fc7ba))
|
|
346
|
-
|
|
347
|
-
# [0.2.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@0.1.0...@ta-interaktiv/react-municipality-search@0.2.0) (2019-05-03)
|
|
348
|
-
|
|
349
|
-
### Features
|
|
350
|
-
|
|
351
|
-
- export Municipality type from index.ts ([ee9b5c6](https://gitlab.com/ta-interaktiv/packages/commit/ee9b5c6))
|
|
352
|
-
|
|
353
|
-
# 0.1.0 (2019-05-02)
|
|
354
|
-
|
|
355
|
-
### Bug Fixes
|
|
356
|
-
|
|
357
|
-
- add french translation ([7387c6a](https://gitlab.com/ta-interaktiv/packages/commit/7387c6a))
|
|
358
|
-
- remove debouncing code ([fb503fa](https://gitlab.com/ta-interaktiv/packages/commit/fb503fa))
|
|
359
|
-
- typescript errors and compiler warnings ([a295309](https://gitlab.com/ta-interaktiv/packages/commit/a295309))
|
|
360
|
-
- use CommonJS import for IE11 compatibility ([144a240](https://gitlab.com/ta-interaktiv/packages/commit/144a240))
|
|
361
|
-
|
|
362
|
-
### Features
|
|
363
|
-
|
|
364
|
-
- add first version of municipality search component ([5f1b4b2](https://gitlab.com/ta-interaktiv/packages/commit/5f1b4b2))
|
|
365
|
-
- load the municipality list from remote ([5928941](https://gitlab.com/ta-interaktiv/packages/commit/5928941))
|
|
366
|
-
- property to use a specific municipality list ([8debe51](https://gitlab.com/ta-interaktiv/packages/commit/8debe51))
|
|
367
|
-
- return complete municipality object upon selection ([cdf0e4d](https://gitlab.com/ta-interaktiv/packages/commit/cdf0e4d))
|