simple-boot-front 1.0.95 → 1.0.99
Sign up to get free protection for your applications and to get access to all the features.
- package/README.MD +335 -335
- package/SimpleBootFront.d.ts +32 -25
- package/SimpleBootFront.js +327 -231
- package/decorators/Component.d.ts +11 -11
- package/decorators/Component.js +30 -54
- package/decorators/Script.d.ts +10 -10
- package/decorators/Script.js +31 -31
- package/decorators/inject/InjectFrontSituationType.d.ts +3 -0
- package/decorators/inject/InjectFrontSituationType.js +7 -0
- package/fetch/Fetcher.d.ts +4 -4
- package/fetch/Fetcher.js +9 -9
- package/lifecycle/OnChangedRender.d.ts +3 -3
- package/lifecycle/OnChangedRender.js +2 -2
- package/lifecycle/OnDestroy.d.ts +3 -3
- package/lifecycle/OnDestroy.js +2 -2
- package/lifecycle/OnFinish.d.ts +3 -3
- package/lifecycle/OnFinish.js +2 -2
- package/lifecycle/OnInit.d.ts +8 -3
- package/lifecycle/OnInit.js +2 -2
- package/lifecycle/OnInitedChild.d.ts +3 -3
- package/lifecycle/OnInitedChild.js +2 -2
- package/option/SimFrontOption.d.ts +14 -14
- package/option/SimFrontOption.js +45 -45
- package/package.json +84 -82
- package/script/ScriptRunnable.d.ts +7 -7
- package/script/ScriptRunnable.js +22 -22
- package/service/CookieService.d.ts +11 -8
- package/service/CookieService.js +54 -42
- package/service/HttpService.d.ts +3 -3
- package/service/HttpService.js +23 -23
- package/service/MetaTagService.d.ts +11 -0
- package/service/MetaTagService.js +52 -0
- package/service/Navigation.d.ts +18 -12
- package/service/Navigation.js +117 -75
- package/service/ScriptService.d.ts +7 -7
- package/service/ScriptService.js +39 -39
- package/service/StorageService.d.ts +12 -0
- package/service/StorageService.js +67 -0
- package/service/view/View.d.ts +6 -6
- package/service/view/View.js +29 -29
- package/service/view/ViewService.d.ts +7 -7
- package/service/view/ViewService.js +46 -46
- package/throwable/RouterError.d.ts +4 -4
- package/throwable/RouterError.js +27 -27
- package/throwable/RouterIntentError.d.ts +4 -4
- package/throwable/RouterIntentError.js +27 -27
- package/throwable/RouterNotFount.d.ts +4 -4
- package/throwable/RouterNotFount.js +27 -27
- package/utils/dom/DomUtils.d.ts +0 -13
- package/utils/dom/DomUtils.js +0 -45
- package/utils/node/NodeUtils.d.ts +0 -10
- package/utils/node/NodeUtils.js +0 -25
- package/utils/window/LocationUtils.d.ts +0 -8
- package/utils/window/LocationUtils.js +0 -34
package/service/view/View.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
export declare class View<T extends Element> {
|
2
|
-
private _e;
|
3
|
-
constructor(_e: T | string);
|
4
|
-
get e(): T;
|
5
|
-
get value(): any;
|
6
|
-
}
|
1
|
+
export declare class View<T extends Element> {
|
2
|
+
private _e;
|
3
|
+
constructor(_e: T | string);
|
4
|
+
get e(): T;
|
5
|
+
get value(): any;
|
6
|
+
}
|
package/service/view/View.js
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.View = void 0;
|
4
|
-
var View = (function () {
|
5
|
-
function View(_e) {
|
6
|
-
this._e = _e;
|
7
|
-
}
|
8
|
-
Object.defineProperty(View.prototype, "e", {
|
9
|
-
get: function () {
|
10
|
-
if (typeof this._e === 'string') {
|
11
|
-
return document.querySelector(this._e);
|
12
|
-
}
|
13
|
-
else {
|
14
|
-
return this._e;
|
15
|
-
}
|
16
|
-
},
|
17
|
-
enumerable: false,
|
18
|
-
configurable: true
|
19
|
-
});
|
20
|
-
Object.defineProperty(View.prototype, "value", {
|
21
|
-
get: function () {
|
22
|
-
return this.e.value;
|
23
|
-
},
|
24
|
-
enumerable: false,
|
25
|
-
configurable: true
|
26
|
-
});
|
27
|
-
return View;
|
28
|
-
}());
|
29
|
-
exports.View = View;
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.View = void 0;
|
4
|
+
var View = (function () {
|
5
|
+
function View(_e) {
|
6
|
+
this._e = _e;
|
7
|
+
}
|
8
|
+
Object.defineProperty(View.prototype, "e", {
|
9
|
+
get: function () {
|
10
|
+
if (typeof this._e === 'string') {
|
11
|
+
return document.querySelector(this._e);
|
12
|
+
}
|
13
|
+
else {
|
14
|
+
return this._e;
|
15
|
+
}
|
16
|
+
},
|
17
|
+
enumerable: false,
|
18
|
+
configurable: true
|
19
|
+
});
|
20
|
+
Object.defineProperty(View.prototype, "value", {
|
21
|
+
get: function () {
|
22
|
+
return this.e.value;
|
23
|
+
},
|
24
|
+
enumerable: false,
|
25
|
+
configurable: true
|
26
|
+
});
|
27
|
+
return View;
|
28
|
+
}());
|
29
|
+
exports.View = View;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { View } from '../../service/view/View';
|
2
|
-
export declare class ViewService {
|
3
|
-
constructor();
|
4
|
-
e<T extends Element>(selector: string): View<T> | undefined;
|
5
|
-
eI<T extends Element = Element>(selector: string): View<T> | undefined;
|
6
|
-
eC<T extends Element = Element>(selector: string): View<T> | undefined;
|
7
|
-
}
|
1
|
+
import { View } from '../../service/view/View';
|
2
|
+
export declare class ViewService {
|
3
|
+
constructor();
|
4
|
+
e<T extends Element>(selector: string): View<T> | undefined;
|
5
|
+
eI<T extends Element = Element>(selector: string): View<T> | undefined;
|
6
|
+
eC<T extends Element = Element>(selector: string): View<T> | undefined;
|
7
|
+
}
|
@@ -1,46 +1,46 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
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;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.ViewService = void 0;
|
13
|
-
var SimDecorator_1 = require("simple-boot-core/decorators/SimDecorator");
|
14
|
-
var View_1 = require("../../service/view/View");
|
15
|
-
var ViewService = (function () {
|
16
|
-
function ViewService() {
|
17
|
-
}
|
18
|
-
ViewService.prototype.e = function (selector) {
|
19
|
-
try {
|
20
|
-
var querySelector = document.querySelector(selector);
|
21
|
-
if (querySelector) {
|
22
|
-
return new View_1.View(querySelector);
|
23
|
-
}
|
24
|
-
else {
|
25
|
-
return undefined;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
catch (e) {
|
29
|
-
return undefined;
|
30
|
-
}
|
31
|
-
};
|
32
|
-
ViewService.prototype.eI = function (selector) {
|
33
|
-
var _a;
|
34
|
-
return (_a = this.e("#"
|
35
|
-
};
|
36
|
-
ViewService.prototype.eC = function (selector) {
|
37
|
-
var _a;
|
38
|
-
return (_a = this.e("."
|
39
|
-
};
|
40
|
-
ViewService = __decorate([
|
41
|
-
(0, SimDecorator_1.Sim)(),
|
42
|
-
__metadata("design:paramtypes", [])
|
43
|
-
], ViewService);
|
44
|
-
return ViewService;
|
45
|
-
}());
|
46
|
-
exports.ViewService = ViewService;
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
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;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.ViewService = void 0;
|
13
|
+
var SimDecorator_1 = require("simple-boot-core/decorators/SimDecorator");
|
14
|
+
var View_1 = require("../../service/view/View");
|
15
|
+
var ViewService = (function () {
|
16
|
+
function ViewService() {
|
17
|
+
}
|
18
|
+
ViewService.prototype.e = function (selector) {
|
19
|
+
try {
|
20
|
+
var querySelector = document.querySelector(selector);
|
21
|
+
if (querySelector) {
|
22
|
+
return new View_1.View(querySelector);
|
23
|
+
}
|
24
|
+
else {
|
25
|
+
return undefined;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
catch (e) {
|
29
|
+
return undefined;
|
30
|
+
}
|
31
|
+
};
|
32
|
+
ViewService.prototype.eI = function (selector) {
|
33
|
+
var _a;
|
34
|
+
return (_a = this.e("#".concat(selector))) !== null && _a !== void 0 ? _a : undefined;
|
35
|
+
};
|
36
|
+
ViewService.prototype.eC = function (selector) {
|
37
|
+
var _a;
|
38
|
+
return (_a = this.e(".".concat(selector))) !== null && _a !== void 0 ? _a : undefined;
|
39
|
+
};
|
40
|
+
ViewService = __decorate([
|
41
|
+
(0, SimDecorator_1.Sim)(),
|
42
|
+
__metadata("design:paramtypes", [])
|
43
|
+
], ViewService);
|
44
|
+
return ViewService;
|
45
|
+
}());
|
46
|
+
exports.ViewService = ViewService;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SimError } from 'simple-boot-core/throwable/SimError';
|
2
|
-
export declare class RouterError extends SimError {
|
3
|
-
constructor(message?: string, name?: string, stack?: string);
|
4
|
-
}
|
1
|
+
import { SimError } from 'simple-boot-core/throwable/SimError';
|
2
|
+
export declare class RouterError extends SimError {
|
3
|
+
constructor(message?: string, name?: string, stack?: string);
|
4
|
+
}
|
package/throwable/RouterError.js
CHANGED
@@ -1,27 +1,27 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
3
|
-
var extendStatics = function (d, b) {
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
-
return extendStatics(d, b);
|
8
|
-
};
|
9
|
-
return function (d, b) {
|
10
|
-
if (typeof b !== "function" && b !== null)
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
-
extendStatics(d, b);
|
13
|
-
function __() { this.constructor = d; }
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
-
};
|
16
|
-
})();
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
-
exports.RouterError = void 0;
|
19
|
-
var SimError_1 = require("simple-boot-core/throwable/SimError");
|
20
|
-
var RouterError = (function (_super) {
|
21
|
-
__extends(RouterError, _super);
|
22
|
-
function RouterError(message, name, stack) {
|
23
|
-
return _super.call(this, message, name, stack) || this;
|
24
|
-
}
|
25
|
-
return RouterError;
|
26
|
-
}(SimError_1.SimError));
|
27
|
-
exports.RouterError = RouterError;
|
1
|
+
"use strict";
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
3
|
+
var extendStatics = function (d, b) {
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
+
return extendStatics(d, b);
|
8
|
+
};
|
9
|
+
return function (d, b) {
|
10
|
+
if (typeof b !== "function" && b !== null)
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
+
extendStatics(d, b);
|
13
|
+
function __() { this.constructor = d; }
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
+
};
|
16
|
+
})();
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
+
exports.RouterError = void 0;
|
19
|
+
var SimError_1 = require("simple-boot-core/throwable/SimError");
|
20
|
+
var RouterError = (function (_super) {
|
21
|
+
__extends(RouterError, _super);
|
22
|
+
function RouterError(message, name, stack) {
|
23
|
+
return _super.call(this, message, name, stack) || this;
|
24
|
+
}
|
25
|
+
return RouterError;
|
26
|
+
}(SimError_1.SimError));
|
27
|
+
exports.RouterError = RouterError;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { RouterError } from './RouterError';
|
2
|
-
export declare class RouterIntentError extends RouterError {
|
3
|
-
constructor(message?: string, name?: string, stack?: string);
|
4
|
-
}
|
1
|
+
import { RouterError } from './RouterError';
|
2
|
+
export declare class RouterIntentError extends RouterError {
|
3
|
+
constructor(message?: string, name?: string, stack?: string);
|
4
|
+
}
|
@@ -1,27 +1,27 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
3
|
-
var extendStatics = function (d, b) {
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
-
return extendStatics(d, b);
|
8
|
-
};
|
9
|
-
return function (d, b) {
|
10
|
-
if (typeof b !== "function" && b !== null)
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
-
extendStatics(d, b);
|
13
|
-
function __() { this.constructor = d; }
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
-
};
|
16
|
-
})();
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
-
exports.RouterIntentError = void 0;
|
19
|
-
var RouterError_1 = require("./RouterError");
|
20
|
-
var RouterIntentError = (function (_super) {
|
21
|
-
__extends(RouterIntentError, _super);
|
22
|
-
function RouterIntentError(message, name, stack) {
|
23
|
-
return _super.call(this, message, name, stack) || this;
|
24
|
-
}
|
25
|
-
return RouterIntentError;
|
26
|
-
}(RouterError_1.RouterError));
|
27
|
-
exports.RouterIntentError = RouterIntentError;
|
1
|
+
"use strict";
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
3
|
+
var extendStatics = function (d, b) {
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
+
return extendStatics(d, b);
|
8
|
+
};
|
9
|
+
return function (d, b) {
|
10
|
+
if (typeof b !== "function" && b !== null)
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
+
extendStatics(d, b);
|
13
|
+
function __() { this.constructor = d; }
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
+
};
|
16
|
+
})();
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
+
exports.RouterIntentError = void 0;
|
19
|
+
var RouterError_1 = require("./RouterError");
|
20
|
+
var RouterIntentError = (function (_super) {
|
21
|
+
__extends(RouterIntentError, _super);
|
22
|
+
function RouterIntentError(message, name, stack) {
|
23
|
+
return _super.call(this, message, name, stack) || this;
|
24
|
+
}
|
25
|
+
return RouterIntentError;
|
26
|
+
}(RouterError_1.RouterError));
|
27
|
+
exports.RouterIntentError = RouterIntentError;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { RouterError } from './RouterError';
|
2
|
-
export declare class RouterNotFount extends RouterError {
|
3
|
-
constructor(message?: string, name?: string, stack?: string);
|
4
|
-
}
|
1
|
+
import { RouterError } from './RouterError';
|
2
|
+
export declare class RouterNotFount extends RouterError {
|
3
|
+
constructor(message?: string, name?: string, stack?: string);
|
4
|
+
}
|
@@ -1,27 +1,27 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
3
|
-
var extendStatics = function (d, b) {
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
-
return extendStatics(d, b);
|
8
|
-
};
|
9
|
-
return function (d, b) {
|
10
|
-
if (typeof b !== "function" && b !== null)
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
-
extendStatics(d, b);
|
13
|
-
function __() { this.constructor = d; }
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
-
};
|
16
|
-
})();
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
-
exports.RouterNotFount = void 0;
|
19
|
-
var RouterError_1 = require("./RouterError");
|
20
|
-
var RouterNotFount = (function (_super) {
|
21
|
-
__extends(RouterNotFount, _super);
|
22
|
-
function RouterNotFount(message, name, stack) {
|
23
|
-
return _super.call(this, message, name, stack) || this;
|
24
|
-
}
|
25
|
-
return RouterNotFount;
|
26
|
-
}(RouterError_1.RouterError));
|
27
|
-
exports.RouterNotFount = RouterNotFount;
|
1
|
+
"use strict";
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
3
|
+
var extendStatics = function (d, b) {
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
+
return extendStatics(d, b);
|
8
|
+
};
|
9
|
+
return function (d, b) {
|
10
|
+
if (typeof b !== "function" && b !== null)
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
+
extendStatics(d, b);
|
13
|
+
function __() { this.constructor = d; }
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
+
};
|
16
|
+
})();
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
18
|
+
exports.RouterNotFount = void 0;
|
19
|
+
var RouterError_1 = require("./RouterError");
|
20
|
+
var RouterNotFount = (function (_super) {
|
21
|
+
__extends(RouterNotFount, _super);
|
22
|
+
function RouterNotFount(message, name, stack) {
|
23
|
+
return _super.call(this, message, name, stack) || this;
|
24
|
+
}
|
25
|
+
return RouterNotFount;
|
26
|
+
}(RouterError_1.RouterError));
|
27
|
+
exports.RouterNotFount = RouterNotFount;
|
package/utils/dom/DomUtils.d.ts
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
export declare type Attr = {
|
2
|
-
name: string;
|
3
|
-
value: any;
|
4
|
-
};
|
5
|
-
export declare class DomUtils {
|
6
|
-
static selectorElements(selector: string, element?: Element | Document): Element[];
|
7
|
-
static selectorNodes(selector: string, element?: Element | Document): NodeListOf<Element>;
|
8
|
-
static removeAttribute(result: HTMLElement, attrs: string[]): void;
|
9
|
-
static setAttribute(result: HTMLElement, attrs: string[]): void;
|
10
|
-
static setAttributeAttr(result: HTMLElement, attrs: Attr[]): void;
|
11
|
-
static getAttributeToObject(input: HTMLElement): any;
|
12
|
-
static getStyleToObject(input: HTMLElement): any;
|
13
|
-
}
|
package/utils/dom/DomUtils.js
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.DomUtils = void 0;
|
4
|
-
var DomUtils = (function () {
|
5
|
-
function DomUtils() {
|
6
|
-
}
|
7
|
-
DomUtils.selectorElements = function (selector, element) {
|
8
|
-
if (element === void 0) { element = document; }
|
9
|
-
return Array.prototype.slice.call(element.querySelectorAll(selector));
|
10
|
-
};
|
11
|
-
DomUtils.selectorNodes = function (selector, element) {
|
12
|
-
if (element === void 0) { element = document; }
|
13
|
-
return element.querySelectorAll(selector);
|
14
|
-
};
|
15
|
-
DomUtils.removeAttribute = function (result, attrs) {
|
16
|
-
attrs.forEach(function (it) {
|
17
|
-
result.removeAttribute(it);
|
18
|
-
});
|
19
|
-
};
|
20
|
-
DomUtils.setAttribute = function (result, attrs) {
|
21
|
-
attrs.forEach(function (it) {
|
22
|
-
result.setAttribute(it, '');
|
23
|
-
});
|
24
|
-
};
|
25
|
-
DomUtils.setAttributeAttr = function (result, attrs) {
|
26
|
-
attrs.forEach(function (it) {
|
27
|
-
result.setAttribute(it.name, it.value);
|
28
|
-
});
|
29
|
-
};
|
30
|
-
DomUtils.getAttributeToObject = function (input) {
|
31
|
-
var attribute = {};
|
32
|
-
input.getAttributeNames().forEach(function (ait) { return attribute[ait] = input.getAttribute(ait); });
|
33
|
-
return attribute;
|
34
|
-
};
|
35
|
-
DomUtils.getStyleToObject = function (input) {
|
36
|
-
var style = {};
|
37
|
-
for (var i = 0; i < input.style.length; i++) {
|
38
|
-
var key = input.style[i];
|
39
|
-
style[key] = input.style[key];
|
40
|
-
}
|
41
|
-
return style;
|
42
|
-
};
|
43
|
-
return DomUtils;
|
44
|
-
}());
|
45
|
-
exports.DomUtils = DomUtils;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
export declare type Attr = {
|
2
|
-
name: string;
|
3
|
-
value: any;
|
4
|
-
};
|
5
|
-
export declare class NodeUtils {
|
6
|
-
static removeAllChildNode(node: Node): void;
|
7
|
-
static appendChild(parentNode: Node, childNode: Node): Node;
|
8
|
-
static replaceNode(targetNode: Node, newNode: Node): Node | undefined;
|
9
|
-
static addNode(targetNode: Node, newNode: Node): Node | undefined;
|
10
|
-
}
|
package/utils/node/NodeUtils.js
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.NodeUtils = void 0;
|
4
|
-
var NodeUtils = (function () {
|
5
|
-
function NodeUtils() {
|
6
|
-
}
|
7
|
-
NodeUtils.removeAllChildNode = function (node) {
|
8
|
-
while (node === null || node === void 0 ? void 0 : node.firstChild) {
|
9
|
-
node.firstChild.remove();
|
10
|
-
}
|
11
|
-
};
|
12
|
-
NodeUtils.appendChild = function (parentNode, childNode) {
|
13
|
-
return parentNode.appendChild(childNode);
|
14
|
-
};
|
15
|
-
NodeUtils.replaceNode = function (targetNode, newNode) {
|
16
|
-
var _a;
|
17
|
-
return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newNode, targetNode);
|
18
|
-
};
|
19
|
-
NodeUtils.addNode = function (targetNode, newNode) {
|
20
|
-
var _a;
|
21
|
-
return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newNode, targetNode.nextSibling);
|
22
|
-
};
|
23
|
-
return NodeUtils;
|
24
|
-
}());
|
25
|
-
exports.NodeUtils = NodeUtils;
|
@@ -1,34 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.LocationUtils = void 0;
|
4
|
-
var LocationUtils = (function () {
|
5
|
-
function LocationUtils() {
|
6
|
-
}
|
7
|
-
LocationUtils.hash = function () {
|
8
|
-
return window.location.hash.replace('#', '');
|
9
|
-
};
|
10
|
-
LocationUtils.hashPath = function () {
|
11
|
-
return '/' + window.location.hash.replace('#', '').split('?')[0];
|
12
|
-
};
|
13
|
-
LocationUtils.hashQueryParams = function () {
|
14
|
-
var s = window.location.hash.replace('#', '').split('?')[1] || '';
|
15
|
-
return this.queryStringToMap(s);
|
16
|
-
};
|
17
|
-
LocationUtils.path = function () {
|
18
|
-
return window.location.pathname;
|
19
|
-
};
|
20
|
-
LocationUtils.pathQueryParams = function () {
|
21
|
-
return this.queryStringToMap(window.location.search.substring(1));
|
22
|
-
};
|
23
|
-
LocationUtils.queryStringToMap = function (s) {
|
24
|
-
var params = new Map();
|
25
|
-
var vars = s.split('&') || [];
|
26
|
-
vars.forEach(function (it) {
|
27
|
-
var kv = it.split('=') || [];
|
28
|
-
params.set(kv[0], kv[1]);
|
29
|
-
});
|
30
|
-
return params;
|
31
|
-
};
|
32
|
-
return LocationUtils;
|
33
|
-
}());
|
34
|
-
exports.LocationUtils = LocationUtils;
|