@theseam/ui-common 1.0.0-beta.6 → 1.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/breadcrumbs/index.d.ts +1 -2
  2. package/buttons/index.d.ts +20 -13
  3. package/datatable/index.d.ts +8 -8
  4. package/dynamic/index.d.ts +5 -5
  5. package/fesm2022/theseam-ui-common-asset-reader.mjs +28 -29
  6. package/fesm2022/theseam-ui-common-asset-reader.mjs.map +1 -1
  7. package/fesm2022/theseam-ui-common-breadcrumbs.mjs +25 -31
  8. package/fesm2022/theseam-ui-common-breadcrumbs.mjs.map +1 -1
  9. package/fesm2022/theseam-ui-common-buttons.mjs +108 -66
  10. package/fesm2022/theseam-ui-common-buttons.mjs.map +1 -1
  11. package/fesm2022/theseam-ui-common-card.mjs +21 -21
  12. package/fesm2022/theseam-ui-common-card.mjs.map +1 -1
  13. package/fesm2022/theseam-ui-common-carousel.mjs +28 -30
  14. package/fesm2022/theseam-ui-common-carousel.mjs.map +1 -1
  15. package/fesm2022/theseam-ui-common-checkbox.mjs +27 -27
  16. package/fesm2022/theseam-ui-common-checkbox.mjs.map +1 -1
  17. package/fesm2022/theseam-ui-common-confirm-dialog.mjs +23 -27
  18. package/fesm2022/theseam-ui-common-confirm-dialog.mjs.map +1 -1
  19. package/fesm2022/theseam-ui-common-core.mjs +31 -11
  20. package/fesm2022/theseam-ui-common-core.mjs.map +1 -1
  21. package/fesm2022/theseam-ui-common-data-exporter.mjs +18 -19
  22. package/fesm2022/theseam-ui-common-data-exporter.mjs.map +1 -1
  23. package/fesm2022/theseam-ui-common-data-filters.mjs +80 -64
  24. package/fesm2022/theseam-ui-common-data-filters.mjs.map +1 -1
  25. package/fesm2022/theseam-ui-common-datatable-alterations-display.mjs +51 -49
  26. package/fesm2022/theseam-ui-common-datatable-alterations-display.mjs.map +1 -1
  27. package/fesm2022/theseam-ui-common-datatable-dynamic.mjs +145 -112
  28. package/fesm2022/theseam-ui-common-datatable-dynamic.mjs.map +1 -1
  29. package/fesm2022/theseam-ui-common-datatable.mjs +581 -385
  30. package/fesm2022/theseam-ui-common-datatable.mjs.map +1 -1
  31. package/fesm2022/theseam-ui-common-dynamic-component-loader.mjs +12 -14
  32. package/fesm2022/theseam-ui-common-dynamic-component-loader.mjs.map +1 -1
  33. package/fesm2022/theseam-ui-common-dynamic.mjs +60 -48
  34. package/fesm2022/theseam-ui-common-dynamic.mjs.map +1 -1
  35. package/fesm2022/theseam-ui-common-footer-bar.mjs +9 -15
  36. package/fesm2022/theseam-ui-common-footer-bar.mjs.map +1 -1
  37. package/fesm2022/theseam-ui-common-form-field-error.mjs +60 -43
  38. package/fesm2022/theseam-ui-common-form-field-error.mjs.map +1 -1
  39. package/fesm2022/theseam-ui-common-form-field.mjs +120 -74
  40. package/fesm2022/theseam-ui-common-form-field.mjs.map +1 -1
  41. package/fesm2022/theseam-ui-common-framework.mjs +669 -543
  42. package/fesm2022/theseam-ui-common-framework.mjs.map +1 -1
  43. package/fesm2022/theseam-ui-common-google-maps.mjs +206 -149
  44. package/fesm2022/theseam-ui-common-google-maps.mjs.map +1 -1
  45. package/fesm2022/theseam-ui-common-graphql.mjs +252 -195
  46. package/fesm2022/theseam-ui-common-graphql.mjs.map +1 -1
  47. package/fesm2022/theseam-ui-common-icon.mjs +125 -89
  48. package/fesm2022/theseam-ui-common-icon.mjs.map +1 -1
  49. package/fesm2022/theseam-ui-common-layout.mjs +18 -26
  50. package/fesm2022/theseam-ui-common-layout.mjs.map +1 -1
  51. package/fesm2022/theseam-ui-common-loading.mjs +19 -28
  52. package/fesm2022/theseam-ui-common-loading.mjs.map +1 -1
  53. package/fesm2022/theseam-ui-common-menu.mjs +124 -95
  54. package/fesm2022/theseam-ui-common-menu.mjs.map +1 -1
  55. package/fesm2022/theseam-ui-common-modal.mjs +177 -129
  56. package/fesm2022/theseam-ui-common-modal.mjs.map +1 -1
  57. package/fesm2022/theseam-ui-common-models.mjs +3 -3
  58. package/fesm2022/theseam-ui-common-models.mjs.map +1 -1
  59. package/fesm2022/theseam-ui-common-navigation-reload.mjs +13 -11
  60. package/fesm2022/theseam-ui-common-navigation-reload.mjs.map +1 -1
  61. package/fesm2022/theseam-ui-common-popover.mjs +81 -88
  62. package/fesm2022/theseam-ui-common-popover.mjs.map +1 -1
  63. package/fesm2022/theseam-ui-common-progress.mjs +15 -19
  64. package/fesm2022/theseam-ui-common-progress.mjs.map +1 -1
  65. package/fesm2022/theseam-ui-common-rich-text.mjs +65 -52
  66. package/fesm2022/theseam-ui-common-rich-text.mjs.map +1 -1
  67. package/fesm2022/theseam-ui-common-scrollbar.mjs +12 -9
  68. package/fesm2022/theseam-ui-common-scrollbar.mjs.map +1 -1
  69. package/fesm2022/theseam-ui-common-services.mjs +41 -26
  70. package/fesm2022/theseam-ui-common-services.mjs.map +1 -1
  71. package/fesm2022/theseam-ui-common-shared.mjs +123 -67
  72. package/fesm2022/theseam-ui-common-shared.mjs.map +1 -1
  73. package/fesm2022/theseam-ui-common-storage.mjs +9 -6
  74. package/fesm2022/theseam-ui-common-storage.mjs.map +1 -1
  75. package/fesm2022/theseam-ui-common-story-helpers.mjs +148 -86
  76. package/fesm2022/theseam-ui-common-story-helpers.mjs.map +1 -1
  77. package/fesm2022/theseam-ui-common-tabbed.mjs +43 -39
  78. package/fesm2022/theseam-ui-common-tabbed.mjs.map +1 -1
  79. package/fesm2022/theseam-ui-common-table-cell-type.mjs +34 -38
  80. package/fesm2022/theseam-ui-common-table-cell-type.mjs.map +1 -1
  81. package/fesm2022/theseam-ui-common-table-cell-types.mjs +182 -144
  82. package/fesm2022/theseam-ui-common-table-cell-types.mjs.map +1 -1
  83. package/fesm2022/theseam-ui-common-table.mjs +50 -39
  84. package/fesm2022/theseam-ui-common-table.mjs.map +1 -1
  85. package/fesm2022/theseam-ui-common-tel-input.mjs +98 -63
  86. package/fesm2022/theseam-ui-common-tel-input.mjs.map +1 -1
  87. package/fesm2022/theseam-ui-common-testing.mjs +13 -10
  88. package/fesm2022/theseam-ui-common-testing.mjs.map +1 -1
  89. package/fesm2022/theseam-ui-common-tiled-select.mjs +54 -50
  90. package/fesm2022/theseam-ui-common-tiled-select.mjs.map +1 -1
  91. package/fesm2022/theseam-ui-common-toggle-edit.mjs +41 -37
  92. package/fesm2022/theseam-ui-common-toggle-edit.mjs.map +1 -1
  93. package/fesm2022/theseam-ui-common-toggle-group.mjs +30 -31
  94. package/fesm2022/theseam-ui-common-toggle-group.mjs.map +1 -1
  95. package/fesm2022/theseam-ui-common-tooltip.mjs +225 -66
  96. package/fesm2022/theseam-ui-common-tooltip.mjs.map +1 -1
  97. package/fesm2022/theseam-ui-common-unsaved-changes-dialog.mjs +14 -12
  98. package/fesm2022/theseam-ui-common-unsaved-changes-dialog.mjs.map +1 -1
  99. package/fesm2022/theseam-ui-common-utils.mjs +113 -77
  100. package/fesm2022/theseam-ui-common-utils.mjs.map +1 -1
  101. package/fesm2022/theseam-ui-common-validators.mjs +10 -9
  102. package/fesm2022/theseam-ui-common-validators.mjs.map +1 -1
  103. package/fesm2022/theseam-ui-common-vertical-list-filter.mjs +39 -17
  104. package/fesm2022/theseam-ui-common-vertical-list-filter.mjs.map +1 -1
  105. package/fesm2022/theseam-ui-common-viewers.mjs +79 -56
  106. package/fesm2022/theseam-ui-common-viewers.mjs.map +1 -1
  107. package/fesm2022/theseam-ui-common-widget.mjs +288 -314
  108. package/fesm2022/theseam-ui-common-widget.mjs.map +1 -1
  109. package/framework/base-layout/base-layout.component.scss +9 -4
  110. package/framework/base-layout/styles/_variables.scss +4 -9
  111. package/framework/dashboard/dashboard-widgets/dashboard-widgets.component.scss +6 -4
  112. package/framework/index.d.ts +6 -6
  113. package/framework/nav/nav-item/nav-item.component.scss +7 -6
  114. package/framework/nav/styles/_themes/light/_variables.scss +21 -5
  115. package/framework/nav/styles/_themes/primary/_variables.scss +21 -5
  116. package/framework/side-nav/side-nav-item/side-nav-item.component.scss +5 -2
  117. package/framework/side-nav/styles/_themes/light/_variables.scss +5 -1
  118. package/framework/side-nav/styles/_themes/primary/_variables.scss +25 -5
  119. package/graphql/index.d.ts +5 -5
  120. package/modal/README.md +5 -5
  121. package/modal/index.d.ts +1 -1
  122. package/models/index.d.ts +1 -1
  123. package/package.json +59 -59
  124. package/popover/index.d.ts +0 -2
  125. package/progress/progress-circle/styles/_variables.scss +15 -3
  126. package/story-helpers/index.d.ts +11 -1
  127. package/styles/bootstrap/_bootstrap.scss +34 -34
  128. package/styles/bootstrap/_bs-styles.scss +4 -8
  129. package/styles/bootstrap/_bs-utilities.scss +4 -4
  130. package/styles/bootstrap/_bs-variables.scss +65 -70
  131. package/styles/common/_forms.scss +9 -10
  132. package/styles/common/_global.scss +0 -1
  133. package/styles/common/_hacks.scss +1 -1
  134. package/styles/common/_table.scss +0 -1
  135. package/styles/common/_text.scss +3 -1
  136. package/styles/theme.scss +1 -1
  137. package/styles/vendor/ng-select/_ng-select-bs4.scss +292 -294
  138. package/styles/vendor/ngx-datatable/_ngx-datatable.scss +63 -32
  139. package/styles/vendor/ngx-datatable/_themes/bootstrap/_variables.scss +37 -10
  140. package/styles/vendor/ngx-datatable/_themes/material/_variables.scss +3 -1
  141. package/styles/vendor/quill/_quill.scss +15 -9
  142. package/tel-input/README.md +27 -27
  143. package/utils/index.d.ts +3 -3
  144. package/viewers/index.d.ts +9 -2
  145. package/widget/_widget-theme.scss +1 -1
  146. package/widget/styles/_variables.scss +2 -2
  147. package/widget/widget/widget.component.scss +0 -2
  148. package/widget/widget-content-components/widget-tile/widget-tile.component.scss +1 -3
  149. package/widget/widget-footer/widget-footer.component.scss +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-checkbox.mjs","sources":["../../../projects/ui-common/checkbox/testing/checkbox.harness.ts","../../../projects/ui-common/checkbox/checkbox.component.ts","../../../projects/ui-common/checkbox/checkbox.component.html","../../../projects/ui-common/checkbox/checkbox.module.ts","../../../projects/ui-common/checkbox/theseam-ui-common-checkbox.ts"],"sourcesContent":["import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing'\n\ninterface TheSeamCheckboxHarnessFilters extends BaseHarnessFilters {\n /** Filters based on the id of the checkbox. */\n id?: number | string | RegExp\n\n /** Filters based on the name of the checkbox. */\n name?: string | RegExp\n}\n\nexport class TheSeamCheckboxHarness extends ComponentHarness {\n static hostSelector = 'seam-checkbox'\n\n /** Creates a `HarnessPredicate` used to locate a particular `MyMenuHarness`. */\n static with(options: TheSeamCheckboxHarnessFilters): HarnessPredicate<TheSeamCheckboxHarness> {\n return new HarnessPredicate(TheSeamCheckboxHarness, options)\n .addOption('checkbox id', options.id,\n (harness, index) => HarnessPredicate.stringMatches(harness.getId(), `${index}`))\n .addOption('checkbox name', options.name,\n (harness, name) => HarnessPredicate.stringMatches(harness.getName(), name))\n }\n\n public async getId(): Promise<string | null> {\n return (await this.getInputElement()).getAttribute('id')\n }\n\n public async getName(): Promise<string | null> {\n return (await this.getInputElement()).getAttribute('name')\n }\n\n /**\n * Returns the checked state of the checkbox.\n *\n * @returns true if the checkbox is checked, false if not\n */\n public async isChecked(): Promise<boolean> {\n return (await this.getInputElement()).getProperty('checked')\n }\n\n /**\n * Returns the indeterminate state of the checkbox.\n *\n * @returns true if the checkbox is indeterminate, false if not\n */\n public async isIndeterminate(): Promise<boolean> {\n return (await this.getInputElement()).getProperty('indeterminate')\n }\n\n /**\n * Returns the disabled state of the checkbox.\n *\n * @returns true if the checkbox is disabled, false if not\n */\n public async isDisabled(): Promise<boolean> {\n return (await this.getInputElement()).getProperty('disabled')\n }\n\n /**\n * Returns the required state of the checkbox.\n *\n * @returns true if the checkbox is required, false if not\n */\n public async isRequired(): Promise<boolean> {\n return (await this.getInputElement()).getProperty('required')\n }\n\n /**\n * Clicks the checkbox.\n */\n public async click() {\n return (await this.getInputElement()).click()\n }\n\n /**\n * Returns the input element of the checkbox.\n *\n * @returns the input element of the checkbox\n */\n public async getInputElement() {\n return this.locatorFor('input')()\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y'\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { ObserversModule } from '@angular/cdk/observers'\nimport { CommonModule } from '@angular/common'\nimport {\n AfterViewInit,\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n NgZone,\n OnDestroy,\n Output,\n ViewChild\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { CanDisable, CanDisableCtor, HasTabIndex, HasTabIndexCtor, InputBoolean, mixinDisabled, mixinTabIndex } from '@theseam/ui-common/core'\n\n// NOTE: Partially based on mat-checkbox: https://github.com/angular/components/blob/master/src/material/checkbox/checkbox.ts\n\n/** Change event object emitted by TheSeamCheckboxComponent. */\nexport class TheSeamCheckboxChange {\n /** The source TheSeamCheckboxComponent of the event. */\n public readonly source: TheSeamCheckboxComponent\n /** The new `checked` value of the checkbox. */\n public readonly checked: boolean\n\n constructor(\n private readonly _source: TheSeamCheckboxComponent,\n private readonly _checked: boolean\n ) {\n this.source = _source\n this.checked = _checked\n }\n}\n\nexport const THESEAM_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n // tslint:disable-next-line: no-use-before-declare\n useExisting: forwardRef(() => TheSeamCheckboxComponent),\n multi: true\n}\n\nclass TheSeamCheckboxComponentBase {\n constructor(public _elementRef: ElementRef) {}\n}\n\nconst _TheSeamCheckboxMixinBase: HasTabIndexCtor & CanDisableCtor &\n typeof TheSeamCheckboxComponentBase =\n mixinTabIndex(mixinDisabled(TheSeamCheckboxComponentBase))\n\nlet _uid = 0\n\n/**\n * A Checkbox.\n */\n@Component({\n selector: 'seam-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrls: ['./checkbox.component.scss'],\n imports: [\n CommonModule,\n ObserversModule,\n ],\n exportAs: 'seamCheckbox',\n host: {\n '[attr.tabindex]': 'null',\n 'class': 'custom-control custom-checkbox'\n },\n providers: [THESEAM_CHECKBOX_CONTROL_VALUE_ACCESSOR],\n inputs: ['tabIndex'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class TheSeamCheckboxComponent extends _TheSeamCheckboxMixinBase\n implements AfterViewInit, OnDestroy, ControlValueAccessor, CanDisable, HasTabIndex {\n static ngAcceptInputType_checked: BooleanInput\n static ngAcceptInputType_disabled: BooleanInput\n static ngAcceptInputType_indeterminate: BooleanInput\n\n /** @ignore */\n private _uid = `seam-chk-${_uid++}`\n\n /** A unique id for the checkbox input. If none is supplied, it will be auto-generated. */\n @Input() id?: string = this._uid\n\n /** Returns the unique id for the input. */\n get inputId(): string { return `${this.id || this._uid}` }\n\n /**\n * Attached to the aria-label attribute of the host element. In most cases, aria-labelledby will\n * take precedence so this may be omitted.\n */\n @Input('aria-label') ariaLabel?: string = ''\n\n /**\n * Users can specify the `aria-labelledby` attribute which will be forwarded to the input element\n */\n @Input('aria-labelledby') ariaLabelledby?: string | null = null\n\n /** Whether the checkbox is required. */\n @Input() @InputBoolean() required = false\n\n /** Whether the checkbox is checked. */\n @Input()\n get checked(): boolean { return this._checked }\n set checked(value: boolean) {\n const newValue = coerceBooleanProperty(value)\n\n if (newValue !== this.checked) {\n this._checked = newValue\n this._changeDetectorRef.markForCheck()\n }\n }\n /** @ignore */\n private _checked = false\n\n /**\n * Whether the checkbox is disabled.\n */\n // This fully overrides the implementation provided by mixinDisabled, but the\n // mixin is still required because mixinTabIndex requires it.\n @Input()\n get disabled(): boolean { return this._disabled }\n set disabled(value: boolean) {\n const newValue = coerceBooleanProperty(value)\n\n if (newValue !== this.disabled) {\n this._disabled = newValue\n this._changeDetectorRef.markForCheck()\n }\n }\n /** @ignore */\n private _disabled = false\n\n /**\n * Whether the checkbox is indeterminate. This is also known as \"mixed\" mode and can be used to\n * represent a checkbox with three states, e.g. a checkbox that represents a nested list of\n * checkable items. Note that whenever checkbox is manually clicked, indeterminate is immediately\n * set to false.\n */\n @Input()\n get indeterminate(): boolean { return this._indeterminate }\n set indeterminate(value: boolean) {\n const changed = value !== this._indeterminate\n this._indeterminate = coerceBooleanProperty(value)\n\n if (changed) {\n this.indeterminateChange.emit(this._indeterminate)\n }\n\n this._syncIndeterminate(this._indeterminate)\n }\n /** @ignore */\n private _indeterminate = false\n\n /** Name value will be applied to the input element if present */\n @Input() name: string | undefined | null = null\n\n /** Event emitted when the checkbox's `checked` value changes. */\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() readonly change = new EventEmitter<TheSeamCheckboxChange>()\n\n /** Event emitted when the checkbox's `indeterminate` value changes. */\n @Output() readonly indeterminateChange: EventEmitter<boolean> = new EventEmitter<boolean>()\n\n /** The value attribute of the native input element */\n @Input() value: string | undefined | null\n\n /**\n * The native `<input type=\"checkbox\">` element\n * @ignore\n */\n @ViewChild('input', { static: true }) _inputElement: ElementRef<HTMLInputElement> | undefined | null\n\n /**\n * Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor.\n * @ignore\n */\n _onTouched: () => any = () => {}\n\n /** @ignore */\n private _controlValueAccessorChangeFn: (value: any) => void = () => {}\n\n constructor(\n elementRef: ElementRef,\n private _changeDetectorRef: ChangeDetectorRef,\n private _focusMonitor: FocusMonitor,\n private _ngZone: NgZone,\n @Attribute('tabindex') tabIndex: string\n ) {\n super(elementRef)\n\n this.tabIndex = parseInt(tabIndex, 10) || 0\n\n this._focusMonitor.monitor(elementRef, true).subscribe(focusOrigin => {\n if (!focusOrigin) {\n // When a focused element becomes disabled, the browser *immediately* fires a blur event.\n // Angular does not expect events to be raised during change detection, so any state change\n // (such as a form control's 'ng-touched') will cause a changed-after-checked error.\n // See https://github.com/angular/angular/issues/17793. To work around this, we defer\n // telling the form control it has been touched until the next tick.\n Promise.resolve().then(() => {\n this._onTouched()\n _changeDetectorRef.markForCheck()\n })\n }\n })\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef)\n }\n\n /** @ignore */\n ngAfterViewInit() {\n this._syncIndeterminate(this._indeterminate)\n }\n\n /**\n * Method being called whenever the label text changes.\n * @ignore\n */\n _onLabelTextChange() {\n // Since the event of the `cdkObserveContent` directive runs outside of the zone, the checkbox\n // component will be only marked for check, but no actual change detection runs automatically.\n // Instead of going back into the zone in order to trigger a change detection which causes\n // *all* components to be checked (if explicitly marked or not using OnPush), we only trigger\n // an explicit change detection for the checkbox view and its children.\n this._changeDetectorRef.detectChanges()\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n writeValue(value: any) {\n this.checked = !!value\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n registerOnChange(fn: (value: any) => void) {\n this._controlValueAccessorChangeFn = fn\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n registerOnTouched(fn: any) {\n this._onTouched = fn\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled\n }\n\n /** @ignore */\n _getAriaChecked(): 'true' | 'false' | 'mixed' {\n return this.checked ? 'true' : (this.indeterminate ? 'mixed' : 'false')\n }\n\n /** @ignore */\n private _emitChangeEvent() {\n const event = new TheSeamCheckboxChange(this, this.checked)\n\n this._controlValueAccessorChangeFn(this.checked)\n this.change.emit(event)\n }\n\n /** Toggles the `checked` state of the checkbox. */\n toggle(): void {\n this.checked = !this.checked\n }\n\n /**\n * Event handler for checkbox input element.\n * Toggles checked state if element is not disabled.\n * Do not toggle on (change) event since IE doesn't fire change event when\n * indeterminate checkbox is clicked.\n * @ignore\n */\n _onInputClick(event: Event) {\n // If resetIndeterminate is false, and the current state is indeterminate, do nothing on click\n if (!this.disabled) {\n // When user manually click on the checkbox, `indeterminate` is set to false.\n if (this.indeterminate) {\n Promise.resolve().then(() => {\n this._indeterminate = false\n this.indeterminateChange.emit(this._indeterminate)\n })\n }\n\n this.toggle()\n\n // Emit our custom change event if the native input emitted one.\n // It is important to only emit it, if the native input triggered one, because\n // we don't want to trigger a change event, when the `checked` variable changes for example.\n this._emitChangeEvent()\n }\n }\n\n /** Focuses the checkbox. */\n focus(origin: FocusOrigin = 'keyboard', options?: FocusOptions): void {\n if (!this._inputElement) { return }\n this._focusMonitor.focusVia(this._inputElement, origin, options)\n }\n\n /** @ignore */\n _onInteractionEvent(event: Event) {\n // We always have to stop propagation on the change event.\n // Otherwise the change event, from the input element, will bubble up and\n // emit its event object to the `change` output.\n event.stopPropagation()\n }\n\n /**\n * Syncs the indeterminate value with the checkbox DOM node.\n *\n * We sync `indeterminate` directly on the DOM node, because in Ivy the check for whether a\n * property is supported on an element boils down to `if (propName in element)`. Domino's\n * HTMLInputElement doesn't have an `indeterminate` property so Ivy will warn during\n * server-side rendering.\n * @ignore\n */\n private _syncIndeterminate(value: boolean) {\n const nativeCheckbox = this._inputElement\n\n if (nativeCheckbox) {\n nativeCheckbox.nativeElement.indeterminate = value\n }\n }\n\n}\n","<input #input\n type=\"checkbox\"\n class=\"custom-control-input\"\n [id]=\"inputId\"\n [required]=\"required\"\n [checked]=\"checked\"\n [attr.value]=\"value\"\n [disabled]=\"disabled\"\n [attr.name]=\"name\"\n [tabIndex]=\"tabIndex\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-checked]=\"_getAriaChecked()\"\n (change)=\"_onInteractionEvent($event)\"\n (click)=\"_onInputClick($event)\">\n<label #checkboxLabel\n class=\"custom-control-label\"\n [attr.for]=\"inputId\"\n (cdkObserveContent)=\"_onLabelTextChange()\">\n <ng-content></ng-content>\n</label>\n","import { ObserversModule } from '@angular/cdk/observers'\nimport { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { TheSeamCheckboxComponent } from './checkbox.component'\n\n/** @deprecated */\n@NgModule({\n imports: [\n TheSeamCheckboxComponent\n ],\n exports: [\n TheSeamCheckboxComponent\n ]\n})\nexport class TheSeamCheckboxModule { }\n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AA;AACR,oBAAA,OAAO,EAAE;wBACP;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP;AACD;AACF,iBAAA;;;ACdD;;AAEG;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-checkbox.mjs","sources":["../../../projects/ui-common/checkbox/testing/checkbox.harness.ts","../../../projects/ui-common/checkbox/checkbox.component.ts","../../../projects/ui-common/checkbox/checkbox.component.html","../../../projects/ui-common/checkbox/checkbox.module.ts","../../../projects/ui-common/checkbox/theseam-ui-common-checkbox.ts"],"sourcesContent":["import {\n BaseHarnessFilters,\n ComponentHarness,\n HarnessPredicate,\n} from '@angular/cdk/testing'\n\ninterface TheSeamCheckboxHarnessFilters extends BaseHarnessFilters {\n /** Filters based on the id of the checkbox. */\n id?: number | string | RegExp\n\n /** Filters based on the name of the checkbox. */\n name?: string | RegExp\n}\n\nexport class TheSeamCheckboxHarness extends ComponentHarness {\n static hostSelector = 'seam-checkbox'\n\n /** Creates a `HarnessPredicate` used to locate a particular `MyMenuHarness`. */\n static with(\n options: TheSeamCheckboxHarnessFilters,\n ): HarnessPredicate<TheSeamCheckboxHarness> {\n return new HarnessPredicate(TheSeamCheckboxHarness, options)\n .addOption('checkbox id', options.id, (harness, index) =>\n HarnessPredicate.stringMatches(harness.getId(), `${index}`),\n )\n .addOption('checkbox name', options.name, (harness, name) =>\n HarnessPredicate.stringMatches(harness.getName(), name),\n )\n }\n\n public async getId(): Promise<string | null> {\n return (await this.getInputElement()).getAttribute('id')\n }\n\n public async getName(): Promise<string | null> {\n return (await this.getInputElement()).getAttribute('name')\n }\n\n /**\n * Returns the checked state of the checkbox.\n *\n * @returns true if the checkbox is checked, false if not\n */\n public async isChecked(): Promise<boolean> {\n return (await this.getInputElement()).getProperty('checked')\n }\n\n /**\n * Returns the indeterminate state of the checkbox.\n *\n * @returns true if the checkbox is indeterminate, false if not\n */\n public async isIndeterminate(): Promise<boolean> {\n return (await this.getInputElement()).getProperty('indeterminate')\n }\n\n /**\n * Returns the disabled state of the checkbox.\n *\n * @returns true if the checkbox is disabled, false if not\n */\n public async isDisabled(): Promise<boolean> {\n return (await this.getInputElement()).getProperty('disabled')\n }\n\n /**\n * Returns the required state of the checkbox.\n *\n * @returns true if the checkbox is required, false if not\n */\n public async isRequired(): Promise<boolean> {\n return (await this.getInputElement()).getProperty('required')\n }\n\n /**\n * Clicks the checkbox.\n */\n public async click() {\n return (await this.getInputElement()).click()\n }\n\n /**\n * Returns the input element of the checkbox.\n *\n * @returns the input element of the checkbox\n */\n public async getInputElement() {\n return this.locatorFor('input')()\n }\n}\n","import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y'\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { ObserversModule } from '@angular/cdk/observers'\nimport { CommonModule } from '@angular/common'\nimport {\n AfterViewInit,\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n NgZone,\n OnDestroy,\n Output,\n ViewChild,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport {\n CanDisable,\n CanDisableCtor,\n HasTabIndex,\n HasTabIndexCtor,\n InputBoolean,\n mixinDisabled,\n mixinTabIndex,\n} from '@theseam/ui-common/core'\n\n// NOTE: Partially based on mat-checkbox: https://github.com/angular/components/blob/master/src/material/checkbox/checkbox.ts\n\n/** Change event object emitted by TheSeamCheckboxComponent. */\nexport class TheSeamCheckboxChange {\n /** The source TheSeamCheckboxComponent of the event. */\n public readonly source: TheSeamCheckboxComponent\n /** The new `checked` value of the checkbox. */\n public readonly checked: boolean\n\n constructor(\n private readonly _source: TheSeamCheckboxComponent,\n private readonly _checked: boolean,\n ) {\n this.source = _source\n this.checked = _checked\n }\n}\n\nexport const THESEAM_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TheSeamCheckboxComponent),\n multi: true,\n}\n\nclass TheSeamCheckboxComponentBase {\n constructor(public _elementRef: ElementRef) {}\n}\n\nconst _TheSeamCheckboxMixinBase: HasTabIndexCtor &\n CanDisableCtor &\n typeof TheSeamCheckboxComponentBase = mixinTabIndex(\n mixinDisabled(TheSeamCheckboxComponentBase),\n)\n\nlet _uid = 0\n\n/**\n * A Checkbox.\n */\n@Component({\n selector: 'seam-checkbox',\n templateUrl: './checkbox.component.html',\n styleUrls: ['./checkbox.component.scss'],\n imports: [CommonModule, ObserversModule],\n exportAs: 'seamCheckbox',\n host: {\n '[attr.tabindex]': 'null',\n class: 'custom-control custom-checkbox',\n },\n providers: [THESEAM_CHECKBOX_CONTROL_VALUE_ACCESSOR],\n inputs: ['tabIndex'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TheSeamCheckboxComponent\n extends _TheSeamCheckboxMixinBase\n implements\n AfterViewInit,\n OnDestroy,\n ControlValueAccessor,\n CanDisable,\n HasTabIndex\n{\n static ngAcceptInputType_checked: BooleanInput\n static ngAcceptInputType_disabled: BooleanInput\n static ngAcceptInputType_indeterminate: BooleanInput\n\n /** @ignore */\n private _uid = `seam-chk-${_uid++}`\n\n /** A unique id for the checkbox input. If none is supplied, it will be auto-generated. */\n @Input() id?: string = this._uid\n\n /** Returns the unique id for the input. */\n get inputId(): string {\n return `${this.id || this._uid}`\n }\n\n /**\n * Attached to the aria-label attribute of the host element. In most cases, aria-labelledby will\n * take precedence so this may be omitted.\n */\n @Input('aria-label') ariaLabel?: string = ''\n\n /**\n * Users can specify the `aria-labelledby` attribute which will be forwarded to the input element\n */\n @Input('aria-labelledby') ariaLabelledby?: string | null = null\n\n /** Whether the checkbox is required. */\n @Input() @InputBoolean() required = false\n\n /** Whether the checkbox is checked. */\n @Input()\n get checked(): boolean {\n return this._checked\n }\n set checked(value: boolean) {\n const newValue = coerceBooleanProperty(value)\n\n if (newValue !== this.checked) {\n this._checked = newValue\n this._changeDetectorRef.markForCheck()\n }\n }\n /** @ignore */\n private _checked = false\n\n /**\n * Whether the checkbox is disabled.\n */\n // This fully overrides the implementation provided by mixinDisabled, but the\n // mixin is still required because mixinTabIndex requires it.\n @Input()\n get disabled(): boolean {\n return this._disabled\n }\n set disabled(value: boolean) {\n const newValue = coerceBooleanProperty(value)\n\n if (newValue !== this.disabled) {\n this._disabled = newValue\n this._changeDetectorRef.markForCheck()\n }\n }\n /** @ignore */\n private _disabled = false\n\n /**\n * Whether the checkbox is indeterminate. This is also known as \"mixed\" mode and can be used to\n * represent a checkbox with three states, e.g. a checkbox that represents a nested list of\n * checkable items. Note that whenever checkbox is manually clicked, indeterminate is immediately\n * set to false.\n */\n @Input()\n get indeterminate(): boolean {\n return this._indeterminate\n }\n set indeterminate(value: boolean) {\n const changed = value !== this._indeterminate\n this._indeterminate = coerceBooleanProperty(value)\n\n if (changed) {\n this.indeterminateChange.emit(this._indeterminate)\n }\n\n this._syncIndeterminate(this._indeterminate)\n }\n /** @ignore */\n private _indeterminate = false\n\n /** Name value will be applied to the input element if present */\n @Input() name: string | undefined | null = null\n\n /** Event emitted when the checkbox's `checked` value changes. */\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() readonly change = new EventEmitter<TheSeamCheckboxChange>()\n\n /** Event emitted when the checkbox's `indeterminate` value changes. */\n @Output() readonly indeterminateChange: EventEmitter<boolean> =\n new EventEmitter<boolean>()\n\n /** The value attribute of the native input element */\n @Input() value: string | undefined | null\n\n /**\n * The native `<input type=\"checkbox\">` element\n * @ignore\n */\n @ViewChild('input', { static: true }) _inputElement:\n | ElementRef<HTMLInputElement>\n | undefined\n | null\n\n /**\n * Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor.\n * @ignore\n */\n _onTouched: () => any = () => {}\n\n /** @ignore */\n private _controlValueAccessorChangeFn: (value: any) => void = () => {}\n\n constructor(\n elementRef: ElementRef,\n private _changeDetectorRef: ChangeDetectorRef,\n private _focusMonitor: FocusMonitor,\n private _ngZone: NgZone,\n @Attribute('tabindex') tabIndex: string,\n ) {\n super(elementRef)\n\n this.tabIndex = parseInt(tabIndex, 10) || 0\n\n this._focusMonitor.monitor(elementRef, true).subscribe((focusOrigin) => {\n if (!focusOrigin) {\n // When a focused element becomes disabled, the browser *immediately* fires a blur event.\n // Angular does not expect events to be raised during change detection, so any state change\n // (such as a form control's 'ng-touched') will cause a changed-after-checked error.\n // See https://github.com/angular/angular/issues/17793. To work around this, we defer\n // telling the form control it has been touched until the next tick.\n Promise.resolve().then(() => {\n this._onTouched()\n _changeDetectorRef.markForCheck()\n })\n }\n })\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef)\n }\n\n /** @ignore */\n ngAfterViewInit() {\n this._syncIndeterminate(this._indeterminate)\n }\n\n /**\n * Method being called whenever the label text changes.\n * @ignore\n */\n _onLabelTextChange() {\n // Since the event of the `cdkObserveContent` directive runs outside of the zone, the checkbox\n // component will be only marked for check, but no actual change detection runs automatically.\n // Instead of going back into the zone in order to trigger a change detection which causes\n // *all* components to be checked (if explicitly marked or not using OnPush), we only trigger\n // an explicit change detection for the checkbox view and its children.\n this._changeDetectorRef.detectChanges()\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n writeValue(value: any) {\n this.checked = !!value\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n registerOnChange(fn: (value: any) => void) {\n this._controlValueAccessorChangeFn = fn\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n registerOnTouched(fn: any) {\n this._onTouched = fn\n }\n\n // Implemented as part of ControlValueAccessor.\n /** @ignore */\n setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled\n }\n\n /** @ignore */\n _getAriaChecked(): 'true' | 'false' | 'mixed' {\n return this.checked ? 'true' : this.indeterminate ? 'mixed' : 'false'\n }\n\n /** @ignore */\n private _emitChangeEvent() {\n const event = new TheSeamCheckboxChange(this, this.checked)\n\n this._controlValueAccessorChangeFn(this.checked)\n this.change.emit(event)\n }\n\n /** Toggles the `checked` state of the checkbox. */\n toggle(): void {\n this.checked = !this.checked\n }\n\n /**\n * Event handler for checkbox input element.\n * Toggles checked state if element is not disabled.\n * Do not toggle on (change) event since IE doesn't fire change event when\n * indeterminate checkbox is clicked.\n * @ignore\n */\n _onInputClick(event: Event) {\n // If resetIndeterminate is false, and the current state is indeterminate, do nothing on click\n if (!this.disabled) {\n // When user manually click on the checkbox, `indeterminate` is set to false.\n if (this.indeterminate) {\n Promise.resolve().then(() => {\n this._indeterminate = false\n this.indeterminateChange.emit(this._indeterminate)\n })\n }\n\n this.toggle()\n\n // Emit our custom change event if the native input emitted one.\n // It is important to only emit it, if the native input triggered one, because\n // we don't want to trigger a change event, when the `checked` variable changes for example.\n this._emitChangeEvent()\n }\n }\n\n /** Focuses the checkbox. */\n focus(origin: FocusOrigin = 'keyboard', options?: FocusOptions): void {\n if (!this._inputElement) {\n return\n }\n this._focusMonitor.focusVia(this._inputElement, origin, options)\n }\n\n /** @ignore */\n _onInteractionEvent(event: Event) {\n // We always have to stop propagation on the change event.\n // Otherwise the change event, from the input element, will bubble up and\n // emit its event object to the `change` output.\n event.stopPropagation()\n }\n\n /**\n * Syncs the indeterminate value with the checkbox DOM node.\n *\n * We sync `indeterminate` directly on the DOM node, because in Ivy the check for whether a\n * property is supported on an element boils down to `if (propName in element)`. Domino's\n * HTMLInputElement doesn't have an `indeterminate` property so Ivy will warn during\n * server-side rendering.\n * @ignore\n */\n private _syncIndeterminate(value: boolean) {\n const nativeCheckbox = this._inputElement\n\n if (nativeCheckbox) {\n nativeCheckbox.nativeElement.indeterminate = value\n }\n }\n}\n","<input\n #input\n type=\"checkbox\"\n class=\"custom-control-input\"\n [id]=\"inputId\"\n [required]=\"required\"\n [checked]=\"checked\"\n [attr.value]=\"value\"\n [disabled]=\"disabled\"\n [attr.name]=\"name\"\n [tabIndex]=\"tabIndex\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-checked]=\"_getAriaChecked()\"\n (change)=\"_onInteractionEvent($event)\"\n (click)=\"_onInputClick($event)\"\n/>\n<label\n #checkboxLabel\n class=\"custom-control-label\"\n [attr.for]=\"inputId\"\n (cdkObserveContent)=\"_onLabelTextChange()\"\n>\n <ng-content></ng-content>\n</label>\n","import { ObserversModule } from '@angular/cdk/observers'\nimport { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\n\nimport { TheSeamCheckboxComponent } from './checkbox.component'\n\n/** @deprecated */\n@NgModule({\n imports: [TheSeamCheckboxComponent],\n exports: [TheSeamCheckboxComponent],\n})\nexport class TheSeamCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAcM,MAAO,sBAAuB,SAAQ,gBAAgB,CAAA;AAC1D,IAAA,OAAO,YAAY,GAAG,eAAe;;IAGrC,OAAO,IAAI,CACT,OAAsC,EAAA;AAEtC,QAAA,OAAO,IAAI,gBAAgB,CAAC,sBAAsB,EAAE,OAAO;aACxD,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,KACnD,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAA,EAAG,KAAK,CAAA,CAAE,CAAC;aAE5D,SAAS,CAAC,eAAe,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,KACtD,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CACxD;IACL;AAEO,IAAA,MAAM,KAAK,GAAA;AAChB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,eAAe,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC;IAC1D;AAEO,IAAA,MAAM,OAAO,GAAA;AAClB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,eAAe,EAAE,EAAE,YAAY,CAAC,MAAM,CAAC;IAC5D;AAEA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A;kBAJjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,OAAO,EAAE,CAAC,wBAAwB,CAAC;AACpC,iBAAA;;;ACVD;;AAEG;;;;"}
@@ -24,17 +24,17 @@ class ConfirmDialogComponent {
24
24
  }
25
25
  return undefined;
26
26
  }
