@2sic.com/dnn-sxc-angular
Advanced tools
Comparing version 10.25.3-pre4 to 10.25.3-pre5
@@ -5,3 +5,3 @@ import { ElementRef } from '@angular/core'; | ||
constructor(el: ElementRef); | ||
getTag(attribute: string): any; | ||
getAttribute(attribute: string): string; | ||
} |
@@ -5,3 +5,3 @@ var AppTagService = /** @class */ (function () { | ||
} | ||
AppTagService.prototype.getTag = function (attribute) { | ||
AppTagService.prototype.getAttribute = function (attribute) { | ||
// todo: after upgrading to NG8, probably use el.GetAttribute | ||
@@ -8,0 +8,0 @@ return this.el.nativeElement.getAttribute(attribute); |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"AppTagService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":4,"character":20}]}],"getTag":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"AppTagService":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":4,"character":20}]}],"getAttribute":[{"__symbolic":"method"}]}}}}] |
@@ -1,1 +0,1 @@ | ||
{"moduleName":null,"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbol":1,"members":[]}]}],"getTag":[{"__symbolic":"method"}]}}}],"symbols":[{"__symbol":0,"name":"AppTagService","filePath":"./apptag.service"},{"__symbol":1,"name":"ElementRef","filePath":"@angular/core"}]} | ||
{"moduleName":null,"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbol":1,"members":[]}]}],"getAttribute":[{"__symbolic":"method"}]}}}],"symbols":[{"__symbol":0,"name":"AppTagService","filePath":"./apptag.service"},{"__symbol":1,"name":"ElementRef","filePath":"@angular/core"}]} |
@@ -7,3 +7,3 @@ import { SxcInstance, SxcRoot } from "@2sic.com/2sxc-typings"; | ||
*/ | ||
export declare class ContextInfo { | ||
export interface ContextInfo { | ||
/** | ||
@@ -10,0 +10,0 @@ * The $2sxc root object which is globally accessible through window.$2sxc |
@@ -1,14 +0,1 @@ | ||
// These are the parameters which make up the current context / state of this app. | ||
// It's mainly needed to ensure that the Http Service is correctly set up. | ||
/** | ||
* The context in which the current app is running. | ||
* Important to interact with the server | ||
* or with the DNN around it. | ||
*/ | ||
var ContextInfo = /** @class */ (function () { | ||
function ContextInfo() { | ||
} | ||
return ContextInfo; | ||
}()); | ||
export { ContextInfo }; | ||
//# sourceMappingURL=context-info.js.map |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"ContextInfo":{"__symbolic":"class"}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"ContextInfo":{"__symbolic":"interface"}}}] |
@@ -1,1 +0,1 @@ | ||
{"moduleName":null,"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbolic":"class"}}],"symbols":[{"__symbol":0,"name":"ContextInfo","filePath":"./context-info"}]} | ||
{"moduleName":null,"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbolic":"interface"}}],"symbols":[{"__symbol":0,"name":"ContextInfo","filePath":"./context-info"}]} |
@@ -0,7 +1,16 @@ | ||
import { SxcRoot, SxcInstance } from '@2sic.com/2sxc-typings'; | ||
import { ElementRef } from '@angular/core'; | ||
import { ContextInfo } from './context-info'; | ||
import { AppTagService } from './apptag.service'; | ||
export declare class Context extends ContextInfo { | ||
appTagService: AppTagService; | ||
preConfiguration: Partial<ContextInfo>; | ||
import { ContextInfoPreconfigure } from './context-info-preconfigure'; | ||
export declare class Context implements ContextInfo { | ||
$2sxc: SxcRoot; | ||
sxc: SxcInstance; | ||
addHttpHeaders: boolean; | ||
appNameInPath: string; | ||
edition: string; | ||
apiEdition: string; | ||
moduleId: number; | ||
contentBlockId: number; | ||
private appTagService; | ||
private preConfiguration; | ||
constructor(); | ||
@@ -13,3 +22,3 @@ private check2sxcVersion; | ||
*/ | ||
preConfigure(preConfig: Partial<ContextInfo>): this; | ||
preConfigure(preConfig: Partial<ContextInfoPreconfigure>): this; | ||
/** | ||
@@ -21,2 +30,7 @@ * Configure 2sxc in the context of a HTMLNode. | ||
/** | ||
* Get an attribute value from the app-tag | ||
* @param name attribute name | ||
*/ | ||
getAppAttribute(name: string): string; | ||
/** | ||
* Get context information like module-id from the app-root tag | ||
@@ -23,0 +37,0 @@ * new in Dnn-Sxc-Angular 8 |
@@ -1,11 +0,1 @@ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
@@ -21,3 +11,2 @@ for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
import { appTag } from '../names'; | ||
import { ContextInfo } from './context-info'; | ||
import { AppTagService } from './apptag.service'; | ||
@@ -28,12 +17,9 @@ import * as i0 from "@angular/core"; | ||
}; | ||
var Context = /** @class */ (function (_super) { | ||
__extends(Context, _super); | ||
var Context = /** @class */ (function () { | ||
function Context() { | ||
var _this = _super.call(this) || this; | ||
_this.$2sxc = window.$2sxc; | ||
if (_this.$2sxc === undefined) { | ||
this.$2sxc = window.$2sxc; | ||
if (this.$2sxc === undefined) { | ||
throw new Error('window.$2sxc is null - you probably forgot to include the script before loading angular'); | ||
} | ||
_this.check2sxcVersion(); | ||
return _this; | ||
this.check2sxcVersion(); | ||
} | ||
@@ -65,3 +51,3 @@ Context.prototype.check2sxcVersion = function () { | ||
var settings = __assign({}, runtimeDefaults, this.getContextFromAppTag(), this.preConfiguration); | ||
// Use pre-configured value already in settings if defined; otherwise | ||
// Use pre-configured values already in settings if defined; otherwise | ||
// get from HTMLNode | ||
@@ -75,4 +61,2 @@ settings.sxc = settings.sxc || | ||
} | ||
this.moduleId = settings.sxc.id; | ||
this.contentBlockId = settings.sxc.cbid; | ||
this.sxc = settings.sxc; | ||
@@ -85,2 +69,9 @@ this.addHttpHeaders = settings.addHttpHeaders; | ||
/** | ||
* Get an attribute value from the app-tag | ||
* @param name attribute name | ||
*/ | ||
Context.prototype.getAppAttribute = function (name) { | ||
return this.appTagService.getAttribute(name); | ||
}; | ||
/** | ||
* Get context information like module-id from the app-root tag | ||
@@ -92,4 +83,4 @@ * new in Dnn-Sxc-Angular 8 | ||
// 2019-09-29 2dm important now | ||
edition: this.appTagService.getTag(appTag.edition), | ||
apiEdition: this.appTagService.getTag(appTag.apiEdition) | ||
edition: this.appTagService.getAttribute(appTag.edition), | ||
apiEdition: this.appTagService.getAttribute(appTag.apiEdition) | ||
}; | ||
@@ -108,4 +99,4 @@ // Return an object containing only the not-null properties | ||
return Context; | ||
}(ContextInfo)); | ||
}()); | ||
export { Context }; | ||
//# sourceMappingURL=context.service.js.map |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":4,"metadata":{"Context":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./context-info","name":"ContextInfo","line":17,"character":29},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":12,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"check2sxcVersion":[{"__symbolic":"method"}],"preConfigure":[{"__symbolic":"method"}],"autoConfigure":[{"__symbolic":"method"}],"getContextFromAppTag":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}}}}] | ||
[{"__symbolic":"module","version":4,"metadata":{"Context":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":13,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"check2sxcVersion":[{"__symbolic":"method"}],"preConfigure":[{"__symbolic":"method"}],"autoConfigure":[{"__symbolic":"method"}],"getAppAttribute":[{"__symbolic":"method"}],"getContextFromAppTag":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}}}}] |
@@ -1,1 +0,1 @@ | ||
{"moduleName":null,"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbolic":"class","extends":{"__symbol":1,"members":[]},"members":{"__ctor__":[{"__symbolic":"constructor"}],"check2sxcVersion":[{"__symbolic":"method"}],"preConfigure":[{"__symbolic":"method"}],"autoConfigure":[{"__symbolic":"method"}],"getContextFromAppTag":[{"__symbolic":"method"}]}},"type":{"summaryKind":3,"type":{"reference":{"__symbol":0,"members":[]},"diDeps":[],"lifecycleHooks":[]}}}],"symbols":[{"__symbol":0,"name":"Context","filePath":"./context.service"},{"__symbol":1,"name":"ContextInfo","filePath":"./context-info"}]} | ||
{"moduleName":null,"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor"}],"check2sxcVersion":[{"__symbolic":"method"}],"preConfigure":[{"__symbolic":"method"}],"autoConfigure":[{"__symbolic":"method"}],"getAppAttribute":[{"__symbolic":"method"}],"getContextFromAppTag":[{"__symbolic":"method"}]}},"type":{"summaryKind":3,"type":{"reference":{"__symbol":0,"members":[]},"diDeps":[],"lifecycleHooks":[]}}}],"symbols":[{"__symbol":0,"name":"Context","filePath":"./context.service"}]} |
{ | ||
"name": "@2sic.com/dnn-sxc-angular", | ||
"version": "10.25.3-pre4", | ||
"version": "10.25.3-pre5", | ||
"author": "2sic.com - daniel mettler and raphael müller", | ||
@@ -5,0 +5,0 @@ "bugs": { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153562
125
902