kempo-ui 0.0.2 → 0.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.
Files changed (193) hide show
  1. package/.github/copilot-instructions.md +149 -149
  2. package/.github/workflows/publish-npm.yml +44 -44
  3. package/CONTRIBUTING.md +149 -149
  4. package/README.md +0 -0
  5. package/dist/kempo-vars.css +0 -0
  6. package/dist/src/components/FocusCapture.js +7 -0
  7. package/dist/src/components/Icon.js +10 -0
  8. package/dist/src/components/Import.js +1 -0
  9. package/dist/src/components/ShadowComponent.js +1 -0
  10. package/dist/src/components/SideMenu.js +97 -0
  11. package/dist/src/lit-all.min.js +120 -0
  12. package/docs/components/accordion.html +122 -0
  13. package/docs/components/card.html +91 -0
  14. package/docs/components/component.html +90 -0
  15. package/docs/components/content-slider.html +193 -0
  16. package/docs/components/dialog.html +245 -0
  17. package/docs/components/directory-viewer.html +90 -0
  18. package/docs/components/focus-capture.html +68 -0
  19. package/docs/components/icon.html +161 -0
  20. package/docs/components/import.html +78 -0
  21. package/docs/components/lazy-component.html +84 -0
  22. package/docs/components/reactive-component.html +69 -0
  23. package/docs/components/reactive-lazy-component.html +69 -0
  24. package/docs/components/resize.html +152 -0
  25. package/docs/components/search.html +102 -0
  26. package/docs/components/show-more.html +123 -0
  27. package/docs/components/side-menu.html +168 -0
  28. package/docs/components/sortable.html +96 -0
  29. package/docs/components/split.html +126 -0
  30. package/docs/components/table.html +312 -0
  31. package/docs/components/tableControls.html +77 -0
  32. package/docs/components/tableCustomFields.html +113 -0
  33. package/docs/components/tableFetchRecords.html +114 -0
  34. package/docs/components/tableFieldSortHide.html +75 -0
  35. package/docs/components/tablePagination.html +100 -0
  36. package/docs/components/tableRecordEditing.html +144 -0
  37. package/docs/components/tableRecordFiltering.html +75 -0
  38. package/docs/components/tableRecordHiding.html +80 -0
  39. package/docs/components/tableRecordSearching.html +75 -0
  40. package/docs/components/tableRecordSelection.html +75 -0
  41. package/docs/components/tableRowControls.html +78 -0
  42. package/docs/components/tableSorting.html +73 -0
  43. package/docs/components/tabs.html +163 -0
  44. package/docs/components/tags.html +94 -0
  45. package/docs/components/theme-switcher.html +129 -0
  46. package/docs/components/timestamp.html +86 -0
  47. package/docs/components/toast.html +328 -0
  48. package/docs/components/toggle.html +155 -0
  49. package/docs/dev.config.json +20 -0
  50. package/docs/icons/add.svg +1 -0
  51. package/docs/icons/arrow-back.svg +1 -0
  52. package/docs/icons/arrow-down-double.svg +1 -0
  53. package/docs/icons/arrow-down.svg +1 -0
  54. package/docs/icons/arrow-forward.svg +1 -0
  55. package/docs/icons/arrow-up-double.svg +1 -0
  56. package/docs/icons/arrow-up.svg +1 -0
  57. package/docs/icons/cards.svg +1 -0
  58. package/docs/icons/check.svg +1 -0
  59. package/docs/icons/chevron-left.svg +1 -0
  60. package/docs/icons/chevron-right.svg +1 -0
  61. package/docs/icons/close.svg +2 -0
  62. package/docs/icons/compare.svg +1 -0
  63. package/docs/icons/delete.svg +1 -0
  64. package/docs/icons/drag-handle.svg +1 -0
  65. package/docs/icons/drawing2.svg +124 -0
  66. package/docs/icons/edit.svg +1 -0
  67. package/docs/icons/error.svg +1 -0
  68. package/docs/icons/export-file.svg +1 -0
  69. package/docs/icons/file-text.svg +1 -0
  70. package/docs/icons/file.svg +1 -0
  71. package/docs/icons/filter-off.svg +1 -0
  72. package/docs/icons/filter.svg +1 -0
  73. package/docs/icons/first.svg +1 -0
  74. package/docs/icons/folder-clear.svg +1 -0
  75. package/docs/icons/folder-create.svg +1 -0
  76. package/docs/icons/folder-open.svg +1 -0
  77. package/docs/icons/folder.svg +1 -0
  78. package/docs/icons/hide.svg +1 -0
  79. package/docs/icons/image.svg +1 -0
  80. package/docs/icons/label-add.svg +1 -0
  81. package/docs/icons/label.svg +1 -0
  82. package/docs/icons/last.svg +1 -0
  83. package/docs/icons/menu.svg +1 -0
  84. package/docs/icons/mode-auto.svg +1 -0
  85. package/docs/icons/mode-dark.svg +1 -0
  86. package/docs/icons/mode-light.svg +1 -0
  87. package/docs/icons/open-in-browser.svg +1 -0
  88. package/docs/icons/pause.svg +1 -0
  89. package/docs/icons/play.svg +1 -0
  90. package/docs/icons/refresh.svg +1 -0
  91. package/docs/icons/remove.svg +1 -0
  92. package/docs/icons/save.svg +1 -0
  93. package/docs/icons/search.svg +1 -0
  94. package/docs/icons/settings.svg +1 -0
  95. package/docs/icons/show.svg +1 -0
  96. package/docs/icons/storage.svg +1 -0
  97. package/docs/icons/table-visibility.svg +1 -0
  98. package/docs/icons/tag.svg +1 -0
  99. package/docs/icons/tools.svg +1 -0
  100. package/docs/icons/trash-x.svg +1 -0
  101. package/docs/icons/warning.svg +1 -0
  102. package/docs/index.html +28 -21
  103. package/docs/nav.inc.html +73 -0
  104. package/docs/nav.inc.js +4 -0
  105. package/{config/production.json → docs/prod.config.json} +20 -16
  106. package/docs/src/components/FocusCapture.js +7 -0
  107. package/docs/src/components/HybridComponent.js +1 -0
  108. package/docs/src/components/Icon.js +10 -0
  109. package/docs/src/components/Import.js +1 -0
  110. package/docs/src/components/LightComponent.js +1 -0
  111. package/docs/src/components/ShadowComponent.js +1 -0
  112. package/docs/src/components/SideMenu.js +97 -0
  113. package/docs/src/lit-all.min.js +120 -0
  114. package/docs/src/utils/cli.js +1 -0
  115. package/docs/src/utils/fs-utils.js +1 -0
  116. package/docs/styles.css +6 -0
  117. package/icons/add.svg +1 -0
  118. package/icons/arrow-back.svg +1 -0
  119. package/icons/arrow-down-double.svg +1 -0
  120. package/icons/arrow-down.svg +1 -0
  121. package/icons/arrow-forward.svg +1 -0
  122. package/icons/arrow-up-double.svg +1 -0
  123. package/icons/arrow-up.svg +1 -0
  124. package/icons/cards.svg +1 -0
  125. package/icons/check.svg +1 -0
  126. package/icons/chevron-left.svg +1 -0
  127. package/icons/chevron-right.svg +1 -0
  128. package/icons/close.svg +2 -0
  129. package/icons/compare.svg +1 -0
  130. package/icons/delete.svg +1 -0
  131. package/icons/drag-handle.svg +1 -0
  132. package/icons/drawing2.svg +124 -0
  133. package/icons/edit.svg +1 -0
  134. package/icons/error.svg +1 -0
  135. package/icons/export-file.svg +1 -0
  136. package/icons/file-text.svg +1 -0
  137. package/icons/file.svg +1 -0
  138. package/icons/filter-off.svg +1 -0
  139. package/icons/filter.svg +1 -0
  140. package/icons/first.svg +1 -0
  141. package/icons/folder-clear.svg +1 -0
  142. package/icons/folder-create.svg +1 -0
  143. package/icons/folder-open.svg +1 -0
  144. package/icons/folder.svg +1 -0
  145. package/icons/hide.svg +1 -0
  146. package/icons/image.svg +1 -0
  147. package/icons/label-add.svg +1 -0
  148. package/icons/label.svg +1 -0
  149. package/icons/last.svg +1 -0
  150. package/icons/menu.svg +1 -0
  151. package/icons/mode-auto.svg +1 -0
  152. package/icons/mode-dark.svg +1 -0
  153. package/icons/mode-light.svg +1 -0
  154. package/icons/open-in-browser.svg +1 -0
  155. package/icons/pause.svg +1 -0
  156. package/icons/play.svg +1 -0
  157. package/icons/refresh.svg +1 -0
  158. package/icons/remove.svg +1 -0
  159. package/icons/save.svg +1 -0
  160. package/icons/search.svg +1 -0
  161. package/icons/settings.svg +1 -0
  162. package/icons/show.svg +1 -0
  163. package/icons/storage.svg +1 -0
  164. package/icons/table-visibility.svg +1 -0
  165. package/icons/tag.svg +1 -0
  166. package/icons/tools.svg +1 -0
  167. package/icons/trash-x.svg +1 -0
  168. package/icons/warning.svg +1 -0
  169. package/package.json +2 -2
  170. package/scripts/build.js +109 -138
  171. package/scripts/docs.js +60 -60
  172. package/src/components/Card.js +66 -0
  173. package/src/components/FocusCapture.js +23 -0
  174. package/src/components/HybridComponent.js +40 -40
  175. package/src/components/Icon.js +155 -0
  176. package/src/components/Import.js +104 -0
  177. package/src/components/LightComponent.js +32 -32
  178. package/src/components/ShadowComponent.js +30 -17
  179. package/src/components/SideMenu.js +167 -0
  180. package/src/components/ThemeSwitcher.js +108 -0
  181. package/src/kempo-hljs.css +146 -0
  182. package/src/utils/cli.js +43 -43
  183. package/src/utils/fs-utils.js +41 -41
  184. package/src/utils/propConverters.js +11 -0
  185. package/tests/HybridComponent.browser-test.js +214 -214
  186. package/tests/LightComponent.browser-test.js +169 -169
  187. package/tests/ShadowComponent.browser-test.js +130 -130
  188. package/config/development.json +0 -14
  189. package/docs/components/ShadowComponent.js +0 -1
  190. /package/{docs → dist/src}/components/HybridComponent.js +0 -0
  191. /package/{docs → dist/src}/components/LightComponent.js +0 -0
  192. /package/{docs → dist/src}/utils/cli.js +0 -0
  193. /package/{docs → dist/src}/utils/fs-utils.js +0 -0
