Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-boot-front

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-boot-front - npm Package Compare versions

Comparing version 1.0.51 to 1.0.52

5

fetch/Fetcher.js

@@ -0,1 +1,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Fetcher = void 0;
var Fetcher = (function () {

@@ -6,2 +9,2 @@ function Fetcher() {

}());
export { Fetcher };
exports.Fetcher = Fetcher;

83

module/FrontModule.js

@@ -0,1 +1,2 @@

"use strict";
var __extends = (this && this.__extends) || (function () {

@@ -52,17 +53,19 @@ var extendStatics = function (d, b) {

};
import { Renderer } from '../render/Renderer';
import { fromEvent } from 'rxjs';
import { View } from '../service/view/View';
import { RandomUtils } from 'simple-boot-core/utils/random/RandomUtils';
import { FunctionUtils } from 'simple-boot-core/utils/function/FunctionUtils';
import { Intent } from 'simple-boot-core/intent/Intent';
import { SimGlobal } from 'simple-boot-core/global/SimGlobal';
import { Navigation } from '../service/Navigation';
import { FrontModuleOption } from './FrontModuleOption';
import { DomUtils } from '../utils/dom/DomUtils';
import { ObjectUtils } from 'simple-boot-core/utils/object/ObjectUtils';
import { getEventListener } from 'simple-boot-core/decorators/event/EventListener';
import { Module } from 'simple-boot-core/module/Module';
import { Scope } from 'dom-render/Scope';
import { ScopeRawSet } from 'dom-render/ScopeRawSet';
Object.defineProperty(exports, "__esModule", { value: true });
exports.FrontModule = void 0;
var Renderer_1 = require("../render/Renderer");
var rxjs_1 = require("rxjs");
var View_1 = require("../service/view/View");
var RandomUtils_1 = require("simple-boot-core/utils/random/RandomUtils");
var FunctionUtils_1 = require("simple-boot-core/utils/function/FunctionUtils");
var Intent_1 = require("simple-boot-core/intent/Intent");
var SimGlobal_1 = require("simple-boot-core/global/SimGlobal");
var Navigation_1 = require("../service/Navigation");
var FrontModuleOption_1 = require("./FrontModuleOption");
var DomUtils_1 = require("../utils/dom/DomUtils");
var ObjectUtils_1 = require("simple-boot-core/utils/object/ObjectUtils");
var EventListener_1 = require("simple-boot-core/decorators/event/EventListener");
var Module_1 = require("simple-boot-core/module/Module");
var Scope_1 = require("dom-render/Scope");
var ScopeRawSet_1 = require("dom-render/ScopeRawSet");
var FrontModule = (function (_super) {

@@ -77,6 +80,6 @@ __extends(FrontModule, _super);

_this._scopes = new Map();
_this._renderer = (_a = SimGlobal().application) === null || _a === void 0 ? void 0 : _a.simstanceManager.getOrNewSim(Renderer);
_this._navigation = (_b = SimGlobal().application) === null || _b === void 0 ? void 0 : _b.simstanceManager.getOrNewSim(Navigation);
_this._renderer = (_a = SimGlobal_1.SimGlobal().application) === null || _a === void 0 ? void 0 : _a.simstanceManager.getOrNewSim(Renderer_1.Renderer);
_this._navigation = (_b = SimGlobal_1.SimGlobal().application) === null || _b === void 0 ? void 0 : _b.simstanceManager.getOrNewSim(Navigation_1.Navigation);
_this.value = _inputOption.value;
var option = new FrontModuleOption();
var option = new FrontModuleOption_1.FrontModuleOption();
if (_inputOption.modules) {

@@ -86,3 +89,3 @@ option.modules = _inputOption.modules;

_this._option = option;
_this.id = "___Module__" + _this.constructor.name + "_" + RandomUtils.uuid();
_this.id = "___Module__" + _this.constructor.name + "_" + RandomUtils_1.RandomUtils.uuid();
return _this;

@@ -109,3 +112,3 @@ }

if (this._option.template.search('\\[router-outlet\\]')) {
this._router_outlet_id = "___Module__" + this.constructor.name + "_router-outlet_" + this.id + "_" + RandomUtils.uuid();
this._router_outlet_id = "___Module__" + this.constructor.name + "_router-outlet_" + this.id + "_" + RandomUtils_1.RandomUtils.uuid();
this._option.template = this._option.template.replace('[router-outlet]', " id='" + this._router_outlet_id + "' ");

@@ -166,4 +169,4 @@ }

if (attribute && _this.getValue(attribute)) {
fromEvent(it, endFix).subscribe(function (eit) {
var view = new View(eit.target);
rxjs_1.fromEvent(it, endFix).subscribe(function (eit) {
var view = new View_1.View(eit.target);
if (typeof _this.getValue(attribute) === 'function') {

@@ -185,5 +188,5 @@ _this.getValue(attribute)(eit, view);

this.procAttr(rootElement, attr, function (it, attr) {
var attribute = FunctionUtils.eval(attr);
var attribute = FunctionUtils_1.FunctionUtils.eval(attr);
if (attribute && Array.isArray(attribute)) {
fromEvent(it, endFix).subscribe(function (eit) {
rxjs_1.fromEvent(it, endFix).subscribe(function (eit) {
if (attribute.length === 2) {

@@ -194,6 +197,6 @@ var newVarElement = _this.getValue(attribute[1]);

}
_this.publish(new Intent(attribute[0], newVarElement, eit));
_this.publish(new Intent_1.Intent(attribute[0], newVarElement, eit));
}
else if (attribute.length === 1) {
_this.publish(new Intent(attribute[0], new View(eit.target, _this), eit));
_this.publish(new Intent_1.Intent(attribute[0], new View_1.View(eit.target, _this), eit));
}

@@ -209,7 +212,7 @@ });

var _this = this;
var set = new Set(ObjectUtils.getAllProtoTypeName(this));
var set = new Set(ObjectUtils_1.ObjectUtils.getAllProtoTypeName(this));
set.forEach(function (it) {
var data = getEventListener(_this, it);
var data = EventListener_1.getEventListener(_this, it);
if (data) {
var view_1 = new View(data.target, _this);
var view_1 = new View_1.View(data.target, _this);
view_1.event(data.name).subscribe(function (sit) {

@@ -248,3 +251,3 @@ _this[it](sit, view_1);

if (varName && _this.getValue(varName)) {
fromEvent(it, 'input').subscribe(function (eit) {
rxjs_1.fromEvent(it, 'input').subscribe(function (eit) {
if (typeof _this.getValue(varName) === 'function') {

@@ -273,3 +276,3 @@ _this.getValue(varName)(eit);

this.procAttr(rootElement, 'module-change-attr', function (it, attribute) {
var varNames = new Set(Scope.usingThisVar(attribute !== null && attribute !== void 0 ? attribute : ''));
var varNames = new Set(Scope_1.Scope.usingThisVar(attribute !== null && attribute !== void 0 ? attribute : ''));
var script = attribute;

@@ -282,4 +285,4 @@ varNames.forEach(function (varName) {

var _a;
var a = JSON.stringify(DomUtils.getAttributeToObject(it));
var rtnAttribute = (_a = FunctionUtils.eval("const attribute = " + a + ";" + script, _this)) !== null && _a !== void 0 ? _a : {};
var a = JSON.stringify(DomUtils_1.DomUtils.getAttributeToObject(it));
var rtnAttribute = (_a = FunctionUtils_1.FunctionUtils.eval("const attribute = " + a + ";" + script, _this)) !== null && _a !== void 0 ? _a : {};
for (var _i = 0, _b = Object.entries(rtnAttribute); _i < _b.length; _i++) {

@@ -294,3 +297,3 @@ var _c = _b[_i], key = _c[0], value = _c[1];

this.procAttr(rootElement, 'module-change-style', function (it, attribute) {
var varNames = new Set(Scope.usingThisVar(attribute !== null && attribute !== void 0 ? attribute : ''));
var varNames = new Set(Scope_1.Scope.usingThisVar(attribute !== null && attribute !== void 0 ? attribute : ''));
var script = attribute;

@@ -303,3 +306,3 @@ varNames.forEach(function (varName) {

var _a;
var rtnStyle = (_a = FunctionUtils.eval("const style=" + JSON.stringify(DomUtils.getStyleToObject(it)) + ";" + script, _this)) !== null && _a !== void 0 ? _a : {};
var rtnStyle = (_a = FunctionUtils_1.FunctionUtils.eval("const style=" + JSON.stringify(DomUtils_1.DomUtils.getStyleToObject(it)) + ";" + script, _this)) !== null && _a !== void 0 ? _a : {};
for (var _i = 0, _b = Object.entries(rtnStyle); _i < _b.length; _i++) {

@@ -314,3 +317,3 @@ var _c = _b[_i], key = _c[0], value = _c[1];

this.procAttr(rootElement, 'router-link', function (it, attribute) {
fromEvent(it, 'click').subscribe(function (eit) {
rxjs_1.fromEvent(it, 'click').subscribe(function (eit) {
var _a;

@@ -361,4 +364,4 @@ (_a = _this._navigation) === null || _a === void 0 ? void 0 : _a.go(attribute || '');

var _a;
if (uuid === void 0) { uuid = RandomUtils.uuid(); }
var rawSet = new ScopeRawSet(this.templateString, this._option.styleImports);
if (uuid === void 0) { uuid = RandomUtils_1.RandomUtils.uuid(); }
var rawSet = new ScopeRawSet_1.ScopeRawSet(this.templateString, this._option.styleImports);
var scope = (_a = this._renderer) === null || _a === void 0 ? void 0 : _a.compileScope(rawSet, this, targetNode, uuid);

@@ -429,3 +432,3 @@ if (scope) {

return FrontModule;
}(Module));
export { FrontModule };
}(Module_1.Module));
exports.FrontModule = FrontModule;

@@ -0,1 +1,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FrontModuleOption = void 0;
var FrontModuleOption = (function () {

@@ -9,2 +12,2 @@ function FrontModuleOption() {

}());
export { FrontModuleOption };
exports.FrontModuleOption = FrontModuleOption;

@@ -0,1 +1,2 @@

"use strict";
var __extends = (this && this.__extends) || (function () {

@@ -16,8 +17,10 @@ var extendStatics = function (d, b) {

})();
import { SimOption } from 'simple-boot-core/SimOption';
export var UrlType;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimFrontOption = exports.UrlType = void 0;
var SimOption_1 = require("simple-boot-core/SimOption");
var UrlType;
(function (UrlType) {
UrlType["path"] = "path";
UrlType["hash"] = "hash";
})(UrlType || (UrlType = {}));
})(UrlType = exports.UrlType || (exports.UrlType = {}));
var SimFrontOption = (function (_super) {

@@ -42,3 +45,3 @@ __extends(SimFrontOption, _super);

return SimFrontOption;
}(SimOption));
export { SimFrontOption };
}(SimOption_1.SimOption));
exports.SimFrontOption = SimFrontOption;
{
"name": "simple-boot-front",
"version": "1.0.51",
"version": "1.0.52",
"main": "SimpleApplication.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -0,1 +1,2 @@

"use strict";
var __extends = (this && this.__extends) || (function () {

@@ -16,5 +17,7 @@ var extendStatics = function (d, b) {

})();
import { SimGlobal } from 'simple-boot-core/global/SimGlobal';
import { SimProxy } from 'simple-boot-core/proxy/SimProxy';
import { FrontModule } from '../module/FrontModule';
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimFrontProxyHandler = void 0;
var SimGlobal_1 = require("simple-boot-core/global/SimGlobal");
var SimProxy_1 = require("simple-boot-core/proxy/SimProxy");
var FrontModule_1 = require("../module/FrontModule");
var SimFrontProxyHandler = (function (_super) {

@@ -26,3 +29,3 @@ __extends(SimFrontProxyHandler, _super);

_this.simOption = simOption;
_this.simstanceManager = (_a = SimGlobal().application) === null || _a === void 0 ? void 0 : _a.simstanceManager;
_this.simstanceManager = (_a = SimGlobal_1.SimGlobal().application) === null || _a === void 0 ? void 0 : _a.simstanceManager;
return _this;

@@ -32,3 +35,3 @@ }

var _a, _b;
if (obj instanceof FrontModule) {
if (obj instanceof FrontModule_1.FrontModule) {
(_a = obj._refModule.get(prop)) === null || _a === void 0 ? void 0 : _a.forEach(function (it, val) {

@@ -39,3 +42,3 @@ it.forEach(function (sit) { return sit.callBack.apply(val, sit.params); });

var sim = (_b = this.simstanceManager) === null || _b === void 0 ? void 0 : _b.getOrNewSim(obj.constructor);
if (sim && sim instanceof FrontModule) {
if (sim && sim instanceof FrontModule_1.FrontModule) {
sim.renderToScope(prop);

@@ -54,3 +57,3 @@ }

return SimFrontProxyHandler;
}(SimProxy));
export { SimFrontProxyHandler };
}(SimProxy_1.SimProxy));
exports.SimFrontProxyHandler = SimFrontProxyHandler;

@@ -0,1 +1,2 @@

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

@@ -10,11 +11,13 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;

};
import { FrontModule } from '../module/FrontModule';
import { SimFrontOption } from '../option/SimFrontOption';
import { Sim } from 'simple-boot-core/decorators/SimDecorator';
import { RandomUtils } from 'simple-boot-core/utils/random/RandomUtils';
import { NodeUtils } from '../utils/node/NodeUtils';
import { TargetNodeMode } from 'dom-render/RootScope';
import { DomRender } from 'dom-render/DomRender';
import { Config } from 'dom-render/Config';
import { ScopeFrontObject } from './ScopeFrontObject';
Object.defineProperty(exports, "__esModule", { value: true });
exports.Renderer = void 0;
var FrontModule_1 = require("../module/FrontModule");
var SimFrontOption_1 = require("../option/SimFrontOption");
var SimDecorator_1 = require("simple-boot-core/decorators/SimDecorator");
var RandomUtils_1 = require("simple-boot-core/utils/random/RandomUtils");
var NodeUtils_1 = require("../utils/node/NodeUtils");
var RootScope_1 = require("dom-render/RootScope");
var DomRender_1 = require("dom-render/DomRender");
var Config_1 = require("dom-render/Config");
var ScopeFrontObject_1 = require("./ScopeFrontObject");
var Renderer = (function () {

@@ -25,5 +28,5 @@ function Renderer(option) {

Renderer.prototype.compileScope = function (rawSet, obj, targetNode, rootUUID) {
if (rootUUID === void 0) { rootUUID = RandomUtils.uuid(); }
var config = new Config(document, function (scope) { return new ScopeFrontObject(scope.config); });
var domRender = new DomRender(rawSet, config, rootUUID);
if (rootUUID === void 0) { rootUUID = RandomUtils_1.RandomUtils.uuid(); }
var config = new Config_1.Config(document, function (scope) { return new ScopeFrontObject_1.ScopeFrontObject(scope.config); });
var domRender = new DomRender_1.DomRender(rawSet, config, rootUUID);
domRender.rootUUID = rootUUID;

@@ -34,3 +37,3 @@ return domRender.compile(obj, targetNode);

var targetElement = document.querySelector(this.option.selector);
if (targetElement && module instanceof FrontModule) {
if (targetElement && module instanceof FrontModule_1.FrontModule) {
targetElement.innerHTML = module.templateString;

@@ -53,5 +56,5 @@ module._onChangedRender();

module.addEvent(it.scopeResult.fragment);
it.scopeResult.childNodes.forEach(function (cit) { return NodeUtils.addNode(startComment_1, cit); });
NodeUtils.replaceNode(startComment_1, it.scopeResult.startComment);
NodeUtils.replaceNode(endComment, it.scopeResult.endComment);
it.scopeResult.childNodes.forEach(function (cit) { return NodeUtils_1.NodeUtils.addNode(startComment_1, cit); });
NodeUtils_1.NodeUtils.replaceNode(startComment_1, it.scopeResult.startComment);
NodeUtils_1.NodeUtils.replaceNode(endComment, it.scopeResult.endComment);
it.scopeResult.calls.filter(function (it) { return it.name === 'module'; }).map(function (it) { return it.result; }).forEach(function (it) {

@@ -61,3 +64,3 @@ it.renderWrap();

}
it.usingVars.filter(function (uit) { return module.getValue(uit) instanceof FrontModule; }).forEach(function (mit) {
it.usingVars.filter(function (uit) { return module.getValue(uit) instanceof FrontModule_1.FrontModule; }).forEach(function (mit) {
module.getValue(mit).scopeUpdateAndRenderToByScopes();

@@ -71,8 +74,8 @@ });

module.addEvent(childNode);
if (TargetNodeMode.child === scope.targetNode.mode) {
NodeUtils.removeAllChildNode(scope.targetNode.node);
NodeUtils.appendChild(scope.targetNode.node, childNode);
if (RootScope_1.TargetNodeMode.child === scope.targetNode.mode) {
NodeUtils_1.NodeUtils.removeAllChildNode(scope.targetNode.node);
NodeUtils_1.NodeUtils.appendChild(scope.targetNode.node, childNode);
}
else if (TargetNodeMode.replace === scope.targetNode.mode) {
NodeUtils.replaceNode(scope.targetNode.node, childNode);
else if (RootScope_1.TargetNodeMode.replace === scope.targetNode.mode) {
NodeUtils_1.NodeUtils.replaceNode(scope.targetNode.node, childNode);
}

@@ -98,7 +101,7 @@ else {

Renderer = __decorate([
Sim(),
__metadata("design:paramtypes", [SimFrontOption])
SimDecorator_1.Sim(),
__metadata("design:paramtypes", [SimFrontOption_1.SimFrontOption])
], Renderer);
return Renderer;
}());
export { Renderer };
exports.Renderer = Renderer;

@@ -0,1 +1,2 @@

"use strict";
var __extends = (this && this.__extends) || (function () {

@@ -16,10 +17,12 @@ var extendStatics = function (d, b) {

})();
import { RandomUtils } from 'simple-boot-core/utils/random/RandomUtils';
import { SimGlobal } from 'simple-boot-core/global/SimGlobal';
import { ScopeObject } from 'dom-render/ScopeObject';
import { TargetNode, TargetNodeMode } from 'dom-render/RootScope';
Object.defineProperty(exports, "__esModule", { value: true });
exports.ScopeFrontObject = void 0;
var RandomUtils_1 = require("simple-boot-core/utils/random/RandomUtils");
var SimGlobal_1 = require("simple-boot-core/global/SimGlobal");
var ScopeObject_1 = require("dom-render/ScopeObject");
var RootScope_1 = require("dom-render/RootScope");
var ScopeFrontObject = (function (_super) {
__extends(ScopeFrontObject, _super);
function ScopeFrontObject(config, uuid) {
if (uuid === void 0) { uuid = RandomUtils.uuid(); }
if (uuid === void 0) { uuid = RandomUtils_1.RandomUtils.uuid(); }
var _this = _super.call(this, config) || this;

@@ -37,3 +40,3 @@ _this.uuid = uuid;

if (module) {
var newSim = (_a = SimGlobal().application) === null || _a === void 0 ? void 0 : _a.simstanceManager.newSim(module);
var newSim = (_a = SimGlobal_1.SimGlobal().application) === null || _a === void 0 ? void 0 : _a.simstanceManager.newSim(module);
if (newSim) {

@@ -47,5 +50,5 @@ return newSim;

if (module) {
var uuid = RandomUtils.uuid();
var uuid = RandomUtils_1.RandomUtils.uuid();
var targetSelecotr = module.getTemplateSelector(uuid);
var targetNode = new TargetNode(targetSelecotr, TargetNodeMode.replace);
var targetNode = new RootScope_1.TargetNode(targetSelecotr, RootScope_1.TargetNodeMode.replace);
var scope = module.setScope(targetNode, uuid);

@@ -58,3 +61,3 @@ if (scope) {

return ScopeFrontObject;
}(ScopeObject));
export { ScopeFrontObject };
}(ScopeObject_1.ScopeObject));
exports.ScopeFrontObject = ScopeFrontObject;

@@ -0,1 +1,2 @@

"use strict";
var __extends = (this && this.__extends) || (function () {

@@ -16,3 +17,5 @@ var extendStatics = function (d, b) {

})();
import { Router } from 'simple-boot-core/route/Router';
Object.defineProperty(exports, "__esModule", { value: true });
exports.FrontRouter = void 0;
var Router_1 = require("simple-boot-core/route/Router");
var FrontRouter = (function (_super) {

@@ -29,3 +32,3 @@ __extends(FrontRouter, _super);

return FrontRouter;
}(Router));
export { FrontRouter };
}(Router_1.Router));
exports.FrontRouter = FrontRouter;

@@ -0,1 +1,2 @@

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

@@ -10,4 +11,6 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;

};
import { Sim } from 'simple-boot-core/decorators/SimDecorator';
import { ajax } from 'rxjs/ajax';
Object.defineProperty(exports, "__esModule", { value: true });
exports.AjaxService = void 0;
var SimDecorator_1 = require("simple-boot-core/decorators/SimDecorator");
var ajax_1 = require("rxjs/ajax");
var AjaxService = (function () {

@@ -17,15 +20,15 @@ function AjaxService() {

AjaxService.prototype.delete = function (url, headers) {
return ajax.delete(url, headers);
return ajax_1.ajax.delete(url, headers);
};
AjaxService.prototype.get = function (url, headers) {
return ajax.get(url, headers);
return ajax_1.ajax.get(url, headers);
};
AjaxService.prototype.getJson = function (url, headers) {
return ajax.getJSON(url, headers);
return ajax_1.ajax.getJSON(url, headers);
};
AjaxService.prototype.patch = function (url, body, headers) {
return ajax.patch(url, body, headers);
return ajax_1.ajax.patch(url, body, headers);
};
AjaxService.prototype.post = function (url, body, headers) {
return ajax.post(url, body, headers);
return ajax_1.ajax.post(url, body, headers);
};

@@ -35,9 +38,9 @@ AjaxService.prototype.postJson = function (url, body, headers) {

headers = Object.assign(headers, { 'Content-Type': 'application/json' });
return ajax.post(url, body, headers);
return ajax_1.ajax.post(url, body, headers);
};
AjaxService.prototype.put = function (url, body, headers) {
return ajax.put(url, body, headers);
return ajax_1.ajax.put(url, body, headers);
};
AjaxService = __decorate([
Sim(),
SimDecorator_1.Sim(),
__metadata("design:paramtypes", [])

@@ -47,2 +50,2 @@ ], AjaxService);

}());
export { AjaxService };
exports.AjaxService = AjaxService;

@@ -0,1 +1,2 @@

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

@@ -10,5 +11,7 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;

};
import { Sim } from 'simple-boot-core/decorators/SimDecorator';
import { SimFrontOption, UrlType } from '../option/SimFrontOption';
import { LocationUtils } from '../utils/window/LocationUtils';
Object.defineProperty(exports, "__esModule", { value: true });
exports.Navigation = void 0;
var SimDecorator_1 = require("simple-boot-core/decorators/SimDecorator");
var SimFrontOption_1 = require("../option/SimFrontOption");
var LocationUtils_1 = require("../utils/window/LocationUtils");
var Navigation = (function () {

@@ -20,7 +23,7 @@ function Navigation(option) {

get: function () {
if (UrlType.path === this.option.urlType) {
return LocationUtils.path();
if (SimFrontOption_1.UrlType.path === this.option.urlType) {
return LocationUtils_1.LocationUtils.path();
}
else if (UrlType.hash === this.option.urlType) {
return LocationUtils.hashPath();
else if (SimFrontOption_1.UrlType.hash === this.option.urlType) {
return LocationUtils_1.LocationUtils.hashPath();
}

@@ -36,7 +39,7 @@ else {

get: function () {
if (UrlType.path === this.option.urlType) {
return LocationUtils.pathQueryParams();
if (SimFrontOption_1.UrlType.path === this.option.urlType) {
return LocationUtils_1.LocationUtils.pathQueryParams();
}
else if (UrlType.hash === this.option.urlType) {
return LocationUtils.hashQueryParams();
else if (SimFrontOption_1.UrlType.hash === this.option.urlType) {
return LocationUtils_1.LocationUtils.hashQueryParams();
}

@@ -60,6 +63,6 @@ else {

if (title === void 0) { title = ''; }
if (UrlType.path === this.option.urlType) {
if (SimFrontOption_1.UrlType.path === this.option.urlType) {
history.pushState(data, title, path);
}
else if (UrlType.hash === this.option.urlType) {
else if (SimFrontOption_1.UrlType.hash === this.option.urlType) {
path = '#' + path.substring(1);

@@ -71,7 +74,7 @@ history.pushState(data, title, path);

Navigation = __decorate([
Sim(),
__metadata("design:paramtypes", [SimFrontOption])
SimDecorator_1.Sim(),
__metadata("design:paramtypes", [SimFrontOption_1.SimFrontOption])
], Navigation);
return Navigation;
}());
export { Navigation };
exports.Navigation = Navigation;

@@ -1,2 +0,5 @@

import { fromEvent } from 'rxjs';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.View = void 0;
var rxjs_1 = require("rxjs");
var View = (function () {

@@ -8,6 +11,6 @@ function View(_e, module) {

View.prototype.event = function (eventName) {
return fromEvent(this.e, eventName);
return rxjs_1.fromEvent(this.e, eventName);
};
View.prototype.click = function () {
return fromEvent(this.e, 'click');
return rxjs_1.fromEvent(this.e, 'click');
};

@@ -40,2 +43,2 @@ Object.defineProperty(View.prototype, "e", {

}());
export { View };
exports.View = View;

@@ -0,1 +1,2 @@

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

@@ -10,4 +11,6 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;

};
import { Sim } from 'simple-boot-core/decorators/SimDecorator';
import { View } from '../../service/view/View';
Object.defineProperty(exports, "__esModule", { value: true });
exports.ViewService = void 0;
var SimDecorator_1 = require("simple-boot-core/decorators/SimDecorator");
var View_1 = require("../../service/view/View");
var ViewService = (function () {

@@ -20,3 +23,3 @@ function ViewService() {

if (querySelector) {
return new View(querySelector);
return new View_1.View(querySelector);
}

@@ -40,3 +43,3 @@ else {

ViewService = __decorate([
Sim(),
SimDecorator_1.Sim(),
__metadata("design:paramtypes", [])

@@ -46,2 +49,2 @@ ], ViewService);

}());
export { ViewService };
exports.ViewService = ViewService;

@@ -0,1 +1,2 @@

"use strict";
var __extends = (this && this.__extends) || (function () {

@@ -52,10 +53,12 @@ var extendStatics = function (d, b) {

};
import { SimpleApplication } from 'simple-boot-core/SimpleApplication';
import { SimFrontProxyHandler } from './proxy/SimFrontProxyHandler';
import { Navigation } from './service/Navigation';
import { Intent } from 'simple-boot-core/intent/Intent';
import { FrontModule } from './module/FrontModule';
import { FunctionUtils } from 'simple-boot-core/utils/function/FunctionUtils';
import { fromEvent } from 'rxjs';
import { TargetNode, TargetNodeMode } from 'dom-render/RootScope';
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimpleBootFront = void 0;
var SimpleApplication_1 = require("simple-boot-core/SimpleApplication");
var SimFrontProxyHandler_1 = require("./proxy/SimFrontProxyHandler");
var Navigation_1 = require("./service/Navigation");
var Intent_1 = require("simple-boot-core/intent/Intent");
var FrontModule_1 = require("./module/FrontModule");
var FunctionUtils_1 = require("simple-boot-core/utils/function/FunctionUtils");
var rxjs_1 = require("rxjs");
var RootScope_1 = require("dom-render/RootScope");
var SimpleBootFront = (function (_super) {

@@ -68,3 +71,3 @@ __extends(SimpleBootFront, _super);

window.__dirname = 'simple-boot-front__dirname';
option.simProxy = new SimFrontProxyHandler(option);
option.simProxy = new SimFrontProxyHandler_1.SimFrontProxyHandler(option);
return _this;

@@ -75,6 +78,6 @@ }

_super.prototype.run.call(this);
var navigation = this.simstanceManager.getOrNewSim(Navigation);
fromEvent(window, 'popstate').subscribe(function (_) {
var navigation = this.simstanceManager.getOrNewSim(Navigation_1.Navigation);
rxjs_1.fromEvent(window, 'popstate').subscribe(function (_) {
var _a;
var intent = new Intent((_a = navigation.path) !== null && _a !== void 0 ? _a : '');
var intent = new Intent_1.Intent((_a = navigation.path) !== null && _a !== void 0 ? _a : '');
_this.routing(intent).then(function (it) { return __awaiter(_this, void 0, void 0, function () {

@@ -94,3 +97,3 @@ var lastRouterSelector, _i, _a, routerChain, moduleObj, option_1, module, option;

moduleObj = (_c = this.simstanceManager) === null || _c === void 0 ? void 0 : _c.getOrNewSim(routerChain.module);
if (!(moduleObj instanceof FrontModule)) return [3, 3];
if (!(moduleObj instanceof FrontModule_1.FrontModule)) return [3, 3];
return [4, moduleObj.init({ router: 'true' })];

@@ -131,7 +134,7 @@ case 2:

var attr = 'router-active-class';
var navigation = (_a = this.simstanceManager) === null || _a === void 0 ? void 0 : _a.getOrNewSim(Navigation);
var navigation = (_a = this.simstanceManager) === null || _a === void 0 ? void 0 : _a.getOrNewSim(Navigation_1.Navigation);
this.procAttr(attr, function (it, value) {
var _a, _b;
var _c;
var actives = FunctionUtils.eval(value !== null && value !== void 0 ? value : '[]');
var actives = FunctionUtils_1.FunctionUtils.eval(value !== null && value !== void 0 ? value : '[]');
if (!actives)

@@ -156,3 +159,3 @@ return;

module._onInit();
module.setScope(new TargetNode(targetSelector, TargetNodeMode.child));
module.setScope(new RootScope_1.TargetNode(targetSelector, RootScope_1.TargetNodeMode.child));
module.renderWrap();

@@ -166,3 +169,3 @@ return true;

return SimpleBootFront;
}(SimpleApplication));
export { SimpleBootFront };
}(SimpleApplication_1.SimpleApplication));
exports.SimpleBootFront = SimpleBootFront;

@@ -0,1 +1,2 @@

"use strict";
var __extends = (this && this.__extends) || (function () {

@@ -16,3 +17,5 @@ var extendStatics = function (d, b) {

})();
import { SimError } from 'simple-boot-core/throwable/SimError';
Object.defineProperty(exports, "__esModule", { value: true });
exports.RouterError = void 0;
var SimError_1 = require("simple-boot-core/throwable/SimError");
var RouterError = (function (_super) {

@@ -24,3 +27,3 @@ __extends(RouterError, _super);

return RouterError;
}(SimError));
export { RouterError };
}(SimError_1.SimError));
exports.RouterError = RouterError;

@@ -0,1 +1,2 @@

"use strict";
var __extends = (this && this.__extends) || (function () {

@@ -16,3 +17,5 @@ var extendStatics = function (d, b) {

})();
import { RouterError } from './RouterError';
Object.defineProperty(exports, "__esModule", { value: true });
exports.RouterIntentError = void 0;
var RouterError_1 = require("./RouterError");
var RouterIntentError = (function (_super) {

@@ -24,3 +27,3 @@ __extends(RouterIntentError, _super);

return RouterIntentError;
}(RouterError));
export { RouterIntentError };
}(RouterError_1.RouterError));
exports.RouterIntentError = RouterIntentError;

@@ -0,1 +1,2 @@

"use strict";
var __extends = (this && this.__extends) || (function () {

@@ -16,3 +17,5 @@ var extendStatics = function (d, b) {

})();
import { RouterError } from './RouterError';
Object.defineProperty(exports, "__esModule", { value: true });
exports.RouterNotFount = void 0;
var RouterError_1 = require("./RouterError");
var RouterNotFount = (function (_super) {

@@ -24,3 +27,3 @@ __extends(RouterNotFount, _super);

return RouterNotFount;
}(RouterError));
export { RouterNotFount };
}(RouterError_1.RouterError));
exports.RouterNotFount = RouterNotFount;

@@ -0,1 +1,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DomUtils = void 0;
var DomUtils = (function () {

@@ -42,2 +45,2 @@ function DomUtils() {

}());
export { DomUtils };
exports.DomUtils = DomUtils;

@@ -0,1 +1,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeUtils = void 0;
var NodeUtils = (function () {

@@ -22,2 +25,2 @@ function NodeUtils() {

}());
export { NodeUtils };
exports.NodeUtils = NodeUtils;

@@ -0,1 +1,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LocationUtils = void 0;
var LocationUtils = (function () {

@@ -31,2 +34,2 @@ function LocationUtils() {

}());
export { LocationUtils };
exports.LocationUtils = LocationUtils;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc