kempo-ui 0.3.4 → 0.3.6

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 (143) hide show
  1. package/AGENTS.md +2 -1
  2. package/dist/components/Aside.js +2 -0
  3. package/docs/components/accordion.html +240 -8
  4. package/docs/components/aside-items.html +13 -9
  5. package/docs/components/aside-menu.html +13 -9
  6. package/docs/components/aside-push.html +11 -6
  7. package/docs/components/aside.html +239 -8
  8. package/docs/components/card.html +238 -7
  9. package/docs/components/color-picker.html +245 -14
  10. package/docs/components/content-slider.html +240 -8
  11. package/docs/components/context.html +241 -7
  12. package/docs/components/dialog.html +238 -7
  13. package/docs/components/dropdown.html +238 -7
  14. package/docs/components/filter-list.html +239 -10
  15. package/docs/components/focus-capture.html +241 -10
  16. package/docs/components/html-editor.html +266 -35
  17. package/docs/components/hybrid-component.html +238 -6
  18. package/docs/components/icon.html +239 -9
  19. package/docs/components/import.html +239 -8
  20. package/docs/components/light-component.html +239 -7
  21. package/docs/components/nav.html +240 -8
  22. package/docs/components/photo-viewer.html +239 -9
  23. package/docs/components/resize.html +240 -9
  24. package/docs/components/shadow-component.html +239 -7
  25. package/docs/components/show-more.html +237 -8
  26. package/docs/components/sortable.html +239 -8
  27. package/docs/components/spinner.html +237 -6
  28. package/docs/components/split.html +241 -10
  29. package/docs/components/table.html +241 -11
  30. package/docs/components/tableControls.html +240 -7
  31. package/docs/components/tableCustomFields.html +241 -8
  32. package/docs/components/tableFetchRecords.html +239 -7
  33. package/docs/components/tableFieldSortHide.html +239 -7
  34. package/docs/components/tablePagination.html +246 -13
  35. package/docs/components/tablePlaceholder.html +241 -8
  36. package/docs/components/tableRecordEditing.html +241 -8
  37. package/docs/components/tableRecordFiltering.html +239 -7
  38. package/docs/components/tableRecordHiding.html +241 -9
  39. package/docs/components/tableRecordSearching.html +239 -7
  40. package/docs/components/tableRecordSelection.html +240 -7
  41. package/docs/components/tableRowControls.html +241 -8
  42. package/docs/components/tableServerSync.html +245 -11
  43. package/docs/components/tableSorting.html +239 -7
  44. package/docs/components/tabs.html +240 -7
  45. package/docs/components/tags.html +239 -7
  46. package/docs/components/theme-select.html +239 -7
  47. package/docs/components/theme-switcher.html +240 -8
  48. package/docs/components/timestamp.html +239 -8
  49. package/docs/components/toast.html +240 -8
  50. package/docs/components/toggle.html +240 -9
  51. package/docs/components/tree.html +239 -8
  52. package/docs/index.html +244 -6
  53. package/docs/prod.config.json +0 -4
  54. package/docs/src/components/Aside.js +2 -0
  55. package/docs/utils/context.html +237 -6
  56. package/docs/utils/cookie.html +251 -21
  57. package/docs/utils/debounce.html +236 -5
  58. package/docs/utils/drag.html +236 -5
  59. package/docs/utils/elevation.html +238 -6
  60. package/docs/utils/formatTimestamp.html +233 -3
  61. package/docs/utils/object.html +236 -5
  62. package/docs/utils/propConverters.html +233 -3
  63. package/docs/utils/string.html +236 -5
  64. package/docs/utils/theme.html +237 -6
  65. package/docs/utils/toTitleCase.html +233 -3
  66. package/docs/utils/type.html +236 -5
  67. package/docs/utils/wait.html +236 -5
  68. package/docs-src/.config.js +16 -0
  69. package/docs-src/bare.template.html +16 -0
  70. package/docs-src/components/accordion.page.html +201 -0
  71. package/docs-src/components/aside-items.page.html +36 -0
  72. package/docs-src/components/aside-menu.page.html +36 -0
  73. package/docs-src/components/aside-push.page.html +20 -0
  74. package/docs-src/components/aside.page.html +551 -0
  75. package/docs-src/components/card.page.html +78 -0
  76. package/docs-src/components/color-picker.page.html +559 -0
  77. package/docs-src/components/content-slider.page.html +266 -0
  78. package/docs-src/components/context.page.html +214 -0
  79. package/docs-src/components/dialog.page.html +365 -0
  80. package/docs-src/components/dropdown.page.html +300 -0
  81. package/docs-src/components/filter-list.page.html +117 -0
  82. package/docs-src/components/focus-capture.page.html +97 -0
  83. package/docs-src/components/html-editor.page.html +423 -0
  84. package/docs-src/components/hybrid-component.page.html +96 -0
  85. package/docs-src/components/icon.page.html +208 -0
  86. package/docs-src/components/import.page.html +76 -0
  87. package/docs-src/components/light-component.page.html +99 -0
  88. package/docs-src/components/nav.page.html +106 -0
  89. package/docs-src/components/photo-viewer.page.html +253 -0
  90. package/docs-src/components/resize.page.html +161 -0
  91. package/docs-src/components/shadow-component.page.html +84 -0
  92. package/docs-src/components/show-more.page.html +113 -0
  93. package/docs-src/components/sortable.page.html +117 -0
  94. package/docs-src/components/spinner.page.html +197 -0
  95. package/docs-src/components/split.page.html +195 -0
  96. package/docs-src/components/table.page.html +283 -0
  97. package/docs-src/components/tableControls.page.html +64 -0
  98. package/docs-src/components/tableCustomFields.page.html +124 -0
  99. package/docs-src/components/tableFetchRecords.page.html +95 -0
  100. package/docs-src/components/tableFieldSortHide.page.html +56 -0
  101. package/docs-src/components/tablePagination.page.html +85 -0
  102. package/docs-src/components/tablePlaceholder.page.html +73 -0
  103. package/docs-src/components/tableRecordEditing.page.html +161 -0
  104. package/docs-src/components/tableRecordFiltering.page.html +69 -0
  105. package/docs-src/components/tableRecordHiding.page.html +65 -0
  106. package/docs-src/components/tableRecordSearching.page.html +56 -0
  107. package/docs-src/components/tableRecordSelection.page.html +60 -0
  108. package/docs-src/components/tableRowControls.page.html +62 -0
  109. package/docs-src/components/tableServerSync.page.html +129 -0
  110. package/docs-src/components/tableSorting.page.html +54 -0
  111. package/docs-src/components/tabs.page.html +201 -0
  112. package/docs-src/components/tags.page.html +157 -0
  113. package/docs-src/components/theme-select.page.html +106 -0
  114. package/docs-src/components/theme-switcher.page.html +122 -0
  115. package/docs-src/components/timestamp.page.html +109 -0
  116. package/docs-src/components/toast.page.html +338 -0
  117. package/docs-src/components/toggle.page.html +177 -0
  118. package/docs-src/components/tree.page.html +356 -0
  119. package/docs-src/default.template.html +28 -0
  120. package/docs-src/index.page.html +312 -0
  121. package/docs-src/nav.fragment.html +228 -0
  122. package/docs-src/utils/context.page.html +143 -0
  123. package/docs-src/utils/cookie.page.html +128 -0
  124. package/docs-src/utils/debounce.page.html +42 -0
  125. package/docs-src/utils/drag.page.html +64 -0
  126. package/docs-src/utils/elevation.page.html +144 -0
  127. package/docs-src/utils/formatTimestamp.page.html +76 -0
  128. package/docs-src/utils/object.page.html +76 -0
  129. package/docs-src/utils/propConverters.page.html +73 -0
  130. package/docs-src/utils/string.page.html +66 -0
  131. package/docs-src/utils/theme.page.html +136 -0
  132. package/docs-src/utils/toTitleCase.page.html +52 -0
  133. package/docs-src/utils/type.page.html +31 -0
  134. package/docs-src/utils/wait.page.html +31 -0
  135. package/package.json +4 -4
  136. package/scripts/build.js +5 -0
  137. package/scripts/docs.js +5 -52
  138. package/src/components/Aside.js +2 -0
  139. package/tests/components/Aside.browser-test.js +35 -0
  140. package/docs/dev.config.json +0 -20
  141. package/docs/nav-1.inc.html +0 -168
  142. package/docs/nav.inc.html +0 -168
  143. package/docs/nav.inc.js +0 -70
