simple-boot-front 1.0.104 → 1.0.107

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.
@@ -7,7 +7,9 @@ import { HttpService } from './service/HttpService';
7
7
  import { SimstanceManager } from 'simple-boot-core/simstance/SimstanceManager';
8
8
  import { IntentManager } from 'simple-boot-core/intent/IntentManager';
9
9
  import { RouterManager } from 'simple-boot-core/route/RouterManager';
10
- import { Config, TargetElement, TargetAttr } from 'dom-render/Config';
10
+ import { Config } from 'dom-render/configs/Config';
11
+ import { TargetAttr } from 'dom-render/configs/TargetAttr';
12
+ import { TargetElement } from 'dom-render/configs/TargetElement';
11
13
  import { RouterModule } from 'simple-boot-core/route/RouterModule';
12
14
  export declare class SimpleBootFront extends SimpleApplication {
13
15
  rootRouter: ConstructorType<any>;
@@ -18,7 +20,7 @@ export declare class SimpleBootFront extends SimpleApplication {
18
20
  domRenderTargetAttrs: TargetAttr[];
19
21
  domRenderConfig: Config;
20
22
  constructor(rootRouter: ConstructorType<any>, option: SimFrontOption);
21
- getComponentInnerHtml(targetObj: any): string;
23
+ getComponentInnerHtml(targetObj: any, id: string): string;
22
24
  createDomRender<T extends object>(obj: T): T;
23
25
  private initRun;
24
26
  initWriteRootRouter(): void;
@@ -146,9 +146,9 @@ var SimpleBootFront = (function (_super) {
146
146
  if (attrValue) {
147
147
  var targetObj = ScriptUtils_1.ScriptUtils.eval("return ".concat(attrValue), obj);
148
148
  var n = element.cloneNode(true);
149
- var innerHTML = _this.getComponentInnerHtml(targetObj);
149
+ var innerHTML = _this.getComponentInnerHtml(targetObj, rawSet.uuid);
150
150
  n.innerHTML = innerHTML;
151
- return RawSet_1.RawSet.drThisCreate(n, attrValue, '', true, obj, _this.option);
151
+ return RawSet_1.RawSet.drThisCreate(rawSet, n, attrValue, '', true, obj, _this.option);
152
152
  }
153
153
  var fag = _this.option.window.document.createDocumentFragment();
154
154
  return fag;
@@ -159,11 +159,11 @@ var SimpleBootFront = (function (_super) {
159
159
  };
160
160
  return _this;
161
161
  }
162
- SimpleBootFront.prototype.getComponentInnerHtml = function (targetObj) {
163
- var _a, _b, _c;
162
+ SimpleBootFront.prototype.getComponentInnerHtml = function (targetObj, id) {
163
+ var _a, _b;
164
164
  var component = (0, Component_1.getComponent)(targetObj);
165
- 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(' ');
166
- var template = ((_c = component === null || component === void 0 ? void 0 : component.template) !== null && _c !== void 0 ? _c : '');
165
+ var styles = RawSet_1.RawSet.generateStyleTransform((_a = component === null || component === void 0 ? void 0 : component.styles) !== null && _a !== void 0 ? _a : [], id);
166
+ var template = ((_b = component === null || component === void 0 ? void 0 : component.template) !== null && _b !== void 0 ? _b : '');
167
167
  return styles + template;
168
168
  };
169
169
  SimpleBootFront.prototype.createDomRender = function (obj) {
@@ -203,13 +203,14 @@ var SimpleBootFront = (function (_super) {
203
203
  }
204
204
  };
205
205
  SimpleBootFront.prototype.writeRootRouter = function () {
206
- var _a, _b, _c;
207
206
  var routerAtomic = new SimAtomic_1.SimAtomic(this.rootRouter, this.getSimstanceManager());
208
207
  var target = this.option.window.document.querySelector(this.option.selector);
209
208
  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 : '');
209
+ var id = 'root-router';
210
+ var startEndPoint = RawSet_1.RawSet.createStartEndPoint(id, RawSet_1.RawSetType.TARGET_ELEMENT, this.domRenderConfig);
211
+ target.appendChild(startEndPoint.start);
212
+ target.insertAdjacentHTML('beforeend', this.getComponentInnerHtml(this.rootRouter, id));
213
+ target.appendChild(startEndPoint.end);
213
214
  }
214
215
  return routerAtomic;
215
216
  };
@@ -321,7 +322,7 @@ var SimpleBootFront = (function (_super) {
321
322
  var items = RawSet_1.RawSet.createComponentTargetElement(name, function (e, obj, r) {
322
323
  var newSim = _this.simstanceManager.newSim(val);
323
324
  return newSim;
324
- }, component === null || component === void 0 ? void 0 : component.template, component === null || component === void 0 ? void 0 : component.styles, false, _this.domRenderConfig);
325
+ }, component === null || component === void 0 ? void 0 : component.template, component === null || component === void 0 ? void 0 : component.styles);
325
326
  _this.domRenderTargetElements.push(items);
326
327
  });
327
328
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-boot-front",
3
- "version": "1.0.104",
3
+ "version": "1.0.107",
4
4
  "main": "SimpleApplication.js",
5
5
  "license": "MIT",
6
6
  "description": "front end SPA frameworks",
@@ -72,7 +72,7 @@
72
72
  "typescript": "^4.4.3"
73
73
  },
74
74
  "dependencies": {
75
- "dom-render": "^1.0.75",
76
- "simple-boot-core": "^1.0.30"
75
+ "dom-render": "^1.0.86",
76
+ "simple-boot-core": "^1.0.31"
77
77
  }
78
78
  }