@salesforcedevs/dx-components 0.66.2 → 0.70.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 +2 -0
- package/package.json +3 -2
- package/src/modules/dx/banner/banner.ts +3 -5
- package/src/modules/dx/iconBadge/iconBadge.html +2 -7
- package/src/modules/dx/iconBadge/iconBadge.ts +8 -4
- package/src/modules/dx/input/input.css +17 -1
- package/src/modules/dx/input/input.html +5 -1
- package/src/modules/dx/input/input.ts +8 -0
- package/src/modules/dx/searchResults/coveo.css +18989 -0
- package/src/modules/dx/searchResults/searchResults.css +387 -0
- package/src/modules/dx/searchResults/searchResults.html +104 -0
- package/src/modules/dx/searchResults/searchResults.ts +187 -0
- package/src/modules/dxUtils/lwc/lwc.ts +9 -0
package/lwc.config.json
CHANGED
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"dx/popover",
|
|
54
54
|
"dx/radioGroup",
|
|
55
55
|
"dx/relativeDateTime",
|
|
56
|
+
"dx/searchResults",
|
|
56
57
|
"dx/section",
|
|
57
58
|
"dx/sectionSignup",
|
|
58
59
|
"dx/sectionSmall",
|
|
@@ -86,6 +87,7 @@
|
|
|
86
87
|
"dxUtils/dates",
|
|
87
88
|
"dxUtils/highlight",
|
|
88
89
|
"dxUtils/language",
|
|
90
|
+
"dxUtils/lwc",
|
|
89
91
|
"dxUtils/normalizers",
|
|
90
92
|
"dxUtils/queryCoordinator",
|
|
91
93
|
"dxUtils/recentSearches",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.0",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"@sfdocs-internal/wires": "^0.6.3",
|
|
16
16
|
"@vimeo/player": "^2.16.4",
|
|
17
17
|
"classnames": "^2.2.6",
|
|
18
|
+
"coveo-search-ui": "^2.10082.5",
|
|
18
19
|
"debounce": "^1.2.0",
|
|
19
20
|
"lodash.get": "^4.4.2",
|
|
20
21
|
"microtip": "0.2.2"
|
|
@@ -25,5 +26,5 @@
|
|
|
25
26
|
"@types/lodash.get": "^4.4.6",
|
|
26
27
|
"@types/vimeo__player": "^2.16.2"
|
|
27
28
|
},
|
|
28
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "d32440fddef6bfd9f99abb0fe905d2c9cb8ee74e"
|
|
29
30
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
|
+
import { setContainerInnerHtml } from "dxUtils/lwc";
|
|
2
3
|
|
|
3
4
|
export default class Banner extends LightningElement {
|
|
4
5
|
@api bannerMarkup =
|
|
5
6
|
'<span><a href="https://forms.gle/TdSyKFPHXoBx7seM9" target="blank">Share your feedback</a>about our new site.</span>';
|
|
6
7
|
|
|
7
|
-
renderedCallback(){
|
|
8
|
+
renderedCallback() {
|
|
8
9
|
const container = this.template.querySelector(".info-container");
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line @lwc/lwc/no-inner-html
|
|
11
|
-
container.innerHTML = this.bannerMarkup
|
|
12
|
-
}
|
|
10
|
+
setContainerInnerHtml(container, this.bannerMarkup);
|
|
13
11
|
}
|
|
14
12
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class={className} style={style}>
|
|
3
|
-
<dx-icon
|
|
4
|
-
color={color}
|
|
5
|
-
symbol={symbol}
|
|
6
|
-
sprite={sprite}
|
|
7
|
-
size={iconSize}
|
|
8
|
-
></dx-icon>
|
|
2
|
+
<div class={className} style={style} part="badge">
|
|
3
|
+
<dx-icon symbol={symbol} sprite={sprite} size={iconSize}></dx-icon>
|
|
9
4
|
</div>
|
|
10
5
|
</template>
|
|
@@ -40,9 +40,13 @@ export default class IconBadge extends LightningElement {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
get style() {
|
|
43
|
-
|
|
44
|
-
this.
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
const color = this.color
|
|
44
|
+
? `--dx-c-icon-badge-color: ${toDxColor(this.color)};`
|
|
45
|
+
: "";
|
|
46
|
+
const backgroundColor = this.backgroundColor
|
|
47
|
+
? `background-color: ${toDxColor(this.backgroundColor)};`
|
|
48
|
+
: "";
|
|
49
|
+
|
|
50
|
+
return `${color}${backgroundColor}`;
|
|
47
51
|
}
|
|
48
52
|
}
|
|
@@ -133,6 +133,22 @@ input::placeholder {
|
|
|
133
133
|
text-transform: uppercase;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
.description {
|
|
137
|
+
margin-top: var(--dx-g-spacing-xs);
|
|
138
|
+
font-family: var(--dx-g-font-sans);
|
|
139
|
+
font-size: var(--dx-g-text-xs);
|
|
140
|
+
line-height: 18px;
|
|
141
|
+
color: var(--dx-g-gray-50);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.description.hide {
|
|
145
|
+
display: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.description a {
|
|
149
|
+
color: var(--dx-g-blue-vibrant-50);
|
|
150
|
+
}
|
|
151
|
+
|
|
136
152
|
.shortcut > img {
|
|
137
153
|
margin-right: var(--dx-g-spacing-2xs);
|
|
138
154
|
}
|
|
@@ -148,7 +164,7 @@ input::placeholder {
|
|
|
148
164
|
}
|
|
149
165
|
|
|
150
166
|
.error-message-box {
|
|
151
|
-
margin-top: var(--dx-g-spacing-
|
|
167
|
+
margin-top: var(--dx-g-spacing-xs);
|
|
152
168
|
display: block;
|
|
153
169
|
}
|
|
154
170
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<label if:true={label} for="input">
|
|
2
|
+
<label if:true={label} id="label" for="input" tabindex="-1">
|
|
3
3
|
{label}
|
|
4
4
|
<abbr if:true={required}>*</abbr>
|
|
5
5
|
</label>
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
placeholder={placeholder}
|
|
25
25
|
type={type}
|
|
26
26
|
value={value}
|
|
27
|
+
aria-labelledby="label description"
|
|
27
28
|
/>
|
|
28
29
|
<button
|
|
29
30
|
class="clear-button"
|
|
@@ -48,6 +49,9 @@
|
|
|
48
49
|
{submitLabel}
|
|
49
50
|
</dx-button>
|
|
50
51
|
</div>
|
|
52
|
+
<div id="description" class={descriptionClassName} tabindex="-1">
|
|
53
|
+
{description}
|
|
54
|
+
</div>
|
|
51
55
|
<div
|
|
52
56
|
if:true={errorMessage}
|
|
53
57
|
aria-live="assertive"
|
|
@@ -2,6 +2,7 @@ import { LightningElement, api } from "lwc";
|
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { IconSize, IconSymbol } from "typings/custom";
|
|
4
4
|
import { isMac } from "dxUtils/devices";
|
|
5
|
+
import { setContainerInnerHtml } from "dxUtils/lwc";
|
|
5
6
|
import { isValidEmail } from "./validators";
|
|
6
7
|
|
|
7
8
|
type ValidatorMap = {
|
|
@@ -25,6 +26,7 @@ export default class Input extends LightningElement {
|
|
|
25
26
|
@api iconSize: IconSize = "medium";
|
|
26
27
|
@api iconSymbol: IconSymbol | null = null;
|
|
27
28
|
@api label?: string;
|
|
29
|
+
@api descriptionMarkup?: string;
|
|
28
30
|
@api loading: boolean = false;
|
|
29
31
|
@api missingErrorMessage: string = "Complete this field";
|
|
30
32
|
@api formatErrorMessage?: string;
|
|
@@ -118,6 +120,10 @@ export default class Input extends LightningElement {
|
|
|
118
120
|
return cx("input-group", `size-${this.size}`);
|
|
119
121
|
}
|
|
120
122
|
|
|
123
|
+
private get descriptionClassName() {
|
|
124
|
+
return cx("description", !this.descriptionMarkup && "hide");
|
|
125
|
+
}
|
|
126
|
+
|
|
121
127
|
private get inputContainerClassName() {
|
|
122
128
|
return cx(
|
|
123
129
|
"input-container",
|
|
@@ -160,6 +166,8 @@ export default class Input extends LightningElement {
|
|
|
160
166
|
if (!this.input) {
|
|
161
167
|
this.input = <HTMLInputElement>this.template.querySelector("input");
|
|
162
168
|
}
|
|
169
|
+
const container = this.template.querySelector(".description");
|
|
170
|
+
setContainerInnerHtml(container, this.descriptionMarkup);
|
|
163
171
|
}
|
|
164
172
|
|
|
165
173
|
onClick() {
|