@moatamed-sce/ui-components 0.1.4 → 0.1.7
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 +0 -0
- package/fesm2022/moatamed-sce-ui-components-maps.mjs +1326 -0
- package/fesm2022/moatamed-sce-ui-components-maps.mjs.map +1 -0
- package/fesm2022/moatamed-sce-ui-components.mjs +15538 -6803
- package/fesm2022/moatamed-sce-ui-components.mjs.map +1 -1
- package/package.json +13 -2
- package/types/moatamed-sce-ui-components-maps.d.ts +220 -0
- package/types/moatamed-sce-ui-components.d.ts +6059 -1035
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moatamed-sce/ui-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "SCE Platform design system — presentational Angular components.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
@@ -13,8 +13,12 @@
|
|
|
13
13
|
"@angular/forms": "^21.0.0",
|
|
14
14
|
"@angular/platform-browser": "^21.0.0",
|
|
15
15
|
"@angular/router": "^21.0.0",
|
|
16
|
+
"@hugeicons/angular": "^1.0.10",
|
|
17
|
+
"@hugeicons/core-free-icons": "^4.2.3",
|
|
18
|
+
"@moatamed-sce/core": "^0.1.7",
|
|
19
|
+
"@moatamed-sce/form-engine": "^0.1.7",
|
|
20
|
+
"@moatamed-sce/form-schema": "^0.1.7",
|
|
16
21
|
"@ngx-translate/core": "^18.0.0",
|
|
17
|
-
"@moatamed-sce/core": "^0.1.4",
|
|
18
22
|
"leaflet": "^1.9.0",
|
|
19
23
|
"ngx-image-cropper": "^9.0.0",
|
|
20
24
|
"primeng": "^21.0.0",
|
|
@@ -22,6 +26,9 @@
|
|
|
22
26
|
"rxjs": "^7.8.0"
|
|
23
27
|
},
|
|
24
28
|
"peerDependenciesMeta": {
|
|
29
|
+
"@hugeicons/core-free-icons": {
|
|
30
|
+
"optional": true
|
|
31
|
+
},
|
|
25
32
|
"leaflet": {
|
|
26
33
|
"optional": true
|
|
27
34
|
},
|
|
@@ -65,6 +72,10 @@
|
|
|
65
72
|
".": {
|
|
66
73
|
"types": "./types/moatamed-sce-ui-components.d.ts",
|
|
67
74
|
"default": "./fesm2022/moatamed-sce-ui-components.mjs"
|
|
75
|
+
},
|
|
76
|
+
"./maps": {
|
|
77
|
+
"types": "./types/moatamed-sce-ui-components-maps.d.ts",
|
|
78
|
+
"default": "./fesm2022/moatamed-sce-ui-components-maps.mjs"
|
|
68
79
|
}
|
|
69
80
|
},
|
|
70
81
|
"type": "module"
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnDestroy, ElementRef, AfterViewInit, OnChanges, SimpleChanges, OnInit } from '@angular/core';
|
|
3
|
+
import * as i1 from '@moatamed-sce/core';
|
|
4
|
+
import { BaladyPointDataResult, BaladyRegionItem, BaladyCityItem, BaladyDistrictItem } from '@moatamed-sce/core';
|
|
5
|
+
import { SafeResourceUrl } from '@angular/platform-browser';
|
|
6
|
+
|
|
7
|
+
/** A pin on `sce-osm-leaflet-map`, optionally draggable and carrying raw `popupHtml` for its popup bubble. */
|
|
8
|
+
interface OsmMapMarker {
|
|
9
|
+
lat: number;
|
|
10
|
+
lng: number;
|
|
11
|
+
popupHtml?: string;
|
|
12
|
+
draggable?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** OpenStreetMap Leaflet map that lazily loads Leaflet, renders the given markers and emits map clicks and marker drag-ends; setting `interactive` to false disables panning, zooming, the zoom control and click events. */
|
|
15
|
+
declare class SceOsmLeafletMapComponent implements OnDestroy {
|
|
16
|
+
readonly latitude: _angular_core.InputSignal<number>;
|
|
17
|
+
readonly longitude: _angular_core.InputSignal<number>;
|
|
18
|
+
readonly zoom: _angular_core.InputSignal<number>;
|
|
19
|
+
readonly markers: _angular_core.InputSignal<OsmMapMarker[]>;
|
|
20
|
+
readonly interactive: _angular_core.InputSignal<boolean>;
|
|
21
|
+
readonly mapClick: _angular_core.OutputEmitterRef<{
|
|
22
|
+
lat: number;
|
|
23
|
+
lng: number;
|
|
24
|
+
}>;
|
|
25
|
+
readonly markerDragEnd: _angular_core.OutputEmitterRef<{
|
|
26
|
+
lat: number;
|
|
27
|
+
lng: number;
|
|
28
|
+
index: number;
|
|
29
|
+
}>;
|
|
30
|
+
protected mapEl: _angular_core.Signal<ElementRef<HTMLElement> | undefined>;
|
|
31
|
+
private map;
|
|
32
|
+
private markerLayer;
|
|
33
|
+
private L;
|
|
34
|
+
private cancelLeafletResize;
|
|
35
|
+
private initMap;
|
|
36
|
+
private renderMarkers;
|
|
37
|
+
ngOnDestroy(): void;
|
|
38
|
+
private readonly bindHost;
|
|
39
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SceOsmLeafletMapComponent, never>;
|
|
40
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SceOsmLeafletMapComponent, "sce-osm-leaflet-map", never, { "latitude": { "alias": "latitude"; "required": false; "isSignal": true; }; "longitude": { "alias": "longitude"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; "markers": { "alias": "markers"; "required": false; "isSignal": true; }; "interactive": { "alias": "interactive"; "required": false; "isSignal": true; }; }, { "mapClick": "mapClick"; "markerDragEnd": "markerDragEnd"; }, never, never, true, [{ directive: typeof i1.SceVariantDirective; inputs: { "sceVariant": "sceVariant"; "sceDensity": "sceDensity"; }; outputs: {}; }]>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** One engineering office plotted on the offices map; `approximate` marks a coordinate derived from a city or region rather than a precise address. */
|
|
44
|
+
interface SceOsmOfficeMapPoint {
|
|
45
|
+
id: string | number;
|
|
46
|
+
name: string;
|
|
47
|
+
latitude: number;
|
|
48
|
+
longitude: number;
|
|
49
|
+
approximate?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** React: google-maps/osm-offices-map.tsx */
|
|
52
|
+
declare class SceOsmOfficesMapComponent implements AfterViewInit, OnChanges, OnDestroy {
|
|
53
|
+
private readonly language;
|
|
54
|
+
mapRoot?: ElementRef<HTMLDivElement>;
|
|
55
|
+
private readonly translate;
|
|
56
|
+
readonly offices: _angular_core.InputSignal<SceOsmOfficeMapPoint[]>;
|
|
57
|
+
readonly selectedOfficeId: _angular_core.InputSignal<string | number | undefined>;
|
|
58
|
+
readonly showTooltip: _angular_core.InputSignal<boolean>;
|
|
59
|
+
readonly ariaLabelInput: _angular_core.InputSignal<string>;
|
|
60
|
+
readonly ariaLabel: _angular_core.Signal<any>;
|
|
61
|
+
readonly selectOffice: _angular_core.OutputEmitterRef<string | number>;
|
|
62
|
+
readonly ready: _angular_core.OutputEmitterRef<void>;
|
|
63
|
+
readonly mapError: _angular_core.OutputEmitterRef<void>;
|
|
64
|
+
private map;
|
|
65
|
+
private markers;
|
|
66
|
+
private markerByOfficeId;
|
|
67
|
+
private mapReady;
|
|
68
|
+
private disposed;
|
|
69
|
+
private icon;
|
|
70
|
+
private cancelLeafletResize;
|
|
71
|
+
ngAfterViewInit(): void;
|
|
72
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
73
|
+
ngOnDestroy(): void;
|
|
74
|
+
private bootMap;
|
|
75
|
+
private syncMarkers;
|
|
76
|
+
private queueLeafletResize;
|
|
77
|
+
private focusSelectedOffice;
|
|
78
|
+
private clearMarkers;
|
|
79
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SceOsmOfficesMapComponent, never>;
|
|
80
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SceOsmOfficesMapComponent, "sce-osm-offices-map", never, { "offices": { "alias": "offices"; "required": false; "isSignal": true; }; "selectedOfficeId": { "alias": "selectedOfficeId"; "required": false; "isSignal": true; }; "showTooltip": { "alias": "showTooltip"; "required": false; "isSignal": true; }; "ariaLabelInput": { "alias": "ariaLabelInput"; "required": false; "isSignal": true; }; }, { "selectOffice": "selectOffice"; "ready": "ready"; "mapError": "mapError"; }, never, never, true, [{ directive: typeof i1.SceVariantDirective; inputs: { "sceVariant": "sceVariant"; "sceDensity": "sceDensity"; }; outputs: {}; }]>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** A position chosen in `sce-osm-location-picker`: coordinates plus the reverse-geocoded address when Nominatim returned one. */
|
|
84
|
+
interface LocationPickerValue {
|
|
85
|
+
lat: number;
|
|
86
|
+
lng: number;
|
|
87
|
+
address?: string;
|
|
88
|
+
}
|
|
89
|
+
/** Location picker pairing an OSM Leaflet map with a Nominatim search box, which validates every clicked, dragged or searched position before placing a draggable pin and emitting it with its reverse-geocoded address. */
|
|
90
|
+
declare class SceOsmLocationPickerComponent {
|
|
91
|
+
readonly initialLat: _angular_core.InputSignal<number>;
|
|
92
|
+
readonly initialLng: _angular_core.InputSignal<number>;
|
|
93
|
+
readonly zoom: _angular_core.InputSignal<number>;
|
|
94
|
+
readonly locale: _angular_core.InputSignal<"ar" | "en">;
|
|
95
|
+
readonly locationSelect: _angular_core.OutputEmitterRef<LocationPickerValue>;
|
|
96
|
+
private readonly nominatim;
|
|
97
|
+
private readonly mapValidation;
|
|
98
|
+
private readonly toast;
|
|
99
|
+
private readonly destroyRef;
|
|
100
|
+
protected searchQuery: string;
|
|
101
|
+
protected isSearching: _angular_core.WritableSignal<boolean>;
|
|
102
|
+
protected currentLat: _angular_core.WritableSignal<number>;
|
|
103
|
+
protected currentLng: _angular_core.WritableSignal<number>;
|
|
104
|
+
protected selectedLocation: _angular_core.WritableSignal<LocationPickerValue | null>;
|
|
105
|
+
protected readonly selectedCoordsLabel: _angular_core.Signal<string>;
|
|
106
|
+
protected currentMarkers: _angular_core.WritableSignal<OsmMapMarker[]>;
|
|
107
|
+
onMapClick(coords: {
|
|
108
|
+
lat: number;
|
|
109
|
+
lng: number;
|
|
110
|
+
}): void;
|
|
111
|
+
onMarkerDragEnd(event: {
|
|
112
|
+
lat: number;
|
|
113
|
+
lng: number;
|
|
114
|
+
}): void;
|
|
115
|
+
private validateAndPlacePin;
|
|
116
|
+
private placePin;
|
|
117
|
+
onSearch(): void;
|
|
118
|
+
private readonly bindHost;
|
|
119
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SceOsmLocationPickerComponent, never>;
|
|
120
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SceOsmLocationPickerComponent, "sce-osm-location-picker", never, { "initialLat": { "alias": "initialLat"; "required": false; "isSignal": true; }; "initialLng": { "alias": "initialLng"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; }, { "locationSelect": "locationSelect"; }, never, never, true, [{ directive: typeof i1.SceVariantDirective; inputs: { "sceVariant": "sceVariant"; "sceDensity": "sceDensity"; }; outputs: {}; }]>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Read-only map of an office's location: a Leaflet map with a marker when valid coordinates are given, a Google Maps embed built from the address when they are not, and a "not specified" fallback when neither is available. */
|
|
124
|
+
declare class SceOfficeLocationMapComponent implements AfterViewInit, OnDestroy {
|
|
125
|
+
private readonly sanitizer;
|
|
126
|
+
readonly latitude: _angular_core.InputSignal<number | null | undefined>;
|
|
127
|
+
readonly longitude: _angular_core.InputSignal<number | null | undefined>;
|
|
128
|
+
readonly address: _angular_core.InputSignal<string | undefined>;
|
|
129
|
+
readonly emptyLabel: _angular_core.InputSignal<string | undefined>;
|
|
130
|
+
mapContainer?: ElementRef<HTMLDivElement>;
|
|
131
|
+
private map;
|
|
132
|
+
private cancelLeafletResize;
|
|
133
|
+
readonly hasCoords: _angular_core.Signal<boolean>;
|
|
134
|
+
readonly googleEmbedUrl: _angular_core.Signal<SafeResourceUrl | null>;
|
|
135
|
+
ngAfterViewInit(): void;
|
|
136
|
+
ngOnDestroy(): void;
|
|
137
|
+
private initLeaflet;
|
|
138
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SceOfficeLocationMapComponent, never>;
|
|
139
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SceOfficeLocationMapComponent, "sce-office-location-map", never, { "latitude": { "alias": "latitude"; "required": false; "isSignal": true; }; "longitude": { "alias": "longitude"; "required": false; "isSignal": true; }; "address": { "alias": "address"; "required": false; "isSignal": true; }; "emptyLabel": { "alias": "emptyLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.SceVariantDirective; inputs: { "sceVariant": "sceVariant"; "sceDensity": "sceDensity"; }; outputs: {}; }]>;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Titled card framing the OSM map of branch/office locations. */
|
|
143
|
+
declare class SceStoreLocationsComponent {
|
|
144
|
+
readonly titleKey: _angular_core.InputSignal<string>;
|
|
145
|
+
readonly showHeader: _angular_core.InputSignal<boolean>;
|
|
146
|
+
readonly locations: _angular_core.InputSignal<SceOsmOfficeMapPoint[]>;
|
|
147
|
+
readonly selectedLocationId: _angular_core.InputSignal<string | number | undefined>;
|
|
148
|
+
/** Map viewport height, in px. */
|
|
149
|
+
readonly height: _angular_core.InputSignal<number>;
|
|
150
|
+
readonly locationSelect: _angular_core.OutputEmitterRef<string | number>;
|
|
151
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SceStoreLocationsComponent, never>;
|
|
152
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SceStoreLocationsComponent, "sce-store-locations", never, { "titleKey": { "alias": "titleKey"; "required": false; "isSignal": true; }; "showHeader": { "alias": "showHeader"; "required": false; "isSignal": true; }; "locations": { "alias": "locations"; "required": false; "isSignal": true; }; "selectedLocationId": { "alias": "selectedLocationId"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, { "locationSelect": "locationSelect"; }, never, never, true, [{ directive: typeof i1.SceVariantDirective; inputs: { "sceVariant": "sceVariant"; "sceDensity": "sceDensity"; }; outputs: {}; }]>;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
interface SelectOption {
|
|
156
|
+
label: string;
|
|
157
|
+
value: string;
|
|
158
|
+
}
|
|
159
|
+
declare class SceBaladyMapSelectorComponent implements OnInit, OnDestroy {
|
|
160
|
+
readonly locale: _angular_core.InputSignal<"ar" | "en">;
|
|
161
|
+
readonly dir: _angular_core.InputSignal<"rtl" | "ltr">;
|
|
162
|
+
readonly initialPropertyData: _angular_core.InputSignal<BaladyPointDataResult | null>;
|
|
163
|
+
readonly propertySelected: _angular_core.OutputEmitterRef<BaladyPointDataResult>;
|
|
164
|
+
readonly mapClick: _angular_core.OutputEmitterRef<{
|
|
165
|
+
lat: number;
|
|
166
|
+
lng: number;
|
|
167
|
+
}>;
|
|
168
|
+
private readonly gisService;
|
|
169
|
+
private readonly toast;
|
|
170
|
+
private lastQueriedCoords;
|
|
171
|
+
/** Epoch ms until which point queries are held back after a 429 from the GIS proxy. */
|
|
172
|
+
private pointQueryBlockedUntil;
|
|
173
|
+
constructor();
|
|
174
|
+
private regionsSub?;
|
|
175
|
+
private citiesSub?;
|
|
176
|
+
private districtsSub?;
|
|
177
|
+
private pointDataSub?;
|
|
178
|
+
protected readonly regions: _angular_core.WritableSignal<BaladyRegionItem[]>;
|
|
179
|
+
protected readonly cities: _angular_core.WritableSignal<BaladyCityItem[]>;
|
|
180
|
+
protected readonly districts: _angular_core.WritableSignal<BaladyDistrictItem[]>;
|
|
181
|
+
protected readonly selectedRegionCode: _angular_core.WritableSignal<string>;
|
|
182
|
+
protected readonly selectedCityCode: _angular_core.WritableSignal<string>;
|
|
183
|
+
protected readonly selectedDistrictCode: _angular_core.WritableSignal<string>;
|
|
184
|
+
protected formatArea(area?: string): string;
|
|
185
|
+
protected readonly currentLat: _angular_core.WritableSignal<number>;
|
|
186
|
+
protected readonly currentLng: _angular_core.WritableSignal<number>;
|
|
187
|
+
protected readonly zoomLevel: _angular_core.WritableSignal<number>;
|
|
188
|
+
protected readonly currentMarkers: _angular_core.WritableSignal<OsmMapMarker[]>;
|
|
189
|
+
protected readonly isLoadingFilterData: _angular_core.WritableSignal<boolean>;
|
|
190
|
+
protected readonly isQueryingPointData: _angular_core.WritableSignal<boolean>;
|
|
191
|
+
protected readonly loadError: _angular_core.WritableSignal<boolean>;
|
|
192
|
+
protected readonly selectedPropertyData: _angular_core.WritableSignal<BaladyPointDataResult | null>;
|
|
193
|
+
protected readonly regionOptions: _angular_core.Signal<SelectOption[]>;
|
|
194
|
+
protected readonly cityOptions: _angular_core.Signal<SelectOption[]>;
|
|
195
|
+
protected readonly districtOptions: _angular_core.Signal<SelectOption[]>;
|
|
196
|
+
ngOnInit(): void;
|
|
197
|
+
ngOnDestroy(): void;
|
|
198
|
+
protected loadRegions(): void;
|
|
199
|
+
/** Filter -> Map Sync: User selects Region */
|
|
200
|
+
onRegionChange(code: string | null): void;
|
|
201
|
+
/** Filter -> Map Sync: User selects City */
|
|
202
|
+
onCityChange(code: string | null): void;
|
|
203
|
+
/** Filter -> Map Sync: User selects District */
|
|
204
|
+
onDistrictChange(code: string | null): void;
|
|
205
|
+
/** Query Balady GIS API for point data (x=lng, y=lat) */
|
|
206
|
+
protected queryPointData(lng: number, lat: number, options?: {
|
|
207
|
+
emit?: boolean;
|
|
208
|
+
}): void;
|
|
209
|
+
private showPointQueryError;
|
|
210
|
+
/** Map Click -> Query Balady & Sync Filter Dropdowns */
|
|
211
|
+
onMapClicked(coords: {
|
|
212
|
+
lat: number;
|
|
213
|
+
lng: number;
|
|
214
|
+
}): void;
|
|
215
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SceBaladyMapSelectorComponent, never>;
|
|
216
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SceBaladyMapSelectorComponent, "sce-balady-map-selector", never, { "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "dir": { "alias": "dir"; "required": false; "isSignal": true; }; "initialPropertyData": { "alias": "initialPropertyData"; "required": false; "isSignal": true; }; }, { "propertySelected": "propertySelected"; "mapClick": "mapClick"; }, never, never, true, [{ directive: typeof i1.SceVariantDirective; inputs: { "sceVariant": "sceVariant"; "sceDensity": "sceDensity"; }; outputs: {}; }]>;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export { SceBaladyMapSelectorComponent, SceOfficeLocationMapComponent, SceOsmLeafletMapComponent, SceOsmLocationPickerComponent, SceOsmOfficesMapComponent, SceStoreLocationsComponent };
|
|
220
|
+
export type { LocationPickerValue, OsmMapMarker, SceOsmOfficeMapPoint };
|