@@ -0,0 +1,195 @@
1
+ <page pageName="Split" title="Split - Components - Kempo Docs - A Web Components Solution">
2
+ <content>
3
+ <k-accordion persistent-id="toc" class="b r mb">
4
+ <k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
5
+ <k-accordion-panel name="toc-panel">
6
+ <div class="m ">
7
+ <h6>Examples</h6>
8
+ <a href="#basicUsage">Basic Usage</a><br />
9
+ <a href="#resizing">Resizing</a><br />
10
+ <a href="#verticalSplit">Vertical Split</a><br />
11
+ <a href="#persistentState">Persistent State</a><br />
12
+ <h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
13
+ <a href="#constructor">Constructor</a><br />
14
+ <a href="#requirements">Requirements</a><br />
15
+ <a href="#properties">Properties</a><br />
16
+ <a href="#cssCustomProperties">CSS Custom Properties</a><br />
17
+ <a href="#methods">Methods</a><br />
18
+ <a href="#events">Events</a><br />
19
+ </div>
20
+ </k-accordion-panel>
21
+ </k-accordion>
22
+
23
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
24
+ <p>Create a split view using the <code>k-split</code> component. Add content to the first pane by placing it inside the component, and add content to the second pane by using the <code>slot="right"</code> attribute.</p>
25
+ <div class="row -mx mb">
26
+ <div class="col d-span-6 m-span-12 px">
27
+ <k-card label="HTML">
28
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-split</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 10rem"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"b"</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>Left Pane Content<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"right"</span>&gt;</span>Right Pane Content<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-split</span>&gt;</span></code></pre>
29
+ </k-card>
30
+ </div>
31
+ <div class="col d-span-6 m-span-12 px">
32
+ <k-card label="Results">
33
+ <k-split style="height: 10rem" class="b">
34
+ <div>Left Pane Content</div>
35
+ <div slot="right">Right Pane Content</div>
36
+ </k-split>
37
+ </k-card>
38
+ </div>
39
+ </div>
40
+
41
+ <h3 id="resizing"><a href="#resizing" class="no-link">Resizing</a></h3>
42
+ <p>The split view can be resized by dragging the divider handle. The initial size of the first pane can be set using the <code>--pane_1_size</code> CSS custom property.</p>
43
+ <div class="row -mx mb">
44
+ <div class="col d-span-6 m-span-12 px">
45
+ <k-card label="HTML">
46
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-split</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"--pane_1_size: 30%; height: 10rem"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"b"</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>Left Pane Content<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"right"</span>&gt;</span>Right Pane Content<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-split</span>&gt;</span></code></pre>
47
+ </k-card>
48
+ </div>
49
+ <div class="col d-span-6 m-span-12 px">
50
+ <k-card label="Results">
51
+ <k-split style="--pane_1_size: 30%; height: 10rem" class="b">
52
+ <div>Left Pane Content</div>
53
+ <div slot="right">Right Pane Content</div>
54
+ </k-split>
55
+ </k-card>
56
+ </div>
57
+ </div>
58
+
59
+ <h3>Sizes</h3>
60
+ <p>Set the CSS Custom Property <code>--pane_1_size</code> to set the initial size of the first pane.</p>
61
+ <p>Set the CSS Custom Property <code>--min_pane_size</code> to set the minimum size each pane can be.</p>
62
+ <p>Set the CSS Custom Property <code>--handle_width</code> to set the size of the handle (the draggable region between the panes).</p>
63
+ <div class="row -mx">
64
+ <div class="col m-span-12 px">
65
+ <k-card label="HTML">
66
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-split</span><br /> <span class="hljs-attr">style</span>=<span class="hljs-string">"<br /> --pane_1_size: 100px;<br /> --min_pane_size: 100px;<br /> --handle_width: 20px;<br /> height: 10rem<br /> "</span><br /> <span class="hljs-attr">class</span>=<span class="hljs-string">"b"</span><br />&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>left<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"right"</span>&gt;</span>right<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-split</span>&gt;</span></code></pre>
67
+ </k-card>
68
+ </div>
69
+ <div class="col m-span-12 px">
70
+ <k-card label="Output">
71
+ <k-split
72
+ style="
73
+ --pane_1_size: 100px;
74
+ --min_pane_size: 100px;
75
+ --handle_width: 20px;
76
+ height: 10rem
77
+ "
78
+ class="b"
79
+ >
80
+ <p>left</p>
81
+ <p slot="right">right</p>
82
+ </k-split>
83
+ </k-card>
84
+ </div>
85
+ </div>
86
+
87
+ <h3 id="verticalSplit"><a href="#verticalSplit" class="no-link">Vertical Split</a></h3>
88
+ <p>Use the <code>direction="vertical"</code> attribute to create a vertical split where the top and bottom panes are divided by a horizontal handle. Set an explicit height on the component for predictable sizing. The default slot provides the top pane content; use <code>slot="right"</code> for the bottom pane content.</p>
89
+ <div class="row -mx mb">
90
+ <div class="col d-span-6 m-span-12 px">
91
+ <k-card label="HTML">
92
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-split</span> <span class="hljs-attr">direction</span>=<span class="hljs-string">"vertical"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 16rem"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"b"</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>Top Pane Content<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"right"</span>&gt;</span>Bottom Pane Content<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-split</span>&gt;</span></code></pre>
93
+ </k-card>
94
+ </div>
95
+ <div class="col d-span-6 m-span-12 px">
96
+ <k-card label="Results">
97
+ <k-split direction="vertical" style="height: 16rem" class="b">
98
+ <div>Top Pane Content</div>
99
+ <div slot="right">Bottom Pane Content</div>
100
+ </k-split>
101
+ </k-card>
102
+ </div>
103
+ </div>
104
+
105
+ <h3 id="stacking"><a href="#stacking" class="no-link">Stacking</a></h3>
106
+ <p>When the screen size is small (mobile) a split panel may not make sense, rather than changing the markup set the <code>stack-width</code> attribute to stack the contents (disable split view) when the component's size is less than the provided size.</p>
107
+ <div class="row -mx">
108
+ <div class="col m-span-12 px">
109
+ <k-card label="HTML">
110
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-split</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 10rem"</span> <span class="hljs-attr">stack-width</span>=<span class="hljs-string">"1080"</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>Left Pane Content<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"right"</span>&gt;</span>Right Pane Content<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-split</span>&gt;</span></code></pre>
111
+ </k-card>
112
+ </div>
113
+ <div class="col m-span-12 px">
114
+ <k-card label="Output">
115
+ <k-resize dimension="width">
116
+ <k-split style="height: 10rem" stack-width="300">
117
+ <div>Left Pane Content</div>
118
+ <div slot="right">Right Pane Content</div>
119
+ </k-split>
120
+ </k-resize>
121
+ </k-card>
122
+ </div>
123
+ </div>
124
+
125
+
126
+ <h3 id="persistentState"><a href="#persistentState" class="no-link">Persistent State</a></h3>
127
+ <p>Add the <code>persistent-id</code> attribute to save and restore the pane size across page refreshes using <code>localStorage</code>. Each split that uses persistence must have a unique <code>persistent-id</code> value.</p>
128
+ <div class="row -mx mb">
129
+ <div class="col d-span-6 m-span-12 px">
130
+ <k-card label="HTML">
131
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-split</span> <span class="hljs-attr">persistent-id</span>=<span class="hljs-string">"my-split"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 10rem"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"b"</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>Left Pane Content<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"right"</span>&gt;</span>Right Pane Content<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-split</span>&gt;</span></code></pre>
132
+ </k-card>
133
+ </div>
134
+ <div class="col d-span-6 m-span-12 px">
135
+ <k-card label="Results">
136
+ <k-split persistent-id="docs-split-example" style="height: 10rem" class="b">
137
+ <div>Left Pane Content</div>
138
+ <div slot="right">Right Pane Content</div>
139
+ </k-split>
140
+ </k-card>
141
+ </div>
142
+ </div>
143
+
144
+ <h2 id="jsRef">JavaScript Reference</h2>
145
+
146
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
147
+ <h6>Extends <a href="./shadow-component.html">ShadowComponent</a></h6>
148
+ <h5>
149
+ <code>new Split()</code>
150
+ </h5>
151
+
152
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
153
+ <ul>
154
+ <li><a href="./shadow-component.html">ShadowComponent</a></li>
155
+ </ul>
156
+
157
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
158
+ <h5><code>resizing<i>: boolean</i></code></h5>
159
+ <p>Whether the split view is currently being resized. Syncs to <code>resizing</code> attribute.</p>
160
+ <h5><code>stacked<i>: boolean</i></code></h5>
161
+ <p>Whether the split view is in stacked mode. Syncs to <code>stacked</code> attribute.</p>
162
+ <h5><code>stackWidth<i>: number</i></code></h5>
163
+ <p>The window width threshold for stacking behavior. Syncs to <code>stack-width</code> attribute.</p>
164
+ <h5><code>direction<i>: string</i></code></h5>
165
+ <p>The direction of the split. Can be <code>"horizontal"</code> (default) or <code>"vertical"</code>. Syncs to <code>direction</code> attribute.</p>
166
+ <h5><code>persistentId<i>: string</i></code></h5>
167
+ <p>When set, the pane size is saved to <code>localStorage</code> on resize and restored on initialization. Must be unique per split instance. Syncs to <code>persistent-id</code> attribute.</p>
168
+
169
+ <h3 id="cssCustomProperties"><a href="#cssCustomProperties" class="no-link">CSS Custom Properties</a></h3>
170
+ <h5><code>--pane_1_size</code></h5>
171
+ <p>The size of pane 1 (width in horizontal mode, height in vertical mode). Default is <code>calc((100% - var(--handle_width)) / 2)</code>.</p>
172
+ <h5><code>--handle_width</code></h5>
173
+ <p>The width/height of the draggable divider handle. Default is <code>0.5rem</code>.</p>
174
+ <h5><code>--min_pane_size</code></h5>
175
+ <p>The minimum size each pane can be resized to. Default is <code>6rem</code>.</p>
176
+
177
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
178
+ <h5><code>setSize(size)<i>: void</i></code></h5>
179
+ <p>Sets the size of pane 1 via <code>--pane_1_size</code>. Controls width in horizontal mode and height in vertical mode.</p>
180
+
181
+ <h3 id="events"><a href="#events" class="no-link">Events</a></h3>
182
+ <h5><code>resizestart</code></h5>
183
+ <p>Fired when the user starts dragging the divider handle. Detail contains <code>{ startSize }</code>.</p>
184
+ <h5><code>resize</code></h5>
185
+ <p>Fired during dragging of the divider handle. Detail contains <code>{ size }</code>.</p>
186
+ <h5><code>resizeend</code></h5>
187
+ <p>Fired when the user stops dragging the divider handle. Detail contains <code>{ size }</code>.</p>
188
+ </content>
189
+ <content location="scripts">
190
+ <script type="module" src="{{pathToRoot}}src/components/Card.js"></script>
191
+ <script type="module" src="{{pathToRoot}}src/components/Split.js"></script>
192
+ <script type="module" src="{{pathToRoot}}src/components/Accordion.js"></script>
193
+ <script type="module" src="{{pathToRoot}}src/components/Resize.js"></script>
194
+ </content>
195
+ </page>
@@ -0,0 +1,283 @@
1
+ <page pageName="Table" title="Table - Components - Kempo Docs - A Web Components Solution">
2
+ <content>
3
+ <k-accordion persistent-id="toc" class="b r mb">
4
+ <k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
5
+ <k-accordion-panel name="toc-panel">
6
+ <div class="m ">
7
+ <a href="#basicUsage">Basic Usage</a><br />
8
+ <h6 class="mt">Examples</h6>
9
+ <a href="./tableCustomFields.html">Custom Fields</a><br />
10
+ <a href="./tableControls.html">Top and Bottom Controls</a><br />
11
+ <a href="./tableRowControls.html">Row Controls</a><br />
12
+ <a href="./tablePagination.html">Pagination</a><br />
13
+ <a href="./tableRecordSelection.html">Record Selection</a><br />
14
+ <a href="./tableRecordEditing.html">Record Editing</a><br />
15
+ <a href="./tableRecordHiding.html">Record Hiding</a><br />
16
+ <a href="./tableRecordFiltering.html">Record Filtering</a><br />
17
+ <a href="./tableRecordSearching.html">Record Searching</a><br />
18
+ <a href="./tableSorting.html">Sorting</a><br />
19
+ <a href="./tableFieldSortHide.html">Field Sorting and Hiding</a><br />
20
+ <a href="./tableFetchRecords.html">Fetching Records</a><br />
21
+ <a href="./tableServerSync.html">Server Sync</a><br />
22
+ <a href="./tablePlaceholder.html">Placeholder</a><br />
23
+ <h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
24
+ <a href="#constructor">Constructor</a><br />
25
+ <a href="#requirements">Requirements</a><br />
26
+ <a href="#properties">Properties</a><br />
27
+ <a href="#methods">Methods</a><br />
28
+ </div>
29
+ </k-accordion-panel>
30
+ </k-accordion>
31
+
32
+ <h3>Description</h3>
33
+ <p>The <code>&lt;k-table></code> component is used to render data into a <code>&lt;table></code> using JavaScript.</p>
34
+
35
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
36
+ <p>In HTML create a <code>&lt;k-table></code>, and then in JavaScript call the <code>setData</code> method passing in an options object containing your data.</p>
37
+
38
+ <k-card label="HTML">
39
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-table</span> <span class="hljs-attr">id</span>=<span class="hljs-string">basicUsageExample</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-table</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">module</span>&gt;</span><span class="language-javascript"><br> <span class="hljs-keyword">await</span> <span class="hljs-variable language_">window</span>.<span class="hljs-property">customElements</span>.<span class="hljs-title function_">whenDefined</span>(<span class="hljs-string">&#x27;k-table&#x27;</span>);<br> <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&#x27;basicUsageExample&#x27;</span>).<span class="hljs-title function_">setData</span>({<br> <span class="hljs-attr">records</span>: [{<br> <span class="hljs-attr">name</span>: <span class="hljs-string">&#x27;Dustin&#x27;</span>,<br> <span class="hljs-attr">phoneNumber</span>: <span class="hljs-string">&#x27;(111) 111-1111&#x27;</span>,<br> <span class="hljs-attr">emailAddress</span>: <span class="hljs-string">&#x27;dustin@mailserver.com&#x27;</span>,<br> <span class="hljs-attr">gender</span>: <span class="hljs-string">&#x27;Male&#x27;</span><br> }, {<br> <span class="hljs-attr">name</span>: <span class="hljs-string">&#x27;Kayla&#x27;</span>,<br> <span class="hljs-attr">phoneNumber</span>: <span class="hljs-string">&#x27;(222) 222-2222&#x27;</span>,<br> <span class="hljs-attr">emailAddress</span>: <span class="hljs-string">&#x27;kayla@mailserver.com&#x27;</span>,<br> <span class="hljs-attr">gender</span>: <span class="hljs-string">&#x27;Female&#x27;</span><br> }, {<br> <span class="hljs-attr">name</span>: <span class="hljs-string">&#x27;Alexander&#x27;</span>,<br> <span class="hljs-attr">phoneNumber</span>: <span class="hljs-string">&#x27;(333) 333-33333&#x27;</span>,<br> <span class="hljs-attr">emailAddress</span>: <span class="hljs-string">&#x27;alex@mailserver.com&#x27;</span>,<br> <span class="hljs-attr">gender</span>: <span class="hljs-string">&#x27;Male&#x27;</span><br> }, {<br> <span class="hljs-attr">name</span>: <span class="hljs-string">&#x27;Amelia&#x27;</span>,<br> <span class="hljs-attr">phoneNumber</span>: <span class="hljs-string">&#x27;(444) 444-44444&#x27;</span>,<br> <span class="hljs-attr">emailAddress</span>: <span class="hljs-string">&#x27;amelia@mailserver.com&#x27;</span>,<br> <span class="hljs-attr">gender</span>: <span class="hljs-string">&#x27;Female&#x27;</span><br> }]<br> });<br></span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></pre>
40
+ </k-card>
41
+ <k-card label="Results">
42
+ <k-table id="basicUsageExample"></k-table>
43
+ <script type="module">
44
+ await window.customElements.whenDefined('k-table');
45
+ document.getElementById('basicUsageExample').setData({
46
+ records: [
47
+ {
48
+ name: "Dustin",
49
+ phoneNumber: "(111) 111-1111",
50
+ emailAddress: "dustin@mailserver.com",
51
+ gender: "Male"
52
+ },
53
+ {
54
+ name: "Kayla",
55
+ phoneNumber: "(222) 222-2222",
56
+ emailAddress: "kayla@mailserver.com",
57
+ gender: "Female"
58
+ },
59
+ {
60
+ name: "Alexander",
61
+ phoneNumber: "(333) 333-33333",
62
+ emailAddress: "alex@mailserver.com",
63
+ gender: "Male"
64
+ },
65
+ {
66
+ name: "Amelia",
67
+ phoneNumber: "(444) 444-44444",
68
+ emailAddress: "amelia@mailserver.com",
69
+ gender: "Female"
70
+ },
71
+ ]
72
+ });
73
+ </script>
74
+ </k-card>
75
+
76
+ <h3>Examples</h3>
77
+ <ul>
78
+ <li><a href="./tableCustomFields.html">Custom Fields Example</a></li>
79
+ <li><a href="./tableControls.html">Top and Bottom Controls</a></li>
80
+ <li><a href="./tableRowControls.html">Row Controls</a></li>
81
+ <li><a href="./tablePagination.html">Pagination</a></li>
82
+ <li><a href="./tableRecordSelection.html">Record Selection</a></li>
83
+ <li><a href="./tableRecordEditing.html">Record Editing</a></li>
84
+ <li><a href="./tableRecordHiding.html">Record Hiding</a></li>
85
+ <li><a href="./tableRecordFiltering.html">Record Filtering</a></li>
86
+ <li><a href="./tableRecordSearching.html">Record Searching</a></li>
87
+ <li><a href="./tableSorting.html">Sorting</a></li>
88
+ <li><a href="./tableFieldSortHide.html">Field Sorting and Hiding</a></li>
89
+ <li><a href="./tableFetchRecords.html">Fetching Records</a></li>
90
+ <li><a href="./tableServerSync.html">Server Sync</a></li>
91
+ <li><a href="./tablePlaceholder.html">Placeholder</a></li>
92
+ </ul>
93
+
94
+ <br />
95
+ <hr class="my" />
96
+
97
+ <h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
98
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
99
+ <h6>Extends <a href="./component.html">Component</a></h6>
100
+ <h5>
101
+ <code>new Table()</code><br />
102
+ <code>new Table(<i>&lt;Array>object</i> options)</code>
103
+ </h5>
104
+
105
+ <h4>Parameters</h4>
106
+ <h5><code><i>object</i> options</code></h5>
107
+ <p>An object containing the initial configuration for the table. The options object can contain the following properties:</p>
108
+ <ul>
109
+ <li><code>records</code>: An array of objects representing the records to be shown in the table.</li>
110
+ <li><code>fields</code>: An array of objects representing the fields of the table, each object must contain a <code>name</code> and a <code>label</code>. If this property is omitted, the fields will be automatically generated from the first 100 records.</li>
111
+ <li><code>controls</code>: An object containing optional arrays of controls to be displayed before and/or after each row. Each control is defined by an icon name, a callback function, and optionally an HTML string or a render function. The <code>controls</code> object can contain the optional <code>before</code> and <code>after</code> properties, which are arrays of objects containing the <code>icon</code> (string), <code>action</code> (function), <code>html</code> (string), and <code>render</code> (function). If <code>html</code> is present, it overrides the icon and is rendered in its place. If <code>render</code> is present, it is used to render the control.</li>
112
+ <li><code>pageSize</code>: The number of records to display per page.</li>
113
+ <li><code>pageSizeOptions</code>: An array of numbers representing the available page size options.</li>
114
+ </ul>
115
+
116
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
117
+ <ul>
118
+ <li><a href="{{pathToRoot}}utils/string.html"><code>toTitleCase</code> <i>from string.js</i></a></li>
119
+ </ul>
120
+
121
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
122
+ <h5><code>fields<i>: &lt;Array>object</i></code></h5>
123
+ <p>An array of objects that represent the fields to be displayed. Each field object supports the following properties:</p>
124
+ <ul>
125
+ <li><code>name</code> <i>(string, required)</i>: The key in the record object to display.</li>
126
+ <li><code>label</code> <i>(string)</i>: The column header label. Defaults to <code>toTitleCase(name)</code>.</li>
127
+ <li><code>size</code> <i>(number)</i>: The column width in pixels.</li>
128
+ <li><code>hidden</code> <i>(boolean)</i>: Hides the column when <code>true</code>.</li>
129
+ <li><code>editable</code> <i>(boolean)</i>: Set to <code>false</code> to make the field read-only during record editing. Defaults to <code>true</code>.</li>
130
+ <li><code>type</code> <i>(string)</i>: The editor type to use (<code>"string"</code>, <code>"number"</code>, <code>"date"</code>, <code>"boolean"</code>). Inferred from the value if omitted.</li>
131
+ <li><code>formatter</code> <i>(function)</i>: A function <code>(value) => displayString</code> that formats the display value.</li>
132
+ <li><code>calculator</code> <i>(function)</i>: A function <code>(record, table) => value</code> that computes a derived value. Calculated fields are always read-only.</li>
133
+ <li><code>editor</code> <i>(function)</i>: A custom editor generator function <code>(value) => HTMLInputElement</code> for per-field editing.</li>
134
+ </ul>
135
+
136
+ <h5><code>records<i>: &lt;Array>object</i></code></h5>
137
+ <p>An array of objects containing the data that will be the records of the table, where the object keys match the field names.</p>
138
+
139
+ <h5><code>controls<i>: object</i></code></h5>
140
+ <p>An object containing optional arrays of controls to be displayed before and/or after each row, or above and below the table. Each control is defined by an icon name, a callback function, and optionally an HTML string or a render function. The <code>controls</code> object can contain the optional <code>before</code>, <code>after</code>, <code>top</code>, and <code>bottom</code> properties, which are arrays of objects containing the <code>icon</code> (string), <code>action</code> (function), <code>html</code> (string), and <code>render</code> (function). If <code>html</code> is present, it overrides the icon and is rendered in its place. If <code>render</code> is present, it is used to render the control. Controls in the <code>before</code> or <code>after</code> arrays receive the record and index as the 2nd and 3rd parameters in the action function and the renderer function.</p>
141
+
142
+ <h5><code>pageSize<i>: number</i></code></h5>
143
+ <p>The number of records to display per page.</p>
144
+
145
+ <h5><code>pageSizeOptions<i>: &lt;Array>number</i></code></h5>
146
+ <p>An array of numbers representing the available page size options.</p>
147
+
148
+ <h5><code>placeholder<i>: string</i></code></h5>
149
+ <p>Text shown when the table has no records. Defaults to <code>"No Records"</code>. Set to an empty string to suppress. See <a href="./tablePlaceholder.html">Placeholder</a>.</p>
150
+
151
+ <h5><code>filtered-placeholder<i>: string</i></code></h5>
152
+ <p>Text shown when records exist but all are currently filtered or hidden. Defaults to <code>""</code> (no row shown). See <a href="./tablePlaceholder.html">Placeholder</a>.</p>
153
+
154
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
155
+
156
+ <h5><code>setData(<i>object</i> options)<i>: undefined</i></code></h5>
157
+ <p>Sets the records and the fields and renders the table. If no fields are provided, they will be automatically generated from the keys of the first 100 records. The options object can contain the following properties:</p>
158
+ <ul>
159
+ <li><code>records</code>: An array of objects representing the records to be shown in the table.</li>
160
+ <li><code>fields</code>: An array of objects representing the fields of the table, each object must contain a <code>name</code> and a <code>label</code>. If this property is omitted, the fields will be automatically generated from the first 100 records.</li>
161
+ <li><code>filters</code>: An array of filter objects to apply to the records.</li>
162
+ <li><code>pageSize</code>: The number of records to display per page.</li>
163
+ <li><code>pageSizeOptions</code>: An array of numbers representing the available page size options.</li>
164
+ <li><code>currentPage</code>: The current page to display.</li>
165
+ <li><code>enableSelection</code>: A boolean to enable or disable record selection.</li>
166
+ <li><code>enablePages</code>: A boolean to enable or disable pagination.</li>
167
+ </ul>
168
+
169
+ <h5><code>renderFields()<i>: undefined</i></code></h5>
170
+ <p>Renders the fields as table headers. This is called automatically by setData, you should never have to call it.</p>
171
+
172
+ <h5><code>renderRecords()<i>: undefined</i></code></h5>
173
+ <p>Renders the records as table rows. This is called automatically by setData, you should never have to call it.</p>
174
+
175
+ <h5><code>addRecord(<i>object</i> record)<i>: undefined</i></code></h5>
176
+ <p>Adds a new record to the table.</p>
177
+
178
+ <h5><code>updateRecord(<i>object</i> record, <i>object</i> newData)<i>: undefined</i></code></h5>
179
+ <p>Updates an existing record with new data.</p>
180
+
181
+ <h5><code>deleteRecord(<i>object</i> record)<i>: undefined</i></code></h5>
182
+ <p>Deletes a record from the table.</p>
183
+
184
+ <h5><code>setRecords(<i>Array</i> records)<i>: undefined</i></code></h5>
185
+ <p>Sets the records for the table and re-renders the rows.</p>
186
+
187
+ <h5><code>setPageSize(<i>number</i> pageSize)<i>: undefined</i></code></h5>
188
+ <p>Sets the number of records to display per page.</p>
189
+
190
+ <h5><code>setPage(<i>number</i> page)<i>: undefined</i></code></h5>
191
+ <p>Sets the current page to display.</p>
192
+
193
+ <h5><code>nextPage()<i>: undefined</i></code></h5>
194
+ <p>Moves to the next page.</p>
195
+
196
+ <h5><code>prevPage()<i>: undefined</i></code></h5>
197
+ <p>Moves to the previous page.</p>
198
+
199
+ <h5><code>getCurrentPage()<i>: number</i></code></h5>
200
+ <p>Returns the current page number.</p>
201
+
202
+ <h5><code>getTotalPages()<i>: number</i></code></h5>
203
+ <p>Returns the total number of pages.</p>
204
+
205
+ <h5><code>getSelectedRecords()<i>: Array</i></code></h5>
206
+ <p>Returns an array of the currently selected records.</p>
207
+
208
+ <h5><code>deleteSelected()<i>: undefined</i></code></h5>
209
+ <p>Deletes all currently selected records from the table.</p>
210
+
211
+ <h5><code>selectAllOnPage()<i>: undefined</i></code></h5>
212
+ <p>Selects all the records on the current page.</p>
213
+
214
+ <h5><code>deselectAllOnPage()<i>: undefined</i></code></h5>
215
+ <p>Deselects all the records on the current page.</p>
216
+
217
+ <h5><code>allOnPageSelected()<i>: boolean</i></code></h5>
218
+ <p>Returns <code>true</code> if all the records on the current page are selected, and <code>false</code> if they are not.</p>
219
+
220
+ <h5><code>editRecord(<i>object</i> record)<i>: undefined</i></code></h5>
221
+ <p>Enables editing mode for a record.</p>
222
+
223
+ <h5><code>saveEditedRecord(<i>object</i> record)<i>: undefined</i></code></h5>
224
+ <p>Saves the changes made to an edited record.</p>
225
+
226
+ <h5><code>cancelEditedRecord(<i>object</i> record)<i>: undefined</i></code></h5>
227
+ <p>Cancels the editing mode for a record.</p>
228
+
229
+ <h5><code>recordIsEditing(<i>object</i> record)<i>: boolean</i></code></h5>
230
+ <p>Returns <code>true</code> if the record is in editing mode, and <code>false</code> if it is not.</p>
231
+
232
+ <h5><code>hideRecord(<i>object</i> record)<i>: undefined</i></code></h5>
233
+ <p>Hides a record from the table.</p>
234
+
235
+ <h5><code>showRecord(<i>object</i> record)<i>: undefined</i></code></h5>
236
+ <p>Shows a hidden record in the table.</p>
237
+
238
+ <h5><code>showAllRecords()<i>: undefined</i></code></h5>
239
+ <p>Shows all hidden records in the table.</p>
240
+
241
+ <h5><code>addFilter(<i>string</i> field, <i>string</i> condition, <i>any</i> value)<i>: undefined</i></code></h5>
242
+ <p>Adds a filter to the table.</p>
243
+
244
+ <h5><code>removeFilter(<i>string</i> field, <i>string</i> condition, <i>any</i> value)<i>: undefined</i></code></h5>
245
+ <p>Removes a filter from the table.</p>
246
+
247
+ <h5><code>removeAllFilters()<i>: undefined</i></code></h5>
248
+ <p>Removes all filters from the table.</p>
249
+
250
+ <h5><code>search(<i>string</i> term)<i>: undefined</i></code></h5>
251
+ <p>Searches the records for the specified term.</p>
252
+
253
+ <h5><code>getDisplayedRecords()<i>: Array</i></code></h5>
254
+ <p>Returns an array of the records currently displayed in the table.</p>
255
+
256
+ <h5><code>getHiddenRecords()<i>: Array</i></code></h5>
257
+ <p>Returns an array of the hidden records in the table.</p>
258
+
259
+ <h5><code>setupFetchRecords(<i>number</i> totalRecords, <i>function</i> callback)<i>: undefined</i></code></h5>
260
+ <p>Sets up the table to fetch records dynamically.</p>
261
+
262
+ <h5><code>sortBy(<i>string</i> field, <i>boolean</i> asc)<i>: undefined</i></code></h5>
263
+ <p>Sorts the records by the specified field in ascending or descending order.</p>
264
+
265
+ <h5><code>setFieldHiddenState(<i>string</i> fieldName, <i>boolean</i> hidden)<i>: undefined</i></code></h5>
266
+ <p>Sets the hidden state of a field.</p>
267
+
268
+ <h5><code>hideField(<i>string</i> fieldName)<i>: undefined</i></code></h5>
269
+ <p>Hides a field in the table.</p>
270
+
271
+ <h5><code>showField(<i>string</i> fieldName)<i>: undefined</i></code></h5>
272
+ <p>Shows a hidden field in the table.</p>
273
+
274
+ <h5><code>reorderFields(<i>Array</i> newOrder)<i>: undefined</i></code></h5>
275
+ <p>Reorders the fields in the table based on the new order array.</p>
276
+ </content>
277
+ <content location="scripts">
278
+ <script type="module" src="{{pathToRoot}}src/components/Table.js"></script>
279
+ <script type="module" src="{{pathToRoot}}src/components/Accordion.js"></script>
280
+ <script type="module" src="{{pathToRoot}}src/components/Card.js"></script>
281
+ <script type="module" src="{{pathToRoot}}src/components/Resize.js"></script>
282
+ </content>
283
+ </page>
@@ -0,0 +1,64 @@
1
+ <page pageName="Table - Top and Bottom Controls" title="Top and Bottom Controls - Table - Kempo Docs">
2
+ <content location="head">
3
+ <script>
4
+ window.contacts = [];
5
+ function generateContact(){
6
+ const maleNames = [
7
+ "Liam", "Noah", "Oliver", "Elijah", "William", "James", "Benjamin",
8
+ "Lucas", "Henry", "Alexander", "Mason", "Michael", "Ethan", "Daniel",
9
+ "Jacob", "Logan", "Jackson", "Levi", "Sebastian", "Mateo", "Jack",
10
+ "Owen", "Theodore", "Aiden", "Samuel", "Joseph", "John", "David",
11
+ "Wyatt", "Matthew"
12
+ ];
13
+ const femaleNames = [
14
+ "Olivia", "Emma", "Ava", "Sophia", "Isabella", "Mia", "Amelia",
15
+ "Harper", "Evelyn", "Abigail", "Emily", "Ella", "Elizabeth",
16
+ "Camila", "Luna", "Sofia", "Avery", "Mila", "Aria", "Scarlett",
17
+ "Penelope", "Layla", "Chloe", "Victoria", "Madison", "Eleanor",
18
+ "Grace", "Nora", "Riley", "Zoey"
19
+ ];
20
+ const lastNames = [
21
+ "Smith", "Johnson", "Williams", "Brown", "Jones", "Garcia", "Miller",
22
+ "Davis", "Rodriguez", "Martinez", "Hernandez", "Lopez", "Gonzalez",
23
+ "Wilson", "Anderson", "Thomas", "Taylor", "Moore", "Jackson", "Martin",
24
+ "Lee", "Perez", "Thompson", "White", "Harris", "Sanchez", "Clark",
25
+ "Ramirez", "Lewis", "Robinson"
26
+ ];
27
+ const gender = Math.random() > 0.5 ? 'm' : 'f';
28
+ const firstName = gender === 'm' ? maleNames[Math.floor(Math.random() * maleNames.length)] : femaleNames[Math.floor(Math.random() * femaleNames.length)];
29
+ const lastName = lastNames[Math.floor(Math.random() * lastNames.length)];
30
+ const name = `${firstName} ${lastName}`;
31
+ const email = `${firstName.toLowerCase()}.${lastName.toLowerCase()}@mailserver.com`;
32
+ const birthday = `${Math.floor(Math.random() * 100) + 1920}-${String(Math.floor(Math.random() * 12) + 1).padStart(2, '0')}-${String(Math.floor(Math.random() * 28) + 1).padStart(2, '0')}`;
33
+ const phoneNumber = `(${Math.floor(Math.random() * 900) + 100}) ${Math.floor(Math.random() * 900) + 100}-${Math.floor(Math.random() * 9000) + 1000}`;
34
+ return { name, email, birthday, phoneNumber, gender };
35
+ }
36
+ for (let i = 0; i < 10; i++) {
37
+ contacts.push(generateContact());
38
+ };
39
+ </script>
40
+ </content>
41
+ <content>
42
+
43
+ <a href="./table.html"><h5>Back to Table Component Documentation</h5></a>
44
+
45
+ <p>The table component supports controls at both the top and bottom. These controls can handle pagination, adding new records, or other actions. They are web components that interact with their parent <code>k-table</code> by accessing its methods and listening for its events.</p>
46
+ <p>Controls without a slot will be placed at the bottom of the table by default, to place a control on the top of the table give it a <code>slot="top"</code>.</p>
47
+
48
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-table</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"topBottomControlsExample"</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">k-tc-export-json</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"top"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-tc-export-json</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">k-tc-export-csv</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-tc-export-csv</span>&gt;</span><br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-table</span>&gt;</span><br /><span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/src/components/tableControls/ExportJson.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span><br /><span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/src/components/tableControls/ExportCsv.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span><br /><span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>&gt;</span><span class="javascript"><br /> <span class="hljs-keyword">await</span> <span class="hljs-built_in">window</span>.customElements.whenDefined(<span class="hljs-string">'k-table'</span>);<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'topBottomControlsExample'</span>).setRecords(contacts);<br /></span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></pre>
49
+
50
+ <k-table id="topBottomControlsExample">
51
+ <k-tc-export-json slot="top"></k-tc-export-json>
52
+ <k-tc-export-csv></k-tc-export-csv>
53
+ </k-table>
54
+ <script type="module" src="{{pathToRoot}}src/components/tableControls/ExportJson.js"></script>
55
+ <script type="module" src="{{pathToRoot}}src/components/tableControls/ExportCsv.js"></script>
56
+ <script type="module">
57
+ await window.customElements.whenDefined('k-table');
58
+ document.getElementById('topBottomControlsExample').setRecords(contacts);
59
+ </script>
60
+ </content>
61
+ <content location="scripts">
62
+ <script type="module" src="{{pathToRoot}}src/components/Table.js"></script>
63
+ </content>
64
+ </page>