@theseam/ui-common 2.0.1-beta.99 → 2.1.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.
Files changed (39) hide show
  1. package/ai/index.d.ts +1 -363
  2. package/carousel/index.d.ts +1 -21
  3. package/data-filters/index.d.ts +30 -6
  4. package/datatable/index.d.ts +3 -299
  5. package/datatable-alterations-display/index.d.ts +1 -61
  6. package/fesm2022/theseam-ui-common-ai.mjs +1 -1368
  7. package/fesm2022/theseam-ui-common-ai.mjs.map +1 -1
  8. package/fesm2022/theseam-ui-common-carousel.mjs +1 -48
  9. package/fesm2022/theseam-ui-common-carousel.mjs.map +1 -1
  10. package/fesm2022/theseam-ui-common-data-filters.mjs +61 -18
  11. package/fesm2022/theseam-ui-common-data-filters.mjs.map +1 -1
  12. package/fesm2022/theseam-ui-common-datatable-alterations-display.mjs +1 -197
  13. package/fesm2022/theseam-ui-common-datatable-alterations-display.mjs.map +1 -1
  14. package/fesm2022/theseam-ui-common-datatable.mjs +4 -668
  15. package/fesm2022/theseam-ui-common-datatable.mjs.map +1 -1
  16. package/fesm2022/theseam-ui-common-file-input.mjs +1 -156
  17. package/fesm2022/theseam-ui-common-file-input.mjs.map +1 -1
  18. package/fesm2022/theseam-ui-common-google-maps.mjs +299 -218
  19. package/fesm2022/theseam-ui-common-google-maps.mjs.map +1 -1
  20. package/fesm2022/theseam-ui-common-icon.mjs +1 -72
  21. package/fesm2022/theseam-ui-common-icon.mjs.map +1 -1
  22. package/fesm2022/theseam-ui-common-table-cell-types.mjs +0 -4
  23. package/fesm2022/theseam-ui-common-table-cell-types.mjs.map +1 -1
  24. package/fesm2022/theseam-ui-common-toggle-group.mjs +81 -112
  25. package/fesm2022/theseam-ui-common-toggle-group.mjs.map +1 -1
  26. package/fesm2022/theseam-ui-common-tooltip.mjs +1 -110
  27. package/fesm2022/theseam-ui-common-tooltip.mjs.map +1 -1
  28. package/fesm2022/theseam-ui-common-utils.mjs +112 -21
  29. package/fesm2022/theseam-ui-common-utils.mjs.map +1 -1
  30. package/fesm2022/theseam-ui-common-widget.mjs +1 -23
  31. package/fesm2022/theseam-ui-common-widget.mjs.map +1 -1
  32. package/file-input/index.d.ts +1 -78
  33. package/google-maps/index.d.ts +35 -23
  34. package/icon/index.d.ts +3 -33
  35. package/package.json +5 -2
  36. package/toggle-group/index.d.ts +42 -18
  37. package/tooltip/index.d.ts +2 -40
  38. package/utils/index.d.ts +38 -6
  39. package/widget/index.d.ts +2 -17
@@ -4,7 +4,6 @@ import * as _angular_core from '@angular/core';
4
4
  import { AfterViewInit } from '@angular/core';
5
5
  import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
6
6
  import { ControlValueAccessor } from '@angular/forms';
7
- import { ComponentHarness } from '@angular/cdk/testing';
8
7
 
9
8
  /** Tagged union describing where a file item's bytes (or asset pointer) live. */
