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,662 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Time - Components - Kempo Docs - A Web Components Solution</title>
7
+ <link rel="icon" type="image/png" sizes="48x48" href="../media/icon48.png">
8
+ <link rel="manifest" href="../manifest.json" />
9
+ <link rel="stylesheet" href="../kempo-vars.css" />
10
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/kempo-css@2/dist/kempo.min.css" />
11
+ <link rel="stylesheet" href="../kempo-hljs.css" />
12
+ <link rel="stylesheet" href="../styles.css" />
13
+ <script>window.litDisableBundleWarning = true;</script>
14
+
15
+ </head>
16
+ <body>
17
+
18
+ <k-nav
19
+ fixed
20
+ class="bg-primary"
21
+ >
22
+ <button
23
+ id="toggleNavSideMenu"
24
+ class="link"
25
+ >
26
+ <k-icon name="menu"></k-icon>
27
+ </button>
28
+ <a
29
+ href="../"
30
+ class="d-if ph"
31
+ style="align-items: center"
32
+ >
33
+ <img
34
+ src="../media/icon32.png"
35
+ alt="Kempo UI Icon"
36
+ class="pr"
37
+ />
38
+ Kempo UI
39
+ </a>
40
+ <div
41
+ style="position:relative;margin:0 .25rem;align-self:center;"
42
+ theme="light"
43
+ >
44
+ <input
45
+ id="navSearchInput"
46
+ type="search"
47
+ placeholder="Search docs..."
48
+ autocomplete="off"
49
+ style="width:11rem;"
50
+ />
51
+ <div
52
+ id="navSearchDropdown"
53
+ hidden
54
+ theme="light"
55
+ style="position:absolute;top:calc(100% + 4px);left:0;width:min(480px,90vw);max-height:70vh;background:var(--c_bg);border:1px solid var(--c_border);border-radius:var(--radius);overflow:auto;z-index:9999;box-shadow:0 4px 12px rgba(0,0,0,.3);"
56
+ >
57
+ <k-filter-list
58
+ id="navSearchList"
59
+ style="display:block;padding:.25rem 0;"
60
+ >
61
+ <k-filter-item filter-keywords="accordion components"><a
62
+ href="../components/accordion.html">Accordion<br><small>Component</small></a></k-filter-item>
63
+ <k-filter-item filter-keywords="aside sidebar components"><a
64
+ href="../components/aside.html">Aside<br><small>Component</small></a></k-filter-item>
65
+ <k-filter-item filter-keywords="calendar date picker range month day components"><a
66
+ href="../components/calendar.html"
67
+ >Calendar<br><small>Component</small></a></k-filter-item>
68
+ <k-filter-item filter-keywords="card components"><a
69
+ href="../components/card.html">Card<br><small>Component</small></a></k-filter-item>
70
+ <k-filter-item filter-keywords="code editor codeeditor monaco components"><a
71
+ href="../components/code-editor.html"
72
+ >Code Editor<br><small>Component</small></a></k-filter-item>
73
+ <k-filter-item filter-keywords="combobox combo box search autocomplete components"><a
74
+ href="../components/combobox.html"
75
+ >Combobox<br><small>Component</small></a></k-filter-item>
76
+ <k-filter-item filter-keywords="color picker colorpicker components"><a
77
+ href="../components/color-picker.html"
78
+ >Color Picker<br><small>Component</small></a></k-filter-item>
79
+ <k-filter-item filter-keywords="content slider components"><a
80
+ href="../components/content-slider.html"
81
+ >Content Slider<br><small>Component</small></a></k-filter-item>
82
+ <k-filter-item filter-keywords="context state global components"><a
83
+ href="../components/context.html"
84
+ >Context<br><small>Component</small></a></k-filter-item>
85
+ <k-filter-item filter-keywords="dialog modal popup components"><a
86
+ href="../components/dialog.html">Dialog<br><small>Component</small></a></k-filter-item>
87
+ <k-filter-item filter-keywords="dropdown select components"><a
88
+ href="../components/dropdown.html">Dropdown<br><small>Component</small></a></k-filter-item>
89
+ <k-filter-item filter-keywords="filter list filterlist components"><a
90
+ href="../components/filter-list.html"
91
+ >Filter List<br><small>Component</small></a></k-filter-item>
92
+ <k-filter-item filter-keywords="focus capture focuscapture components"><a
93
+ href="../components/focus-capture.html"
94
+ >Focus Capture<br><small>Component</small></a></k-filter-item>
95
+ <k-filter-item filter-keywords="html editor components"><a
96
+ href="../components/html-editor.html">HTML
97
+ Editor<br><small>Component</small></a></k-filter-item>
98
+ <k-filter-item filter-keywords="icon components"><a
99
+ href="../components/icon.html">Icon<br><small>Component</small></a></k-filter-item>
100
+ <k-filter-item filter-keywords="import components"><a
101
+ href="../components/import.html">Import<br><small>Component</small></a></k-filter-item>
102
+ <k-filter-item filter-keywords="nav navbar navigation components"><a
103
+ href="../components/nav.html">Nav<br><small>Component</small></a></k-filter-item>
104
+ <k-filter-item filter-keywords="nav spacer navbar spacer navspacer components"><a
105
+ href="../components/nav-spacer.html"
106
+ >Nav Spacer<br><small>Component</small></a></k-filter-item>
107
+ <k-filter-item filter-keywords="photo viewer photoviewer components"><a
108
+ href="../components/photo-viewer.html"
109
+ >Photo Viewer<br><small>Component</small></a></k-filter-item>
110
+ <k-filter-item filter-keywords="progress loading components"><a
111
+ href="../components/progress.html">Progress<br><small>Component</small></a></k-filter-item>
112
+ <k-filter-item filter-keywords="resize components"><a
113
+ href="../components/resize.html">Resize<br><small>Component</small></a></k-filter-item>
114
+ <k-filter-item filter-keywords="show more showmore components"><a
115
+ href="../components/show-more.html"
116
+ >Show More<br><small>Component</small></a></k-filter-item>
117
+ <k-filter-item filter-keywords="slider range input step components"><a
118
+ href="../components/slider.html"
119
+ >Slider<br><small>Component</small></a></k-filter-item>
120
+ <k-filter-item filter-keywords="sortable drag drop sort components"><a
121
+ href="../components/sortable.html"
122
+ >Sortable<br><small>Component</small></a></k-filter-item>
123
+ <k-filter-item filter-keywords="spinner loading components"><a
124
+ href="../components/spinner.html">Spinner<br><small>Component</small></a></k-filter-item>
125
+ <k-filter-item filter-keywords="split pane components"><a
126
+ href="../components/split.html">Split<br><small>Component</small></a></k-filter-item>
127
+ <k-filter-item filter-keywords="table data grid components"><a
128
+ href="../components/table.html">Table<br><small>Component</small></a></k-filter-item>
129
+ <k-filter-item filter-keywords="table controls advanced example"><a
130
+ href="../components/tableControls.html"
131
+ >Table &mdash; Controls<br><small>Advanced Example</small></a></k-filter-item>
132
+ <k-filter-item filter-keywords="table custom fields advanced example"><a
133
+ href="../components/tableCustomFields.html"
134
+ >Table &mdash; Custom Fields<br><small>Advanced Example</small></a></k-filter-item>
135
+ <k-filter-item filter-keywords="table fetch records advanced example"><a
136
+ href="../components/tableFetchRecords.html"
137
+ >Table &mdash; Fetch Records<br><small>Advanced Example</small></a></k-filter-item>
138
+ <k-filter-item filter-keywords="table field sort hide advanced example"><a
139
+ href="../components/tableFieldSortHide.html"
140
+ >Table &mdash; Field Sort &amp; Hide<br><small>Advanced Example</small></a></k-filter-item>
141
+ <k-filter-item filter-keywords="table pagination advanced example"><a
142
+ href="../components/tablePagination.html"
143
+ >Table &mdash; Pagination<br><small>Advanced Example</small></a></k-filter-item>
144
+ <k-filter-item filter-keywords="table record editing advanced example"><a
145
+ href="../components/tableRecordEditing.html"
146
+ >Table &mdash; Record Editing<br><small>Advanced Example</small></a></k-filter-item>
147
+ <k-filter-item filter-keywords="table record filtering advanced example"><a
148
+ href="../components/tableRecordFiltering.html"
149
+ >Table &mdash; Record Filtering<br><small>Advanced Example</small></a></k-filter-item>
150
+ <k-filter-item filter-keywords="table record hiding advanced example"><a
151
+ href="../components/tableRecordHiding.html"
152
+ >Table &mdash; Record Hiding<br><small>Advanced Example</small></a></k-filter-item>
153
+ <k-filter-item filter-keywords="table record searching advanced example"><a
154
+ href="../components/tableRecordSearching.html"
155
+ >Table &mdash; Record Searching<br><small>Advanced Example</small></a></k-filter-item>
156
+ <k-filter-item filter-keywords="table record selection advanced example"><a
157
+ href="../components/tableRecordSelection.html"
158
+ >Table &mdash; Record Selection<br><small>Advanced Example</small></a></k-filter-item>
159
+ <k-filter-item filter-keywords="table row controls advanced example"><a
160
+ href="../components/tableRowControls.html"
161
+ >Table &mdash; Row Controls<br><small>Advanced Example</small></a></k-filter-item>
162
+ <k-filter-item filter-keywords="table server sync advanced example"><a
163
+ href="../components/tableServerSync.html"
164
+ >Table &mdash; Server Sync<br><small>Advanced Example</small></a></k-filter-item>
165
+ <k-filter-item filter-keywords="table sorting advanced example"><a
166
+ href="../components/tableSorting.html"
167
+ >Table &mdash; Sorting<br><small>Advanced Example</small></a></k-filter-item>
168
+ <k-filter-item filter-keywords="table placeholder advanced example"><a
169
+ href="../components/tablePlaceholder.html"
170
+ >Table &mdash; Placeholder<br><small>Advanced Example</small></a></k-filter-item>
171
+ <k-filter-item filter-keywords="tabs tab panel components"><a
172
+ href="../components/tabs.html">Tabs<br><small>Component</small></a></k-filter-item>
173
+ <k-filter-item filter-keywords="tags tag input components"><a
174
+ href="../components/tags.html">Tags<br><small>Component</small></a></k-filter-item>
175
+ <k-filter-item filter-keywords="theme select dropdown dark light components"><a
176
+ href="../components/theme-select.html"
177
+ >Theme Select<br><small>Component</small></a></k-filter-item>
178
+ <k-filter-item filter-keywords="theme switcher dark light components"><a
179
+ href="../components/theme-switcher.html"
180
+ >Theme Switcher<br><small>Component</small></a></k-filter-item>
181
+ <k-filter-item filter-keywords="time picker clock hour minute form components"><a
182
+ href="../components/time.html"
183
+ >Time<br><small>Component</small></a></k-filter-item>
184
+ <k-filter-item filter-keywords="timestamp date time components"><a
185
+ href="../components/timestamp.html"
186
+ >Timestamp<br><small>Component</small></a></k-filter-item>
187
+ <k-filter-item filter-keywords="toast notification alert components"><a
188
+ href="../components/toast.html"
189
+ >Toast<br><small>Component</small></a></k-filter-item>
190
+ <k-filter-item filter-keywords="toggle switch checkbox components"><a
191
+ href="../components/toggle.html"
192
+ >Toggle<br><small>Component</small></a></k-filter-item>
193
+ <k-filter-item filter-keywords="tree treeview components"><a
194
+ href="../components/tree.html">Tree<br><small>Component</small></a></k-filter-item>
195
+ <k-filter-item filter-keywords="shadow component base"><a
196
+ href="../components/shadow-component.html"
197
+ >Shadow Component<br><small>Base Component</small></a></k-filter-item>
198
+ <k-filter-item filter-keywords="light component base"><a
199
+ href="../components/light-component.html">Light Component<br><small>Base
200
+ Component</small></a></k-filter-item>
201
+ <k-filter-item filter-keywords="hybrid component base"><a
202
+ href="../components/hybrid-component.html"
203
+ >Hybrid Component<br><small>Base Component</small></a></k-filter-item>
204
+ <k-filter-item filter-keywords="cookie utils utility"><a
205
+ href="../utils/cookie.html">cookie<br><small>Utility</small></a></k-filter-item>
206
+ <k-filter-item filter-keywords="context utils utility"><a
207
+ href="../utils/context.html">context<br><small>Utility</small></a></k-filter-item>
208
+ <k-filter-item filter-keywords="debounce utils utility"><a
209
+ href="../utils/debounce.html">debounce<br><small>Utility</small></a></k-filter-item>
210
+ <k-filter-item filter-keywords="drag utils utility"><a
211
+ href="../utils/drag.html">drag<br><small>Utility</small></a></k-filter-item>
212
+ <k-filter-item filter-keywords="elevation z-index stacking utils"><a
213
+ href="../utils/elevation.html">elevation<br><small>Utility</small></a></k-filter-item>
214
+ <k-filter-item filter-keywords="formattimestamp timestamp format date time utils utility"><a
215
+ href="../utils/formatTimestamp.html"
216
+ >formatTimestamp<br><small>Utility</small></a></k-filter-item>
217
+ <k-filter-item filter-keywords="object utils utility"><a
218
+ href="../utils/object.html">object<br><small>Utility</small></a></k-filter-item>
219
+ <k-filter-item filter-keywords="propconverters prop converters utils utility"><a
220
+ href="../utils/propConverters.html"
221
+ >propConverters<br><small>Utility</small></a></k-filter-item>
222
+ <k-filter-item filter-keywords="string utils utility"><a
223
+ href="../utils/string.html">string<br><small>Utility</small></a></k-filter-item>
224
+ <k-filter-item filter-keywords="theme utils utility"><a
225
+ href="../utils/theme.html">theme<br><small>Utility</small></a></k-filter-item>
226
+ <k-filter-item filter-keywords="type utils utility"><a
227
+ href="../utils/type.html">type<br><small>Utility</small></a></k-filter-item>
228
+ <k-filter-item filter-keywords="wait async utils utility"><a
229
+ href="../utils/wait.html">wait<br><small>Utility</small></a></k-filter-item>
230
+ </k-filter-list>
231
+ </div>
232
+ </div>
233
+ <div class="flex"></div>
234
+ <a
235
+ href="https://github.com/dustinpoissant/kempo-ui?tab=License-1-ov-file#creative-commons-attribution-noncommercial-sharealike-20"
236
+ target="_blank"
237
+ ><k-icon name="license"></k-icon></a>
238
+ <a
239
+ href="https://www.npmjs.com/package/kempo-ui"
240
+ target="_blank"
241
+ ><k-icon name="npm"></k-icon></a>
242
+ <a
243
+ href="https://github.com/dustinpoissant/kempo-ui"
244
+ target="_blank"
245
+ ><k-icon name="github-mark"></k-icon></a>
246
+ <k-theme-switcher
247
+ class="mr"
248
+ style="
249
+ --padding: 0.5rem;
250
+ --c_active: var(--tc_on_primary);
251
+ --tc_active: var(--c_primary);
252
+ --c_inactive__hover: rgba(255, 255, 255, 0.1);
253
+ "
254
+ ></k-theme-switcher>
255
+ </k-nav>
256
+ <div style="width: 100%; height: 4rem;"></div>
257
+ <k-aside
258
+ id="navSideMenu"
259
+ main="overlay"
260
+ state="offscreen"
261
+ >
262
+ <menu>
263
+ <a
264
+ href="../"
265
+ class="ta-center bb mb r0"
266
+ >
267
+ <h1 class="tc-primary">Kempo UI</h1>
268
+ <img
269
+ src="../media/icon128.png"
270
+ alt="Kempo UI Icon"
271
+ />
272
+ </a>
273
+
274
+ <div class="pl mb">
275
+ <h3>Components</h3>
276
+ <a href="../components/accordion.html">Accordion</a>
277
+ <a href="../components/aside.html">Aside</a>
278
+ <a href="../components/calendar.html">Calendar</a>
279
+ <a href="../components/card.html">Card</a>
280
+ <a href="../components/code-editor.html">Code Editor</a>
281
+ <a href="../components/combobox.html">Combobox</a>
282
+ <a href="../components/color-picker.html">ColorPicker</a>
283
+ <a href="../components/content-slider.html">Content Slider</a>
284
+ <a href="../components/context.html">Context</a>
285
+ <a href="../components/dialog.html">Dialog</a>
286
+ <a href="../components/dropdown.html">Dropdown</a>
287
+ <a href="../components/filter-list.html">Filter List</a>
288
+ <a href="../components/focus-capture.html">FocusCapture</a>
289
+ <a href="../components/html-editor.html">HTML Editor</a>
290
+ <a href="../components/icon.html">Icon</a>
291
+ <a href="../components/import.html">Import</a>
292
+ <a href="../components/nav.html">Nav</a>
293
+ <a href="../components/nav-spacer.html">Nav Spacer</a>
294
+ <a href="../components/photo-viewer.html">Photo Viewer</a>
295
+ <a href="../components/progress.html">Progress</a>
296
+ <a href="../components/resize.html">Resize</a>
297
+ <a href="../components/show-more.html">Show More</a>
298
+ <a href="../components/slider.html">Slider</a>
299
+ <a href="../components/sortable.html">Sortable</a>
300
+ <a href="../components/spinner.html">Spinner</a>
301
+ <a href="../components/split.html">Split</a>
302
+ <a href="../components/table.html">Table</a>
303
+ <a href="../components/tabs.html">Tabs</a>
304
+ <a href="../components/tags.html">Tags</a>
305
+ <a href="../components/theme-select.html">Theme Select</a>
306
+ <a href="../components/theme-switcher.html">Theme Switcher</a>
307
+ <a href="../components/time.html">Time</a>
308
+ <a href="../components/timestamp.html">Timestamp</a>
309
+ <a href="../components/toast.html">Toast</a>
310
+ <a href="../components/toggle.html">Toggle</a>
311
+ <a href="../components/tree.html">Tree</a>
312
+ </div>
313
+
314
+ <h5 class="mb0">Base Components</h5>
315
+ <div class="pl mb">
316
+ <a href="../components/shadow-component.html">Shadow Component</a>
317
+ <a href="../components/light-component.html">Light Component</a>
318
+ <a href="../components/hybrid-component.html">Hybrid Component</a>
319
+ </div>
320
+
321
+ <h5 class="mb0">Utils</h5>
322
+ <div class="pl mb">
323
+ <a href="../utils/cookie.html">cookie</a>
324
+ <a href="../utils/context.html">context</a>
325
+ <a href="../utils/debounce.html">debounce</a>
326
+ <a href="../utils/drag.html">drag</a>
327
+ <a href="../utils/elevation.html">elevation</a>
328
+ <a href="../utils/formatTimestamp.html">formatTimestamp</a>
329
+ <a href="../utils/object.html">object</a>
330
+ <a href="../utils/propConverters.html">propConverters</a>
331
+ <a href="../utils/string.html">string</a>
332
+ <a href="../utils/theme.html">theme</a>
333
+ <a href="../utils/type.html">type</a>
334
+ <a href="../utils/wait.html">wait</a>
335
+ </div>
336
+ </menu>
337
+ </k-aside>
338
+ <style>
339
+ #navSearchList a {
340
+ display: block;
341
+ padding: .25rem .5rem;
342
+ border-radius: var(--radius);
343
+ text-decoration: none;
344
+ color: var(--tc);
345
+ }
346
+
347
+ #navSearchList a:hover {
348
+ background: rgba(128, 128, 128, .15);
349
+ }
350
+
351
+ #navSearchList a small {
352
+ display: block;
353
+ color: var(--tc_muted);
354
+ }
355
+ </style>
356
+ <script
357
+ src="../src/components/Nav.js"
358
+ type="module"
359
+ ></script>
360
+ <script
361
+ src="../src/components/FilterList.js"
362
+ type="module"
363
+ ></script>
364
+ <script
365
+ src="../src/components/FilterItem.js"
366
+ type="module"
367
+ ></script>
368
+ <script
369
+ src="../src/components/Aside.js"
370
+ type="module"
371
+ ></script>
372
+ <script
373
+ src="../src/components/Icon.js"
374
+ type="module"
375
+ ></script>
376
+ <script
377
+ src="../src/components/ThemeSwitcher.js"
378
+ type="module"
379
+ ></script>
380
+ <script type="module">
381
+ import debounce from '../src/utils/debounce.js';
382
+
383
+ document.getElementById('toggleNavSideMenu').addEventListener('click', async () => {
384
+ await window.customElements.whenDefined('k-aside');
385
+ document.getElementById('navSideMenu').toggle();
386
+ });
387
+
388
+ document.addEventListener('click', function (e) {
389
+ if (e.target.matches('a[href^="#"]')) {
390
+ e.preventDefault();
391
+ const targetId = e.target.getAttribute('href').replace('#', '');
392
+ const target = document.getElementById(targetId);
393
+ if (target) {
394
+ target.scrollIntoView({ behavior: 'smooth' });
395
+ const url = window.location.pathname + window.location.search + '#' + targetId;
396
+ history.replaceState(null, '', url);
397
+ }
398
+ }
399
+ });
400
+
401
+ /*
402
+ Nav Search
403
+ */
404
+ const searchInput = document.getElementById('navSearchInput');
405
+ const searchDropdown = document.getElementById('navSearchDropdown');
406
+ let navSearchList = null;
407
+
408
+ const openSearch = async () => {
409
+ await customElements.whenDefined('k-filter-list');
410
+ if (!navSearchList) navSearchList = document.getElementById('navSearchList');
411
+ navSearchList.filter(searchInput.value);
412
+ searchDropdown.hidden = false;
413
+ };
414
+
415
+ const closeSearch = () => {
416
+ searchDropdown.hidden = true;
417
+ navSearchList?.clearFocus();
418
+ };
419
+
420
+ searchInput.addEventListener('focus', openSearch);
421
+
422
+ searchInput.addEventListener('input', debounce(e => {
423
+ navSearchList?.filter(e.target.value);
424
+ }, 150));
425
+
426
+ searchInput.addEventListener('keydown', e => {
427
+ if (e.key === 'Escape') {
428
+ searchInput.value = '';
429
+ searchInput.blur();
430
+ closeSearch();
431
+ } else if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter') {
432
+ navSearchList?.handleKeydown(e);
433
+ }
434
+ });
435
+
436
+ searchInput.addEventListener('blur', () => {
437
+ setTimeout(closeSearch, 150);
438
+ });
439
+
440
+ document.addEventListener('keydown', e => {
441
+ let active = document.activeElement;
442
+ while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
443
+ const tag = active?.tagName;
444
+ if (tag === 'INPUT' || tag === 'TEXTAREA' || active?.isContentEditable) return;
445
+ if (e.metaKey || e.ctrlKey || e.altKey) return;
446
+ if (e.key.length === 1) {
447
+ searchInput.focus();
448
+ }
449
+ });
450
+ </script>
451
+
452
+
453
+ <h1 class="ta-center">Time</h1>
454
+
455
+ <k-main>
456
+
457
+ <k-accordion persistent-id="toc" class="b r mb">
458
+ <k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
459
+ <k-accordion-panel name="toc-panel">
460
+ <div class="m pl">
461
+ <h6>Examples</h6>
462
+ <a href="#basicUsage">Basic Usage</a><br />
463
+ <a href="#defaultValue">Default Value</a><br />
464
+ <a href="#increment">Minute Increment</a><br />
465
+ <a href="#military">24-Hour Time</a><br />
466
+ <a href="#javascriptUsage">JavaScript Usage</a><br />
467
+ <a href="#formUsage">Form Usage</a><br />
468
+ <a href="#disabled">Disabled</a><br />
469
+
470
+ <h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
471
+ <a href="#constructor">Constructor</a><br />
472
+ <a href="#requirements">Requirements</a><br />
473
+ <a href="#properties">Properties</a><br />
474
+ <a href="#events">Events</a><br />
475
+ </div>
476
+ </k-accordion-panel>
477
+ </k-accordion>
478
+
479
+ <h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
480
+ <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>
481
+ <div class="row -mx">
482
+ <div class="col m-span-12 px">
483
+ <k-card label="HTML">
484
+ <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>
485
+ </k-card>
486
+ </div>
487
+ <div class="col m-span-12 px">
488
+ <k-card label="Output">
489
+ <k-time></k-time>
490
+ </k-card>
491
+ </div>
492
+ </div>
493
+
494
+ <h3 id="defaultValue"><a href="#defaultValue" class="no-link">Default Value</a></h3>
495
+ <p>Set an initial value with the <code>value</code> attribute using 24-hour <code>HH:MM</code> format.</p>
496
+ <div class="row -mx">
497
+ <div class="col m-span-12 px">
498
+ <k-card label="HTML">
499
+ <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>
500
+ </k-card>
501
+ </div>
502
+ <div class="col m-span-12 px">
503
+ <k-card label="Output">
504
+ <k-time value="14:30"></k-time>
505
+ </k-card>
506
+ </div>
507
+ </div>
508
+
509
+ <h3 id="increment"><a href="#increment" class="no-link">Minute Increment</a></h3>
510
+ <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>
511
+ <div class="row -mx">
512
+ <div class="col m-span-12 px">
513
+ <k-card label="HTML">
514
+ <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>
515
+ </k-card>
516
+ </div>
517
+ <div class="col m-span-12 px">
518
+ <k-card label="Output">
519
+ <k-time value="09:15" increment="15"></k-time>
520
+ </k-card>
521
+ </div>
522
+ </div>
523
+
524
+ <h4>Half-Hour Increment</h4>
525
+ <div class="row -mx">
526
+ <div class="col m-span-12 px">
527
+ <k-card label="HTML">
528
+ <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>
529
+ </k-card>
530
+ </div>
531
+ <div class="col m-span-12 px">
532
+ <k-card label="Output">
533
+ <k-time value="13:00" increment="30"></k-time>
534
+ </k-card>
535
+ </div>
536
+ </div>
537
+
538
+ <h3 id="military"><a href="#military" class="no-link">24-Hour Time</a></h3>
539
+ <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>
540
+ <div class="row -mx">
541
+ <div class="col m-span-12 px">
542
+ <k-card label="HTML">
543
+ <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>
544
+ </k-card>
545
+ </div>
546
+ <div class="col m-span-12 px">
547
+ <k-card label="Output">
548
+ <k-time military value="17:45" increment="15"></k-time>
549
+ </k-card>
550
+ </div>
551
+ </div>
552
+
553
+ <h3 id="javascriptUsage"><a href="#javascriptUsage" class="no-link">JavaScript Usage</a></h3>
554
+ <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>
555
+ <div class="row -mx">
556
+ <div class="col m-span-12 px">
557
+ <k-card label="HTML">
558
+ <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>
559
+ </k-card>
560
+ </div>
561
+ <div class="col m-span-12 px">
562
+ <k-card label="Output">
563
+ <k-time id="jsTime" value="08:00" increment="5" class="mb"></k-time>
564
+ <p>Selected: <span id="jsTimeOutput">08:00</span></p>
565
+ <script>
566
+ const $time = document.getElementById('jsTime');
567
+ const $out = document.getElementById('jsTimeOutput');
568
+ $time.addEventListener('change', (e) => {
569
+ $out.textContent = e.detail.value;
570
+ });
571
+ </script>
572
+ </k-card>
573
+ </div>
574
+ </div>
575
+
576
+ <h3 id="formUsage"><a href="#formUsage" class="no-link">Form Usage</a></h3>
577
+ <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>
578
+ <div class="row -mx">
579
+ <div class="col m-span-12 px">
580
+ <k-card label="HTML">
581
+ <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>
582
+ </k-card>
583
+ </div>
584
+ <div class="col m-span-12 px">
585
+ <k-card label="Output">
586
+ <form id="timeForm" class="mb">
587
+ <label class="d-b mb">Start: <k-time name="start" value="09:00" increment="15"></k-time></label>
588
+ <label class="d-b mb">End: <k-time name="end" value="17:00" increment="15" military></k-time></label>
589
+ <button type="submit">Submit</button>
590
+ </form>
591
+ <p>Form Data: <span id="timeFormOutput"></span></p>
592
+ <script>
593
+ document.getElementById('timeForm').addEventListener('submit', (e) => {
594
+ e.preventDefault();
595
+ const fd = new FormData(e.target);
596
+ const entries = [...fd.entries()].map(([k, v]) => k + '=' + v);
597
+ document.getElementById('timeFormOutput').textContent = entries.join(', ');
598
+ });
599
+ </script>
600
+ </k-card>
601
+ </div>
602
+ </div>
603
+
604
+ <h3 id="disabled"><a href="#disabled" class="no-link">Disabled</a></h3>
605
+ <p>The <code>disabled</code> attribute prevents user interaction.</p>
606
+ <div class="row -mx">
607
+ <div class="col m-span-12 px">
608
+ <k-card label="HTML">
609
+ <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>
610
+ </k-card>
611
+ </div>
612
+ <div class="col m-span-12 px">
613
+ <k-card label="Output">
614
+ <k-time disabled value="12:00"></k-time>
615
+ </k-card>
616
+ </div>
617
+ </div>
618
+
619
+ <h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
620
+
621
+ <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
622
+ <h6>Extends <a href="./shadow-component.html">ShadowComponent</a></h6>
623
+ <h5><code>new Time()</code></h5>
624
+
625
+ <h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
626
+ <ul>
627
+ <li><a href="./shadow-component.html">ShadowComponent</a></li>
628
+ </ul>
629
+
630
+ <h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
631
+ <h5><code>value<i>: String</i></code></h5>
632
+ <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>
633
+
634
+ <h5><code>name<i>: String</i></code></h5>
635
+ <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>
636
+
637
+ <h5><code>increment<i>: Number</i></code></h5>
638
+ <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>
639
+
640
+ <h5><code>military<i>: Boolean</i></code></h5>
641
+ <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>
642
+
643
+ <h5><code>disabled<i>: Boolean</i></code></h5>
644
+ <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>
645
+
646
+ <h5><code>required<i>: Boolean</i></code></h5>
647
+ <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>
648
+
649
+ <h3 id="events"><a href="#events" class="no-link">Events</a></h3>
650
+ <h5><code>change</code></h5>
651
+ <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>
652
+
653
+ </k-main>
654
+ <div style="height:33vh"></div>
655
+ <script type="module" src="../src/components/Main.js"></script>
656
+
657
+ <script type="module" src="../src/components/Time.js"></script>
658
+ <script type="module" src="../src/components/Accordion.js"></script>
659
+ <script type="module" src="../src/components/Card.js"></script>
660
+
661
+ </body>
662
+ </html>