@salesforcedevs/dx-components 0.54.2 → 0.54.7-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/lwc.config.json +19 -19
- package/package.json +2 -4
- package/src/modules/dx/banner/banner.css +3 -3
- package/src/modules/dx/breadcrumbs/breadcrumbs.css +2 -2
- package/src/modules/dx/breadcrumbs/breadcrumbs.ts +27 -26
- package/src/modules/dx/button/button.css +10 -1
- package/src/modules/dx/button/button.ts +1 -1
- package/src/modules/dx/cardBlogPost/cardBlogPost.css +1 -1
- package/src/modules/dx/cardCallout/cardCallout.css +3 -3
- package/src/modules/dx/cardCallout/cardCallout.ts +2 -2
- package/src/modules/dx/cardContent/cardContent.css +3 -3
- package/src/modules/dx/cardContent/cardContent.ts +2 -2
- package/src/modules/dx/cardDemo/cardDemo.css +1 -1
- package/src/modules/dx/cardDocs/cardDocs.css +3 -3
- package/src/modules/dx/cardDocs/cardDocs.ts +1 -1
- package/src/modules/dx/cardEvent/cardEvent.css +3 -3
- package/src/modules/dx/cardExpanded/cardExpanded.css +1 -1
- package/src/modules/dx/cardExpanded/cardExpanded.ts +1 -1
- package/src/modules/dx/cardMinimal/cardMinimal.css +2 -2
- package/src/modules/dx/cardMinimal/cardMinimal.ts +1 -1
- package/src/modules/dx/cardNews/cardNews.css +3 -3
- package/src/modules/dx/cardNews/cardNews.ts +2 -2
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.css +3 -3
- package/src/modules/dx/cardSmall/cardSmall.css +3 -3
- package/src/modules/dx/cardSmall/cardSmall.ts +1 -1
- package/src/modules/dx/cardTitle/cardTitle.css +2 -2
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.css +1 -1
- package/src/modules/dx/cardTrial/cardTrial.css +3 -3
- package/src/modules/dx/cardTrial/cardTrial.ts +1 -1
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.css +1 -1
- package/src/modules/dx/checkbox/checkbox.css +2 -2
- package/src/modules/dx/checkboxGroup/checkboxGroup.css +1 -1
- package/src/modules/dx/checkboxGroup/checkboxGroup.ts +1 -1
- package/src/modules/dx/codeBlock/codeBlock.css +2 -2
- package/src/modules/dx/codeBlock/codeBlock.ts +2 -2
- package/src/modules/dx/dropdown/dropdown.css +1 -1
- package/src/modules/dx/dropdown/dropdown.ts +4 -4
- package/src/modules/dx/dropdownOption/dropdownOption.css +1 -1
- package/src/modules/dx/dropdownOption/dropdownOption.ts +3 -3
- package/src/modules/dx/emptyState/emptyState.css +2 -2
- package/src/modules/dx/feature/feature.css +2 -2
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.css +4 -4
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +2 -2
- package/src/modules/dx/featuresList/featuresList.css +2 -2
- package/src/modules/dx/featuresList/featuresList.ts +1 -1
- package/src/modules/dx/filterMenu/filterMenu.css +1 -1
- package/src/modules/dx/footer/footer.css +2 -2
- package/src/modules/dx/footer/footer.ts +4 -4
- package/src/modules/dx/footerOption/footerOption.ts +1 -1
- package/src/modules/dx/groupText/groupText.css +2 -2
- package/src/modules/dx/groupText/groupText.ts +3 -3
- package/src/modules/dx/header/header.css +1 -1
- package/src/modules/dx/header/header.ts +4 -4
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.css +1 -1
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.ts +5 -5
- package/src/modules/dx/headerMobileNavMenuOption/headerMobileNavMenuOption.ts +1 -1
- package/src/modules/dx/headerNav/headerNav.css +1 -1
- package/src/modules/dx/headerNav/headerNav.ts +5 -5
- package/src/modules/dx/headerSearch/headerSearch.css +1 -1
- package/src/modules/dx/headerSearch/headerSearch.ts +3 -3
- package/src/modules/dx/helmet/helmet.css +2 -2
- package/src/modules/dx/hr/hr.css +2 -2
- package/src/modules/dx/icon/icon.css +1 -1
- package/src/modules/dx/icon/icon.ts +1 -1
- package/src/modules/dx/iconBadge/iconBadge.css +1 -1
- package/src/modules/dx/iconBadge/iconBadge.ts +1 -1
- package/src/modules/dx/imageAndLabel/imageAndLabel.css +3 -3
- package/src/modules/dx/input/input.css +2 -2
- package/src/modules/dx/input/input.ts +1 -1
- package/src/modules/dx/logo/logo.css +2 -2
- package/src/modules/dx/modalDrawer/modalDrawer.ts +1 -1
- package/src/modules/dx/pagination/pagination.css +1 -1
- package/src/modules/dx/pagination/pagination.ts +1 -1
- package/src/modules/dx/podcastHost/podcastHost.css +2 -2
- package/src/modules/dx/popover/popover.css +1 -1
- package/src/modules/dx/popover/popover.ts +1 -1
- package/src/modules/dx/radioGroup/radioGroup.css +1 -1
- package/src/modules/dx/radioGroup/radioGroup.ts +1 -1
- package/src/modules/dx/section/section.css +2 -2
- package/src/modules/dx/section/section.ts +1 -1
- package/src/modules/dx/select/select.css +181 -8
- package/src/modules/dx/select/select.html +51 -54
- package/src/modules/dx/select/select.ts +128 -10
- package/src/modules/dx/sidebar/sidebar.css +2 -2
- package/src/modules/dx/sidebar/sidebar.ts +4 -4
- package/src/modules/dx/sidebarOld/sidebarOld.css +2 -2
- package/src/modules/dx/sidebarOld/sidebarOld.ts +3 -3
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +11 -5
- package/src/modules/dx/sidebarSearchResult/sidebarSearchResult.css +3 -3
- package/src/modules/dx/skipNavLink/skipNavLink.css +1 -1
- package/src/modules/dx/socials/socials.ts +1 -1
- package/src/modules/dx/tab/tab.css +1 -1
- package/src/modules/dx/tab/tab.ts +2 -2
- package/src/modules/dx/toc/toc.css +2 -2
- package/src/modules/dx/toc/toc.ts +1 -1
- package/src/modules/dx/topics/topics.ts +1 -1
- package/src/modules/dx/tree/tree.css +1 -1
- package/src/modules/dx/tree/tree.ts +1 -1
- package/src/modules/dx/treeItem/treeItem.css +1 -1
- package/src/modules/dx/treeItem/treeItem.ts +2 -2
- package/src/modules/dx/treeTile/treeTile.css +2 -2
- package/src/modules/dx/typeBadge/typeBadge.css +1 -1
- package/src/modules/dx/typeBadge/typeBadge.ts +1 -1
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.ts +1 -1
- package/src/modules/dx/vimeoPlayer/vimeoPlayer.css +1 -1
- package/src/modules/{base-elements → dxBaseElements}/archiveCard/archiveCard.ts +0 -0
- package/src/modules/{base-elements → dxBaseElements}/headerBase/headerBase.ts +5 -5
- package/src/modules/{base-elements → dxBaseElements}/matchMediaElement/matchMediaElement.ts +1 -1
- package/src/modules/{base-elements → dxBaseElements}/sidebarBase/sidebarBase.ts +0 -0
- package/src/modules/{helpers → dxHelpers}/animations/animations.css +0 -0
- package/src/modules/{helpers → dxHelpers}/button/button.css +0 -0
- package/src/modules/{helpers → dxHelpers}/card/card.css +1 -1
- package/src/modules/{helpers → dxHelpers}/code/code.css +0 -0
- package/src/modules/{helpers → dxHelpers}/commonHeader/commonHeader.css +2 -2
- package/src/modules/{helpers → dxHelpers}/reset/reset.css +0 -0
- package/src/modules/{helpers → dxHelpers}/sidebar/sidebar.css +0 -0
- package/src/modules/{helpers → dxHelpers}/table/table.css +0 -0
- package/src/modules/{helpers → dxHelpers}/text/text.css +0 -0
- package/src/modules/{utils → dxUtils}/analytics/analytics.ts +0 -0
- package/src/modules/{utils → dxUtils}/browser/browser.ts +0 -0
- package/src/modules/{utils → dxUtils}/constants/breakpoints.ts +0 -0
- package/src/modules/{utils → dxUtils}/constants/constants.ts +0 -0
- package/src/modules/{utils → dxUtils}/coveo/coveo.ts +0 -0
- package/src/modules/{utils → dxUtils}/css/css.ts +0 -0
- package/src/modules/{utils → dxUtils}/dates/dates.ts +0 -0
- package/src/modules/{utils → dxUtils}/devices/devices.ts +0 -0
- package/src/modules/{utils → dxUtils}/highlight/highlight.ts +1 -1
- package/src/modules/dxUtils/language/language.ts +21 -0
- package/src/modules/{utils → dxUtils}/normalizers/normalizers.ts +9 -21
- package/src/modules/{utils → dxUtils}/options/options.ts +13 -9
- package/src/modules/{utils → dxUtils}/prismjs/prismjs.html +0 -0
- package/src/modules/{utils → dxUtils}/prismjs/prismjs.ts +0 -0
- package/src/modules/{utils → dxUtils}/queryCoordinator/queryCoordinator.ts +0 -0
- package/src/modules/{utils → dxUtils}/recentSearches/recentSearches.ts +0 -0
- package/src/modules/{utils → dxUtils}/regexps/regexps.ts +0 -0
- package/src/modules/{utils → dxUtils}/seo/seo.ts +0 -0
- package/src/modules/{utils → dxUtils}/slot/slot.ts +0 -0
- package/src/modules/{utils → dxUtils}/wordpress/wordpress.ts +0 -0
- package/LICENSE +0 -12
- package/src/modules/helpers/slds/slds.css +0 -191
|
@@ -1,60 +1,57 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<option if:false={value} value="" disabled>
|
|
27
|
-
{placeholder}
|
|
28
|
-
</option>
|
|
29
|
-
</template>
|
|
30
|
-
<template for:each={options} for:item="option">
|
|
31
|
-
<template if:true={option.disabled}>
|
|
32
|
-
<option
|
|
33
|
-
disabled
|
|
34
|
-
key={option.value}
|
|
35
|
-
value={option.value}
|
|
36
|
-
>
|
|
37
|
-
{option.label}
|
|
38
|
-
</option>
|
|
2
|
+
<div class={containerClass}>
|
|
3
|
+
<label class="form-element_label" for="select">
|
|
4
|
+
{label}
|
|
5
|
+
<template if:true={required}>
|
|
6
|
+
<abbr>*</abbr>
|
|
7
|
+
</template>
|
|
8
|
+
</label>
|
|
9
|
+
<div class="form-element_control">
|
|
10
|
+
<div class="select_container">
|
|
11
|
+
<select
|
|
12
|
+
autocomplete={autocomplete}
|
|
13
|
+
class={selectClass}
|
|
14
|
+
disabled={disabled}
|
|
15
|
+
id="select"
|
|
16
|
+
name={name}
|
|
17
|
+
onblur={handleBlur}
|
|
18
|
+
onchange={handleChange}
|
|
19
|
+
onfocus={handleFocus}
|
|
20
|
+
required={required}
|
|
21
|
+
accesskey={accessKey}
|
|
22
|
+
size={size}
|
|
23
|
+
>
|
|
24
|
+
<template if:true={placeholder}>
|
|
25
|
+
<option value="" disabled>{placeholder}</option>
|
|
39
26
|
</template>
|
|
40
|
-
<template
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
<template for:each={options} for:item="option">
|
|
28
|
+
<template if:true={option.disabled}>
|
|
29
|
+
<option
|
|
30
|
+
disabled
|
|
31
|
+
key={option.value}
|
|
32
|
+
value={option.value}
|
|
33
|
+
>
|
|
34
|
+
{option.label}
|
|
35
|
+
</option>
|
|
36
|
+
</template>
|
|
37
|
+
<template if:false={option.disabled}>
|
|
38
|
+
<option key={option.value} value={option.value}>
|
|
39
|
+
{option.label}
|
|
40
|
+
</option>
|
|
41
|
+
</template>
|
|
44
42
|
</template>
|
|
45
|
-
</
|
|
46
|
-
</
|
|
43
|
+
</select>
|
|
44
|
+
</div>
|
|
47
45
|
</div>
|
|
46
|
+
<template if:true={helpMessage}>
|
|
47
|
+
<div
|
|
48
|
+
aria-live="assertive"
|
|
49
|
+
class="form-element_help"
|
|
50
|
+
data-help-message
|
|
51
|
+
id="help-message"
|
|
52
|
+
>
|
|
53
|
+
{helpMessage}
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
48
56
|
</div>
|
|
49
|
-
|
|
50
|
-
<template if:true={_helpMessage}>
|
|
51
|
-
<div
|
|
52
|
-
aria-live="assertive"
|
|
53
|
-
class="slds-form-element__help"
|
|
54
|
-
data-help-message
|
|
55
|
-
id="help-message"
|
|
56
|
-
>
|
|
57
|
-
{_helpMessage}
|
|
58
|
-
</div>
|
|
59
|
-
</template>
|
|
60
57
|
</template>
|
|
@@ -1,23 +1,141 @@
|
|
|
1
1
|
import cx from "classnames";
|
|
2
|
-
import { api } from "lwc";
|
|
3
|
-
import
|
|
4
|
-
import { toJson } from "
|
|
2
|
+
import { LightningElement, api } from "lwc";
|
|
3
|
+
import { SelectOption } from "typings/custom";
|
|
4
|
+
import { toJson, normalizeBoolean } from "dxUtils/normalizers";
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const DEFAULT_MISSING_MESSAGE = "This field is required";
|
|
7
|
+
|
|
8
|
+
export default class Select extends LightningElement {
|
|
9
|
+
@api accessKey!: string;
|
|
10
|
+
@api autocomplete?: string;
|
|
11
|
+
@api label?: string;
|
|
12
|
+
@api messageWhenValueMissing: string = DEFAULT_MISSING_MESSAGE;
|
|
13
|
+
@api name?: string;
|
|
7
14
|
@api placeholder?: string;
|
|
15
|
+
@api size?: string;
|
|
16
|
+
|
|
17
|
+
@api
|
|
18
|
+
get disabled() {
|
|
19
|
+
return this._disabled;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
set disabled(value) {
|
|
23
|
+
this._disabled = normalizeBoolean(value);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@api
|
|
27
|
+
get options() {
|
|
28
|
+
return this._options;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
set options(value) {
|
|
32
|
+
this._options = toJson(value);
|
|
33
|
+
}
|
|
8
34
|
|
|
9
35
|
@api
|
|
10
|
-
get
|
|
11
|
-
return this.
|
|
36
|
+
get required() {
|
|
37
|
+
return this._required;
|
|
12
38
|
}
|
|
13
39
|
|
|
14
|
-
set
|
|
15
|
-
this.
|
|
40
|
+
set required(value) {
|
|
41
|
+
this._required = normalizeBoolean(value);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@api
|
|
45
|
+
get value() {
|
|
46
|
+
return this._value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
set value(value) {
|
|
50
|
+
this._value = value;
|
|
51
|
+
this.updateSelectValue();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
_disabled = false;
|
|
55
|
+
_size = "";
|
|
56
|
+
_required = false;
|
|
57
|
+
_options: Array<SelectOption> = [];
|
|
58
|
+
_value: string = "";
|
|
59
|
+
_selectElement: HTMLSelectElement | null = null;
|
|
60
|
+
helpMessage?: string = "";
|
|
61
|
+
|
|
62
|
+
renderedCallback(): void {
|
|
63
|
+
this.updateSelectValue();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
get containerClass() {
|
|
67
|
+
return cx("form-element", this.hasError && "has-error");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get hasError(): boolean {
|
|
71
|
+
return !!this.helpMessage;
|
|
16
72
|
}
|
|
17
73
|
|
|
18
74
|
get selectClass() {
|
|
19
|
-
return cx("
|
|
20
|
-
|
|
75
|
+
return cx("select-element", {
|
|
76
|
+
"select-element_placeholder": this.placeholder && !this.value
|
|
21
77
|
});
|
|
22
78
|
}
|
|
79
|
+
|
|
80
|
+
get selectElement() {
|
|
81
|
+
if (!this._selectElement) {
|
|
82
|
+
this._selectElement =
|
|
83
|
+
this.template.querySelector<HTMLSelectElement>("select");
|
|
84
|
+
}
|
|
85
|
+
return this._selectElement;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@api
|
|
89
|
+
blur(): void {
|
|
90
|
+
if (this.selectElement) {
|
|
91
|
+
this.selectElement.blur();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@api
|
|
96
|
+
focus(): void {
|
|
97
|
+
if (this.selectElement) {
|
|
98
|
+
this.selectElement.focus();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@api
|
|
103
|
+
reportValidity(): boolean {
|
|
104
|
+
const isInvalid = this._required && !this._value;
|
|
105
|
+
this.helpMessage = isInvalid
|
|
106
|
+
? this.messageWhenValueMissing || DEFAULT_MISSING_MESSAGE
|
|
107
|
+
: "";
|
|
108
|
+
return !isInvalid;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
handleBlur(): void {
|
|
112
|
+
this.reportValidity();
|
|
113
|
+
this.dispatchEvent(new CustomEvent("blur"));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
handleChange(event: Event & { target: HTMLSelectElement }): void {
|
|
117
|
+
const { value } = event.target;
|
|
118
|
+
this._value = value;
|
|
119
|
+
this.dispatchEvent(
|
|
120
|
+
new CustomEvent("change", {
|
|
121
|
+
detail: { value }
|
|
122
|
+
})
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
handleFocus(): void {
|
|
127
|
+
this.helpMessage = "";
|
|
128
|
+
this.dispatchEvent(new CustomEvent("focus"));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// We have to do it programmatically because value binding doesn't work apparently.
|
|
132
|
+
updateSelectValue(): void {
|
|
133
|
+
if (!this._value && !this.placeholder) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (this.selectElement) {
|
|
138
|
+
this.selectElement.value = this._value;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
23
141
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import cx from "classnames";
|
|
2
|
-
import { track as trackAnalytics } from "utils/analytics";
|
|
3
2
|
import { api, track } from "lwc";
|
|
4
3
|
import {
|
|
5
4
|
TreeNode,
|
|
6
5
|
SidebarGtmAction,
|
|
7
6
|
SidebarSearchResult
|
|
8
7
|
} from "typings/custom";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { track as trackAnalytics } from "dxUtils/analytics";
|
|
9
|
+
import { getSidebarSearchParams } from "dxUtils/coveo";
|
|
10
|
+
import { toJson } from "dxUtils/normalizers";
|
|
11
11
|
import SidebarSearch from "dx/sidebarSearch";
|
|
12
|
-
import { SidebarBase } from "
|
|
12
|
+
import { SidebarBase } from "dxBaseElements/sidebarBase";
|
|
13
13
|
|
|
14
14
|
const MOBILE_SIZE_MATCH = "768px";
|
|
15
15
|
const TOGGLE_BUTTON_LABEL = "Toggle Sidebar";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import cx from "classnames";
|
|
2
|
-
import { track } from "
|
|
2
|
+
import { track } from "dxUtils/analytics";
|
|
3
3
|
import { api } from "lwc";
|
|
4
4
|
|
|
5
5
|
import { TreeNode, SidebarGtmAction } from "typings/custom";
|
|
6
|
-
import { toJson } from "
|
|
7
|
-
import { SidebarBase } from "
|
|
6
|
+
import { toJson } from "dxUtils/normalizers";
|
|
7
|
+
import { SidebarBase } from "dxBaseElements/sidebarBase";
|
|
8
8
|
|
|
9
9
|
const WAIT_TIME = 500;
|
|
10
10
|
const MOBILE_SIZE_MATCH = "768px";
|
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
SearchAppState,
|
|
15
15
|
loadQueryActions
|
|
16
16
|
} from "@coveo/headless";
|
|
17
|
-
import { buildSearchEngine, getSidebarSearchParams } from "
|
|
18
|
-
import { RecentSearches } from "
|
|
19
|
-
import { toJson } from "
|
|
17
|
+
import { buildSearchEngine, getSidebarSearchParams } from "dxUtils/coveo";
|
|
18
|
+
import { RecentSearches } from "dxUtils/recentSearches";
|
|
19
|
+
import { toJson } from "dxUtils/normalizers";
|
|
20
20
|
import {
|
|
21
21
|
Option,
|
|
22
22
|
PopoverRequestCloseType,
|
|
@@ -292,7 +292,7 @@ export default class SidebarSearch extends LightningElement {
|
|
|
292
292
|
}: Result): SidebarSearchResult => {
|
|
293
293
|
// discussion about this normalization here: https://salesforce-internal.slack.com/archives/C020S6784JX/p1639506238376600
|
|
294
294
|
|
|
295
|
-
let pathname;
|
|
295
|
+
let pathname, queryParam;
|
|
296
296
|
if (sfhtml_url__c) {
|
|
297
297
|
pathname = `/docs/${sfhtml_url__c}`;
|
|
298
298
|
} else {
|
|
@@ -303,9 +303,15 @@ export default class SidebarSearch extends LightningElement {
|
|
|
303
303
|
? ".html"
|
|
304
304
|
: "";
|
|
305
305
|
pathname = `${url.pathname}${extension}`;
|
|
306
|
+
queryParam = url.search;
|
|
306
307
|
}
|
|
307
308
|
|
|
308
|
-
|
|
309
|
+
let href;
|
|
310
|
+
if (queryParam) {
|
|
311
|
+
href = `${pathname}${queryParam}&q=${this.value}`;
|
|
312
|
+
} else {
|
|
313
|
+
href = `${pathname}?q=${this.value}`;
|
|
314
|
+
}
|
|
309
315
|
|
|
310
316
|
return {
|
|
311
317
|
title,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
|
-
import { track } from "
|
|
2
|
+
import { track } from "dxUtils/analytics";
|
|
3
3
|
import cx from "classnames";
|
|
4
4
|
import { TabVariant } from "typings/custom";
|
|
5
|
-
import { normalizeBoolean } from "
|
|
5
|
+
import { normalizeBoolean } from "dxUtils/normalizers";
|
|
6
6
|
|
|
7
7
|
export default class Tab extends LightningElement {
|
|
8
8
|
@api label: string | null = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api, track } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { ContentElement } from "typings/custom";
|
|
4
|
-
import { toJson } from "
|
|
4
|
+
import { toJson } from "dxUtils/normalizers";
|
|
5
5
|
|
|
6
6
|
export default class Toc extends LightningElement {
|
|
7
7
|
@api title!: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import { TreeNode, InternalTreeNode } from "typings/custom";
|
|
3
|
-
import { toJson } from "
|
|
3
|
+
import { toJson } from "dxUtils/normalizers";
|
|
4
4
|
import { TreeHandler } from "./treeHandler";
|
|
5
5
|
|
|
6
6
|
export default class Tree extends LightningElement {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import { InternalTreeNode } from "typings/custom";
|
|
3
|
-
import { track } from "
|
|
3
|
+
import { track } from "dxUtils/analytics";
|
|
4
4
|
import { SidebarGtmAction } from "typings/custom";
|
|
5
|
-
import { isInViewport } from "
|
|
5
|
+
import { isInViewport } from "dxUtils/browser";
|
|
6
6
|
|
|
7
7
|
const DEFAULT_TARGET = "_self";
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
|
-
import { normalizeToArray } from "
|
|
2
|
+
import { normalizeToArray } from "dxUtils/normalizers";
|
|
3
3
|
import { TypeBadgeSize } from "typings/custom";
|
|
4
4
|
|
|
5
5
|
export default class TypeBadgeGroup extends LightningElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "dxHelpers/reset";
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
|
-
import { Brand,
|
|
4
|
-
import { toJson } from "
|
|
5
|
-
import { track } from "
|
|
3
|
+
import { Brand, OptionWithLink, OptionWithNested } from "typings/custom";
|
|
4
|
+
import { toJson } from "dxUtils/normalizers";
|
|
5
|
+
import { track } from "dxUtils/analytics";
|
|
6
6
|
|
|
7
7
|
const VALID_BRANDS = [
|
|
8
8
|
"analytics",
|
|
@@ -61,8 +61,8 @@ export abstract class HeaderBase extends LightningElement {
|
|
|
61
61
|
this._versions = toJson(value);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
private _navItems!:
|
|
65
|
-
private _versions!:
|
|
64
|
+
private _navItems!: OptionWithNested[];
|
|
65
|
+
private _versions!: OptionWithLink[];
|
|
66
66
|
private matchMedia!: MediaQueryList;
|
|
67
67
|
protected mobile: boolean = false;
|
|
68
68
|
private mobileNavMenuValue: string | null = null;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Language } from "typings/custom";
|
|
2
|
+
|
|
3
|
+
export const getLanguageDisplayTextById = (
|
|
4
|
+
languages: Language[],
|
|
5
|
+
languageId: string
|
|
6
|
+
): string => {
|
|
7
|
+
const language = languages.find(
|
|
8
|
+
(languageItem) => languageItem.id === languageId
|
|
9
|
+
);
|
|
10
|
+
return language ? language.displayText : "";
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const isGivenLanguageSupported = (
|
|
14
|
+
languages: Language[],
|
|
15
|
+
languageId: string
|
|
16
|
+
): boolean => {
|
|
17
|
+
const languageIndex = languages.findIndex(
|
|
18
|
+
(languageItem) => languageItem.id === languageId
|
|
19
|
+
);
|
|
20
|
+
return languageIndex >= 0;
|
|
21
|
+
};
|