kempo-ui 0.4.1 → 0.4.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 (84) hide show
  1. package/dist/components/Calendar.js +170 -0
  2. package/dist/components/Slider.js +188 -0
  3. package/dist/components/Time.js +37 -0
  4. package/docs/components/accordion.html +12 -0
  5. package/docs/components/aside.html +12 -0
  6. package/docs/components/calendar.html +712 -0
  7. package/docs/components/card.html +12 -0
  8. package/docs/components/code-editor.html +12 -0
  9. package/docs/components/color-picker.html +12 -0
  10. package/docs/components/combobox.html +12 -0
  11. package/docs/components/content-slider.html +12 -0
  12. package/docs/components/context.html +12 -0
  13. package/docs/components/dialog.html +12 -0
  14. package/docs/components/dropdown.html +12 -0
  15. package/docs/components/filter-list.html +12 -0
  16. package/docs/components/focus-capture.html +12 -0
  17. package/docs/components/html-editor.html +12 -0
  18. package/docs/components/hybrid-component.html +12 -0
  19. package/docs/components/icon.html +12 -0
  20. package/docs/components/import.html +12 -0
  21. package/docs/components/light-component.html +12 -0
  22. package/docs/components/nav-spacer.html +12 -0
  23. package/docs/components/nav.html +12 -0
  24. package/docs/components/photo-viewer.html +12 -0
  25. package/docs/components/progress.html +12 -0
  26. package/docs/components/resize.html +12 -0
  27. package/docs/components/shadow-component.html +12 -0
  28. package/docs/components/show-more.html +12 -0
  29. package/docs/components/slider.html +789 -0
  30. package/docs/components/sortable.html +12 -0
  31. package/docs/components/spinner.html +12 -0
  32. package/docs/components/split.html +12 -0
  33. package/docs/components/table.html +12 -0
  34. package/docs/components/tableControls.html +12 -0
  35. package/docs/components/tableCustomFields.html +12 -0
  36. package/docs/components/tableFetchRecords.html +12 -0
  37. package/docs/components/tableFieldSortHide.html +12 -0
  38. package/docs/components/tablePagination.html +12 -0
  39. package/docs/components/tablePlaceholder.html +12 -0
  40. package/docs/components/tableRecordEditing.html +12 -0
  41. package/docs/components/tableRecordFiltering.html +12 -0
  42. package/docs/components/tableRecordHiding.html +12 -0
  43. package/docs/components/tableRecordSearching.html +12 -0
  44. package/docs/components/tableRecordSelection.html +12 -0
  45. package/docs/components/tableRowControls.html +12 -0
  46. package/docs/components/tableServerSync.html +12 -0
  47. package/docs/components/tableSorting.html +12 -0
  48. package/docs/components/tabs.html +12 -0
  49. package/docs/components/tags.html +12 -0
  50. package/docs/components/theme-select.html +12 -0
  51. package/docs/components/theme-switcher.html +12 -0
  52. package/docs/components/time.html +662 -0
  53. package/docs/components/timestamp.html +12 -0
  54. package/docs/components/toast.html +12 -0
  55. package/docs/components/toggle.html +12 -0
  56. package/docs/components/tree.html +12 -0
  57. package/docs/index.html +30 -0
  58. package/docs/src/components/Calendar.js +170 -0
  59. package/docs/src/components/Slider.js +188 -0
  60. package/docs/src/components/Time.js +37 -0
  61. package/docs/utils/context.html +12 -0
  62. package/docs/utils/cookie.html +12 -0
  63. package/docs/utils/debounce.html +12 -0
  64. package/docs/utils/drag.html +12 -0
  65. package/docs/utils/elevation.html +12 -0
  66. package/docs/utils/formatTimestamp.html +12 -0
  67. package/docs/utils/object.html +12 -0
  68. package/docs/utils/propConverters.html +12 -0
  69. package/docs/utils/string.html +12 -0
  70. package/docs/utils/theme.html +12 -0
  71. package/docs/utils/toTitleCase.html +12 -0
  72. package/docs/utils/type.html +12 -0
  73. package/docs/utils/wait.html +12 -0
  74. package/docs-src/components/calendar.page.html +254 -0
  75. package/docs-src/components/slider.page.html +331 -0
  76. package/docs-src/components/time.page.html +204 -0
  77. package/docs-src/index.page.html +18 -0
  78. package/docs-src/nav.fragment.html +12 -0
  79. package/llms.txt +3 -0
  80. package/package.json +1 -1
  81. package/src/components/Calendar.js +473 -0
  82. package/src/components/Slider.js +480 -0
  83. package/src/components/Time.js +137 -0
  84. package/tests/components/Slider.browser-test.js +823 -0
