simple-boot-front 1.0.118 → 1.0.120

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.
Files changed (55) hide show
  1. package/.idea/dataSources.xml +12 -0
  2. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  3. package/.idea/jpa-buddy.xml +6 -0
  4. package/.idea/misc.xml +8 -0
  5. package/.idea/modules.xml +8 -0
  6. package/.idea/simple-boot-front.iml +9 -0
  7. package/.idea/vcs.xml +8 -0
  8. package/README.MD +6 -383
  9. package/package.json +11 -5
  10. package/SimpleBootFront.d.ts +0 -36
  11. package/SimpleBootFront.js +0 -325
  12. package/decorators/Component.d.ts +0 -11
  13. package/decorators/Component.js +0 -35
  14. package/decorators/Script.d.ts +0 -9
  15. package/decorators/Script.js +0 -31
  16. package/decorators/inject/InjectFrontSituationType.d.ts +0 -0
  17. package/decorators/inject/InjectFrontSituationType.js +0 -1
  18. package/fetch/Fetcher.d.ts +0 -4
  19. package/fetch/Fetcher.js +0 -9
  20. package/lifecycle/OnChangedRender.d.ts +0 -3
  21. package/lifecycle/OnChangedRender.js +0 -2
  22. package/lifecycle/OnDestroy.d.ts +0 -3
  23. package/lifecycle/OnDestroy.js +0 -2
  24. package/lifecycle/OnFinish.d.ts +0 -3
  25. package/lifecycle/OnFinish.js +0 -2
  26. package/lifecycle/OnInit.d.ts +0 -8
  27. package/lifecycle/OnInit.js +0 -2
  28. package/lifecycle/OnInitedChild.d.ts +0 -3
  29. package/lifecycle/OnInitedChild.js +0 -2
  30. package/option/SimFrontOption.d.ts +0 -14
  31. package/option/SimFrontOption.js +0 -45
  32. package/script/ScriptRunnable.d.ts +0 -7
  33. package/script/ScriptRunnable.js +0 -22
  34. package/service/CookieService.d.ts +0 -11
  35. package/service/CookieService.js +0 -54
  36. package/service/HttpService.d.ts +0 -3
  37. package/service/HttpService.js +0 -23
  38. package/service/MetaTagService.d.ts +0 -11
  39. package/service/MetaTagService.js +0 -52
  40. package/service/Navigation.d.ts +0 -18
  41. package/service/Navigation.js +0 -117
  42. package/service/ScriptService.d.ts +0 -7
  43. package/service/ScriptService.js +0 -39
  44. package/service/StorageService.d.ts +0 -12
  45. package/service/StorageService.js +0 -67
  46. package/service/view/View.d.ts +0 -6
  47. package/service/view/View.js +0 -29
  48. package/service/view/ViewService.d.ts +0 -7
  49. package/service/view/ViewService.js +0 -46
  50. package/throwable/RouterError.d.ts +0 -4
  51. package/throwable/RouterError.js +0 -27
  52. package/throwable/RouterIntentError.d.ts +0 -4
  53. package/throwable/RouterIntentError.js +0 -27
  54. package/throwable/RouterNotFount.d.ts +0 -4
  55. package/throwable/RouterNotFount.js +0 -27
