@salesforcedevs/dw-components 1.3.219-canary.0 → 1.3.227

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 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/dw-components",
3
- "version": "1.3.219-canary.0",
3
+ "version": "1.3.227",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -23,5 +23,6 @@
23
23
  "@types/lodash.uniqby": "^4.7.7",
24
24
  "@types/setimmediate": "^1.0.2",
25
25
  "setimmediate": "^1.0.5"
26
- }
26
+ },
27
+ "gitHead": "ca4d2f11924db69bc1e872fb61587af9bb78cdde"
27
28
  }
@@ -1,4 +1,11 @@
1
1
  :host {
2
+ --dx-c-button-custom-background: var(--dx-g-blue-vibrant-50);
3
+ --dx-c-button-custom-color: white;
4
+ --dx-c-button-custom-border: var(--dx-g-blue-vibrant-50);
5
+ --dx-c-button-custom-color-hover: white;
6
+ --dx-c-button-custom-background-hover: var(--dx-g-blue-vibrant-40);
7
+ --dx-c-button-custom-border-hover: var(--dx-g-blue-vibrant-40);
8
+
2
9
  display: block;
3
10
  }
4
11
 
@@ -55,11 +62,6 @@ form > .full-name-field {
55
62
  width: 100%;
56
63
  }
57
64
 
58
- .form-submit:hover {
59
- background-color: var(--dx-g-blue-vibrant-40);
60
- border-color: var(--dx-g-blue-vibrant-40);
61
- }
62
-
63
65
  @media screen and (min-width: 641px) {
64
66
  form > .full-name-field:first-of-type {
65
67
  margin-right: var(--dx-g-spacing-lg);
@@ -119,6 +119,7 @@
119
119
 
120
120
  <dx-button
121
121
  class="submit-button"
122
+ variant="custom"
122
123
  disabled={disableSubmit}
123
124
  size="large"
124
125
  type="submit"
@@ -99,6 +99,26 @@ export default class DeSignupForm extends LightningElement {
99
99
  return uuid;
100
100
  }
101
101
 
102
+ setSubmitButtonDisabled(isDisabled: boolean): void {
103
+ this.disableSubmit = isDisabled;
104
+
105
+ let backgroundAndBorderColor: string;
106
+ if (isDisabled) {
107
+ backgroundAndBorderColor = "var(--dx-g-gray-80)";
108
+ } else {
109
+ backgroundAndBorderColor = "var(--dx-g-blue-vibrant-50)";
110
+ }
111
+
112
+ this.template.host.style.setProperty(
113
+ "--dx-c-button-custom-background",
114
+ backgroundAndBorderColor
115
+ );
116
+ this.template.host.style.setProperty(
117
+ "--dx-c-button-custom-border",
118
+ backgroundAndBorderColor
119
+ );
120
+ }
121
+
102
122
  handleSubmit(event: Event): void {
103
123
  event.preventDefault();
104
124
 
@@ -127,8 +147,8 @@ export default class DeSignupForm extends LightningElement {
127
147
  },
128
148
  SIGN_UP_FORM_TIMEOUT_MS
129
149
  );
130
- this.disableSubmit = true;
131
150
 
151
+ this.setSubmitButtonDisabled(true);
132
152
  submitForm(formData)
133
153
  .then(() => {
134
154
  trackGtm(event.target!, "custEv_signUp", {
@@ -157,11 +177,11 @@ export default class DeSignupForm extends LightningElement {
157
177
  // so we navigate the user to an interim page that tells them to watch their email.
158
178
  window.location.href = "/signup/account-verification";
159
179
  } else {
160
- this.disableSubmit = false;
180
+ this.setSubmitButtonDisabled(false);
161
181
  if (error.message === ErrorCode.DUPLICATE) {
162
182
  this.knownDuplicateUsers.push(formData.user.username);
163
183
  } else {
164
- console.log(
184
+ console.warn(
165
185
  "Oops, something went wrong",
166
186
  error.message
167
187
  );