@twobirds/microcomponents 0.0.9 → 0.0.12

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 (46) hide show
  1. package/README.md +3 -5
  2. package/assets/test.html +11 -0
  3. package/dist/microcomponents.d.ts +15 -231
  4. package/dist/microcomponents.d.ts.map +1 -1
  5. package/dist/microcomponents.es3.d.ts +5 -0
  6. package/dist/microcomponents.es3.d.ts.map +1 -1
  7. package/dist/microcomponents.js +143 -334
  8. package/dist/microcomponents.min.js +32 -29
  9. package/dist/microcomponents.ts +209 -395
  10. package/dist/test.d.ts +36 -0
  11. package/dist/test.d.ts.map +1 -0
  12. package/dist/test.js +214 -0
  13. package/package.json +3 -4
  14. package/public/{docs/assets → assets}/highlight.css +29 -22
  15. package/public/assets/search.js +1 -0
  16. package/public/{docs/classes → classes}/microcomponents.MC.html +78 -241
  17. package/public/{docs/classes → classes}/microcomponents_es3.MC.html +12 -12
  18. package/public/{docs/functions → functions}/microcomponents_es3.__isEmpty.html +1 -1
  19. package/public/index.html +101 -11
  20. package/public/microcomponents.js +176 -0
  21. package/public/{docs/modules → modules}/microcomponents.html +2 -7
  22. package/public/test.html +11 -0
  23. package/public/test.js +214 -0
  24. package/src/microcomponents.ts +209 -395
  25. package/src/test.js +245 -0
  26. package/typedoc.json +1 -1
  27. package/assets/index.html +0 -11
  28. package/jsdoc.conf.json +0 -19
  29. package/public/docs/assets/search.js +0 -1
  30. package/public/docs/index.html +0 -97
  31. package/public/docs/interfaces/microcomponents.HTMLElementMc.html +0 -3605
  32. package/public/jsdoc/es3/files.html +0 -216
  33. package/public/jsdoc/es3/index.html +0 -210
  34. package/public/jsdoc/es3/symbols/_global_.html +0 -368
  35. package/public/jsdoc/es3/symbols/src/build_microcomponents.es3.js.html +0 -104
  36. package/public/jsdoc/es5+/files.html +0 -218
  37. package/public/jsdoc/es5+/index.html +0 -218
  38. package/public/jsdoc/es5+/symbols/MC.html +0 -621
  39. package/public/jsdoc/es5+/symbols/_global_.html +0 -720
  40. package/public/jsdoc/es5+/symbols/microcomponents.MC.html +0 -323
  41. package/public/jsdoc/es5+/symbols/src/build_microcomponents.js.html +0 -375
  42. /package/public/{docs/.nojekyll → .nojekyll} +0 -0
  43. /package/public/{docs/assets → assets}/main.js +0 -0
  44. /package/public/{docs/assets → assets}/style.css +0 -0
  45. /package/public/{docs/modules → modules}/microcomponents_es3.html +0 -0
  46. /package/public/{docs/modules.html → modules.html} +0 -0