27
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
28
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.1", type: ConfirmDialogComponent, isStandalone: true, selector: "seam-confirm-dialog", inputs: { message: "message", alertMessage: "alertMessage", alertType: "alertType", template: "template" }, ngImport: i0, template: "<seam-modal-body>\n <ng-container *ngIf=\"tpl; else messageTpl\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: tplContext }\"></ng-container>\n </ng-container>\n\n <ng-template #messageTpl>\n <h5>{{ message }}</h5>\n\n <div *ngIf=\"alertMessage\" class=\"alert {{ alertType ? 'alert-' + alertType : '' }} mb-0\">\n {{ alertMessage }}\n </div>\n </ng-template>\n\n</seam-modal-body>\n<seam-modal-footer>\n <button class=\"btn btn-primary\" seamModalClose=\"confirm\">Yes</button>\n <button class=\"btn btn-lightgray\" data-dismiss=\"modal\" seamModalClose=\"cancel\" seamAutoFocus>No</button>\n</seam-modal-footer>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TheSeamModalModule }, { kind: "component", type: i1.ModalBodyComponent, selector: "seam-modal-body" }, { kind: "component", type: i1.ModalFooterComponent, selector: "seam-modal-footer" }, { kind: "directive", type: i1.ModalCloseDirective, selector: "button[seamModalClose]", inputs: ["type", "aria-label", "seamModalClose", "seamModalNext", "seamModalNextConfig"], exportAs: ["seamModalClose"] }, { kind: "directive", type: TheSeamAutoFocusDirective, selector: "[seamAutoFocus]", inputs: ["seamAutoFocus"], exportAs: ["seamAutoFocus"] }] });
27
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
28
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: ConfirmDialogComponent, isStandalone: true, selector: "seam-confirm-dialog", inputs: { message: "message", alertMessage: "alertMessage", alertType: "alertType", template: "template" }, ngImport: i0, template: "<seam-modal-body>\n <ng-container *ngIf=\"tpl; else messageTpl\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: tplContext }\"\n ></ng-container>\n </ng-container>\n\n <ng-template #messageTpl>\n <h5>{{ message }}</h5>\n\n <div\n *ngIf=\"alertMessage\"\n class=\"alert {{ alertType ? 'alert-' + alertType : '' }} mb-0\"\n >\n {{ alertMessage }}\n </div>\n </ng-template>\n</seam-modal-body>\n<seam-modal-footer>\n <button class=\"btn btn-primary\" seamModalClose=\"confirm\">Yes</button>\n <button\n class=\"btn btn-lightgray\"\n data-dismiss=\"modal\"\n seamModalClose=\"cancel\"\n seamAutoFocus\n >\n No\n </button>\n</seam-modal-footer>\n", styles: [""], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TheSeamModalModule }, { kind: "component", type: i1.ModalBodyComponent, selector: "seam-modal-body" }, { kind: "component", type: i1.ModalFooterComponent, selector: "seam-modal-footer" }, { kind: "directive", type: i1.ModalCloseDirective, selector: "button[seamModalClose]", inputs: ["type", "aria-label", "seamModalClose", "seamModalNext", "seamModalNextConfig"], exportAs: ["seamModalClose"] }, { kind: "directive", type: TheSeamAutoFocusDirective, selector: "[seamAutoFocus]", inputs: ["seamAutoFocus"], exportAs: ["seamAutoFocus"] }] });
29
29
  }
