@code-plate/iran-cities 1.0.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/README.md +257 -0
- package/dist/index.cjs +5336 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.mjs +5300 -0
- package/dist/index.mjs.map +1 -0
- package/dist/react.cjs +5328 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.mts +39 -0
- package/dist/react.d.ts +39 -0
- package/dist/react.mjs +5299 -0
- package/dist/react.mjs.map +1 -0
- package/dist/types--eoWJy5A.d.mts +27 -0
- package/dist/types--eoWJy5A.d.ts +27 -0
- package/package.json +64 -0
package/dist/react.d.mts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { C as City, S as SearchOptions, F as FlatCity, P as Province } from './types--eoWJy5A.mjs';
|
|
3
|
+
|
|
4
|
+
/** لیست استانها (بدون شهرها) - برای Select/Dropdown استان */
|
|
5
|
+
declare function useProvinces(): {
|
|
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
|
+
*/
|
|
15
|
+
declare function useProvinceCitySelect(): {
|
|
16
|
+
provinces: {
|
|
17
|
+
en: string;
|
|
18
|
+
fa: string;
|
|
19
|
+
}[];
|
|
20
|
+
cities: City[];
|
|
21
|
+
province: string;
|
|
22
|
+
setProvince: (value: string) => void;
|
|
23
|
+
city: string;
|
|
24
|
+
setCity: react.Dispatch<react.SetStateAction<string>>;
|
|
25
|
+
};
|
|
26
|
+
/** جستجوی زندهی شهر با نگهداشتن state عبارت جستجو */
|
|
27
|
+
declare function useCitySearch(initialQuery?: string, options?: SearchOptions): {
|
|
28
|
+
query: string;
|
|
29
|
+
setQuery: react.Dispatch<react.SetStateAction<string>>;
|
|
30
|
+
results: FlatCity[];
|
|
31
|
+
};
|
|
32
|
+
/** جستجوی زندهی استان با نگهداشتن state عبارت جستجو */
|
|
33
|
+
declare function useProvinceSearch(initialQuery?: string, options?: SearchOptions): {
|
|
34
|
+
query: string;
|
|
35
|
+
setQuery: react.Dispatch<react.SetStateAction<string>>;
|
|
36
|
+
results: Province[];
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { useCities, useCitySearch, useProvinceCitySelect, useProvinceSearch, useProvinces };
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { C as City, S as SearchOptions, F as FlatCity, P as Province } from './types--eoWJy5A.js';
|
|
3
|
+
|
|
4
|
+
/** لیست استانها (بدون شهرها) - برای Select/Dropdown استان */
|
|
5
|
+
declare function useProvinces(): {
|
|
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
|
+
*/
|
|
15
|
+
declare function useProvinceCitySelect(): {
|
|
16
|
+
provinces: {
|
|
17
|
+
en: string;
|
|
18
|
+
fa: string;
|
|
19
|
+
}[];
|
|
20
|
+
cities: City[];
|
|
21
|
+
province: string;
|
|
22
|
+
setProvince: (value: string) => void;
|
|
23
|
+
city: string;
|
|
24
|
+
setCity: react.Dispatch<react.SetStateAction<string>>;
|
|
25
|
+
};
|
|
26
|
+
/** جستجوی زندهی شهر با نگهداشتن state عبارت جستجو */
|
|
27
|
+
declare function useCitySearch(initialQuery?: string, options?: SearchOptions): {
|
|
28
|
+
query: string;
|
|
29
|
+
setQuery: react.Dispatch<react.SetStateAction<string>>;
|
|
30
|
+
results: FlatCity[];
|
|
31
|
+
};
|
|
32
|
+
/** جستجوی زندهی استان با نگهداشتن state عبارت جستجو */
|
|
33
|
+
declare function useProvinceSearch(initialQuery?: string, options?: SearchOptions): {
|
|
34
|
+
query: string;
|
|
35
|
+
setQuery: react.Dispatch<react.SetStateAction<string>>;
|
|
36
|
+
results: Province[];
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { useCities, useCitySearch, useProvinceCitySelect, useProvinceSearch, useProvinces };
|