@@ -1,621 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
- <meta name="generator" content="JsDoc Toolkit" />
7
-
8
- <title>JsDoc Reference - MC</title>
9
-
10
- <style type="text/css">
11
- /* default.css */
12
- body
13
- {
14
- font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
15
- width: 800px;
16
- }
17
-
18
- .header
19
- {
20
- clear: both;
21
- background-color: #ccc;
22
- padding: 8px;
23
- }
24
-
25
- h1
26
- {
27
- font-size: 150%;
28
- font-weight: bold;
29
- padding: 0;
30
- margin: 1em 0 0 .3em;
31
- }
32
-
33
- hr
34
- {
35
- border: none 0;
36
- border-top: 1px solid #7F8FB1;
37
- height: 1px;
38
- }
39
-
40
- pre.code
41
- {
42
- display: block;
43
- padding: 8px;
44
- border: 1px dashed #ccc;
45
- }
46
-
47
- #index
48
- {
49
- margin-top: 24px;
50
- float: left;
51
- width: 160px;
52
- position: absolute;
53
- left: 8px;
54
- background-color: #F3F3F3;
55
- padding: 8px;
56
- }
57
-
58
- #content
59
- {
60
- margin-left: 190px;
61
- width: 600px;
62
- }
63
-
64
- .classList
65
- {
66
- list-style-type: none;
67
- padding: 0;
68
- margin: 0 0 0 8px;
69
- font-family: arial, sans-serif;
70
- font-size: 1em;
71
- overflow: auto;
72
- }
73
-
74
- .classList li
75
- {
76
- padding: 0;
77
- margin: 0 0 8px 0;
78
- }
79
-
80
- .summaryTable { width: 100%; }
81
-
82
- h1.classTitle
83
- {
84
- font-size:170%;
85
- line-height:130%;
86
- }
87
-
88
- h2 { font-size: 110%; }
89
- caption, div.sectionTitle
90
- {
91
- background-color: #7F8FB1;
92
- color: #fff;
93
- font-size:130%;
94
- text-align: left;
95
- padding: 2px 6px 2px 6px;
96
- border: 1px #7F8FB1 solid;
97
- }
98
-
99
- div.sectionTitle { margin-bottom: 8px; }
100
- .summaryTable thead { display: none; }
101
-
102
- .summaryTable td
103
- {
104
- vertical-align: top;
105
- padding: 4px;
106
- border-bottom: 1px #7F8FB1 solid;
107
- border-right: 1px #7F8FB1 solid;
108
- }
109
-
110
- /*col#summaryAttributes {}*/
111
- .summaryTable td.attributes
112
- {
113
- border-left: 1px #7F8FB1 solid;
114
- width: 140px;
115
- text-align: right;
116
- }
117
-
118
- td.attributes, .fixedFont
119
- {
120
- line-height: 15px;
121
- color: #002EBE;
122
- font-family: "Courier New",Courier,monospace;
123
- font-size: 13px;
124
- }
125
-
126
- .summaryTable td.nameDescription
127
- {
128
- text-align: left;
129
- font-size: 13px;
130
- line-height: 15px;
131
- }
132
-
133
- .summaryTable td.nameDescription, .description
134
- {
135
- line-height: 15px;
136
- padding: 4px;
137
- padding-left: 4px;
138
- }
139
-
140
- .summaryTable { margin-bottom: 8px; }
141
-
142
- ul.inheritsList
143
- {
144
- list-style: square;
145
- margin-left: 20px;
146
- padding-left: 0;
147
- }
148
-
149
- .detailList {
150
- margin-left: 20px;
151
- line-height: 15px;
152
- }
153
- .detailList dt { margin-left: 20px; }
154
-
155
- .detailList .heading
156
- {
157
- font-weight: bold;
158
- padding-bottom: 6px;
159
- margin-left: 0;
160
- }
161
-
162
- .light, td.attributes, .light a:link, .light a:visited
163
- {
164
- color: #777;
165
- font-style: italic;
166
- }
167
-
168
- .fineprint
169
- {
170
- text-align: right;
171
- font-size: 10px;
172
- }
173
- </style>
174
- </head>
175
-
176
- <body>
177
- <!-- ============================== header ================================= -->
178
- <!-- begin static/header.html -->
179
- <div id="header">
180
- </div>
181
- <!-- end static/header.html -->
182
-
183
- <!-- ============================== classes index ============================ -->
184
- <div id="index">
185
- <!-- begin publish.classesIndex -->
186
- <div align="center"><a href="../index.html">Class Index</a>
187
- | <a href="../files.html">File Index</a></div>
188
- <hr />
189
- <h2>Classes</h2>
190
- <ul class="classList">
191
-
192
- <li><i><a href="../symbols/_global_.html">_global_</a></i></li>
193
-
194
- <li><a href="../symbols/MC.html">MC</a></li>
195
-
196
- </ul>
197
- <hr />
198
- <!-- end publish.classesIndex -->
199
- </div>
200
-
201
- <div id="content">
202
- <!-- ============================== class title ============================ -->
203
- <h1 class="classTitle">
204
-
205
- Class MC
206
- </h1>
207
-
208
- <!-- ============================== class summary ========================== -->
209
- <p class="description">
210
-
211
-
212
-
213
-
214
-
215
-
216
- <br /><i>Defined in: </i> <a href="../symbols/src/build_microcomponents.js.html">microcomponents.js</a>.
217
-
218
- </p>
219
-
220
- <!-- ============================== constructor summary ==================== -->
221
-
222
- <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class MC.">
223
- <caption>Class Summary</caption>
224
- <thead>
225
- <tr>
226
- <th scope="col">Constructor Attributes</th>
227
- <th scope="col">Constructor Name and Description</th>
228
- </tr>
229
- </thead>
230
- <tbody>
231
- <tr>
232
- <td class="attributes">&nbsp;</td>
233
- <td class="nameDescription" >
234
- <div class="fixedFont">
235
- <b><a href="../symbols/MC.html#constructor">MC</a></b>()
236
- </div>
237
- <div class="description">Manages microcomponents (MCs) attached to DOM elements, allowing for the
238
- addition, removal, and traversal of microcomponents across siblings, parents,
239
- children, and descendants.</div>
240
- </td>
241
- </tr>
242
- </tbody>
243
- </table>
244
-
245
-
246
- <!-- ============================== properties summary ===================== -->
247
-
248
-
249
-
250
- <table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class MC.">
251
- <caption>Field Summary</caption>
252
- <thead>
253
- <tr>
254
- <th scope="col">Field Attributes</th>
255
- <th scope="col">Field Name and Description</th>
256
- </tr>
257
- </thead>
258
- <tbody>
259
-
260
- <tr>
261
- <td class="attributes">&lt;static&gt; &nbsp;</td>
262
- <td class="nameDescription">
263
- <div class="fixedFont">
264
- MC.<b><a href="../symbols/MC.html#.debug">debug</a></b>
265
- </div>
266
- <div class="description">A static flag to enable or disable debugging mode.</div>
267
- </td>
268
- </tr>
269
-
270
- </tbody>
271
- </table>
272
-
273
-
274
-
275
-
276
-
277
- <!-- ============================== methods summary ======================== -->
278
-
279
-
280
-
281
- <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class MC.">
282
- <caption>Method Summary</caption>
283
- <thead>
284
- <tr>
285
- <th scope="col">Method Attributes</th>
286
- <th scope="col">Method Name and Description</th>
287
- </tr>
288
- </thead>
289
- <tbody>
290
-
291
- <tr>
292
- <td class="attributes">&lt;static&gt; &nbsp;</td>
293
- <td class="nameDescription">
294
- <div class="fixedFont">MC.<b><a href="../symbols/MC.html#.add">add</a></b>(target, key, element)
295
- </div>
296
- <div class="description">Adds a top level microcomponent to a target DOM node.</div>
297
- </td>
298
- </tr>
299
-
300
- <tr>
301
- <td class="attributes">&lt;static&gt; &nbsp;</td>
302
- <td class="nameDescription">
303
- <div class="fixedFont">MC.<b><a href="../symbols/MC.html#.remove">remove</a></b>(target, key)
304
- </div>
305
- <div class="description">Removes a top level microcomponent from the target DOM node.</div>
306
- </td>
307
- </tr>
308
-
309
- <tr>
310
- <td class="attributes">&lt;static&gt; &nbsp;</td>
311
- <td class="nameDescription">
312
- <div class="fixedFont">MC.<b><a href="../symbols/MC.html#.siblings">siblings</a></b>(target, search)
313
- </div>
314
- <div class="description">Retrieves all top-level microcomponents from a target HTMLElement.</div>
315
- </td>
316
- </tr>
317
-
318
- </tbody>
319
- </table>
320
-
321
-
322
-
323
-
324
- <!-- ============================== events summary ======================== -->
325
-
326
-
327
- <!-- ============================== constructor details ==================== -->
328
-
329
- <div class="details"><a name="constructor"> </a>
330
- <div class="sectionTitle">
331
- Class Detail
332
- </div>
333
-
334
- <div class="fixedFont">
335
- <b>MC</b>()
336
- </div>
337
-
338
- <div class="description">
339
- Manages microcomponents (MCs) attached to DOM elements, allowing for the
340
- addition, removal, and traversal of microcomponents across siblings, parents,
341
- children, and descendants.
342
-
343
- This class provides an API for interacting with microcomponents on DOM elements.
344
- Public microcomponents are stored on the `_mc` attribute of the DOM element, while
345
- private microcomponents are managed internally.
346
-
347
- </div>
348
-
349
-
350
-
351
- <pre class="code">```javascript
352
-
353
- // create the micro component class
354
- class MyMC extends MC{
355
-
356
- &nbsp;constructor( target ){
357
- &nbsp;&nbsp;super( target );
358
- &nbsp;&nbsp;this.target = target;
359
- &nbsp;}
360
- }
361
-
362
- const element = document.querySelector('div')
363
-
364
- // Add the top level microcomponent to the target element
365
- let mcc = MC.add(
366
- &nbsp;element,
367
- &nbsp;'myMC',
368
- &nbsp;new MyMC( element )
369
- );
370
-
371
- // Add an inner (private) microcomponent to mcc
372
- let mcc.add(
373
- &nbsp;'myInnerMC',
374
- &nbsp;new MyMC( element )
375
- );
376
-
377
- console.log( element._mc );
378
- // { 'myMC': { target: (element) } }
379
-
380
- console.log( element._mc.myMC );
381
- // { target: (element) }
382
-
383
- console.log( mcc.siblings() );
384
- // [ { target: (element) } ]
385
-
386
- ```</pre>
387
-
388
-
389
-
390
-
391
-
392
-
393
-
394
-
395
-
396
-
397
-
398
-
399
- </div>
400
-
401
-
402
- <!-- ============================== field details ========================== -->
403
-
404
- <div class="sectionTitle">
405
- Field Detail
406
- </div>
407
-
408
- <a name=".debug"> </a>
409
- <div class="fixedFont">&lt;static&gt;
410
-
411
- <span class="light">{A static flag to enable or disable debugging mode.}</span>
412
- <span class="light">MC.</span><b>debug</b>
413
-
414
- </div>
415
- <div class="description">
416
- A static flag to enable or disable debugging mode.
417
-
418
-
419
- </div>
420
-
421
-
422
-
423
-
424
-
425
-
426
-
427
-
428
-
429
-
430
-
431
-
432
- <!-- ============================== method details ========================= -->
433
-
434
- <div class="sectionTitle">
435
- Method Detail
436
- </div>
437
-
438
- <a name=".add"> </a>
439
- <div class="fixedFont">&lt;static&gt;
440
-
441
- <span class="light">{any}</span>
442
- <span class="light">MC.</span><b>add</b>(target, key, element)
443
-
444
- </div>
445
- <div class="description">
446
- Adds a top level microcomponent to a target DOM node.
447
-
448
-
449
- </div>
450
-
451
-
452
-
453
- <pre class="code">const component = MC.add(
454
- &nbsp;document.getElementById('myElement'),
455
- &nbsp;'myComponent',
456
- &nbsp;{}
457
- );</pre>
458
-
459
-
460
-
461
-
462
- <dl class="detailList">
463
- <dt class="heading">Parameters:</dt>
464
-
465
- <dt>
466
- <span class="light fixedFont">{HTMLElement}</span> <b>target</b>
467
-
468
- </dt>
469
- <dd>- The target DOM element.</dd>
470
-
471
- <dt>
472
- <span class="light fixedFont">{string}</span> <b>key</b>
473
-
474
- </dt>
475
- <dd>- The key to identify the microcomponent.</dd>
476
-
477
- <dt>
478
- <span class="light fixedFont">{any}</span> <b>element</b>
479
- <i>Optional, Default: {}</i>
480
- </dt>
481
- <dd>- The microcomponent to add.</dd>
482
-
483
- </dl>
484
-
485
-
486
-
487
-
488
-
489
- <dl class="detailList">
490
- <dt class="heading">Returns:</dt>
491
-
492
- <dd><span class="light fixedFont">{any}</span> The added microcomponent.</dd>
493
-
494
- </dl>
495
-
496
-
497
-
498
-
499
- <hr />
500
-
501
- <a name=".remove"> </a>
502
- <div class="fixedFont">&lt;static&gt;
503
-
504
-
505
- <span class="light">MC.</span><b>remove</b>(target, key)
506
-
507
- </div>
508
- <div class="description">
509
- Removes a top level microcomponent from the target DOM node.
510
-
511
-
512
- </div>
513
-
514
-
515
-
516
- <pre class="code">MC.remove(
517
- &nbsp;document.getElementById('myElement'),
518
- &nbsp;'myComponent'
519
- );</pre>
520
-
521
-
522
-
523
-
524
- <dl class="detailList">
525
- <dt class="heading">Parameters:</dt>
526
-
527
- <dt>
528
- <span class="light fixedFont">{HTMLElement}</span> <b>target</b>
529
-
530
- </dt>
531
- <dd>- The target DOM element.</dd>
532
-
533
- <dt>
534
- <span class="light fixedFont">{string}</span> <b>key</b>
535
-
536
- </dt>
537
- <dd>- The key identifying the microcomponent.</dd>
538
-
539
- </dl>
540
-
541
-
542
-
543
-
544
-
545
-
546
-
547
-
548
- <hr />
549
-
550
- <a name=".siblings"> </a>
551
- <div class="fixedFont">&lt;static&gt;
552
-
553
- <span class="light">{Array<any>}</span>
554
- <span class="light">MC.</span><b>siblings</b>(target, search)
555
-
556
- </div>
557
- <div class="description">
558
- Retrieves all top-level microcomponents from a target HTMLElement.
559
-
560
-
561
- </div>
562
-
563
-
564
-
565
- <pre class="code">const siblings = MC.siblings(
566
- &nbsp;document.getElementById('myElement'),
567
- &nbsp;'myComponent'
568
- );</pre>
569
-
570
-
571
-
572
-
573
- <dl class="detailList">
574
- <dt class="heading">Parameters:</dt>
575
-
576
- <dt>
577
- <span class="light fixedFont">{HTMLElement}</span> <b>target</b>
578
-
579
- </dt>
580
- <dd>- The target DOM element.</dd>
581
-
582
- <dt>
583
- <span class="light fixedFont">{string}</span> <b>search</b>
584
- <i>Optional</i>
585
- </dt>
586
- <dd>- The key of the specific microcomponent to find.</dd>
587
-
588
- </dl>
589
-
590
-
591
-
592
-
593
-
594
- <dl class="detailList">
595
- <dt class="heading">Returns:</dt>
596
-
597
- <dd><span class="light fixedFont">{Array<any>}</span> An array of microcomponents or an empty array if none found.</dd>
598
-
599
- </dl>
600
-
601
-
602
-
603
-
604
-
605
-
606
-
607
-
608
- <!-- ============================== event details ========================= -->
609
-
610
-
611
- <hr />
612
- </div>
613
-
614
-
615
- <!-- ============================== footer ================================= -->
616
- <div class="fineprint" style="clear:both">
617
-
618
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Oct 30 2024 23:18:47 GMT+0100 (MEZ)
619
- </div>
620
- </body>
621
- </html>