30
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
31
31
  type: Component,
32
32
  args: [{ selector: 'seam-confirm-dialog', imports: [
33
33
  NgIf,
34
34
  NgTemplateOutlet,
35
35
  TheSeamModalModule,
36
36
  TheSeamAutoFocusDirective,
37
- ], template: "<seam-modal-body>\n <ng-container *ngIf=\"tpl; else messageTpl\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: tplContext }\"></ng-container>\n </ng-container>\n\n <ng-template #messageTpl>\n <h5>{{ message }}</h5>\n\n <div *ngIf=\"alertMessage\" class=\"alert {{ alertType ? 'alert-' + alertType : '' }} mb-0\">\n {{ alertMessage }}\n </div>\n </ng-template>\n\n</seam-modal-body>\n<seam-modal-footer>\n <button class=\"btn btn-primary\" seamModalClose=\"confirm\">Yes</button>\n <button class=\"btn btn-lightgray\" data-dismiss=\"modal\" seamModalClose=\"cancel\" seamAutoFocus>No</button>\n</seam-modal-footer>\n" }]
37
+ ], template: "<seam-modal-body>\n <ng-container *ngIf=\"tpl; else messageTpl\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: tplContext }\"\n ></ng-container>\n </ng-container>\n\n <ng-template #messageTpl>\n <h5>{{ message }}</h5>\n\n <div\n *ngIf=\"alertMessage\"\n class=\"alert {{ alertType ? 'alert-' + alertType : '' }} mb-0\"\n >\n {{ alertMessage }}\n </div>\n </ng-template>\n</seam-modal-body>\n<seam-modal-footer>\n <button class=\"btn btn-primary\" seamModalClose=\"confirm\">Yes</button>\n <button\n class=\"btn btn-lightgray\"\n data-dismiss=\"modal\"\n seamModalClose=\"cancel\"\n seamAutoFocus\n >\n No\n </button>\n</seam-modal-footer>\n" }]
38
38
  }], propDecorators: { message: [{
39
39
  type: Input
40
40
  }], alertMessage: [{
@@ -77,10 +77,10 @@ class SeamConfirmDialogService {
77
77
  }
78
78
  return modalRef;
79
79
  }
80
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: SeamConfirmDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
81
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: SeamConfirmDialogService, providedIn: 'root' });
80
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: SeamConfirmDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
81
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: SeamConfirmDialogService, providedIn: 'root' });
82
82
  }
