@asd20/ui 3.2.858 → 3.2.860
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/package.json +1 -1
- package/src/components/atoms/Asd20Viewport/index.vue +74 -1
- package/src/components/molecules/Asd20Swiper/index.vue +11 -0
- package/src/components/organisms/Asd20FileList/index.vue +36 -4
- package/src/components/organisms/Asd20LinkList/index.vue +29 -15
- package/src/components/organisms/Asd20List/index.vue +7 -2
- package/src/components/organisms/Asd20PeopleList/index.vue +26 -0
- package/src/components/organisms/Asd20WidgetsSection/index.vue +35 -26
- package/src/mixins/mockPageMixin.js +2 -2
package/package.json
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div>
|
|
3
|
+
<div :class="classes" :style="styles" ref="viewport" @scroll="handleScroll">
|
|
4
|
+
<slot />
|
|
5
|
+
|
|
6
|
+
<!-- CSS-based down arrow (conditionally displayed) -->
|
|
7
|
+
</div>
|
|
8
|
+
<div class="arrow-wrapper">
|
|
9
|
+
<div v-if="showDownArrow" class="down-arrow"></div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
3
12
|
</template>
|
|
4
13
|
|
|
5
14
|
<script>
|
|
@@ -10,6 +19,11 @@ export default {
|
|
|
10
19
|
padded: { type: Boolean, default: false },
|
|
11
20
|
maxHeight: { type: String, default: '' },
|
|
12
21
|
},
|
|
22
|
+
data() {
|
|
23
|
+
return {
|
|
24
|
+
showDownArrow: false, // Track whether the down arrow should be shown
|
|
25
|
+
}
|
|
26
|
+
},
|
|
13
27
|
computed: {
|
|
14
28
|
classes() {
|
|
15
29
|
return {
|
|
@@ -24,23 +38,59 @@ export default {
|
|
|
24
38
|
}
|
|
25
39
|
},
|
|
26
40
|
},
|
|
41
|
+
mounted() {
|
|
42
|
+
this.checkForOverflow()
|
|
43
|
+
window.addEventListener('resize', this.checkForOverflow)
|
|
44
|
+
},
|
|
45
|
+
beforeDestroy() {
|
|
46
|
+
window.removeEventListener('resize', this.checkForOverflow)
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
checkForOverflow() {
|
|
50
|
+
const viewport = this.$refs.viewport
|
|
51
|
+
// Check if content overflows the viewport
|
|
52
|
+
if (viewport.scrollHeight > viewport.clientHeight) {
|
|
53
|
+
this.showDownArrow = true
|
|
54
|
+
// console.log('Show Down Arrow:', this.showDownArrow)
|
|
55
|
+
} else {
|
|
56
|
+
this.showDownArrow = false
|
|
57
|
+
// console.log('Show Down Arrow:', this.showDownArrow)
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
handleScroll() {
|
|
61
|
+
const viewport = this.$refs.viewport
|
|
62
|
+
// Hide the down arrow if the user scrolls to the bottom
|
|
63
|
+
if (
|
|
64
|
+
viewport.scrollTop + viewport.clientHeight >=
|
|
65
|
+
viewport.scrollHeight - 5
|
|
66
|
+
) {
|
|
67
|
+
this.showDownArrow = false
|
|
68
|
+
} else {
|
|
69
|
+
this.showDownArrow = true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
},
|
|
27
73
|
}
|
|
28
74
|
</script>
|
|
29
75
|
|
|
30
76
|
<style lang="scss" scoped>
|
|
31
77
|
@import '../../../design/_mixins.scss';
|
|
32
78
|
@import '../../../design/_variables.scss';
|
|
79
|
+
|
|
33
80
|
.asd20-viewport {
|
|
34
81
|
flex-grow: 1;
|
|
35
82
|
overflow: hidden;
|
|
36
83
|
position: relative;
|
|
84
|
+
|
|
37
85
|
&--scrollable {
|
|
38
86
|
overflow-y: auto;
|
|
39
87
|
-webkit-overflow-scrolling: touch;
|
|
40
88
|
}
|
|
89
|
+
|
|
41
90
|
&--padded {
|
|
42
91
|
padding: space(1);
|
|
43
92
|
}
|
|
93
|
+
|
|
44
94
|
&::-webkit-scrollbar {
|
|
45
95
|
-webkit-appearance: none;
|
|
46
96
|
width: 6px;
|
|
@@ -52,4 +102,27 @@ export default {
|
|
|
52
102
|
margin: 3px;
|
|
53
103
|
}
|
|
54
104
|
}
|
|
105
|
+
/* CSS-based down arrow */
|
|
106
|
+
|
|
107
|
+
.arrow-wrapper {
|
|
108
|
+
position: relative; /* Ensure arrow-wrapper stays relative to the viewport */
|
|
109
|
+
width: 100%; /* Takes up full width of the viewport */
|
|
110
|
+
height: 0; /* No height is required here */
|
|
111
|
+
margin-bottom: space(1);
|
|
112
|
+
}
|
|
113
|
+
.down-arrow {
|
|
114
|
+
position: absolute;
|
|
115
|
+
bottom: -1.5rem;
|
|
116
|
+
left: 50%;
|
|
117
|
+
transform: translateX(-50%);
|
|
118
|
+
width: 0;
|
|
119
|
+
height: 0;
|
|
120
|
+
border-left: 10px solid transparent;
|
|
121
|
+
border-right: 10px solid transparent;
|
|
122
|
+
border-top: 10px solid rgba(0, 0, 0, 0.7); /* Arrow color */
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
z-index: 10;
|
|
125
|
+
transition: opacity 0.3s ease;
|
|
126
|
+
opacity: 0.7;
|
|
127
|
+
}
|
|
55
128
|
</style>
|
|
@@ -112,6 +112,8 @@ export default {
|
|
|
112
112
|
{
|
|
113
113
|
mousewheel: {
|
|
114
114
|
releaseOnEdges: true,
|
|
115
|
+
sensitivity: 0.5,
|
|
116
|
+
forceToAxis: true,
|
|
115
117
|
},
|
|
116
118
|
controller: {
|
|
117
119
|
control: this.controlled,
|
|
@@ -128,6 +130,15 @@ export default {
|
|
|
128
130
|
)
|
|
129
131
|
)
|
|
130
132
|
|
|
133
|
+
// Delay horizontal scrolling and prioritize vertical scrolling
|
|
134
|
+
this.swiper.on('touchMove', event => {
|
|
135
|
+
const { deltaX, deltaY } = event // Track horizontal and vertical scroll movements
|
|
136
|
+
if (Math.abs(deltaY) > Math.abs(deltaX)) {
|
|
137
|
+
// If the vertical scroll is stronger, prevent horizontal scrolling
|
|
138
|
+
event.preventDefault()
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
|
|
131
142
|
this.swiper.on('slideChange', this.onSlideChange)
|
|
132
143
|
|
|
133
144
|
this.$emit('update:swiper', this.swiper)
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
:headline="title"
|
|
9
9
|
:icon="icon"
|
|
10
10
|
:column-width="640"
|
|
11
|
+
ref="listComponent"
|
|
11
12
|
>
|
|
12
13
|
<template v-for="category in categorizedFileItems">
|
|
13
14
|
<asd20-list-category :key="category.name" :label="category.name" />
|
|
@@ -47,11 +48,42 @@ export default {
|
|
|
47
48
|
loadedFiles: [],
|
|
48
49
|
}),
|
|
49
50
|
|
|
51
|
+
watch: {
|
|
52
|
+
files: {
|
|
53
|
+
handler() {
|
|
54
|
+
this.$nextTick(() => {
|
|
55
|
+
// console.log('Change in Files detected:', this.files)
|
|
56
|
+
this.checkForOverflow() // Ensure overflow check happens after file changes
|
|
57
|
+
this.handleResize() // Ensure column resize happens after file changes
|
|
58
|
+
})
|
|
59
|
+
},
|
|
60
|
+
deep: true,
|
|
61
|
+
immediate: true,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
|
|
50
65
|
methods: {
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
|
|
66
|
+
// Expose the checkForOverflow method from the asd20viewport component
|
|
67
|
+
// Expose the handleResize method from the asd20list component
|
|
68
|
+
checkForOverflow() {
|
|
69
|
+
// console.log('attempting to run checkForOverFlow from fileList component')
|
|
70
|
+
|
|
71
|
+
// Access the Asd20Viewport component through Asd20List
|
|
72
|
+
const listComponent = this.$refs.listComponent
|
|
73
|
+
if (listComponent && listComponent.$refs.viewport) {
|
|
74
|
+
// console.log('Calling checkForOverflow on Asd20Viewport')
|
|
75
|
+
listComponent.$refs.viewport.checkForOverflow() // This should call the method in Asd20Viewport
|
|
76
|
+
} else {
|
|
77
|
+
// console.log('Viewport ref not available')
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
handleResize() {
|
|
81
|
+
// console.log('attempting to run handleResize from asd20list component')
|
|
82
|
+
|
|
83
|
+
// Access the Asd20List component
|
|
84
|
+
const listComponent = this.$refs.listComponent
|
|
85
|
+
listComponent.handleResize() // This should call the method in Asd20Viewport
|
|
86
|
+
},
|
|
55
87
|
},
|
|
56
88
|
|
|
57
89
|
computed: {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
:max-height="maxHeight"
|
|
12
12
|
:multi-column="multiColumn"
|
|
13
13
|
:column-width="640"
|
|
14
|
+
ref="listComponent"
|
|
14
15
|
>
|
|
15
16
|
<template v-for="category in categorizedLinkItems">
|
|
16
17
|
<asd20-list-category :key="category.name" :label="category.name" />
|
|
@@ -62,21 +63,34 @@ export default {
|
|
|
62
63
|
return !!this.links.find(l => !!l.imageUrl)
|
|
63
64
|
},
|
|
64
65
|
},
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
watch: {
|
|
67
|
+
// Watch for changes in files
|
|
68
|
+
links: {
|
|
69
|
+
handler() {
|
|
70
|
+
this.$nextTick(() => {
|
|
71
|
+
// console.log('Change in Links detected:', this.links)
|
|
72
|
+
this.checkForOverflow()
|
|
73
|
+
})
|
|
74
|
+
},
|
|
75
|
+
deep: true,
|
|
76
|
+
immediate: true,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
67
79
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
80
|
+
methods: {
|
|
81
|
+
// Expose the checkForOverflow method from the viewport component
|
|
82
|
+
checkForOverflow() {
|
|
83
|
+
// console.log('attempting to run checkForOverFlow from linkList component')
|
|
71
84
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
// Access the Asd20Viewport component through Asd20List
|
|
86
|
+
const listComponent = this.$refs.listComponent
|
|
87
|
+
if (listComponent && listComponent.$refs.viewport) {
|
|
88
|
+
// console.log('Calling checkForOverflow on Asd20Viewport')
|
|
89
|
+
listComponent.$refs.viewport.checkForOverflow() // This should call the method in Asd20Viewport
|
|
90
|
+
} else {
|
|
91
|
+
// console.log('Viewport ref not available')
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
},
|
|
81
95
|
}
|
|
82
|
-
</
|
|
96
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="asd20-list" :class="classes">
|
|
2
|
+
<div class="asd20-list" :class="classes" ref="listComponent">
|
|
3
3
|
<div class="asd20-list__header" v-if="$slots.header || headline">
|
|
4
4
|
<asd20-icon v-if="icon" :name="icon" :size="iconSize" />
|
|
5
5
|
<component
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
></component>
|
|
10
10
|
<slot name="header" />
|
|
11
11
|
</div>
|
|
12
|
-
<asd20-viewport scrollable :max-height="maxHeight">
|
|
12
|
+
<asd20-viewport ref="viewport" scrollable :max-height="maxHeight">
|
|
13
13
|
<div class="asd20-list__items" :style="styles">
|
|
14
14
|
<template v-for="(item, index) in items">
|
|
15
15
|
<asd20-list-category
|
|
@@ -91,6 +91,11 @@ export default {
|
|
|
91
91
|
this.columns = Math.round(this.$el.offsetWidth / this.columnWidth)
|
|
92
92
|
// console.log(this.$el.offsetWidth, this.columnWidth, this.columns)
|
|
93
93
|
},
|
|
94
|
+
checkForOverflow() {
|
|
95
|
+
if (this.$refs.viewport) {
|
|
96
|
+
this.$refs.viewport.checkForOverflow()
|
|
97
|
+
}
|
|
98
|
+
},
|
|
94
99
|
},
|
|
95
100
|
}
|
|
96
101
|
</script>
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
:headline="headline || title"
|
|
9
9
|
:icon="icon"
|
|
10
10
|
:column-width="640"
|
|
11
|
+
ref="listComponent"
|
|
11
12
|
>
|
|
12
13
|
<asd20-list-item
|
|
13
14
|
v-for="(person, index) in mappedPeople"
|
|
@@ -54,6 +55,18 @@ export default {
|
|
|
54
55
|
// loadedPeople: [],
|
|
55
56
|
selectedPerson: null,
|
|
56
57
|
}),
|
|
58
|
+
watch: {
|
|
59
|
+
files: {
|
|
60
|
+
handler() {
|
|
61
|
+
this.$nextTick(() => {
|
|
62
|
+
// console.log('Change in Files detected:', this.files)
|
|
63
|
+
this.checkForOverflow() // Ensure overflow check happens after file changes
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
deep: true,
|
|
67
|
+
immediate: true,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
57
70
|
|
|
58
71
|
methods: {
|
|
59
72
|
// async loadPeople() {
|
|
@@ -74,6 +87,19 @@ export default {
|
|
|
74
87
|
biography: p.biography,
|
|
75
88
|
}
|
|
76
89
|
},
|
|
90
|
+
// Expose the checkForOverflow method from the viewport component
|
|
91
|
+
checkForOverflow() {
|
|
92
|
+
// console.log('attempting to run checkForOverFlow from fileList component')
|
|
93
|
+
|
|
94
|
+
// Access the Asd20Viewport component through Asd20List
|
|
95
|
+
const listComponent = this.$refs.listComponent
|
|
96
|
+
if (listComponent && listComponent.$refs.viewport) {
|
|
97
|
+
// console.log('Calling checkForOverflow on Asd20Viewport')
|
|
98
|
+
listComponent.$refs.viewport.checkForOverflow() // This should call the method in Asd20Viewport
|
|
99
|
+
} else {
|
|
100
|
+
// console.log('Viewport ref not available')
|
|
101
|
+
}
|
|
102
|
+
},
|
|
77
103
|
},
|
|
78
104
|
|
|
79
105
|
computed: {
|
|
@@ -8,14 +8,7 @@
|
|
|
8
8
|
v-if="group"
|
|
9
9
|
:group="group"
|
|
10
10
|
/>
|
|
11
|
-
|
|
12
|
-
class="relatedPeople"
|
|
13
|
-
v-if="peopleFeedProps && people.length > 0 && !noPeople"
|
|
14
|
-
:people="people"
|
|
15
|
-
v-bind="peopleFeedProps"
|
|
16
|
-
:multi-column="full"
|
|
17
|
-
max-height="400px"
|
|
18
|
-
/>
|
|
11
|
+
|
|
19
12
|
<asd20-link-list
|
|
20
13
|
v-if="relatedPages"
|
|
21
14
|
class="relatedPages"
|
|
@@ -24,14 +17,7 @@
|
|
|
24
17
|
:multi-column="full"
|
|
25
18
|
max-height="400px"
|
|
26
19
|
/>
|
|
27
|
-
|
|
28
|
-
v-if="relatedLinks.length > 5"
|
|
29
|
-
class="related-links-wide"
|
|
30
|
-
:links="relatedLinks"
|
|
31
|
-
v-bind="relatedLinksProps"
|
|
32
|
-
:multi-column="full"
|
|
33
|
-
max-height="1500px"
|
|
34
|
-
/> -->
|
|
20
|
+
|
|
35
21
|
<asd20-link-list
|
|
36
22
|
v-if="relatedLinks"
|
|
37
23
|
class="relatedLinks"
|
|
@@ -41,15 +27,32 @@
|
|
|
41
27
|
max-height="400px"
|
|
42
28
|
/>
|
|
43
29
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
v-
|
|
47
|
-
:
|
|
48
|
-
|
|
30
|
+
<asd20-people-list
|
|
31
|
+
class="relatedPeople"
|
|
32
|
+
v-if="peopleFeedProps && people.length > 0 && !noPeople"
|
|
33
|
+
:people="people"
|
|
34
|
+
v-bind="peopleFeedProps"
|
|
35
|
+
:multi-column="full"
|
|
36
|
+
max-height="400px"
|
|
49
37
|
/>
|
|
50
|
-
|
|
38
|
+
<!-- <asd20-link-list
|
|
39
|
+
v-if="relatedLinks.length > 5"
|
|
40
|
+
class="related-links-wide"
|
|
41
|
+
:links="relatedLinks"
|
|
42
|
+
v-bind="relatedLinksProps"
|
|
43
|
+
:multi-column="full"
|
|
44
|
+
max-height="1500px"
|
|
45
|
+
/> -->
|
|
46
|
+
|
|
47
|
+
<!-- <intersect v-if="eventsFeedProps" @enter="$emit('events-in-view')">
|
|
48
|
+
<asd20-event-list
|
|
49
|
+
v-bind="eventsFeedProps"
|
|
50
|
+
:events="events"
|
|
51
|
+
hide-past-events
|
|
52
|
+
/>
|
|
53
|
+
</intersect> -->
|
|
51
54
|
|
|
52
|
-
<intersect v-if="filesFeedProps" @enter="
|
|
55
|
+
<intersect v-if="filesFeedProps" @enter="handleFilesInView">
|
|
53
56
|
<asd20-file-list
|
|
54
57
|
v-if="filesFeedProps && !noFiles"
|
|
55
58
|
class="relatedFiles"
|
|
@@ -116,6 +119,12 @@ export default {
|
|
|
116
119
|
noFiles: { type: Boolean, default: false },
|
|
117
120
|
noPeople: { type: Boolean, default: false },
|
|
118
121
|
},
|
|
122
|
+
|
|
123
|
+
methods: {
|
|
124
|
+
handleFilesInView() {
|
|
125
|
+
this.$emit('files-in-view')
|
|
126
|
+
},
|
|
127
|
+
},
|
|
119
128
|
}
|
|
120
129
|
</script>
|
|
121
130
|
|
|
@@ -178,9 +187,9 @@ export default {
|
|
|
178
187
|
.widgets-wrapper {
|
|
179
188
|
--minimum-column-width: 450px;
|
|
180
189
|
--gutter: #{space(1)};
|
|
181
|
-
&::v-deep .asd20-person-list {
|
|
182
|
-
|
|
183
|
-
}
|
|
190
|
+
// &::v-deep .asd20-person-list {
|
|
191
|
+
// max-width: 50vw;
|
|
192
|
+
// }
|
|
184
193
|
}
|
|
185
194
|
|
|
186
195
|
// .relatedDepartment,
|
|
@@ -25,14 +25,14 @@ export default {
|
|
|
25
25
|
selectedLanguageCode: 'en',
|
|
26
26
|
isAuthenticated: true,
|
|
27
27
|
relatedLinks: [].concat(
|
|
28
|
-
Array(
|
|
28
|
+
Array(6).fill({
|
|
29
29
|
category: 'External',
|
|
30
30
|
source: '',
|
|
31
31
|
url: 'https://external/communications/factsheetsandfaqs-assessment',
|
|
32
32
|
title: 'Colorado State Assessment Process',
|
|
33
33
|
description: 'Assessment information for the state of Colorado.',
|
|
34
34
|
}),
|
|
35
|
-
Array(
|
|
35
|
+
Array(5).fill({
|
|
36
36
|
path: '/internal-page',
|
|
37
37
|
title: 'Ridiculus Tortor Amet',
|
|
38
38
|
metaDescription:
|