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,17 +1,18 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
+
<base href="/kempo-ui/">
|
|
4
5
|
<meta charset="UTF-8">
|
|
5
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
7
|
<title>Tabs - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
|
-
<link rel="stylesheet" href="
|
|
8
|
-
<link rel="stylesheet" href="
|
|
9
|
-
<link rel="stylesheet" href="
|
|
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" />
|
|
10
12
|
<script>window.litDisableBundleWarning = true;</script>
|
|
11
|
-
<script type="module" src="./init.js"></script>
|
|
12
13
|
</head>
|
|
13
14
|
<body>
|
|
14
|
-
<k-import src="
|
|
15
|
+
<k-import src="/kempo-ui/nav.inc.html"></k-import>
|
|
15
16
|
<h1 class="ta-center">Tabs</h1>
|
|
16
17
|
<main>
|
|
17
18
|
<details class="b r mb">
|
|
@@ -169,7 +170,7 @@
|
|
|
169
170
|
<p>Fired when the active tab changes. Detail contains <code>{ tab }</code> with the name of the new active tab.</p>
|
|
170
171
|
</main>
|
|
171
172
|
<div style="height:33vh"></div>
|
|
172
|
-
<script type="module" src="
|
|
173
|
-
<script type="module" src="
|
|
173
|
+
<script type="module" src="/kempo-ui/src/components/Tabs.js"></script>
|
|
174
|
+
<script type="module" src="/kempo-ui/src/components/Import.js"></script>
|
|
174
175
|
</body>
|
|
175
176
|
</html>
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
+
<base href="/kempo-ui/">
|
|
4
5
|
<meta charset="UTF-8">
|
|
5
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
7
|
<title>Tags - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
|
-
<link rel="stylesheet" href="
|
|
8
|
-
<link rel="stylesheet" href="
|
|
9
|
-
<link rel="stylesheet" href="
|
|
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" />
|
|
10
12
|
<script>window.litDisableBundleWarning = true;</script>
|
|
11
|
-
<script type="module" src="./init.js"></script>
|
|
12
13
|
</head>
|
|
13
14
|
<body>
|
|
14
|
-
<k-import src="
|
|
15
|
+
<k-import src="/kempo-ui/nav.inc.html"></k-import>
|
|
15
16
|
<h1 class="ta-center">Tags</h1>
|
|
16
17
|
<main>
|
|
17
18
|
<details class="b r mb">
|
|
@@ -99,7 +100,7 @@
|
|
|
99
100
|
<p>Fired when the disallowed tags list changes. Detail contains <code>{ oldValue, newValue }</code>.</p>
|
|
100
101
|
|
|
101
102
|
</main>
|
|
102
|
-
<script type="module" src="
|
|
103
|
-
<script type="module" src="
|
|
103
|
+
<script type="module" src="/kempo-ui/src/components/Import.js"></script>
|
|
104
|
+
<script type="module" src="/kempo-ui/src/components/Tags.js"></script>
|
|
104
105
|
</body>
|
|
105
106
|
</html>
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
+
<base href="/kempo-ui/">
|
|
4
5
|
<meta charset="UTF-8">
|
|
5
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
7
|
<title>ThemeSwitcher - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
|
-
<link rel="stylesheet" href="
|
|
8
|
-
<link rel="stylesheet" href="
|
|
9
|
-
<link rel="stylesheet" href="
|
|
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" />
|
|
10
12
|
<script>window.litDisableBundleWarning = true;</script>
|
|
11
|
-
<script type="module" src="./init.js"></script>
|
|
12
13
|
</head>
|
|
13
14
|
<body>
|
|
14
|
-
<k-import src="
|
|
15
|
+
<k-import src="/kempo-ui/nav.inc.html"></k-import>
|
|
15
16
|
<h1 class="ta-center">ThemeSwitcher</h1>
|
|
16
17
|
<main>
|
|
17
18
|
<details class="b r mb">
|
|
@@ -115,7 +116,7 @@
|
|
|
115
116
|
<p>The component also synchronizes theme changes across browser tabs using the storage event, ensuring a consistent user experience.</p>
|
|
116
117
|
|
|
117
118
|
</main>
|
|
118
|
-
<script type="module" src="
|
|
119
|
-
<script type="module" src="
|
|
119
|
+
<script type="module" src="/kempo-ui/src/components/Import.js"></script>
|
|
120
|
+
<script type="module" src="/kempo-ui/src/components/ThemeSwitcher.js"></script>
|
|
120
121
|
</body>
|
|
121
122
|
</html>
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
+
<base href="/kempo-ui/">
|
|
4
5
|
<meta charset="UTF-8">
|
|
5
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
7
|
<title>Timestamp - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
|
-
<link rel="stylesheet" href="
|
|
8
|
-
<link rel="stylesheet" href="
|
|
9
|
-
<link rel="stylesheet" href="
|
|
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" />
|
|
10
12
|
<script>window.litDisableBundleWarning = true;</script>
|
|
11
|
-
<script type="module" src="./init.js"></script>
|
|
12
13
|
</head>
|
|
13
14
|
<body>
|
|
14
|
-
<k-import src="
|
|
15
|
+
<k-import src="/kempo-ui/nav.inc.html"></k-import>
|
|
15
16
|
<h1 class="ta-center">Timestamp</h1>
|
|
16
17
|
<main>
|
|
17
18
|
<details class="b r mb">
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
|
|
72
73
|
</main>
|
|
73
74
|
<div style="height:33vh"></div>
|
|
74
|
-
<script type="module" src="
|
|
75
|
-
<script type="module" src="
|
|
75
|
+
<script type="module" src="/kempo-ui/src/components/Import.js"></script>
|
|
76
|
+
<script type="module" src="/kempo-ui/src/components/Timestamp.js"></script>
|
|
76
77
|
</body>
|
|
77
78
|
</html>
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<base href="/kempo-ui/">
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Toast - 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" />
|
|
12
|
+
<script>window.litDisableBundleWarning = true;</script>
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<k-import src="/kempo-ui/nav.inc.html"></k-import>
|
|
16
|
+
<h1 class="ta-center">Toast</h1>
|
|
17
|
+
<main>
|
|
18
|
+
<details
|
|
19
|
+
class="b r mb"
|
|
20
|
+
>
|
|
21
|
+
<summary class="p">Table of Contents</summary>
|
|
22
|
+
<div class="m mt0 pl">
|
|
23
|
+
<h6>Examples</h6>
|
|
24
|
+
<a href="#basicUsage">Basic Usage</a><br />
|
|
25
|
+
<a href="#positions">Different Positions</a><br />
|
|
26
|
+
<a href="#timeouts">Timeouts</a><br />
|
|
27
|
+
<a href="#actionAndClose">Action and Close Buttons</a><br />
|
|
28
|
+
|
|
29
|
+
<h6 class="mt">JavaScript Reference</h6>
|
|
30
|
+
<a href="#constructor">Constructor</a><br />
|
|
31
|
+
<a href="#staticMethods">Static Methods</a><br />
|
|
32
|
+
<a href="#requirements">Requirements</a><br />
|
|
33
|
+
<a href="#properties">Properties</a><br />
|
|
34
|
+
<a href="#methods">Methods</a><br />
|
|
35
|
+
<a href="#events">Events</a><br />
|
|
36
|
+
<a href="#toastContainer">ToastContainer</a><br />
|
|
37
|
+
</div>
|
|
38
|
+
</details>
|
|
39
|
+
|
|
40
|
+
<h3>Description</h3>
|
|
41
|
+
<p>The Toast component provides a way to display short-lived notifications to users. Toasts appear in a corner of the screen, can be configured with different positions, and can optionally include action and close buttons. Toasts can be set to automatically close after a specified timeout or remain until manually dismissed.</p>
|
|
42
|
+
|
|
43
|
+
<h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
|
|
44
|
+
<div class="row -mx">
|
|
45
|
+
<div class="col d-span-6 t-span-6 m-span-12 px">
|
|
46
|
+
<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">"example1"</span>></span>Open Toast<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> Toast <span class="hljs-keyword">from</span> <span class="hljs-string">'/src/components/Toast.js'</span>;<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'example1'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Toast.create(<span class="hljs-string">"Hello World"</span>);<br /> });<br /></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="col d-span-6 t-span-6 m-span-12 px">
|
|
49
|
+
<button id="example1" class="mb">Open Toast</button>
|
|
50
|
+
<script type="module">
|
|
51
|
+
import Toast from '/kempo-ui/src/components/Toast.js';
|
|
52
|
+
document.getElementById('example1').addEventListener('click', () => {
|
|
53
|
+
Toast.create("Hello World");
|
|
54
|
+
});
|
|
55
|
+
</script>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<h3 id="positions"><a href="#positions" class="no-link">Different Positions</a></h3>
|
|
61
|
+
<p>Toasts can be positioned in different corners of the screen using the <code>position</code> property.</p>
|
|
62
|
+
<div class="row -mx">
|
|
63
|
+
<div class="col d-span-6 t-span-6 m-span-12 px">
|
|
64
|
+
|
|
65
|
+
</div>
|
|
66
|
+
<div class="col d-span-6 t-span-6 m-span-12 px">
|
|
67
|
+
<button id="example2-topleft" class="mb">Top Left</button>
|
|
68
|
+
<button id="example2-topcenter" class="mb">Top Center</button>
|
|
69
|
+
<button id="example2-topright" class="mb">Top Right</button><br />
|
|
70
|
+
<button id="example2-bottomleft" class="mb">Bottom Left</button>
|
|
71
|
+
<button id="example2-bottomcenter" class="mb">Bottom Center</button>
|
|
72
|
+
<button id="example2-bottomright" class="mb">Bottom Right</button>
|
|
73
|
+
<script type="module">
|
|
74
|
+
import Toast from '/kempo-ui/src/components/Toast.js';
|
|
75
|
+
document.getElementById('example2-topleft').addEventListener('click', () => {
|
|
76
|
+
Toast.create("Hello Top Left", {
|
|
77
|
+
position: "top left"
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
document.getElementById('example2-topcenter').addEventListener('click', () => {
|
|
81
|
+
Toast.create("Hello Top Center", {
|
|
82
|
+
position: "top center"
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
document.getElementById('example2-topright').addEventListener('click', () => {
|
|
86
|
+
Toast.create("Hello Top Right", {
|
|
87
|
+
position: "top right"
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
document.getElementById('example2-bottomleft').addEventListener('click', () => {
|
|
91
|
+
Toast.create("Hello Bottom Left", {
|
|
92
|
+
position: "bottom left"
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
document.getElementById('example2-bottomcenter').addEventListener('click', () => {
|
|
96
|
+
Toast.create("Hello Bottom Center", {
|
|
97
|
+
position: "bottom center"
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
document.getElementById('example2-bottomright').addEventListener('click', () => {
|
|
101
|
+
Toast.create("Hello Bottom Right", {
|
|
102
|
+
position: "bottom right"
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
</script>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<h3 id="timeouts"><a href="#timeouts" class="no-link">Timeouts</a></h3>
|
|
110
|
+
<p>Toasts can automatically close after a specified timeout (in milliseconds). The default timeout when using <code>Toast.create</code> is <code>5000</code> (ms), or 5 seconds.</p>
|
|
111
|
+
<div class="row -mx">
|
|
112
|
+
<div class="col d-span-6 t-span-6 m-span-12 px">
|
|
113
|
+
<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">"example3-1"</span>></span>Open 1 Second Timeout Toast<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example3-3"</span>></span>Open 3 Second Timeout Toast<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example3-10"</span>></span>Open 10 Second Timeout Toast<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> Toast <span class="hljs-keyword">from</span> <span class="hljs-string">'/src/components/Toast.js'</span>;<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'example3-1'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Toast.create(<span class="hljs-string">"I will timeout in 1 second"</span>, {<br /> <span class="hljs-attr">timeout</span>: <span class="hljs-number">1000</span><br /> });<br /> });<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'example3-3'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Toast.create(<span class="hljs-string">"I will timeout in 3 second"</span>, {<br /> <span class="hljs-attr">timeout</span>: <span class="hljs-number">3000</span><br /> });<br /> });<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'example3-10'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Toast.create(<span class="hljs-string">"I will timeout in 10 second"</span>, {<br /> <span class="hljs-attr">timeout</span>: <span class="hljs-number">10000</span><br /> });<br /> });<br /></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="col d-span-6 t-span-6 m-span-12 px">
|
|
116
|
+
<button id="example3-1" class="mb">Open 1 Second Timeout Toast</button>
|
|
117
|
+
<button id="example3-3" class="mb">Open 3 Second Timeout Toast</button>
|
|
118
|
+
<button id="example3-10" class="mb">Open 10 Second Timeout Toast</button>
|
|
119
|
+
<script type="module">
|
|
120
|
+
import Toast from '/kempo-ui/src/components/Toast.js';
|
|
121
|
+
document.getElementById('example3-1').addEventListener('click', () => {
|
|
122
|
+
Toast.create("I will timeout in 1 second", {
|
|
123
|
+
timeout: 1000
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
document.getElementById('example3-3').addEventListener('click', () => {
|
|
127
|
+
Toast.create("I will timeout in 3 second", {
|
|
128
|
+
timeout: 3000
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
document.getElementById('example3-10').addEventListener('click', () => {
|
|
132
|
+
Toast.create("I will timeout in 10 second", {
|
|
133
|
+
timeout: 10000
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
</script>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
<h3 id="actionAndClose"><a href="#actionAndClose" class="no-link">Action and Close Buttons</a></h3>
|
|
142
|
+
<p>Toasts can have action and close buttons that trigger callbacks when clicked.</p>
|
|
143
|
+
<div class="row -mx">
|
|
144
|
+
<div class="col d-span-6 t-span-6 m-span-12 px">
|
|
145
|
+
<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">"example4-action"</span>></span>Open Toast with Action<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example4-close"</span>></span>Open Toast with Close Button<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example4-action-close"</span>></span>Open Toast with Action and Close Button<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> Toast <span class="hljs-keyword">from</span> <span class="hljs-string">'/src/components/Toast.js'</span>;<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'example4-action'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Toast.create(<span class="hljs-string">"Hello World"</span>, {<br /> <span class="hljs-attr">timeout</span>: <span class="hljs-number">0</span>,<br /> <span class="hljs-attr">action</span>: <span class="hljs-string">'Click Me'</span>,<br /> <span class="hljs-attr">actionCallback</span>: <span class="hljs-function"><span class="hljs-params">()</span> =></span> {<br /> Toast.create(<span class="hljs-string">"You clicked the action"</span>);<br /> }<br /> });<br /> });<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'example4-close'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Toast.create(<span class="hljs-string">"Hello World"</span>, {<br /> <span class="hljs-attr">timeout</span>: <span class="hljs-number">0</span>,<br /> <span class="hljs-attr">close</span>: <span class="hljs-string">'<k-icon name="close"></div>'</span>,<br /> <span class="hljs-attr">closeCallback</span>: <span class="hljs-function"><span class="hljs-params">()</span> =></span> {<br /> Toast.create(<span class="hljs-string">"You closed the toast"</span>);<br /> }<br /> });<br /> });<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'example4-action-close'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Toast.create(<span class="hljs-string">"Hello World"</span>, {<br /> <span class="hljs-attr">timeout</span>: <span class="hljs-number">0</span>,<br /> <span class="hljs-attr">action</span>: <span class="hljs-string">'Click Me'</span>,<br /> <span class="hljs-attr">actionCallback</span>: <span class="hljs-function"><span class="hljs-params">()</span> =></span> {<br /> Toast.create(<span class="hljs-string">"You clicked the action"</span>);<br /> <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>; <span class="hljs-comment">// return false to prevent closing</span><br /> },<br /> <span class="hljs-attr">close</span>: <span class="hljs-string">'<k-icon name="close"></div>'</span>,<br /> <span class="hljs-attr">closeCallback</span>: <span class="hljs-function"><span class="hljs-params">()</span> =></span> {<br /> Toast.create(<span class="hljs-string">"You closed the toast"</span>);<br /> }<br /> });<br /> });<br /></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
146
|
+
</div>
|
|
147
|
+
<div class="col d-span-6 t-span-6 m-span-12 px">
|
|
148
|
+
<button id="example4-action" class="mb">Open Toast with Action</button>
|
|
149
|
+
<button id="example4-close" class="mb">Open Toast with Close Button</button>
|
|
150
|
+
<button id="example4-action-close" class="mb">Open Toast with Action and Close Button</button>
|
|
151
|
+
<script type="module">
|
|
152
|
+
import Toast from '/kempo-ui/src/components/Toast.js';
|
|
153
|
+
document.getElementById('example4-action').addEventListener('click', () => {
|
|
154
|
+
Toast.create("Hello World", {
|
|
155
|
+
timeout: 0,
|
|
156
|
+
action: 'Click Me',
|
|
157
|
+
actionCallback: () => {
|
|
158
|
+
Toast.create("You clicked the action");
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
document.getElementById('example4-close').addEventListener('click', () => {
|
|
163
|
+
Toast.create("Hello World", {
|
|
164
|
+
timeout: 0,
|
|
165
|
+
close: '<k-icon name="close"></div>',
|
|
166
|
+
closeCallback: () => {
|
|
167
|
+
Toast.create("You closed the toast");
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
document.getElementById('example4-action-close').addEventListener('click', () => {
|
|
172
|
+
Toast.create("Hello World", {
|
|
173
|
+
timeout: 0,
|
|
174
|
+
action: 'Click Me',
|
|
175
|
+
actionCallback: () => {
|
|
176
|
+
Toast.create("You clicked the action");
|
|
177
|
+
return false; // return false to prevent closing
|
|
178
|
+
},
|
|
179
|
+
close: '<k-icon name="close"></div>',
|
|
180
|
+
closeCallback: () => {
|
|
181
|
+
Toast.create("You closed the toast");
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
</script>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<h3 id="successWarningError"><a href="#successWarningError" class="no-link">Success, Warning and Error</a></h3>
|
|
190
|
+
<p>Toasts can be created as a success, warning or error message.</p>
|
|
191
|
+
<div class="row -mx">
|
|
192
|
+
<div class="col d-span-6 t-span-6 m-span-12 px">
|
|
193
|
+
<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">"example5-success"</span>></span>Success Toast<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example5-warning"</span>></span>Warning Toast<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br /><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"example5-error"</span>></span>Error Toast<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> Toast <span class="hljs-keyword">from</span> <span class="hljs-string">'/src/components/Toast.js'</span>;<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'example5-success'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Toast.success(<span class="hljs-string">"It Worked!"</span>);<br /> });<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'example5-warning'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Toast.warning(<span class="hljs-string">"Be Careful"</span>);<br /> });<br /> <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'example5-error'</span>).addEventListener(<span class="hljs-string">'click'</span>, () => {<br /> Toast.error(<span class="hljs-string">"That's a very bad idea"</span>);<br /> });<br /></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
194
|
+
</div>
|
|
195
|
+
<div class="col d-span-6 t-span-6 m-span-12 px">
|
|
196
|
+
<button id="example5-success" class="mb">Success Toast</button>
|
|
197
|
+
<button id="example5-warning" class="mb">Warning Toast</button>
|
|
198
|
+
<button id="example5-error" class="mb">Error Toast</button>
|
|
199
|
+
<script type="module">
|
|
200
|
+
import Toast from '/kempo-ui/src/components/Toast.js';
|
|
201
|
+
document.getElementById('example5-success').addEventListener('click', () => {
|
|
202
|
+
Toast.success("It Worked!");
|
|
203
|
+
});
|
|
204
|
+
document.getElementById('example5-warning').addEventListener('click', () => {
|
|
205
|
+
Toast.warning("Be Careful");
|
|
206
|
+
});
|
|
207
|
+
document.getElementById('example5-error').addEventListener('click', () => {
|
|
208
|
+
Toast.error("That's a very bad idea");
|
|
209
|
+
});
|
|
210
|
+
</script>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
<h2 id="jsRef">JavaScript Reference</h2>
|
|
216
|
+
|
|
217
|
+
<h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
|
|
218
|
+
<h6>Extends <a href="./component.html">Component</a></h6>
|
|
219
|
+
<h5>
|
|
220
|
+
<code>new Toast()</code><br />
|
|
221
|
+
<code>new Toast(<i>object</i> options)</code>
|
|
222
|
+
</h5>
|
|
223
|
+
|
|
224
|
+
<h4>Parameters</h4>
|
|
225
|
+
<h5><code>options<i>: object</i></code></h5>
|
|
226
|
+
<p>An object with the following optional properties:</p>
|
|
227
|
+
<ul>
|
|
228
|
+
<li><code>actionCallback<i>: function</i></code> - Function to call when the action button is clicked. If this function returns <code>false</code>, the toast will not close.</li>
|
|
229
|
+
<li><code>actionHtml<i>: string</i></code> - HTML content for the action button.</li>
|
|
230
|
+
<li><code>closeCallback<i>: function</i></code> - Function to call when the toast is closed.</li>
|
|
231
|
+
<li><code>closeHtml<i>: string</i></code> - HTML content for the close button.</li>
|
|
232
|
+
<li><code>timeout<i>: number</i></code> - Time in milliseconds before the toast automatically closes. Default is 0 (no auto-close).</li>
|
|
233
|
+
</ul>
|
|
234
|
+
|
|
235
|
+
<h3 id="staticMethods"><a href="#staticMethods" class="no-link">Static Methods</a></h3>
|
|
236
|
+
<h5><code>Toast.create(message, options)<i>: Toast</i></code></h5>
|
|
237
|
+
<p>Creates and displays a new toast with the specified message and options. Returns the created Toast instance.</p>
|
|
238
|
+
<p>Options include:</p>
|
|
239
|
+
<ul>
|
|
240
|
+
<li><code>position<i>: string</i></code> - Position of the toast on the screen. Default is 'auto', which uses 'bottom center' on mobile and 'top right' on desktop. Valid positions are: 'top left', 'top center', 'top right', 'bottom left', 'bottom center', 'bottom right'.</li>
|
|
241
|
+
<li><code>removeOnClose<i>: boolean</i></code> - If true, the toast element will be removed from the DOM when closed. Default is true.</li>
|
|
242
|
+
<li><code>timeout<i>: number</i></code> - Time in milliseconds before the toast automatically closes. Default is 5000ms (5 seconds).</li>
|
|
243
|
+
<li><code>action<i>: string | HTMLElement</i></code> - Text or HTML element to use for the action button.</li>
|
|
244
|
+
<li><code>actionCallback<i>: function</i></code> - Function to call when the action button is clicked. If this function returns <code>false</code>, the toast will not close.</li>
|
|
245
|
+
<li><code>close<i>: string | HTMLElement</i></code> - Text or HTML element to use for the close button.</li>
|
|
246
|
+
<li><code>closeCallback<i>: function</i></code> - Function to call when the toast is closed.</li>
|
|
247
|
+
<li><code>icon<i>: string | HTMLElement</i></code> - Text or HTML element to use as an icon in the toast.</li>
|
|
248
|
+
</ul>
|
|
249
|
+
|
|
250
|
+
<h5><code>Toast.success(message, options)<i>: Toast</i></code></h5>
|
|
251
|
+
<p>Creates and displays a success toast with a check icon and applies a success background style. Accepts the same options as <code>Toast.create()</code>.</p>
|
|
252
|
+
|
|
253
|
+
<h5><code>Toast.warning(message, options)<i>: Toast</i></code></h5>
|
|
254
|
+
<p>Creates and displays a warning toast with a warning icon and applies a warning background style. Accepts the same options as <code>Toast.create()</code>.</p>
|
|
255
|
+
|
|
256
|
+
<h5><code>Toast.error(message, options)<i>: Toast</i></code></h5>
|
|
257
|
+
<p>Creates and displays an error toast with an error icon and applies a danger background style. Accepts the same options as <code>Toast.create()</code>.</p>
|
|
258
|
+
|
|
259
|
+
<h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
|
|
260
|
+
<ul>
|
|
261
|
+
<li>ShadowComponent (configure <code>ShadowComponent.stylesheetPath</code> as needed for your server)</li>
|
|
262
|
+
<li><a href="./icon.html">Icon</a></li>
|
|
263
|
+
</ul>
|
|
264
|
+
|
|
265
|
+
<h3 id="properties"><a href="#properties" class="no-link">Properties</a></h3>
|
|
266
|
+
<h5><code>actionHtml<i>: string</i></code></h5>
|
|
267
|
+
<p>HTML content for the action button. Syncs to <code>action-html</code> attribute.</p>
|
|
268
|
+
|
|
269
|
+
<h5><code>closeHtml<i>: string</i></code></h5>
|
|
270
|
+
<p>HTML content for the close button. Syncs to <code>close-html</code> attribute.</p>
|
|
271
|
+
|
|
272
|
+
<h5><code>timeout<i>: number</i></code></h5>
|
|
273
|
+
<p>Time in milliseconds before the toast automatically closes. Default is 0 (no auto-close). Syncs to <code>timeout</code> attribute.</p>
|
|
274
|
+
|
|
275
|
+
<h5><code>opened<i>: boolean</i></code></h5>
|
|
276
|
+
<p>Whether the toast is currently open. Default is false. Syncs to <code>opened</code> attribute.</p>
|
|
277
|
+
|
|
278
|
+
<h5><code>actionCallback<i>: function</i></code></h5>
|
|
279
|
+
<p>Function to call when the action button is clicked.</p>
|
|
280
|
+
|
|
281
|
+
<h5><code>closeCallback<i>: function</i></code></h5>
|
|
282
|
+
<p>Function to call when the toast is closed.</p>
|
|
283
|
+
|
|
284
|
+
<h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
|
|
285
|
+
<h5><code>open()<i>: void</i></code></h5>
|
|
286
|
+
<p>Opens the toast. If a timeout is specified, this starts the timer for automatic closing.</p>
|
|
287
|
+
|
|
288
|
+
<h5><code>close()<i>: void</i></code></h5>
|
|
289
|
+
<p>Closes the toast and calls the <code>closeCallback</code> if provided.</p>
|
|
290
|
+
|
|
291
|
+
<h3 id="events"><a href="#events" class="no-link">Events</a></h3>
|
|
292
|
+
<h5><code>open</code></h5>
|
|
293
|
+
<p>Fired when the toast is opened.</p>
|
|
294
|
+
|
|
295
|
+
<h5><code>close</code></h5>
|
|
296
|
+
<p>Fired when the toast is closed.</p>
|
|
297
|
+
|
|
298
|
+
<h5><code>openchange</code></h5>
|
|
299
|
+
<p>Fired when the toast open state changes (both when opening and closing).</p>
|
|
300
|
+
|
|
301
|
+
<h3 id="toastContainer"><a href="#toastContainer" class="no-link">ToastContainer</a></h3>
|
|
302
|
+
<p>The <code>ToastContainer</code> is an internal component used to position and display toasts. It is automatically created when <code>Toast.create()</code> is called, but can also be used directly.</p>
|
|
303
|
+
|
|
304
|
+
<h5><code>new ToastContainer(position)</code></h5>
|
|
305
|
+
<p>Creates a new toast container at the specified position.</p>
|
|
306
|
+
|
|
307
|
+
<h5><code>position<i>: string</i></code></h5>
|
|
308
|
+
<p>The position of the container on the screen. Valid values are: 'top left', 'top center', 'top right', 'bottom left', 'bottom center', 'bottom right'.</p>
|
|
309
|
+
|
|
310
|
+
</main>
|
|
311
|
+
<div style="height:33vh"></div>
|
|
312
|
+
<script type="module" src="/kempo-ui/src/components/Import.js"></script>
|
|
313
|
+
<script type="module" src="/kempo-ui/src/components/Toast.js"></script>
|
|
314
|
+
</body>
|
|
315
|
+
</html>
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
+
<base href="/kempo-ui/">
|
|
4
5
|
<meta charset="UTF-8">
|
|
5
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
7
|
<title>Toggle - Components - Kempo Docs - A Web Components Solution</title>
|
|
7
|
-
<link rel="stylesheet" href="
|
|
8
|
-
<link rel="stylesheet" href="
|
|
9
|
-
<link rel="stylesheet" href="
|
|
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" />
|
|
10
12
|
<script>window.litDisableBundleWarning = true;</script>
|
|
11
|
-
<script type="module" src="./init.js"></script>
|
|
12
13
|
</head>
|
|
13
14
|
<body>
|
|
14
|
-
<k-import src="
|
|
15
|
+
<k-import src="/kempo-ui/nav.inc.html"></k-import>
|
|
15
16
|
<h1 class="ta-center">Toggle</h1>
|
|
16
17
|
<main>
|
|
17
18
|
<details class="b r mb">
|
|
@@ -145,7 +146,7 @@
|
|
|
145
146
|
|
|
146
147
|
</main>
|
|
147
148
|
<div style="height:33vh"></div>
|
|
148
|
-
<script type="module" src="
|
|
149
|
-
<script type="module" src="
|
|
149
|
+
<script type="module" src="/kempo-ui/src/components/Import.js"></script>
|
|
150
|
+
<script type="module" src="/kempo-ui/src/components/Toggle.js"></script>
|
|
150
151
|
</body>
|
|
151
152
|
</html>
|