@theseam/ui-common 1.0.0-beta.13 → 1.0.0-beta.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.
@@ -1,7 +1,7 @@
1
1
  import { BaseHarnessFilters, ContentContainerComponentHarness, ComponentHarnessConstructor, HarnessPredicate } from '@angular/cdk/testing';
2
2
  import { FocusMonitor } from '@angular/cdk/a11y';
3
3
  import * as i0 from '@angular/core';
4
- import { OnDestroy, ElementRef, Renderer2, EventEmitter } from '@angular/core';
4
+ import { OnDestroy, ElementRef, Renderer2, NgZone, EventEmitter } from '@angular/core';
5
5
  import { ThemeTypes } from '@theseam/ui-common/models';
6
6
  import { CanDisableCtor, CanThemeCtor, CanSizeCtor } from '@theseam/ui-common/core';
7
7
  import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
@@ -141,11 +141,14 @@ declare class TheSeamAnchorButtonComponent extends _TheSeamButtonMixinBase imple
141
141
  readonly _elementRef: ElementRef;
142
142
  readonly _focusMonitor: FocusMonitor;
143
143
  readonly _renderer: Renderer2;
144
+ protected readonly _ngZone: NgZone;
145
+ private readonly _cleanupClick;
144
146
  /** Tabindex of the button. */
145
147
  tabIndex: number | undefined | null;
146
148
  constructor(_elementRef: ElementRef, _focusMonitor: FocusMonitor, _renderer: Renderer2);
147
149
  ngOnDestroy(): void;
148
150
  _haltDisabledEvents(event: Event): void;
151
+ private _createClickListener;
149
152
  static ɵfac: i0.ɵɵFactoryDeclaration<TheSeamAnchorButtonComponent, never>;
150
153
  static ɵcmp: i0.ɵɵComponentDeclaration<TheSeamAnchorButtonComponent, "a[seamButton]", ["seamButton", "seamButtonBaseAnchor"], { "disabled": { "alias": "disabled"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "size": { "alias": "size"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; }, {}, never, ["*"], false, never>;
151
154
  }
@@ -2,7 +2,7 @@ import { ThemeNames, OutlineThemeNames } from '@theseam/ui-common/models';
2
2
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
3
3
  import { HarnessPredicate, ContentContainerComponentHarness } from '@angular/cdk/testing';
4
4
  import * as i0 from '@angular/core';
5
- import { Component, Input, ChangeDetectionStrategy, HostBinding, forwardRef, EventEmitter, Output, NgModule } from '@angular/core';
5
+ import { Component, Input, ChangeDetectionStrategy, inject, NgZone, HostBinding, forwardRef, EventEmitter, Output, NgModule } from '@angular/core';
6
6
  import { mixinSize, mixinTheme, mixinDisabled, InputBoolean, InputNumber } from '@theseam/ui-common/core';
7
7
  import * as i1 from '@angular/cdk/a11y';
8
8
  import { __decorate } from 'tslib';
@@ -226,6 +226,8 @@ class TheSeamAnchorButtonComponent extends _TheSeamButtonMixinBase {
226
226
  _elementRef;
227
227
  _focusMonitor;
228
228
  _renderer;
229
+ _ngZone = inject(NgZone);
230
+ _cleanupClick;
229
231
  /** Tabindex of the button. */
230
232
  tabIndex;
231
233
  // TODO: Consider adding dev warning for `window.opener` exploit. Could maybe
@@ -239,9 +241,13 @@ class TheSeamAnchorButtonComponent extends _TheSeamButtonMixinBase {
239
241
  this._elementRef = _elementRef;
240
242
  this._focusMonitor = _focusMonitor;
241
243
  this._renderer = _renderer;
244
+ // Can't initialize on the property since it depends on a
245
+ // constructor-injected value.
246
+ this._cleanupClick = this._createClickListener();
242
247
  }
243
248
  ngOnDestroy() {
244
249
  super.ngOnDestroy();
250
+ this._cleanupClick();
245
251
  }
246
252
  _haltDisabledEvents(event) {
247
253
  // A disabled button shouldn't apply any actions
@@ -250,8 +256,11 @@ class TheSeamAnchorButtonComponent extends _TheSeamButtonMixinBase {
250
256
  event.stopImmediatePropagation();
251
257
  }
252
258
  }
259
+ _createClickListener() {
260
+ return this._ngZone.runOutsideAngular(() => this._renderer.listen(this._elementRef.nativeElement, 'click', (event) => this._haltDisabledEvents(event)));
261
+ }
253
262
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamAnchorButtonComponent, deps: [{ token: i0.ElementRef }, { token: i1.FocusMonitor }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
254
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.7", type: TheSeamAnchorButtonComponent, isStandalone: false, selector: "a[seamButton]", inputs: { disabled: "disabled", theme: "theme", size: "size", tabIndex: "tabIndex" }, host: { listeners: { "click": "_haltDisabledEvents($event)" }, properties: { "attr.tabindex": "disabled ? -1 : (tabIndex || 0)", "attr.disabled": "disabled || null", "attr.aria-disabled": "disabled.toString()" }, classAttribute: "btn" }, exportAs: ["seamButton", "seamButtonBaseAnchor"], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
263
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.7", type: TheSeamAnchorButtonComponent, isStandalone: false, selector: "a[seamButton]", inputs: { disabled: "disabled", theme: "theme", size: "size", tabIndex: "tabIndex" }, host: { properties: { "attr.tabindex": "disabled ? -1 : (tabIndex || 0)", "attr.disabled": "disabled || null", "attr.aria-disabled": "disabled.toString()" }, classAttribute: "btn" }, exportAs: ["seamButton", "seamButtonBaseAnchor"], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush });
255
264
  }
256
265
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamAnchorButtonComponent, decorators: [{
257
266
  type: Component,
@@ -261,7 +270,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
261
270
  '[attr.tabindex]': 'disabled ? -1 : (tabIndex || 0)',
262
271
  '[attr.disabled]': 'disabled || null',
263
272
  '[attr.aria-disabled]': 'disabled.toString()',
264
- '(click)': '_haltDisabledEvents($event)',
265
273
  }, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<ng-content></ng-content>\n" }]
266
274
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.FocusMonitor }, { type: i0.Renderer2 }], propDecorators: { tabIndex: [{
267
275
  type: Input
@@ -319,7 +327,7 @@ class TheSeamAnchorBadgeButtonComponent extends TheSeamAnchorButtonComponent {
319
327
  super.ngOnDestroy();
320
328
  }
321
329
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamAnchorBadgeButtonComponent, deps: [{ token: i0.ElementRef }, { token: i1.FocusMonitor }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
322
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.7", type: TheSeamAnchorBadgeButtonComponent, isStandalone: false, selector: "a[seamBadgeButton]", inputs: { disabled: "disabled", theme: "theme", size: "size", badgeTheme: "badgeTheme", badgeText: "badgeText" }, host: { listeners: { "click": "_haltDisabledEvents($event)" }, properties: { "attr.tabindex": "disabled ? -1 : (tabIndex || 0)", "attr.disabled": "disabled || null", "attr.aria-disabled": "disabled.toString()", "class.text-nowrap": "this._textNoWrap" }, classAttribute: "btn" }, exportAs: ["seamBadgeButton", "seamBadgeButtonAnchor"], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\n<span class=\"ml-2 badge badge-{{ badgeTheme }}\">{{ badgeText }}</span>\n", styles: [""] });
330
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.7", type: TheSeamAnchorBadgeButtonComponent, isStandalone: false, selector: "a[seamBadgeButton]", inputs: { disabled: "disabled", theme: "theme", size: "size", badgeTheme: "badgeTheme", badgeText: "badgeText" }, host: { properties: { "attr.tabindex": "disabled ? -1 : (tabIndex || 0)", "attr.disabled": "disabled || null", "attr.aria-disabled": "disabled.toString()", "class.text-nowrap": "this._textNoWrap" }, classAttribute: "btn" }, exportAs: ["seamBadgeButton", "seamBadgeButtonAnchor"], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\n<span class=\"ml-2 badge badge-{{ badgeTheme }}\">{{ badgeText }}</span>\n", styles: [""] });
323
331
  }
324
332
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImport: i0, type: TheSeamAnchorBadgeButtonComponent, decorators: [{
325
333
  type: Component,
@@ -328,7 +336,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.7", ngImpor
328
336
  '[attr.tabindex]': 'disabled ? -1 : (tabIndex || 0)',
329
337
  '[attr.disabled]': 'disabled || null',
330
338
  '[attr.aria-disabled]': 'disabled.toString()',
331
- '(click)': '_haltDisabledEvents($event)',
332
339
  }, standalone: false, template: "<ng-content></ng-content>\n<span class=\"ml-2 badge badge-{{ badgeTheme }}\">{{ badgeText }}</span>\n" }]
