@salesforcedevs/dx-components 1.3.194-langpicker19-alpha → 1.3.194-langpicker20-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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.194-langpicker19-alpha",
3
+ "version": "1.3.194-langpicker20-alpha",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -82,7 +82,8 @@
82
82
  <div if:true={hasSidebarFooter} class="footer-nav">
83
83
  <doc-sidebar-footer-nav
84
84
  lang-value-path={langValuePath}
85
- sidebar-footer-content={sidebarFooterContent}
85
+ language={language}
86
+ languages={languages}
86
87
  ></doc-sidebar-footer-nav>
87
88
  </div>
88
89
  </div>
@@ -103,7 +104,10 @@
103
104
  <div class="footer-nav">
104
105
  <doc-sidebar-footer-nav
105
106
  lang-value-path={langValuePath}
106
- sidebar-footer-content={sidebarFooterContent}
107
+ language={language}
108
+ languages={languages}
109
+ bail-href={bailHref}
110
+ bail-label={bailLabel}
107
111
  ></doc-sidebar-footer-nav>
108
112
  </div>
109
113
  </template>
@@ -1,10 +1,11 @@
1
1
  import cx from "classnames";
2
2
  import { api, track } from "lwc";
3
- import { TreeNode, SidebarSearchResult, SidebarFooter } from "typings/custom";
3
+ import { TreeNode, SidebarSearchResult } from "typings/custom";
4
4
  import { getSidebarSearchParams } from "dxUtils/coveo";
5
5
  import { toJson } from "dxUtils/normalizers";
6
6
  import SidebarSearch from "dx/sidebarSearch";
7
7
  import { SidebarBase } from "dxBaseElements/sidebarBase";
8
+ import type { OptionWithLink } from "typings/custom";
8
9
 
9
10
  const MOBILE_SIZE_MATCH = "768px";
10
11
 
@@ -15,7 +16,10 @@ export default class Sidebar extends SidebarBase {
15
16
  @api coveoAdvancedQueryConfig!: string;
16
17
  @api header: string = "";
17
18
  @api langValuePath: string = "id";
18
- @api sidebarFooterContent!: SidebarFooter;
19
+ @api languages!: OptionWithLink[];
20
+ @api language!: string;
21
+ @api bailHref!: string;
22
+ @api bailLabel!: string;
19
23
 
20
24
  @api
21
25
  get value() {
@@ -262,16 +266,13 @@ export default class Sidebar extends SidebarBase {
262
266
  private get hasSidebarFooter(): boolean {
263
267
  if (this.mobile) {
264
268
  return (
265
- !!(
266
- this.sidebarFooterContent.languages &&
267
- toJson(this.sidebarFooterContent.languages).length > 1
268
- ) && this.expanded
269
+ !!(this.languages && toJson(this.languages).length > 1) &&
270
+ this.expanded
269
271
  );
270
272
  }
271
273
  return !!(
272
- (this.sidebarFooterContent.languages &&
273
- toJson(this.sidebarFooterContent.languages).length > 1) ||
274
- Boolean(this.sidebarFooterContent.bailHref)
274
+ (this.languages && toJson(this.languages).length > 1) ||
275
+ Boolean(this.bailHref)
275
276
  );
276
277
  }
277
278
  }
@@ -70,7 +70,8 @@
70
70
  <div if:true={hasSidebarFooter} class="footer-nav">
71
71
  <doc-sidebar-footer-nav
72
72
  lang-value-path={langValuePath}
73
- sidebar-footer-content={sidebarFooterContent}
73
+ language={language}
74
+ languages={languages}
74
75
  ></doc-sidebar-footer-nav>
75
76
  </div>
76
77
  </template>
@@ -79,7 +80,10 @@
79
80
  <div class="footer-nav">
80
81
  <doc-sidebar-footer-nav
81
82
  lang-value-path={langValuePath}
82
- sidebar-footer-content={sidebarFooterContent}
83
+ language={language}
84
+ languages={languages}
85
+ bail-href={bailHref}
86
+ bail-label={bailLabel}
83
87
  ></doc-sidebar-footer-nav>
84
88
  </div>
85
89
  </template>
@@ -1,9 +1,10 @@
1
1
  import cx from "classnames";
2
2
  import { api } from "lwc";
3
3
 
4
- import { TreeNode, SidebarFooter } from "typings/custom";
4
+ import { TreeNode } from "typings/custom";
5
5
  import { toJson } from "dxUtils/normalizers";
6
6
  import { SidebarBase } from "dxBaseElements/sidebarBase";
7
+ import type { OptionWithLink } from "typings/custom";
7
8
 
8
9
  const WAIT_TIME = 500;
9
10
  const MOBILE_SIZE_MATCH = "768px";
@@ -11,7 +12,10 @@ const MOBILE_SIZE_MATCH = "768px";
11
12
  export default class Sidebar extends SidebarBase {
12
13
  @api header: string = "";
13
14
  @api langValuePath: string = "id";
14
- @api sidebarFooterContent!: SidebarFooter;
15
+ @api languages!: OptionWithLink[];
16
+ @api language!: string;
17
+ @api bailHref!: string;
18
+ @api bailLabel!: string;
15
19
 
16
20
  @api
17
21
  get value() {
@@ -195,15 +199,11 @@ export default class Sidebar extends SidebarBase {
195
199
 
196
200
  private get hasSidebarFooter(): boolean {
197
201
  if (this.mobile) {
198
- return !!(
199
- this.sidebarFooterContent?.languages &&
200
- toJson(this.sidebarFooterContent?.languages).length > 1
201
- );
202
+ return !!(this.languages && toJson(this.languages).length > 1);
202
203
  }
203
204
  return !!(
204
- (this.sidebarFooterContent?.languages &&
205
- toJson(this.sidebarFooterContent?.languages).length > 1) ||
206
- Boolean(this.sidebarFooterContent?.bailHref)
205
+ (this.languages && toJson(this.languages).length > 1) ||
206
+ Boolean(this.bailHref)
207
207
  );
208
208
  }
209
209
  }