@asd20/ui 3.2.859 → 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 CHANGED
@@ -5,7 +5,7 @@
5
5
  "*.scss",
6
6
  "*.vue"
7
7
  ],
8
- "version": "3.2.859",
8
+ "version": "3.2.860",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -1,5 +1,14 @@
1
1
  <template>
2
- <div :class="classes" :style="styles"><slot /></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
- // async loadFiles() {
52
- // let { data } = await axios.get(this.url)
53
- // this.loadedFiles = data.value
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
- </script>
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
- <style lang="scss" scoped>
69
- @import '../../../design/_variables.scss';
70
- @import '../../../design/_mixins.scss';
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
- .asd20-link-list.separated {
73
- &::v-deep .asd20-list-item:not(:first-child) {
74
- // border-top: 1px solid rgba(128, 128, 128, 0.125) !important;
75
- // border-top: 1px solid rgba(128, 128, 128, 0.125) !important;
76
- }
77
- &::v-deep .asd20-list-category + .asd20-list-item {
78
- // border-top: none !important;
79
- // border-top: 1px solid rgba(128, 128, 128, 0.125) !important;
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
- </style>
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: {
@@ -52,7 +52,7 @@
52
52
  />
53
53
  </intersect> -->
54
54
 
55
- <intersect v-if="filesFeedProps" @enter="$emit('files-in-view')">
55
+ <intersect v-if="filesFeedProps" @enter="handleFilesInView">
56
56
  <asd20-file-list
57
57
  v-if="filesFeedProps && !noFiles"
58
58
  class="relatedFiles"
@@ -119,6 +119,12 @@ export default {
119
119
  noFiles: { type: Boolean, default: false },
120
120
  noPeople: { type: Boolean, default: false },
121
121
  },
122
+
123
+ methods: {
124
+ handleFilesInView() {
125
+ this.$emit('files-in-view')
126
+ },
127
+ },
122
128
  }
123
129
  </script>
124
130
 
@@ -25,14 +25,14 @@ export default {
25
25
  selectedLanguageCode: 'en',
26
26
  isAuthenticated: true,
27
27
  relatedLinks: [].concat(
28
- Array(3).fill({
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(3).fill({
35
+ Array(5).fill({
36
36
  path: '/internal-page',
37
37
  title: 'Ridiculus Tortor Amet',
38
38
  metaDescription: