spyne 0.19.0 → 0.20.0

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 (129) hide show
  1. package/.eslintrc.js +4 -3
  2. package/.travis.yml +24 -11
  3. package/karma.conf.js +76 -86
  4. package/lib/spyne.esm.js +15 -0
  5. package/lib/spyne.esm.js.map +1 -0
  6. package/lib/spyne.umd.js +9565 -0
  7. package/package.json +46 -26
  8. package/rollup.config.js +26 -0
  9. package/src/spyne/channels/channel-fetch-class.js +39 -43
  10. package/src/spyne/channels/channel-payload-class.js +61 -74
  11. package/src/spyne/channels/channel-proxy.js +25 -26
  12. package/src/spyne/channels/channel.js +141 -149
  13. package/src/spyne/channels/channels-config.js +46 -47
  14. package/src/spyne/channels/channels-map.js +61 -65
  15. package/src/spyne/channels/spyne-channel-lifecycle.js +12 -12
  16. package/src/spyne/channels/spyne-channel-route.js +241 -250
  17. package/src/spyne/channels/spyne-channel-ui.js +213 -75
  18. package/src/spyne/channels/spyne-channel-window.js +157 -157
  19. package/src/spyne/spyne-app.js +32 -19
  20. package/src/spyne/spyne-plugins.js +55 -70
  21. package/src/spyne/spyne.js +23 -23
  22. package/src/spyne/utils/channel-config-validator.js +10 -10
  23. package/src/spyne/utils/channel-fetch-util.js +72 -55
  24. package/src/spyne/utils/channel-payload-filter.js +89 -100
  25. package/src/spyne/utils/deep-merge.js +31 -29
  26. package/src/spyne/utils/frp-tools.js +108 -92
  27. package/src/spyne/utils/gc.js +6 -6
  28. package/src/spyne/utils/mixins/base-core-mixins.js +17 -15
  29. package/src/spyne/utils/mixins/base-streams-mixins.js +9 -9
  30. package/src/spyne/utils/route-channel-updater.js +23 -29
  31. package/src/spyne/utils/safe-clone.js +40 -58
  32. package/src/spyne/utils/sanitize-html.js +35 -0
  33. package/src/spyne/utils/security-policy.js +11 -0
  34. package/src/spyne/utils/spyne-app-properties.js +110 -114
  35. package/src/spyne/utils/spyne-logger.js +4 -11
  36. package/src/spyne/utils/spyne-plugins-methods.js +38 -63
  37. package/src/spyne/utils/spyne-trait.js +33 -33
  38. package/src/spyne/utils/spyne-utils-channel-route-url.js +229 -153
  39. package/src/spyne/utils/spyne-utils-channel-route.js +128 -138
  40. package/src/spyne/utils/spyne-utils-channel-window.js +39 -39
  41. package/src/spyne/utils/viewstream-animations.js +12 -12
  42. package/src/spyne/utils/viewstream-observables.js +45 -45
  43. package/src/spyne/views/dom-element-template.js +111 -114
  44. package/src/spyne/views/dom-element.js +82 -84
  45. package/src/spyne/views/view-stream-broadcaster.js +66 -62
  46. package/src/spyne/views/view-stream-element.js +105 -106
  47. package/src/spyne/views/view-stream-payload.js +25 -27
  48. package/src/spyne/views/view-stream-selector.js +157 -163
  49. package/src/spyne/views/view-stream.js +416 -640
  50. package/src/tests/channels/channel-dom.test.js +15 -15
  51. package/src/tests/channels/channel-fetch.test.js +51 -62
  52. package/src/tests/channels/channel-payload-class.test.js +50 -63
  53. package/src/tests/channels/channel-payload-filter.test.js +133 -193
  54. package/src/tests/channels/channel-route.test.js +102 -112
  55. package/src/tests/channels/channel-stream-item.test.js +19 -19
  56. package/src/tests/channels/channel-ui.test.js +15 -27
  57. package/src/tests/channels/channel-util-dom.test.js +31 -31
  58. package/src/tests/channels/channel.test.js +20 -25
  59. package/src/tests/channels/route-utils.test.js +61 -66
  60. package/src/tests/channels/url-utils.test.js +151 -151
  61. package/src/tests/channels/view-stream-broadcaster.test.js +7 -7
  62. package/src/tests/import.test.js +5 -5
  63. package/src/tests/index.js +6 -7
  64. package/src/tests/index.test.js +6 -8
  65. package/src/tests/mocks/channel-payload-data.js +218 -220
  66. package/src/tests/mocks/enhancer.test.js +5 -5
  67. package/src/tests/mocks/payload-ui.js +87 -90
  68. package/src/tests/mocks/routes-data.js +264 -266
  69. package/src/tests/mocks/spyne-docs.mocks.js +3 -3
  70. package/src/tests/mocks/template-renderer.mocks.js +47 -47
  71. package/src/tests/mocks/utils-data.js +78 -79
  72. package/src/tests/mocks/viewstream-internal-payload.mocks.js +50 -50
  73. package/src/tests/mocks/window-events-arr.js +1 -1
  74. package/src/tests/package-json.spec.test.js +9 -0
  75. package/src/tests/spyne-app.test.js +15 -18
  76. package/src/tests/spyne-plugin.test.js +16 -20
  77. package/src/tests/utils/channel-action-filter.test.js +84 -86
  78. package/src/tests/utils/channel-data-packet-generator.unused.js +62 -86
  79. package/src/tests/utils/channel-fetch-util.test.js +64 -66
  80. package/src/tests/utils/frp-tools.test.js +19 -19
  81. package/src/tests/utils/plugins-methods.test.js +31 -55
  82. package/src/tests/utils/security.test.js +10 -0
  83. package/src/tests/utils/spyne-app-properties.test.js +4 -8
  84. package/src/tests/views/dom-el-selectors.test.js +112 -119
  85. package/src/tests/views/dom-el-template-proxy.test.js +7 -0
  86. package/src/tests/views/dom-el-template.test.js +186 -156
  87. package/src/tests/views/dom-el.test.js +58 -56
  88. package/src/tests/views/view-stream-enhancer-loader.test.js +2 -2
  89. package/src/tests/views/view-stream-enhancer.test.js +11 -11
  90. package/src/tests/views/view-stream.test.js +22 -33
  91. package/webpack.config.js +76 -67
  92. package/docs/-_%20Solves%20equations%20of%20the%20form%20a%20_%20x%20=%20b.html +0 -487
  93. package/docs/DomItem.html +0 -298
  94. package/docs/DomItem_DomItem.html +0 -314
  95. package/docs/ViewStream.html +0 -2249
  96. package/docs/ViewStream_ViewStream.html +0 -503
  97. package/docs/custom/css/jsdoc-viewstream.css +0 -377
  98. package/docs/custom/layout.tmpl +0 -47
  99. package/docs/dom-item.js.html +0 -213
  100. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  101. package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
  102. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  103. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  104. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  105. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  106. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  107. package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
  108. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  109. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  110. package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
  111. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  112. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  113. package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  114. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  115. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  116. package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
  117. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  118. package/docs/global.html +0 -548
  119. package/docs/index-custom.html +0 -79
  120. package/docs/index.html +0 -82
  121. package/docs/jsdoc.config.json +0 -22
  122. package/docs/scripts/linenumber.js +0 -25
  123. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
  124. package/docs/scripts/prettify/lang-css.js +0 -2
  125. package/docs/scripts/prettify/prettify.js +0 -28
  126. package/docs/styles/jsdoc-default.css +0 -358
  127. package/docs/styles/prettify-jsdoc.css +0 -111
  128. package/docs/styles/prettify-tomorrow.css +0 -132
  129. package/docs/view-stream.js.html +0 -767
