@asd20/ui 3.2.875 → 3.2.877

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.875",
8
+ "version": "3.2.877",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -149,7 +149,7 @@ export default {
149
149
  //remove anchor tags but leave anchor text description
150
150
  .replace(/<a[^>]*>(.*?)<\/a>/g, '$1')
151
151
  // remove other html tags
152
- .replace(/<[^>]+>/g, '')
152
+ // .replace(/<[^>]+>/g, '')
153
153
  return truncate(strippedDescription, { length: 150, separator: /,? +/ })
154
154
  },
155
155
  classes() {
@@ -272,6 +272,9 @@ export default {
272
272
  span {
273
273
  display: block;
274
274
  margin-top: space(0.5);
275
+ &::v-deep li {
276
+ margin-left: 1rem;
277
+ }
275
278
  }
276
279
  }
277
280
 
@@ -330,9 +333,9 @@ export default {
330
333
  font-weight: bold;
331
334
  font-family: var(--website-typography__font-family-headlines);
332
335
  display: flex;
333
- align-items: center;
336
+ align-items: flex-start;
334
337
  margin-top: space(0.5);
335
- margin-bottom: 0;
338
+ margin-bottom: space(0.5);
336
339
  .asd20-icon {
337
340
  --line-color: var(--website-icon__line-color);
338
341
  margin-left: -0.125em;
@@ -55,12 +55,13 @@
55
55
  </template>
56
56
 
57
57
  <script>
58
- import { format, parse } from 'date-fns'
59
58
  import Asd20Modal from '../../molecules/Asd20Modal'
60
59
  import Asd20Tag from '../../atoms/Asd20Tag'
61
60
  import Asd20List from '../../organisms/Asd20List'
62
61
  import Asd20ListItem from '../../molecules/Asd20ListItem'
63
62
  import Asd20Viewport from '../../atoms/Asd20Viewport'
63
+ import formattedTime from '../../../helpers/formatEventTime'
64
+ import truncate from 'lodash-es/truncate'
64
65
 
65
66
  export default {
66
67
  name: 'Asd20EventModal',
@@ -80,42 +81,7 @@ export default {
80
81
  return truncate(this.sanitizedSummary, { length: 75 })
81
82
  },
82
83
  time() {
83
- if (!this.event) return null
84
-
85
- const startTime = parse(
86
- this.event.start,
87
- "yyyy-MM-dd'T'HH:mm:ssX",
88
- new Date()
89
- )
90
- const endTime = parse(
91
- this.event.end,
92
- "yyyy-MM-dd'T'HH:mm:ssX",
93
- new Date()
94
- )
95
-
96
- const startHour = startTime.getHours()
97
- // Display 'TBD' if start time is the same as end time and falls between 11 PM and 3 AM
98
- if (
99
- startTime.getTime() === endTime.getTime() &&
100
- (startHour >= 23 || startHour < 3)
101
- ) {
102
- return 'TBD'
103
- }
104
-
105
- let time = `${format(startTime, '<b>h:mm aa</b>').replace(/:00/g, '')}`
106
-
107
- // Check if end time is the same as start time
108
- if (startTime.getTime() === endTime.getTime()) {
109
- time += '' // No end time needed if they are the same
110
- } else if (this.event.endTimeUndetermined) {
111
- time += `${format(endTime).replace(/:00/g, '')}`
112
- } else {
113
- time += ` - ${format(endTime, '<b>h:mm aa</b>')
114
- .replace(/#/g, '&nbsp;')
115
- .replace(/:00/g, '')}`
116
- }
117
-
118
- return time
84
+ return this.event ? formattedTime(this.event) : null
119
85
  },
120
86
  },
121
87
  methods: {
@@ -241,16 +207,21 @@ export default {
241
207
  }
242
208
  }
243
209
  &__details {
244
- }
245
- .description,
246
- .tags {
247
- display: flex;
248
- max-width: 100%;
249
- padding: space(1);
210
+ .description,
211
+ .tags {
212
+ display: flex;
213
+ max-width: 100%;
214
+ padding: space(1);
250
215
 
251
- * {
252
- margin-right: space(0.125);
253
- margin-bottom: space(0.125);
216
+ * {
217
+ align-items: center;
218
+ }
219
+ &::v-deep ul {
220
+ margin-top: 0;
221
+ }
222
+ &::v-deep li {
223
+ margin-left: 1rem;
224
+ }
254
225
  }
255
226
  }
256
227
  }
@@ -48,13 +48,40 @@
48
48
  "calendarFormat": "ical",
49
49
  "calendarColor": "#213f94"
50
50
  },
51
+ {
52
+ "@search.score": 1,
53
+ "id": null,
54
+ "uid": "MDQwMDAwMDA4MjAwRTAwMDc0QzVCNzEwMUE4MkUwMDgwMDAwMDAwMERFRTE5NzcxNThBQ0RBMDEwMDAwMDAwMDAwMDAwMDAwMTAwMDAwMDBFOEVBMjc5NkM0MDI3RjRGODFFNzY1QzQ0M0VGMDA0Mw==",
55
+ "type": "event",
56
+ "summary": "All State Choir",
57
+ "description": "",
58
+ "location": "Denver Center for the Performing Arts (1101 13th St, Denver, CO 80204, United States)",
59
+ "start": "2023-01-09T17:00:00Z",
60
+ "end": "2023-01-11T17:30:00Z",
61
+ "dtstamp": "2023-01-09T17:00:00Z",
62
+ "class": "",
63
+ "priority": "",
64
+ "transparency": "",
65
+ "status": "",
66
+ "sequence": "",
67
+ "url": null,
68
+ "calendarId": "a0c92470-27a0-11ec-a6e3-c76d885e64a4",
69
+ "calendarName": "Choir",
70
+ "calendarOrganizationId": "bb6e9cd6-da25-9e6f-5e8d-072b9a7df4f0",
71
+ "calendarOrganizationTitle": "Air Academy High School",
72
+ "calendarCategories": [],
73
+ "calendarKeywords": [],
74
+ "calendarUrl": "https://outlook.office365.com/owa/calendar/6a1a45f079b7416f8b301747cd731778@asd20.org/93eb354f1a6b446bb533e2f40613f8a310360980508845501669/calendar.ics",
75
+ "calendarFormat": "ical",
76
+ "calendarColor": "#eb28c7"
77
+ },
51
78
  {
52
79
  "@search.score": 1,
53
80
  "id": null,
54
81
  "uid": "MDQwMDAwMDA4MjAwRTAwMDc0QzVCNzEwMUE4MkUwMDgwMDAwMDAwMDYwMzFGM0FERjUwQkQ5MDEwMDAwMDAwMDAwMDAwMDAwMTAwMDAwMDA1NjA4MzhGNkIzMkU3OTQ1ODk2OUU1RUJDRENBM0U4Rg==",
55
82
  "type": "event",
56
83
  "summary": "First day of second semester",
57
- "description": "<a href='www.asd20.org'>Visit ASD20.org</a> for more information.",
84
+ "description": "<ul><li>In-person attendance is limited to boardroom capacity of 70 audience members per the Colorado Springs Fire Marshall.</li><li>Note, those who attend in person may be captured on camera during the live feed and recorded versions of the meeting.</li><li>The meeting link will be available the week of the meeting.</li></ul><br/>We invite public comment at our meetings.<br/><br/><ul><li>You must sign-up to speak between 7 a.m. and 1 p.m., the day of the board meeting by completing our Public <a href=\"https://forms.office.com/r/4nRw9yhyeS\" target=\"_blank\">Comment Form</a>.</li><li>You must be present and available to speak in-person at the podium when called upon.</li><li>You cannot provide virtual public comment.</li><li>If you cannot attend in-person, we invite you to submit your comments in writing via the Public <a href=\"https://forms.office.com/r/4nRw9yhyeS\" target=\"_blank\">Comment Form</a>. Written comments submitted through the Public Comment Form will not be read publicly at the board meeting, but they will be included as part of the public record in the minutes for the meeting.</li></ul>",
58
85
  "location": "AAHS",
59
86
  "start": "2023-01-05T07:00:00Z",
60
87
  "end": "2023-01-06T07:00:00Z",
@@ -292,4 +319,4 @@
292
319
  "calendarColor": "#213f94"
293
320
  }
294
321
  ]
295
- }
322
+ }
@@ -0,0 +1,47 @@
1
+ import format from 'date-fns/format'
2
+ import parse from 'date-fns/parse'
3
+
4
+ export default function formattedTime(event) {
5
+ if (!event) return
6
+
7
+ if (event.allDay) return 'All Day'
8
+
9
+ if (event.multiDay) {
10
+ return `<b>MultiDay Event:</b><br/>Starts: ${format(
11
+ parse(event.originalStart, "yyyy-MM-dd'T'HH:mm:ssX", new Date()),
12
+ '<b>h:mm aa</b>, ddd, MMM DD, YYYY'
13
+ )
14
+ .replace(/#/g, '&nbsp;')
15
+ .replace(/:00/g, '')}<br>Ends: ${format(
16
+ parse(event.end, "yyyy-MM-dd'T'HH:mm:ssX", new Date()),
17
+ '<b>h:mm aa</b>, ddd, MM DD, YYYY'
18
+ )
19
+ .replace(/#/g, '&nbsp;')
20
+ .replace(/:00/g, '')}`
21
+ }
22
+
23
+ const startTime = parse(event.start, "yyyy-MM-dd'T'HH:mm:ssX", new Date())
24
+ const endTime = parse(event.end, "yyyy-MM-dd'T'HH:mm:ssX", new Date())
25
+ const startHour = startTime.getHours()
26
+
27
+ if (
28
+ startTime.getTime() === endTime.getTime() &&
29
+ (startHour >= 23 || startHour < 3)
30
+ ) {
31
+ return 'TBD'
32
+ }
33
+
34
+ let time = `${format(startTime, '<b>h:mm aa</b>').replace(/:00/g, '')}`
35
+
36
+ if (startTime.getTime() === endTime.getTime()) {
37
+ time += ''
38
+ } else if (event.endTimeUndetermined) {
39
+ time += `${format(endTime).replace(/:00/g, '')}`
40
+ } else {
41
+ time += ` - ${format(endTime, '<b>h:mm aa</b>')
42
+ .replace(/#/g, '&nbsp;')
43
+ .replace(/:00/g, '')}`
44
+ }
45
+
46
+ return time
47
+ }
@@ -1,5 +1,6 @@
1
1
  import format from 'date-fns/format'