83
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: SeamConfirmDialogService, decorators: [{
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: SeamConfirmDialogService, decorators: [{
84
84
  type: Injectable,
85
85
  args: [{ providedIn: 'root' }]
86
86
  }] });
@@ -94,7 +94,9 @@ class ConfirmClickDirective {
94
94
  seamConfirmTpl;
95
95
  seamConfirmDisabled = false;
96
96
  seamConfirmClick = new EventEmitter();
97
- get _confirmClickActiveCss() { return !!this._modalRef; }
97
+ get _confirmClickActiveCss() {
98
+ return !!this._modalRef;
99
+ }
98
100
  _onClick(event) {
99
101
  if (this.seamConfirmDisabled) {
100
102
  if (this._modalRef) {
@@ -106,7 +108,7 @@ class ConfirmClickDirective {
106
108
  return;
107
109
  }
108
110
  this._modalRef = this._confirmService.open(this.seamConfirmMsg || '', this.seamConfirmAlert || undefined, this.seamConfirmTpl || undefined);
109
- this._modalRef.afterClosed().subscribe(result => {
111
+ this._modalRef.afterClosed().subscribe((result) => {
110
112
  if (result === 'confirm') {
111
113
  this.seamConfirmClick.emit(result);
112
114
  }
@@ -118,19 +120,21 @@ class ConfirmClickDirective {
118
120
  this._modalRef.close();
119
121
  }
120
122
  }
121
- get modalRef() { return this._modalRef; }
123
+ get modalRef() {
124
+ return this._modalRef;
125
+ }
122
126
  close() {
123
127
  if (this._modalRef) {
124
128
  this._modalRef.close();
125
129
  }
126
130
  }
127
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: ConfirmClickDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
128
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.1", type: ConfirmClickDirective, isStandalone: true, selector: "[seamConfirmClick]", inputs: { seamConfirmMsg: "seamConfirmMsg", seamConfirmAlert: "seamConfirmAlert", seamConfirmTpl: "seamConfirmTpl", seamConfirmDisabled: "seamConfirmDisabled" }, outputs: { seamConfirmClick: "seamConfirmClick" }, host: { listeners: { "click": "_onClick($event)" }, properties: { "class.lib-confirm-click-active": "this._confirmClickActiveCss" } }, exportAs: ["seamConfirmClick"], ngImport: i0 });
131
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: ConfirmClickDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
132
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.6", type: ConfirmClickDirective, isStandalone: true, selector: "[seamConfirmClick]", inputs: { seamConfirmMsg: "seamConfirmMsg", seamConfirmAlert: "seamConfirmAlert", seamConfirmTpl: "seamConfirmTpl", seamConfirmDisabled: "seamConfirmDisabled" }, outputs: { seamConfirmClick: "seamConfirmClick" }, host: { listeners: { "click": "_onClick($event)" }, properties: { "class.lib-confirm-click-active": "this._confirmClickActiveCss" } }, exportAs: ["seamConfirmClick"], ngImport: i0 });
129
133
  }
130
134
  __decorate([
131
135
  InputBoolean()
132
136
  ], ConfirmClickDirective.prototype, "seamConfirmDisabled", void 0);
133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: ConfirmClickDirective, decorators: [{
137
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: ConfirmClickDirective, decorators: [{
134
138
  type: Directive,
135
139
  args: [{
136
140
  selector: '[seamConfirmClick]',
@@ -155,23 +159,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImpor
155
159
  }] } });
156
160
 
157
161
  class TheSeamConfirmDialogModule {
158
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: TheSeamConfirmDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
159
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: TheSeamConfirmDialogModule, imports: [ConfirmDialogComponent,
160
- ConfirmClickDirective], exports: [ConfirmDialogComponent,
161
- ConfirmClickDirective] });
162
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: TheSeamConfirmDialogModule, imports: [ConfirmDialogComponent] });
162
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamConfirmDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
163
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: TheSeamConfirmDialogModule, imports: [ConfirmDialogComponent, ConfirmClickDirective], exports: [ConfirmDialogComponent, ConfirmClickDirective] });
164
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamConfirmDialogModule, imports: [ConfirmDialogComponent] });
163
165
  }
