kempo-ui 0.0.13 → 0.0.15
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/kempo-vars.css +1 -0
- package/docs/dev.config.json +5 -9
- package/docs/kempo-ui/components/accordion.html +236 -0
- package/docs/{components → kempo-ui/components}/card.html +8 -7
- package/docs/{components → kempo-ui/components}/content-slider.html +8 -7
- package/docs/kempo-ui/components/dialog.html +339 -0
- package/docs/{components → kempo-ui/components}/focus-capture.html +9 -8
- package/docs/{components → kempo-ui/components}/hybrid-component.html +7 -6
- package/docs/{components → kempo-ui/components}/icon.html +9 -8
- package/docs/{components → kempo-ui/components}/import.html +8 -7
- package/docs/{components → kempo-ui/components}/light-component.html +7 -6
- package/docs/{components → kempo-ui/components}/photo-viewer.html +8 -7
- package/docs/{components → kempo-ui/components}/resize.html +8 -7
- package/docs/{components → kempo-ui/components}/shadow-component.html +7 -6
- package/docs/{components → kempo-ui/components}/show-more.html +8 -7
- package/docs/{components → kempo-ui/components}/side-menu.html +8 -8
- package/docs/{components → kempo-ui/components}/sortable.html +8 -7
- package/docs/{components → kempo-ui/components}/split.html +9 -8
- package/docs/{components → kempo-ui/components}/table.html +32 -32
- package/docs/{components → kempo-ui/components}/tableControls.html +12 -12
- package/docs/{components → kempo-ui/components}/tableCustomFields.html +9 -9
- package/docs/{components → kempo-ui/components}/tableFetchRecords.html +16 -16
- package/docs/{components → kempo-ui/components}/tableFieldSortHide.html +11 -11
- package/docs/{components → kempo-ui/components}/tablePagination.html +17 -17
- package/docs/{components → kempo-ui/components}/tableRecordEditing.html +12 -12
- package/docs/{components → kempo-ui/components}/tableRecordFiltering.html +11 -11
- package/docs/{components → kempo-ui/components}/tableRecordHiding.html +13 -13
- package/docs/{components → kempo-ui/components}/tableRecordSearching.html +11 -11
- package/docs/{components → kempo-ui/components}/tableRecordSelection.html +11 -11
- package/docs/{components → kempo-ui/components}/tableRowControls.html +12 -12
- package/docs/{components → kempo-ui/components}/tableSorting.html +9 -9
- package/docs/{components → kempo-ui/components}/tabs.html +8 -7
- package/docs/{components → kempo-ui/components}/tags.html +8 -7
- package/docs/{components → kempo-ui/components}/theme-switcher.html +8 -7
- package/docs/{components → kempo-ui/components}/timestamp.html +8 -7
- package/docs/kempo-ui/components/toast.html +315 -0
- package/docs/{components → kempo-ui/components}/toggle.html +8 -7
- package/docs/{components → kempo-ui/components}/tree.html +16 -14
- package/docs/{index.html → kempo-ui/index.html} +7 -18
- package/docs/kempo-ui/kempo-vars.css +1 -0
- package/docs/kempo-ui/nav.inc.html +67 -0
- package/docs/kempo-ui/utils/debounce.html +56 -0
- package/docs/{utils → kempo-ui/utils}/drag.html +8 -17
- package/docs/{utils → kempo-ui/utils}/formatTimestamp.html +12 -29
- package/docs/kempo-ui/utils/propConverters.html +90 -0
- package/docs/{utils → kempo-ui/utils}/toTitleCase.html +7 -6
- package/docs/kempo-ui/utils/watchWindowSize.html +72 -0
- package/docs/prod.config.json +0 -8
- package/package.json +2 -2
- package/scripts/build.js +8 -8
- package/scripts/docs.js +3 -0
- package/src/components/Accordion.js +145 -57
- package/src/components/Tabs.js +14 -23
- package/src/kempo-vars.css +1 -0
- package/docs/components/accordion.html +0 -161
- package/docs/components/collapsible.html +0 -193
- package/docs/components/dialog.html +0 -105
- package/docs/components/init.js +0 -7
- package/docs/components/persistant-collapsible.html +0 -117
- package/docs/components/toast.html +0 -52
- package/docs/init.js +0 -7
- package/docs/kempo-vars.css +0 -0
- package/docs/kempo.css +0 -1
- package/docs/nav.inc.html +0 -69
- package/docs/utils/debounce.html +0 -74
- package/docs/utils/init.js +0 -8
- package/docs/utils/propConverters.html +0 -128
- package/docs/utils/watchWindowSize.html +0 -162
- package/src/components/Collapsible.js +0 -109
- package/src/components/PersistantCollapsible.js +0 -69
- /package/docs/{icons → kempo-ui/icons}/add.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/arrow-back.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/arrow-down-double.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/arrow-down.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/arrow-forward.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/arrow-up-double.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/arrow-up.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/cards.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/check.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/chevron-left.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/chevron-right.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/close.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/compare.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/delete.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/drag-handle.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/drawing2.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/edit.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/error.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/export-file.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/file-text.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/file.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/filter-off.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/filter.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/first.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/folder-clear.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/folder-create.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/folder-open.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/folder.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/hide.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/image.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/label-add.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/label.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/last.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/menu.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/mode-auto.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/mode-dark.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/mode-light.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/open-in-browser.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/pause.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/play.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/refresh.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/remove.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/save.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/search.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/settings.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/show.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/storage.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/table-visibility.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/tag.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/tools.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/trash-x.svg +0 -0
- /package/docs/{icons → kempo-ui/icons}/warning.svg +0 -0
- /package/docs/{kempo-hljs.css → kempo-ui/kempo-hljs.css} +0 -0
- /package/docs/{kempo.min.css → kempo-ui/kempo.min.css} +0 -0
- /package/docs/{media → kempo-ui/media}/civic.jpg +0 -0
- /package/docs/{media → kempo-ui/media}/corvette.jpg +0 -0
- /package/docs/{media → kempo-ui/media}/evo.jpg +0 -0
- /package/docs/{media → kempo-ui/media}/gtr.jpg +0 -0
- /package/docs/{media → kempo-ui/media}/nsx.jpg +0 -0
- /package/docs/{nav.inc.js → kempo-ui/nav.inc.js} +0 -0
- /package/docs/{src → kempo-ui/src}/components/Accordion.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Card.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Collapsible.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/ContentSlider.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Dialog.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/FocusCapture.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/HybridComponent.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Icon.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Import.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/LightComponent.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/PersistantCollapsible.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/PhotoViewer.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Resize.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/ShadowComponent.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/ShowMore.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/SideMenu.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Sortable.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Split.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Table.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Tabs.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Tags.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/ThemeSwitcher.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Timestamp.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Toast.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Toggle.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/Tree.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/DeleteRecord.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/Edit.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/ExportCSV.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/ExportJson.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/FieldSortHide.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/Filters.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/FirstPage.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/HiddenCount.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/Hide.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/LastPage.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/NextPage.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/PageSelect.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/PageSize.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/PrevPage.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/Search.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/ShowAll.js +0 -0
- /package/docs/{src → kempo-ui/src}/components/tableControls/TableControl.js +0 -0
- /package/docs/{src → kempo-ui/src}/lit-all.min.js +0 -0
- /package/docs/{src → kempo-ui/src}/utils/debounce.js +0 -0
- /package/docs/{src → kempo-ui/src}/utils/drag.js +0 -0
- /package/docs/{src → kempo-ui/src}/utils/formatTimestamp.js +0 -0
- /package/docs/{src → kempo-ui/src}/utils/propConverters.js +0 -0
- /package/docs/{src → kempo-ui/src}/utils/toTitleCase.js +0 -0
- /package/docs/{src → kempo-ui/src}/utils/watchWindowSize.js +0 -0
- /package/docs/{styles.css → kempo-ui/styles.css} +0 -0
|
@@ -1,161 +0,0 @@
|
|
|
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>Accordion - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
|
-
<link rel="stylesheet" href="../kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../kempo-hljs.css" />
|
|
9
|
-
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
-
<script>window.litDisableBundleWarning = true;</script>
|
|
11
|
-
<script type="module" src="./init.js"></script>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<k-import src="../nav.inc.html"></k-import>
|
|
15
|
-
<h1 class="ta-center">Accordion</h1>
|
|
16
|
-
<main>
|
|
17
|
-
<details
|
|
18
|
-
class="b r mb"
|
|
19
|
-
>
|
|
20
|
-
<summary class="p">Table of Contents</summary>
|
|
21
|
-
<div class="m mt0 pl">
|
|
22
|
-
<h6>Examples</h6>
|
|
23
|
-
<a href="#basicUsage">Basic Usage</a><br />
|
|
24
|
-
<a href="#defaultOpen">Default Open Panel</a><br />
|
|
25
|
-
<h6 class="mt">JavaScript Reference</h6>
|
|
26
|
-
<a href="#constructor">Constructor</a><br />
|
|
27
|
-
<a href="#requirements">Requirements</a><br />
|
|
28
|
-
<a href="#properties">Properties</a><br />
|
|
29
|
-
<a href="#methods">Methods</a><br />
|
|
30
|
-
<a href="#events">Events</a><br />
|
|
31
|
-
</div>
|
|
32
|
-
</details>
|
|
33
|
-
|
|
34
|
-
<h3>Description</h3>
|
|
35
|
-
<p>A widget that allows a single panel of content to be opened and closed.</p>
|
|
36
|
-
|
|
37
|
-
<h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
|
|
38
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-accordion</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">k-accordion-header</span> <span class="hljs-attr">for-panel</span>=<span class="hljs-string">"panel1"</span>></span>Panel 1<span class="hljs-tag"></<span class="hljs-name">k-accordion-header</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">k-accordion-panel</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"panel1"</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"m"</span>></span>Panel 1 content<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-accordion-panel</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">k-accordion-header</span> <span class="hljs-attr">for-panel</span>=<span class="hljs-string">"panel2"</span>></span>Panel 2<span class="hljs-tag"></<span class="hljs-name">k-accordion-header</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">k-accordion-panel</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"panel2"</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"m"</span>></span>Panel 2 content<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-accordion-panel</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">k-accordion-header</span> <span class="hljs-attr">for-panel</span>=<span class="hljs-string">"panel3"</span>></span>Panel 3<span class="hljs-tag"></<span class="hljs-name">k-accordion-header</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">k-accordion-panel</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"panel3"</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"m"</span>></span>Panel 3 content<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-accordion-panel</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-accordion</span>></span></code></pre>
|
|
39
|
-
<k-accordion
|
|
40
|
-
class="mb"
|
|
41
|
-
>
|
|
42
|
-
<k-accordion-header for-panel="panel1">Panel 1</k-accordion-header>
|
|
43
|
-
<k-accordion-panel name="panel1">
|
|
44
|
-
<p class="m">Panel 1 content</p>
|
|
45
|
-
</k-accordion-panel>
|
|
46
|
-
<k-accordion-header for-panel="panel2">Panel 2</k-accordion-header>
|
|
47
|
-
<k-accordion-panel name="panel2">
|
|
48
|
-
<p class="m">Panel 2 content</p>
|
|
49
|
-
</k-accordion-panel>
|
|
50
|
-
<k-accordion-header for-panel="panel3">Panel 3</k-accordion-header>
|
|
51
|
-
<k-accordion-panel name="panel3">
|
|
52
|
-
<p class="m">Panel 3 content</p>
|
|
53
|
-
</k-accordion-panel>
|
|
54
|
-
</k-accordion>
|
|
55
|
-
|
|
56
|
-
<h3 id="defaultOpen"><a href="#defaultOpen" class="no-link">Default Open Panel</a></h3>
|
|
57
|
-
<p>You can have a panel open by default by setting the <code>active</code> attribute to <code>true</code> on both the header and the panel.</p>
|
|
58
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-accordion</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">k-accordion-header</span> <span class="hljs-attr">for-panel</span>=<span class="hljs-string">"panel1"</span> <span class="hljs-attr">active</span>=<span class="hljs-string">"true"</span>></span>Panel 1<span class="hljs-tag"></<span class="hljs-name">k-accordion-header</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">k-accordion-panel</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"panel1"</span> <span class="hljs-attr">active</span>=<span class="hljs-string">"true"</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"m"</span>></span>Panel 1 content<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br /> <span class="hljs-tag"></<span class="hljs-name">k-accordion-panel</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">k-accordion-header</span> <span class="hljs-attr">for-panel</span>=<span class="hljs-string">"panel2"</span>></span>Panel 2<span class="hljs-tag"></<span class="hljs-name">k-accordion-header</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">k-accordion-panel</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"panel2"</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"m"</span>></span>Panel 2 content<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br /> <span class="hljs-tag"></<span class="hljs-name">k-accordion-panel</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">k-accordion-header</span> <span class="hljs-attr">for-panel</span>=<span class="hljs-string">"panel3"</span>></span>Panel 3<span class="hljs-tag"></<span class="hljs-name">k-accordion-header</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">k-accordion-panel</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"panel3"</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"m"</span>></span>Panel 3 content<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br /> <span class="hljs-tag"></<span class="hljs-name">k-accordion-panel</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-accordion</span>></span></code></pre>
|
|
59
|
-
<k-accordion
|
|
60
|
-
class="mb"
|
|
61
|
-
>
|
|
62
|
-
<k-accordion-header for-panel="panel1" active="true">Panel 1</k-accordion-header>
|
|
63
|
-
<k-accordion-panel name="panel1" active="true">
|
|
64
|
-
<p class="m">Panel 1 content</p>
|
|
65
|
-
</k-accordion-panel>
|
|
66
|
-
<k-accordion-header for-panel="panel2">Panel 2</k-accordion-header>
|
|
67
|
-
<k-accordion-panel name="panel2">
|
|
68
|
-
<p class="m">Panel 2 content</p>
|
|
69
|
-
</k-accordion-panel>
|
|
70
|
-
<k-accordion-header for-panel="panel3">Panel 3</k-accordion-header>
|
|
71
|
-
<k-accordion-panel name="panel3">
|
|
72
|
-
<p class="m">Panel 3 content</p>
|
|
73
|
-
</k-accordion-panel>
|
|
74
|
-
</k-accordion>
|
|
75
|
-
|
|
76
|
-
<h2 id="jsRef">JavaScript Reference</h2>
|
|
77
|
-
|
|
78
|
-
<h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
|
|
79
|
-
<h6>Extends <a href="./component.html">ShadowComponent</a></h6>
|
|
80
|
-
<h5>
|
|
81
|
-
<code>new Accordion()</code><br />
|
|
82
|
-
</h5>
|
|
83
|
-
|
|
84
|
-
<h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
|
|
85
|
-
<ul>
|
|
86
|
-
<li><a href="./component.html">ShadowComponent</a></li>
|
|
87
|
-
</ul>
|
|
88
|
-
|
|
89
|
-
<h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
|
|
90
|
-
|
|
91
|
-
<h4>Accordion (Main Component)</h4>
|
|
92
|
-
<h5><code>activeHeader<i>: HTMLElement | null</i></code></h5>
|
|
93
|
-
<p>Returns the currently active header element, or <code>null</code> if no panel is open.</p>
|
|
94
|
-
<h5><code>activePanel<i>: HTMLElement | null</i></code></h5>
|
|
95
|
-
<p>Returns the currently active panel element, or <code>null</code> if no panel is open.</p>
|
|
96
|
-
|
|
97
|
-
<h4>AccordionHeader</h4>
|
|
98
|
-
<h5><code>forPanel<i>: string</i></code></h5>
|
|
99
|
-
<p>The panel name that this header controls. Syncs with the <code>for-panel</code> attribute.</p>
|
|
100
|
-
<h5><code>active<i>: boolean</i></code></h5>
|
|
101
|
-
<p>Whether this header is currently active (its associated panel is open). Syncs with the <code>active</code> attribute.</p>
|
|
102
|
-
<h5><code>accordion<i>: Accordion | null</i></code></h5>
|
|
103
|
-
<p>Returns the parent accordion component, or <code>null</code> if not inside an accordion.</p>
|
|
104
|
-
|
|
105
|
-
<h4>AccordionPanel</h4>
|
|
106
|
-
<h5><code>name<i>: string</i></code></h5>
|
|
107
|
-
<p>Unique identifier for this panel. Must match the <code>for-panel</code> attribute of its associated header. Syncs with the <code>name</code> attribute.</p>
|
|
108
|
-
<h5><code>active<i>: boolean</i></code></h5>
|
|
109
|
-
<p>Whether this panel is currently open. Syncs with the <code>active</code> attribute.</p>
|
|
110
|
-
<h5><code>transitioning<i>: boolean</i></code></h5>
|
|
111
|
-
<p>Whether this panel is currently animating (opening or closing). Syncs with the <code>transitioning</code> attribute.</p>
|
|
112
|
-
<h5><code>accordion<i>: Accordion | null</i></code></h5>
|
|
113
|
-
<p>Returns the parent accordion component, or <code>null</code> if not inside an accordion.</p>
|
|
114
|
-
|
|
115
|
-
<h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
|
|
116
|
-
|
|
117
|
-
<h4>Accordion (Main Component)</h4>
|
|
118
|
-
<h5><code>getHeader(panelName)<i>: HTMLElement | null</i></code></h5>
|
|
119
|
-
<p>Returns the header element associated with the specified panel name, or <code>null</code> if not found.</p>
|
|
120
|
-
<ul>
|
|
121
|
-
<li><strong>panelName</strong> <code>string</code> - The name of the panel whose header to retrieve</li>
|
|
122
|
-
</ul>
|
|
123
|
-
|
|
124
|
-
<h5><code>getPanel(panelName)<i>: HTMLElement | null</i></code></h5>
|
|
125
|
-
<p>Returns the panel element with the specified name, or <code>null</code> if not found.</p>
|
|
126
|
-
<ul>
|
|
127
|
-
<li><strong>panelName</strong> <code>string</code> - The name of the panel to retrieve</li>
|
|
128
|
-
</ul>
|
|
129
|
-
|
|
130
|
-
<h5><code>openPanel(panelName)<i>: void</i></code></h5>
|
|
131
|
-
<p>Opens the panel with the specified name. Closes any currently open panel first. Dispatches an <code>openpanel</code> event.</p>
|
|
132
|
-
<ul>
|
|
133
|
-
<li><strong>panelName</strong> <code>string</code> - The name of the panel to open</li>
|
|
134
|
-
</ul>
|
|
135
|
-
|
|
136
|
-
<h5><code>closePanel(panelName)<i>: void</i></code></h5>
|
|
137
|
-
<p>Closes the panel with the specified name. Dispatches a <code>closepanel</code> event.</p>
|
|
138
|
-
<ul>
|
|
139
|
-
<li><strong>panelName</strong> <code>string</code> - The name of the panel to close</li>
|
|
140
|
-
</ul>
|
|
141
|
-
|
|
142
|
-
<h5><code>togglePanel(panelName)<i>: void</i></code></h5>
|
|
143
|
-
<p>Toggles the panel with the specified name (opens if closed, closes if open). Dispatches a <code>togglepanel</code> event.</p>
|
|
144
|
-
<ul>
|
|
145
|
-
<li><strong>panelName</strong> <code>string</code> - The name of the panel to toggle</li>
|
|
146
|
-
</ul>
|
|
147
|
-
|
|
148
|
-
<h3 id="events"><a href="#events" class="no-link">Events</a></h3>
|
|
149
|
-
<h5><code>openpanel</code></h5>
|
|
150
|
-
<p>Fired when a panel is opened. The event detail contains <code>{ panelName }</code>.</p>
|
|
151
|
-
<h5><code>closepanel</code></h5>
|
|
152
|
-
<p>Fired when a panel is closed. The event detail contains <code>{ panelName }</code>.</p>
|
|
153
|
-
<h5><code>togglepanel</code></h5>
|
|
154
|
-
<p>Fired when a panel is toggled. The event detail contains <code>{ panelName }</code>.</p>
|
|
155
|
-
|
|
156
|
-
</main>
|
|
157
|
-
<div style="height:33vh"></div>
|
|
158
|
-
<script type="module" src="../src/components/Import.js"></script>
|
|
159
|
-
<script type="module" src="../src/components/Accordion.js"></script>
|
|
160
|
-
</body>
|
|
161
|
-
</html>
|
|
@@ -1,193 +0,0 @@
|
|
|
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>Collapsible - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
|
-
<link rel="stylesheet" href="../kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../kempo-hljs.css" />
|
|
9
|
-
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
-
<script>window.litDisableBundleWarning = true;</script>
|
|
11
|
-
<script type="module" src="./init.js"></script>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<k-import src="../nav.inc.html"></k-import>
|
|
15
|
-
<h1 class="ta-center">Collapsible</h1>
|
|
16
|
-
<main>
|
|
17
|
-
<details class="b r mb">
|
|
18
|
-
<summary class="p">Table of Contents</summary>
|
|
19
|
-
<div class="m mt0 pl">
|
|
20
|
-
<h6>Examples</h6>
|
|
21
|
-
<a href="#basicUsage">Basic Usage</a><br />
|
|
22
|
-
<a href="#defaultOpen">Default Open</a><br />
|
|
23
|
-
<a href="#customLabel">Custom Label</a><br />
|
|
24
|
-
<a href="#customIcon">Custom Icon</a><br />
|
|
25
|
-
|
|
26
|
-
<h6 class="mt">JavaScript Reference</h6>
|
|
27
|
-
<a href="#constructor">Constructor</a><br />
|
|
28
|
-
<a href="#requirements">Requirements</a><br />
|
|
29
|
-
<a href="#properties">Properties</a><br />
|
|
30
|
-
<a href="#methods">Methods</a><br />
|
|
31
|
-
<a href="#events">Events</a><br />
|
|
32
|
-
<a href="#slots">Slots</a><br />
|
|
33
|
-
</div>
|
|
34
|
-
</details>
|
|
35
|
-
|
|
36
|
-
<h3>Description</h3>
|
|
37
|
-
<p>The Collapsible component provides a way to show/hide content with a clickable label header. It features a rotating chevron icon and smooth transitions. The component extends the <a href="./component.html">ShadowComponent</a> class and supports customizable labels and icons through slots.</p>
|
|
38
|
-
|
|
39
|
-
<h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
|
|
40
|
-
<p>Use the collapsible component to create expandable content sections. Click the label to toggle the content visibility.</p>
|
|
41
|
-
|
|
42
|
-
<div class="row -mx mb">
|
|
43
|
-
<div class="col d-span-6 m-span-12 px">
|
|
44
|
-
<k-card label="HTML">
|
|
45
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-collapsible</span>></span>
|
|
46
|
-
<span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"label"</span>></span>Click to expand<span class="hljs-tag"></<span class="hljs-name">span</span>></span>
|
|
47
|
-
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>This content can be collapsed or expanded.<span class="hljs-tag"></<span class="hljs-name">p</span>></span>
|
|
48
|
-
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>Add any content here that you want to show/hide.<span class="hljs-tag"></<span class="hljs-name">p</span>></span>
|
|
49
|
-
<span class="hljs-tag"></<span class="hljs-name">k-collapsible</span>></span></code></pre>
|
|
50
|
-
</k-card>
|
|
51
|
-
</div>
|
|
52
|
-
<div class="col d-span-6 m-span-12 px">
|
|
53
|
-
<k-card label="Output">
|
|
54
|
-
<k-collapsible>
|
|
55
|
-
<span slot="label">Click to expand</span>
|
|
56
|
-
<p>This content can be collapsed or expanded.</p>
|
|
57
|
-
<p>Add any content here that you want to show/hide.</p>
|
|
58
|
-
</k-collapsible>
|
|
59
|
-
</k-card>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
<h3 id="defaultOpen"><a href="#defaultOpen" class="no-link">Default Open</a></h3>
|
|
64
|
-
<p>Set the <code>opened</code> attribute to have the collapsible start in an expanded state.</p>
|
|
65
|
-
|
|
66
|
-
<div class="row -mx mb">
|
|
67
|
-
<div class="col d-span-6 m-span-12 px">
|
|
68
|
-
<k-card label="HTML">
|
|
69
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-collapsible</span> <span class="hljs-attr">opened</span>=<span class="hljs-string">"true"</span>></span>
|
|
70
|
-
<span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"label"</span>></span>Already expanded<span class="hljs-tag"></<span class="hljs-name">span</span>></span>
|
|
71
|
-
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>This collapsible starts in an open state.<span class="hljs-tag"></<span class="hljs-name">p</span>></span>
|
|
72
|
-
<span class="hljs-tag"></<span class="hljs-name">k-collapsible</span>></span></code></pre>
|
|
73
|
-
</k-card>
|
|
74
|
-
</div>
|
|
75
|
-
<div class="col d-span-6 m-span-12 px">
|
|
76
|
-
<k-card label="Output">
|
|
77
|
-
<k-collapsible opened="true">
|
|
78
|
-
<span slot="label">Already expanded</span>
|
|
79
|
-
<p>This collapsible starts in an open state.</p>
|
|
80
|
-
</k-collapsible>
|
|
81
|
-
</k-card>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<h3 id="customLabel"><a href="#customLabel" class="no-link">Custom Label</a></h3>
|
|
86
|
-
<p>You can put any content in the label slot, including formatted text, icons, or even other components.</p>
|
|
87
|
-
|
|
88
|
-
<div class="row -mx mb">
|
|
89
|
-
<div class="col d-span-6 m-span-12 px">
|
|
90
|
-
<k-card label="HTML">
|
|
91
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-collapsible</span>></span>
|
|
92
|
-
<span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"label"</span>></span>
|
|
93
|
-
<span class="hljs-tag"><<span class="hljs-name">strong</span>></span>Advanced Settings<span class="hljs-tag"></<span class="hljs-name">strong</span>></span>
|
|
94
|
-
<span class="hljs-tag"><<span class="hljs-name">small</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"opacity-50 ml"</span>></span>(Optional)<span class="hljs-tag"></<span class="hljs-name">small</span>></span>
|
|
95
|
-
<span class="hljs-tag"></<span class="hljs-name">div</span>></span>
|
|
96
|
-
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>Configure advanced options here.<span class="hljs-tag"></<span class="hljs-name">p</span>></span>
|
|
97
|
-
<span class="hljs-tag"></<span class="hljs-name">k-collapsible</span>></span></code></pre>
|
|
98
|
-
</k-card>
|
|
99
|
-
</div>
|
|
100
|
-
<div class="col d-span-6 m-span-12 px">
|
|
101
|
-
<k-card label="Output">
|
|
102
|
-
<k-collapsible>
|
|
103
|
-
<div slot="label">
|
|
104
|
-
<strong>Advanced Settings</strong>
|
|
105
|
-
<small class="opacity-50 ml">(Optional)</small>
|
|
106
|
-
</div>
|
|
107
|
-
<p>Configure advanced options here.</p>
|
|
108
|
-
</k-collapsible>
|
|
109
|
-
</k-card>
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
|
|
113
|
-
<h3 id="customIcon"><a href="#customIcon" class="no-link">Custom Icon</a></h3>
|
|
114
|
-
<p>Replace the default chevron icon with your own content using the <code>labelIcon</code> slot.</p>
|
|
115
|
-
|
|
116
|
-
<div class="row -mx mb">
|
|
117
|
-
<div class="col d-span-6 m-span-12 px">
|
|
118
|
-
<k-card label="HTML">
|
|
119
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-collapsible</span>></span>
|
|
120
|
-
<span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"label"</span>></span>Custom Icon<span class="hljs-tag"></<span class="hljs-name">span</span>></span>
|
|
121
|
-
<span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"labelIcon"</span>></span>▼<span class="hljs-tag"></<span class="hljs-name">span</span>></span>
|
|
122
|
-
<span class="hljs-tag"><<span class="hljs-name">p</span>></span>Using a custom arrow icon.<span class="hljs-tag"></<span class="hljs-name">p</span>></span>
|
|
123
|
-
<span class="hljs-tag"></<span class="hljs-name">k-collapsible</span>></span></code></pre>
|
|
124
|
-
</k-card>
|
|
125
|
-
</div>
|
|
126
|
-
<div class="col d-span-6 m-span-12 px">
|
|
127
|
-
<k-card label="Output">
|
|
128
|
-
<k-collapsible>
|
|
129
|
-
<span slot="label">Custom Icon</span>
|
|
130
|
-
<span slot="labelIcon">▼</span>
|
|
131
|
-
<p>Using a custom arrow icon.</p>
|
|
132
|
-
</k-collapsible>
|
|
133
|
-
</k-card>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
|
|
137
|
-
<h2 id="jsRef">JavaScript Reference</h2>
|
|
138
|
-
|
|
139
|
-
<h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
|
|
140
|
-
<h6>Extends <a href="./component.html">ShadowComponent</a></h6>
|
|
141
|
-
<h5>
|
|
142
|
-
<code>new Collapsible()</code>
|
|
143
|
-
</h5>
|
|
144
|
-
|
|
145
|
-
<h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
|
|
146
|
-
<ul>
|
|
147
|
-
<li><a href="./component.html">ShadowComponent</a></li>
|
|
148
|
-
<li><a href="./icon.html">Icon</a></li>
|
|
149
|
-
</ul>
|
|
150
|
-
|
|
151
|
-
<h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
|
|
152
|
-
<h5><code>opened<i>: boolean</i></code></h5>
|
|
153
|
-
<p>Gets or sets whether the collapsible is currently expanded. Changing this property will trigger the appropriate events and visual state changes. Syncs to <code>opened</code> attribute. Default value is <code>false</code>.</p>
|
|
154
|
-
|
|
155
|
-
<h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
|
|
156
|
-
<h5><code>open()<i>: void</i></code></h5>
|
|
157
|
-
<p>Expands the collapsible to show its content. Sets <code>opened</code> to <code>true</code>.</p>
|
|
158
|
-
|
|
159
|
-
<h5><code>close()<i>: void</i></code></h5>
|
|
160
|
-
<p>Collapses the collapsible to hide its content. Sets <code>opened</code> to <code>false</code>.</p>
|
|
161
|
-
|
|
162
|
-
<h5><code>toggle()<i>: void</i></code></h5>
|
|
163
|
-
<p>Toggles the collapsible state (expands if collapsed, collapses if expanded). Dispatches an <code>openedtoggled</code> event.</p>
|
|
164
|
-
|
|
165
|
-
<h3 id="events"><a href="#events" class="no-link">Events</a></h3>
|
|
166
|
-
<h5><code>openedchanged</code></h5>
|
|
167
|
-
<p>Fired when the opened state changes. The event detail contains the string <code>"open"</code> or <code>"close"</code>.</p>
|
|
168
|
-
|
|
169
|
-
<h5><code>open</code></h5>
|
|
170
|
-
<p>Fired when the collapsible is expanded.</p>
|
|
171
|
-
|
|
172
|
-
<h5><code>close</code></h5>
|
|
173
|
-
<p>Fired when the collapsible is collapsed.</p>
|
|
174
|
-
|
|
175
|
-
<h5><code>openedtoggled</code></h5>
|
|
176
|
-
<p>Fired when the <code>toggle()</code> method is called (typically when the label is clicked).</p>
|
|
177
|
-
|
|
178
|
-
<h3 id="slots"><a href="#slots" class="no-link">Slots</a></h3>
|
|
179
|
-
<h5><code>Default Slot</code></h5>
|
|
180
|
-
<p>The main content area that can be collapsed or expanded.</p>
|
|
181
|
-
|
|
182
|
-
<h5><code>label</code></h5>
|
|
183
|
-
<p>The clickable label content. This is what users click to toggle the collapsible state.</p>
|
|
184
|
-
|
|
185
|
-
<h5><code>labelIcon</code></h5>
|
|
186
|
-
<p>Custom content for the toggle icon. Defaults to a right-pointing chevron that rotates when expanded. The icon automatically gets hover effects and rotation animations.</p>
|
|
187
|
-
|
|
188
|
-
</main>
|
|
189
|
-
<div style="height:33vh"></div>
|
|
190
|
-
<script type="module" src="../src/components/Import.js"></script>
|
|
191
|
-
<script type="module" src="../src/components/Collapsible.js"></script>
|
|
192
|
-
</body>
|
|
193
|
-
</html>
|
|
@@ -1,105 +0,0 @@
|
|
|
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>Dialog - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
|
-
<link rel="stylesheet" href="../kempo-vars.css" /><link rel="stylesheet" href="../kempo.min.css" />
|
|
8
|
-
<link rel="stylesheet" href="../kempo-hljs.css" />
|
|
9
|
-
<link rel="stylesheet" href="../styles.css" />
|
|
10
|
-
<script>window.litDisableBundleWarning = true;</script>
|
|
11
|
-
<script type="module" src="./init.js"></script>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<k-import src="../nav.inc.html"></k-import>
|
|
15
|
-
<main>
|
|
16
|
-
<h1 class="ta-center">Dialog</h1>
|
|
17
|
-
|
|
18
|
-
<details class="b r mb">
|
|
19
|
-
<summary class="p">Table of Contents</summary>
|
|
20
|
-
<div class="m mt0 pl">
|
|
21
|
-
<h6>Examples</h6>
|
|
22
|
-
<a href="#basicUsage">Basic Usage</a><br />
|
|
23
|
-
<a href="#titles">Titles</a><br />
|
|
24
|
-
<a href="#actionButtons">Action Buttons</a><br />
|
|
25
|
-
<a href="#jsUsage">JavaScript Usage</a><br />
|
|
26
|
-
|
|
27
|
-
<h6 class="mt">JavaScript Reference</h6>
|
|
28
|
-
<a href="#constructor">Constructor</a><br />
|
|
29
|
-
<a href="#requirements">Requirements</a><br />
|
|
30
|
-
<a href="#properties">Properties</a><br />
|
|
31
|
-
<a href="#methods">Methods</a><br />
|
|
32
|
-
<a href="#staticMethods">Static Methods</a><br />
|
|
33
|
-
</div>
|
|
34
|
-
</details>
|
|
35
|
-
|
|
36
|
-
<h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
|
|
37
|
-
<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>
|
|
38
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-dialog</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d1"</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"p"</span>></span>Hello World<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-dialog</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">"doument.getElementById('d1').open()"</span>></span>Open Dialog<span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
|
39
|
-
<button class="openDialog mb" data-dialog="d1" slot="right">Open Dialog</button>
|
|
40
|
-
<k-dialog id="d1">
|
|
41
|
-
<p class="p">Hello World</p>
|
|
42
|
-
</k-dialog>
|
|
43
|
-
|
|
44
|
-
<h3 id="titles"><a href="#titles" class="no-link">Titles</a></h3>
|
|
45
|
-
<p>Assign an element to the <code>title</code> slot to have it appear as the dialog title.</p>
|
|
46
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-dialog</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"d2"</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">h6</span><br /> <span class="hljs-attr">class</span>=<span class="hljs-string">"m0 px"</span><br /> <span class="hljs-attr">slot</span>=<span class="hljs-string">"title"</span><br /> ></span>This is a fact<span class="hljs-tag"></<span class="hljs-name">h6</span>></span><br /> <span class="hljs-tag"><<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"p"</span>></span>A hotdog is a sandwhich<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-dialog</span>></span></code></pre>
|
|
47
|
-
<button class="openDialog mb" data-dialog="d2" slot="right">Open Dialog</button>
|
|
48
|
-
<k-dialog
|
|
49
|
-
id="d2"
|
|
50
|
-
>
|
|
51
|
-
<h6
|
|
52
|
-
class="m0 px"
|
|
53
|
-
slot="title"
|
|
54
|
-
>This is a fact</h6>
|
|
55
|
-
<p class="p">A hotdog is a sandwhich</p>
|
|
56
|
-
</k-dialog>
|
|
57
|
-
|
|
58
|
-
<h3 id="actionButtons"><a href="#actionButtons" class="no-link">Action Buttons</a></h3>
|
|
59
|
-
<p>Add a cancel button using the <code>cancel-text</code> attribute.</p>
|
|
60
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-dialog</span><br /> <span class="hljs-attr">id</span>=<span class="hljs-string">"d4"</span><br /> <span class="hljs-attr">cancel-text</span>=<span class="hljs-string">"Absolutly Not"</span><br />></span><br /> <span class="hljs-tag"><<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"p"</span>></span>Mint and Chocolate belong together<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-dialog</span>></span></code></pre>
|
|
61
|
-
<button class="openDialog mb" data-dialog="d4" slot="right">Open Dialog</button>
|
|
62
|
-
<k-dialog
|
|
63
|
-
id="d4"
|
|
64
|
-
cancel-text="Absolutly Not"
|
|
65
|
-
>
|
|
66
|
-
<p class="p">Mint and Chocolate belong together</p>
|
|
67
|
-
</k-dialog>
|
|
68
|
-
|
|
69
|
-
<p>Add a confirm button using the <code>confirm-text</code> attribute.</p>
|
|
70
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-dialog</span><br /> <span class="hljs-attr">id</span>=<span class="hljs-string">"d5"</span><br /> <span class="hljs-attr">confirm-text</span>=<span class="hljs-string">"Confirm"</span><br />></span><br /> <span class="hljs-tag"><<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"p"</span>></span>Spaghetti is the greatest food<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-dialog</span>></span></code></pre>
|
|
71
|
-
<button class="openDialog mb" data-dialog="d5" slot="right">Open Dialog</button>
|
|
72
|
-
<k-dialog
|
|
73
|
-
id="d5"
|
|
74
|
-
confirm-text="Confirm"
|
|
75
|
-
>
|
|
76
|
-
<p class="p">Spaghetti is the greatest food</p>
|
|
77
|
-
</k-dialog>
|
|
78
|
-
|
|
79
|
-
<p>Try it with both a cancel and confirm button.</p>
|
|
80
|
-
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-dialog</span><br /> <span class="hljs-attr">id</span>=<span class="hljs-string">"d6"</span><br /> <span class="hljs-attr">cancel-text</span>=<span class="hljs-string">"It should be outlawed"</span><br /> <span class="hljs-attr">confirm-text</span>=<span class="hljs-string">"Of course it is"</span><br />></span><br /> <span class="hljs-tag"><<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"p"</span>></span>Ranch is gross<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br /><span class="hljs-tag"></<span class="hljs-name">k-dialog</span>></span></code></pre>
|
|
81
|
-
<button class="openDialog mb" data-dialog="d6" slot="right">Open Dialog</button>
|
|
82
|
-
<k-dialog
|
|
83
|
-
id="d6"
|
|
84
|
-
cancel-text="It should be outlawed"
|
|
85
|
-
confirm-text="Of course it is"
|
|
86
|
-
>
|
|
87
|
-
<p class="p">Ranch is gross</p>
|
|
88
|
-
</k-dialog>
|
|
89
|
-
|
|
90
|
-
<h3 id="jsUsage"><a href="#jsUsage" class="no-link">JavaScript Usage</a></h3>
|
|
91
|
-
<h5>Create Dialog</h5>
|
|
92
|
-
<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">'<p>Hello World</p>'</span>);<br /> });<br /></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
93
|
-
<button id="d7" class="mb">Open Dialog</button>
|
|
94
|
-
<script type="module" src="./init.js"></script>
|
|
95
|
-
<script type="module" src="../src/components/Dialog.js"></script>
|
|
96
|
-
<script>
|
|
97
|
-
document.querySelectorAll('.openDialog').forEach( $btn => {
|
|
98
|
-
$btn.addEventListener('click', () => {
|
|
99
|
-
const $dialog = document.getElementById($btn.dataset.dialog);
|
|
100
|
-
if($dialog) $dialog.open();
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
</script>
|
|
104
|
-
</body>
|
|
105
|
-
</html>
|
package/docs/components/init.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import Import from '../src/components/Import.js';
|
|
2
|
-
import Icon from '../src/components/Icon.js';
|
|
3
|
-
import ShadowComponent from '../src/components/ShadowComponent.js';
|
|
4
|
-
|
|
5
|
-
Import.replacements.root = '../';
|
|
6
|
-
Icon.pathToIcons = ['../icons'];
|
|
7
|
-
ShadowComponent.stylesheetPath = '../kempo.min.css';
|