@theseam/ui-common 0.4.4 → 0.4.6
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/datatable/models/preferences-accessor.d.ts +3 -15
- package/datatable/models/preferences.d.ts +2 -1
- package/datatable/services/datatable-preferences.service.d.ts +11 -14
- package/datatable/tokens/datatable-preferences-accessor.d.ts +2 -2
- package/esm2020/datatable/datatable/datatable.component.mjs +3 -3
- package/esm2020/datatable/models/preferences-accessor.mjs +1 -1
- package/esm2020/datatable/models/preferences.mjs +1 -1
- package/esm2020/datatable/services/datatable-preferences.service.mjs +34 -106
- package/esm2020/datatable/tokens/datatable-preferences-accessor.mjs +1 -1
- package/esm2020/framework/dashboard/dashboard-widgets/dashboard-widgets.service.mjs +9 -3
- package/esm2020/services/preferences/preferences-accessor.mjs +2 -0
- package/esm2020/services/preferences/preferences-manager.service.mjs +69 -0
- package/esm2020/services/preferences/preferences-record.mjs +74 -0
- package/esm2020/services/preferences/preferences.models.mjs +2 -0
- package/esm2020/services/public-api.mjs +5 -1
- package/esm2020/story-helpers/public-api.mjs +2 -1
- package/esm2020/story-helpers/story-preferences-accessor.service.mjs +34 -0
- package/esm2020/widget/preferences/widget-preferences.models.mjs +5 -0
- package/esm2020/widget/preferences/widget-preferences.service.mjs +78 -0
- package/esm2020/widget/preferences/widget-preferences.token.mjs +3 -0
- package/esm2020/widget/public-api.mjs +2 -1
- package/esm2020/widget/widget/widget.component.mjs +81 -30
- package/esm2020/widget/widget-token.mjs +3 -1
- package/esm2020/widget/widget.models.mjs +2 -0
- package/fesm2015/theseam-ui-common-datatable.mjs +45 -116
- package/fesm2015/theseam-ui-common-datatable.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-framework.mjs +9 -3
- package/fesm2015/theseam-ui-common-framework.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-services.mjs +144 -8
- package/fesm2015/theseam-ui-common-services.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-story-helpers.mjs +32 -1
- package/fesm2015/theseam-ui-common-story-helpers.mjs.map +1 -1
- package/fesm2015/theseam-ui-common-widget.mjs +166 -35
- package/fesm2015/theseam-ui-common-widget.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-datatable.mjs +45 -116
- package/fesm2020/theseam-ui-common-datatable.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-framework.mjs +8 -3
- package/fesm2020/theseam-ui-common-framework.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-services.mjs +144 -8
- package/fesm2020/theseam-ui-common-services.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-story-helpers.mjs +32 -1
- package/fesm2020/theseam-ui-common-story-helpers.mjs.map +1 -1
- package/fesm2020/theseam-ui-common-widget.mjs +162 -35
- package/fesm2020/theseam-ui-common-widget.mjs.map +1 -1
- package/package.json +1 -1
- package/services/preferences/preferences-accessor.d.ts +15 -0
- package/services/preferences/preferences-manager.service.d.ts +15 -0
- package/services/preferences/preferences-record.d.ts +28 -0
- package/services/preferences/preferences.models.d.ts +3 -0
- package/services/public-api.d.ts +4 -0
- package/story-helpers/public-api.d.ts +1 -0
- package/story-helpers/story-preferences-accessor.service.d.ts +19 -0
- package/widget/preferences/widget-preferences.models.d.ts +8 -0
- package/widget/preferences/widget-preferences.service.d.ts +21 -0
- package/widget/preferences/widget-preferences.token.d.ts +3 -0
- package/widget/public-api.d.ts +1 -0
- package/widget/widget/widget.component.d.ts +12 -2
- package/widget/widget-token.d.ts +3 -0
- package/widget/widget.models.d.ts +7 -0
|
@@ -1,14 +1,14 @@
|
|
|
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,
|
|
4
|
-
import { Subject, BehaviorSubject,
|
|
5
|
-
import { auditTime, takeUntil, take, switchMap, filter, map } from 'rxjs/operators';
|
|
6
|
-
import { getClosestWidgetCdkDrag } from '@theseam/ui-common/utils';
|
|
3
|
+
import { InjectionToken, Directive, Optional, Inject, Input, Component, ChangeDetectionStrategy, NgModule, ViewEncapsulation, HostBinding, ContentChild, EventEmitter, Output, Injectable, isDevMode } from '@angular/core';
|
|
4
|
+
import { Subject, BehaviorSubject, of, tap as tap$1, takeUntil as takeUntil$1, throwError } from 'rxjs';
|
|
5
|
+
import { auditTime, takeUntil, take, switchMap, filter, map, tap } from 'rxjs/operators';
|
|
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
9
|
import * as i2 from '@angular/common';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
|
-
import * as
|
|
11
|
+
import * as i6 from '@theseam/ui-common/buttons';
|
|
12
12
|
import { TheSeamButtonsModule } from '@theseam/ui-common/buttons';
|
|
13
13
|
import { mixinTheme, mixinActive, mixinDisabled, InputBoolean, mixinTabIndex } from '@theseam/ui-common/core';
|
|
14
14
|
import * as i1$1 from '@angular/cdk/a11y';
|
|
@@ -20,12 +20,13 @@ import { TheSeamTableModule } from '@theseam/ui-common/table';
|
|
|
20
20
|
import { TheSeamTableCellTypesModule } from '@theseam/ui-common/table-cell-types';
|
|
21
21
|
import { trigger, transition, style, animate, state } from '@angular/animations';
|
|
22
22
|
import { faCog, faAngleDown } from '@fortawesome/free-solid-svg-icons';
|
|
23
|
-
import * as
|
|
23
|
+
import * as i1$3 from '@theseam/ui-common/services';
|
|
24
|
+
import * as i3$1 from '@fortawesome/angular-fontawesome';
|
|
24
25
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
25
|
-
import * as
|
|
26
|
+
import * as i5 from '@theseam/ui-common/loading';
|
|
26
27
|
import { TheSeamLoadingModule } from '@theseam/ui-common/loading';
|
|
27
28
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
28
|
-
import * as i1$
|
|
29
|
+
import * as i1$4 from '@theseam/ui-common/dynamic-component-loader';
|
|
29
30
|
import { CdkTableModule } from '@angular/cdk/table';
|
|
30
31
|
import { RouterModule } from '@angular/router';
|
|
31
32
|
|
|
@@ -946,6 +947,90 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
946
947
|
}]
|
|
947
948
|
}] });
|
|
948
949
|
|
|
950
|
+
const THESEAM_WIDGET_PREFERENCES_ACCESSOR = new InjectionToken('TheSeamWidgetPreferencesAccessor');
|
|
951
|
+
|
|
952
|
+
const CURRENT_WIDGET_PREFERENCES_VERSION = 1;
|
|
953
|
+
const EMPTY_WIDGET_PREFERENCES = {
|
|
954
|
+
version: 1,
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
// TODO: Rethink this. I originally implemented this to be shared widget's then
|
|
958
|
+
// changed it to be per widget, for the accessor injection.
|
|
959
|
+
// @Injectable({ providedIn: 'root' })
|
|
960
|
+
class WidgetPreferencesService {
|
|
961
|
+
constructor(_preferencesManager, _prefsAccessor) {
|
|
962
|
+
this._preferencesManager = _preferencesManager;
|
|
963
|
+
this._prefsAccessor = _prefsAccessor;
|
|
964
|
+
this._pendingPatches = {};
|
|
965
|
+
}
|
|
966
|
+
isPatchPending(preferenceKey) {
|
|
967
|
+
return this._pendingPatches[preferenceKey] && this._pendingPatches[preferenceKey].length > 0;
|
|
968
|
+
}
|
|
969
|
+
isPending(preferenceKey) {
|
|
970
|
+
return this._preferencesManager.isPending(preferenceKey);
|
|
971
|
+
}
|
|
972
|
+
isLoaded(preferenceKey) {
|
|
973
|
+
return this._preferencesManager.isLoaded(preferenceKey);
|
|
974
|
+
}
|
|
975
|
+
preferences(preferenceKey) {
|
|
976
|
+
if (!this._prefsAccessor) {
|
|
977
|
+
return of(JSON.parse(JSON.stringify(EMPTY_WIDGET_PREFERENCES)));
|
|
978
|
+
}
|
|
979
|
+
return this._preferencesManager.preferences(preferenceKey, this._prefsAccessor, EMPTY_WIDGET_PREFERENCES).pipe(map(prefs => {
|
|
980
|
+
if (this._isValidPreferences(prefs)) {
|
|
981
|
+
return prefs;
|
|
982
|
+
}
|
|
983
|
+
throw Error(`Preferences for key '${preferenceKey}' is not a valid widget preferences.`);
|
|
984
|
+
}));
|
|
985
|
+
}
|
|
986
|
+
refresh(preferenceKey) {
|
|
987
|
+
this._preferencesManager.refresh(preferenceKey);
|
|
988
|
+
}
|
|
989
|
+
patchPreferences(preferenceKey, preferences) {
|
|
990
|
+
if (!this._prefsAccessor) {
|
|
991
|
+
return;
|
|
992
|
+
}
|
|
993
|
+
if (!this._pendingPatches[preferenceKey]) {
|
|
994
|
+
this._pendingPatches[preferenceKey] = [];
|
|
995
|
+
}
|
|
996
|
+
if (this._pendingPatches[preferenceKey].length > 0) {
|
|
997
|
+
this._pendingPatches[preferenceKey].push(preferences);
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
this._pendingPatches[preferenceKey].push(preferences);
|
|
1001
|
+
this.preferences(preferenceKey).pipe(take(1), map(prefs => {
|
|
1002
|
+
const pendingPatches = this._pendingPatches[preferenceKey];
|
|
1003
|
+
this._pendingPatches[preferenceKey] = [];
|
|
1004
|
+
const newPrefs = pendingPatches.reduce((acc, patch) => {
|
|
1005
|
+
return Object.assign(Object.assign({}, acc), patch);
|
|
1006
|
+
}, prefs); // Typescript isn't recognizing that 'version' is included in the initial value.
|
|
1007
|
+
if (!this._isValidPreferences(newPrefs)) {
|
|
1008
|
+
throw Error(`Attempted to patch preferences for key '${preferenceKey}' with invalid preferences.`);
|
|
1009
|
+
}
|
|
1010
|
+
this._preferencesManager.update(preferenceKey, newPrefs);
|
|
1011
|
+
}), tap(() => this.refresh(preferenceKey))).subscribe();
|
|
1012
|
+
}
|
|
1013
|
+
_isValidPreferences(prefs) {
|
|
1014
|
+
return prefs.version === CURRENT_WIDGET_PREFERENCES_VERSION;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
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 });
|
|
1018
|
+
WidgetPreferencesService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetPreferencesService });
|
|
1019
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetPreferencesService, decorators: [{
|
|
1020
|
+
type: Injectable
|
|
1021
|
+
}], ctorParameters: function () {
|
|
1022
|
+
return [{ type: i1$3.TheSeamPreferencesManagerService }, { type: undefined, decorators: [{
|
|
1023
|
+
type: Optional
|
|
1024
|
+
}, {
|
|
1025
|
+
type: Inject,
|
|
1026
|
+
args: [THESEAM_WIDGET_PREFERENCES_ACCESSOR]
|
|
1027
|
+
}] }];
|
|
1028
|
+
} });
|
|
1029
|
+
|
|
1030
|
+
const THESEAM_WIDGETS = new InjectionToken('TheSeamWidgets');
|
|
1031
|
+
const THESEAM_WIDGET_DATA = new InjectionToken('TheSeamWidgetData');
|
|
1032
|
+
const THESEAM_WIDGET_DEFAULTS = new InjectionToken('TheSeamWidgetDefaults');
|
|
1033
|
+
|
|
949
1034
|
const EXPANDED_STATE = 'expanded';
|
|
950
1035
|
const COLLAPSED_STATE = 'collapsed';
|
|
951
1036
|
const EXPAND_TRANSITION = `${EXPANDED_STATE} <=> ${COLLAPSED_STATE}`;
|
|
@@ -987,9 +1072,32 @@ const collapseAnimation = trigger('collapseAnim', [
|
|
|
987
1072
|
* used then the situation should be considered for becoming a widget component.
|
|
988
1073
|
*/
|
|
989
1074
|
class WidgetComponent {
|
|
990
|
-
|
|
1075
|
+
/**
|
|
1076
|
+
* Icon displayed in the top header.
|
|
1077
|
+
*
|
|
1078
|
+
* If a more advanced icon is needed you can use `seamWidgetIconTpl` template
|
|
1079
|
+
* directive, but a `SeamIcon` input is recommended, because allowing custom
|
|
1080
|
+
* icons that do not follow the tested types can lead to inconsitency quickly
|
|
1081
|
+
* as different developers keep making tweaks.
|
|
1082
|
+
*/
|
|
1083
|
+
get icon() { return this._iconUrl || this._iconObj; }
|
|
1084
|
+
set icon(value) {
|
|
1085
|
+
if (typeof value === 'string') {
|
|
1086
|
+
this._iconUrl = value;
|
|
1087
|
+
this._iconObj = undefined;
|
|
1088
|
+
}
|
|
1089
|
+
else {
|
|
1090
|
+
this._iconUrl = undefined;
|
|
1091
|
+
this._iconObj = value;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
constructor(_widgetPreferences, _defaults, _data) {
|
|
1095
|
+
this._widgetPreferences = _widgetPreferences;
|
|
1096
|
+
this._defaults = _defaults;
|
|
1097
|
+
this._data = _data;
|
|
991
1098
|
this.configIcon = faCog;
|
|
992
1099
|
this.collapseIcon = faAngleDown;
|
|
1100
|
+
this._ngUnsubscribe = new Subject();
|
|
993
1101
|
/**
|
|
994
1102
|
* Toggles the collapsed state of a widget.
|
|
995
1103
|
*/
|
|
@@ -1009,26 +1117,27 @@ class WidgetComponent {
|
|
|
1009
1117
|
* header to toggle the collapsed state.
|
|
1010
1118
|
*/
|
|
1011
1119
|
this.canCollapse = false;
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
* as different developers keep making tweaks.
|
|
1020
|
-
*/
|
|
1021
|
-
get icon() { return this._iconUrl || this._iconObj; }
|
|
1022
|
-
set icon(value) {
|
|
1023
|
-
if (typeof value === 'string') {
|
|
1024
|
-
this._iconUrl = value;
|
|
1025
|
-
this._iconObj = undefined;
|
|
1120
|
+
if (this._defaults) {
|
|
1121
|
+
if (hasProperty(this._defaults, 'canCollapse')) {
|
|
1122
|
+
this.canCollapse = this._defaults.canCollapse;
|
|
1123
|
+
}
|
|
1124
|
+
if (hasProperty(this._defaults, 'collapsed')) {
|
|
1125
|
+
this.collapsed = this._defaults.collapsed;
|
|
1126
|
+
}
|
|
1026
1127
|
}
|
|
1027
|
-
|
|
1028
|
-
this.
|
|
1029
|
-
this.
|
|
1128
|
+
if (this._data && this._data.widgetId) {
|
|
1129
|
+
this._preferencesKey = `widget:${this._data.widgetId}`;
|
|
1130
|
+
this._widgetPreferences.preferences(this._preferencesKey).pipe(tap$1(prefs => {
|
|
1131
|
+
if (hasProperty(prefs, 'collapsed')) {
|
|
1132
|
+
this.collapsed = prefs.collapsed;
|
|
1133
|
+
}
|
|
1134
|
+
}), takeUntil$1(this._ngUnsubscribe)).subscribe();
|
|
1030
1135
|
}
|
|
1031
1136
|
}
|
|
1137
|
+
ngOnDestroy() {
|
|
1138
|
+
this._ngUnsubscribe.next();
|
|
1139
|
+
this._ngUnsubscribe.complete();
|
|
1140
|
+
}
|
|
1032
1141
|
/**
|
|
1033
1142
|
* Toggles a widget's collapsed state.
|
|
1034
1143
|
*/
|
|
@@ -1040,11 +1149,21 @@ class WidgetComponent {
|
|
|
1040
1149
|
return;
|
|
1041
1150
|
}
|
|
1042
1151
|
this.collapsed = !this.collapsed;
|
|
1152
|
+
// Only update the preference, if collapse method is called, because it is
|
|
1153
|
+
// assumed that the user is collapsing the widget. If the collapsed state is
|
|
1154
|
+
// changed by other means, such using the widget's `collapsed` input, then
|
|
1155
|
+
// the preference should not be updated, because that is assumed to be an
|
|
1156
|
+
// app controlled change that should not be persisted.
|
|
1157
|
+
if (this._preferencesKey) {
|
|
1158
|
+
this._widgetPreferences.patchPreferences(this._preferencesKey, { collapsed: this.collapsed });
|
|
1159
|
+
}
|
|
1043
1160
|
}
|
|
1044
1161
|
get collapseState() { return this.collapsed ? COLLAPSED_STATE : EXPANDED_STATE; }
|
|
1045
1162
|
}
|
|
1046
|
-
WidgetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1047
|
-
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" },
|
|
1163
|
+
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 });
|
|
1164
|
+
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: [
|
|
1165
|
+
WidgetPreferencesService,
|
|
1166
|
+
], 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: [
|
|
1048
1167
|
loadingAnimation,
|
|
1049
1168
|
collapseAnimation,
|
|
1050
1169
|
keepContentAnimation,
|
|
@@ -1066,12 +1185,26 @@ __decorate([
|
|
|
1066
1185
|
], WidgetComponent.prototype, "canCollapse", void 0);
|
|
1067
1186
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetComponent, decorators: [{
|
|
1068
1187
|
type: Component,
|
|
1069
|
-
args: [{ selector: 'seam-widget',
|
|
1188
|
+
args: [{ selector: 'seam-widget', providers: [
|
|
1189
|
+
WidgetPreferencesService,
|
|
1190
|
+
], encapsulation: ViewEncapsulation.None, animations: [
|
|
1070
1191
|
loadingAnimation,
|
|
1071
1192
|
collapseAnimation,
|
|
1072
1193
|
keepContentAnimation,
|
|
1073
1194
|
], 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"] }]
|
|
1074
|
-
}],
|
|
1195
|
+
}], ctorParameters: function () {
|
|
1196
|
+
return [{ type: WidgetPreferencesService }, { type: undefined, decorators: [{
|
|
1197
|
+
type: Optional
|
|
1198
|
+
}, {
|
|
1199
|
+
type: Inject,
|
|
1200
|
+
args: [THESEAM_WIDGET_DEFAULTS]
|
|
1201
|
+
}] }, { type: undefined, decorators: [{
|
|
1202
|
+
type: Optional
|
|
1203
|
+
}, {
|
|
1204
|
+
type: Inject,
|
|
1205
|
+
args: [THESEAM_WIDGET_DATA]
|
|
1206
|
+
}] }];
|
|
1207
|
+
}, propDecorators: { collapsed: [{
|
|
1075
1208
|
type: Input
|
|
1076
1209
|
}], hasHeader: [{
|
|
1077
1210
|
type: Input
|
|
@@ -1104,8 +1237,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
1104
1237
|
args: [{ selector: 'seam-widget-footer', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"widget-footer--left\">\n <ng-content select=\"seam-widget-footer-text\"></ng-content>\n</div>\n<div class=\"widget-footer--right\">\n <ng-content select=\"seam-widget-button-group\"></ng-content>\n</div>\n", styles: ["seam-widget-footer{display:flex;flex-direction:row;margin:.25rem}seam-widget-footer .widget-footer--left{flex:1 1 100%}seam-widget-footer .widget-footer--right{flex:0 0 auto}\n"] }]
|
|
1105
1238
|
}] });
|
|
1106
1239
|
|
|
1107
|
-
const THESEAM_WIDGETS = new InjectionToken('TheSeamWidgets');
|
|
1108
|
-
|
|
1109
1240
|
/**
|
|
1110
1241
|
* Registry is to provide a way to manage widgets in a way that we can load them
|
|
1111
1242
|
* the same way throughout the app, whether the component itself is registered,
|
|
@@ -1143,7 +1274,7 @@ class WidgetRegistryService {
|
|
|
1143
1274
|
}
|
|
1144
1275
|
}
|
|
1145
1276
|
}
|
|
1146
|
-
WidgetRegistryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetRegistryService, deps: [{ token: THESEAM_WIDGETS }, { token: i1$
|
|
1277
|
+
WidgetRegistryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetRegistryService, deps: [{ token: THESEAM_WIDGETS }, { token: i1$4.TheSeamDynamicComponentLoader }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1147
1278
|
WidgetRegistryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetRegistryService, providedIn: 'root' });
|
|
1148
1279
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: WidgetRegistryService, decorators: [{
|
|
1149
1280
|
type: Injectable,
|
|
@@ -1154,7 +1285,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
1154
1285
|
return [{ type: undefined, decorators: [{
|
|
1155
1286
|
type: Inject,
|
|
1156
1287
|
args: [THESEAM_WIDGETS]
|
|
1157
|
-
}] }, { type: i1$
|
|
1288
|
+
}] }, { type: i1$4.TheSeamDynamicComponentLoader }];
|
|
1158
1289
|
} });
|
|
1159
1290
|
|
|
1160
1291
|
const contentModules = [
|
|
@@ -1260,5 +1391,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
1260
1391
|
* Generated bundle index. Do not edit.
|
|
1261
1392
|
*/
|
|
1262
1393
|
|
|
1263
|
-
export { THESEAM_WIDGETS, THESEAM_WIDGET_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, WidgetRegistryService, WidgetTableComponent, WidgetTileComponent, WidgetTileFooterComponent, WidgetTileFooterItemComponent, WidgetTileGroupComponent, WidgetTileListComponent, WidgetTileSecondaryIconDirective, WidgetTitleTplDirective, extendStyles, toggleNativeDragInteractions };
|
|
1394
|
+
export { THESEAM_WIDGETS, THESEAM_WIDGET_ACCESSOR, THESEAM_WIDGET_DATA, THESEAM_WIDGET_DEFAULTS, 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 };
|
|
1264
1395
|
//# sourceMappingURL=theseam-ui-common-widget.mjs.map
|