@@ -1,325 +0,0 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
54
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
55
- if (ar || !(i in from)) {
56
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
57
- ar[i] = from[i];
58
- }
59
- }
60
- return to.concat(ar || Array.prototype.slice.call(from));
61
- };
62
- Object.defineProperty(exports, "__esModule", { value: true });
63
- exports.SimpleBootFront = void 0;
64
- var SimFrontOption_1 = require("./option/SimFrontOption");
65
- var Component_1 = require("./decorators/Component");
66
- var Script_1 = require("./decorators/Script");
67
- var DomRender_1 = require("dom-render/DomRender");
68
- var SimAtomic_1 = require("simple-boot-core/simstance/SimAtomic");
69
- var SimpleApplication_1 = require("simple-boot-core/SimpleApplication");
70
- var Intent_1 = require("simple-boot-core/intent/Intent");
71
- var Navigation_1 = require("./service/Navigation");
72
- var ViewService_1 = require("./service/view/ViewService");
73
- var HttpService_1 = require("./service/HttpService");
74
- var SimstanceManager_1 = require("simple-boot-core/simstance/SimstanceManager");
75
- var IntentManager_1 = require("simple-boot-core/intent/IntentManager");
76
- var RouterManager_1 = require("simple-boot-core/route/RouterManager");
77
- var RawSet_1 = require("dom-render/rawsets/RawSet");
78
- var RawSetType_1 = require("dom-render/rawsets/RawSetType");
79
- var ComponentSet_1 = require("dom-render/components/ComponentSet");
80
- var SimpleBootFront = (function (_super) {
81
- __extends(SimpleBootFront, _super);
82
- function SimpleBootFront(rootRouter, option) {
83
- var _this = _super.call(this, rootRouter, option) || this;
84
- _this.rootRouter = rootRouter;
85
- _this.option = option;
86
- _this.domRendoerExcludeProxy = [SimpleApplication_1.SimpleApplication, IntentManager_1.IntentManager, RouterManager_1.RouterManager, SimstanceManager_1.SimstanceManager, SimFrontOption_1.SimFrontOption, Navigation_1.Navigation, ViewService_1.ViewService, HttpService_1.HttpService, HTMLElement];
87
- _this.domRenderTargetElements = [];
88
- _this.domRenderTargetAttrs = [];
89
- _this.domRenderConfig = {
90
- routerType: 'none',
91
- window: option.window,
92
- targetElements: _this.domRenderTargetElements,
93
- targetAttrs: _this.domRenderTargetAttrs,
94
- onElementInit: function (name, obj, rawSet, targetElement) {
95
- },
96
- onAttrInit: function (attrName, attrValue, obj, rawSet) {
97
- },
98
- scripts: { application: _this },
99
- applyEvents: [{
100
- attrName: 'router-link',
101
- callBack: function (elements, attrValue, obj) {
102
- elements.addEventListener('click', function (event) {
103
- var _a;
104
- (_a = _this.getSimstanceManager().getOrNewSim(Navigation_1.Navigation)) === null || _a === void 0 ? void 0 : _a.go(attrValue);
105
- });
106
- }
107
- }],
108
- eventVariables: {},
109
- proxyExcludeTyps: _this.domRendoerExcludeProxy,
110
- operatorAround: {
111
- drThis: {
112
- before: function (data, operatorExecutor) {
113
- var _a, _b;
114
- if (data && !(data instanceof ComponentSet_1.ComponentSet) && operatorExecutor.elementSource.element.getAttribute("".concat(RawSet_1.RawSet.DR_THIS_NAME, ":type")) === 'outlet') {
115
- var component = (0, Component_1.getComponent)(data);
116
- if (component) {
117
- var styles = (_a = component === null || component === void 0 ? void 0 : component.styles) !== null && _a !== void 0 ? _a : [];
118
- var template = (_b = component === null || component === void 0 ? void 0 : component.template) !== null && _b !== void 0 ? _b : '';
119
- return new ComponentSet_1.ComponentSet(data, template, styles, { objPath: null });
120
- }
121
- else {
122
- return undefined;
123
- }
124
- }
125
- return data;
126
- }
127
- }
128
- }
129
- };
130
- _this.option.window.__dirname = 'simple-boot-front__dirname';
131
- option.proxy = {
132
- onProxy: function (it) { return _this.createDomRender(it); }
133
- };
134
- return _this;
135
- }
136
- SimpleBootFront.prototype.getComponentInnerHtml = function (targetObj, id) {
137
- var _a, _b;
138
- var component = (0, Component_1.getComponent)(targetObj);
139
- var styles = RawSet_1.RawSet.generateStyleTransform((_a = component === null || component === void 0 ? void 0 : component.styles) !== null && _a !== void 0 ? _a : [], id);
140
- var template = ((_b = component === null || component === void 0 ? void 0 : component.template) !== null && _b !== void 0 ? _b : '');
141
- return styles + template;
142
- };
143
- SimpleBootFront.prototype.createDomRender = function (obj) {
144
- var component = (0, Component_1.getComponent)(obj);
145
- if (component && typeof obj === 'object') {
146
- return DomRender_1.DomRender.run(obj, undefined, this.domRenderConfig);
147
- }
148
- return obj;
149
- };
150
- SimpleBootFront.prototype.initRun = function (otherInstanceSim) {
151
- var _this = this;
152
- var simstanceManager = _super.prototype.run.call(this, otherInstanceSim);
153
- this.initDomRenderScripts();
154
- this.initDomRenderTargetElements();
155
- this.navigation = this.simstanceManager.getOrNewSim(Navigation_1.Navigation);
156
- this.domRenderConfig.eventVariables = {
157
- $router: this.navigation,
158
- $application: this
159
- };
160
- this.initWriteRootRouter();
161
- this.option.window.addEventListener('intent', function (event) {
162
- var cevent = event;
163
- _this.publishIntent(new Intent_1.Intent(cevent.detail.uri, cevent.detail.data, event));
164
- });
165
- this.option.window.addEventListener('popstate', function (event) {
166
- var intent = new Intent_1.Intent(_this.navigation.url || '/');
167
- _this.routing(intent).then(function (it) {
168
- _this.afterSetting();
169
- });
170
- });
171
- return simstanceManager;
172
- };
173
- SimpleBootFront.prototype.initWriteRootRouter = function () {
174
- var _a;
175
- var routerAtomic = this.writeRootRouter();
176
- var target = this.option.window.document.querySelector(this.option.selector);
177
- if (target && routerAtomic && routerAtomic.value) {
178
- var val = routerAtomic.value;
179
- var domRenderProxy = val._DomRender_proxy;
180
- domRenderProxy.initRender(target);
181
- (_a = val === null || val === void 0 ? void 0 : val.onInit) === null || _a === void 0 ? void 0 : _a.call(val);
182
- }
183
- };
184
- SimpleBootFront.prototype.writeRootRouter = function () {
185
- var routerAtomic = new SimAtomic_1.SimAtomic(this.rootRouter, this.getSimstanceManager());
186
- var target = this.option.window.document.querySelector(this.option.selector);
187
- if (target && routerAtomic.value) {
188
- var id = 'root-router';
189
- var startEndPoint = RawSet_1.RawSet.createStartEndPoint(id, RawSetType_1.RawSetType.TARGET_ELEMENT, this.domRenderConfig);
190
- target.innerHTML = '';
191
- target.appendChild(startEndPoint.start);
192
- target.insertAdjacentHTML('beforeend', this.getComponentInnerHtml(this.rootRouter, id));
193
- target.appendChild(startEndPoint.end);
194
- }
195
- return routerAtomic;
196
- };
197
- SimpleBootFront.prototype.goRouting = function (url) {
198
- var _a;
199
- return __awaiter(this, void 0, void 0, function () {
200
- var intent, data;
201
- return __generator(this, function (_b) {
202
- switch (_b.label) {
203
- case 0:
204
- this.navigation.goNoPopStateEvent(url);
205
- intent = new Intent_1.Intent((_a = this.navigation.url) !== null && _a !== void 0 ? _a : '');
206
- return [4, this.routing(intent)];
207
- case 1:
208
- data = _b.sent();
209
- this.afterSetting();
210
- return [2, data];
211
- }
212
- });
213
- });
214
- };
215
- SimpleBootFront.prototype.runRouting = function (otherInstanceSim, url) {
216
- var _a;
217
- return __awaiter(this, void 0, void 0, function () {
218
- var simstanceManager, intent, data;
219
- return __generator(this, function (_b) {
220
- switch (_b.label) {
221
- case 0:
222
- simstanceManager = this.initRun(otherInstanceSim);
223
- if (url) {
224
- this.navigation.goNoPopStateEvent(url);
225
- }
226
- intent = new Intent_1.Intent((_a = this.navigation.url) !== null && _a !== void 0 ? _a : '');
227
- return [4, this.routing(intent)];
228
- case 1:
229
- data = _b.sent();
230
- this.afterSetting();
231
- return [2, data];
232
- }
233
- });
234
- });
235
- };
236
- SimpleBootFront.prototype.run = function (otherInstanceSim, url) {
237
- var simstanceManager = this.initRun(otherInstanceSim);
238
- if (url) {
239
- this.navigation.go(url);
240
- }
241
- this.option.window.dispatchEvent(new Event('popstate'));
242
- return simstanceManager;
243
- };
244
- SimpleBootFront.prototype.afterSetting = function () {
245
- var _this = this;
246
- this.option.window.document.querySelectorAll('[router-link]').forEach(function (it) {
247
- var _a, _b, _c, _d;
248
- var link = it.getAttribute('router-link');
249
- if (link) {
250
- var activeClasss = it.getAttribute('router-active-class');
251
- var aClasss = activeClasss === null || activeClasss === void 0 ? void 0 : activeClasss.split(',');
252
- var inActiveClasss = it.getAttribute('router-inactive-class');
253
- var iClasss = inActiveClasss === null || inActiveClasss === void 0 ? void 0 : inActiveClasss.split(',');
254
- if (_this.navigation.path === link) {
255
- if (aClasss && aClasss.length > 0) {
256
- (_a = it.classList).add.apply(_a, aClasss);
257
- }
258
- if (iClasss && iClasss.length > 0) {
259
- (_b = it.classList).remove.apply(_b, iClasss);
260
- }
261
- }
262
- else {
263
- if (aClasss && aClasss.length > 0) {
264
- (_c = it.classList).remove.apply(_c, aClasss);
265
- }
266
- if (iClasss && iClasss.length > 0) {
267
- (_d = it.classList).add.apply(_d, iClasss);
268
- }
269
- }
270
- }
271
- });
272
- };
273
- SimpleBootFront.prototype.initDomRenderScripts = function () {
274
- var _this = this;
275
- var simstanceManager = this.simstanceManager;
276
- Script_1.scripts.forEach(function (val, name) {
277
- _this.domRenderConfig.scripts[name] = function () {
278
- var args = [];
279
- for (var _i = 0; _i < arguments.length; _i++) {
280
- args[_i] = arguments[_i];
281
- }
282
- var obj;
283
- try {
284
- obj = simstanceManager.getOrNewSim(val);
285
- }
286
- catch (e) {
287
- obj = simstanceManager.newSim(val);
288
- }
289
- var render = this.__render;
290
- var scriptRunnable = obj;
291
- if (render.rawset) {
292
- scriptRunnable.rawSets.set(render.rawset, this);
293
- }
294
- return scriptRunnable.run.apply(scriptRunnable, args);
295
- };
296
- });
297
- };
298
- SimpleBootFront.prototype.initDomRenderTargetElements = function () {
299
- var _this = this;
300
- var selectors = Component_1.componentSelectors;
301
- selectors.forEach(function (val, name) {
302
- var component = (0, Component_1.getComponent)(val);
303
- var items = RawSet_1.RawSet.createComponentTargetElement(name, function (e, obj, r, counstructorParam) {
304
- var newSim;
305
- if (counstructorParam === null || counstructorParam === void 0 ? void 0 : counstructorParam.length) {
306
- newSim = new (val.bind.apply(val, __spreadArray([void 0], counstructorParam, false)))();
307
- }
308
- else {
309
- newSim = _this.simstanceManager.newSim(val);
310
- }
311
- return newSim;
312
- }, component === null || component === void 0 ? void 0 : component.template, component === null || component === void 0 ? void 0 : component.styles);
313
- _this.domRenderTargetElements.push(items);
314
- });
315
- };
316
- SimpleBootFront.prototype.getSimstanceManager = function () {
317
- return this.simstanceManager;
318
- };
319
- SimpleBootFront.prototype.go = function (url) {
320
- var _a;
321
- (_a = this.getSimstanceManager().getOrNewSim(Navigation_1.Navigation)) === null || _a === void 0 ? void 0 : _a.go(url);
322
- };
323
- return SimpleBootFront;
324
- }(SimpleApplication_1.SimpleApplication));
325
- exports.SimpleBootFront = SimpleBootFront;
@@ -1,11 +0,0 @@
1
- import { ConstructorType, GenericClassDecorator } from 'simple-boot-core/types/Types';
2
- export declare const componentSelectors: Map<string, ConstructorType<any>>;
3
- export interface ComponentConfig {
4
- selector?: string;
5
- template?: string;
6
- styles?: (string)[];
7
- }
8
- export declare const ComponentMetadataKey: unique symbol;
9
- export declare function Component(target: ConstructorType<any>): void;
10
- export declare function Component(config: ComponentConfig): GenericClassDecorator<ConstructorType<any>>;
11
- export declare const getComponent: (target: ConstructorType<any> | Function | any) => ComponentConfig | undefined;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getComponent = exports.Component = exports.ComponentMetadataKey = exports.componentSelectors = void 0;
4
- var ReflectUtils_1 = require("simple-boot-core/utils/reflect/ReflectUtils");
5
- exports.componentSelectors = new Map();
6
- exports.ComponentMetadataKey = Symbol('Component');
7
- var componentProcess = function (config, target) {
8
- if (!config.selector) {
9
- config.selector = target.name.toLowerCase();
10
- }
11
- ReflectUtils_1.ReflectUtils.defineMetadata(exports.ComponentMetadataKey, config, target);
12
- exports.componentSelectors.set(config.selector.toLowerCase(), target);
13
- };
14
- function Component(configOrTarget) {
15
- if (typeof configOrTarget === 'function') {
16
- componentProcess({}, configOrTarget);
17
- }
18
- else {
19
- return function (target) {
20
- componentProcess(configOrTarget, target);
21
- };
22
- }
23
- }
24
- exports.Component = Component;
25
- var getComponent = function (target) {
26
- if (target && typeof target === 'object') {
27
- target = target.constructor;
28
- }
29
- try {
30
- return ReflectUtils_1.ReflectUtils.getMetadata(exports.ComponentMetadataKey, target);
31
- }
32
- catch (e) {
33
- }
34
- };
35
- exports.getComponent = getComponent;
@@ -1,9 +0,0 @@
1
- import { ConstructorType, GenericClassDecorator } from 'simple-boot-core/types/Types';
2
- import { ScriptRunnable } from 'script/ScriptRunnable';
3
- export declare const scripts: Map<string, ConstructorType<ScriptRunnable>>;
4
- export interface ScriptConfig {
5
- name?: string;
6
- }
7
- export declare const ScriptMetadataKey: unique symbol;
8
- export declare const Script: (config?: ScriptConfig) => GenericClassDecorator<ConstructorType<ScriptRunnable>>;
9
- export declare const getScript: (target: ConstructorType<any> | Function | any) => ScriptConfig | undefined;
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getScript = exports.Script = exports.ScriptMetadataKey = exports.scripts = void 0;
4
- var ReflectUtils_1 = require("simple-boot-core/utils/reflect/ReflectUtils");
5
- exports.scripts = new Map();
6
- exports.ScriptMetadataKey = Symbol('Script');
7
- var Script = function (config) {
8
- return function (target) {
9
- if (!config) {
10
- config = {};
11
- }
12
- if (!config.name) {
13
- config.name = target.name;
14
- }
15
- exports.scripts.set(config.name, target);
16
- ReflectUtils_1.ReflectUtils.defineMetadata(exports.ScriptMetadataKey, config, target);
17
- return target;
18
- };
19
- };
20
- exports.Script = Script;
21
- var getScript = function (target) {
22
- if (target && typeof target === 'object') {
23
- target = target.constructor;
24
- }
25
- try {
26
- return ReflectUtils_1.ReflectUtils.getMetadata(exports.ScriptMetadataKey, target);
27
- }
28
- catch (e) {
29
- }
30
- };
31
- exports.getScript = getScript;
File without changes
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,4 +0,0 @@
1
- export declare abstract class Fetcher {
2
- abstract text(path: string, param?: any, dname?: string): Promise<string | void>;
3
- abstract json<T = any>(url: string, param?: any): Promise<T | void>;
4
- }
package/fetch/Fetcher.js DELETED
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Fetcher = void 0;
4
- var Fetcher = (function () {
5
- function Fetcher() {
6
- }
7
- return Fetcher;
8
- }());
9
- exports.Fetcher = Fetcher;
@@ -1,3 +0,0 @@
1
- export interface onChangedRender {
2
- onChangedRender(): void;
3
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- export interface OnDestroy {
2
- onDestroy(): void;
3
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- export interface OnFinish {
2
- onFinish(): void;
3
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +0,0 @@
1
- import { RawSet } from 'dom-render/rawsets/RawSet';
2
- export type OnInitParameter = {
3
- makerObj: any;
4
- rawSet: RawSet;
5
- };
6
- export interface OnInit {
7
- onInit(...data: any): any;
8
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- export interface OnInitedChild {
2
- onInitedChild(): void;
3
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,14 +0,0 @@
1
- import { SimOption } from 'simple-boot-core/SimOption';
2
- import { ConstructorType } from 'simple-boot-core/types/Types';
3
- export declare enum UrlType {
4
- path = "path",
5
- hash = "hash"
6
- }
7
- export declare class SimFrontOption extends SimOption {
8
- window: Window;
9
- selector: string;
10
- urlType: UrlType;
11
- constructor(window: Window, advice?: ConstructorType<any>[]);
12
- setSelector(selector: string): SimFrontOption;
13
- setUrlType(urlType: UrlType): SimFrontOption;
14
- }
@@ -1,45 +0,0 @@
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.SimFrontOption = exports.UrlType = void 0;
19
- var SimOption_1 = require("simple-boot-core/SimOption");
20
- var UrlType;
21
- (function (UrlType) {
22
- UrlType["path"] = "path";
23
- UrlType["hash"] = "hash";
24
- })(UrlType = exports.UrlType || (exports.UrlType = {}));
25
- var SimFrontOption = (function (_super) {
26
- __extends(SimFrontOption, _super);
27
- function SimFrontOption(window, advice) {
28
- if (advice === void 0) { advice = []; }
29
- var _this = _super.call(this, advice) || this;
30
- _this.window = window;
31
- _this.selector = '#app';
32
- _this.urlType = UrlType.path;
33
- return _this;
34
- }
35
- SimFrontOption.prototype.setSelector = function (selector) {
36
- this.selector = selector;
37
- return this;
38
- };
39
- SimFrontOption.prototype.setUrlType = function (urlType) {
40
- this.urlType = urlType;
41
- return this;
42
- };
43
- return SimFrontOption;
44
- }(SimOption_1.SimOption));
45
- exports.SimFrontOption = SimFrontOption;
@@ -1,7 +0,0 @@
1
- import { Runnable } from 'simple-boot-core/run/Runnable';
2
- import { RawSet } from 'dom-render/rawsets/RawSet';
3
- export declare abstract class ScriptRunnable implements Runnable {
4
- rawSets: Map<RawSet, any>;
5
- render(): void;
6
- abstract run(...arg: any): any;
7
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScriptRunnable = void 0;
4
- var ScriptRunnable = (function () {
5
- function ScriptRunnable() {
6
- this.rawSets = new Map();
7
- }
8
- ScriptRunnable.prototype.render = function () {
9
- var _this = this;
10
- this.rawSets.forEach(function (value, key) {
11
- var _a;
12
- if (key.isConnected) {
13
- (_a = value._DomRender_proxy) === null || _a === void 0 ? void 0 : _a.render([key]);
14
- }
15
- else {
16
- _this.rawSets.delete(key);
17
- }
18
- });
19
- };
20
- return ScriptRunnable;
21
- }());
22
- exports.ScriptRunnable = ScriptRunnable;
@@ -1,11 +0,0 @@
1
- import { SimFrontOption } from '../option/SimFrontOption';
2
- export declare class CookieService {
3
- private option;
4
- constructor(option: SimFrontOption);
5
- get(key: string): string | undefined;
6
- getAll(): {
7
- [k: string]: string;
8
- };
9
- set(name: string, value: string, exp?: number): void;
10
- delete(name: string, path?: string): void;
11
- }
@@ -1,54 +0,0 @@
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.CookieService = void 0;
13
- var SimDecorator_1 = require("simple-boot-core/decorators/SimDecorator");
14
- var SimFrontOption_1 = require("../option/SimFrontOption");
15
- var CookieService = (function () {
16
- function CookieService(option) {
17
- this.option = option;
18
- }
19
- CookieService.prototype.get = function (key) {
20
- return this.getAll()[key];
21
- };
22
- CookieService.prototype.getAll = function () {
23
- var _a;
24
- var all = {};
25
- var strings = (_a = this.option.window.document.cookie.split(';')) !== null && _a !== void 0 ? _a : [];
26
- strings.forEach(function (it) {
27
- var set = it.split('=');
28
- if (set[0] && set[1] && set[0].trim().length > 0 && set[1].trim().length > 0) {
29
- all[set[0].trim()] = set[1].trim();
30
- }
31
- });
32
- return all;
33
- };
34
- CookieService.prototype.set = function (name, value, exp) {
35
- if (exp === undefined) {
36
- this.option.window.document.cookie = name + '=' + value + ';path=/';
37
- }
38
- else {
39
- var date = new Date();
40
- date.setTime(date.getTime() + exp);
41
- this.option.window.document.cookie = name + '=' + value + ';expires=' + date.toUTCString() + ';path=/';
42
- }
43
- };
44
- CookieService.prototype.delete = function (name, path) {
45
- if (path === void 0) { path = '/'; }
46
- this.option.window.document.cookie = name + '=; expires=Thu, 01 Jan 1999 00:00:10 GMT;' + " path=".concat(path);
47
- };
48
- CookieService = __decorate([
49
- SimDecorator_1.Sim,
50
- __metadata("design:paramtypes", [SimFrontOption_1.SimFrontOption])
51
- ], CookieService);
52
- return CookieService;
53
- }());
54
- exports.CookieService = CookieService;
@@ -1,3 +0,0 @@
1
- export declare class HttpService {
2
- constructor();
3
- }