164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: TheSeamConfirmDialogModule, decorators: [{
166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamConfirmDialogModule, decorators: [{
165
167
  type: NgModule,
166
168
  args: [{
167
- imports: [
168
- ConfirmDialogComponent,
169
- ConfirmClickDirective,
170
- ],
171
- exports: [
172
- ConfirmDialogComponent,
173
- ConfirmClickDirective,
174
- ],
169
+ imports: [ConfirmDialogComponent, ConfirmClickDirective],
170
+ exports: [ConfirmDialogComponent, ConfirmClickDirective],
175
171
  }]
176
172
  }] });
177
173
 
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-confirm-dialog.mjs","sources":["../../../projects/ui-common/confirm-dialog/confirm-dialog.component.ts","../../../projects/ui-common/confirm-dialog/confirm-dialog.component.html","../../../projects/ui-common/confirm-dialog/confirm-dialog.service.ts","../../../projects/ui-common/confirm-dialog/confirm-click.directive.ts","../../../projects/ui-common/confirm-dialog/confirm-dialog.module.ts","../../../projects/ui-common/confirm-dialog/theseam-ui-common-confirm-dialog.ts"],"sourcesContent":["import { NgIf, NgTemplateOutlet } from '@angular/common'\nimport { Component, Input, TemplateRef } from '@angular/core'\n\nimport { TheSeamModalModule } from '@theseam/ui-common/modal'\nimport { ThemeTypes } from '@theseam/ui-common/models'\nimport { TheSeamAutoFocusDirective } from '@theseam/ui-common/shared'\n\n@Component({\n selector: 'seam-confirm-dialog',\n templateUrl: './confirm-dialog.component.html',\n styleUrls: ['./confirm-dialog.component.scss'],\n imports: [\n NgIf,\n NgTemplateOutlet,\n TheSeamModalModule,\n TheSeamAutoFocusDirective,\n ],\n})\nexport class ConfirmDialogComponent {\n\n @Input() message: string | undefined | null = 'Are you sure you want to continue?'\n @Input() alertMessage: string | undefined | null\n @Input() alertType: ThemeTypes | undefined | null = 'warning'\n @Input() template: TemplateRef<any> | { template: TemplateRef<any>, context: any } | undefined | null\n\n get tpl(): TemplateRef<any> | null | undefined {\n if (this.template && 'template' in this.template) {\n return this.template.template\n }\n\n return this.template\n }\n\n get tplContext(): any {\n if (this.template && 'context' in this.template) {\n return this.template.context\n }\n\n return undefined\n }\n\n}\n","<seam-modal-body>\n <ng-container *ngIf=\"tpl; else messageTpl\">\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"{ $implicit: tplContext }\"></ng-container>\n </ng-container>\n\n <ng-template #messageTpl>\n <h5>{{ message }}</h5>\n\n <div *ngIf=\"alertMessage\" class=\"alert {{ alertType ? 'alert-' + alertType : '' }} mb-0\">\n {{ alertMessage }}\n </div>\n </ng-template>\n\n</seam-modal-body>\n<seam-modal-footer>\n <button class=\"btn btn-primary\" seamModalClose=\"confirm\">Yes</button>\n <button class=\"btn btn-lightgray\" data-dismiss=\"modal\" seamModalClose=\"cancel\" seamAutoFocus>No</button>\n</seam-modal-footer>\n","import { inject, Injectable, TemplateRef } from '@angular/core'\n\nimport { Modal, ModalRef } from '@theseam/ui-common/modal'\nimport { ThemeTypes } from '@theseam/ui-common/models'\n\nimport { ConfirmDialogComponent } from './confirm-dialog.component'\n\n@Injectable({ providedIn: 'root' })\nexport class SeamConfirmDialogService {\n\n private readonly _modal = inject(Modal, { optional: true })\n\n public open(\n message?: string,\n alert?: string | { message: string, type: ThemeTypes },\n template?: TemplateRef<any> | { template: TemplateRef<any>, context: any }\n ): ModalRef<ConfirmDialogComponent, 'confirm' | undefined> {\n if (!this._modal) {\n // TODO: This shouldn't be necessary after refactoring modal service.\n throw new Error('Modal service not provided. Please import TheSeamModalModule in your application.')\n }\n\n const modalRef = this._modal.openFromComponent(ConfirmDialogComponent)\n\n if (!modalRef.componentInstance) {\n throw new Error('ConfirmDialogComponent not created.')\n }\n\n const comp: ConfirmDialogComponent = modalRef.componentInstance\n\n if (message) {\n comp.message = message\n }\n\n if (alert) {\n if (typeof alert === 'string') {\n comp.alertMessage = alert\n } else if (alert.message && alert.type) {\n comp.alertMessage = alert.message\n comp.alertType = alert.type\n } else {\n throw new Error('Invalid alert argument.')\n }\n }\n\n if (template) {\n comp.template = template\n }\n\n return modalRef\n }\n\n}\n","import { BooleanInput } from '@angular/cdk/coercion'\nimport { Directive, EventEmitter, HostBinding, HostListener, inject, Input, OnDestroy, Output, TemplateRef } from '@angular/core'\n\nimport { InputBoolean } from '@theseam/ui-common/core'\nimport { ModalRef } from '@theseam/ui-common/modal'\nimport { ThemeTypes } from '@theseam/ui-common/models'\n\nimport { ConfirmDialogComponent } from './confirm-dialog.component'\nimport { SeamConfirmDialogService } from './confirm-dialog.service'\n\n@Directive({\n selector: '[seamConfirmClick]',\n exportAs: 'seamConfirmClick',\n})\nexport class ConfirmClickDirective implements OnDestroy {\n static ngAcceptInputType_seamConfirmDisabled: BooleanInput\n\n private readonly _confirmService = inject(SeamConfirmDialogService)\n\n private _modalRef: ModalRef<ConfirmDialogComponent, 'confirm' | undefined> | undefined\n\n @Input() seamConfirmMsg: string | undefined | null\n @Input() seamConfirmAlert: string | { message: string, type: ThemeTypes } | undefined | null\n @Input() seamConfirmTpl: TemplateRef<any> | { template: TemplateRef<any>, context: any } | undefined | null\n @Input() @InputBoolean() seamConfirmDisabled = false\n\n @Output() seamConfirmClick = new EventEmitter<'confirm'>()\n\n @HostBinding('class.lib-confirm-click-active')\n get _confirmClickActiveCss() { return !!this._modalRef }\n\n @HostListener('click', [ '$event' ])\n _onClick(event: any) {\n if (this.seamConfirmDisabled) {\n if (this._modalRef) {\n this._modalRef.close()\n this._modalRef = undefined\n }\n }\n\n if (this._modalRef) { return }\n\n this._modalRef = this._confirmService.open(this.seamConfirmMsg || '', this.seamConfirmAlert || undefined, this.seamConfirmTpl || undefined)\n\n this._modalRef.afterClosed().subscribe(result => {\n if (result === 'confirm') {\n this.seamConfirmClick.emit(result)\n }\n\n this._modalRef = undefined\n })\n }\n\n ngOnDestroy() {\n if (this._modalRef) {\n this._modalRef.close()\n }\n }\n\n get modalRef() { return this._modalRef }\n\n public close() {\n if (this._modalRef) {\n this._modalRef.close()\n }\n }\n\n}\n","import { NgModule } from '@angular/core'\n\nimport { ConfirmClickDirective } from './confirm-click.directive'\nimport { ConfirmDialogComponent } from './confirm-dialog.component'\n\n@NgModule({\n imports: [\n ConfirmDialogComponent,\n ConfirmClickDirective,\n ],\n exports: [\n ConfirmDialogComponent,\n ConfirmClickDirective,\n ],\n})\nexport class TheSeamConfirmDialogModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAkBa,sBAAsB,CAAA;IAExB,OAAO,GAA8B,oCAAoC;AACzE,IAAA,YAAY;IACZ,SAAS,GAAkC,SAAS;AACpD,IAAA,QAAQ;AAEjB,IAAA,IAAI,GAAG,GAAA;QACL,IAAI,IAAI,CAAC,QAAQ,IAAI,UAAU,IAAI,IAAI,CAAC,QAAQ,EAAE;AAChD,YAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ;QAC/B;QAEA,OAAO,IAAI,CAAC,QAAQ;IACtB;AAEA,IAAA,IAAI,UAAU,GAAA;QACZ,IAAI,IAAI,CAAC,QAAQ,IAAI,SAAS,IAAI,IAAI,CAAC,QAAQ,EAAE;AAC/C,YAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO;QAC9B;AAEA,QAAA,OAAO,SAAS;IAClB;uGArBW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAtB,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,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
1
+ {"version":3,"file":"theseam-ui-common-confirm-dialog.mjs","sources":["../../../projects/ui-common/confirm-dialog/confirm-dialog.component.ts","../../../projects/ui-common/confirm-dialog/confirm-dialog.component.html","../../../projects/ui-common/confirm-dialog/confirm-dialog.service.ts","../../../projects/ui-common/confirm-dialog/confirm-click.directive.ts","../../../projects/ui-common/confirm-dialog/confirm-dialog.module.ts","../../../projects/ui-common/confirm-dialog/theseam-ui-common-confirm-dialog.ts"],"sourcesContent":["import { NgIf, NgTemplateOutlet } from '@angular/common'\nimport { Component, Input, TemplateRef } from '@angular/core'\n\nimport { TheSeamModalModule } from '@theseam/ui-common/modal'\nimport { ThemeTypes } from '@theseam/ui-common/models'\nimport { TheSeamAutoFocusDirective } from '@theseam/ui-common/shared'\n\n@Component({\n selector: 'seam-confirm-dialog',\n templateUrl: './confirm-dialog.component.html',\n styleUrls: ['./confirm-dialog.component.scss'],\n imports: [\n NgIf,\n NgTemplateOutlet,\n TheSeamModalModule,\n TheSeamAutoFocusDirective,\n ],\n})\nexport class ConfirmDialogComponent {\n @Input() message: string | undefined | null =\n 'Are you sure you want to continue?'\n @Input() alertMessage: string | undefined | null\n @Input() alertType: ThemeTypes | undefined | null = 'warning'\n @Input() template:\n | TemplateRef<any>\n | { template: TemplateRef<any>; context: any }\n | undefined\n | null\n\n get tpl(): TemplateRef<any> | null | undefined {\n if (this.template && 'template' in this.template) {\n return this.template.template\n }\n\n return this.template\n }\n\n get tplContext(): any {\n if (this.template && 'context' in this.template) {\n return this.template.context\n }\n\n return undefined\n }\n}\n","<seam-modal-body>\n <ng-container *ngIf=\"tpl; else messageTpl\">\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: tplContext }\"\n ></ng-container>\n </ng-container>\n\n <ng-template #messageTpl>\n <h5>{{ message }}</h5>\n\n <div\n *ngIf=\"alertMessage\"\n class=\"alert {{ alertType ? 'alert-' + alertType : '' }} mb-0\"\n >\n {{ alertMessage }}\n </div>\n </ng-template>\n</seam-modal-body>\n<seam-modal-footer>\n <button class=\"btn btn-primary\" seamModalClose=\"confirm\">Yes</button>\n <button\n class=\"btn btn-lightgray\"\n data-dismiss=\"modal\"\n seamModalClose=\"cancel\"\n seamAutoFocus\n >\n No\n </button>\n</seam-modal-footer>\n","import { inject, Injectable, TemplateRef } from '@angular/core'\n\nimport { Modal, ModalRef } from '@theseam/ui-common/modal'\nimport { ThemeTypes } from '@theseam/ui-common/models'\n\nimport { ConfirmDialogComponent } from './confirm-dialog.component'\n\n@Injectable({ providedIn: 'root' })\nexport class SeamConfirmDialogService {\n private readonly _modal = inject(Modal, { optional: true })\n\n public open(\n message?: string,\n alert?: string | { message: string; type: ThemeTypes },\n template?: TemplateRef<any> | { template: TemplateRef<any>; context: any },\n ): ModalRef<ConfirmDialogComponent, 'confirm' | undefined> {\n if (!this._modal) {\n // TODO: This shouldn't be necessary after refactoring modal service.\n throw new Error(\n 'Modal service not provided. Please import TheSeamModalModule in your application.',\n )\n }\n\n const modalRef = this._modal.openFromComponent(ConfirmDialogComponent)\n\n if (!modalRef.componentInstance) {\n throw new Error('ConfirmDialogComponent not created.')\n }\n\n const comp: ConfirmDialogComponent = modalRef.componentInstance\n\n if (message) {\n comp.message = message\n }\n\n if (alert) {\n if (typeof alert === 'string') {\n comp.alertMessage = alert\n } else if (alert.message && alert.type) {\n comp.alertMessage = alert.message\n comp.alertType = alert.type\n } else {\n throw new Error('Invalid alert argument.')\n }\n }\n\n if (template) {\n comp.template = template\n }\n\n return modalRef\n }\n}\n","import { BooleanInput } from '@angular/cdk/coercion'\nimport {\n Directive,\n EventEmitter,\n HostBinding,\n HostListener,\n inject,\n Input,\n OnDestroy,\n Output,\n TemplateRef,\n} from '@angular/core'\n\nimport { InputBoolean } from '@theseam/ui-common/core'\nimport { ModalRef } from '@theseam/ui-common/modal'\nimport { ThemeTypes } from '@theseam/ui-common/models'\n\nimport { ConfirmDialogComponent } from './confirm-dialog.component'\nimport { SeamConfirmDialogService } from './confirm-dialog.service'\n\n@Directive({\n selector: '[seamConfirmClick]',\n exportAs: 'seamConfirmClick',\n})\nexport class ConfirmClickDirective implements OnDestroy {\n static ngAcceptInputType_seamConfirmDisabled: BooleanInput\n\n private readonly _confirmService = inject(SeamConfirmDialogService)\n\n private _modalRef:\n | ModalRef<ConfirmDialogComponent, 'confirm' | undefined>\n | undefined\n\n @Input() seamConfirmMsg: string | undefined | null\n @Input() seamConfirmAlert:\n | string\n | { message: string; type: ThemeTypes }\n | undefined\n | null\n @Input() seamConfirmTpl:\n | TemplateRef<any>\n | { template: TemplateRef<any>; context: any }\n | undefined\n | null\n @Input() @InputBoolean() seamConfirmDisabled = false\n\n @Output() seamConfirmClick = new EventEmitter<'confirm'>()\n\n @HostBinding('class.lib-confirm-click-active')\n get _confirmClickActiveCss() {\n return !!this._modalRef\n }\n\n @HostListener('click', ['$event'])\n _onClick(event: any) {\n if (this.seamConfirmDisabled) {\n if (this._modalRef) {\n this._modalRef.close()\n this._modalRef = undefined\n }\n }\n\n if (this._modalRef) {\n return\n }\n\n this._modalRef = this._confirmService.open(\n this.seamConfirmMsg || '',\n this.seamConfirmAlert || undefined,\n this.seamConfirmTpl || undefined,\n )\n\n this._modalRef.afterClosed().subscribe((result) => {\n if (result === 'confirm') {\n this.seamConfirmClick.emit(result)\n }\n\n this._modalRef = undefined\n })\n }\n\n ngOnDestroy() {\n if (this._modalRef) {\n this._modalRef.close()\n }\n }\n\n get modalRef() {\n return this._modalRef\n }\n\n public close() {\n if (this._modalRef) {\n this._modalRef.close()\n }\n }\n}\n","import { NgModule } from '@angular/core'\n\nimport { ConfirmClickDirective } from './confirm-click.directive'\nimport { ConfirmDialogComponent } from './confirm-dialog.component'\n\n@NgModule({\n imports: [ConfirmDialogComponent, ConfirmClickDirective],\n exports: [ConfirmDialogComponent, ConfirmClickDirective],\n})\nexport class TheSeamConfirmDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mapp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AAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,YAH3B,sBAAsB,CAAA,EAAA,CAAA;;2FAGrB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAJtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;AACxD,oBAAA,OAAO,EAAE,CAAC,sBAAsB,EAAE,qBAAqB,CAAC;AACzD,iBAAA;;;ACRD;;AAEG;;;;"}
@@ -20,10 +20,16 @@ import { Observable } from 'rxjs';
20
20
  function mixinDisabled(base) {
21
21
  return class extends base {
22
22
  _disabled = false;
23
- get disabled() { return this._disabled; }
24
- set disabled(value) { this._disabled = coerceBooleanProperty(value); }
23
+ get disabled() {
24
+ return this._disabled;
25
+ }
26
+ set disabled(value) {
27
+ this._disabled = coerceBooleanProperty(value);
28
+ }
25
29
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
26
- constructor(...args) { super(...args); }
30
+ constructor(...args) {
31
+ super(...args);
32
+ }
27
33
  };
28
34
  }
29
35
 
@@ -49,7 +55,7 @@ function mixinInitialized(base) {
49
55
  * Observable stream that emits when the directive initializes. If already initialized, the
50
56
  * subscriber is stored to be notified once _markInitialized is called.
51
57
  */
52
- initialized = new Observable(subscriber => {
58
+ initialized = new Observable((subscriber) => {
53
59
  // If initialized, immediately notify the subscriber. Otherwise store the subscriber to notify
54
60
  // when _markInitialized is called.
55
61
  if (this._isInitialized) {
@@ -62,7 +68,9 @@ function mixinInitialized(base) {
62
68
  }
63
69
  });
64
70
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
65
- constructor(...args) { super(...args); }
71
+ constructor(...args) {
72
+ super(...args);
73
+ }
66
74
  /**
67
75
  * Marks the state as initialized and notifies pending subscribers. Should be called at the end
68
76
  * of ngOnInit.
@@ -91,7 +99,9 @@ function mixinInitialized(base) {
91
99
  function mixinSize(base, sizePrefix, defaultSize) {
92
100
  return class extends base {
93
101
  _size;
94
- get size() { return this._size; }
102
+ get size() {
103
+ return this._size;
104
+ }
95
105
  set size(value) {
96
106
  const themePalette = value || defaultSize;
97
107
  if (themePalette !== this._size) {
@@ -123,7 +133,9 @@ function mixinSize(base, sizePrefix, defaultSize) {
123
133
  function mixinTabIndex(base, defaultTabIndex = 0) {
124
134
  return class extends base {
125
135
  _tabIndex = defaultTabIndex;
126
- get tabIndex() { return this.disabled ? -1 : this._tabIndex; }
136
+ get tabIndex() {
137
+ return this.disabled ? -1 : this._tabIndex;
138
+ }
127
139
  set tabIndex(value) {
128
140
  // If the specified tabIndex value is null or undefined, fall back to the default value.
129
141
  this._tabIndex = value != null ? value : defaultTabIndex;
@@ -139,7 +151,9 @@ function mixinTabIndex(base, defaultTabIndex = 0) {
139
151
  function mixinTheme(base, themePrefix, defaultTheme) {
140
152
  return class extends base {
141
153
  _theme;
142
- get theme() { return this._theme; }
154
+ get theme() {
155
+ return this._theme;
156
+ }
143
157
  set theme(value) {
144
158
  const themePalette = value || defaultTheme;
145
159
  if (themePalette !== this._theme) {
@@ -164,10 +178,16 @@ function mixinTheme(base, themePrefix, defaultTheme) {
164
178
  function mixinActive(base) {
165
179
  return class extends base {
166
180
  _active = false;
167
- get active() { return this._active; }
168
- set active(value) { this._active = coerceBooleanProperty(value); }
181
+ get active() {
182
+ return this._active;
183
+ }
184
+ set active(value) {
185
+ this._active = coerceBooleanProperty(value);
186
+ }
169
187
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
170
- constructor(...args) { super(...args); }
188
+ constructor(...args) {
189
+ super(...args);
190
+ }
171
191
  };
172
192
  }
173
193
 
@@ -1 +1 @@
1
- {"version":3,"file":"theseam-ui-common-core.mjs","sources":["../../../projects/ui-common/core/common-behaviors/constructor.ts","../../../projects/ui-common/core/common-behaviors/disabled.ts","../../../projects/ui-common/core/common-behaviors/initialized.ts","../../../projects/ui-common/core/common-behaviors/size.ts","../../../projects/ui-common/core/common-behaviors/tabindex.ts","../../../projects/ui-common/core/common-behaviors/theme.ts","../../../projects/ui-common/core/common-behaviors/active.ts","../../../projects/ui-common/core/input-decorators/input-boolean.decorator.ts","../../../projects/ui-common/core/input-decorators/input-number.decorator.ts","../../../projects/ui-common/core/theseam-ui-common-core.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** @docs-private */\nexport type Constructor<T> = new(...args: any[]) => T\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { Constructor } from './constructor'\n\n/** @docs-private */\nexport interface CanDisable {\n /** Whether the component is disabled. */\n disabled: boolean\n}\n\n/** @docs-private */\nexport type CanDisableCtor = Constructor<CanDisable>\n\n/** Mixin to augment a directive with a `disabled` property. */\nexport function mixinDisabled<T extends Constructor<object>>(base: T): CanDisableCtor & T {\n return class extends base {\n private _disabled = false\n\n get disabled() { return this._disabled }\n set disabled(value: any) { this._disabled = coerceBooleanProperty(value) }\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor(...args: any[]) { super(...args) }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { Observable, Subscriber } from 'rxjs'\nimport { Constructor } from './constructor'\n\n/**\n * Mixin that adds an initialized property to a directive which, when subscribed to, will emit a\n * value once markInitialized has been called, which should be done during the ngOnInit function.\n * If the subscription is made after it has already been marked as initialized, then it will trigger\n * an emit immediately.\n * @docs-private\n */\nexport interface HasInitialized {\n /** Stream that emits once during the directive/component's ngOnInit. */\n initialized: Observable<void>\n\n /**\n * Sets the state as initialized and must be called during ngOnInit to notify subscribers that\n * the directive has been initialized.\n * @docs-private\n */\n _markInitialized: () => void\n}\n\n/** @docs-private */\nexport type HasInitializedCtor = Constructor<HasInitialized>\n\n/** Mixin to augment a directive with an initialized property that will emits when ngOnInit ends. */\nexport function mixinInitialized<T extends Constructor<object>>(base: T):\n HasInitializedCtor & T {\n return class extends base {\n /** Whether this directive has been marked as initialized. */\n _isInitialized = false\n\n /**\n * List of subscribers that subscribed before the directive was initialized. Should be notified\n * during _markInitialized. Set to null after pending subscribers are notified, and should\n * not expect to be populated after.\n */\n _pendingSubscribers: Subscriber<void>[] | null = []\n\n /**\n * Observable stream that emits when the directive initializes. If already initialized, the\n * subscriber is stored to be notified once _markInitialized is called.\n */\n initialized = new Observable<void>(subscriber => {\n // If initialized, immediately notify the subscriber. Otherwise store the subscriber to notify\n // when _markInitialized is called.\n if (this._isInitialized) {\n this._notifySubscriber(subscriber)\n } else {\n if (this._pendingSubscribers) {\n this._pendingSubscribers.push(subscriber)\n }\n }\n })\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor(...args: any[]) { super(...args) }\n\n /**\n * Marks the state as initialized and notifies pending subscribers. Should be called at the end\n * of ngOnInit.\n * @docs-private\n */\n _markInitialized(): void {\n if (this._isInitialized) {\n throw Error('This directive has already been marked as initialized and ' +\n 'should not be called twice.')\n }\n\n this._isInitialized = true\n\n if (this._pendingSubscribers) {\n this._pendingSubscribers.forEach(this._notifySubscriber)\n }\n this._pendingSubscribers = null\n }\n\n /** Emits and completes the subscriber stream (should only emit once). */\n _notifySubscriber(subscriber: Subscriber<void>): void {\n subscriber.next()\n subscriber.complete()\n }\n }\n}\n","import { SizePrefixes, SizeTypes } from '@theseam/ui-common/models'\n\nimport { Constructor } from './constructor'\nimport { HasElementRef } from './element-ref'\n\nexport interface CanSize {\n size: SizeTypes | undefined\n}\n\nexport type CanSizeCtor = Constructor<CanSize>\n\n/** Mixin to augment a directive with a `size` property. */\nexport function mixinSize<T extends Constructor<HasElementRef>>(\n base: T, sizePrefix: SizePrefixes, defaultSize?: SizeTypes): CanSizeCtor & T {\n return class extends base {\n private _size: SizeTypes | undefined\n\n get size(): SizeTypes | undefined { return this._size }\n set size(value: SizeTypes | undefined) {\n const themePalette = value || defaultSize\n\n if (themePalette !== this._size) {\n if (this._size) {\n this._elementRef.nativeElement.classList.remove(`${sizePrefix}-${this._size}`)\n }\n if (themePalette) {\n this._elementRef.nativeElement.classList.add(`${sizePrefix}-${themePalette}`)\n }\n\n this._size = themePalette\n }\n }\n\n constructor(...args: any[]) {\n super(...args)\n\n // Set the default size that can be specified from the mixin.\n this.size = defaultSize\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { Constructor } from './constructor'\nimport { CanDisable } from './disabled'\n\n/** @docs-private */\nexport interface HasTabIndex {\n /** Tabindex of the component. */\n tabIndex: number\n}\n\n/** @docs-private */\nexport type HasTabIndexCtor = Constructor<HasTabIndex>\n\n/** Mixin to augment a directive with a `tabIndex` property. */\nexport function mixinTabIndex<T extends Constructor<CanDisable>>(base: T, defaultTabIndex = 0)\n : HasTabIndexCtor & T {\n return class extends base {\n private _tabIndex: number = defaultTabIndex\n\n get tabIndex(): number { return this.disabled ? -1 : this._tabIndex }\n set tabIndex(value: number) {\n // If the specified tabIndex value is null or undefined, fall back to the default value.\n this._tabIndex = value != null ? value : defaultTabIndex\n }\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor(...args: any[]) {\n super(...args)\n }\n }\n}\n","import { OutlineThemeTypes, ThemePrefixes, ThemeTypes } from '@theseam/ui-common/models'\n\nimport { Constructor } from './constructor'\nimport { HasElementRef } from './element-ref'\n\nexport interface CanTheme {\n /** Theme palette for the component. */\n theme: ThemeTypes | OutlineThemeTypes | undefined\n}\n\nexport type CanThemeCtor = Constructor<CanTheme>\n\n/** Mixin to augment a directive with a `theme` property. */\nexport function mixinTheme<T extends Constructor<HasElementRef>>(\n base: T, themePrefix: ThemePrefixes, defaultTheme?: ThemeTypes | OutlineThemeTypes): CanThemeCtor & T {\n return class extends base {\n private _theme: ThemeTypes | OutlineThemeTypes | undefined\n\n get theme(): ThemeTypes | OutlineThemeTypes | undefined { return this._theme }\n set theme(value: ThemeTypes | OutlineThemeTypes | undefined) {\n const themePalette = value || defaultTheme\n\n if (themePalette !== this._theme) {\n if (this._theme) {\n this._elementRef.nativeElement.classList.remove(`${themePrefix}-${this._theme}`)\n }\n if (themePalette) {\n this._elementRef.nativeElement.classList.add(`${themePrefix}-${themePalette}`)\n }\n\n this._theme = themePalette\n }\n }\n\n constructor(...args: any[]) {\n super(...args)\n\n // Set the default theme that can be specified from the mixin.\n this.theme = defaultTheme\n }\n }\n}\n","import { coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { Constructor } from './constructor'\n\nexport interface CanBeActive {\n /** Whether the component is active. */\n active: boolean\n}\n\nexport type CanBeActiveCtor = Constructor<CanBeActive>\n\n/** Mixin to augment a directive with a `disabled` property. */\nexport function mixinActive<T extends Constructor<object>>(base: T): CanBeActiveCtor & T {\n return class extends base {\n private _active = false\n\n get active() { return this._active }\n set active(value: any) { this._active = coerceBooleanProperty(value) }\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor(...args: any[]) { super(...args) }\n }\n}\n","import { coerceBooleanProperty } from '@angular/cdk/coercion'\n\n/**\n * Use with `@Input()` to coerse the input to a boolean.\n *\n * Example:\n * ```ts\n * @Component({ template: '' })\n * class {\n * @Input() @InputBoolean() b: boolean\n * }\n * ```\n */\nexport function InputBoolean() {\n const cachedValueKey = Symbol('Cached boolean input value')\n return function(\n target: any,\n propertyKey: string,\n descriptor?: PropertyDescriptor\n ) {\n Object.defineProperty(target, propertyKey, {\n set(value: boolean) {\n this[cachedValueKey] = coerceBooleanProperty(value)\n },\n get() {\n return this[cachedValueKey]\n },\n })\n }\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion'\n\n/**\n * Use with `@Input()` to coerse the input to a number.\n *\n * Example:\n * ```ts\n * @Component({ template: '' })\n * class {\n * @Input() @InputNumber() b: number\n * }\n * ```\n */\nexport function InputNumber<TFallback>(fallback?: TFallback) {\n const cachedValueKey = Symbol('Cached input number value')\n return function(\n target: any,\n propertyKey: string,\n descriptor?: PropertyDescriptor\n ) {\n Object.defineProperty(target, propertyKey, {\n set(value: number) {\n this[cachedValueKey] = coerceNumberProperty(value, fallback)\n },\n get() {\n return this[cachedValueKey]\n },\n })\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;;AAMG;;ACNH;;;;;;AAMG;AAcH;AACM,SAAU,aAAa,CAAgC,IAAO,EAAA;IAClE,OAAO,cAAc,IAAI,CAAA;QACf,SAAS,GAAG,KAAK;QAEzB,IAAI,QAAQ,KAAK,OAAO,IAAI,CAAC,SAAS,CAAA,CAAC;AACvC,QAAA,IAAI,QAAQ,CAAC,KAAU,EAAA,EAAI,IAAI,CAAC,SAAS,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAA,CAAC;;QAGzE,WAAA,CAAY,GAAG,IAAW,EAAA,EAAI,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA,CAAC;KAC9C;AACH;;AC/BA;;;;;;AAMG;AA2BH;AACM,SAAU,gBAAgB,CAAgC,IAAO,EAAA;IAErE,OAAO,cAAc,IAAI,CAAA;;QAEvB,cAAc,GAAG,KAAK;AAEtB;;;;AAIG;QACH,mBAAmB,GAA8B,EAAE;AAEnD;;;AAGG;AACH,QAAA,WAAW,GAAG,IAAI,UAAU,CAAO,UAAU,IAAG;;;AAG9C,YAAA,IAAI,IAAI,CAAC,cAAc,EAAE;AACvB,gBAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;YACpC;iBAAO;AACL,gBAAA,IAAI,IAAI,CAAC,mBAAmB,EAAE;AAC5B,oBA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;;;;;;;;;AAUG;AACG,SAAU,WAAW,CAAY,QAAoB,EAAA;AACzD,IAAA,MAAM,cAAc,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAC1D,IAAA,OAAO,UACL,MAAW,EACX,WAAmB,EACnB,UAA+B,EAAA;AAE/B,QAAA,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE;AACzC,YAAA,GAAG,CAAC,KAAa,EAAA;gBACf,IAAI,CAAC,cAAc,CAAC,GAAG,oBAAoB,CAAC,KAAK,EAAE,QAAQ,CAAC;YAC9D,CAAC;YACD,GAAG,GAAA;AACD,gBAAA,OAAO,IAAI,CAAC,cAAc,CAAC;YAC7B,CAAC;AACF,SAAA,CAAC;AACJ,IAAA,CAAC;AACH;;AC7BA;;AAEG;;;;"}
1
+ {"version":3,"file":"theseam-ui-common-core.mjs","sources":["../../../projects/ui-common/core/common-behaviors/constructor.ts","../../../projects/ui-common/core/common-behaviors/disabled.ts","../../../projects/ui-common/core/common-behaviors/initialized.ts","../../../projects/ui-common/core/common-behaviors/size.ts","../../../projects/ui-common/core/common-behaviors/tabindex.ts","../../../projects/ui-common/core/common-behaviors/theme.ts","../../../projects/ui-common/core/common-behaviors/active.ts","../../../projects/ui-common/core/input-decorators/input-boolean.decorator.ts","../../../projects/ui-common/core/input-decorators/input-number.decorator.ts","../../../projects/ui-common/core/theseam-ui-common-core.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/** @docs-private */\nexport type Constructor<T> = new (...args: any[]) => T\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { Constructor } from './constructor'\n\n/** @docs-private */\nexport interface CanDisable {\n /** Whether the component is disabled. */\n disabled: boolean\n}\n\n/** @docs-private */\nexport type CanDisableCtor = Constructor<CanDisable>\n\n/** Mixin to augment a directive with a `disabled` property. */\nexport function mixinDisabled<T extends Constructor<object>>(\n base: T,\n): CanDisableCtor & T {\n return class extends base {\n private _disabled = false\n\n get disabled() {\n return this._disabled\n }\n set disabled(value: any) {\n this._disabled = coerceBooleanProperty(value)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor(...args: any[]) {\n super(...args)\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { Observable, Subscriber } from 'rxjs'\nimport { Constructor } from './constructor'\n\n/**\n * Mixin that adds an initialized property to a directive which, when subscribed to, will emit a\n * value once markInitialized has been called, which should be done during the ngOnInit function.\n * If the subscription is made after it has already been marked as initialized, then it will trigger\n * an emit immediately.\n * @docs-private\n */\nexport interface HasInitialized {\n /** Stream that emits once during the directive/component's ngOnInit. */\n initialized: Observable<void>\n\n /**\n * Sets the state as initialized and must be called during ngOnInit to notify subscribers that\n * the directive has been initialized.\n * @docs-private\n */\n _markInitialized: () => void\n}\n\n/** @docs-private */\nexport type HasInitializedCtor = Constructor<HasInitialized>\n\n/** Mixin to augment a directive with an initialized property that will emits when ngOnInit ends. */\nexport function mixinInitialized<T extends Constructor<object>>(\n base: T,\n): HasInitializedCtor & T {\n return class extends base {\n /** Whether this directive has been marked as initialized. */\n _isInitialized = false\n\n /**\n * List of subscribers that subscribed before the directive was initialized. Should be notified\n * during _markInitialized. Set to null after pending subscribers are notified, and should\n * not expect to be populated after.\n */\n _pendingSubscribers: Subscriber<void>[] | null = []\n\n /**\n * Observable stream that emits when the directive initializes. If already initialized, the\n * subscriber is stored to be notified once _markInitialized is called.\n */\n initialized = new Observable<void>((subscriber) => {\n // If initialized, immediately notify the subscriber. Otherwise store the subscriber to notify\n // when _markInitialized is called.\n if (this._isInitialized) {\n this._notifySubscriber(subscriber)\n } else {\n if (this._pendingSubscribers) {\n this._pendingSubscribers.push(subscriber)\n }\n }\n })\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor(...args: any[]) {\n super(...args)\n }\n\n /**\n * Marks the state as initialized and notifies pending subscribers. Should be called at the end\n * of ngOnInit.\n * @docs-private\n */\n _markInitialized(): void {\n if (this._isInitialized) {\n throw Error(\n 'This directive has already been marked as initialized and ' +\n 'should not be called twice.',\n )\n }\n\n this._isInitialized = true\n\n if (this._pendingSubscribers) {\n this._pendingSubscribers.forEach(this._notifySubscriber)\n }\n this._pendingSubscribers = null\n }\n\n /** Emits and completes the subscriber stream (should only emit once). */\n _notifySubscriber(subscriber: Subscriber<void>): void {\n subscriber.next()\n subscriber.complete()\n }\n }\n}\n","import { SizePrefixes, SizeTypes } from '@theseam/ui-common/models'\n\nimport { Constructor } from './constructor'\nimport { HasElementRef } from './element-ref'\n\nexport interface CanSize {\n size: SizeTypes | undefined\n}\n\nexport type CanSizeCtor = Constructor<CanSize>\n\n/** Mixin to augment a directive with a `size` property. */\nexport function mixinSize<T extends Constructor<HasElementRef>>(\n base: T,\n sizePrefix: SizePrefixes,\n defaultSize?: SizeTypes,\n): CanSizeCtor & T {\n return class extends base {\n private _size: SizeTypes | undefined\n\n get size(): SizeTypes | undefined {\n return this._size\n }\n set size(value: SizeTypes | undefined) {\n const themePalette = value || defaultSize\n\n if (themePalette !== this._size) {\n if (this._size) {\n this._elementRef.nativeElement.classList.remove(\n `${sizePrefix}-${this._size}`,\n )\n }\n if (themePalette) {\n this._elementRef.nativeElement.classList.add(\n `${sizePrefix}-${themePalette}`,\n )\n }\n\n this._size = themePalette\n }\n }\n\n constructor(...args: any[]) {\n super(...args)\n\n // Set the default size that can be specified from the mixin.\n this.size = defaultSize\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { Constructor } from './constructor'\nimport { CanDisable } from './disabled'\n\n/** @docs-private */\nexport interface HasTabIndex {\n /** Tabindex of the component. */\n tabIndex: number\n}\n\n/** @docs-private */\nexport type HasTabIndexCtor = Constructor<HasTabIndex>\n\n/** Mixin to augment a directive with a `tabIndex` property. */\nexport function mixinTabIndex<T extends Constructor<CanDisable>>(\n base: T,\n defaultTabIndex = 0,\n): HasTabIndexCtor & T {\n return class extends base {\n private _tabIndex: number = defaultTabIndex\n\n get tabIndex(): number {\n return this.disabled ? -1 : this._tabIndex\n }\n set tabIndex(value: number) {\n // If the specified tabIndex value is null or undefined, fall back to the default value.\n this._tabIndex = value != null ? value : defaultTabIndex\n }\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor(...args: any[]) {\n super(...args)\n }\n }\n}\n","import {\n OutlineThemeTypes,\n ThemePrefixes,\n ThemeTypes,\n} from '@theseam/ui-common/models'\n\nimport { Constructor } from './constructor'\nimport { HasElementRef } from './element-ref'\n\nexport interface CanTheme {\n /** Theme palette for the component. */\n theme: ThemeTypes | OutlineThemeTypes | undefined\n}\n\nexport type CanThemeCtor = Constructor<CanTheme>\n\n/** Mixin to augment a directive with a `theme` property. */\nexport function mixinTheme<T extends Constructor<HasElementRef>>(\n base: T,\n themePrefix: ThemePrefixes,\n defaultTheme?: ThemeTypes | OutlineThemeTypes,\n): CanThemeCtor & T {\n return class extends base {\n private _theme: ThemeTypes | OutlineThemeTypes | undefined\n\n get theme(): ThemeTypes | OutlineThemeTypes | undefined {\n return this._theme\n }\n set theme(value: ThemeTypes | OutlineThemeTypes | undefined) {\n const themePalette = value || defaultTheme\n\n if (themePalette !== this._theme) {\n if (this._theme) {\n this._elementRef.nativeElement.classList.remove(\n `${themePrefix}-${this._theme}`,\n )\n }\n if (themePalette) {\n this._elementRef.nativeElement.classList.add(\n `${themePrefix}-${themePalette}`,\n )\n }\n\n this._theme = themePalette\n }\n }\n\n constructor(...args: any[]) {\n super(...args)\n\n // Set the default theme that can be specified from the mixin.\n this.theme = defaultTheme\n }\n }\n}\n","import { coerceBooleanProperty } from '@angular/cdk/coercion'\nimport { Constructor } from './constructor'\n\nexport interface CanBeActive {\n /** Whether the component is active. */\n active: boolean\n}\n\nexport type CanBeActiveCtor = Constructor<CanBeActive>\n\n/** Mixin to augment a directive with a `disabled` property. */\nexport function mixinActive<T extends Constructor<object>>(\n base: T,\n): CanBeActiveCtor & T {\n return class extends base {\n private _active = false\n\n get active() {\n return this._active\n }\n set active(value: any) {\n this._active = coerceBooleanProperty(value)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n constructor(...args: any[]) {\n super(...args)\n }\n }\n}\n","import { coerceBooleanProperty } from '@angular/cdk/coercion'\n\n/**\n * Use with `@Input()` to coerse the input to a boolean.\n *\n * Example:\n * ```ts\n * @Component({ template: '' })\n * class {\n * @Input() @InputBoolean() b: boolean\n * }\n * ```\n */\nexport function InputBoolean() {\n const cachedValueKey = Symbol('Cached boolean input value')\n return function (\n target: any,\n propertyKey: string,\n descriptor?: PropertyDescriptor,\n ) {\n Object.defineProperty(target, propertyKey, {\n set(value: boolean) {\n this[cachedValueKey] = coerceBooleanProperty(value)\n },\n get() {\n return this[cachedValueKey]\n },\n })\n }\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion'\n\n/**\n * Use with `@Input()` to coerse the input to a number.\n *\n * Example:\n * ```ts\n * @Component({ template: '' })\n * class {\n * @Input() @InputNumber() b: number\n * }\n * ```\n */\nexport function InputNumber<TFallback>(fallback?: TFallback) {\n const cachedValueKey = Symbol('Cached input number value')\n return function (\n target: any,\n propertyKey: string,\n descriptor?: PropertyDescriptor,\n ) {\n Object.defineProperty(target, propertyKey, {\n set(value: number) {\n this[cachedValueKey] = coerceNumberProperty(value, fallback)\n },\n get() {\n return this[cachedValueKey]\n },\n })\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;;AAMG;;ACNH;;;;;;AAMG;AAcH;AACM,S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C;AACH;;AC7BA;;AAEG;;;;"}
@@ -24,17 +24,17 @@ class CSVDataExporter {
24
24
  // NOTE: `out` should not be passed as a string, but the fileDataFromBuffer
25
25
  // function happens to works with a string. When the build issue about the
26
26
  // function argument is figured out then this should be fixed.
27
- return from(fileDataFromBuffer(out))
27
+ return (from(fileDataFromBuffer(out))
28
28
  // return from(fileDataFromBuffer(Buffer.from(out)))
29
- .pipe(tap(fileData => {
29
+ .pipe(tap((fileData) => {
30
30
  FileSaver.saveAs(fileData.blob, `Export.csv`);
31
- }), mapTo(true));
31
+ }), mapTo(true)));
32
32
  }));
33
33
  }
34
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: CSVDataExporter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
35
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: CSVDataExporter });
34
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: CSVDataExporter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
35
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: CSVDataExporter });
36
36
  }
37
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: CSVDataExporter, decorators: [{
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: CSVDataExporter, decorators: [{
38
38
  type: Injectable
39
39
  }] });
40
40
 
@@ -46,38 +46,37 @@ class XLSXDataExporter {
46
46
  // TODO: Fix typing for the dynamic imports
47
47
  return wrapIntoObservable(import('xlsx')).pipe(switchMap((XLSX) => {
48
48
  const ws = XLSX.utils.json_to_sheet(data);
49
- const wb = { Sheets: { 'data': ws }, SheetNames: ['data'] };
49
+ const wb = { Sheets: { data: ws }, SheetNames: ['data'] };
50
50
  const excelBuffer = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });
51
- return from(fileDataFromBuffer(Buffer.from(excelBuffer)))
52
- .pipe(tap(fileData => {
51
+ return from(fileDataFromBuffer(Buffer.from(excelBuffer))).pipe(tap((fileData) => {
53
52
  FileSaver.saveAs(fileData.blob, `Export.xlsx`);
54
53
  }), mapTo(true));
55
54
  }));
56
55
  }
57
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: XLSXDataExporter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
58
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: XLSXDataExporter });
56
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: XLSXDataExporter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
57
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: XLSXDataExporter });
59
58
  }