2
2
  import parse from 'date-fns/parse'
3
+ import formattedTime from './formatEventTime'
3
4
 
4
5
  // Function to sanitize the summary
5
6
  const sanitizeSummary = summary => {
@@ -35,51 +36,6 @@ const sanitizeDescription = description => {
35
36
  return description
36
37
  }
37
38
 
38
- const formattedTime = event => {
39
- if (!event) return
40
-
41
- if (event.allDay) return 'All Day'
42
-
43
- if (event.multiDay) {
44
- return `${format(
45
- parse(event.originalStart, "yyyy-MM-dd'T'HH:mm:ssX", new Date()),
46
- '<b>h:mm aa</b>, dddd, MMMM dd, yyyy'
47
- )
48
- .replace(/#/g, '&nbsp;')
49
- .replace(/:00/g, '')}<br>ending ${format(
50
- parse(event.end, "yyyy-MM-dd'T'HH:mm:ssX", new Date()),
51
- '<b>h:mm aa</b>, dddd, MMMM dd, yyyy'
52
- )
53
- .replace(/#/g, '&nbsp;')
54
- .replace(/:00/g, '')}`
55
- }
56
-
57
- const startTime = parse(event.start, "yyyy-MM-dd'T'HH:mm:ssX", new Date())
58
- const endTime = parse(event.end, "yyyy-MM-dd'T'HH:mm:ssX", new Date())
59
- const startHour = startTime.getHours()
60
-
61
- if (
62
- startTime.getTime() === endTime.getTime() &&
63
- (startHour >= 23 || startHour < 3)
64
- ) {
65
- return 'TBD'
66
- }
67
-
68
- let time = `${format(startTime, '<b>h:mm aa</b>').replace(/:00/g, '')}`
69
-
70
- if (startTime.getTime() === endTime.getTime()) {
71
- time += ''
72
- } else if (event.endTimeUndetermined) {
73
- time += `${format(endTime).replace(/:00/g, '')}`
74
- } else {
75
- time += ` - ${format(endTime, '<b>h:mm aa</b>')
76
- .replace(/#/g, '&nbsp;')
77
- .replace(/:00/g, '')}`
78
- }
79
-
80
- return time
81
- }
82
-
83
39
  export default function mapEventToCard(event) {
84
40
  const sanitizedSummary = sanitizeSummary(event.summary)
85
41
  const sanitizedDescription = sanitizeDescription(event.description)