@asd20/ui 3.2.973 → 3.2.975

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.973",
8
+ "version": "3.2.975",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -1,9 +1,17 @@
1
1
  <template>
2
- <div :class="{ 'asd20-checkbox__no-icon': !icon }" class="asd20-checkbox">
2
+ <div
3
+ :class="[
4
+ 'asd20-checkbox',
5
+ { 'asd20-checkbox__no-icon': !icon && !checkbox },
6
+ { 'asd20-checkbox__checkbox': !icon && checkbox }
7
+ ]"
8
+ >
3
9
  <input
4
10
  ref="checkbox"
5
11
  :id="id"
6
12
  :checked="value"
13
+ :role="!checkbox ? 'switch' : null"
14
+ :aria-checked="value.toString()"
7
15
  v-bind="$attrs"
8
16
  type="checkbox"
9
17
  @change="toggle"
@@ -29,6 +37,7 @@ export default {
29
37
  description: { type: String, default: '' },
30
38
  count: { type: Number, default: 0 },
31
39
  icon: { type: String, default: '' },
40
+ checkbox: { type: Boolean, default: false }
32
41
  },
33
42
  data() {
34
43
  return {
@@ -37,10 +46,10 @@ export default {
37
46
  },
38
47
  computed: {
39
48
  id() {
40
- return (
41
- `asd20-checkbox-${this.label.replace(/ /gi, '-').toLowerCase()}` ||
42
- `asd20-checkbox-${this._uid}`
43
- )
49
+ const base = this.label?.replace(/ /gi, '-').toLowerCase()
50
+ return base && base.length
51
+ ? `asd20-checkbox-${base}`
52
+ : `asd20-checkbox-${this._uid}`
44
53
  },
45
54
  },
46
55
  methods: {
@@ -142,6 +151,15 @@ export default {
142
151
  transform: translate3d(0, 0, 0);
143
152
  }
144
153
  }
154
+ &.asd20-checkbox__checkbox {
155
+ input {
156
+ position: absolute;
157
+ left: 1rem;
158
+ right: unset;
159
+ opacity: 1;
160
+ }
161
+
162
+ }
145
163
 
146
164
  input:focus + label:after {
147
165
  @include asd20-focus;
@@ -27,7 +27,17 @@
27
27
  <div class="asd20-list-item__content">
28
28
  <div v-if="label" class="asd20-list-item__label">
29
29
  <span v-html="label"></span>
30
+ <div class="asd20-list-item__icon" v-if="logoUrl && attribution">
31
+ <img
32
+ v-if="logoUrl"
33
+ :src="logoUrl"
34
+ alt="Organization Logo"
35
+ style="width: 28px; height: 28px; object-fit: contain"
36
+ />
37
+ <asd20-icon v-else :name="icon" :size="iconSize" />
38
+ </div>
30
39
  <asd20-icon
40
+ v-if="!logoUrl && !attribution"
31
41
  v-show="targetValue === '_blank'"
32
42
  name="external"
33
43
  size="sm"
@@ -39,6 +49,9 @@
39
49
  v-html="description"
40
50
  ></div>
41
51
  <asd20-tag-group v-if="tags && tags.length > 0" :tags="tags" />
52
+ <div v-if="sourceTitle && attribution" class="asd20-list-item__source">
53
+ Source: {{ sourceTitle }}
54
+ </div>
42
55
  <slot name="content" />
43
56
  <slot />
44
57
  </div>
@@ -88,6 +101,9 @@ export default {
88
101
  alignTop: { type: Boolean, default: false },
89
102
  to: { default: '' },
90
103
  link: { type: String, default: '' },
104
+ sourceTitle: { type: String, default: '' },
105
+ logoUrl: { type: String, default: '' },
106
+ attribution: { type: Boolean, default: false },
91
107
  },
92
108
 
93
109
  computed: {
@@ -231,6 +247,13 @@ export default {
231
247
  flex-shrink: 0;
232
248
  flex-grow: 0;
233
249
  }
250
+ &__source {
251
+ font-size: 0.75rem;
252
+ color: var(--color__primary);
253
+ // font-style: italic;
254
+ // color: var(--color__neutral-d40);
255
+ margin-top: space(0.25);
256
+ }
234
257
 
235
258
  &::v-deep .asd20-tag-group {
236
259
  margin-top: space(0.25);
@@ -80,6 +80,8 @@
80
80
  <asd20-site-search
81
81
  v-show="searchOpen"
82
82
  :active="searchOpen"
83
+ :organization="organization"
84
+ :organization-options="organizationOptions"
83
85
  @update:active="$emit('update:searchOpen', $event)"
84
86
  >
85
87
  </asd20-site-search>
@@ -1,4 +1,4 @@
1
- <template>
1
+ \<template>
2
2
  <div
3
3
  ref="container"
4
4
  class="asd20-site-search"
@@ -11,16 +11,10 @@
11
11
  <asd20-search-field idTag="-sitewide" ref="search" v-model="keywords" />
12
12
  <asd20-checkbox
13
13
  v-show="hasParentOrg"
14
- v-model="_includeDistrictSearchResults"
14
+ v-model="excludeDistrictResults"
15
15
  id="checkbox-id-search"
16
- :label="
17
- `Include ${
18
- this._organization &&
19
- this._organization.parentOrganization !== null
20
- ? this._organization.parentOrganization.title
21
- : ''
22
- } Results?`
23
- "
16
+ checkbox
17
+ label="Only show school results"
24
18
  />
25
19
  </div>
26
20
  <asd20-tab-bar :tabs="tabs" @tabClick="onTabClick" />
@@ -39,7 +33,8 @@
39
33
  <asd20-list @click.native="dismiss">
40
34
  <asd20-list-item
41
35
  v-for="item in pageListItems"
42
- :key="item.label"
36
+ :key="item.page.id"
37
+ :attribution="!excludeDistrictResults"
43
38
  v-bind="item"
44
39
  />
45
40
  </asd20-list>
@@ -56,12 +51,14 @@
56
51
  </div>
57
52
  </asd20-viewport>
58
53
  <div class="asd20-site-search__suggested" v-if="_groups.length > 0">
59
- <h3>Suggested Contact:</h3>
54
+ <h3>{{ _groups.length > 1 ? 'Suggested Contacts:' : 'Suggested Contact:' }}</h3>
60
55
  <asd20-list-item
61
56
  v-for="g in _groups"
62
57
  :text-avatar="
63
58
  g.abbreviation ||
64
- (g.shortName || g.title).match(/\b([A-Z])/g).join('')
59
+ ((g.shortName || g.title || '')
60
+ .match(/\b([A-Z])/g) || [])
61
+ .join('')
65
62
  "
66
63
  :key="g.id"
67
64
  :label="`${g.title}`"
@@ -137,7 +134,7 @@ export default {
137
134
  'includeDistrictSearchResults',
138
135
  {
139
136
  type: Boolean,
140
- default: false,
137
+ default: true,
141
138
  },
142
139
  'search'
143
140
  ),
@@ -159,7 +156,8 @@ export default {
159
156
 
160
157
  props: {
161
158
  active: { type: Boolean, default: false },
162
- // organization: {type: Object, default: {title: "Academy District 20"} }
159
+ organization: {type: Object, default: {title: "Academy District 20"} },
160
+ organizationOptions: { type: Array, default: () => [] },
163
161
  },
164
162
 
165
163
  data: () => ({
@@ -176,10 +174,34 @@ export default {
176
174
 
177
175
  computed: {
178
176
  pageListItems() {
179
- return mapPagesToListItems(this._pages)
177
+ return Array.isArray(this._pages)
178
+ ? mapPagesToListItems(this._pages).map(item => {
179
+ const org = this.organizationOptions.find(
180
+ o => o.id === item.page.ownerOrganizationId
181
+ )
182
+
183
+ let sourceTitle = 'Academy District 20'
184
+ let logoUrl = ''
185
+
186
+ if (org) {
187
+ if (org.title) {
188
+ sourceTitle = org.title
189
+ }
190
+ if (org.logoImageUrl) {
191
+ logoUrl = org.logoImageUrl
192
+ }
193
+ }
194
+
195
+ return {
196
+ ...item,
197
+ sourceTitle,
198
+ logoUrl
199
+ }
200
+ })
201
+ : []
180
202
  },
181
203
  fileListItems() {
182
- return mapFilesToListItems(this._files)
204
+ return Array.isArray(this._files) ? mapFilesToListItems(this._files) : []
183
205
  },
184
206
  tabs() {
185
207
  return [
@@ -202,6 +224,14 @@ export default {
202
224
  return false
203
225
  // return true
204
226
  },
227
+ excludeDistrictResults: {
228
+ get() {
229
+ return !this._includeDistrictSearchResults
230
+ },
231
+ set(val) {
232
+ this._includeDistrictSearchResults = !val
233
+ }
234
+ },
205
235
  },
206
236
 
207
237
  watch: {
@@ -307,19 +337,19 @@ export default {
307
337
  flex-grow: 1;
308
338
  }
309
339
  &__suggested {
310
- border-top: 1px solid var(--color__tertiary);
340
+ border-top: 2px solid var(--color__tertiary);
311
341
  background: var(--website-page__alternate-background-t50);
312
- &::v-deep h3 {
313
- font-size: 0.75rem;
314
- font-weight: normal;
342
+ h3 {
343
+ font-size: 1rem;
344
+ font-weight: bold;
315
345
  color: var(--website-card__reverse-background-color);
316
346
  margin: space(0.25) 0 0 space(0.5);
317
347
  }
318
348
  }
319
349
  ::v-deep .asd20-checkbox {
320
- justify-content: flex-end;
350
+ justify-content: flex-start;
321
351
  label {
322
- padding: space(0.5) space(1);
352
+ padding: space(0.5) space(0.5) space(0.5) space(1.5);
323
353
  flex-grow: 0;
324
354
  }
325
355
  }
@@ -32,6 +32,9 @@ export default function mapPagesToListItems(pages) {
32
32
  // icon = 'external'
33
33
  }
34
34
 
35
+ tags = Array.from(new Set(tags))
36
+
37
+
35
38
  return {
36
39
  page: p,
37
40
  label: p.title,