@theseam/ui-common 0.4.13 → 0.4.15

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 (139) hide show
  1. package/buttons/public-api.d.ts +1 -0
  2. package/buttons/testing/anchor-badge-button.harness.d.ts +16 -0
  3. package/buttons/testing/anchor-button.harness.d.ts +16 -0
  4. package/buttons/testing/badge-button.harness.d.ts +15 -0
  5. package/buttons/testing/base-badge-button.harness.d.ts +15 -0
  6. package/buttons/testing/base-button.harness.d.ts +19 -0
  7. package/buttons/testing/button.harness.d.ts +15 -0
  8. package/buttons/testing/index.d.ts +5 -0
  9. package/buttons/testing/toggle-button.harness.d.ts +21 -0
  10. package/checkbox/checkbox.component.d.ts +1 -1
  11. package/checkbox/checkbox.module.d.ts +2 -3
  12. package/datatable/datatable.module.d.ts +1 -1
  13. package/esm2020/buttons/button/button.component.mjs +2 -1
  14. package/esm2020/buttons/public-api.mjs +2 -1
  15. package/esm2020/buttons/testing/anchor-badge-button.harness.mjs +18 -0
  16. package/esm2020/buttons/testing/anchor-button.harness.mjs +18 -0
  17. package/esm2020/buttons/testing/badge-button.harness.mjs +14 -0
  18. package/esm2020/buttons/testing/base-badge-button.harness.mjs +29 -0
  19. package/esm2020/buttons/testing/base-button.harness.mjs +41 -0
  20. package/esm2020/buttons/testing/button.harness.mjs +16 -0
  21. package/esm2020/buttons/testing/index.mjs +6 -0
  22. package/esm2020/buttons/testing/toggle-button.harness.mjs +25 -0
  23. package/esm2020/checkbox/checkbox.component.mjs +8 -3
  24. package/esm2020/checkbox/checkbox.module.mjs +5 -12
  25. package/esm2020/datatable/datatable.module.mjs +5 -5
  26. package/esm2020/form-field/form-field.component.mjs +4 -4
  27. package/esm2020/framework/schema-form/index.mjs +2 -1
  28. package/esm2020/framework/schema-form/schema-form-framework.component.mjs +6 -3
  29. package/esm2020/framework/schema-form/schema-form-framework.mjs +62 -7
  30. package/esm2020/framework/schema-form/schema-form-widget.mjs +2 -0
  31. package/esm2020/framework/schema-form/schema-form.module.mjs +1 -8
  32. package/esm2020/framework/schema-form-controls/schema-form-checkbox/schema-form-checkbox.component.mjs +21 -11
  33. package/esm2020/framework/schema-form-controls/schema-form-divider/schema-form-divider.component.mjs +20 -0
  34. package/esm2020/framework/schema-form-controls/schema-form-input/schema-form-input.component.mjs +17 -8
  35. package/esm2020/framework/schema-form-controls/schema-form-number/schema-form-number.component.mjs +14 -5
  36. package/esm2020/framework/schema-form-controls/schema-form-select/schema-form-select.component.mjs +19 -9
  37. package/esm2020/framework/schema-form-controls/schema-form-submit/schema-form-submit.component.mjs +21 -13
  38. package/esm2020/framework/schema-form-controls/schema-form-submit-split/schema-form-submit-split.component.mjs +30 -18
  39. package/esm2020/framework/schema-form-controls/schema-form-tel/schema-form-tel.component.mjs +48 -0
  40. package/esm2020/framework/schema-form-controls/schema-form-tiled-select/schema-form-tiled-select.component.mjs +57 -0
  41. package/esm2020/google-maps/google-maps/google-maps.component.mjs +9 -2
  42. package/esm2020/google-maps/google-maps-api-loader/lazy-google-maps-api-loader.mjs +2 -1
  43. package/esm2020/menu/public-api.mjs +5 -1
  44. package/esm2020/menu/testing/menu-footer.harness.mjs +28 -0
  45. package/esm2020/menu/testing/menu-header.harness.mjs +23 -0
  46. package/esm2020/menu/testing/menu-item.harness.mjs +59 -0
  47. package/esm2020/menu/testing/menu.harness.mjs +163 -0
  48. package/esm2020/menu/testing/utils.mjs +13 -0
  49. package/esm2020/story-helpers/args-to-tpl.mjs +83 -0
  50. package/esm2020/story-helpers/public-api.mjs +2 -2
  51. package/esm2020/tel-input/public-api.mjs +2 -1
  52. package/esm2020/tel-input/tel-input/tel-input.component.mjs +22 -10
  53. package/esm2020/tel-input/tel-input.directive.mjs +12 -13
  54. package/esm2020/tel-input/tel-input.module.mjs +10 -9
  55. package/esm2020/tel-input/testing/tel-input.harness.mjs +49 -0
  56. package/esm2020/testing/harnesses/ng-select-dropdown.harness.mjs +39 -0
  57. package/esm2020/testing/harnesses/ng-select-option.harness.mjs +26 -0
  58. package/esm2020/testing/harnesses/ng-select.harness.mjs +104 -0
  59. package/esm2020/testing/public-api.mjs +4 -1
  60. package/esm2020/tiled-select/components/tiled-select/tiled-select.component.mjs +1 -1
  61. package/fesm2015/theseam-ui-common-buttons.mjs +181 -3
  62. package/fesm2015/theseam-ui-common-buttons.mjs.map +1 -1
  63. package/fesm2015/theseam-ui-common-checkbox.mjs +12 -14
  64. package/fesm2015/theseam-ui-common-checkbox.mjs.map +1 -1
  65. package/fesm2015/theseam-ui-common-datatable.mjs +4 -4
  66. package/fesm2015/theseam-ui-common-datatable.mjs.map +1 -1
  67. package/fesm2015/theseam-ui-common-form-field.mjs +3 -3
  68. package/fesm2015/theseam-ui-common-form-field.mjs.map +1 -1
  69. package/fesm2015/theseam-ui-common-framework.mjs +248 -164
  70. package/fesm2015/theseam-ui-common-framework.mjs.map +1 -1
  71. package/fesm2015/theseam-ui-common-google-maps.mjs +10 -1
  72. package/fesm2015/theseam-ui-common-google-maps.mjs.map +1 -1
  73. package/fesm2015/theseam-ui-common-menu.mjs +329 -3
  74. package/fesm2015/theseam-ui-common-menu.mjs.map +1 -1
  75. package/fesm2015/theseam-ui-common-story-helpers.mjs +86 -1
  76. package/fesm2015/theseam-ui-common-story-helpers.mjs.map +1 -1
  77. package/fesm2015/theseam-ui-common-tel-input.mjs +105 -29
  78. package/fesm2015/theseam-ui-common-tel-input.mjs.map +1 -1
  79. package/fesm2015/theseam-ui-common-testing.mjs +197 -1
  80. package/fesm2015/theseam-ui-common-testing.mjs.map +1 -1
  81. package/fesm2015/theseam-ui-common-tiled-select.mjs.map +1 -1
  82. package/fesm2020/theseam-ui-common-buttons.mjs +154 -2
  83. package/fesm2020/theseam-ui-common-buttons.mjs.map +1 -1
  84. package/fesm2020/theseam-ui-common-checkbox.mjs +12 -14
  85. package/fesm2020/theseam-ui-common-checkbox.mjs.map +1 -1
  86. package/fesm2020/theseam-ui-common-datatable.mjs +4 -4
  87. package/fesm2020/theseam-ui-common-datatable.mjs.map +1 -1
  88. package/fesm2020/theseam-ui-common-form-field.mjs +3 -3
  89. package/fesm2020/theseam-ui-common-form-field.mjs.map +1 -1
  90. package/fesm2020/theseam-ui-common-framework.mjs +236 -162
  91. package/fesm2020/theseam-ui-common-framework.mjs.map +1 -1
  92. package/fesm2020/theseam-ui-common-google-maps.mjs +9 -1
  93. package/fesm2020/theseam-ui-common-google-maps.mjs.map +1 -1
  94. package/fesm2020/theseam-ui-common-menu.mjs +275 -2
  95. package/fesm2020/theseam-ui-common-menu.mjs.map +1 -1
  96. package/fesm2020/theseam-ui-common-story-helpers.mjs +84 -1
  97. package/fesm2020/theseam-ui-common-story-helpers.mjs.map +1 -1
  98. package/fesm2020/theseam-ui-common-tel-input.mjs +89 -29
  99. package/fesm2020/theseam-ui-common-tel-input.mjs.map +1 -1
  100. package/fesm2020/theseam-ui-common-testing.mjs +165 -1
  101. package/fesm2020/theseam-ui-common-testing.mjs.map +1 -1
  102. package/fesm2020/theseam-ui-common-tiled-select.mjs.map +1 -1
  103. package/framework/schema-form/index.d.ts +1 -0
  104. package/framework/schema-form/schema-form-framework.d.ts +12 -1
  105. package/framework/schema-form/schema-form-widget.d.ts +61 -0
  106. package/framework/schema-form/schema-form.module.d.ts +1 -2
  107. package/framework/schema-form-controls/schema-form-checkbox/schema-form-checkbox.component.d.ts +12 -11
  108. package/framework/schema-form-controls/schema-form-divider/schema-form-divider.component.d.ts +12 -0
  109. package/framework/schema-form-controls/schema-form-input/schema-form-input.component.d.ts +10 -9
  110. package/framework/schema-form-controls/schema-form-number/schema-form-number.component.d.ts +8 -7
  111. package/framework/schema-form-controls/schema-form-select/schema-form-select.component.d.ts +10 -9
  112. package/framework/schema-form-controls/schema-form-submit/schema-form-submit.component.d.ts +10 -9
  113. package/framework/schema-form-controls/schema-form-submit-split/schema-form-submit-split.component.d.ts +10 -9
  114. package/framework/schema-form-controls/schema-form-tel/schema-form-tel.component.d.ts +23 -0
  115. package/framework/schema-form-controls/schema-form-tiled-select/schema-form-tiled-select.component.d.ts +32 -0
  116. package/google-maps/google-maps/google-maps.component.d.ts +2 -1
  117. package/google-maps/google-maps-api-loader/lazy-google-maps-api-loader.d.ts +1 -0
  118. package/menu/menu-footer-action/menu-footer-action.component.d.ts +1 -1
  119. package/menu/public-api.d.ts +4 -0
  120. package/menu/testing/menu-footer.harness.d.ts +22 -0
  121. package/menu/testing/menu-header.harness.d.ts +18 -0
  122. package/menu/testing/menu-item.harness.d.ts +37 -0
  123. package/menu/testing/menu.harness.d.ts +74 -0
  124. package/menu/testing/utils.d.ts +5 -0
  125. package/package.json +1 -1
  126. package/story-helpers/args-to-tpl.d.ts +25 -0
  127. package/story-helpers/public-api.d.ts +1 -0
  128. package/tel-input/public-api.d.ts +1 -0
  129. package/tel-input/tel-input/tel-input.component.d.ts +2 -2
  130. package/tel-input/tel-input.directive.d.ts +1 -1
  131. package/tel-input/tel-input.module.d.ts +7 -7
  132. package/tel-input/testing/tel-input.harness.d.ts +19 -0
  133. package/testing/harnesses/ng-select-dropdown.harness.d.ts +23 -0
  134. package/testing/harnesses/ng-select-option.harness.d.ts +18 -0
  135. package/testing/harnesses/ng-select.harness.d.ts +50 -0
  136. package/testing/public-api.d.ts +3 -0
  137. package/tiled-select/components/tiled-select/tiled-select.component.d.ts +10 -10
  138. package/esm2020/framework/schema-form-controls/schema-form-controls.module.mjs +0 -79
  139. package/framework/schema-form-controls/schema-form-controls.module.d.ts +0 -20
