@asd20/ui 3.2.974 → 3.2.976
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/Asd20Checkbox/index.vue +23 -5
- package/src/components/molecules/Asd20ListItem/index.vue +23 -0
- package/src/components/organisms/Asd20SiteNavigation/index.vue +2 -0
- package/src/components/organisms/Asd20SiteSearch/index.vue +43 -15
- package/src/helpers/mapPagesToListItems.js +3 -0
package/package.json
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
`asd20-checkbox-${
|
|
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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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="
|
|
14
|
+
v-model="excludeDistrictResults"
|
|
15
15
|
id="checkbox-id-search"
|
|
16
|
-
|
|
17
|
-
|
|
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" />
|
|
@@ -40,6 +34,7 @@
|
|
|
40
34
|
<asd20-list-item
|
|
41
35
|
v-for="item in pageListItems"
|
|
42
36
|
:key="item.page.id"
|
|
37
|
+
:attribution="organization.id !== '26eaf390-d8ab-11e9-a3a8-5de5bba4f125' && !excludeDistrictResults"
|
|
43
38
|
v-bind="item"
|
|
44
39
|
/>
|
|
45
40
|
</asd20-list>
|
|
@@ -139,7 +134,7 @@ export default {
|
|
|
139
134
|
'includeDistrictSearchResults',
|
|
140
135
|
{
|
|
141
136
|
type: Boolean,
|
|
142
|
-
default:
|
|
137
|
+
default: true,
|
|
143
138
|
},
|
|
144
139
|
'search'
|
|
145
140
|
),
|
|
@@ -161,7 +156,8 @@ export default {
|
|
|
161
156
|
|
|
162
157
|
props: {
|
|
163
158
|
active: { type: Boolean, default: false },
|
|
164
|
-
|
|
159
|
+
organization: {type: Object, default: {title: "Academy District 20"} },
|
|
160
|
+
organizationOptions: { type: Array, default: () => [] },
|
|
165
161
|
},
|
|
166
162
|
|
|
167
163
|
data: () => ({
|
|
@@ -178,7 +174,31 @@ export default {
|
|
|
178
174
|
|
|
179
175
|
computed: {
|
|
180
176
|
pageListItems() {
|
|
181
|
-
return Array.isArray(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
|
+
: []
|
|
182
202
|
},
|
|
183
203
|
fileListItems() {
|
|
184
204
|
return Array.isArray(this._files) ? mapFilesToListItems(this._files) : []
|
|
@@ -204,6 +224,14 @@ export default {
|
|
|
204
224
|
return false
|
|
205
225
|
// return true
|
|
206
226
|
},
|
|
227
|
+
excludeDistrictResults: {
|
|
228
|
+
get() {
|
|
229
|
+
return !this._includeDistrictSearchResults
|
|
230
|
+
},
|
|
231
|
+
set(val) {
|
|
232
|
+
this._includeDistrictSearchResults = !val
|
|
233
|
+
}
|
|
234
|
+
},
|
|
207
235
|
},
|
|
208
236
|
|
|
209
237
|
watch: {
|
|
@@ -319,9 +347,9 @@ export default {
|
|
|
319
347
|
}
|
|
320
348
|
}
|
|
321
349
|
::v-deep .asd20-checkbox {
|
|
322
|
-
justify-content: flex-
|
|
350
|
+
justify-content: flex-start;
|
|
323
351
|
label {
|
|
324
|
-
padding: space(0.5) space(1);
|
|
352
|
+
padding: space(0.5) space(0.5) space(0.5) space(1.5);
|
|
325
353
|
flex-grow: 0;
|
|
326
354
|
}
|
|
327
355
|
}
|