10
9
  type SeamFileItemSource = {
@@ -187,81 +186,5 @@ declare class TheSeamFileFieldComponent implements ControlValueAccessor {
187
186
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<TheSeamFileFieldComponent, "seam-file-field", never, { "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "maxSize": { "alias": "maxSize"; "required": false; "isSignal": true; }; "maxFiles": { "alias": "maxFiles"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "previewMode": { "alias": "previewMode"; "required": false; "isSignal": true; }; "showTileName": { "alias": "showTileName"; "required": false; "isSignal": true; }; "promptText": { "alias": "promptText"; "required": false; "isSignal": true; }; "promptSuffix": { "alias": "promptSuffix"; "required": false; "isSignal": true; }; "replaceText": { "alias": "replaceText"; "required": false; "isSignal": true; }; "hideErrors": { "alias": "hideErrors"; "required": false; "isSignal": true; }; }, { "rejected": "rejected"; }, never, never, true, never>;
188
187
  }
189
188
 
190
- /**
191
- * Test harness for an element with `[seamFileDropZone]` attached.
192
- *
193
- * Usage:
194
- * ```ts
195
- * const harness = await loader.getHarness(TheSeamFileDropZoneHarness)
196
- * await harness.dropFiles([new File(['x'], 'x.txt')])
197
- * expect(await harness.isOver()).toBe(false)
198
- * ```
199
- */
200
- declare class TheSeamFileDropZoneHarness extends ComponentHarness {
201
- static hostSelector: string;
202
- isOver(): Promise<boolean>;
203
- dropFiles(files: File[]): Promise<void>;
204
- }
205
-
206
- /**
207
- * Test harness for `<seam-file-input>`.
208
- */
209
- declare class TheSeamFileInputHarness extends ComponentHarness {
210
- static hostSelector: string;
211
- private _zone;
212
- private _prompt;
213
- private _errors;
214
- private _native;
215
- /** Trimmed prompt text including the bold portion and suffix. */
216
- getPromptText(): Promise<string>;
217
- /** Component renders `tabindex=-1` on the zone when disabled. */
218
- isDisabled(): Promise<boolean>;
219
- /** Trimmed error line text, or null when no errors are visible. */
220
- getErrorMessage(): Promise<string | null>;
221
- /**
222
- * Simulates drop of files on the zone. The directive performs validation
223
- * and emits `filesAdded` / `rejected` via the component.
224
- */
225
- dropFiles(files: File[]): Promise<void>;
226
- }
227
-
228
- /**
229
- * Test harness for `<seam-file-tile>`.
230
- */
231
- declare class TheSeamFileTileHarness extends ComponentHarness {
232
- static hostSelector: string;
233
- private _root;
234
- private _rowName;
235
- private _previewName;
236
- private _remove;
237
- private _clickableBody;
238
- getName(): Promise<string>;
239
- getVariant(): Promise<SeamFileTileVariant>;
240
- /** True when a consumer has wired `(itemClick)` AND the tile isn't disabled. */
241
- isClickable(): Promise<boolean>;
242
- click(): Promise<void>;
243
- clickRemove(): Promise<void>;
244
- }
245
-
246
- /**
247
- * Test harness for `<seam-file-field>`. Delegates to tile/input harnesses
248
- * for their respective pieces.
249
- */
250
- declare class TheSeamFileFieldHarness extends ComponentHarness {
251
- static hostSelector: string;
252
- private _replace;
253
- private _allInputs;
254
- private _tiles;
255
- /**
256
- * Returns the visible embedded file-input harness, or null when the field
257
- * is in the filled single-mode state (visible input replaced by tile).
258
- * In filled single-mode the hidden input still exists but is not returned.
259
- */
260
- getInputHarness(): Promise<TheSeamFileInputHarness | null>;
261
- getTiles(): Promise<TheSeamFileTileHarness[]>;
262
- getReplaceButtonText(): Promise<string | null>;
263
- clickReplace(): Promise<void>;
264
- }
265
-
266
- export { TheSeamFileDropZoneDirective, TheSeamFileDropZoneHarness, TheSeamFileFieldComponent, TheSeamFileFieldHarness, TheSeamFileInputComponent, TheSeamFileInputHarness, TheSeamFileTileComponent, TheSeamFileTileHarness, iconForMime, seamFileItemFromFile, seamFileItemFromUrl, seamFilesFromItems };
189
+ export { TheSeamFileDropZoneDirective, TheSeamFileFieldComponent, TheSeamFileInputComponent, TheSeamFileTileComponent, iconForMime, seamFileItemFromFile, seamFileItemFromUrl, seamFilesFromItems };
267
190
  export type { SeamFileItem, SeamFileItemFromUrlOptions, SeamFileItemSource, SeamFileRejection, SeamFileRejectionReason, SeamFileTileVariant };
@@ -16,7 +16,7 @@ import * as i7 from '@angular/common';
16
16
  import * as i8 from '@angular/cdk/observers';
17
17
  import * as i9 from '@theseam/ui-common/shared';
18
18
  import * as i13 from '@angular/google-maps';
19
- import * as geojson from 'geojson';
19
+ import { Polygon } from 'geojson';
20
20
 
21
21
  declare abstract class TheSeamGoogleMapsApiLoader {
22
22
  abstract load(): Observable<void>;
@@ -49,7 +49,10 @@ declare class GoogleMapsService implements OnDestroy {
49
49
  private readonly _ngUnsubscribe;
50
50
  private readonly _mapReadySubject;
51
51
  private readonly _editingEnabledSubject;
52
- private _drawingManager?;
52
+ private _terraDraw?;
53
+ private _terraDrawReady;
54
+ private readonly _drawingSubject;
55
+ readonly drawing$: Observable<boolean>;
53
56
  private _featureContextMenu;
54
57
  private _activeContextMenu;
55
58
  private _baseLatLng?;
@@ -74,11 +77,16 @@ declare class GoogleMapsService implements OnDestroy {
74
77
  * Iterates the map's features and removes any that are selected.
75
78
  */
76
79
  deleteSelection(): void;
80
+ /** Whether polygon drawing mode is currently active. */
81
+ isDrawing(): boolean;
82
+ /** Enter polygon drawing mode. */
83
+ startDrawing(): void;
77
84
  /**
78
- * Stops the current drawing.
85
+ * Cancel any in-progress drawing and leave drawing mode. Switching to the
86
+ * `static` mode clears an unfinished line.
79
87
  */
80
88
  stopDrawing(): void;
81
- private _initDrawingManager;
89
+ private _initTerraDraw;
82
90
  addControl(element: HTMLElement, position: google.maps.ControlPosition): void;
83
91
  setData(data: any): Promise<void>;
84
92
  reCenterOnFeatures(): void;
@@ -89,7 +97,6 @@ declare class GoogleMapsService implements OnDestroy {
89
97
  setFeatureHoveredStyleOverride(feature: google.maps.Data.Feature): void;
90
98
  private _mergeStyleOptions;
91
99
  private _initFeatureChangeListeners;
92
- isDrawing(): boolean;
93
100
  hasSelectedFeature(): boolean;
94
101
  getSelectedFeature(): google.maps.Data.Feature | null;
95
102
  openContextMenu(): void;
@@ -98,6 +105,20 @@ declare class GoogleMapsService implements OnDestroy {
98
105
  getGeoJson(removeAppProperties?: boolean): Promise<object>;
99
106
  /** Asserts that the map has been initialized. */
100
107
  private _assertInitialized;
108
+ private _onDrawFinished;
109
+ /**
110
+ * Normalize a finished Terra Draw geometry into a Polygon. A Polygon (the
111
+ * user closed the line on its start point) passes through; an open LineString
112
+ * (the user finished without closing) is closed into a polygon so nothing
113
+ * they drew is discarded. Any other geometry type yields undefined.
114
+ */
115
+ private _toDrawnPolygon;
116
+ /**
117
+ * Find an existing Polygon feature that fully contains the drawn polygon, so
118
+ * the drawing can be applied as a cutout. Returns the existing feature
119
+ * instance (never a copy).
120
+ */
121
+ private _getPossibleExteriorFeature;
101
122
  static ɵfac: i0.ɵɵFactoryDeclaration<GoogleMapsService, never>;
102
123
  static ɵprov: i0.ɵɵInjectableDeclaration<GoogleMapsService>;
103
124
  }
@@ -148,6 +169,7 @@ declare class TheSeamGoogleMapsComponent extends _TheSeamGoogleMapsMixinBase imp
148
169
  readonly _gmApiLoaded: Observable<boolean>;
149
170
  readonly _fileUploadControlDef: MapControl;
150
171
  readonly _reCenterControlDef: MapControl;
172
+ readonly _drawControlDef: MapControl;
151
173
  private _focusOrigin;
152
174
  set value(value: MapValue);
153
175
  get value(): MapValue;
@@ -529,25 +551,15 @@ declare function getStyleOptionsDefinedByFeature(feature: google.maps.Data.Featu
529
551
  declare function getHoveredStyleOptionsDefinedByFeature(feature: google.maps.Data.Feature): google.maps.Data.StyleOptions | undefined;
530
552
  declare function getSelectedStyleOptionsDefinedByFeature(feature: google.maps.Data.Feature): google.maps.Data.StyleOptions | undefined;
531
553
  declare function stripAppFeaturePropertiesFromJson(json: any): void;
532
- /**
533
- * Searches for a Feature in Data that contains the provided Feature and can use
534
- * it as a cutout area.
535
- */
536
- declare function getPossibleExteriorFeature(data: google.maps.Data, feature: google.maps.Data.Feature): google.maps.Data.Feature | undefined;
537
- declare function addInnerFeatureCutoutToExteriorFeature(exteriorFeature: google.maps.Data.Feature, innerFeature: google.maps.Data.Feature): void;
538
- /**
539
- * Google maps paths don't always start and stop at the exact same position, so
540
- * this will fix that for turfjs.
541
- */
542
- declare function fixPathDifferentStartingAndEndingPoint(coordinates: number[][]): void;
543
554
  declare function polygonHasValidPathsLengths(polygon: google.maps.Polygon, minPointsInValidPath?: number): boolean;
544
555
  declare function polygonCoordinates(polygon: google.maps.Data.Polygon): number[][][];
545
- declare function multiPolygonCoordinates(multiPolygon: google.maps.Data.MultiPolygon): number[][][][];
546
- declare function toTurfJsPolygon(polygon: google.maps.Data.Polygon): geojson.Feature<geojson.Polygon, geojson.GeoJsonProperties>;
547
- declare function toTurfJsMultiPolygon(multiPolygon: google.maps.Data.MultiPolygon): geojson.Feature<geojson.MultiPolygon, geojson.GeoJsonProperties>;
548
- declare function toTurfJsFeature(googleFeature: google.maps.Data.Feature): geojson.Feature<geojson.Polygon, geojson.GeoJsonProperties> | geojson.Feature<geojson.MultiPolygon, geojson.GeoJsonProperties>;
549
- declare function featureContains(featureA: google.maps.Data.Feature, featureB: google.maps.Data.Feature): boolean;
550
- declare function createDataFeatureFromPolygon(polygon: google.maps.Polygon): google.maps.Data.Feature;
556
+ /** Build a google.maps.Data.Polygon from a GeoJSON Polygon (lng/lat order). */
557
+ declare function dataPolygonFromGeoJson(polygon: Polygon): google.maps.Data.Polygon;
558
+ /**
559
+ * Read an existing feature's Polygon geometry as a closed GeoJSON Polygon.
560
+ * Returns undefined for non-Polygon geometries. Does not mutate the feature.
561
+ */
562
+ declare function geoJsonPolygonFromDataFeature(feature: google.maps.Data.Feature): Polygon | undefined;
551
563
  declare function getBoundsWithAllFeatures(data: google.maps.Data): google.maps.LatLngBounds;
552
564
  declare function getFeatureBounds(feature: google.maps.Data.Feature): google.maps.LatLngBounds;
553
565
  declare function getFeatureCenter(feature: google.maps.Data.Feature): google.maps.LatLng;
@@ -653,5 +665,5 @@ declare class TheSeamNoopGoogleMapsAPILoader extends TheSeamGoogleMapsApiLoader
653
665
  static ɵprov: i0.ɵɵInjectableDeclaration<TheSeamNoopGoogleMapsAPILoader>;
654
666
  }
655
667
 
656
- export { AppFeaturePropertyName, GoogleMapsContextMenu, GoogleMapsControlsService, GoogleMapsService, MAP_CONTROLS_SERVICE, MAP_CONTROL_DATA, MapControlRef, MapValueManagerService, MapValueSource, SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS, THESEAM_LAZY_MAPS_API_CONFIG, TheSeamGoogleMapsApiLoader, TheSeamGoogleMapsComponent, TheSeamGoogleMapsModule, TheSeamGoogleMapsPlacesAutoCompleteComponent, TheSeamGoogleMapsPlacesAutocompleteDirective, TheSeamGoogleMapsRecenterButtonControlComponent, TheSeamGoogleMapsUploadButtonControlComponent, TheSeamLazyMapsApiLoader, TheSeamMapFileDropComponent, TheSeamMapsControlComponent, TheSeamNoopGoogleMapsAPILoader, addInnerFeatureCutoutToExteriorFeature, createDataFeatureFromPolygon, createFeatureChangeObservable, featureContains, fixPathDifferentStartingAndEndingPoint, getBoundsWithAllFeatures, getFeatureBounds, getFeatureCenter, getFeaturesCount, getHoveredStyleOptionsDefinedByFeature, getPossibleExteriorFeature, getSelectedStyleOptionsDefinedByFeature, getStyleOptionsDefinedByFeature, isAppFeatureProperty, isFeatureSelected, multiPolygonCoordinates, polygonCoordinates, polygonHasValidPathsLengths, removeAllFeatures, setFeatureSelected, stripAppFeaturePropertiesFromJson, toTurfJsFeature, toTurfJsMultiPolygon, toTurfJsPolygon };
668
+ export { AppFeaturePropertyName, GoogleMapsContextMenu, GoogleMapsControlsService, GoogleMapsService, MAP_CONTROLS_SERVICE, MAP_CONTROL_DATA, MapControlRef, MapValueManagerService, MapValueSource, SEAM_GOOGLE_PLACES_AUTOCOMPLETE_DEFAULT_OPTIONS, THESEAM_LAZY_MAPS_API_CONFIG, TheSeamGoogleMapsApiLoader, TheSeamGoogleMapsComponent, TheSeamGoogleMapsModule, TheSeamGoogleMapsPlacesAutoCompleteComponent, TheSeamGoogleMapsPlacesAutocompleteDirective, TheSeamGoogleMapsRecenterButtonControlComponent, TheSeamGoogleMapsUploadButtonControlComponent, TheSeamLazyMapsApiLoader, TheSeamMapFileDropComponent, TheSeamMapsControlComponent, TheSeamNoopGoogleMapsAPILoader, createFeatureChangeObservable, dataPolygonFromGeoJson, geoJsonPolygonFromDataFeature, getBoundsWithAllFeatures, getFeatureBounds, getFeatureCenter, getFeaturesCount, getHoveredStyleOptionsDefinedByFeature, getSelectedStyleOptionsDefinedByFeature, getStyleOptionsDefinedByFeature, isAppFeatureProperty, isFeatureSelected, polygonCoordinates, polygonHasValidPathsLengths, removeAllFeatures, setFeatureSelected, stripAppFeaturePropertiesFromJson };
657
669
  export type { GoogleMapsRecenterButtonControlData, GoogleMapsUploadButtonControlData, MapControl, MapControlsService, MapValue, MapValueChange, TheSeamLazyMapsApiLoaderConfig };
package/icon/index.d.ts CHANGED
@@ -1,12 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { DoCheck, ElementRef, Renderer2, OnInit } from '@angular/core';
3
3
  import { BooleanInput } from '@angular/cdk/coercion';
4
- import { IconProp, IconDefinition, SizeProp, IconLookup } from '@fortawesome/fontawesome-svg-core';
4
+ import { IconProp, IconDefinition, SizeProp } from '@fortawesome/fontawesome-svg-core';
5
5
  import { ThemeTypes } from '@theseam/ui-common/models';
6
6
  import * as _angular_animations from '@angular/animations';
7
7
  import * as i4 from '@angular/common';
8
8
  import * as i5 from '@fortawesome/angular-fontawesome';
9
- import { BaseHarnessFilters, ContentContainerComponentHarness, ComponentHarnessConstructor, HarnessPredicate } from '@angular/cdk/testing';
10
9
 
11
10
  type SeamIcon = IconProp | IconDefinition | string;
12
11
 
@@ -190,34 +189,5 @@ declare function fileExtensionIcon(extension: string | null | undefined, default
190
189
 
191
190
  declare function getKnownIcon(iconStr: string): SeamIcon | undefined;
192
191
 
193
- /**
194
- * Returns only IconLookup for FontAwesome icons
195
- */
196
- type TestSeamIcon = string | IconLookup;
197
- declare function toIconLookup(icon: IconDefinition): IconLookup;
198
- /** A set of criteria that can be used to filter a list of `TheSeamIconComponentHarness` instances. */
199
- interface TheSeamIconComponentHarnessFilters extends BaseHarnessFilters {
200
- /** Only find instances whose text matches the given value. */
201
- icon?: string | RegExp | SeamIcon;
202
- }
203
- declare class TheSeamIconComponentHarness extends ContentContainerComponentHarness<string> {
204
- /** The selector for the host element of a `TheSeamIconComponent` instance. */
205
- static hostSelector: string;
206
- private readonly _imgElement;
207
- private readonly _svgElement;
208
- /**
209
- * Gets a `HarnessPredicate` that can be used to search for a menu item with specific attributes.
210
- * @param options Options for filtering which menu item instances are considered a match.
211
- * @return a `HarnessPredicate` configured with the given options.
212
- */
213
- static with<T extends TheSeamIconComponentHarness>(this: ComponentHarnessConstructor<T>, options?: TheSeamIconComponentHarnessFilters): HarnessPredicate<T>;
214
- /** Whether the menu is disabled. */
215
- isDisabled(): Promise<boolean>;
216
- /** Get icon image. */
217
- getIcon(): Promise<TestSeamIcon | undefined>;
218
- /** Get icon type. */
219
- getIconType(): Promise<string | undefined>;
220
- }
221
-
222
- export { DEFAULT_FILE_EXTENSION_ICON, IconBtnComponent, IconComponent, IconNotificationComponent, TheSeamIconComponentHarness, TheSeamIconModule, fileExtensionIcon, getKnownIcon, pulseAnimation, toIconLookup };
223
- export type { SeamIcon, TestSeamIcon, TheSeamIconComponentHarnessFilters, TheSeamIconType };
192
+ export { DEFAULT_FILE_EXTENSION_ICON, IconBtnComponent, IconComponent, IconNotificationComponent, TheSeamIconModule, fileExtensionIcon, getKnownIcon, pulseAnimation };
193
+ export type { SeamIcon, TheSeamIconType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theseam/ui-common",
3
- "version": "2.0.1-beta.99",
3
+ "version": "2.1.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^20.2.3",
6
6
  "@angular/common": "^20.3.0",
@@ -8,6 +8,7 @@
8
8
  "@angular/forms": "^20.3.0",
9
9
  "@angular/animations": "^20.3.0",
10
10
  "@angular/router": "^20.3.0",
11
+ "@angular/google-maps": "^20.2.3",
11
12
  "rxjs": "~7.8.0",
12
13
  "@fortawesome/angular-fontawesome": "^0.13.0",
13
14
  "@fortawesome/fontawesome-svg-core": "^1.2.35",
@@ -43,6 +44,8 @@
43
44
  "@turf/kinks": "^7.2.0",
44
45
  "shpjs": "^6.2.0",
45
46
  "@types/geojson": "^7946.0.8",
47
+ "terra-draw": "^1.31.2",
48
+ "terra-draw-google-maps-adapter": "^1.6.1",
46
49
  "tslib": "^2.3.0"
47
50
  },
48
51
  "repository": {
@@ -353,4 +356,4 @@
353
356
  }
354
357
  },
355
358
  "sideEffects": false
356
- }
359
+ }
@@ -1,41 +1,46 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, OnDestroy, AfterViewInit, QueryList } from '@angular/core';
2
+ import { InjectionToken, EventEmitter, QueryList } from '@angular/core';
3
3
  import { BooleanInput } from '@angular/cdk/coercion';
4
4
  import { ControlValueAccessor } from '@angular/forms';
5
- import { Observable } from 'rxjs';
6
5
 
7
6
  declare class ToggleGroupOptionDirective {
8
- private readonly _cdr;
7
+ private readonly _group;
9
8
  seamToggleGroupOption: string | undefined | null;
10
- get selected(): boolean;
11
- set selected(value: boolean);
12
- private _selected;
13
- /** Internal use only for now. */
14
- _canUnselect: boolean;
15
- selectionChange: EventEmitter<boolean>;
16
9
  get _checkioSelectedClass(): boolean;
17
10
  get value(): string | undefined | null;
18
11
  static ɵfac: i0.ɵɵFactoryDeclaration<ToggleGroupOptionDirective, never>;
19
- static ɵdir: i0.ɵɵDirectiveDeclaration<ToggleGroupOptionDirective, "[seamToggleGroupOption]", ["seamToggleGroupOption"], { "seamToggleGroupOption": { "alias": "seamToggleGroupOption"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; }, { "selectionChange": "selectionChange"; }, never, never, true, never>;
12
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ToggleGroupOptionDirective, "[seamToggleGroupOption]", ["seamToggleGroupOption"], { "seamToggleGroupOption": { "alias": "seamToggleGroupOption"; "required": false; }; }, {}, never, never, true, never>;
20
13
  }
21
14
 
15
+ /**
16
+ * The part of the toggle group that an option needs in order to resolve its own
17
+ * selected state.
18
+ *
19
+ * This exists as a separate token so `ToggleGroupOptionDirective` can reach its
20
+ * parent group without importing `ToggleGroupDirective`, which would create a
21
+ * circular import between the two directives.
22
+ */
23
+ interface TheSeamToggleGroupParent {
24
+ isSelected(value: string | undefined | null): boolean;
25
+ }
26
+ declare const THESEAM_TOGGLE_GROUP_PARENT: InjectionToken<TheSeamToggleGroupParent>;
27
+
22
28
  declare const TOGGLE_GROUP_VALUE_ACCESSOR: any;
23
- declare class ToggleGroupDirective implements OnDestroy, AfterViewInit, ControlValueAccessor {
29
+ declare class ToggleGroupDirective implements ControlValueAccessor {
24
30
  static ngAcceptInputType_disabled: BooleanInput;
25
31
  static ngAcceptInputType_multiple: BooleanInput;
26
32
  static ngAcceptInputType_selectionToggleable: BooleanInput;
27
- private readonly _ngUnsubscribe;
28
33
  val: string | string[] | undefined | null;
29
34
  disabled: boolean;
30
35
  multiple: boolean;
31
36
  selectionToggleable: boolean;
32
37
  readonly change: EventEmitter<string | string[] | null | undefined>;
33
38
  optionDirectives?: QueryList<ToggleGroupOptionDirective>;
34
- options?: Observable<ToggleGroupOptionDirective[]>;
35
39
  onChange: any;
36
40
  onTouched: any;
37
- ngOnDestroy(): void;
38
- ngAfterViewInit(): void;
41
+ private _selectedSet;
42
+ private _selectedSetSource;
43
+ private _selectedSetMultiple;
39
44
  get value(): string | string[] | undefined | null;
40
45
  set value(value: string | string[] | undefined | null);
41
46
  writeValue(value: any): void;
@@ -43,11 +48,29 @@ declare class ToggleGroupDirective implements OnDestroy, AfterViewInit, ControlV
43
48
  registerOnTouched(fn: any): void;
44
49
  setDisabledState(isDisabled: boolean): void;
45
50
  isSelected(value: string | undefined | null): boolean;
51
+ /**
52
+ * The current selection as a set, rebuilt only when the value (or `multiple`)
53
+ * changes.
54
+ *
55
+ * `isSelected` is called from templates and from every option's host binding,
56
+ * so it runs several times per option per change detection pass. Hashing the
57
+ * selection once keeps those lookups O(1) instead of scanning the value array
58
+ * on every call.
59
+ *
60
+ * Invalidation is keyed on the `val` reference rather than done in the `value`
61
+ * setter, because `val` is also written directly by the `[value]` input, which
62
+ * does not go through the setter.
63
+ */
64
+ private _selected;
65
+ private _buildSelectedSet;
66
+ /**
67
+ * Toggles an option's selected state by value.
68
+ */
69
+ toggleOptionSelect(value: string | undefined | null): void;
70
+ private _selectedCount;
46
71
  unselectValue(value: string | undefined | null): void;
47
72
  selectValue(value: string | undefined | null): void;
48
73
  getOptionDirectiveByValue(value: string): ToggleGroupOptionDirective | null | undefined;
49
- private _updateDirectiveStates;
50
- private _updateDirectiveState;
51
74
  static ɵfac: i0.ɵɵFactoryDeclaration<ToggleGroupDirective, never>;
52
75
  static ɵdir: i0.ɵɵDirectiveDeclaration<ToggleGroupDirective, "[seamToggleGroup]", ["seamToggleGroup"], { "val": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "selectionToggleable": { "alias": "selectionToggleable"; "required": false; }; }, { "change": "change"; }, ["optionDirectives"], never, true, never>;
53
76
  }
@@ -58,4 +81,5 @@ declare class TheSeamToggleGroupModule {
58
81
  static ɵinj: i0.ɵɵInjectorDeclaration<TheSeamToggleGroupModule>;
59
82
  }
60
83
 
61
- export { TOGGLE_GROUP_VALUE_ACCESSOR, TheSeamToggleGroupModule, ToggleGroupDirective, ToggleGroupOptionDirective };
84
+ export { THESEAM_TOGGLE_GROUP_PARENT, TOGGLE_GROUP_VALUE_ACCESSOR, TheSeamToggleGroupModule, ToggleGroupDirective, ToggleGroupOptionDirective };
85
+ export type { TheSeamToggleGroupParent };
@@ -4,7 +4,6 @@ import { AnimationEvent } from '@angular/animations';
4
4
  import { Subject } from 'rxjs';
5
5
  import * as i1 from '@angular/common';
6
6
  import * as i2 from '@angular/cdk/overlay';
7
- import { BaseHarnessFilters, ComponentHarness, HarnessPredicate, ElementDimensions } from '@angular/cdk/testing';
8
7
 
9
8
  type TheSeamTooltipPlacement = 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'left-top' | 'left-bottom' | 'right' | 'right-top' | 'right-bottom' | 'auto';
10
9
  declare class TheSeamTooltipComponent implements OnDestroy {
@@ -115,42 +114,5 @@ declare class TheSeamTooltipModule {
115
114
  static ɵinj: i0.ɵɵInjectorDeclaration<TheSeamTooltipModule>;
116
115
  }
117
116
 
118
- interface TheSeamTooltipHarnessFilters extends BaseHarnessFilters {
119
- }
120
- /**
121
- * Harness for interacting with tooltip directives in tests
122
- */
123
- declare class TheSeamTooltipHarness extends ComponentHarness {
124
- static hostSelector: string;
125
- /**
126
- * Gets a `HarnessPredicate` that can be used to search for a tooltip with specific attributes
127
- */
128
- static with(options?: TheSeamTooltipHarnessFilters): HarnessPredicate<TheSeamTooltipHarness>;
129
- /** Hovers over the element to show the tooltip */
130
- hover(): Promise<void>;
131
- /** Moves the mouse away from the element to hide the tooltip */
132
- mouseAway(): Promise<void>;
133
- /** Focuses the element to show the tooltip */
134
- focus(): Promise<void>;
135
- /** Blurs the element to hide the tooltip */
136
- blur(): Promise<void>;
137
- /** Clicks the element */
138
- click(): Promise<void>;
139
- /** Gets whether the tooltip is currently visible */
140
- isTooltipVisible(): Promise<boolean>;
141
- /** Gets the visible tooltip text content */
142
- getVisibleTooltipText(): Promise<string | null>;
143
- /** Gets the visible tooltip classes */
144
- getVisibleTooltipClasses(): Promise<string[]>;
145
- /** Gets the tooltip ID from the aria-describedby attribute */
146
- private _getTooltipId;
147
- /** Waits for the tooltip to appear */
148
- waitForTooltipToShow(timeout?: number): Promise<void>;
149
- /** Waits for the tooltip to disappear */
150
- waitForTooltipToHide(timeout?: number): Promise<void>;
151
- getTriggerDimensions(): Promise<ElementDimensions | null>;
152
- getTooltipDimensions(): Promise<ElementDimensions | null>;
153
- }
154
-
155
- export { TheSeamTooltipComponent, TheSeamTooltipDirective, TheSeamTooltipHarness, TheSeamTooltipModule };
156
- export type { TheSeamTooltipHarnessFilters, TheSeamTooltipPlacement, TheSeamTooltipPlacementInput, TheSeamTooltipTrigger };
117
+ export { TheSeamTooltipComponent, TheSeamTooltipDirective, TheSeamTooltipModule };
118
+ export type { TheSeamTooltipPlacement, TheSeamTooltipPlacementInput, TheSeamTooltipTrigger };
package/utils/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { ElementRef, QueryList } from '@angular/core';
3
3
  import { AbstractControl, ValidatorFn } from '@angular/forms';
4
4
  import { Observable } from 'rxjs';
5
5
  import { ActivatedRoute, Data, ActivatedRouteSnapshot } from '@angular/router';
6
- import { FeatureCollection, GeoJSON, Feature, GeoJsonProperties, Geometry, Polygon, MultiPolygon } from 'geojson';
6
+ import { FeatureCollection, GeoJSON, Feature, GeoJsonProperties, Geometry, Polygon, MultiPolygon, Position } from 'geojson';
7
7
  import { AreaUnits } from '@turf/helpers';
8
8
 
9
9
  /**
@@ -234,14 +234,46 @@ declare function readGeoFile(fileOrBuffer: File | ArrayBuffer): Promise<FeatureC
234
234
  declare function splitMultiPolygons(featureCollection: FeatureCollection): void;
235
235
 
236
236
  /**
237
- * Close all polygons in the GeoJSON.
237
+ * Close all polygons in the GeoJSON so the first and last position of every
238
+ * ring are identical.
238
239
  *
239
- * Google Maps requires that polygons be closed, but not all libraries have that
240
- * requirement. This may add redundent points to the GeoJSON, but it will ensure
241
- * that the GeoJSON is valid for Google Maps.
240
+ * Google Maps requires closed polygon rings, but not all libraries produce
241
+ * them. This is idempotent: rings that are already closed are left unchanged.
242
242
  */
243
243
  declare function closePolygons(geoJson: FeatureCollection | Feature | Polygon | MultiPolygon): void;
244
244
 
245
+ /**
246
+ * Checks if a single polygon ring's coordinate count violates the given
247
+ * min/max point bounds. `max` is only applied when it is greater than `min`.
248
+ */
249
+ declare function polygonViolatesMinMax(coordinateLength: number, min: number, max?: number | undefined): boolean;
250
+
251
+ /**
252
+ * Whether a polygon's outer ring has at least `min` distinct vertices.
253
+ * Ring closure (a repeated first/last point) does not count toward the total,
254
+ * so this behaves the same for closed and unclosed rings.
255
+ */
256
+ declare function polygonHasMinDistinctVertices(polygon: Polygon, min?: number): boolean;
257
+
258
+ /**
259
+ * Whether `outer` fully contains `inner`, using turf's boolean-contains on the
260
+ * GeoJSON geometries directly (no Google Maps dependency).
261
+ */
262
+ declare function polygonContains(outer: Polygon, inner: Polygon): boolean;
263
+
264
+ /**
265
+ * Whether a ring is wound clockwise, via the shoelace signed-area sign.
266
+ * Sum of (x2 - x1) * (y2 + y1) is positive for clockwise rings in standard
267
+ * (x = lng, y = lat) orientation.
268
+ */
269
+ declare function ringIsClockwise(ring: Position[]): boolean;
270
+ /**
271
+ * Append the outer ring of `hole` to `exterior` as an interior ring (a
272
+ * cutout), wound opposite the exterior ring so it renders as a hole. Returns a
273
+ * new Polygon; inputs are not mutated.
274
+ */
275
+ declare function addHoleToPolygon(exterior: Polygon, hole: Polygon): Polygon;
276
+
245
277
  /**
246
278
  Moves the item to the new position in the input array. Useful for huge arrays
247
279
  where absolute performance is needed.
@@ -452,5 +484,5 @@ interface SanitizeFilenameOptions {
452
484
  }
453
485
  declare function sanitizeFilename(filename: string, options?: SanitizeFilenameOptions): string;
454
486
 
455
- export { IS_FEATURE_COLLECTION_VALIDATOR_NAME, IS_ONLY_GEOMETRY_TYPES_VALIDATOR_NAME, MIN_MAX_POINTS_VALIDATOR_NAME, NO_EMPTY_FEATURE_COLLECTION_VALIDATOR_NAME, NO_INNER_RINGS_VALIDATOR_NAME, NO_KINKS_VALIDATOR_NAME, PollingTickerOptions, Refreshable, activatedRoutesWithDataProperty, arrayMoveImmutable, arrayMoveMutable, calcPercentage, closePolygons, coerceFeatureCollection, createPadding, deleteProperties, deleteProperty, fileBufferToBlob, fileBufferToObjectUrl, fileDataFromBuffer, fractionalDigitsCount, geoJsonToArea, getAttribute, getClosestWidgetCdkDrag, getControlName, getControlPath, hasAttribute, hasProperty, hasRequiredControl, isAbsoluteUrl, isEmptyInputValue, isEmptyUrlRoute, isFeatureCollectionValidator, isNullOrUndefined, isNullOrUndefinedOrEmpty, isNumeric, isOnlyGeometryTypes, isOnlyGeometryTypesValidator, leafChildRoute, loadStyle, loadStyleSheet, mapEach, mergePolygons, minMaxPointsValidator, noEmptyFeatureCollectionValidator, noInnerRingsValidator, noKinksValidator, notNullOrUndefined, notNullOrUndefinedOrEmpty, observeControlIsDifferent, observeControlStatus, observeControlValid, observeControlValue, observeControlValueChange, observeQueryList, openBlob, padEnd, padStart, phoneNumberMask, pollingTicker, readFileAsDataUrlAsync, readFileAsync, readGeoFile, routeSnapshotPathFull, routeSnapshotPathRelative, sanitizeFilename, splitMultiPolygons, stripOuter, subscriberCount, tapFirst, toggleAttribute, trimRepeated, waitOnConditionAsync, waitOnNonPendingStatus, willHaveDataProp, withoutProperties, withoutProperty, wrapIntoObservable };
487
+ export { IS_FEATURE_COLLECTION_VALIDATOR_NAME, IS_ONLY_GEOMETRY_TYPES_VALIDATOR_NAME, MIN_MAX_POINTS_VALIDATOR_NAME, NO_EMPTY_FEATURE_COLLECTION_VALIDATOR_NAME, NO_INNER_RINGS_VALIDATOR_NAME, NO_KINKS_VALIDATOR_NAME, PollingTickerOptions, Refreshable, activatedRoutesWithDataProperty, addHoleToPolygon, arrayMoveImmutable, arrayMoveMutable, calcPercentage, closePolygons, coerceFeatureCollection, createPadding, deleteProperties, deleteProperty, fileBufferToBlob, fileBufferToObjectUrl, fileDataFromBuffer, fractionalDigitsCount, geoJsonToArea, getAttribute, getClosestWidgetCdkDrag, getControlName, getControlPath, hasAttribute, hasProperty, hasRequiredControl, isAbsoluteUrl, isEmptyInputValue, isEmptyUrlRoute, isFeatureCollectionValidator, isNullOrUndefined, isNullOrUndefinedOrEmpty, isNumeric, isOnlyGeometryTypes, isOnlyGeometryTypesValidator, leafChildRoute, loadStyle, loadStyleSheet, mapEach, mergePolygons, minMaxPointsValidator, noEmptyFeatureCollectionValidator, noInnerRingsValidator, noKinksValidator, notNullOrUndefined, notNullOrUndefinedOrEmpty, observeControlIsDifferent, observeControlStatus, observeControlValid, observeControlValue, observeControlValueChange, observeQueryList, openBlob, padEnd, padStart, phoneNumberMask, pollingTicker, polygonContains, polygonHasMinDistinctVertices, polygonViolatesMinMax, readFileAsDataUrlAsync, readFileAsync, readGeoFile, ringIsClockwise, routeSnapshotPathFull, routeSnapshotPathRelative, sanitizeFilename, splitMultiPolygons, stripOuter, subscriberCount, tapFirst, toggleAttribute, trimRepeated, waitOnConditionAsync, waitOnNonPendingStatus, willHaveDataProp, withoutProperties, withoutProperty, wrapIntoObservable };
456
488
  export type { IActivatedRouteWithData, IFileData, PollingActionFn, RefreshableOptions, SanitizeFilenameOptions, SubscriberCountChangedFn };
package/widget/index.d.ts CHANGED
@@ -22,7 +22,6 @@ import * as i7 from '@fortawesome/angular-fontawesome';
22
22
  import * as i9 from '@theseam/ui-common/loading';
23
23
  import * as i12 from '@angular/cdk/table';
24
24
  import * as i24 from '@angular/router';
25
- import { BaseHarnessFilters, ContentContainerComponentHarness, ComponentHarnessConstructor, HarnessPredicate } from '@angular/cdk/testing';
26
25
 
27
26
  type Writeable<T> = {
28
27
  -readonly [P in keyof T]-?: T[P];
@@ -532,19 +531,5 @@ declare class TheSeamWidgetModule {
532
531
  static ɵinj: i0.ɵɵInjectorDeclaration<TheSeamWidgetModule>;
533
532
  }
534
533
 
535
- /** A set of criteria that can be used to filter a list of `TheSeamWidgetHarness` instances. */
536
- interface TheSeamWidgetHarnessFilters extends BaseHarnessFilters {
537
- }
538
- declare class TheSeamWidgetHarness extends ContentContainerComponentHarness<string> {
539
- /** The selector for the host element of a `WidgetComponent` instance. */
540
- static hostSelector: string;
541
- /**
542
- * Gets a `HarnessPredicate` that can be used to search for a menu item with specific attributes.
543
- * @param options Options for filtering which menu item instances are considered a match.
544
- * @return a `HarnessPredicate` configured with the given options.
545
- */
546
- static with<T extends TheSeamWidgetHarness>(this: ComponentHarnessConstructor<T>, options?: TheSeamWidgetHarnessFilters): HarnessPredicate<T>;
547
- }
548
-
549
- export { CURRENT_WIDGET_PREFERENCES_VERSION, EMPTY_WIDGET_PREFERENCES, THESEAM_WIDGETS, THESEAM_WIDGET_ACCESSOR, THESEAM_WIDGET_DATA, THESEAM_WIDGET_DEFAULTS, THESEAM_WIDGET_PREFERENCES_ACCESSOR, TheSeamWidgetButtonGroupModule, TheSeamWidgetContentHeaderModule, TheSeamWidgetDescriptionModule, TheSeamWidgetEmptyLabelModule, TheSeamWidgetFooterLinkModule, TheSeamWidgetFooterTextModule, TheSeamWidgetHarness, TheSeamWidgetHeaderBadgeModule, TheSeamWidgetListGroupModule, TheSeamWidgetModule, TheSeamWidgetTableModule, TheSeamWidgetTileListModule, TheSeamWidgetTileModule, WidgetButtonGroupComponent, WidgetComponent, WidgetContentHeaderComponent, WidgetDescriptionComponent, WidgetDragHandleDirective, WidgetEmptyLabelComponent, WidgetFooterComponent, WidgetFooterLinkComponent, WidgetFooterTextComponent, WidgetHeaderBadgeComponent, WidgetIconTplDirective, WidgetListGroupComponent, WidgetListGroupItemAnchorComponent, WidgetListGroupItemButtonComponent, WidgetListGroupItemComponent, WidgetListGroupItemIconTplDirective, WidgetPreferencesService, WidgetRegistryService, WidgetTableComponent, WidgetTileComponent, WidgetTileFooterComponent, WidgetTileFooterItemComponent, WidgetTileGroupComponent, WidgetTileListComponent, WidgetTileSecondaryIconDirective, WidgetTitleTplDirective, extendStyles, toggleNativeDragInteractions };
550
- export type { IWidgetRegistryRecord, TheSeamWidgetAccessor, TheSeamWidgetData, TheSeamWidgetDefaults, TheSeamWidgetHarnessFilters, TheSeamWidgetPreferences, TheSeamWidgetPreferences_v1 };
534
+ export { CURRENT_WIDGET_PREFERENCES_VERSION, EMPTY_WIDGET_PREFERENCES, THESEAM_WIDGETS, THESEAM_WIDGET_ACCESSOR, THESEAM_WIDGET_DATA, THESEAM_WIDGET_DEFAULTS, THESEAM_WIDGET_PREFERENCES_ACCESSOR, TheSeamWidgetButtonGroupModule, TheSeamWidgetContentHeaderModule, TheSeamWidgetDescriptionModule, TheSeamWidgetEmptyLabelModule, TheSeamWidgetFooterLinkModule, TheSeamWidgetFooterTextModule, TheSeamWidgetHeaderBadgeModule, TheSeamWidgetListGroupModule, TheSeamWidgetModule, TheSeamWidgetTableModule, TheSeamWidgetTileListModule, TheSeamWidgetTileModule, WidgetButtonGroupComponent, WidgetComponent, WidgetContentHeaderComponent, WidgetDescriptionComponent, WidgetDragHandleDirective, WidgetEmptyLabelComponent, WidgetFooterComponent, WidgetFooterLinkComponent, WidgetFooterTextComponent, WidgetHeaderBadgeComponent, WidgetIconTplDirective, WidgetListGroupComponent, WidgetListGroupItemAnchorComponent, WidgetListGroupItemButtonComponent, WidgetListGroupItemComponent, WidgetListGroupItemIconTplDirective, WidgetPreferencesService, WidgetRegistryService, WidgetTableComponent, WidgetTileComponent, WidgetTileFooterComponent, WidgetTileFooterItemComponent, WidgetTileGroupComponent, WidgetTileListComponent, WidgetTileSecondaryIconDirective, WidgetTitleTplDirective, extendStyles, toggleNativeDragInteractions };
535
+ export type { IWidgetRegistryRecord, TheSeamWidgetAccessor, TheSeamWidgetData, TheSeamWidgetDefaults, TheSeamWidgetPreferences, TheSeamWidgetPreferences_v1 };