@@ -0,0 +1,331 @@
1
+ <page pageName="Slider" title="Slider - 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 pl">
7
+ <h6>Examples</h6>
8
+ <a href="#basicUsage">Basic Usage</a><br />
9
+ <a href="#withSteps">With Steps</a><br />
10
+ <a href="#rangeSlider">Range Slider</a><br />
11
+ <a href="#vertical">Vertical</a><br />
12
+ <a href="#verticalRange">Vertical Range</a><br />
13
+ <a href="#customStyles">Custom Styles</a><br />
14
+ <a href="#formatTooltip">Format Tooltip</a><br />
15
+ <a href="#javascriptUsage">JavaScript Usage</a><br />
16
+ <a href="#formUsage">Form Usage</a><br />
17
+ <a href="#disabled">Disabled</a><br />
18
+
19
+ <h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
20
+ <a href="#constructor">Constructor</a><br />
21
+ <a href="#requirements">Requirements</a><br />
22
+ <a href="#properties">Properties</a><br />
23
+ <a href="#methods">Methods</a><br />
24
+ <a href="#cssVariables">CSS Variables</a><br />
25
+ <a href="#events">Events</a><br />
26
+ </div>
27
+ </k-accordion-panel>
28
+ </k-accordion>
29
+
30
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
31
+ <p>A continuous slider from 0 to 100.</p>
32
+ <div class="row -mx">
33
+ <div class="col m-span-12 px">
34
+ <k-card label="HTML">
35
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;25&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span></code></pre>
36
+ </k-card>
37
+ </div>
38
+ <div class="col m-span-12 px">
39
+ <k-card label="Output">
40
+ <k-slider value="25" class="my"></k-slider>
41
+ </k-card>
42
+ </div>
43
+ </div>
44
+
45
+ <h3 id="withSteps"><a href="#withSteps" class="no-link">With Steps</a></h3>
46
+ <p>Use the <code>steps</code> attribute to define specific snap points. The slider will only stop on those values.</p>
47
+ <div class="row -mx">
48
+ <div class="col m-span-12 px">
49
+ <k-card label="HTML">
50
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">min</span>=<span class="hljs-string">&quot;0&quot;</span> <span class="hljs-attr">max</span>=<span class="hljs-string">&quot;100&quot;</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;50&quot;</span> <span class="hljs-attr">steps</span>=<span class="hljs-string">&quot;0,25,50,75,100&quot;</span>&gt;</span>Volume<span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span></code></pre>
51
+ </k-card>
52
+ </div>
53
+ <div class="col m-span-12 px">
54
+ <k-card label="Output">
55
+ <k-slider min="0" max="100" value="50" steps="0,25,50,75,100" class="my">Volume</k-slider>
56
+ </k-card>
57
+ </div>
58
+ </div>
59
+
60
+ <h3 id="rangeSlider"><a href="#rangeSlider" class="no-link">Range Slider</a></h3>
61
+ <p>Pass two comma-separated numbers as the <code>value</code> to create a range slider with two handles. The first number is the lower bound and the second is the upper bound. The handles cannot cross each other.</p>
62
+ <div class="row -mx">
63
+ <div class="col m-span-12 px">
64
+ <k-card label="HTML">
65
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;20,80&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span></code></pre>
66
+ </k-card>
67
+ </div>
68
+ <div class="col m-span-12 px">
69
+ <k-card label="Output">
70
+ <k-slider value="20,80" class="my"></k-slider>
71
+ </k-card>
72
+ </div>
73
+ </div>
74
+
75
+ <h4>Range with Steps</h4>
76
+ <div class="row -mx">
77
+ <div class="col m-span-12 px">
78
+ <k-card label="HTML">
79
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;25,75&quot;</span> <span class="hljs-attr">steps</span>=<span class="hljs-string">&quot;0,25,50,75,100&quot;</span>&gt;</span>Price Range<span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span></code></pre>
80
+ </k-card>
81
+ </div>
82
+ <div class="col m-span-12 px">
83
+ <k-card label="Output">
84
+ <k-slider value="25,75" steps="0,25,50,75,100" class="my">Price Range</k-slider>
85
+ </k-card>
86
+ </div>
87
+ </div>
88
+
89
+ <h3 id="vertical"><a href="#vertical" class="no-link">Vertical</a></h3>
90
+ <p>Add the <code>vertical</code> attribute to render the slider vertically. Set a height on the element or its container.</p>
91
+ <div class="row -mx">
92
+ <div class="col m-span-12 px">
93
+ <k-card label="HTML">
94
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">vertical</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;40&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span></code></pre>
95
+ </k-card>
96
+ </div>
97
+ <div class="col m-span-12 px">
98
+ <k-card label="Output">
99
+ <k-slider vertical value="40"></k-slider>
100
+ </k-card>
101
+ </div>
102
+ </div>
103
+
104
+ <h3 id="verticalRange"><a href="#verticalRange" class="no-link">Vertical Range</a></h3>
105
+ <p>Combine <code>vertical</code> with a comma-separated <code>value</code> for a vertical range slider.</p>
106
+ <div class="row -mx">
107
+ <div class="col m-span-12 px">
108
+ <k-card label="HTML">
109
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">vertical</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;20,80&quot;</span> <span class="hljs-attr">steps</span>=<span class="hljs-string">&quot;0,20,40,60,80,100&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span></code></pre>
110
+ </k-card>
111
+ </div>
112
+ <div class="col m-span-12 px">
113
+ <k-card label="Output">
114
+ <k-slider vertical value="20,80"></k-slider>
115
+ </k-card>
116
+ </div>
117
+ </div>
118
+
119
+ <h3 id="customStyles"><a href="#customStyles" class="no-link">Custom Styles</a></h3>
120
+ <div class="row -mx">
121
+ <div class="col m-span-12 px">
122
+ <k-card label="HTML">
123
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;50&quot;</span> <span class="hljs-attr">style</span>=<span class="hljs-string">&quot;<br> --track_height: 10px;<br> --fill_background: var(--c_success);<br> --thumb_size: 28px;<br> --thumb_background: var(--c_success);<br> --step_dot_size: 12px;<br> &quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span></code></pre>
124
+ </k-card>
125
+ </div>
126
+ <div class="col m-span-12 px">
127
+ <k-card label="Output">
128
+ <k-slider
129
+ value="50"
130
+ style="
131
+ --track_height: 10px;
132
+ --fill_background: var(--c_success);
133
+ --thumb_size: 28px;
134
+ --thumb_background: var(--c_success);
135
+ --step_dot_size: 12px;
136
+ "
137
+ ></k-slider>
138
+ </k-card>
139
+ </div>
140
+ </div>
141
+
142
+ <h3 id="formatTooltip"><a href="#formatTooltip" class="no-link">Format Tooltip</a></h3>
143
+ <p>Add the <code>tooltip</code> attribute to show a value tooltip above the handle while dragging. Use the <code>format</code> attribute to control how the value is displayed in the tooltip, change event, and form submission. The pattern <code>0.00</code> in the format string is replaced with the numeric value at the matching decimal precision.</p>
144
+ <div class="row -mx">
145
+ <div class="col m-span-12 px">
146
+ <k-card label="HTML">
147
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;25&quot;</span> <span class="hljs-attr">min</span>=<span class="hljs-string">&quot;0&quot;</span> <span class="hljs-attr">max</span>=<span class="hljs-string">&quot;100&quot;</span> <span class="hljs-attr">format</span>=<span class="hljs-string">&quot;$0.00&quot;</span> <span class="hljs-attr">tooltip</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span></code></pre>
148
+ </k-card>
149
+ </div>
150
+ <div class="col m-span-12 px">
151
+ <k-card label="Output">
152
+ <k-slider value="25" min="0" max="100" format="$0.00" tooltip class="my"></k-slider>
153
+ </k-card>
154
+ </div>
155
+ </div>
156
+
157
+ <h3 id="javascriptUsage"><a href="#javascriptUsage" class="no-link">JavaScript Usage</a></h3>
158
+ <h4>Single Value</h4>
159
+ <div class="row -mx">
160
+ <div class="col m-span-12 px">
161
+ <k-card label="HTML">
162
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;jsSlider&quot;</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;0&quot;</span> <span class="hljs-attr">format</span>=<span class="hljs-string">&quot;0&quot;</span> <span class="hljs-attr">tooltip</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Value: <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;sliderVal&quot;</span>&gt;</span>0<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="language-javascript"><br> <span class="hljs-keyword">const</span> $jsSlider = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&#x27;jsSlider&#x27;</span>);<br> <span class="hljs-keyword">const</span> $sliderVal = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&#x27;sliderVal&#x27;</span>);<br> $jsSlider.<span class="hljs-title function_">addEventListener</span>(<span class="hljs-string">&#x27;change&#x27;</span>, <span class="hljs-function">(<span class="hljs-params">e</span>) =&gt;</span> {<br> $sliderVal.<span class="hljs-property">textContent</span> = e.<span class="hljs-property">detail</span>.<span class="hljs-property">value</span>;<br> });<br></span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></pre>
163
+ </k-card>
164
+ </div>
165
+ <div class="col m-span-12 px">
166
+ <k-card label="Output">
167
+ <k-slider id="jsSlider" value="0" format="0" tooltip class="my"></k-slider>
168
+ <p>Value: <span id="sliderVal">0</span></p>
169
+ <script>
170
+ const $jsSlider = document.getElementById('jsSlider');
171
+ const $sliderVal = document.getElementById('sliderVal');
172
+ $jsSlider.addEventListener('change', (e) => {
173
+ $sliderVal.textContent = e.detail.value;
174
+ });
175
+ </script>
176
+ </k-card>
177
+ </div>
178
+ </div>
179
+
180
+ <h4>Range</h4>
181
+ <div class="row -mx">
182
+ <div class="col m-span-12 px">
183
+ <k-card label="HTML">
184
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;jsRangeSlider&quot;</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;10,90&quot;</span> <span class="hljs-attr">format</span>=<span class="hljs-string">&quot;0&quot;</span> <span class="hljs-attr">tooltip</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Range: <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;rangeDisplay&quot;</span>&gt;</span>10 - 90<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="language-javascript"><br> <span class="hljs-keyword">const</span> $rs = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&#x27;jsRangeSlider&#x27;</span>);<br> <span class="hljs-keyword">const</span> $rd = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&#x27;rangeDisplay&#x27;</span>);<br> $rs.<span class="hljs-title function_">addEventListener</span>(<span class="hljs-string">&#x27;change&#x27;</span>, <span class="hljs-function">(<span class="hljs-params">e</span>) =&gt;</span> {<br> <span class="hljs-keyword">const</span> [lo, hi] = e.<span class="hljs-property">detail</span>.<span class="hljs-property">value</span>.<span class="hljs-title function_">split</span>(<span class="hljs-string">&#x27;,&#x27;</span>);<br> $rd.<span class="hljs-property">textContent</span> = lo + <span class="hljs-string">&#x27; - &#x27;</span> + hi;<br> });<br></span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></pre>
185
+ </k-card>
186
+ </div>
187
+ <div class="col m-span-12 px">
188
+ <k-card label="Output">
189
+ <k-slider id="jsRangeSlider" class="my" value="10,90" format="0" tooltip></k-slider>
190
+ <p>Range: <span id="rangeDisplay">10 - 90</span></p>
191
+ <script>
192
+ const $rs = document.getElementById('jsRangeSlider');
193
+ const $rd = document.getElementById('rangeDisplay');
194
+ $rs.addEventListener('change', (e) => {
195
+ const [lo, hi] = e.detail.value.split(',');
196
+ $rd.textContent = lo + ' - ' + hi;
197
+ });
198
+ </script>
199
+ </k-card>
200
+ </div>
201
+ </div>
202
+
203
+ <h3 id="formUsage"><a href="#formUsage" class="no-link">Form Usage</a></h3>
204
+ <p>The slider is form-associated. Set a <code>name</code> attribute so it participates in form submission. When a <code>format</code> is set, the submitted value is the formatted string.</p>
205
+ <div class="row -mx">
206
+ <div class="col m-span-12 px">
207
+ <k-card label="HTML">
208
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">form</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;sliderForm&quot;</span>&gt;</span><br> <span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;volume&quot;</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;75&quot;</span> <span class="hljs-attr">format</span>=<span class="hljs-string">&quot;0%&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span><br> <span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;priceRange&quot;</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;20,80&quot;</span> <span class="hljs-attr">format</span>=<span class="hljs-string">&quot;$0&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span><br> <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;submit&quot;</span>&gt;</span>Submit<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Form Data: <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;formOutput&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="language-javascript"><br> <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&#x27;sliderForm&#x27;</span>).<span class="hljs-title function_">addEventListener</span>(<span class="hljs-string">&#x27;submit&#x27;</span>, <span class="hljs-function">(<span class="hljs-params">e</span>) =&gt;</span> {<br> e.<span class="hljs-title function_">preventDefault</span>();<br> <span class="hljs-keyword">const</span> fd = <span class="hljs-keyword">new</span> <span class="hljs-title class_">FormData</span>(e.<span class="hljs-property">target</span>);<br> <span class="hljs-keyword">const</span> entries = [...fd.<span class="hljs-title function_">entries</span>()].<span class="hljs-title function_">map</span>(<span class="hljs-function">(<span class="hljs-params">[k, v]</span>) =&gt;</span> k + <span class="hljs-string">&#x27;=&#x27;</span> + v);<br> <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&#x27;formOutput&#x27;</span>).<span class="hljs-property">textContent</span> = entries.<span class="hljs-title function_">join</span>(<span class="hljs-string">&#x27;, &#x27;</span>);<br> });<br></span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></pre>
209
+ </k-card>
210
+ </div>
211
+ <div class="col m-span-12 px">
212
+ <k-card label="Output">
213
+ <form id="sliderForm">
214
+ <k-slider name="volume" value="75" format="0%" class="my"></k-slider>
215
+ <k-slider name="priceRange" value="20,80" format="$0" class="my"></k-slider>
216
+ <button type="submit">Submit</button>
217
+ </form>
218
+ <p>Form Data: <span id="formOutput"></span></p>
219
+ <script>
220
+ document.getElementById('sliderForm').addEventListener('submit', (e) => {
221
+ e.preventDefault();
222
+ const fd = new FormData(e.target);
223
+ const entries = [...fd.entries()].map(([k, v]) => k + '=' + v);
224
+ document.getElementById('formOutput').textContent = entries.join(', ');
225
+ });
226
+ </script>
227
+ </k-card>
228
+ </div>
229
+ </div>
230
+
231
+ <h3 id="disabled"><a href="#disabled" class="no-link">Disabled</a></h3>
232
+ <p>The <code>disabled</code> attribute prevents user interaction while displaying the current value.</p>
233
+ <div class="row -mx">
234
+ <div class="col m-span-12 px">
235
+ <k-card label="HTML">
236
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-slider</span> <span class="hljs-attr">disabled</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;40&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-slider</span>&gt;</span></code></pre>
237
+ </k-card>
238
+ </div>
239
+ <div class="col m-span-12 px">
240
+ <k-card label="Output">
241
+ <k-slider disabled class="my" value="40"></k-slider>
242
+ </k-card>
243
+ </div>
244
+ </div>
245
+
246
+ <h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
247
+
248
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
249
+ <h6>Extends <a href="./shadow-component.html">ShadowComponent</a></h6>
250
+ <h5><code>new Slider()</code></h5>
251
+
252
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
253
+ <ul>
254
+ <li><a href="./shadow-component.html">ShadowComponent</a></li>
255
+ </ul>
256
+
257
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
258
+ <h5><code>value<i>: String</i></code></h5>
259
+ <p>The current value. A single number (e.g. <code>"50"</code>) for a standard slider, or two comma-separated numbers (e.g. <code>"20,80"</code>) for a range slider. Default is <code>"0"</code>. Syncs to <code>value</code> attribute.</p>
260
+
261
+ <h5><code>name<i>: String</i></code></h5>
262
+ <p>The form field name. When set inside a <code>&lt;form&gt;</code>, the slider participates in form submission. Syncs to <code>name</code> attribute.</p>
263
+
264
+ <h5><code>min<i>: Number</i></code></h5>
265
+ <p>The minimum value of the slider range. Default is <code>0</code>. Syncs to <code>min</code> attribute.</p>
266
+
267
+ <h5><code>max<i>: Number</i></code></h5>
268
+ <p>The maximum value of the slider range. Default is <code>100</code>. Syncs to <code>max</code> attribute.</p>
269
+
270
+ <h5><code>steps<i>: String</i></code></h5>
271
+ <p>A comma-separated list of specific values the slider can snap to (e.g. <code>"0,25,50,75,100"</code>). When set, the slider only stops on these values. When not set, the slider is continuous. Syncs to <code>steps</code> attribute.</p>
272
+
273
+ <h5><code>format<i>: String</i></code></h5>
274
+ <p>A pattern string for formatting the slider value. Applied to the tooltip display, the <code>change</code> event <code>detail.value</code>, and the form submission value. Use <code>0</code>s as digit placeholders — the number of <code>0</code>s after the decimal separator controls precision. For example <code>"$0.00"</code> formats <code>25</code> as <code>"$25.00"</code>. Default is <code>null</code> (raw number). Syncs to <code>format</code> attribute.</p>
275
+
276
+ <h5><code>tooltip<i>: Boolean</i></code></h5>
277
+ <p>When <code>true</code>, a tooltip showing the current value appears above the thumb handle during drag. Default is <code>false</code>. Syncs to <code>tooltip</code> attribute.</p>
278
+
279
+ <h5><code>vertical<i>: Boolean</i></code></h5>
280
+ <p>When <code>true</code>, the slider renders vertically. Set a height on the element to control the track length. Default is <code>false</code>. Syncs to <code>vertical</code> attribute.</p>
281
+
282
+ <h5><code>disabled<i>: Boolean</i></code></h5>
283
+ <p>When <code>true</code>, the slider cannot be changed by user interaction. The element appears at 50% opacity. Syncs to <code>disabled</code> attribute.</p>
284
+
285
+ <h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
286
+ <h5><code>setValue(newValue)<i>: void</i></code></h5>
287
+ <p>Sets the lower value, clamped to min/max and snapped to the nearest step. In range mode, it cannot exceed the upper value.</p>
288
+
289
+ <h5><code>setUpper(newValue)<i>: void</i></code></h5>
290
+ <p>Sets the upper value (range mode only), clamped to min/max and snapped to the nearest step. Cannot go below the lower value.</p>
291
+
292
+ <h5><code>isRange<i>: Boolean</i></code> (getter)</h5>
293
+ <p>Returns <code>true</code> when the <code>value</code> contains a comma (i.e. two handles are active).</p>
294
+
295
+ <h5><code>formattedValue<i>: String</i></code> (getter)</h5>
296
+ <p>Returns the value formatted with the <code>format</code> pattern. For range sliders, both halves are formatted (e.g. <code>"$20.00,$80.00"</code>). Returns the raw <code>value</code> when no format is set.</p>
297
+
298
+ <h5><code>lower<i>: Number</i></code> (getter)</h5>
299
+ <p>The numeric lower bound parsed from <code>value</code>.</p>
300
+
301
+ <h5><code>upper<i>: Number</i></code> (getter)</h5>
302
+ <p>The numeric upper bound parsed from <code>value</code>. Equals <code>max</code> when not in range mode.</p>
303
+
304
+ <h3 id="cssVariables"><a href="#cssVariables" class="no-link">CSS Variables</a></h3>
305
+ <table class="b">
306
+ <thead><tr><th>Variable</th><th>Default</th><th>Description</th></tr></thead>
307
+ <tbody>
308
+ <tr><td><code>--track_height</code></td><td><code>6px</code></td><td>Thickness of the track (height when horizontal, width when vertical)</td></tr>
309
+ <tr><td><code>--track_background</code></td><td><code>var(--c_border)</code></td><td>Background color of the track</td></tr>
310
+ <tr><td><code>--track_radius</code></td><td><code>99999px</code></td><td>Border radius of the track</td></tr>
311
+ <tr><td><code>--fill_background</code></td><td><code>var(--c_primary)</code></td><td>Color of the filled portion</td></tr>
312
+ <tr><td><code>--thumb_size</code></td><td><code>20px</code></td><td>Diameter of the thumb handle(s)</td></tr>
313
+ <tr><td><code>--thumb_background</code></td><td><code>var(--c_primary)</code></td><td>Background color of the thumb(s)</td></tr>
314
+ <tr><td><code>--thumb_border</code></td><td><code>2px solid white</code></td><td>Border of the thumb(s)</td></tr>
315
+ <tr><td><code>--thumb_shadow</code></td><td><code>0 1px 3px rgba(0,0,0,.3)</code></td><td>Box shadow of the thumb(s)</td></tr>
316
+ <tr><td><code>--step_dot_size</code></td><td><code>8px</code></td><td>Diameter of step indicator dots</td></tr>
317
+ <tr><td><code>--step_dot_background</code></td><td><code>var(--c_bg__alt)</code></td><td>Background of step dots</td></tr>
318
+ <tr><td><code>--step_dot_border</code></td><td><code>1px solid var(--c_border)</code></td><td>Border of step dots</td></tr>
319
+ </tbody>
320
+ </table>
321
+
322
+ <h3 id="events"><a href="#events" class="no-link">Events</a></h3>
323
+ <h5><code>change</code></h5>
324
+ <p>Fired when the value changes. The event <code>detail</code> contains <code>{ value: String }</code>. When a <code>format</code> is set, the value is formatted (e.g. <code>"$50.00"</code> or <code>"$20.00,$80.00"</code>). Without a format, the raw number string is used (e.g. <code>"50"</code> or <code>"20,80"</code>).</p>
325
+ </content>
326
+ <content location="scripts">
327
+ <script type="module" src="{{pathToRoot}}src/components/Slider.js"></script>
328
+ <script type="module" src="{{pathToRoot}}src/components/Accordion.js"></script>
329
+ <script type="module" src="{{pathToRoot}}src/components/Card.js"></script>
330
+ </content>
331
+ </page>
@@ -0,0 +1,204 @@
1
+ <page pageName="Time" title="Time - 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 pl">
7
+ <h6>Examples</h6>
8
+ <a href="#basicUsage">Basic Usage</a><br />
9
+ <a href="#defaultValue">Default Value</a><br />
10
+ <a href="#increment">Minute Increment</a><br />
11
+ <a href="#military">24-Hour Time</a><br />
12
+ <a href="#javascriptUsage">JavaScript Usage</a><br />
13
+ <a href="#formUsage">Form Usage</a><br />
14
+ <a href="#disabled">Disabled</a><br />
15
+
16
+ <h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
17
+ <a href="#constructor">Constructor</a><br />
18
+ <a href="#requirements">Requirements</a><br />
19
+ <a href="#properties">Properties</a><br />
20
+ <a href="#events">Events</a><br />
21
+ </div>
22
+ </k-accordion-panel>
23
+ </k-accordion>
24
+
25
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
26
+ <p>Wraps the browser's native <code>&lt;input type="time"&gt;</code> so the user can click or tab between the hour, minute, and AM/PM segments and type numbers to change each one. The <code>value</code> is always a 24-hour <code>HH:MM</code> string regardless of the locale-dependent display format.</p>
27
+ <div class="row -mx">
28
+ <div class="col m-span-12 px">
29
+ <k-card label="HTML">
30
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-time</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-time</span>&gt;</span></code></pre>
31
+ </k-card>
32
+ </div>
33
+ <div class="col m-span-12 px">
34
+ <k-card label="Output">
35
+ <k-time></k-time>
36
+ </k-card>
37
+ </div>
38
+ </div>
39
+
40
+ <h3 id="defaultValue"><a href="#defaultValue" class="no-link">Default Value</a></h3>
41
+ <p>Set an initial value with the <code>value</code> attribute using 24-hour <code>HH:MM</code> format.</p>
42
+ <div class="row -mx">
43
+ <div class="col m-span-12 px">
44
+ <k-card label="HTML">
45
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-time</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;14:30&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-time</span>&gt;</span></code></pre>
46
+ </k-card>
47
+ </div>
48
+ <div class="col m-span-12 px">
49
+ <k-card label="Output">
50
+ <k-time value="14:30"></k-time>
51
+ </k-card>
52
+ </div>
53
+ </div>
54
+
55
+ <h3 id="increment"><a href="#increment" class="no-link">Minute Increment</a></h3>
56
+ <p>The <code>increment</code> attribute controls the minute step when the user presses the up/down arrow keys on the minute segment. Defaults to <code>1</code>.</p>
57
+ <div class="row -mx">
58
+ <div class="col 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-time</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;09:15&quot;</span> <span class="hljs-attr">increment</span>=<span class="hljs-string">&quot;15&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-time</span>&gt;</span></code></pre>
61
+ </k-card>
62
+ </div>
63
+ <div class="col m-span-12 px">
64
+ <k-card label="Output">
65
+ <k-time value="09:15" increment="15"></k-time>
66
+ </k-card>
67
+ </div>
68
+ </div>
69
+
70
+ <h4>Half-Hour Increment</h4>
71
+ <div class="row -mx">
72
+ <div class="col m-span-12 px">
73
+ <k-card label="HTML">
74
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-time</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;13:00&quot;</span> <span class="hljs-attr">increment</span>=<span class="hljs-string">&quot;30&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-time</span>&gt;</span></code></pre>
75
+ </k-card>
76
+ </div>
77
+ <div class="col m-span-12 px">
78
+ <k-card label="Output">
79
+ <k-time value="13:00" increment="30"></k-time>
80
+ </k-card>
81
+ </div>
82
+ </div>
83
+
84
+ <h3 id="military"><a href="#military" class="no-link">24-Hour Time</a></h3>
85
+ <p>Add the <code>military</code> attribute to render in 24-hour form without an AM/PM segment. Internally the input is tagged as <code>lang="en-GB"</code> to request a 24-hour display; most modern browsers respect this. The stored <code>value</code> format is unchanged.</p>
86
+ <div class="row -mx">
87
+ <div class="col m-span-12 px">
88
+ <k-card label="HTML">
89
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-time</span> <span class="hljs-attr">military</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;17:45&quot;</span> <span class="hljs-attr">increment</span>=<span class="hljs-string">&quot;15&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-time</span>&gt;</span></code></pre>
90
+ </k-card>
91
+ </div>
92
+ <div class="col m-span-12 px">
93
+ <k-card label="Output">
94
+ <k-time military value="17:45" increment="15"></k-time>
95
+ </k-card>
96
+ </div>
97
+ </div>
98
+
99
+ <h3 id="javascriptUsage"><a href="#javascriptUsage" class="no-link">JavaScript Usage</a></h3>
100
+ <p>Listen for the <code>change</code> event to react to committed values. The <code>detail.value</code> is a <code>HH:MM</code> string in 24-hour format.</p>
101
+ <div class="row -mx">
102
+ <div class="col m-span-12 px">
103
+ <k-card label="HTML">
104
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-time</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;jsTime&quot;</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;08:00&quot;</span> <span class="hljs-attr">increment</span>=<span class="hljs-string">&quot;5&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-time</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Selected: <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;jsTimeOutput&quot;</span>&gt;</span>08:00<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="language-javascript"><br> <span class="hljs-keyword">const</span> $time = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&#x27;jsTime&#x27;</span>);<br> <span class="hljs-keyword">const</span> $out = <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&#x27;jsTimeOutput&#x27;</span>);<br> $time.<span class="hljs-title function_">addEventListener</span>(<span class="hljs-string">&#x27;change&#x27;</span>, <span class="hljs-function">(<span class="hljs-params">e</span>) =&gt;</span> {<br> $out.<span class="hljs-property">textContent</span> = e.<span class="hljs-property">detail</span>.<span class="hljs-property">value</span>;<br> });<br></span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></pre>
105
+ </k-card>
106
+ </div>
107
+ <div class="col m-span-12 px">
108
+ <k-card label="Output">
109
+ <k-time id="jsTime" value="08:00" increment="5" class="mb"></k-time>
110
+ <p>Selected: <span id="jsTimeOutput">08:00</span></p>
111
+ <script>
112
+ const $time = document.getElementById('jsTime');
113
+ const $out = document.getElementById('jsTimeOutput');
114
+ $time.addEventListener('change', (e) => {
115
+ $out.textContent = e.detail.value;
116
+ });
117
+ </script>
118
+ </k-card>
119
+ </div>
120
+ </div>
121
+
122
+ <h3 id="formUsage"><a href="#formUsage" class="no-link">Form Usage</a></h3>
123
+ <p>The component is form-associated. Set a <code>name</code> so it participates in form submission. The submitted value is always the 24-hour <code>HH:MM</code> string, regardless of display mode.</p>
124
+ <div class="row -mx">
125
+ <div class="col m-span-12 px">
126
+ <k-card label="HTML">
127
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">form</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;timeForm&quot;</span>&gt;</span><br> <span class="hljs-tag">&lt;<span class="hljs-name">label</span>&gt;</span>Start: <span class="hljs-tag">&lt;<span class="hljs-name">k-time</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;start&quot;</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;09:00&quot;</span> <span class="hljs-attr">increment</span>=<span class="hljs-string">&quot;15&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-time</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span><br> <span class="hljs-tag">&lt;<span class="hljs-name">label</span>&gt;</span>End: <span class="hljs-tag">&lt;<span class="hljs-name">k-time</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;end&quot;</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;17:00&quot;</span> <span class="hljs-attr">increment</span>=<span class="hljs-string">&quot;15&quot;</span> <span class="hljs-attr">military</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-time</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span><br> <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">type</span>=<span class="hljs-string">&quot;submit&quot;</span>&gt;</span>Submit<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span><br><span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Form Data: <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;timeFormOutput&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span><br><span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="language-javascript"><br> <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&#x27;timeForm&#x27;</span>).<span class="hljs-title function_">addEventListener</span>(<span class="hljs-string">&#x27;submit&#x27;</span>, <span class="hljs-function">(<span class="hljs-params">e</span>) =&gt;</span> {<br> e.<span class="hljs-title function_">preventDefault</span>();<br> <span class="hljs-keyword">const</span> fd = <span class="hljs-keyword">new</span> <span class="hljs-title class_">FormData</span>(e.<span class="hljs-property">target</span>);<br> <span class="hljs-keyword">const</span> entries = [...fd.<span class="hljs-title function_">entries</span>()].<span class="hljs-title function_">map</span>(<span class="hljs-function">(<span class="hljs-params">[k, v]</span>) =&gt;</span> k + <span class="hljs-string">&#x27;=&#x27;</span> + v);<br> <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">&#x27;timeFormOutput&#x27;</span>).<span class="hljs-property">textContent</span> = entries.<span class="hljs-title function_">join</span>(<span class="hljs-string">&#x27;, &#x27;</span>);<br> });<br></span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></pre>
128
+ </k-card>
129
+ </div>
130
+ <div class="col m-span-12 px">
131
+ <k-card label="Output">
132
+ <form id="timeForm" class="mb">
133
+ <label class="d-b mb">Start: <k-time name="start" value="09:00" increment="15"></k-time></label>
134
+ <label class="d-b mb">End: <k-time name="end" value="17:00" increment="15" military></k-time></label>
135
+ <button type="submit">Submit</button>
136
+ </form>
137
+ <p>Form Data: <span id="timeFormOutput"></span></p>
138
+ <script>
139
+ document.getElementById('timeForm').addEventListener('submit', (e) => {
140
+ e.preventDefault();
141
+ const fd = new FormData(e.target);
142
+ const entries = [...fd.entries()].map(([k, v]) => k + '=' + v);
143
+ document.getElementById('timeFormOutput').textContent = entries.join(', ');
144
+ });
145
+ </script>
146
+ </k-card>
147
+ </div>
148
+ </div>
149
+
150
+ <h3 id="disabled"><a href="#disabled" class="no-link">Disabled</a></h3>
151
+ <p>The <code>disabled</code> attribute prevents user interaction.</p>
152
+ <div class="row -mx">
153
+ <div class="col m-span-12 px">
154
+ <k-card label="HTML">
155
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-time</span> <span class="hljs-attr">disabled</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;12:00&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">k-time</span>&gt;</span></code></pre>
156
+ </k-card>
157
+ </div>
158
+ <div class="col m-span-12 px">
159
+ <k-card label="Output">
160
+ <k-time disabled value="12:00"></k-time>
161
+ </k-card>
162
+ </div>
163
+ </div>
164
+
165
+ <h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
166
+
167
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
168
+ <h6>Extends <a href="./shadow-component.html">ShadowComponent</a></h6>
169
+ <h5><code>new Time()</code></h5>
170
+
171
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
172
+ <ul>
173
+ <li><a href="./shadow-component.html">ShadowComponent</a></li>
174
+ </ul>
175
+
176
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
177
+ <h5><code>value<i>: String</i></code></h5>
178
+ <p>The committed time as a 24-hour <code>HH:MM</code> string (e.g. <code>"14:30"</code>). Empty string when no time is set. Syncs to <code>value</code> attribute.</p>
179
+
180
+ <h5><code>name<i>: String</i></code></h5>
181
+ <p>The form field name. When set inside a <code>&lt;form&gt;</code>, the component participates in form submission. Syncs to <code>name</code> attribute.</p>
182
+
183
+ <h5><code>increment<i>: Number</i></code></h5>
184
+ <p>The minute step used when the user presses the up/down arrow keys on the minute segment. Also sets the underlying <code>step</code> attribute on the native input in seconds (<code>increment &times; 60</code>). Default is <code>1</code>. Syncs to <code>increment</code> attribute.</p>
185
+
186
+ <h5><code>military<i>: Boolean</i></code></h5>
187
+ <p>When <code>true</code>, the displayed time uses 24-hour format and no AM/PM segment. The stored <code>value</code> format is unchanged. Default is <code>false</code>. Syncs to <code>military</code> attribute.</p>
188
+
189
+ <h5><code>disabled<i>: Boolean</i></code></h5>
190
+ <p>When <code>true</code>, the component cannot be changed by user interaction. The element appears at 50% opacity. Syncs to <code>disabled</code> attribute.</p>
191
+
192
+ <h5><code>required<i>: Boolean</i></code></h5>
193
+ <p>When <code>true</code> and no time is set, the element reports a <code>valueMissing</code> validity error for form validation. Syncs to <code>required</code> attribute.</p>
194
+
195
+ <h3 id="events"><a href="#events" class="no-link">Events</a></h3>
196
+ <h5><code>change</code></h5>
197
+ <p>Fired when the committed <code>value</code> changes. The event <code>detail</code> contains <code>{ value: String }</code> in 24-hour <code>HH:MM</code> format, or an empty string when cleared.</p>
198
+ </content>
199
+ <content location="scripts">
200
+ <script type="module" src="{{pathToRoot}}src/components/Time.js"></script>
201
+ <script type="module" src="{{pathToRoot}}src/components/Accordion.js"></script>
202
+ <script type="module" src="{{pathToRoot}}src/components/Card.js"></script>
203
+ </content>
204
+ </page>