@byu-oit/vue-decision-processing-components 8.25.4 → 8.26.0

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.
@@ -61,6 +61,7 @@ export default {
61
61
  accept: 'application/json',
62
62
  'content-type': 'application/json'
63
63
  }
64
+ // This config is hosted in the domain-common-admit-periods repository
64
65
  const url = `https://admit-period-vocab-cdn.ces-admissionssupport-prd.amazon.byu.edu/${this.school}-admit-periods.json`
65
66
  const options = { headers, url }
66
67
  const r = await window.byu.auth.request(options)
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [8.26.0](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.25.4...v8.26.0) (2022-06-03)
6
+
7
+
8
+ ### Features
9
+
10
+ * collapsing DetailsHeader - when scrolling and not mouseover - header collapses to a smaller size. ([05ef93a](https://github.com/byu-oit/vue-decision-processing-components/commit/05ef93aaaee0c05c0a6a1651b72d35f0a7cd2773))
11
+
5
12
  ### [8.25.4](https://github.com/byu-oit/vue-decision-processing-components/compare/v8.25.3...v8.25.4) (2022-06-01)
6
13
 
7
14
 
package/DetailsHeader.vue CHANGED
@@ -14,24 +14,48 @@
14
14
  limitations under the License.
15
15
  -->
16
16
  <template>
17
- <div class="applicant-details">
18
- <div class="star" v-if="!hideStar && appId" :title="userFlag.isActive ? 'Remove from Tracking List' : 'Add to Tracking List'">
19
- <starred-indicator :set="userFlag.isActive" @click="toggleApplicationStar" />
20
- </div>
17
+ <div ref="container" class="header-container bg-secondary text-white" @mouseenter="mouseenter" @mouseleave="mouseleave">
21
18
 
22
- <div class="name">
23
- <slot name="applicantName">
24
- <h2>{{application.applicantName}}</h2>
25
- </slot>
19
+ <transition name="scale">
20
+ <div v-if="compact" class="applicant-details compact" key="compact">
21
+ <div class="star" v-if="!hideStar && appId" :title="userFlag.isActive ? 'Remove from Tracking List' : 'Add to Tracking List'">
22
+ <starred-indicator :set="userFlag.isActive" @click="toggleApplicationStar" />
23
+ </div>
24
+ <div class="name">
25
+ <slot name="applicantNameCompact"></slot>
26
+ </div>
27
+ <div class="applicant">
28
+ <slot name="applicantInfoCompact"></slot>
29
+ </div>
30
+ <div class="additional">
31
+ <slot name="additionalInfoCompact"></slot>
32
+ </div>
33
+ <div class="actions bg-light">
34
+ <slot name="actionsCompact"></slot>
35
+ </div>
26
36
  </div>
27
- <div class="applicant">
28
- <slot name="applicantInfo">
37
+ <div v-else class="applicant-details" key="expanded">
38
+ <div class="star" v-if="!hideStar && appId" :title="userFlag.isActive ? 'Remove from Tracking List' : 'Add to Tracking List'">
39
+ <starred-indicator :set="userFlag.isActive" @click="toggleApplicationStar" />
40
+ </div>
41
+ <div class="name">
42
+ <slot name="applicantName">
43
+ <h2>{{application.applicantName}}</h2>
44
+ </slot>
45
+ </div>
46
+ <div class="applicant">
47
+ <slot name="applicantInfo">
29
48
  <ApplicantInfo/>
30
- </slot>
31
- </div>
32
- <div class="additional">
33
- <slot name="additionalInfo"></slot>
49
+ </slot>
50
+ </div>
51
+ <div class="additional">
52
+ <slot name="additionalInfo"></slot>
53
+ </div>
54
+ <div class="actions bg-light text-body">
55
+ <slot name="actions"></slot>
56
+ </div>
34
57
  </div>
58
+ </transition>
35
59
  </div>
36
60
  </template>
37
61
  <script>
@@ -56,6 +80,12 @@ export default {
56
80
  type: String
57
81
  }
58
82
  },
83
+ data () {
84
+ return {
85
+ compact: false,
86
+ hovering: false
87
+ }
88
+ },
59
89
  computed: {
60
90
  ...mapState({
61
91
  userInfo: 'userInfo',
@@ -81,20 +111,56 @@ export default {
81
111
  flagValue: 'S-' + this.userInfo.byuId,
82
112
  flagState: userFlagSet ? 'clear' : 'set'
83
113
  })
114
+ },
115
+ handleScroll (event) {
116
+ if (!this.hovering) {
117
+ const containerElem = this.$refs.container
118
+ const containerTopY = containerElem.getBoundingClientRect().top
119
+ // Prevent flickering when just over the scroll threshold
120
+ if (this.compact) {
121
+ this.compact = containerTopY < 50
122
+ } else {
123
+ this.compact = containerTopY <= 0
124
+ }
125
+ }
126
+ },
127
+ mouseenter () {
128
+ this.compact = false
129
+ this.hovering = true
130
+ },
131
+ mouseleave (event) {
132
+ this.hovering = false
133
+ this.handleScroll(event)
84
134
  }
85
135
  },
86
- filters: { yearTermFormat }
136
+ filters: { yearTermFormat },
137
+ mounted () {
138
+ window.addEventListener("scroll", this.handleScroll)
139
+ },
140
+ beforeUnmount () {
141
+ window.removeEventListener("scroll", this.handleScroll)
142
+ }
87
143
  }
88
144
  </script>
89
145
  <style scoped>
146
+ .header-container {
147
+ display: grid;
148
+ grid-template-columns: 1fr;
149
+ }
150
+
151
+ .header-container > * {
152
+ grid-column: 1/2;
153
+ grid-row: 1/2;
154
+ }
155
+
90
156
  .applicant-details {
91
157
  display: grid;
92
- grid-template-columns: 3rem 2fr 1fr;
158
+ grid-template-columns: 3rem minmax(40vw, 2fr) minmax(20vw, 1fr) minmax(auto, 30vw);
93
159
  grid-template-rows: repeat(2, auto);
94
160
  grid-column-gap: 0.5rem;
95
161
  grid-template-areas:
96
- "star name additional"
97
- "star applicant additional";
162
+ "star name additional actions"
163
+ "star applicant additional actions";
98
164
  }
99
165
 
100
166
  .star {
@@ -117,4 +183,24 @@ export default {
117
183
  padding: 0.5rem;
118
184
  }
119
185
 
186
+ .actions {
187
+ grid-area: actions;
188
+ padding: 0.5rem;
189
+ }
190
+
191
+ .scale-enter-active,
192
+ .scale-leave-active {
193
+ transition: all 0.25s ease-out;
194
+ }
195
+
196
+ .scale-enter {
197
+ opacity: 0;
198
+ transform: scaleY(0.5) translateY(0.5rem);
199
+ }
200
+
201
+ .scale-leave-to {
202
+ opacity: 0;
203
+ transform: scaleY(0.5) translateY(-0.5rem);
204
+ }
205
+
120
206
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byu-oit/vue-decision-processing-components",
3
- "version": "8.25.4",
3
+ "version": "8.26.0",
4
4
  "description": "Vue components shared between decision processing systems for the CES schools.",
5
5
  "dependencies": {
6
6
  "@fortawesome/fontawesome-free": "^5.15.4",