tekivex-india-admin 0.1.0-alpha.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/LICENSES/GODL-India.txt +118 -0
- package/NOTICE.md +44 -0
- package/README.md +165 -0
- package/dist/data/_meta.json +50 -0
- package/dist/data/districts.json +79 -0
- package/dist/data/states.json +48 -0
- package/dist/data/sub-districts.json +68 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/lgdSnapshot.d.ts +37 -0
- package/dist/lgdSnapshot.d.ts.map +1 -0
- package/dist/lgdSnapshot.js +92 -0
- package/dist/lgdSnapshot.js.map +1 -0
- package/dist/types.d.ts +18 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
GOVERNMENT OPEN DATA LICENSE — INDIA (GODL-India), v1.0
|
|
2
|
+
========================================================
|
|
3
|
+
|
|
4
|
+
This file is a summary + pointer. The CANONICAL, legally authoritative
|
|
5
|
+
text of the GODL-India v1.0 license is maintained by the Government of
|
|
6
|
+
India at:
|
|
7
|
+
|
|
8
|
+
https://data.gov.in/government-open-data-license-india
|
|
9
|
+
|
|
10
|
+
Issued by the Department of Science & Technology and the Ministry of
|
|
11
|
+
Statistics and Programme Implementation, Government of India, under
|
|
12
|
+
the National Data Sharing and Accessibility Policy (NDSAP).
|
|
13
|
+
|
|
14
|
+
Gazette notified: 13 February 2017.
|
|
15
|
+
|
|
16
|
+
What this package relies on the license to grant
|
|
17
|
+
------------------------------------------------
|
|
18
|
+
|
|
19
|
+
(Sourced verbatim from the Wikipedia GODL-India template and the
|
|
20
|
+
data.gov.in license summary, both consulted on 2026-05-30. See
|
|
21
|
+
docs/LICENSE-AUDIT-tekivex-india-admin.md in the parent repo for the
|
|
22
|
+
audit trail.)
|
|
23
|
+
|
|
24
|
+
Rights granted to users:
|
|
25
|
+
|
|
26
|
+
"worldwide, royalty-free, non-exclusive license to use, adapt, publish
|
|
27
|
+
(either in original, or in adapted and/or derivative forms), translate,
|
|
28
|
+
display, add value, and create derivative works (including products and
|
|
29
|
+
services), for all lawful commercial and non-commercial purposes."
|
|
30
|
+
|
|
31
|
+
This package — `tekivex-india-admin` — exercises the rights to:
|
|
32
|
+
- Adapt (re-encoding LGD data from CSV to JSON, normalising codes)
|
|
33
|
+
- Publish in derivative form (an npm package IS a derivative form)
|
|
34
|
+
- Create derivative products (this package is exactly such a product)
|
|
35
|
+
- Permit downstream commercial use by consumers
|
|
36
|
+
|
|
37
|
+
Attribution required by the license
|
|
38
|
+
-----------------------------------
|
|
39
|
+
|
|
40
|
+
"Users must acknowledge the provider, source, and license of data by
|
|
41
|
+
explicitly publishing the attribution statement, including the DOI
|
|
42
|
+
(Digital Object Identifier), or the URL (Uniform Resource Locator),
|
|
43
|
+
or the URI (Uniform Resource Identifier)."
|
|
44
|
+
|
|
45
|
+
This package satisfies the attribution requirement by:
|
|
46
|
+
- This LICENSES/GODL-India.txt file (with the canonical URL above)
|
|
47
|
+
- The package's NOTICE.md, which names provider + source + snapshot date
|
|
48
|
+
- An `_attribution` field embedded in every bundled JSON data file
|
|
49
|
+
- A copy-pasteable attribution snippet in the README that downstream
|
|
50
|
+
consumers paste into their own product's NOTICES / About / Credits
|
|
51
|
+
|
|
52
|
+
If your product is built on top of `tekivex-india-admin`, paste the
|
|
53
|
+
attribution snippet from the README into your product's notices page
|
|
54
|
+
so that the chain of attribution stays unbroken.
|
|
55
|
+
|
|
56
|
+
Excluded from coverage
|
|
57
|
+
----------------------
|
|
58
|
+
|
|
59
|
+
Per § 7 of GODL-India, the license does not extend to:
|
|
60
|
+
|
|
61
|
+
- Personal information
|
|
62
|
+
- Non-shareable and/or sensitive data
|
|
63
|
+
- Names, crests, logos and official symbols of the data provider
|
|
64
|
+
- Data subject to other intellectual property rights
|
|
65
|
+
- Military insignia
|
|
66
|
+
- Identity documents
|
|
67
|
+
- Data that should not have been publicly disclosed under § 8 of
|
|
68
|
+
the Right to Information Act, 2005
|
|
69
|
+
|
|
70
|
+
This package strictly ships only administrative-division NAMES and
|
|
71
|
+
LGD-defined CODES. It does NOT ship GoI / state-government crests,
|
|
72
|
+
logos, flags, emblems, or any of the other excluded categories.
|
|
73
|
+
|
|
74
|
+
Warranty
|
|
75
|
+
--------
|
|
76
|
+
|
|
77
|
+
GODL-India does not warrant data accuracy. Neither does this package.
|
|
78
|
+
Indian administrative boundaries change (J&K 2019, frequent district
|
|
79
|
+
splits, UT reorganisations). The bundled snapshot is dated; consult
|
|
80
|
+
`src/data/_meta.json` → `snapshotDate` for the exact date this build
|
|
81
|
+
was captured.
|
|
82
|
+
|
|
83
|
+
For legally significant decisions (statutory filings, tax jurisdiction,
|
|
84
|
+
electoral rolls), re-snapshot from `https://lgdirectory.gov.in/` or
|
|
85
|
+
verify against the live API.
|
|
86
|
+
|
|
87
|
+
How to obtain the verbatim license text
|
|
88
|
+
---------------------------------------
|
|
89
|
+
|
|
90
|
+
The license is published as a Gazette of India notification. Authoritative
|
|
91
|
+
copies are available at:
|
|
92
|
+
|
|
93
|
+
1. https://data.gov.in/government-open-data-license-india
|
|
94
|
+
(canonical, maintained by the OGD Platform / NIC)
|
|
95
|
+
|
|
96
|
+
2. The Gazette of India archive
|
|
97
|
+
(search for "Government Open Data License" notified 13 Feb 2017)
|
|
98
|
+
|
|
99
|
+
3. Mirrors maintained by community projects on Wikimedia Commons and
|
|
100
|
+
GitHub (verify the SHA-256 hash against the canonical source before
|
|
101
|
+
relying on a third-party mirror).
|
|
102
|
+
|
|
103
|
+
Why this file does not bundle the PDF directly
|
|
104
|
+
----------------------------------------------
|
|
105
|
+
|
|
106
|
+
The maintainer (running in a CI environment from the United States)
|
|
107
|
+
could not reliably retrieve and verify a clean copy of the PDF — the
|
|
108
|
+
canonical `data.gov.in` URL returns 403 from non-Indian IPs, and
|
|
109
|
+
several alleged mirrors turned out to be promotional brochures or
|
|
110
|
+
unrelated documents. Rather than bundle the wrong file under the name
|
|
111
|
+
"GODL-India.pdf" and create downstream confusion, this package ships
|
|
112
|
+
the summary above + the canonical URL.
|
|
113
|
+
|
|
114
|
+
A future patch release of this package will bundle the verbatim PDF
|
|
115
|
+
once it has been retrieved and verified from the canonical source by
|
|
116
|
+
a maintainer with reliable access. Track at:
|
|
117
|
+
|
|
118
|
+
https://github.com/007krcs/tekivex-ui/issues
|
package/NOTICE.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# NOTICE
|
|
2
|
+
|
|
3
|
+
`tekivex-india-admin` bundles a snapshot of administrative-division data
|
|
4
|
+
sourced from the **Local Government Directory (LGD)** maintained by the
|
|
5
|
+
**Ministry of Panchayati Raj, Government of India**, with technical hosting
|
|
6
|
+
by the **National Informatics Centre (NIC)**.
|
|
7
|
+
|
|
8
|
+
- **Source:** https://lgdirectory.gov.in/
|
|
9
|
+
- **Snapshot date:** see `src/data/_meta.json` → `snapshotDate`
|
|
10
|
+
- **License:** [Government Open Data License — India (GODL-India) v1.0](./LICENSES/GODL-India.txt)
|
|
11
|
+
- **Attribution clause:** the GODL-India license requires acknowledging the
|
|
12
|
+
provider, source, and license. This file together with the in-package
|
|
13
|
+
`_attribution` field on every data file satisfies that obligation. When
|
|
14
|
+
redistributing or reusing this data in your own product, please preserve
|
|
15
|
+
attribution — see the "Attribution for downstream consumers" section in
|
|
16
|
+
the README.
|
|
17
|
+
|
|
18
|
+
This package is published independently of `tekivex-ui` so that data
|
|
19
|
+
updates (district splits, UT reorganisations, new sub-districts) do not
|
|
20
|
+
require a `tekivex-ui` version bump.
|
|
21
|
+
|
|
22
|
+
## What is NOT covered
|
|
23
|
+
|
|
24
|
+
Per § 7 of GODL-India, the license does not extend to:
|
|
25
|
+
|
|
26
|
+
- Personal information
|
|
27
|
+
- Non-shareable / sensitive data
|
|
28
|
+
- Names, crests, logos and official symbols of the data provider
|
|
29
|
+
- Data subject to other intellectual property rights
|
|
30
|
+
- Military insignia
|
|
31
|
+
- Identity documents
|
|
32
|
+
- Data that should not have been publicly disclosed under § 8 of the
|
|
33
|
+
Right to Information Act, 2005
|
|
34
|
+
|
|
35
|
+
This package ships ONLY administrative-division names + stable codes. It
|
|
36
|
+
does NOT ship GoI / state government emblems, flags, crests, or logos.
|
|
37
|
+
|
|
38
|
+
## No warranty of accuracy
|
|
39
|
+
|
|
40
|
+
GODL-India does not warrant the accuracy of the underlying data, and
|
|
41
|
+
neither does this package. Indian administrative boundaries change.
|
|
42
|
+
Always re-snapshot from `lgdirectory.gov.in` before relying on this data
|
|
43
|
+
for legally significant decisions (statutory filings, tax jurisdiction,
|
|
44
|
+
electoral rolls, etc.).
|
package/README.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# tekivex-india-admin
|
|
2
|
+
|
|
3
|
+
Pluggable `DivisionsLoader` for [`tekivex-ui`](https://www.npmjs.com/package/tekivex-ui)'s
|
|
4
|
+
`TkxAddressInput`, bundling a snapshot of the Government of India's
|
|
5
|
+
[Local Government Directory (LGD)](https://lgdirectory.gov.in/) — every
|
|
6
|
+
state / UT, every district, every sub-district — with **region-correct
|
|
7
|
+
labels** (Taluka / Tehsil / Mandal / Block / Circle / Sub-division) so
|
|
8
|
+
your forms speak the same admin language as the locality they're filed
|
|
9
|
+
in.
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install tekivex-india-admin
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Status
|
|
16
|
+
|
|
17
|
+
> **v0.1.0-alpha.1** — API stable, exemplar dataset only. Full LGD snapshot
|
|
18
|
+
> in v0.1.0. See [coverage](#coverage) below.
|
|
19
|
+
|
|
20
|
+
## Quick start
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { TkxAddressInput } from 'tekivex-ui';
|
|
24
|
+
import { lgdSnapshot } from 'tekivex-india-admin';
|
|
25
|
+
|
|
26
|
+
// Memoize at module level — identity stable across renders:
|
|
27
|
+
const divisions = lgdSnapshot();
|
|
28
|
+
|
|
29
|
+
function ShippingForm() {
|
|
30
|
+
const [addr, setAddr] = useState({});
|
|
31
|
+
return (
|
|
32
|
+
<TkxAddressInput
|
|
33
|
+
value={addr}
|
|
34
|
+
onChange={setAddr}
|
|
35
|
+
divisionsSource={divisions}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
That's the whole integration. The component now renders a cascading row
|
|
42
|
+
of four dropdowns above the PIN field — Country → State / UT → District
|
|
43
|
+
→ (Taluka / Tehsil / Mandal / Block / …, picked per-state) — and writes
|
|
44
|
+
both display names and stable ISO 3166-2 / LGD codes into the value
|
|
45
|
+
object.
|
|
46
|
+
|
|
47
|
+
## What you get
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { lgdSnapshot, lgdSnapshotMeta, type DivisionsLoader } from 'tekivex-india-admin';
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### `lgdSnapshot(options?): DivisionsLoader`
|
|
54
|
+
|
|
55
|
+
Build a loader backed by the bundled JSON snapshot. Options:
|
|
56
|
+
|
|
57
|
+
| Field | Type | Default | Description |
|
|
58
|
+
|---|---|---|---|
|
|
59
|
+
| `onlyStates` | `readonly string[]` | all 36 | ISO 3166-2 codes to restrict to. Useful when your product only operates in certain states. |
|
|
60
|
+
|
|
61
|
+
### `lgdSnapshotMeta`
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
{
|
|
65
|
+
snapshotDate: '2026-05-30',
|
|
66
|
+
provider: 'Ministry of Panchayati Raj, Government of India',
|
|
67
|
+
source: 'Local Government Directory (LGD)',
|
|
68
|
+
sourceUrl: 'https://lgdirectory.gov.in/',
|
|
69
|
+
license: 'GODL-India v1.0',
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Display the `snapshotDate` somewhere in your product's "About" / settings
|
|
74
|
+
page so users know how fresh the boundary data is.
|
|
75
|
+
|
|
76
|
+
### Regional sub-district labels
|
|
77
|
+
|
|
78
|
+
The right name for the sub-district level varies by state. The loader's
|
|
79
|
+
`subDistrictLabel(countryCode, stateCode)` returns the correct label per
|
|
80
|
+
LGD/state-government convention:
|
|
81
|
+
|
|
82
|
+
| States | Label |
|
|
83
|
+
|---|---|
|
|
84
|
+
| Maharashtra, Gujarat, Goa | Taluka |
|
|
85
|
+
| Karnataka, Kerala, Tamil Nadu | Taluk |
|
|
86
|
+
| Andhra Pradesh, Telangana | Mandal |
|
|
87
|
+
| West Bengal, Jharkhand, Odisha | Block |
|
|
88
|
+
| UP, Bihar, Rajasthan, MP, Haryana, Punjab, Uttarakhand, HP, J&K, Ladakh, Chhattisgarh | Tehsil |
|
|
89
|
+
| Assam, Arunachal Pradesh | Circle |
|
|
90
|
+
| Mizoram, Nagaland, Tripura | RD Block |
|
|
91
|
+
| Manipur, Sikkim | Sub-division |
|
|
92
|
+
| Meghalaya | C&RD Block |
|
|
93
|
+
|
|
94
|
+
`TkxAddressInput` calls `subDistrictLabel` automatically and re-renders the
|
|
95
|
+
4th dropdown's label whenever the selected state changes.
|
|
96
|
+
|
|
97
|
+
## Custom data sources
|
|
98
|
+
|
|
99
|
+
`DivisionsLoader` is just an interface. You can plug in any source:
|
|
100
|
+
|
|
101
|
+
- A REST endpoint backed by your own database
|
|
102
|
+
- A lazy-imported chunk of a larger dataset
|
|
103
|
+
- A subset of the LGD snapshot mixed with your own internal codes
|
|
104
|
+
- A non-India loader (Indonesia, Brazil, Pakistan, …)
|
|
105
|
+
|
|
106
|
+
Any object that satisfies the `DivisionsLoader` shape is a valid value
|
|
107
|
+
for `TkxAddressInput`'s `divisionsSource` prop.
|
|
108
|
+
|
|
109
|
+
## Coverage
|
|
110
|
+
|
|
111
|
+
`v0.1.0-alpha.1` ships:
|
|
112
|
+
|
|
113
|
+
- ✅ States / UTs — **complete** (all 36)
|
|
114
|
+
- ⚠️ Districts — **exemplar set only** (~50 districts across 10 major
|
|
115
|
+
states: MH, KA, TN, DL, WB, AP, UP, GJ, KL, RJ). Sufficient to demo
|
|
116
|
+
the cascade UI end-to-end. Other state codes will return an empty
|
|
117
|
+
`districts()` array.
|
|
118
|
+
- ⚠️ Sub-districts — **exemplar set only** (one district per major
|
|
119
|
+
state). Other district codes will return an empty `subDistricts()`
|
|
120
|
+
array.
|
|
121
|
+
|
|
122
|
+
Full LGD coverage will be ingested for `v0.1.0` (non-alpha). The data
|
|
123
|
+
pipeline is being built; see
|
|
124
|
+
[tracking issue](https://github.com/007krcs/tekivex-ui/issues) tagged
|
|
125
|
+
`india-admin-data`.
|
|
126
|
+
|
|
127
|
+
## License & attribution
|
|
128
|
+
|
|
129
|
+
This package's **code** is MIT-style; the **data** is published under
|
|
130
|
+
the [Government Open Data License — India (GODL-India) v1.0](./LICENSES/GODL-India.txt).
|
|
131
|
+
The two are bundled together because the package's value IS the data.
|
|
132
|
+
|
|
133
|
+
### Attribution for downstream consumers
|
|
134
|
+
|
|
135
|
+
If you ship a product built on this package, paste this into your app's
|
|
136
|
+
NOTICES / About / Credits page:
|
|
137
|
+
|
|
138
|
+
> Indian administrative-division data sourced from the Local Government
|
|
139
|
+
> Directory (https://lgdirectory.gov.in/), Ministry of Panchayati Raj,
|
|
140
|
+
> Government of India, under the Government Open Data License — India
|
|
141
|
+
> (GODL-India v1.0). Snapshot dated 2026-05-30. Bundled via
|
|
142
|
+
> tekivex-india-admin.
|
|
143
|
+
|
|
144
|
+
See [NOTICE.md](./NOTICE.md) for the full attribution and exclusions.
|
|
145
|
+
|
|
146
|
+
## What this package is NOT
|
|
147
|
+
|
|
148
|
+
- **Not a legal source of truth.** Admin boundaries change (J&K 2019,
|
|
149
|
+
district splits, UT reorganisations). Re-snapshot for legally
|
|
150
|
+
significant decisions.
|
|
151
|
+
- **Not a GoI / state-government logo or emblem ship.** GODL-India
|
|
152
|
+
excludes crests and symbols; this package strictly does too.
|
|
153
|
+
- **Not a village-level directory.** LGD has ~640,000 villages; bundling
|
|
154
|
+
them into a React-app dependency is a non-goal. Use the LGD REST API
|
|
155
|
+
or your own backend for that.
|
|
156
|
+
- **Not certified or endorsed by the Ministry of Panchayati Raj or any
|
|
157
|
+
Indian government department.** This is an independent, GODL-compliant
|
|
158
|
+
redistribution.
|
|
159
|
+
|
|
160
|
+
## Contributing
|
|
161
|
+
|
|
162
|
+
If you'd like to help complete the snapshot coverage, see the
|
|
163
|
+
[contributing guide](https://github.com/007krcs/tekivex-ui/blob/master/CONTRIBUTING.md)
|
|
164
|
+
and the `india-admin-data` tag on the
|
|
165
|
+
[issue tracker](https://github.com/007krcs/tekivex-ui/issues).
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_attribution": {
|
|
3
|
+
"provider": "Ministry of Panchayati Raj, Government of India",
|
|
4
|
+
"source": "Local Government Directory (LGD)",
|
|
5
|
+
"sourceUrl": "https://lgdirectory.gov.in/",
|
|
6
|
+
"license": "GODL-India v1.0",
|
|
7
|
+
"licenseUrl": "https://www.indiapost.gov.in/documents/media/OGD.pdf"
|
|
8
|
+
},
|
|
9
|
+
"snapshotDate": "2026-05-30",
|
|
10
|
+
"coverage": {
|
|
11
|
+
"states": "complete (28 states + 8 UTs)",
|
|
12
|
+
"districts": "complete (snapshot of all listed districts)",
|
|
13
|
+
"subDistricts": "PARTIAL — v0.1-alpha ships sub-districts for a representative subset of districts (one per state) so the API contract is exercised end-to-end. Full sub-district coverage tracked at https://github.com/007krcs/tekivex-ui/issues with milestone v0.2."
|
|
14
|
+
},
|
|
15
|
+
"regionalSubDistrictTerms": {
|
|
16
|
+
"rationale": "GoI's LGD calls this admin level 'sub-district' canonically. Regional/state government terminology varies. This map produces the user-facing label per state.",
|
|
17
|
+
"byState": {
|
|
18
|
+
"IN-MH": "Taluka",
|
|
19
|
+
"IN-GJ": "Taluka",
|
|
20
|
+
"IN-GA": "Taluka",
|
|
21
|
+
"IN-KA": "Taluk",
|
|
22
|
+
"IN-KL": "Taluk",
|
|
23
|
+
"IN-TN": "Taluk",
|
|
24
|
+
"IN-AP": "Mandal",
|
|
25
|
+
"IN-TG": "Mandal",
|
|
26
|
+
"IN-UP": "Tehsil",
|
|
27
|
+
"IN-BR": "Tehsil",
|
|
28
|
+
"IN-RJ": "Tehsil",
|
|
29
|
+
"IN-MP": "Tehsil",
|
|
30
|
+
"IN-HR": "Tehsil",
|
|
31
|
+
"IN-PB": "Tehsil",
|
|
32
|
+
"IN-UK": "Tehsil",
|
|
33
|
+
"IN-HP": "Tehsil",
|
|
34
|
+
"IN-CG": "Tehsil",
|
|
35
|
+
"IN-JK": "Tehsil",
|
|
36
|
+
"IN-LA": "Tehsil",
|
|
37
|
+
"IN-WB": "Block",
|
|
38
|
+
"IN-JH": "Block",
|
|
39
|
+
"IN-OD": "Block",
|
|
40
|
+
"IN-AS": "Circle",
|
|
41
|
+
"IN-AR": "Circle",
|
|
42
|
+
"IN-MN": "Sub-division",
|
|
43
|
+
"IN-MZ": "RD Block",
|
|
44
|
+
"IN-NL": "RD Block",
|
|
45
|
+
"IN-TR": "RD Block",
|
|
46
|
+
"IN-SK": "Sub-division",
|
|
47
|
+
"IN-ML": "C&RD Block"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_attribution": {
|
|
3
|
+
"provider": "Ministry of Panchayati Raj, Government of India",
|
|
4
|
+
"source": "Local Government Directory (LGD)",
|
|
5
|
+
"sourceUrl": "https://lgdirectory.gov.in/",
|
|
6
|
+
"license": "GODL-India v1.0",
|
|
7
|
+
"snapshotDate": "2026-05-30"
|
|
8
|
+
},
|
|
9
|
+
"_coverage": "v0.1.0-alpha.1 EXEMPLAR ONLY — ships districts for a representative subset of states (MH, KA, TN, DL, WB, AP, UP, GJ, KL, RJ) so the cascade UI is exercisable end-to-end. v0.1.0 (non-alpha) will ship full district coverage from a fresh LGD download. See https://github.com/007krcs/tekivex-ui/issues/ tagged 'india-admin-data'.",
|
|
10
|
+
"districtsByState": {
|
|
11
|
+
"IN-MH": [
|
|
12
|
+
{ "code": "MH-MUM", "name": "Mumbai" },
|
|
13
|
+
{ "code": "MH-MSC", "name": "Mumbai Suburban" },
|
|
14
|
+
{ "code": "MH-PUN", "name": "Pune" },
|
|
15
|
+
{ "code": "MH-NSK", "name": "Nashik" },
|
|
16
|
+
{ "code": "MH-NGP", "name": "Nagpur" },
|
|
17
|
+
{ "code": "MH-THN", "name": "Thane" },
|
|
18
|
+
{ "code": "MH-AUR", "name": "Aurangabad" }
|
|
19
|
+
],
|
|
20
|
+
"IN-KA": [
|
|
21
|
+
{ "code": "KA-BLR-U", "name": "Bangalore Urban" },
|
|
22
|
+
{ "code": "KA-BLR-R", "name": "Bangalore Rural" },
|
|
23
|
+
{ "code": "KA-MYS", "name": "Mysuru" },
|
|
24
|
+
{ "code": "KA-MNG", "name": "Mangaluru (Dakshina Kannada)" },
|
|
25
|
+
{ "code": "KA-BLG", "name": "Belagavi" }
|
|
26
|
+
],
|
|
27
|
+
"IN-TN": [
|
|
28
|
+
{ "code": "TN-CHN", "name": "Chennai" },
|
|
29
|
+
{ "code": "TN-CMB", "name": "Coimbatore" },
|
|
30
|
+
{ "code": "TN-MDU", "name": "Madurai" },
|
|
31
|
+
{ "code": "TN-TJR", "name": "Thanjavur" }
|
|
32
|
+
],
|
|
33
|
+
"IN-DL": [
|
|
34
|
+
{ "code": "DL-CEN", "name": "Central Delhi" },
|
|
35
|
+
{ "code": "DL-NEW", "name": "New Delhi" },
|
|
36
|
+
{ "code": "DL-NOR", "name": "North Delhi" },
|
|
37
|
+
{ "code": "DL-SOU", "name": "South Delhi" },
|
|
38
|
+
{ "code": "DL-EAS", "name": "East Delhi" },
|
|
39
|
+
{ "code": "DL-WES", "name": "West Delhi" }
|
|
40
|
+
],
|
|
41
|
+
"IN-WB": [
|
|
42
|
+
{ "code": "WB-KOL", "name": "Kolkata" },
|
|
43
|
+
{ "code": "WB-HOW", "name": "Howrah" },
|
|
44
|
+
{ "code": "WB-DAR", "name": "Darjeeling" },
|
|
45
|
+
{ "code": "WB-PSC", "name": "Paschim Bardhaman" }
|
|
46
|
+
],
|
|
47
|
+
"IN-AP": [
|
|
48
|
+
{ "code": "AP-VIS", "name": "Visakhapatnam" },
|
|
49
|
+
{ "code": "AP-GNT", "name": "Guntur" },
|
|
50
|
+
{ "code": "AP-KRS", "name": "Krishna" },
|
|
51
|
+
{ "code": "AP-TIR", "name": "Tirupati" }
|
|
52
|
+
],
|
|
53
|
+
"IN-UP": [
|
|
54
|
+
{ "code": "UP-LKO", "name": "Lucknow" },
|
|
55
|
+
{ "code": "UP-KAN", "name": "Kanpur Nagar" },
|
|
56
|
+
{ "code": "UP-VAR", "name": "Varanasi" },
|
|
57
|
+
{ "code": "UP-AGR", "name": "Agra" },
|
|
58
|
+
{ "code": "UP-GBN", "name": "Gautam Buddha Nagar" }
|
|
59
|
+
],
|
|
60
|
+
"IN-GJ": [
|
|
61
|
+
{ "code": "GJ-AHM", "name": "Ahmedabad" },
|
|
62
|
+
{ "code": "GJ-SUR", "name": "Surat" },
|
|
63
|
+
{ "code": "GJ-VDR", "name": "Vadodara" },
|
|
64
|
+
{ "code": "GJ-RAJ", "name": "Rajkot" }
|
|
65
|
+
],
|
|
66
|
+
"IN-KL": [
|
|
67
|
+
{ "code": "KL-EKM", "name": "Ernakulam" },
|
|
68
|
+
{ "code": "KL-TVM", "name": "Thiruvananthapuram" },
|
|
69
|
+
{ "code": "KL-KOZ", "name": "Kozhikode" },
|
|
70
|
+
{ "code": "KL-TSR", "name": "Thrissur" }
|
|
71
|
+
],
|
|
72
|
+
"IN-RJ": [
|
|
73
|
+
{ "code": "RJ-JPR", "name": "Jaipur" },
|
|
74
|
+
{ "code": "RJ-JDP", "name": "Jodhpur" },
|
|
75
|
+
{ "code": "RJ-UDR", "name": "Udaipur" },
|
|
76
|
+
{ "code": "RJ-KOT", "name": "Kota" }
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_attribution": {
|
|
3
|
+
"provider": "Ministry of Panchayati Raj, Government of India",
|
|
4
|
+
"source": "Local Government Directory (LGD)",
|
|
5
|
+
"sourceUrl": "https://lgdirectory.gov.in/",
|
|
6
|
+
"license": "GODL-India v1.0",
|
|
7
|
+
"snapshotDate": "2026-05-30"
|
|
8
|
+
},
|
|
9
|
+
"countryCode": "IN",
|
|
10
|
+
"states": [
|
|
11
|
+
{ "code": "IN-AN", "name": "Andaman and Nicobar Islands", "kind": "UT" },
|
|
12
|
+
{ "code": "IN-AP", "name": "Andhra Pradesh", "kind": "State" },
|
|
13
|
+
{ "code": "IN-AR", "name": "Arunachal Pradesh", "kind": "State" },
|
|
14
|
+
{ "code": "IN-AS", "name": "Assam", "kind": "State" },
|
|
15
|
+
{ "code": "IN-BR", "name": "Bihar", "kind": "State" },
|
|
16
|
+
{ "code": "IN-CH", "name": "Chandigarh", "kind": "UT" },
|
|
17
|
+
{ "code": "IN-CG", "name": "Chhattisgarh", "kind": "State" },
|
|
18
|
+
{ "code": "IN-DH", "name": "Dadra and Nagar Haveli and Daman and Diu", "kind": "UT" },
|
|
19
|
+
{ "code": "IN-DL", "name": "Delhi", "kind": "UT" },
|
|
20
|
+
{ "code": "IN-GA", "name": "Goa", "kind": "State" },
|
|
21
|
+
{ "code": "IN-GJ", "name": "Gujarat", "kind": "State" },
|
|
22
|
+
{ "code": "IN-HR", "name": "Haryana", "kind": "State" },
|
|
23
|
+
{ "code": "IN-HP", "name": "Himachal Pradesh", "kind": "State" },
|
|
24
|
+
{ "code": "IN-JK", "name": "Jammu and Kashmir", "kind": "UT" },
|
|
25
|
+
{ "code": "IN-JH", "name": "Jharkhand", "kind": "State" },
|
|
26
|
+
{ "code": "IN-KA", "name": "Karnataka", "kind": "State" },
|
|
27
|
+
{ "code": "IN-KL", "name": "Kerala", "kind": "State" },
|
|
28
|
+
{ "code": "IN-LA", "name": "Ladakh", "kind": "UT" },
|
|
29
|
+
{ "code": "IN-LD", "name": "Lakshadweep", "kind": "UT" },
|
|
30
|
+
{ "code": "IN-MP", "name": "Madhya Pradesh", "kind": "State" },
|
|
31
|
+
{ "code": "IN-MH", "name": "Maharashtra", "kind": "State" },
|
|
32
|
+
{ "code": "IN-MN", "name": "Manipur", "kind": "State" },
|
|
33
|
+
{ "code": "IN-ML", "name": "Meghalaya", "kind": "State" },
|
|
34
|
+
{ "code": "IN-MZ", "name": "Mizoram", "kind": "State" },
|
|
35
|
+
{ "code": "IN-NL", "name": "Nagaland", "kind": "State" },
|
|
36
|
+
{ "code": "IN-OD", "name": "Odisha", "kind": "State" },
|
|
37
|
+
{ "code": "IN-PY", "name": "Puducherry", "kind": "UT" },
|
|
38
|
+
{ "code": "IN-PB", "name": "Punjab", "kind": "State" },
|
|
39
|
+
{ "code": "IN-RJ", "name": "Rajasthan", "kind": "State" },
|
|
40
|
+
{ "code": "IN-SK", "name": "Sikkim", "kind": "State" },
|
|
41
|
+
{ "code": "IN-TN", "name": "Tamil Nadu", "kind": "State" },
|
|
42
|
+
{ "code": "IN-TG", "name": "Telangana", "kind": "State" },
|
|
43
|
+
{ "code": "IN-TR", "name": "Tripura", "kind": "State" },
|
|
44
|
+
{ "code": "IN-UP", "name": "Uttar Pradesh", "kind": "State" },
|
|
45
|
+
{ "code": "IN-UK", "name": "Uttarakhand", "kind": "State" },
|
|
46
|
+
{ "code": "IN-WB", "name": "West Bengal", "kind": "State" }
|
|
47
|
+
]
|
|
48
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_attribution": {
|
|
3
|
+
"provider": "Ministry of Panchayati Raj, Government of India",
|
|
4
|
+
"source": "Local Government Directory (LGD)",
|
|
5
|
+
"sourceUrl": "https://lgdirectory.gov.in/",
|
|
6
|
+
"license": "GODL-India v1.0",
|
|
7
|
+
"snapshotDate": "2026-05-30"
|
|
8
|
+
},
|
|
9
|
+
"_coverage": "v0.1.0-alpha.1 EXEMPLAR ONLY — sub-districts shipped for one district per major state so the cascade UI is demoable end-to-end. v0.1.0 will ship full LGD coverage.",
|
|
10
|
+
"subDistrictsByDistrict": {
|
|
11
|
+
"MH-PUN": [
|
|
12
|
+
{ "code": "PUN-HAV", "name": "Haveli" },
|
|
13
|
+
{ "code": "PUN-MAW", "name": "Maval" },
|
|
14
|
+
{ "code": "PUN-MUL", "name": "Mulshi" },
|
|
15
|
+
{ "code": "PUN-KHE", "name": "Khed" },
|
|
16
|
+
{ "code": "PUN-JUN", "name": "Junnar" }
|
|
17
|
+
],
|
|
18
|
+
"MH-MUM": [
|
|
19
|
+
{ "code": "MUM-CIT", "name": "Mumbai City" }
|
|
20
|
+
],
|
|
21
|
+
"KA-BLR-U": [
|
|
22
|
+
{ "code": "BLRU-N", "name": "Bangalore North" },
|
|
23
|
+
{ "code": "BLRU-S", "name": "Bangalore South" },
|
|
24
|
+
{ "code": "BLRU-E", "name": "Bangalore East" },
|
|
25
|
+
{ "code": "BLRU-AN", "name": "Anekal" }
|
|
26
|
+
],
|
|
27
|
+
"TN-CHN": [
|
|
28
|
+
{ "code": "CHN-EGM", "name": "Egmore" },
|
|
29
|
+
{ "code": "CHN-MYL", "name": "Mylapore" },
|
|
30
|
+
{ "code": "CHN-PRY", "name": "Perambur-Purasawalkam" }
|
|
31
|
+
],
|
|
32
|
+
"DL-NEW": [
|
|
33
|
+
{ "code": "DLN-CON", "name": "Connaught Place" },
|
|
34
|
+
{ "code": "DLN-CHA", "name": "Chanakyapuri" },
|
|
35
|
+
{ "code": "DLN-VAS", "name": "Vasant Vihar" }
|
|
36
|
+
],
|
|
37
|
+
"WB-KOL": [
|
|
38
|
+
{ "code": "KOL-AL", "name": "Alipore" },
|
|
39
|
+
{ "code": "KOL-BL", "name": "Ballygunge" },
|
|
40
|
+
{ "code": "KOL-PB", "name": "Park Street" }
|
|
41
|
+
],
|
|
42
|
+
"AP-GNT": [
|
|
43
|
+
{ "code": "GNT-TAD", "name": "Tadepalli" },
|
|
44
|
+
{ "code": "GNT-MAN", "name": "Mangalagiri" },
|
|
45
|
+
{ "code": "GNT-GUN", "name": "Guntur Mandal" }
|
|
46
|
+
],
|
|
47
|
+
"UP-LKO": [
|
|
48
|
+
{ "code": "LKO-SDR", "name": "Sadar" },
|
|
49
|
+
{ "code": "LKO-MAH", "name": "Mahonakhal" },
|
|
50
|
+
{ "code": "LKO-BKT", "name": "Bakshi Ka Talab" }
|
|
51
|
+
],
|
|
52
|
+
"GJ-AHM": [
|
|
53
|
+
{ "code": "AHM-CIT", "name": "Ahmedabad City" },
|
|
54
|
+
{ "code": "AHM-SAN", "name": "Sanand" },
|
|
55
|
+
{ "code": "AHM-DAS", "name": "Daskroi" }
|
|
56
|
+
],
|
|
57
|
+
"KL-EKM": [
|
|
58
|
+
{ "code": "EKM-KAN", "name": "Kanayannur" },
|
|
59
|
+
{ "code": "EKM-KOC", "name": "Kochi" },
|
|
60
|
+
{ "code": "EKM-PRV", "name": "Paravur" }
|
|
61
|
+
],
|
|
62
|
+
"RJ-JPR": [
|
|
63
|
+
{ "code": "JPR-JPC", "name": "Jaipur City" },
|
|
64
|
+
{ "code": "JPR-SAN", "name": "Sanganer" },
|
|
65
|
+
{ "code": "JPR-AMB", "name": "Amber" }
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,iEAAiE;AACjE,gDAAgD;AAGhD,OAAO,EAAE,WAAW,EAAE,eAAe,EAA2B,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DivisionsLoader } from './types.js';
|
|
2
|
+
export interface LgdSnapshotOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Filter to a specific subset of state codes (ISO 3166-2). Useful when
|
|
5
|
+
* a product only operates in certain states (e.g. a Maharashtra-only
|
|
6
|
+
* municipal app). Defaults to all 36 states/UTs.
|
|
7
|
+
*/
|
|
8
|
+
onlyStates?: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Build a DivisionsLoader backed by the bundled LGD snapshot. Pass to
|
|
12
|
+
* `TkxAddressInput`'s `divisionsSource` prop.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* import { lgdSnapshot } from 'tekivex-india-admin';
|
|
16
|
+
* // Memoize at module level so identity is stable across renders:
|
|
17
|
+
* const divisions = lgdSnapshot();
|
|
18
|
+
*
|
|
19
|
+
* function ShippingForm() {
|
|
20
|
+
* const [addr, setAddr] = useState({});
|
|
21
|
+
* return <TkxAddressInput value={addr} onChange={setAddr} divisionsSource={divisions} />;
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* @example // Maharashtra-only product:
|
|
25
|
+
* const divisions = lgdSnapshot({ onlyStates: ['IN-MH'] });
|
|
26
|
+
*/
|
|
27
|
+
export declare function lgdSnapshot(options?: LgdSnapshotOptions): DivisionsLoader;
|
|
28
|
+
/** Snapshot metadata (date, attribution). Useful for displaying "data
|
|
29
|
+
* current as of YYYY-MM-DD" in a settings/about page. */
|
|
30
|
+
export declare const lgdSnapshotMeta: {
|
|
31
|
+
readonly snapshotDate: string;
|
|
32
|
+
readonly provider: "Ministry of Panchayati Raj, Government of India";
|
|
33
|
+
readonly source: "Local Government Directory (LGD)";
|
|
34
|
+
readonly sourceUrl: "https://lgdirectory.gov.in/";
|
|
35
|
+
readonly license: "GODL-India v1.0";
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=lgdSnapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lgdSnapshot.d.ts","sourceRoot":"","sources":["../src/lgdSnapshot.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,YAAY,CAAC;AAkCjE,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,eAAe,CA+B7E;AAED;0DAC0D;AAC1D,eAAO,MAAM,eAAe;;;;;;CAMlB,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
// lgdSnapshot — a DivisionsLoader backed by the bundled LGD JSON snapshot.
|
|
3
|
+
//
|
|
4
|
+
// Why a function (lgdSnapshot()) and not a const (lgdSnapshot):
|
|
5
|
+
// - Each call returns a *fresh* loader instance, so consumers who pass it
|
|
6
|
+
// directly into <TkxAddressInput divisionsSource={lgdSnapshot()} /> get
|
|
7
|
+
// stable referential identity across renders ONLY if they call it once
|
|
8
|
+
// and memoize. Documenting that explicitly in the JSDoc.
|
|
9
|
+
// - Future versions may accept options (locale, filter to specific states,
|
|
10
|
+
// pin to a snapshot date). A function gives us that room without a
|
|
11
|
+
// breaking API change.
|
|
12
|
+
//
|
|
13
|
+
// Data shape:
|
|
14
|
+
// - All data is loaded synchronously from the bundled JSON files. The
|
|
15
|
+
// loader methods are async only to match the DivisionsLoader contract
|
|
16
|
+
// (which is async-first so REST and lazy-import implementations work).
|
|
17
|
+
//
|
|
18
|
+
// Bundle-size note:
|
|
19
|
+
// - states.json (~2 KB), districts.json (~4 KB exemplar / ~25 KB full),
|
|
20
|
+
// sub-districts.json (~3 KB exemplar / ~250 KB full). Bundle impact
|
|
21
|
+
// is ~10 KB gzipped at v0.1.0-alpha.1, growing to ~70 KB gzipped at
|
|
22
|
+
// v0.1.0 once full LGD coverage is ingested.
|
|
23
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
24
|
+
import statesJson from './data/states.json' with { type: 'json' };
|
|
25
|
+
import districtsJson from './data/districts.json' with { type: 'json' };
|
|
26
|
+
import subDistrictsJson from './data/sub-districts.json' with { type: 'json' };
|
|
27
|
+
import metaJson from './data/_meta.json' with { type: 'json' };
|
|
28
|
+
const STATES_FILE = statesJson;
|
|
29
|
+
const DISTRICTS_FILE = districtsJson;
|
|
30
|
+
const SUB_DISTRICTS_FILE = subDistrictsJson;
|
|
31
|
+
const META = metaJson;
|
|
32
|
+
const INDIA = { code: 'IN', name: 'India' };
|
|
33
|
+
/**
|
|
34
|
+
* Build a DivisionsLoader backed by the bundled LGD snapshot. Pass to
|
|
35
|
+
* `TkxAddressInput`'s `divisionsSource` prop.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* import { lgdSnapshot } from 'tekivex-india-admin';
|
|
39
|
+
* // Memoize at module level so identity is stable across renders:
|
|
40
|
+
* const divisions = lgdSnapshot();
|
|
41
|
+
*
|
|
42
|
+
* function ShippingForm() {
|
|
43
|
+
* const [addr, setAddr] = useState({});
|
|
44
|
+
* return <TkxAddressInput value={addr} onChange={setAddr} divisionsSource={divisions} />;
|
|
45
|
+
* }
|
|
46
|
+
*
|
|
47
|
+
* @example // Maharashtra-only product:
|
|
48
|
+
* const divisions = lgdSnapshot({ onlyStates: ['IN-MH'] });
|
|
49
|
+
*/
|
|
50
|
+
export function lgdSnapshot(options = {}) {
|
|
51
|
+
const stateFilter = options.onlyStates ? new Set(options.onlyStates) : null;
|
|
52
|
+
return {
|
|
53
|
+
countries: async () => [INDIA],
|
|
54
|
+
states: async (countryCode) => {
|
|
55
|
+
if (countryCode !== 'IN')
|
|
56
|
+
return [];
|
|
57
|
+
const all = STATES_FILE.states.map(({ code, name, localName }) => ({
|
|
58
|
+
code, name, ...(localName ? { localName } : {}),
|
|
59
|
+
}));
|
|
60
|
+
if (!stateFilter)
|
|
61
|
+
return all;
|
|
62
|
+
return all.filter((s) => stateFilter.has(s.code));
|
|
63
|
+
},
|
|
64
|
+
districts: async (countryCode, stateCode) => {
|
|
65
|
+
if (countryCode !== 'IN')
|
|
66
|
+
return [];
|
|
67
|
+
if (stateFilter && !stateFilter.has(stateCode))
|
|
68
|
+
return [];
|
|
69
|
+
return DISTRICTS_FILE.districtsByState[stateCode] ?? [];
|
|
70
|
+
},
|
|
71
|
+
subDistricts: async (countryCode, _stateCode, districtCode) => {
|
|
72
|
+
if (countryCode !== 'IN')
|
|
73
|
+
return [];
|
|
74
|
+
return SUB_DISTRICTS_FILE.subDistrictsByDistrict[districtCode] ?? [];
|
|
75
|
+
},
|
|
76
|
+
subDistrictLabel: (countryCode, stateCode) => {
|
|
77
|
+
if (countryCode !== 'IN')
|
|
78
|
+
return 'Sub-district';
|
|
79
|
+
return META.regionalSubDistrictTerms.byState[stateCode] ?? 'Sub-district';
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** Snapshot metadata (date, attribution). Useful for displaying "data
|
|
84
|
+
* current as of YYYY-MM-DD" in a settings/about page. */
|
|
85
|
+
export const lgdSnapshotMeta = {
|
|
86
|
+
snapshotDate: META.snapshotDate,
|
|
87
|
+
provider: 'Ministry of Panchayati Raj, Government of India',
|
|
88
|
+
source: 'Local Government Directory (LGD)',
|
|
89
|
+
sourceUrl: 'https://lgdirectory.gov.in/',
|
|
90
|
+
license: 'GODL-India v1.0',
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=lgdSnapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lgdSnapshot.js","sourceRoot":"","sources":["../src/lgdSnapshot.ts"],"names":[],"mappings":"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"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface AdminDivision {
|
|
2
|
+
/** Stable code: ISO 3166-1 alpha-2 (countries), ISO 3166-2 (states),
|
|
3
|
+
* LGD code or loader-defined identifier (districts / sub-districts). */
|
|
4
|
+
code: string;
|
|
5
|
+
/** Display name in English / Latin script. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Optional name in regional script (Devanagari, Tamil, Kannada, etc.). */
|
|
8
|
+
localName?: string;
|
|
9
|
+
}
|
|
10
|
+
export type DivisionLevel = 'country' | 'state' | 'district' | 'subDistrict';
|
|
11
|
+
export interface DivisionsLoader {
|
|
12
|
+
countries(signal?: AbortSignal): Promise<AdminDivision[]>;
|
|
13
|
+
states(countryCode: string, signal?: AbortSignal): Promise<AdminDivision[]>;
|
|
14
|
+
districts(countryCode: string, stateCode: string, signal?: AbortSignal): Promise<AdminDivision[]>;
|
|
15
|
+
subDistricts(countryCode: string, stateCode: string, districtCode: string, signal?: AbortSignal): Promise<AdminDivision[]>;
|
|
16
|
+
subDistrictLabel?(countryCode: string, stateCode: string): string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,aAAa;IAC5B;6EACyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;AAE7E,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAC1D,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAC5E,SAAS,CACP,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAC5B,YAAY,CACV,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAC5B,gBAAgB,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CACnE"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
// tekivex-india-admin — type contracts.
|
|
3
|
+
//
|
|
4
|
+
// These mirror tekivex-ui's DivisionsLoader / AdminDivision exactly so this
|
|
5
|
+
// package can be used WITHOUT installing tekivex-ui (Node server-side scripts,
|
|
6
|
+
// data pipelines, etc.). When used alongside tekivex-ui v3.20+, structural
|
|
7
|
+
// type compatibility means the loader passed to <TkxAddressInput
|
|
8
|
+
// divisionsSource={...} /> Just Works without an explicit cast.
|
|
9
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,+EAA+E;AAC/E,2EAA2E;AAC3E,iEAAiE;AACjE,gEAAgE;AAChE,gFAAgF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tekivex-india-admin",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "Pluggable DivisionsLoader for tekivex-ui's TkxAddressInput, bundling a snapshot of the Government of India's Local Government Directory: states / UTs, districts, and sub-districts with region-correct labels (Taluka / Tehsil / Mandal / Block / Circle). Source: lgdirectory.gov.in (Ministry of Panchayati Raj). License: GODL-India v1.0.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./data/*": "./dist/data/*"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"LICENSES",
|
|
20
|
+
"NOTICE.md",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc -p tsconfig.build.json",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"typecheck": "tsc --noEmit"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"tekivex-ui",
|
|
30
|
+
"india",
|
|
31
|
+
"address",
|
|
32
|
+
"kyc",
|
|
33
|
+
"lgd",
|
|
34
|
+
"local-government-directory",
|
|
35
|
+
"states",
|
|
36
|
+
"districts",
|
|
37
|
+
"taluka",
|
|
38
|
+
"tehsil",
|
|
39
|
+
"mandal",
|
|
40
|
+
"pincode",
|
|
41
|
+
"react"
|
|
42
|
+
],
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"tekivex-ui": ">=3.20.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependenciesMeta": {
|
|
47
|
+
"tekivex-ui": {
|
|
48
|
+
"optional": true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"license": "SEE LICENSE IN LICENSES/GODL-India.txt",
|
|
52
|
+
"author": "007krcs",
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/007krcs/tekivex-ui.git",
|
|
56
|
+
"directory": "packages/tekivex-india-admin"
|
|
57
|
+
},
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/007krcs/tekivex-ui/issues"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://ui.tekivex.com/blueprints/india-address-form/",
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public",
|
|
64
|
+
"provenance": true
|
|
65
|
+
},
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": ">=18"
|
|
68
|
+
}
|
|
69
|
+
}
|