@uxf/smart-address 10.0.0 → 10.8.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/README.md +45 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,50 @@
|
|
|
1
1
|
# @uxf/smart-address
|
|
2
|
-
|
|
3
2
|
## How to install
|
|
4
|
-
|
|
5
3
|
```bash
|
|
6
4
|
yarn add @uxf/smart-address
|
|
5
|
+
```
|
|
6
|
+
### Loading search options from the smart address
|
|
7
|
+
#### Params
|
|
8
|
+
```
|
|
9
|
+
type Params = { term: string; level: number; limit?: number; zip?: number; getLabel?: (address: Location) => string };
|
|
10
|
+
```
|
|
11
|
+
#### level: number
|
|
12
|
+
* 1 = Číslo domovní (Číslo orientační, Znak čísla orientačního)
|
|
13
|
+
* 2 = Ulice
|
|
14
|
+
* 3 = Název části obce
|
|
15
|
+
* 4 = Název MOP (městský obvod Praha)
|
|
16
|
+
* 5 = Název MOMC (městský obvod/městská část)
|
|
17
|
+
* 6 = Název obce
|
|
18
|
+
* 7 = okres (future)
|
|
19
|
+
* 8 = kraj (future)
|
|
20
|
+
```tsx
|
|
21
|
+
const options = await SmartAddress.loadAddressOptions({ term: "Sovova", level: 1 });
|
|
22
|
+
```
|
|
23
|
+
### Options with zip code.
|
|
24
|
+
```tsx
|
|
25
|
+
const zipOptions = await SmartAddress.loadZipOptions({ term: "46001" });
|
|
26
|
+
```
|
|
27
|
+
### Get a specific address by id.
|
|
28
|
+
```tsx
|
|
29
|
+
const address = await SmartAddress.getAddress(123456);
|
|
30
|
+
```
|
|
31
|
+
### Option of location with added extension of electricity distributor, building type etc. by id.
|
|
32
|
+
```tsx
|
|
33
|
+
const address = await SmartAddress.getAddressExtended(123456);
|
|
34
|
+
```
|
|
35
|
+
### Get a specific part of the city by id.
|
|
36
|
+
```tsx
|
|
37
|
+
const cityPart = await SmartAddress.getCityPart(123456);
|
|
38
|
+
```
|
|
39
|
+
### Get a city district by id.
|
|
40
|
+
```tsx
|
|
41
|
+
const momc = await SmartAddress.getMomc(123456);
|
|
42
|
+
```
|
|
43
|
+
### Get city district of Prague by id.
|
|
44
|
+
```tsx
|
|
45
|
+
const mop = await SmartAddress.getmop(123456);
|
|
46
|
+
```
|
|
47
|
+
### Get city street by id.
|
|
48
|
+
```tsx
|
|
49
|
+
const street = await SmartAddress.getStreet(123456);
|
|
7
50
|
```
|