kempo-ui 0.0.16 → 0.0.18
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.
- package/dist/components/LightComponent.js +1 -0
- package/dist/components/ShadowComponent.js +1 -0
- package/{docs/kempo-ui/src → dist}/components/SideMenu.js +2 -2
- package/dist/components/Split.js +84 -0
- package/dist/components/Table.js +151 -0
- package/dist/{src/components → components}/Tree.js +0 -3
- package/{docs/kempo-ui/src → dist}/components/tableControls/FieldSortHide.js +1 -2
- package/dist/{src/components → components}/tableControls/Filters.js +2 -3
- package/docs/{kempo-ui/components → components}/accordion.html +35 -52
- package/docs/{kempo-ui/components → components}/card.html +31 -23
- package/docs/components/content-slider.html +283 -0
- package/docs/{kempo-ui/components → components}/dialog.html +44 -40
- package/docs/{kempo-ui/components → components}/focus-capture.html +28 -23
- package/docs/{kempo-ui/components → components}/hybrid-component.html +20 -17
- package/docs/{kempo-ui/components → components}/icon.html +43 -35
- package/docs/components/import.html +80 -0
- package/docs/{kempo-ui/components → components}/light-component.html +51 -32
- package/docs/components/photo-viewer.html +269 -0
- package/docs/{kempo-ui/components → components}/resize.html +34 -29
- package/docs/{kempo-ui/components → components}/shadow-component.html +44 -29
- package/docs/{kempo-ui/components → components}/show-more.html +31 -26
- package/docs/{kempo-ui/components → components}/side-menu.html +9 -9
- package/docs/{kempo-ui/components → components}/sortable.html +28 -23
- package/docs/{kempo-ui/components → components}/split.html +68 -41
- package/docs/{kempo-ui/components → components}/table.html +89 -118
- package/docs/{kempo-ui/components → components}/tableControls.html +16 -12
- package/docs/{kempo-ui/components → components}/tableCustomFields.html +13 -10
- package/docs/{kempo-ui/components → components}/tableFetchRecords.html +16 -16
- package/docs/{kempo-ui/components → components}/tableFieldSortHide.html +11 -11
- package/docs/components/tablePagination.html +99 -0
- package/docs/{kempo-ui/components → components}/tableRecordEditing.html +15 -12
- package/docs/{kempo-ui/components → components}/tableRecordFiltering.html +12 -12
- package/docs/{kempo-ui/components → components}/tableRecordHiding.html +16 -13
- package/docs/{kempo-ui/components → components}/tableRecordSearching.html +11 -11
- package/docs/{kempo-ui/components → components}/tableRecordSelection.html +13 -11
- package/docs/{kempo-ui/components → components}/tableRowControls.html +14 -13
- package/docs/{kempo-ui/components → components}/tableSorting.html +9 -9
- package/docs/components/tabs.html +126 -0
- package/docs/components/tags.html +153 -0
- package/docs/{kempo-ui/components → components}/theme-switcher.html +20 -15
- package/docs/components/timestamp.html +127 -0
- package/docs/components/toast.html +355 -0
- package/docs/{kempo-ui/components → components}/toggle.html +20 -15
- package/docs/components/tree.html +187 -0
- package/docs/dev.config.json +3 -4
- package/docs/{kempo-ui/index.html → index.html} +0 -7
- package/docs/init-1.js +4 -0
- package/docs/nav-1.inc.html +66 -0
- package/docs/nav.inc.html +66 -0
- package/docs/nav.inc.js +16 -0
- package/docs/src/components/LightComponent.js +1 -0
- package/docs/src/components/ShadowComponent.js +1 -0
- package/{dist → docs}/src/components/SideMenu.js +2 -2
- package/docs/src/components/Split.js +84 -0
- package/docs/src/components/Table.js +151 -0
- package/docs/{kempo-ui/src → src}/components/Tree.js +0 -3
- package/{dist → docs}/src/components/tableControls/FieldSortHide.js +1 -2
- package/docs/{kempo-ui/src → src}/components/tableControls/Filters.js +2 -3
- package/docs/src/kempo-vars.css +1 -0
- package/docs/{kempo-ui/utils → utils}/debounce.html +23 -22
- package/docs/{kempo-ui/utils → utils}/drag.html +29 -26
- package/docs/{kempo-ui/utils → utils}/formatTimestamp.html +7 -7
- package/docs/{kempo-ui/utils → utils}/propConverters.html +11 -11
- package/docs/{kempo-ui/utils → utils}/toTitleCase.html +7 -7
- package/package.json +3 -3
- package/scripts/build.js +10 -17
- package/scripts/docs.js +0 -3
- package/src/components/LightComponent.js +22 -0
- package/src/components/ShadowComponent.js +23 -0
- package/src/components/SideMenu.js +2 -1
- package/src/components/Split.js +16 -8
- package/src/components/Table.js +112 -95
- package/src/components/Tree.js +0 -3
- package/src/components/tableControls/FieldSortHide.js +1 -1
- package/src/components/tableControls/Filters.js +2 -3
- package/tests/components/HybridComponent.browser-test.js +1 -1
- package/tests/components/ShadowComponent.browser-test.js +3 -3
- package/dist/kempo-hljs.css +0 -1
- package/dist/src/components/LightComponent.js +0 -1
- package/dist/src/components/ShadowComponent.js +0 -1
- package/dist/src/components/Split.js +0 -84
- package/dist/src/components/Table.js +0 -151
- package/dist/src/utils/watchWindowSize.js +0 -1
- package/docs/kempo-ui/components/content-slider.html +0 -219
- package/docs/kempo-ui/components/import.html +0 -70
- package/docs/kempo-ui/components/photo-viewer.html +0 -221
- package/docs/kempo-ui/components/tablePagination.html +0 -97
- package/docs/kempo-ui/components/tabs.html +0 -176
- package/docs/kempo-ui/components/tags.html +0 -106
- package/docs/kempo-ui/components/timestamp.html +0 -78
- package/docs/kempo-ui/components/toast.html +0 -315
- package/docs/kempo-ui/components/tree.html +0 -179
- package/docs/kempo-ui/nav.inc.html +0 -67
- package/docs/kempo-ui/nav.inc.js +0 -4
- package/docs/kempo-ui/src/components/LightComponent.js +0 -1
- package/docs/kempo-ui/src/components/ShadowComponent.js +0 -1
- package/docs/kempo-ui/src/components/Split.js +0 -84
- package/docs/kempo-ui/src/components/Table.js +0 -151
- package/docs/kempo-ui/src/utils/watchWindowSize.js +0 -1
- package/docs/kempo-ui/utils/watchWindowSize.html +0 -72
- package/src/kempo-hljs.css +0 -146
- package/src/utils/watchWindowSize.js +0 -16
- /package/{docs/kempo-ui/src → dist}/components/Accordion.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/Card.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/ContentSlider.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/Dialog.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/FocusCapture.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/HybridComponent.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/Icon.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/Import.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/PhotoViewer.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/Resize.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/ShowMore.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/Sortable.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/Tabs.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/Tags.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/ThemeSwitcher.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/Timestamp.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/Toast.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/Toggle.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/DeleteRecord.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/Edit.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/ExportCSV.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/ExportJson.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/FirstPage.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/HiddenCount.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/Hide.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/LastPage.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/NextPage.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/PageSelect.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/PageSize.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/PrevPage.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/Search.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/ShowAll.js +0 -0
- /package/{docs/kempo-ui/src → dist}/components/tableControls/TableControl.js +0 -0
- /package/{docs/kempo-ui/src → dist}/lit-all.min.js +0 -0
- /package/{docs/kempo-ui/src → dist}/utils/debounce.js +0 -0
- /package/{docs/kempo-ui/src → dist}/utils/drag.js +0 -0
- /package/{docs/kempo-ui/src → dist}/utils/formatTimestamp.js +0 -0
- /package/{docs/kempo-ui/src → dist}/utils/propConverters.js +0 -0
- /package/{docs/kempo-ui/src → dist}/utils/toTitleCase.js +0 -0
- /package/docs/{kempo-ui/icons → icons}/add.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/arrow-back.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/arrow-down-double.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/arrow-down.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/arrow-forward.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/arrow-up-double.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/arrow-up.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/cards.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/check.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/chevron-left.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/chevron-right.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/close.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/compare.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/delete.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/drag-handle.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/drawing2.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/edit.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/error.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/export-file.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/file-text.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/file.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/filter-off.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/filter.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/first.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/folder-clear.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/folder-create.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/folder-open.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/folder.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/hide.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/image.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/label-add.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/label.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/last.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/menu.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/mode-auto.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/mode-dark.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/mode-light.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/open-in-browser.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/pause.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/play.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/refresh.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/remove.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/save.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/search.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/settings.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/show.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/storage.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/table-visibility.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/tag.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/tools.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/trash-x.svg +0 -0
- /package/docs/{kempo-ui/icons → icons}/warning.svg +0 -0
- /package/docs/{kempo-ui/kempo-hljs.css → kempo-hljs.css} +0 -0
- /package/docs/{kempo-ui/kempo-vars.css → kempo-vars.css} +0 -0
- /package/docs/{kempo-ui/kempo.min.css → kempo.min.css} +0 -0
- /package/docs/{kempo-ui/media → media}/civic.jpg +0 -0
- /package/docs/{kempo-ui/media → media}/corvette.jpg +0 -0
- /package/docs/{kempo-ui/media → media}/evo.jpg +0 -0
- /package/docs/{kempo-ui/media → media}/gtr.jpg +0 -0
- /package/docs/{kempo-ui/media → media}/nsx.jpg +0 -0
- /package/{dist → docs}/src/components/Accordion.js +0 -0
- /package/{dist → docs}/src/components/Card.js +0 -0
- /package/{dist → docs}/src/components/ContentSlider.js +0 -0
- /package/{dist → docs}/src/components/Dialog.js +0 -0
- /package/{dist → docs}/src/components/FocusCapture.js +0 -0
- /package/{dist → docs}/src/components/HybridComponent.js +0 -0
- /package/{dist → docs}/src/components/Icon.js +0 -0
- /package/{dist → docs}/src/components/Import.js +0 -0
- /package/{dist → docs}/src/components/PhotoViewer.js +0 -0
- /package/{dist → docs}/src/components/Resize.js +0 -0
- /package/{dist → docs}/src/components/ShowMore.js +0 -0
- /package/{dist → docs}/src/components/Sortable.js +0 -0
- /package/{dist → docs}/src/components/Tabs.js +0 -0
- /package/{dist → docs}/src/components/Tags.js +0 -0
- /package/{dist → docs}/src/components/ThemeSwitcher.js +0 -0
- /package/{dist → docs}/src/components/Timestamp.js +0 -0
- /package/{dist → docs}/src/components/Toast.js +0 -0
- /package/{dist → docs}/src/components/Toggle.js +0 -0
- /package/{dist → docs}/src/components/tableControls/DeleteRecord.js +0 -0
- /package/{dist → docs}/src/components/tableControls/Edit.js +0 -0
- /package/{dist → docs}/src/components/tableControls/ExportCSV.js +0 -0
- /package/{dist → docs}/src/components/tableControls/ExportJson.js +0 -0
- /package/{dist → docs}/src/components/tableControls/FirstPage.js +0 -0
- /package/{dist → docs}/src/components/tableControls/HiddenCount.js +0 -0
- /package/{dist → docs}/src/components/tableControls/Hide.js +0 -0
- /package/{dist → docs}/src/components/tableControls/LastPage.js +0 -0
- /package/{dist → docs}/src/components/tableControls/NextPage.js +0 -0
- /package/{dist → docs}/src/components/tableControls/PageSelect.js +0 -0
- /package/{dist → docs}/src/components/tableControls/PageSize.js +0 -0
- /package/{dist → docs}/src/components/tableControls/PrevPage.js +0 -0
- /package/{dist → docs}/src/components/tableControls/Search.js +0 -0
- /package/{dist → docs}/src/components/tableControls/ShowAll.js +0 -0
- /package/{dist → docs}/src/components/tableControls/TableControl.js +0 -0
- /package/{dist → docs}/src/lit-all.min.js +0 -0
- /package/{dist → docs}/src/utils/debounce.js +0 -0
- /package/{dist → docs}/src/utils/drag.js +0 -0
- /package/{dist → docs}/src/utils/formatTimestamp.js +0 -0
- /package/{dist → docs}/src/utils/propConverters.js +0 -0
- /package/{dist → docs}/src/utils/toTitleCase.js +0 -0
- /package/docs/{kempo-ui/styles.css → styles.css} +0 -0
|
@@ -0,0 +1,283 @@
|
|
|
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>Content Slider - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
|
+
<link rel="stylesheet" href="../kempo-vars.css" />
|
|
8
|
+
<link rel="stylesheet" href="../kempo.min.css" />
|
|
9
|
+
<link rel="stylesheet" href="../kempo-hljs.css" />
|
|
10
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
11
|
+
<script>window.litDisableBundleWarning = true;</script>
|
|
12
|
+
<script src="../init-1.js" type="module"></script>
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<k-import src="../nav-1.inc.html"></k-import>
|
|
16
|
+
<h1 class="ta-center">Content Slider</h1>
|
|
17
|
+
<main>
|
|
18
|
+
<k-accordion persistent-id="toc" class="b r mb">
|
|
19
|
+
<k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
|
|
20
|
+
<k-accordion-panel name="toc-panel">
|
|
21
|
+
<div class="m ">
|
|
22
|
+
<h6>Examples</h6>
|
|
23
|
+
<a href="#basicUsage">Basic Usage</a><br />
|
|
24
|
+
<a href="#keyboardControls">Keyboard Controls</a><br />
|
|
25
|
+
<a href="#globalControls">Global Controls</a><br />
|
|
26
|
+
<a href="#controls">Controls</a><br />
|
|
27
|
+
<a href="#loop">Loop</a><br />
|
|
28
|
+
<h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
|
|
29
|
+
<a href="#constructor">Constructor</a><br />
|
|
30
|
+
<a href="#requirements">Requirements</a><br />
|
|
31
|
+
<a href="#properties">Properties</a><br />
|
|
32
|
+
<a href="#methods">Methods</a><br />
|
|
33
|
+
<a href="#events">Events</a><br />
|
|
34
|
+
<a href="#slots">Slots</a><br />
|
|
35
|
+
</div>
|
|
36
|
+
</k-accordion-panel>
|
|
37
|
+
</k-accordion>
|
|
38
|
+
|
|
39
|
+
<h3>Description</h3>
|
|
40
|
+
<p>The ContentSlider component provides a way to display multiple content slides with navigation controls. Users can
|
|
41
|
+
navigate through slides using previous/next buttons, keyboard arrows, or programmatically. It extends the <a
|
|
42
|
+
href="./component.html">ShadowComponent</a> class and supports looping, keyboard controls, and customizable
|
|
43
|
+
navigation.</p>
|
|
44
|
+
|
|
45
|
+
<h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
|
|
46
|
+
<div class="row -mx">
|
|
47
|
+
<div class="col d-span-6 t-span-6 m-spane-12 p">
|
|
48
|
+
<k-card label="HTML">
|
|
49
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-content-slider</span><br /> <span class="hljs-attr">class</span>=<span class="hljs-string">"bg-alt"</span><br /> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 10rem"</span><br />></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 1<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 2<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 3<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 4<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-content-slider</span>></span></code></pre>
|
|
50
|
+
</k-card>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="col d-span-6 t-span-6 m-spane-12 p">
|
|
53
|
+
<k-card label="Results">
|
|
54
|
+
<k-content-slider class="bg-alt" style="height: 10rem">
|
|
55
|
+
<div>
|
|
56
|
+
<p>Slide 1</p>
|
|
57
|
+
</div>
|
|
58
|
+
<div>
|
|
59
|
+
<p>Slide 2</p>
|
|
60
|
+
</div>
|
|
61
|
+
<div>
|
|
62
|
+
<p>Slide 3</p>
|
|
63
|
+
</div>
|
|
64
|
+
<div>
|
|
65
|
+
<p>Slide 4</p>
|
|
66
|
+
</div>
|
|
67
|
+
</k-content-slider>
|
|
68
|
+
</k-card>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<h3 id="keyboardControls"><a href="#keyboardControls" class="no-link">Keyboard Controls</a></h3>
|
|
73
|
+
<p>By default the <code>keyboard-controls</code> attribute is set to <code>"true"</code>, which allows the left and
|
|
74
|
+
right keyboard buttons to change the slides when the component is focused. Set it to <code>"false"</code> to
|
|
75
|
+
disable this functionality.</p>
|
|
76
|
+
<div class="row -mx">
|
|
77
|
+
<div class="col d-span-6 t-span-6 m-spane-12 p">
|
|
78
|
+
<k-card label="HTML">
|
|
79
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-content-slider</span><br /> <span class="hljs-attr">class</span>=<span class="hljs-string">"bg-alt"</span><br /> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 10rem"</span><br /> <span class="hljs-attr">keyboard-controls</span>=<span class="hljs-string">"false"</span><br />></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 1<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 2<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 3<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 4<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-content-slider</span>></span></code></pre>
|
|
80
|
+
</k-card>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="col d-span-6 t-span-6 m-spane-12 p">
|
|
83
|
+
<k-card label="Results">
|
|
84
|
+
<k-content-slider class="bg-alt" style="height: 10rem" keyboard-controls="false">
|
|
85
|
+
<div>
|
|
86
|
+
<p>Slide 1</p>
|
|
87
|
+
</div>
|
|
88
|
+
<div>
|
|
89
|
+
<p>Slide 2</p>
|
|
90
|
+
</div>
|
|
91
|
+
<div>
|
|
92
|
+
<p>Slide 3</p>
|
|
93
|
+
</div>
|
|
94
|
+
<div>
|
|
95
|
+
<p>Slide 4</p>
|
|
96
|
+
</div>
|
|
97
|
+
</k-content-slider>
|
|
98
|
+
</k-card>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<h3 id="globalControls"><a href="#globalControls" class="no-link">Global Controls</a></h3>
|
|
103
|
+
<p>Use the <code>global-controls="true"</code> attribute to enable global controls (next and back arrows) anywhere
|
|
104
|
+
in the window, even when this component is not focused. This is suggested when there is only one content slider on
|
|
105
|
+
a page and it is of prominance (large slider on top of the page).</p>
|
|
106
|
+
<div class="row -mx">
|
|
107
|
+
<div class="col d-span-6 t-span-6 m-spane-12 p">
|
|
108
|
+
<k-card label="HTML">
|
|
109
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-content-slider</span><br /> <span class="hljs-attr">class</span>=<span class="hljs-string">"bg-alt"</span><br /> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 10rem"</span><br /> <span class="hljs-attr">global-controls</span>=<span class="hljs-string">"true"</span><br />></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 1<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 2<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 3<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 4<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-content-slider</span>></span></code></pre>
|
|
110
|
+
</k-card>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="col d-span-6 t-span-6 m-spane-12 p">
|
|
113
|
+
<k-card label="Results">
|
|
114
|
+
<k-content-slider class="bg-alt" style="height: 10rem" global-controls="true">
|
|
115
|
+
<div>
|
|
116
|
+
<p>Slide 1</p>
|
|
117
|
+
</div>
|
|
118
|
+
<div>
|
|
119
|
+
<p>Slide 2</p>
|
|
120
|
+
</div>
|
|
121
|
+
<div>
|
|
122
|
+
<p>Slide 3</p>
|
|
123
|
+
</div>
|
|
124
|
+
<div>
|
|
125
|
+
<p>Slide 4</p>
|
|
126
|
+
</div>
|
|
127
|
+
</k-content-slider>
|
|
128
|
+
</k-card>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<h3 id="controls"><a href="#controls" class="no-link">Controls</a></h3>
|
|
133
|
+
<p>By default the <code>controls</code> attribute is set to <code>"true"</code>, this shows the previous and next
|
|
134
|
+
buttons. To hide them set <code>controls="false"</code>.</p>
|
|
135
|
+
<div class="row -mx">
|
|
136
|
+
<div class="col d-span-6 t-span-6 m-spane-12 p">
|
|
137
|
+
<k-card label="HTML">
|
|
138
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-content-slider</span><br /> <span class="hljs-attr">class</span>=<span class="hljs-string">"bg-alt"</span><br /> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 10rem"</span><br /> <span class="hljs-attr">controls</span>=<span class="hljs-string">"false"</span><br />></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 1<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 2<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 3<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 4<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-content-slider</span>></span></code></pre>
|
|
139
|
+
</k-card>
|
|
140
|
+
</div>
|
|
141
|
+
<div class="col d-span-6 t-span-6 m-spane-12 p">
|
|
142
|
+
<k-card label="Results">
|
|
143
|
+
<k-content-slider class="bg-alt" style="height: 10rem" controls="false">
|
|
144
|
+
<div>
|
|
145
|
+
<p>Slide 1</p>
|
|
146
|
+
</div>
|
|
147
|
+
<div>
|
|
148
|
+
<p>Slide 2</p>
|
|
149
|
+
</div>
|
|
150
|
+
<div>
|
|
151
|
+
<p>Slide 3</p>
|
|
152
|
+
</div>
|
|
153
|
+
<div>
|
|
154
|
+
<p>Slide 4</p>
|
|
155
|
+
</div>
|
|
156
|
+
</k-content-slider>
|
|
157
|
+
</k-card>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
<h3 id="loop"><a href="#loop" class="no-link">Loop</a></h3>
|
|
162
|
+
<p>To make the slider loop (go back to the beginning after it hits the last slide) use the <code>loop="true"</code>
|
|
163
|
+
attribute.</p>
|
|
164
|
+
<div class="row -mx">
|
|
165
|
+
<div class="col d-span-6 t-span-6 m-spane-12 p">
|
|
166
|
+
<k-card label="HTML">
|
|
167
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-content-slider</span><br /> <span class="hljs-attr">class</span>=<span class="hljs-string">"bg-alt"</span><br /> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 10rem"</span><br /> <span class="hljs-attr">loop</span>=<span class="hljs-string">"true"</span><br />></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 1<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 2<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 3<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">div</span>></span><span class="hljs-tag"><<span class="hljs-name">p</span>></span>Slide 4<span class="hljs-tag"></<span class="hljs-name">p</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-content-slider</span>></span></code></pre>
|
|
168
|
+
</k-card>
|
|
169
|
+
</div>
|
|
170
|
+
<div class="col d-span-6 t-span-6 m-spane-12 p">
|
|
171
|
+
<k-card label="Results">
|
|
172
|
+
<k-content-slider class="bg-alt" style="height: 10rem" loop="true">
|
|
173
|
+
<div>
|
|
174
|
+
<p>Slide 1</p>
|
|
175
|
+
</div>
|
|
176
|
+
<div>
|
|
177
|
+
<p>Slide 2</p>
|
|
178
|
+
</div>
|
|
179
|
+
<div>
|
|
180
|
+
<p>Slide 3</p>
|
|
181
|
+
</div>
|
|
182
|
+
<div>
|
|
183
|
+
<p>Slide 4</p>
|
|
184
|
+
</div>
|
|
185
|
+
</k-content-slider>
|
|
186
|
+
</k-card>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<h2 id="jsRef" class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
|
|
191
|
+
|
|
192
|
+
<h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
|
|
193
|
+
<h6>Extends <a href="./component.html">ShadowComponent</a></h6>
|
|
194
|
+
<h5>
|
|
195
|
+
<code>new ContentSlider()</code>
|
|
196
|
+
</h5>
|
|
197
|
+
|
|
198
|
+
<h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
|
|
199
|
+
<ul>
|
|
200
|
+
<li><a href="./component.html">ShadowComponent</a></li>
|
|
201
|
+
<li><a href="./icon.html">Icon</a></li>
|
|
202
|
+
</ul>
|
|
203
|
+
|
|
204
|
+
<h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
|
|
205
|
+
<h5><code>index<i>: number</i></code></h5>
|
|
206
|
+
<p>Gets or sets the current slide index. Automatically validates to stay within bounds. Syncs to <code>index</code>
|
|
207
|
+
attribute. Default value is <code>0</code>.</p>
|
|
208
|
+
|
|
209
|
+
<h5><code>controls<i>: boolean</i></code></h5>
|
|
210
|
+
<p>Gets or sets whether control buttons are visible. Syncs to <code>controls</code> attribute. Default value is
|
|
211
|
+
<code>true</code>.</p>
|
|
212
|
+
|
|
213
|
+
<h5><code>keyboardControls<i>: boolean</i></code></h5>
|
|
214
|
+
<p>Gets or sets whether keyboard controls are enabled. Syncs to <code>keyboard-controls</code> attribute. Default
|
|
215
|
+
value is <code>true</code>.</p>
|
|
216
|
+
|
|
217
|
+
<h5><code>globalControls<i>: boolean</i></code></h5>
|
|
218
|
+
<p>Gets or sets whether global keyboard controls are enabled. Use with caution - recommended only for prominent
|
|
219
|
+
sliders. Syncs to <code>global-controls</code> attribute. Default value is <code>false</code>.</p>
|
|
220
|
+
|
|
221
|
+
<h5><code>loop<i>: boolean</i></code></h5>
|
|
222
|
+
<p>Gets or sets whether the slider loops continuously (after the last slide, go to the first; before the first
|
|
223
|
+
slide, go to the last). Syncs to <code>loop</code> attribute. Default value is <code>false</code>.</p>
|
|
224
|
+
|
|
225
|
+
<h5><code>content<i>: Array<HTMLElement></i></code></h5>
|
|
226
|
+
<p>Array of child elements that serve as slides. Automatically updated when the component is connected.</p>
|
|
227
|
+
|
|
228
|
+
<h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
|
|
229
|
+
<h5><code>previous()<i>: void</i></code></h5>
|
|
230
|
+
<p>Navigates to the previous slide. If <code>loop</code> is enabled and currently on the first slide, goes to the
|
|
231
|
+
last slide. Dispatches a <code>previous</code> event.</p>
|
|
232
|
+
|
|
233
|
+
<h5><code>next()<i>: void</i></code></h5>
|
|
234
|
+
<p>Navigates to the next slide. If <code>loop</code> is enabled and currently on the last slide, goes to the first
|
|
235
|
+
slide. Dispatches a <code>next</code> event.</p>
|
|
236
|
+
|
|
237
|
+
<h5><code>goto(index)<i>: void</i></code></h5>
|
|
238
|
+
<p>Navigates to the slide at the specified index. Index is automatically validated to stay within bounds. Dispatches
|
|
239
|
+
a <code>goto</code> event.</p>
|
|
240
|
+
<ul>
|
|
241
|
+
<li><strong>index</strong> <code>number</code> - The zero-based index of the slide to navigate to</li>
|
|
242
|
+
</ul>
|
|
243
|
+
|
|
244
|
+
<h3 id="events"><a href="#events" class="no-link">Events</a></h3>
|
|
245
|
+
<h5><code>change</code></h5>
|
|
246
|
+
<p>Fired when the active slide changes. The event detail contains <code>{ index }</code>.</p>
|
|
247
|
+
|
|
248
|
+
<h5><code>previous</code></h5>
|
|
249
|
+
<p>Fired when the previous button is clicked or previous navigation is triggered. The event detail contains
|
|
250
|
+
<code>{ index }</code> of the target slide.</p>
|
|
251
|
+
|
|
252
|
+
<h5><code>next</code></h5>
|
|
253
|
+
<p>Fired when the next button is clicked or next navigation is triggered. The event detail contains
|
|
254
|
+
<code>{ index }</code> of the target slide.</p>
|
|
255
|
+
|
|
256
|
+
<h5><code>goto</code></h5>
|
|
257
|
+
<p>Fired when programmatic navigation to a specific slide occurs. The event detail contains <code>{ index }</code>
|
|
258
|
+
of the target slide.</p>
|
|
259
|
+
|
|
260
|
+
<h5><code>keyleft</code></h5>
|
|
261
|
+
<p>Fired when the left arrow key is pressed (before triggering previous navigation).</p>
|
|
262
|
+
|
|
263
|
+
<h5><code>keyright</code></h5>
|
|
264
|
+
<p>Fired when the right arrow key is pressed (before triggering next navigation).</p>
|
|
265
|
+
|
|
266
|
+
<h3 id="slots"><a href="#slots" class="no-link">Slots</a></h3>
|
|
267
|
+
<h5><code>Default Slot</code></h5>
|
|
268
|
+
<p>The main content area where slide elements are placed. Each direct child element becomes a slide.</p>
|
|
269
|
+
|
|
270
|
+
<h5><code>prev</code></h5>
|
|
271
|
+
<p>Custom content for the previous button. Defaults to a left chevron icon if not provided.</p>
|
|
272
|
+
|
|
273
|
+
<h5><code>next</code></h5>
|
|
274
|
+
<p>Custom content for the next button. Defaults to a right chevron icon if not provided.</p>
|
|
275
|
+
|
|
276
|
+
</main>
|
|
277
|
+
<div style="height:33vh"></div>
|
|
278
|
+
<script type="module" src="../src/components/Import.js"></script>
|
|
279
|
+
<script type="module" src="../src/components/ContentSlider.js"></script>
|
|
280
|
+
<script type="module" src="../src/components/Accordion.js"></script>
|
|
281
|
+
<script type="module" src="../src/components/Card.js"></script>
|
|
282
|
+
</body>
|
|
283
|
+
</html>
|
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<base href="/kempo-ui/">
|
|
5
4
|
<meta charset="UTF-8">
|
|
6
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
6
|
<title>Dialog - Components - Kempo Docs - A Web Components Solution</title>
|
|
8
|
-
<link rel="stylesheet" href="kempo-vars.css" />
|
|
9
|
-
<link rel="stylesheet" href="kempo.min.css" />
|
|
10
|
-
<link rel="stylesheet" href="kempo-hljs.css" />
|
|
11
|
-
<link rel="stylesheet" href="styles.css" />
|
|
7
|
+
<link rel="stylesheet" href="../kempo-vars.css" />
|
|
8
|
+
<link rel="stylesheet" href="../kempo.min.css" />
|
|
9
|
+
<link rel="stylesheet" href="../kempo-hljs.css" />
|
|
10
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
12
11
|
<script>window.litDisableBundleWarning = true;</script>
|
|
12
|
+
<script src="../init-1.js" type="module"></script>
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
|
-
<k-import src="
|
|
15
|
+
<k-import src="../nav-1.inc.html"></k-import>
|
|
16
16
|
<main>
|
|
17
17
|
<h1 class="ta-center">Dialog</h1>
|
|
18
18
|
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
<k-accordion persistent-id="toc" class="b r mb">
|
|
20
|
+
<k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
|
|
21
|
+
<k-accordion-panel name="toc-panel">
|
|
22
|
+
<div class="m ">
|
|
23
|
+
<h6>Examples</h6>
|
|
24
|
+
<a href="#basicUsage">Basic Usage</a><br />
|
|
25
|
+
<a href="#titles">Titles</a><br />
|
|
26
|
+
<a href="#actionButtons">Action Buttons</a><br />
|
|
27
|
+
<a href="#jsUsage">JavaScript Usage</a><br />
|
|
28
|
+
<a href="#confirmDialog">Confirm Dialog</a><br />
|
|
29
|
+
|
|
30
|
+
<h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
|
|
31
|
+
<a href="#constructor">Constructor</a><br />
|
|
32
|
+
<a href="#requirements">Requirements</a><br />
|
|
33
|
+
<a href="#attributes">Attributes</a><br />
|
|
34
|
+
<a href="#properties">Properties</a><br />
|
|
35
|
+
<a href="#methods">Methods</a><br />
|
|
36
|
+
<a href="#staticMethods">Static Methods</a><br />
|
|
37
|
+
</div>
|
|
38
|
+
</k-accordion-panel>
|
|
39
|
+
</k-accordion>
|
|
38
40
|
|
|
39
41
|
<h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
|
|
40
42
|
<p>Create dialogs using the <code>k-dialog</code> component. Open the dialog by calling the <code>open()</code> method, and close it by calling the <code>close()</code> method. Or it can be closed using the dialog's GUI (clicking the overlay, clicking the close button, or the cancel or confirm action buttons).</p>
|
|
@@ -92,20 +94,20 @@
|
|
|
92
94
|
|
|
93
95
|
<h3 id="jsUsage"><a href="#jsUsage" class="no-link">JavaScript Usage</a></h3>
|
|
94
96
|
<h5>Create Dialog</h5>
|
|
95
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d7"</span>></span>Open Dialog<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>></span><span class="javascript"><br /> <span class="hljs-keyword">import</span> Dialog <span class="hljs-keyword">from</span> <span class="hljs-string">'/
|
|
97
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d7"</span>></span>Open Dialog<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>></span><span class="javascript"><br /> <span class="hljs-keyword">import</span> Dialog <span class="hljs-keyword">from</span> <span class="hljs-string">'/src/components/Dialog.js'</span>;<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'d7'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Dialog.create(<span class="hljs-string">'Hello World'</span>);<br /> });<br /></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
96
98
|
<button id="d7" class="mb">Open Dialog</button>
|
|
97
99
|
<script type="module">
|
|
98
|
-
import Dialog from '/
|
|
100
|
+
import Dialog from '/src/components/Dialog.js';
|
|
99
101
|
document.getElementById('d7').addEventListener('click', () => {
|
|
100
102
|
Dialog.create('Hello World');
|
|
101
103
|
});
|
|
102
104
|
</script>
|
|
103
105
|
|
|
104
106
|
<h5>Dialog with Title</h5>
|
|
105
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d7b"</span>></span>Open Dialog with Title<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>></span><span class="javascript"><br /> <span class="hljs-keyword">import</span> Dialog <span class="hljs-keyword">from</span> <span class="hljs-string">'/
|
|
107
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d7b"</span>></span>Open Dialog with Title<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>></span><span class="javascript"><br /> <span class="hljs-keyword">import</span> Dialog <span class="hljs-keyword">from</span> <span class="hljs-string">'/src/components/Dialog.js'</span>;<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'d7b'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Dialog.create(<span class="hljs-string">'This is the dialog content'</span>, {<br /> <span class="hljs-attr">title</span>: <span class="hljs-string">'My Dialog Title'</span><br /> });<br /> });<br /></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
106
108
|
<button id="d7b" class="mb">Open Dialog with Title</button>
|
|
107
109
|
<script type="module">
|
|
108
|
-
import Dialog from '/
|
|
110
|
+
import Dialog from '/src/components/Dialog.js';
|
|
109
111
|
document.getElementById('d7b').addEventListener('click', () => {
|
|
110
112
|
Dialog.create('This is the dialog content', {
|
|
111
113
|
title: 'My Dialog Title'
|
|
@@ -114,10 +116,10 @@
|
|
|
114
116
|
</script>
|
|
115
117
|
|
|
116
118
|
<h5>Error Dialog</h5>
|
|
117
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d8"</span>></span>Open Dialog<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>></span><span class="javascript"><br /> <span class="hljs-keyword">import</span> Dialog <span class="hljs-keyword">from</span> <span class="hljs-string">'/
|
|
119
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d8"</span>></span>Open Dialog<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>></span><span class="javascript"><br /> <span class="hljs-keyword">import</span> Dialog <span class="hljs-keyword">from</span> <span class="hljs-string">'/src/components/Dialog.js'</span>;<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'d8'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Dialog.error(<span class="hljs-string">"Oh no, don't do that!"</span>);<br /> });<br /></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
118
120
|
<button id="d8" class="mb">Open Dialog</button>
|
|
119
121
|
<script type="module">
|
|
120
|
-
import Dialog from '/
|
|
122
|
+
import Dialog from '/src/components/Dialog.js';
|
|
121
123
|
document.getElementById('d8').addEventListener('click', () => {
|
|
122
124
|
Dialog.error("Oh no, don't do that!");
|
|
123
125
|
});
|
|
@@ -125,10 +127,10 @@
|
|
|
125
127
|
|
|
126
128
|
<h3 id="confirmDialog"><a href="#confirmDialog" class="no-link">Confirm Dialog</a></h3>
|
|
127
129
|
<p>Use the <code>Dialog.confirm</code> static method to create a confirmation dialog. This method takes a text message, a response callback, and an options object.</p>
|
|
128
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d9"</span>></span>Open Confirm Dialog<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>></span><span class="javascript"><br /> <span class="hljs-keyword">import</span> Dialog <span class="hljs-keyword">from</span> <span class="hljs-string">'/
|
|
130
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d9"</span>></span>Open Confirm Dialog<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"module"</span>></span><span class="javascript"><br /> <span class="hljs-keyword">import</span> Dialog <span class="hljs-keyword">from</span> <span class="hljs-string">'/src/components/Dialog.js'</span>;<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'d9'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Dialog.confirm(<span class="hljs-string">"Are you sure you want to proceed?"</span>, <span class="hljs-function"><span class="hljs-params">response</span> =></span> {<br /> <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"User response:"</span>, response);<br /> });<br /> });<br /></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
129
131
|
<button id="d9" class="mb">Open Confirm Dialog</button>
|
|
130
132
|
<script type="module">
|
|
131
|
-
import Dialog from '/
|
|
133
|
+
import Dialog from '/src/components/Dialog.js';
|
|
132
134
|
document.getElementById('d9').addEventListener('click', () => {
|
|
133
135
|
Dialog.confirm("Are you sure you want to proceed?", response => {
|
|
134
136
|
console.log("User response:", response);
|
|
@@ -136,10 +138,10 @@
|
|
|
136
138
|
});
|
|
137
139
|
</script>
|
|
138
140
|
|
|
139
|
-
<h2 id="jsRef">JavaScript Reference</h2>
|
|
141
|
+
<h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
|
|
140
142
|
|
|
141
143
|
<h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
|
|
142
|
-
<h6>Extends <a href="
|
|
144
|
+
<h6>Extends <a href="./components/shadow-component.html">ShadowComponent</a></h6>
|
|
143
145
|
<h5>
|
|
144
146
|
<code>new Dialog()</code><br />
|
|
145
147
|
<code>new Dialog(<i>object</i> options)</code>
|
|
@@ -163,9 +165,9 @@
|
|
|
163
165
|
|
|
164
166
|
<h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
|
|
165
167
|
<ul>
|
|
166
|
-
<li><a href="
|
|
167
|
-
<li><a href="
|
|
168
|
-
<li><a href="
|
|
168
|
+
<li><a href="./components/shadow-component.html">ShadowComponent</a></li>
|
|
169
|
+
<li><a href="./components/icon.html">Icon</a></li>
|
|
170
|
+
<li><a href="./components/focus-capture.html">FocusCapture</a></li>
|
|
169
171
|
</ul>
|
|
170
172
|
|
|
171
173
|
<h3 id="attributes"><a href="#attributes" class="no-link">Attributes</a></h3>
|
|
@@ -325,8 +327,10 @@
|
|
|
325
327
|
|
|
326
328
|
</main>
|
|
327
329
|
<div style="height:33vh"></div>
|
|
328
|
-
<script type="module" src="
|
|
329
|
-
<script type="module" src="
|
|
330
|
+
<script type="module" src="../src/components/Dialog.js"></script>
|
|
331
|
+
<script type="module" src="../src/components/Import.js"></script>
|
|
332
|
+
<script type="module" src="../src/components/Accordion.js"></script>
|
|
333
|
+
<script type="module" src="../src/components/Card.js"></script>
|
|
330
334
|
<script>
|
|
331
335
|
document.querySelectorAll('.openDialog').forEach( $btn => {
|
|
332
336
|
$btn.addEventListener('click', () => {
|
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<base href="/kempo-ui/">
|
|
5
4
|
<meta charset="UTF-8">
|
|
6
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
6
|
<title>FocusCapture - Components - Kempo Docs - A Web Components Solution</title>
|
|
8
|
-
<link rel="stylesheet" href="kempo-vars.css" />
|
|
9
|
-
<link rel="stylesheet" href="kempo.min.css" />
|
|
10
|
-
<link rel="stylesheet" href="kempo-hljs.css" />
|
|
11
|
-
<link rel="stylesheet" href="styles.css" />
|
|
7
|
+
<link rel="stylesheet" href="../kempo-vars.css" />
|
|
8
|
+
<link rel="stylesheet" href="../kempo.min.css" />
|
|
9
|
+
<link rel="stylesheet" href="../kempo-hljs.css" />
|
|
10
|
+
<link rel="stylesheet" href="../styles.css" />
|
|
12
11
|
<script>window.litDisableBundleWarning = true;</script>
|
|
12
|
+
<script src="../init-1.js" type="module"></script>
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
|
-
<k-import src="
|
|
15
|
+
<k-import src="../nav-1.inc.html"></k-import>
|
|
16
16
|
<h1 class="ta-center">FocusCapture</h1>
|
|
17
17
|
<main>
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
<k-accordion persistent-id="toc" class="b r mb">
|
|
19
|
+
<k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
|
|
20
|
+
<k-accordion-panel name="toc-panel">
|
|
21
|
+
<div class="m ">
|
|
22
|
+
<h6>Examples</h6>
|
|
23
|
+
<a href="#basicUsage">Basic Usage</a><br />
|
|
24
|
+
<a href="#dialogExample">Dialog Example</a><br />
|
|
25
|
+
|
|
26
|
+
<h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
|
|
27
|
+
<a href="#constructor">Constructor</a><br />
|
|
28
|
+
<a href="#requirements">Requirements</a><br />
|
|
29
|
+
<a href="#properties">Properties</a><br />
|
|
30
|
+
<a href="#methods">Methods</a><br />
|
|
31
|
+
</div>
|
|
32
|
+
</k-accordion-panel>
|
|
33
|
+
</k-accordion>
|
|
32
34
|
|
|
33
35
|
<h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
|
|
34
36
|
<p>The <code>k-focus-capture</code> component traps focus within its children. When focus reaches the end of the focusable elements, it cycles back to the first focusable element. This is useful for modal dialogs, side menus, or any UI where you want to keep focus contained within a specific area.</p>
|
|
@@ -103,8 +105,11 @@
|
|
|
103
105
|
|
|
104
106
|
</main>
|
|
105
107
|
<div style="height:33vh"></div>
|
|
106
|
-
<script type="module" src="
|
|
107
|
-
<script type="module" src="
|
|
108
|
-
<script type="module" src="
|
|
108
|
+
<script type="module" src="../src/components/Import.js"></script>
|
|
109
|
+
<script type="module" src="../src/components/FocusCapture.js"></script>
|
|
110
|
+
<script type="module" src="../src/components/Dialog.js"></script>
|
|
111
|
+
<script type="module" src="../src/components/Accordion.js"></script>
|
|
112
|
+
<script type="module" src="../src/components/Card.js"></script>
|
|
113
|
+
|
|
109
114
|
</body>
|
|
110
115
|
</html>
|