kempo-ui 0.3.6 → 0.3.8
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/Accordion.js +5 -5
- package/dist/components/Aside.js +16 -16
- package/dist/components/Card.js +3 -3
- package/dist/components/ColorPicker.js +4 -4
- package/dist/components/ContentSlider.js +3 -3
- package/dist/components/Context.js +1 -1
- package/dist/components/Dialog.js +7 -7
- package/dist/components/Dropdown.js +7 -4
- package/dist/components/FilterItem.js +2 -2
- package/dist/components/FilterList.js +2 -2
- package/dist/components/FocusCapture.js +2 -2
- package/dist/components/HtmlEditor.js +62 -39
- package/dist/components/HybridComponent.js +1 -1
- package/dist/components/Icon.js +2 -2
- package/dist/components/Import.js +1 -1
- package/dist/components/LightComponent.js +1 -1
- package/dist/components/Main.js +3 -3
- package/dist/components/Nav.js +2 -2
- package/dist/components/NavSpacer.js +6 -0
- package/dist/components/PhotoViewer.js +3 -3
- package/dist/components/Resize.js +3 -3
- package/dist/components/ShadowComponent.js +1 -1
- package/dist/components/ShowMore.js +3 -3
- package/dist/components/Sortable.js +3 -3
- package/dist/components/Spinner.js +2 -2
- package/dist/components/Split.js +3 -3
- package/dist/components/Table.js +27 -27
- package/dist/components/Tabs.js +7 -7
- package/dist/components/Tags.js +4 -4
- package/dist/components/ThemeSelect.js +4 -4
- package/dist/components/ThemeSwitcher.js +5 -5
- package/dist/components/Timestamp.js +1 -1
- package/dist/components/Toast.js +3 -3
- package/dist/components/Toggle.js +3 -3
- package/dist/components/Tree.js +10 -10
- package/dist/components/htmlEditorControls/AlignCenter.js +4 -4
- package/dist/components/htmlEditorControls/AlignJustify.js +4 -4
- package/dist/components/htmlEditorControls/AlignLeft.js +4 -4
- package/dist/components/htmlEditorControls/AlignRight.js +4 -4
- package/dist/components/htmlEditorControls/Bold.js +4 -4
- package/dist/components/htmlEditorControls/BulletList.js +4 -4
- package/dist/components/htmlEditorControls/CharacterCount.js +3 -3
- package/dist/components/htmlEditorControls/ClearFormatting.js +4 -4
- package/dist/components/htmlEditorControls/CodeBlock.js +3 -3
- package/dist/components/htmlEditorControls/ControlGroup.js +2 -2
- package/dist/components/htmlEditorControls/ControlSpacer.js +2 -2
- package/dist/components/htmlEditorControls/CreateLink.js +3 -3
- package/dist/components/htmlEditorControls/DropdownControl.js +3 -3
- package/dist/components/htmlEditorControls/FormatBlock.js +4 -4
- package/dist/components/htmlEditorControls/HtmlEditorControl.js +2 -2
- package/dist/components/htmlEditorControls/InlineCode.js +3 -3
- package/dist/components/htmlEditorControls/InsertTable.js +3 -3
- package/dist/components/htmlEditorControls/Italic.js +4 -4
- package/dist/components/htmlEditorControls/Mode.js +3 -3
- package/dist/components/htmlEditorControls/NumberList.js +4 -4
- package/dist/components/htmlEditorControls/Strikethrough.js +4 -4
- package/dist/components/htmlEditorControls/TextBackgroundColor.js +6 -6
- package/dist/components/htmlEditorControls/TextColor.js +7 -7
- package/dist/components/htmlEditorControls/Underline.js +4 -4
- package/dist/components/htmlEditorControls/WordCount.js +3 -3
- package/dist/components/htmlEditorNodes/HtmlComment.js +24 -0
- package/dist/components/tableControls/DeleteRecord.js +2 -2
- package/dist/components/tableControls/DeleteSelected.js +2 -2
- package/dist/components/tableControls/Edit.js +4 -4
- package/dist/components/tableControls/ExportCSV.js +2 -2
- package/dist/components/tableControls/ExportJson.js +2 -2
- package/dist/components/tableControls/FieldSortHide.js +4 -4
- package/dist/components/tableControls/Filters.js +17 -17
- package/dist/components/tableControls/FirstPage.js +2 -2
- package/dist/components/tableControls/HiddenCount.js +2 -2
- package/dist/components/tableControls/Hide.js +2 -2
- package/dist/components/tableControls/LastPage.js +2 -2
- package/dist/components/tableControls/NextPage.js +2 -2
- package/dist/components/tableControls/PageSelect.js +4 -4
- package/dist/components/tableControls/PageSize.js +3 -3
- package/dist/components/tableControls/PrevPage.js +2 -2
- package/dist/components/tableControls/Search.js +2 -2
- package/dist/components/tableControls/ShowAll.js +2 -2
- package/dist/components/tableControls/TableControl.js +2 -2
- package/dist/utils/context.js +1 -1
- package/dist/utils/debounce.js +1 -1
- package/dist/utils/object.js +1 -1
- package/dist/utils/theme.js +1 -1
- package/dist/utils/wait.js +0 -1
- package/docs/components/accordion.html +2 -0
- package/docs/components/aside.html +55 -111
- package/docs/components/card.html +2 -0
- package/docs/components/color-picker.html +2 -0
- package/docs/components/content-slider.html +2 -0
- package/docs/components/context.html +2 -0
- package/docs/components/dialog.html +2 -0
- package/docs/components/dropdown.html +2 -0
- package/docs/components/filter-list.html +2 -0
- package/docs/components/focus-capture.html +2 -0
- package/docs/components/html-editor.html +54 -6
- package/docs/components/hybrid-component.html +2 -0
- package/docs/components/icon.html +2 -0
- package/docs/components/import.html +2 -0
- package/docs/components/light-component.html +2 -0
- package/docs/components/nav-spacer.html +315 -0
- package/docs/components/nav.html +2 -0
- package/docs/components/photo-viewer.html +2 -0
- package/docs/components/resize.html +2 -0
- package/docs/components/shadow-component.html +2 -0
- package/docs/components/show-more.html +2 -0
- package/docs/components/sortable.html +2 -0
- package/docs/components/spinner.html +2 -0
- package/docs/components/split.html +2 -0
- package/docs/components/table.html +2 -0
- package/docs/components/tableControls.html +2 -0
- package/docs/components/tableCustomFields.html +2 -0
- package/docs/components/tableFetchRecords.html +2 -0
- package/docs/components/tableFieldSortHide.html +2 -0
- package/docs/components/tablePagination.html +2 -0
- package/docs/components/tablePlaceholder.html +2 -0
- package/docs/components/tableRecordEditing.html +2 -0
- package/docs/components/tableRecordFiltering.html +2 -0
- package/docs/components/tableRecordHiding.html +2 -0
- package/docs/components/tableRecordSearching.html +2 -0
- package/docs/components/tableRecordSelection.html +2 -0
- package/docs/components/tableRowControls.html +2 -0
- package/docs/components/tableServerSync.html +2 -0
- package/docs/components/tableSorting.html +2 -0
- package/docs/components/tabs.html +2 -0
- package/docs/components/tags.html +2 -0
- package/docs/components/theme-select.html +2 -0
- package/docs/components/theme-switcher.html +2 -0
- package/docs/components/timestamp.html +2 -0
- package/docs/components/toast.html +2 -0
- package/docs/components/toggle.html +2 -0
- package/docs/components/tree.html +2 -0
- package/docs/icons/comment.svg +1 -0
- package/docs/index.html +8 -0
- package/docs/src/components/Accordion.js +5 -5
- package/docs/src/components/Aside.js +16 -16
- package/docs/src/components/Card.js +3 -3
- package/docs/src/components/ColorPicker.js +4 -4
- package/docs/src/components/ContentSlider.js +3 -3
- package/docs/src/components/Context.js +1 -1
- package/docs/src/components/Dialog.js +7 -7
- package/docs/src/components/Dropdown.js +7 -4
- package/docs/src/components/FilterItem.js +2 -2
- package/docs/src/components/FilterList.js +2 -2
- package/docs/src/components/FocusCapture.js +2 -2
- package/docs/src/components/HtmlEditor.js +62 -39
- package/docs/src/components/HybridComponent.js +1 -1
- package/docs/src/components/Icon.js +2 -2
- package/docs/src/components/Import.js +1 -1
- package/docs/src/components/LightComponent.js +1 -1
- package/docs/src/components/Main.js +3 -3
- package/docs/src/components/Nav.js +2 -2
- package/docs/src/components/NavSpacer.js +6 -0
- package/docs/src/components/PhotoViewer.js +3 -3
- package/docs/src/components/Resize.js +3 -3
- package/docs/src/components/ShadowComponent.js +1 -1
- package/docs/src/components/ShowMore.js +3 -3
- package/docs/src/components/Sortable.js +3 -3
- package/docs/src/components/Spinner.js +2 -2
- package/docs/src/components/Split.js +3 -3
- package/docs/src/components/Table.js +27 -27
- package/docs/src/components/Tabs.js +7 -7
- package/docs/src/components/Tags.js +4 -4
- package/docs/src/components/ThemeSelect.js +4 -4
- package/docs/src/components/ThemeSwitcher.js +5 -5
- package/docs/src/components/Timestamp.js +1 -1
- package/docs/src/components/Toast.js +3 -3
- package/docs/src/components/Toggle.js +3 -3
- package/docs/src/components/Tree.js +10 -10
- package/docs/src/components/htmlEditorControls/AlignCenter.js +4 -4
- package/docs/src/components/htmlEditorControls/AlignJustify.js +4 -4
- package/docs/src/components/htmlEditorControls/AlignLeft.js +4 -4
- package/docs/src/components/htmlEditorControls/AlignRight.js +4 -4
- package/docs/src/components/htmlEditorControls/Bold.js +4 -4
- package/docs/src/components/htmlEditorControls/BulletList.js +4 -4
- package/docs/src/components/htmlEditorControls/CharacterCount.js +3 -3
- package/docs/src/components/htmlEditorControls/ClearFormatting.js +4 -4
- package/docs/src/components/htmlEditorControls/CodeBlock.js +3 -3
- package/docs/src/components/htmlEditorControls/ControlGroup.js +2 -2
- package/docs/src/components/htmlEditorControls/ControlSpacer.js +2 -2
- package/docs/src/components/htmlEditorControls/CreateLink.js +3 -3
- package/docs/src/components/htmlEditorControls/DropdownControl.js +3 -3
- package/docs/src/components/htmlEditorControls/FormatBlock.js +4 -4
- package/docs/src/components/htmlEditorControls/HtmlEditorControl.js +2 -2
- package/docs/src/components/htmlEditorControls/InlineCode.js +3 -3
- package/docs/src/components/htmlEditorControls/InsertTable.js +3 -3
- package/docs/src/components/htmlEditorControls/Italic.js +4 -4
- package/docs/src/components/htmlEditorControls/Mode.js +3 -3
- package/docs/src/components/htmlEditorControls/NumberList.js +4 -4
- package/docs/src/components/htmlEditorControls/Strikethrough.js +4 -4
- package/docs/src/components/htmlEditorControls/TextBackgroundColor.js +6 -6
- package/docs/src/components/htmlEditorControls/TextColor.js +7 -7
- package/docs/src/components/htmlEditorControls/Underline.js +4 -4
- package/docs/src/components/htmlEditorControls/WordCount.js +3 -3
- package/docs/src/components/htmlEditorNodes/HtmlComment.js +24 -0
- package/docs/src/components/tableControls/DeleteRecord.js +2 -2
- package/docs/src/components/tableControls/DeleteSelected.js +2 -2
- package/docs/src/components/tableControls/Edit.js +4 -4
- package/docs/src/components/tableControls/ExportCSV.js +2 -2
- package/docs/src/components/tableControls/ExportJson.js +2 -2
- package/docs/src/components/tableControls/FieldSortHide.js +4 -4
- package/docs/src/components/tableControls/Filters.js +17 -17
- package/docs/src/components/tableControls/FirstPage.js +2 -2
- package/docs/src/components/tableControls/HiddenCount.js +2 -2
- package/docs/src/components/tableControls/Hide.js +2 -2
- package/docs/src/components/tableControls/LastPage.js +2 -2
- package/docs/src/components/tableControls/NextPage.js +2 -2
- package/docs/src/components/tableControls/PageSelect.js +4 -4
- package/docs/src/components/tableControls/PageSize.js +3 -3
- package/docs/src/components/tableControls/PrevPage.js +2 -2
- package/docs/src/components/tableControls/Search.js +2 -2
- package/docs/src/components/tableControls/ShowAll.js +2 -2
- package/docs/src/components/tableControls/TableControl.js +2 -2
- package/docs/src/utils/context.js +1 -1
- package/docs/src/utils/debounce.js +1 -1
- package/docs/src/utils/object.js +1 -1
- package/docs/src/utils/theme.js +1 -1
- package/docs/src/utils/wait.js +0 -1
- package/docs/utils/context.html +2 -0
- package/docs/utils/cookie.html +2 -0
- package/docs/utils/debounce.html +2 -0
- package/docs/utils/drag.html +2 -0
- package/docs/utils/elevation.html +2 -0
- package/docs/utils/formatTimestamp.html +8 -6
- package/docs/utils/object.html +2 -0
- package/docs/utils/propConverters.html +2 -0
- package/docs/utils/string.html +2 -0
- package/docs/utils/theme.html +2 -0
- package/docs/utils/toTitleCase.html +8 -6
- package/docs/utils/type.html +2 -0
- package/docs/utils/wait.html +2 -0
- package/docs-src/components/aside.page.html +53 -111
- package/docs-src/components/html-editor.page.html +52 -6
- package/docs-src/components/nav-spacer.page.html +65 -0
- package/docs-src/index.page.html +6 -0
- package/docs-src/nav.fragment.html +2 -0
- package/docs-src/utils/formatTimestamp.page.html +6 -6
- package/docs-src/utils/toTitleCase.page.html +6 -6
- package/icons/comment.svg +1 -0
- package/llm.txt +1 -0
- package/package.json +3 -3
- package/scripts/build.js +1 -1
- package/src/components/Accordion.js +1 -1
- package/src/components/Aside.js +12 -1
- package/src/components/Dropdown.js +7 -3
- package/src/components/HtmlEditor.js +699 -1206
- package/src/components/Main.js +1 -1
- package/src/components/NavSpacer.js +55 -0
- package/src/components/htmlEditorControls/AlignCenter.js +5 -5
- package/src/components/htmlEditorControls/AlignJustify.js +5 -5
- package/src/components/htmlEditorControls/AlignLeft.js +5 -5
- package/src/components/htmlEditorControls/AlignRight.js +5 -5
- package/src/components/htmlEditorControls/Bold.js +5 -5
- package/src/components/htmlEditorControls/BulletList.js +5 -5
- package/src/components/htmlEditorControls/ClearFormatting.js +5 -5
- package/src/components/htmlEditorControls/CodeBlock.js +16 -8
- package/src/components/htmlEditorControls/CreateLink.js +3 -7
- package/src/components/htmlEditorControls/FormatBlock.js +5 -5
- package/src/components/htmlEditorControls/InlineCode.js +1 -13
- package/src/components/htmlEditorControls/InsertTable.js +43 -44
- package/src/components/htmlEditorControls/Italic.js +5 -5
- package/src/components/htmlEditorControls/Mode.js +1 -1
- package/src/components/htmlEditorControls/NumberList.js +5 -5
- package/src/components/htmlEditorControls/Strikethrough.js +5 -5
- package/src/components/htmlEditorControls/Underline.js +5 -5
- package/src/components/htmlEditorNodes/HtmlComment.js +118 -0
- package/tests/components/Accordion.browser-test.js +154 -0
- package/tests/components/Aside.browser-test.js +75 -0
- package/tests/components/Dropdown.browser-test.js +85 -0
- package/tests/components/HtmlComment.browser-test.js +115 -0
- package/tests/components/HtmlEditor.browser-test.js +379 -0
- package/tests/components/NavSpacer.browser-test.js +81 -0
package/docs/utils/wait.html
CHANGED
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
<k-filter-item filter-keywords="icon components"><a href="../components/icon.html">Icon<br><small>Component</small></a></k-filter-item>
|
|
42
42
|
<k-filter-item filter-keywords="import components"><a href="../components/import.html">Import<br><small>Component</small></a></k-filter-item>
|
|
43
43
|
<k-filter-item filter-keywords="nav navbar navigation components"><a href="../components/nav.html">Nav<br><small>Component</small></a></k-filter-item>
|
|
44
|
+
<k-filter-item filter-keywords="nav spacer navbar spacer navspacer components"><a href="../components/nav-spacer.html">Nav Spacer<br><small>Component</small></a></k-filter-item>
|
|
44
45
|
<k-filter-item filter-keywords="photo viewer photoviewer components"><a href="../components/photo-viewer.html">Photo Viewer<br><small>Component</small></a></k-filter-item>
|
|
45
46
|
<k-filter-item filter-keywords="resize components"><a href="../components/resize.html">Resize<br><small>Component</small></a></k-filter-item>
|
|
46
47
|
<k-filter-item filter-keywords="show more showmore components"><a href="../components/show-more.html">Show More<br><small>Component</small></a></k-filter-item>
|
|
@@ -118,6 +119,7 @@
|
|
|
118
119
|
<a href="../components/icon.html">Icon</a>
|
|
119
120
|
<a href="../components/import.html">Import</a>
|
|
120
121
|
<a href="../components/nav.html">Nav</a>
|
|
122
|
+
<a href="../components/nav-spacer.html">Nav Spacer</a>
|
|
121
123
|
<a href="../components/photo-viewer.html">Photo Viewer</a>
|
|
122
124
|
<a href="../components/resize.html">Resize</a>
|
|
123
125
|
<a href="../components/show-more.html">Show More</a>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<page pageName="Aside" title="Aside - Components - Kempo Docs - A Web Components Solution">
|
|
2
2
|
<content>
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
3
|
+
<k-accordion persistent-id="toc" class="b r mb">
|
|
4
|
+
<k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
|
|
5
|
+
<k-accordion-panel name="toc-panel">
|
|
6
|
+
<div class="m">
|
|
6
7
|
<h6>Overlay Mode</h6>
|
|
7
8
|
<a href="#overlayBasic">Basic Usage</a><br />
|
|
8
9
|
<a href="#overlayClose">Closing Options</a><br />
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
<a href="#customWidth">Custom Width</a><br />
|
|
18
19
|
<a href="#customBg">Custom Background</a><br />
|
|
19
20
|
<a href="#customCollapsed">Custom Collapsed Width</a><br />
|
|
21
|
+
<a href="#persistentState">Persistent State</a><br />
|
|
20
22
|
|
|
21
23
|
<h6 class="mt">Sub-Components</h6>
|
|
22
24
|
<a href="#subItems">Items & Labels</a><br />
|
|
@@ -39,7 +41,8 @@
|
|
|
39
41
|
<a href="#asideSpacer">k-aside-spacer</a><br />
|
|
40
42
|
<a href="#asideToggle">k-aside-toggle</a><br />
|
|
41
43
|
</div>
|
|
42
|
-
|
|
44
|
+
</k-accordion-panel>
|
|
45
|
+
</k-accordion>
|
|
43
46
|
|
|
44
47
|
<h2>Overlay Mode</h2>
|
|
45
48
|
<p>The default mode. Use <code>state="offscreen"</code> as the starting state; call <code>expand()</code> to open. Clicking the backdrop or pressing ESC closes it by default.</p>
|
|
@@ -49,12 +52,7 @@
|
|
|
49
52
|
<div class="row -mx">
|
|
50
53
|
<div class="col m-span-12 px">
|
|
51
54
|
<k-card label="HTML">
|
|
52
|
-
<pre><code class="hljs
|
|
53
|
-
<p>Overlay Menu Content</p>
|
|
54
|
-
</k-aside>
|
|
55
|
-
<button onclick="this.previousElementSibling.expand()">
|
|
56
|
-
Open Menu
|
|
57
|
-
</button></code></pre>
|
|
55
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-aside</span> <span class="hljs-attr">state</span>=<span class="hljs-string">'offscreen'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">p</span>></span>Overlay Menu Content<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-aside</span>></span><br><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">'this.previousElementSibling.expand()'</span>></span> Open Menu <span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
|
58
56
|
</k-card>
|
|
59
57
|
</div>
|
|
60
58
|
<div class="col m-span-12 px">
|
|
@@ -78,16 +76,7 @@
|
|
|
78
76
|
<div class="row -mx">
|
|
79
77
|
<div class="col m-span-12 px">
|
|
80
78
|
<k-card label="HTML">
|
|
81
|
-
<pre><code class="hljs
|
|
82
|
-
overlay-close="false">
|
|
83
|
-
<p>Overlay Menu</p>
|
|
84
|
-
<button onclick="this.closest('k-aside').hide()">
|
|
85
|
-
Close
|
|
86
|
-
</button>
|
|
87
|
-
</k-aside>
|
|
88
|
-
<button onclick="this.previousElementSibling.expand()">
|
|
89
|
-
Open Menu
|
|
90
|
-
</button></code></pre>
|
|
79
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-aside</span> <span class="hljs-attr">state</span>=<span class="hljs-string">'offscreen'</span> <span class="hljs-attr">overlay-close</span>=<span class="hljs-string">'false'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">p</span>></span>Overlay Menu<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">'this.closest("k-aside").hide()'</span>></span> Close <span class="hljs-tag"></<span class="hljs-name">button</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-aside</span>></span><br><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">'this.previousElementSibling.expand()'</span>></span> Open Menu <span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
|
91
80
|
</k-card>
|
|
92
81
|
</div>
|
|
93
82
|
<div class="col m-span-12 px">
|
|
@@ -115,13 +104,7 @@
|
|
|
115
104
|
<div class="row -mx">
|
|
116
105
|
<div class="col m-span-12 px">
|
|
117
106
|
<k-card label="HTML">
|
|
118
|
-
<pre><code class="hljs
|
|
119
|
-
side="right">
|
|
120
|
-
<p>Right Side Menu</p>
|
|
121
|
-
</k-aside>
|
|
122
|
-
<button onclick="this.previousElementSibling.expand()">
|
|
123
|
-
Open Right Menu
|
|
124
|
-
</button></code></pre>
|
|
107
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-aside</span> <span class="hljs-attr">state</span>=<span class="hljs-string">'offscreen'</span> <span class="hljs-attr">side</span>=<span class="hljs-string">'right'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">p</span>></span>Right Side Menu<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-aside</span>></span><br><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">'this.previousElementSibling.expand()'</span>></span> Open Right Menu <span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
|
125
108
|
</k-card>
|
|
126
109
|
</div>
|
|
127
110
|
<div class="col m-span-12 px">
|
|
@@ -147,23 +130,13 @@
|
|
|
147
130
|
<div class="row -mx">
|
|
148
131
|
<div class="col m-span-12 px">
|
|
149
132
|
<k-card label="HTML">
|
|
150
|
-
<pre><code class="hljs
|
|
151
|
-
<nav>
|
|
152
|
-
<h3>Sidebar</h3>
|
|
153
|
-
<a href="#">Home</a>
|
|
154
|
-
<a href="#">About</a>
|
|
155
|
-
<a href="#">Contact</a>
|
|
156
|
-
</nav>
|
|
157
|
-
</k-aside>
|
|
158
|
-
<button onclick="this.previousElementSibling.toggle()">
|
|
159
|
-
Toggle Sidebar
|
|
160
|
-
</button></code></pre>
|
|
133
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-aside</span> <span class="hljs-attr">main</span>=<span class="hljs-string">'push'</span> <span class="hljs-attr">state</span>=<span class="hljs-string">'offscreen'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">nav</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">h3</span>></span>Sidebar<span class="hljs-tag"></<span class="hljs-name">h3</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">'#'</span>></span>Home<span class="hljs-tag"></<span class="hljs-name">a</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">'#'</span>></span>About<span class="hljs-tag"></<span class="hljs-name">a</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">'#'</span>></span>Contact<span class="hljs-tag"></<span class="hljs-name">a</span>></span><br> <span class="hljs-tag"></<span class="hljs-name">nav</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-aside</span>></span><br><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">'this.previousElementSibling.toggle()'</span>></span> Toggle Sidebar <span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
|
161
134
|
</k-card>
|
|
162
135
|
</div>
|
|
163
136
|
<div class="col m-span-12 px">
|
|
164
137
|
<k-card label="Output">
|
|
165
138
|
<k-aside id="aside5" main="push" state="offscreen">
|
|
166
|
-
<
|
|
139
|
+
<k-nav-spacer></k-nav-spacer>
|
|
167
140
|
<nav>
|
|
168
141
|
<h3>Sidebar</h3>
|
|
169
142
|
<a href="#">Home</a>
|
|
@@ -186,23 +159,13 @@
|
|
|
186
159
|
<div class="row -mx">
|
|
187
160
|
<div class="col m-span-12 px">
|
|
188
161
|
<k-card label="HTML">
|
|
189
|
-
<pre><code class="hljs
|
|
190
|
-
<nav>
|
|
191
|
-
<h3>Menu</h3>
|
|
192
|
-
<a href="#">Dashboard</a>
|
|
193
|
-
<a href="#">Settings</a>
|
|
194
|
-
</nav>
|
|
195
|
-
</k-aside>
|
|
196
|
-
|
|
197
|
-
<button onclick="aside.expand()">Expand</button>
|
|
198
|
-
<button onclick="aside.collapse()">Collapse</button>
|
|
199
|
-
<button onclick="aside.hide()">Hide</button></code></pre>
|
|
162
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-aside</span> <span class="hljs-attr">main</span>=<span class="hljs-string">'push'</span> <span class="hljs-attr">state</span>=<span class="hljs-string">'offscreen'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">nav</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">h3</span>></span>Menu<span class="hljs-tag"></<span class="hljs-name">h3</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">'#'</span>></span>Dashboard<span class="hljs-tag"></<span class="hljs-name">a</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">'#'</span>></span>Settings<span class="hljs-tag"></<span class="hljs-name">a</span>></span><br> <span class="hljs-tag"></<span class="hljs-name">nav</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-aside</span>></span><br><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">'aside.expand()'</span>></span>Expand<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">onclick</span>=<span class="hljs-string">'aside.collapse()'</span>></span>Collapse<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">onclick</span>=<span class="hljs-string">'aside.hide()'</span>></span>Hide<span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
|
200
163
|
</k-card>
|
|
201
164
|
</div>
|
|
202
165
|
<div class="col m-span-12 px">
|
|
203
166
|
<k-card label="Output">
|
|
204
167
|
<k-aside id="aside6" main="push" state="offscreen">
|
|
205
|
-
<
|
|
168
|
+
<k-nav-spacer></k-nav-spacer>
|
|
206
169
|
<nav>
|
|
207
170
|
<h3>Menu</h3>
|
|
208
171
|
<a href="#">Dashboard</a>
|
|
@@ -227,22 +190,13 @@
|
|
|
227
190
|
<div class="row -mx">
|
|
228
191
|
<div class="col m-span-12 px">
|
|
229
192
|
<k-card label="HTML">
|
|
230
|
-
<pre><code class="hljs
|
|
231
|
-
<nav>
|
|
232
|
-
<h3>Right Panel</h3>
|
|
233
|
-
<a href="#">Item 1</a>
|
|
234
|
-
<a href="#">Item 2</a>
|
|
235
|
-
</nav>
|
|
236
|
-
</k-aside>
|
|
237
|
-
<button onclick="this.previousElementSibling.toggle()">
|
|
238
|
-
Toggle Right Sidebar
|
|
239
|
-
</button></code></pre>
|
|
193
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-aside</span> <span class="hljs-attr">main</span>=<span class="hljs-string">'push'</span> <span class="hljs-attr">side</span>=<span class="hljs-string">'right'</span> <span class="hljs-attr">state</span>=<span class="hljs-string">'offscreen'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">nav</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">h3</span>></span>Right Panel<span class="hljs-tag"></<span class="hljs-name">h3</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">'#'</span>></span>Item 1<span class="hljs-tag"></<span class="hljs-name">a</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">'#'</span>></span>Item 2<span class="hljs-tag"></<span class="hljs-name">a</span>></span><br> <span class="hljs-tag"></<span class="hljs-name">nav</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-aside</span>></span><br><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">'this.previousElementSibling.toggle()'</span>></span> Toggle Right Sidebar <span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
|
240
194
|
</k-card>
|
|
241
195
|
</div>
|
|
242
196
|
<div class="col m-span-12 px">
|
|
243
197
|
<k-card label="Output">
|
|
244
198
|
<k-aside id="aside7" main="push" side="right" state="offscreen">
|
|
245
|
-
<
|
|
199
|
+
<k-nav-spacer></k-nav-spacer>
|
|
246
200
|
<nav>
|
|
247
201
|
<h3>Right Panel</h3>
|
|
248
202
|
<a href="#">Item 1</a>
|
|
@@ -266,15 +220,7 @@
|
|
|
266
220
|
<div class="row -mx">
|
|
267
221
|
<div class="col m-span-12 px">
|
|
268
222
|
<k-card label="HTML">
|
|
269
|
-
<pre><code class="hljs
|
|
270
|
-
k-aside { --width: 30rem; }
|
|
271
|
-
</style>
|
|
272
|
-
<k-aside state="offscreen">
|
|
273
|
-
<p>This menu is 30rem wide.</p>
|
|
274
|
-
</k-aside>
|
|
275
|
-
<button onclick="this.previousElementSibling.expand()">
|
|
276
|
-
Open Wide Menu
|
|
277
|
-
</button></code></pre>
|
|
223
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">style</span>></span><span class="language-css"><br> k-<span class="hljs-selector-tag">aside</span> {<br> <span class="hljs-attr">--width</span>: <span class="hljs-number">30rem</span>;<br> }<br></span><span class="hljs-tag"></<span class="hljs-name">style</span>></span><br><span class="hljs-tag"><<span class="hljs-name">k-aside</span> <span class="hljs-attr">state</span>=<span class="hljs-string">'offscreen'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">p</span>></span>This menu is 30rem wide.<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-aside</span>></span><br><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">'this.previousElementSibling.expand()'</span>></span> Open Wide Menu <span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
|
278
224
|
</k-card>
|
|
279
225
|
</div>
|
|
280
226
|
<div class="col m-span-12 px">
|
|
@@ -298,19 +244,7 @@
|
|
|
298
244
|
<div class="row -mx">
|
|
299
245
|
<div class="col m-span-12 px">
|
|
300
246
|
<k-card label="HTML">
|
|
301
|
-
<pre><code class="hljs
|
|
302
|
-
k-aside { --bg: var(--c_primary); }
|
|
303
|
-
</style>
|
|
304
|
-
<k-aside state="offscreen">
|
|
305
|
-
<nav class="p tc-light">
|
|
306
|
-
<h3>Branded Menu</h3>
|
|
307
|
-
<a href="#" class="tc-light">Home</a>
|
|
308
|
-
<a href="#" class="tc-light">About</a>
|
|
309
|
-
</nav>
|
|
310
|
-
</k-aside>
|
|
311
|
-
<button onclick="this.previousElementSibling.expand()">
|
|
312
|
-
Open Branded Menu
|
|
313
|
-
</button></code></pre>
|
|
247
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">style</span>></span><span class="language-css"><br> k-<span class="hljs-selector-tag">aside</span> {<br> <span class="hljs-attr">--bg</span>: <span class="hljs-built_in">var</span>(--c_primary);<br> }<br></span><span class="hljs-tag"></<span class="hljs-name">style</span>></span><br><span class="hljs-tag"><<span class="hljs-name">k-aside</span> <span class="hljs-attr">state</span>=<span class="hljs-string">'offscreen'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">nav</span> <span class="hljs-attr">class</span>=<span class="hljs-string">'p tc-light'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">h3</span>></span>Branded Menu<span class="hljs-tag"></<span class="hljs-name">h3</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">'#'</span> <span class="hljs-attr">class</span>=<span class="hljs-string">'tc-light'</span>></span>Home<span class="hljs-tag"></<span class="hljs-name">a</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">'#'</span> <span class="hljs-attr">class</span>=<span class="hljs-string">'tc-light'</span>></span>About<span class="hljs-tag"></<span class="hljs-name">a</span>></span><br> <span class="hljs-tag"></<span class="hljs-name">nav</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-aside</span>></span><br><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">'this.previousElementSibling.expand()'</span>></span> Open Branded Menu <span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
|
314
248
|
</k-card>
|
|
315
249
|
</div>
|
|
316
250
|
<div class="col m-span-12 px">
|
|
@@ -338,28 +272,14 @@
|
|
|
338
272
|
<div class="row -mx">
|
|
339
273
|
<div class="col m-span-12 px">
|
|
340
274
|
<k-card label="HTML">
|
|
341
|
-
<pre><code class="hljs
|
|
342
|
-
k-aside { --collapsed-width: 5rem; }
|
|
343
|
-
</style>
|
|
344
|
-
<k-aside main="push" state="offscreen">
|
|
345
|
-
<nav>
|
|
346
|
-
<h3>Sidebar</h3>
|
|
347
|
-
<a href="#">Dashboard</a>
|
|
348
|
-
<a href="#">Reports</a>
|
|
349
|
-
<a href="#">Settings</a>
|
|
350
|
-
</nav>
|
|
351
|
-
</k-aside>
|
|
352
|
-
|
|
353
|
-
<button onclick="aside.expand()">Expand</button>
|
|
354
|
-
<button onclick="aside.collapse()">Collapse</button>
|
|
355
|
-
<button onclick="aside.hide()">Hide</button></code></pre>
|
|
275
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">style</span>></span><span class="language-css"><br> k-<span class="hljs-selector-tag">aside</span> {<br> <span class="hljs-attr">--collapsed-width</span>: <span class="hljs-number">5rem</span>;<br> }<br></span><span class="hljs-tag"></<span class="hljs-name">style</span>></span><br><span class="hljs-tag"><<span class="hljs-name">k-aside</span> <span class="hljs-attr">main</span>=<span class="hljs-string">'push'</span> <span class="hljs-attr">state</span>=<span class="hljs-string">'offscreen'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">nav</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">h3</span>></span>Sidebar<span class="hljs-tag"></<span class="hljs-name">h3</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">'#'</span>></span>Dashboard<span class="hljs-tag"></<span class="hljs-name">a</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">'#'</span>></span>Reports<span class="hljs-tag"></<span class="hljs-name">a</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">'#'</span>></span>Settings<span class="hljs-tag"></<span class="hljs-name">a</span>></span><br> <span class="hljs-tag"></<span class="hljs-name">nav</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-aside</span>></span><br><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">'aside.expand()'</span>></span>Expand<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">onclick</span>=<span class="hljs-string">'aside.collapse()'</span>></span>Collapse<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">onclick</span>=<span class="hljs-string">'aside.hide()'</span>></span>Hide<span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
|
356
276
|
</k-card>
|
|
357
277
|
</div>
|
|
358
278
|
<div class="col m-span-12 px">
|
|
359
279
|
<k-card label="Output">
|
|
360
280
|
<style>k-aside#aside13 { --collapsed-width: 5rem; }</style>
|
|
361
281
|
<k-aside id="aside13" main="push" state="offscreen">
|
|
362
|
-
<
|
|
282
|
+
<k-nav-spacer></k-nav-spacer>
|
|
363
283
|
<nav>
|
|
364
284
|
<h3>Sidebar</h3>
|
|
365
285
|
<a href="#">Dashboard</a>
|
|
@@ -380,6 +300,34 @@
|
|
|
380
300
|
</div>
|
|
381
301
|
</div>
|
|
382
302
|
|
|
303
|
+
<h3 id="persistentState"><a href="#persistentState" class="no-link">Persistent State</a></h3>
|
|
304
|
+
<p>Use <code>persistent-id</code> to remember the aside's state across page loads. The state is saved to <code>localStorage</code> under the key <code>aside-persistent-id-{id}</code> and restored when the element is connected. Works with <code>"expanded"</code>, <code>"collapsed"</code>, and <code>"offscreen"</code> states.</p>
|
|
305
|
+
<div class="row -mx">
|
|
306
|
+
<div class="col m-span-12 px">
|
|
307
|
+
<k-card label="HTML">
|
|
308
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-aside</span> <span class="hljs-attr">main</span>=<span class="hljs-string">'push'</span> <span class="hljs-attr">state</span>=<span class="hljs-string">'offscreen'</span> <span class="hljs-attr">persistent-id</span>=<span class="hljs-string">'my-nav'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">nav</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">p</span>></span>Sidebar Content<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br> <span class="hljs-tag"></<span class="hljs-name">nav</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-aside</span>></span><br><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">'this.previousElementSibling.expand()'</span>></span>Expand<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">onclick</span>=<span class="hljs-string">'this.previousElementSibling.collapse()'</span>></span>Collapse<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">onclick</span>=<span class="hljs-string">'this.previousElementSibling.hide()'</span>></span>Hide<span class="hljs-tag"></<span class="hljs-name">button</span>></span></code></pre>
|
|
309
|
+
</k-card>
|
|
310
|
+
</div>
|
|
311
|
+
<div class="col m-span-12 px">
|
|
312
|
+
<k-card label="Output">
|
|
313
|
+
<k-aside id="aside-persist" main="push" state="offscreen" persistent-id="docs-aside-persist-demo">
|
|
314
|
+
<k-nav-spacer></k-nav-spacer>
|
|
315
|
+
<p>Sidebar Content</p>
|
|
316
|
+
</k-aside>
|
|
317
|
+
<button id="btn-persist-expand">Expand</button>
|
|
318
|
+
<button id="btn-persist-collapse">Collapse</button>
|
|
319
|
+
<button id="btn-persist-hide">Hide</button>
|
|
320
|
+
<p class="mt"><small>Toggle the state and reload the page — it will be restored.</small></p>
|
|
321
|
+
<script>
|
|
322
|
+
const aPersist = document.getElementById('aside-persist');
|
|
323
|
+
document.getElementById('btn-persist-expand').addEventListener('click',()=> aPersist.expand());
|
|
324
|
+
document.getElementById('btn-persist-collapse').addEventListener('click',()=> aPersist.collapse());
|
|
325
|
+
document.getElementById('btn-persist-hide').addEventListener('click',()=> aPersist.hide());
|
|
326
|
+
</script>
|
|
327
|
+
</k-card>
|
|
328
|
+
</div>
|
|
329
|
+
</div>
|
|
330
|
+
|
|
383
331
|
<h2 id="subItems"><a href="#subItems" class="no-link">Items & Labels</a></h2>
|
|
384
332
|
<p>Use <code>k-aside-item</code>, <code>k-aside-label</code>, and <code>k-aside-spacer</code> inside a push-mode aside for a navigation panel with icons and text. Set <code>--aside_padding: 0;</code> on the aside so the sub-components control their own spacing.</p>
|
|
385
333
|
<p>Items and labels automatically react to the aside's collapsed/expanded state.</p>
|
|
@@ -416,17 +364,7 @@
|
|
|
416
364
|
<div class="row -mx">
|
|
417
365
|
<div class="col m-span-12 px">
|
|
418
366
|
<k-card label="HTML">
|
|
419
|
-
<pre><code class="hljs
|
|
420
|
-
<p>Open and close me to see events.</p>
|
|
421
|
-
</k-aside>
|
|
422
|
-
<button onclick="myAside.expand()">Open Menu</button>
|
|
423
|
-
<div id="log"></div>
|
|
424
|
-
|
|
425
|
-
<script>
|
|
426
|
-
myAside.addEventListener('aside_state_change', e => {
|
|
427
|
-
log.textContent = 'state: ' + e.detail.state;
|
|
428
|
-
});
|
|
429
|
-
</script></code></pre>
|
|
367
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-aside</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'myAside'</span> <span class="hljs-attr">state</span>=<span class="hljs-string">'offscreen'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">p</span>></span>Open and close me to see events.<span class="hljs-tag"></<span class="hljs-name">p</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-aside</span>></span><br><span class="hljs-tag"><<span class="hljs-name">button</span> <span class="hljs-attr">onclick</span>=<span class="hljs-string">'myAside.expand()'</span>></span>Open Menu<span class="hljs-tag"></<span class="hljs-name">button</span>></span><br><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">'log'</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br><span class="hljs-tag"><<span class="hljs-name">script</span>></span><span class="language-javascript"><br> myAside.<span class="hljs-title function_">addEventListener</span>(<span class="hljs-string">'aside_state_change'</span>, <span class="hljs-function"><span class="hljs-params">e</span> =></span> {<br> log.<span class="hljs-property">textContent</span> = <span class="hljs-string">'state: '</span> + e.<span class="hljs-property">detail</span>.<span class="hljs-property">state</span>;<br> });<br></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span></code></pre>
|
|
430
368
|
</k-card>
|
|
431
369
|
</div>
|
|
432
370
|
<div class="col m-span-12 px">
|
|
@@ -475,6 +413,8 @@
|
|
|
475
413
|
<p>Whether clicking the overlay backdrop closes the aside. Defaults to <code>true</code>. Syncs to <code>overlay-close</code> attribute.</p>
|
|
476
414
|
<h5><code>escClose<i>: boolean</i></code></h5>
|
|
477
415
|
<p>Whether pressing the ESC key closes the aside. Defaults to <code>true</code>. Syncs to <code>esc-close</code> attribute.</p>
|
|
416
|
+
<h5><code>persistentId<i>: string | null</i></code></h5>
|
|
417
|
+
<p>When set, the aside's <code>state</code> is saved to <code>localStorage</code> under <code>aside-persistent-id-{id}</code> on every change, and restored when the element connects. Defaults to <code>null</code>. Syncs to <code>persistent-id</code> attribute.</p>
|
|
478
418
|
|
|
479
419
|
<h3 id="eventRef"><a href="#eventRef" class="no-link">Events</a></h3>
|
|
480
420
|
<h5><code>aside_state_change</code></h5>
|
|
@@ -545,7 +485,9 @@
|
|
|
545
485
|
<p>No additional attributes. Automatically syncs with the parent aside's state.</p>
|
|
546
486
|
</content>
|
|
547
487
|
<content location="scripts">
|
|
488
|
+
<script type="module" src="{{pathToRoot}}src/components/Accordion.js"></script>
|
|
548
489
|
<script type="module" src="{{pathToRoot}}src/components/Aside.js"></script>
|
|
549
490
|
<script type="module" src="{{pathToRoot}}src/components/Card.js"></script>
|
|
491
|
+
<script type="module" src="{{pathToRoot}}src/components/NavSpacer.js"></script>
|
|
550
492
|
</content>
|
|
551
493
|
</page>
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
<h6>Examples</h6>
|
|
8
8
|
<a href="#fullExample">Complete Editor Example</a><br />
|
|
9
9
|
<a href="#javascriptUsage">JavaScript API Example</a><br />
|
|
10
|
+
<a href="#incompatibleContent">Incompatible Content Example</a><br />
|
|
11
|
+
<a href="#customNodes">Custom Nodes Example</a><br />
|
|
10
12
|
|
|
11
13
|
<h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
|
|
12
14
|
<a href="#constructor">Constructor</a><br />
|
|
@@ -180,9 +182,9 @@
|
|
|
180
182
|
<k-html-editor id="myEditor" class="b r"></k-html-editor>
|
|
181
183
|
<script>
|
|
182
184
|
const myEditor = document.getElementById('myEditor');
|
|
183
|
-
|
|
185
|
+
myEditor.addEventListener('ready', () => {
|
|
184
186
|
myEditor.setValue('<p>Select text and use the buttons above to format it!</p><p>The editor works without any built-in controls - you have full control via JavaScript.</p>');
|
|
185
|
-
}
|
|
187
|
+
});
|
|
186
188
|
|
|
187
189
|
function insertMyEditorHTML() {
|
|
188
190
|
myEditor.insertHTML('<p><b>Inserted content!</b></p>');
|
|
@@ -196,6 +198,43 @@
|
|
|
196
198
|
</div>
|
|
197
199
|
</div>
|
|
198
200
|
|
|
201
|
+
<h3 id="incompatibleContent"><a href="#incompatibleContent" class="no-link">Incompatible Content Example</a></h3>
|
|
202
|
+
<p>When the editor's value contains HTML that Lexical does not support (such as <code><svg></code>, <code><script></code>, <code><style></code>, <code><video></code>, etc.), it automatically defaults to code mode to preserve the content. If the user attempts to switch to visual mode, a confirmation dialog warns that the incompatible code will be lost.</p>
|
|
203
|
+
<div class="row -mx">
|
|
204
|
+
<div class="col m-span-12 px">
|
|
205
|
+
<k-card label="HTML">
|
|
206
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-html-editor</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"svgEditor"</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"<p>This value contains an inline SVG which Lexical does not support:</p><svg width='120' height='60' xmlns='http://www.w3.org/2000/svg'><rect width='120' height='60' rx='8' fill='#4a90d9'/><text x='50%' y='50%' dominant-baseline='middle' text-anchor='middle' fill='white' font-size='14'>SVG</text></svg><p>The editor detected incompatible content and defaulted to code mode automatically.</p>"</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">k-hec-spacer</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-top"</span>></span><span class="hljs-tag"></<span class="hljs-name">k-hec-spacer</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">k-hec-mode</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"toolbar-top"</span>></span><span class="hljs-tag"></<span class="hljs-name">k-hec-mode</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-html-editor</span>></span></code></pre>
|
|
207
|
+
</k-card>
|
|
208
|
+
</div>
|
|
209
|
+
<div class="col m-span-12 px">
|
|
210
|
+
<k-card label="Output">
|
|
211
|
+
<k-html-editor id="svgEditor" class="b r" value="<p>This value contains an inline SVG which Lexical does not support:</p><svg width='120' height='60' xmlns='http://www.w3.org/2000/svg'><rect width='120' height='60' rx='8' fill='#4a90d9'/><text x='50%' y='50%' dominant-baseline='middle' text-anchor='middle' fill='white' font-size='14'>SVG</text></svg><p>The editor detected incompatible content and defaulted to code mode automatically.</p>">
|
|
212
|
+
<k-hec-spacer slot="toolbar-top"></k-hec-spacer>
|
|
213
|
+
<k-hec-mode slot="toolbar-top"></k-hec-mode>
|
|
214
|
+
</k-html-editor>
|
|
215
|
+
</k-card>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
<h3 id="customNodes"><a href="#customNodes" class="no-link">Custom Nodes Example</a></h3>
|
|
220
|
+
<p>Custom nodes extend what Lexical understands in visual mode. Import a node file and list its name in the <code>nodes</code> attribute (comma-separated filenames without <code>.js</code>). The built-in <code>HtmlComment</code> node preserves HTML comments as inline visual chips rather than forcing code mode — comments round-trip through the editor without being stripped.</p>
|
|
221
|
+
<div class="row -mx">
|
|
222
|
+
<div class="col m-span-12 px">
|
|
223
|
+
<k-card label="HTML">
|
|
224
|
+
<pre><code class="hljs xml"><span class="hljs-comment"><!-- Import the HtmlComment node --></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 class="hljs-attr">src</span>=<span class="hljs-string">'src/components/htmlEditorNodes/HtmlComment.js'</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span><br><span class="hljs-comment"><!-- Register the node with nodes attribute --></span><br><span class="hljs-tag"><<span class="hljs-name">k-html-editor</span> <span class="hljs-attr">nodes</span>=<span class="hljs-string">'HtmlComment'</span> <span class="hljs-attr">value</span>=<span class="hljs-string">'<p>This paragraph has an <!-- important note --> inline comment.</p>'</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">k-hec-spacer</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">'toolbar-top'</span>></span><span class="hljs-tag"></<span class="hljs-name">k-hec-spacer</span>></span><br> <span class="hljs-tag"><<span class="hljs-name">k-hec-mode</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">'toolbar-top'</span>></span><span class="hljs-tag"></<span class="hljs-name">k-hec-mode</span>></span><br><span class="hljs-tag"></<span class="hljs-name">k-html-editor</span>></span></code></pre>
|
|
225
|
+
</k-card>
|
|
226
|
+
</div>
|
|
227
|
+
<div class="col m-span-12 px">
|
|
228
|
+
<k-card label="Output">
|
|
229
|
+
<script type="module" src="/src/components/htmlEditorNodes/HtmlComment.js"></script>
|
|
230
|
+
<k-html-editor id="commentEditor" class="b r" nodes="HtmlComment" value="<p>This paragraph has an <!-- important note --> inline comment.</p>">
|
|
231
|
+
<k-hec-spacer slot="toolbar-top"></k-hec-spacer>
|
|
232
|
+
<k-hec-mode slot="toolbar-top"></k-hec-mode>
|
|
233
|
+
</k-html-editor>
|
|
234
|
+
</k-card>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
|
|
199
238
|
<h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
|
|
200
239
|
|
|
201
240
|
<h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
|
|
@@ -211,23 +250,30 @@
|
|
|
211
250
|
<p>The HTML content of the editor. Can be get or set via JavaScript or HTML attribute.</p>
|
|
212
251
|
|
|
213
252
|
<h5><code>mode<i>: String</i></code></h5>
|
|
214
|
-
<p>Current editing mode. Either <code>'visual'</code> (WYSIWYG) or <code>'code'</code> (raw HTML). Default: <code>'visual'</code
|
|
253
|
+
<p>Current editing mode. Either <code>'visual'</code> (WYSIWYG) or <code>'code'</code> (raw HTML). Default: <code>'visual'</code>. If the initial <code>value</code> contains content that is incompatible with the visual editor (such as <code><svg></code>, <code><script></code>, <code><style></code>, etc.), the editor automatically switches to <code>'code'</code> mode to preserve the content. Custom nodes can extend what is considered compatible by defining a static <code>isVisualCompatible(domNode)</code> method.</p>
|
|
254
|
+
|
|
255
|
+
<h5><code>nodes<i>: String</i></code></h5>
|
|
256
|
+
<p>Comma-separated list of custom Lexical node module filenames (without <code>.js</code>) to load from the <code>htmlEditorNodes/</code> directory. Custom nodes can define two static hooks:</p>
|
|
257
|
+
<ul>
|
|
258
|
+
<li><code>isVisualCompatible(domNode)</code> — returns <code>true</code> if the node handles a DOM construct that would otherwise be considered incompatible (e.g., HTML comments)</li>
|
|
259
|
+
<li><code>preprocessHtml(htmlString)</code> — transforms raw HTML before Lexical parses it (e.g., converting <code><!-- --></code> to a parseable <code><span></code>)</li>
|
|
260
|
+
</ul>
|
|
215
261
|
|
|
216
262
|
<h3 id="methods"><a href="#methods" class="no-link">Methods</a></h3>
|
|
217
263
|
|
|
218
264
|
<h4>Mode Control</h4>
|
|
219
265
|
<h5><code>setMode(mode)<i>: this</i></code></h5>
|
|
220
|
-
<p>Set the editing mode. Accepts <code>'visual'</code> or <code>'code'</code
|
|
266
|
+
<p>Set the editing mode. Accepts <code>'visual'</code> or <code>'code'</code>. If switching to <code>'visual'</code> and the current content is incompatible, a confirmation dialog warns that incompatible code will be lost.</p>
|
|
221
267
|
|
|
222
268
|
<h5><code>toggleMode()<i>: this</i></code></h5>
|
|
223
|
-
<p>Toggle between visual and code modes.</p>
|
|
269
|
+
<p>Toggle between visual and code modes. Same incompatibility warning applies when switching to visual mode.</p>
|
|
224
270
|
|
|
225
271
|
<h4>Content Management</h4>
|
|
226
272
|
<h5><code>getValue()<i>: String</i></code></h5>
|
|
227
273
|
<p>Returns the current HTML content.</p>
|
|
228
274
|
|
|
229
275
|
<h5><code>setValue(html)<i>: this</i></code></h5>
|
|
230
|
-
<p>Sets the HTML content of the editor.</p>
|
|
276
|
+
<p>Sets the HTML content of the editor. If the editor is in visual mode and the new content is incompatible, automatically switches to code mode.</p>
|
|
231
277
|
|
|
232
278
|
<h5><code>clear()<i>: this</i></code></h5>
|
|
233
279
|
<p>Clears all content from the editor.</p>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<page pageName="Nav Spacer" title="Nav Spacer - Components - Kempo Docs - A Web Components Solution">
|
|
2
|
+
<content location="header"></content>
|
|
3
|
+
<content>
|
|
4
|
+
<h1 class="ta-center">Nav Spacer</h1>
|
|
5
|
+
|
|
6
|
+
<k-accordion persistent-id="toc-nav-spacer" class="b r mb">
|
|
7
|
+
<k-accordion-header for-panel="toc-nav-spacer-panel">Table of Contents</k-accordion-header>
|
|
8
|
+
<k-accordion-panel name="toc-nav-spacer-panel">
|
|
9
|
+
<div class="m">
|
|
10
|
+
<h6>Examples</h6>
|
|
11
|
+
<a href="#basicUsage">Basic Usage</a><br />
|
|
12
|
+
<a href="#noMargin">No Margin</a><br />
|
|
13
|
+
|
|
14
|
+
<h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
|
|
15
|
+
<a href="#constructor">Constructor</a><br />
|
|
16
|
+
<a href="#requirements">Requirements</a><br />
|
|
17
|
+
<a href="#cssVariables">CSS Variables</a><br />
|
|
18
|
+
</div>
|
|
19
|
+
</k-accordion-panel>
|
|
20
|
+
</k-accordion>
|
|
21
|
+
|
|
22
|
+
<p>Place <code>k-nav-spacer</code> immediately after a <code><k-nav fixed></code> element. It automatically measures the nav's height using a <code>ResizeObserver</code> and sets its own height to match, ensuring page content is not hidden behind the fixed nav. A default bottom margin of <code>var(--spacer)</code> separates the spacer from the content below; override it with kempo-css margin utilities like <code>mb0</code>, <code>mbh</code>, etc.</p>
|
|
23
|
+
|
|
24
|
+
<h3 id="basicUsage"><a href="#basicUsage" class="no-link">Basic Usage</a></h3>
|
|
25
|
+
<p>Place <code>k-nav-spacer</code> directly after the fixed nav in your HTML. It will size itself to match the nav height.</p>
|
|
26
|
+
<div class="row -mx">
|
|
27
|
+
<div class="col m-span-12 px">
|
|
28
|
+
<k-card label="HTML">
|
|
29
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-nav</span> <span class="hljs-attr">fixed</span>></span><br> <span class="hljs-comment"><!-- nav content --></span><br><span class="hljs-tag"></<span class="hljs-name">k-nav</span>></span><br><span class="hljs-tag"><<span class="hljs-name">k-nav-spacer</span>></span><span class="hljs-tag"></<span class="hljs-name">k-nav-spacer</span>></span><br><span class="hljs-tag"><<span class="hljs-name">main</span>></span><br> <span class="hljs-comment"><!-- page content --></span><br><span class="hljs-tag"></<span class="hljs-name">main</span>></span></code></pre>
|
|
30
|
+
</k-card>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<h3 id="noMargin"><a href="#noMargin" class="no-link">No Margin</a></h3>
|
|
35
|
+
<p>Add <code>mb0</code> to remove the default bottom margin, or use any kempo-css margin utility to customise it.</p>
|
|
36
|
+
<div class="row -mx">
|
|
37
|
+
<div class="col m-span-12 px">
|
|
38
|
+
<k-card label="HTML">
|
|
39
|
+
<pre><code class="hljs xml"><span class="hljs-tag"><<span class="hljs-name">k-nav-spacer</span> <span class="hljs-attr">class</span>=<span class="hljs-string">'mb0'</span>></span><span class="hljs-tag"></<span class="hljs-name">k-nav-spacer</span>></span></code></pre>
|
|
40
|
+
</k-card>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<h2 id="jsRef"><a href="#jsRef" class="no-link">JavaScript Reference</a></h2>
|
|
45
|
+
|
|
46
|
+
<h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
|
|
47
|
+
<h6>Extends <a href="./shadow-component.html">ShadowComponent</a></h6>
|
|
48
|
+
<h5><code>new NavSpacer()</code></h5>
|
|
49
|
+
|
|
50
|
+
<h3 id="requirements"><a href="#requirements" class="no-link">Requirements</a></h3>
|
|
51
|
+
<ul>
|
|
52
|
+
<li><a href="./shadow-component.html">ShadowComponent</a></li>
|
|
53
|
+
</ul>
|
|
54
|
+
|
|
55
|
+
<h3 id="cssVariables"><a href="#cssVariables" class="no-link">CSS Variables</a></h3>
|
|
56
|
+
<h5><code>--spacer</code></h5>
|
|
57
|
+
<p>Controls the default bottom margin. Inherited from kempo-css (default <code>1rem</code>). Override by applying a margin utility class directly to the element.</p>
|
|
58
|
+
</content>
|
|
59
|
+
<content location="scripts">
|
|
60
|
+
<script type="module" src="{{pathToRoot}}src/components/NavSpacer.js"></script>
|
|
61
|
+
<script type="module" src="{{pathToRoot}}src/components/Nav.js"></script>
|
|
62
|
+
<script type="module" src="{{pathToRoot}}src/components/Accordion.js"></script>
|
|
63
|
+
<script type="module" src="{{pathToRoot}}src/components/Card.js"></script>
|
|
64
|
+
</content>
|
|
65
|
+
</page>
|
package/docs-src/index.page.html
CHANGED
|
@@ -119,6 +119,12 @@
|
|
|
119
119
|
<p class="tc-muted">Fixed navigation bar with automatic elevation applied at the correct stacking level.</p>
|
|
120
120
|
</a>
|
|
121
121
|
</div>
|
|
122
|
+
<div class="span-12 t-span-6 d-span-4 px">
|
|
123
|
+
<a href="{{pathToRoot}}components/nav-spacer.html" class="card mb no-link d-b">
|
|
124
|
+
<h3 class="tc-primary">Nav Spacer</h3>
|
|
125
|
+
<p class="tc-muted">Auto-sizing spacer that offsets page content below a fixed nav bar.</p>
|
|
126
|
+
</a>
|
|
127
|
+
</div>
|
|
122
128
|
<div class="span-12 t-span-6 d-span-4 px">
|
|
123
129
|
<a href="{{pathToRoot}}components/photo-viewer.html" class="card mb no-link d-b">
|
|
124
130
|
<h3 class="tc-primary">Photo Viewer</h3>
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
<k-filter-item filter-keywords="icon components"><a href="{{pathToRoot}}components/icon.html">Icon<br><small>Component</small></a></k-filter-item>
|
|
26
26
|
<k-filter-item filter-keywords="import components"><a href="{{pathToRoot}}components/import.html">Import<br><small>Component</small></a></k-filter-item>
|
|
27
27
|
<k-filter-item filter-keywords="nav navbar navigation components"><a href="{{pathToRoot}}components/nav.html">Nav<br><small>Component</small></a></k-filter-item>
|
|
28
|
+
<k-filter-item filter-keywords="nav spacer navbar spacer navspacer components"><a href="{{pathToRoot}}components/nav-spacer.html">Nav Spacer<br><small>Component</small></a></k-filter-item>
|
|
28
29
|
<k-filter-item filter-keywords="photo viewer photoviewer components"><a href="{{pathToRoot}}components/photo-viewer.html">Photo Viewer<br><small>Component</small></a></k-filter-item>
|
|
29
30
|
<k-filter-item filter-keywords="resize components"><a href="{{pathToRoot}}components/resize.html">Resize<br><small>Component</small></a></k-filter-item>
|
|
30
31
|
<k-filter-item filter-keywords="show more showmore components"><a href="{{pathToRoot}}components/show-more.html">Show More<br><small>Component</small></a></k-filter-item>
|
|
@@ -102,6 +103,7 @@
|
|
|
102
103
|
<a href="{{pathToRoot}}components/icon.html">Icon</a>
|
|
103
104
|
<a href="{{pathToRoot}}components/import.html">Import</a>
|
|
104
105
|
<a href="{{pathToRoot}}components/nav.html">Nav</a>
|
|
106
|
+
<a href="{{pathToRoot}}components/nav-spacer.html">Nav Spacer</a>
|
|
105
107
|
<a href="{{pathToRoot}}components/photo-viewer.html">Photo Viewer</a>
|
|
106
108
|
<a href="{{pathToRoot}}components/resize.html">Resize</a>
|
|
107
109
|
<a href="{{pathToRoot}}components/show-more.html">Show More</a>
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
<content>
|
|
4
4
|
<h1>formatTimestamp</h1>
|
|
5
5
|
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
<div class="m mt0 pl">
|
|
6
|
+
<k-accordion persistent-id="toc" class="b r mb">
|
|
7
|
+
<k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
|
|
8
|
+
<k-accordion-panel name="toc-panel">
|
|
9
|
+
<div class="m">
|
|
11
10
|
<h6>Usage</h6>
|
|
12
11
|
<a href="#basicUsage">Basic Usage</a><br />
|
|
13
12
|
<a href="#parameters">Parameters</a><br />
|
|
14
13
|
<a href="#formatTokens">Format Tokens</a><br />
|
|
15
14
|
<a href="#examples">Examples</a><br />
|
|
16
15
|
</div>
|
|
17
|
-
|
|
16
|
+
</k-accordion-panel>
|
|
17
|
+
</k-accordion>
|
|
18
18
|
|
|
19
19
|
<h3>Description</h3>
|
|
20
20
|
<p>The <code>formatTimestamp</code> utility function formats timestamps using custom format tokens or locale-specific formatting.</p>
|