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.42 to 1.0.43

module/FrontModule.d.ts

10

package.json
{
"name": "simple-boot-front",
"version": "1.0.42",
"version": "1.0.43",
"main": "SimpleApplication.js",

@@ -33,2 +33,5 @@ "license": "MIT",

},
"workspaces": [
"examples/dev"
],
"jest": {

@@ -69,3 +72,4 @@ "transform": {

"supertest": "^6.1.3",
"ts-jest": "^26.5.4"
"ts-jest": "^26.5.4",
"typescript": "^4.3.5"
},

@@ -75,4 +79,4 @@ "dependencies": {

"rxjs": "^6.6.7",
"typescript": "^4.2.3"
"simple-boot-core": "^1.0.3"
}
}
![Single Page Application Framworks](assets/banner.png)
[![npm version](https://img.shields.io/badge/npm-v1.0.42-blue)](https://www.npmjs.com/package/simple-boot-front) [![license](https://img.shields.io/badge/license-MIT-green)](LICENSE.md) [![Chat](https://img.shields.io/badge/discord-20%20online-brightgreen?logo=discord)](https://discord.gg/PW56dpns) [![Github](https://img.shields.io/badge/-github-black?logo=github)](https://github.com/visualkhh/simple-boot-front)
[![npm version](https://img.shields.io/badge/npm-v1.0.43-blue)](https://www.npmjs.com/package/simple-boot-front) [![license](https://img.shields.io/badge/license-MIT-green)](LICENSE.md) [![Chat](https://img.shields.io/badge/discord-20%20online-brightgreen?logo=discord)](https://discord.gg/PW56dpns) [![Github](https://img.shields.io/badge/-github-black?logo=github)](https://github.com/visualkhh/simple-boot-front)

@@ -4,0 +4,0 @@ Single Page Application Framworks for Web

@@ -19,3 +19,3 @@ var __extends = (this && this.__extends) || (function () {

import { ScopeRawSet } from './ScopeRawSet';
import { RandomUtils } from '../../util/random/RandomUtils';
import { RandomUtils } from 'simple-boot-core/utils/random/RandomUtils';
export var TargetNodeMode;

@@ -22,0 +22,0 @@ (function (TargetNodeMode) {

import { ScopeObject } from './ScopeObject';
import { ScopePosition } from './ScopePosition';
import { RandomUtils } from '../../util/random/RandomUtils';
import { RandomUtils } from 'simple-boot-core/utils/random/RandomUtils';
var Scope = (function () {

@@ -5,0 +5,0 @@ function Scope(raws, obj, uuid, config, position) {

import { ScopeResultSet } from './ScopeResultSet';
import { Module } from '../../module/Module';
import { ModuleOption } from "../../module/ModuleOption";
import { FrontModule } from '../../module/FrontModule';
import { FrontModuleOption } from '../../module/FrontModuleOption';
export declare type ScopeObjectCalls = {

@@ -11,4 +11,4 @@ name: string;

uuid: string;
_dynamicModule: Map<string, Module[]>;
_option: ModuleOption;
_dynamicModule: Map<string, FrontModule[]>;
_option: FrontModuleOption;
calls: ScopeObjectCalls;

@@ -21,5 +21,5 @@ [name: string]: any;

private scopeEval;
newSimOrAddDynamicModule(moduleName: string): Module | undefined;
newSimOrAddDynamicModule(moduleName: string): any;
appendWrite(str: string): void;
moduleWriteAndSetScope(module: Module): void;
moduleWriteAndSetScope(module: FrontModule): void;
}

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

import { RandomUtils } from '../../util/random/RandomUtils';
import { RandomUtils } from 'simple-boot-core/utils/random/RandomUtils';
import { ScopeResultSet } from './ScopeResultSet';
import { TargetNode, TargetNodeMode } from './RootScope';
import { SimGlobal } from "../../global/SimGlobal";
import { SimGlobal } from 'simple-boot-core/global/SimGlobal';
var ScopeObject = (function () {

@@ -36,3 +36,3 @@ function ScopeObject(uuid) {

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

@@ -39,0 +39,0 @@ return newSim;

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

import { Runnable } from '../../run/Runnable';
import { Runnable } from 'simple-boot-core/run/Runnable';
import { RootScope } from './RootScope';
import { ScopeRawSet } from "./ScopeRawSet";
import { ScopeRawSet } from './ScopeRawSet';
export declare class SimCompiler implements Runnable {

@@ -5,0 +5,0 @@ raws: ScopeRawSet;

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

import { RandomUtils } from '../../util/random/RandomUtils';
import { RandomUtils } from 'simple-boot-core/utils/random/RandomUtils';
import { RootScope } from './RootScope';

@@ -3,0 +3,0 @@ var SimCompiler = (function () {

@@ -1,14 +0,14 @@

import { Module } from '../module/Module';
import { SimOption } from '../option/SimOption';
import { FrontModule } from '../module/FrontModule';
import { SimFrontOption } from '../option/SimFrontOption';
import { Scope } from './compile/Scope';
import { RootScope } from './compile/RootScope';
import { ScopeRawSet } from "./compile/ScopeRawSet";
import { ScopeRawSet } from './compile/ScopeRawSet';
export declare class Renderer {
private option;
constructor(option: SimOption);
constructor(option: SimFrontOption);
compileScope(rawSet: ScopeRawSet, obj: any, rootUUID?: string): RootScope | undefined;
render(module: Module | string): void;
renderToScope(scope: Scope, module: Module, varName: string): void;
renderToByScopes(scope: RootScope, module: Module): void;
render(module: FrontModule | string): void;
renderToScope(scope: Scope, module: FrontModule, varName: string): void;
renderToByScopes(scope: RootScope, module: FrontModule): void;
prependStyle(selector: string, style: string | undefined): void;
}

@@ -10,8 +10,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

};
import { Module } from '../module/Module';
import { SimOption } from '../option/SimOption';
import { Sim } from '../decorators/SimDecorator';
import { FrontModule } from '../module/FrontModule';
import { SimFrontOption } from '../option/SimFrontOption';
import { Sim } from 'simple-boot-core/decorators/SimDecorator';
import { SimCompiler } from './compile/SimCompiler';
import { RandomUtils } from '../util/random/RandomUtils';
import { NodeUtils } from '../util/node/NodeUtils';
import { RandomUtils } from 'simple-boot-core/utils/random/RandomUtils';
import { NodeUtils } from '../utils/node/NodeUtils';
import { TargetNodeMode } from './compile/RootScope';

@@ -29,3 +29,3 @@ var Renderer = (function () {

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

@@ -55,3 +55,3 @@ module._onChangedRender();

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

@@ -92,3 +92,3 @@ });

Sim(),
__metadata("design:paramtypes", [SimOption])
__metadata("design:paramtypes", [SimFrontOption])
], Renderer);

@@ -95,0 +95,0 @@ return Renderer;

@@ -1,19 +0,22 @@

import { Module } from '../module/Module';
import { ConstructorType } from '../types/Types';
import { SimBase } from '../base/SimBase';
import { FrontModule } from '../module/FrontModule';
import { ConstructorType } from 'simple-boot-core/types/Types';
import { RouterModule } from './RouterModule';
import { Url } from '../model/Url';
export declare class Router extends SimBase {
import { IntentEvent } from 'simple-boot-core/intent/IntentEvent';
import { Intent } from 'simple-boot-core/intent/Intent';
export declare class Router implements IntentEvent {
path: string;
module?: ConstructorType<Module> | undefined;
module?: ConstructorType<FrontModule> | undefined;
childs: ConstructorType<Router>[];
[name: string]: ConstructorType<Module> | any;
[name: string]: ConstructorType<FrontModule> | any;
private _simstanceManager;
private _navigation;
constructor(path: string, module?: ConstructorType<Module> | undefined, childs?: ConstructorType<Router>[]);
constructor(path: string, module?: ConstructorType<FrontModule> | undefined, childs?: ConstructorType<Router>[]);
publish(intent: Intent): void;
subscribe(intent: Intent): void;
getExecuteModule(parentRouters: Router[]): RouterModule | undefined;
isRootUrl(parentRoots: string[], url: string): boolean;
routing(parentRoots: string[], path: string): RouterModule | undefined;
canActivate(url: Url, module: RouterModule): Promise<RouterModule | ConstructorType<Module>>;
notFound(url: Url): ConstructorType<Module> | undefined;
canActivate(url: Url, module: RouterModule): Promise<RouterModule | ConstructorType<FrontModule>>;
notFound(url: Url): ConstructorType<FrontModule> | undefined;
}

@@ -1,16 +0,1 @@

var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -52,19 +37,21 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
import { SimBase } from '../base/SimBase';
import { SimGlobal } from '../global/SimGlobal';
import { SimGlobal } from 'simple-boot-core/global/SimGlobal';
import { Navigation } from '../service/Navigation';
import { RouterModule } from './RouterModule';
var Router = (function (_super) {
__extends(Router, _super);
var Router = (function () {
function Router(path, module, childs) {
if (childs === void 0) { childs = []; }
var _a;
var _this = _super.call(this) || this;
_this.path = path;
_this.module = module;
_this.childs = childs;
_this._simstanceManager = (_a = SimGlobal.application) === null || _a === void 0 ? void 0 : _a.simstanceManager,
_this._navigation = _this._simstanceManager.getOrNewSim(Navigation);
return _this;
this.path = path;
this.module = module;
this.childs = childs;
this._simstanceManager = (_a = SimGlobal().application) === null || _a === void 0 ? void 0 : _a.simstanceManager;
this._navigation = this._simstanceManager.getOrNewSim(Navigation);
}
Router.prototype.publish = function (intent) {
var _a, _b;
(_b = (_a = SimGlobal()) === null || _a === void 0 ? void 0 : _a.application) === null || _b === void 0 ? void 0 : _b.intentManager.onNext(intent);
};
Router.prototype.subscribe = function (intent) {
};
Router.prototype.getExecuteModule = function (parentRouters) {

@@ -115,3 +102,3 @@ var path = this._navigation.path;

return Router;
}(SimBase));
}());
export { Router };
import 'reflect-metadata';
import { SimstanceManager } from '../simstance/SimstanceManager';
import { Runnable } from '../run/Runnable';
import { Module } from '../module/Module';
import { SimOption } from '../option/SimOption';
import { SimstanceManager } from 'simple-boot-core/simstance/SimstanceManager';
import { Runnable } from 'simple-boot-core/run/Runnable';
import { FrontModule } from '../module/FrontModule';
import { SimFrontOption } from '../option/SimFrontOption';
export declare class RouterManager implements Runnable {
private option;
private simstanceManager;
constructor(option: SimOption, simstanceManager: SimstanceManager);
constructor(option: SimFrontOption, simstanceManager: SimstanceManager);
run(): void;

@@ -14,3 +14,3 @@ executeRouter(): void;

procAttr(attrName: string, f: (h: HTMLElement, value: string | null) => void): void;
render(module: Module | undefined, targetSelector: Node | null): boolean;
render(module: FrontModule | undefined, targetSelector: Node | null): boolean;
}
import 'reflect-metadata';
import { fromEvent } from 'rxjs';
import { FunctionUtils } from '../util/function/FunctionUtils';
import { FunctionUtils } from 'simple-boot-core/utils/function/FunctionUtils';
import { FrontModule } from '../module/FrontModule';
import { Navigation } from '../service/Navigation';

@@ -27,3 +28,3 @@ import { RouterModule } from './RouterModule';

if (!executeModule) {
var notFound = undefined;
var notFound = void 0;
for (var _i = 0, _c = routers.slice().reverse(); _i < _c.length; _i++) {

@@ -48,11 +49,13 @@ var route = _c[_i];

var moduleObj = (_a = _this.simstanceManager) === null || _a === void 0 ? void 0 : _a.getOrNewSim(it.module);
if (!document.querySelector("[module-id='" + (moduleObj === null || moduleObj === void 0 ? void 0 : moduleObj.id) + "']")) {
_this.render(moduleObj, document.querySelector(lastRouterSelector_1));
if (moduleObj instanceof FrontModule) {
if (!document.querySelector("[module-id='" + (moduleObj === null || moduleObj === void 0 ? void 0 : moduleObj.id) + "']")) {
_this.render(moduleObj, document.querySelector(lastRouterSelector_1));
}
if (moduleObj === null || moduleObj === void 0 ? void 0 : moduleObj._router_outlet_id) {
lastRouterSelector_1 = '#' + (moduleObj === null || moduleObj === void 0 ? void 0 : moduleObj._router_outlet_id);
}
else {
lastRouterSelector_1 = '#' + (moduleObj === null || moduleObj === void 0 ? void 0 : moduleObj.id);
}
}
if (moduleObj === null || moduleObj === void 0 ? void 0 : moduleObj._router_outlet_id) {
lastRouterSelector_1 = '#' + (moduleObj === null || moduleObj === void 0 ? void 0 : moduleObj._router_outlet_id);
}
else {
lastRouterSelector_1 = '#' + (moduleObj === null || moduleObj === void 0 ? void 0 : moduleObj.id);
}
});

@@ -59,0 +62,0 @@ var module_1 = targetModule instanceof RouterModule ? targetModule.module : (_b = _this.simstanceManager) === null || _b === void 0 ? void 0 : _b.getOrNewSim(targetModule);

import { Router } from './Router';
import { Module } from '../module/Module';
import { FrontModule } from '../module/FrontModule';
export declare class RouterModule {
router?: Router | undefined;
module?: Module | undefined;
constructor(router?: Router | undefined, module?: Module | undefined);
module?: FrontModule | undefined;
constructor(router?: Router | undefined, module?: FrontModule | undefined);
}

@@ -10,3 +10,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

};
import { Sim } from '../decorators/SimDecorator';
import { Sim } from 'simple-boot-core/decorators/SimDecorator';
import { ajax } from 'rxjs/ajax';

@@ -13,0 +13,0 @@ var AjaxService = (function () {

@@ -1,6 +0,6 @@

import { SimOption } from '../option/SimOption';
import { SimFrontOption } from '../option/SimFrontOption';
import { Url } from '../model/Url';
export declare class Navigation {
private option;
constructor(option: SimOption);
constructor(option: SimFrontOption);
get path(): string;

@@ -7,0 +7,0 @@ get queryParams(): Map<string, string>;

@@ -10,5 +10,5 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

};
import { Sim } from '../decorators/SimDecorator';
import { SimOption, UrlType } from '../option/SimOption';
import { LocationUtils } from '../util/window/LocationUtils';
import { Sim } from 'simple-boot-core/decorators/SimDecorator';
import { SimFrontOption, UrlType } from '../option/SimFrontOption';
import { LocationUtils } from '../utils/window/LocationUtils';
var Navigation = (function () {

@@ -69,3 +69,3 @@ function Navigation(option) {

Sim(),
__metadata("design:paramtypes", [SimOption])
__metadata("design:paramtypes", [SimFrontOption])
], Navigation);

@@ -72,0 +72,0 @@ return Navigation;

import { Observable } from 'rxjs';
import { Module } from '../../module/Module';
import { FromEventTarget } from "rxjs/internal/observable/fromEvent";
import { FrontModule } from '../../module/FrontModule';
import { FromEventTarget } from 'rxjs/internal/observable/fromEvent';
export declare class View<T extends Element> {
private _e;
module?: Module | undefined;
constructor(_e: T | FromEventTarget<any> | string, module?: Module | undefined);
module?: FrontModule | undefined;
constructor(_e: T | FromEventTarget<any> | string, module?: FrontModule | undefined);
event<T>(eventName: string): Observable<T>;

@@ -9,0 +9,0 @@ click<E>(): Observable<E>;

@@ -10,3 +10,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

};
import { Sim } from '../../decorators/SimDecorator';
import { Sim } from 'simple-boot-core/decorators/SimDecorator';
import { View } from '../../service/view/View';

@@ -13,0 +13,0 @@ var ViewService = (function () {

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

import { SimError } from './SimError';
import { SimError } from 'simple-boot-core/throwable/SimError';
export declare class RouterError extends SimError {
constructor(message?: string, name?: string, stack?: string);
}

@@ -16,3 +16,3 @@ var __extends = (this && this.__extends) || (function () {

})();
import { SimError } from './SimError';
import { SimError } from 'simple-boot-core/throwable/SimError';
var RouterError = (function (_super) {

@@ -19,0 +19,0 @@ __extends(RouterError, _super);

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