simple-boot-front 1.0.105 → 1.0.108

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.
@@ -20,7 +20,7 @@ export declare class SimpleBootFront extends SimpleApplication {
20
20
  domRenderTargetAttrs: TargetAttr[];
21
21
  domRenderConfig: Config;
22
22
  constructor(rootRouter: ConstructorType<any>, option: SimFrontOption);
23
- getComponentInnerHtml(targetObj: any): string;
23
+ getComponentInnerHtml(targetObj: any, id: string): string;
24
24
  createDomRender<T extends object>(obj: T): T;
25
25
  private initRun;
26
26
  initWriteRootRouter(): void;
@@ -146,7 +146,7 @@ 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
151
  return RawSet_1.RawSet.drThisCreate(rawSet, n, attrValue, '', true, obj, _this.option);
152
152
  }
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-boot-front",
3
- "version": "1.0.105",
3
+ "version": "1.0.108",
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.86",
75
+ "dom-render": "^1.0.87",
76
76
  "simple-boot-core": "^1.0.31"
77
77
  }
78
78
  }