@@ -0,0 +1,78 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Import - Components - Kempo Docs - A Web Components Solution</title>
7
+ <link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
8
+ <link rel="stylesheet" href="../src/kempo-hljs.css" />
9
+ <link rel="stylesheet" href="../styles.css" />
10
+ <script type="module">
11
+ import Import from '../src/components/Import.js';
12
+ import Icon from '../src/components/Icon.js';
13
+ Import.replacements.root = '../';
14
+ Icon.pathToIcons = ['../icons'];
15
+ </script>
16
+ </head>
17
+ <body>
18
+ <k-import src="../nav.inc.html"></k-import>
19
+ <h1 class="ta-center">Import</h1>
20
+ <main>
21
+ <details class="b r mb">
22
+ <summary class="p">Table of Contents</summary>
23
+ <div class="m mt0 pl">
24
+ <h6>Examples</h6>
25
+ <a href="#basicUsage">Basic Usage</a><br />
26
+
27
+ <h6 class="mt">JavaScript Reference</h6>
28
+ <a href="#constructor">Constructor</a><br />
29
+ <a href="#requirements">Requirements</a><br />
30
+ <a href="#attributes">Attributes</a><br />
31
+ <a href="#properties">Properties</a><br />
32
+ <a href="#methods">Methods</a><br />
33
+ </div>
34
+ </details>
35
+
36
+ <h3>What is an import</h3>
37
+ <p>Import commonly used HTML snippets.</p>
38
+ <k-card label="import-me.html">
39
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>I am html<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span></code></pre>
40
+ </k-card>
41
+ <k-card label="HTML">
42
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-import</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"import-me.html"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-import</span>&gt;</span></code></pre>
43
+ </k-card>
44
+ <k-card label="Results">
45
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-import</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"import-me.html"</span> <span class="hljs-attr">rendered</span>=<span class="hljs-string">"true"</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>I am html<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-import</span>&gt;</span></code></pre>
46
+ </k-card>
47
+
48
+ <h2 id="jsRef">JavaScript Reference</h2>
49
+
50
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
51
+ <h6>Extends <a href="./component.html">Component</a></h6>
52
+ <h5>
53
+ <code>new Import()</code>
54
+ </h5>
55
+
56
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
57
+ <ul>
58
+ <li><a href="./component.html">Component</a></li>
59
+ </ul>
60
+
61
+ <h3 id="attributes"><a href="#attributes" class="no-link">Attributes</a></h3>
62
+ <h5><code>src<i>: string</i></code></h5>
63
+ <p>The source URL of the HTML snippet to import.</p>
64
+
65
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
66
+ <h5><code>src<i>: string</i></code></h5>
67
+ <p>The source URL of the HTML snippet to import.</p>
68
+
69
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
70
+ <h5><code>load()<i>: Promise</i></code></h5>
71
+ <p>Loads the HTML snippet from the specified source URL.</p>
72
+
73
+ </main>
74
+ <div style="height:33vh"></div>
75
+ <script type="module" src="../src/components/Import.js"></script>
76
+ <script type="module" src="../src/components/Card.js"></script>
77
+ </body>
78
+ </html>
@@ -0,0 +1,84 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>LazyComponent - Components - Kempo Docs - A Web Components Solution</title>
7
+ <link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
8
+ <link rel="stylesheet" href="../src/kempo-hljs.css" />`n <link rel="stylesheet" href="../styles.css" />
9
+ <script type="module">
10
+ import Import from '../src/components/Import.js';
11
+ import Icon from '../src/components/Icon.js';
12
+ Import.replacements.root = '../';
13
+ Icon.pathToIcons = ['../icons'];
14
+ </script>
15
+ </head>
16
+ <body>
17
+ <k-import src="../nav.inc.html"></k-import>
18
+ <h1 class="ta-center">LazyComponent</h1>
19
+ <main>
20
+ <details class="b r mb">
21
+ <summary class="p">Table of Contents</summary>
22
+ <div class="m mt0 pl">
23
+ <h6>Examples</h6>
24
+ <a href="#basicUsage">Basic Usage</a><br />
25
+
26
+ <h6 class="mt">JavaScript Reference</h6>
27
+ <a href="#constructor">Constructor</a><br />
28
+ <a href="#requirements">Requirements</a><br />
29
+ <a href="#attributes">Attributes</a><br />
30
+ <a href="#properties">Properties</a><br />
31
+ <a href="#methods">Methods</a><br />
32
+ </div>
33
+ </details>
34
+
35
+ <h3>Description</h3>
36
+ <p>This is a base class like <a href="./component.html">Component</a> but the <code>render</code> method is not called until the element is visible (in the view), a skeleton is rendered until then.</p>
37
+
38
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
39
+ <p>Extend the <code>LazyComponent</code> class to create a lazy-loaded component. The component will render its content only when it becomes visible in the viewport.</p>
40
+ <pre><code class="hljs javascript"><span class="hljs-keyword">import</span> LazyComponent <span class="hljs-keyword">from</span> <span class="hljs-string">'kempo'</span>;<br /><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyLazyComponent</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">LazyComponent</span> </span>{<br /> <span class="hljs-keyword">constructor</span>(){<br /> <span class="hljs-keyword">super</span>();<br /> <span class="hljs-comment">// Your Constructor</span><br /> }<br /> <span class="hljs-keyword">async</span> render(force){<br /> <span class="hljs-keyword">if</span>(<span class="hljs-keyword">await</span> <span class="hljs-keyword">super</span>.render(force)){<br /> <span class="hljs-comment">// Your render logic</span><br /> <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;<br /> }<br /> <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;<br /> }<br />}<br /><span class="hljs-built_in">window</span>.customElements.define(<span class="hljs-string">'my-lazy-component'</span>, MyLazyComponent);</code></pre>
41
+
42
+ <h3 id="basicUsage"><a href="#interval" class="no-link">In-View Interval Timeout</a></h3>
43
+ <p>In addition to using intersection observes to watch for components being scrolled into view, an interval is used to check if the component suddenly become visible via a display style change to itself or a parent. The timeout of the interval can be set for all instances of your LazyComponent by chaning the static member <code>inViewIntervalTimeout</code>.</p>
44
+ <pre><code class="hljs javascript"><span class="hljs-keyword">import</span> LazyComponent <span class="hljs-keyword">from</span> <span class="hljs-string">'kempo'</span>;<br /><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyLazyComponent</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">LazyComponent</span> </span>{<br /> <span class="hljs-keyword">constructor</span>(){<br /> <span class="hljs-keyword">super</span>();<br /> <span class="hljs-comment">// Your Constructor</span><br /> }<br /> <span class="hljs-keyword">async</span> render(force){<br /> <span class="hljs-keyword">if</span>(<span class="hljs-keyword">await</span> <span class="hljs-keyword">super</span>.render(force)){<br /> <span class="hljs-comment">// Your render logic</span><br /> <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;<br /> }<br /> <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;<br /> }<br /><br /> <span class="hljs-keyword">static</span> inViewIntervalTimeout = <span class="hljs-number">200</span>; <span class="hljs-comment">// Change the inView checking interval to 200ms instead of the default 1000</span><br />}<br /><span class="hljs-built_in">window</span>.customElements.define(<span class="hljs-string">'my-lazy-component'</span>, MyLazyComponent);</code></pre>
45
+
46
+ <h5>Individal Component interval timer overwrites</h5>
47
+ <p>You can overwrite this interval timeout for individual elements by setting the <code>in-view-interval</code> attribute.</p>
48
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">my-lazy-component</span> <span class="hljs-attr">in-view-interval</span>=<span class="hljs-string">"5000"</span>&gt;</span><br /> <span class="hljs-comment">&lt;!-- The interval to check if it is in-view (due to element/parent visibility change) is now set to check every 5 seconds --&gt;</span><br /><span class="hljs-tag">&lt;/<span class="hljs-name">my-lazy-component</span>&gt;</span></code></pre>
49
+
50
+ <h2 id="jsRef">JavaScript Reference</h2>
51
+
52
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
53
+ <h6>Extends <a href="./component.html">Component</a></h6>
54
+ <h5>
55
+ <code>new LazyComponent()</code><br />
56
+ <code>new LazyComponent(<i>Object</i> shadowOptions)</code>
57
+ </h5>
58
+ <p>This class <b class="tc-danger">cannot</b> be instantiated directly, but rather <b class="tc-success">should be</b> extended, optionally passing in the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow#options" target="_blank">shadowOptions</a>.</p>
59
+
60
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
61
+ <ul>
62
+ <li><a href="./component.html">Component</a></li>
63
+ <li><a href="../utils/element.js">isInView Utility Function</a></li>
64
+ <li><a href="../utils/raf.js">raf Utility Function</a></li>
65
+ </ul>
66
+
67
+ <h3 id="attributes"><a href="#attributes" class="no-link">Attributes</a></h3>
68
+ <h5><code>unrender<i>: boolean</i></code></h5>
69
+ <p>If set to <code>true</code>, the component will unrender its content when it goes out of view.</p>
70
+
71
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
72
+ <h5><code>async renderSkelton()<i>: Promise</i></code></h5>
73
+ <p>Renders the skeleton template of the component. This is called when the component is not yet visible in the viewport or when it goes out of view and <code>unrender</code> is set to <code>true</code>.</p>
74
+
75
+ <h5><code>async inViewCallback()<i>: Promise</i></code></h5>
76
+ <p>Callback method that is called when the component becomes visible in the viewport. By default, it calls the <code>render</code> method.</p>
77
+
78
+ <h5><code>async outOfViewCallback()<i>: Promise</i></code></h5>
79
+ <p>Callback method that is called when the component goes out of view. If <code>unrender</code> is set to <code>true</code>, it calls the <code>renderSkelton</code> method.</p>
80
+
81
+ </main>
82
+ <script type="module" src="../src/components/Import.js"></script>
83
+ </body>
84
+ </html>
@@ -0,0 +1,69 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>ReactiveComponent - Components - Kempo Docs - A Web Components Solution</title>
7
+ <link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
8
+ <link rel="stylesheet" href="../src/kempo-hljs.css" />`n <link rel="stylesheet" href="../styles.css" />
9
+ <script type="module">
10
+ import Import from '../src/components/Import.js';
11
+ import Icon from '../src/components/Icon.js';
12
+ Import.replacements.root = '../';
13
+ Icon.pathToIcons = ['../icons'];
14
+ </script>
15
+ </head>
16
+ <body>
17
+ <k-import src="../nav.inc.html"></k-import>
18
+ <h1 class="ta-center">ReactiveComponent</h1>
19
+ <main>
20
+ <details class="b r mb">
21
+ <summary class="p">Table of Contents</summary>
22
+ <div class="m mt0 pl">
23
+ <h6>Examples</h6>
24
+ <a href="#basicUsage">Basic Usage</a><br />
25
+
26
+ <h6 class="mt">JavaScript Reference</h6>
27
+ <a href="#constructor">Constructor</a><br />
28
+ <a href="#requirements">Requirements</a><br />
29
+ <a href="#attributes">Attributes</a><br />
30
+ <a href="#properties">Properties</a><br />
31
+ <a href="#methods">Methods</a><br />
32
+ </div>
33
+ </details>
34
+
35
+ <h3>Description</h3>
36
+ <p>The <code>ReactiveComponent</code> class extends the <a href="./component.html">Component</a> class and provides additional functionality to automatically re-render the component when specified attributes change.</p>
37
+
38
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
39
+ <p>Extend the <code>ReactiveComponent</code> class to create a component that automatically re-renders when specified attributes change.</p>
40
+ <pre><code class="hljs javascript"><span class="hljs-keyword">import</span> ReactiveComponent <span class="hljs-keyword">from</span> <span class="hljs-string">'kempo'</span>;<br /><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyReactiveComponent</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">ReactiveComponent</span> </span>{<br /> <span class="hljs-keyword">constructor</span>(){<br /> <span class="hljs-keyword">super</span>();<br /> <span class="hljs-comment">// Your Constructor</span><br /> }<br /> <span class="hljs-keyword">static</span> get renderOnChange(){<br /> <span class="hljs-keyword">return</span> [<span class="hljs-string">'my-attr'</span>];<br /> }<br /> <span class="hljs-keyword">async</span> render(force){<br /> <span class="hljs-keyword">if</span>(<span class="hljs-keyword">await</span> <span class="hljs-keyword">super</span>.render(force)){<br /> <span class="hljs-comment">// Your render logic</span><br /> <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;<br /> }<br /> <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;<br /> }<br />}<br /><span class="hljs-built_in">window</span>.customElements.define(<span class="hljs-string">'my-reactive-component'</span>, MyReactiveComponent);</code></pre>
41
+
42
+ <h2 id="jsRef">JavaScript Reference</h2>
43
+
44
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
45
+ <h6>Extends <a href="./component.html">Component</a></h6>
46
+ <h5>
47
+ <code>new ReactiveComponent()</code>
48
+ </h5>
49
+
50
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
51
+ <ul>
52
+ <li><a href="./component.html">Component</a></li>
53
+ </ul>
54
+
55
+ <h3 id="attributes"><a href="#attributes" class="no-link">Attributes</a></h3>
56
+ <p>The <code>ReactiveComponent</code> class does not introduce any new attributes beyond those provided by the <a href="./component.html">Component</a> class.</p>
57
+
58
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
59
+ <h5><code>attributeChangedCallback(n, oV, nV)<i>: void</i></code></h5>
60
+ <p>Overrides the <code>attributeChangedCallback</code> method to automatically re-render the component when specified attributes change.</p>
61
+
62
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
63
+ <h5><code>static renderOnChange<i>: Array</i></code></h5>
64
+ <p>An array of attribute names that should trigger a re-render when they change. This property should be overridden in your component class.</p>
65
+
66
+ </main>
67
+ <script type="module" src="../src/components/Import.js"></script>
68
+ </body>
69
+ </html>
@@ -0,0 +1,69 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>ReactiveLazyComponent - Components - Kempo Docs - A Web Components Solution</title>
7
+ <link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
8
+ <link rel="stylesheet" href="../src/kempo-hljs.css" />`n <link rel="stylesheet" href="../styles.css" />
9
+ <script type="module">
10
+ import Import from '../src/components/Import.js';
11
+ import Icon from '../src/components/Icon.js';
12
+ Import.replacements.root = '../';
13
+ Icon.pathToIcons = ['../icons'];
14
+ </script>
15
+ </head>
16
+ <body>
17
+ <k-import src="../nav.inc.html"></k-import>
18
+ <h1 class="ta-center">ReactiveLazyComponent</h1>
19
+ <main>
20
+ <details class="b r mb">
21
+ <summary class="p">Table of Contents</summary>
22
+ <div class="m mt0 pl">
23
+ <h6>Examples</h6>
24
+ <a href="#basicUsage">Basic Usage</a><br />
25
+
26
+ <h6 class="mt">JavaScript Reference</h6>
27
+ <a href="#constructor">Constructor</a><br />
28
+ <a href="#requirements">Requirements</a><br />
29
+ <a href="#attributes">Attributes</a><br />
30
+ <a href="#properties">Properties</a><br />
31
+ <a href="#methods">Methods</a><br />
32
+ </div>
33
+ </details>
34
+
35
+ <h3>Description</h3>
36
+ <p>The <code>ReactiveLazyComponent</code> class extends the <a href="./lazy-component.html">LazyComponent</a> class and provides additional functionality to automatically re-render the component when specified attributes change.</p>
37
+
38
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
39
+ <p>Extend the <code>ReactiveLazyComponent</code> class to create a component that automatically re-renders when specified attributes change and only renders its content when it becomes visible in the viewport.</p>
40
+ <pre><code class="hljs javascript"><span class="hljs-keyword">import</span> ReactiveLazyComponent <span class="hljs-keyword">from</span> <span class="hljs-string">'kempo'</span>;<br /><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyReactiveLazyComponent</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">ReactiveLazyComponent</span> </span>{<br /> <span class="hljs-keyword">constructor</span>(){<br /> <span class="hljs-keyword">super</span>();<br /> <span class="hljs-comment">// Your Constructor</span><br /> }<br /> <span class="hljs-keyword">static</span> get renderOnChange(){<br /> <span class="hljs-keyword">return</span> [<span class="hljs-string">'my-attr'</span>];<br /> }<br /> <span class="hljs-keyword">async</span> render(force){<br /> <span class="hljs-keyword">if</span>(<span class="hljs-keyword">await</span> <span class="hljs-keyword">super</span>.render(force)){<br /> <span class="hljs-comment">// Your render logic</span><br /> <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;<br /> }<br /> <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;<br /> }<br />}<br /><span class="hljs-built_in">window</span>.customElements.define(<span class="hljs-string">'my-reactive-lazy-component'</span>, MyReactiveLazyComponent);</code></pre>
41
+
42
+ <h2 id="jsRef">JavaScript Reference</h2>
43
+
44
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
45
+ <h6>Extends <a href="./lazy-component.html">LazyComponent</a></h6>
46
+ <h5>
47
+ <code>new ReactiveLazyComponent()</code>
48
+ </h5>
49
+
50
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
51
+ <ul>
52
+ <li><a href="./lazy-component.html">LazyComponent</a></li>
53
+ </ul>
54
+
55
+ <h3 id="attributes"><a href="#attributes" class="no-link">Attributes</a></h3>
56
+ <p>The <code>ReactiveLazyComponent</code> class does not introduce any new attributes beyond those provided by the <a href="./lazy-component.html">LazyComponent</a> class.</p>
57
+
58
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
59
+ <h5><code>attributeChangedCallback(n, oV, nV)<i>: void</i></code></h5>
60
+ <p>Overrides the <code>attributeChangedCallback</code> method to automatically re-render the component when specified attributes change.</p>
61
+
62
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
63
+ <h5><code>static renderOnChange<i>: Array</i></code></h5>
64
+ <p>An array of attribute names that should trigger a re-render when they change. This property should be overridden in your component class.</p>
65
+
66
+ </main>
67
+ <script type="module" src="../src/components/Import.js"></script>
68
+ </body>
69
+ </html>
@@ -0,0 +1,152 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Resize - Components - Kempo Docs - A Web Components Solution</title>
7
+ <link rel="stylesheet" href="../src/kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
8
+ <link rel="stylesheet" href="../src/kempo-hljs.css" />`n <link rel="stylesheet" href="../styles.css" />
9
+ <script type="module">
10
+ import Import from '../src/components/Import.js';
11
+ import Icon from '../src/components/Icon.js';
12
+ Import.replacements.root = '../';
13
+ Icon.pathToIcons = ['../icons'];
14
+ </script>
15
+ </head>
16
+ <body>
17
+ <k-import src="../nav.inc.html"></k-import>
18
+ <h1 class="ta-center">Resize</h1>
19
+ <main>
20
+ <details class="b r mb">
21
+ <summary class="p">Table of Contents</summary>
22
+ <div class="m mt0 pl">
23
+ <h6>Examples</h6>
24
+ <a href="#basicUsage">Basic Usage</a><br />
25
+ <a href="#resizeDimention">Resize Dimension</a><br />
26
+
27
+ <h6 class="mt">JavaScript Reference</h6>
28
+ <a href="#constructor">Constructor</a><br />
29
+ <a href="#requirements">Requirements</a><br />
30
+ <a href="#attributes">Attributes</a><br />
31
+ <a href="#properties">Properties</a><br />
32
+ <a href="#methods">Methods</a><br />
33
+ </div>
34
+ </details>
35
+
36
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
37
+ <p>Set the initial height and width using normal styles.</p>
38
+ <div class="row -mx mb">
39
+ <div class="col d-span-6 m-span-12 px">
40
+ <k-card label="HTML">
41
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-resize</span><br /> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 200px; width: 200px;"</span><br />&gt;</span><br /> Resize Me<br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-resize</span>&gt;</span></code></pre>
42
+ </k-card>
43
+ </div>
44
+ <div class="col d-span-6 m-span-12 px">
45
+ <k-card label="Output*" class="pb">
46
+ <k-resize
47
+ style="height: 200px; width: 200px;"
48
+ >
49
+ <p class="p">
50
+ Resize Me
51
+ </p>
52
+ </k-resize>
53
+ </k-card>
54
+ </div>
55
+ </div>
56
+ <p>Set the minimum and maximum height and width using normal styles. The default min-height and min-width is <code>10rem</code> and the default max-height and max-width is <code>100%</code>.</p>
57
+ <div class="row -mx mb">
58
+ <div class="col d-span-6 m-span-12 px">
59
+ <k-card label="HTML">
60
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-resize</span><br /> <span class="hljs-attr">style</span>=<span class="hljs-string">"min-height: 100px; height: 200px; max-height: 300px; min-width: 100px; width: 200px; max-width: 300px;"</span><br />&gt;</span><br /> Resize Me<br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-resize</span>&gt;</span></code></pre>
61
+ </k-card>
62
+ </div>
63
+ <div class="col d-span-6 m-span-12 px">
64
+ <k-card label="Output*" class="pb">
65
+ <k-resize
66
+ style="min-height: 100px; height: 200px; max-height: 300px; min-width: 100px; width: 200px; max-width: 300px;"
67
+ >
68
+ <p class="p">
69
+ Resize Me
70
+ </p>
71
+ </k-resize>
72
+ </k-card>
73
+ </div>
74
+ </div>
75
+
76
+ <h3 id="resizeDimention"><a href="#resizeDimention" class="no-link">Resize Dimension</a></h3>
77
+ <div class="row -mx mb">
78
+ <div class="col d-span-6 m-span-12 px">
79
+ <k-card label="HTML">
80
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-resize</span><br /> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 200px; width: 200px;"</span><br /> <span class="hljs-attr">dimention</span>=<span class="hljs-string">"width"</span><br />&gt;</span><br /> Resize Width<br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-resize</span>&gt;</span></code></pre>
81
+ </k-card>
82
+ </div>
83
+ <div class="col d-span-6 m-span-12 px">
84
+ <k-card label="Output*" class="pb">
85
+ <k-resize
86
+ style="height: 200px; width: 200px;"
87
+ dimention="width"
88
+ >
89
+ <p class="p">
90
+ Resize Width
91
+ </p>
92
+ </k-resize>
93
+ </k-card>
94
+ </div>
95
+ </div>
96
+ <div class="row -mx mb">
97
+ <div class="col d-span-6 m-span-12 px">
98
+ <k-card label="HTML">
99
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-resize</span><br /> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 200px; width: 200px;"</span><br /> <span class="hljs-attr">dimention</span>=<span class="hljs-string">"height"</span><br />&gt;</span><br /> Resize Height<br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-resize</span>&gt;</span></code></pre>
100
+ </k-card>
101
+ </div>
102
+ <div class="col d-span-6 m-span-12 px">
103
+ <k-card label="Output*" class="pb">
104
+ <k-resize
105
+ style="height: 200px; width: 200px;"
106
+ dimention="height"
107
+ >
108
+ <p class="p">
109
+ Resize Height
110
+ </p>
111
+ </k-resize>
112
+ </k-card>
113
+ </div>
114
+ </div>
115
+
116
+
117
+ <h3>* Notes</h3>
118
+ <p><i>Additional styles may be added to the example output (borders, spacing, colors) for demonstration.</i></p>
119
+
120
+ <h2 id="jsRef">JavaScript Reference</h2>
121
+
122
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
123
+ <h6>Extends <a href="./component.html">Component</a></h6>
124
+ <h5>
125
+ <code>new Resize()</code>
126
+ </h5>
127
+
128
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
129
+ <ul>
130
+ <li><a href="./component.html">Component</a></li>
131
+ </ul>
132
+
133
+ <h3 id="attributes"><a href="#attributes" class="no-link">Attributes</a></h3>
134
+ <h5><code>resizing<i>: string</i></code></h5>
135
+ <p>Indicates which handle is currently being used to resize the element.</p>
136
+ <h5><code>dimention<i>: string</i></code></h5>
137
+ <p>Specifies which dimension to resize. Can be <code>"width"</code> or <code>"height"</code>.</p>
138
+
139
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
140
+ <h5><code>resizing<i>: string</i></code></h5>
141
+ <p>Indicates which handle is currently being used to resize the element.</p>
142
+
143
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
144
+ <h5><code>render(force)<i>: Promise</i></code></h5>
145
+ <p>Renders the component. If <code>force</code> is <code>true</code>, the component will be re-rendered even if it has already been rendered.</p>
146
+
147
+ </main>
148
+ <div style="height:33vh"></div>
149
+ <script type="module" src="../src/components/Import.js"></script>
150
+ <script type="module" src="../src/components/Resize.js"></script>
151
+ </body>
152
+ </html>
@@ -0,0 +1,102 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Search - Components - Kempo Docs - A Web Components Solution</title>
7
+ <link rel="stylesheet" href="../src/kempo-vars.css" />
8
+ <link rel="stylesheet" href="../kempo.min.css" />
9
+ <link rel="stylesheet" href="../src/kempo-hljs.css" />`n <link rel="stylesheet" href="../styles.css" />
10
+ <script type="module">
11
+ import Import from '../src/components/Import.js';
12
+ import Icon from '../src/components/Icon.js';
13
+ Import.replacements.root = '../';
14
+ Icon.pathToIcons = ['../icons'];
15
+ </script>
16
+ </head>
17
+ <body>
18
+ <k-import src="../nav.inc.html"></k-import>
19
+ <h1 class="ta-center">Search</h1>
20
+ <main>
21
+ <details class="b r mb">
22
+ <summary class="p">Table of Contents</summary>
23
+ <div class="m mt0 pl">
24
+ <h6>Examples</h6>
25
+ <a href="#basicUsage">Basic Usage</a><br />
26
+ <a href="#updateSearchDataUrl">Update searchDataUrl</a><br />
27
+
28
+ <h6 class="mt">JavaScript Reference</h6>
29
+ <a href="#constructor">Constructor</a><br />
30
+ <a href="#requirements">Requirements</a><br />
31
+ <a href="#attributes">Attributes</a><br />
32
+ <a href="#properties">Properties</a><br />
33
+ <a href="#methods">Methods</a><br />
34
+ <a href="#staticMembers">Static Members</a><br />
35
+ </div>
36
+ </details>
37
+
38
+ <h3>Description</h3>
39
+ <p>The <code>Search</code> component provides a search input field with debounced input handling and search result display.</p>
40
+
41
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
42
+ <pre><code class="html">&lt;k-search&gt;&lt;/k-search&gt;</code></pre>
43
+ <k-search class="mb"></k-search>
44
+
45
+ <br>
46
+ <h3 id="updateSearchDataUrl"><a href="#updateSearchDataUrl" class="no-link">Update searchDataUrl</a></h3>
47
+ <p>You can update the URL from which the search data is fetched by setting the <code>searchDataUrl</code> static member. This should be done in the head of your document before any search components are instatiated.</p>
48
+ <pre><code class="javascript">import Search from '../src/components/Search.js';<br/>Search.searchDataUrl = '/custom-search.json';</code></pre>
49
+
50
+ <br>
51
+ <h2 id="jsRef">JavaScript Reference</h2>
52
+
53
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
54
+ <h6>Extends <a href="./component.html">Component</a></h6>
55
+ <h5>
56
+ <code>new Search()</code>
57
+ </h5>
58
+
59
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
60
+ <ul>
61
+ <li><a href="../utils/debounce.html">debounce</a></li>
62
+ </ul>
63
+
64
+ <h3 id="attributes"><a href="#attributes" class="no-link">Attributes</a></h3>
65
+ <h5><code>opened: boolean</code></h5>
66
+ <p>Indicates whether the search results are visible.</p>
67
+
68
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
69
+ <h5><code>pages: object</code></h5>
70
+ <p>Contains the search data loaded from <code>/search.json</code>.</p>
71
+
72
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
73
+ <h5><code>render(force: boolean): Promise&lt;boolean&gt;</code></h5>
74
+ <p>Renders the component and attaches event listeners to the input field.</p>
75
+
76
+ <h5><code>search(term: string): void</code></h5>
77
+ <p>Performs the search operation and updates the search results.</p>
78
+
79
+ <h3 id="staticMembers"><a href="#staticMembers" class="no-link">Static Members</a></h3>
80
+ <h5><code>Search.searchDataUrl: string</code></h5>
81
+ <p>The URL from which the search data is fetched. Default is <code>/search.json</code>.</p>
82
+
83
+ <h3 id="searchDataFormat"><a href="#searchDataFormat" class="no-link">Search Data Format</a></h3>
84
+ <p>The search data file should be a JSON object where each key is a URL path and the value is an object with the following properties:</p>
85
+ <ul>
86
+ <li><code>name</code>: The name of the page.</li>
87
+ <li><code>terms</code>: An array of terms associated with the page.</li>
88
+ </ul>
89
+ <pre><code class="json">{
90
+ "/components/accordion.html": {
91
+ "name": "Components > Accordion",
92
+ "terms": ["accordion", "collapsible", "toggle", "content", "panel", "header"]
93
+ },
94
+ "/components/component.html": {
95
+ "name": "Components > Component",
96
+ "terms": ["component", "base", "root", "framework", "parent"]
97
+ }
98
+ }</code></pre>
99
+ </main>
100
+ <script type="module" src="../src/components/Import.js"></script>
101
+ </body>
102
+ </html>