@salesforcedevs/dx-components 1.3.14 → 1.3.16
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 +5 -3
- package/src/modules/dx/banner/banner.css +46 -0
- package/src/modules/dx/banner/banner.html +13 -0
- package/src/modules/dx/banner/banner.ts +12 -0
- package/src/modules/dx/formattedDateTime/formattedDateTime.ts +10 -4
- package/src/modules/dx/header/header.html +4 -0
- package/src/modules/dxBaseElements/headerBase/headerBase.ts +13 -1
package/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.16",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -32,9 +32,11 @@
|
|
|
32
32
|
"@types/lodash.defaults": "^4.2.7",
|
|
33
33
|
"@types/lodash.get": "^4.4.6",
|
|
34
34
|
"@types/lodash.kebabcase": "^4.1.7",
|
|
35
|
+
"@types/luxon": "^3.1.0",
|
|
35
36
|
"@types/uuid": "^8.3.4",
|
|
36
37
|
"@types/vimeo__player": "^2.16.2",
|
|
37
|
-
"eventsourcemock": "^2.0.0"
|
|
38
|
+
"eventsourcemock": "^2.0.0",
|
|
39
|
+
"luxon": "^3.1.0"
|
|
38
40
|
},
|
|
39
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "9bc872aa74451b077e4c1d70a7b2378a01a2337a"
|
|
40
42
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
|
|
4
|
+
.container {
|
|
5
|
+
--primary-color: var(--dx-g-cloud-blue-vibrant-50);
|
|
6
|
+
--secondary-color: var(--dx-g-cloud-blue-vibrant-40);
|
|
7
|
+
|
|
8
|
+
width: 100%;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
min-height: 24px;
|
|
14
|
+
padding: 0 var(--dx-g-page-padding-horizontal);
|
|
15
|
+
background: repeating-linear-gradient(
|
|
16
|
+
45deg,
|
|
17
|
+
var(--primary-color),
|
|
18
|
+
var(--primary-color) 20px,
|
|
19
|
+
var(--secondary-color) 20px,
|
|
20
|
+
var(--secondary-color) 40px
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.container_inner {
|
|
25
|
+
height: 100%;
|
|
26
|
+
display: flex;
|
|
27
|
+
background: var(--primary-color);
|
|
28
|
+
padding: var(--dx-g-spacing-xs) var(--dx-g-spacing-sm);
|
|
29
|
+
color: white;
|
|
30
|
+
font-weight: bold;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.container a {
|
|
34
|
+
text-decoration: underline;
|
|
35
|
+
transition: var(--dx-g-transition-hue-1x);
|
|
36
|
+
margin-right: 4px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.container a:hover {
|
|
40
|
+
opacity: 0.8;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.container dx-icon {
|
|
44
|
+
margin-right: var(--dx-g-spacing-sm);
|
|
45
|
+
margin-top: var(--dx-g-spacing-2xs);
|
|
46
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container">
|
|
3
|
+
<div class="container_inner dx-text-body-4">
|
|
4
|
+
<dx-icon symbol="announcement"></dx-icon>
|
|
5
|
+
<!--
|
|
6
|
+
NOTE: Here we are rendering mark up using lwc:dom & innerHTML
|
|
7
|
+
option instead of slots because the html markup will come as a
|
|
8
|
+
property to the component from a configuration
|
|
9
|
+
-->
|
|
10
|
+
<div lwc:dom="manual" class="info-container"></div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import { setContainerInnerHtml } from "dxUtils/lwc";
|
|
3
|
+
|
|
4
|
+
export default class Banner extends LightningElement {
|
|
5
|
+
@api bannerMarkup =
|
|
6
|
+
'<span><a href="https://forms.gle/TdSyKFPHXoBx7seM9" target="blank">Share your feedback</a>about our new site.</span>';
|
|
7
|
+
|
|
8
|
+
renderedCallback() {
|
|
9
|
+
const container = this.template.querySelector(".info-container");
|
|
10
|
+
setContainerInnerHtml(container, this.bannerMarkup);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
formattedDateYear
|
|
12
12
|
} from "typings/custom";
|
|
13
13
|
|
|
14
|
+
import { DateTime } from "luxon";
|
|
15
|
+
|
|
14
16
|
export default class FormattedDateTime extends LightningElement {
|
|
15
17
|
@api weekday: formattedDateWeekday;
|
|
16
18
|
@api year: formattedDateYear;
|
|
@@ -27,7 +29,11 @@ export default class FormattedDateTime extends LightningElement {
|
|
|
27
29
|
return;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
this._unformattedDate =
|
|
32
|
+
this._unformattedDate = DateTime.fromISO(value)
|
|
33
|
+
.plus({
|
|
34
|
+
hour: 1
|
|
35
|
+
})
|
|
36
|
+
.toJSDate();
|
|
31
37
|
|
|
32
38
|
if (this._unformattedDate.toString() === "Invalid Date") {
|
|
33
39
|
// this is a fix for Safari since it doesn't support date strings with 'yyyy/mm/dd' patterns
|
|
@@ -62,7 +68,7 @@ export default class FormattedDateTime extends LightningElement {
|
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
getOptions() {
|
|
65
|
-
|
|
71
|
+
return {
|
|
66
72
|
weekday: this.weekday || undefined,
|
|
67
73
|
year: this.year || undefined,
|
|
68
74
|
month: this.month || undefined,
|
|
@@ -70,8 +76,8 @@ export default class FormattedDateTime extends LightningElement {
|
|
|
70
76
|
hour: this.hour || undefined,
|
|
71
77
|
minute: this.minute || undefined,
|
|
72
78
|
second: this.second,
|
|
73
|
-
timeZoneName: this.timeZoneName || undefined
|
|
79
|
+
timeZoneName: this.timeZoneName || undefined,
|
|
80
|
+
timeZone: "America/Los_Angeles"
|
|
74
81
|
};
|
|
75
|
-
return options;
|
|
76
82
|
}
|
|
77
83
|
}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
<dx-brand-theme-provider brand={brand}>
|
|
3
3
|
<header class={className}>
|
|
4
4
|
<dx-skip-nav-link></dx-skip-nav-link>
|
|
5
|
+
<dx-banner
|
|
6
|
+
if:true={showBanner}
|
|
7
|
+
banner-markup={bannerMarkup}
|
|
8
|
+
></dx-banner>
|
|
5
9
|
<div class="header_l1">
|
|
6
10
|
<dx-logo label={title}></dx-logo>
|
|
7
11
|
<div class="header-cta-container">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { Brand, OptionWithLink, OptionWithNested } from "typings/custom";
|
|
4
|
-
import { toJson } from "dxUtils/normalizers";
|
|
4
|
+
import { toJson, normalizeBoolean } from "dxUtils/normalizers";
|
|
5
5
|
import { track } from "dxUtils/analytics";
|
|
6
6
|
|
|
7
7
|
const VALID_BRANDS = [
|
|
@@ -41,6 +41,8 @@ export abstract class HeaderBase extends LightningElement {
|
|
|
41
41
|
@api subtitle!: string;
|
|
42
42
|
@api title: string = "Salesforce";
|
|
43
43
|
@api version?: string | null = null;
|
|
44
|
+
@api bannerMarkup =
|
|
45
|
+
'<span><a href="https://forms.gle/oWYTbH9RvGyt9uxx7" target="blank">Share your feedback</a>about our new site.</span>';
|
|
44
46
|
|
|
45
47
|
@api
|
|
46
48
|
get navItems() {
|
|
@@ -59,6 +61,15 @@ export abstract class HeaderBase extends LightningElement {
|
|
|
59
61
|
this._versions = toJson(value);
|
|
60
62
|
}
|
|
61
63
|
|
|
64
|
+
@api
|
|
65
|
+
get showBanner() {
|
|
66
|
+
return this._showBanner && this.bannerMarkup;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
set showBanner(value) {
|
|
70
|
+
this._showBanner = normalizeBoolean(value);
|
|
71
|
+
}
|
|
72
|
+
|
|
62
73
|
private _navItems!: OptionWithNested[];
|
|
63
74
|
private _versions!: OptionWithLink[];
|
|
64
75
|
private matchMedia!: MediaQueryList;
|
|
@@ -67,6 +78,7 @@ export abstract class HeaderBase extends LightningElement {
|
|
|
67
78
|
private showMobileNavMenu: boolean = false;
|
|
68
79
|
private showNavScrollShadow: boolean = false;
|
|
69
80
|
protected isSearchOpen: boolean = false;
|
|
81
|
+
private _showBanner?: boolean = false;
|
|
70
82
|
|
|
71
83
|
get url() {
|
|
72
84
|
return this.href ? new URL(this.href!) : window.location;
|