srcdev-nuxt-components 6.1.7 → 6.1.9
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.
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component
|
|
2
|
+
<component
|
|
3
|
+
:is="tag"
|
|
4
|
+
class="layout-row"
|
|
5
|
+
:class="elementClasses"
|
|
6
|
+
:id
|
|
7
|
+
:tab-index="isLandmark ? 0 : null"
|
|
8
|
+
:aria-label="isLandmark ? 'Layout Row Landmark' : undefined"
|
|
9
|
+
>
|
|
3
10
|
<div :data-testid="dataTestid" class="layout-row-inner" :class="variant">
|
|
4
11
|
<div>
|
|
5
12
|
<slot name="default"></slot>
|
|
@@ -9,46 +16,57 @@
|
|
|
9
16
|
</template>
|
|
10
17
|
|
|
11
18
|
<script lang="ts">
|
|
12
|
-
const TAGS_ALLOWED = <string[]>[
|
|
19
|
+
export const TAGS_ALLOWED = <string[]>[
|
|
20
|
+
"div",
|
|
21
|
+
"section",
|
|
22
|
+
"article",
|
|
23
|
+
"aside",
|
|
24
|
+
"header",
|
|
25
|
+
"footer",
|
|
26
|
+
"main",
|
|
27
|
+
"nav",
|
|
28
|
+
"ul",
|
|
29
|
+
"ol",
|
|
30
|
+
]
|
|
13
31
|
|
|
14
|
-
const VARIANT_CLASSES = <string[]>[
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
]
|
|
32
|
+
export const VARIANT_CLASSES = <string[]>[
|
|
33
|
+
"full",
|
|
34
|
+
"full-start",
|
|
35
|
+
"full-end",
|
|
36
|
+
"popout",
|
|
37
|
+
"popout-start",
|
|
38
|
+
"popout-end",
|
|
39
|
+
"content",
|
|
40
|
+
"content-start",
|
|
41
|
+
"content-end",
|
|
42
|
+
"inset-content",
|
|
43
|
+
"inset-content-start",
|
|
44
|
+
"inset-content-end",
|
|
45
|
+
"full-width",
|
|
46
|
+
"full-content",
|
|
47
|
+
"full-content-nopad",
|
|
48
|
+
"full-content",
|
|
49
|
+
]
|
|
32
50
|
</script>
|
|
33
51
|
|
|
34
52
|
<script setup lang="ts">
|
|
35
53
|
const props = defineProps({
|
|
36
54
|
dataTestid: {
|
|
37
55
|
type: String,
|
|
38
|
-
default:
|
|
56
|
+
default: "layout-row",
|
|
39
57
|
},
|
|
40
58
|
tag: {
|
|
41
59
|
type: String,
|
|
42
|
-
default:
|
|
60
|
+
default: "div",
|
|
43
61
|
validator(value: string) {
|
|
44
|
-
return TAGS_ALLOWED.includes(value)
|
|
62
|
+
return TAGS_ALLOWED.includes(value)
|
|
45
63
|
},
|
|
46
64
|
},
|
|
47
65
|
variant: {
|
|
48
66
|
type: String,
|
|
49
67
|
required: true,
|
|
50
68
|
validator(value: string) {
|
|
51
|
-
return VARIANT_CLASSES.includes(value)
|
|
69
|
+
return VARIANT_CLASSES.includes(value)
|
|
52
70
|
},
|
|
53
71
|
},
|
|
54
72
|
id: {
|
|
@@ -63,9 +81,9 @@ const props = defineProps({
|
|
|
63
81
|
type: Boolean,
|
|
64
82
|
default: false,
|
|
65
83
|
},
|
|
66
|
-
})
|
|
84
|
+
})
|
|
67
85
|
|
|
68
|
-
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
86
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
69
87
|
</script>
|
|
70
88
|
|
|
71
89
|
<style lang="css">
|
|
@@ -384,17 +384,8 @@ const initMainNavigationState = () => {
|
|
|
384
384
|
})
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
if (navigationInitialized.value && navLoaded.value) {
|
|
390
|
-
return
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
await initTemplateRefs().then(() => {
|
|
394
|
-
navLoaded.value = true
|
|
395
|
-
navigationInitialized.value = true
|
|
396
|
-
})
|
|
397
|
-
|
|
387
|
+
// Function to set up click outside listeners
|
|
388
|
+
const setupClickOutsideListeners = () => {
|
|
398
389
|
navigationDetailsRefs.value?.forEach((element, index) => {
|
|
399
390
|
onClickOutside(element, () => {
|
|
400
391
|
navigationDetailsRefs.value?.[index]?.removeAttribute("open")
|
|
@@ -405,6 +396,23 @@ onMounted(async () => {
|
|
|
405
396
|
onClickOutside(overflowDetailsRef.value, () => {
|
|
406
397
|
overflowDetailsRef.value?.removeAttribute("open")
|
|
407
398
|
})
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
onMounted(async () => {
|
|
402
|
+
// If navigation is already initialized and loaded, skip the template refs setup
|
|
403
|
+
if (navigationInitialized.value && navLoaded.value) {
|
|
404
|
+
// But still set up click outside listeners as DOM elements may have changed
|
|
405
|
+
await nextTick()
|
|
406
|
+
setupClickOutsideListeners()
|
|
407
|
+
return
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
await initTemplateRefs().then(() => {
|
|
411
|
+
navLoaded.value = true
|
|
412
|
+
navigationInitialized.value = true
|
|
413
|
+
})
|
|
414
|
+
|
|
415
|
+
setupClickOutsideListeners()
|
|
408
416
|
})
|
|
409
417
|
|
|
410
418
|
useResizeObserver(navigationWrapperRef, async () => {
|
package/nuxt.config.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export default defineNuxtConfig({
|
|
3
3
|
devtools: { enabled: true },
|
|
4
4
|
// css: ["modern-normalize", "./app/assets/styles/main.css"],
|
|
5
|
-
modules: ["@nuxt/eslint", "@nuxt/icon", "@nuxt/image"],
|
|
5
|
+
modules: ["@nuxt/eslint", "@nuxt/icon", "@nuxt/image", "@nuxtjs/i18n"],
|
|
6
6
|
app: {
|
|
7
7
|
head: {
|
|
8
8
|
htmlAttrs: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "srcdev-nuxt-components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.1.
|
|
4
|
+
"version": "6.1.9",
|
|
5
5
|
"main": "nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"typescript": "5.9.2"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"@nuxtjs/i18n": "^10.0.6",
|
|
39
40
|
"focus-trap-vue": "4.0.3"
|
|
40
41
|
},
|
|
41
42
|
"release-it": {
|