@salesforcedevs/dx-components 1.40.1-ver-picker-1 → 1.40.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 +47 -47
- package/src/modules/dx/dropdownOption/dropdownOption.css +2 -14
- package/src/modules/dx/tree/treeHandler.ts +2 -1
- package/src/modules/dx/treeItem/treeItem.ts +21 -0
- package/src/modules/dx/treeTile/treeTile.html +1 -1
- package/src/modules/dx/treeTile/treeTile.ts +22 -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,48 +1,48 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
2
|
+
"name": "@salesforcedevs/dx-components",
|
|
3
|
+
"version": "1.40.1",
|
|
4
|
+
"description": "DX Lightning web components",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": "22.x"
|
|
8
|
+
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@coveo/headless": "3.22.2",
|
|
14
|
+
"@floating-ui/dom": "1.5.1",
|
|
15
|
+
"@optimizely/optimizely-sdk": "5.3.0",
|
|
16
|
+
"@shikijs/colorized-brackets": "^3.12.2",
|
|
17
|
+
"@types/throttle-debounce": "5.0.2",
|
|
18
|
+
"@vimeo/player": "2.22.0",
|
|
19
|
+
"classnames": "2.5.1",
|
|
20
|
+
"composed-offset-position": "0.0.4",
|
|
21
|
+
"coveo-search-ui": "2.10113.0",
|
|
22
|
+
"debounce": "1.2.1",
|
|
23
|
+
"js-cookie": "3.0.5",
|
|
24
|
+
"lodash.defaults": "4.2.0",
|
|
25
|
+
"lodash.get": "4.4.2",
|
|
26
|
+
"lodash.kebabcase": "4.1.1",
|
|
27
|
+
"memoize-one": "6.0.0",
|
|
28
|
+
"microtip": "0.2.2",
|
|
29
|
+
"shiki": "^3.12.2",
|
|
30
|
+
"throttle-debounce": "5.0.0",
|
|
31
|
+
"uuid": "9.0.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/classnames": "2.3.1",
|
|
35
|
+
"@types/debounce": "1.2.4",
|
|
36
|
+
"@types/js-cookie": "3.0.6",
|
|
37
|
+
"@types/lodash.defaults": "4.2.9",
|
|
38
|
+
"@types/lodash.get": "4.4.9",
|
|
39
|
+
"@types/lodash.kebabcase": "4.1.9",
|
|
40
|
+
"@types/luxon": "3.4.2",
|
|
41
|
+
"@types/uuid": "8.3.4",
|
|
42
|
+
"@types/vimeo__player": "2.18.3",
|
|
43
|
+
"eventsourcemock": "2.0.0",
|
|
44
|
+
"luxon": "3.4.4",
|
|
45
|
+
"msw": "^2.12.4"
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "e14396ab322a7cec69a1ebf180adbf8ac2902c3b"
|
|
48
|
+
}
|
|
@@ -25,14 +25,9 @@
|
|
|
25
25
|
display: flex;
|
|
26
26
|
font-family: var(--dx-g-font-sans);
|
|
27
27
|
width: 100%;
|
|
28
|
-
|
|
29
|
-
/* Opt-in hooks; defaults preserve today's look. */
|
|
30
|
-
padding: var(--dx-c-dropdown-option-padding, var(--dx-g-spacing-sm));
|
|
28
|
+
padding: var(--dx-g-spacing-sm);
|
|
31
29
|
font-size: var(--dx-g-text-sm);
|
|
32
|
-
border-radius: var(
|
|
33
|
-
--dx-c-dropdown-option-border-radius,
|
|
34
|
-
var(--dx-g-spacing-xs)
|
|
35
|
-
);
|
|
30
|
+
border-radius: var(--dx-g-spacing-xs);
|
|
36
31
|
transition: var(--dx-g-transition-hue-1x);
|
|
37
32
|
align-items: center;
|
|
38
33
|
outline: none !important;
|
|
@@ -76,13 +71,6 @@
|
|
|
76
71
|
align-items: center;
|
|
77
72
|
font-weight: var(--dx-c-dropdown-option-font-weight, var(--dx-g-font-bold));
|
|
78
73
|
font-size: var(--dx-c-dropdown-option-font-size, var(--dx-g-text-base));
|
|
79
|
-
|
|
80
|
-
/* Opt-in truncation: consumers set --dx-c-dropdown-option-white-space:
|
|
81
|
-
nowrap to truncate labels with an ellipsis instead of wrapping.
|
|
82
|
-
Defaults preserve today's wrapping behavior. */
|
|
83
|
-
white-space: var(--dx-c-dropdown-option-white-space, normal);
|
|
84
|
-
overflow: var(--dx-c-dropdown-option-overflow, visible);
|
|
85
|
-
text-overflow: var(--dx-c-dropdown-option-text-overflow, clip);
|
|
86
74
|
}
|
|
87
75
|
|
|
88
76
|
.option-indented .option_label {
|
|
@@ -65,7 +65,8 @@ export class TreeHandler {
|
|
|
65
65
|
isChildrenLoading: node.isChildrenLoading || false,
|
|
66
66
|
link: node.link,
|
|
67
67
|
method: node.method,
|
|
68
|
-
showForwardArrow: node.showForwardArrow
|
|
68
|
+
showForwardArrow: node.showForwardArrow,
|
|
69
|
+
redirectToChild: node.redirectToChild
|
|
69
70
|
};
|
|
70
71
|
|
|
71
72
|
const mapItem = { node: convertedNode, parent };
|
|
@@ -49,6 +49,10 @@ export default class TreeItem extends LightningElement {
|
|
|
49
49
|
return this.hasChildren || this.isChildrenLoading;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
private get isContentlessParent(): boolean {
|
|
53
|
+
return this.isParent && !!this._treeNode?.redirectToChild;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
private get showChildren(): boolean {
|
|
53
57
|
return this.isExpanded && this.hasChildren;
|
|
54
58
|
}
|
|
@@ -140,6 +144,23 @@ export default class TreeItem extends LightningElement {
|
|
|
140
144
|
private onLinkClick(event: Event): void {
|
|
141
145
|
this.preventDefaultLinkBehavior(event);
|
|
142
146
|
|
|
147
|
+
/**
|
|
148
|
+
* A content-less parent that redirects to a content child navigates
|
|
149
|
+
* like a normal link (navigation handles selection and ancestor
|
|
150
|
+
* expansion). A content-less parent whose chain has no content page to
|
|
151
|
+
* redirect to only expands, it is never selected.
|
|
152
|
+
*/
|
|
153
|
+
if (this.isContentlessParent) {
|
|
154
|
+
if (this._treeNode.link?.href) {
|
|
155
|
+
this.sendGtm(event);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const isSelectAction = false;
|
|
159
|
+
this.doExpand(isSelectAction);
|
|
160
|
+
this.sendGtm(event);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
143
164
|
if (this.isParent) {
|
|
144
165
|
const isSelectAction = true;
|
|
145
166
|
this.doExpand(isSelectAction);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<a href={href} class={tileClass} target={target}>
|
|
2
|
+
<a href={href} class={tileClass} target={target} aria-label={linkAriaLabel}>
|
|
3
3
|
<div class="flex indentation" role="heading" aria-level={tileAriaLevel}>
|
|
4
4
|
<div class="flex tile-expand-icon tile-icon" if:true={showArrow}>
|
|
5
5
|
<dx-icon
|
|
@@ -37,6 +37,28 @@ export default class TreeTile extends LightningElement {
|
|
|
37
37
|
return this.treeNode.level + 2;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Accessible name for the link. If a parent redirects to its first child,
|
|
42
|
+
* include both the parent and child labels so the destination is clear to
|
|
43
|
+
* screen reader users (WCAG 2.4.4)
|
|
44
|
+
*/
|
|
45
|
+
get linkAriaLabel(): string | null {
|
|
46
|
+
if (!this.treeNode.redirectToChild || !this.treeNode.link?.href) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The redirect can target a deep descendant, so walk the first-child
|
|
51
|
+
* chain to the node that owns the destination link and name it.
|
|
52
|
+
*/
|
|
53
|
+
let destination = this.treeNode.children?.[0];
|
|
54
|
+
while (destination?.redirectToChild) {
|
|
55
|
+
destination = destination.children?.[0];
|
|
56
|
+
}
|
|
57
|
+
return destination?.link?.href === this.treeNode.link.href
|
|
58
|
+
? `${this.treeNode.label}, opens ${destination.label}`
|
|
59
|
+
: null;
|
|
60
|
+
}
|
|
61
|
+
|
|
40
62
|
private get iconSize() {
|
|
41
63
|
return "xsmall";
|
|
42
64
|
}
|