@@ -1,27 +1,28 @@
1
1
  import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { AbstractControl } from '@angular/forms';
3
3
  import { JsonSchemaFormService, TitleMapItem } from '@ajsf/core';
4
+ import { TheSeamSchemaFormControlWidget, TheSeamSchemaFormWidgetLayoutNodeOptions } from '../../schema-form';
4
5
  import * as i0 from "@angular/core";
5
6
  export type TheSeamSchemaFormSubmitSplitItem = TitleMapItem;
6
- export declare class TheSeamSchemaFormSubmitSplitComponent implements OnInit, OnDestroy {
7
- private jsf;
7
+ export declare class TheSeamSchemaFormSubmitSplitComponent implements OnInit, OnDestroy, TheSeamSchemaFormControlWidget {
8
+ private readonly _jsf;
8
9
  /** @ignore */
9
10
  private readonly _ngUnsubscribe;
10
11
  formControl?: AbstractControl;
11
12
  controlName?: string;
12
- controlValue: any;
13
+ controlValue?: any;
13
14
  controlDisabled: boolean;
14
15
  boundControl: boolean;
15
- options: any;
16
- layoutNode: any;
17
- layoutIndex: number[] | undefined | null;
18
- dataIndex: number[] | undefined | null;
16
+ options?: TheSeamSchemaFormWidgetLayoutNodeOptions;
17
+ layoutNode: TheSeamSchemaFormControlWidget['layoutNode'];
18
+ layoutIndex: TheSeamSchemaFormControlWidget['layoutIndex'];
19
+ dataIndex: TheSeamSchemaFormControlWidget['dataIndex'];
19
20
  _buttonLabel: string;
20
21
  _dropdownObj: any;
21
22
  _dropdownDisabled: boolean;
22
23
  _selectList: TheSeamSchemaFormSubmitSplitItem[];
23
24
  _selectedItem?: TheSeamSchemaFormSubmitSplitItem;
24
- constructor(jsf: JsonSchemaFormService);
25
+ constructor(_jsf: JsonSchemaFormService);
25
26
  /** @ignore */
26
27
  ngOnInit(): void;
27
28
  /** @ignore */
@@ -33,5 +34,5 @@ export declare class TheSeamSchemaFormSubmitSplitComponent implements OnInit, On
33
34
  private _getSelectedItem;
34
35
  _setDropdownValue(value: any): void;
35
36
  static ɵfac: i0.ɵɵFactoryDeclaration<TheSeamSchemaFormSubmitSplitComponent, never>;
36
- static ɵcmp: i0.ɵɵComponentDeclaration<TheSeamSchemaFormSubmitSplitComponent, "seam-schema-form-submit-split", never, { "layoutNode": "layoutNode"; "layoutIndex": "layoutIndex"; "dataIndex": "dataIndex"; }, {}, never, never, false, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<TheSeamSchemaFormSubmitSplitComponent, "seam-schema-form-submit-split", never, { "layoutNode": "layoutNode"; "layoutIndex": "layoutIndex"; "dataIndex": "dataIndex"; }, {}, never, never, true, never>;
37
38
  }
@@ -0,0 +1,23 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { AbstractControl } from '@angular/forms';
3
+ import { JsonSchemaFormService } from '@ajsf/core';
4
+ import { TheSeamSchemaFormControlWidget, TheSeamSchemaFormWidgetLayoutNodeOptions } from '../../schema-form';
5
+ import * as i0 from "@angular/core";
6
+ export declare class TheSeamSchemaFormTelComponent implements OnInit, TheSeamSchemaFormControlWidget {
7
+ private readonly _jsf;
8
+ formControl?: AbstractControl;
9
+ controlName?: string;
10
+ controlValue?: any;
11
+ controlDisabled: boolean;
12
+ boundControl: boolean;
13
+ options?: TheSeamSchemaFormWidgetLayoutNodeOptions;
14
+ layoutNode: TheSeamSchemaFormControlWidget['layoutNode'];
15
+ layoutIndex: TheSeamSchemaFormControlWidget['layoutIndex'];
16
+ dataIndex: TheSeamSchemaFormControlWidget['dataIndex'];
17
+ autoCompleteList: string[];
18
+ constructor(_jsf: JsonSchemaFormService);
19
+ ngOnInit(): void;
20
+ updateValue(event: any): void;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<TheSeamSchemaFormTelComponent, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<TheSeamSchemaFormTelComponent, "seam-schema-form-tel", never, { "layoutNode": "layoutNode"; "layoutIndex": "layoutIndex"; "dataIndex": "dataIndex"; }, {}, never, never, true, never>;
23
+ }
@@ -0,0 +1,32 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { AbstractControl } from '@angular/forms';
3
+ import { JsonSchemaFormService } from '@ajsf/core';
4
+ import { TheSeamSchemaFormControlWidget, TheSeamSchemaFormWidgetLayoutNodeOptions } from '../../schema-form';
5
+ import { TiledSelectItem, TiledSelectLayout } from '@theseam/ui-common/tiled-select';
6
+ import { Platform } from '@angular/cdk/platform';
7
+ import * as i0 from "@angular/core";
8
+ export declare class TheSeamSchemaFormTiledSelectComponent implements OnInit, TheSeamSchemaFormControlWidget {
9
+ private readonly _jsf;
10
+ private readonly _platform;
11
+ formControl?: AbstractControl;
12
+ controlName?: string;
13
+ controlValue?: any;
14
+ controlDisabled: boolean;
15
+ boundControl: boolean;
16
+ options?: TheSeamSchemaFormWidgetLayoutNodeOptions;
17
+ layoutNode: TheSeamSchemaFormControlWidget['layoutNode'];
18
+ layoutIndex: TheSeamSchemaFormControlWidget['layoutIndex'];
19
+ dataIndex: TheSeamSchemaFormControlWidget['dataIndex'];
20
+ tiles: TiledSelectItem[];
21
+ layout: TiledSelectLayout;
22
+ multiple: boolean;
23
+ selectionToggleable: boolean;
24
+ tileBackdrop: boolean;
25
+ showSelectedIcon: boolean;
26
+ animationsDisabled: boolean;
27
+ constructor(_jsf: JsonSchemaFormService, _platform: Platform);
28
+ ngOnInit(): void;
29
+ updateValue(event: any): void;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<TheSeamSchemaFormTiledSelectComponent, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<TheSeamSchemaFormTiledSelectComponent, "seam-schema-form-tiled-select", never, { "layoutNode": "layoutNode"; "layoutIndex": "layoutIndex"; "dataIndex": "dataIndex"; }, {}, never, never, true, never>;
32
+ }
@@ -72,7 +72,7 @@ export declare class TheSeamGoogleMapsComponent extends _TheSeamGoogleMapsMixinB
72
72
  zoom: number;
73
73
  longitude: number;
74
74
  latitude: number;
75
- mapReady: EventEmitter<void>;
75
+ mapReady: EventEmitter<google.maps.Map | undefined>;
76
76
  featureContextMenu: MenuComponent;
77
77
  _options: {
78
78
  mapTypeControl: boolean;
@@ -81,6 +81,7 @@ export declare class TheSeamGoogleMapsComponent extends _TheSeamGoogleMapsMixinB
81
81
  fullscreenControl: boolean;
82
82
  };
83
83
  readonly _contextMenuItems$: Observable<TheSeamMapContextMenuItem[]>;
84
+ private idleListener;
84
85
  constructor(elementRef: ElementRef, _focusMonitor: FocusMonitor, _googleMaps: GoogleMapsService, _mapValueManager: MapValueManagerService, _googleMapsApiLoader: TheSeamGoogleMapsApiLoader);
85
86
  ngOnInit(): void;
86
87
  ngOnDestroy(): void;
@@ -55,6 +55,7 @@ export interface TheSeamLazyMapsApiLoaderConfig {
55
55
  * https://developers.google.com/maps/documentation/javascript/basics#Language
56
56
  */
57
57
  language?: string;
58
+ loading?: string;
58
59
  }
59
60
  export declare class TheSeamLazyMapsApiLoader extends TheSeamGoogleMapsApiLoader {
60
61
  private readonly _localeId;
@@ -2,7 +2,7 @@ import { ElementRef } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class MenuFooterActionComponent {
4
4
  private _elementRef;
5
- get _attrType(): "reset" | "submit" | "button" | null | undefined;
5
+ get _attrType(): "button" | "reset" | "submit" | null | undefined;
6
6
  /** ARIA type for the button. */
7
7
  get type(): 'button' | 'submit' | 'reset' | undefined | null;
8
8
  set type(value: 'button' | 'submit' | 'reset' | undefined | null);
@@ -1,3 +1,7 @@
1
+ export * from './testing/menu-footer.harness';
2
+ export * from './testing/menu-header.harness';
3
+ export * from './testing/menu-item.harness';
4
+ export * from './testing/menu.harness';
1
5
  export * from './menu-animations';
2
6
  export * from './menu-divider.component';
3
7
  export * from './menu-item.component';
@@ -0,0 +1,22 @@
1
+ import { BaseHarnessFilters, ComponentHarnessConstructor, ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
2
+ /** A set of criteria that can be used to filter a list of `TheSeamMenuFooterHarness` instances. */
3
+ export interface TheSeamMenuFooterHarnessFilters extends BaseHarnessFilters {
4
+ /** Only find instances whose text matches the given value. */
5
+ text?: string | RegExp;
6
+ }
7
+ export declare class TheSeamMenuFooterHarness extends ContentContainerComponentHarness<string> {
8
+ /** The selector for the host element of a `MenuFooterComponent` instance. */
9
+ static hostSelector: string;
10
+ /**
11
+ * Gets a `HarnessPredicate` that can be used to search for a menu item with specific attributes.
12
+ * @param options Options for filtering which menu item instances are considered a match.
13
+ * @return a `HarnessPredicate` configured with the given options.
14
+ */
15
+ static with<T extends TheSeamMenuFooterHarness>(this: ComponentHarnessConstructor<T>, options?: TheSeamMenuFooterHarnessFilters): HarnessPredicate<T>;
16
+ /** Gets the text of the menu item. */
17
+ getText(): Promise<string>;
18
+ /** Clicks the menu item. */
19
+ click(): Promise<void>;
20
+ /** Hovers the menu item. */
21
+ hover(): Promise<void>;
22
+ }
@@ -0,0 +1,18 @@
1
+ import { BaseHarnessFilters, ComponentHarnessConstructor, ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
2
+ /** A set of criteria that can be used to filter a list of `TheSeamMenuHeaderHarness` instances. */
3
+ export interface TheSeamMenuHeaderHarnessFilters extends BaseHarnessFilters {
4
+ }
5
+ export declare class TheSeamMenuHeaderHarness extends ContentContainerComponentHarness<string> {
6
+ /** The selector for the host element of a `MenuHeaderComponent` instance. */
7
+ static hostSelector: string;
8
+ /**
9
+ * Gets a `HarnessPredicate` that can be used to search for a menu item with specific attributes.
10
+ * @param options Options for filtering which menu item instances are considered a match.
11
+ * @return a `HarnessPredicate` configured with the given options.
12
+ */
13
+ static with<T extends TheSeamMenuHeaderHarness>(this: ComponentHarnessConstructor<T>, options?: TheSeamMenuHeaderHarnessFilters): HarnessPredicate<T>;
14
+ /** Clicks the menu item. */
15
+ click(): Promise<void>;
16
+ /** Hovers the menu item. */
17
+ hover(): Promise<void>;
18
+ }
@@ -0,0 +1,37 @@
1
+ import { BaseHarnessFilters, ComponentHarnessConstructor, ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
2
+ import { TheSeamMenuHarness } from './menu.harness';
3
+ /** A set of criteria that can be used to filter a list of `TheSeamMenuItemHarness` instances. */
4
+ export interface TheSeamMenuItemHarnessFilters extends BaseHarnessFilters {
5
+ /** Only find instances whose text matches the given value. */
6
+ text?: string | RegExp;
7
+ /** Only find instances that have a sub-menu. */
8
+ hasSubmenu?: boolean;
9
+ }
10
+ export declare class TheSeamMenuItemHarness extends ContentContainerComponentHarness<string> {
11
+ /** The selector for the host element of a `MenuItemComponent` instance. */
12
+ static hostSelector: string;
13
+ /**
14
+ * Gets a `HarnessPredicate` that can be used to search for a menu item with specific attributes.
15
+ * @param options Options for filtering which menu item instances are considered a match.
16
+ * @return a `HarnessPredicate` configured with the given options.
17
+ */
18
+ static with<T extends TheSeamMenuItemHarness>(this: ComponentHarnessConstructor<T>, options?: TheSeamMenuItemHarnessFilters): HarnessPredicate<T>;
19
+ /** Whether the menu is disabled. */
20
+ isDisabled(): Promise<boolean>;
21
+ /** Gets the text of the menu item. */
22
+ getText(): Promise<string>;
23
+ /** Focuses the menu item. */
24
+ focus(): Promise<void>;
25
+ /** Blurs the menu item. */
26
+ blur(): Promise<void>;
27
+ /** Whether the menu item is focused. */
28
+ isFocused(): Promise<boolean>;
29
+ /** Clicks the menu item. */
30
+ click(): Promise<void>;
31
+ /** Hovers the menu item. */
32
+ hover(): Promise<void>;
33
+ /** Whether this item has a submenu. */
34
+ hasSubmenu(): Promise<boolean>;
35
+ /** Gets the submenu associated with this menu item, or null if none. */
36
+ getSubmenu(): Promise<TheSeamMenuHarness | null>;
37
+ }
@@ -0,0 +1,74 @@
1
+ import { ComponentHarnessConstructor, ContentContainerComponentHarness, HarnessLoader, HarnessPredicate, BaseHarnessFilters } from '@angular/cdk/testing';
2
+ import { TheSeamMenuItemHarness, TheSeamMenuItemHarnessFilters } from './menu-item.harness';
3
+ import { TheSeamMenuFooterHarness, TheSeamMenuFooterHarnessFilters } from './menu-footer.harness';
4
+ import { TheSeamMenuHeaderHarness, TheSeamMenuHeaderHarnessFilters } from './menu-header.harness';
5
+ /** A set of criteria that can be used to filter a list of `TheSeamMenuHarness` instances. */
6
+ export interface TheSeamMenuHarnessFilters extends BaseHarnessFilters {
7
+ /** Only find instances whose trigger text matches the given value. */
8
+ triggerText?: string | RegExp;
9
+ }
10
+ export declare class TheSeamMenuHarness extends ContentContainerComponentHarness<string> {
11
+ private _documentRootLocator;
12
+ /** The selector for the host element of a `MenuComponent` instance. */
13
+ static hostSelector: string;
14
+ /**
15
+ * Gets a `HarnessPredicate` that can be used to search for a menu with specific attributes.
16
+ * @param options Options for filtering which menu instances are considered a match.
17
+ * @return a `HarnessPredicate` configured with the given options.
18
+ */
19
+ static with<T extends TheSeamMenuHarness>(this: ComponentHarnessConstructor<T>, options?: TheSeamMenuHarnessFilters): HarnessPredicate<T>;
20
+ /** Whether the menu is disabled. */
21
+ isDisabled(): Promise<boolean>;
22
+ /** Whether the menu is open. */
23
+ isOpen(): Promise<boolean>;
24
+ /** Gets the text of the menu's trigger element. */
25
+ getTriggerText(): Promise<string>;
26
+ /** Focuses the menu. */
27
+ focus(): Promise<void>;
28
+ /** Blurs the menu. */
29
+ blur(): Promise<void>;
30
+ /** Whether the menu is focused. */
31
+ isFocused(): Promise<boolean>;
32
+ /** Opens the menu. */
33
+ open(): Promise<void>;
34
+ /** Closes the menu. */
35
+ close(): Promise<void>;
36
+ /**
37
+ * Gets a list of `TheSeamMenuItemHarness` representing the items in the menu.
38
+ * @param filters Optionally filters which menu items are included.
39
+ */
40
+ getItems(filters?: Omit<TheSeamMenuItemHarnessFilters, 'ancestor'>): Promise<TheSeamMenuItemHarness[]>;
41
+ /**
42
+ * Clicks an item in the menu, and optionally continues clicking items in subsequent sub-menus.
43
+ * @param itemFilter A filter used to represent which item in the menu should be clicked. The
44
+ * first matching menu item will be clicked.
45
+ * @param subItemFilters A list of filters representing the items to click in any subsequent
46
+ * sub-menus. The first item in the sub-menu matching the corresponding filter in
47
+ * `subItemFilters` will be clicked.
48
+ */
49
+ clickItem(itemFilter: Omit<TheSeamMenuItemHarnessFilters, 'ancestor'>, ...subItemFilters: Omit<TheSeamMenuItemHarnessFilters, 'ancestor'>[]): Promise<void>;
50
+ /**
51
+ * Hovers an item in the menu, and optionally continues hovering items in subsequent sub-menus.
52
+ * @param itemFilter A filter used to represent which item in the menu should be hovered. The
53
+ * first matching menu item will be hovered.
54
+ * @param subItemFilters A list of filters representing the items to hover in any subsequent
55
+ * sub-menus. The first item in the sub-menu matching the corresponding filter in
56
+ * `subItemFilters` will be hovered.
57
+ */
58
+ hoverItem(itemFilter: Omit<TheSeamMenuItemHarnessFilters, 'ancestor'>, ...subItemFilters: Omit<TheSeamMenuItemHarnessFilters, 'ancestor'>[]): Promise<void>;
59
+ /**
60
+ * Gets a `TheSeamMenuHeaderHarness` representing the header in the menu.
61
+ * @param filters Optionally filters which menu items are included.
62
+ */
63
+ getHeader(filters?: Omit<TheSeamMenuHeaderHarnessFilters, 'ancestor'>): Promise<TheSeamMenuHeaderHarness | null>;
64
+ /**
65
+ * Gets a `TheSeamMenuFooterHarness` representing the footer in the menu.
66
+ * @param filters Optionally filters which menu items are included.
67
+ */
68
+ getFooter(filters?: Omit<TheSeamMenuFooterHarnessFilters, 'ancestor'>): Promise<TheSeamMenuFooterHarness | null>;
69
+ protected getRootHarnessLoader(): Promise<HarnessLoader>;
70
+ /** Gets the menu panel associated with this menu. */
71
+ private _getMenuPanel;
72
+ /** Gets the id of the menu panel associated with this menu. */
73
+ private _getPanelId;
74
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Workaround to wait on the animation to finish in browser, until a generic
3
+ * broswer-based solution is added, for Storybook interactions.
4
+ */
5
+ export declare function animatingWait(): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theseam/ui-common",
3
- "version": "0.4.13",
3
+ "version": "0.4.15",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^15.0.0",
6
6
  "@angular/common": "^15.0.0",
@@ -0,0 +1,25 @@
1
+ import { HandlerFunction } from '@storybook/addon-actions';
2
+ export interface ArgsTplParts {
3
+ actions: {
4
+ [prop: string]: HandlerFunction;
5
+ };
6
+ tplfragment: string;
7
+ }
8
+ export interface ArgsTplOptions {
9
+ /**
10
+ * Properties to always bind to the template.
11
+ */
12
+ alwaysBind?: string[];
13
+ /**
14
+ * Properties to exclude from bidning to the template.
15
+ */
16
+ exclude?: string[];
17
+ }
18
+ /**
19
+ * This is an attempt at simplifying the use of auto-generated args in stories
20
+ * defined with `template`, since Angular doesn't have a way to simply use a
21
+ * spread operator syntax.
22
+ *
23
+ * @experimental
24
+ */
25
+ export declare function argsToTpl(options?: ArgsTplOptions): string;
@@ -1,4 +1,5 @@
1
1
  export * from './arg-type-helpers';
2
+ export * from './args-to-tpl';
2
3
  export * from './story-empty.component';
3
4
  export * from './story-initial-route';
4
5
  export * from './route-button';
@@ -7,3 +7,4 @@ export * from './tel-input.directive';
7
7
  export * from './tel-input-validator';
8
8
  export * from './tel-input.module';
9
9
  export * from './phone-number.pipe';
10
+ export * from './testing/tel-input.harness';
@@ -39,7 +39,7 @@ export declare class TheSeamTelInputComponent implements OnInit, OnDestroy, Cont
39
39
  /** The value attribute of the native input element */
40
40
  value: string | undefined | null;
41
41
  /** Event emitted when the "tel" input value changes. */
42
- readonly change: EventEmitter<string>;
42
+ readonly change: EventEmitter<string | null | undefined>;
43
43
  /**
44
44
  * The telInput directive
45
45
  * @ignore
@@ -82,5 +82,5 @@ export declare class TheSeamTelInputComponent implements OnInit, OnDestroy, Cont
82
82
  blur(): void;
83
83
  hasFocus(): boolean;
84
84
  static ɵfac: i0.ɵɵFactoryDeclaration<TheSeamTelInputComponent, never>;
85
- static ɵcmp: i0.ɵɵComponentDeclaration<TheSeamTelInputComponent, "seam-tel-input", never, { "required": "required"; "disabled": "disabled"; "tabIndex": "tabIndex"; "name": "name"; "value": "value"; }, { "change": "change"; }, never, never, false, never>;
85
+ static ɵcmp: i0.ɵɵComponentDeclaration<TheSeamTelInputComponent, "seam-tel-input", never, { "required": "required"; "disabled": "disabled"; "tabIndex": "tabIndex"; "name": "name"; "value": "value"; }, { "change": "change"; }, never, never, true, never>;
86
86
  }
@@ -31,5 +31,5 @@ export declare class TheSeamTelInputDirective implements OnInit, OnDestroy, DoCh
31
31
  blur(): void;
32
32
  getHostElement(): HTMLInputElement;
33
33
  static ɵfac: i0.ɵɵFactoryDeclaration<TheSeamTelInputDirective, [null, null, null, { optional: true; }, { optional: true; self: true; }]>;
34
- static ɵdir: i0.ɵɵDirectiveDeclaration<TheSeamTelInputDirective, "input[seamTelInput]", ["seamTelInput"], { "value": "value"; }, {}, never, never, false, never>;
34
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TheSeamTelInputDirective, "input[seamTelInput]", ["seamTelInput"], { "value": "value"; }, {}, never, never, true, never>;
35
35
  }
@@ -1,12 +1,12 @@
1
1
  import * as i0 from "@angular/core";
2
- import * as i1 from "./tel-input.directive";
3
- import * as i2 from "./tel-input/tel-input.component";
4
- import * as i3 from "./phone-number.pipe";
5
- import * as i4 from "@angular/common";
6
- import * as i5 from "@angular/forms";
7
- import * as i6 from "@theseam/ui-common/form-field";
2
+ import * as i1 from "./phone-number.pipe";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/forms";
5
+ import * as i4 from "@theseam/ui-common/form-field";
6
+ import * as i5 from "./tel-input.directive";
7
+ import * as i6 from "./tel-input/tel-input.component";
8
8
  export declare class TheSeamTelInputModule {
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<TheSeamTelInputModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<TheSeamTelInputModule, [typeof i1.TheSeamTelInputDirective, typeof i2.TheSeamTelInputComponent, typeof i3.TheSeamPhoneNumberPipe], [typeof i4.CommonModule, typeof i5.ReactiveFormsModule, typeof i6.TheSeamFormFieldModule], [typeof i1.TheSeamTelInputDirective, typeof i2.TheSeamTelInputComponent, typeof i3.TheSeamPhoneNumberPipe]>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TheSeamTelInputModule, [typeof i1.TheSeamPhoneNumberPipe], [typeof i2.CommonModule, typeof i3.ReactiveFormsModule, typeof i4.TheSeamFormFieldModule, typeof i5.TheSeamTelInputDirective, typeof i6.TheSeamTelInputComponent], [typeof i5.TheSeamTelInputDirective, typeof i6.TheSeamTelInputComponent, typeof i1.TheSeamPhoneNumberPipe]>;
11
11
  static ɵinj: i0.ɵɵInjectorDeclaration<TheSeamTelInputModule>;
12
12
  }
@@ -0,0 +1,19 @@
1
+ import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
2
+ interface TheSeamTelInputHarnessFilters extends BaseHarnessFilters {
3
+ /** Filters based on the name of the field. */
4
+ name?: string | RegExp;
5
+ }
6
+ export declare class TheSeamTelInputHarness extends ComponentHarness {
7
+ static hostSelector: string;
8
+ private readonly _input;
9
+ /** Creates a `HarnessPredicate` used to locate a particular `TheSeamTelInputHarness`. */
10
+ static with(options: TheSeamTelInputHarnessFilters): HarnessPredicate<TheSeamTelInputHarness>;
11
+ getName(): Promise<string | null>;
12
+ getValue(): Promise<any>;
13
+ isDisabled(): Promise<boolean>;
14
+ isRequired(): Promise<boolean>;
15
+ click(): Promise<void>;
16
+ setValue(value: any): Promise<void>;
17
+ private _waitOnInstance;
18
+ }
19
+ export {};
@@ -0,0 +1,23 @@
1
+ import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
2
+ import { TheSeamNgSelectOptionHarness, TheSeamNgSelectOptionHarnessFilters } from './ng-select-option.harness';
3
+ export interface TheSeamNgSelectDropdownHarnessFilters extends BaseHarnessFilters {
4
+ /** Filters based on the name of the field. */
5
+ id?: string | RegExp;
6
+ }
7
+ export declare class TheSeamNgSelectDropdownHarness extends ComponentHarness {
8
+ static hostSelector: string;
9
+ /** Creates a `HarnessPredicate` used to locate a particular `MyMenuHarness`. */
10
+ static with(options: TheSeamNgSelectDropdownHarnessFilters): HarnessPredicate<TheSeamNgSelectDropdownHarness>;
11
+ getId(): Promise<string | null>;
12
+ /**
13
+ * Gets a list of `TheSeamNgSelectOptionHarness` representing the items in the menu.
14
+ * @param filters Optionally filters which menu items are included.
15
+ */
16
+ getOptions(filters?: Omit<TheSeamNgSelectOptionHarnessFilters, 'ancestor'>): Promise<TheSeamNgSelectOptionHarness[]>;
17
+ /**
18
+ * Clicks an option in the dropdown.
19
+ * @param optionFilter A filter used to represent which option in the dropdown should be clicked. The
20
+ * first matching dropdown option will be clicked.
21
+ */
22
+ clickOption(optionFilter: Omit<TheSeamNgSelectOptionHarnessFilters, 'ancestor'>): Promise<void>;
23
+ }
@@ -0,0 +1,18 @@
1
+ import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
2
+ export interface TheSeamNgSelectOptionHarnessFilters extends BaseHarnessFilters {
3
+ /** Filters based on the value of the field. */
4
+ value?: string | RegExp;
5
+ }
6
+ export declare class TheSeamNgSelectOptionHarness extends ComponentHarness {
7
+ static hostSelector: string;
8
+ /** Creates a `HarnessPredicate` used to locate a particular `MyMenuHarness`. */
9
+ static with(options: TheSeamNgSelectOptionHarnessFilters): HarnessPredicate<TheSeamNgSelectOptionHarness>;
10
+ /**
11
+ * NOTE: Only works with string values, curently.
12
+ * @returns value of the select option
13
+ */
14
+ getValue(): Promise<any>;
15
+ /** Whether the ng-select is disabled. */
16
+ isDisabled(): Promise<boolean>;
17
+ click(): Promise<void>;
18
+ }
@@ -0,0 +1,50 @@
1
+ import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
2
+ import { TheSeamNgSelectOptionHarness, TheSeamNgSelectOptionHarnessFilters } from './ng-select-option.harness';
3
+ export interface TheSeamNgSelectHarnessFilters extends BaseHarnessFilters {
4
+ }
5
+ export declare class TheSeamNgSelectHarness extends ComponentHarness {
6
+ private _documentRootLocator;
7
+ static hostSelector: string;
8
+ private readonly _value;
9
+ private readonly _valueLabel;
10
+ /** Creates a `HarnessPredicate` used to locate a particular `MyMenuHarness`. */
11
+ static with(options: TheSeamNgSelectHarnessFilters): HarnessPredicate<TheSeamNgSelectHarness>;
12
+ getId(): Promise<string | null>;
13
+ getAriaControls(): Promise<string | null>;
14
+ getName(): Promise<string | null>;
15
+ /**
16
+ * NOTE: Only works with string values, curently.
17
+ * @returns value of the select
18
+ */
19
+ getValue(): Promise<any>;
20
+ /**
21
+ * Gets a list of `TheSeamNgSelectOptionHarness` representing the options in the dropdown.
22
+ *
23
+ * NOTE: Must open the dropdown first. eg. `await ngSelectHarness.click()`
24
+ *
25
+ * @param filters Optionally filters which menu items are included.
26
+ */
27
+ getOptions(filters?: Omit<TheSeamNgSelectOptionHarnessFilters, 'ancestor'>): Promise<TheSeamNgSelectOptionHarness[]>;
28
+ /**
29
+ * Clicks an option in the dropdown.
30
+ * @param optionFilter A filter used to represent which option in the dropdown should be clicked. The
31
+ * first matching dropdown option will be clicked.
32
+ */
33
+ clickOption(optionFilter: Omit<TheSeamNgSelectOptionHarnessFilters, 'ancestor'>): Promise<void>;
34
+ /** Whether the ng-select is disabled. */
35
+ isDisabled(): Promise<boolean>;
36
+ /**
37
+ * Returns the required state of the ng-select.
38
+ *
39
+ * @returns true if the ng-select is required, false if not
40
+ */
41
+ isRequired(): Promise<boolean>;
42
+ click(): Promise<void>;
43
+ /**
44
+ * Returns the input element of the checkbox.
45
+ *
46
+ * @returns the input element of the checkbox
47
+ */
48
+ getInputElement(): Promise<import("@angular/cdk/testing").TestElement>;
49
+ private _getDropdown;
50
+ }
@@ -1,3 +1,6 @@
1
+ export * from './harnesses/ng-select-dropdown.harness';
2
+ export * from './harnesses/ng-select-option.harness';
3
+ export * from './harnesses/ng-select.harness';
1
4
  export * from './fake-toastr';
2
5
  export * from './render-story';
3
6
  export * from './tick-helper';
@@ -3,7 +3,7 @@ import { Platform } from '@angular/cdk/platform';
3
3
  import { ChangeDetectorRef, ElementRef, EventEmitter, QueryList, Renderer2 } from '@angular/core';
4
4
  import { ControlValueAccessor } from '@angular/forms';
5
5
  import { TiledSelectTileOverlayDirective } from './../../directives/tiled-select-tile-overlay.directive';
6
- import { ITiledSelectItem, TiledSelectLayout } from '../../tiled-select.models';
6
+ import { TiledSelectItem, TiledSelectLayout } from '../../tiled-select.models';
7
7
  import * as i0 from "@angular/core";
8
8
  export declare const slideEnterAnimation: import("@angular/animations").AnimationReferenceMetadata;
9
9
  export declare const TILED_SELECT_VALUE_ACCESSOR: any;
@@ -20,8 +20,8 @@ export declare class TheSeamTiledSelectComponent implements ControlValueAccessor
20
20
  static ngAcceptInputType_showSelectedIcon: BooleanInput;
21
21
  static ngAcceptInputType_animationsDisabled: BooleanInput;
22
22
  layout: TiledSelectLayout;
23
- get tiles(): ITiledSelectItem[];
24
- set tiles(value: ITiledSelectItem[]);
23
+ get tiles(): TiledSelectItem[];
24
+ set tiles(value: TiledSelectItem[]);
25
25
  private _tiles;
26
26
  val: string | string[] | undefined;
27
27
  disabled: boolean;
@@ -42,13 +42,13 @@ export declare class TheSeamTiledSelectComponent implements ControlValueAccessor
42
42
  registerOnChange(fn: any): void;
43
43
  registerOnTouched(fn: any): void;
44
44
  setDisabledState(isDisabled: boolean): void;
45
- onTileSelected(event: MouseEvent, tile: ITiledSelectItem): void;
46
- isSelected(tile: ITiledSelectItem): boolean;
47
- toggleTileSelected(tile: ITiledSelectItem): void;
48
- selectTile(tile: ITiledSelectItem): void;
49
- unselectTile(tile: ITiledSelectItem): void;
50
- getSelectedTiles(): ITiledSelectItem[];
51
- getOverlayTpl(tile: ITiledSelectItem): TiledSelectTileOverlayDirective | undefined;
45
+ onTileSelected(event: MouseEvent, tile: TiledSelectItem): void;
46
+ isSelected(tile: TiledSelectItem): boolean;
47
+ toggleTileSelected(tile: TiledSelectItem): void;
48
+ selectTile(tile: TiledSelectItem): void;
49
+ unselectTile(tile: TiledSelectItem): void;
50
+ getSelectedTiles(): TiledSelectItem[];
51
+ getOverlayTpl(tile: TiledSelectItem): TiledSelectTileOverlayDirective | undefined;
52
52
  static ɵfac: i0.ɵɵFactoryDeclaration<TheSeamTiledSelectComponent, never>;
53
53
  static ɵcmp: i0.ɵɵComponentDeclaration<TheSeamTiledSelectComponent, "seam-tiled-select", never, { "layout": "layout"; "tiles": "tiles"; "val": "value"; "disabled": "disabled"; "multiple": "multiple"; "selectionToggleable": "selectionToggleable"; "tileBackdrop": "tileBackdrop"; "showSelectedIcon": "showSelectedIcon"; "animationsDisabled": "animationsDisabled"; }, { "change": "change"; }, ["overlayTpls"], never, false, never>;
54
54
  }