@salesforcedevs/dx-components 1.3.263 → 1.3.268-ref-rnb-tab1

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 CHANGED
@@ -42,6 +42,7 @@
42
42
  "dx/emptyState",
43
43
  "dx/faq",
44
44
  "dx/feature",
45
+ "dx/featureFlag",
45
46
  "dx/featureGrid",
46
47
  "dx/featuredContentHeader",
47
48
  "dx/featuresList",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.263",
3
+ "version": "1.3.268-ref-rnb-tab1",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -12,6 +12,7 @@
12
12
  "dependencies": {
13
13
  "@coveo/headless": "2.16.5",
14
14
  "@floating-ui/dom": "1.5.1",
15
+ "@optimizely/optimizely-sdk": "^5.3.0",
15
16
  "@salesforcedevs/sfdocs-wires": "0.6.98",
16
17
  "@types/throttle-debounce": "^5.0.0",
17
18
  "@vimeo/player": "^2.16.4",
@@ -44,6 +45,5 @@
44
45
  },
45
46
  "volta": {
46
47
  "node": "16.19.1"
47
- },
48
- "gitHead": "68f4f16b723448bf1b5df3659874a914cea972b9"
48
+ }
49
49
  }
@@ -6,7 +6,7 @@ ul {
6
6
  }
7
7
 
8
8
  .container {
9
- max-width: 840px;
9
+ max-width: var(--dx-c-agenda-max-width, 840px);
10
10
  margin: 0 auto;
11
11
  }
12
12
 
@@ -254,4 +254,4 @@
254
254
  .player-threedot-menu button:hover {
255
255
  background: var(--sds-g-gray-4);
256
256
  }
257
- }
257
+ }
@@ -21,18 +21,25 @@
21
21
  height: 160px;
22
22
  }
23
23
 
24
+ :not(.not-clickable) .body {
25
+ padding-right: var(
26
+ --dx-c-card-clickthrough-body-right-padding,
27
+ 64px
28
+ ); /* leave room for the control */
29
+ }
30
+
24
31
  .control {
25
- border-radius: 50%;
32
+ border-radius: var(--dx-c-card-clickthrough-control-border-radius, 50%);
26
33
  background-color: var(--dx-g-cloud-blue-vibrant-95);
27
34
  color: var(--dx-g-blue-vibrant-40);
28
- width: 48px;
29
- height: 48px;
35
+ width: var(--dx-c-card-clickthrough-control-width, 48px);
36
+ height: var(--dx-c-card-clickthrough-control-height, 48px);
30
37
  display: flex;
31
38
  align-items: center;
32
39
  justify-content: center;
33
40
  position: absolute;
34
- bottom: 32px;
35
- right: 20px;
41
+ bottom: var(--dx-c-card-clickthrough-control-bottom, 32px);
42
+ right: var(--dx-c-card-clickthrough-control-right, 20px);
36
43
  }
37
44
 
38
45
  /* text section */
@@ -10,9 +10,21 @@
10
10
  class="dx-card-base_section-vertical dx-card-base_column card_section-text"
11
11
  >
12
12
  <span class="dx-text-label-3" part="label">{label}</span>
13
- <dx-card-title title={title} target={target} onclick={handleLinkClick}></dx-card-title>
14
- <span lwc:if={body} class="dx-text-body-2" onclick={handleTextClick}>{body}</span>
15
- <span lwc:if={href} class="control"><dx-icon size="medium" symbol="forward"></dx-icon></span>
13
+ <dx-card-title
14
+ title={title}
15
+ target={target}
16
+ onclick={handleLinkClick}
17
+ ></dx-card-title>
18
+ <span
19
+ lwc:if={body}
20
+ class="dx-text-body-2 body"
21
+ onclick={handleTextClick}
22
+ >
23
+ {body}
24
+ </span>
25
+ <span lwc:if={href} class="control">
26
+ <dx-icon size="medium" symbol="forward"></dx-icon>
27
+ </span>
16
28
  </div>
17
29
  </a>
18
30
  </template>
@@ -15,7 +15,13 @@
15
15
  target={target}
16
16
  onclick={handleLinkClick}
17
17
  ></dx-card-title>
18
- <span lwc:if={body} class="dx-text-body-2" onclick={handleTextClick}>{body}</span>
18
+ <span
19
+ lwc:if={body}
20
+ class="dx-text-body-2"
21
+ onclick={handleTextClick}
22
+ >
23
+ {body}
24
+ </span>
19
25
  </div>
20
26
  <div class="dx-card-base_section-vertical dx-card-base_ctas">
21
27
  <slot onslotchange={onSlotChange}></slot>
@@ -11,8 +11,7 @@
11
11
  title={card.title}
12
12
  target={card.target}
13
13
  show-mobile-img={card.showMobileImg}
14
- >
15
- </dx-card-clickthrough>
14
+ ></dx-card-clickthrough>
16
15
  </template>
