@salesforcedevs/docs-components 1.3.194-langpicker10-alpha → 1.3.194-langpicker12-alpha
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
|
@@ -12,6 +12,27 @@
|
|
|
12
12
|
>
|
|
13
13
|
{bailLabel}
|
|
14
14
|
</dx-button>
|
|
15
|
+
<dx-dropdown
|
|
16
|
+
if:true={hasLanguages}
|
|
17
|
+
class="footer_lang-dropdown"
|
|
18
|
+
options={languages}
|
|
19
|
+
small
|
|
20
|
+
value-path={langValuePath}
|
|
21
|
+
value={language}
|
|
22
|
+
onchange={onLangChange}
|
|
23
|
+
variant="docoption"
|
|
24
|
+
>
|
|
25
|
+
<dx-button
|
|
26
|
+
aria-label="Select Language"
|
|
27
|
+
variant="inline"
|
|
28
|
+
icon-size="large"
|
|
29
|
+
icon-symbol="world"
|
|
30
|
+
>
|
|
31
|
+
{languageLabel}
|
|
32
|
+
</dx-button>
|
|
33
|
+
</dx-dropdown>
|
|
34
|
+
</div>
|
|
35
|
+
<div if:true={mobile} class="footer-display">
|
|
15
36
|
<dx-dropdown
|
|
16
37
|
if:true={hasLanguages}
|
|
17
38
|
class="footer_lang-dropdown"
|
|
@@ -5,6 +5,8 @@ import { toJson } from "dxUtils/normalizers";
|
|
|
5
5
|
import get from "lodash.get";
|
|
6
6
|
import { track } from "dxUtils/analytics";
|
|
7
7
|
|
|
8
|
+
const MOBILE_SIZE_MATCH = "768px";
|
|
9
|
+
|
|
8
10
|
export default class ContentLayout extends LightningElement {
|
|
9
11
|
@api langValuePath: string = "id";
|
|
10
12
|
@api bailHref?: string | null = null;
|
|
@@ -32,6 +34,8 @@ export default class ContentLayout extends LightningElement {
|
|
|
32
34
|
|
|
33
35
|
private _languages!: OptionWithLink[];
|
|
34
36
|
private _language: string | null = null;
|
|
37
|
+
private mobile: boolean = false;
|
|
38
|
+
private matchMedia!: MediaQueryList;
|
|
35
39
|
|
|
36
40
|
private get hasLanguages(): boolean {
|
|
37
41
|
return !!(this.languages && this.languages.length > 1);
|
|
@@ -81,4 +85,20 @@ export default class ContentLayout extends LightningElement {
|
|
|
81
85
|
...payload
|
|
82
86
|
});
|
|
83
87
|
}
|
|
88
|
+
|
|
89
|
+
connectedCallback() {
|
|
90
|
+
this.matchMedia = window.matchMedia(
|
|
91
|
+
`(max-width: ${MOBILE_SIZE_MATCH})`
|
|
92
|
+
);
|
|
93
|
+
this.onMediaChange(this.matchMedia);
|
|
94
|
+
this.matchMedia.addEventListener("change", this.onMediaChange);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
disconnectedCallback() {
|
|
98
|
+
this.matchMedia.removeEventListener("change", this.onMediaChange);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
private onMediaChange = (event: MediaQueryListEvent | MediaQueryList) => {
|
|
102
|
+
this.mobile = event.matches;
|
|
103
|
+
};
|
|
84
104
|
}
|