@salesforcedevs/dx-components 1.3.36 → 1.3.37-alpha02

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
@@ -1,42 +1,41 @@
1
1
  {
2
- "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.36",
4
- "description": "DX Lightning web components",
5
- "license": "MIT",
6
- "engines": {
7
- "node": ">= 14.x"
8
- },
9
- "publishConfig": {
10
- "access": "public"
11
- },
12
- "dependencies": {
13
- "@coveo/headless": "^1.32.0",
14
- "@floating-ui/dom": "^1.0.4",
15
- "@sfdocs-internal/wires": "^0.6.3",
16
- "@vimeo/player": "^2.16.4",
17
- "classnames": "^2.2.6",
18
- "coveo-search-ui": "^2.10082.5",
19
- "debounce": "^1.2.0",
20
- "js-cookie": "^3.0.1",
21
- "lodash.defaults": "^4.2.0",
22
- "lodash.get": "^4.4.2",
23
- "lodash.kebabcase": "^4.1.1",
24
- "microtip": "0.2.2",
25
- "salesforce-oauth2": "^0.2.0",
26
- "uuid": "^9.0.0"
27
- },
28
- "devDependencies": {
29
- "@types/classnames": "^2.2.10",
30
- "@types/debounce": "^1.2.0",
31
- "@types/js-cookie": "^3.0.2",
32
- "@types/lodash.defaults": "^4.2.7",
33
- "@types/lodash.get": "^4.4.6",
34
- "@types/lodash.kebabcase": "^4.1.7",
35
- "@types/luxon": "^3.1.0",
36
- "@types/uuid": "^8.3.4",
37
- "@types/vimeo__player": "^2.16.2",
38
- "eventsourcemock": "^2.0.0",
39
- "luxon": "^3.1.0"
40
- },
41
- "gitHead": "83327a09abf6351d1cac3a905c5feb729356507a"
2
+ "name": "@salesforcedevs/dx-components",
3
+ "version": "1.3.37-alpha02",
4
+ "description": "DX Lightning web components",
5
+ "license": "MIT",
6
+ "engines": {
7
+ "node": ">= 14.x"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "dependencies": {
13
+ "@coveo/headless": "^1.32.0",
14
+ "@floating-ui/dom": "^1.0.4",
15
+ "@sfdocs-internal/wires": "^0.6.3",
16
+ "@vimeo/player": "^2.16.4",
17
+ "classnames": "^2.2.6",
18
+ "coveo-search-ui": "^2.10104.0",
19
+ "debounce": "^1.2.0",
20
+ "js-cookie": "^3.0.1",
21
+ "lodash.defaults": "^4.2.0",
22
+ "lodash.get": "^4.4.2",
23
+ "lodash.kebabcase": "^4.1.1",
24
+ "microtip": "0.2.2",
25
+ "salesforce-oauth2": "^0.2.0",
26
+ "uuid": "^9.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "@types/classnames": "^2.2.10",
30
+ "@types/debounce": "^1.2.0",
31
+ "@types/js-cookie": "^3.0.2",
32
+ "@types/lodash.defaults": "^4.2.7",
33
+ "@types/lodash.get": "^4.4.6",
34
+ "@types/lodash.kebabcase": "^4.1.7",
35
+ "@types/luxon": "^3.1.0",
36
+ "@types/uuid": "^8.3.4",
37
+ "@types/vimeo__player": "^2.16.2",
38
+ "eventsourcemock": "^2.0.0",
39
+ "luxon": "^3.1.0"
40
+ }
42
41
  }
@@ -2,6 +2,13 @@
2
2
  @import "dxHelpers/text";
3
3
  @import "dxHelpers/card";
4
4
 
5
+ :host {
6
+ --dx-c-feature-img-padding-top: 0;
7
+ --dx-c-feature-img-padding-right: 0;
8
+ --dx-c-feature-img-padding-left: 0;
9
+ --dx-c-feature-img-padding-bottom: 0;
10
+ }
11
+
5
12
  .dx-card-news {
6
13
  position: relative;
7
14
  display: flex;
@@ -157,3 +164,10 @@ img {
157
164
  max-width: 25%;
158
165
  }
159
166
  }
167
+
168
+ .dx-card-news-img-padding {
169
+ padding: var(--dx-c-feature-img-padding-top)
170
+ var(--dx-c-feature-img-padding-right)
171
+ var(--dx-c-feature-img-padding-bottom)
172
+ var(--dx-c-feature-img-padding-left);
173
+ }
@@ -59,7 +59,8 @@ export default class CardNews extends LightningElement {
59
59
  return cx(
60
60
  this.imgVerticalAlign &&
61
61
  `dx-card-news-img-vertical-align-${this.imgVerticalAlign}`,
62
- this.textContainerWidth === "large" && `dx-card-news-img-small`
62
+ this.textContainerWidth === "large" && `dx-card-news-img-small`,
63
+ `dx-card-news-img-padding`
63
64
  );
64
65
  }
65
66
 
@@ -6,7 +6,12 @@
6
6
  <span if:true={subtitle} class="subtitle dx-text-heading-4b">
7
7
  {subtitle}
8
8
  </span>
9
- <dx-button href={ctaHref} target={ctaTarget} size="large">
9
+ <dx-button
10
+ onclick={onCtaClick}
11
+ href={ctaHref}
12
+ target={ctaTarget}
13
+ size="large"
14
+ >
10
15
  {ctaLabel}
11
16
  </dx-button>
12
17
  </div>
@@ -385,3 +385,8 @@ a.CoveoResultLink,
385
385
  margin: 0 auto;
386
386
  width: fit-content;
387
387
  }
