@theseam/ui-common 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/widget/public-api.mjs +5 -1
- package/esm2020/widget/widget/widget.component.mjs +18 -4
- package/esm2020/widget/widget-token.mjs +2 -1
- package/esm2020/widget/widget.models.mjs +2 -0
- package/fesm2015/theseam-ui-common-widget.mjs +114 -99
- package/fesm2015/theseam-ui-common-widget.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-widget.mjs +112 -97
- package/fesm2020/theseam-ui-common-widget.mjs.map +1 -1
- package/package.json +1 -1
- package/widget/public-api.d.ts +4 -0
- package/widget/widget/widget.component.d.ts +5 -3
- package/widget/widget-token.d.ts +3 -1
- package/widget/widget.models.d.ts +7 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, Directive, Optional, Inject, Input, Component, ChangeDetectionStrategy, NgModule, ViewEncapsulation, HostBinding, ContentChild, EventEmitter, Output,
|
|
3
|
+
import { InjectionToken, Directive, Optional, Inject, Input, Injectable, Component, ChangeDetectionStrategy, NgModule, ViewEncapsulation, HostBinding, ContentChild, EventEmitter, Output, isDevMode } from '@angular/core';
|
|
4
4
|
import { Subject, BehaviorSubject, of, tap as tap$1, takeUntil as takeUntil$1, throwError } from 'rxjs';
|
|
5
5
|
import { auditTime, takeUntil, take, switchMap, filter, map, tap } from 'rxjs/operators';
|
|
6
6
|
import { getClosestWidgetCdkDrag, hasProperty } from '@theseam/ui-common/utils';
|
|
7
7
|
import * as i1 from '@angular/cdk/drag-drop';
|
|
8
8
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
9
|
+
import * as i1$1 from '@theseam/ui-common/services';
|
|
9
10
|
import * as i2 from '@angular/common';
|
|
10
11
|
import { CommonModule } from '@angular/common';
|
|
11
12
|
import * as i6 from '@theseam/ui-common/buttons';
|
|
12
13
|
import { TheSeamButtonsModule } from '@theseam/ui-common/buttons';
|
|
13
14
|
import { mixinTheme, mixinActive, mixinDisabled, InputBoolean, mixinTabIndex } from '@theseam/ui-common/core';
|
|
14
|
-
import * as i1$
|
|
15
|
+
import * as i1$2 from '@angular/cdk/a11y';
|
|
15
16
|
import * as i3 from '@theseam/ui-common/icon';
|
|
16
17
|
import { TheSeamIconModule } from '@theseam/ui-common/icon';
|
|
17
18
|
import { __decorate } from 'tslib';
|
|
18
|
-
import * as i1$
|
|
19
|
+
import * as i1$3 from '@theseam/ui-common/table';
|
|
19
20
|
import { TheSeamTableModule } from '@theseam/ui-common/table';
|
|
20
21
|
import { TheSeamTableCellTypesModule } from '@theseam/ui-common/table-cell-types';
|
|
21
22
|
import { trigger, transition, style, animate, state } from '@angular/animations';
|
|
22
23
|
import { faCog, faAngleDown } from '@fortawesome/free-solid-svg-icons';
|
|
23
|
-
import * as i1$3 from '@theseam/ui-common/services';
|
|
24
24
|
import * as i3$1 from '@fortawesome/angular-fontawesome';
|
|
25
25
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
26
26
|
import * as i5 from '@theseam/ui-common/loading';
|
|
@@ -201,6 +201,84 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
201
201
|
}]
|
|
202
202
|
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
203
203
|
|
|
204
|
+
const CURRENT_WIDGET_PREFERENCES_VERSION = 1;
|
|
205
|
+
const EMPTY_WIDGET_PREFERENCES = {
|
|
206
|
+
version: 1,
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const THESEAM_WIDGET_PREFERENCES_ACCESSOR = new InjectionToken('TheSeamWidgetPreferencesAccessor');
|
|
210
|
+
|
|
211
|
+
// TODO: Rethink this. I originally implemented this to be shared widget's then
|
|
212
|
+
// changed it to be per widget, for the accessor injection.
|
|
213
|
+
// @Injectable({ providedIn: 'root' })
|
|
214
|
+
class WidgetPreferencesService {
|
|
215
|
+
constructor(_preferencesManager, _prefsAccessor) {
|
|
216
|
+
this._preferencesManager = _preferencesManager;
|
|
217
|
+
this._prefsAccessor = _prefsAccessor;
|
|
218
|
+
this._pendingPatches = {};
|
|
219
|
+
}
|
|
220
|
+
isPatchPending(preferenceKey) {
|
|
221
|
+
return this._pendingPatches[preferenceKey] && this._pendingPatches[preferenceKey].length > 0;
|
|
222
|
+
}
|
|
223
|
+
isPending(preferenceKey) {
|
|
224
|
+
return this._preferencesManager.isPending(preferenceKey);
|
|
225
|
+
}
|
|
226
|
+
isLoaded(preferenceKey) {
|
|
227
|
+
return this._preferencesManager.isLoaded(preferenceKey);
|
|
228
|
+
}
|
|
229
|
+
preferences(preferenceKey) {
|
|
230
|
+
if (!this._prefsAccessor) {
|
|
231
|
+
return of(JSON.parse(JSON.stringify(EMPTY_WIDGET_PREFERENCES)));
|
|
232
|
+
}
|
|
233
|
+
return this._preferencesManager.preferences(preferenceKey, this._prefsAccessor, EMPTY_WIDGET_PREFERENCES).pipe(map(prefs => {
|
|
234
|
+
if (this._isValidPreferences(prefs)) {
|
|
235
|
+
return prefs;
|
|
236
|
+
}
|
|
237
|
+
throw Error(`Preferences for key '${preferenceKey}' is not a valid widget preferences.`);
|
|
238
|
+
}));
|
|
239
|
+
}
|
|
240
|
+
refresh(preferenceKey) {
|
|
241
|
+
this._preferencesManager.refresh(preferenceKey);
|
|
242
|
+
}
|
|
243
|
+
patchPreferences(preferenceKey, preferences) {
|
|
244
|
+
if (!this._prefsAccessor) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
if (!this._pendingPatches[preferenceKey]) {
|
|
248
|
+
this._pendingPatches[preferenceKey] = [];
|
|
249
|
+
}
|
|
250
|
+
if (this._pendingPatches[preferenceKey].length > 0) {
|
|
251
|
+
this._pendingPatches[preferenceKey].push(preferences);
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
this._pendingPatches[preferenceKey].push(preferences);
|
|
255
|
+
this.preferences(preferenceKey).pipe(take(1), map(prefs => {
|
|
256
|
+
const pendingPatches = this._pendingPatches[preferenceKey];
|
|
257
|
+
this._pendingPatches[preferenceKey] = [];
|
|
258
|
+
const newPrefs = pendingPatches.reduce((acc, patch) => {
|
|
259
|
+
return { ...acc, ...patch };
|
|
260
|
+
}, prefs); // Typescript isn't recognizing that 'version' is included in the initial value.
|
|
261
|
+
if (!this._isValidPreferences(newPrefs)) {
|
|
262
|
+
throw Error(`Attempted to patch preferences for key '${preferenceKey}' with invalid preferences.`);
|
|
263
|
+
}
|
|
264
|
+
this._preferencesManager.update(preferenceKey, newPrefs);
|
|
265
|
+
}), tap(() => this.refresh(preferenceKey))).subscribe();
|
|
266
|
+
}
|
|
267
|
+
_isValidPreferences(prefs) {
|
|
268
|
+
return prefs.version === CURRENT_WIDGET_PREFERENCES_VERSION;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
WidgetPreferencesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetPreferencesService, deps: [{ token: i1$1.TheSeamPreferencesManagerService }, { token: THESEAM_WIDGET_PREFERENCES_ACCESSOR, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
272
|
+
WidgetPreferencesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetPreferencesService });
|
|
273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetPreferencesService, decorators: [{
|
|
274
|
+
type: Injectable
|
|
275
|
+
}], ctorParameters: function () { return [{ type: i1$1.TheSeamPreferencesManagerService }, { type: undefined, decorators: [{
|
|
276
|
+
type: Optional
|
|
277
|
+
}, {
|
|
278
|
+
type: Inject,
|
|
279
|
+
args: [THESEAM_WIDGET_PREFERENCES_ACCESSOR]
|
|
280
|
+
}] }]; } });
|
|
281
|
+
|
|
204
282
|
class WidgetButtonGroupComponent {
|
|
205
283
|
}
|
|
206
284
|
WidgetButtonGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -497,11 +575,11 @@ class WidgetListGroupItemActionableBase extends WidgetListGroupItemBase {
|
|
|
497
575
|
this._focusMonitor.stopMonitoring(this._elementRef);
|
|
498
576
|
}
|
|
499
577
|
}
|
|
500
|
-
WidgetListGroupItemActionableBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetListGroupItemActionableBase, deps: [{ token: i0.ElementRef }, { token: i1$
|
|
578
|
+
WidgetListGroupItemActionableBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetListGroupItemActionableBase, deps: [{ token: i0.ElementRef }, { token: i1$2.FocusMonitor }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
501
579
|
WidgetListGroupItemActionableBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.7", type: WidgetListGroupItemActionableBase, usesInheritance: true, ngImport: i0 });
|
|
502
580
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetListGroupItemActionableBase, decorators: [{
|
|
503
581
|
type: Directive
|
|
504
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$
|
|
582
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$2.FocusMonitor }, { type: i0.Renderer2 }]; } });
|
|
505
583
|
const _WidgetListGroupItemBase = mixinActive(mixinTheme(mixinDisabled(WidgetListGroupItemBase), 'list-group-item'));
|
|
506
584
|
const _WidgetListGroupItemActionableBase = mixinActive(mixinTheme(mixinDisabled(WidgetListGroupItemActionableBase), 'list-group-item'));
|
|
507
585
|
class WidgetListGroupItemComponent extends _WidgetListGroupItemBase {
|
|
@@ -533,7 +611,7 @@ class WidgetListGroupItemButtonComponent extends _WidgetListGroupItemActionableB
|
|
|
533
611
|
}
|
|
534
612
|
ngOnDestroy() { super.ngOnDestroy(); }
|
|
535
613
|
}
|
|
536
|
-
WidgetListGroupItemButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetListGroupItemButtonComponent, deps: [{ token: i0.ElementRef }, { token: i1$
|
|
614
|
+
WidgetListGroupItemButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetListGroupItemButtonComponent, deps: [{ token: i0.ElementRef }, { token: i1$2.FocusMonitor }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
537
615
|
WidgetListGroupItemButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: WidgetListGroupItemButtonComponent, selector: "button[seam-widget-list-group-item],button[seamWidgetListGroupItem]", inputs: { disabled: "disabled", theme: "theme", active: "active", icon: "icon", iconClass: "iconClass", label: "label", secondaryIcon: "secondaryIcon", secondaryIconClass: "secondaryIconClass", secondaryIconTitle: "secondaryIconTitle", type: "type" }, host: { properties: { "attr.type": "type", "class.active": "active", "attr.aria-disabled": "disabled.toString()", "attr.disabled": "disabled || null" }, classAttribute: "list-group-item list-group-item-action" }, exportAs: ["seamWidgetListGroupItem"], usesInheritance: true, ngImport: i0, template: "<div class=\"d-flex flex-row\">\n <ng-container *ngIf=\"iconTpl; else noIconTpl\">\n <span class=\"pr-2\">\n <ng-container *ngTemplateOutlet=\"$any(iconTpl)\"></ng-container>\n </span>\n </ng-container>\n <ng-template #noIconTpl>\n <span class=\"pr-2\">\n <seam-icon *ngIf=\"icon\"\n [icon]=\"icon\"\n [iconClass]=\"iconClass\"\n iconType=\"borderless-styled-square\">\n </seam-icon>\n </span>\n </ng-template>\n\n <div class=\"d-flex flex-column justify-content-center flex-grow-1\">\n {{ label }}\n </div>\n\n <seam-icon *ngIf=\"secondaryIcon\"\n iconType=\"borderless-styled-square\"\n class=\"secondary-icon align-self-center ml-1\"\n [icon]=\"secondaryIcon\"\n [iconClass]=\"secondaryIconClass\"\n [title]=\"secondaryIconTitle\"\n size=\"lg\">\n </seam-icon>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.IconComponent, selector: "seam-icon", inputs: ["grayscaleOnDisable", "disabled", "iconClass", "icon", "size", "showDefaultOnError", "defaultIcon", "iconType"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
538
616
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetListGroupItemButtonComponent, decorators: [{
|
|
539
617
|
type: Component,
|
|
@@ -544,7 +622,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
544
622
|
'[attr.aria-disabled]': 'disabled.toString()',
|
|
545
623
|
'[attr.disabled]': 'disabled || null',
|
|
546
624
|
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"d-flex flex-row\">\n <ng-container *ngIf=\"iconTpl; else noIconTpl\">\n <span class=\"pr-2\">\n <ng-container *ngTemplateOutlet=\"$any(iconTpl)\"></ng-container>\n </span>\n </ng-container>\n <ng-template #noIconTpl>\n <span class=\"pr-2\">\n <seam-icon *ngIf=\"icon\"\n [icon]=\"icon\"\n [iconClass]=\"iconClass\"\n iconType=\"borderless-styled-square\">\n </seam-icon>\n </span>\n </ng-template>\n\n <div class=\"d-flex flex-column justify-content-center flex-grow-1\">\n {{ label }}\n </div>\n\n <seam-icon *ngIf=\"secondaryIcon\"\n iconType=\"borderless-styled-square\"\n class=\"secondary-icon align-self-center ml-1\"\n [icon]=\"secondaryIcon\"\n [iconClass]=\"secondaryIconClass\"\n [title]=\"secondaryIconTitle\"\n size=\"lg\">\n </seam-icon>\n</div>\n" }]
|
|
547
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$
|
|
625
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$2.FocusMonitor }, { type: i0.Renderer2 }]; }, propDecorators: { type: [{
|
|
548
626
|
type: Input
|
|
549
627
|
}] } });
|
|
550
628
|
class WidgetListGroupItemAnchorComponent extends _WidgetListGroupItemActionableBase {
|
|
@@ -563,7 +641,7 @@ class WidgetListGroupItemAnchorComponent extends _WidgetListGroupItemActionableB
|
|
|
563
641
|
}
|
|
564
642
|
}
|
|
565
643
|
}
|
|
566
|
-
WidgetListGroupItemAnchorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetListGroupItemAnchorComponent, deps: [{ token: i0.ElementRef }, { token: i1$
|
|
644
|
+
WidgetListGroupItemAnchorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetListGroupItemAnchorComponent, deps: [{ token: i0.ElementRef }, { token: i1$2.FocusMonitor }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
567
645
|
WidgetListGroupItemAnchorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: WidgetListGroupItemAnchorComponent, selector: "a[seam-widget-list-group-item],a[seamWidgetListGroupItem]", inputs: { disabled: "disabled", theme: "theme", active: "active", icon: "icon", iconClass: "iconClass", label: "label", secondaryIcon: "secondaryIcon", secondaryIconClass: "secondaryIconClass", secondaryIconTitle: "secondaryIconTitle", tabIndex: "tabIndex" }, host: { listeners: { "click": "_haltDisabledEvents($event)" }, properties: { "class.active": "active", "attr.tabindex": "disabled ? -1 : (tabIndex || 0)", "attr.aria-disabled": "disabled.toString()", "attr.disabled": "disabled || null" }, classAttribute: "list-group-item list-group-item-action" }, exportAs: ["seamWidgetListGroupItem"], usesInheritance: true, ngImport: i0, template: "<div class=\"d-flex flex-row\">\n <ng-container *ngIf=\"iconTpl; else noIconTpl\">\n <span class=\"pr-2\">\n <ng-container *ngTemplateOutlet=\"$any(iconTpl)\"></ng-container>\n </span>\n </ng-container>\n <ng-template #noIconTpl>\n <span class=\"pr-2\">\n <seam-icon *ngIf=\"icon\"\n [icon]=\"icon\"\n [iconClass]=\"iconClass\"\n iconType=\"borderless-styled-square\">\n </seam-icon>\n </span>\n </ng-template>\n\n <div class=\"d-flex flex-column justify-content-center flex-grow-1\">\n {{ label }}\n </div>\n\n <seam-icon *ngIf=\"secondaryIcon\"\n iconType=\"borderless-styled-square\"\n class=\"secondary-icon align-self-center ml-1\"\n [icon]=\"secondaryIcon\"\n [iconClass]=\"secondaryIconClass\"\n [title]=\"secondaryIconTitle\"\n size=\"lg\">\n </seam-icon>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.IconComponent, selector: "seam-icon", inputs: ["grayscaleOnDisable", "disabled", "iconClass", "icon", "size", "showDefaultOnError", "defaultIcon", "iconType"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
568
646
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetListGroupItemAnchorComponent, decorators: [{
|
|
569
647
|
type: Component,
|
|
@@ -575,7 +653,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
575
653
|
'[attr.disabled]': 'disabled || null',
|
|
576
654
|
'(click)': '_haltDisabledEvents($event)',
|
|
577
655
|
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"d-flex flex-row\">\n <ng-container *ngIf=\"iconTpl; else noIconTpl\">\n <span class=\"pr-2\">\n <ng-container *ngTemplateOutlet=\"$any(iconTpl)\"></ng-container>\n </span>\n </ng-container>\n <ng-template #noIconTpl>\n <span class=\"pr-2\">\n <seam-icon *ngIf=\"icon\"\n [icon]=\"icon\"\n [iconClass]=\"iconClass\"\n iconType=\"borderless-styled-square\">\n </seam-icon>\n </span>\n </ng-template>\n\n <div class=\"d-flex flex-column justify-content-center flex-grow-1\">\n {{ label }}\n </div>\n\n <seam-icon *ngIf=\"secondaryIcon\"\n iconType=\"borderless-styled-square\"\n class=\"secondary-icon align-self-center ml-1\"\n [icon]=\"secondaryIcon\"\n [iconClass]=\"secondaryIconClass\"\n [title]=\"secondaryIconTitle\"\n size=\"lg\">\n </seam-icon>\n</div>\n" }]
|
|
578
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$
|
|
656
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$2.FocusMonitor }, { type: i0.Renderer2 }]; }, propDecorators: { tabIndex: [{
|
|
579
657
|
type: Input
|
|
580
658
|
}] } });
|
|
581
659
|
|
|
@@ -642,7 +720,7 @@ class WidgetTableComponent {
|
|
|
642
720
|
}
|
|
643
721
|
}
|
|
644
722
|
WidgetTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
645
|
-
WidgetTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: WidgetTableComponent, selector: "seam-widget-table", inputs: { columns: "columns", rows: "rows", trackBy: "trackBy", size: "size", hasHeader: "hasHeader" }, outputs: { actionRefreshRequest: "actionRefreshRequest" }, ngImport: i0, template: "<seam-table\n [columns]=\"columns\"\n [rows]=\"rows\"\n [trackBy]=\"trackBy\"\n [size]=\"size\"\n [hasHeader]=\"hasHeader\"\n (actionRefreshRequest)=\"_actionRefreshRequest()\">\n</seam-table>\n", styles: [""], dependencies: [{ kind: "component", type: i1$
|
|
723
|
+
WidgetTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: WidgetTableComponent, selector: "seam-widget-table", inputs: { columns: "columns", rows: "rows", trackBy: "trackBy", size: "size", hasHeader: "hasHeader" }, outputs: { actionRefreshRequest: "actionRefreshRequest" }, ngImport: i0, template: "<seam-table\n [columns]=\"columns\"\n [rows]=\"rows\"\n [trackBy]=\"trackBy\"\n [size]=\"size\"\n [hasHeader]=\"hasHeader\"\n (actionRefreshRequest)=\"_actionRefreshRequest()\">\n</seam-table>\n", styles: [""], dependencies: [{ kind: "component", type: i1$3.TableComponent, selector: "seam-table", inputs: ["columns", "rows", "trackBy", "size", "hasHeader"], outputs: ["actionRefreshRequest"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
646
724
|
__decorate([
|
|
647
725
|
InputBoolean()
|
|
648
726
|
], WidgetTableComponent.prototype, "hasHeader", void 0);
|
|
@@ -779,12 +857,12 @@ class TheSeamWidgetTileBase {
|
|
|
779
857
|
return this._elementRef.nativeElement;
|
|
780
858
|
}
|
|
781
859
|
}
|
|
782
|
-
TheSeamWidgetTileBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamWidgetTileBase, deps: [{ token: i0.ElementRef }, { token: i1$
|
|
860
|
+
TheSeamWidgetTileBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamWidgetTileBase, deps: [{ token: i0.ElementRef }, { token: i1$2.FocusMonitor }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
783
861
|
TheSeamWidgetTileBase.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: TheSeamWidgetTileBase, selector: "ng-component", ngImport: i0, template: '', isInline: true });
|
|
784
862
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: TheSeamWidgetTileBase, decorators: [{
|
|
785
863
|
type: Component,
|
|
786
864
|
args: [{ template: '' }]
|
|
787
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$
|
|
865
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$2.FocusMonitor }, { type: i0.Renderer2 }]; } });
|
|
788
866
|
const _TheSeamWidgetTileMixinBase = mixinTabIndex(mixinDisabled(TheSeamWidgetTileBase));
|
|
789
867
|
// TODO: Should this component be split into separate components for button and anchor.
|
|
790
868
|
class WidgetTileComponent extends _TheSeamWidgetTileMixinBase {
|
|
@@ -830,7 +908,7 @@ class WidgetTileComponent extends _TheSeamWidgetTileMixinBase {
|
|
|
830
908
|
return this._elementRef.nativeElement.nodeName.toLowerCase() === 'a';
|
|
831
909
|
}
|
|
832
910
|
}
|
|
833
|
-
WidgetTileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetTileComponent, deps: [{ token: i0.ElementRef }, { token: i1$
|
|
911
|
+
WidgetTileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetTileComponent, deps: [{ token: i0.ElementRef }, { token: i1$2.FocusMonitor }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
834
912
|
WidgetTileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: WidgetTileComponent, selector: "seam-widget-tile, a[seam-widget-tile], button[seam-widget-tile]", inputs: { disabled: "disabled", type: "type", icon: "icon", grayscaleOnDisable: "grayscaleOnDisable", iconClass: "iconClass", iconType: "iconType", notificationIcon: "notificationIcon", notificationIconClass: "notificationIconClass" }, host: { properties: { "attr.type": "this._attrType", "class.btn": "this._btnCss", "class.disabled": "this._disabledCss", "attr.aria-disabled": "this._ariaDisabled", "attr.disabled": "this._attrDisabled", "attr.tabindex": "this._attrTabIndex" } }, queries: [{ propertyName: "secondaryIcon", first: true, predicate: WidgetTileSecondaryIconDirective, descendants: true, static: true }], exportAs: ["seamWidgetTile"], usesInheritance: true, ngImport: i0, template: "<div class=\"d-flex flex-row\">\n <div style=\"position: relative\">\n <seam-icon\n [icon]=\"icon\"\n [iconType]=\"iconType\"\n [iconClass]=\"iconClass\"\n [disabled]=\"disabled\">\n </seam-icon>\n\n <seam-icon *ngIf=\"notificationIcon\"\n class=\"widget-tile--notification-icon\"\n [icon]=\"notificationIcon\"\n iconType=\"image-fill\"\n [iconClass]=\"notificationIconClass\"\n [disabled]=\"disabled\">\n </seam-icon>\n </div>\n <div class=\"flex-grow-1 text-left pl-2\" style=\"margin: auto 0;\">\n <ng-content></ng-content>\n </div>\n <div *ngIf=\"secondaryIcon\">\n <ng-template [ngTemplateOutlet]=\"secondaryIcon.template\"></ng-template>\n </div>\n</div>\n", styles: ["seam-widget-tile,a[seam-widget-tile],button[seam-widget-tile]{display:block;width:100%;padding:4px;text-decoration:none;color:#212529;font-size:14px;font-weight:400;line-height:18px;border:1px solid #dee2e6;border-radius:10px;margin-bottom:.5rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}seam-widget-tile:hover,a[seam-widget-tile]:hover,button[seam-widget-tile]:hover{color:#212529;background-color:#f4f4f4;text-decoration:none}seam-widget-tile:focus,seam-widget-tile.focus,a[seam-widget-tile]:focus,a[seam-widget-tile].focus,button[seam-widget-tile]:focus,button[seam-widget-tile].focus{box-shadow:0 0 0 .2rem #357ebd40;outline:0}seam-widget-tile.disabled,seam-widget-tile:disabled,a[seam-widget-tile].disabled,a[seam-widget-tile]:disabled,button[seam-widget-tile].disabled,button[seam-widget-tile]:disabled{opacity:.65;pointer-events:none;cursor:default;filter:grayscale(1)}seam-widget-tile:last-child,a[seam-widget-tile]:last-child,button[seam-widget-tile]:last-child{margin-bottom:0}seam-widget-tile .widget-tile--notification-icon,a[seam-widget-tile] .widget-tile--notification-icon,button[seam-widget-tile] .widget-tile--notification-icon{position:absolute;bottom:-3px;right:-3px;width:15px!important;height:15px!important}seam-widget-tile seam-icon img[src$=\".svg\"],a[seam-widget-tile] seam-icon img[src$=\".svg\"],button[seam-widget-tile] seam-icon img[src$=\".svg\"]{height:100%}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.IconComponent, selector: "seam-icon", inputs: ["grayscaleOnDisable", "disabled", "iconClass", "icon", "size", "showDefaultOnError", "defaultIcon", "iconType"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
835
913
|
__decorate([
|
|
836
914
|
InputBoolean()
|
|
@@ -838,7 +916,7 @@ __decorate([
|
|
|
838
916
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetTileComponent, decorators: [{
|
|
839
917
|
type: Component,
|
|
840
918
|
args: [{ selector: 'seam-widget-tile, a[seam-widget-tile], button[seam-widget-tile]', inputs: ['disabled'], exportAs: 'seamWidgetTile', encapsulation: ViewEncapsulation.None, template: "<div class=\"d-flex flex-row\">\n <div style=\"position: relative\">\n <seam-icon\n [icon]=\"icon\"\n [iconType]=\"iconType\"\n [iconClass]=\"iconClass\"\n [disabled]=\"disabled\">\n </seam-icon>\n\n <seam-icon *ngIf=\"notificationIcon\"\n class=\"widget-tile--notification-icon\"\n [icon]=\"notificationIcon\"\n iconType=\"image-fill\"\n [iconClass]=\"notificationIconClass\"\n [disabled]=\"disabled\">\n </seam-icon>\n </div>\n <div class=\"flex-grow-1 text-left pl-2\" style=\"margin: auto 0;\">\n <ng-content></ng-content>\n </div>\n <div *ngIf=\"secondaryIcon\">\n <ng-template [ngTemplateOutlet]=\"secondaryIcon.template\"></ng-template>\n </div>\n</div>\n", styles: ["seam-widget-tile,a[seam-widget-tile],button[seam-widget-tile]{display:block;width:100%;padding:4px;text-decoration:none;color:#212529;font-size:14px;font-weight:400;line-height:18px;border:1px solid #dee2e6;border-radius:10px;margin-bottom:.5rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}seam-widget-tile:hover,a[seam-widget-tile]:hover,button[seam-widget-tile]:hover{color:#212529;background-color:#f4f4f4;text-decoration:none}seam-widget-tile:focus,seam-widget-tile.focus,a[seam-widget-tile]:focus,a[seam-widget-tile].focus,button[seam-widget-tile]:focus,button[seam-widget-tile].focus{box-shadow:0 0 0 .2rem #357ebd40;outline:0}seam-widget-tile.disabled,seam-widget-tile:disabled,a[seam-widget-tile].disabled,a[seam-widget-tile]:disabled,button[seam-widget-tile].disabled,button[seam-widget-tile]:disabled{opacity:.65;pointer-events:none;cursor:default;filter:grayscale(1)}seam-widget-tile:last-child,a[seam-widget-tile]:last-child,button[seam-widget-tile]:last-child{margin-bottom:0}seam-widget-tile .widget-tile--notification-icon,a[seam-widget-tile] .widget-tile--notification-icon,button[seam-widget-tile] .widget-tile--notification-icon{position:absolute;bottom:-3px;right:-3px;width:15px!important;height:15px!important}seam-widget-tile seam-icon img[src$=\".svg\"],a[seam-widget-tile] seam-icon img[src$=\".svg\"],button[seam-widget-tile] seam-icon img[src$=\".svg\"]{height:100%}\n"] }]
|
|
841
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$
|
|
919
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$2.FocusMonitor }, { type: i0.Renderer2 }]; }, propDecorators: { _attrType: [{
|
|
842
920
|
type: HostBinding,
|
|
843
921
|
args: ['attr.type']
|
|
844
922
|
}], _btnCss: [{
|
|
@@ -945,86 +1023,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
945
1023
|
}]
|
|
946
1024
|
}] });
|
|
947
1025
|
|
|
948
|
-
const THESEAM_WIDGET_PREFERENCES_ACCESSOR = new InjectionToken('TheSeamWidgetPreferencesAccessor');
|
|
949
|
-
|
|
950
|
-
const CURRENT_WIDGET_PREFERENCES_VERSION = 1;
|
|
951
|
-
const EMPTY_WIDGET_PREFERENCES = {
|
|
952
|
-
version: 1,
|
|
953
|
-
};
|
|
954
|
-
|
|
955
|
-
// TODO: Rethink this. I originally implemented this to be shared widget's then
|
|
956
|
-
// changed it to be per widget, for the accessor injection.
|
|
957
|
-
// @Injectable({ providedIn: 'root' })
|
|
958
|
-
class WidgetPreferencesService {
|
|
959
|
-
constructor(_preferencesManager, _prefsAccessor) {
|
|
960
|
-
this._preferencesManager = _preferencesManager;
|
|
961
|
-
this._prefsAccessor = _prefsAccessor;
|
|
962
|
-
this._pendingPatches = {};
|
|
963
|
-
}
|
|
964
|
-
isPatchPending(preferenceKey) {
|
|
965
|
-
return this._pendingPatches[preferenceKey] && this._pendingPatches[preferenceKey].length > 0;
|
|
966
|
-
}
|
|
967
|
-
isPending(preferenceKey) {
|
|
968
|
-
return this._preferencesManager.isPending(preferenceKey);
|
|
969
|
-
}
|
|
970
|
-
isLoaded(preferenceKey) {
|
|
971
|
-
return this._preferencesManager.isLoaded(preferenceKey);
|
|
972
|
-
}
|
|
973
|
-
preferences(preferenceKey) {
|
|
974
|
-
if (!this._prefsAccessor) {
|
|
975
|
-
return of(JSON.parse(JSON.stringify(EMPTY_WIDGET_PREFERENCES)));
|
|
976
|
-
}
|
|
977
|
-
return this._preferencesManager.preferences(preferenceKey, this._prefsAccessor, EMPTY_WIDGET_PREFERENCES).pipe(map(prefs => {
|
|
978
|
-
if (this._isValidPreferences(prefs)) {
|
|
979
|
-
return prefs;
|
|
980
|
-
}
|
|
981
|
-
throw Error(`Preferences for key '${preferenceKey}' is not a valid widget preferences.`);
|
|
982
|
-
}));
|
|
983
|
-
}
|
|
984
|
-
refresh(preferenceKey) {
|
|
985
|
-
this._preferencesManager.refresh(preferenceKey);
|
|
986
|
-
}
|
|
987
|
-
patchPreferences(preferenceKey, preferences) {
|
|
988
|
-
if (!this._prefsAccessor) {
|
|
989
|
-
return;
|
|
990
|
-
}
|
|
991
|
-
if (!this._pendingPatches[preferenceKey]) {
|
|
992
|
-
this._pendingPatches[preferenceKey] = [];
|
|
993
|
-
}
|
|
994
|
-
if (this._pendingPatches[preferenceKey].length > 0) {
|
|
995
|
-
this._pendingPatches[preferenceKey].push(preferences);
|
|
996
|
-
return;
|
|
997
|
-
}
|
|
998
|
-
this._pendingPatches[preferenceKey].push(preferences);
|
|
999
|
-
this.preferences(preferenceKey).pipe(take(1), map(prefs => {
|
|
1000
|
-
const pendingPatches = this._pendingPatches[preferenceKey];
|
|
1001
|
-
this._pendingPatches[preferenceKey] = [];
|
|
1002
|
-
const newPrefs = pendingPatches.reduce((acc, patch) => {
|
|
1003
|
-
return { ...acc, ...patch };
|
|
1004
|
-
}, prefs); // Typescript isn't recognizing that 'version' is included in the initial value.
|
|
1005
|
-
if (!this._isValidPreferences(newPrefs)) {
|
|
1006
|
-
throw Error(`Attempted to patch preferences for key '${preferenceKey}' with invalid preferences.`);
|
|
1007
|
-
}
|
|
1008
|
-
this._preferencesManager.update(preferenceKey, newPrefs);
|
|
1009
|
-
}), tap(() => this.refresh(preferenceKey))).subscribe();
|
|
1010
|
-
}
|
|
1011
|
-
_isValidPreferences(prefs) {
|
|
1012
|
-
return prefs.version === CURRENT_WIDGET_PREFERENCES_VERSION;
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
WidgetPreferencesService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetPreferencesService, deps: [{ token: i1$3.TheSeamPreferencesManagerService }, { token: THESEAM_WIDGET_PREFERENCES_ACCESSOR, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1016
|
-
WidgetPreferencesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetPreferencesService });
|
|
1017
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetPreferencesService, decorators: [{
|
|
1018
|
-
type: Injectable
|
|
1019
|
-
}], ctorParameters: function () { return [{ type: i1$3.TheSeamPreferencesManagerService }, { type: undefined, decorators: [{
|
|
1020
|
-
type: Optional
|
|
1021
|
-
}, {
|
|
1022
|
-
type: Inject,
|
|
1023
|
-
args: [THESEAM_WIDGET_PREFERENCES_ACCESSOR]
|
|
1024
|
-
}] }]; } });
|
|
1025
|
-
|
|
1026
1026
|
const THESEAM_WIDGETS = new InjectionToken('TheSeamWidgets');
|
|
1027
|
-
const THESEAM_WIDGET_DATA = new InjectionToken('TheSeamWidgetData');
|
|
1027
|
+
const THESEAM_WIDGET_DATA = new InjectionToken('TheSeamWidgetData');
|
|
1028
|
+
const THESEAM_WIDGET_DEFAULTS = new InjectionToken('TheSeamWidgetDefaults');
|
|
1028
1029
|
|
|
1029
1030
|
const EXPANDED_STATE = 'expanded';
|
|
1030
1031
|
const COLLAPSED_STATE = 'collapsed';
|
|
@@ -1086,8 +1087,9 @@ class WidgetComponent {
|
|
|
1086
1087
|
this._iconObj = value;
|
|
1087
1088
|
}
|
|
1088
1089
|
}
|
|
1089
|
-
constructor(_widgetPreferences, _data) {
|
|
1090
|
+
constructor(_widgetPreferences, _defaults, _data) {
|
|
1090
1091
|
this._widgetPreferences = _widgetPreferences;
|
|
1092
|
+
this._defaults = _defaults;
|
|
1091
1093
|
this._data = _data;
|
|
1092
1094
|
this.configIcon = faCog;
|
|
1093
1095
|
this.collapseIcon = faAngleDown;
|
|
@@ -1111,6 +1113,14 @@ class WidgetComponent {
|
|
|
1111
1113
|
* header to toggle the collapsed state.
|
|
1112
1114
|
*/
|
|
1113
1115
|
this.canCollapse = false;
|
|
1116
|
+
if (this._defaults) {
|
|
1117
|
+
if (hasProperty(this._defaults, 'canCollapse')) {
|
|
1118
|
+
this.canCollapse = this._defaults.canCollapse;
|
|
1119
|
+
}
|
|
1120
|
+
if (hasProperty(this._defaults, 'collapsed')) {
|
|
1121
|
+
this.collapsed = this._defaults.collapsed;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1114
1124
|
if (this._data && this._data.widgetId) {
|
|
1115
1125
|
this._preferencesKey = `widget:${this._data.widgetId}`;
|
|
1116
1126
|
this._widgetPreferences.preferences(this._preferencesKey).pipe(tap$1(prefs => {
|
|
@@ -1146,7 +1156,7 @@ class WidgetComponent {
|
|
|
1146
1156
|
}
|
|
1147
1157
|
get collapseState() { return this.collapsed ? COLLAPSED_STATE : EXPANDED_STATE; }
|
|
1148
1158
|
}
|
|
1149
|
-
WidgetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetComponent, deps: [{ token: WidgetPreferencesService }, { token: THESEAM_WIDGET_DATA, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
1159
|
+
WidgetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetComponent, deps: [{ token: WidgetPreferencesService }, { token: THESEAM_WIDGET_DEFAULTS, optional: true }, { token: THESEAM_WIDGET_DATA, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
1150
1160
|
WidgetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.7", type: WidgetComponent, selector: "seam-widget", inputs: { collapsed: "collapsed", hasHeader: "hasHeader", titleText: "titleText", icon: "icon", iconClass: "iconClass", loading: "loading", hasConfig: "hasConfig", canCollapse: "canCollapse" }, providers: [
|
|
1151
1161
|
WidgetPreferencesService,
|
|
1152
1162
|
], queries: [{ propertyName: "iconTpl", first: true, predicate: WidgetIconTplDirective, descendants: true, static: true }, { propertyName: "titleTpl", first: true, predicate: WidgetTitleTplDirective, descendants: true, static: true }], ngImport: i0, template: "<div class=\"seam-widget border rounded overflow-hidden\">\n <div class=\"widget-header\" seamWidgetDragHandle *ngIf=\"hasHeader\">\n <div class=\"widget-header-content p-2 text-nowrap\">\n <span class=\"mr-1 widget-header-icon\">\n <ng-container *ngIf=\"iconTpl; else noIconTpl\">\n <ng-template\n [ngTemplateOutlet]=\"iconTpl.template\"\n [ngTemplateOutletContext]=\"{ $implicit: icon, icon: icon, title: titleText }\">\n </ng-template>\n </ng-container>\n <ng-template #noIconTpl>\n <fa-icon *ngIf=\"_iconObj\"\n class=\"widget-header-icon--fa {{ iconClass }}\"\n [icon]=\"_iconObj\"></fa-icon>\n <img *ngIf=\"_iconUrl\"\n class=\"widget-header-icon--img {{ iconClass }}\"\n [src]=\"_iconUrl\" [alt]=\"titleText\">\n </ng-template>\n </span>\n <span class=\"widget-header-title text-truncate\">\n <ng-container *ngIf=\"titleTpl; else noTitleTpl\">\n <ng-template\n [ngTemplateOutlet]=\"titleTpl.template\"\n [ngTemplateOutletContext]=\"{ $implicit: titleText, icon: icon, title: titleText }\">\n </ng-template>\n </ng-container>\n <ng-template #noTitleTpl>{{ titleText }}</ng-template>\n </span>\n </div>\n <div class=\"widget-header-btns-container\" *ngIf=\"hasConfig || canCollapse\">\n <!-- <div *ngIf=\"hasConfig\">\n <button seamIconBtn [icon]=\"configIcon\"\n class=\"widget-header-btn-config\"\n [iconType]=\"null\">\n <span class=\"sr-only\">Widget configuration menu</span>\n </button>\n <button seamButton class=\"widget-header-btn-config p-0\">\n <seam-icon class=\"d-block\" [icon]=\"configIcon\" iconClass=\"text-secondary\"></seam-icon>\n <span class=\"sr-only\">Widget configuration menu</span>\n </button>\n </div> -->\n\n <div *ngIf=\"canCollapse\" class=\"px-0\">\n\n <button seamButton class=\"widget-header-btn-collapse p-0 mr-1 h-100\" (click)=\"collapse()\" [class.widget-header-btn-collapse--active]=\"collapsed\">\n <seam-icon class=\"d-block\"\n [icon]=\"collapseIcon\"\n iconClass=\"text-secondary\">\n </seam-icon>\n <span class=\"sr-only\">Widget collapse</span>\n </button>\n <!-- iconType=\"borderless-styled-square\" -->\n <!-- style=\"margin-left: -10px; margin-right: -5px;\" -->\n\n <!-- <button seamIconBtn class=\"widget-header-btn-collapse\" (click)=\"collapse()\" [class.widget-header-btn-collapse--active]=\"collapsed\"\n btnTheme=\"secondary\"\n [icon]=\"collapseIcon\"\n iconType=\"borderless-styled-square\"\n size=\"xs\"\n btnSize=\"sm\"\n >\n <seam-icon class=\"d-block\"\n [icon]=\"collapseIcon\"\n iconClass=\"text-secondary\"\n style=\"margin-left: -10px; margin-right: -5px;\"\n iconType=\"borderless-styled-square\"></seam-icon>\n <span class=\"sr-only\">Widget collapse</span>\n </button> -->\n </div>\n </div>\n </div>\n <div class=\"position-relative overflow-hidden\" [style.height.px]=\"loading ? 150 : undefined\" [@collapseAnim]=\"collapseState\">\n <ng-container *ngIf=\"!collapsed\">\n <div class=\"p-2\" *ngIf=\"!loading else loadingTpl\" @keepContentAnim>\n <ng-content></ng-content>\n </div>\n <ng-content select=\"seam-widget-footer\"></ng-content>\n <ng-template #loadingTpl>\n <div class=\"position-absolute\" @loadingAnim style=\"top:0;right:0;bottom:0;left:0\">\n <seam-loading [theme]=\"'primary'\"></seam-loading>\n </div>\n </ng-template>\n </ng-container>\n </div>\n</div>\n", styles: ["seam-widget{display:block;font-size:15px}seam-widget .seam-widget{background:#FFFFFF;box-shadow:none}seam-widget .widget-header{display:flex;flex-direction:row;border-bottom:1px solid #dee2e6;background:#F4F4F4;font-size:17px}seam-widget .widget-header .widget-header-content{flex:1 1 100%}seam-widget .widget-header .widget-header-btns-container{display:flex;flex-direction:row}seam-widget .widget-header .widget-header-btns-container>div{display:flex;flex-direction:column;justify-content:center;padding:4px}seam-widget .widget-header .widget-header-btns-container .widget-header-btn-config .seam-icon--fa{display:flex;flex-direction:row;justify-content:center;text-align:center;height:25px;width:30px}seam-widget .widget-header .widget-header-btns-container .widget-header-btn-config .seam-icon--fa .svg-inline--fa{max-width:100%;height:100%;width:100%}seam-widget .widget-header .widget-header-btns-container .widget-header-btn-collapse .seam-icon--fa{display:flex;flex-direction:row;justify-content:center;text-align:center;height:25px;width:30px}seam-widget .widget-header .widget-header-btns-container .widget-header-btn-collapse .seam-icon--fa .svg-inline--fa{max-width:100%;height:100%;width:100%}seam-widget .widget-header .widget-header-btns-container .widget-header-btn-collapse .svg-inline--fa{transform:rotate(0);transition:.3s ease-in-out transform}seam-widget .widget-header .widget-header-btns-container .widget-header-btn-collapse.widget-header-btn-collapse--active .svg-inline--fa{transform:rotate(90deg)}seam-widget .widget-header .widget-header-title{font-size:17px}seam-widget .widget-header-icon{display:inline-block;vertical-align:top;max-height:20px;max-width:20px;height:20px;width:20px;color:currentColor}seam-widget .widget-header-icon .widget-header-icon--fa{display:flex;flex-direction:row;justify-content:center;text-align:center;max-height:20px;max-width:20px;height:20px;width:20px}seam-widget .widget-header-icon .widget-header-icon--fa .svg-inline--fa{max-width:100%;height:100%;width:100%}seam-widget .widget-header-icon .widget-header-icon--img{height:100%;max-height:20px;max-width:20px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$1.FaIconComponent, selector: "fa-icon", inputs: ["classes", "icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }, { kind: "component", type: i3.IconComponent, selector: "seam-icon", inputs: ["grayscaleOnDisable", "disabled", "iconClass", "icon", "size", "showDefaultOnError", "defaultIcon", "iconType"] }, { kind: "component", type: i5.LoadingComponent, selector: "seam-loading", inputs: ["theme"] }, { kind: "component", type: i6.ButtonComponent, selector: "button[seamButton]", inputs: ["disabled", "theme", "size", "type"], exportAs: ["seamButton"] }, { kind: "directive", type: WidgetDragHandleDirective, selector: "[seamWidgetDragHandle]", inputs: ["cdkDragHandleDisabled"] }], animations: [
|
|
@@ -1180,6 +1190,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
1180
1190
|
], template: "<div class=\"seam-widget border rounded overflow-hidden\">\n <div class=\"widget-header\" seamWidgetDragHandle *ngIf=\"hasHeader\">\n <div class=\"widget-header-content p-2 text-nowrap\">\n <span class=\"mr-1 widget-header-icon\">\n <ng-container *ngIf=\"iconTpl; else noIconTpl\">\n <ng-template\n [ngTemplateOutlet]=\"iconTpl.template\"\n [ngTemplateOutletContext]=\"{ $implicit: icon, icon: icon, title: titleText }\">\n </ng-template>\n </ng-container>\n <ng-template #noIconTpl>\n <fa-icon *ngIf=\"_iconObj\"\n class=\"widget-header-icon--fa {{ iconClass }}\"\n [icon]=\"_iconObj\"></fa-icon>\n <img *ngIf=\"_iconUrl\"\n class=\"widget-header-icon--img {{ iconClass }}\"\n [src]=\"_iconUrl\" [alt]=\"titleText\">\n </ng-template>\n </span>\n <span class=\"widget-header-title text-truncate\">\n <ng-container *ngIf=\"titleTpl; else noTitleTpl\">\n <ng-template\n [ngTemplateOutlet]=\"titleTpl.template\"\n [ngTemplateOutletContext]=\"{ $implicit: titleText, icon: icon, title: titleText }\">\n </ng-template>\n </ng-container>\n <ng-template #noTitleTpl>{{ titleText }}</ng-template>\n </span>\n </div>\n <div class=\"widget-header-btns-container\" *ngIf=\"hasConfig || canCollapse\">\n <!-- <div *ngIf=\"hasConfig\">\n <button seamIconBtn [icon]=\"configIcon\"\n class=\"widget-header-btn-config\"\n [iconType]=\"null\">\n <span class=\"sr-only\">Widget configuration menu</span>\n </button>\n <button seamButton class=\"widget-header-btn-config p-0\">\n <seam-icon class=\"d-block\" [icon]=\"configIcon\" iconClass=\"text-secondary\"></seam-icon>\n <span class=\"sr-only\">Widget configuration menu</span>\n </button>\n </div> -->\n\n <div *ngIf=\"canCollapse\" class=\"px-0\">\n\n <button seamButton class=\"widget-header-btn-collapse p-0 mr-1 h-100\" (click)=\"collapse()\" [class.widget-header-btn-collapse--active]=\"collapsed\">\n <seam-icon class=\"d-block\"\n [icon]=\"collapseIcon\"\n iconClass=\"text-secondary\">\n </seam-icon>\n <span class=\"sr-only\">Widget collapse</span>\n </button>\n <!-- iconType=\"borderless-styled-square\" -->\n <!-- style=\"margin-left: -10px; margin-right: -5px;\" -->\n\n <!-- <button seamIconBtn class=\"widget-header-btn-collapse\" (click)=\"collapse()\" [class.widget-header-btn-collapse--active]=\"collapsed\"\n btnTheme=\"secondary\"\n [icon]=\"collapseIcon\"\n iconType=\"borderless-styled-square\"\n size=\"xs\"\n btnSize=\"sm\"\n >\n <seam-icon class=\"d-block\"\n [icon]=\"collapseIcon\"\n iconClass=\"text-secondary\"\n style=\"margin-left: -10px; margin-right: -5px;\"\n iconType=\"borderless-styled-square\"></seam-icon>\n <span class=\"sr-only\">Widget collapse</span>\n </button> -->\n </div>\n </div>\n </div>\n <div class=\"position-relative overflow-hidden\" [style.height.px]=\"loading ? 150 : undefined\" [@collapseAnim]=\"collapseState\">\n <ng-container *ngIf=\"!collapsed\">\n <div class=\"p-2\" *ngIf=\"!loading else loadingTpl\" @keepContentAnim>\n <ng-content></ng-content>\n </div>\n <ng-content select=\"seam-widget-footer\"></ng-content>\n <ng-template #loadingTpl>\n <div class=\"position-absolute\" @loadingAnim style=\"top:0;right:0;bottom:0;left:0\">\n <seam-loading [theme]=\"'primary'\"></seam-loading>\n </div>\n </ng-template>\n </ng-container>\n </div>\n</div>\n", styles: ["seam-widget{display:block;font-size:15px}seam-widget .seam-widget{background:#FFFFFF;box-shadow:none}seam-widget .widget-header{display:flex;flex-direction:row;border-bottom:1px solid #dee2e6;background:#F4F4F4;font-size:17px}seam-widget .widget-header .widget-header-content{flex:1 1 100%}seam-widget .widget-header .widget-header-btns-container{display:flex;flex-direction:row}seam-widget .widget-header .widget-header-btns-container>div{display:flex;flex-direction:column;justify-content:center;padding:4px}seam-widget .widget-header .widget-header-btns-container .widget-header-btn-config .seam-icon--fa{display:flex;flex-direction:row;justify-content:center;text-align:center;height:25px;width:30px}seam-widget .widget-header .widget-header-btns-container .widget-header-btn-config .seam-icon--fa .svg-inline--fa{max-width:100%;height:100%;width:100%}seam-widget .widget-header .widget-header-btns-container .widget-header-btn-collapse .seam-icon--fa{display:flex;flex-direction:row;justify-content:center;text-align:center;height:25px;width:30px}seam-widget .widget-header .widget-header-btns-container .widget-header-btn-collapse .seam-icon--fa .svg-inline--fa{max-width:100%;height:100%;width:100%}seam-widget .widget-header .widget-header-btns-container .widget-header-btn-collapse .svg-inline--fa{transform:rotate(0);transition:.3s ease-in-out transform}seam-widget .widget-header .widget-header-btns-container .widget-header-btn-collapse.widget-header-btn-collapse--active .svg-inline--fa{transform:rotate(90deg)}seam-widget .widget-header .widget-header-title{font-size:17px}seam-widget .widget-header-icon{display:inline-block;vertical-align:top;max-height:20px;max-width:20px;height:20px;width:20px;color:currentColor}seam-widget .widget-header-icon .widget-header-icon--fa{display:flex;flex-direction:row;justify-content:center;text-align:center;max-height:20px;max-width:20px;height:20px;width:20px}seam-widget .widget-header-icon .widget-header-icon--fa .svg-inline--fa{max-width:100%;height:100%;width:100%}seam-widget .widget-header-icon .widget-header-icon--img{height:100%;max-height:20px;max-width:20px}\n"] }]
|
|
1181
1191
|
}], ctorParameters: function () { return [{ type: WidgetPreferencesService }, { type: undefined, decorators: [{
|
|
1182
1192
|
type: Optional
|
|
1193
|
+
}, {
|
|
1194
|
+
type: Inject,
|
|
1195
|
+
args: [THESEAM_WIDGET_DEFAULTS]
|
|
1196
|
+
}] }, { type: undefined, decorators: [{
|
|
1197
|
+
type: Optional
|
|
1183
1198
|
}, {
|
|
1184
1199
|
type: Inject,
|
|
1185
1200
|
args: [THESEAM_WIDGET_DATA]
|
|
@@ -1368,5 +1383,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
1368
1383
|
* Generated bundle index. Do not edit.
|
|
1369
1384
|
*/
|
|
1370
1385
|
|
|
1371
|
-
export { THESEAM_WIDGETS, THESEAM_WIDGET_ACCESSOR, THESEAM_WIDGET_DATA, TheSeamWidgetButtonGroupModule, TheSeamWidgetContentHeaderModule, TheSeamWidgetDescriptionModule, TheSeamWidgetEmptyLabelModule, TheSeamWidgetFooterLinkModule, TheSeamWidgetFooterTextModule, TheSeamWidgetHeaderBadgeModule, TheSeamWidgetListGroupModule, TheSeamWidgetModule, TheSeamWidgetTableModule, TheSeamWidgetTileListModule, TheSeamWidgetTileModule, WidgetButtonGroupComponent, WidgetComponent, WidgetContentHeaderComponent, WidgetDescriptionComponent, WidgetDragHandleDirective, WidgetEmptyLabelComponent, WidgetFooterComponent, WidgetFooterLinkComponent, WidgetFooterTextComponent, WidgetHeaderBadgeComponent, WidgetIconTplDirective, WidgetListGroupComponent, WidgetListGroupItemAnchorComponent, WidgetListGroupItemButtonComponent, WidgetListGroupItemComponent, WidgetListGroupItemIconTplDirective, WidgetRegistryService, WidgetTableComponent, WidgetTileComponent, WidgetTileFooterComponent, WidgetTileFooterItemComponent, WidgetTileGroupComponent, WidgetTileListComponent, WidgetTileSecondaryIconDirective, WidgetTitleTplDirective, extendStyles, toggleNativeDragInteractions };
|
|
1386
|
+
export { CURRENT_WIDGET_PREFERENCES_VERSION, EMPTY_WIDGET_PREFERENCES, THESEAM_WIDGETS, THESEAM_WIDGET_ACCESSOR, THESEAM_WIDGET_DATA, THESEAM_WIDGET_DEFAULTS, THESEAM_WIDGET_PREFERENCES_ACCESSOR, TheSeamWidgetButtonGroupModule, TheSeamWidgetContentHeaderModule, TheSeamWidgetDescriptionModule, TheSeamWidgetEmptyLabelModule, TheSeamWidgetFooterLinkModule, TheSeamWidgetFooterTextModule, TheSeamWidgetHeaderBadgeModule, TheSeamWidgetListGroupModule, TheSeamWidgetModule, TheSeamWidgetTableModule, TheSeamWidgetTileListModule, TheSeamWidgetTileModule, WidgetButtonGroupComponent, WidgetComponent, WidgetContentHeaderComponent, WidgetDescriptionComponent, WidgetDragHandleDirective, WidgetEmptyLabelComponent, WidgetFooterComponent, WidgetFooterLinkComponent, WidgetFooterTextComponent, WidgetHeaderBadgeComponent, WidgetIconTplDirective, WidgetListGroupComponent, WidgetListGroupItemAnchorComponent, WidgetListGroupItemButtonComponent, WidgetListGroupItemComponent, WidgetListGroupItemIconTplDirective, WidgetPreferencesService, WidgetRegistryService, WidgetTableComponent, WidgetTileComponent, WidgetTileFooterComponent, WidgetTileFooterItemComponent, WidgetTileGroupComponent, WidgetTileListComponent, WidgetTileSecondaryIconDirective, WidgetTitleTplDirective, extendStyles, toggleNativeDragInteractions };
|
|
1372
1387
|
//# sourceMappingURL=theseam-ui-common-widget.mjs.map
|