@csnext/cs-core
Advanced tools
Comparing version 0.0.132-alpha.54 to 0.0.132-alpha.448
import { MessageBusService } from '..'; | ||
export declare class MainBus { | ||
/** used for singleton */ | ||
private static pInstance; | ||
private static pEvents; | ||
/** Get singleton instance of appstate */ | ||
static get Instance(): MainBus; | ||
/** Event bus for publish/subscribe events in application */ | ||
static get events(): MessageBusService; | ||
} |
import { MessageBusService } from '..'; | ||
export class MainBus { | ||
/** Get singleton instance of appstate */ | ||
static get Instance() { | ||
return this.pInstance || (this.pInstance = new this()); | ||
} | ||
/** Event bus for publish/subscribe events in application */ | ||
static get events() { | ||
@@ -9,0 +7,0 @@ return this.pEvents || (this.pEvents = new MessageBusService()); |
@@ -14,4 +14,6 @@ export declare class Topics { | ||
static readonly RESIZE = "resize"; | ||
static readonly RESIZE_STARTED = "started"; | ||
static readonly RESIZE_CHANGED = "changed"; | ||
static readonly DASHBOARD = "dashboard"; | ||
static readonly DASHBOARD_RELOAD = "dashboard-reload"; | ||
} |
@@ -1,21 +0,19 @@ | ||
let Topics = /** @class */ (() => { | ||
class Topics { | ||
} | ||
Topics.TIME_TOPIC = 'time'; | ||
Topics.LOG_TOPIC = 'log'; | ||
Topics.LOG_ITEM_ADDED = 'log-item-added'; | ||
Topics.LOG_ITEM_UPDATED = 'log-item-updated'; | ||
Topics.LOG_ITEM_SELECTED = 'log-item-selected'; | ||
Topics.SELECT_LOG_ITEM = 'select-log-item'; | ||
Topics.SET_FOCUS_TIME = 'set-time'; | ||
Topics.SET_TIME_RANGE = 'set-time-range'; | ||
Topics.TIMELINE_MOVED = 'moved'; | ||
Topics.TIMELINE_MOVING = 'moving'; | ||
Topics.TIMELINE_DOUBLE_CLICK = 'doubleclick'; | ||
Topics.RESIZE = 'resize'; | ||
Topics.DASHBOARD = "dashboard"; | ||
Topics.DASHBOARD_RELOAD = "dashboard-reload"; | ||
return Topics; | ||
})(); | ||
export { Topics }; | ||
export class Topics { | ||
} | ||
Topics.TIME_TOPIC = 'time'; | ||
Topics.LOG_TOPIC = 'log'; | ||
Topics.LOG_ITEM_ADDED = 'log-item-added'; | ||
Topics.LOG_ITEM_UPDATED = 'log-item-updated'; | ||
Topics.LOG_ITEM_SELECTED = 'log-item-selected'; | ||
Topics.SELECT_LOG_ITEM = 'select-log-item'; | ||
Topics.SET_FOCUS_TIME = 'set-time'; | ||
Topics.SET_TIME_RANGE = 'set-time-range'; | ||
Topics.TIMELINE_MOVED = 'moved'; | ||
Topics.TIMELINE_MOVING = 'moving'; | ||
Topics.TIMELINE_DOUBLE_CLICK = 'doubleclick'; | ||
Topics.RESIZE = 'resize'; | ||
Topics.RESIZE_STARTED = 'started'; | ||
Topics.RESIZE_CHANGED = 'changed'; | ||
Topics.DASHBOARD = "dashboard"; | ||
Topics.DASHBOARD_RELOAD = "dashboard-reload"; | ||
//# sourceMappingURL=topics.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=dashboard-manager-config.js.map |
import { IWidget, IDashboard } from './..'; | ||
/** Interface for dashboard manager */ | ||
export interface IDashboardManager { | ||
@@ -7,2 +6,3 @@ start?: (dashboard: IDashboard) => void; | ||
dashboardLoaded?: () => void; | ||
data?: any; | ||
contentLoaded?: (d: any) => void; | ||
@@ -12,2 +12,3 @@ editDashboard?: (dashboard: IDashboard) => void; | ||
removeWidget?: (widget: IWidget) => void; | ||
_contentHasBeenLoaded?: boolean; | ||
} |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=dashboard-manager.js.map |
@@ -13,2 +13,5 @@ import { IDashboard } from './dashboard'; | ||
_dashboard?: IDashboard; | ||
sidebarWidth?: number | string; | ||
sidebarTemporary?: boolean; | ||
sidebarExpanded?: boolean; | ||
info?: InfoOptions | string; | ||
@@ -15,0 +18,0 @@ shortcut?: KeyboardShortcut; |
@@ -27,3 +27,2 @@ import { IFooterOptions, IDashboardManager, IWidget, WidgetOptions, ISidebarOptions, IDashboardOptions, IMessageBusService, IMenu, Info } from '../'; | ||
footer?: IFooterOptions; | ||
/** dashboard specific sidebars */ | ||
sidebars?: { | ||
@@ -39,3 +38,2 @@ [key: string]: IDashboard; | ||
component?: any; | ||
/** Background information description. Only available in UI if used in combination with cs-info component from @csnext/cs-markdown */ | ||
info?: Info; | ||
@@ -42,0 +40,0 @@ hideFromNavigation?: boolean; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=dashboard.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=layout-manager-config.js.map |
@@ -8,2 +8,4 @@ import { BaseDashboardOptions } from './dashboard-options'; | ||
icons?: boolean; | ||
storeActive?: boolean; | ||
toolBarTabs?: boolean; | ||
} |
@@ -10,4 +10,6 @@ import { BaseDashboardOptions } from './dashboard-options'; | ||
this.icons = false; | ||
this.storeActive = false; | ||
this.toolBarTabs = false; | ||
} | ||
} | ||
//# sourceMappingURL=tab-dashboard-options.js.map |
@@ -9,2 +9,3 @@ export declare class ToolbarOptions { | ||
prominent?: boolean; | ||
outlined?: boolean; | ||
collapse?: boolean; | ||
@@ -11,0 +12,0 @@ absolute?: boolean; |
@@ -1,60 +0,53 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
import { __decorate, __metadata } from "tslib"; | ||
import { FormField, Form } from '../form/form-decorators'; | ||
let ToolbarOptions = class ToolbarOptions { | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
import { FormField, Form } from '../form/form-decorators'; | ||
let ToolbarOptions = /** @class */ (() => { | ||
let ToolbarOptions = class ToolbarOptions { | ||
}; | ||
__decorate([ | ||
FormField({ title: 'Background Color', type: 'string' }), | ||
__metadata("design:type", String) | ||
], ToolbarOptions.prototype, "backgroundColor", void 0); | ||
__decorate([ | ||
FormField({ title: 'Flat', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "flat", void 0); | ||
__decorate([ | ||
FormField({ title: 'Dense', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "dense", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide Icon', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "hideIcon", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide Title', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "hideTitle", void 0); | ||
__decorate([ | ||
FormField({ title: 'Prominent', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "prominent", void 0); | ||
__decorate([ | ||
FormField({ title: 'Collapse', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "collapse", void 0); | ||
__decorate([ | ||
FormField({ title: 'Absolute', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "absolute", void 0); | ||
__decorate([ | ||
FormField({ title: 'Elevation', type: 'slider', min: 0, max: 10 }), | ||
__metadata("design:type", Number) | ||
], ToolbarOptions.prototype, "elevation", void 0); | ||
__decorate([ | ||
FormField({ title: 'Background Image', type: 'string' }), | ||
__metadata("design:type", String) | ||
], ToolbarOptions.prototype, "backgroundImage", void 0); | ||
ToolbarOptions = __decorate([ | ||
Form({ title: 'Toolbar options' }) | ||
], ToolbarOptions); | ||
return ToolbarOptions; | ||
})(); | ||
__decorate([ | ||
FormField({ title: 'Background Color', type: 'string' }), | ||
__metadata("design:type", String) | ||
], ToolbarOptions.prototype, "backgroundColor", void 0); | ||
__decorate([ | ||
FormField({ title: 'Flat', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "flat", void 0); | ||
__decorate([ | ||
FormField({ title: 'Dense', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "dense", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide Icon', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "hideIcon", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide Title', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "hideTitle", void 0); | ||
__decorate([ | ||
FormField({ title: 'Prominent', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "prominent", void 0); | ||
__decorate([ | ||
FormField({ title: 'Outlined', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "outlined", void 0); | ||
__decorate([ | ||
FormField({ title: 'Collapse', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "collapse", void 0); | ||
__decorate([ | ||
FormField({ title: 'Absolute', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], ToolbarOptions.prototype, "absolute", void 0); | ||
__decorate([ | ||
FormField({ title: 'Elevation', type: 'slider', min: 0, max: 10 }), | ||
__metadata("design:type", Number) | ||
], ToolbarOptions.prototype, "elevation", void 0); | ||
__decorate([ | ||
FormField({ title: 'Background Image', type: 'string' }), | ||
__metadata("design:type", String) | ||
], ToolbarOptions.prototype, "backgroundImage", void 0); | ||
ToolbarOptions = __decorate([ | ||
Form({ title: 'Toolbar options' }) | ||
], ToolbarOptions); | ||
export { ToolbarOptions }; | ||
//# sourceMappingURL=toolbar-options.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=datasource.js.map |
@@ -10,3 +10,8 @@ import 'reflect-metadata'; | ||
toolbarClass?: string; | ||
showPanels?: boolean; | ||
icon?: string; | ||
verbose?: boolean; | ||
isPanelOpen?: boolean; | ||
optionalSupport?: boolean; | ||
data?: any; | ||
keys?: boolean; | ||
@@ -40,3 +45,3 @@ groups?: { | ||
export interface IFormFieldOptions extends IFormFieldBaseOptions { | ||
type?: 'string' | 'textarea' | 'number' | 'slider' | 'chips' | 'colorpicker' | 'combobox' | 'combobox-objects' | 'checkboxes-horizontal' | 'checkbox' | 'object' | 'selection' | 'array' | 'keyvalue' | 'form' | 'union' | 'keysobject' | 'datetimepicker' | 'datepicker' | 'button-trigger' | 'rating' | 'component' | 'imagelist'; | ||
type?: 'string' | 'textarea' | 'number' | 'slider' | 'chips' | 'colorpicker' | 'combobox' | 'combobox-objects' | 'checkboxes-horizontal' | 'checkbox' | 'object' | 'selection' | 'keyvalue' | 'switch' | 'form' | 'union' | 'keysobject' | 'datetimepicker' | 'url' | 'group-buttons' | 'epochdatetimepicker' | 'datepicker' | 'button-trigger' | 'rating' | 'component' | 'imagelist'; | ||
defaultValue?: any; | ||
@@ -46,2 +51,4 @@ description?: string; | ||
group?: string; | ||
section?: string; | ||
array?: boolean; | ||
min?: number; | ||
@@ -53,2 +60,3 @@ max?: number; | ||
arrayType?: IFormOptions; | ||
arrayFieldType?: string; | ||
form?: IFormOptions; | ||
@@ -59,6 +67,9 @@ canDelete?: boolean; | ||
canEditKey?: boolean; | ||
data?: any; | ||
placeholder?: string; | ||
addUsingDialog?: boolean; | ||
newItem?: () => any; | ||
readonly?: boolean; | ||
keyText?: string; | ||
urlTemplate?: string; | ||
keyValue?: string; | ||
@@ -68,6 +79,9 @@ icon?: string; | ||
component?: any; | ||
selectedText?: string; | ||
hint?: string; | ||
persistentHint?: boolean; | ||
locale?: string; | ||
optional?: boolean; | ||
requirements?: ((value: object) => boolean)[]; | ||
arrayFilter?: ((value: object) => boolean); | ||
_appendIcon?: string; | ||
@@ -74,0 +88,0 @@ _isError?: boolean; |
@@ -19,3 +19,2 @@ import 'reflect-metadata'; | ||
options._model = object[key]; | ||
// let meta = Reflect.getMetadata("design:returntype", object, key); | ||
if (!object.hasOwnProperty('_form')) { | ||
@@ -31,3 +30,2 @@ object._form = { fields: [options] }; | ||
return function decorator(object, key, target) { | ||
// let res = Object.getOwnPropertyDescriptor(object,key); | ||
options._object = object; | ||
@@ -37,3 +35,2 @@ options._key = key; | ||
options._model = object[key]; | ||
// let meta = Reflect.getMetadata("design:returntype", object, key); | ||
if (!object.hasOwnProperty('_form')) { | ||
@@ -40,0 +37,0 @@ object._form = { fields: [options] }; |
@@ -13,2 +13,5 @@ import { IWidget } from './../widget/widget'; | ||
textInput?: boolean; | ||
defaultText?: string; | ||
placeholder?: string; | ||
input?: string; | ||
data?: any; | ||
@@ -15,0 +18,0 @@ width?: number | string; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=dialog.js.map |
@@ -0,1 +1,2 @@ | ||
import { IWidget } from '..'; | ||
import { IDashboard } from '../dashboard/dashboard'; | ||
@@ -24,5 +25,8 @@ export interface IMenu { | ||
component?: any; | ||
plugin?: any; | ||
widget?: IWidget; | ||
closeOnContentClick?: boolean; | ||
data?: any; | ||
location?: 'sidebar' | 'header' | 'footer' | 'floating'; | ||
_dashboard?: IDashboard; | ||
} |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=menu.js.map |
import { INotification } from './..'; | ||
/** options for notifications in project */ | ||
export interface INotificationOptions { | ||
/** show/hide notifictions */ | ||
enabled?: boolean; | ||
/** list of existing notifications */ | ||
items?: INotification[]; | ||
listStyle?: 'popup' | 'right-sidebar'; | ||
} |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=notification-options.js.map |
@@ -1,2 +0,1 @@ | ||
/** notification object */ | ||
export interface INotification { | ||
@@ -13,2 +12,3 @@ id?: string; | ||
buttonText?: string; | ||
group?: boolean; | ||
color?: string; | ||
@@ -15,0 +15,0 @@ _visible?: boolean; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=notification.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=search-options.js.map |
@@ -1,12 +0,8 @@ | ||
import { IProject, MessageBusService, IDashboard, INotification, IWidget, ISidebarOptions } from '..'; | ||
import { IProject, MessageBusService, IDashboard, INotification, IWidget, ISidebarOptions, Loader } from '..'; | ||
export declare abstract class AppStateBase { | ||
/** True if the application has been initialized */ | ||
isInitialized: boolean; | ||
/** Project definition */ | ||
project: IProject; | ||
/** Event bus for publish/subscribe events in application */ | ||
loader: Loader; | ||
get bus(): MessageBusService; | ||
/** list of past notifications */ | ||
notifications: INotification[]; | ||
/** Currently active dashboard */ | ||
activeDashboard?: IDashboard; | ||
@@ -13,0 +9,0 @@ data: { |
import { MainBus } from '..'; | ||
export class AppStateBase { | ||
constructor() { | ||
/** True if the application has been initialized */ | ||
this.isInitialized = false; | ||
/** Project definition */ | ||
this.project = {}; | ||
/** list of past notifications */ | ||
this.notifications = []; | ||
@@ -13,3 +10,2 @@ this.data = {}; | ||
} | ||
/** Event bus for publish/subscribe events in application */ | ||
get bus() { | ||
@@ -16,0 +12,0 @@ return MainBus.events; |
@@ -5,2 +5,3 @@ import { ThemeColors } from './theme-colors'; | ||
dark?: boolean; | ||
invertLogoInDarkMode?: boolean; | ||
colors?: ThemeColors; | ||
@@ -7,0 +8,0 @@ lightColors?: ThemeColors; |
@@ -1,49 +0,37 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
import { __decorate, __metadata } from "tslib"; | ||
import { ThemeColors } from './theme-colors'; | ||
import { Form, FormField } from '../form/form-decorators'; | ||
// Application look and feel | ||
let AppTheme = /** @class */ (() => { | ||
let AppTheme = class AppTheme { | ||
constructor(value) { | ||
this.colors = {}; | ||
this.lightColors = {}; | ||
this.darkColors = {}; | ||
if (value) { | ||
Object.assign(this, value); | ||
} | ||
let AppTheme = class AppTheme { | ||
constructor(value) { | ||
this.colors = {}; | ||
this.lightColors = {}; | ||
this.darkColors = {}; | ||
if (value) { | ||
Object.assign(this, value); | ||
} | ||
}; | ||
__decorate([ | ||
FormField({ title: 'Dark mode', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], AppTheme.prototype, "dark", void 0); | ||
__decorate([ | ||
FormField({ | ||
title: 'Light Colors', | ||
type: 'object', | ||
}), | ||
__metadata("design:type", ThemeColors) | ||
], AppTheme.prototype, "lightColors", void 0); | ||
__decorate([ | ||
FormField({ | ||
title: 'Dark colors Colors', | ||
type: "object" | ||
}), | ||
__metadata("design:type", ThemeColors) | ||
], AppTheme.prototype, "darkColors", void 0); | ||
AppTheme = __decorate([ | ||
Form({ title: 'Theme' }), | ||
__metadata("design:paramtypes", [AppTheme]) | ||
], AppTheme); | ||
return AppTheme; | ||
})(); | ||
} | ||
}; | ||
__decorate([ | ||
FormField({ title: 'Dark mode', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], AppTheme.prototype, "dark", void 0); | ||
__decorate([ | ||
FormField({ | ||
title: 'Light Colors', | ||
type: 'object', | ||
}), | ||
__metadata("design:type", ThemeColors) | ||
], AppTheme.prototype, "lightColors", void 0); | ||
__decorate([ | ||
FormField({ | ||
title: 'Dark colors Colors', | ||
type: "object" | ||
}), | ||
__metadata("design:type", ThemeColors) | ||
], AppTheme.prototype, "darkColors", void 0); | ||
AppTheme = __decorate([ | ||
Form({ title: 'Theme' }), | ||
__metadata("design:paramtypes", [AppTheme]) | ||
], AppTheme); | ||
export { AppTheme }; | ||
//# sourceMappingURL=app-theme.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=footer-options.js.map |
@@ -1,93 +0,80 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
import { __decorate, __metadata } from "tslib"; | ||
import { FormField, Form } from '../form/form-decorators'; | ||
let HeaderOptions = /** @class */ (() => { | ||
let HeaderOptions = class HeaderOptions { | ||
// #endregion Properties (20) | ||
// #region Constructors (1) | ||
constructor(options) { | ||
this.elevation = 5; | ||
if (options) { | ||
Object.assign(this, options); | ||
} | ||
let HeaderOptions = class HeaderOptions { | ||
constructor(options) { | ||
this.elevation = 5; | ||
if (options) { | ||
Object.assign(this, options); | ||
} | ||
}; | ||
__decorate([ | ||
FormField({ title: 'Use breadcrumbs', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "breadcrumbs", void 0); | ||
__decorate([ | ||
FormField({ title: 'Dense', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "dense", void 0); | ||
__decorate([ | ||
FormField({ title: 'Elevation', type: 'slider', min: 0, max: 20, group: 'toolbar layout' }), | ||
__metadata("design:type", Number) | ||
], HeaderOptions.prototype, "elevation", void 0); | ||
__decorate([ | ||
FormField({ title: 'Flat', type: 'checkbox', group: 'toolbar layout' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "flat", void 0); | ||
__decorate([ | ||
FormField({ title: 'Floating', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "floating", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide logo', type: 'checkbox', group: 'logo' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "hideLogo", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide menu toggle', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "hideMenuToggle", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide title', type: 'checkbox', group: 'title' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "hideTitle", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide toolbar', type: 'checkbox', group: 'toolbar layout' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "hideToolbar", void 0); | ||
__decorate([ | ||
FormField({ title: 'Logo', type: 'string', group: 'logo' }), | ||
__metadata("design:type", String) | ||
], HeaderOptions.prototype, "logo", void 0); | ||
__decorate([ | ||
FormField({ title: 'Show loading icon', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "showLoadingIcon", void 0); | ||
__decorate([ | ||
FormField({ title: 'Tabs centered', type: 'checkbox', group: 'tabs' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "tabsCentered", void 0); | ||
__decorate([ | ||
FormField({ title: 'Tabs grow', type: 'checkbox', group: 'tabs' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "tabsGrow", void 0); | ||
__decorate([ | ||
FormField({ title: 'Tabs hide slider', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "tabsHideSlider", void 0); | ||
__decorate([ | ||
FormField({ title: 'Tabs right', type: 'checkbox', group: 'tabs' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "tabsRight", void 0); | ||
__decorate([ | ||
FormField({ title: 'Title', type: 'string', group: 'title' }), | ||
__metadata("design:type", String) | ||
], HeaderOptions.prototype, "title", void 0); | ||
HeaderOptions = __decorate([ | ||
Form({ title: 'Header' }), | ||
__metadata("design:paramtypes", [HeaderOptions]) | ||
], HeaderOptions); | ||
return HeaderOptions; | ||
})(); | ||
} | ||
}; | ||
__decorate([ | ||
FormField({ title: 'Use breadcrumbs', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "breadcrumbs", void 0); | ||
__decorate([ | ||
FormField({ title: 'Dense', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "dense", void 0); | ||
__decorate([ | ||
FormField({ title: 'Elevation', type: 'slider', min: 0, max: 20, group: 'toolbar layout' }), | ||
__metadata("design:type", Number) | ||
], HeaderOptions.prototype, "elevation", void 0); | ||
__decorate([ | ||
FormField({ title: 'Flat', type: 'checkbox', group: 'toolbar layout' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "flat", void 0); | ||
__decorate([ | ||
FormField({ title: 'Floating', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "floating", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide logo', type: 'checkbox', group: 'logo' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "hideLogo", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide menu toggle', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "hideMenuToggle", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide title', type: 'checkbox', group: 'title' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "hideTitle", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide toolbar', type: 'checkbox', group: 'toolbar layout' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "hideToolbar", void 0); | ||
__decorate([ | ||
FormField({ title: 'Logo', type: 'string', group: 'logo' }), | ||
__metadata("design:type", String) | ||
], HeaderOptions.prototype, "logo", void 0); | ||
__decorate([ | ||
FormField({ title: 'Show loading icon', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "showLoadingIcon", void 0); | ||
__decorate([ | ||
FormField({ title: 'Tabs centered', type: 'checkbox', group: 'tabs' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "tabsCentered", void 0); | ||
__decorate([ | ||
FormField({ title: 'Tabs grow', type: 'checkbox', group: 'tabs' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "tabsGrow", void 0); | ||
__decorate([ | ||
FormField({ title: 'Tabs hide slider', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "tabsHideSlider", void 0); | ||
__decorate([ | ||
FormField({ title: 'Tabs right', type: 'checkbox', group: 'tabs' }), | ||
__metadata("design:type", Boolean) | ||
], HeaderOptions.prototype, "tabsRight", void 0); | ||
__decorate([ | ||
FormField({ title: 'Title', type: 'string', group: 'title' }), | ||
__metadata("design:type", String) | ||
], HeaderOptions.prototype, "title", void 0); | ||
HeaderOptions = __decorate([ | ||
Form({ title: 'Header' }), | ||
__metadata("design:paramtypes", [HeaderOptions]) | ||
], HeaderOptions); | ||
export { HeaderOptions }; | ||
//# sourceMappingURL=header-options.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=language-options.js.map |
@@ -1,36 +0,23 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
import { __decorate, __metadata } from "tslib"; | ||
import { Form, FormField } from '../form/form-decorators'; | ||
let NavigationOptions = /** @class */ (() => { | ||
let NavigationOptions = class NavigationOptions { | ||
// #endregion Properties (2) | ||
// #region Constructors (1) | ||
constructor(options) { | ||
if (options) { | ||
Object.assign(this, options); | ||
} | ||
let NavigationOptions = class NavigationOptions { | ||
constructor(options) { | ||
if (options) { | ||
Object.assign(this, options); | ||
} | ||
}; | ||
__decorate([ | ||
FormField({ title: 'style', type: 'combobox', options: ['left-hierarchy', 'tabs', 'bottom', 'mobile'] }), | ||
__metadata("design:type", String) | ||
], NavigationOptions.prototype, "style", void 0); | ||
__decorate([ | ||
FormField({ title: 'auto mobile bottom', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], NavigationOptions.prototype, "autoMobileBottom", void 0); | ||
NavigationOptions = __decorate([ | ||
Form({ title: 'Navigation' }), | ||
__metadata("design:paramtypes", [NavigationOptions]) | ||
], NavigationOptions); | ||
return NavigationOptions; | ||
})(); | ||
} | ||
}; | ||
__decorate([ | ||
FormField({ title: 'style', type: 'combobox', options: ['left-hierarchy', 'tabs', 'bottom', 'mobile'] }), | ||
__metadata("design:type", String) | ||
], NavigationOptions.prototype, "style", void 0); | ||
__decorate([ | ||
FormField({ title: 'auto mobile bottom', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], NavigationOptions.prototype, "autoMobileBottom", void 0); | ||
NavigationOptions = __decorate([ | ||
Form({ title: 'Navigation' }), | ||
__metadata("design:paramtypes", [NavigationOptions]) | ||
], NavigationOptions); | ||
export { NavigationOptions }; | ||
//# sourceMappingURL=navigation-options.js.map |
import { AppTheme, HeaderOptions, IFooterOptions, IDatasource, IDashboard, ISidebarOptions, NavigationOptions, ILanguageOptions, ServerConnection, IMenu, INotificationOptions, IUserOptions } from './..'; | ||
/** project definition */ | ||
export interface IProject { | ||
@@ -13,3 +12,2 @@ id?: string; | ||
}; | ||
/** list of dashboards */ | ||
dashboards?: IDashboard[]; | ||
@@ -16,0 +14,0 @@ leftSidebar?: ISidebarOptions; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=project.js.map |
@@ -1,64 +0,53 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
import { __decorate, __metadata } from "tslib"; | ||
import { FormField, Form } from '../form/form-decorators'; | ||
let SidebarOptions = class SidebarOptions { | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
import { FormField, Form } from '../form/form-decorators'; | ||
let SidebarOptions = /** @class */ (() => { | ||
let SidebarOptions = class SidebarOptions { | ||
}; | ||
__decorate([ | ||
FormField({ title: 'Is Open', type: 'checkbox', group: 'open' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "open", void 0); | ||
__decorate([ | ||
FormField({ title: 'Permanent', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "permanent", void 0); | ||
__decorate([ | ||
FormField({ title: 'Persistent', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "persistent", void 0); | ||
__decorate([ | ||
FormField({ title: 'Temporary', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "temporary", void 0); | ||
__decorate([ | ||
FormField({ title: 'Floating', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "floating", void 0); | ||
__decorate([ | ||
FormField({ title: 'Mini', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "mini", void 0); | ||
__decorate([ | ||
FormField({ title: 'Clipped', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "clipped", void 0); | ||
__decorate([ | ||
FormField({ title: 'Can Pin', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "canPin", void 0); | ||
__decorate([ | ||
FormField({ title: 'Can be minified', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "canMinify", void 0); | ||
__decorate([ | ||
FormField({ title: 'Width', type: 'number' }), | ||
__metadata("design:type", Number) | ||
], SidebarOptions.prototype, "width", void 0); | ||
__decorate([ | ||
FormField({ title: 'Visible', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "visible", void 0); | ||
SidebarOptions = __decorate([ | ||
Form({ title: 'Sidebar' }) | ||
], SidebarOptions); | ||
return SidebarOptions; | ||
})(); | ||
__decorate([ | ||
FormField({ title: 'Is Open', type: 'checkbox', group: 'open' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "open", void 0); | ||
__decorate([ | ||
FormField({ title: 'Permanent', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "permanent", void 0); | ||
__decorate([ | ||
FormField({ title: 'Persistent', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "persistent", void 0); | ||
__decorate([ | ||
FormField({ title: 'Temporary', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "temporary", void 0); | ||
__decorate([ | ||
FormField({ title: 'Floating', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "floating", void 0); | ||
__decorate([ | ||
FormField({ title: 'Mini', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "mini", void 0); | ||
__decorate([ | ||
FormField({ title: 'Clipped', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "clipped", void 0); | ||
__decorate([ | ||
FormField({ title: 'Can Pin', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "canPin", void 0); | ||
__decorate([ | ||
FormField({ title: 'Can be minified', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "canMinify", void 0); | ||
__decorate([ | ||
FormField({ title: 'Width', type: 'number' }), | ||
__metadata("design:type", Number) | ||
], SidebarOptions.prototype, "width", void 0); | ||
__decorate([ | ||
FormField({ title: 'Visible', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], SidebarOptions.prototype, "visible", void 0); | ||
SidebarOptions = __decorate([ | ||
Form({ title: 'Sidebar' }) | ||
], SidebarOptions); | ||
export { SidebarOptions }; | ||
//# sourceMappingURL=sidebar-options.js.map |
@@ -1,36 +0,25 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
import { __decorate, __metadata } from "tslib"; | ||
import { Form, FormField } from './../form/form-decorators'; | ||
let ThemeColors = class ThemeColors { | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
import { Form, FormField } from './../form/form-decorators'; | ||
let ThemeColors = /** @class */ (() => { | ||
let ThemeColors = class ThemeColors { | ||
}; | ||
__decorate([ | ||
FormField({ title: 'Primary', type: 'string' }), | ||
__metadata("design:type", String) | ||
], ThemeColors.prototype, "primary", void 0); | ||
__decorate([ | ||
FormField({ title: 'Secondary', type: 'string' }), | ||
__metadata("design:type", String) | ||
], ThemeColors.prototype, "secondary", void 0); | ||
__decorate([ | ||
FormField({ title: 'Accent', type: 'string' }), | ||
__metadata("design:type", String) | ||
], ThemeColors.prototype, "accent", void 0); | ||
__decorate([ | ||
FormField({ title: 'Error', type: 'string' }), | ||
__metadata("design:type", String) | ||
], ThemeColors.prototype, "error", void 0); | ||
ThemeColors = __decorate([ | ||
Form({ title: 'Theme Colors' }) | ||
], ThemeColors); | ||
return ThemeColors; | ||
})(); | ||
__decorate([ | ||
FormField({ title: 'Primary', type: 'string' }), | ||
__metadata("design:type", String) | ||
], ThemeColors.prototype, "primary", void 0); | ||
__decorate([ | ||
FormField({ title: 'Secondary', type: 'string' }), | ||
__metadata("design:type", String) | ||
], ThemeColors.prototype, "secondary", void 0); | ||
__decorate([ | ||
FormField({ title: 'Accent', type: 'string' }), | ||
__metadata("design:type", String) | ||
], ThemeColors.prototype, "accent", void 0); | ||
__decorate([ | ||
FormField({ title: 'Error', type: 'string' }), | ||
__metadata("design:type", String) | ||
], ThemeColors.prototype, "error", void 0); | ||
ThemeColors = __decorate([ | ||
Form({ title: 'Theme Colors' }) | ||
], ThemeColors); | ||
export { ThemeColors }; | ||
//# sourceMappingURL=theme-colors.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=user-options.js.map |
@@ -1,1 +0,1 @@ | ||
export declare function isFunction(functionToCheck: any): boolean; | ||
export declare function isFunction(functionToCheck: any): any; |
export declare function guidGenerator(): string; | ||
export declare function idGenerator(): string; | ||
export declare function numberGenerator(): number; | ||
export declare function generateHash(text: string): number; |
export function guidGenerator() { | ||
const S4 = () => { | ||
// tslint:disable-next-line:no-bitwise | ||
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); | ||
}; | ||
return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4()); | ||
return (S4() + | ||
S4() + | ||
"-" + | ||
S4() + | ||
"-" + | ||
S4() + | ||
"-" + | ||
S4() + | ||
"-" + | ||
S4() + | ||
S4() + | ||
S4()); | ||
} | ||
export function idGenerator() { | ||
const S4 = () => { | ||
// tslint:disable-next-line:no-bitwise | ||
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); | ||
}; | ||
return (S4() + S4()); | ||
return S4() + S4(); | ||
} | ||
@@ -18,2 +27,13 @@ export function numberGenerator() { | ||
} | ||
export function generateHash(text) { | ||
var hash = 0, i, chr; | ||
if (text.length === 0) | ||
return hash; | ||
for (i = 0; i < text.length; i++) { | ||
chr = text.charCodeAt(i); | ||
hash = (hash << 5) - hash + chr; | ||
hash |= 0; | ||
} | ||
return hash; | ||
} | ||
//# sourceMappingURL=guid.js.map |
@@ -1,6 +0,6 @@ | ||
/** project definition */ | ||
export declare class Info { | ||
title?: string; | ||
markdownUrl?: string; | ||
mdContent?: string; | ||
tabs?: Info[]; | ||
} |
@@ -1,4 +0,3 @@ | ||
/** project definition */ | ||
export class Info { | ||
} | ||
//# sourceMappingURL=info.js.map |
@@ -0,1 +1,2 @@ | ||
import { INotification } from '../interactions/notification'; | ||
import { MessageBusService } from './message-bus/message-bus-service'; | ||
@@ -5,3 +6,4 @@ export declare class Loader { | ||
static LOADERS: string; | ||
static LOADER_UPDATED: string; | ||
static LOADER_ADDED: string; | ||
static LOADER_REMOVED: string; | ||
loading: boolean; | ||
@@ -12,3 +14,3 @@ protected loaders: { | ||
constructor(bus?: MessageBusService | undefined); | ||
addLoader(id?: string, title?: string): string; | ||
addLoader(id?: string, title?: string, notification?: INotification): string; | ||
removeLoader(id: string): void; | ||
@@ -15,0 +17,0 @@ getLoaders(): { |
import { guidGenerator } from '..'; | ||
let Loader = /** @class */ (() => { | ||
class Loader { | ||
constructor(bus) { | ||
this.bus = bus; | ||
this.loading = false; | ||
this.loaders = {}; | ||
export class Loader { | ||
constructor(bus) { | ||
this.bus = bus; | ||
this.loading = false; | ||
this.loaders = {}; | ||
} | ||
addLoader(id, title, notification) { | ||
var _a; | ||
if (id === undefined) { | ||
id = guidGenerator(); | ||
} | ||
addLoader(id, title) { | ||
if (id === undefined) { | ||
id = guidGenerator(); | ||
} | ||
this.loaders[id] = title || id; | ||
if (notification && !notification.title) { | ||
notification.title = (_a = notification.title) !== null && _a !== void 0 ? _a : notification.id; | ||
} | ||
; | ||
this.loaders[id] = { title: title || id, notification }; | ||
this.loading = Object.keys(this.loaders).length > 0; | ||
if (this.bus) { | ||
this.bus.publish(Loader.LOADERS, Loader.LOADER_ADDED, { loaders: this.loaders, id: id, title: title, notification: notification }); | ||
} | ||
return id; | ||
} | ||
removeLoader(id) { | ||
if (this.loaders.hasOwnProperty(id)) { | ||
const notification = this.loaders[id].notification; | ||
delete this.loaders[id]; | ||
this.loading = Object.keys(this.loaders).length > 0; | ||
if (this.bus) { | ||
this.bus.publish(Loader.LOADERS, Loader.LOADER_UPDATED); | ||
this.bus.publish(Loader.LOADERS, Loader.LOADER_REMOVED, { loaders: this.loaders, id: id, notification: notification }); | ||
} | ||
return id; | ||
} | ||
// remove a loader, if this is the last loader it disables the loading icon in the header | ||
removeLoader(id) { | ||
if (this.loaders.hasOwnProperty(id)) { | ||
delete this.loaders[id]; | ||
this.loading = Object.keys(this.loaders).length > 0; | ||
if (this.bus) { | ||
this.bus.publish(Loader.LOADERS, Loader.LOADER_UPDATED); | ||
} | ||
} | ||
} | ||
// returns the list of existing loaders | ||
getLoaders() { | ||
return this.loaders; | ||
} | ||
} | ||
Loader.LOADERS = 'loaders'; | ||
Loader.LOADER_UPDATED = 'updated'; | ||
return Loader; | ||
})(); | ||
export { Loader }; | ||
getLoaders() { | ||
return this.loaders; | ||
} | ||
} | ||
Loader.LOADERS = 'loaders'; | ||
Loader.LOADER_ADDED = 'added'; | ||
Loader.LOADER_REMOVED = 'added'; | ||
//# sourceMappingURL=loader.js.map |
@@ -1,4 +0,1 @@ | ||
// Interface for message bus callbacks, i.e. (data: any) => any, | ||
// so you can supply a single data argument of any type, and it may return any type. | ||
// Handle returned when subscribing to a topic | ||
export class MessageBusHandle { | ||
@@ -5,0 +2,0 @@ constructor(topic, callback) { |
import { IMessageBusService, MessageBusHandle, IMessageBusCallback } from '../..'; | ||
/** Helper class to manage message bus subscriptions/handles. Is used by Widget and Dashboard managers */ | ||
export declare class MessageBusManager { | ||
@@ -4,0 +3,0 @@ busHandlers: { |
@@ -1,2 +0,1 @@ | ||
/** Helper class to manage message bus subscriptions/handles. Is used by Widget and Dashboard managers */ | ||
export class MessageBusManager { | ||
@@ -6,4 +5,3 @@ constructor() { | ||
} | ||
start() { | ||
} | ||
start() { } | ||
stop() { | ||
@@ -24,9 +22,6 @@ for (const id in this.busHandlers) { | ||
} | ||
// if id not specified, create bus-topic specific id | ||
if (id === undefined) { | ||
id = `${bus.id}-${topic}`; | ||
} | ||
// allow only one handler instance with a single id | ||
if (!this.busHandlers.hasOwnProperty(id)) { | ||
// subscribe and register handler | ||
this.busHandlers[id] = { bus: bus, handle: bus.subscribe(topic, callback) }; | ||
@@ -33,0 +28,0 @@ } |
@@ -8,6 +8,2 @@ import { MessageBusHandle, IMessageBusCallback } from './message-bus-handle'; | ||
} | ||
/** | ||
* Simple message bus service, used for subscribing and unsubsubscribing to topics. | ||
* @see {@link https://gist.github.com/floatingmonkey/3384419} | ||
*/ | ||
export declare class MessageBusService implements IMessageBusService { | ||
@@ -18,16 +14,5 @@ private cache; | ||
constructor(); | ||
/** | ||
* Publish to a topic | ||
*/ | ||
publish(topic: string, title: string, data?: any): void; | ||
/** | ||
* Subscribe to a topic | ||
* @param {string} topic The desired topic of the message. | ||
* @param {IMessageBusCallback} callback The callback to call. | ||
*/ | ||
subscribe(topic: string, callback: IMessageBusCallback): MessageBusHandle; | ||
/** | ||
* Unsubscribe to a topic by providing its handle | ||
*/ | ||
unsubscribe(handle: MessageBusHandle): void; | ||
} |
import { MessageBusHandle } from './message-bus-handle'; | ||
import { guidGenerator } from '../guid'; | ||
/** | ||
* Simple message bus service, used for subscribing and unsubsubscribing to topics. | ||
* @see {@link https://gist.github.com/floatingmonkey/3384419} | ||
*/ | ||
export class MessageBusService { | ||
@@ -13,7 +9,3 @@ constructor() { | ||
} | ||
/** | ||
* Publish to a topic | ||
*/ | ||
publish(topic, title, data) { | ||
// window.console.log('publish: ' + topic + ', ' + title); | ||
if (!this.cache[topic]) { | ||
@@ -26,7 +18,2 @@ return; | ||
} | ||
/** | ||
* Subscribe to a topic | ||
* @param {string} topic The desired topic of the message. | ||
* @param {IMessageBusCallback} callback The callback to call. | ||
*/ | ||
subscribe(topic, callback) { | ||
@@ -39,5 +26,2 @@ if (!this.cache[topic]) { | ||
} | ||
/** | ||
* Unsubscribe to a topic by providing its handle | ||
*/ | ||
unsubscribe(handle) { | ||
@@ -44,0 +28,0 @@ const topic = handle.topic; |
export class TypedEvent { | ||
constructor() { | ||
// Private member vars | ||
// tslint:disable-next-line:variable-name | ||
this._listeners = []; | ||
} | ||
add(listener) { | ||
/// <summary>Registers a new listener for the event.</summary> | ||
/// <param name='listener'>The callback function to register.</param> | ||
this._listeners.push(listener); | ||
} | ||
remove(listener) { | ||
/// <summary>Unregisters a listener from the event.</summary> | ||
/// <param name='listener'>The callback function that was registered. If missing then all listeners will be removed.</param> | ||
if (typeof listener === 'function') { | ||
@@ -28,5 +22,2 @@ for (let i = 0, l = this._listeners.length; i < l; l++) { | ||
trigger(...a) { | ||
/// <summary>Invokes all of the listeners for this event.</summary> | ||
/// <param name='args'>Optional set of arguments to pass to listners.</param> | ||
// tslint:disable-next-line:prefer-const | ||
let context = {}; | ||
@@ -33,0 +24,0 @@ const listeners = this._listeners.slice(0); |
@@ -1,4 +0,1 @@ | ||
/** | ||
* Listen for events of Type T | ||
*/ | ||
export declare type IListener<T> = (event: T) => any; | ||
@@ -8,20 +5,2 @@ export interface IDisposable { | ||
} | ||
/** | ||
* Typed EventEmitter, passes through events as they happen. | ||
* You will not get events from before you start listening | ||
* | ||
* @see https://basarat.gitbooks.io/typescript/docs/tips/typed-event.html | ||
* | ||
* Usage: | ||
* const onFoo = new EventEmitter<Foo>(); | ||
* const onBar = new EventEmitter<Bar>(); | ||
* | ||
* // Emit: | ||
* onFoo.emit(foo); | ||
* onBar.emit(bar); | ||
* | ||
* // Listen: | ||
* onFoo.on((foo)=>console.log(foo)); | ||
* onBar.on((bar)=>console.log(bar)); | ||
*/ | ||
export declare class EventEmitter<T> { | ||
@@ -28,0 +7,0 @@ private listeners; |
@@ -1,19 +0,1 @@ | ||
/** | ||
* Typed EventEmitter, passes through events as they happen. | ||
* You will not get events from before you start listening | ||
* | ||
* @see https://basarat.gitbooks.io/typescript/docs/tips/typed-event.html | ||
* | ||
* Usage: | ||
* const onFoo = new EventEmitter<Foo>(); | ||
* const onBar = new EventEmitter<Bar>(); | ||
* | ||
* // Emit: | ||
* onFoo.emit(foo); | ||
* onBar.emit(bar); | ||
* | ||
* // Listen: | ||
* onFoo.on((foo)=>console.log(foo)); | ||
* onBar.on((bar)=>console.log(bar)); | ||
*/ | ||
export class EventEmitter { | ||
@@ -40,5 +22,3 @@ constructor() { | ||
emit(event) { | ||
/** Update any general listeners */ | ||
this.listeners.forEach((listener) => listener(event)); | ||
/** Clear the `once` queue */ | ||
this.listenersOncer.forEach((listener) => listener(event)); | ||
@@ -45,0 +25,0 @@ this.listenersOncer = []; |
@@ -11,3 +11,2 @@ import { IMenu, ToolbarOptions } from './../'; | ||
y?: number; | ||
/** set as dashboard background widget */ | ||
background?: boolean; | ||
@@ -31,8 +30,6 @@ canRemove?: boolean; | ||
raised?: boolean; | ||
/** adds a close button that will remove widget and close rightsidebar */ | ||
closeSidebarButton?: boolean; | ||
/** adds a hide button that will close rightsidebar, but not remove widget/menu item */ | ||
hideSidebarButton?: boolean; | ||
/** if using a cssgrid dashboard with area defintions, you can define the area defintition here */ | ||
area?: string; | ||
sync?: 'widget' | 'dashboard' | 'manager' | 'datasource' | 'global'; | ||
} |
@@ -1,68 +0,57 @@ | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
import { __decorate, __metadata } from "tslib"; | ||
import { FormField, Form } from '../form/form-decorators'; | ||
let WidgetOptions = class WidgetOptions { | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
import { FormField, Form } from '../form/form-decorators'; | ||
let WidgetOptions = /** @class */ (() => { | ||
let WidgetOptions = class WidgetOptions { | ||
}; | ||
__decorate([ | ||
FormField({ title: 'Background Color', type: 'string' }), | ||
__metadata("design:type", String) | ||
], WidgetOptions.prototype, "backgroundColor", void 0); | ||
__decorate([ | ||
FormField({ title: 'Icon', type: 'string' }), | ||
__metadata("design:type", String) | ||
], WidgetOptions.prototype, "icon", void 0); | ||
__decorate([ | ||
FormField({ title: 'Search', type: 'string' }), | ||
__metadata("design:type", String) | ||
], WidgetOptions.prototype, "searchProperty", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide menu', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], WidgetOptions.prototype, "hideMenu", void 0); | ||
__decorate([ | ||
FormField({ title: 'Show toolbar', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], WidgetOptions.prototype, "showToolbar", void 0); | ||
__decorate([ | ||
FormField({ title: 'Title', type: 'string' }), | ||
__metadata("design:type", String) | ||
], WidgetOptions.prototype, "title", void 0); | ||
__decorate([ | ||
FormField({ title: 'Disabled', type: 'checkbox' }), | ||
__metadata("design:type", String) | ||
], WidgetOptions.prototype, "disabled", void 0); | ||
__decorate([ | ||
FormField({ title: 'Tile', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], WidgetOptions.prototype, "tile", void 0); | ||
__decorate([ | ||
FormField({ title: 'Elevation', type: 'slider', min: 0, max: 10 }), | ||
__metadata("design:type", Number) | ||
], WidgetOptions.prototype, "elevation", void 0); | ||
__decorate([ | ||
FormField({ title: 'Flat', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], WidgetOptions.prototype, "flat", void 0); | ||
__decorate([ | ||
FormField({ title: 'Outlined', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], WidgetOptions.prototype, "outlined", void 0); | ||
__decorate([ | ||
FormField({ title: 'Raised', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], WidgetOptions.prototype, "raised", void 0); | ||
WidgetOptions = __decorate([ | ||
Form({ title: 'Widget Options' }) | ||
], WidgetOptions); | ||
return WidgetOptions; | ||
})(); | ||
__decorate([ | ||
FormField({ title: 'Background Color', type: 'string' }), | ||
__metadata("design:type", String) | ||
], WidgetOptions.prototype, "backgroundColor", void 0); | ||
__decorate([ | ||
FormField({ title: 'Icon', type: 'string' }), | ||
__metadata("design:type", String) | ||
], WidgetOptions.prototype, "icon", void 0); | ||
__decorate([ | ||
FormField({ title: 'Search', type: 'string' }), | ||
__metadata("design:type", String) | ||
], WidgetOptions.prototype, "searchProperty", void 0); | ||
__decorate([ | ||
FormField({ title: 'Hide menu', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], WidgetOptions.prototype, "hideMenu", void 0); | ||
__decorate([ | ||
FormField({ title: 'Show toolbar', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], WidgetOptions.prototype, "showToolbar", void 0); | ||
__decorate([ | ||
FormField({ title: 'Title', type: 'string' }), | ||
__metadata("design:type", String) | ||
], WidgetOptions.prototype, "title", void 0); | ||
__decorate([ | ||
FormField({ title: 'Disabled', type: 'checkbox' }), | ||
__metadata("design:type", String) | ||
], WidgetOptions.prototype, "disabled", void 0); | ||
__decorate([ | ||
FormField({ title: 'Tile', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], WidgetOptions.prototype, "tile", void 0); | ||
__decorate([ | ||
FormField({ title: 'Elevation', type: 'slider', min: 0, max: 10 }), | ||
__metadata("design:type", Number) | ||
], WidgetOptions.prototype, "elevation", void 0); | ||
__decorate([ | ||
FormField({ title: 'Flat', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], WidgetOptions.prototype, "flat", void 0); | ||
__decorate([ | ||
FormField({ title: 'Outlined', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], WidgetOptions.prototype, "outlined", void 0); | ||
__decorate([ | ||
FormField({ title: 'Raised', type: 'checkbox' }), | ||
__metadata("design:type", Boolean) | ||
], WidgetOptions.prototype, "raised", void 0); | ||
WidgetOptions = __decorate([ | ||
Form({ title: 'Widget Options' }) | ||
], WidgetOptions); | ||
export { WidgetOptions }; | ||
//# sourceMappingURL=widget-options.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=widget-size.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=widget.js.map |
{ | ||
"name": "@csnext/cs-core", | ||
"version": "0.0.132-alpha.54+43ef7aee", | ||
"description": "cscore", | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"url": "https://github.com/TNOCS/csnext", | ||
"bugs": "https://github.com/TNOCS/csnext/issues", | ||
"license": "MIT", | ||
"scripts": { | ||
"link": "yarn link", | ||
"unlink": "yarn unlink", | ||
"dev": "tsc -w", | ||
"clean": "del-cli package-lock.json yarn.lock yarn-error.log dist lib node_modules tsconfig.tsbuildinfo", | ||
"build": "tsc" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"typescript-collections": "^1.3.3" | ||
}, | ||
"devDependencies": { | ||
"@types/socket.io-client": "^1.4.34" | ||
}, | ||
"gitHead": "43ef7aeea0e4f3e78641bbf047b52eb9cc7bf0da" | ||
"name": "@csnext/cs-core", | ||
"version": "0.0.132-alpha.448+9e227223", | ||
"description": "cscore", | ||
"exports": { | ||
".": "./lib/cscore.cs.js", | ||
"./module": "./lib/cscore.mjs" | ||
}, | ||
"main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"url": "https://github.com/TNOCS/csnext", | ||
"bugs": "https://github.com/TNOCS/csnext/issues", | ||
"license": "MIT", | ||
"scripts": { | ||
"fixrouter": "del-cli node_modules/@csnext", | ||
"link": "yarn link", | ||
"build:pack": "yarn pack --filename ../../dist/cs-core.tgz", | ||
"unlink": "yarn unlink", | ||
"dev": "nodemon --watch webpack.config.js --exec \"webpack --watch --env dev --mode development\"", | ||
"build": "tsc && webpack --mode development", | ||
"build:production": "webpack --mode development && tsc", | ||
"clean": "del-cli package-lock.json yarn.lock yarn-error.log dist lib node_modules tsconfig.tsbuildinfo" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"typescript-collections": "^1.3.3" | ||
}, | ||
"gitHead": "9e22722319d9ca132b28a6a292e35ae426558c0e" | ||
} |
@@ -14,4 +14,7 @@ export class Topics { | ||
public static readonly RESIZE = 'resize'; | ||
public static readonly RESIZE_STARTED = 'started'; | ||
public static readonly RESIZE_CHANGED = 'changed'; | ||
public static readonly DASHBOARD = "dashboard"; | ||
public static readonly DASHBOARD_RELOAD = "dashboard-reload"; | ||
} |
@@ -7,2 +7,3 @@ import { IWidget, IDashboard } from './..'; | ||
dashboardLoaded?: () => void; | ||
data?: any; | ||
contentLoaded?: (d: any) => void; | ||
@@ -12,2 +13,3 @@ editDashboard?: (dashboard: IDashboard) => void; | ||
removeWidget?: (widget: IWidget) => void; | ||
_contentHasBeenLoaded?: boolean; | ||
} |
@@ -16,2 +16,6 @@ import { IDashboard } from './dashboard'; | ||
_dashboard?: IDashboard; | ||
// width of sidebar if this dashboard is hosted in a sidebar | ||
sidebarWidth?: number | string; | ||
sidebarTemporary?: boolean; | ||
sidebarExpanded?: boolean; | ||
info?: InfoOptions | string; | ||
@@ -18,0 +22,0 @@ // trigger dashboard using keyboard short cut |
@@ -29,3 +29,3 @@ import { IFooterOptions, IDashboardManager, IWidget, WidgetOptions, ISidebarOptions, IDashboardOptions, IMessageBusService, IMenu, Info } from '../'; | ||
options?: IDashboardOptions; | ||
options?: IDashboardOptions; | ||
@@ -32,0 +32,0 @@ // list of widgets |
@@ -9,3 +9,4 @@ import { BaseDashboardOptions } from './dashboard-options'; | ||
public icons?: boolean = false; | ||
public storeActive?: boolean = false; | ||
public toolBarTabs?: boolean = false; | ||
} |
@@ -17,2 +17,4 @@ import { FormField, Form } from '../form/form-decorators'; | ||
public prominent?: boolean; | ||
@FormField({ title: 'Outlined', type: 'checkbox' }) | ||
public outlined?: boolean; | ||
@FormField({ title: 'Collapse', type: 'checkbox' }) | ||
@@ -19,0 +21,0 @@ public collapse?: boolean; |
@@ -12,3 +12,3 @@ import { MessageBusService } from '../utils/message-bus/message-bus-service'; | ||
loaded?: boolean; | ||
events?: MessageBusService; | ||
events?: MessageBusService; | ||
// tslint:disable-next-line:ban-types | ||
@@ -15,0 +15,0 @@ requestQueue?: Array<{ resolve: Function; reject: Function }>; |
@@ -11,3 +11,8 @@ import 'reflect-metadata'; | ||
toolbarClass?: string; | ||
showPanels?: boolean; | ||
icon?: string; | ||
verbose?: boolean; | ||
isPanelOpen?: boolean; | ||
optionalSupport?: boolean; | ||
data?: any; | ||
keys?: boolean; | ||
@@ -55,5 +60,5 @@ groups?: { [name: string]: IFormGroupOptions }; | ||
| 'object' | ||
| 'selection' | ||
| 'array' | ||
| 'selection' | ||
| 'keyvalue' | ||
| 'switch' | ||
| 'form' | ||
@@ -63,2 +68,5 @@ | 'union' | ||
| 'datetimepicker' | ||
| 'url' | ||
| 'group-buttons' | ||
| 'epochdatetimepicker' | ||
| 'datepicker' | ||
@@ -73,2 +81,4 @@ | 'button-trigger' | ||
group?: string; | ||
section?: string; | ||
array?: boolean; | ||
min?: number; | ||
@@ -80,2 +90,3 @@ max?: number; | ||
arrayType?: IFormOptions; | ||
arrayFieldType?: string; | ||
form?: IFormOptions; | ||
@@ -86,6 +97,9 @@ canDelete?: boolean; | ||
canEditKey?: boolean; | ||
data?: any; | ||
placeholder?: string; | ||
addUsingDialog?: boolean; | ||
newItem?: ()=>any; | ||
readonly?: boolean; | ||
keyText?: string; | ||
urlTemplate?: string; | ||
keyValue?: string; | ||
@@ -95,6 +109,9 @@ icon?: string; | ||
component?: any; | ||
selectedText?: string; | ||
hint?: string; | ||
persistentHint?: boolean; | ||
locale?: string; | ||
optional?: boolean; | ||
requirements?: ((value: object) => boolean)[]; | ||
arrayFilter?: ((value: object) => boolean); | ||
_appendIcon?: string; | ||
@@ -101,0 +118,0 @@ _isError?: boolean; |
@@ -14,2 +14,5 @@ | ||
textInput?: boolean; | ||
defaultText?: string; | ||
placeholder?: string; | ||
input?: string; | ||
// toolbar?: boolean; | ||
@@ -16,0 +19,0 @@ data?: any; |
@@ -0,1 +1,2 @@ | ||
import { IWidget } from '..'; | ||
import { IDashboard } from '../dashboard/dashboard'; | ||
@@ -25,5 +26,8 @@ | ||
component?: any; | ||
plugin?: any; | ||
widget?: IWidget; | ||
closeOnContentClick?: boolean; | ||
data?: any; | ||
location?: 'sidebar' | 'header' | 'footer' | 'floating'; | ||
_dashboard?: IDashboard; | ||
} |
@@ -13,2 +13,3 @@ /** notification object */ | ||
buttonText?: string; | ||
group?: boolean; | ||
color?: string; | ||
@@ -15,0 +16,0 @@ // tslint:disable-next-line:variable-name |
@@ -8,3 +8,4 @@ import { | ||
IWidget, | ||
ISidebarOptions | ||
ISidebarOptions, | ||
Loader | ||
} from '..'; | ||
@@ -19,2 +20,4 @@ | ||
public loader!: Loader; | ||
/** Event bus for publish/subscribe events in application */ | ||
@@ -21,0 +24,0 @@ |
@@ -16,2 +16,3 @@ import { ThemeColors } from './theme-colors'; | ||
public dark?: boolean; | ||
public invertLogoInDarkMode?: boolean; | ||
public colors?: ThemeColors = {}; | ||
@@ -18,0 +19,0 @@ @FormField({ |
@@ -1,2 +0,2 @@ | ||
export function guidGenerator() { | ||
export function guidGenerator(): string { | ||
const S4 = () => { | ||
@@ -6,3 +6,16 @@ // tslint:disable-next-line:no-bitwise | ||
}; | ||
return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4()); | ||
return ( | ||
S4() + | ||
S4() + | ||
"-" + | ||
S4() + | ||
"-" + | ||
S4() + | ||
"-" + | ||
S4() + | ||
"-" + | ||
S4() + | ||
S4() + | ||
S4() | ||
); | ||
} | ||
@@ -15,3 +28,3 @@ | ||
}; | ||
return (S4() + S4()); | ||
return S4() + S4(); | ||
} | ||
@@ -22,1 +35,14 @@ | ||
} | ||
export function generateHash(text: string) { | ||
var hash = 0, | ||
i, | ||
chr; | ||
if (text.length === 0) return hash; | ||
for (i = 0; i < text.length; i++) { | ||
chr = text.charCodeAt(i); | ||
hash = (hash << 5) - hash + chr; | ||
hash |= 0; // Convert to 32bit integer | ||
} | ||
return hash; | ||
} |
@@ -6,3 +6,4 @@ | ||
markdownUrl?: string; | ||
mdContent?: string; | ||
tabs?: Info[]; | ||
} |
import { guidGenerator } from '..'; | ||
import { INotification } from '../interactions/notification'; | ||
import { MessageBusService } from './message-bus/message-bus-service'; | ||
@@ -7,3 +8,4 @@ | ||
public static LOADERS = 'loaders'; | ||
public static LOADER_UPDATED = 'updated'; | ||
public static LOADER_ADDED = 'added'; | ||
public static LOADER_REMOVED = 'added'; | ||
public loading: boolean = false; | ||
@@ -15,11 +17,12 @@ | ||
public addLoader(id?: string, title?: string): string { | ||
public addLoader(id?: string, title?: string, notification?: INotification): string { | ||
if (id === undefined) { | ||
id = guidGenerator(); | ||
} | ||
this.loaders[id] = title || id; | ||
if (notification && !notification.title) { notification.title = notification.title ?? notification.id }; | ||
this.loaders[id] = { title: title || id, notification }; | ||
this.loading = Object.keys(this.loaders).length > 0; | ||
if (this.bus) { | ||
this.bus.publish(Loader.LOADERS, Loader.LOADER_UPDATED); | ||
} | ||
this.bus.publish(Loader.LOADERS, Loader.LOADER_ADDED, { loaders: this.loaders, id: id, title: title, notification: notification }); | ||
} | ||
return id; | ||
@@ -31,6 +34,7 @@ } | ||
if (this.loaders.hasOwnProperty(id)) { | ||
const notification = this.loaders[id].notification; | ||
delete this.loaders[id]; | ||
this.loading = Object.keys(this.loaders).length > 0; | ||
if (this.bus) { | ||
this.bus.publish(Loader.LOADERS, Loader.LOADER_UPDATED); | ||
this.bus.publish(Loader.LOADERS, Loader.LOADER_REMOVED, { loaders: this.loaders, id: id, notification: notification }); | ||
} | ||
@@ -37,0 +41,0 @@ } |
@@ -12,6 +12,4 @@ import { IMessageBusService, MessageBusHandle, IMessageBusCallback } from '../..'; | ||
public start() { | ||
public start() {} | ||
} | ||
public stop() { | ||
@@ -18,0 +16,0 @@ for (const id in this.busHandlers) { |
@@ -53,2 +53,3 @@ import { IMenu, ToolbarOptions } from './../'; | ||
public area?: string; | ||
public sync?: 'widget' | 'dashboard' | 'manager' | 'datasource' | 'global'; | ||
} |
@@ -7,5 +7,7 @@ { | ||
"outDir": "./dist", | ||
"rootDir": "./src/" | ||
"rootDir": "./src/", | ||
"module": "ES6", | ||
"checkJs": false | ||
}, | ||
"exclude": ["./dist"] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
2616410
0
289
9578