@salesforcedevs/dx-components 1.3.254 → 1.3.256-canary.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 CHANGED
@@ -5,6 +5,7 @@
5
5
  { "npm": "@salesforcedevs/docs-components" }
6
6
  ],
7
7
  "expose": [
8
+ "dx/agenda",
8
9
  "dx/alert",
9
10
  "dx/audio",
10
11
  "dx/banner",
@@ -14,11 +15,13 @@
14
15
  "dx/buttonToggle",
15
16
  "dx/cardBlogPost",
16
17
  "dx/cardCallout",
18
+ "dx/cardClickthrough",
17
19
  "dx/cardContent",
18
20
  "dx/cardDemo",
19
21
  "dx/cardDocs",
20
22
  "dx/cardEvent",
21
23
  "dx/cardExpanded",
24
+ "dx/cardGrid",
22
25
  "dx/cardGridDocs",
23
26
  "dx/cardMinimal",
24
27
  "dx/cardNews",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.254",
3
+ "version": "1.3.256-canary.0",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -44,6 +44,5 @@
44
44
  },
45
45
  "volta": {
46
46
  "node": "16.19.1"
47
- },
48
- "gitHead": "1b749ae7cd4066e332ed443c23309dddc30dc933"
47
+ }
49
48
  }
@@ -0,0 +1,67 @@
1
+ @import "dxHelpers/reset";
2
+ @import "dxHelpers/text";
3
+
4
+ ul {
5
+ list-style: none;
6
+ }
7
+
8
+ .container {
9
+ max-width: 840px;
10
+ margin: 0 auto;
11
+ }
12
+
13
+ .detail-list-title {
14
+ text-align: center;
15
+ margin-bottom: 60px;
16
+ }
17
+
18
+ .detail-list-content-container {
19
+ position: relative;
20
+ }
21
+
22
+ .detail-list-content {
23
+ background-color: white;
24
+ border-color: rgb(229, 229, 229);
25
+ border-style: solid;
26
+ border-width: 1px;
27
+ border-radius: 16px;
28
+ padding: var(--dx-g-spacing-sm) var(--dx-g-spacing-2xl);
29
+ }
30
+
31
+ .detail-list-item {
32
+ align-items: center;
33
+ display: flex;
34
+ gap: var(--dx-g-spacing-xl);
35
+ padding: var(--dx-g-spacing-xl) 0;
36
+ }
37
+
38
+ .detail-list-item:not(:last-child) {
39
+ border-bottom: 1px solid var(--dx-g-gray-95);
40
+ }
41
+
42
+ .detail-list-item-title {
43
+ flex: 1;
44
+ }
45
+
46
+ .detail-list-item .detail-list-item-detail {
47
+ color: var(--dx-g-blue-vibrant-20);
48
+ display: inline-block;
49
+ font-weight: 700;
50
+ width: 25%;
51
+ }
52
+
53
+ .detail-list-item-detail-right {
54
+ text-align: right;
55
+ }
56
+
57
+ .flourish {
58
+ position: absolute;
59
+ bottom: 0;
60
+ right: 0;
61
+ }
62
+
63
+ @media (max-width: 840px) {
64
+ .flourish {
65
+ display: none;
66
+ }
67
+ }
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <div class="container">
3
+ <h2 class="detail-list-title dx-text-display-4">{title}</h2>
4
+ <div class="detail-list-content-container">
5
+ <ul class="detail-list-content" part="content">
6
+ <template for:each={items} for:item="item">
7
+ <li class="detail-list-item" key={item.title}>
8
+ <span
9
+ lwc:if={item.leftDetail}
10
+ class="detail-list-item-detail detail-list-item-detail-left dx-text-body-3"
11
+ >
12
+ {item.leftDetail}
13
+ </span>
14
+ <span class="detail-list-item-title dx-text-display-7">
15
+ {item.title}
16
+ </span>
17
+ <span
18
+ lwc:if={item.rightDetail}
19
+ class="detail-list-item-detail detail-list-item-detail-right dx-text-body-3"
20
+ >
21
+ {item.rightDetail}
22
+ </span>
23
+ </li>
24
+ </template>
25
+ </ul>
26
+ <img
27
+ lwc:if={flourish}
28
+ class="flourish"
29
+ srcset={flourishSrcSet}
30
+ src={flourish}
31
+ />
32
+ </div>
33
+ </div>
34
+ </template>
@@ -0,0 +1,29 @@
1
+ import { toJson } from "dxUtils/normalizers";
2
+ import { api, LightningElement } from "lwc";
3
+
4
+ export interface AgendaItem {
5
+ body?: string;
6
+ isInitiallyOpen?: boolean;
7
+ leftDetail?: string;
8
+ rightDetail?: string;
9
+ title: string;
10
+ }
11
+
12
+ export default class Agenda extends LightningElement {
13
+ @api title: string = "Agenda";
14
+ @api flourish?: string;
15
+
16
+ @api
17
+ get items() {
18
+ return this._items;
19
+ }
20
+ set items(value: any) {
21
+ this._items = toJson(value);
22
+ }
23
+
24
+ get flourishSrcSet() {
25
+ return `${this.flourish} 2x`; // component expects images @2x
26
+ }
27
+
28
+ private _items: AgendaItem[] = [];
29
+ }
@@ -0,0 +1,69 @@
1
+ @import "dxHelpers/reset";
2
+ @import "dxHelpers/text";
3
+ @import "dxHelpers/card";
4
+
5
+ :host {
6
+ --dx-c-heading-max-lines: 4;
7
+ --dx-c-card-grid-max-width: 60px;
8
+ }
9
+
10
+ .card {
11
+ display: flex;
12
+ flex-direction: column;
13
+ }
14
+
15
+ .not-clickable {
16
+ cursor: default;
17
+ }
18
+
19
+ .image {
20
+ width: 100%;
21
+ height: 160px;
22
+ }
23
+
24
+ .control {
25
+ border-radius: 50%;
26
+ background-color: var(--dx-g-cloud-blue-vibrant-95);
27
+ color: var(--dx-g-blue-vibrant-40);
28
+ width: 48px;
29
+ height: 48px;
30
+ display: flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ position: absolute;
34
+ bottom: 32px;
35
+ right: 20px;
36
+ }
37
+
38
+ /* text section */
39
+
40
+ .card_section-text {
41
+ grid-area: text;
42
+ flex-grow: 1;
43
+ position: relative;
44
+ }
45
+
46
+ .dx-text-display-8 dx-button {
47
+ margin-left: var(--dx-g-spacing-xs);
48
+ }
49
+
50
+ .dx-text-display-6 {
51
+ position: relative;
52
+ -webkit-line-clamp: var(--dx-c-heading-max-lines);
53
+ -webkit-box-orient: vertical;
54
+ display: box;
55
+ overflow: hidden;
56
+ }
57
+
58
+ .dx-text-display-6 dx-icon {
59
+ display: inline-block;
60
+ transform: translateY(-3px);
61
+ }
62
+
63
+ /* mobile responsiveness */
64
+
65
+ @media screen and (max-width: 1024px) {
66
+ .has-image:not(.show-mobile-image) .image {
67
+ display: none;
68
+ }
69
+ }
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <a href={href} class={className} target={target} onclick={handleCardClick}>
3
+ <img
4
+ if:true={imgSrc}
5
+ alt={imgAlt}
6
+ src={imgSrc}
7
+ class="image dx-card-base_image"
8
+ />
9
+ <div
10
+ class="dx-card-base_section-vertical dx-card-base_column card_section-text"
11
+ >
12
+ <span class="dx-text-label-3" part="label">{label}</span>
13
+ <dx-card-title title={title} target={target} onclick={handleLinkClick}></dx-card-title>
14
+ <span lwc:if={body} class="dx-text-body-2" onclick={handleTextClick}>{body}</span>
15
+ <span lwc:if={href} class="control"><dx-icon size="medium" symbol="forward"></dx-icon></span>
16
+ </div>
17
+ </a>
18
+ </template>
@@ -0,0 +1,61 @@
1
+ import { LightningElement, api } from "lwc";
2
+ import cx from "classnames";
3
+ import { track } from "dxUtils/analytics";
4
+
5
+ export default class CardClickthrough extends LightningElement {
6
+ @api body!: string;
7
+ @api href?: string;
8
+ @api imgAlt?: string = "";
9
+ @api imgSrc?: string | null = null;
10
+ @api label!: string;
11
+ @api title!: string;
12
+ @api target?: string | null = null;
13
+ @api showMobileImg?: boolean = false;
14
+
15
+ private get className(): string {
16
+ return cx(
17
+ "card",
18
+ "dx-card-base",
19
+ this.imgSrc && "has-image",
20
+ this.showMobileImg && "show-mobile-image",
21
+ !this.href && "not-clickable" // for "coming soon" cards
22
+ );
23
+ }
24
+
25
+ handleCardClick(evt: Event) {
26
+ if (!this.href) {
27
+ evt.preventDefault();
28
+ return;
29
+ }
30
+ }
31
+
32
+ private handleLinkClick(event: PointerEvent) {
33
+ if (!this.href) {
34
+ return;
35
+ }
36
+ const payloadCardInfo = {
37
+ click_text: this.title,
38
+ element_title: this.title,
39
+ click_url: this.href,
40
+ element_type: "link",
41
+ content_category: "cta"
42
+ };
43
+ track(event.currentTarget!, "custEv_cardClick", payloadCardInfo);
44
+ track(event.currentTarget!, "custEv_linkClick", payloadCardInfo);
45
+ }
46
+
47
+ private handleTextClick(event: PointerEvent) {
48
+ if (!this.href) {
49
+ return;
50
+ }
51
+ const payloadCardTextInfo = {
52
+ click_text: this.body,
53
+ element_title: this.title,
54
+ click_url: `${window.location.origin}${this.href}`,
55
+ element_type: "tile",
56
+ content_category: "cta"
57
+ };
58
+ track(event.currentTarget!, "custEv_ctaTile", payloadCardTextInfo);
59
+ track(event.currentTarget!, "custEv_linkClick", payloadCardTextInfo);
60
+ }
61
+ }
@@ -9,13 +9,13 @@
9
9
  <div
