kempo-ui 0.3.5 → 0.3.7
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/AGENTS.md +2 -1
- package/dist/components/Aside.js +1 -1
- package/dist/components/Main.js +1 -1
- package/docs/components/accordion.html +240 -8
- package/docs/components/aside-items.html +13 -9
- package/docs/components/aside-menu.html +13 -9
- package/docs/components/aside-push.html +11 -6
- package/docs/components/aside.html +289 -115
- package/docs/components/card.html +238 -7
- package/docs/components/color-picker.html +245 -14
- package/docs/components/content-slider.html +240 -8
- package/docs/components/context.html +241 -7
- package/docs/components/dialog.html +238 -7
- package/docs/components/dropdown.html +238 -7
- package/docs/components/filter-list.html +239 -10
- package/docs/components/focus-capture.html +241 -10
- package/docs/components/html-editor.html +266 -35
- package/docs/components/hybrid-component.html +238 -6
- package/docs/components/icon.html +239 -9
- package/docs/components/import.html +239 -8
- package/docs/components/light-component.html +239 -7
- package/docs/components/nav.html +240 -8
- package/docs/components/photo-viewer.html +239 -9
- package/docs/components/resize.html +240 -9
- package/docs/components/shadow-component.html +239 -7
- package/docs/components/show-more.html +237 -8
- package/docs/components/sortable.html +239 -8
- package/docs/components/spinner.html +237 -6
- package/docs/components/split.html +241 -10
- package/docs/components/table.html +241 -11
- package/docs/components/tableControls.html +240 -7
- package/docs/components/tableCustomFields.html +241 -8
- package/docs/components/tableFetchRecords.html +239 -7
- package/docs/components/tableFieldSortHide.html +239 -7
- package/docs/components/tablePagination.html +246 -13
- package/docs/components/tablePlaceholder.html +241 -8
- package/docs/components/tableRecordEditing.html +241 -8
- package/docs/components/tableRecordFiltering.html +239 -7
- package/docs/components/tableRecordHiding.html +241 -9
- package/docs/components/tableRecordSearching.html +239 -7
- package/docs/components/tableRecordSelection.html +240 -7
- package/docs/components/tableRowControls.html +241 -8
- package/docs/components/tableServerSync.html +245 -11
- package/docs/components/tableSorting.html +239 -7
- package/docs/components/tabs.html +240 -7
- package/docs/components/tags.html +239 -7
- package/docs/components/theme-select.html +239 -7
- package/docs/components/theme-switcher.html +240 -8
- package/docs/components/timestamp.html +239 -8
- package/docs/components/toast.html +240 -8
- package/docs/components/toggle.html +240 -9
- package/docs/components/tree.html +239 -8
- package/docs/index.html +244 -6
- package/docs/prod.config.json +0 -4
- package/docs/src/components/Aside.js +1 -1
- package/docs/src/components/Main.js +1 -1
- package/docs/utils/context.html +237 -6
- package/docs/utils/cookie.html +251 -21
- package/docs/utils/debounce.html +236 -5
- package/docs/utils/drag.html +236 -5
- package/docs/utils/elevation.html +238 -6
- package/docs/utils/formatTimestamp.html +239 -9
- package/docs/utils/object.html +236 -5
- package/docs/utils/propConverters.html +233 -3
- package/docs/utils/string.html +236 -5
- package/docs/utils/theme.html +237 -6
- package/docs/utils/toTitleCase.html +239 -9
- package/docs/utils/type.html +236 -5
- package/docs/utils/wait.html +236 -5
- package/docs-src/.config.js +16 -0
- package/docs-src/bare.template.html +16 -0
- package/docs-src/components/accordion.page.html +201 -0
- package/docs-src/components/aside-items.page.html +36 -0
- package/docs-src/components/aside-menu.page.html +36 -0
- package/docs-src/components/aside-push.page.html +20 -0
- package/docs-src/components/aside.page.html +494 -0
- package/docs-src/components/card.page.html +78 -0
- package/docs-src/components/color-picker.page.html +559 -0
- package/docs-src/components/content-slider.page.html +266 -0
- package/docs-src/components/context.page.html +214 -0
- package/docs-src/components/dialog.page.html +365 -0
- package/docs-src/components/dropdown.page.html +300 -0
- package/docs-src/components/filter-list.page.html +117 -0
- package/docs-src/components/focus-capture.page.html +97 -0
- package/docs-src/components/html-editor.page.html +423 -0
- package/docs-src/components/hybrid-component.page.html +96 -0
- package/docs-src/components/icon.page.html +208 -0
- package/docs-src/components/import.page.html +76 -0
- package/docs-src/components/light-component.page.html +99 -0
- package/docs-src/components/nav.page.html +106 -0
- package/docs-src/components/photo-viewer.page.html +253 -0
- package/docs-src/components/resize.page.html +161 -0
- package/docs-src/components/shadow-component.page.html +84 -0
- package/docs-src/components/show-more.page.html +113 -0
- package/docs-src/components/sortable.page.html +117 -0
- package/docs-src/components/spinner.page.html +197 -0
- package/docs-src/components/split.page.html +195 -0
- package/docs-src/components/table.page.html +283 -0
- package/docs-src/components/tableControls.page.html +64 -0
- package/docs-src/components/tableCustomFields.page.html +124 -0
- package/docs-src/components/tableFetchRecords.page.html +95 -0
- package/docs-src/components/tableFieldSortHide.page.html +56 -0
- package/docs-src/components/tablePagination.page.html +85 -0
- package/docs-src/components/tablePlaceholder.page.html +73 -0
- package/docs-src/components/tableRecordEditing.page.html +161 -0
- package/docs-src/components/tableRecordFiltering.page.html +69 -0
- package/docs-src/components/tableRecordHiding.page.html +65 -0
- package/docs-src/components/tableRecordSearching.page.html +56 -0
- package/docs-src/components/tableRecordSelection.page.html +60 -0
- package/docs-src/components/tableRowControls.page.html +62 -0
- package/docs-src/components/tableServerSync.page.html +129 -0
- package/docs-src/components/tableSorting.page.html +54 -0
- package/docs-src/components/tabs.page.html +201 -0
- package/docs-src/components/tags.page.html +157 -0
- package/docs-src/components/theme-select.page.html +106 -0
- package/docs-src/components/theme-switcher.page.html +122 -0
- package/docs-src/components/timestamp.page.html +109 -0
- package/docs-src/components/toast.page.html +338 -0
- package/docs-src/components/toggle.page.html +177 -0
- package/docs-src/components/tree.page.html +356 -0
- package/docs-src/default.template.html +28 -0
- package/docs-src/index.page.html +312 -0
- package/docs-src/nav.fragment.html +228 -0
- package/docs-src/utils/context.page.html +143 -0
- package/docs-src/utils/cookie.page.html +128 -0
- package/docs-src/utils/debounce.page.html +42 -0
- package/docs-src/utils/drag.page.html +64 -0
- package/docs-src/utils/elevation.page.html +144 -0
- package/docs-src/utils/formatTimestamp.page.html +76 -0
- package/docs-src/utils/object.page.html +76 -0
- package/docs-src/utils/propConverters.page.html +73 -0
- package/docs-src/utils/string.page.html +66 -0
- package/docs-src/utils/theme.page.html +136 -0
- package/docs-src/utils/toTitleCase.page.html +52 -0
- package/docs-src/utils/type.page.html +31 -0
- package/docs-src/utils/wait.page.html +31 -0
- package/package.json +4 -4
- package/scripts/build.js +5 -0
- package/scripts/docs.js +5 -52
- package/src/components/Aside.js +12 -1
- package/src/components/Main.js +1 -1
- package/tests/components/Aside.browser-test.js +75 -0
- package/docs/dev.config.json +0 -20
- package/docs/nav-1.inc.html +0 -168
- package/docs/nav.inc.html +0 -168
- package/docs/nav.inc.js +0 -70
|
@@ -11,24 +11,254 @@
|
|
|
11
11
|
<link rel="stylesheet" href="../kempo-hljs.css" />
|
|
12
12
|
<link rel="stylesheet" href="../styles.css" />
|
|
13
13
|
<script>window.litDisableBundleWarning = true;</script>
|
|
14
|
+
|
|
14
15
|
</head>
|
|
15
16
|
<body>
|
|
16
|
-
|
|
17
|
+
|
|
18
|
+
<k-nav fixed class="bg-primary">
|
|
19
|
+
<button id="toggleNavSideMenu" class="link">
|
|
20
|
+
<k-icon name="menu"></k-icon>
|
|
21
|
+
</button>
|
|
22
|
+
<a href="../" class="d-if ph" style="align-items: center">
|
|
23
|
+
<img src="../media/icon32.png" alt="Kempo UI Icon" class="pr" />
|
|
24
|
+
Kempo UI
|
|
25
|
+
</a>
|
|
26
|
+
<div style="position:relative;margin:0 .25rem;align-self:center;" theme="light">
|
|
27
|
+
<input id="navSearchInput" type="search" placeholder="Search docs..." autocomplete="off" style="width:11rem;" />
|
|
28
|
+
<div id="navSearchDropdown" hidden theme="light" style="position:absolute;top:calc(100% + 4px);left:0;width:min(480px,90vw);max-height:70vh;background:var(--c_bg);border:1px solid var(--c_border);border-radius:var(--radius);overflow:auto;z-index:9999;box-shadow:0 4px 12px rgba(0,0,0,.3);">
|
|
29
|
+
<k-filter-list id="navSearchList" style="display:block;padding:.25rem 0;">
|
|
30
|
+
<k-filter-item filter-keywords="accordion components"><a href="../components/accordion.html">Accordion<br><small>Component</small></a></k-filter-item>
|
|
31
|
+
<k-filter-item filter-keywords="aside sidebar components"><a href="../components/aside.html">Aside<br><small>Component</small></a></k-filter-item>
|
|
32
|
+
<k-filter-item filter-keywords="card components"><a href="../components/card.html">Card<br><small>Component</small></a></k-filter-item>
|
|
33
|
+
<k-filter-item filter-keywords="color picker colorpicker components"><a href="../components/color-picker.html">Color Picker<br><small>Component</small></a></k-filter-item>
|
|
34
|
+
<k-filter-item filter-keywords="content slider components"><a href="../components/content-slider.html">Content Slider<br><small>Component</small></a></k-filter-item>
|
|
35
|
+
<k-filter-item filter-keywords="context state global components"><a href="../components/context.html">Context<br><small>Component</small></a></k-filter-item>
|
|
36
|
+
<k-filter-item filter-keywords="dialog modal popup components"><a href="../components/dialog.html">Dialog<br><small>Component</small></a></k-filter-item>
|
|
37
|
+
<k-filter-item filter-keywords="dropdown select components"><a href="../components/dropdown.html">Dropdown<br><small>Component</small></a></k-filter-item>
|
|
38
|
+
<k-filter-item filter-keywords="filter list filterlist components"><a href="../components/filter-list.html">Filter List<br><small>Component</small></a></k-filter-item>
|
|
39
|
+
<k-filter-item filter-keywords="focus capture focuscapture components"><a href="../components/focus-capture.html">Focus Capture<br><small>Component</small></a></k-filter-item>
|
|
40
|
+
<k-filter-item filter-keywords="html editor components"><a href="../components/html-editor.html">HTML Editor<br><small>Component</small></a></k-filter-item>
|
|
41
|
+
<k-filter-item filter-keywords="icon components"><a href="../components/icon.html">Icon<br><small>Component</small></a></k-filter-item>
|
|
42
|
+
<k-filter-item filter-keywords="import components"><a href="../components/import.html">Import<br><small>Component</small></a></k-filter-item>
|
|
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="photo viewer photoviewer components"><a href="../components/photo-viewer.html">Photo Viewer<br><small>Component</small></a></k-filter-item>
|
|
45
|
+
<k-filter-item filter-keywords="resize components"><a href="../components/resize.html">Resize<br><small>Component</small></a></k-filter-item>
|
|
46
|
+
<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>
|
|
47
|
+
<k-filter-item filter-keywords="sortable drag drop sort components"><a href="../components/sortable.html">Sortable<br><small>Component</small></a></k-filter-item>
|
|
48
|
+
<k-filter-item filter-keywords="spinner loading components"><a href="../components/spinner.html">Spinner<br><small>Component</small></a></k-filter-item>
|
|
49
|
+
<k-filter-item filter-keywords="split pane components"><a href="../components/split.html">Split<br><small>Component</small></a></k-filter-item>
|
|
50
|
+
<k-filter-item filter-keywords="table data grid components"><a href="../components/table.html">Table<br><small>Component</small></a></k-filter-item>
|
|
51
|
+
<k-filter-item filter-keywords="table controls advanced example"><a href="../components/tableControls.html">Table — Controls<br><small>Advanced Example</small></a></k-filter-item>
|
|
52
|
+
<k-filter-item filter-keywords="table custom fields advanced example"><a href="../components/tableCustomFields.html">Table — Custom Fields<br><small>Advanced Example</small></a></k-filter-item>
|
|
53
|
+
<k-filter-item filter-keywords="table fetch records advanced example"><a href="../components/tableFetchRecords.html">Table — Fetch Records<br><small>Advanced Example</small></a></k-filter-item>
|
|
54
|
+
<k-filter-item filter-keywords="table field sort hide advanced example"><a href="../components/tableFieldSortHide.html">Table — Field Sort & Hide<br><small>Advanced Example</small></a></k-filter-item>
|
|
55
|
+
<k-filter-item filter-keywords="table pagination advanced example"><a href="../components/tablePagination.html">Table — Pagination<br><small>Advanced Example</small></a></k-filter-item>
|
|
56
|
+
<k-filter-item filter-keywords="table record editing advanced example"><a href="../components/tableRecordEditing.html">Table — Record Editing<br><small>Advanced Example</small></a></k-filter-item>
|
|
57
|
+
<k-filter-item filter-keywords="table record filtering advanced example"><a href="../components/tableRecordFiltering.html">Table — Record Filtering<br><small>Advanced Example</small></a></k-filter-item>
|
|
58
|
+
<k-filter-item filter-keywords="table record hiding advanced example"><a href="../components/tableRecordHiding.html">Table — Record Hiding<br><small>Advanced Example</small></a></k-filter-item>
|
|
59
|
+
<k-filter-item filter-keywords="table record searching advanced example"><a href="../components/tableRecordSearching.html">Table — Record Searching<br><small>Advanced Example</small></a></k-filter-item>
|
|
60
|
+
<k-filter-item filter-keywords="table record selection advanced example"><a href="../components/tableRecordSelection.html">Table — Record Selection<br><small>Advanced Example</small></a></k-filter-item>
|
|
61
|
+
<k-filter-item filter-keywords="table row controls advanced example"><a href="../components/tableRowControls.html">Table — Row Controls<br><small>Advanced Example</small></a></k-filter-item>
|
|
62
|
+
<k-filter-item filter-keywords="table server sync advanced example"><a href="../components/tableServerSync.html">Table — Server Sync<br><small>Advanced Example</small></a></k-filter-item>
|
|
63
|
+
<k-filter-item filter-keywords="table sorting advanced example"><a href="../components/tableSorting.html">Table — Sorting<br><small>Advanced Example</small></a></k-filter-item>
|
|
64
|
+
<k-filter-item filter-keywords="table placeholder advanced example"><a href="../components/tablePlaceholder.html">Table — Placeholder<br><small>Advanced Example</small></a></k-filter-item>
|
|
65
|
+
<k-filter-item filter-keywords="tabs tab panel components"><a href="../components/tabs.html">Tabs<br><small>Component</small></a></k-filter-item>
|
|
66
|
+
<k-filter-item filter-keywords="tags tag input components"><a href="../components/tags.html">Tags<br><small>Component</small></a></k-filter-item>
|
|
67
|
+
<k-filter-item filter-keywords="theme select dropdown dark light components"><a href="../components/theme-select.html">Theme Select<br><small>Component</small></a></k-filter-item>
|
|
68
|
+
<k-filter-item filter-keywords="theme switcher dark light components"><a href="../components/theme-switcher.html">Theme Switcher<br><small>Component</small></a></k-filter-item>
|
|
69
|
+
<k-filter-item filter-keywords="timestamp date time components"><a href="../components/timestamp.html">Timestamp<br><small>Component</small></a></k-filter-item>
|
|
70
|
+
<k-filter-item filter-keywords="toast notification alert components"><a href="../components/toast.html">Toast<br><small>Component</small></a></k-filter-item>
|
|
71
|
+
<k-filter-item filter-keywords="toggle switch checkbox components"><a href="../components/toggle.html">Toggle<br><small>Component</small></a></k-filter-item>
|
|
72
|
+
<k-filter-item filter-keywords="tree treeview components"><a href="../components/tree.html">Tree<br><small>Component</small></a></k-filter-item>
|
|
73
|
+
<k-filter-item filter-keywords="shadow component base"><a href="../components/shadow-component.html">Shadow Component<br><small>Base Component</small></a></k-filter-item>
|
|
74
|
+
<k-filter-item filter-keywords="light component base"><a href="../components/light-component.html">Light Component<br><small>Base Component</small></a></k-filter-item>
|
|
75
|
+
<k-filter-item filter-keywords="hybrid component base"><a href="../components/hybrid-component.html">Hybrid Component<br><small>Base Component</small></a></k-filter-item>
|
|
76
|
+
<k-filter-item filter-keywords="cookie utils utility"><a href="../utils/cookie.html">cookie<br><small>Utility</small></a></k-filter-item>
|
|
77
|
+
<k-filter-item filter-keywords="context utils utility"><a href="../utils/context.html">context<br><small>Utility</small></a></k-filter-item>
|
|
78
|
+
<k-filter-item filter-keywords="debounce utils utility"><a href="../utils/debounce.html">debounce<br><small>Utility</small></a></k-filter-item>
|
|
79
|
+
<k-filter-item filter-keywords="drag utils utility"><a href="../utils/drag.html">drag<br><small>Utility</small></a></k-filter-item>
|
|
80
|
+
<k-filter-item filter-keywords="elevation z-index stacking utils"><a href="../utils/elevation.html">elevation<br><small>Utility</small></a></k-filter-item>
|
|
81
|
+
<k-filter-item filter-keywords="formattimestamp timestamp format date time utils utility"><a href="../utils/formatTimestamp.html">formatTimestamp<br><small>Utility</small></a></k-filter-item>
|
|
82
|
+
<k-filter-item filter-keywords="object utils utility"><a href="../utils/object.html">object<br><small>Utility</small></a></k-filter-item>
|
|
83
|
+
<k-filter-item filter-keywords="propconverters prop converters utils utility"><a href="../utils/propConverters.html">propConverters<br><small>Utility</small></a></k-filter-item>
|
|
84
|
+
<k-filter-item filter-keywords="string utils utility"><a href="../utils/string.html">string<br><small>Utility</small></a></k-filter-item>
|
|
85
|
+
<k-filter-item filter-keywords="theme utils utility"><a href="../utils/theme.html">theme<br><small>Utility</small></a></k-filter-item>
|
|
86
|
+
<k-filter-item filter-keywords="type utils utility"><a href="../utils/type.html">type<br><small>Utility</small></a></k-filter-item>
|
|
87
|
+
<k-filter-item filter-keywords="wait async utils utility"><a href="../utils/wait.html">wait<br><small>Utility</small></a></k-filter-item>
|
|
88
|
+
</k-filter-list>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
<div class="flex"></div>
|
|
92
|
+
<a href="https://github.com/dustinpoissant/kempo-ui?tab=License-1-ov-file#creative-commons-attribution-noncommercial-sharealike-20" target="_blank"><k-icon name="license"></k-icon></a>
|
|
93
|
+
<a href="https://www.npmjs.com/package/kempo-ui" target="_blank"><k-icon name="npm"></k-icon></a>
|
|
94
|
+
<a href="https://github.com/dustinpoissant/kempo-ui" target="_blank"><k-icon name="github-mark"></k-icon></a>
|
|
95
|
+
<k-theme-switcher></k-theme-switcher>
|
|
96
|
+
</k-nav>
|
|
97
|
+
<div style="width: 100%; height: 4rem;"></div>
|
|
98
|
+
<k-aside id="navSideMenu" main="overlay" state="offscreen">
|
|
99
|
+
<menu>
|
|
100
|
+
<a href="../" class="ta-center bb mb r0">
|
|
101
|
+
<h1 class="tc-primary">Kempo UI</h1>
|
|
102
|
+
<img src="../media/icon128.png" alt="Kempo UI Icon" />
|
|
103
|
+
</a>
|
|
104
|
+
|
|
105
|
+
<div class="pl mb">
|
|
106
|
+
<h3>Components</h3>
|
|
107
|
+
<a href="../components/accordion.html">Accordion</a>
|
|
108
|
+
<a href="../components/aside.html">Aside</a>
|
|
109
|
+
<a href="../components/card.html">Card</a>
|
|
110
|
+
<a href="../components/color-picker.html">ColorPicker</a>
|
|
111
|
+
<a href="../components/content-slider.html">Content Slider</a>
|
|
112
|
+
<a href="../components/context.html">Context</a>
|
|
113
|
+
<a href="../components/dialog.html">Dialog</a>
|
|
114
|
+
<a href="../components/dropdown.html">Dropdown</a>
|
|
115
|
+
<a href="../components/filter-list.html">Filter List</a>
|
|
116
|
+
<a href="../components/focus-capture.html">FocusCapture</a>
|
|
117
|
+
<a href="../components/html-editor.html">HTML Editor</a>
|
|
118
|
+
<a href="../components/icon.html">Icon</a>
|
|
119
|
+
<a href="../components/import.html">Import</a>
|
|
120
|
+
<a href="../components/nav.html">Nav</a>
|
|
121
|
+
<a href="../components/photo-viewer.html">Photo Viewer</a>
|
|
122
|
+
<a href="../components/resize.html">Resize</a>
|
|
123
|
+
<a href="../components/show-more.html">Show More</a>
|
|
124
|
+
<a href="../components/sortable.html">Sortable</a>
|
|
125
|
+
<a href="../components/spinner.html">Spinner</a>
|
|
126
|
+
<a href="../components/split.html">Split</a>
|
|
127
|
+
<a href="../components/table.html">Table</a>
|
|
128
|
+
<a href="../components/tabs.html">Tabs</a>
|
|
129
|
+
<a href="../components/tags.html">Tags</a>
|
|
130
|
+
<a href="../components/theme-select.html">Theme Select</a>
|
|
131
|
+
<a href="../components/theme-switcher.html">Theme Switcher</a>
|
|
132
|
+
<a href="../components/timestamp.html">Timestamp</a>
|
|
133
|
+
<a href="../components/toast.html">Toast</a>
|
|
134
|
+
<a href="../components/toggle.html">Toggle</a>
|
|
135
|
+
<a href="../components/tree.html">Tree</a>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<h5 class="mb0">Base Components</h5>
|
|
139
|
+
<div class="pl mb">
|
|
140
|
+
<a href="../components/shadow-component.html">Shadow Component</a>
|
|
141
|
+
<a href="../components/light-component.html">Light Component</a>
|
|
142
|
+
<a href="../components/hybrid-component.html">Hybrid Component</a>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<h5 class="mb0">Utils</h5>
|
|
146
|
+
<div class="pl mb">
|
|
147
|
+
<a href="../utils/cookie.html">cookie</a>
|
|
148
|
+
<a href="../utils/context.html">context</a>
|
|
149
|
+
<a href="../utils/debounce.html">debounce</a>
|
|
150
|
+
<a href="../utils/drag.html">drag</a>
|
|
151
|
+
<a href="../utils/elevation.html">elevation</a>
|
|
152
|
+
<a href="../utils/formatTimestamp.html">formatTimestamp</a>
|
|
153
|
+
<a href="../utils/object.html">object</a>
|
|
154
|
+
<a href="../utils/propConverters.html">propConverters</a>
|
|
155
|
+
<a href="../utils/string.html">string</a>
|
|
156
|
+
<a href="../utils/theme.html">theme</a>
|
|
157
|
+
<a href="../utils/type.html">type</a>
|
|
158
|
+
<a href="../utils/wait.html">wait</a>
|
|
159
|
+
</div>
|
|
160
|
+
</menu>
|
|
161
|
+
</k-aside>
|
|
162
|
+
<style>
|
|
163
|
+
#navSearchList a{display:block;padding:.25rem .5rem;border-radius:var(--radius);text-decoration:none;color:var(--tc);}
|
|
164
|
+
#navSearchList a:hover{background:rgba(128,128,128,.15);}
|
|
165
|
+
#navSearchList a small{display:block;color:var(--tc_muted);}
|
|
166
|
+
</style>
|
|
167
|
+
<script src="../src/components/Nav.js" type="module"></script>
|
|
168
|
+
<script src="../src/components/FilterList.js" type="module"></script>
|
|
169
|
+
<script src="../src/components/FilterItem.js" type="module"></script>
|
|
170
|
+
<script src="../src/components/Aside.js" type="module"></script>
|
|
171
|
+
<script src="../src/components/Icon.js" type="module"></script>
|
|
172
|
+
<script src="../src/components/ThemeSwitcher.js" type="module"></script>
|
|
173
|
+
<script type="module">
|
|
174
|
+
import debounce from '../src/utils/debounce.js';
|
|
175
|
+
|
|
176
|
+
document.getElementById('toggleNavSideMenu').addEventListener('click', async () => {
|
|
177
|
+
await window.customElements.whenDefined('k-aside');
|
|
178
|
+
document.getElementById('navSideMenu').toggle();
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
document.addEventListener('click', function(e) {
|
|
182
|
+
if(e.target.matches('a[href^="#"]')) {
|
|
183
|
+
e.preventDefault();
|
|
184
|
+
const targetId = e.target.getAttribute('href').replace('#', '');
|
|
185
|
+
const target = document.getElementById(targetId);
|
|
186
|
+
if(target) {
|
|
187
|
+
target.scrollIntoView({ behavior: 'smooth' });
|
|
188
|
+
const url = window.location.pathname + window.location.search + '#' + targetId;
|
|
189
|
+
history.replaceState(null, '', url);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
/*
|
|
195
|
+
Nav Search
|
|
196
|
+
*/
|
|
197
|
+
const searchInput = document.getElementById('navSearchInput');
|
|
198
|
+
const searchDropdown = document.getElementById('navSearchDropdown');
|
|
199
|
+
let navSearchList = null;
|
|
200
|
+
|
|
201
|
+
const openSearch = async () => {
|
|
202
|
+
await customElements.whenDefined('k-filter-list');
|
|
203
|
+
if(!navSearchList) navSearchList = document.getElementById('navSearchList');
|
|
204
|
+
navSearchList.filter(searchInput.value);
|
|
205
|
+
searchDropdown.hidden = false;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const closeSearch = () => {
|
|
209
|
+
searchDropdown.hidden = true;
|
|
210
|
+
navSearchList?.clearFocus();
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
searchInput.addEventListener('focus', openSearch);
|
|
214
|
+
|
|
215
|
+
searchInput.addEventListener('input', debounce(e => {
|
|
216
|
+
navSearchList?.filter(e.target.value);
|
|
217
|
+
}, 150));
|
|
218
|
+
|
|
219
|
+
searchInput.addEventListener('keydown', e => {
|
|
220
|
+
if(e.key === 'Escape') {
|
|
221
|
+
searchInput.value = '';
|
|
222
|
+
searchInput.blur();
|
|
223
|
+
closeSearch();
|
|
224
|
+
} else if(e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter') {
|
|
225
|
+
navSearchList?.handleKeydown(e);
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
searchInput.addEventListener('blur', () => {
|
|
230
|
+
setTimeout(closeSearch, 150);
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
document.addEventListener('keydown', e => {
|
|
234
|
+
let active = document.activeElement;
|
|
235
|
+
while(active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
|
|
236
|
+
const tag = active?.tagName;
|
|
237
|
+
if(tag === 'INPUT' || tag === 'TEXTAREA' || active?.isContentEditable) return;
|
|
238
|
+
if(e.metaKey || e.ctrlKey || e.altKey) return;
|
|
239
|
+
if(e.key.length === 1) {
|
|
240
|
+
searchInput.focus();
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
</script>
|
|
244
|
+
|
|
245
|
+
|
|
17
246
|
<k-main>
|
|
247
|
+
|
|
18
248
|
<h1>formatTimestamp</h1>
|
|
19
249
|
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
<div class="m mt0 pl">
|
|
250
|
+
<k-accordion persistent-id="toc" class="b r mb">
|
|
251
|
+
<k-accordion-header for-panel="toc-panel">Table of Contents</k-accordion-header>
|
|
252
|
+
<k-accordion-panel name="toc-panel">
|
|
253
|
+
<div class="m">
|
|
25
254
|
<h6>Usage</h6>
|
|
26
255
|
<a href="#basicUsage">Basic Usage</a><br />
|
|
27
256
|
<a href="#parameters">Parameters</a><br />
|
|
28
257
|
<a href="#formatTokens">Format Tokens</a><br />
|
|
29
258
|
<a href="#examples">Examples</a><br />
|
|
30
259
|
</div>
|
|
31
|
-
|
|
260
|
+
</k-accordion-panel>
|
|
261
|
+
</k-accordion>
|
|
32
262
|
|
|
33
263
|
<h3>Description</h3>
|
|
34
264
|
<p>The <code>formatTimestamp</code> utility function formats timestamps using custom format tokens or locale-specific formatting.</p>
|
|
@@ -86,10 +316,10 @@
|
|
|
86
316
|
|
|
87
317
|
<h4>Locale Formatting</h4>
|
|
88
318
|
<pre><code class="hljs javascript"><span class="hljs-comment">// Uses browser locale when no format specified</span><br />formatTimestamp(timestamp); <span class="hljs-comment">// "10/1/2021, 12:00:00 AM"</span><br /><br /><span class="hljs-comment">// Force specific locale</span><br />formatTimestamp(timestamp, <span class="hljs-literal">null</span>, <span class="hljs-string">'de-DE'</span>); <span class="hljs-comment">// German formatting</span></code></pre>
|
|
89
|
-
|
|
319
|
+
|
|
90
320
|
</k-main>
|
|
91
321
|
<div style="height:33vh"></div>
|
|
92
|
-
<script type="module" src="../src/components/Import.js"></script>
|
|
93
322
|
<script type="module" src="../src/components/Main.js"></script>
|
|
323
|
+
|
|
94
324
|
</body>
|
|
95
325
|
</html>
|
package/docs/utils/object.html
CHANGED
|
@@ -11,10 +11,240 @@
|
|
|
11
11
|
<link rel="stylesheet" href="../kempo-hljs.css" />
|
|
12
12
|
<link rel="stylesheet" href="../styles.css" />
|
|
13
13
|
<script>window.litDisableBundleWarning = true;</script>
|
|
14
|
+
|
|
14
15
|
</head>
|
|
15
16
|
<body>
|
|
16
|
-
|
|
17
|
+
|
|
18
|
+
<k-nav fixed class="bg-primary">
|
|
19
|
+
<button id="toggleNavSideMenu" class="link">
|
|
20
|
+
<k-icon name="menu"></k-icon>
|
|
21
|
+
</button>
|
|
22
|
+
<a href="../" class="d-if ph" style="align-items: center">
|
|
23
|
+
<img src="../media/icon32.png" alt="Kempo UI Icon" class="pr" />
|
|
24
|
+
Kempo UI
|
|
25
|
+
</a>
|
|
26
|
+
<div style="position:relative;margin:0 .25rem;align-self:center;" theme="light">
|
|
27
|
+
<input id="navSearchInput" type="search" placeholder="Search docs..." autocomplete="off" style="width:11rem;" />
|
|
28
|
+
<div id="navSearchDropdown" hidden theme="light" style="position:absolute;top:calc(100% + 4px);left:0;width:min(480px,90vw);max-height:70vh;background:var(--c_bg);border:1px solid var(--c_border);border-radius:var(--radius);overflow:auto;z-index:9999;box-shadow:0 4px 12px rgba(0,0,0,.3);">
|
|
29
|
+
<k-filter-list id="navSearchList" style="display:block;padding:.25rem 0;">
|
|
30
|
+
<k-filter-item filter-keywords="accordion components"><a href="../components/accordion.html">Accordion<br><small>Component</small></a></k-filter-item>
|
|
31
|
+
<k-filter-item filter-keywords="aside sidebar components"><a href="../components/aside.html">Aside<br><small>Component</small></a></k-filter-item>
|
|
32
|
+
<k-filter-item filter-keywords="card components"><a href="../components/card.html">Card<br><small>Component</small></a></k-filter-item>
|
|
33
|
+
<k-filter-item filter-keywords="color picker colorpicker components"><a href="../components/color-picker.html">Color Picker<br><small>Component</small></a></k-filter-item>
|
|
34
|
+
<k-filter-item filter-keywords="content slider components"><a href="../components/content-slider.html">Content Slider<br><small>Component</small></a></k-filter-item>
|
|
35
|
+
<k-filter-item filter-keywords="context state global components"><a href="../components/context.html">Context<br><small>Component</small></a></k-filter-item>
|
|
36
|
+
<k-filter-item filter-keywords="dialog modal popup components"><a href="../components/dialog.html">Dialog<br><small>Component</small></a></k-filter-item>
|
|
37
|
+
<k-filter-item filter-keywords="dropdown select components"><a href="../components/dropdown.html">Dropdown<br><small>Component</small></a></k-filter-item>
|
|
38
|
+
<k-filter-item filter-keywords="filter list filterlist components"><a href="../components/filter-list.html">Filter List<br><small>Component</small></a></k-filter-item>
|
|
39
|
+
<k-filter-item filter-keywords="focus capture focuscapture components"><a href="../components/focus-capture.html">Focus Capture<br><small>Component</small></a></k-filter-item>
|
|
40
|
+
<k-filter-item filter-keywords="html editor components"><a href="../components/html-editor.html">HTML Editor<br><small>Component</small></a></k-filter-item>
|
|
41
|
+
<k-filter-item filter-keywords="icon components"><a href="../components/icon.html">Icon<br><small>Component</small></a></k-filter-item>
|
|
42
|
+
<k-filter-item filter-keywords="import components"><a href="../components/import.html">Import<br><small>Component</small></a></k-filter-item>
|
|
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="photo viewer photoviewer components"><a href="../components/photo-viewer.html">Photo Viewer<br><small>Component</small></a></k-filter-item>
|
|
45
|
+
<k-filter-item filter-keywords="resize components"><a href="../components/resize.html">Resize<br><small>Component</small></a></k-filter-item>
|
|
46
|
+
<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>
|
|
47
|
+
<k-filter-item filter-keywords="sortable drag drop sort components"><a href="../components/sortable.html">Sortable<br><small>Component</small></a></k-filter-item>
|
|
48
|
+
<k-filter-item filter-keywords="spinner loading components"><a href="../components/spinner.html">Spinner<br><small>Component</small></a></k-filter-item>
|
|
49
|
+
<k-filter-item filter-keywords="split pane components"><a href="../components/split.html">Split<br><small>Component</small></a></k-filter-item>
|
|
50
|
+
<k-filter-item filter-keywords="table data grid components"><a href="../components/table.html">Table<br><small>Component</small></a></k-filter-item>
|
|
51
|
+
<k-filter-item filter-keywords="table controls advanced example"><a href="../components/tableControls.html">Table — Controls<br><small>Advanced Example</small></a></k-filter-item>
|
|
52
|
+
<k-filter-item filter-keywords="table custom fields advanced example"><a href="../components/tableCustomFields.html">Table — Custom Fields<br><small>Advanced Example</small></a></k-filter-item>
|
|
53
|
+
<k-filter-item filter-keywords="table fetch records advanced example"><a href="../components/tableFetchRecords.html">Table — Fetch Records<br><small>Advanced Example</small></a></k-filter-item>
|
|
54
|
+
<k-filter-item filter-keywords="table field sort hide advanced example"><a href="../components/tableFieldSortHide.html">Table — Field Sort & Hide<br><small>Advanced Example</small></a></k-filter-item>
|
|
55
|
+
<k-filter-item filter-keywords="table pagination advanced example"><a href="../components/tablePagination.html">Table — Pagination<br><small>Advanced Example</small></a></k-filter-item>
|
|
56
|
+
<k-filter-item filter-keywords="table record editing advanced example"><a href="../components/tableRecordEditing.html">Table — Record Editing<br><small>Advanced Example</small></a></k-filter-item>
|
|
57
|
+
<k-filter-item filter-keywords="table record filtering advanced example"><a href="../components/tableRecordFiltering.html">Table — Record Filtering<br><small>Advanced Example</small></a></k-filter-item>
|
|
58
|
+
<k-filter-item filter-keywords="table record hiding advanced example"><a href="../components/tableRecordHiding.html">Table — Record Hiding<br><small>Advanced Example</small></a></k-filter-item>
|
|
59
|
+
<k-filter-item filter-keywords="table record searching advanced example"><a href="../components/tableRecordSearching.html">Table — Record Searching<br><small>Advanced Example</small></a></k-filter-item>
|
|
60
|
+
<k-filter-item filter-keywords="table record selection advanced example"><a href="../components/tableRecordSelection.html">Table — Record Selection<br><small>Advanced Example</small></a></k-filter-item>
|
|
61
|
+
<k-filter-item filter-keywords="table row controls advanced example"><a href="../components/tableRowControls.html">Table — Row Controls<br><small>Advanced Example</small></a></k-filter-item>
|
|
62
|
+
<k-filter-item filter-keywords="table server sync advanced example"><a href="../components/tableServerSync.html">Table — Server Sync<br><small>Advanced Example</small></a></k-filter-item>
|
|
63
|
+
<k-filter-item filter-keywords="table sorting advanced example"><a href="../components/tableSorting.html">Table — Sorting<br><small>Advanced Example</small></a></k-filter-item>
|
|
64
|
+
<k-filter-item filter-keywords="table placeholder advanced example"><a href="../components/tablePlaceholder.html">Table — Placeholder<br><small>Advanced Example</small></a></k-filter-item>
|
|
65
|
+
<k-filter-item filter-keywords="tabs tab panel components"><a href="../components/tabs.html">Tabs<br><small>Component</small></a></k-filter-item>
|
|
66
|
+
<k-filter-item filter-keywords="tags tag input components"><a href="../components/tags.html">Tags<br><small>Component</small></a></k-filter-item>
|
|
67
|
+
<k-filter-item filter-keywords="theme select dropdown dark light components"><a href="../components/theme-select.html">Theme Select<br><small>Component</small></a></k-filter-item>
|
|
68
|
+
<k-filter-item filter-keywords="theme switcher dark light components"><a href="../components/theme-switcher.html">Theme Switcher<br><small>Component</small></a></k-filter-item>
|
|
69
|
+
<k-filter-item filter-keywords="timestamp date time components"><a href="../components/timestamp.html">Timestamp<br><small>Component</small></a></k-filter-item>
|
|
70
|
+
<k-filter-item filter-keywords="toast notification alert components"><a href="../components/toast.html">Toast<br><small>Component</small></a></k-filter-item>
|
|
71
|
+
<k-filter-item filter-keywords="toggle switch checkbox components"><a href="../components/toggle.html">Toggle<br><small>Component</small></a></k-filter-item>
|
|
72
|
+
<k-filter-item filter-keywords="tree treeview components"><a href="../components/tree.html">Tree<br><small>Component</small></a></k-filter-item>
|
|
73
|
+
<k-filter-item filter-keywords="shadow component base"><a href="../components/shadow-component.html">Shadow Component<br><small>Base Component</small></a></k-filter-item>
|
|
74
|
+
<k-filter-item filter-keywords="light component base"><a href="../components/light-component.html">Light Component<br><small>Base Component</small></a></k-filter-item>
|
|
75
|
+
<k-filter-item filter-keywords="hybrid component base"><a href="../components/hybrid-component.html">Hybrid Component<br><small>Base Component</small></a></k-filter-item>
|
|
76
|
+
<k-filter-item filter-keywords="cookie utils utility"><a href="../utils/cookie.html">cookie<br><small>Utility</small></a></k-filter-item>
|
|
77
|
+
<k-filter-item filter-keywords="context utils utility"><a href="../utils/context.html">context<br><small>Utility</small></a></k-filter-item>
|
|
78
|
+
<k-filter-item filter-keywords="debounce utils utility"><a href="../utils/debounce.html">debounce<br><small>Utility</small></a></k-filter-item>
|
|
79
|
+
<k-filter-item filter-keywords="drag utils utility"><a href="../utils/drag.html">drag<br><small>Utility</small></a></k-filter-item>
|
|
80
|
+
<k-filter-item filter-keywords="elevation z-index stacking utils"><a href="../utils/elevation.html">elevation<br><small>Utility</small></a></k-filter-item>
|
|
81
|
+
<k-filter-item filter-keywords="formattimestamp timestamp format date time utils utility"><a href="../utils/formatTimestamp.html">formatTimestamp<br><small>Utility</small></a></k-filter-item>
|
|
82
|
+
<k-filter-item filter-keywords="object utils utility"><a href="../utils/object.html">object<br><small>Utility</small></a></k-filter-item>
|
|
83
|
+
<k-filter-item filter-keywords="propconverters prop converters utils utility"><a href="../utils/propConverters.html">propConverters<br><small>Utility</small></a></k-filter-item>
|
|
84
|
+
<k-filter-item filter-keywords="string utils utility"><a href="../utils/string.html">string<br><small>Utility</small></a></k-filter-item>
|
|
85
|
+
<k-filter-item filter-keywords="theme utils utility"><a href="../utils/theme.html">theme<br><small>Utility</small></a></k-filter-item>
|
|
86
|
+
<k-filter-item filter-keywords="type utils utility"><a href="../utils/type.html">type<br><small>Utility</small></a></k-filter-item>
|
|
87
|
+
<k-filter-item filter-keywords="wait async utils utility"><a href="../utils/wait.html">wait<br><small>Utility</small></a></k-filter-item>
|
|
88
|
+
</k-filter-list>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
<div class="flex"></div>
|
|
92
|
+
<a href="https://github.com/dustinpoissant/kempo-ui?tab=License-1-ov-file#creative-commons-attribution-noncommercial-sharealike-20" target="_blank"><k-icon name="license"></k-icon></a>
|
|
93
|
+
<a href="https://www.npmjs.com/package/kempo-ui" target="_blank"><k-icon name="npm"></k-icon></a>
|
|
94
|
+
<a href="https://github.com/dustinpoissant/kempo-ui" target="_blank"><k-icon name="github-mark"></k-icon></a>
|
|
95
|
+
<k-theme-switcher></k-theme-switcher>
|
|
96
|
+
</k-nav>
|
|
97
|
+
<div style="width: 100%; height: 4rem;"></div>
|
|
98
|
+
<k-aside id="navSideMenu" main="overlay" state="offscreen">
|
|
99
|
+
<menu>
|
|
100
|
+
<a href="../" class="ta-center bb mb r0">
|
|
101
|
+
<h1 class="tc-primary">Kempo UI</h1>
|
|
102
|
+
<img src="../media/icon128.png" alt="Kempo UI Icon" />
|
|
103
|
+
</a>
|
|
104
|
+
|
|
105
|
+
<div class="pl mb">
|
|
106
|
+
<h3>Components</h3>
|
|
107
|
+
<a href="../components/accordion.html">Accordion</a>
|
|
108
|
+
<a href="../components/aside.html">Aside</a>
|
|
109
|
+
<a href="../components/card.html">Card</a>
|
|
110
|
+
<a href="../components/color-picker.html">ColorPicker</a>
|
|
111
|
+
<a href="../components/content-slider.html">Content Slider</a>
|
|
112
|
+
<a href="../components/context.html">Context</a>
|
|
113
|
+
<a href="../components/dialog.html">Dialog</a>
|
|
114
|
+
<a href="../components/dropdown.html">Dropdown</a>
|
|
115
|
+
<a href="../components/filter-list.html">Filter List</a>
|
|
116
|
+
<a href="../components/focus-capture.html">FocusCapture</a>
|
|
117
|
+
<a href="../components/html-editor.html">HTML Editor</a>
|
|
118
|
+
<a href="../components/icon.html">Icon</a>
|
|
119
|
+
<a href="../components/import.html">Import</a>
|
|
120
|
+
<a href="../components/nav.html">Nav</a>
|
|
121
|
+
<a href="../components/photo-viewer.html">Photo Viewer</a>
|
|
122
|
+
<a href="../components/resize.html">Resize</a>
|
|
123
|
+
<a href="../components/show-more.html">Show More</a>
|
|
124
|
+
<a href="../components/sortable.html">Sortable</a>
|
|
125
|
+
<a href="../components/spinner.html">Spinner</a>
|
|
126
|
+
<a href="../components/split.html">Split</a>
|
|
127
|
+
<a href="../components/table.html">Table</a>
|
|
128
|
+
<a href="../components/tabs.html">Tabs</a>
|
|
129
|
+
<a href="../components/tags.html">Tags</a>
|
|
130
|
+
<a href="../components/theme-select.html">Theme Select</a>
|
|
131
|
+
<a href="../components/theme-switcher.html">Theme Switcher</a>
|
|
132
|
+
<a href="../components/timestamp.html">Timestamp</a>
|
|
133
|
+
<a href="../components/toast.html">Toast</a>
|
|
134
|
+
<a href="../components/toggle.html">Toggle</a>
|
|
135
|
+
<a href="../components/tree.html">Tree</a>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<h5 class="mb0">Base Components</h5>
|
|
139
|
+
<div class="pl mb">
|
|
140
|
+
<a href="../components/shadow-component.html">Shadow Component</a>
|
|
141
|
+
<a href="../components/light-component.html">Light Component</a>
|
|
142
|
+
<a href="../components/hybrid-component.html">Hybrid Component</a>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
<h5 class="mb0">Utils</h5>
|
|
146
|
+
<div class="pl mb">
|
|
147
|
+
<a href="../utils/cookie.html">cookie</a>
|
|
148
|
+
<a href="../utils/context.html">context</a>
|
|
149
|
+
<a href="../utils/debounce.html">debounce</a>
|
|
150
|
+
<a href="../utils/drag.html">drag</a>
|
|
151
|
+
<a href="../utils/elevation.html">elevation</a>
|
|
152
|
+
<a href="../utils/formatTimestamp.html">formatTimestamp</a>
|
|
153
|
+
<a href="../utils/object.html">object</a>
|
|
154
|
+
<a href="../utils/propConverters.html">propConverters</a>
|
|
155
|
+
<a href="../utils/string.html">string</a>
|
|
156
|
+
<a href="../utils/theme.html">theme</a>
|
|
157
|
+
<a href="../utils/type.html">type</a>
|
|
158
|
+
<a href="../utils/wait.html">wait</a>
|
|
159
|
+
</div>
|
|
160
|
+
</menu>
|
|
161
|
+
</k-aside>
|
|
162
|
+
<style>
|
|
163
|
+
#navSearchList a{display:block;padding:.25rem .5rem;border-radius:var(--radius);text-decoration:none;color:var(--tc);}
|
|
164
|
+
#navSearchList a:hover{background:rgba(128,128,128,.15);}
|
|
165
|
+
#navSearchList a small{display:block;color:var(--tc_muted);}
|
|
166
|
+
</style>
|
|
167
|
+
<script src="../src/components/Nav.js" type="module"></script>
|
|
168
|
+
<script src="../src/components/FilterList.js" type="module"></script>
|
|
169
|
+
<script src="../src/components/FilterItem.js" type="module"></script>
|
|
170
|
+
<script src="../src/components/Aside.js" type="module"></script>
|
|
171
|
+
<script src="../src/components/Icon.js" type="module"></script>
|
|
172
|
+
<script src="../src/components/ThemeSwitcher.js" type="module"></script>
|
|
173
|
+
<script type="module">
|
|
174
|
+
import debounce from '../src/utils/debounce.js';
|
|
175
|
+
|
|
176
|
+
document.getElementById('toggleNavSideMenu').addEventListener('click', async () => {
|
|
177
|
+
await window.customElements.whenDefined('k-aside');
|
|
178
|
+
document.getElementById('navSideMenu').toggle();
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
document.addEventListener('click', function(e) {
|
|
182
|
+
if(e.target.matches('a[href^="#"]')) {
|
|
183
|
+
e.preventDefault();
|
|
184
|
+
const targetId = e.target.getAttribute('href').replace('#', '');
|
|
185
|
+
const target = document.getElementById(targetId);
|
|
186
|
+
if(target) {
|
|
187
|
+
target.scrollIntoView({ behavior: 'smooth' });
|
|
188
|
+
const url = window.location.pathname + window.location.search + '#' + targetId;
|
|
189
|
+
history.replaceState(null, '', url);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
/*
|
|
195
|
+
Nav Search
|
|
196
|
+
*/
|
|
197
|
+
const searchInput = document.getElementById('navSearchInput');
|
|
198
|
+
const searchDropdown = document.getElementById('navSearchDropdown');
|
|
199
|
+
let navSearchList = null;
|
|
200
|
+
|
|
201
|
+
const openSearch = async () => {
|
|
202
|
+
await customElements.whenDefined('k-filter-list');
|
|
203
|
+
if(!navSearchList) navSearchList = document.getElementById('navSearchList');
|
|
204
|
+
navSearchList.filter(searchInput.value);
|
|
205
|
+
searchDropdown.hidden = false;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const closeSearch = () => {
|
|
209
|
+
searchDropdown.hidden = true;
|
|
210
|
+
navSearchList?.clearFocus();
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
searchInput.addEventListener('focus', openSearch);
|
|
214
|
+
|
|
215
|
+
searchInput.addEventListener('input', debounce(e => {
|
|
216
|
+
navSearchList?.filter(e.target.value);
|
|
217
|
+
}, 150));
|
|
218
|
+
|
|
219
|
+
searchInput.addEventListener('keydown', e => {
|
|
220
|
+
if(e.key === 'Escape') {
|
|
221
|
+
searchInput.value = '';
|
|
222
|
+
searchInput.blur();
|
|
223
|
+
closeSearch();
|
|
224
|
+
} else if(e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter') {
|
|
225
|
+
navSearchList?.handleKeydown(e);
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
searchInput.addEventListener('blur', () => {
|
|
230
|
+
setTimeout(closeSearch, 150);
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
document.addEventListener('keydown', e => {
|
|
234
|
+
let active = document.activeElement;
|
|
235
|
+
while(active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;
|
|
236
|
+
const tag = active?.tagName;
|
|
237
|
+
if(tag === 'INPUT' || tag === 'TEXTAREA' || active?.isContentEditable) return;
|
|
238
|
+
if(e.metaKey || e.ctrlKey || e.altKey) return;
|
|
239
|
+
if(e.key.length === 1) {
|
|
240
|
+
searchInput.focus();
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
</script>
|
|
244
|
+
|
|
245
|
+
|
|
17
246
|
<k-main>
|
|
247
|
+
|
|
18
248
|
<h1>Object Utilities</h1>
|
|
19
249
|
|
|
20
250
|
<k-accordion persistent-id="toc" class="b r mb">
|
|
@@ -83,11 +313,12 @@
|
|
|
83
313
|
<h3 id="mapObject"><a href="#mapObject" class="no-link">mapObject</a></h3>
|
|
84
314
|
<p>Maps over an object's entries using a function that returns [newKey, newValue].</p>
|
|
85
315
|
<pre><code class="hljs javascript"><span class="hljs-keyword">import</span> { mapObject } <span class="hljs-keyword">from</span> <span class="hljs-string">'../src/utils/object.js'</span>;<br /><br /><span class="hljs-keyword">const</span> obj = { <span class="hljs-attr">a</span>: <span class="hljs-number">1</span>, <span class="hljs-attr">b</span>: <span class="hljs-number">2</span> };<br />mapObject(obj, (k, v) => [`new_${k}`, v * <span class="hljs-number">2</span>]); <span class="hljs-comment">// { new_a: 2, new_b: 4 }</span></code></pre>
|
|
86
|
-
|
|
316
|
+
|
|
87
317
|
</k-main>
|
|
88
318
|
<div style="height:33vh"></div>
|
|
89
|
-
<script type="module" src="../src/components/Import.js"></script>
|
|
90
319
|
<script type="module" src="../src/components/Main.js"></script>
|
|
91
|
-
|
|
320
|
+
|
|
321
|
+
<script type="module" src="../src/components/Accordion.js"></script>
|
|
322
|
+
|
|
92
323
|
</body>
|
|
93
|
-
</html>
|
|
324
|
+
</html>
|