@theseam/ui-common 1.0.2-beta.51 → 1.0.2-beta.57
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/fesm2022/theseam-ui-common-graphql.mjs +261 -67
- package/fesm2022/theseam-ui-common-graphql.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-states-counties-map.mjs +317 -0
- package/fesm2022/theseam-ui-common-states-counties-map.mjs.map +1 -0
- package/graphql/index.d.ts +186 -4
- package/package.json +5 -1
- package/states-counties-map/index.d.ts +120 -0
- package/states-counties-map/package.json +3 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken, Provider } from '@angular/core';
|
|
3
|
+
import { Feature, Geometry } from 'geojson';
|
|
4
|
+
import { Topology } from 'topojson-specification';
|
|
5
|
+
import { ComponentHarness, TestElement } from '@angular/cdk/testing';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Payload emitted by `countyClick` / `countyEnter` / `countyLeave` outputs.
|
|
9
|
+
*
|
|
10
|
+
* `id` is the FIPS county code as a string (e.g., `"01001"`), matching the
|
|
11
|
+
* format consumers pass to `selectedCountyIds`. `feature` is the raw
|
|
12
|
+
* GeoJSON feature produced by `topojson.feature(...)`.
|
|
13
|
+
*/
|
|
14
|
+
interface TheSeamStatesCountiesMapCountyEvent {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly feature: Feature<Geometry>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare class TheSeamStatesCountiesMapComponent {
|
|
20
|
+
/** FIPS state code (e.g., `"48"` for Texas). Null/undefined renders nothing. */
|
|
21
|
+
readonly stateNumber: _angular_core.InputSignal<string | null | undefined>;
|
|
22
|
+
/** FIPS county codes to highlight with the `county-selected` class. */
|
|
23
|
+
readonly selectedCountyIds: _angular_core.InputSignal<readonly string[]>;
|
|
24
|
+
/** Enable pointer interaction (click, enter, leave) on counties. */
|
|
25
|
+
readonly interactive: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
26
|
+
readonly countyClick: _angular_core.OutputEmitterRef<TheSeamStatesCountiesMapCountyEvent>;
|
|
27
|
+
readonly countyEnter: _angular_core.OutputEmitterRef<TheSeamStatesCountiesMapCountyEvent>;
|
|
28
|
+
readonly countyLeave: _angular_core.OutputEmitterRef<TheSeamStatesCountiesMapCountyEvent>;
|
|
29
|
+
private readonly _wrapper;
|
|
30
|
+
private readonly _data;
|
|
31
|
+
private _topologyPromise;
|
|
32
|
+
private _lastRenderedState;
|
|
33
|
+
private _lastRenderedInteractive;
|
|
34
|
+
private _renderSerial;
|
|
35
|
+
constructor();
|
|
36
|
+
private _loadTopology;
|
|
37
|
+
private _render;
|
|
38
|
+
private _updateSelectedCounties;
|
|
39
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TheSeamStatesCountiesMapComponent, never>;
|
|
40
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TheSeamStatesCountiesMapComponent, "seam-states-counties-map", never, { "stateNumber": { "alias": "stateNumber"; "required": false; "isSignal": true; }; "selectedCountyIds": { "alias": "selectedCountyIds"; "required": false; "isSignal": true; }; "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; }, { "countyClick": "countyClick"; "countyEnter": "countyEnter"; "countyLeave": "countyLeave"; }, never, never, true, never>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Configuration for `TheSeamStatesCountiesMapComponent`. */
|
|
44
|
+
interface TheSeamStatesCountiesMapConfig {
|
|
45
|
+
/**
|
|
46
|
+
* URL to the TopoJSON topology file.
|
|
47
|
+
*
|
|
48
|
+
* Defaults to `/assets/geoData/us.json` when the token is not provided.
|
|
49
|
+
* The file is not shipped with the library — each consuming app must
|
|
50
|
+
* place a compatible topology at this path or provide a different URL
|
|
51
|
+
* via `provideStatesCountiesMap({ topologyUrl })`.
|
|
52
|
+
*/
|
|
53
|
+
readonly topologyUrl?: string;
|
|
54
|
+
}
|
|
55
|
+
/** Default URL used when no config is provided. */
|
|
56
|
+
declare const THE_SEAM_STATES_COUNTIES_MAP_DEFAULT_URL = "/assets/geoData/us.json";
|
|
57
|
+
/** DI token for `TheSeamStatesCountiesMapConfig`. */
|
|
58
|
+
declare const THE_SEAM_STATES_COUNTIES_MAP_CONFIG: InjectionToken<TheSeamStatesCountiesMapConfig>;
|
|
59
|
+
/**
|
|
60
|
+
* Register configuration for the states-counties map.
|
|
61
|
+
*
|
|
62
|
+
* ```ts
|
|
63
|
+
* bootstrapApplication(AppComponent, {
|
|
64
|
+
* providers: [
|
|
65
|
+
* provideStatesCountiesMap({ topologyUrl: '/static/us.json' }),
|
|
66
|
+
* ],
|
|
67
|
+
* })
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
declare function provideStatesCountiesMap(config: TheSeamStatesCountiesMapConfig): Provider;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Loads and caches TopoJSON topology data for the states/counties map.
|
|
74
|
+
*
|
|
75
|
+
* Provided in root so that multiple component instances share a single
|
|
76
|
+
* in-flight/cached request per URL.
|
|
77
|
+
*/
|
|
78
|
+
declare class TheSeamStatesCountiesMapDataService {
|
|
79
|
+
private readonly _config;
|
|
80
|
+
private readonly _cache;
|
|
81
|
+
/**
|
|
82
|
+
* Load the topology from the configured URL (or an explicit override).
|
|
83
|
+
* Concurrent calls for the same URL share a single fetch promise.
|
|
84
|
+
*/
|
|
85
|
+
load(url?: string): Promise<Topology>;
|
|
86
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TheSeamStatesCountiesMapDataService, never>;
|
|
87
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<TheSeamStatesCountiesMapDataService>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Harness for `TheSeamStatesCountiesMapComponent`. Designed for use in both
|
|
92
|
+
* TestBed and Storybook (via `@marklb/storybook-harness`).
|
|
93
|
+
*/
|
|
94
|
+
declare class TheSeamStatesCountiesMapHarness extends ComponentHarness {
|
|
95
|
+
static hostSelector: string;
|
|
96
|
+
private readonly _wrapper;
|
|
97
|
+
private readonly _svg;
|
|
98
|
+
/** Whether the SVG has been rendered yet. */
|
|
99
|
+
hasRendered(): Promise<boolean>;
|
|
100
|
+
/** Returns all county path elements that have been rendered. */
|
|
101
|
+
getCountyPaths(): Promise<TestElement[]>;
|
|
102
|
+
/** Returns the path for a single county by its FIPS id, or null. */
|
|
103
|
+
getCountyPath(countyId: string): Promise<TestElement | null>;
|
|
104
|
+
/** Ids of every county currently marked `county-selected`. */
|
|
105
|
+
getSelectedCountyIds(): Promise<string[]>;
|
|
106
|
+
/** Click a county by FIPS id. Throws if the county is not rendered. */
|
|
107
|
+
clickCounty(countyId: string): Promise<void>;
|
|
108
|
+
/** Simulate pointer entering a county area. Throws if the county is not rendered. */
|
|
109
|
+
enterCounty(countyId: string): Promise<void>;
|
|
110
|
+
/** Simulate pointer leaving a county area by hovering away from it. */
|
|
111
|
+
leaveCounty(countyId: string): Promise<void>;
|
|
112
|
+
/** Rendered viewport dimensions, for layout-sensitive assertions. */
|
|
113
|
+
getWrapperSize(): Promise<{
|
|
114
|
+
width: number;
|
|
115
|
+
height: number;
|
|
116
|
+
}>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { THE_SEAM_STATES_COUNTIES_MAP_CONFIG, THE_SEAM_STATES_COUNTIES_MAP_DEFAULT_URL, TheSeamStatesCountiesMapComponent, TheSeamStatesCountiesMapDataService, TheSeamStatesCountiesMapHarness, provideStatesCountiesMap };
|
|
120
|
+
export type { TheSeamStatesCountiesMapConfig, TheSeamStatesCountiesMapCountyEvent };
|