@salesforcedevs/dx-components 1.31.0 → 1.32.0-alpha.2
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/LICENSE +12 -0
- package/lwc.config.json +1 -0
- package/package.json +3 -2
- package/src/modules/dx/dropdownOption/dropdownOption.css +13 -8
- package/src/modules/dx/searchResults/searchResults.css +105 -6
- package/src/modules/dx/searchResults/searchResults.html +87 -91
- package/src/modules/dx/searchResults/searchResults.ts +174 -477
- package/src/modules/dx/sidebar/sidebar.css +1 -0
- package/src/modules/dx/sidebar/sidebar.html +1 -5
- package/src/modules/dx/sidebar/sidebar.ts +7 -7
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +159 -343
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.css +41 -21
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.ts +12 -4
- package/src/modules/dxUtils/data360Search/data360Search.ts +168 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2020, Salesforce.com, Inc.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
|
|
8
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0-alpha.2",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -43,5 +43,6 @@
|
|
|
43
43
|
"eventsourcemock": "2.0.0",
|
|
44
44
|
"luxon": "3.4.4",
|
|
45
45
|
"msw": "^2.12.4"
|
|
46
|
-
}
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "f42dc4194e762fe78415b45c729e966c0a680f8d"
|
|
47
48
|
}
|
|
@@ -31,14 +31,7 @@
|
|
|
31
31
|
transition: var(--dx-g-transition-hue-1x);
|
|
32
32
|
align-items: center;
|
|
33
33
|
outline: none !important;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.option:focus {
|
|
37
|
-
box-shadow: inset 0 0 0 1px var(--dx-g-blue-vibrant-50);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.option:active {
|
|
41
|
-
background: var(--dx-g-cloud-blue-vibrant-95) !important;
|
|
34
|
+
background: white;
|
|
42
35
|
}
|
|
43
36
|
|
|
44
37
|
.option:not(.option-active):hover {
|
|
@@ -51,6 +44,18 @@
|
|
|
51
44
|
background: var(--dx-g-cloud-blue-vibrant-95);
|
|
52
45
|
}
|
|
53
46
|
|
|
47
|
+
.option:focus {
|
|
48
|
+
box-shadow: 0 0 0 2px var(--dx-g-blue-vibrant-50);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.option-active:focus {
|
|
52
|
+
box-shadow: 0 0 0 2px var(--dx-g-blue-vibrant-50);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.option:active {
|
|
56
|
+
background: var(--dx-g-cloud-blue-vibrant-95) !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
54
59
|
.option_details {
|
|
55
60
|
display: flex;
|
|
56
61
|
flex-direction: column;
|
|
@@ -248,7 +248,7 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
|
|
|
248
248
|
|
|
249
249
|
.coveo-pager-list-item {
|
|
250
250
|
border: none;
|
|
251
|
-
border-radius:
|
|
251
|
+
border-radius: var(--dx-g-spacing-xs);
|
|
252
252
|
display: inline-flex;
|
|
253
253
|
align-items: center;
|
|
254
254
|
justify-content: center;
|
|
@@ -282,13 +282,62 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
|
|
|
282
282
|
border-right: none;
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
/* List item states: same padding in all states so text never moves. Ring 8px from text on sides, more on top/bottom. */
|
|
285
286
|
.dx-result {
|
|
287
|
+
--dx-result-inner-gap-x: var(
|
|
288
|
+
--dx-g-spacing-sm
|
|
289
|
+
); /* 8px between text and ring on sides */
|
|
290
|
+
|
|
291
|
+
--dx-result-inner-gap-y: var(
|
|
292
|
+
--dx-g-spacing-xs
|
|
293
|
+
); /* ring closer to card edge so more padding inside box top/bottom */
|
|
294
|
+
|
|
295
|
+
position: relative;
|
|
286
296
|
background: white;
|
|
287
|
-
border-radius:
|
|
297
|
+
border-radius: var(--dx-g-spacing-md);
|
|
288
298
|
border: 1px solid rgb(24 24 24 / 4%);
|
|
289
299
|
box-shadow: 0 0 2px 0 rgb(24 24 24 / 8%), 0 2px 4px 1px rgb(24 24 24 / 16%);
|
|
290
|
-
padding:
|
|
291
|
-
margin-bottom: var(--dx-g-spacing-
|
|
300
|
+
padding: var(--dx-g-spacing-md);
|
|
301
|
+
margin-bottom: var(--dx-g-spacing-md);
|
|
302
|
+
transition: background-color 0.1s ease;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/* Hover: same shape as focus box, more padding top/bottom inside box; space between results unchanged */
|
|
306
|
+
.dx-result:hover::after {
|
|
307
|
+
content: "";
|
|
308
|
+
position: absolute;
|
|
309
|
+
top: var(--dx-result-inner-gap-y);
|
|
310
|
+
bottom: var(--dx-result-inner-gap-y);
|
|
311
|
+
left: var(--dx-result-inner-gap-x);
|
|
312
|
+
right: var(--dx-result-inner-gap-x);
|
|
313
|
+
background: var(--dx-g-gray-95);
|
|
314
|
+
border-radius: var(--dx-g-spacing-xs);
|
|
315
|
+
pointer-events: none;
|
|
316
|
+
z-index: 0;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.dx-result > * {
|
|
320
|
+
position: relative;
|
|
321
|
+
z-index: 1;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/* Focus: ring 8px from text via pseudo-element; no padding/layout change */
|
|
325
|
+
.dx-result:focus-within {
|
|
326
|
+
outline: none;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/* Pseudo: 8px from text on sides, more padding top/bottom inside ring (smaller inset y) */
|
|
330
|
+
.dx-result:focus-within::before {
|
|
331
|
+
content: "";
|
|
332
|
+
position: absolute;
|
|
333
|
+
top: var(--dx-result-inner-gap-y);
|
|
334
|
+
bottom: var(--dx-result-inner-gap-y);
|
|
335
|
+
left: var(--dx-result-inner-gap-x);
|
|
336
|
+
right: var(--dx-result-inner-gap-x);
|
|
337
|
+
border: 2px solid var(--dx-g-blue-vibrant-50);
|
|
338
|
+
border-radius: var(--dx-g-spacing-xs);
|
|
339
|
+
pointer-events: none;
|
|
340
|
+
z-index: 2;
|
|
292
341
|
}
|
|
293
342
|
|
|
294
343
|
.dx-result-title {
|
|
@@ -322,10 +371,59 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
|
|
|
322
371
|
color: white;
|
|
323
372
|
}
|
|
324
373
|
|
|
325
|
-
.dx-search-header + .
|
|
374
|
+
.dx-search-header + .dx-search-main {
|
|
326
375
|
margin-top: var(--dx-g-spacing-2xl);
|
|
327
376
|
}
|
|
328
377
|
|
|
378
|
+
.dx-search-results {
|
|
379
|
+
font-family: var(--dx-g-font-sans);
|
|
380
|
+
background-color: #fafaf9;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.dx-search-main {
|
|
384
|
+
max-width: 1200px;
|
|
385
|
+
margin: 0 auto;
|
|
386
|
+
padding: 0 var(--dx-g-spacing-xl);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.dx-search-box-row {
|
|
390
|
+
margin-bottom: var(--dx-g-spacing-lg);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.dx-search-box-row .dx-search-box {
|
|
394
|
+
max-width: 400px;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.dx-search-loading {
|
|
398
|
+
padding: var(--dx-g-spacing-2xl);
|
|
399
|
+
text-align: center;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.dx-search-loading-image {
|
|
403
|
+
max-width: 200px;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.dx-search-no-results {
|
|
407
|
+
display: flex;
|
|
408
|
+
justify-content: center;
|
|
409
|
+
gap: 90px;
|
|
410
|
+
margin: 50px 34px 90px;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.dx-search-no-results-info {
|
|
414
|
+
text-align: left;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.dx-search-no-results-info > ul {
|
|
418
|
+
list-style-type: disc;
|
|
419
|
+
list-style-position: inside;
|
|
420
|
+
font-size: var(--dx-g-text-xs);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.dx-search-result-list {
|
|
424
|
+
padding-bottom: var(--dx-g-spacing-2xl);
|
|
425
|
+
}
|
|
426
|
+
|
|
329
427
|
.dx-search-header-container {
|
|
330
428
|
margin: 0 auto;
|
|
331
429
|
max-width: 1200px;
|
|
@@ -498,7 +596,8 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
|
|
|
498
596
|
}
|
|
499
597
|
|
|
500
598
|
@media screen and (max-width: 768px) {
|
|
501
|
-
.no-results > img
|
|
599
|
+
.no-results > img,
|
|
600
|
+
.dx-search-no-results > img {
|
|
502
601
|
display: none;
|
|
503
602
|
}
|
|
504
603
|
}
|
|
@@ -1,106 +1,102 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
class="CoveoSearchInterface"
|
|
5
|
-
data-enable-history="true"
|
|
6
|
-
data-pipeline={coveoSearchPipeline}
|
|
7
|
-
>
|
|
8
|
-
<div
|
|
9
|
-
class="CoveoAnalytics"
|
|
10
|
-
data-search-hub="salesforcedevdoc"
|
|
11
|
-
data-endpoint={coveoAnalyticsEndpoint}
|
|
12
|
-
></div>
|
|
13
|
-
<div if:true={hasQuery} class="dx-search-header">
|
|
2
|
+
<div id="search" class="dx-search-results">
|
|
3
|
+
<div lwc:if={hasQuery} class="dx-search-header">
|
|
14
4
|
<div class="dx-search-header-container">
|
|
15
5
|
<p class="dx-search-header-title">
|
|
16
|
-
<span class="dx-search-header-title-results">
|
|
6
|
+
<span class="dx-search-header-title-results">
|
|
7
|
+
{resultCountLabel}
|
|
8
|
+
</span>
|
|
17
9
|
results for
|
|
18
10
|
</p>
|
|
19
11
|
<p class="dx-search-header-query">“{query}”</p>
|
|
20
12
|
</div>
|
|
21
13
|
</div>
|
|
22
|
-
<div class="
|
|
23
|
-
<div class="
|
|
24
|
-
<div class="dx-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
14
|
+
<div class="dx-search-main">
|
|
15
|
+
<div class="dx-search-results-column">
|
|
16
|
+
<div class="dx-search-box-row">
|
|
17
|
+
<dx-input
|
|
18
|
+
class="dx-search-box"
|
|
19
|
+
type="search"
|
|
20
|
+
placeholder="Search"
|
|
21
|
+
role="search"
|
|
22
|
+
aria-label="Search"
|
|
23
|
+
icon-symbol="search"
|
|
24
|
+
size="small"
|
|
25
|
+
value={query}
|
|
26
|
+
onchange={onSearchInputChange}
|
|
27
|
+
clearable
|
|
28
|
+
></dx-input>
|
|
31
29
|
</div>
|
|
32
|
-
<div
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
data-title="Content Type"
|
|
39
|
-
data-field="@commonsource"
|
|
40
|
-
data-tab="All"
|
|
41
|
-
data-enable-facet-search="false"
|
|
42
|
-
></div>
|
|
43
|
-
<div
|
|
44
|
-
class="CoveoDynamicFacet"
|
|
45
|
-
data-title="Language"
|
|
46
|
-
data-field="@language"
|
|
47
|
-
data-tab="All"
|
|
48
|
-
data-enable-facet-search="false"
|
|
49
|
-
></div>
|
|
30
|
+
<div lwc:if={isLoading} class="dx-search-loading">
|
|
31
|
+
<img
|
|
32
|
+
class="dx-search-loading-image"
|
|
33
|
+
src="https://a.sfdcstatic.com/developer-website/prod/images/sidebar-loading.svg"
|
|
34
|
+
alt="Loading"
|
|
35
|
+
/>
|
|
50
36
|
</div>
|
|
51
|
-
<
|
|
52
|
-
<dx-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
37
|
+
<template lwc:if={showNoResults}>
|
|
38
|
+
<div class="dx-search-no-results">
|
|
39
|
+
<img
|
|
40
|
+
src="https://a.sfdcstatic.com/developer-website/prod/images/binary-cloud-circle-small.svg"
|
|
41
|
+
alt=""
|
|
42
|
+
/>
|
|
43
|
+
<div class="dx-search-no-results-info">
|
|
44
|
+
<p class="dx-text-display-8">
|
|
45
|
+
Sorry, no results were found for your search
|
|
46
|
+
“{query}”
|
|
47
|
+
</p>
|
|
48
|
+
<p class="dx-text-display-8 tip">Search Tips:</p>
|
|
49
|
+
<ul class="tip-list">
|
|
50
|
+
<li>Please consider misspellings</li>
|
|
51
|
+
<li>Try different search keywords</li>
|
|
52
|
+
</ul>
|
|
53
|
+
<p class="dx-text-display-8 tip tbc-container">
|
|
54
|
+
Still not finding what you're looking for?
|
|
55
|
+
Consider asking in the
|
|
56
|
+
<a
|
|
57
|
+
class="link"
|
|
58
|
+
href="https://trailhead.salesforce.com/trailblazer-community/feed"
|
|
59
|
+
>
|
|
60
|
+
Trailblazer Community
|
|
61
|
+
</a>
|
|
62
|
+
!
|
|
63
|
+
</p>
|
|
64
|
+
</div>
|
|
73
65
|
</div>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
66
|
+
</template>
|
|
67
|
+
<template lwc:if={hasResults}>
|
|
68
|
+
<div class="dx-search-result-list">
|
|
69
|
+
<template
|
|
70
|
+
for:each={results}
|
|
71
|
+
for:item="result"
|
|
72
|
+
for:index="index"
|
|
73
|
+
>
|
|
74
|
+
<div
|
|
75
|
+
key={result.uniqueId}
|
|
76
|
+
class="dx-result"
|
|
77
|
+
data-result-id={result.uniqueId}
|
|
78
|
+
>
|
|
79
|
+
<a
|
|
80
|
+
href={result.href}
|
|
81
|
+
class="dx-result-title"
|
|
82
|
+
target={result.openInNewTab}
|
|
83
|
+
rel={result.rel}
|
|
84
|
+
data-index={result.resultIndex}
|
|
85
|
+
data-title={result.title}
|
|
86
|
+
onclick={onSearchResultClick}
|
|
87
|
+
>
|
|
88
|
+
{result.title}
|
|
89
|
+
</a>
|
|
90
|
+
<p
|
|
91
|
+
lwc:if={result.matchedText}
|
|
92
|
+
class="dx-result-excerpt"
|
|
93
|
+
>
|
|
94
|
+
{result.matchedText}
|
|
95
|
+
</p>
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
81
98
|
</div>
|
|
82
|
-
</
|
|
83
|
-
<div class="CoveoBreadcrumb"></div>
|
|
84
|
-
<div class="CoveoHiddenQuery"></div>
|
|
85
|
-
<div class="CoveoErrorReport"></div>
|
|
86
|
-
<div
|
|
87
|
-
class="CoveoResultList"
|
|
88
|
-
data-layout="list"
|
|
89
|
-
data-wait-animation="fade"
|
|
90
|
-
data-auto-select-fields-to-include="true"
|
|
91
|
-
lwc:dom="manual"
|
|
92
|
-
></div>
|
|
93
|
-
<div class="coveo-results-footer" aria-hidden="true">
|
|
94
|
-
<div class="CoveoPager"></div>
|
|
95
|
-
</div>
|
|
96
|
-
<div class="pagination-container">
|
|
97
|
-
<dx-pagination
|
|
98
|
-
current-page={currentPage}
|
|
99
|
-
total-pages={totalPages}
|
|
100
|
-
onpagechange={goToPage}
|
|
101
|
-
pages-to-show="5"
|
|
102
|
-
></dx-pagination>
|
|
103
|
-
</div>
|
|
99
|
+
</template>
|
|
104
100
|
</div>
|
|
105
101
|
</div>
|
|
106
102
|
</div>
|