17
16
  </dx-grid>
18
17
  </template>
@@ -21,8 +21,7 @@ export const stepsData = [
21
21
  'I agree to the Journey to Salesforce Program Terms, subject to the <a href="http://www.google.com">Salesforce Program Agreement</a>.',
22
22
  notAvailableAlertInfo: {
23
23
  title: "Not Available",
24
- body:
25
- 'The Journey to Salesforce program is not currently available in your country. See the <a href="https://www.google.com/">program FAQs</a> for a list of participating countries.'
24
+ body: 'The Journey to Salesforce program is not currently available in your country. See the <a href="https://www.google.com/">program FAQs</a> for a list of participating countries.'
26
25
  },
27
26
  participatingCountryCodes: ["US", "CA", "IN"]
28
27
  },
@@ -4,7 +4,7 @@
4
4
  body={body}
5
5
  featured={featured}
6
6
  href={href}
7
- label="Trailhead"
7
+ label={label}
8
8
  subtitle={subtitle}
9
9
  target={target}
10
10
  title={title}
@@ -11,6 +11,7 @@ export default class CardTrailheadModule extends LightningElement {
11
11
  @api points!: string | number;
12
12
  @api target?: string | null = null;
13
13
  @api title!: string;
14
+ @api label?: string = "Trailhead";
14
15
 
15
16
  get subtitle() {
16
17
  return `${this.points} Points`;
@@ -23,13 +23,15 @@ export const ampscript = {
23
23
  },
24
24
  boolean: /\b(true|false|null)\b/i,
25
25
  number: /\b(0(x|X)[0-9a-fA-F]+|([0-9]+(\.[0-9]+)?))\b/,
26
- keyword: /\b(do|else|elseif|for|if(?:\s+not)?|endif|next|then|to|downto|var|set)\b/i,
26
+ keyword:
27
+ /\b(do|else|elseif|for|if(?:\s+not)?|endif|next|then|to|downto|var|set)\b/i,
27
28
  operator: /==|!=|>|<|>=|<=|=/,
28
29
  variable: {
29
30
  pattern: /@\w+|\[\w+\]/,
30
31
  greedy: true
31
32
  },
32
- constant: /\b(xtmonth|xtmonthnumeric|xtday|xtdayofweek|xtyear|xtshortdate|xtlongdate)\b/i,
33
+ constant:
34
+ /\b(xtmonth|xtmonthnumeric|xtday|xtdayofweek|xtyear|xtshortdate|xtlongdate)\b/i,
33
35
  logical: /\b(and|or|not)\b/i
34
36
  }
35
37
  };
@@ -0,0 +1,3 @@
1
+ .hidden {
2
+ display: none;
3
+ }
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <slot class="hidden"></slot>
3
+ </template>
@@ -0,0 +1,41 @@
1
+ import { api, LightningElement } from "lwc";
2
+ import optimizelySdk from "@optimizely/optimizely-sdk";
3
+
4
+ // This is needed to specify user context (such as logged in, admin, ...etc).
5
+ // leave this as hard-coded for now until we create audiences in Optimizely.
6
+ const userId = "user123";
7
+
8
+ export default class FeatureFlag extends LightningElement {
9
+ @api flag!: string;
10
+
11
+ private optimizelyInstance: any;
12
+
13
+ private showElements(slot: any) {
14
+ slot.classList.remove("hidden");
15
+ }
16
+
17
+ connectedCallback(): void {
18
+ this.optimizelyInstance = optimizelySdk.createInstance({
19
+ sdkKey: process.env.OPTIMIZELY_SDK_KEY
20
+ });
21
+ }
22
+
23
+ renderedCallback(): void {
24
+ const slotEl = this.template.querySelector("slot") as any;
25
+
26
+ this.optimizelyInstance?.onReady().then(({ success, reason }: any) => {
27
+ if (!success) {
28
+ console.log(
29
+ `Optimizely client initialization unsuccessful, reason: ${reason}`
30
+ );
31
+ return;
32
+ }
33
+ const user = this.optimizelyInstance?.createUserContext(userId);
34
+ const decision = user?.decide(this.flag);
35
+
36
+ if (decision?.enabled) {
37
+ this.showElements(slotEl);
38
+ }
39
+ });
40
+ }
41
+ }
@@ -22,6 +22,16 @@
22
22
  translateY(14px);
23
23
  --dx-c-featured-content-header-swoop-display: block;
24
24
  --dx-c-featured-content-header-swoop-height: 30%;
25
+ --dx-c-featured-content-header-background-image-position: top right;
26
+ --dx-c-featured-content-header-background-image-size: contain;
27
+ --dx-c-featured-content-header-image-padding-top: calc(
28
+ 50% + var(--dx-c-featured-content-header-padding-horizontal) / 2
29
+ );
30
+ --dx-c-featured-content-header-image-margin-right: calc(
31
+ var(--dx-c-featured-content-header-padding-horizontal) * -1
32
+ );
33
+ --dx-c-featured-content-header-image-border-radius: var(--image-radius) 0 0
34
+ var(--image-radius);
25
35
  }