60
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: XLSXDataExporter, decorators: [{
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: XLSXDataExporter, decorators: [{
61
60
  type: Injectable
62
61
  }] });
63
62
 
64
63
  class TheSeamDataExporterModule {
65
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: TheSeamDataExporterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
66
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: TheSeamDataExporterModule });
67
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: TheSeamDataExporterModule, providers: [
64
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamDataExporterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
65
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: TheSeamDataExporterModule });
66
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamDataExporterModule, providers: [
68
67
  { provide: THESEAM_DATA_EXPORTER, useClass: CSVDataExporter, multi: true },
69
- { provide: THESEAM_DATA_EXPORTER, useClass: XLSXDataExporter, multi: true }
68
+ { provide: THESEAM_DATA_EXPORTER, useClass: XLSXDataExporter, multi: true },
70
69
  ] });
71
70
  }
72
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: TheSeamDataExporterModule, decorators: [{
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: TheSeamDataExporterModule, decorators: [{
73
72
  type: NgModule,
74
73
  args: [{
75
74
  declarations: [],
76
75
  imports: [],
77
76
  providers: [
78
77
  { provide: THESEAM_DATA_EXPORTER, useClass: CSVDataExporter, multi: true },
79
- { provide: THESEAM_DATA_EXPORTER, useClass: XLSXDataExporter, multi: true }
80
- ]
78
+ { provide: THESEAM_DATA_EXPORTER, useClass: XLSXDataExporter, multi: true },
79
+ ],
81
80
  }]
82
81
  }] });
