@code-plate/iran-cities 1.0.2 → 1.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 +10 -0
- package/NOTICE.md +21 -0
- package/README.fa.md +56 -20
- package/README.md +56 -20
- package/dist/index.cjs +5089 -1173
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +14 -33
- package/dist/index.d.ts +14 -33
- package/dist/index.mjs +5083 -1173
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +5104 -1175
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.mts +11 -20
- package/dist/react.d.ts +11 -20
- package/dist/react.mjs +5105 -1176
- package/dist/react.mjs.map +1 -1
- package/dist/{types-DwFZSr9I.d.mts → types-DwK3g-Z0.d.mts} +25 -6
- package/dist/{types-DwFZSr9I.d.ts → types-DwK3g-Z0.d.ts} +25 -6
- package/package.json +12 -5
package/dist/react.d.mts
CHANGED
|
@@ -1,35 +1,26 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { C as City, S as SearchOptions, F as FlatCity, P as Province } from './types-
|
|
2
|
+
import { Q as Query, C as City, S as SearchOptions, F as FlatCity, d as ProvinceListItem, c as ProvinceId, a as CityId, P as Province } from './types-DwK3g-Z0.mjs';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
declare function
|
|
6
|
-
en: string;
|
|
7
|
-
fa: string;
|
|
8
|
-
}[];
|
|
9
|
-
/** لیست شهرهای یک استان؛ با تغییر استان بهصورت خودکار بهروز میشود */
|
|
10
|
-
declare function useCities(provinceQuery: string | undefined | null): City[];
|
|
11
|
-
/**
|
|
12
|
-
* ست کامل state + logic برای یک فرم استان/شهر:
|
|
13
|
-
* const { provinces, cities, province, setProvince, city, setCity } = useProvinceCitySelect();
|
|
14
|
-
*/
|
|
4
|
+
declare function useProvinces(): ProvinceListItem[];
|
|
5
|
+
declare function useCities(provinceQuery: Query | undefined | null): City[];
|
|
15
6
|
declare function useProvinceCitySelect(): {
|
|
16
|
-
provinces:
|
|
17
|
-
en: string;
|
|
18
|
-
fa: string;
|
|
19
|
-
}[];
|
|
7
|
+
provinces: ProvinceListItem[];
|
|
20
8
|
cities: City[];
|
|
21
9
|
province: string;
|
|
22
|
-
setProvince: (value:
|
|
10
|
+
setProvince: (value: Query) => void;
|
|
23
11
|
city: string;
|
|
24
|
-
setCity:
|
|
12
|
+
setCity: (value: Query) => void;
|
|
13
|
+
provinceId: ProvinceId | undefined;
|
|
14
|
+
cityId: CityId | undefined;
|
|
15
|
+
selectedProvince: Province | undefined;
|
|
16
|
+
selectedCity: FlatCity | undefined;
|
|
17
|
+
reset: () => void;
|
|
25
18
|
};
|
|
26
|
-
/** جستجوی زندهی شهر با نگهداشتن state عبارت جستجو */
|
|
27
19
|
declare function useCitySearch(initialQuery?: string, options?: SearchOptions): {
|
|
28
20
|
query: string;
|
|
29
21
|
setQuery: react.Dispatch<react.SetStateAction<string>>;
|
|
30
22
|
results: FlatCity[];
|
|
31
23
|
};
|
|
32
|
-
/** جستجوی زندهی استان با نگهداشتن state عبارت جستجو */
|
|
33
24
|
declare function useProvinceSearch(initialQuery?: string, options?: SearchOptions): {
|
|
34
25
|
query: string;
|
|
35
26
|
setQuery: react.Dispatch<react.SetStateAction<string>>;
|
package/dist/react.d.ts
CHANGED
|
@@ -1,35 +1,26 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { C as City, S as SearchOptions, F as FlatCity, P as Province } from './types-
|
|
2
|
+
import { Q as Query, C as City, S as SearchOptions, F as FlatCity, d as ProvinceListItem, c as ProvinceId, a as CityId, P as Province } from './types-DwK3g-Z0.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
declare function
|
|
6
|
-
en: string;
|
|
7
|
-
fa: string;
|
|
8
|
-
}[];
|
|
9
|
-
/** لیست شهرهای یک استان؛ با تغییر استان بهصورت خودکار بهروز میشود */
|
|
10
|
-
declare function useCities(provinceQuery: string | undefined | null): City[];
|
|
11
|
-
/**
|
|
12
|
-
* ست کامل state + logic برای یک فرم استان/شهر:
|
|
13
|
-
* const { provinces, cities, province, setProvince, city, setCity } = useProvinceCitySelect();
|
|
14
|
-
*/
|
|
4
|
+
declare function useProvinces(): ProvinceListItem[];
|
|
5
|
+
declare function useCities(provinceQuery: Query | undefined | null): City[];
|
|
15
6
|
declare function useProvinceCitySelect(): {
|
|
16
|
-
provinces:
|
|
17
|
-
en: string;
|
|
18
|
-
fa: string;
|
|
19
|
-
}[];
|
|
7
|
+
provinces: ProvinceListItem[];
|
|
20
8
|
cities: City[];
|
|
21
9
|
province: string;
|
|
22
|
-
setProvince: (value:
|
|
10
|
+
setProvince: (value: Query) => void;
|
|
23
11
|
city: string;
|
|
24
|
-
setCity:
|
|
12
|
+
setCity: (value: Query) => void;
|
|
13
|
+
provinceId: ProvinceId | undefined;
|
|
14
|
+
cityId: CityId | undefined;
|
|
15
|
+
selectedProvince: Province | undefined;
|
|
16
|
+
selectedCity: FlatCity | undefined;
|
|
17
|
+
reset: () => void;
|
|
25
18
|
};
|
|
26
|
-
/** جستجوی زندهی شهر با نگهداشتن state عبارت جستجو */
|
|
27
19
|
declare function useCitySearch(initialQuery?: string, options?: SearchOptions): {
|
|
28
20
|
query: string;
|
|
29
21
|
setQuery: react.Dispatch<react.SetStateAction<string>>;
|
|
30
22
|
results: FlatCity[];
|
|
31
23
|
};
|
|
32
|
-
/** جستجوی زندهی استان با نگهداشتن state عبارت جستجو */
|
|
33
24
|
declare function useProvinceSearch(initialQuery?: string, options?: SearchOptions): {
|
|
34
25
|
query: string;
|
|
35
26
|
setQuery: react.Dispatch<react.SetStateAction<string>>;
|