333
340
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.FocusMonitor }, { type: i0.Renderer2 }], propDecorators: { _textNoWrap: [{
334
341
  type: HostBinding,
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-buttons.mjs","sources":["../../../projects/ui-common/buttons/testing/base-button.harness.ts","../../../projects/ui-common/buttons/testing/base-badge-button.harness.ts","../../../projects/ui-common/buttons/testing/anchor-badge-button.harness.ts","../../../projects/ui-common/buttons/testing/anchor-button.harness.ts","../../../projects/ui-common/buttons/testing/badge-button.harness.ts","../../../projects/ui-common/buttons/testing/button.harness.ts","../../../projects/ui-common/buttons/testing/toggle-button.harness.ts","../../../projects/ui-common/buttons/button/button.component.ts","../../../projects/ui-common/buttons/button/button.component.html","../../../projects/ui-common/buttons/badge-button/badge-button.component.ts","../../../projects/ui-common/buttons/badge-button/badge-button.component.html","../../../projects/ui-common/buttons/progress-circle-button/progress-circle-button.component.ts","../../../projects/ui-common/buttons/progress-circle-button/progress-circle-button.component.html","../../../projects/ui-common/buttons/toggle-button/toggle-button.component.ts","../../../projects/ui-common/buttons/toggle-button/toggle-button.component.html","../../../projects/ui-common/buttons/buttons.module.ts","../../../projects/ui-common/buttons/theseam-ui-common-buttons.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion'\nimport {\n BaseHarnessFilters,\n ComponentHarness,\n ComponentHarnessConstructor,\n ContentContainerComponentHarness,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\n// import { TheSeamMenuHarness } from './button.harness'\n// import { animatingWait } from './utils'\n\nimport { OutlineThemeNames, ThemeNames } from '@theseam/ui-common/models'\n\nconst THEME_NAMES = [...ThemeNames, ...OutlineThemeNames]\nconst THEME_CLASSES = THEME_NAMES.map((t) => `btn-${t}`)\n\nfunction getButtonThemeClass(classListString: string | null) {\n return (classListString?.split(' ') || []).find((c) =>\n THEME_CLASSES.includes(c),\n )\n}\n\n/** A set of criteria that can be used to filter a list of `TheSeamBaseButtonComponentHarness` instances. */\nexport interface TheSeamBaseButtonComponentHarnessFilters\n extends BaseHarnessFilters {\n /** Only find instances whose text matches the given value. */\n text?: string | RegExp\n type?: 'button' | 'submit' | 'reset'\n}\n\nexport function createBaseButtonComponentHarnessPredicate<\n T extends TheSeamBaseButtonComponentHarness,\n>(\n componentHarness: ComponentHarnessConstructor<T>,\n options: TheSeamBaseButtonComponentHarnessFilters = {},\n): HarnessPredicate<T> {\n return new HarnessPredicate(componentHarness, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n )\n .addOption('type', options.type, (harness, type) =>\n HarnessPredicate.stringMatches(harness.getType(), type),\n )\n}\n\nexport class TheSeamBaseButtonComponentHarness extends ContentContainerComponentHarness<string> {\n /** Whether the button is disabled. */\n async isDisabled(): Promise<boolean> {\n const disabled = (await this.host()).getAttribute('disabled')\n return coerceBooleanProperty(await disabled)\n }\n\n async hasDisabledAria(): Promise<boolean> {\n const ariaValue = await (await this.host()).getAttribute('aria-disabled')\n return ariaValue === 'true'\n }\n\n async getType(): Promise<string | null> {\n return (await this.host()).getAttribute('type')\n }\n\n /** Gets the text of the button item. */\n async getText(): Promise<string> {\n return (await this.host()).text()\n }\n\n /** Gets the theme of the button item. */\n async getTheme(): Promise<string | null> {\n return (await this.host())\n .getAttribute('class')\n .then((c) => getButtonThemeClass(c)?.replace('btn-', '') || null)\n }\n\n async click(): Promise<void> {\n return (await this.host()).click()\n }\n}\n","import {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\nimport { OutlineThemeNames, ThemeNames } from '@theseam/ui-common/models'\nimport {\n TheSeamBaseButtonComponentHarness,\n TheSeamBaseButtonComponentHarnessFilters,\n createBaseButtonComponentHarnessPredicate,\n} from './base-button.harness'\n\nconst THEME_NAMES = [...ThemeNames, ...OutlineThemeNames]\nconst THEME_CLASSES = THEME_NAMES.map((t) => `badge-${t}`)\n\nfunction getbadgeThemeClass(classListString: string | null) {\n return (classListString?.split(' ') || []).find((c) =>\n THEME_CLASSES.includes(c),\n )\n}\n\n/** A set of criteria that can be used to filter a list of `TheSeamBaseBadgeButtonComponentHarness` instances. */\nexport type TheSeamBaseBadgeButtonComponentHarnessFilters =\n TheSeamBaseButtonComponentHarnessFilters\n\nexport function createBaseBadgeButtonComponentHarnessPredicate<\n T extends TheSeamBaseBadgeButtonComponentHarness,\n>(\n componentHarness: ComponentHarnessConstructor<T>,\n options: TheSeamBaseBadgeButtonComponentHarnessFilters = {},\n): HarnessPredicate<T> {\n return createBaseButtonComponentHarnessPredicate(componentHarness, options)\n}\n\nexport class TheSeamBaseBadgeButtonComponentHarness extends TheSeamBaseButtonComponentHarness {\n private readonly _badgeElement = this.locatorFor('.badge')\n\n /** Gets the text of the button item. */\n async getText(): Promise<string> {\n return (await this.host()).text({ exclude: '.badge' })\n }\n\n /** Gets the text of the badge. */\n async getBadgeText(): Promise<string> {\n return (await this._badgeElement()).text()\n }\n\n /** Gets the theme of the badge. */\n async getBadgeTheme(): Promise<string | null> {\n return (await this._badgeElement())\n .getAttribute('class')\n .then((c) => getbadgeThemeClass(c)?.replace('badge-', '') || null)\n }\n}\n","import {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\nimport {\n TheSeamBaseBadgeButtonComponentHarness,\n TheSeamBaseBadgeButtonComponentHarnessFilters,\n createBaseBadgeButtonComponentHarnessPredicate,\n} from './base-badge-button.harness'\n\n/** A set of criteria that can be used to filter a list of `TheSeamAnchorBadgeButtonComponentHarness` instances. */\nexport type TheSeamAnchorBadgeButtonComponentHarnessFilters =\n TheSeamBaseBadgeButtonComponentHarnessFilters\n\nexport class TheSeamAnchorBadgeButtonComponentHarness extends TheSeamBaseBadgeButtonComponentHarness {\n /** The selector for the host element of a `TheSeamAnchorBadgeButtonComponent` instance. */\n static hostSelector = 'a[seamBadgeButton]'\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a button item with specific attributes.\n * @param options Options for filtering which button item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends TheSeamAnchorBadgeButtonComponentHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TheSeamAnchorBadgeButtonComponentHarnessFilters = {},\n ): HarnessPredicate<T> {\n return createBaseBadgeButtonComponentHarnessPredicate(this, options)\n }\n\n async getTabIndex(): Promise<number> {\n const tabIndex = await (await this.host()).getAttribute('tabindex')\n return Number(tabIndex)\n }\n}\n","import {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\nimport {\n TheSeamBaseButtonComponentHarness,\n TheSeamBaseButtonComponentHarnessFilters,\n createBaseButtonComponentHarnessPredicate,\n} from './base-button.harness'\n\n/** A set of criteria that can be used to filter a list of `TheSeamAnchorButtonComponentHarness` instances. */\nexport type TheSeamAnchorButtonComponentHarnessFilters =\n TheSeamBaseButtonComponentHarnessFilters\n\nexport class TheSeamAnchorButtonComponentHarness extends TheSeamBaseButtonComponentHarness {\n /** The selector for the host element of a `TheSeamAnchorButtonComponent` instance. */\n static hostSelector = 'a[seamButton]'\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a button item with specific attributes.\n * @param options Options for filtering which button item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends TheSeamAnchorButtonComponentHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TheSeamAnchorButtonComponentHarnessFilters = {},\n ): HarnessPredicate<T> {\n return createBaseButtonComponentHarnessPredicate(this, options)\n }\n\n async getTabIndex(): Promise<number> {\n const tabIndex = await (await this.host()).getAttribute('tabindex')\n return Number(tabIndex)\n }\n}\n","import {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\nimport {\n TheSeamBaseBadgeButtonComponentHarness,\n TheSeamBaseBadgeButtonComponentHarnessFilters,\n createBaseBadgeButtonComponentHarnessPredicate,\n} from './base-badge-button.harness'\n\n/** A set of criteria that can be used to filter a list of `TheSeamBadgeButtonComponentHarness` instances. */\nexport type TheSeamBadgeButtonComponentHarnessFilters =\n TheSeamBaseBadgeButtonComponentHarnessFilters\n\nexport class TheSeamBadgeButtonComponentHarness extends TheSeamBaseBadgeButtonComponentHarness {\n /** The selector for the host element of a `TheSeamBadgeButtonComponent` instance. */\n static hostSelector = 'button[seamBadgeButton]'\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a button item with specific attributes.\n * @param options Options for filtering which button item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends TheSeamBadgeButtonComponentHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TheSeamBadgeButtonComponentHarnessFilters = {},\n ): HarnessPredicate<T> {\n return createBaseBadgeButtonComponentHarnessPredicate(this, options)\n }\n}\n","import { coerceBooleanProperty } from '@angular/cdk/coercion'\nimport {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\n// import { TheSeamMenuHarness } from './button.harness'\n// import { animatingWait } from './utils'\n\nimport {\n TheSeamBaseButtonComponentHarness,\n TheSeamBaseButtonComponentHarnessFilters,\n createBaseButtonComponentHarnessPredicate,\n} from './base-button.harness'\n\n/** A set of criteria that can be used to filter a list of `TheSeamButtonComponentHarness` instances. */\nexport type TheSeamButtonComponentHarnessFilters =\n TheSeamBaseButtonComponentHarnessFilters\n\nexport class TheSeamButtonComponentHarness extends TheSeamBaseButtonComponentHarness {\n /** The selector for the host element of a `TheSeamButtonComponent` instance. */\n static hostSelector = 'button[seamButton]'\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a button item with specific attributes.\n * @param options Options for filtering which button item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends TheSeamButtonComponentHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TheSeamButtonComponentHarnessFilters = {},\n ): HarnessPredicate<T> {\n return createBaseButtonComponentHarnessPredicate(this, options)\n }\n}\n","import {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\nimport {\n TheSeamBaseButtonComponentHarness,\n TheSeamBaseButtonComponentHarnessFilters,\n createBaseButtonComponentHarnessPredicate,\n} from './base-button.harness'\n\n/** A set of criteria that can be used to filter a list of `TheSeamToggleButtonComponentHarness` instances. */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface TheSeamToggleButtonComponentHarnessFilters\n extends TheSeamBaseButtonComponentHarnessFilters {}\n\nexport class TheSeamToggleButtonComponentHarness extends TheSeamBaseButtonComponentHarness {\n /** The selector for the host element of a `TheSeamToggleButtonComponent` instance. */\n static hostSelector = 'button[seamToggleButton]'\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a button item with specific attributes.\n * @param options Options for filtering which button item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends TheSeamToggleButtonComponentHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TheSeamToggleButtonComponentHarnessFilters = {},\n ): HarnessPredicate<T> {\n return createBaseButtonComponentHarnessPredicate(this, options)\n }\n\n /**\n * Clicks the button.\n */\n public async click() {\n return (await this.host()).click()\n }\n\n /** Gets the theme of the button item. */\n async isActive(): Promise<boolean> {\n return (await this.host())\n .getAttribute('class')\n .then((c) => c?.split(' ').indexOf('active') !== -1 || false)\n }\n}\n","import { FocusMonitor } from '@angular/cdk/a11y'\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n OnDestroy,\n Renderer2,\n} from '@angular/core'\n\nimport {\n CanDisableCtor,\n CanSizeCtor,\n CanThemeCtor,\n mixinDisabled,\n mixinSize,\n mixinTheme,\n} from '@theseam/ui-common/core'\n\n@Component({\n template: '',\n standalone: false,\n})\nclass TheSeamButtonBase implements OnDestroy {\n constructor(\n public readonly _elementRef: ElementRef,\n public readonly _focusMonitor: FocusMonitor,\n public readonly _renderer: Renderer2,\n ) {\n this._focusMonitor.monitor(this._elementRef, true)\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef)\n }\n\n /** Focuses the button. */\n focus(): void {\n this._getHostElement().focus()\n }\n\n _getHostElement() {\n return this._elementRef.nativeElement\n }\n}\n\nconst _TheSeamButtonMixinBase: CanDisableCtor &\n CanThemeCtor &\n CanSizeCtor &\n typeof TheSeamButtonBase = mixinSize(\n mixinTheme(mixinDisabled(TheSeamButtonBase), 'btn'),\n 'btn',\n)\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'button[seamButton]',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n exportAs: 'seamButton',\n inputs: ['disabled', 'theme', 'size'],\n host: {\n '[attr.type]': 'type',\n class: 'btn',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.disabled]': 'disabled || null',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class TheSeamButtonComponent\n extends _TheSeamButtonMixinBase\n implements OnDestroy\n{\n /** ARIA type for the button. */\n @Input() type: 'button' | 'submit' | 'reset' = 'button'\n\n constructor(\n readonly _elementRef: ElementRef,\n readonly _focusMonitor: FocusMonitor,\n readonly _renderer: Renderer2,\n ) {\n super(_elementRef, _focusMonitor, _renderer)\n }\n\n ngOnDestroy() {\n super.ngOnDestroy()\n }\n}\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'a[seamButton]',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n exportAs: 'seamButton,seamButtonBaseAnchor',\n inputs: ['disabled', 'theme', 'size'],\n host: {\n class: 'btn',\n // '[class.disabled]': 'disabled || null',\n '[attr.tabindex]': 'disabled ? -1 : (tabIndex || 0)',\n '[attr.disabled]': 'disabled || null',\n '[attr.aria-disabled]': 'disabled.toString()',\n '(click)': '_haltDisabledEvents($event)',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class TheSeamAnchorButtonComponent\n extends _TheSeamButtonMixinBase\n implements OnDestroy\n{\n /** Tabindex of the button. */\n @Input() tabIndex: number | undefined | null\n\n // TODO: Consider adding dev warning for `window.opener` exploit. Could maybe\n // add `rel` it if the href isn't on the current domain or not specified in an\n // injected list. This probably isn't needed and may be to strict for our\n // usage, so I am just adding this as a reminder to think about it.\n //\n // rel=\"noopener noreferrer\"\n\n constructor(\n readonly _elementRef: ElementRef,\n readonly _focusMonitor: FocusMonitor,\n readonly _renderer: Renderer2,\n ) {\n super(_elementRef, _focusMonitor, _renderer)\n }\n\n ngOnDestroy() {\n super.ngOnDestroy()\n }\n\n _haltDisabledEvents(event: Event) {\n // A disabled button shouldn't apply any actions\n if (this.disabled) {\n event.preventDefault()\n event.stopImmediatePropagation()\n }\n }\n}\n","<ng-content></ng-content>\n","import { FocusMonitor } from '@angular/cdk/a11y'\nimport {\n Component,\n ElementRef,\n HostBinding,\n Input,\n OnDestroy,\n Renderer2,\n} from '@angular/core'\n\nimport type { ThemeTypes } from '@theseam/ui-common/models'\n\nimport {\n TheSeamAnchorButtonComponent,\n TheSeamButtonComponent,\n} from '../button/button.component'\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'button[seamBadgeButton]',\n templateUrl: './badge-button.component.html',\n styleUrls: ['./badge-button.component.scss'],\n exportAs: 'seamBadgeButton',\n inputs: ['disabled', 'theme', 'size'],\n host: {\n '[attr.type]': 'type',\n class: 'btn',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.disabled]': 'disabled || null',\n },\n standalone: false,\n})\nexport class TheSeamBadgeButtonComponent\n extends TheSeamButtonComponent\n implements OnDestroy\n{\n @HostBinding('class.text-nowrap') _textNoWrap = true\n\n @Input() badgeTheme: ThemeTypes = 'light'\n @Input() badgeText = ''\n\n constructor(\n readonly _elementRef: ElementRef,\n readonly _focusMonitor: FocusMonitor,\n readonly _renderer: Renderer2,\n ) {\n super(_elementRef, _focusMonitor, _renderer)\n }\n\n ngOnDestroy() {\n super.ngOnDestroy()\n }\n}\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'a[seamBadgeButton]',\n templateUrl: './badge-button.component.html',\n styleUrls: ['./badge-button.component.scss'],\n exportAs: 'seamBadgeButton,seamBadgeButtonAnchor',\n inputs: ['disabled', 'theme', 'size'],\n host: {\n class: 'btn',\n '[attr.tabindex]': 'disabled ? -1 : (tabIndex || 0)',\n '[attr.disabled]': 'disabled || null',\n '[attr.aria-disabled]': 'disabled.toString()',\n '(click)': '_haltDisabledEvents($event)',\n },\n standalone: false,\n})\nexport class TheSeamAnchorBadgeButtonComponent\n extends TheSeamAnchorButtonComponent\n implements OnDestroy\n{\n @HostBinding('class.text-nowrap') _textNoWrap = true\n\n @Input() badgeTheme: ThemeTypes = 'light'\n @Input() badgeText = ''\n\n constructor(\n readonly _elementRef: ElementRef,\n readonly _focusMonitor: FocusMonitor,\n readonly _renderer: Renderer2,\n ) {\n super(_elementRef, _focusMonitor, _renderer)\n }\n\n ngOnDestroy() {\n super.ngOnDestroy()\n }\n}\n","<ng-content></ng-content>\n<span class=\"ml-2 badge badge-{{ badgeTheme }}\">{{ badgeText }}</span>\n","import { FocusMonitor } from '@angular/cdk/a11y'\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion'\nimport {\n Component,\n ElementRef,\n Input,\n OnDestroy,\n Renderer2,\n} from '@angular/core'\n\nimport { InputBoolean, InputNumber } from '@theseam/ui-common/core'\n\nimport { TheSeamButtonComponent } from '../button/button.component'\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'button[seamProgressCircleButton]',\n templateUrl: './progress-circle-button.component.html',\n styleUrls: ['./progress-circle-button.component.scss'],\n exportAs: 'seamProgressCircleButton',\n inputs: ['disabled', 'theme', 'size'],\n host: {\n '[attr.type]': 'type',\n class: 'btn',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.disabled]': 'disabled || null',\n },\n standalone: false,\n})\nexport class TheSeamProgressCircleButtonComponent\n extends TheSeamButtonComponent\n implements OnDestroy\n{\n static ngAcceptInputType_fillBackground: BooleanInput\n static ngAcceptInputType_showText: BooleanInput\n static ngAcceptInputType_hiddenOnEmpty: BooleanInput\n static ngAcceptInputType_percentage: NumberInput\n\n @Input() @InputBoolean() fillBackground = false\n @Input() @InputBoolean() showText = false\n @Input() @InputBoolean() hiddenOnEmpty = true\n\n @Input() @InputNumber(0) percentage = 100\n\n constructor(\n readonly _elementRef: ElementRef,\n readonly _focusMonitor: FocusMonitor,\n readonly _renderer: Renderer2,\n ) {\n super(_elementRef, _focusMonitor, _renderer)\n }\n\n ngOnDestroy() {\n super.ngOnDestroy()\n }\n}\n","<ng-content></ng-content>\n<seam-progress-circle\n class=\"progress-circle-btn--icon\"\n [fillBackground]=\"fillBackground\"\n [showText]=\"showText\"\n [hiddenOnEmpty]=\"hiddenOnEmpty\"\n [percentage]=\"percentage\"\n>\n</seam-progress-circle>\n","import { FocusMonitor } from '@angular/cdk/a11y'\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion'\nimport {\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n Input,\n OnDestroy,\n Output,\n Renderer2,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { InputBoolean } from '@theseam/ui-common/core'\n\nimport { TheSeamButtonComponent } from '../button/button.component'\n\nexport const TOGGLE_BUTTON_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TheSeamToggleButtonComponent),\n multi: true,\n}\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'button[seamToggleButton]',\n templateUrl: './toggle-button.component.html',\n styleUrls: ['./toggle-button.component.scss'],\n exportAs: 'seamToggleButton',\n inputs: ['disabled', 'theme', 'size'],\n host: {\n '[attr.type]': 'type',\n class: 'btn',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.disabled]': 'disabled || null',\n '(click)': '_toggleValue()',\n },\n providers: [TOGGLE_BUTTON_VALUE_ACCESSOR],\n standalone: false,\n})\nexport class TheSeamToggleButtonComponent\n extends TheSeamButtonComponent\n implements OnDestroy, ControlValueAccessor\n{\n static ngAcceptInputType_val: BooleanInput\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('value') @InputBoolean() val = false\n\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() readonly change = new EventEmitter<boolean>()\n\n onChange: any\n onTouched: any\n\n @HostBinding('class.active')\n get _activeCssClass() {\n return this.value ? coerceBooleanProperty(this.value) : false\n }\n\n constructor(\n readonly _elementRef: ElementRef,\n readonly _focusMonitor: FocusMonitor,\n readonly _renderer: Renderer2,\n ) {\n super(_elementRef, _focusMonitor, _renderer)\n }\n\n ngOnDestroy() {\n super.ngOnDestroy()\n }\n\n get value(): boolean {\n return this.val\n }\n\n set value(value: boolean) {\n this.val = value\n this.change.emit(this.val)\n if (this.onChange) {\n this.onChange(value)\n }\n if (this.onTouched) {\n this.onTouched()\n }\n }\n\n writeValue(value: any): void {\n this.value = value\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled\n }\n\n _toggleValue() {\n this.value = !this.value\n }\n}\n","<ng-content></ng-content>\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { TheSeamProgressModule } from '@theseam/ui-common/progress'\n\nimport {\n TheSeamAnchorBadgeButtonComponent,\n TheSeamBadgeButtonComponent,\n} from './badge-button/badge-button.component'\nimport {\n TheSeamAnchorButtonComponent,\n TheSeamButtonComponent,\n} from './button/button.component'\nimport { TheSeamProgressCircleButtonComponent } from './progress-circle-button/progress-circle-button.component'\nimport { TheSeamToggleButtonComponent } from './toggle-button/toggle-button.component'\n\n@NgModule({\n declarations: [\n TheSeamBadgeButtonComponent,\n TheSeamProgressCircleButtonComponent,\n TheSeamToggleButtonComponent,\n TheSeamButtonComponent,\n TheSeamAnchorButtonComponent,\n TheSeamAnchorBadgeButtonComponent,\n ],\n imports: [CommonModule, TheSeamProgressModule],\n exports: [\n TheSeamBadgeButtonComponent,\n TheSeamProgressCircleButtonComponent,\n TheSeamToggleButtonComponent,\n TheSeamButtonComponent,\n TheSeamAnchorButtonComponent,\n TheSeamAnchorBadgeButtonComponent,\n ],\n})\nexport class TheSeamButtonsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["THEME_NAMES","THEME_CLASSES"],"mappings":";;;;;;;;;;;;;AAcA,MAAMA,aAAW,GAAG,CAAC,GAAG,UAAU,EAAE,GAAG,iBAAiB,CAAC;AACzD,MAAMC,eAAa,GAAGD,aAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAA,IAAA,EAAO,CAAC,CAAA,CAAE,CAAC;AAExD,SAAS,mBAAmB,CAAC,eAA8B,EAAA;IACzD,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,KAChDC,eAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC1B;AACH;SAUgB,yCAAyC,CAG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oCAAoC;wBACpC,4BAA4B;wBAC5B,sBAAsB;wBACtB,4BAA4B;wBAC5B,iCAAiC;AAClC,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;AAC9C,oBAAA,OAAO,EAAE;wBACP,2BAA2B;wBAC3B,oCAAoC;wBACpC,4BAA4B;wBAC5B,sBAAsB;wBACtB,4BAA4B;wBAC5B,iCAAiC;AAClC,qBAAA;AACF,iBAAA;;;AClCD;;AAEG;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-buttons.mjs","sources":["../../../projects/ui-common/buttons/testing/base-button.harness.ts","../../../projects/ui-common/buttons/testing/base-badge-button.harness.ts","../../../projects/ui-common/buttons/testing/anchor-badge-button.harness.ts","../../../projects/ui-common/buttons/testing/anchor-button.harness.ts","../../../projects/ui-common/buttons/testing/badge-button.harness.ts","../../../projects/ui-common/buttons/testing/button.harness.ts","../../../projects/ui-common/buttons/testing/toggle-button.harness.ts","../../../projects/ui-common/buttons/button/button.component.ts","../../../projects/ui-common/buttons/button/button.component.html","../../../projects/ui-common/buttons/badge-button/badge-button.component.ts","../../../projects/ui-common/buttons/badge-button/badge-button.component.html","../../../projects/ui-common/buttons/progress-circle-button/progress-circle-button.component.ts","../../../projects/ui-common/buttons/progress-circle-button/progress-circle-button.component.html","../../../projects/ui-common/buttons/toggle-button/toggle-button.component.ts","../../../projects/ui-common/buttons/toggle-button/toggle-button.component.html","../../../projects/ui-common/buttons/buttons.module.ts","../../../projects/ui-common/buttons/theseam-ui-common-buttons.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion'\nimport {\n BaseHarnessFilters,\n ComponentHarness,\n ComponentHarnessConstructor,\n ContentContainerComponentHarness,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\n// import { TheSeamMenuHarness } from './button.harness'\n// import { animatingWait } from './utils'\n\nimport { OutlineThemeNames, ThemeNames } from '@theseam/ui-common/models'\n\nconst THEME_NAMES = [...ThemeNames, ...OutlineThemeNames]\nconst THEME_CLASSES = THEME_NAMES.map((t) => `btn-${t}`)\n\nfunction getButtonThemeClass(classListString: string | null) {\n return (classListString?.split(' ') || []).find((c) =>\n THEME_CLASSES.includes(c),\n )\n}\n\n/** A set of criteria that can be used to filter a list of `TheSeamBaseButtonComponentHarness` instances. */\nexport interface TheSeamBaseButtonComponentHarnessFilters\n extends BaseHarnessFilters {\n /** Only find instances whose text matches the given value. */\n text?: string | RegExp\n type?: 'button' | 'submit' | 'reset'\n}\n\nexport function createBaseButtonComponentHarnessPredicate<\n T extends TheSeamBaseButtonComponentHarness,\n>(\n componentHarness: ComponentHarnessConstructor<T>,\n options: TheSeamBaseButtonComponentHarnessFilters = {},\n): HarnessPredicate<T> {\n return new HarnessPredicate(componentHarness, options)\n .addOption('text', options.text, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getText(), text),\n )\n .addOption('type', options.type, (harness, type) =>\n HarnessPredicate.stringMatches(harness.getType(), type),\n )\n}\n\nexport class TheSeamBaseButtonComponentHarness extends ContentContainerComponentHarness<string> {\n /** Whether the button is disabled. */\n async isDisabled(): Promise<boolean> {\n const disabled = (await this.host()).getAttribute('disabled')\n return coerceBooleanProperty(await disabled)\n }\n\n async hasDisabledAria(): Promise<boolean> {\n const ariaValue = await (await this.host()).getAttribute('aria-disabled')\n return ariaValue === 'true'\n }\n\n async getType(): Promise<string | null> {\n return (await this.host()).getAttribute('type')\n }\n\n /** Gets the text of the button item. */\n async getText(): Promise<string> {\n return (await this.host()).text()\n }\n\n /** Gets the theme of the button item. */\n async getTheme(): Promise<string | null> {\n return (await this.host())\n .getAttribute('class')\n .then((c) => getButtonThemeClass(c)?.replace('btn-', '') || null)\n }\n\n async click(): Promise<void> {\n return (await this.host()).click()\n }\n}\n","import {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\nimport { OutlineThemeNames, ThemeNames } from '@theseam/ui-common/models'\nimport {\n TheSeamBaseButtonComponentHarness,\n TheSeamBaseButtonComponentHarnessFilters,\n createBaseButtonComponentHarnessPredicate,\n} from './base-button.harness'\n\nconst THEME_NAMES = [...ThemeNames, ...OutlineThemeNames]\nconst THEME_CLASSES = THEME_NAMES.map((t) => `badge-${t}`)\n\nfunction getbadgeThemeClass(classListString: string | null) {\n return (classListString?.split(' ') || []).find((c) =>\n THEME_CLASSES.includes(c),\n )\n}\n\n/** A set of criteria that can be used to filter a list of `TheSeamBaseBadgeButtonComponentHarness` instances. */\nexport type TheSeamBaseBadgeButtonComponentHarnessFilters =\n TheSeamBaseButtonComponentHarnessFilters\n\nexport function createBaseBadgeButtonComponentHarnessPredicate<\n T extends TheSeamBaseBadgeButtonComponentHarness,\n>(\n componentHarness: ComponentHarnessConstructor<T>,\n options: TheSeamBaseBadgeButtonComponentHarnessFilters = {},\n): HarnessPredicate<T> {\n return createBaseButtonComponentHarnessPredicate(componentHarness, options)\n}\n\nexport class TheSeamBaseBadgeButtonComponentHarness extends TheSeamBaseButtonComponentHarness {\n private readonly _badgeElement = this.locatorFor('.badge')\n\n /** Gets the text of the button item. */\n async getText(): Promise<string> {\n return (await this.host()).text({ exclude: '.badge' })\n }\n\n /** Gets the text of the badge. */\n async getBadgeText(): Promise<string> {\n return (await this._badgeElement()).text()\n }\n\n /** Gets the theme of the badge. */\n async getBadgeTheme(): Promise<string | null> {\n return (await this._badgeElement())\n .getAttribute('class')\n .then((c) => getbadgeThemeClass(c)?.replace('badge-', '') || null)\n }\n}\n","import {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\nimport {\n TheSeamBaseBadgeButtonComponentHarness,\n TheSeamBaseBadgeButtonComponentHarnessFilters,\n createBaseBadgeButtonComponentHarnessPredicate,\n} from './base-badge-button.harness'\n\n/** A set of criteria that can be used to filter a list of `TheSeamAnchorBadgeButtonComponentHarness` instances. */\nexport type TheSeamAnchorBadgeButtonComponentHarnessFilters =\n TheSeamBaseBadgeButtonComponentHarnessFilters\n\nexport class TheSeamAnchorBadgeButtonComponentHarness extends TheSeamBaseBadgeButtonComponentHarness {\n /** The selector for the host element of a `TheSeamAnchorBadgeButtonComponent` instance. */\n static hostSelector = 'a[seamBadgeButton]'\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a button item with specific attributes.\n * @param options Options for filtering which button item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends TheSeamAnchorBadgeButtonComponentHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TheSeamAnchorBadgeButtonComponentHarnessFilters = {},\n ): HarnessPredicate<T> {\n return createBaseBadgeButtonComponentHarnessPredicate(this, options)\n }\n\n async getTabIndex(): Promise<number> {\n const tabIndex = await (await this.host()).getAttribute('tabindex')\n return Number(tabIndex)\n }\n}\n","import {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\nimport {\n TheSeamBaseButtonComponentHarness,\n TheSeamBaseButtonComponentHarnessFilters,\n createBaseButtonComponentHarnessPredicate,\n} from './base-button.harness'\n\n/** A set of criteria that can be used to filter a list of `TheSeamAnchorButtonComponentHarness` instances. */\nexport type TheSeamAnchorButtonComponentHarnessFilters =\n TheSeamBaseButtonComponentHarnessFilters\n\nexport class TheSeamAnchorButtonComponentHarness extends TheSeamBaseButtonComponentHarness {\n /** The selector for the host element of a `TheSeamAnchorButtonComponent` instance. */\n static hostSelector = 'a[seamButton]'\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a button item with specific attributes.\n * @param options Options for filtering which button item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends TheSeamAnchorButtonComponentHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TheSeamAnchorButtonComponentHarnessFilters = {},\n ): HarnessPredicate<T> {\n return createBaseButtonComponentHarnessPredicate(this, options)\n }\n\n async getTabIndex(): Promise<number> {\n const tabIndex = await (await this.host()).getAttribute('tabindex')\n return Number(tabIndex)\n }\n}\n","import {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\nimport {\n TheSeamBaseBadgeButtonComponentHarness,\n TheSeamBaseBadgeButtonComponentHarnessFilters,\n createBaseBadgeButtonComponentHarnessPredicate,\n} from './base-badge-button.harness'\n\n/** A set of criteria that can be used to filter a list of `TheSeamBadgeButtonComponentHarness` instances. */\nexport type TheSeamBadgeButtonComponentHarnessFilters =\n TheSeamBaseBadgeButtonComponentHarnessFilters\n\nexport class TheSeamBadgeButtonComponentHarness extends TheSeamBaseBadgeButtonComponentHarness {\n /** The selector for the host element of a `TheSeamBadgeButtonComponent` instance. */\n static hostSelector = 'button[seamBadgeButton]'\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a button item with specific attributes.\n * @param options Options for filtering which button item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends TheSeamBadgeButtonComponentHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TheSeamBadgeButtonComponentHarnessFilters = {},\n ): HarnessPredicate<T> {\n return createBaseBadgeButtonComponentHarnessPredicate(this, options)\n }\n}\n","import { coerceBooleanProperty } from '@angular/cdk/coercion'\nimport {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\n// import { TheSeamMenuHarness } from './button.harness'\n// import { animatingWait } from './utils'\n\nimport {\n TheSeamBaseButtonComponentHarness,\n TheSeamBaseButtonComponentHarnessFilters,\n createBaseButtonComponentHarnessPredicate,\n} from './base-button.harness'\n\n/** A set of criteria that can be used to filter a list of `TheSeamButtonComponentHarness` instances. */\nexport type TheSeamButtonComponentHarnessFilters =\n TheSeamBaseButtonComponentHarnessFilters\n\nexport class TheSeamButtonComponentHarness extends TheSeamBaseButtonComponentHarness {\n /** The selector for the host element of a `TheSeamButtonComponent` instance. */\n static hostSelector = 'button[seamButton]'\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a button item with specific attributes.\n * @param options Options for filtering which button item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends TheSeamButtonComponentHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TheSeamButtonComponentHarnessFilters = {},\n ): HarnessPredicate<T> {\n return createBaseButtonComponentHarnessPredicate(this, options)\n }\n}\n","import {\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\nimport {\n TheSeamBaseButtonComponentHarness,\n TheSeamBaseButtonComponentHarnessFilters,\n createBaseButtonComponentHarnessPredicate,\n} from './base-button.harness'\n\n/** A set of criteria that can be used to filter a list of `TheSeamToggleButtonComponentHarness` instances. */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface TheSeamToggleButtonComponentHarnessFilters\n extends TheSeamBaseButtonComponentHarnessFilters {}\n\nexport class TheSeamToggleButtonComponentHarness extends TheSeamBaseButtonComponentHarness {\n /** The selector for the host element of a `TheSeamToggleButtonComponent` instance. */\n static hostSelector = 'button[seamToggleButton]'\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a button item with specific attributes.\n * @param options Options for filtering which button item instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends TheSeamToggleButtonComponentHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TheSeamToggleButtonComponentHarnessFilters = {},\n ): HarnessPredicate<T> {\n return createBaseButtonComponentHarnessPredicate(this, options)\n }\n\n /**\n * Clicks the button.\n */\n public async click() {\n return (await this.host()).click()\n }\n\n /** Gets the theme of the button item. */\n async isActive(): Promise<boolean> {\n return (await this.host())\n .getAttribute('class')\n .then((c) => c?.split(' ').indexOf('active') !== -1 || false)\n }\n}\n","import { FocusMonitor } from '@angular/cdk/a11y'\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n inject,\n Input,\n NgZone,\n OnDestroy,\n Renderer2,\n} from '@angular/core'\n\nimport {\n CanDisableCtor,\n CanSizeCtor,\n CanThemeCtor,\n mixinDisabled,\n mixinSize,\n mixinTheme,\n} from '@theseam/ui-common/core'\n\n@Component({\n template: '',\n standalone: false,\n})\nclass TheSeamButtonBase implements OnDestroy {\n constructor(\n public readonly _elementRef: ElementRef,\n public readonly _focusMonitor: FocusMonitor,\n public readonly _renderer: Renderer2,\n ) {\n this._focusMonitor.monitor(this._elementRef, true)\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef)\n }\n\n /** Focuses the button. */\n focus(): void {\n this._getHostElement().focus()\n }\n\n _getHostElement() {\n return this._elementRef.nativeElement\n }\n}\n\nconst _TheSeamButtonMixinBase: CanDisableCtor &\n CanThemeCtor &\n CanSizeCtor &\n typeof TheSeamButtonBase = mixinSize(\n mixinTheme(mixinDisabled(TheSeamButtonBase), 'btn'),\n 'btn',\n)\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'button[seamButton]',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n exportAs: 'seamButton',\n inputs: ['disabled', 'theme', 'size'],\n host: {\n '[attr.type]': 'type',\n class: 'btn',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.disabled]': 'disabled || null',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class TheSeamButtonComponent\n extends _TheSeamButtonMixinBase\n implements OnDestroy\n{\n /** ARIA type for the button. */\n @Input() type: 'button' | 'submit' | 'reset' = 'button'\n\n constructor(\n readonly _elementRef: ElementRef,\n readonly _focusMonitor: FocusMonitor,\n readonly _renderer: Renderer2,\n ) {\n super(_elementRef, _focusMonitor, _renderer)\n }\n\n ngOnDestroy() {\n super.ngOnDestroy()\n }\n}\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'a[seamButton]',\n templateUrl: './button.component.html',\n styleUrls: ['./button.component.scss'],\n exportAs: 'seamButton,seamButtonBaseAnchor',\n inputs: ['disabled', 'theme', 'size'],\n host: {\n class: 'btn',\n // '[class.disabled]': 'disabled || null',\n '[attr.tabindex]': 'disabled ? -1 : (tabIndex || 0)',\n '[attr.disabled]': 'disabled || null',\n '[attr.aria-disabled]': 'disabled.toString()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class TheSeamAnchorButtonComponent\n extends _TheSeamButtonMixinBase\n implements OnDestroy\n{\n protected readonly _ngZone = inject(NgZone)\n\n private readonly _cleanupClick: () => void\n\n /** Tabindex of the button. */\n @Input() tabIndex: number | undefined | null\n\n // TODO: Consider adding dev warning for `window.opener` exploit. Could maybe\n // add `rel` it if the href isn't on the current domain or not specified in an\n // injected list. This probably isn't needed and may be to strict for our\n // usage, so I am just adding this as a reminder to think about it.\n //\n // rel=\"noopener noreferrer\"\n\n constructor(\n readonly _elementRef: ElementRef,\n readonly _focusMonitor: FocusMonitor,\n readonly _renderer: Renderer2,\n ) {\n super(_elementRef, _focusMonitor, _renderer)\n\n // Can't initialize on the property since it depends on a\n // constructor-injected value.\n this._cleanupClick = this._createClickListener()\n }\n\n ngOnDestroy() {\n super.ngOnDestroy()\n this._cleanupClick()\n }\n\n _haltDisabledEvents(event: Event) {\n // A disabled button shouldn't apply any actions\n if (this.disabled) {\n event.preventDefault()\n event.stopImmediatePropagation()\n }\n }\n\n private _createClickListener() {\n return this._ngZone.runOutsideAngular(() =>\n this._renderer.listen(\n this._elementRef.nativeElement,\n 'click',\n (event: Event) => this._haltDisabledEvents(event),\n ),\n )\n }\n}\n","<ng-content></ng-content>\n","import { FocusMonitor } from '@angular/cdk/a11y'\nimport {\n Component,\n ElementRef,\n HostBinding,\n Input,\n OnDestroy,\n Renderer2,\n} from '@angular/core'\n\nimport type { ThemeTypes } from '@theseam/ui-common/models'\n\nimport {\n TheSeamAnchorButtonComponent,\n TheSeamButtonComponent,\n} from '../button/button.component'\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'button[seamBadgeButton]',\n templateUrl: './badge-button.component.html',\n styleUrls: ['./badge-button.component.scss'],\n exportAs: 'seamBadgeButton',\n inputs: ['disabled', 'theme', 'size'],\n host: {\n '[attr.type]': 'type',\n class: 'btn',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.disabled]': 'disabled || null',\n },\n standalone: false,\n})\nexport class TheSeamBadgeButtonComponent\n extends TheSeamButtonComponent\n implements OnDestroy\n{\n @HostBinding('class.text-nowrap') _textNoWrap = true\n\n @Input() badgeTheme: ThemeTypes = 'light'\n @Input() badgeText = ''\n\n constructor(\n readonly _elementRef: ElementRef,\n readonly _focusMonitor: FocusMonitor,\n readonly _renderer: Renderer2,\n ) {\n super(_elementRef, _focusMonitor, _renderer)\n }\n\n ngOnDestroy() {\n super.ngOnDestroy()\n }\n}\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'a[seamBadgeButton]',\n templateUrl: './badge-button.component.html',\n styleUrls: ['./badge-button.component.scss'],\n exportAs: 'seamBadgeButton,seamBadgeButtonAnchor',\n inputs: ['disabled', 'theme', 'size'],\n host: {\n class: 'btn',\n '[attr.tabindex]': 'disabled ? -1 : (tabIndex || 0)',\n '[attr.disabled]': 'disabled || null',\n '[attr.aria-disabled]': 'disabled.toString()',\n },\n standalone: false,\n})\nexport class TheSeamAnchorBadgeButtonComponent\n extends TheSeamAnchorButtonComponent\n implements OnDestroy\n{\n @HostBinding('class.text-nowrap') _textNoWrap = true\n\n @Input() badgeTheme: ThemeTypes = 'light'\n @Input() badgeText = ''\n\n constructor(\n readonly _elementRef: ElementRef,\n readonly _focusMonitor: FocusMonitor,\n readonly _renderer: Renderer2,\n ) {\n super(_elementRef, _focusMonitor, _renderer)\n }\n\n ngOnDestroy() {\n super.ngOnDestroy()\n }\n}\n","<ng-content></ng-content>\n<span class=\"ml-2 badge badge-{{ badgeTheme }}\">{{ badgeText }}</span>\n","import { FocusMonitor } from '@angular/cdk/a11y'\nimport { BooleanInput, NumberInput } from '@angular/cdk/coercion'\nimport {\n Component,\n ElementRef,\n Input,\n OnDestroy,\n Renderer2,\n} from '@angular/core'\n\nimport { InputBoolean, InputNumber } from '@theseam/ui-common/core'\n\nimport { TheSeamButtonComponent } from '../button/button.component'\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'button[seamProgressCircleButton]',\n templateUrl: './progress-circle-button.component.html',\n styleUrls: ['./progress-circle-button.component.scss'],\n exportAs: 'seamProgressCircleButton',\n inputs: ['disabled', 'theme', 'size'],\n host: {\n '[attr.type]': 'type',\n class: 'btn',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.disabled]': 'disabled || null',\n },\n standalone: false,\n})\nexport class TheSeamProgressCircleButtonComponent\n extends TheSeamButtonComponent\n implements OnDestroy\n{\n static ngAcceptInputType_fillBackground: BooleanInput\n static ngAcceptInputType_showText: BooleanInput\n static ngAcceptInputType_hiddenOnEmpty: BooleanInput\n static ngAcceptInputType_percentage: NumberInput\n\n @Input() @InputBoolean() fillBackground = false\n @Input() @InputBoolean() showText = false\n @Input() @InputBoolean() hiddenOnEmpty = true\n\n @Input() @InputNumber(0) percentage = 100\n\n constructor(\n readonly _elementRef: ElementRef,\n readonly _focusMonitor: FocusMonitor,\n readonly _renderer: Renderer2,\n ) {\n super(_elementRef, _focusMonitor, _renderer)\n }\n\n ngOnDestroy() {\n super.ngOnDestroy()\n }\n}\n","<ng-content></ng-content>\n<seam-progress-circle\n class=\"progress-circle-btn--icon\"\n [fillBackground]=\"fillBackground\"\n [showText]=\"showText\"\n [hiddenOnEmpty]=\"hiddenOnEmpty\"\n [percentage]=\"percentage\"\n>\n</seam-progress-circle>\n","import { FocusMonitor } from '@angular/cdk/a11y'\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion'\nimport {\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n Input,\n OnDestroy,\n Output,\n Renderer2,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { InputBoolean } from '@theseam/ui-common/core'\n\nimport { TheSeamButtonComponent } from '../button/button.component'\n\nexport const TOGGLE_BUTTON_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TheSeamToggleButtonComponent),\n multi: true,\n}\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'button[seamToggleButton]',\n templateUrl: './toggle-button.component.html',\n styleUrls: ['./toggle-button.component.scss'],\n exportAs: 'seamToggleButton',\n inputs: ['disabled', 'theme', 'size'],\n host: {\n '[attr.type]': 'type',\n class: 'btn',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[attr.disabled]': 'disabled || null',\n '(click)': '_toggleValue()',\n },\n providers: [TOGGLE_BUTTON_VALUE_ACCESSOR],\n standalone: false,\n})\nexport class TheSeamToggleButtonComponent\n extends TheSeamButtonComponent\n implements OnDestroy, ControlValueAccessor\n{\n static ngAcceptInputType_val: BooleanInput\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('value') @InputBoolean() val = false\n\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() readonly change = new EventEmitter<boolean>()\n\n onChange: any\n onTouched: any\n\n @HostBinding('class.active')\n get _activeCssClass() {\n return this.value ? coerceBooleanProperty(this.value) : false\n }\n\n constructor(\n readonly _elementRef: ElementRef,\n readonly _focusMonitor: FocusMonitor,\n readonly _renderer: Renderer2,\n ) {\n super(_elementRef, _focusMonitor, _renderer)\n }\n\n ngOnDestroy() {\n super.ngOnDestroy()\n }\n\n get value(): boolean {\n return this.val\n }\n\n set value(value: boolean) {\n this.val = value\n this.change.emit(this.val)\n if (this.onChange) {\n this.onChange(value)\n }\n if (this.onTouched) {\n this.onTouched()\n }\n }\n\n writeValue(value: any): void {\n this.value = value\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled\n }\n\n _toggleValue() {\n this.value = !this.value\n }\n}\n","<ng-content></ng-content>\n","import { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { TheSeamProgressModule } from '@theseam/ui-common/progress'\n\nimport {\n TheSeamAnchorBadgeButtonComponent,\n TheSeamBadgeButtonComponent,\n} from './badge-button/badge-button.component'\nimport {\n TheSeamAnchorButtonComponent,\n TheSeamButtonComponent,\n} from './button/button.component'\nimport { TheSeamProgressCircleButtonComponent } from './progress-circle-button/progress-circle-button.component'\nimport { TheSeamToggleButtonComponent } from './toggle-button/toggle-button.component'\n\n@NgModule({\n declarations: [\n TheSeamBadgeButtonComponent,\n TheSeamProgressCircleButtonComponent,\n TheSeamToggleButtonComponent,\n TheSeamButtonComponent,\n TheSeamAnchorButtonComponent,\n TheSeamAnchorBadgeButtonComponent,\n ],\n imports: [CommonModule, TheSeamProgressModule],\n exports: [\n TheSeamBadgeButtonComponent,\n TheSeamProgressCircleButtonComponent,\n TheSeamToggleButtonComponent,\n TheSeamButtonComponent,\n TheSeamAnchorButtonComponent,\n TheSeamAnchorBadgeButtonComponent,\n ],\n})\nexport class TheSeamButtonsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["THEME_NAMES","THEME_CLASSES"],"mappings":";;;;;;;;;;;;;AAcA,MAAMA,aAAW,GAAG,CAAC,GAAG,UAAU,EAAE,GAAG,iBAAiB,CAAC;AACzD,MAAMC,eAAa,GAAGD,aAAW,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAA,IAAA,EAAO,CAAC,CAAA,CAAE,CAAC;AAExD,SAAS,mBAAmB,CAAC,eAA8B,EAAA;IACzD,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,KAChDC,eAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC1B;AACH;SAUgB,yCAAyC,CAGvD,gBAAgD,EAChD,UAAoD,EAAE,EAAA;AAEtD,IAAA,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,EAAE,OAAO;SAClD,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,C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AAA,CAVrB,YAAY,EAAE,qBAAqB,CAAA,EAAA,CAAA;;2FAUlC,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAnBhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,2BAA2B;wBAC3B,oCAAoC;wBACpC,4BAA4B;wBAC5B,sBAAsB;wBACtB,4BAA4B;wBAC5B,iCAAiC;AAClC,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;AAC9C,oBAAA,OAAO,EAAE;wBACP,2BAA2B;wBAC3B,oCAAoC;wBACpC,4BAA4B;wBAC5B,sBAAsB;wBACtB,4BAA4B;wBAC5B,iCAAiC;AAClC,qBAAA;AACF,iBAAA;;;AClCD;;AAEG;;;;"}
@@ -12,13 +12,31 @@ function exportOperator(exportFn) {
12
12
  return (source$) => source$.pipe(switchMap(exportFn));
13
13
  }
14
14
 
15
+ // TODO: We may be able to avoid this by getting the Storybook tsconfig and our
16
+ // apps Angular builds more in-sync or when Storybook updates the builder that
17
+ // it uses. For now, this should give a reliable ESM and CJS interop for the
18
+ // XLSX library.
19
+ /**
20
+ * Imports the XLSX library.
21
+ *
22
+ * This should be used instead of direct dynamic imports to ensure
23
+ * compatibility. It may be better to just import normally, but most datatables
24
+ * don't do client-side XLSX processing so dynamic imports are preferred.
25
+ *
26
+ * @returns The XLSX library.
27
+ */
28
+ async function importXlsx() {
29
+ // TODO: Fix typing for the dynamic imports
30
+ const XLSX = await import('xlsx');
31
+ return XLSX.default ?? XLSX;
32
+ }
33
+
15
34
  class CSVDataExporter {
16
35
  name = 'exporter:csv';
17
36
  label = 'CSV';
18
37
  icon = faFileCsv;
19
38
  export(data) {
20
- // TODO: Fix typing for the dynamic imports
21
- return wrapIntoObservable(import('xlsx')).pipe(switchMap((XLSX) => {
39
+ return wrapIntoObservable(importXlsx()).pipe(switchMap((XLSX) => {
22
40
  const ws = XLSX.utils.json_to_sheet(data);
23
41
  const out = XLSX.utils.sheet_to_csv(ws);
24
42
  // NOTE: `out` should not be passed as a string, but the fileDataFromBuffer
@@ -43,8 +61,7 @@ class XLSXDataExporter {
43
61
  label = 'XLSX';
44
62
  icon = faFileExcel;
45
63
  export(data) {
46
- // TODO: Fix typing for the dynamic imports
47
- return wrapIntoObservable(import('xlsx')).pipe(switchMap((XLSX) => {
64
+ return wrapIntoObservable(importXlsx()).pipe(switchMap((XLSX) => {
48
65
  const ws = XLSX.utils.json_to_sheet(data);
49
66
  const wb = { Sheets: { data: ws }, SheetNames: ['data'] };
50
67
  const excelBuffer = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-data-exporter.mjs","sources":["../../../projects/ui-common/data-exporter/data-exporter.ts","../../../projects/ui-common/data-exporter/exporters/csv-exporter.ts","../../../projects/ui-common/data-exporter/exporters/xlsx-exporter.ts","../../../projects/ui-common/data-exporter/data-exporter.module.ts","../../../projects/ui-common/data-exporter/theseam-ui-common-data-exporter.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core'\nimport { Observable } from 'rxjs'\nimport { switchMap } from 'rxjs/operators'\n\nimport { IconProp } from '@fortawesome/fontawesome-svg-core'\n\nexport type IDataExporterFunction = <T>(data: T[]) => Observable<T[]>\n\nexport interface IDataExporter {\n /**\n * Name to identify the exporter.\n */\n readonly name: string\n\n /**\n * Label to use for exporter in user visible text.\n *\n * default: `name`\n */\n label?: string\n\n /**\n * Icon to represent exporter.\n */\n icon?: string | IconProp\n\n /**\n * Pass the rows directly to the export function without any mapping.\n */\n skipDataMapping?: boolean\n\n /**\n * Export the data based on the data to some format.\n */\n export<T>(data: T[]): Observable<boolean>\n}\n\nexport const THESEAM_DATA_EXPORTER = new InjectionToken<IDataExporter>(\n 'TheSeamDataExporter',\n)\n\nexport function exportOperator<T>(exportFn: IDataExporterFunction) {\n return (source$: Observable<T[]>) => source$.pipe(switchMap(exportFn))\n}\n","import { Injectable } from '@angular/core'\nimport { from, Observable } from 'rxjs'\nimport { mapTo, switchMap, tap } from 'rxjs/operators'\n\nimport { faFileCsv } from '@fortawesome/free-solid-svg-icons'\nimport FileSaver from 'file-saver'\n\nimport {\n fileDataFromBuffer,\n wrapIntoObservable,\n} from '@theseam/ui-common/utils'\n\nimport { IDataExporter } from '../data-exporter'\n\n@Injectable()\nexport class CSVDataExporter implements IDataExporter {\n public readonly name = 'exporter:csv'\n\n public label = 'CSV'\n\n public icon = faFileCsv\n\n public export<T>(data: T[]): Observable<boolean> {\n // TODO: Fix typing for the dynamic imports\n return wrapIntoObservable(import('xlsx')).pipe(\n switchMap((XLSX: any) => {\n const ws = XLSX.utils.json_to_sheet(data)\n\n const out = XLSX.utils.sheet_to_csv(ws)\n\n // NOTE: `out` should not be passed as a string, but the fileDataFromBuffer\n // function happens to works with a string. When the build issue about the\n // function argument is figured out then this should be fixed.\n return (\n from(fileDataFromBuffer(out as any))\n // return from(fileDataFromBuffer(Buffer.from(out)))\n .pipe(\n tap((fileData) => {\n FileSaver.saveAs(fileData.blob, `Export.csv`)\n }),\n mapTo(true),\n )\n )\n }),\n )\n }\n}\n","import { Injectable } from '@angular/core'\nimport { from, Observable } from 'rxjs'\nimport { mapTo, switchMap, tap } from 'rxjs/operators'\n\nimport { faFileExcel } from '@fortawesome/free-solid-svg-icons'\nimport { Buffer } from 'buffer/'\nimport FileSaver from 'file-saver'\n\nimport {\n fileDataFromBuffer,\n wrapIntoObservable,\n} from '@theseam/ui-common/utils'\n\nimport { IDataExporter } from '../data-exporter'\n\n@Injectable()\nexport class XLSXDataExporter implements IDataExporter {\n public readonly name = 'exporter:xlsx'\n\n public label = 'XLSX'\n\n public icon = faFileExcel\n\n public export<T>(data: T[]): Observable<boolean> {\n // TODO: Fix typing for the dynamic imports\n return wrapIntoObservable(import('xlsx')).pipe(\n switchMap((XLSX: any) => {\n const ws = XLSX.utils.json_to_sheet(data)\n const wb = { Sheets: { data: ws }, SheetNames: ['data'] }\n const excelBuffer = XLSX.write(wb, { bookType: 'xlsx', type: 'array' })\n\n return from(fileDataFromBuffer(Buffer.from(excelBuffer))).pipe(\n tap((fileData) => {\n FileSaver.saveAs(fileData.blob, `Export.xlsx`)\n }),\n mapTo(true),\n )\n }),\n )\n }\n}\n","import { NgModule } from '@angular/core'\n\nimport { CSVDataExporter } from './exporters/csv-exporter'\nimport { XLSXDataExporter } from './exporters/xlsx-exporter'\n\nimport { THESEAM_DATA_EXPORTER } from './data-exporter'\n\n@NgModule({\n declarations: [],\n imports: [],\n providers: [\n { provide: THESEAM_DATA_EXPORTER, useClass: CSVDataExporter, multi: true },\n { provide: THESEAM_DATA_EXPORTER, useClass: XLSXDataExporter, multi: true },\n ],\n})\nexport class TheSeamDataExporterModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAqCa,qBAAqB,GAAG,IAAI,cAAc,CACrD,qBAAqB;AAGjB,SAAU,cAAc,CAAI,QAA+B,EAAA;AAC/D,IAAA,OAAO,CAAC,OAAwB,KAAK,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACxE;;MC5Ba,eAAe,CAAA;IACV,IAAI,GAAG,cAAc;IAE9B,KAAK,GAAG,KAAK;IAEb,IAAI,GAAG,SAAS;AAEhB,IAAA,MAAM,CAAI,IAAS,EAAA;;AAExB,QAAA,OAAO,kBAAkB,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAC5C,SAAS,CAAC,CAAC,IAAS,KAAI;YACtB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC;YAEzC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;;;;AAKvC,YAAA,QACE,IAAI,CAAC,kBAAkB,CAAC,GAAU,CAAC;;AAEhC,iBAAA,IAAI,CACH,GAAG,CAAC,CAAC,QAAQ,KAAI;g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,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAhB,gBAAgB,EAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B;;;MCAY,yBAAyB,CAAA;uGAAzB,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;wGAAzB,yBAAyB,EAAA,CAAA;AAAzB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,EAAA,SAAA,EALzB;YACT,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE;YAC1E,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAE;AAC5E,SAAA,EAAA,CAAA;;2FAEU,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBARrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,SAAS,EAAE;wBACT,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE;wBAC1E,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAE;AAC5E,qBAAA;AACF,iBAAA;;;ACdD;;AAEG;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-data-exporter.mjs","sources":["../../../projects/ui-common/data-exporter/data-exporter.ts","../../../projects/ui-common/data-exporter/import-xlsx.ts","../../../projects/ui-common/data-exporter/exporters/csv-exporter.ts","../../../projects/ui-common/data-exporter/exporters/xlsx-exporter.ts","../../../projects/ui-common/data-exporter/data-exporter.module.ts","../../../projects/ui-common/data-exporter/theseam-ui-common-data-exporter.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core'\nimport { Observable } from 'rxjs'\nimport { switchMap } from 'rxjs/operators'\n\nimport { IconProp } from '@fortawesome/fontawesome-svg-core'\n\nexport type IDataExporterFunction = <T>(data: T[]) => Observable<T[]>\n\nexport interface IDataExporter {\n /**\n * Name to identify the exporter.\n */\n readonly name: string\n\n /**\n * Label to use for exporter in user visible text.\n *\n * default: `name`\n */\n label?: string\n\n /**\n * Icon to represent exporter.\n */\n icon?: string | IconProp\n\n /**\n * Pass the rows directly to the export function without any mapping.\n */\n skipDataMapping?: boolean\n\n /**\n * Export the data based on the data to some format.\n */\n export<T>(data: T[]): Observable<boolean>\n}\n\nexport const THESEAM_DATA_EXPORTER = new InjectionToken<IDataExporter>(\n 'TheSeamDataExporter',\n)\n\nexport function exportOperator<T>(exportFn: IDataExporterFunction) {\n return (source$: Observable<T[]>) => source$.pipe(switchMap(exportFn))\n}\n","// TODO: We may be able to avoid this by getting the Storybook tsconfig and our\n// apps Angular builds more in-sync or when Storybook updates the builder that\n// it uses. For now, this should give a reliable ESM and CJS interop for the\n// XLSX library.\n\n/**\n * Imports the XLSX library.\n *\n * This should be used instead of direct dynamic imports to ensure\n * compatibility. It may be better to just import normally, but most datatables\n * don't do client-side XLSX processing so dynamic imports are preferred.\n *\n * @returns The XLSX library.\n */\nexport async function importXlsx(): Promise<any> {\n // TODO: Fix typing for the dynamic imports\n const XLSX = await import('xlsx')\n return XLSX.default ?? XLSX\n}\n","import { Injectable } from '@angular/core'\nimport { from, Observable } from 'rxjs'\nimport { mapTo, switchMap, tap } from 'rxjs/operators'\n\nimport { faFileCsv } from '@fortawesome/free-solid-svg-icons'\nimport FileSaver from 'file-saver'\n\nimport {\n fileDataFromBuffer,\n wrapIntoObservable,\n} from '@theseam/ui-common/utils'\n\nimport { IDataExporter } from '../data-exporter'\nimport { importXlsx } from '../import-xlsx'\n\n@Injectable()\nexport class CSVDataExporter implements IDataExporter {\n public readonly name = 'exporter:csv'\n\n public label = 'CSV'\n\n public icon = faFileCsv\n\n public export<T>(data: T[]): Observable<boolean> {\n return wrapIntoObservable(importXlsx()).pipe(\n switchMap((XLSX: any) => {\n const ws = XLSX.utils.json_to_sheet(data)\n\n const out = XLSX.utils.sheet_to_csv(ws)\n\n // NOTE: `out` should not be passed as a string, but the fileDataFromBuffer\n // function happens to works with a string. When the build issue about the\n // function argument is figured out then this should be fixed.\n return (\n from(fileDataFromBuffer(out as any))\n // return from(fileDataFromBuffer(Buffer.from(out)))\n .pipe(\n tap((fileData) => {\n FileSaver.saveAs(fileData.blob, `Export.csv`)\n }),\n mapTo(true),\n )\n )\n }),\n )\n }\n}\n","import { Injectable } from '@angular/core'\nimport { from, Observable } from 'rxjs'\nimport { mapTo, switchMap, tap } from 'rxjs/operators'\n\nimport { faFileExcel } from '@fortawesome/free-solid-svg-icons'\nimport { Buffer } from 'buffer/'\nimport FileSaver from 'file-saver'\n\nimport {\n fileDataFromBuffer,\n wrapIntoObservable,\n} from '@theseam/ui-common/utils'\n\nimport { IDataExporter } from '../data-exporter'\nimport { importXlsx } from '../import-xlsx'\n\n@Injectable()\nexport class XLSXDataExporter implements IDataExporter {\n public readonly name = 'exporter:xlsx'\n\n public label = 'XLSX'\n\n public icon = faFileExcel\n\n public export<T>(data: T[]): Observable<boolean> {\n return wrapIntoObservable(importXlsx()).pipe(\n switchMap((XLSX: any) => {\n const ws = XLSX.utils.json_to_sheet(data)\n const wb = { Sheets: { data: ws }, SheetNames: ['data'] }\n const excelBuffer = XLSX.write(wb, { bookType: 'xlsx', type: 'array' })\n\n return from(fileDataFromBuffer(Buffer.from(excelBuffer))).pipe(\n tap((fileData) => {\n FileSaver.saveAs(fileData.blob, `Export.xlsx`)\n }),\n mapTo(true),\n )\n }),\n )\n }\n}\n","import { NgModule } from '@angular/core'\n\nimport { CSVDataExporter } from './exporters/csv-exporter'\nimport { XLSXDataExporter } from './exporters/xlsx-exporter'\n\nimport { THESEAM_DATA_EXPORTER } from './data-exporter'\n\n@NgModule({\n declarations: [],\n imports: [],\n providers: [\n { provide: THESEAM_DATA_EXPORTER, useClass: CSVDataExporter, multi: true },\n { provide: THESEAM_DATA_EXPORTER, useClass: XLSXDataExporter, multi: true },\n ],\n})\nexport class TheSeamDataExporterModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAqCa,qBAAqB,GAAG,IAAI,cAAc,CACrD,qBAAqB;AAGjB,SAAU,cAAc,CAAI,QAA+B,EAAA;AAC/D,IAAA,OAAO,CAAC,OAAwB,KAAK,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACxE;;AC3CA;AACA;AACA;AACA;AAEA;;;;;;;;AAQG;AACI,eAAe,UAAU,GAAA;;AAE9B,IAAA,MAAM,IAAI,GAAG,MAAM,OAAO,MAAM,CAAC;AACjC,IAAA,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI;AAC7B;;MCFa,eAAe,CAAA;IACV,IAAI,GAAG,cAAc;IAE9B,KAAK,GAAG,KAAK;IAEb,IAAI,GAAG,SAAS;AAEhB,IAAA,MAAM,CAAI,IAAS,EAAA;AACxB,QAAA,OAAO,kBAAkB,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAC1C,SAAS,CAAC,CAAC,IAAS,KAAI;YACtB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC;YAEzC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;;;;AAKvC,YAAA,QACE,IAAI,CAAC,kBAAkB,CAAC,GAAU,CAAC;;AAEhC,iBAAA,IAAI,CACH,GAAG,CAAC,CAAC,QAAQ,KAAI;gBACf,SAAS,CAAC,MAAM,CAAC,QAAQ,CAA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