@salesforcedevs/dx-components 0.30.0 → 0.31.0-alpha.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.
- package/lwc.config.json +5 -1
- package/package.json +4 -4
- package/src/assets/svg/no-results-combined.svg +80 -0
- package/src/modules/dx/button/button.css +4 -0
- package/src/modules/dx/cardExpanded/cardExpanded.css +2 -1
- package/src/modules/dx/cardExpanded/cardExpanded.html +1 -2
- package/src/modules/dx/cardExpanded/cardExpanded.ts +0 -1
- package/src/modules/dx/checkbox/checkbox.ts +1 -0
- package/src/modules/dx/checkboxNative/checkboxNative.css +21 -0
- package/src/modules/dx/checkboxNative/checkboxNative.html +14 -0
- package/src/modules/dx/checkboxNative/checkboxNative.ts +38 -0
- package/src/modules/dx/contentArchive/contentArchive.css +246 -0
- package/src/modules/dx/contentArchive/contentArchive.html +336 -0
- package/src/modules/dx/contentArchive/contentArchive.ts +444 -0
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.html +33 -31
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +1 -0
- package/src/modules/dx/filterMenu/filterMenu.css +106 -0
- package/src/modules/dx/filterMenu/filterMenu.html +107 -0
- package/src/modules/dx/filterMenu/filterMenu.ts +104 -0
- package/src/modules/dx/modalDrawer/modalDrawer.css +1 -0
- package/src/modules/dx/spinner/spinner.css +0 -7
- package/src/modules/dx/topics/topics.css +1 -0
- package/src/modules/utils/contentArchive/altData.js +3 -0
- package/src/modules/utils/contentArchive/contentArchive.ts +163 -0
- package/LICENSE +0 -12
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<dx-featured-content-header
|
|
3
|
+
class="documentation_header"
|
|
4
|
+
title="Content Archive"
|
|
5
|
+
dark="true"
|
|
6
|
+
no-swoop={isMobile}
|
|
7
|
+
></dx-featured-content-header>
|
|
8
|
+
<div class="container">
|
|
9
|
+
<template if:true={isMobile}>
|
|
10
|
+
<dx-modal-drawer open={modalOpen} onclickclose={toggleModal}>
|
|
11
|
+
<img
|
|
12
|
+
if:true={filtersLoading}
|
|
13
|
+
src="/assets/svg/sidebar-loading.svg"
|
|
14
|
+
alt="loading"
|
|
15
|
+
class="modal-loading"
|
|
16
|
+
/>
|
|
17
|
+
<template if:false={filtersLoading}>
|
|
18
|
+
<div class="filter-header-container">
|
|
19
|
+
<p class="filter-title">Filters</p>
|
|
20
|
+
<button
|
|
21
|
+
onclick={handleFilterClear}
|
|
22
|
+
class="filter-clear-btn"
|
|
23
|
+
>
|
|
24
|
+
Clear all
|
|
25
|
+
</button>
|
|
26
|
+
</div>
|
|
27
|
+
<dx-filter-menu
|
|
28
|
+
name="site"
|
|
29
|
+
title={contentTypeTitle}
|
|
30
|
+
options={contentTypeList}
|
|
31
|
+
onchange={updateSelectedFilters}
|
|
32
|
+
></dx-filter-menu>
|
|
33
|
+
<dx-filter-menu
|
|
34
|
+
name="dates"
|
|
35
|
+
title={dateTitle}
|
|
36
|
+
options={dateList}
|
|
37
|
+
variant="nested"
|
|
38
|
+
onchange={updateSelectedFilters}
|
|
39
|
+
></dx-filter-menu>
|
|
40
|
+
<template if:false={hideBlogFilters}>
|
|
41
|
+
<dx-filter-menu
|
|
42
|
+
name="authors"
|
|
43
|
+
title={authorTitle}
|
|
44
|
+
options={authorList}
|
|
45
|
+
onchange={updateSelectedFilters}
|
|
46
|
+
></dx-filter-menu>
|
|
47
|
+
</template>
|
|
48
|
+
<dx-filter-menu
|
|
49
|
+
name="categories"
|
|
50
|
+
title={categoryTitle}
|
|
51
|
+
options={categoryList}
|
|
52
|
+
onchange={updateSelectedFilters}
|
|
53
|
+
></dx-filter-menu>
|
|
54
|
+
</template>
|
|
55
|
+
</dx-modal-drawer>
|
|
56
|
+
</template>
|
|
57
|
+
<div class="filter-container">
|
|
58
|
+
<template if:false={isMobile}>
|
|
59
|
+
<img
|
|
60
|
+
if:true={filtersLoading}
|
|
61
|
+
src="/assets/svg/sidebar-loading.svg"
|
|
62
|
+
alt="loading"
|
|
63
|
+
/>
|
|
64
|
+
<template if:false={filtersLoading}>
|
|
65
|
+
<div class="filter-header-container">
|
|
66
|
+
<p class="filter-title">Filters</p>
|
|
67
|
+
<button
|
|
68
|
+
onclick={handleFilterClear}
|
|
69
|
+
class="filter-clear-btn"
|
|
70
|
+
>
|
|
71
|
+
Clear all
|
|
72
|
+
</button>
|
|
73
|
+
</div>
|
|
74
|
+
<dx-filter-menu
|
|
75
|
+
name="site"
|
|
76
|
+
title={contentTypeTitle}
|
|
77
|
+
options={contentTypeList}
|
|
78
|
+
onchange={updateSelectedFilters}
|
|
79
|
+
></dx-filter-menu>
|
|
80
|
+
<dx-filter-menu
|
|
81
|
+
name="dates"
|
|
82
|
+
title={dateTitle}
|
|
83
|
+
options={dateList}
|
|
84
|
+
variant="nested"
|
|
85
|
+
onchange={updateSelectedFilters}
|
|
86
|
+
></dx-filter-menu>
|
|
87
|
+
<template if:false={hideBlogFilters}>
|
|
88
|
+
<dx-filter-menu
|
|
89
|
+
name="authors"
|
|
90
|
+
title={authorTitle}
|
|
91
|
+
options={authorList}
|
|
92
|
+
onchange={updateSelectedFilters}
|
|
93
|
+
></dx-filter-menu>
|
|
94
|
+
</template>
|
|
95
|
+
<dx-filter-menu
|
|
96
|
+
name="categories"
|
|
97
|
+
title={categoryTitle}
|
|
98
|
+
options={categoryList}
|
|
99
|
+
onchange={updateSelectedFilters}
|
|
100
|
+
></dx-filter-menu>
|
|
101
|
+
</template>
|
|
102
|
+
</template>
|
|
103
|
+
<template if:true={isMobile}>
|
|
104
|
+
<div class="content-info-container">
|
|
105
|
+
<button class="filter-content" onclick={toggleModal}>
|
|
106
|
+
Filter
|
|
107
|
+
<span>
|
|
108
|
+
<dx-icon
|
|
109
|
+
class="filter-icon"
|
|
110
|
+
symbol="filter"
|
|
111
|
+
sprite="action"
|
|
112
|
+
size="small"
|
|
113
|
+
></dx-icon>
|
|
114
|
+
</span>
|
|
115
|
+
</button>
|
|
116
|
+
<div class="card-type-group">
|
|
117
|
+
<button
|
|
118
|
+
onclick={handleCardTypeChange}
|
|
119
|
+
value="expanded"
|
|
120
|
+
class={expandedCardClass}
|
|
121
|
+
>
|
|
122
|
+
Expanded
|
|
123
|
+
</button>
|
|
124
|
+
<button
|
|
125
|
+
onclick={handleCardTypeChange}
|
|
126
|
+
value="minimal"
|
|
127
|
+
class={minimalCardClass}
|
|
128
|
+
>
|
|
129
|
+
Minimal
|
|
130
|
+
</button>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</template>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="content-container">
|
|
136
|
+
<div class="content-info-container">
|
|
137
|
+
<p class="content-page-length">{currentPageLength}</p>
|
|
138
|
+
<template if:false={isMobile}>
|
|
139
|
+
<div class="card-type-group">
|
|
140
|
+
<button
|
|
141
|
+
onclick={handleCardTypeChange}
|
|
142
|
+
value="expanded"
|
|
143
|
+
class={expandedCardClass}
|
|
144
|
+
>
|
|
145
|
+
Expanded
|
|
146
|
+
</button>
|
|
147
|
+
<button
|
|
148
|
+
onclick={handleCardTypeChange}
|
|
149
|
+
value="minimal"
|
|
150
|
+
class={minimalCardClass}
|
|
151
|
+
>
|
|
152
|
+
Minimal
|
|
153
|
+
</button>
|
|
154
|
+
</div>
|
|
155
|
+
</template>
|
|
156
|
+
</div>
|
|
157
|
+
<div class="filter-chips-container">
|
|
158
|
+
<template if:true={selectedFilterMenuData.site.length}>
|
|
159
|
+
<div class="chip-item-container">
|
|
160
|
+
<p class="chip-title">Type</p>
|
|
161
|
+
<template
|
|
162
|
+
for:each={selectedFilterMenuData.site}
|
|
163
|
+
for:item="postType"
|
|
164
|
+
>
|
|
165
|
+
<span class="chip-item" key={postType.name}>
|
|
166
|
+
{postType.name}
|
|
167
|
+
<dx-button
|
|
168
|
+
name="site"
|
|
169
|
+
value={postType}
|
|
170
|
+
onclick={removeFilterItem}
|
|
171
|
+
variant="inline"
|
|
172
|
+
>
|
|
173
|
+
✕
|
|
174
|
+
</dx-button>
|
|
175
|
+
</span>
|
|
176
|
+
</template>
|
|
177
|
+
</div>
|
|
178
|
+
</template>
|
|
179
|
+
<template if:true={selectedFilterMenuData.dates.length}>
|
|
180
|
+
<div class="chip-item-container">
|
|
181
|
+
<p class="chip-title">Date</p>
|
|
182
|
+
<template
|
|
183
|
+
for:each={selectedFilterMenuData.dates}
|
|
184
|
+
for:item="date"
|
|
185
|
+
>
|
|
186
|
+
<span class="chip-item" key={date}>
|
|
187
|
+
{date.name}
|
|
188
|
+
<dx-button
|
|
189
|
+
name="dates"
|
|
190
|
+
onclick={removeFilterItem}
|
|
191
|
+
value={date}
|
|
192
|
+
variant="inline"
|
|
193
|
+
>
|
|
194
|
+
✕
|
|
195
|
+
</dx-button>
|
|
196
|
+
</span>
|
|
197
|
+
</template>
|
|
198
|
+
</div>
|
|
199
|
+
</template>
|
|
200
|
+
<template if:true={selectedFilterMenuData.authors.length}>
|
|
201
|
+
<div class="chip-item-container">
|
|
202
|
+
<p class="chip-title">Author</p>
|
|
203
|
+
<template
|
|
204
|
+
for:each={selectedFilterMenuData.authors}
|
|
205
|
+
for:item="author"
|
|
206
|
+
>
|
|
207
|
+
<span class="chip-item" key={author.name}>
|
|
208
|
+
{author.name}
|
|
209
|
+
<dx-button
|
|
210
|
+
name="authors"
|
|
211
|
+
value={author}
|
|
212
|
+
onclick={removeFilterItem}
|
|
213
|
+
variant="inline"
|
|
214
|
+
>
|
|
215
|
+
✕
|
|
216
|
+
</dx-button>
|
|
217
|
+
</span>
|
|
218
|
+
</template>
|
|
219
|
+
</div>
|
|
220
|
+
</template>
|
|
221
|
+
<template if:true={selectedFilterMenuData.categories.length}>
|
|
222
|
+
<div class="chip-item-container">
|
|
223
|
+
<p class="chip-title">Category</p>
|
|
224
|
+
<template
|
|
225
|
+
for:each={selectedFilterMenuData.categories}
|
|
226
|
+
for:item="category"
|
|
227
|
+
>
|
|
228
|
+
<span class="chip-item" key={category.name}>
|
|
229
|
+
{category.name}
|
|
230
|
+
<dx-button
|
|
231
|
+
name="categories"
|
|
232
|
+
value={category}
|
|
233
|
+
onclick={removeFilterItem}
|
|
234
|
+
variant="inline"
|
|
235
|
+
>
|
|
236
|
+
✕
|
|
237
|
+
</dx-button>
|
|
238
|
+
</span>
|
|
239
|
+
</template>
|
|
240
|
+
</div>
|
|
241
|
+
</template>
|
|
242
|
+
</div>
|
|
243
|
+
<h3 class="results-heading" if:false={loading}>{resultsHeading}</h3>
|
|
244
|
+
<hr />
|
|
245
|
+
<template if:true={loading}>
|
|
246
|
+
<template if:false={modalOpen}>
|
|
247
|
+
<div class="spinner-container">
|
|
248
|
+
<dx-spinner
|
|
249
|
+
size={spinnerSize}
|
|
250
|
+
variant="brand"
|
|
251
|
+
></dx-spinner>
|
|
252
|
+
</div>
|
|
253
|
+
</template>
|
|
254
|
+
</template>
|
|
255
|
+
<template if:false={loading}>
|
|
256
|
+
<template if:false={isEmptyState}>
|
|
257
|
+
<template if:true={isMinimalCard}>
|
|
258
|
+
<template
|
|
259
|
+
for:each={postsByMonth}
|
|
260
|
+
for:item="postByMonth"
|
|
261
|
+
>
|
|
262
|
+
<template iterator:it={postByMonth}>
|
|
263
|
+
<h3
|
|
264
|
+
key={it.value}
|
|
265
|
+
class="posts-month"
|
|
266
|
+
if:true={it.first}
|
|
267
|
+
>
|
|
268
|
+
{it.value}
|
|
269
|
+
</h3>
|
|
270
|
+
<template
|
|
271
|
+
if:false={it.first}
|
|
272
|
+
for:each={it.value}
|
|
273
|
+
for:item="post"
|
|
274
|
+
>
|
|
275
|
+
<dx-card-minimal
|
|
276
|
+
key={post.id}
|
|
277
|
+
content-type={post.contentType}
|
|
278
|
+
title={post.title}
|
|
279
|
+
href={post.href}
|
|
280
|
+
></dx-card-minimal>
|
|
281
|
+
</template>
|
|
282
|
+
</template>
|
|
283
|
+
</template>
|
|
284
|
+
</template>
|
|
285
|
+
<template for:each={posts} for:item="post">
|
|
286
|
+
<template if:false={isMinimalCard}>
|
|
287
|
+
<template if:true={post.author}>
|
|
288
|
+
<dx-card-expanded
|
|
289
|
+
key={post.id}
|
|
290
|
+
title={post.title}
|
|
291
|
+
content-type={post.contentType}
|
|
292
|
+
href={post.href}
|
|
293
|
+
date={post.date}
|
|
294
|
+
body={post.excerpt}
|
|
295
|
+
author-img-src={post.authorImgSrc}
|
|
296
|
+
author-label={post.author.name}
|
|
297
|
+
topics={post.topics}
|
|
298
|
+
length={post.duration}
|
|
299
|
+
></dx-card-expanded>
|
|
300
|
+
</template>
|
|
301
|
+
<template if:false={post.author}>
|
|
302
|
+
<dx-card-expanded
|
|
303
|
+
key={post.id}
|
|
304
|
+
title={post.title}
|
|
305
|
+
content-type={post.contentType}
|
|
306
|
+
href={post.href}
|
|
307
|
+
date={post.date}
|
|
308
|
+
body={post.excerpt}
|
|
309
|
+
topics={post.topics}
|
|
310
|
+
length={post.duration}
|
|
311
|
+
></dx-card-expanded>
|
|
312
|
+
</template>
|
|
313
|
+
</template>
|
|
314
|
+
</template>
|
|
315
|
+
<template if:true={showPagination}>
|
|
316
|
+
<div class="pagination-container">
|
|
317
|
+
<dx-pagination
|
|
318
|
+
current-page={currentPage}
|
|
319
|
+
total-pages={totalPages}
|
|
320
|
+
onpagechange={goToPage}
|
|
321
|
+
pages-to-show="5"
|
|
322
|
+
></dx-pagination>
|
|
323
|
+
</div>
|
|
324
|
+
</template>
|
|
325
|
+
</template>
|
|
326
|
+
</template>
|
|
327
|
+
<template if:true={isEmptyState}>
|
|
328
|
+
<div class="empty-state-container">
|
|
329
|
+
<p class="empty-state-text">
|
|
330
|
+
Please try a different filter selection.
|
|
331
|
+
</p>
|
|
332
|
+
</div>
|
|
333
|
+
</template>
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
</template>
|