83
82
 
@@ -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>('TheSeamDataExporter')\n\nexport function exportOperator<T>(exportFn: IDataExporterFunction) {\n return (source$: Observable<T[]>) =>\n 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 { fileDataFromBuffer, wrapIntoObservable } from '@theseam/ui-common/utils'\n\nimport { IDataExporter } from '../data-exporter'\n\n@Injectable()\nexport class CSVDataExporter implements IDataExporter {\n\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 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 { fileDataFromBuffer, wrapIntoObservable } from '@theseam/ui-common/utils'\n\nimport { IDataExporter } from '../data-exporter'\n\n@Injectable()\nexport class XLSXDataExporter implements IDataExporter {\n\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)))\n .pipe(\n tap(fileData => {\n FileSaver.saveAs(fileData.blob, `Export.xlsx`)\n }),\n mapTo(true)\n )\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,CAAgB,qBAAqB;AAEtF,SAAU,cAAc,CAAI,QAA+B,EAAA;AAC/D,IAAA,OAAO,CAAC,OAAwB,KAC9B,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACrC;;MC9Ba,eAAe,CAAA;IAE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AA,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;AAC1E;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/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;gBACf,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAA,UAAA,CAAY,CAAC;YAC/C,CAAC,CAAC,EACF,KAAK,CAAC,IAAI,CAAC,C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