10
10
  class="dx-card-base_section-vertical dx-card-base_column card_section-text"
11
11
  >
12
- <span class="dx-text-label-3">{label}</span>
12
+ <span class="dx-text-label-3" part="label">{label}</span>
13
13
  <dx-card-title
14
14
  title={title}
15
15
  target={target}
16
16
  onclick={handleLinkClick}
17
17
  ></dx-card-title>
18
- <span class="dx-text-body-2" onclick={handleTextClick}>{body}</span>
18
+ <span lwc:if={body} class="dx-text-body-2" onclick={handleTextClick}>{body}</span>
19
19
  </div>
20
20
  <div class="dx-card-base_section-vertical dx-card-base_ctas">
21
21
  <slot onslotchange={onSlotChange}></slot>
@@ -0,0 +1,5 @@
1
+ @media screen and (max-width: 1024px) {
2
+ dx-card-docs {
3
+ --dx-c-body-max-lines: 3;
4
+ }
5
+ }
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <dx-grid columns={numColumns}>
3
+ <template for:each={cards} for:item="card">
4
+ <dx-card-clickthrough
5
+ key={card.title}
6
+ body={card.body}
7
+ href={card.href}
8
+ img-alt={card.imgAlt}
9
+ img-src={card.imgSrc}
10
+ label={card.label}
11
+ title={card.title}
12
+ target={card.target}
13
+ show-mobile-img={card.showMobileImg}
14
+ >
15
+ </dx-card-clickthrough>
16
+ </template>
17
+ </dx-grid>
18
+ </template>
@@ -0,0 +1,18 @@
1
+ import { api, LightningElement } from "lwc";
2
+ import Grid from "dx/grid";
3
+ import { DocsCard } from "typings/custom";
4
+ import { toJson } from "dxUtils/normalizers";
5
+
6
+ export default class CardGrid extends LightningElement {
7
+ private _cards: DocsCard[] = [];
8
+
9
+ @api
10
+ get cards() {
11
+ return this._cards;
12
+ }
13
+ set cards(value: any) {
14
+ this._cards = toJson(value);
15
+ }
16
+
17
+ @api numColumns: Grid['columns'] = "three";
18
+ }
@@ -13,7 +13,7 @@ a {
13
13
  }