26
36
 
27
37
  .container {
@@ -50,8 +60,10 @@
50
60
  var(--dx-c-featured-content-header-padding-horizontal);
51
61
  background-image: var(--background-image);
52
62
  background-repeat: no-repeat;
53
- background-position: top right;
54
- background-size: contain;
63
+ background-position: var(
64
+ --dx-c-featured-content-header-background-image-position
65
+ );
66
+ background-size: var(--dx-c-featured-content-header-background-image-size);
55
67
  }
56
68
 
57
69
  /* LAYOUTS */
@@ -420,17 +432,13 @@ dx-image-and-label {
420
432
 
421
433
  @media screen and (max-width: 1401px) {
422
434
  .img-placement_below .image-container {
423
- padding-top: calc(
424
- 50% + var(--dx-c-featured-content-header-padding-horizontal) / 2
425
- );
435
+ padding-top: var(--dx-c-featured-content-header-image-padding-top);
426
436
  margin-top: var(--item-spacing);
427
- margin-right: calc(
428
- var(--dx-c-featured-content-header-padding-horizontal) * -1
429
- );
437
+ margin-right: var(--dx-c-featured-content-header-image-margin-right);
430
438
  }
431
439
 
432
440
  .img-placement_below img {
433
- border-radius: var(--image-radius) 0 0 var(--image-radius);
441
+ border-radius: var(--dx-c-featured-content-header-image-border-radius);
434
442
  }
435
443
  }
436
444
 
@@ -34,10 +34,7 @@
34
34
  </dx-button>
35
35
  </div>
36
36
  </div>
37
- <div
38
- if:true={showLargeNoSignup}
39
- class={largeNoSignupClassName}
40
- >
37
+ <div if:true={showLargeNoSignup} class={largeNoSignupClassName}>
41
38
  <div class="graphic graphic-large" alt=""></div>
42
39
  <slot name="custom-content" onslotchange={onSlotChange}></slot>
43
40
  </div>
@@ -42,7 +42,8 @@ export default class Footer extends LightningElement {
42
42
  private isSlotEmpty = true;
43
43
  private socialLinks = socialLinks;
44
44
  private termsLinks = termsLinks;
45
- private signupUrl = "https://www.salesforce.com/form/other/role-based-newsletter/?Developer=true";
45
+ private signupUrl =
46
+ "https://www.salesforce.com/form/other/role-based-newsletter/?Developer=true";
46
47
 
47
48
  @api
48
49
  set variant(value: FooterVariant) {
@@ -11,6 +11,7 @@ import {
11
11
  formattedDateWeekday,
12
12
  formattedDateYear
13
13
  } from "typings/custom";
14
+ import { DateTime } from "luxon";
14
15
 
15
16
  export default class FormattedDateTime extends LightningElement {
16
17
  @api weekday: formattedDateWeekday;
@@ -49,10 +50,11 @@ export default class FormattedDateTime extends LightningElement {
49
50
 
50
51
  formatDate(unformattedDate: Date, options: formattedDateOptions) {
51
52
  const locale = navigator.language;
52
- let formattedDateTime = Intl.DateTimeFormat(
53
- locale,
54
- options as any
55
- ).format(unformattedDate) as string;
53
+
54
+ let formattedDateTime = DateTime.fromISO(unformattedDate?.toISOString())
55
+ .setLocale(locale)
56
+ .toLocaleString(options as any);
57
+
56
58
  formattedDateTime = this.updateDayPeriodFormatting(formattedDateTime);
57
59
  return formattedDateTime;
58
60
  }
@@ -80,7 +80,11 @@ export default class Popover extends LightningElement {
80
80
  this.control.setAttribute("aria-expanded", "true");
81
81
 
82
82
  if (this.popover) {
83
- this.autoUpdateCleanup = autoUpdate(this.control, this.popover, this.setPosition);
83
+ this.autoUpdateCleanup = autoUpdate(
84
+ this.control,
85
+ this.popover,
86
+ this.setPosition
87
+ );
84
88
  }
85
89
 
86
90
  this.dispatchEvent(new CustomEvent("open"));
@@ -92,6 +92,14 @@ export default class TabPanelList extends LightningElement {
92
92
  this.tabElements.forEach((tab: any, index) => {
93
93
  tab.active = this.activeIndex === index;
94
94
  });
95
+
96
+ this.dispatchEvent(
97
+ new CustomEvent("tabchanged", {
98
+ detail: this.id || this.groupId,
99
+ bubbles: true,
100
+ composed: true
101
+ })
102
+ );
95
103
  }
96
104
 
97
105
  private focusActiveTab() {
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.