@salesforcedevs/dx-components 1.3.102 → 1.3.104-alpha01

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.102",
3
+ "version": "1.3.104-alpha01",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -39,6 +39,5 @@
39
39
  "@types/vimeo__player": "^2.16.2",
40
40
  "eventsourcemock": "^2.0.0",
41
41
  "luxon": "^3.1.0"
42
- },
43
- "gitHead": "3e8a3f0d4092d9d819a05ebfcffd71977a699df2"
42
+ }
44
43
  }
@@ -2,7 +2,7 @@
2
2
  @import "dxHelpers/text";
3
3
 
4
4
  .content-container {
5
- padding: 0 var(--dx-g-page-padding-horizontal);
5
+ padding: 0 var(--dx-g-header-padding-horizontal);
6
6
  }
7
7
 
8
8
  a {
@@ -32,10 +32,6 @@ dx-empty-state {
32
32
  display: none;
33
33
  }
34
34
 
35
- .container.collapsed .header-toggle-button {
36
- transform: rotate(180deg);
37
- }
38
-
39
35
  .container.collapsed .sidebar-header,
40
36
  .container.collapsed .sidebar-content {
41
37
  display: none;
@@ -16,17 +16,6 @@
16
16
  </div>
17
17
  </div>
18
18
 
19
- <dx-button
20
- if:false={mobile}
21
- aria-expanded={expanded}
22
- aria-label="icon"
23
- class="header-toggle-button"
24
- icon-symbol="close_panel"
25
- variant="custom"
26
- onclick={onToggleClick}
27
- onmouseenter={onToggleMouseEnter}
28
- onmouseleave={onToggleMouseLeave}
29
- ></dx-button>
30
19
  <div class="sidebar-header padding-horizontal">
31
20
  <div class="header" if:false={mobile}>
32
21
  <h2 class="dx-text-display-6 header-title">{header}</h2>
@@ -53,7 +53,6 @@ export default class Sidebar extends SidebarBase {
53
53
  }
54
54
 
55
55
  private expanded: boolean = true;
56
- private _toggleHovered: boolean = false;
57
56
  private _value?: string = undefined;
58
57
 
59
58
  @track
@@ -113,7 +112,6 @@ export default class Sidebar extends SidebarBase {
113
112
  private get containerClass() {
114
113
  return cx("container", {
115
114
  collapsed: !this.expanded,
116
- "container-border-active": this._toggleHovered,
117
115
  "container-mobile": this.mobile,
118
116
  "user-searching": this.isUserSearching,
119
117
  "show-tree": !this.isUserSearching,
@@ -158,8 +156,10 @@ export default class Sidebar extends SidebarBase {
158
156
  this.matchMedia.removeEventListener("change", this.onMediaChange);
159
157
  }
160
158
 
161
- private onMediaChange = (event: MediaQueryListEvent | MediaQueryList) =>
162
- (this.mobile = event.matches);
159
+ private onMediaChange = (event: MediaQueryListEvent | MediaQueryList) => {
160
+ this.mobile = event.matches;
161
+ this.expanded = !this.mobile;
162
+ };
163
163
 
164
164
  private onSelect(event: CustomEvent) {
165
165
  this._value = event.detail.name;
@@ -167,15 +167,6 @@ export default class Sidebar extends SidebarBase {
167
167
 
168
168
  private onToggleClick() {
169
169
  this.expanded = !this.expanded;
170
- this._toggleHovered = false;
171
- }
172
-
173
- private onToggleMouseEnter() {
174
- this._toggleHovered = true;
175
- }
176
-
177
- private onToggleMouseLeave() {
178
- this._toggleHovered = false;
179
170
  }
180
171
 
181
172
  private makeKey(): string {
@@ -1,9 +1,5 @@
1
1
  @import "dxHelpers/commonSidebar";
2
2
 
3
- .collapsed .header-toggle-button {
4
- transform: rotate(180deg);
5
- }
6
-
7
3
  .sidebar-content {
8
4
  overflow-y: auto;
9
5
  }
@@ -16,18 +16,6 @@
16
16
  </div>
17
17
  </div>
18
18
 
19
- <dx-button
20
- if:false={mobile}
21
- aria-expanded={expanded}
22
- aria-label="icon"
23
- class="header-toggle-button"
24
- icon-symbol="close_panel"
25
- variant="custom"
26
- onclick={onToggleClick}
27
- onmouseenter={onToggleMouseEnter}
28
- onmouseleave={onToggleMouseLeave}
29
- ></dx-button>
30
-
31
19
  <template if:true={expanded}>
32
20
  <div class="padding-horizontal">
33
21
  <div class="header" if:false={mobile}>
@@ -38,7 +38,6 @@ export default class Sidebar extends SidebarBase {
38
38
  }
39
39
 
40
40
  private expanded: boolean = true;
41
- private _toggleHovered: boolean = false;
42
41
  private _searchTimeout?: number;
43
42
  private _value?: string = undefined;
44
43
  private _trees!: Array<TreeNode>;
@@ -56,7 +55,6 @@ export default class Sidebar extends SidebarBase {
56
55
  private get containerClass() {
57
56
  return cx("container", {
58
57
  collapsed: !this.expanded,
59
- "container-border-active": this._toggleHovered,
60
58
  "container-mobile": this.mobile
61
59
  });
62
60
  }
@@ -88,8 +86,10 @@ export default class Sidebar extends SidebarBase {
88
86
  this.matchMedia.removeEventListener("change", this.onMediaChange);
89
87
  }
90
88
 
91
- private onMediaChange = (event: MediaQueryListEvent | MediaQueryList) =>
92
- (this.mobile = event.matches);
89
+ private onMediaChange = (event: MediaQueryListEvent | MediaQueryList) => {
90
+ this.mobile = event.matches;
91
+ this.expanded = !this.mobile;
92
+ };
93
93
 
94
94
  private onSelect(event: CustomEvent) {
95
95
  this._value = event.detail.name;
@@ -97,15 +97,6 @@ export default class Sidebar extends SidebarBase {
97
97
 
98
98
  private onToggleClick() {
99
99
  this.expanded = !this.expanded;
100
- this._toggleHovered = false;
101
- }
102
-
103
- private onToggleMouseEnter() {
104
- this._toggleHovered = true;
105
- }
106
-
107
- private onToggleMouseLeave() {
108
- this._toggleHovered = false;
109
100
  }
110
101
 
111
102
  /*
@@ -9,15 +9,10 @@
9
9
  display: flex;
10
10
  flex-direction: row-reverse;
11
11
  width: var(--dx-c-toc-width);
12
- max-width: 100%;
12
+ max-width: 240px;
13
13
  word-break: break-word;
14
14
  }
15
15
 
16
- .toc_collapsed {
17
- width: var(--dx-g-spacing-xl);
18
- margin-left: var(--dx-g-spacing-xl);
19
- }
20
-
21
16
  .toc_content {
22
17
  display: flex;
23
18
  flex-direction: column;
@@ -26,11 +21,6 @@
26
21
  padding-bottom: var(--dx-g-spacing-smd);
27
22
  }
28
23
 
29
- .state-hide-content {
30
- opacity: 0;
31
- pointer-events: none;
32
- }
33
-
34
24
  .toc_title {
35
25
  display: flex;
36
26
  flex-direction: row;
@@ -44,29 +34,6 @@
44
34
  transition: var(--dx-g-transition-hue-1x);
45
35
  }
46
36
 
47
- .toggle-button.collapsed {
48
- --dx-c-button-opacity: 1;
49
-
50
- transform: rotate(180deg);
51
- }
52
-
53
- .toggle-button {
54
- width: var(--dx-g-icon-size-xl);
55
- height: var(--dx-g-icon-size-xl);
56
-
57
- --dx-c-button-opacity: 0;
58
- --dx-c-button-custom-color: var(--dx-g-blue-vibrant-50);
59
- --dx-c-button-custom-background: white;
60
- --dx-c-button-custom-border: white;
61
- --dx-c-button-custom-color-hover: white;
62
- --dx-c-button-custom-background-hover: var(--dx-g-blue-vibrant-50);
63
- --dx-c-button-custom-border-hover: var(--dx-g-blue-vibrant-50);
64
- }
65
-
66
- .toggle-button:hover {
67
- --dx-c-button-opacity: 1;
68
- }
69
-
70
37
  .content-button {
71
38
  line-height: var(--dx-g-text-lg);
72
39
  color: var(--dx-g-blue-vibrant-20);
@@ -100,7 +67,3 @@
100
67
  color: var(--dx-g-blue-vibrant-40);
101
68
  border-color: var(--dx-g-blue-vibrant-40);
102
69
  }
103
-
104
- .toc:hover .toggle-button {
105
- --dx-c-button-opacity: 1;
106
- }
@@ -1,14 +1,7 @@
1
1
  <template>
2
- <div class={contentClassName} role="directory">
3
- <dx-button
4
- aria-label={toggleButtonAriaLabel}
5
- class={toggleButtonClass}
6
- onclick={toggleShowContent}
7
- icon-symbol="open_panel"
8
- variant="custom"
9
- ></dx-button>
10
- <div if:true={showContent} class="toc toc_content">
11
- <h2 class={titleClassName}>{title}</h2>
2
+ <div class="toc" role="directory">
3
+ <div class="toc toc_content">
4
+ <h2 class="dx-text-display-8 toc_title">{title}</h2>
12
5
  <template for:each={options} for:item="option">
13
6
  <a
14
7
  href={option.anchor}
@@ -23,7 +16,7 @@
23
16
  </template>
24
17
  </div>
25
18
  </div>
26
- <div if:true={showContent}>
19
+ <div>
27
20
  <slot name="view-pdf"></slot>
28
21
  </div>
29
22
  </template>
@@ -35,34 +35,9 @@ export default class Toc extends LightningElement {
35
35
  }
36
36
 
37
37
  private _value?: string = undefined;
38
- private showContent: boolean = true;
39
38
 
40
39
  @track _options!: Array<ContentElement>;
41
40
 
42
- private get toggleButtonIconSymbol() {
43
- return this.showContent ? "forward" : "back";
44
- }
45
-
46
- private get toggleButtonAriaLabel() {
47
- return this.showContent
48
- ? "Hide table of contents"
49
- : "Show table of contents";
50
- }
51
-
52
- private get contentClassName() {
53
- return cx("toc", !this.showContent && "toc_collapsed");
54
- }
55
- private get toggleButtonClass() {
56
- return cx("toggle-button", !this.showContent && "collapsed");
57
- }
58
-
59
- private get titleClassName() {
60
- return cx(
61
- "dx-text-display-8 toc_title",
62
- !this.showContent && "state-hide-content"
63
- );
64
- }
65
-
66
41
  private onClick(e: Event) {
67
42
  const target = e.currentTarget as HTMLElement;
68
43
  const id = target.getAttribute("contentid");
@@ -84,24 +59,4 @@ export default class Toc extends LightningElement {
84
59
  content_category: "cta"
85
60
  });
86
61
  }
87
-
88
- private toggleShowContent(e: Event) {
89
- this.showContent = !this.showContent;
90
- this.trackShowContent(e);
91
- }
92
-
93
- private trackShowContent(event: Event) {
94
- let action = "collapse";
95
- if (this.showContent) {
96
- action = "expand";
97
- }
98
- sendGtm(event.target!, "custEv_tableOfContents", {
99
- click_text: this.toggleButtonAriaLabel,
100
- clickAction: action,
101
- click_url: "",
102
- element_title: this.title,
103
- element_type: "button",
104
- content_category: "cta"
105
- });
106
- }
107
62
  }
@@ -43,7 +43,7 @@ header.state-show-mobile-nav .header_l2_group-nav_overflow {
43
43
  .header_l1 {
44
44
  height: var(--dx-g-spacing-3xl);
45
45
  background: var(--dx-g-brand-current-color-background-2);
46
- padding: 0 var(--dx-g-page-padding-horizontal);
46
+ padding: 0 var(--dx-g-header-padding-horizontal);
47
47
  position: relative;
48
48
  }
49
49
 
@@ -60,7 +60,7 @@ header.state-show-mobile-nav .header_l2_group-nav_overflow {
60
60
  .header_l2 {
61
61
  height: var(--dx-g-spacing-4xl);
62
62
  background: var(--dx-g-brand-current-color-background);
63
- padding: var(--dx-g-spacing-lg) var(--dx-g-page-padding-horizontal);
63
+ padding: var(--dx-g-spacing-lg) var(--dx-g-header-padding-horizontal);
64
64
  }
65
65
 
66
66
  .header_l2_group {
@@ -121,7 +121,7 @@ header.state-show-mobile-nav .header_l2_group-nav_overflow {
121
121
 
122
122
  @media (max-width: 768px) {
123
123
  .header_l2_group-nav {
124
- padding-left: calc(var(--dx-g-page-padding-horizontal) - 4px);
124
+ padding-left: calc(var(--dx-g-header-padding-horizontal) - 4px);
125
125
  }
126
126
 
127
127
  .header_l2_group-nav_overflow {
@@ -9,7 +9,7 @@
9
9
  --dx-c-sidebar-button-color-hover: white;
10
10
  --dx-c-sidebar-button-background-hover: var(--dx-g-blue-vibrant-50);
11
11
  --dx-c-sidebar-button-border-hover: var(--dx-g-blue-vibrant-50);
12
- --dx-c-sidebar-left-padding: var(--dx-g-page-padding-horizontal);
12
+ --dx-c-sidebar-left-padding: var(--dx-g-header-padding-horizontal);
13
13
  --dx-c-sidebar-vertical-padding: var(--dx-g-spacing-md);
14
14
  }
15
15
 
@@ -39,21 +39,6 @@ dx-tree:not(:last-child) {
39
39
  line-height: inherit;
40
40
  }
41
41
 
42
- .header-toggle-button {
43
- position: absolute;
44
- right: calc((-1 * (var(--dx-g-spacing-xl) / 2)) - 1px);
45
-
46
- --dx-c-button-opacity: 0;
47
- --dx-c-button-custom-color: var(--dx-c-sidebar-button-color);
48
- --dx-c-button-custom-background: var(--dx-c-sidebar-button-background);
49
- --dx-c-button-custom-border: var(--dx-c-sidebar-button-border);
50
- --dx-c-button-custom-color-hover: var(--dx-c-sidebar-button-color-hover);
51
- --dx-c-button-custom-background-hover: var(
52
- --dx-c-sidebar-button-background-hover
53
- );
54
- --dx-c-button-custom-border-hover: var(--dx-c-sidebar-button-border-hover);
55
- }
56
-
57
42
  .header-toggle-icon {
58
43
  margin: auto 0 auto auto;
59
44
  color: var(--dx-g-blue-vibrant-30);
@@ -96,10 +81,6 @@ dx-tree:not(:last-child) {
96
81
  --border-color: transparent;
97
82
  }
98
83
 
99
- .container:hover .header-toggle-button {
100
- --dx-c-button-opacity: 1;
101
- }
102
-
103
84
  .container.container-mobile {
104
85
  width: 100%;
105
86
  }
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.