@salesforcedevs/arch-components 1.25.1-alpha9 → 1.27.1
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/package.json +3 -2
- package/src/modules/arch/cardNew/cardNew.html +9 -0
- package/src/modules/arch/cardNew/cardNew.ts +25 -18
- package/src/modules/arch/searchList/searchList.html +0 -8
- package/src/modules/arch/summary/summary.css +4 -0
- package/src/modules/arch/summary/summary.html +9 -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/arch-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.1",
|
|
4
4
|
"description": "Architect Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -47,5 +47,6 @@
|
|
|
47
47
|
"volta": {
|
|
48
48
|
"node": "20.19.0",
|
|
49
49
|
"yarn": "1.22.19"
|
|
50
|
-
}
|
|
50
|
+
},
|
|
51
|
+
"gitHead": "ed88ab0b8e50b76396093fe8c28091f3e41973ce"
|
|
51
52
|
}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
header={header}
|
|
18
18
|
href={ctaHref}
|
|
19
19
|
onclick={handleLinkClick}
|
|
20
|
+
target={ctaTarget}
|
|
20
21
|
></dx-card-title>
|
|
21
22
|
<div class="subtitle">{subtitle}</div>
|
|
22
23
|
<dx-button
|
|
@@ -24,8 +25,16 @@
|
|
|
24
25
|
variant="inline"
|
|
25
26
|
href={ctaHref}
|
|
26
27
|
onclick={handleLinkClick}
|
|
28
|
+
target={ctaTarget}
|
|
27
29
|
>
|
|
28
30
|
{ctaTitle}
|
|
31
|
+
<img
|
|
32
|
+
if:true={isExternalHref}
|
|
33
|
+
src="https://a.sfdcstatic.com/developer-website/images/architect/new_window.svg"
|
|
34
|
+
style="display: inline; height: 1rem; margin: 0 0 0 5px"
|
|
35
|
+
alt="Open link in new window"
|
|
36
|
+
aria-label="Open link in new window"
|
|
37
|
+
/>
|
|
29
38
|
</dx-button>
|
|
30
39
|
</div>
|
|
31
40
|
</dx-card-content>
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { api, LightningElement } from "lwc";
|
|
2
|
-
import { track } from
|
|
2
|
+
import { track } from "arch/instrumentation";
|
|
3
3
|
|
|
4
|
-
export type PillPosition =
|
|
4
|
+
export type PillPosition = "top" | "bottom";
|
|
5
5
|
|
|
6
6
|
export default class extends LightningElement {
|
|
7
|
-
@api pill: string =
|
|
8
|
-
@api label: string =
|
|
9
|
-
@api header: string =
|
|
10
|
-
@api subtitle: string =
|
|
11
|
-
@api ctaHref: string =
|
|
12
|
-
@api
|
|
13
|
-
@api
|
|
14
|
-
@api
|
|
7
|
+
@api pill: string = "";
|
|
8
|
+
@api label: string = "";
|
|
9
|
+
@api header: string = "";
|
|
10
|
+
@api subtitle: string = "";
|
|
11
|
+
@api ctaHref: string = "";
|
|
12
|
+
@api ctaTarget: string = "";
|
|
13
|
+
@api ctaTitle: string = "";
|
|
14
|
+
@api imgSrc: string = "";
|
|
15
|
+
@api imgLinkAriaLabel: string = "";
|
|
15
16
|
@api noDisplayedHeader: boolean = false;
|
|
16
17
|
|
|
17
18
|
@api get pillPosition() {
|
|
18
19
|
return this._pillPosition;
|
|
19
20
|
}
|
|
20
21
|
set pillPosition(value: PillPosition) {
|
|
21
|
-
this._pillPosition = value ||
|
|
22
|
+
this._pillPosition = value || "top";
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
private _pillPosition: PillPosition =
|
|
25
|
+
private _pillPosition: PillPosition = "top";
|
|
25
26
|
|
|
26
27
|
private get className() {
|
|
27
28
|
return `body pill-${this.pillPosition}`;
|
|
@@ -31,6 +32,10 @@ export default class extends LightningElement {
|
|
|
31
32
|
return this.header && !this.noDisplayedHeader;
|
|
32
33
|
}
|
|
33
34
|
|
|
35
|
+
private get isExternalHref() {
|
|
36
|
+
return this.ctaTarget === "_blank";
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
private handleImageClick(e: MouseEvent) {
|
|
35
40
|
// FIXME? sendInteractionEventwon't work with custom elements/shadow DOM. Maybe investigate or get rid of this.
|
|
36
41
|
// sendInteractionEvent('Card Image Click', InteractionEventTypes.IMAGE_CLICK, e, e.currentTarget);
|
|
@@ -39,7 +44,7 @@ export default class extends LightningElement {
|
|
|
39
44
|
clickImg: this.imgSrc,
|
|
40
45
|
label: this.label,
|
|
41
46
|
title: this.header,
|
|
42
|
-
subtitle: this.subtitle
|
|
47
|
+
subtitle: this.subtitle
|
|
43
48
|
});
|
|
44
49
|
}
|
|
45
50
|
|
|
@@ -47,20 +52,22 @@ export default class extends LightningElement {
|
|
|
47
52
|
// FIXME? sendInteractionEvent won't work with custom elements/shadow DOM. Maybe investigate or get rid of this.
|
|
48
53
|
// sendInteractionEvent('Card Link Click', InteractionEventTypes.CLICK, e, e.currentTarget);
|
|
49
54
|
const currentTarget = e.currentTarget as HTMLElement;
|
|
50
|
-
const clickText = currentTarget.matches(
|
|
55
|
+
const clickText = currentTarget.matches("dx-card-title")
|
|
56
|
+
? this.header
|
|
57
|
+
: this.ctaTitle;
|
|
51
58
|
this.handleHrefClick(e, {
|
|
52
59
|
clickText,
|
|
53
60
|
clickUrl: this.ctaHref,
|
|
54
61
|
label: this.label,
|
|
55
62
|
title: this.header,
|
|
56
|
-
subtitle: this.subtitle
|
|
63
|
+
subtitle: this.subtitle
|
|
57
64
|
});
|
|
58
65
|
}
|
|
59
66
|
|
|
60
67
|
private handleHrefClick(e: MouseEvent, payload: Record<string, string>) {
|
|
61
68
|
const target = e.currentTarget as HTMLElement;
|
|
62
|
-
track(target,
|
|
63
|
-
...payload
|
|
69
|
+
track(target, "card_clicked", {
|
|
70
|
+
...payload
|
|
64
71
|
});
|
|
65
72
|
}
|
|
66
|
-
}
|
|
73
|
+
}
|
|
@@ -10,14 +10,6 @@
|
|
|
10
10
|
path={result.url}
|
|
11
11
|
title={result.title}
|
|
12
12
|
>
|
|
13
|
-
<dx-icon-badge
|
|
14
|
-
shape="circle"
|
|
15
|
-
class="brand-icon"
|
|
16
|
-
sprite="utility"
|
|
17
|
-
symbol="knowledge_base"
|
|
18
|
-
size="large"
|
|
19
|
-
></dx-icon-badge>
|
|
20
|
-
|
|
21
13
|
<div slot="pretitle"></div>
|
|
22
14
|
<span slot="meta-right"></span>
|
|
23
15
|
<span slot="meta-left">{result.description}</span>
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="summary" data-display={displayMode}>
|
|
3
|
+
<dx-icon-badge
|
|
4
|
+
shape="circle"
|
|
5
|
+
class="brand-icon"
|
|
6
|
+
sprite="utility"
|
|
7
|
+
symbol="knowledge_base"
|
|
8
|
+
size="large"
|
|
9
|
+
></dx-icon-badge>
|
|
10
|
+
|
|
3
11
|
<div class="header">
|
|
4
12
|
<div class="image">
|
|
5
13
|
<slot name="image" onslotchange={onSlotChange}></slot>
|
|
@@ -10,6 +18,7 @@
|
|
|
10
18
|
</div>
|
|
11
19
|
</template>
|
|
12
20
|
</div>
|
|
21
|
+
|
|
13
22
|
<div class="body">
|
|
14
23
|
<div class="content">
|
|
15
24
|
<div class="content-start">
|