simple-boot-front 1.0.101 → 1.0.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.MD +11 -11
- package/SimpleBootFront.d.ts +3 -1
- package/SimpleBootFront.js +23 -13
- package/package.json +2 -2
package/README.MD
CHANGED
@@ -30,20 +30,20 @@ npm start
|
|
30
30
|
# directory structure
|
31
31
|
```
|
32
32
|
┌─ assets
|
33
|
-
|
34
|
-
|
35
|
-
│
|
33
|
+
├─ dist (out put directory)
|
34
|
+
├─ src (source)
|
35
|
+
│ ├─ pages (your pages)
|
36
36
|
│ │ ├ home.ts (sample page)
|
37
37
|
│ │ └ user.ts (sample page)
|
38
|
-
│
|
39
|
-
│
|
40
|
-
│
|
41
|
-
|
38
|
+
│ ├─ index.css (index route page css)
|
39
|
+
│ ├─ index.html (index route page template)
|
40
|
+
│ └─ index.ts (simple-boot-fornt start and route point)
|
41
|
+
├─ types (typescript type)
|
42
42
|
│ └ index.d.ts (type definition)
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
├─ index.html start (point html)
|
44
|
+
├─ package.json (project config)
|
45
|
+
├─ rollup.config.js (rollup bundler config)
|
46
|
+
└─ tsconfig.json (typescript config)
|
47
47
|
```
|
48
48
|
|
49
49
|
## source
|
package/SimpleBootFront.d.ts
CHANGED
@@ -21,9 +21,11 @@ export declare class SimpleBootFront extends SimpleApplication {
|
|
21
21
|
getComponentInnerHtml(targetObj: any): string;
|
22
22
|
createDomRender<T extends object>(obj: T): T;
|
23
23
|
private initRun;
|
24
|
+
initWriteRootRouter(): void;
|
25
|
+
writeRootRouter(): SimAtomic<any>;
|
24
26
|
goRouting(url: string): Promise<RouterModule<SimAtomic<Object>, any>>;
|
25
27
|
runRouting(otherInstanceSim?: Map<ConstructorType<any>, any>, url?: string): Promise<RouterModule<SimAtomic<Object>, any> | undefined>;
|
26
|
-
run(otherInstanceSim?: Map<ConstructorType<any>, any>, url?: string):
|
28
|
+
run(otherInstanceSim?: Map<ConstructorType<any>, any>, url?: string): void;
|
27
29
|
private afterSetting;
|
28
30
|
initDomRenderScripts(): void;
|
29
31
|
private initDomRenderTargetElements;
|
package/SimpleBootFront.js
CHANGED
@@ -174,22 +174,11 @@ var SimpleBootFront = (function (_super) {
|
|
174
174
|
};
|
175
175
|
SimpleBootFront.prototype.initRun = function (otherInstanceSim) {
|
176
176
|
var _this = this;
|
177
|
-
var _a, _b, _c, _d, _e;
|
178
177
|
_super.prototype.run.call(this, otherInstanceSim);
|
179
178
|
this.initDomRenderScripts();
|
180
179
|
this.initDomRenderTargetElements();
|
181
180
|
this.navigation = this.simstanceManager.getOrNewSim(Navigation_1.Navigation);
|
182
|
-
|
183
|
-
var target = this.option.window.document.querySelector(this.option.selector);
|
184
|
-
if (target && routerAtomic.value) {
|
185
|
-
var component = routerAtomic.getConfig(Component_1.ComponentMetadataKey);
|
186
|
-
var styles = ((_b = (_a = component === null || component === void 0 ? void 0 : component.styles) === null || _a === void 0 ? void 0 : _a.map(function (it) { return "<style>".concat(it, "</style>"); })) !== null && _b !== void 0 ? _b : []).join(' ');
|
187
|
-
target.innerHTML = "".concat(styles, " ").concat((_c = component === null || component === void 0 ? void 0 : component.template) !== null && _c !== void 0 ? _c : '');
|
188
|
-
var val = routerAtomic.value;
|
189
|
-
var domRenderProxy = val._DomRender_proxy;
|
190
|
-
domRenderProxy.initRender(target);
|
191
|
-
(_e = (_d = val) === null || _d === void 0 ? void 0 : _d.onInit) === null || _e === void 0 ? void 0 : _e.call(_d);
|
192
|
-
}
|
181
|
+
this.initWriteRootRouter();
|
193
182
|
this.option.window.addEventListener('intent', function (event) {
|
194
183
|
var cevent = event;
|
195
184
|
_this.publishIntent(new Intent_1.Intent(cevent.detail.uri, cevent.detail.data, event));
|
@@ -202,6 +191,28 @@ var SimpleBootFront = (function (_super) {
|
|
202
191
|
});
|
203
192
|
});
|
204
193
|
};
|
194
|
+
SimpleBootFront.prototype.initWriteRootRouter = function () {
|
195
|
+
var _a, _b;
|
196
|
+
var routerAtomic = this.writeRootRouter();
|
197
|
+
var target = this.option.window.document.querySelector(this.option.selector);
|
198
|
+
if (target && routerAtomic && routerAtomic.value) {
|
199
|
+
var val = routerAtomic.value;
|
200
|
+
var domRenderProxy = val._DomRender_proxy;
|
201
|
+
domRenderProxy.initRender(target);
|
202
|
+
(_b = (_a = val) === null || _a === void 0 ? void 0 : _a.onInit) === null || _b === void 0 ? void 0 : _b.call(_a);
|
203
|
+
}
|
204
|
+
};
|
205
|
+
SimpleBootFront.prototype.writeRootRouter = function () {
|
206
|
+
var _a, _b, _c;
|
207
|
+
var routerAtomic = new SimAtomic_1.SimAtomic(this.rootRouter, this.getSimstanceManager());
|
208
|
+
var target = this.option.window.document.querySelector(this.option.selector);
|
209
|
+
if (target && routerAtomic.value) {
|
210
|
+
var component = routerAtomic.getConfig(Component_1.ComponentMetadataKey);
|
211
|
+
var styles = ((_b = (_a = component === null || component === void 0 ? void 0 : component.styles) === null || _a === void 0 ? void 0 : _a.map(function (it) { return "<style>".concat(it, "</style>"); })) !== null && _b !== void 0 ? _b : []).join(' ');
|
212
|
+
target.innerHTML = "".concat(styles, " ").concat((_c = component === null || component === void 0 ? void 0 : component.template) !== null && _c !== void 0 ? _c : '');
|
213
|
+
}
|
214
|
+
return routerAtomic;
|
215
|
+
};
|
205
216
|
SimpleBootFront.prototype.goRouting = function (url) {
|
206
217
|
var _a;
|
207
218
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -247,7 +258,6 @@ var SimpleBootFront = (function (_super) {
|
|
247
258
|
this.navigation.go(url);
|
248
259
|
}
|
249
260
|
this.option.window.dispatchEvent(new Event('popstate'));
|
250
|
-
return this;
|
251
261
|
};
|
252
262
|
SimpleBootFront.prototype.afterSetting = function () {
|
253
263
|
var _this = this;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "simple-boot-front",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.102",
|
4
4
|
"main": "SimpleApplication.js",
|
5
5
|
"license": "MIT",
|
6
6
|
"description": "front end SPA frameworks",
|
@@ -77,7 +77,7 @@
|
|
77
77
|
"typescript": "^4.4.3"
|
78
78
|
},
|
79
79
|
"dependencies": {
|
80
|
-
"dom-render": "^1.0.
|
80
|
+
"dom-render": "^1.0.71",
|
81
81
|
"simple-boot-core": "^1.0.29"
|
82
82
|
}
|
83
83
|
}
|