@ta-interaktiv/react-municipality-search 2.1.3 → 2.2.0
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 +378 -0
- package/dist/index.js +8 -6
- 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 +8 -6
- 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 -2
- package/src/municipalitySearch.tsx +10 -5
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
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.2.0](https://gitlab.com/ta-interaktiv/packages/compare/@ta-interaktiv/react-municipality-search@2.1.4...@ta-interaktiv/react-municipality-search@2.2.0) (2024-09-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* new prop "propertyToSearch" ([8fb9fd5](https://gitlab.com/ta-interaktiv/packages/commit/8fb9fd58f37a0e7778634de5d84926d68143cae1))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* don't show plz when plz empty ([0e52030](https://gitlab.com/ta-interaktiv/packages/commit/0e52030f54ba4e745a008cc026711d8c9d8750e3))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## [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)
|
|
29
|
+
|
|
30
|
+
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## [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)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* bring this repo to the 21st century ([38af4bf](https://gitlab.com/ta-interaktiv/packages/commit/38af4bfe550eb6ced0410012153e5a69e7fcb0d7))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## [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)
|
|
48
|
+
|
|
49
|
+
### Bug Fixes
|
|
50
|
+
|
|
51
|
+
- able to search for wil ([92dd8e5](https://gitlab.com/ta-interaktiv/packages/commit/92dd8e59158c935e49c0d9aaeefb8156c377bdff))
|
|
52
|
+
|
|
53
|
+
# [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)
|
|
54
|
+
|
|
55
|
+
### Features
|
|
56
|
+
|
|
57
|
+
- selectedMunicipalityId ([ea50af2](https://gitlab.com/ta-interaktiv/packages/commit/ea50af2b76a6fe1dc82c334b9911c7013e0f5245))
|
|
58
|
+
|
|
59
|
+
# [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)
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
- upgrade to latest styled-components version ([a27639a](https://gitlab.com/ta-interaktiv/packages/commit/a27639a387a1188d5090b21e4d97f1f1815afc6b))
|
|
64
|
+
|
|
65
|
+
### BREAKING CHANGES
|
|
66
|
+
|
|
67
|
+
- new version of styled-components
|
|
68
|
+
|
|
69
|
+
## [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)
|
|
70
|
+
|
|
71
|
+
### Bug Fixes
|
|
72
|
+
|
|
73
|
+
- results same width as search ([e19a2e7](https://gitlab.com/ta-interaktiv/packages/commit/e19a2e7da39b4cca0f9301754aa0e49854b9b6d8))
|
|
74
|
+
|
|
75
|
+
## [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)
|
|
76
|
+
|
|
77
|
+
### Bug Fixes
|
|
78
|
+
|
|
79
|
+
- mobile removode flex column ([b7a91d5](https://gitlab.com/ta-interaktiv/packages/commit/b7a91d524a08de824358c593954f131d13dbd552))
|
|
80
|
+
|
|
81
|
+
## [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)
|
|
82
|
+
|
|
83
|
+
### Bug Fixes
|
|
84
|
+
|
|
85
|
+
- last selected munis for nozip ([cf680fd](https://gitlab.com/ta-interaktiv/packages/commit/cf680fda03321d45413748c5cc1587cd95e04e1a))
|
|
86
|
+
|
|
87
|
+
# [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)
|
|
88
|
+
|
|
89
|
+
### Bug Fixes
|
|
90
|
+
|
|
91
|
+
- typo ([5b5e922](https://gitlab.com/ta-interaktiv/packages/commit/5b5e922291b35aed88f8619f33ffbf5f1abfadc2))
|
|
92
|
+
|
|
93
|
+
### Features
|
|
94
|
+
|
|
95
|
+
- removed deps and better style ([dcfea21](https://gitlab.com/ta-interaktiv/packages/commit/dcfea210dfcc2f5d72d82699c59bc1d042098f3c))
|
|
96
|
+
|
|
97
|
+
# [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)
|
|
98
|
+
|
|
99
|
+
### Features
|
|
100
|
+
|
|
101
|
+
- municipalitysearch with municipalities only ([4336e3e](https://gitlab.com/ta-interaktiv/packages/commit/4336e3ebd6e8a1718a9d09d437a9fd7842eafe89))
|
|
102
|
+
|
|
103
|
+
## [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)
|
|
104
|
+
|
|
105
|
+
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
106
|
+
|
|
107
|
+
## [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)
|
|
108
|
+
|
|
109
|
+
### Bug Fixes
|
|
110
|
+
|
|
111
|
+
- downgrade react-spring ([cc66923](https://gitlab.com/ta-interaktiv/packages/commit/cc66923dc36e08ae060a781694006ce60618be05))
|
|
112
|
+
|
|
113
|
+
## [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)
|
|
114
|
+
|
|
115
|
+
### Bug Fixes
|
|
116
|
+
|
|
117
|
+
- updated react spring ([639fbe5](https://gitlab.com/ta-interaktiv/packages/commit/639fbe57e366bfb302e5f7a3b01b0ca6246102a6))
|
|
118
|
+
|
|
119
|
+
# [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)
|
|
120
|
+
|
|
121
|
+
### Features
|
|
122
|
+
|
|
123
|
+
- use new atm jsons if available ([70d5dae](https://gitlab.com/ta-interaktiv/packages/commit/70d5daed5294787f0fdf4c02bb94b440b1cfa7d6))
|
|
124
|
+
|
|
125
|
+
## [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)
|
|
126
|
+
|
|
127
|
+
### Bug Fixes
|
|
128
|
+
|
|
129
|
+
- changed boldness ([ef331e0](https://gitlab.com/ta-interaktiv/packages/commit/ef331e0ac5346f5b5c36b1e6215f5cf3231897e9))
|
|
130
|
+
|
|
131
|
+
# [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)
|
|
132
|
+
|
|
133
|
+
### Features
|
|
134
|
+
|
|
135
|
+
- maxResults and icon on right side ([bd3a029](https://gitlab.com/ta-interaktiv/packages/commit/bd3a0295517f6dae73015fc1fb7c5a8634a388d3))
|
|
136
|
+
|
|
137
|
+
## [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)
|
|
138
|
+
|
|
139
|
+
### Bug Fixes
|
|
140
|
+
|
|
141
|
+
- get data from cookies ([1a78a15](https://gitlab.com/ta-interaktiv/packages/commit/1a78a154c02f35b5213d1c7430817edf733854ae))
|
|
142
|
+
|
|
143
|
+
# [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)
|
|
144
|
+
|
|
145
|
+
### Features
|
|
146
|
+
|
|
147
|
+
- add scroller component ([3f854de](https://gitlab.com/ta-interaktiv/packages/commit/3f854deed1bc26c0801e26dafeeff871460bf1f8))
|
|
148
|
+
- cookie support for municipalitySearch ([3afac60](https://gitlab.com/ta-interaktiv/packages/commit/3afac602ad546f478e4de1fea26ee29e9beb7c8d))
|
|
149
|
+
|
|
150
|
+
# [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)
|
|
151
|
+
|
|
152
|
+
### Features
|
|
153
|
+
|
|
154
|
+
- upgraded most dependencies ⭐️ ([2d16e51](https://gitlab.com/ta-interaktiv/packages/commit/2d16e515bd8ac761eee50477a3ae4ebd78a591a1))
|
|
155
|
+
|
|
156
|
+
## [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)
|
|
157
|
+
|
|
158
|
+
### Bug Fixes
|
|
159
|
+
|
|
160
|
+
- dedupe lastSelected munis & suggeest Fetched munis ([e4b6ddc](https://gitlab.com/ta-interaktiv/packages/commit/e4b6ddc332f3656a92474262146b6e94eb46c522))
|
|
161
|
+
|
|
162
|
+
## [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)
|
|
163
|
+
|
|
164
|
+
### Bug Fixes
|
|
165
|
+
|
|
166
|
+
- municipaltiy search common localStorageName ([dc7439d](https://gitlab.com/ta-interaktiv/packages/commit/dc7439df6a6d7946c3d393f53de2d3cc4e5a0d62))
|
|
167
|
+
|
|
168
|
+
## [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)
|
|
169
|
+
|
|
170
|
+
### Bug Fixes
|
|
171
|
+
|
|
172
|
+
- try to publish ([55709f9](https://gitlab.com/ta-interaktiv/packages/commit/55709f97a752e5753430f8068e2edc858b22a84b))
|
|
173
|
+
|
|
174
|
+
### Reverts
|
|
175
|
+
|
|
176
|
+
- Revert "Publish" ([627f67e](https://gitlab.com/ta-interaktiv/packages/commit/627f67ed0bb983a9213d344c699c6c1518f1a2a7))
|
|
177
|
+
- Revert "Publish" ([5f254e3](https://gitlab.com/ta-interaktiv/packages/commit/5f254e3d553853fa050f2635afc8fa36186b517c))
|
|
178
|
+
|
|
179
|
+
## [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)
|
|
180
|
+
|
|
181
|
+
### Reverts
|
|
182
|
+
|
|
183
|
+
- Revert "Publish" ([627f67e](https://gitlab.com/ta-interaktiv/packages/commit/627f67ed0bb983a9213d344c699c6c1518f1a2a7))
|
|
184
|
+
- Revert "Publish" ([5f254e3](https://gitlab.com/ta-interaktiv/packages/commit/5f254e3d553853fa050f2635afc8fa36186b517c))
|
|
185
|
+
|
|
186
|
+
# [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)
|
|
187
|
+
|
|
188
|
+
### Features
|
|
189
|
+
|
|
190
|
+
- muniSearch refactor to styledComponents ([603fadd](https://gitlab.com/ta-interaktiv/packages/commit/603fadd02ff8280c20eab454d0cae28d88a505ba))
|
|
191
|
+
|
|
192
|
+
## [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)
|
|
193
|
+
|
|
194
|
+
### Bug Fixes
|
|
195
|
+
|
|
196
|
+
- muniSearch switched to css module ([10dbc07](https://gitlab.com/ta-interaktiv/packages/commit/10dbc074f415bdd3fb1d1ab85d47d62eb57b93d5))
|
|
197
|
+
|
|
198
|
+
# [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)
|
|
199
|
+
|
|
200
|
+
### Features
|
|
201
|
+
|
|
202
|
+
- updated to react-spring ^9.4.5 ([2e1c8a1](https://gitlab.com/ta-interaktiv/packages/commit/2e1c8a19acc0963bae2feb563a90286d2e24168c))
|
|
203
|
+
|
|
204
|
+
# [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)
|
|
205
|
+
|
|
206
|
+
### Bug Fixes
|
|
207
|
+
|
|
208
|
+
- remove console log ([c3e2566](https://gitlab.com/ta-interaktiv/packages/commit/c3e25662da69d3671aade242e8d700a95c259984))
|
|
209
|
+
|
|
210
|
+
### Features
|
|
211
|
+
|
|
212
|
+
- allow new municipalities data retrieval when the date prop is changed ([62e46d4](https://gitlab.com/ta-interaktiv/packages/commit/62e46d4ad710df131b44d8b1554bf89481bbd2b9))
|
|
213
|
+
|
|
214
|
+
## [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)
|
|
215
|
+
|
|
216
|
+
### Bug Fixes
|
|
217
|
+
|
|
218
|
+
- correct order in ms ([44dc573](https://gitlab.com/ta-interaktiv/packages/commit/44dc573c1d4dae990ae3984f4cd9ea901a7f40d9))
|
|
219
|
+
|
|
220
|
+
## [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)
|
|
221
|
+
|
|
222
|
+
### Bug Fixes
|
|
223
|
+
|
|
224
|
+
- show last selected municipalities ([adff1f9](https://gitlab.com/ta-interaktiv/packages/commit/adff1f9ec251be7ee948697dafbaf00ec3703ac9))
|
|
225
|
+
|
|
226
|
+
# [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)
|
|
227
|
+
|
|
228
|
+
### Features
|
|
229
|
+
|
|
230
|
+
- hideToooltip and resetOnSelect ([f5c1f8f](https://gitlab.com/ta-interaktiv/packages/commit/f5c1f8f9c6d6c86af1b82a995a2d8dcb98a8d87e))
|
|
231
|
+
|
|
232
|
+
## [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)
|
|
233
|
+
|
|
234
|
+
### Bug Fixes
|
|
235
|
+
|
|
236
|
+
- add placeholder prop to municipality search ([08c6fca](https://gitlab.com/ta-interaktiv/packages/commit/08c6fcad43c6197d548c82e81da311f4022de74b))
|
|
237
|
+
|
|
238
|
+
## [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)
|
|
239
|
+
|
|
240
|
+
### Bug Fixes
|
|
241
|
+
|
|
242
|
+
- add PLZ6 to municipality search results ([ec58935](https://gitlab.com/ta-interaktiv/packages/commit/ec58935f1f4b5e386fedb587e05888672fb381a0))
|
|
243
|
+
|
|
244
|
+
## [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)
|
|
245
|
+
|
|
246
|
+
### Bug Fixes
|
|
247
|
+
|
|
248
|
+
- Add dedupe prop to municipality search ([7fdc442](https://gitlab.com/ta-interaktiv/packages/commit/7fdc4429138738466c8b2a58d85c8a3a92138ad2))
|
|
249
|
+
- better source data set from swisstopo, added requirements ([1dda1df](https://gitlab.com/ta-interaktiv/packages/commit/1dda1df26342310bcf38ac80de6016cb1b656a1b))
|
|
250
|
+
- remove erroneous dependency ([fe10dba](https://gitlab.com/ta-interaktiv/packages/commit/fe10dba0b6a2df20a1ea79a89d33ecc4a442d27f))
|
|
251
|
+
|
|
252
|
+
# [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)
|
|
253
|
+
|
|
254
|
+
### Features
|
|
255
|
+
|
|
256
|
+
- added 2021 data ([8043b68](https://gitlab.com/ta-interaktiv/packages/commit/8043b688432552a2a4c78e6a849ffda06d1d7fe9))
|
|
257
|
+
|
|
258
|
+
## [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)
|
|
259
|
+
|
|
260
|
+
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
261
|
+
|
|
262
|
+
# [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)
|
|
263
|
+
|
|
264
|
+
### Features
|
|
265
|
+
|
|
266
|
+
- do not display paywall during development ([04801ff](https://gitlab.com/ta-interaktiv/packages/commit/04801ffe18498c9c1a4065b95cc66d2902fae448))
|
|
267
|
+
|
|
268
|
+
* Merge branch 'master' into 144-upgrade-react-components-to-use-new-apis ([8f052df](https://gitlab.com/ta-interaktiv/packages/commit/8f052df9ba3932204382eb9bcedff517c9aaf316))
|
|
269
|
+
|
|
270
|
+
### BREAKING CHANGES
|
|
271
|
+
|
|
272
|
+
- allow childs for image and svg, allow to place labels below image, oversized only via css, link with disco option, scrolltracking with multiple option
|
|
273
|
+
- 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
|
|
274
|
+
- Rename Svg to InlineSvg
|
|
275
|
+
- Add annotationLayer, change ChapterNavigation props, exchange ScrollTracking Component, stories in mdx feat: add AnnotationLayer
|
|
276
|
+
|
|
277
|
+
## [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)
|
|
278
|
+
|
|
279
|
+
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
280
|
+
|
|
281
|
+
## [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)
|
|
282
|
+
|
|
283
|
+
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
284
|
+
|
|
285
|
+
## [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)
|
|
286
|
+
|
|
287
|
+
### Bug Fixes
|
|
288
|
+
|
|
289
|
+
- 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)
|
|
290
|
+
- remove duplicate Canonical URL ([7d54376](https://gitlab.com/ta-interaktiv/packages/commit/7d5437642e640cfdb8cb49e35a86f494fe7afbc6)), closes [#117](https://gitlab.com/ta-interaktiv/packages/issues/117)
|
|
291
|
+
|
|
292
|
+
## [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)
|
|
293
|
+
|
|
294
|
+
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
295
|
+
|
|
296
|
+
## [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)
|
|
297
|
+
|
|
298
|
+
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
299
|
+
|
|
300
|
+
## [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)
|
|
301
|
+
|
|
302
|
+
### Bug Fixes
|
|
303
|
+
|
|
304
|
+
- localise input field placeholder text ([a536e26](https://gitlab.com/ta-interaktiv/packages/commit/a536e26))
|
|
305
|
+
|
|
306
|
+
## [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)
|
|
307
|
+
|
|
308
|
+
### Bug Fixes
|
|
309
|
+
|
|
310
|
+
- localise input field placeholder text ([b33f598](https://gitlab.com/ta-interaktiv/packages/commit/b33f598))
|
|
311
|
+
|
|
312
|
+
## [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)
|
|
313
|
+
|
|
314
|
+
**Note:** Version bump only for package @ta-interaktiv/react-municipality-search
|
|
315
|
+
|
|
316
|
+
## [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)
|
|
317
|
+
|
|
318
|
+
### Bug Fixes
|
|
319
|
+
|
|
320
|
+
- hide border when no objects are above it ([48a0d6f](https://gitlab.com/ta-interaktiv/packages/commit/48a0d6f))
|
|
321
|
+
- integration with other components ([0316883](https://gitlab.com/ta-interaktiv/packages/commit/0316883))
|
|
322
|
+
|
|
323
|
+
## [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)
|
|
324
|
+
|
|
325
|
+
### Bug Fixes
|
|
326
|
+
|
|
327
|
+
- larger label ([c04fd37](https://gitlab.com/ta-interaktiv/packages/commit/c04fd37))
|
|
328
|
+
- remove search type designation on input ([760464b](https://gitlab.com/ta-interaktiv/packages/commit/760464b))
|
|
329
|
+
|
|
330
|
+
## [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)
|
|
331
|
+
|
|
332
|
+
### Bug Fixes
|
|
333
|
+
|
|
334
|
+
- hide results box when there are no results. ([4a1c885](https://gitlab.com/ta-interaktiv/packages/commit/4a1c885))
|
|
335
|
+
|
|
336
|
+
## [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)
|
|
337
|
+
|
|
338
|
+
### Bug Fixes
|
|
339
|
+
|
|
340
|
+
- enhance background contrast of selected option ([796c114](https://gitlab.com/ta-interaktiv/packages/commit/796c114))
|
|
341
|
+
- improve contrast of label on coloured backgrounds ([8964d6e](https://gitlab.com/ta-interaktiv/packages/commit/8964d6e))
|
|
342
|
+
- remove white background from results ([a6d6534](https://gitlab.com/ta-interaktiv/packages/commit/a6d6534))
|
|
343
|
+
- switch domain when downloading article data ([60f0acb](https://gitlab.com/ta-interaktiv/packages/commit/60f0acb))
|
|
344
|
+
|
|
345
|
+
## [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)
|
|
346
|
+
|
|
347
|
+
### Bug Fixes
|
|
348
|
+
|
|
349
|
+
- remove Semantic UI icons ([80181e7](https://gitlab.com/ta-interaktiv/packages/commit/80181e7))
|
|
350
|
+
|
|
351
|
+
## [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)
|
|
352
|
+
|
|
353
|
+
### Bug Fixes
|
|
354
|
+
|
|
355
|
+
- made the component cuter ([a7c03d5](https://gitlab.com/ta-interaktiv/packages/commit/a7c03d5))
|
|
356
|
+
- reduce requirements of react peer dependencies ([b3fc7ba](https://gitlab.com/ta-interaktiv/packages/commit/b3fc7ba))
|
|
357
|
+
|
|
358
|
+
# [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)
|
|
359
|
+
|
|
360
|
+
### Features
|
|
361
|
+
|
|
362
|
+
- export Municipality type from index.ts ([ee9b5c6](https://gitlab.com/ta-interaktiv/packages/commit/ee9b5c6))
|
|
363
|
+
|
|
364
|
+
# 0.1.0 (2019-05-02)
|
|
365
|
+
|
|
366
|
+
### Bug Fixes
|
|
367
|
+
|
|
368
|
+
- add french translation ([7387c6a](https://gitlab.com/ta-interaktiv/packages/commit/7387c6a))
|
|
369
|
+
- remove debouncing code ([fb503fa](https://gitlab.com/ta-interaktiv/packages/commit/fb503fa))
|
|
370
|
+
- typescript errors and compiler warnings ([a295309](https://gitlab.com/ta-interaktiv/packages/commit/a295309))
|
|
371
|
+
- use CommonJS import for IE11 compatibility ([144a240](https://gitlab.com/ta-interaktiv/packages/commit/144a240))
|
|
372
|
+
|
|
373
|
+
### Features
|
|
374
|
+
|
|
375
|
+
- add first version of municipality search component ([5f1b4b2](https://gitlab.com/ta-interaktiv/packages/commit/5f1b4b2))
|
|
376
|
+
- load the municipality list from remote ([5928941](https://gitlab.com/ta-interaktiv/packages/commit/5928941))
|
|
377
|
+
- property to use a specific municipality list ([8debe51](https://gitlab.com/ta-interaktiv/packages/commit/8debe51))
|
|
378
|
+
- return complete municipality object upon selection ([cdf0e4d](https://gitlab.com/ta-interaktiv/packages/commit/cdf0e4d))
|
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 ||
|
|
@@ -184,8 +184,9 @@ var MunicipalitySearch = (function (_super) {
|
|
|
184
184
|
var exactWordRegex_1 = RegExp("\\b" + 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' });
|
|
@@ -477,10 +478,10 @@ var MunicipalitySearch = (function (_super) {
|
|
|
477
478
|
result.ORTNAME ? t('list.municipalityPrefix') : '',
|
|
478
479
|
' ',
|
|
479
480
|
React.createElement("b", null, (_a = result.GDENAMK) !== null && _a !== void 0 ? _a : result.NORMGEMEINDE +
|
|
480
|
-
(results.find(function (muni) {
|
|
481
|
+
((results.find(function (muni) {
|
|
481
482
|
return muni !== result &&
|
|
482
483
|
muni.NORMGEMEINDE === result.NORMGEMEINDE;
|
|
483
|
-
})
|
|
484
|
+
}) && result.KTKZ)
|
|
484
485
|
? ' (' + result.KTKZ + ')'
|
|
485
486
|
: ''))))));
|
|
486
487
|
}))))));
|
|
@@ -492,6 +493,7 @@ 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));
|
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"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAe,SAAS,EAAE,MAAM,OAAO,CAAA;AAkBpD,UAAU,YAAY;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CA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AO1C,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 ||
|
|
@@ -180,8 +180,9 @@ var MunicipalitySearch = (function (_super) {
|
|
|
180
180
|
var exactWordRegex_1 = RegExp("\\b" + 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' });
|
|
@@ -473,10 +474,10 @@ var MunicipalitySearch = (function (_super) {
|
|
|
473
474
|
result.ORTNAME ? t('list.municipalityPrefix') : '',
|
|
474
475
|
' ',
|
|
475
476
|
React.createElement("b", null, (_a = result.GDENAMK) !== null && _a !== void 0 ? _a : result.NORMGEMEINDE +
|
|
476
|
-
(results.find(function (muni) {
|
|
477
|
+
((results.find(function (muni) {
|
|
477
478
|
return muni !== result &&
|
|
478
479
|
muni.NORMGEMEINDE === result.NORMGEMEINDE;
|
|
479
|
-
})
|
|
480
|
+
}) && result.KTKZ)
|
|
480
481
|
? ' (' + result.KTKZ + ')'
|
|
481
482
|
: ''))))));
|
|
482
483
|
}))))));
|
|
@@ -488,6 +489,7 @@ 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));
|
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;IACrB,QA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AAC,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.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "React component that allows searching for Swiss municipalities with either ZIP code or place names.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"react-dom": ">=16.8.0",
|
|
53
53
|
"styled-components": "^6.1.1"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "e14ed049579a8649fadbb1240d9226a5a9225296"
|
|
56
56
|
}
|
|
@@ -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(
|
|
@@ -675,11 +680,11 @@ export class MunicipalitySearch extends Component<Props, State> {
|
|
|
675
680
|
<b>
|
|
676
681
|
{result.GDENAMK ??
|
|
677
682
|
result.NORMGEMEINDE +
|
|
678
|
-
|
|
683
|
+
( (results.find(
|
|
679
684
|
(muni: Municipality) =>
|
|
680
685
|
muni !== result &&
|
|
681
686
|
muni.NORMGEMEINDE === result.NORMGEMEINDE,
|
|
682
|
-
)
|
|
687
|
+
) && result.KTKZ)
|
|
683
688
|
? ' (' + result.KTKZ + ')'
|
|
684
689
|
: '')}
|
|
685
690
|
</b>
|