@@ -1,377 +0,0 @@
1
- @font-face {
2
- font-family: 'Open Sans';
3
- font-weight: normal;
4
- font-style: normal;
5
- src: url('../../fonts/OpenSans-Regular-webfont.eot');
6
- src:
7
- local('Open Sans'),
8
- local('OpenSans'),
9
- url('../../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
10
- url('../../fonts/OpenSans-Regular-webfont.woff') format('woff'),
11
- url('../../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');
12
- }
13
-
14
- @font-face {
15
- font-family: 'Open Sans Light';
16
- font-weight: normal;
17
- font-style: normal;
18
- src: url('../../fonts/OpenSans-Light-webfont.eot');
19
- src:
20
- local('Open Sans Light'),
21
- local('OpenSans Light'),
22
- url('../../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
23
- url('../../fonts/OpenSans-Light-webfont.woff') format('woff'),
24
- url('../../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg');
25
- }
26
-
27
- html
28
- {
29
- overflow: auto;
30
- background-color: #fff;
31
- font-size: 14px;
32
- }
33
-
34
- body
35
- {
36
- font-family: 'Open Sans', sans-serif;
37
- line-height: 1.5;
38
- color: #4d4e53;
39
- background-color: white;
40
- }
41
-
42
- a, a:visited, a:active {
43
- color: #0095dd;
44
- text-decoration: none;
45
- }
46
-
47
- a:hover {
48
- text-decoration: underline;
49
- }
50
-
51
- header
52
- {
53
- display: block;
54
- padding: 0px 4px;
55
- }
56
-
57
- tt, code, kbd, samp {
58
- font-family: Consolas, Monaco, 'Andale Mono', monospace;
59
- }
60
-
61
- .class-description {
62
- font-size: 130%;
63
- line-height: 140%;
64
- margin-bottom: 1em;
65
- margin-top: 1em;
66
- }
67
-
68
- .class-description:empty {
69
- margin: 0;
70
- }
71
-
72
- #main {
73
- float: left;
74
- width: 70%;
75
- }
76
-
77
- article dl {
78
- margin-bottom: 40px;
79
- }
80
-
81
- section
82
- {
83
- display: block;
84
- background-color: #fff;
85
- padding: 12px 24px;
86
- border-bottom: 1px solid #ccc;
87
- margin-right: 30px;
88
- }
89
-
90
- .variation {
91
- display: none;
92
- }
93
-
94
- .signature-attributes {
95
- font-size: 60%;
96
- color: #aaa;
97
- font-style: italic;
98
- font-weight: lighter;
99
- }
100
-
101
- nav
102
- {
103
- display: block;
104
- float: right;
105
- margin-top: 28px;
106
- width: 30%;
107
- box-sizing: border-box;
108
- border-left: 1px solid #ccc;
109
- padding-left: 16px;
110
- }
111
-
112
- nav ul {
113
- font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
114
- font-size: 100%;
115
- line-height: 17px;
116
- padding: 0;
117
- margin: 0;
118
- list-style-type: none;
119
- }
120
-
121
- nav ul a, nav ul a:visited, nav ul a:active {
122
- font-family: Consolas, Monaco, 'Andale Mono', monospace;
123
- line-height: 18px;
124
- color: #4D4E53;
125
- }
126
-
127
- nav h3 {
128
- margin-top: 12px;
129
- }
130
-
131
- nav li {
132
- margin-top: 6px;
133
- }
134
-
135
- footer {
136
- display: block;
137
- padding: 6px;
138
- margin-top: 12px;
139
- font-style: italic;
140
- font-size: 90%;
141
- }
142
-
143
- h1, h2, h3, h4 {
144
- font-weight: 200;
145
- margin: 0;
146
- }
147
-
148
- h1
149
- {
150
- font-family: 'Open Sans Light', sans-serif;
151
- font-size: 48px;
152
- letter-spacing: -2px;
153
- margin: 12px 24px 20px;
154
- }
155
-
156
- h2, h3.subsection-title
157
- {
158
- font-size: 30px;
159
- font-weight: 700;
160
- letter-spacing: -1px;
161
- margin-bottom: 12px;
162
- }
163
-
164
- h3
165
- {
166
- font-size: 24px;
167
- letter-spacing: -0.5px;
168
- margin-bottom: 12px;
169
- }
170
-
171
- h4
172
- {
173
- font-size: 18px;
174
- letter-spacing: -0.33px;
175
- margin-bottom: 12px;
176
- color: #4d4e53;
177
- }
178
-
179
- h5, .container-overview .subsection-title
180
- {
181
- font-size: 120%;
182
- font-weight: bold;
183
- letter-spacing: -0.01em;
184
- margin: 8px 0 3px 0;
185
- }
186
-
187
- h6
188
- {
189
- font-size: 100%;
190
- letter-spacing: -0.01em;
191
- margin: 6px 0 3px 0;
192
- font-style: italic;
193
- }
194
-
195
- table
196
- {
197
- border-spacing: 0;
198
- border: 0;
199
- border-collapse: collapse;
200
- }
201
-
202
- td, th
203
- {
204
- border: 1px solid #ddd;
205
- margin: 0px;
206
- text-align: left;
207
- vertical-align: top;
208
- padding: 4px 6px;
209
- display: table-cell;
210
- }
211
-
212
- thead tr
213
- {
214
- background-color: #ddd;
215
- font-weight: bold;
216
- }
217
-
218
- th { border-right: 1px solid #aaa; }
219
- tr > th:last-child { border-right: 1px solid #ddd; }
220
-
221
- .ancestors { color: #999; }
222
- .ancestors a
223
- {
224
- color: #999 !important;
225
- text-decoration: none;
226
- }
227
-
228
- .clear
229
- {
230
- clear: both;
231
- }
232
-
233
- .important
234
- {
235
- font-weight: bold;
236
- color: #950B02;
237
- }
238
-
239
- .yes-def {
240
- text-indent: -1000px;
241
- }
242
-
243
- .type-signature {
244
- color: #aaa;
245
- }
246
-
247
- .name, .signature {
248
- font-family: Consolas, Monaco, 'Andale Mono', monospace;
249
-
250
-
251
- }
252
-
253
- .name{
254
- border-top: 1px solid #2980B9;
255
- margin-top: 24px;
256
- padding-top: 4px;
257
- }
258
-
259
- .details { margin-top: 14px; border-left: 2px solid #DDD; }
260
- .details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; }
261
- .details dd { margin-left: 70px; }
262
- .details ul { margin: 0; }
263
- .details ul { list-style-type: none; }
264
- .details li { margin-left: 30px; padding-top: 6px; }
265
- .details pre.prettyprint { margin: 0 }
266
- .details .object-value { padding-top: 0; }
267
-
268
- .description {
269
- margin-bottom: 1em;
270
- margin-top: 1em;
271
- }
272
-
273
- .code-caption
274
- {
275
- font-style: italic;
276
- font-size: 107%;
277
- margin: 0;
278
- }
279
-
280
- .prettyprint
281
- {
282
- border: 1px solid #ddd;
283
- width: 80%;
284
- overflow: auto;
285
- }
286
-
287
- .prettyprint.source {
288
- width: inherit;
289
- }
290
-
291
- .prettyprint code
292
- {
293
- font-size: 100%;
294
- line-height: 18px;
295
- display: block;
296
- padding: 4px 12px;
297
- margin: 0;
298
- background-color: #fff;
299
- color: #4D4E53;
300
- }
301
-
302
- .prettyprint code span.line
303
- {
304
- display: inline-block;
305
- }
306
-
307
- .prettyprint.linenums
308
- {
309
- padding-left: 70px;
310
- -webkit-user-select: none;
311
- -moz-user-select: none;
312
- -ms-user-select: none;
313
- user-select: none;
314
- }
315
-
316
- .prettyprint.linenums ol
317
- {
318
- padding-left: 0;
319
- }
320
-
321
- .prettyprint.linenums li
322
- {
323
- border-left: 3px #ddd solid;
324
- }
325
-
326
- .prettyprint.linenums li.selected,
327
- .prettyprint.linenums li.selected *
328
- {
329
- background-color: lightyellow;
330
- }
331
-
332
- .prettyprint.linenums li *
333
- {
334
- -webkit-user-select: text;
335
- -moz-user-select: text;
336
- -ms-user-select: text;
337
- user-select: text;
338
- }
339
-
340
- .params .name, .props .name, .name code {
341
- color: #4D4E53;
342
- font-family: Consolas, Monaco, 'Andale Mono', monospace;
343
- font-size: 100%;
344
- }
345
-
346
- .params td.description > p:first-child,
347
- .props td.description > p:first-child
348
- {
349
- margin-top: 0;
350
- padding-top: 0;
351
- }
352
-
353
- .params td.description > p:last-child,
354
- .props td.description > p:last-child
355
- {
356
- margin-bottom: 0;
357
- padding-bottom: 0;
358
- }
359
-
360
- .disabled {
361
- color: #454545;
362
- }
363
-
364
- a.page-title.spyne{
365
- font-family: 'Roboto Slab', serif;
366
- color: #fff;
367
- font-size:2rem;
368
- text-decoration: none;
369
- background: slateblue;
370
- text-align: center;
371
- width: 89px;
372
- padding: 0px 12px 7px 11px;
373
- margin: 10px 0 0 24px;
374
- }
375
-
376
-
377
- }
@@ -1,47 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>JSDoc: <?js= title ?></title>
6
- <link href="https://fonts.googleapis.com/css?family=Roboto+Slab" rel="stylesheet">
7
-
8
- <script src="scripts/prettify/prettify.js"> </script>
9
- <script src="scripts/prettify/lang-css.js"> </script>
10
- <!--[if lt IE 9]>
11
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
12
- <![endif]-->
13
- <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
14
- <!--
15
- <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
16
- -->
17
- <link type="text/css" rel="stylesheet" href="custom/css/jsdoc-viewstream.css">
18
-
19
-
20
- </head>
21
-
22
- <body>
23
-
24
- <div id="main">
25
- <a class="page-title spyne" href='https://www.npmjs.com/package/spyne' target='blank'>spyne</a>
26
-
27
- <!--
28
- <h1 class="page-title"><?js= title ?></h1>
29
- -->
30
-
31
- <?js= content ?>
32
- </div>
33
-
34
- <nav>
35
- <?js= this.nav ?>
36
- </nav>
37
-
38
- <br class="clear">
39
-
40
- <footer>
41
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc <?js= env.version.number ?></a><?js if(env.conf.templates && env.conf.templates.default && env.conf.templates.default.includeDate !== false) { ?> on <?js= (new Date()) ?><?js } ?>
42
- </footer>
43
-
44
- <script> prettyPrint(); </script>
45
- <script src="scripts/linenumber.js"> </script>
46
- </body>
47
- </html>
@@ -1,213 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>JSDoc: Source: dom-element.js</title>
6
- <link href="https://fonts.googleapis.com/css?family=Roboto+Slab" rel="stylesheet">
7
-
8
- <script src="scripts/prettify/prettify.js"> </script>
9
- <script src="scripts/prettify/lang-css.js"> </script>
10
- <!--[if lt IE 9]>
11
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
12
- <![endif]-->
13
- <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
14
- <!--
15
- <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
16
- -->
17
- <link type="text/css" rel="stylesheet" href="custom/css/jsdoc-viewstream.css">
18
-
19
-
20
- </head>
21
-
22
- <body>
23
-
24
- <div id="main">
25
- <a class="page-title spyne" href='https://www.npmjs.com/package/spyne' target='blank'>spyne</a>
26
-
27
- <!--
28
- <h1 class="page-title">Source: dom-element.js</h1>
29
- -->
30
-
31
-
32
-
33
-
34
-
35
-
36
- <section>
37
- <article>
38
- <pre class="prettyprint source linenums"><code>// import {createElement} from '../utils/dom-methods';
39
- import {BaseCoreMixins} from '../utils/mixins/base-core-mixins';
40
- import { DomItemTemplate } from './template-renderer';
41
- // import {DomItemTemplate} from './template-renderer';
42
-
43
- const R = require('ramda');
44
-
45
- export class DomItem {
46
- /**
47
- * @module DomItem
48
- *
49
- * @desc
50
- * This class is mostly used internally by the ViewStream object, but it can be also used to generate a lightweight dom element that contains no props or parameters.
51
- *
52
- * @constructor
53
- * @param {string} tagName the tagname for this dom element.
54
- * @param {object} attributes any domElement attribute (except for class )
55
- * @param {string|object} content string for text tags and json for templates
56
- * @param {tmpl} template
57
- */
58
-
59
- constructor(tagName = 'div', attributes = {}, content = undefined, template = undefined) {
60
- let isSimpleView = R.is(String, attributes);
61
- if (isSimpleView === true) {
62
- content = attributes;
63
- attributes = {};
64
- }
65
- this.props = new Map();
66
- this.setProp('fragment', document.createDocumentFragment());
67
- this.setProp('tagName', tagName);
68
- this.setProp('attrs', this.updateAttrs(attributes));
69
- this.setProp('content', content);
70
- this.setProp('tmpl', template);
71
- this.addMixins();
72
- }
73
-
74
- setProp(key, val) {
75
- this.props.set(key, val);
76
- }
77
-
78
- getProp(val) {
79
- return this.props.get(val);
80
- }
81
-
82
- get el() {
83
- return this.props.get('el');
84
- }
85
-
86
- setElAttrs(el, params) {
87
- let addAttributes = (val, key) => {
88
- let addToDataset = (val, key) => { el.dataset[key] = val; };
89
- if (key === 'dataset') {
90
- R.forEachObjIndexed(addToDataset, val);
91
- } else {
92
- el.setAttribute(key, val);
93
- }
94
- };
95
- this.getProp('attrs').forEach(addAttributes);
96
- return el;
97
- }
98
-
99
- updateAttrs(params, m) {
100
- let theMap = m !== undefined ? m : new Map();
101
- let addAttributes = (val, key) => theMap.set(key, val);
102
- R.mapObjIndexed(addAttributes, params);
103
- return theMap;
104
- }
105
-
106
- addTemplate(el) {
107
- let tmpl = this.getProp('tmpl');
108
-
109
- let addTmpl = (tmpl) => {
110
- let data = this.getProp('content');
111
- data = R.is(Object, data) ? data : {};
112
-
113
- let frag = new DomItemTemplate(tmpl, data).renderDocFrag();
114
- el.appendChild(frag);
115
- return el;
116
- };
117
- let doNothing = (el) => el;
118
- return tmpl !== undefined ? addTmpl(tmpl) : doNothing(el);
119
- }
120
-
121
- createElement(tagName = 'div') {
122
- return document.createElement(tagName);
123
- }
124
-
125
- addContent(el) {
126
- let text = (this.getProp('content'));
127
- let isText = R.is(String, text);
128
- if (isText === true) {
129
- let txt = document.createTextNode(text);
130
- el.appendChild(txt);
131
- }
132
- return el;
133
- }
134
-
135
- execute() {
136
- let el = R.pipe(
137
- this.createElement.bind(this),
138
- this.setElAttrs.bind(this),
139
- this.addTemplate.bind(this),
140
- this.addContent.bind(this)
141
- )(this.getProp('tagName'));
142
- // this.getProp('fragment').appendChild(el);
143
- this.props.set('el', el);
144
- }
145
-
146
- render() {
147
- this.execute();
148
- return this.getProp('el');
149
- }
150
-
151
- returnIfDefined(obj, val) {
152
- if (val !== undefined) {
153
- let isObj = typeof (val) === 'undefined';
154
- isObj === false ? obj[val] = val : obj[val] = Object.assign(obj[val], val);
155
- }
156
- }
157
-
158
- updateprops(val) {
159
- this.returnIfDefined(this.props, val);
160
- return this;
161
- }
162
-
163
- updatepropsAndRun(val) {
164
- this.updateprops(val);
165
- this.execute();
166
- return this.getProp('fragment');
167
- }
168
-
169
- unmount() {
170
- this.getProp('el').remove();
171
- this.props.clear();
172
- this.gc();
173
- }
174
-
175
- updateTag(tagName = 'div') { this.updateprops(tagName); }
176
- updateAttributes(attrs = {}) { this.updateprops(attrs); }
177
- updateTemplate(tmpl) { this.updateprops(tmpl); }
178
- updateData(data = {}) { this.updateprops(data); }
179
- addTagAndRender(tagName = 'div') { this.updatepropsAndRun(tagName); }
180
- addAttrsibutesAndRender(attrs = {}) { this.updatepropsAndRun(attrs); }
181
- addTemplateAndRender(tmpl) { this.updatepropsAndRun(tmpl); }
182
- addDataAndRender(data = {}) { this.updatepropsAndRun(data); }
183
- // ==================================
184
- // BASE CORE MIXINS
185
- // ==================================
186
- addMixins() {
187
- let coreMixins = BaseCoreMixins();
188
- this.gc = coreMixins.gc.bind(this);
189
- }
190
- }
191
- </code></pre>
192
- </article>
193
- </section>
194
-
195
-
196
-
197
-
198
- </div>
199
-
200
- <nav>
201
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="DomItem.html">DomItem</a></li><li><a href="ViewStream.html">ViewStream</a></li></ul>
202
- </nav>
203
-
204
- <br class="clear">
205
-
206
- <footer>
207
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Dec 15 2017 22:34:55 GMT-0500 (EST)
208
- </footer>
209
-
210
- <script> prettyPrint(); </script>
211
- <script src="scripts/linenumber.js"> </script>
212
- </body>
213
- </html>