@salesforcedevs/dx-components 1.3.119 → 1.3.123-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/lwc.config.json +1 -0
- package/package.json +2 -3
- package/src/assets/icons/utility-sprite/svg/symbols.svg +2 -1
- package/src/modules/dx/checkbox/checkbox.css +2 -0
- package/src/modules/dx/sidebar/sidebar.css +18 -4
- package/src/modules/dx/sidebar/sidebar.html +11 -5
- package/src/modules/dx/sidebar/sidebar.ts +17 -0
- package/src/modules/dx/sidebarOld/sidebarOld.css +14 -0
- package/src/modules/dx/sidebarOld/sidebarOld.html +11 -5
- package/src/modules/dx/sidebarOld/sidebarOld.ts +17 -0
- package/src/modules/dx/toast/toast.css +58 -0
- package/src/modules/dx/toast/toast.html +21 -0
- package/src/modules/dx/toast/toast.ts +36 -0
- package/src/modules/dxHelpers/commonSidebar/commonSidebar.css +8 -16
- package/LICENSE +0 -12
|
@@ -41,6 +41,7 @@ input {
|
|
|
41
41
|
|
|
42
42
|
.checkbox-error {
|
|
43
43
|
opacity: 0;
|
|
44
|
+
display: none;
|
|
44
45
|
margin-top: var(--dx-g-spacing-xs);
|
|
45
46
|
user-select: none;
|
|
46
47
|
}
|
|
@@ -57,6 +58,7 @@ input:disabled + .checkbox-label {
|
|
|
57
58
|
|
|
58
59
|
.container.show-error .checkbox-error {
|
|
59
60
|
opacity: 1;
|
|
61
|
+
display: block;
|
|
60
62
|
user-select: auto;
|
|
61
63
|
}
|
|
62
64
|
|
|
@@ -12,10 +12,6 @@ dx-empty-state {
|
|
|
12
12
|
padding-bottom: var(--dx-g-spacing-md);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.sidebar-content-tree {
|
|
16
|
-
padding: var(--dx-g-spacing-xs);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
15
|
.loading-skeleton {
|
|
20
16
|
margin-top: var(--dx-g-spacing-md);
|
|
21
17
|
}
|
|
@@ -37,6 +33,20 @@ dx-empty-state {
|
|
|
37
33
|
display: none;
|
|
38
34
|
}
|
|
39
35
|
|
|
36
|
+
.header-toggle-icon dx-button {
|
|
37
|
+
--dx-c-button-secondary-color-hover: var(--dx-g-gray-80);
|
|
38
|
+
|
|
39
|
+
width: 10px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.header-toggle-icon dx-button[aria-expanded="true"] {
|
|
43
|
+
--dx-c-button-secondary-color-hover: transparent;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.header-toggle-icon dx-button[aria-expanded="true"]:hover {
|
|
47
|
+
--dx-c-button-secondary-color-hover: var(--dx-g-gray-80);
|
|
48
|
+
}
|
|
49
|
+
|
|
40
50
|
@media (max-width: 768px) {
|
|
41
51
|
:host {
|
|
42
52
|
width: 100%;
|
|
@@ -45,4 +55,8 @@ dx-empty-state {
|
|
|
45
55
|
.loading-skeleton {
|
|
46
56
|
width: 100%;
|
|
47
57
|
}
|
|
58
|
+
|
|
59
|
+
.sidebar-content-tree {
|
|
60
|
+
padding: 0 var(--dx-g-spacing-sm);
|
|
61
|
+
}
|
|
48
62
|
}
|
|
@@ -7,12 +7,18 @@
|
|
|
7
7
|
>
|
|
8
8
|
<span class="header-title truncate">{headerMobile}</span>
|
|
9
9
|
<div class="header-toggle-icon">
|
|
10
|
-
<dx-
|
|
10
|
+
<dx-button
|
|
11
11
|
aria-expanded={expanded}
|
|
12
|
-
aria-label="
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
aria-label="toggle menu"
|
|
13
|
+
type="button"
|
|
14
|
+
variant="tertiary"
|
|
15
|
+
>
|
|
16
|
+
<dx-icon
|
|
17
|
+
sprite="utility"
|
|
18
|
+
symbol={menuSymbol}
|
|
19
|
+
color="blue-vibrant-20"
|
|
20
|
+
></dx-icon>
|
|
21
|
+
</dx-button>
|
|
16
22
|
</div>
|
|
17
23
|
</div>
|
|
18
24
|
|
|
@@ -127,6 +127,10 @@ export default class Sidebar extends SidebarBase {
|
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
private get menuSymbol() {
|
|
131
|
+
return this.expanded ? "close" : "custom-rows";
|
|
132
|
+
}
|
|
133
|
+
|
|
130
134
|
constructor() {
|
|
131
135
|
super();
|
|
132
136
|
|
|
@@ -163,10 +167,23 @@ export default class Sidebar extends SidebarBase {
|
|
|
163
167
|
|
|
164
168
|
private onSelect(event: CustomEvent) {
|
|
165
169
|
this._value = event.detail.name;
|
|
170
|
+
|
|
171
|
+
if (this.mobile) {
|
|
172
|
+
this.onToggleClick();
|
|
173
|
+
}
|
|
166
174
|
}
|
|
167
175
|
|
|
168
176
|
private onToggleClick() {
|
|
169
177
|
this.expanded = !this.expanded;
|
|
178
|
+
this.dispatchEvent(
|
|
179
|
+
new CustomEvent("togglesidebar", {
|
|
180
|
+
detail: {
|
|
181
|
+
open: this.expanded,
|
|
182
|
+
bubbles: true,
|
|
183
|
+
composed: true
|
|
184
|
+
}
|
|
185
|
+
})
|
|
186
|
+
);
|
|
170
187
|
}
|
|
171
188
|
|
|
172
189
|
private makeKey(): string {
|
|
@@ -10,3 +10,17 @@ dx-empty-state {
|
|
|
10
10
|
|
|
11
11
|
padding-bottom: var(--dx-g-spacing-md);
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
.header-toggle-icon dx-button {
|
|
15
|
+
--dx-c-button-secondary-color-hover: var(--dx-g-gray-80);
|
|
16
|
+
|
|
17
|
+
width: 10px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.header-toggle-icon dx-button[aria-expanded="true"] {
|
|
21
|
+
--dx-c-button-secondary-color-hover: transparent;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.header-toggle-icon dx-button[aria-expanded="true"]:hover {
|
|
25
|
+
--dx-c-button-secondary-color-hover: var(--dx-g-gray-80);
|
|
26
|
+
}
|
|
@@ -7,12 +7,18 @@
|
|
|
7
7
|
>
|
|
8
8
|
<span class="header-title truncate">{headerMobile}</span>
|
|
9
9
|
<div class="header-toggle-icon">
|
|
10
|
-
<dx-
|
|
10
|
+
<dx-button
|
|
11
11
|
aria-expanded={expanded}
|
|
12
|
-
aria-label="
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
aria-label="toggle menu"
|
|
13
|
+
type="button"
|
|
14
|
+
variant="tertiary"
|
|
15
|
+
>
|
|
16
|
+
<dx-icon
|
|
17
|
+
sprite="utility"
|
|
18
|
+
symbol={menuSymbol}
|
|
19
|
+
color="blue-vibrant-20"
|
|
20
|
+
></dx-icon>
|
|
21
|
+
</dx-button>
|
|
16
22
|
</div>
|
|
17
23
|
</div>
|
|
18
24
|
|
|
@@ -67,6 +67,10 @@ export default class Sidebar extends SidebarBase {
|
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
private get menuSymbol() {
|
|
71
|
+
return this.expanded ? "close" : "custom-rows";
|
|
72
|
+
}
|
|
73
|
+
|
|
70
74
|
connectedCallback() {
|
|
71
75
|
this.matchMedia = window.matchMedia(
|
|
72
76
|
`(max-width: ${MOBILE_SIZE_MATCH})`
|
|
@@ -93,10 +97,23 @@ export default class Sidebar extends SidebarBase {
|
|
|
93
97
|
|
|
94
98
|
private onSelect(event: CustomEvent) {
|
|
95
99
|
this._value = event.detail.name;
|
|
100
|
+
|
|
101
|
+
if (this.mobile) {
|
|
102
|
+
this.onToggleClick();
|
|
103
|
+
}
|
|
96
104
|
}
|
|
97
105
|
|
|
98
106
|
private onToggleClick() {
|
|
99
107
|
this.expanded = !this.expanded;
|
|
108
|
+
this.dispatchEvent(
|
|
109
|
+
new CustomEvent("togglesidebar", {
|
|
110
|
+
detail: {
|
|
111
|
+
open: this.expanded,
|
|
112
|
+
bubbles: true,
|
|
113
|
+
composed: true
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
);
|
|
100
117
|
}
|
|
101
118
|
|
|
102
119
|
/*
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@import "dxHelpers/text";
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.container {
|
|
8
|
+
position: fixed;
|
|
9
|
+
bottom: var(--dx-g-spacing-lg);
|
|
10
|
+
left: var(--dx-g-spacing-lg);
|
|
11
|
+
right: var(--dx-g-spacing-lg);
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.toast {
|
|
18
|
+
text-align: left;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
max-width: 926px;
|
|
23
|
+
background-color: rgb(22, 50, 92);
|
|
24
|
+
padding: var(--dx-g-spacing-mlg);
|
|
25
|
+
border-radius: 4px;
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.toast-warning {
|
|
30
|
+
background-color: var(--dx-g-red-natural-95);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.toast-success {
|
|
34
|
+
background-color: var(--dx-g-green-natural-95);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.toast-error {
|
|
38
|
+
background-color: var(--dx-g-red-natural-95);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.content {
|
|
42
|
+
flex-grow: 1;
|
|
43
|
+
margin: 0 var(--dx-g-spacing-lg);
|
|
44
|
+
color: white;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.content > a {
|
|
48
|
+
text-decoration: underline;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
dx-button {
|
|
52
|
+
--dx-c-button-primary-color: white;
|
|
53
|
+
--dx-c-button-inline-color-hover: gray;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
dx-icon {
|
|
57
|
+
color: white;
|
|
58
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template if:true={isOpen}>
|
|
3
|
+
<div class="container">
|
|
4
|
+
<div class={className} role="status">
|
|
5
|
+
<div class="type-icon">
|
|
6
|
+
<dx-icon size="large" symbol={iconSymbol}></dx-icon>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="content dx-text-body-3">
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="close">
|
|
12
|
+
<dx-button
|
|
13
|
+
onclick={close}
|
|
14
|
+
icon-symbol="close"
|
|
15
|
+
variant="inline"
|
|
16
|
+
></dx-button>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { api, LightningElement } from "lwc";
|
|
2
|
+
|
|
3
|
+
type ToastVariant = "info" | "error" | "success";
|
|
4
|
+
|
|
5
|
+
const icons = {
|
|
6
|
+
info: "info",
|
|
7
|
+
warning: "warning",
|
|
8
|
+
success: "success",
|
|
9
|
+
error: "error"
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default class extends LightningElement {
|
|
13
|
+
@api variant: ToastVariant = "info";
|
|
14
|
+
@api localStorageKey!: string;
|
|
15
|
+
|
|
16
|
+
private isOpen: boolean = false;
|
|
17
|
+
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
this.isOpen =
|
|
20
|
+
window.localStorage.getItem(this.localStorageKey) !== "false";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
private get iconSymbol() {
|
|
24
|
+
return icons[this.variant] || icons.info;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private get className() {
|
|
28
|
+
return `toast toast-${this.variant}`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
close() {
|
|
32
|
+
this.dispatchEvent(new CustomEvent("close"));
|
|
33
|
+
window.localStorage.setItem(this.localStorageKey, "false");
|
|
34
|
+
this.isOpen = false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -44,17 +44,12 @@ dx-tree:not(:last-child) {
|
|
|
44
44
|
color: var(--dx-g-blue-vibrant-30);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.header-toggle-icon dx-icon {
|
|
48
|
-
transition: var(--dx-g-transition-transform-2x);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
47
|
.container.collapsed {
|
|
52
48
|
width: var(--dx-g-spacing-xl);
|
|
53
49
|
}
|
|
54
50
|
|
|
55
51
|
.container.collapsed .header {
|
|
56
52
|
padding-left: var(--dx-g-global-header-padding-horizontal);
|
|
57
|
-
padding-right: var(--dx-g-global-header-padding-horizontal);
|
|
58
53
|
}
|
|
59
54
|
|
|
60
55
|
.container {
|
|
@@ -96,13 +91,7 @@ dx-tree:not(:last-child) {
|
|
|
96
91
|
}
|
|
97
92
|
|
|
98
93
|
.container.container-mobile:not(.collapsed) .header {
|
|
99
|
-
background-color:
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* This class checks if an element with container class has an elemnt with container-mobile class and
|
|
103
|
-
must not contain any collapsed class and finally must have a mobile-header class (to which this css will be applied) */
|
|
104
|
-
.container.container-mobile:not(.collapsed) .mobile-header {
|
|
105
|
-
background-color: var(--dx-g-gray-95);
|
|
94
|
+
background-color: var(--dx-g-gray-90);
|
|
106
95
|
}
|
|
107
96
|
|
|
108
97
|
.container.container-mobile .header-title {
|
|
@@ -120,10 +109,6 @@ must not contain any collapsed class and finally must have a mobile-header class
|
|
|
120
109
|
margin-bottom: 0;
|
|
121
110
|
}
|
|
122
111
|
|
|
123
|
-
.container.container-mobile.collapsed .header-toggle-icon dx-icon {
|
|
124
|
-
transform: rotateZ(-90deg);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
112
|
.container.container-border-active {
|
|
128
113
|
--border-color: var(--dx-c-sidebar-button-color);
|
|
129
114
|
}
|
|
@@ -141,3 +126,10 @@ must not contain any collapsed class and finally must have a mobile-header class
|
|
|
141
126
|
text-overflow: ellipsis;
|
|
142
127
|
white-space: nowrap;
|
|
143
128
|
}
|
|
129
|
+
|
|
130
|
+
@media screen and (max-width: 768px) {
|
|
131
|
+
.padding-horizontal {
|
|
132
|
+
padding-left: var(--dx-g-spacing-lg);
|
|
133
|
+
padding-right: var(--dx-g-spacing-md);
|
|
134
|
+
}
|
|
135
|
+
}
|
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.
|