@splendidlabz/svelte 4.5.1 → 4.6.1
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/CHANGELOG.md +24 -0
- package/components/Callout/Callout.svelte +3 -8
- package/components/ContentList/ContentList.svelte +78 -36
- package/components/ContentList/contentlist.js +59 -0
- package/components/Form/SearchInput.svelte +6 -0
- package/components/Form/TextInput.svelte +8 -3
- package/components/List/NestedListItem.svelte +42 -24
- package/components/Status.svelte +11 -16
- package/components/Tabs/tabs.js +0 -2
- package/package.json +3 -3
- package/components/ContentList/ContentList-old.svelte +0 -117
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @splendidlabz/svelte
|
|
2
2
|
|
|
3
|
+
## 4.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @splendidlabz/styles@4.4.1
|
|
9
|
+
|
|
10
|
+
## 4.6.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 4efacb3: - 9b5ea9a2 Upgrade Content List
|
|
15
|
+
- Add aria-current attribute to list items
|
|
16
|
+
- Improve structure building and updating
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 96c92cc: Some cleanup and typo fixes
|
|
21
|
+
- Updated dependencies [4efacb3]
|
|
22
|
+
- Updated dependencies [4efacb3]
|
|
23
|
+
- Updated dependencies [96c92cc]
|
|
24
|
+
- @splendidlabz/styles@4.4.0
|
|
25
|
+
- @splendidlabz/utils@1.10.0
|
|
26
|
+
|
|
3
27
|
## 4.5.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
<!-- BREAKING CHANGES TO CALLOUT -->
|
|
2
|
-
<!-- Rename CalloutPrefix to CalloutHeader -->
|
|
3
|
-
|
|
4
1
|
<script>
|
|
5
2
|
import { toTitle } from '@splendidlabz/utils'
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
export { klass as class }
|
|
9
|
-
export let type = 'note'
|
|
4
|
+
const { class: klass = '', type = 'note', children, ...rest } = $props()
|
|
10
5
|
</script>
|
|
11
6
|
|
|
12
|
-
<div class="callout callout-{type}
|
|
7
|
+
<div {...rest} class="callout callout-{type} {klass}" data-type={type}>
|
|
13
8
|
<div class="callout-header">{toTitle(type)}</div>
|
|
14
9
|
<div class="callout-content prose">
|
|
15
|
-
|
|
10
|
+
{@render children?.()}
|
|
16
11
|
</div>
|
|
17
12
|
</div>
|
|
@@ -1,66 +1,108 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
/**
|
|
3
|
+
* @component ContentList
|
|
4
|
+
* A dynamic table of contents component that tracks and highlights the current heading
|
|
5
|
+
* based on scroll position. Automatically builds a hierarchical structure from headings
|
|
6
|
+
* in the document or a specified container.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} [selector] - CSS selector for container to search for headings. If not provided, searches entire document
|
|
9
|
+
* @param {string} [label] - Label text to display above the content list
|
|
10
|
+
* @param {string} [class] - Additional CSS classes for the component wrapper
|
|
11
|
+
* @param {string} [labelClass] - CSS classes for the label element
|
|
12
|
+
* @param {string} [listClass] - CSS classes for the list element
|
|
13
|
+
* @param {string} [liClass] - CSS classes for list item elements
|
|
14
|
+
* @param {string} [aClass] - CSS classes for anchor elements
|
|
15
|
+
* @param {Object} [options] - Configuration options for heading selection
|
|
16
|
+
* @param {string[]} [options.includes=['h2','h3','h4','h5','h6']] - Heading tags to include
|
|
17
|
+
* @param {string[]} [options.excludes=[]] - CSS selectors to exclude from the list
|
|
18
|
+
* @param {...*} [rest] - Additional props passed to the wrapper div
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <ContentList
|
|
22
|
+
* label="On this page"
|
|
23
|
+
* selector=".content"
|
|
24
|
+
* options={{ includes: ['h2', 'h3'] }}
|
|
25
|
+
* />
|
|
26
|
+
*/
|
|
27
|
+
import {
|
|
28
|
+
findScrollContainer,
|
|
29
|
+
rlh,
|
|
30
|
+
scrollObserver,
|
|
31
|
+
} from '@splendidlabz/utils/dom'
|
|
2
32
|
import { onMount } from 'svelte'
|
|
3
33
|
import NestedList from '../List/NestedListItem.svelte'
|
|
34
|
+
import { buildStructure, updateAriaCurrent } from './contentlist.js'
|
|
4
35
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
36
|
+
const {
|
|
37
|
+
selector,
|
|
38
|
+
label,
|
|
39
|
+
class: klass = '',
|
|
40
|
+
labelClass,
|
|
41
|
+
listClass,
|
|
42
|
+
liClass,
|
|
43
|
+
aClass,
|
|
44
|
+
options,
|
|
45
|
+
...rest
|
|
46
|
+
} = $props()
|
|
13
47
|
|
|
14
|
-
|
|
48
|
+
const defaultOptions = {
|
|
15
49
|
includes: ['h2', 'h3', 'h4', 'h5', 'h6'],
|
|
16
50
|
excludes: [],
|
|
17
51
|
}
|
|
18
52
|
|
|
19
|
-
|
|
53
|
+
const opts = { ...defaultOptions, ...options, ...rest }
|
|
54
|
+
|
|
55
|
+
let ref = $state(null)
|
|
56
|
+
let elements = $state([])
|
|
57
|
+
let structure = $state([])
|
|
58
|
+
let currentHeading = $state(null)
|
|
20
59
|
|
|
21
60
|
onMount(() => {
|
|
22
61
|
if (typeof window === 'undefined') return
|
|
23
62
|
const targetElement = selector ? document.querySelector(selector) : document
|
|
24
|
-
|
|
25
|
-
|
|
63
|
+
|
|
64
|
+
elements = Array.from(
|
|
65
|
+
targetElement.querySelectorAll(opts.includes.join(',')),
|
|
26
66
|
).filter(el => {
|
|
27
67
|
if (el.matches('.contentlist-exclude')) return false
|
|
28
|
-
if (
|
|
68
|
+
if (opts.excludes.some(selector => el.matches(selector))) return false
|
|
29
69
|
return true
|
|
30
70
|
})
|
|
31
71
|
|
|
32
|
-
structure = buildStructure(elements)
|
|
72
|
+
structure = buildStructure(elements, liClass, aClass)
|
|
33
73
|
})
|
|
34
74
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
elements.forEach(element => {
|
|
40
|
-
const headingLevel = parseInt(element.tagName.charAt(1))
|
|
41
|
-
const item = {
|
|
42
|
-
href: `#${element.id}`,
|
|
43
|
-
label: element.textContent,
|
|
44
|
-
liClass,
|
|
45
|
-
aClass,
|
|
46
|
-
children: [],
|
|
47
|
-
}
|
|
75
|
+
$effect(_ => {
|
|
76
|
+
if (!ref) return
|
|
77
|
+
const scrollContainer = findScrollContainer(ref)
|
|
48
78
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
79
|
+
const observer = scrollObserver(scrollContainer, {
|
|
80
|
+
callback: data => {
|
|
81
|
+
const { scrollTop } = data
|
|
82
|
+
const offset = rlh() + 10 // 10px leeway for any rounding errors + some headroom
|
|
52
83
|
|
|
53
|
-
|
|
54
|
-
|
|
84
|
+
const closestHeading = [...elements]
|
|
85
|
+
.reverse()
|
|
86
|
+
.find(h => h.offsetTop <= scrollTop + offset)
|
|
87
|
+
// Update current heading and structure when closest heading changes
|
|
88
|
+
if (closestHeading && closestHeading !== currentHeading) {
|
|
89
|
+
currentHeading = closestHeading
|
|
90
|
+
structure = updateAriaCurrent(structure, `#${closestHeading.id}`)
|
|
91
|
+
}
|
|
92
|
+
},
|
|
55
93
|
})
|
|
56
94
|
|
|
57
|
-
return
|
|
58
|
-
}
|
|
95
|
+
return () => observer.destroy()
|
|
96
|
+
})
|
|
59
97
|
</script>
|
|
60
98
|
|
|
61
99
|
{#if structure.length}
|
|
62
|
-
<div class="contentlist {klass}"
|
|
63
|
-
|
|
100
|
+
<div bind:this={ref} {...rest} class="contentlist {klass}">
|
|
101
|
+
{#if typeof label === 'string'}
|
|
102
|
+
<div class="label {labelClass}">{label}</div>
|
|
103
|
+
{:else}
|
|
104
|
+
{@render label?.()}
|
|
105
|
+
{/if}
|
|
64
106
|
<ul class={listClass}>
|
|
65
107
|
<NestedList items={structure} />
|
|
66
108
|
</ul>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a hierarchical structure from a flat list of heading elements
|
|
3
|
+
* @param {HTMLElement[]} elements - Array of heading elements to structure
|
|
4
|
+
* @param {string} liClass - CSS classes for list items
|
|
5
|
+
* @param {string} aClass - CSS classes for anchors
|
|
6
|
+
* @return {Object[]} Hierarchical array of items with nested children
|
|
7
|
+
* @property {string} return[].href - Anchor link to the heading
|
|
8
|
+
* @property {string} return[].label - Text content of the heading
|
|
9
|
+
* @property {string} return[].liClass - CSS classes for the list item
|
|
10
|
+
* @property {string} return[].aClass - CSS classes for the anchor
|
|
11
|
+
* @property {Object[]} return[].children - Nested child items
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export function buildStructure(elements, liClass, aClass) {
|
|
15
|
+
const structure = []
|
|
16
|
+
const stack = [{ headingLevel: 0, children: structure }]
|
|
17
|
+
|
|
18
|
+
elements.forEach(element => {
|
|
19
|
+
const headingLevel = parseInt(element.tagName.charAt(1))
|
|
20
|
+
const item = {
|
|
21
|
+
href: `#${element.id}`,
|
|
22
|
+
label: element.textContent,
|
|
23
|
+
liClass,
|
|
24
|
+
aClass,
|
|
25
|
+
children: [],
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
while (headingLevel <= stack[stack.length - 1].headingLevel) {
|
|
29
|
+
stack.pop()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
stack[stack.length - 1].children.push(item)
|
|
33
|
+
stack.push({ headingLevel, children: item.children })
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
return structure
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Recursively updates aria-current attribute for items matching the target href
|
|
41
|
+
* @param {Object[]} items - Array of content list items to process
|
|
42
|
+
* @param {string} targetHref - Target href to mark as current location
|
|
43
|
+
* @return {Object[]} Updated array with aria-current attributes set
|
|
44
|
+
* @property {string|null} return[].aria-current - 'location' if item matches targetHref, null otherwise
|
|
45
|
+
*/
|
|
46
|
+
export function updateAriaCurrent(items, targetHref) {
|
|
47
|
+
return items.map(item => {
|
|
48
|
+
const newItem = { ...item }
|
|
49
|
+
if (item.href === targetHref) {
|
|
50
|
+
newItem['aria-current'] = 'location'
|
|
51
|
+
} else {
|
|
52
|
+
newItem['aria-current'] = null
|
|
53
|
+
}
|
|
54
|
+
if (item.children && item.children.length > 0) {
|
|
55
|
+
newItem.children = updateAriaCurrent(item.children, targetHref)
|
|
56
|
+
}
|
|
57
|
+
return newItem
|
|
58
|
+
})
|
|
59
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { randomString } from '@splendidlabz/utils/dom'
|
|
3
3
|
import { useActions } from '../../actions/use-actions'
|
|
4
|
+
import Markdown from '../Markdown/Markdown.svelte'
|
|
4
5
|
|
|
5
6
|
let { value = $bindable(''), ref = $bindable(null), ...p } = $props()
|
|
6
7
|
const {
|
|
@@ -79,14 +80,18 @@
|
|
|
79
80
|
aria-label={!labelVisible && label}
|
|
80
81
|
>
|
|
81
82
|
{#if label && labelVisible}
|
|
82
|
-
<label class="label input-meta {labelClass}" for={id}>
|
|
83
|
+
<label class="label input-meta {labelClass}" for={id}>
|
|
84
|
+
<Markdown content={label} inline />
|
|
85
|
+
</label>
|
|
83
86
|
{/if}
|
|
84
87
|
{#if hint}
|
|
85
|
-
<div id={hintId} class="hint input-meta {hintClass}">
|
|
88
|
+
<div id={hintId} class="hint input-meta {hintClass}">
|
|
89
|
+
<Markdown content={hint} inline />
|
|
90
|
+
</div>
|
|
86
91
|
{/if}
|
|
87
92
|
{#if error}
|
|
88
93
|
<output id={errorId} class="error input-meta {errorClass}" for={id}>
|
|
89
|
-
{error}
|
|
94
|
+
<Markdown content={error} inline />
|
|
90
95
|
</output>
|
|
91
96
|
{/if}
|
|
92
97
|
|
|
@@ -19,32 +19,50 @@ Props:
|
|
|
19
19
|
- children (Object[]): Optional array of nested items to be rendered as a sublist.
|
|
20
20
|
-->
|
|
21
21
|
<script>
|
|
22
|
-
|
|
23
|
-
// export { klass as class }
|
|
24
|
-
export let items = []
|
|
25
|
-
export let liClass = ''
|
|
26
|
-
export let aClass = ''
|
|
27
|
-
</script>
|
|
22
|
+
const { items = [], liClass = '', aClass = '' } = $props()
|
|
28
23
|
|
|
29
|
-
|
|
24
|
+
function parseItemProps(item) {
|
|
25
|
+
const {
|
|
26
|
+
label,
|
|
27
|
+
children,
|
|
28
|
+
liClass: ilClass,
|
|
29
|
+
aClass: iaClass,
|
|
30
|
+
href,
|
|
31
|
+
'aria-current': ariaCurrent,
|
|
32
|
+
...irest
|
|
33
|
+
} = item
|
|
30
34
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
return {
|
|
36
|
+
liProps: {
|
|
37
|
+
class: ilClass || liClass,
|
|
38
|
+
...irest,
|
|
39
|
+
},
|
|
40
|
+
aProps: {
|
|
41
|
+
class: iaClass || aClass,
|
|
42
|
+
href,
|
|
43
|
+
'aria-current': ariaCurrent,
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
</script>
|
|
34
48
|
|
|
35
|
-
{#
|
|
36
|
-
{#
|
|
37
|
-
|
|
38
|
-
|
|
49
|
+
{#snippet nestedItems(items)}
|
|
50
|
+
{#if items.length}
|
|
51
|
+
{#each items as item (item.label)}
|
|
52
|
+
{@const { liProps, aProps } = parseItemProps(item)}
|
|
53
|
+
<li {...liProps}>
|
|
54
|
+
<a {...aProps}>
|
|
55
|
+
{item.label}
|
|
56
|
+
</a>
|
|
39
57
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{/if}
|
|
58
|
+
{#if item.children.length}
|
|
59
|
+
<ul>
|
|
60
|
+
{@render nestedItems(item.children)}
|
|
61
|
+
</ul>
|
|
62
|
+
{/if}
|
|
63
|
+
</li>
|
|
64
|
+
{/each}
|
|
65
|
+
{/if}
|
|
66
|
+
{/snippet}
|
|
48
67
|
|
|
49
|
-
|
|
50
|
-
<!-- Hm. How to style? CSS directly? -->
|
|
68
|
+
{@render nestedItems(items)}
|
package/components/Status.svelte
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
let { status, ...p } = $props()
|
|
2
|
+
let { status = $bindable('info'), ...p } = $props()
|
|
3
3
|
|
|
4
4
|
const { class: klass = '', children, ...rest } = p
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
break
|
|
14
|
-
case status >= 400:
|
|
15
|
-
status = 'error'
|
|
16
|
-
break
|
|
17
|
-
default:
|
|
18
|
-
status = 'info'
|
|
19
|
-
}
|
|
6
|
+
function getStatusString(status) {
|
|
7
|
+
console.log('status', status)
|
|
8
|
+
if (typeof status === 'string') return status
|
|
9
|
+
if (status >= 200 && status < 300) return 'success'
|
|
10
|
+
if (status >= 300 && status < 400) return 'redirect'
|
|
11
|
+
if (status >= 400) return 'error'
|
|
12
|
+
return 'info'
|
|
20
13
|
}
|
|
21
14
|
|
|
22
15
|
const statusClasses = {
|
|
@@ -24,7 +17,9 @@
|
|
|
24
17
|
success: 'status-success',
|
|
25
18
|
error: 'status-error',
|
|
26
19
|
}
|
|
27
|
-
|
|
20
|
+
|
|
21
|
+
let statusClass = $derived.by(_ => statusClasses[getStatusString(status)])
|
|
22
|
+
$inspect(statusClass)
|
|
28
23
|
</script>
|
|
29
24
|
|
|
30
25
|
<div {...rest} class="status {statusClass} {klass}">
|
package/components/Tabs/tabs.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// import { all as layoutScripts } from '@splendidlabz/styles/scripts'
|
|
2
1
|
import { omitEmpty } from '@splendidlabz/utils'
|
|
3
2
|
import {
|
|
4
3
|
Focusable,
|
|
@@ -22,7 +21,6 @@ export const DEFAULT_TABLIST_OPTIONS = {
|
|
|
22
21
|
loop: false,
|
|
23
22
|
autoplay: false,
|
|
24
23
|
autoplayInterval: 3000,
|
|
25
|
-
// runLayoutScripts: false,
|
|
26
24
|
},
|
|
27
25
|
}
|
|
28
26
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splendidlabz/svelte",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.6.1",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"scripts": {
|
|
7
7
|
"lint": "eslint . --fix",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@floating-ui/dom": "^1.6.13",
|
|
23
23
|
"@iconify/svelte": "^4.2.0",
|
|
24
|
-
"@splendidlabz/styles": "4.
|
|
25
|
-
"@splendidlabz/utils": "1.
|
|
24
|
+
"@splendidlabz/styles": "4.4.1",
|
|
25
|
+
"@splendidlabz/utils": "1.10.0",
|
|
26
26
|
"autosuggest-highlight": "^3.3.4",
|
|
27
27
|
"lodash-es": "^4.17.21",
|
|
28
28
|
"node-html-parser": "^7.0.1"
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { onMount } from 'svelte'
|
|
3
|
-
export let label = 'Contents'
|
|
4
|
-
export let labelClass = ''
|
|
5
|
-
export let headings = ['h2', 'h3', 'h4', 'h5', 'h6']
|
|
6
|
-
export let selector = null
|
|
7
|
-
|
|
8
|
-
let structure = []
|
|
9
|
-
|
|
10
|
-
// Search the DOM so we have to do onMount
|
|
11
|
-
onMount(async _ => {
|
|
12
|
-
selector = document.querySelector(selector) || document
|
|
13
|
-
|
|
14
|
-
const elements = Array.from(selector.querySelectorAll(headings))
|
|
15
|
-
|
|
16
|
-
elements.forEach(element => {
|
|
17
|
-
const heading = element.tagName.toLowerCase()
|
|
18
|
-
const id = element.id
|
|
19
|
-
const label = element.textContent
|
|
20
|
-
|
|
21
|
-
if (heading === 'h1' || heading === 'h2') {
|
|
22
|
-
structure.push({ id, label, children: [] })
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (heading === 'h3') {
|
|
26
|
-
const last = structure[structure.length - 1]
|
|
27
|
-
last.children.push({ id, label, children: [] })
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (heading === 'h4') {
|
|
31
|
-
const last = structure[structure.length - 1]
|
|
32
|
-
const lastChild = last.children[last.children.length - 1]
|
|
33
|
-
lastChild.children.push({ id, label, children: [] })
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (heading === 'h5') {
|
|
37
|
-
const last = structure[structure.length - 1]
|
|
38
|
-
const lastChild = last.children[last.children.length - 1]
|
|
39
|
-
const lastGrandChild = lastChild.children[lastChild.children.length - 1]
|
|
40
|
-
lastGrandChild.children.push({ id, label, children: [] })
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (heading === 'h6') {
|
|
44
|
-
const last = structure[structure.length - 1]
|
|
45
|
-
const lastChild = last.children[last.children.length - 1]
|
|
46
|
-
const lastGrandChild = lastChild.children[lastChild.children.length - 1]
|
|
47
|
-
const lastGreatGrandChild =
|
|
48
|
-
lastGrandChild.children[lastGrandChild.children.length - 1]
|
|
49
|
-
lastGreatGrandChild.children.push({ id, label })
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
// Reassign to trigger update
|
|
54
|
-
structure = structure
|
|
55
|
-
})
|
|
56
|
-
</script>
|
|
57
|
-
|
|
58
|
-
{#if structure.length}
|
|
59
|
-
<div class="ContentList" {...$$restProps}>
|
|
60
|
-
<div class="label {labelClass}">{label}</div>
|
|
61
|
-
|
|
62
|
-
<!-- H1 and H2 -->
|
|
63
|
-
<ul>
|
|
64
|
-
{#each structure as level1}
|
|
65
|
-
<li class="level-1">
|
|
66
|
-
<a href="#{level1.id}">{level1.label}</a>
|
|
67
|
-
|
|
68
|
-
<!-- H3 -->
|
|
69
|
-
{#if level1.children}
|
|
70
|
-
<ul>
|
|
71
|
-
{#each level1.children as level2}
|
|
72
|
-
<li class="level-2">
|
|
73
|
-
<a href="#{level2.id}">{level2.label}</a>
|
|
74
|
-
|
|
75
|
-
<!-- H4 -->
|
|
76
|
-
{#if level2.children}
|
|
77
|
-
<ul>
|
|
78
|
-
{#each level2.children as level3}
|
|
79
|
-
<li class="level-3">
|
|
80
|
-
<a href="#{level3.id}">{level3.label}</a>
|
|
81
|
-
|
|
82
|
-
<!-- H5 -->
|
|
83
|
-
{#if level3.children}
|
|
84
|
-
<ul>
|
|
85
|
-
{#each level3.children as level4}
|
|
86
|
-
<li class="level-4">
|
|
87
|
-
<a href="#{level4.id}">{level4.label}</a>
|
|
88
|
-
|
|
89
|
-
<!-- H6 -->
|
|
90
|
-
{#if level4.children}
|
|
91
|
-
<ul>
|
|
92
|
-
{#each level4.children as level5}
|
|
93
|
-
<li class="level-5">
|
|
94
|
-
<a href="#{level5.id}"
|
|
95
|
-
>{level5.label}</a
|
|
96
|
-
>
|
|
97
|
-
</li>
|
|
98
|
-
{/each}
|
|
99
|
-
</ul>
|
|
100
|
-
{/if}
|
|
101
|
-
</li>
|
|
102
|
-
{/each}
|
|
103
|
-
</ul>
|
|
104
|
-
{/if}
|
|
105
|
-
</li>
|
|
106
|
-
{/each}
|
|
107
|
-
</ul>
|
|
108
|
-
{/if}
|
|
109
|
-
</li>
|
|
110
|
-
{/each}
|
|
111
|
-
</ul>
|
|
112
|
-
{/if}
|
|
113
|
-
</li>
|
|
114
|
-
{/each}
|
|
115
|
-
</ul>
|
|
116
|
-
</div>
|
|
117
|
-
{/if}
|