14
14
 
15
15
  footer {
16
- padding-top: var(--dx-g-spacing-5xl);
16
+ padding-top: var(--dx-c-footer-padding-top, var(--dx-g-spacing-5xl));
17
17
  }
18
18
 
19
19
  footer.signup-variant-large-signup {
@@ -74,6 +74,10 @@ footer.signup-variant-no-signup {
74
74
  height: 504px;
75
75
  }
76
76
 
77
+ .content-container_top_large_no_signup {
78
+ height: 33vw;
79
+ }
80
+
77
81
  .subscription {
78
82
  position: relative;
79
83
  z-index: 1;
@@ -278,7 +282,7 @@ footer.signup-variant-no-signup {
278
282
  }
279
283
 
280
284
  @media screen and (min-width: 1400px) {
281
- .content-container_top_large {
285
+ .content-container_top_large:not(.content-container_top_large_no_signup) {
282
286
  /* takes into account the background assets' h:w ratio */
283
287
  height: 38vw;
284
288
  }
@@ -301,11 +305,20 @@ footer.signup-variant-no-signup {
301
305
  background-size: 122.92%;
302
306
  }
303
307
 
308
+ .content-container_top_large_no_signup .graphic-large {
309
+ background-size: 101%;
310
+ }
311
+
304
312
  .content-container_top_large {
305
313
  height: 464px;
306
314
  padding-top: var(--dx-g-spacing-2xl);
307
315
  }
308
316
 
317
+ .content-container_top_large_no_signup {
318
+ height: 38vw;
319
+ padding-top: 0;
320
+ }
321
+
309
322
  .subscription h3 {
310
323
  font-size: 24px;
311
324
  line-height: 28px;
@@ -380,6 +393,10 @@ footer.signup-variant-no-signup {
380
393
  padding-bottom: 140px;
381
394
  }
382
395
 
396
+ .content-container_top_large_no_signup {
397
+ height: 44vw;
398
+ }
399
+
383
400
  .graphic-mountains {
384
401
  display: none;
385
402
  }
@@ -33,6 +33,13 @@
33
33
  </dx-button>
34
34
  </div>
35
35
  </div>
36
+ <div
37
+ if:true={showLargeNoSignup}
38
+ class={largeNoSignupClassName}
39
+ >
40
+ <div class="graphic graphic-large" alt=""></div>
41
+ <slot name="custom-content" onslotchange={onSlotChange}></slot>
42
+ </div>
36
43
  <div
37
44
  if:true={showContainerMiddle}
38
45
  class="content-container content-container_middle"
@@ -1,6 +1,10 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import cx from "classnames";
3
- import { FooterVariant, OptionWithLink } from "typings/custom";
3
+ import {
4
+ FooterVariant,
5
+ LightningSlotElement,
6
+ OptionWithLink
7
+ } from "typings/custom";
4
8
  import { toJson } from "dxUtils/normalizers";
5
9
  import {
6
10
  defaultGeneralLinks,
@@ -9,6 +13,7 @@ import {
9
13
  intellectualHref
10
14
  } from "./links";
11
15
  import { track } from "dxUtils/analytics";
16
+ import { isSlotEmpty } from "dxUtils/slot";
12
17
 
13
18
  export default class Footer extends LightningElement {
14
19
  @api locale: string | null = null;
@@ -34,6 +39,7 @@ export default class Footer extends LightningElement {
34
39
  private _locales: OptionWithLink[] | null = null;
35
40
  private _variant: FooterVariant = "small-signup";
36
41
  private intellectualHref = intellectualHref;
42
+ private isSlotEmpty = true;
37
43
  private socialLinks = socialLinks;
38
44
  private termsLinks = termsLinks;
39
45
  private signupPath = "/newsletter";
@@ -64,6 +70,10 @@ export default class Footer extends LightningElement {
64
70
  return this.variant === "small-signup";
65
71
  }
66
72
 
73
+ get showLargeNoSignup() {
74
+ return this.variant === "large-no-signup";
75
+ }
76
+
67
77
  get hasLocales() {
68
78
  return this.locale && this.locales;
69
79
  }
@@ -94,17 +104,31 @@ export default class Footer extends LightningElement {
94
104
  return cx(`signup-variant-${this.variant}`);
95
105
  }
96
106
 
107
+ get largeNoSignupClassName() {
108
+ return cx(
109
+ "content-container",
110
+ "content-container_top_large",
111
+ "content-container_top_large_no_signup",
112
+ !this.isSlotEmpty && "custom-content"
113
+ );
114
+ }
115
+
97
116
  private onLocaleChange(e: CustomEvent) {
98
117
  this.dispatchEvent(
99
118
  new CustomEvent("localechange", { detail: e.detail })
100
119
  );
101
120
  }
102
121
 
122
+ private onSlotChange(e: LightningSlotElement): void {
123
+ this.isSlotEmpty = isSlotEmpty(e);
124
+ }
125
+
103
126
  private isFooterVariant(value: string): value is FooterVariant {
104
127
  return [
105
128
  "no-signup",
106
129
  "small-signup",
107
130
  "large-signup",
131
+ "large-no-signup",
108
132
  "terms-only"
109
133
  ].includes(value);
110
134
  }
@@ -180,6 +180,24 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
180
180
  margin-top: var(--dx-g-spacing-lg);
181
181
  }
182
182
 
183
+ .coveo-query-summary-cancel-last,
184
+ .coveo-query-summary-search-tips-info,
185
+ .CoveoQuerySummary ul {
186
+ display: none;
187
+ }
188
+
189
+ .CoveoSearchInterface .coveo-results-column.coveo-no-results {
190
+ max-width: 100%;
191
+ }
192
+
193
+ .CoveoQuerySummary div {
194
+ margin-bottom: var(--dx-g-spacing-md);
195
+ }
196
+
197
+ .coveo-query-summary-no-results-string {
198
+ color: var(--dx-g-text-heading-color);
199
+ }
200
+
183
201
  .CoveoSort {
184
202
  font-size: var(--dx-g-text-sm);
185
203
  color: var(--dx-g-blue-vibrant-20);
@@ -431,6 +449,10 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
431
449
  font-size: var(--dx-g-text-xs);
432
450
  }
433
451
 
452
+ .no-results-info {
453
+ text-align: left;
454
+ }
455
+
434
456
  .no-results {
435
457
  display: flex;
436
458
  justify-content: center;
@@ -442,6 +464,15 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
442
464
  font-size: var(--dx-g-text-sm);
443
465
  }
444
466
 
467
+ .tip-list {
468
+ padding-bottom: var(--dx-g-spacing-2xl);
469
+ }
470
+
471
+ .tbc-container {
472
+ padding-top: var(--dx-g-spacing-2xl);
473
+ border-top: 1px solid var(--dx-g-gray-80);
474
+ }
475
+
445
476
  .link {
446
477
  color: var(--dx-g-blue-vibrant-50);
447
478
  text-decoration: underline;
@@ -451,10 +482,6 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
451
482
  color: var(--dx-g-blue-vibrant-20);
452
483
  }
453
484
 
454
- .no-results-info > p:first-of-type {
455
- margin-bottom: var(--dx-g-spacing-md);
456
- }
457
-
458
485
  .no-results-info > ul {
459
486
  list-style-type: disc;
460
487
  list-style-position: inside;
@@ -10,129 +10,94 @@
10
10
  <div class="dx-search-header-container">
11
11
  <p class="dx-search-header-title">
12
12
  <span class="dx-search-header-title-results">{title}</span>
13
- &nbsp;
14
- <strong lwc:if={hasNoResults}>0</strong>
15
13
  &nbsp;results for
16
14
  </p>
17
15
  <p class="dx-search-header-query">&ldquo;{query}&rdquo;</p>
18
16
  </div>
19
17
  </div>
20
18
  <div class="coveo-main-section">
21
- <div class="no-results" lwc:if={hasNoResults}>
22
- <img
23
- src="https://a.sfdcstatic.com/developer-website/images/binary-cloud-circle-small.svg"
24
- alt="purple cloud with floating binary numbers above"
25
- />
26
- <div class="no-results-info">
27
- <p class="dx-text-display-8">
28
- Sorry, no results were found for your search
29
- &ldquo;{query}&rdquo;
30
- </p>
31
- <p class="dx-text-display-8 tip">Search Tips:</p>
32
- <ul>
33
- <li>Please consider misspellings</li>
34
- <li>Try different search keywords</li>
35
- </ul>
36
- <dx-hr no-padding="true"></dx-hr>
37
- <p class="dx-text-display-8 tip">
38
- Still not finding what you're looking for? Consider
39
- asking in the&nbsp;
40
- <a
41
- class="link"
42
- href="https://trailhead.salesforce.com/trailblazer-community/feed"
43
- >
44
- Trailblazer Community
45
- </a>
46
- !
47
- </p>
19
+ <div class="coveo-facet-column">
20
+ <div class="dx-facet-column-header">
21
+ <span class="dx-facet-column-header-title">Filters</span>
22
+ <template if:true={hasFilters}>
23
+ <dx-button onclick={clearFilters} variant="inline">
24
+ Clear
25
+ </dx-button>
26
+ </template>
27
+ </div>
28
+ <div
29
+ class="CoveoDynamicFacetManager"
30
+ data-enable-reorder="false"
31
+ >
32
+ <div
33
+ class="CoveoDynamicFacet"
34
+ data-title="Content Type"
35
+ data-field="@commonsource"
36
+ data-tab="All"
37
+ data-enable-facet-search="false"
38
+ ></div>
39
+ <div
40
+ class="CoveoDynamicFacet"
41
+ data-title="Language"
42
+ data-field="@language"
43
+ data-tab="All"
44
+ data-enable-facet-search="false"
45
+ ></div>
46
+ </div>
47
+ <div class="dx-facet-column-footer">
48
+ <dx-button onclick={dismissFiltersOverlay}>
49
+ View {title} results
50
+ </dx-button>
48
51
  </div>
49
52
  </div>
50
- <template lwc:if={hasResults}>
51
- <div class="coveo-facet-column">
52
- <div class="dx-facet-column-header">
53
- <span class="dx-facet-column-header-title">
54
- Filters
55
- </span>
56
- <template if:true={hasFilters}>
57
- <dx-button onclick={clearFilters} variant="inline">
58
- Clear
59
- </dx-button>
60
- </template>
53
+ <div class="coveo-results-column">
54
+ <div class="CoveoShareQuery"></div>
55
+ <div class="CoveoExportToExcel"></div>
56
+ <div class="CoveoPreferencesPanel">
57
+ <div class="CoveoResultsPreferences"></div>
58
+ <div class="CoveoResultsFiltersPreferences"></div>
59
+ </div>
60
+ <div class="CoveoDidYouMean"></div>
61
+ <div class="coveo-results-header">
62
+ <div class="coveo-summary-section"></div>
63
+ <div class="coveo-sort-section" role="radiogroup">
64
+ <span
65
+ class="CoveoSort"
66
+ data-sort-criteria="relevancy"
67
+ data-caption="Sorted by Relevance"
68
+ ></span>
61
69
  </div>
62
- <div
63
- class="CoveoDynamicFacetManager"
64
- data-enable-reorder="false"
65
- >
66
- <div
67
- class="CoveoDynamicFacet"
68
- data-title="Content Type"
69
- data-field="@commonsource"
70
- data-tab="All"
71
- data-enable-facet-search="false"
72
- ></div>
70
+ <div>
73
71
  <div
74
- class="CoveoDynamicFacet"
75
- data-title="Language"
76
- data-field="@language"
77
- data-tab="All"
78
- data-enable-facet-search="false"
72
+ class="CoveoSearchbox"
73
+ data-enable-omnibox="false"
74
+ data-add-search-button="false"
75
+ aria-hidden="true"
79
76
  ></div>
80
77
  </div>
81
- <div class="dx-facet-column-footer">
82
- <dx-button onclick={dismissFiltersOverlay}>
83
- View {title} results
84
- </dx-button>
85
- </div>
86
78
  </div>
87
- <div class="coveo-results-column">
88
- <div class="CoveoShareQuery"></div>
89
- <div class="CoveoExportToExcel"></div>
90
- <div class="CoveoPreferencesPanel">
91
- <div class="CoveoResultsPreferences"></div>
92
- <div class="CoveoResultsFiltersPreferences"></div>
93
- </div>
94
- <div class="CoveoDidYouMean"></div>
95
- <div class="coveo-results-header">
96
- <div class="coveo-summary-section"></div>
97
- <div class="coveo-sort-section" role="radiogroup">
98
- <span
99
- class="CoveoSort"
100
- data-sort-criteria="relevancy"
101
- data-caption="Sorted by Relevance"
102
- ></span>
103
- </div>
104
- <div>
105
- <div
106
- class="CoveoSearchbox"
107
- data-enable-omnibox="false"
108
- data-add-search-button="false"
109
- aria-hidden="true"
110
- ></div>
111
- </div>
112
- </div>
113
- <div class="CoveoBreadcrumb"></div>
114
- <div class="CoveoHiddenQuery"></div>
115
- <div class="CoveoErrorReport"></div>
116
- <div
117
- class="CoveoResultList"
118
- data-layout="list"
119
- data-wait-animation="fade"
120
- data-auto-select-fields-to-include="true"
121
- lwc:dom="manual"
122
- ></div>
123
- <div class="coveo-results-footer" aria-hidden="true">
124
- <div class="CoveoPager"></div>
125
- </div>
126
- <div class="pagination-container">
127
- <dx-pagination
128
- current-page={currentPage}
129
- total-pages={totalPages}
130
- onpagechange={goToPage}
131
- pages-to-show="5"
132
- ></dx-pagination>
133
- </div>
79
+ <div class="CoveoBreadcrumb"></div>
80
+ <div class="CoveoHiddenQuery"></div>
81
+ <div class="CoveoErrorReport"></div>
82
+ <div
83
+ class="CoveoResultList"
84
+ data-layout="list"
85
+ data-wait-animation="fade"
86
+ data-auto-select-fields-to-include="true"
87
+ lwc:dom="manual"
88
+ ></div>
89
+ <div class="coveo-results-footer" aria-hidden="true">
90
+ <div class="CoveoPager"></div>
134
91
  </div>
135
- </template>
92
+ <div class="pagination-container">
93
+ <dx-pagination
94
+ current-page={currentPage}
95
+ total-pages={totalPages}
96
+ onpagechange={goToPage}
97
+ pages-to-show="5"
98
+ ></dx-pagination>
99
+ </div>
100
+ </div>
136
101
  </div>
137
102
  </div>
138
103
  </template>
@@ -42,55 +42,43 @@ function getPaginationState(event: CoveoSDK.IQuerySuccessEventArgs): {
42
42
  }
43
43
 
44
44
  const resultsTemplatesInnerHtml = `
45
- <script
46
- id="myDocumentResultTemplate"
47
- class="result-template"
48
- type="text/underscore"
49
- data-field-publicurl=""
50
- >
51
- <div class="dx-result">
52
- <div class="dx-result-info">
53
- <span class="CoveoFieldValue" data-field="@content_type" data-helper="badge" data-html-value="true"></span>
54
- <% if (!raw.breadcrumbs && !raw.metabreadcrumbs) { %>
55
- <span class="CoveoFieldValue" data-field="@uri" data-helper="uriBreadcrumbs" data-html-value="true"></span>
56
- <% } else { %>
57
- <% if (raw.uri.includes('/references/')) { %>
58
- <span class="CoveoFieldValue" data-field="@metabreadcrumbs" data-helper="metabreadcrumbs" data-html-value="true"></span>
59
- <% } else { %>
60
- <span class="CoveoFieldValue" data-field="@breadcrumbs" data-helper="breadcrumbs" data-html-value="true"></span>
61
- <% } %>
62
- <% } %>
45
+ <div class="coveo-show-if-no-results">
46
+ <div class="no-results">
47
+ <img
48
+ src="https://a.sfdcstatic.com/developer-website/images/binary-cloud-circle-small.svg"
49
+ alt="purple cloud with floating binary numbers above"
50
+ />
51
+ <div class="no-results-info">
52
+ <span class="CoveoQuerySummary dx-text-display-8"
53
+ data-enable-no-results-found-message="true"
54
+ data-no-results-found-message="Sorry, no results were found for your search &ldquo;\${query}&rdquo;">
55
+ </span>
56
+ <p class="dx-text-display-8 tip">Search Tips:</p>
57
+ <ul class="tip-list">
58
+ <li>Please consider misspellings</li>
59
+ <li>Try different search keywords</li>
60
+ </ul>
61
+ <p class="dx-text-display-8 tip tbc-container">
62
+ Still not finding what you're looking for? Consider
63
+ asking in the&nbsp;
64
+ <a
65
+ class="link"
66
+ href="https://trailhead.salesforce.com/trailblazer-community/feed"
67
+ >
68
+ Trailblazer Community
69
+ </a>
70
+ !
71
+ </p>
63
72
  </div>
64
- <a
65
- href="<%= raw.uri %>"
66
- class="dx-result-title CoveoResultLink"
67
- <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
68
- target="_blank"
69
- <% } %>
70
- >
71
- <%= title %>
72
- <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
73
- <svg xmlns="http://www.w3.org/2000/svg" style="display: inline; vertical-align: baseline;" fill="var(--dx-g-blue-vibrant-20)" width="20" height="20" part="svg" aria-hidden="true"><use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#new_window"></use></svg>
74
- <% } %>
75
- </a>
76
- <span class="CoveoFieldValue" data-field="@sflastmodifieddate" data-helper="postedDate" data-html-value="true"></span>
77
- <p class="dx-result-excerpt CoveoExcerpt"></p>
78
- <% if (raw.sfcommentcount || raw.sflikecount) { %>
79
- <div class="post-info-container">
80
- <span class="CoveoFieldValue" data-field="@sfcommentcount" data-helper="replies" data-html-value="true"></span>
81
- <% if (raw.sfcommentcount && raw.sflikecount) { %>
82
- <span>&bull;</span>
83
- <% } %>
84
- <span class="CoveoFieldValue" data-field="@sflikecount" data-helper="likes" data-html-value="true"></span>
85
- </div>
86
- <% } %>
87
- </div>
88
- </script>
89
- <script
90
- id="myDefaultResultTemplate"
91
- class="result-template"
92
- type="text/underscore"
93
- >
73
+ </div>
74
+ </div>
75
+ <div class="coveo-show-if-results">
76
+ <script
77
+ id="myDocumentResultTemplate"
78
+ class="result-template"
79
+ type="text/underscore"
80
+ data-field-publicurl=""
81
+ >
94
82
  <div class="dx-result">
95
83
  <div class="dx-result-info">
96
84
  <span class="CoveoFieldValue" data-field="@content_type" data-helper="badge" data-html-value="true"></span>
@@ -111,11 +99,7 @@ const resultsTemplatesInnerHtml = `
111
99
  target="_blank"
112
100
  <% } %>
113
101
  >
114
- <% if (title) { %>
115
- <%= title %>
116
- <% } else { %>
117
- <%= uri %>
118
- <% } %>
102
+ <%= title %>
119
103
  <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
120
104
  <svg xmlns="http://www.w3.org/2000/svg" style="display: inline; vertical-align: baseline;" fill="var(--dx-g-blue-vibrant-20)" width="20" height="20" part="svg" aria-hidden="true"><use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#new_window"></use></svg>
121
105
  <% } %>
@@ -132,7 +116,55 @@ const resultsTemplatesInnerHtml = `
132
116
  </div>
133
117
  <% } %>
134
118
  </div>
135
- </script>
119
+ </script>
120
+ <script
121
+ id="myDefaultResultTemplate"
122
+ class="result-template"
123
+ type="text/underscore"
124
+ >
125
+ <div class="dx-result">
126
+ <div class="dx-result-info">
127
+ <span class="CoveoFieldValue" data-field="@content_type" data-helper="badge" data-html-value="true"></span>
128
+ <% if (!raw.breadcrumbs && !raw.metabreadcrumbs) { %>
129
+ <span class="CoveoFieldValue" data-field="@uri" data-helper="uriBreadcrumbs" data-html-value="true"></span>
130
+ <% } else { %>
131
+ <% if (raw.uri.includes('/references/')) { %>
132
+ <span class="CoveoFieldValue" data-field="@metabreadcrumbs" data-helper="metabreadcrumbs" data-html-value="true"></span>
133
+ <% } else { %>
134
+ <span class="CoveoFieldValue" data-field="@breadcrumbs" data-helper="breadcrumbs" data-html-value="true"></span>
135
+ <% } %>
136
+ <% } %>
137
+ </div>
138
+ <a
139
+ href="<%= raw.uri %>"
140
+ class="dx-result-title CoveoResultLink"
141
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
142
+ target="_blank"
143
+ <% } %>
144
+ >
145
+ <% if (title) { %>
146
+ <%= title %>
147
+ <% } else { %>
148
+ <%= uri %>
149
+ <% } %>
150
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
151
+ <svg xmlns="http://www.w3.org/2000/svg" style="display: inline; vertical-align: baseline;" fill="var(--dx-g-blue-vibrant-20)" width="20" height="20" part="svg" aria-hidden="true"><use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#new_window"></use></svg>
152
+ <% } %>
153
+ </a>
154
+ <span class="CoveoFieldValue" data-field="@sflastmodifieddate" data-helper="postedDate" data-html-value="true"></span>
155
+ <p class="dx-result-excerpt CoveoExcerpt"></p>
156
+ <% if (raw.sfcommentcount || raw.sflikecount) { %>
157
+ <div class="post-info-container">
158
+ <span class="CoveoFieldValue" data-field="@sfcommentcount" data-helper="replies" data-html-value="true"></span>
159
+ <% if (raw.sfcommentcount && raw.sflikecount) { %>
160
+ <span>&bull;</span>
161
+ <% } %>
162
+ <span class="CoveoFieldValue" data-field="@sflikecount" data-helper="likes" data-html-value="true"></span>
163
+ </div>
164
+ <% } %>
165
+ </div>
166
+ </script>
167
+ </div>
136
168
  `;
137
169
 
138
170
  const isInternalDomain = (domain: string) =>
@@ -316,21 +348,16 @@ export default class SearchResults extends LightningElement {
316
348
  private totalResults: number | null = null;
317
349
 
318
350
  private get title() {
319
- return this.totalResults ? this.totalResults.toLocaleString() : "";
351
+ return this.totalResults ? this.totalResults.toLocaleString() : "0";
320
352
  }
321
353
 
322
354
  private query: string = "";
323
355
  private hasFilters: boolean = false;
324
- private hasResults: boolean = true;
325
356
 
326
357
  private get hasQuery(): boolean {
327
358
  return this.query !== "";
328
359
  }
329
360
 
330
- private get hasNoResults(): boolean {
331
- return this.hasQuery && !this.hasResults;
332
- }
333
-
334
361
  private updateSearchQuery() {
335
362
  Coveo.state(this.root!, "q", this._query);
336
363
  }
@@ -398,12 +425,8 @@ export default class SearchResults extends LightningElement {
398
425
  this.totalPages = numberOfPages;
399
426
  this.totalResults = event.detail.results.totalCount;
400
427
 
401
- if (!this.totalResults) {
402
- this.hasResults = false;
403
- }
404
-
405
428
  this.query = event.detail.query.q ?? "";
406
- this.hasFilters = event.detail.query.facets.some((f: any) => {
429
+ this.hasFilters = event.detail.query?.facets?.some((f: any) => {
407
430
  return f.currentValues.some((cv: any) => {
408
431
  return cv.state === "selected";
409
432
  });
@@ -1,6 +1,7 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import { LightningSlotElement } from "typings/custom";
3
3
  import debounce from "debounce";
4
+ import { isSlotEmpty } from "dxUtils/slot";
4
5
  const MOBILE_SIZE = 640;
5
6
  const getInputSize = () =>
6
7
  (window.innerWidth ||
@@ -30,8 +31,7 @@ export default class SectionSignup extends LightningElement {
30
31
  }
31
32
 
32
33
  private onSlotChange(e: LightningSlotElement) {
33
- // @ts-ignore
34
- this.isSlotEmpty = e.target.assignedElements().length === 0;
34
+ this.isSlotEmpty = isSlotEmpty(e);
35
35
  }
36
36
 
37
37
  private _updateSize = () => {
package/LICENSE DELETED
@@ -1,12 +0,0 @@
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.