@angelscmf/front 1.0.1 → 1.0.3

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 CHANGED
@@ -0,0 +1,7 @@
1
+ # Install
2
+
3
+ > npm i @angelscmf/front
4
+
5
+ or
6
+
7
+ > npm i -D @angelscmf/front
@@ -1,30 +1,10 @@
1
- import AngelsMod from './AngelsMod.mjs';
1
+ import AngelsFrontComponent from './AngelsFrontComponent.mjs';
2
+ import './AngelsFrontMod.mjs';
2
3
 
3
- declare class AngelsApplicationCore {
4
- protected appMods: Set<AngelsMod>;
5
- constructor();
6
- appStart(): void;
7
- appStop(): void;
8
- /**
9
- * Inits the Angels' Application.
10
- */
11
- appInit(): void;
12
- /**
13
- * Binds Angels' Application's handlers.
14
- */
15
- appBind(): void;
16
- appLink(): void;
17
- /**
18
- * Runs the Angels' Application.
19
- */
20
- appRun(): void;
21
- appWait(): void;
22
- appDeInit(): void;
23
- appDeBind(): void;
24
- appDeLink(): void;
25
- appDeRun(): void;
26
- appDeWait(): void;
27
- appAddMod<TMod extends AngelsMod>(mod: TMod): TMod;
4
+ /**
5
+ * @example new AngelsFrontApplication(document.body)
6
+ */
7
+ declare class AngelsFrontApplication extends AngelsFrontComponent {
28
8
  }
29
9
 
30
- export { AngelsApplicationCore as default };
10
+ export { AngelsFrontApplication as default };
@@ -1,30 +1,10 @@
1
- import AngelsMod from './AngelsMod.js';
1
+ import AngelsFrontComponent from './AngelsFrontComponent.js';
2
+ import './AngelsFrontMod.js';
2
3
 
3
- declare class AngelsApplicationCore {
4
- protected appMods: Set<AngelsMod>;
5
- constructor();
6
- appStart(): void;
7
- appStop(): void;
8
- /**
9
- * Inits the Angels' Application.
10
- */
11
- appInit(): void;
12
- /**
13
- * Binds Angels' Application's handlers.
14
- */
15
- appBind(): void;
16
- appLink(): void;
17
- /**
18
- * Runs the Angels' Application.
19
- */
20
- appRun(): void;
21
- appWait(): void;
22
- appDeInit(): void;
23
- appDeBind(): void;
24
- appDeLink(): void;
25
- appDeRun(): void;
26
- appDeWait(): void;
27
- appAddMod<TMod extends AngelsMod>(mod: TMod): TMod;
4
+ /**
5
+ * @example new AngelsFrontApplication(document.body)
6
+ */
7
+ declare class AngelsFrontApplication extends AngelsFrontComponent {
28
8
  }
29
9
 
30
- export { AngelsApplicationCore as default };
10
+ export { AngelsFrontApplication as default };
@@ -20,69 +20,136 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/AngelsFrontApplication.ts
21
21
  var AngelsFrontApplication_exports = {};
22
22
  __export(AngelsFrontApplication_exports, {
23
- default: () => AngelsApplicationCore
23
+ default: () => AngelsFrontApplication
24
24
  });
25
25
  module.exports = __toCommonJS(AngelsFrontApplication_exports);
26
- var AngelsApplicationCore = class {
26
+
27
+ // src/AngelsFrontMod.ts
28
+ var AngelsFrontMod = class {
27
29
  constructor() {
28
- this.appMods = /* @__PURE__ */ new Set();
29
- }
30
- appStart() {
31
- this.appInit();
32
- this.appBind();
33
- this.appLink();
34
- this.appRun();
35
- this.appWait();
36
- }
37
- appStop() {
38
- this.appDeWait();
39
- this.appDeBind();
40
- this.appDeLink();
41
- this.appDeBind();
42
- this.appDeInit();
30
+ this.modWaitStartTimeout = 1e3;
31
+ this.modSubModArray = new Array();
32
+ }
33
+ /**
34
+ * Starts AngelsFrontMod.
35
+ */
36
+ modStart() {
37
+ this.modInit();
38
+ this.modBind();
39
+ this.modLink();
40
+ this.modRun();
41
+ setTimeout(() => {
42
+ this.modWait();
43
+ }, this.modWaitStartTimeout);
44
+ }
45
+ /**
46
+ * Finishes AngelsFrontMod.
47
+ */
48
+ modFinish() {
49
+ this.modDeWait();
50
+ this.modDeRun();
51
+ this.modDeLink();
52
+ this.modDeBind();
53
+ this.modDeInit();
54
+ }
55
+ /**
56
+ * Inits AngelsFrontMod and its sub-modules AngelsFrontMod.
57
+ */
58
+ modInit() {
59
+ this.modSubModArray.forEach((mod) => mod.modInit());
60
+ }
61
+ /**
62
+ * Binds AngelsFrontMod and its sub-modules AngelsFrontMod.
63
+ */
64
+ modBind() {
65
+ this.modSubModArray.forEach((mod) => mod.modBind());
43
66
  }
44
67
  /**
45
- * Inits the Angels' Application.
68
+ * Links AngelsFrontMod and its sub-modules AngelsFrontMod.
46
69
  */
47
- appInit() {
48
- this.appMods.forEach((mod) => mod.modInit());
70
+ modLink() {
71
+ this.modSubModArray.forEach((mod) => mod.modLink());
49
72
  }
50
73
  /**
51
- * Binds Angels' Application's handlers.
74
+ * Runs AngelsFrontMod and its sub-modules AngelsFrontMod.
52
75
  */
53
- appBind() {
54
- this.appMods.forEach((mod) => mod.modBind());
76
+ modRun() {
77
+ this.modSubModArray.forEach((mod) => mod.modRun());
55
78
  }
56
- appLink() {
57
- this.appMods.forEach((mod) => mod.modBind());
79
+ /**
80
+ * Waits AngelsFrontMod and its sub-modules AngelsFrontMod.
81
+ */
82
+ modWait() {
83
+ this.modSubModArray.forEach((mod) => mod.modWait());
58
84
  }
59
85
  /**
60
- * Runs the Angels' Application.
86
+ * DeInits AngelsFrontMod and its sub-modules AngelsFrontMod.
61
87
  */
62
- appRun() {
63
- this.appMods.forEach((mod) => mod.modRun());
88
+ modDeInit() {
89
+ this.modSubModArray.forEach((mod) => mod.modDeInit());
64
90
  }
65
- appWait() {
66
- this.appMods.forEach((mod) => mod.modWait());
91
+ /**
92
+ * DeBinds AngelsFrontMod and its sub-modules AngelsFrontMod.
93
+ */
94
+ modDeBind() {
95
+ this.modSubModArray.forEach((mod) => mod.modDeBind());
67
96
  }
68
- appDeInit() {
69
- this.appMods.forEach((mod) => mod.modDeInit());
97
+ /**
98
+ * DeLinks AngelsFrontMod and its sub-modules AngelsFrontMod.
99
+ */
100
+ modDeLink() {
101
+ this.modSubModArray.forEach((mod) => mod.modDeLink());
70
102
  }
71
- appDeBind() {
72
- this.appMods.forEach((mod) => mod.modDeBind());
103
+ /**
104
+ * DeRuns AngelsFrontMod and its sub-modules AngelsFrontMod.
105
+ */
106
+ modDeRun() {
107
+ this.modSubModArray.forEach((mod) => mod.modDeRun());
73
108
  }
74
- appDeLink() {
75
- this.appMods.forEach((mod) => mod.modDeBind());
109
+ /**
110
+ * DeWaits AngelsFrontMod and its sub-modules AngelsFrontMod.
111
+ */
112
+ modDeWait() {
113
+ this.modSubModArray.forEach((mod) => mod.modDeWait());
76
114
  }
77
- appDeRun() {
78
- this.appMods.forEach((mod) => mod.modDeRun());
115
+ modDestructor() {
116
+ this.modSubModArray.forEach((mod) => mod.modDestructor());
79
117
  }
80
- appDeWait() {
81
- this.appMods.forEach((mod) => mod.modDeWait());
118
+ modAddSubMod(mod) {
119
+ if (mod) {
120
+ this.modSubModArray.push(mod);
121
+ return mod;
122
+ }
123
+ return null;
82
124
  }
83
- appAddMod(mod) {
84
- this.appMods.add(mod);
125
+ modRequireSubMod(mod) {
126
+ this.modSubModArray.push(mod);
85
127
  return mod;
86
128
  }
87
129
  };
130
+
131
+ // src/AngelsFrontComponent.ts
132
+ var AngelsFrontComponent = class extends AngelsFrontMod {
133
+ constructor(element) {
134
+ super();
135
+ this.comElement = element;
136
+ }
137
+ comFindElement(selector) {
138
+ return this.comElement.querySelector(selector);
139
+ }
140
+ comFindElements(selector) {
141
+ return Array.from(this.comElement.querySelectorAll(selector));
142
+ }
143
+ comRequireElement(selector) {
144
+ const element = this.comElement.querySelector(selector);
145
+ if (element) {
146
+ return element;
147
+ }
148
+ throw Error(`Element '${selector}' is not found.`);
149
+ }
150
+ };
151
+
152
+ // src/AngelsFrontApplication.ts
153
+ var AngelsFrontApplication = class extends AngelsFrontComponent {
154
+ };
88
155
  //# sourceMappingURL=AngelsFrontApplication.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/AngelsFrontApplication.ts"],"sourcesContent":["import AngelsMod from \"./AngelsMod\";\n\nexport default class AngelsApplicationCore {\n\n protected appMods: Set<AngelsMod>;\n\n constructor() {\n this.appMods = new Set;\n }\n\n appStart() {\n this.appInit();\n this.appBind();\n this.appLink();\n this.appRun();\n this.appWait();\n }\n\n appStop() {\n this.appDeWait();\n this.appDeBind();\n this.appDeLink();\n this.appDeBind();\n this.appDeInit();\n }\n\n /**\n * Inits the Angels' Application.\n */\n appInit() {\n this.appMods.forEach(mod => mod.modInit())\n }\n\n /**\n * Binds Angels' Application's handlers.\n */\n appBind() {\n this.appMods.forEach(mod => mod.modBind())\n }\n\n appLink() {\n this.appMods.forEach(mod => mod.modBind())\n }\n\n /**\n * Runs the Angels' Application.\n */\n appRun() {\n this.appMods.forEach(mod => mod.modRun())\n }\n\n appWait() {\n this.appMods.forEach(mod => mod.modWait())\n }\n\n appDeInit() {\n this.appMods.forEach(mod => mod.modDeInit())\n }\n\n appDeBind() {\n this.appMods.forEach(mod => mod.modDeBind())\n }\n\n appDeLink() {\n this.appMods.forEach(mod => mod.modDeBind())\n }\n\n appDeRun() {\n this.appMods.forEach(mod => mod.modDeRun())\n }\n\n appDeWait() {\n this.appMods.forEach(mod => mod.modDeWait())\n }\n\n appAddMod<TMod extends AngelsMod>(mod: TMod): TMod {\n this.appMods.add(mod);\n return mod;\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAqB,wBAArB,MAA2C;AAAA,EAIvC,cAAc;AACV,SAAK,UAAU,oBAAI;AAAA,EACvB;AAAA,EAEA,WAAW;AACP,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,QAAQ;AAAA,EACjB;AAAA,EAEA,UAAU;AACN,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,UAAU;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACN,SAAK,QAAQ,QAAQ,SAAO,IAAI,QAAQ,CAAC;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACN,SAAK,QAAQ,QAAQ,SAAO,IAAI,QAAQ,CAAC;AAAA,EAC7C;AAAA,EAEA,UAAU;AACN,SAAK,QAAQ,QAAQ,SAAO,IAAI,QAAQ,CAAC;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS;AACL,SAAK,QAAQ,QAAQ,SAAO,IAAI,OAAO,CAAC;AAAA,EAC5C;AAAA,EAEA,UAAU;AACN,SAAK,QAAQ,QAAQ,SAAO,IAAI,QAAQ,CAAC;AAAA,EAC7C;AAAA,EAEA,YAAY;AACR,SAAK,QAAQ,QAAQ,SAAO,IAAI,UAAU,CAAC;AAAA,EAC/C;AAAA,EAEA,YAAY;AACR,SAAK,QAAQ,QAAQ,SAAO,IAAI,UAAU,CAAC;AAAA,EAC/C;AAAA,EAEA,YAAY;AACR,SAAK,QAAQ,QAAQ,SAAO,IAAI,UAAU,CAAC;AAAA,EAC/C;AAAA,EAEA,WAAW;AACP,SAAK,QAAQ,QAAQ,SAAO,IAAI,SAAS,CAAC;AAAA,EAC9C;AAAA,EAEA,YAAY;AACR,SAAK,QAAQ,QAAQ,SAAO,IAAI,UAAU,CAAC;AAAA,EAC/C;AAAA,EAEA,UAAkC,KAAiB;AAC/C,SAAK,QAAQ,IAAI,GAAG;AACpB,WAAO;AAAA,EACX;AACJ;","names":[]}
1
+ {"version":3,"sources":["../src/AngelsFrontApplication.ts","../src/AngelsFrontMod.ts","../src/AngelsFrontComponent.ts"],"sourcesContent":["import AngelsFrontComponent from \"./AngelsFrontComponent\";\n\n/**\n * @example new AngelsFrontApplication(document.body)\n */\nexport default class AngelsFrontApplication extends AngelsFrontComponent {\n}","export default class AngelsFrontMod {\n\n protected modSubModArray: Array<AngelsFrontMod>;\n public modWaitStartTimeout = 1000;\n\n constructor() {\n this.modSubModArray = new Array;\n }\n\n /**\n * Starts AngelsFrontMod.\n */\n modStart() {\n this.modInit();\n this.modBind();\n this.modLink();\n this.modRun();\n setTimeout(() => {\n this.modWait();\n }, this.modWaitStartTimeout);\n }\n\n /**\n * Finishes AngelsFrontMod.\n */\n modFinish() {\n this.modDeWait();\n this.modDeRun();\n this.modDeLink();\n this.modDeBind();\n this.modDeInit();\n }\n\n /**\n * Inits AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modInit() {\n this.modSubModArray.forEach(mod => mod.modInit());\n }\n\n /**\n * Binds AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modBind() {\n this.modSubModArray.forEach(mod => mod.modBind());\n }\n\n /**\n * Links AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modLink() {\n this.modSubModArray.forEach(mod => mod.modLink());\n }\n\n /**\n * Runs AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modRun() {\n this.modSubModArray.forEach(mod => mod.modRun());\n }\n\n /**\n * Waits AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modWait() {\n this.modSubModArray.forEach(mod => mod.modWait());\n }\n\n /**\n * DeInits AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modDeInit() {\n this.modSubModArray.forEach(mod => mod.modDeInit());\n }\n /**\n * DeBinds AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modDeBind() {\n this.modSubModArray.forEach(mod => mod.modDeBind());\n }\n /**\n * DeLinks AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modDeLink() {\n this.modSubModArray.forEach(mod => mod.modDeLink());\n }\n /**\n * DeRuns AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modDeRun() {\n this.modSubModArray.forEach(mod => mod.modDeRun());\n }\n /**\n * DeWaits AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modDeWait() {\n this.modSubModArray.forEach(mod => mod.modDeWait());\n }\n\n modDestructor() {\n this.modSubModArray.forEach(mod => mod.modDestructor());\n }\n\n modAddSubMod<T extends AngelsFrontMod>(mod: T | null): T | null {\n if (mod) {\n this.modSubModArray.push(mod);\n return mod;\n }\n return null;\n }\n\n modRequireSubMod<T extends AngelsFrontMod>(mod: T): T {\n this.modSubModArray.push(mod);\n return mod;\n }\n}","import AngelsFrontMod from \"./AngelsFrontMod\";\n\nexport default class AngelsFrontComponent extends AngelsFrontMod {\n\n readonly comElement: Element;\n\n constructor(element: Element) {\n super();\n this.comElement = element;\n }\n\n comFindElement(selector: string): Element | null {\n return this.comElement.querySelector(selector);\n }\n\n comFindElements(selector: string): Array<Element> {\n return Array.from(this.comElement.querySelectorAll(selector));\n }\n\n comRequireElement(selector: string): Element {\n const element = this.comElement.querySelector(selector);\n if (element) {\n return element;\n }\n throw Error(`Element '${selector}' is not found.`);\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAqB,iBAArB,MAAoC;AAAA,EAKhC,cAAc;AAFd,SAAO,sBAAsB;AAGzB,SAAK,iBAAiB,IAAI;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA,EAKA,WAAW;AACP,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,eAAW,MAAM;AACb,WAAK,QAAQ;AAAA,IACjB,GAAG,KAAK,mBAAmB;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA,EAKA,YAAY;AACR,SAAK,UAAU;AACf,SAAK,SAAS;AACd,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,UAAU;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACN,SAAK,eAAe,QAAQ,SAAO,IAAI,QAAQ,CAAC;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACN,SAAK,eAAe,QAAQ,SAAO,IAAI,QAAQ,CAAC;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACN,SAAK,eAAe,QAAQ,SAAO,IAAI,QAAQ,CAAC;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS;AACL,SAAK,eAAe,QAAQ,SAAO,IAAI,OAAO,CAAC;AAAA,E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AAI,SAAS;AACT,aAAO;AAAA,IACX;AACA,UAAM,MAAM,YAAY,QAAQ,iBAAiB;AAAA,EACrD;AACJ;;;AFrBA,IAAqB,yBAArB,cAAoD,qBAAqB;AACzE;","names":[]}
@@ -1,67 +1,132 @@
1
- // src/AngelsFrontApplication.ts
2
- var AngelsApplicationCore = class {
1
+ // src/AngelsFrontMod.ts
2
+ var AngelsFrontMod = class {
3
3
  constructor() {
4
- this.appMods = /* @__PURE__ */ new Set();
5
- }
6
- appStart() {
7
- this.appInit();
8
- this.appBind();
9
- this.appLink();
10
- this.appRun();
11
- this.appWait();
12
- }
13
- appStop() {
14
- this.appDeWait();
15
- this.appDeBind();
16
- this.appDeLink();
17
- this.appDeBind();
18
- this.appDeInit();
4
+ this.modWaitStartTimeout = 1e3;
5
+ this.modSubModArray = new Array();
6
+ }
7
+ /**
8
+ * Starts AngelsFrontMod.
9
+ */
10
+ modStart() {
11
+ this.modInit();
12
+ this.modBind();
13
+ this.modLink();
14
+ this.modRun();
15
+ setTimeout(() => {
16
+ this.modWait();
17
+ }, this.modWaitStartTimeout);
19
18
  }
20
19
  /**
21
- * Inits the Angels' Application.
20
+ * Finishes AngelsFrontMod.
22
21
  */
23
- appInit() {
24
- this.appMods.forEach((mod) => mod.modInit());
22
+ modFinish() {
23
+ this.modDeWait();
24
+ this.modDeRun();
25
+ this.modDeLink();
26
+ this.modDeBind();
27
+ this.modDeInit();
25
28
  }
26
29
  /**
27
- * Binds Angels' Application's handlers.
30
+ * Inits AngelsFrontMod and its sub-modules AngelsFrontMod.
28
31
  */
29
- appBind() {
30
- this.appMods.forEach((mod) => mod.modBind());
32
+ modInit() {
33
+ this.modSubModArray.forEach((mod) => mod.modInit());
31
34
  }
32
- appLink() {
33
- this.appMods.forEach((mod) => mod.modBind());
35
+ /**
36
+ * Binds AngelsFrontMod and its sub-modules AngelsFrontMod.
37
+ */
38
+ modBind() {
39
+ this.modSubModArray.forEach((mod) => mod.modBind());
40
+ }
41
+ /**
42
+ * Links AngelsFrontMod and its sub-modules AngelsFrontMod.
43
+ */
44
+ modLink() {
45
+ this.modSubModArray.forEach((mod) => mod.modLink());
46
+ }
47
+ /**
48
+ * Runs AngelsFrontMod and its sub-modules AngelsFrontMod.
49
+ */
50
+ modRun() {
51
+ this.modSubModArray.forEach((mod) => mod.modRun());
52
+ }
53
+ /**
54
+ * Waits AngelsFrontMod and its sub-modules AngelsFrontMod.
55
+ */
56
+ modWait() {
57
+ this.modSubModArray.forEach((mod) => mod.modWait());
34
58
  }
35
59
  /**
36
- * Runs the Angels' Application.
60
+ * DeInits AngelsFrontMod and its sub-modules AngelsFrontMod.
37
61
  */
38
- appRun() {
39
- this.appMods.forEach((mod) => mod.modRun());
62
+ modDeInit() {
63
+ this.modSubModArray.forEach((mod) => mod.modDeInit());
40
64
  }
41
- appWait() {
42
- this.appMods.forEach((mod) => mod.modWait());
65
+ /**
66
+ * DeBinds AngelsFrontMod and its sub-modules AngelsFrontMod.
67
+ */
68
+ modDeBind() {
69
+ this.modSubModArray.forEach((mod) => mod.modDeBind());
43
70
  }
44
- appDeInit() {
45
- this.appMods.forEach((mod) => mod.modDeInit());
71
+ /**
72
+ * DeLinks AngelsFrontMod and its sub-modules AngelsFrontMod.
73
+ */
74
+ modDeLink() {
75
+ this.modSubModArray.forEach((mod) => mod.modDeLink());
46
76
  }
47
- appDeBind() {
48
- this.appMods.forEach((mod) => mod.modDeBind());
77
+ /**
78
+ * DeRuns AngelsFrontMod and its sub-modules AngelsFrontMod.
79
+ */
80
+ modDeRun() {
81
+ this.modSubModArray.forEach((mod) => mod.modDeRun());
49
82
  }
50
- appDeLink() {
51
- this.appMods.forEach((mod) => mod.modDeBind());
83
+ /**
84
+ * DeWaits AngelsFrontMod and its sub-modules AngelsFrontMod.
85
+ */
86
+ modDeWait() {
87
+ this.modSubModArray.forEach((mod) => mod.modDeWait());
52
88
  }
53
- appDeRun() {
54
- this.appMods.forEach((mod) => mod.modDeRun());
89
+ modDestructor() {
90
+ this.modSubModArray.forEach((mod) => mod.modDestructor());
55
91
  }
56
- appDeWait() {
57
- this.appMods.forEach((mod) => mod.modDeWait());
92
+ modAddSubMod(mod) {
93
+ if (mod) {
94
+ this.modSubModArray.push(mod);
95
+ return mod;
96
+ }
97
+ return null;
58
98
  }
59
- appAddMod(mod) {
60
- this.appMods.add(mod);
99
+ modRequireSubMod(mod) {
100
+ this.modSubModArray.push(mod);
61
101
  return mod;
62
102
  }
63
103
  };
104
+
105
+ // src/AngelsFrontComponent.ts
106
+ var AngelsFrontComponent = class extends AngelsFrontMod {
107
+ constructor(element) {
108
+ super();
109
+ this.comElement = element;
110
+ }
111
+ comFindElement(selector) {
112
+ return this.comElement.querySelector(selector);
113
+ }
114
+ comFindElements(selector) {
115
+ return Array.from(this.comElement.querySelectorAll(selector));
116
+ }
117
+ comRequireElement(selector) {
118
+ const element = this.comElement.querySelector(selector);
119
+ if (element) {
120
+ return element;
121
+ }
122
+ throw Error(`Element '${selector}' is not found.`);
123
+ }
124
+ };
125
+
126
+ // src/AngelsFrontApplication.ts
127
+ var AngelsFrontApplication = class extends AngelsFrontComponent {
128
+ };
64
129
  export {
65
- AngelsApplicationCore as default
130
+ AngelsFrontApplication as default
66
131
  };
67
132
  //# sourceMappingURL=AngelsFrontApplication.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/AngelsFrontApplication.ts"],"sourcesContent":["import AngelsMod from \"./AngelsMod\";\n\nexport default class AngelsApplicationCore {\n\n protected appMods: Set<AngelsMod>;\n\n constructor() {\n this.appMods = new Set;\n }\n\n appStart() {\n this.appInit();\n this.appBind();\n this.appLink();\n this.appRun();\n this.appWait();\n }\n\n appStop() {\n this.appDeWait();\n this.appDeBind();\n this.appDeLink();\n this.appDeBind();\n this.appDeInit();\n }\n\n /**\n * Inits the Angels' Application.\n */\n appInit() {\n this.appMods.forEach(mod => mod.modInit())\n }\n\n /**\n * Binds Angels' Application's handlers.\n */\n appBind() {\n this.appMods.forEach(mod => mod.modBind())\n }\n\n appLink() {\n this.appMods.forEach(mod => mod.modBind())\n }\n\n /**\n * Runs the Angels' Application.\n */\n appRun() {\n this.appMods.forEach(mod => mod.modRun())\n }\n\n appWait() {\n this.appMods.forEach(mod => mod.modWait())\n }\n\n appDeInit() {\n this.appMods.forEach(mod => mod.modDeInit())\n }\n\n appDeBind() {\n this.appMods.forEach(mod => mod.modDeBind())\n }\n\n appDeLink() {\n this.appMods.forEach(mod => mod.modDeBind())\n }\n\n appDeRun() {\n this.appMods.forEach(mod => mod.modDeRun())\n }\n\n appDeWait() {\n this.appMods.forEach(mod => mod.modDeWait())\n }\n\n appAddMod<TMod extends AngelsMod>(mod: TMod): TMod {\n this.appMods.add(mod);\n return mod;\n }\n}"],"mappings":";AAEA,IAAqB,wBAArB,MAA2C;AAAA,EAIvC,cAAc;AACV,SAAK,UAAU,oBAAI;AAAA,EACvB;AAAA,EAEA,WAAW;AACP,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,QAAQ;AAAA,EACjB;AAAA,EAEA,UAAU;AACN,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,UAAU;AACf,SAAK,UAAU;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACN,SAAK,QAAQ,QAAQ,SAAO,IAAI,QAAQ,CAAC;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACN,SAAK,QAAQ,QAAQ,SAAO,IAAI,QAAQ,CAAC;AAAA,EAC7C;AAAA,EAEA,UAAU;AACN,SAAK,QAAQ,QAAQ,SAAO,IAAI,QAAQ,CAAC;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS;AACL,SAAK,QAAQ,QAAQ,SAAO,IAAI,OAAO,CAAC;AAAA,EAC5C;AAAA,EAEA,UAAU;AACN,SAAK,QAAQ,QAAQ,SAAO,IAAI,QAAQ,CAAC;AAAA,EAC7C;AAAA,EAEA,YAAY;AACR,SAAK,QAAQ,QAAQ,SAAO,IAAI,UAAU,CAAC;AAAA,EAC/C;AAAA,EAEA,YAAY;AACR,SAAK,QAAQ,QAAQ,SAAO,IAAI,UAAU,CAAC;AAAA,EAC/C;AAAA,EAEA,YAAY;AACR,SAAK,QAAQ,QAAQ,SAAO,IAAI,UAAU,CAAC;AAAA,EAC/C;AAAA,EAEA,WAAW;AACP,SAAK,QAAQ,QAAQ,SAAO,IAAI,SAAS,CAAC;AAAA,EAC9C;AAAA,EAEA,YAAY;AACR,SAAK,QAAQ,QAAQ,SAAO,IAAI,UAAU,CAAC;AAAA,EAC/C;AAAA,EAEA,UAAkC,KAAiB;AAC/C,SAAK,QAAQ,IAAI,GAAG;AACpB,WAAO;AAAA,EACX;AACJ;","names":[]}
1
+ {"version":3,"sources":["../src/AngelsFrontMod.ts","../src/AngelsFrontComponent.ts","../src/AngelsFrontApplication.ts"],"sourcesContent":["export default class AngelsFrontMod {\n\n protected modSubModArray: Array<AngelsFrontMod>;\n public modWaitStartTimeout = 1000;\n\n constructor() {\n this.modSubModArray = new Array;\n }\n\n /**\n * Starts AngelsFrontMod.\n */\n modStart() {\n this.modInit();\n this.modBind();\n this.modLink();\n this.modRun();\n setTimeout(() => {\n this.modWait();\n }, this.modWaitStartTimeout);\n }\n\n /**\n * Finishes AngelsFrontMod.\n */\n modFinish() {\n this.modDeWait();\n this.modDeRun();\n this.modDeLink();\n this.modDeBind();\n this.modDeInit();\n }\n\n /**\n * Inits AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modInit() {\n this.modSubModArray.forEach(mod => mod.modInit());\n }\n\n /**\n * Binds AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modBind() {\n this.modSubModArray.forEach(mod => mod.modBind());\n }\n\n /**\n * Links AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modLink() {\n this.modSubModArray.forEach(mod => mod.modLink());\n }\n\n /**\n * Runs AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modRun() {\n this.modSubModArray.forEach(mod => mod.modRun());\n }\n\n /**\n * Waits AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modWait() {\n this.modSubModArray.forEach(mod => mod.modWait());\n }\n\n /**\n * DeInits AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modDeInit() {\n this.modSubModArray.forEach(mod => mod.modDeInit());\n }\n /**\n * DeBinds AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modDeBind() {\n this.modSubModArray.forEach(mod => mod.modDeBind());\n }\n /**\n * DeLinks AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modDeLink() {\n this.modSubModArray.forEach(mod => mod.modDeLink());\n }\n /**\n * DeRuns AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modDeRun() {\n this.modSubModArray.forEach(mod => mod.modDeRun());\n }\n /**\n * DeWaits AngelsFrontMod and its sub-modules AngelsFrontMod.\n */\n modDeWait() {\n this.modSubModArray.forEach(mod => mod.modDeWait());\n }\n\n modDestructor() {\n this.modSubModArray.forEach(mod => mod.modDestructor());\n }\n\n modAddSubMod<T extends AngelsFrontMod>(mod: T | null): T | null {\n if (mod) {\n this.modSubModArray.push(mod);\n return mod;\n }\n return null;\n }\n\n modRequireSubMod<T extends AngelsFrontMod>(mod: T): T {\n this.modSubModArray.push(mod);\n return mod;\n }\n}","import AngelsFrontMod from \"./AngelsFrontMod\";\n\nexport default class AngelsFrontComponent extends AngelsFrontMod {\n\n readonly comElement: Element;\n\n constructor(element: Element) {\n super();\n this.comElement = element;\n }\n\n comFindElement(selector: string): Element | null {\n return this.comElement.querySelector(selector);\n }\n\n comFindElements(selector: string): Array<Element> {\n return Array.from(this.comElement.querySelectorAll(selector));\n }\n\n comRequireElement(selector: string): Element {\n const element = this.comElement.querySelector(selector);\n if (element) {\n return element;\n }\n throw Error(`Element '${selector}' is not found.`);\n }\n}","import AngelsFrontComponent from \"./AngelsFrontComponent\";\n\n/**\n * @example new AngelsF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SAAO,IAAI,UAAU,CAAC;AAAA,EACtD;AAAA;AAAA;AAAA;AAAA,EAIA,WAAW;AACP,SAAK,eAAe,QAAQ,SAAO,IAAI,SAAS,CAAC;AAAA,EACrD;AAAA;AAAA;AAAA;AAAA,EAIA,YAAY;AACR,SAAK,eAAe,QAAQ,SAAO,IAAI,UAAU,CAAC;AAAA,EACtD;AAAA,EAEA,gBAAgB;AACZ,SAAK,eAAe,QAAQ,SAAO,IAAI,cAAc,CAAC;AAAA,EAC1D;AAAA,EAEA,aAAuC,KAAyB;AAC5D,QAAI,KAAK;AACL,WAAK,eAAe,KAAK,GAAG;AAC5B,aAAO;AAAA,IACX;AACA,WAAO;AAAA,EACX;AAAA,EAEA,iBAA2C,KAAW;AAClD,SAAK,eAAe,KAAK,GAAG;AAC5B,WAAO;AAAA,EACX;AACJ;;;ACjHA,IAAqB,uBAArB,cAAkD,eAAe;AAAA,EAI7D,YAAY,SAAkB;AAC1B,UAAM;AACN,SAAK,aAAa;AAAA,EACtB;AAAA,EAEA,eAAe,UAAkC;AAC7C,WAAO,KAAK,WAAW,cAAc,QAAQ;AAAA,EACjD;AAAA,EAEA,gBAAgB,UAAkC;AAC9C,WAAO,MAAM,KAAK,KAAK,WAAW,iBAAiB,QAAQ,CAAC;AAAA,EAChE;AAAA,EAEA,kBAAkB,UAA2B;AACzC,UAAM,UAAU,KAAK,WAAW,cAAc,QAAQ;AACtD,QAAI,SAAS;AACT,aAAO;AAAA,IACX;AACA,UAAM,MAAM,YAAY,QAAQ,iBAAiB;AAAA,EACrD;AACJ;;;ACrBA,IAAqB,yBAArB,cAAoD,qBAAqB;AACzE;","names":[]}
@@ -0,0 +1,11 @@
1
+ import AngelsFrontMod from './AngelsFrontMod.mjs';
2
+
3
+ declare class AngelsFrontComponent extends AngelsFrontMod {
4
+ readonly comElement: Element;
5
+ constructor(element: Element);
6
+ comFindElement(selector: string): Element | null;
7
+ comFindElements(selector: string): Array<Element>;
8
+ comRequireElement(selector: string): Element;
9
+ }
10
+
11
+ export { AngelsFrontComponent as default };
@@ -0,0 +1,11 @@
1
+ import AngelsFrontMod from './AngelsFrontMod.js';
2
+
3
+ declare class AngelsFrontComponent extends AngelsFrontMod {
4
+ readonly comElement: Element;
5
+ constructor(element: Element);
6
+ comFindElement(selector: string): Element | null;
7
+ comFindElements(selector: string): Array<Element>;
8
+ comRequireElement(selector: string): Element;
9
+ }
10
+
11
+ export { AngelsFrontComponent as default };
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/AngelsFrontComponent.ts
21
+ var AngelsFrontComponent_exports = {};
22
+ __export(AngelsFrontComponent_exports, {
23
+ default: () => AngelsFrontComponent
24
+ });
25
+ module.exports = __toCommonJS(AngelsFrontComponent_exports);
26
+
27
+ // src/AngelsFrontMod.ts
28
+ var AngelsFrontMod = class {
29
+ constructor() {
30
+ this.modWaitStartTimeout = 1e3;
31
+ this.modSubModArray = new Array();
32
+ }
33
+ /**
34
+ * Starts AngelsFrontMod.
35
+ */
36
+ modStart() {
37
+ this.modInit();
38
+ this.modBind();
39
+ this.modLink();
40
+ this.modRun();
41
+ setTimeout(() => {
42
+ this.modWait();
43
+ }, this.modWaitStartTimeout);
44
+ }
45
+ /**
46
+ * Finishes AngelsFrontMod.
47
+ */
48
+ modFinish() {
49
+ this.modDeWait();
50
+ this.modDeRun();
51
+ this.modDeLink();
52
+ this.modDeBind();
53
+ this.modDeInit();
54
+ }
55
+ /**
56
+ * Inits AngelsFrontMod and its sub-modules AngelsFrontMod.
57
+ */
58
+ modInit() {
59
+ this.modSubModArray.forEach((mod) => mod.modInit());
60
+ }
61
+ /**
62
+ * Binds AngelsFrontMod and its sub-modules AngelsFrontMod.
63
+ */
64
+ modBind() {
65
+ this.modSubModArray.forEach((mod) => mod.modBind());
66
+ }
67
+ /**
68
+ * Links AngelsFrontMod and its sub-modules AngelsFrontMod.
69
+ */
70
+ modLink() {
71
+ this.modSubModArray.forEach((mod) => mod.modLink());
72
+ }
73
+ /**
74
+ * Runs AngelsFrontMod and its sub-modules AngelsFrontMod.
75
+ */
76
+ modRun() {
77
+ this.modSubModArray.forEach((mod) => mod.modRun());
78
+ }
79
+ /**
80
+ * Waits AngelsFrontMod and its sub-modules AngelsFrontMod.
81
+ */
82
+ modWait() {
83
+ this.modSubModArray.forEach((mod) => mod.modWait());
84
+ }
85
+ /**
86
+ * DeInits AngelsFrontMod and its sub-modules AngelsFrontMod.
87
+ */
88
+ modDeInit() {
89
+ this.modSubModArray.forEach((mod) => mod.modDeInit());
90
+ }
91
+ /**
92
+ * DeBinds AngelsFrontMod and its sub-modules AngelsFrontMod.
93
+ */
94
+ modDeBind() {
95
+ this.modSubModArray.forEach((mod) => mod.modDeBind());
96
+ }
97
+ /**
98
+ * DeLinks AngelsFrontMod and its sub-modules AngelsFrontMod.
99
+ */
100
+ modDeLink() {
101
+ this.modSubModArray.forEach((mod) => mod.modDeLink());
102
+ }
103
+ /**
104
+ * DeRuns AngelsFrontMod and its sub-modules AngelsFrontMod.
105
+ */
106
+ modDeRun() {
107
+ this.modSubModArray.forEach((mod) => mod.modDeRun());
108
+ }
109
+ /**
110
+ * DeWaits AngelsFrontMod and its sub-modules AngelsFrontMod.
111
+ */
112
+ modDeWait() {
113
+ this.modSubModArray.forEach((mod) => mod.modDeWait());
114
+ }
115
+ modDestructor() {
116
+ this.modSubModArray.forEach((mod) => mod.modDestructor());
117
+ }
118
+ modAddSubMod(mod) {
119
+ if (mod) {
120
+ this.modSubModArray.push(mod);
121
+ return mod;
122
+ }
123
+ return null;
124
+ }
125
+ modRequireSubMod(mod) {
126
+ this.modSubModArray.push(mod);
127
+ return mod;
128
+ }
129
+ };
130
+
131
+ // src/AngelsFrontComponent.ts
132
+ var AngelsFrontComponent = class extends AngelsFrontMod {
133
+ constructor(element) {
134
+ super();
135
+ this.comElement = element;
136
+ }
137
+ comFindElement(selector) {
138
+ return this.comElement.querySelector(selector);
139
+ }
140
+ comFindElements(selector) {
141
+ return Array.from(this.comElement.querySelectorAll(selector));
142
+ }
143
+ comRequireElement(selector) {
144
+ const element = this.comElement.querySelector(selector);
145
+ if (element) {
146
+ return element;
147
+ }
148
+ throw Error(`Element '${selector}' is not found.`);
149
+ }
150
+ };
151
+ //# sourceMappingURL=AngelsFrontComponent.js.map