388
+
389
+ dx-type-badge {
390
+ display: block;
391
+ margin-bottom: var(--dx-g-spacing-smd);
392
+ }
@@ -37,6 +37,7 @@ const resultsTemplatesInnerHtml = `
37
37
  data-field-publicurl=""
38
38
  >
39
39
  <div class="dx-result">
40
+ <span class="CoveoFieldValue" data-field="@content_type" data-helper="badge" data-html-value="true"></span>
40
41
  <p class="dx-result-title">
41
42
  <a
42
43
  class="CoveoResultLink"
@@ -52,6 +53,7 @@ const resultsTemplatesInnerHtml = `
52
53
  type="text/html"
53
54
  >
54
55
  <div class="dx-result">
56
+ <span class="CoveoFieldValue" data-field="@content_type" data-helper="badge" data-html-value="true"></span>
55
57
  <p class="dx-result-title">
56
58
  <a class="CoveoResultLink"></a>
57
59
  </p>
@@ -110,9 +112,7 @@ export default class SearchResults extends LightningElement {
110
112
 
111
113
  private goToPage(e: CustomEvent) {
112
114
  const page = e.detail;
113
- const Pager = Coveo.get(
114
- this.root!.querySelector(".CoveoPager") as HTMLElement
115
- ) as any;
115
+ const Pager = Coveo.get(this.root!.querySelector(".CoveoPager") as HTMLElement) as any;
116
116
  Pager.setPage(page);
117
117
  this.currentPage = page;
118
118
  }
@@ -125,23 +125,18 @@ export default class SearchResults extends LightningElement {
125
125
  };
126
126
 
127
127
  private attachListeners(root: HTMLElement) {
128
- Coveo.$$(root).on(
129
- Coveo.InitializationEvents.afterInitialization,
130
- () => {
131
- if (this._query !== "") {
132
- Coveo.state(this.root!, "q", this.searchQuery);
133
- }
134
- if (Coveo.state(this.root!, "q") === "") {
135
- Coveo.state(this.root!, "sort", "date descending");
136
- }
137
- this.isInitialized = true;
128
+ Coveo.$$(root).on(Coveo.InitializationEvents.afterInitialization, () => {
129
+ if (this._query !== "") {
130
+ Coveo.state(this.root!, "q", this.searchQuery);
138
131
  }
139
- );
132
+ if (Coveo.state(this.root!, "q") === "") {
133
+ Coveo.state(this.root!, "sort", "date descending");
134
+ }
135
+ this.isInitialized = true;
136
+ });
140
137
 
141
138
  Coveo.$$(root).on(Coveo.QueryEvents.querySuccess, (event: any) => {
142
- const { currentPage, numberOfPages } = getPaginationState(
143
- event.detail
144
- );
139
+ const { currentPage, numberOfPages } = getPaginationState(event.detail);
145
140
  this.currentPage = currentPage;
146
141
  this.totalPages = numberOfPages;
147
142
  this.totalResults = event.detail.results.totalCount;
@@ -169,6 +164,16 @@ export default class SearchResults extends LightningElement {
169
164
 
170
165
  this.attachListeners(this.root);
171
166
 
167
+ let variantValue = "";
168
+
169
+ Coveo.TemplateHelpers.registerTemplateHelper("badge", (value: string) => {
170
+ variantValue = value;
171
+ });
172
+
173
+ const typeBadgeEl = document.createElement("dx-type-badge");
174
+ typeBadgeEl.setAttribute("variant", variantValue);
175
+ this.template.querySelector(".CoveoFieldValue");
176
+
172
177
  Coveo.init(this.root);
173
178
  }
174
179
 
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.