@salesforcedevs/dx-components 0.26.2 → 0.26.3-alpha.1
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 +2 -1
- package/package.json +2 -7
- package/src/modules/{utils-internal → base-elements}/archiveCard/archiveCard.ts +0 -0
- package/src/modules/{utils-internal → base-elements}/headerBase/headerBase.ts +0 -0
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.ts +1 -1
- package/src/modules/dx/cardCallout/cardCallout.ts +1 -1
- package/src/modules/dx/cardContent/cardContent.ts +2 -2
- package/src/modules/dx/cardDocs/cardDocs.ts +1 -1
- package/src/modules/dx/cardExpanded/cardExpanded.ts +1 -1
- package/src/modules/dx/cardMinimal/cardMinimal.ts +1 -1
- package/src/modules/dx/cardNews/cardNews.ts +1 -1
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.ts +1 -1
- package/src/modules/dx/cardSmall/cardSmall.ts +1 -1
- package/src/modules/dx/codeBlock/codeBlock.ts +1 -1
- package/src/modules/dx/dropdown/dropdown.ts +1 -1
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +1 -1
- package/src/modules/dx/groupText/groupText.ts +1 -1
- package/src/modules/dx/header/header.ts +1 -1
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.ts +1 -1
- package/src/modules/dx/headerSearch/headerSearch.ts +1 -1
- package/src/modules/dx/icon/icon.ts +1 -1
- package/src/modules/dx/iconBadge/iconBadge.ts +1 -1
- package/src/modules/dx/input/input.ts +1 -1
- package/src/modules/dx/modalDrawer/modalDrawer.css +40 -0
- package/src/modules/dx/modalDrawer/modalDrawer.html +11 -0
- package/src/modules/dx/modalDrawer/modalDrawer.ts +27 -0
- package/src/modules/dx/newsletterForm/newsletterForm.html +3 -3
- package/src/modules/dx/popover/popover.ts +1 -1
- package/src/modules/dx/section/section.ts +1 -1
- package/src/modules/dx/sidebar/sidebar.ts +1 -1
- package/src/modules/dx/sidebarOld/sidebarOld.html +1 -1
- package/src/modules/dx/sidebarOld/sidebarOld.ts +22 -7
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +41 -25
- package/src/modules/dx/slackCta/slackCta.css +1 -1
- package/src/modules/dx/tooltip/microtip.css +1 -0
- package/src/modules/dx/tooltip/tooltip.css +1 -0
- package/src/modules/dx/typeBadge/typeBadge.ts +1 -1
- package/src/modules/{utils-internal → utils}/coveo/coveo.ts +0 -0
- package/src/modules/{utils-internal → utils}/css/css.ts +0 -0
- package/src/modules/{utils-internal → utils}/devices/devices.ts +0 -0
- package/src/modules/utils/highlight/highlight.ts +28 -15
- package/src/modules/{utils-internal → utils}/options/options.ts +0 -0
- package/src/modules/{utils-internal → utils}/prismjs/prismjs.html +0 -0
- package/src/modules/{utils-internal → utils}/prismjs/prismjs.ts +0 -0
- package/src/modules/{utils-internal → utils}/recentSearches/recentSearches.ts +0 -0
- package/src/modules/utils/regexps/regexps.ts +12 -0
- package/src/modules/{utils-internal → utils}/seo/seo.ts +0 -0
- package/src/modules/{utils-internal → utils}/slot/slot.ts +0 -0
- package/src/modules/{utils-internal → utils}/wordpress/wordpress.ts +0 -0
- package/LICENSE +0 -12
- package/src/modules/dx/banner/__tests__/banner.test.ts +0 -33
- package/src/modules/dx/brandThemeProvider/__tests__/brandThemeProvider.test.ts +0 -49
- package/src/modules/dx/brandThemeProvider/brandThemeProvider.stories.ts +0 -321
- package/src/modules/dx/breadcrumbs/__tests__/breadcrumbs.test.ts +0 -140
- package/src/modules/dx/breadcrumbs/__tests__/mockProps.ts +0 -28
- package/src/modules/dx/breadcrumbs/breadcrumbs.stories.ts +0 -39
- package/src/modules/dx/button/__tests__/button.test.ts +0 -107
- package/src/modules/dx/button/button.stories.ts +0 -150
- package/src/modules/dx/cardBlogPost/__tests__/cardBlogPost.test.ts +0 -26
- package/src/modules/dx/cardBlogPost/__tests__/mockProps.ts +0 -12
- package/src/modules/dx/cardBlogPost/cardBlogPost.stories.ts +0 -164
- package/src/modules/dx/cardBlogPostProvider/__tests__/cardBlogPostProvider.test.ts +0 -34
- package/src/modules/dx/cardBlogPostProvider/__tests__/mockWordpressPosts.ts +0 -44
- package/src/modules/dx/cardCallout/__tests__/cardCallout.test.ts +0 -20
- package/src/modules/dx/cardCallout/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/cardCallout/cardCallout.stories.ts +0 -33
- package/src/modules/dx/cardContent/__tests__/cardContent.test.ts +0 -100
- package/src/modules/dx/cardContent/__tests__/mockProps.ts +0 -13
- package/src/modules/dx/cardContent/cardContent.stories.ts +0 -127
- package/src/modules/dx/cardDemo/cardDemo.stories.ts +0 -115
- package/src/modules/dx/cardDocs/__tests__/cardDocs.test.ts +0 -48
- package/src/modules/dx/cardDocs/__tests__/mockProps.ts +0 -9
- package/src/modules/dx/cardDocs/cardDocs.stories.ts +0 -299
- package/src/modules/dx/cardEvent/__tests__/cardEvent.test.ts +0 -95
- package/src/modules/dx/cardEvent/__tests__/mockProps.ts +0 -10
- package/src/modules/dx/cardEvent/cardEvent.stories.ts +0 -153
- package/src/modules/dx/cardExpanded/__tests__/cardExpanded.test.ts +0 -193
- package/src/modules/dx/cardExpanded/__tests__/mockProps.ts +0 -21
- package/src/modules/dx/cardExpanded/cardExpanded.stories.ts +0 -59
- package/src/modules/dx/cardGrid/__tests__/cardMockProps.ts +0 -431
- package/src/modules/dx/cardGrid/__tests__/mockProps.ts +0 -15
- package/src/modules/dx/cardGrid/cardGrid.stories.ts +0 -111
- package/src/modules/dx/cardMinimal/__tests__/cardMinimal.test.ts +0 -87
- package/src/modules/dx/cardMinimal/__tests__/mockProps.ts +0 -10
- package/src/modules/dx/cardMinimal/cardMinimal.stories.ts +0 -32
- package/src/modules/dx/cardNews/__tests__/cardNews.test.ts +0 -58
- package/src/modules/dx/cardNews/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/cardNews/cardNews.stories.ts +0 -115
- package/src/modules/dx/cardPodcastEpisode/__tests__/cardPodcastEpisode.test.ts +0 -68
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.stories.ts +0 -31
- package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/cardPodcastEpisodeProvider.test.ts +0 -36
- package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/mockWordpressEpisodes.ts +0 -50
- package/src/modules/dx/cardSmall/__tests__/cardSmall.test.ts +0 -66
- package/src/modules/dx/cardSmall/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/cardSmall/cardSmall.stories.ts +0 -166
- package/src/modules/dx/cardTitle/__tests__/cardTitle.test.ts +0 -46
- package/src/modules/dx/cardTrailheadModule/__tests__/cardTrailheadModule.test.ts +0 -18
- package/src/modules/dx/cardTrailheadModule/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.stories.ts +0 -122
- package/src/modules/dx/cardVideoPreview/__tests__/cardVideoPreview.test.ts +0 -22
- package/src/modules/dx/cardVideoPreview/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.stories.ts +0 -147
- package/src/modules/dx/checkbox/__tests__/checkbox.test.ts +0 -85
- package/src/modules/dx/checkbox/__tests__/mockProps.ts +0 -5
- package/src/modules/dx/checkbox/checkbox.stories.ts +0 -38
- package/src/modules/dx/checkboxGroup/__tests__/checkboxGroup.test.ts +0 -80
- package/src/modules/dx/checkboxGroup/__tests__/mockProps.ts +0 -14
- package/src/modules/dx/checkboxGroup/checkboxGroup.stories.ts +0 -33
- package/src/modules/dx/codeBlock/__tests__/codeBlock.test.ts +0 -238
- package/src/modules/dx/codeBlock/__tests__/mockProps.ts +0 -160
- package/src/modules/dx/codeBlock/codeBlock.stories.ts +0 -143
- package/src/modules/dx/dropdown/__tests__/dropdown.test.ts +0 -165
- package/src/modules/dx/dropdown/__tests__/mockNestedOptions.ts +0 -96
- package/src/modules/dx/dropdown/__tests__/mockOptions.ts +0 -10
- package/src/modules/dx/dropdown/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/dropdown/dropdown.stories.ts +0 -89
- package/src/modules/dx/dropdownOption/__tests__/dropdownOption.test.ts +0 -112
- package/src/modules/dx/dropdownOption/__tests__/mockProps.ts +0 -20
- package/src/modules/dx/emptyState/__tests__/emptyState.test.ts +0 -52
- package/src/modules/dx/emptyState/__tests__/mockProps.ts +0 -4
- package/src/modules/dx/emptyState/emptyState.stories.ts +0 -45
- package/src/modules/dx/feature/__tests__/feature.test.ts +0 -51
- package/src/modules/dx/feature/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/featureGrid/__tests__/featureGrid.test.ts +0 -21
- package/src/modules/dx/featureGrid/featureGrid.stories.ts +0 -120
- package/src/modules/dx/featuredContentHeader/__tests__/featuredContentHeader.test.ts +0 -178
- package/src/modules/dx/featuredContentHeader/__tests__/mockProps.ts +0 -73
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.stories.ts +0 -153
- package/src/modules/dx/featuresList/__tests__/featuresList.test.ts +0 -43
- package/src/modules/dx/featuresList/__tests__/mockProps.ts +0 -17
- package/src/modules/dx/featuresList/featuresList.stories.ts +0 -30
- package/src/modules/dx/footer/__tests__/footer.test.ts +0 -147
- package/src/modules/dx/footer/__tests__/mockLocales.ts +0 -7
- package/src/modules/dx/footer/footer.stories.ts +0 -88
- package/src/modules/dx/footerOption/__tests__/footerOption.test.ts +0 -34
- package/src/modules/dx/footerOption/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/formattedDateTime/__tests__/formattedDateTime.test.ts +0 -25
- package/src/modules/dx/formattedDateTime/__tests__/mockProps.ts +0 -13
- package/src/modules/dx/formattedDateTime/formattedDateTime.stories.ts +0 -103
- package/src/modules/dx/grid/__tests__/grid.test.ts +0 -32
- package/src/modules/dx/grid/grid.stories.ts +0 -134
- package/src/modules/dx/groupBio/__tests__/groupBio.test.ts +0 -82
- package/src/modules/dx/groupBio/__tests__/mockProps.ts +0 -15
- package/src/modules/dx/groupBio/groupBio.stories.ts +0 -66
- package/src/modules/dx/groupText/__tests__/groupText.test.ts +0 -69
- package/src/modules/dx/groupText/__tests__/mockProps.ts +0 -35
- package/src/modules/dx/groupText/groupText.stories.ts +0 -81
- package/src/modules/dx/header/__tests__/header.test.ts +0 -236
- package/src/modules/dx/header/__tests__/mockNavArchitects.ts +0 -169
- package/src/modules/dx/header/__tests__/mockNavDevelopers.ts +0 -419
- package/src/modules/dx/header/__tests__/mockNavs.ts +0 -115
- package/src/modules/dx/header/__tests__/mockProps.ts +0 -164
- package/src/modules/dx/header/header.stories.ts +0 -172
- package/src/modules/dx/headerMobileNavMenu/__tests__/headerMobileNavMenu.test.ts +0 -123
- package/src/modules/dx/headerMobileNavMenuOption/__tests__/headerMobileNavMenuOption.test.ts +0 -38
- package/src/modules/dx/headerNav/__tests__/headerNav.test.ts +0 -49
- package/src/modules/dx/headerSearch/__tests__/headerSearch.test.ts +0 -182
- package/src/modules/dx/headerSearch/__tests__/mockData.ts +0 -11
- package/src/modules/dx/headerSearch/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/helmet/__tests__/helmet.test.ts +0 -52
- package/src/modules/dx/helmet/helmet.stories.ts +0 -53
- package/src/modules/dx/hr/__tests__/hr.test.ts +0 -53
- package/src/modules/dx/hr/__tests__/mockProps.ts +0 -16
- package/src/modules/dx/hr/hr.stories.ts +0 -50
- package/src/modules/dx/icon/__tests__/icon.test.ts +0 -54
- package/src/modules/dx/icon/icon.stories.ts +0 -100
- package/src/modules/dx/iconBadge/__tests__/iconBadge.test.ts +0 -17
- package/src/modules/dx/iconBadge/iconBadge.stories.ts +0 -32
- package/src/modules/dx/imageAndLabel/__tests__/imageAndLabel.test.ts +0 -39
- package/src/modules/dx/imageAndLabel/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/imageAndLabel/imageAndLabel.stories.ts +0 -48
- package/src/modules/dx/input/__tests__/input.test.ts +0 -357
- package/src/modules/dx/input/input.stories.ts +0 -102
- package/src/modules/dx/instrumentation/__tests__/instrumentation.test.ts +0 -86
- package/src/modules/dx/interactiveImage/__tests__/interactiveImage.test.ts +0 -83
- package/src/modules/dx/interactiveImage/__tests__/mockProps.ts +0 -39
- package/src/modules/dx/interactiveImage/interactiveImage.stories.ts +0 -31
- package/src/modules/dx/lazy/__tests__/lazy.test.ts +0 -43
- package/src/modules/dx/lazy/lazy.stories.ts +0 -132
- package/src/modules/dx/pagination/__tests__/pagination.test.ts +0 -121
- package/src/modules/dx/pagination/pagination.stories.ts +0 -88
- package/src/modules/dx/podcastHost/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/podcastHost/__tests__/podcastHost.test.ts +0 -21
- package/src/modules/dx/podcastHost/podcastHost.stories.ts +0 -17
- package/src/modules/dx/podcastPlayer/__tests__/podcastPlayer.test.ts +0 -20
- package/src/modules/dx/podcastPlayer/podcastPlayer.stories.ts +0 -13
- package/src/modules/dx/podcastSubscription/__tests__/podcastSubscription.test.ts +0 -16
- package/src/modules/dx/podcastSubscription/podcastSubscription.stories.ts +0 -23
- package/src/modules/dx/popover/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/popover/__tests__/popover.test.ts +0 -313
- package/src/modules/dx/popover/popover.stories.ts +0 -82
- package/src/modules/dx/radioGroup/__tests__/mockProps.ts +0 -12
- package/src/modules/dx/radioGroup/__tests__/radioGroup.test.ts +0 -42
- package/src/modules/dx/radioGroup/radioGroup.stories.ts +0 -25
- package/src/modules/dx/relativeDateTime/__tests__/mockProps.ts +0 -55
- package/src/modules/dx/relativeDateTime/__tests__/relativeDateTime.test.ts +0 -52
- package/src/modules/dx/relativeDateTime/relativeDateTime.stories.ts +0 -83
- package/src/modules/dx/searchResults/searchResults.stories.ts +0 -36
- package/src/modules/dx/section/__tests__/section.test.ts +0 -17
- package/src/modules/dx/section/section.stories.ts +0 -381
- package/src/modules/dx/sectionSignup/__tests__/sectionSignup.test.ts +0 -66
- package/src/modules/dx/sectionSignup/sectionSignup.stories.ts +0 -49
- package/src/modules/dx/select/select.stories.ts +0 -59
- package/src/modules/dx/sidebar/__tests__/mockProps.ts +0 -181
- package/src/modules/dx/sidebar/__tests__/mockSearchChangeEmptyEvent.ts +0 -6
- package/src/modules/dx/sidebar/__tests__/mockSearchChangeEvent.ts +0 -527
- package/src/modules/dx/sidebar/__tests__/sidebar.test.ts +0 -568
- package/src/modules/dx/sidebar/sidebar.stories.ts +0 -188
- package/src/modules/dx/sidebarOld/__tests__/mockProps.ts +0 -178
- package/src/modules/dx/sidebarOld/__tests__/sidebarOld.test.ts +0 -570
- package/src/modules/dx/sidebarOld/sidebarOld.stories.ts +0 -139
- package/src/modules/dx/sidebarSearch/__tests__/mockPreloadedState.ts +0 -1686
- package/src/modules/dx/sidebarSearch/__tests__/sidebarSearch.test.ts +0 -175
- package/src/modules/dx/sidebarSearchResult/__tests__/sidebarSearchResult.test.ts +0 -96
- package/src/modules/dx/slackCta/__tests__/slackCta.test.ts +0 -36
- package/src/modules/dx/slackCta/slackCta.stories.ts +0 -25
- package/src/modules/dx/socials/__tests__/socials.test.ts +0 -114
- package/src/modules/dx/socials/socials.stories.ts +0 -24
- package/src/modules/dx/spinner/__tests__/spinner.test.ts +0 -37
- package/src/modules/dx/spinner/spinner.stories.ts +0 -69
- package/src/modules/dx/tab/__tests__/tab.test.ts +0 -129
- package/src/modules/dx/tab/tab.stories.ts +0 -57
- package/src/modules/dx/toc/__tests__/mockProps.ts +0 -28
- package/src/modules/dx/toc/__tests__/toc.test.ts +0 -109
- package/src/modules/dx/toc/toc.stories.ts +0 -26
- package/src/modules/dx/tooltip/__tests__/tooltip.test.ts +0 -22
- package/src/modules/dx/tooltip/tooltip.stories.ts +0 -46
- package/src/modules/dx/topics/__tests__/mockProps.ts +0 -3
- package/src/modules/dx/topics/__tests__/topics.test.ts +0 -31
- package/src/modules/dx/tree/__tests__/mockProps.ts +0 -215
- package/src/modules/dx/tree/__tests__/tree.test.ts +0 -346
- package/src/modules/dx/tree/__tests__/treeHandler.test.ts +0 -194
- package/src/modules/dx/tree/tree.stories.ts +0 -65
- package/src/modules/dx/treeItem/__tests__/mockProps.ts +0 -46
- package/src/modules/dx/treeItem/__tests__/treeItem.test.ts +0 -377
- package/src/modules/dx/treeTile/__tests__/mockProps.ts +0 -16
- package/src/modules/dx/treeTile/__tests__/treeTile.test.ts +0 -168
- package/src/modules/dx/typeBadge/__tests__/typeBadge.test.ts +0 -77
- package/src/modules/dx/typeBadge/typeBadge.stories.ts +0 -114
- package/src/modules/dx/typeBadgeGroup/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/typeBadgeGroup/__tests__/typeBadgeGroup.test.ts +0 -72
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.stories.ts +0 -19
- package/src/modules/test-components/buttonTest/buttonTest.html +0 -3
- package/src/modules/test-components/buttonTest/buttonTest.ts +0 -3
- package/src/modules/test-components/codeBlockTest/codeBlockTest.js +0 -4
- package/src/modules/test-components/featureGridTest/featureGridTest.html +0 -7
- package/src/modules/test-components/featureGridTest/featureGridTest.ts +0 -5
- package/src/modules/test-components/instrumentationTest/instrumentationTest.html +0 -4
- package/src/modules/test-components/instrumentationTest/instrumentationTest.ts +0 -8
- package/src/modules/test-components/popoverTest/popoverTest.html +0 -6
- package/src/modules/test-components/popoverTest/popoverTest.ts +0 -5
- package/src/modules/test-components/slackCtaTest/slackCtaTest.html +0 -3
- package/src/modules/test-components/slackCtaTest/slackCtaTest.ts +0 -3
- package/src/modules/utils/highlight/__tests__/highlight.test.ts +0 -108
- package/src/modules/utils/highlight/__tests__/mockProps.ts +0 -45
- package/src/modules/utils-internal/jest/jest.ts +0 -58
- package/src/modules/utils-internal/recentSearches/__tests__/recentSearches.test.ts +0 -83
- package/src/modules/utils-internal/regexps/regexps.ts +0 -5
- package/src/modules/utils-internal/storybook/storybook.ts +0 -32
- package/src/modules/utils-internal/tests/tests.ts +0 -38
- package/src/modules/utils-internal/wordpress/__tests__/wordpress.test.ts +0 -15
package/lwc.config.json
CHANGED
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"dx/interactiveImage",
|
|
50
50
|
"dx/lazy",
|
|
51
51
|
"dx/logo",
|
|
52
|
+
"dx/modalDrawer",
|
|
52
53
|
"dx/pagination",
|
|
53
54
|
"dx/podcastHost",
|
|
54
55
|
"dx/podcastPlayer",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
"helpers/reset",
|
|
81
82
|
"helpers/table",
|
|
82
83
|
"helpers/text",
|
|
83
|
-
"
|
|
84
|
+
"base-elements/headerBase",
|
|
84
85
|
"utils/normalizers",
|
|
85
86
|
"utils/highlight"
|
|
86
87
|
]
|
package/package.json
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.3-alpha.1",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">= 14.x"
|
|
8
8
|
},
|
|
9
|
-
"files": [
|
|
10
|
-
"src/",
|
|
11
|
-
"lwc.config.json"
|
|
12
|
-
],
|
|
13
9
|
"publishConfig": {
|
|
14
10
|
"access": "public"
|
|
15
11
|
},
|
|
@@ -28,6 +24,5 @@
|
|
|
28
24
|
"@types/classnames": "^2.2.10",
|
|
29
25
|
"@types/debounce": "^1.2.0",
|
|
30
26
|
"@types/lodash.get": "^4.4.6"
|
|
31
|
-
}
|
|
32
|
-
"gitHead": "a51ec257e0bc853955267650e17c86e8a250ea16"
|
|
27
|
+
}
|
|
33
28
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
|
-
import { toDxColor } from "utils
|
|
3
|
+
import { toDxColor } from "utils/css";
|
|
4
4
|
import { track } from "dx/instrumentation";
|
|
5
5
|
|
|
6
6
|
export default class CardCallout extends LightningElement {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { LightningSlotElement } from "typings/custom";
|
|
4
|
-
import { isSlotEmpty } from "utils
|
|
5
|
-
import { toDxColor } from "utils
|
|
4
|
+
import { isSlotEmpty } from "utils/slot";
|
|
5
|
+
import { toDxColor } from "utils/css";
|
|
6
6
|
|
|
7
7
|
export default class CardContent extends LightningElement {
|
|
8
8
|
@api authorHref?: string | null = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { LightningSlotElement } from "typings/custom";
|
|
4
|
-
import { stopPropagationOnSlotted } from "utils
|
|
4
|
+
import { stopPropagationOnSlotted } from "utils/slot";
|
|
5
5
|
|
|
6
6
|
export default class CardDocs extends LightningElement {
|
|
7
7
|
@api body!: string;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
IconSymbol,
|
|
7
7
|
IconBadgeShape
|
|
8
8
|
} from "typings/custom";
|
|
9
|
-
import { isSlotEmpty, stopPropagationOnSlotted } from "utils
|
|
9
|
+
import { isSlotEmpty, stopPropagationOnSlotted } from "utils/slot";
|
|
10
10
|
|
|
11
11
|
export default class CardSmall extends LightningElement {
|
|
12
12
|
@api badgeBackgroundColor?: string = "indigo-vibrant-50";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api, wire, track } from "lwc";
|
|
2
2
|
import { CodeBlockTheme, CodeBlockLanguage } from "typings/custom";
|
|
3
3
|
import cx from "classnames";
|
|
4
|
-
import Prism from "utils
|
|
4
|
+
import Prism from "utils/prismjs";
|
|
5
5
|
import {
|
|
6
6
|
getLocalStorageData,
|
|
7
7
|
setLocalStorageData
|
|
@@ -2,7 +2,7 @@ import { Option, PopperPlacement } from "typings/custom";
|
|
|
2
2
|
import { LightningElement, api, track } from "lwc";
|
|
3
3
|
import cx from "classnames";
|
|
4
4
|
import get from "lodash.get";
|
|
5
|
-
import { deepmapOptions } from "utils
|
|
5
|
+
import { deepmapOptions } from "utils/options";
|
|
6
6
|
import { toJson } from "utils/normalizers";
|
|
7
7
|
|
|
8
8
|
interface DropdownOption extends Option {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { LightningSlotElement } from "typings/custom";
|
|
4
|
-
import { isSlotEmpty } from "utils
|
|
4
|
+
import { isSlotEmpty } from "utils/slot";
|
|
5
5
|
import { toJson } from "utils/normalizers";
|
|
6
6
|
import { ImageAndLabel } from "../imageAndLabel";
|
|
7
7
|
import svgs from "./svgs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { LightningSlotElement, Link } from "typings/custom";
|
|
4
|
-
import { isSlotEmpty } from "utils
|
|
4
|
+
import { isSlotEmpty } from "utils/slot";
|
|
5
5
|
import { toJson } from "utils/normalizers";
|
|
6
6
|
|
|
7
7
|
type OptionalLink = Link | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { Option } from "typings/custom";
|
|
4
|
-
import { deepmapOptions } from "utils
|
|
4
|
+
import { deepmapOptions } from "utils/options";
|
|
5
5
|
|
|
6
6
|
export default class HeaderMobileNavMenu extends LightningElement {
|
|
7
7
|
@api open: boolean = false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { PopoverRequestCloseType, Option } from "typings/custom";
|
|
4
|
-
import { buildSearchEngine } from "utils
|
|
4
|
+
import { buildSearchEngine } from "utils/coveo";
|
|
5
5
|
import {
|
|
6
6
|
StandaloneSearchBox as StandaloneSearchBoxType,
|
|
7
7
|
StandaloneSearchBoxState,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { IconSprite, IconSymbol, IconBadgeShape } from "typings/custom";
|
|
4
|
-
import { toDxColor } from "utils
|
|
4
|
+
import { toDxColor } from "utils/css";
|
|
5
5
|
|
|
6
6
|
const validShapes = ["square", "circle"];
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { IconSize, IconSymbol } from "typings/custom";
|
|
4
|
-
import { isMac } from "utils
|
|
4
|
+
import { isMac } from "utils/devices";
|
|
5
5
|
import { isValidEmail } from "./validators";
|
|
6
6
|
|
|
7
7
|
type ValidatorMap = {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--dx-c-modal-drawer-z-index: 5000;
|
|
3
|
+
--dx-c-modal-padding-around: var(--dx-g-spacing-smd);
|
|
4
|
+
--dx-c-modal-height: calc(100vh - var(--dx-c-modal-padding-around) * 2);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
dx-button {
|
|
8
|
+
display: block;
|
|
9
|
+
margin-left: auto;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.modal-drawer_container {
|
|
13
|
+
background-color: white;
|
|
14
|
+
height: var(--dx-c-modal-height);
|
|
15
|
+
left: 0;
|
|
16
|
+
padding: var(--dx-c-modal-padding-around);
|
|
17
|
+
position: fixed;
|
|
18
|
+
transform: translateX(-100%);
|
|
19
|
+
transition: transform 0.4s ease;
|
|
20
|
+
top: 0;
|
|
21
|
+
width: inherit;
|
|
22
|
+
z-index: var(--dx-c-modal-drawer-z-index);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.modal-drawer_container.modal-drawer_active {
|
|
26
|
+
transform: translateX(0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.modal-drawer_overlay {
|
|
30
|
+
background-color: #195594;
|
|
31
|
+
bottom: 0;
|
|
32
|
+
height: 100%;
|
|
33
|
+
left: 0;
|
|
34
|
+
opacity: 0.62;
|
|
35
|
+
position: fixed;
|
|
36
|
+
right: 0;
|
|
37
|
+
top: 0;
|
|
38
|
+
width: 100%;
|
|
39
|
+
z-index: calc(var(--dx-c-modal-drawer-z-index) - 1);
|
|
40
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import cx from "classnames";
|
|
2
|
+
import { LightningElement, api } from "lwc";
|
|
3
|
+
import { normalizeBoolean } from "utils/normalizers";
|
|
4
|
+
|
|
5
|
+
export default class ModalDrawer extends LightningElement {
|
|
6
|
+
private _open = false;
|
|
7
|
+
|
|
8
|
+
@api get open() {
|
|
9
|
+
return this._open;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
set open(value) {
|
|
13
|
+
this._open = normalizeBoolean(value);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
get containerClass(): string {
|
|
17
|
+
return cx(
|
|
18
|
+
"modal-drawer_container",
|
|
19
|
+
this._open && "modal-drawer_active"
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
handleCloseModal() {
|
|
24
|
+
this._open = !this._open;
|
|
25
|
+
this.dispatchEvent(new CustomEvent("clickclose"));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
<dx-select
|
|
44
44
|
name="country"
|
|
45
45
|
class="country-select"
|
|
46
|
-
label="Country"
|
|
46
|
+
label="Country/Region"
|
|
47
47
|
onchange={handleChange}
|
|
48
|
-
placeholder="Select your Country"
|
|
49
|
-
message-when-value-missing="Select your country"
|
|
48
|
+
placeholder="Select your Country/Region"
|
|
49
|
+
message-when-value-missing="Select your country/region"
|
|
50
50
|
json-options={countries}
|
|
51
51
|
value={country}
|
|
52
52
|
required="true"
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import { createPopper } from "@popperjs/core";
|
|
9
9
|
import cx from "classnames";
|
|
10
10
|
import debounce from "debounce";
|
|
11
|
-
import { isPrerender } from "utils
|
|
11
|
+
import { isPrerender } from "utils/seo";
|
|
12
12
|
|
|
13
13
|
const isEventOutsideElements = (
|
|
14
14
|
e: Event,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
|
-
import { toDxColor } from "utils
|
|
3
|
+
import { toDxColor } from "utils/css";
|
|
4
4
|
|
|
5
5
|
export default class Section extends LightningElement {
|
|
6
6
|
@api backgroundColor?: string | null = "transparent";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
SidebarGtmAction,
|
|
7
7
|
SidebarSearchResult
|
|
8
8
|
} from "typings/custom";
|
|
9
|
-
import { getSidebarSearchParams } from "utils
|
|
9
|
+
import { getSidebarSearchParams } from "utils/coveo";
|
|
10
10
|
import { toJson } from "utils/normalizers";
|
|
11
11
|
import SidebarSearch from "dx/sidebarSearch";
|
|
12
12
|
|
|
@@ -78,10 +78,18 @@ export default class Sidebar extends LightningElement {
|
|
|
78
78
|
this.expanded = !this.matchMedia.matches;
|
|
79
79
|
this.onMediaChange(this.matchMedia);
|
|
80
80
|
this.matchMedia.addEventListener("change", this.onMediaChange);
|
|
81
|
+
window.addEventListener(
|
|
82
|
+
"referencecontentloaded",
|
|
83
|
+
this.dispatchHighlightedTermChange
|
|
84
|
+
);
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
disconnectedCallback() {
|
|
84
88
|
this.matchMedia.removeEventListener("change", this.onMediaChange);
|
|
89
|
+
window.removeEventListener(
|
|
90
|
+
"referencecontentloaded",
|
|
91
|
+
this.dispatchHighlightedTermChange
|
|
92
|
+
);
|
|
85
93
|
}
|
|
86
94
|
|
|
87
95
|
private onMediaChange = (event: MediaQueryListEvent | MediaQueryList) =>
|
|
@@ -120,16 +128,23 @@ export default class Sidebar extends LightningElement {
|
|
|
120
128
|
window.clearTimeout(this._searchTimeout);
|
|
121
129
|
this._searchTimeout = window.setTimeout(() => {
|
|
122
130
|
this.assignFilteredTrees();
|
|
123
|
-
this.
|
|
124
|
-
new CustomEvent("highlightedtermchange", {
|
|
125
|
-
detail: this.searchText,
|
|
126
|
-
composed: true,
|
|
127
|
-
bubbles: true
|
|
128
|
-
})
|
|
129
|
-
);
|
|
131
|
+
this.dispatchHighlightedTermChange();
|
|
130
132
|
}, WAIT_TIME);
|
|
131
133
|
}
|
|
132
134
|
|
|
135
|
+
private dispatchHighlightedTermChange = () => {
|
|
136
|
+
this.dispatchEvent(
|
|
137
|
+
new CustomEvent("highlightedtermchange", {
|
|
138
|
+
detail: {
|
|
139
|
+
query: this.searchText,
|
|
140
|
+
termsToHighlight: [this.searchText]
|
|
141
|
+
},
|
|
142
|
+
composed: true,
|
|
143
|
+
bubbles: true
|
|
144
|
+
})
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
|
|
133
148
|
private assignFilteredTrees() {
|
|
134
149
|
this.filteredTrees = this._trees
|
|
135
150
|
.map((singleTree) => {
|
|
@@ -14,11 +14,8 @@ import {
|
|
|
14
14
|
SearchAppState,
|
|
15
15
|
loadQueryActions
|
|
16
16
|
} from "@coveo/headless";
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
getSidebarSearchParams
|
|
20
|
-
} from "utils-internal/coveo";
|
|
21
|
-
import { RecentSearches } from "utils-internal/recentSearches";
|
|
17
|
+
import { buildSearchEngine, getSidebarSearchParams } from "utils/coveo";
|
|
18
|
+
import { RecentSearches } from "utils/recentSearches";
|
|
22
19
|
import { toJson } from "utils/normalizers";
|
|
23
20
|
import {
|
|
24
21
|
Option,
|
|
@@ -94,6 +91,30 @@ export default class SidebarSearch extends LightningElement {
|
|
|
94
91
|
private fetchingMoreResults: boolean = false;
|
|
95
92
|
private didRender = false;
|
|
96
93
|
|
|
94
|
+
private get termsToHighlight(): string[] | null {
|
|
95
|
+
const { termsToHighlight, phrasesToHighlight } =
|
|
96
|
+
this.engine?.state?.search?.response;
|
|
97
|
+
if (!termsToHighlight || !phrasesToHighlight) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const flattenTerms = (terms: Object): string[] =>
|
|
102
|
+
Object.entries(terms).reduce((acc, [key, value]) => {
|
|
103
|
+
if (Array.isArray(value)) {
|
|
104
|
+
return [...acc, key, ...value];
|
|
105
|
+
}
|
|
106
|
+
const values = flattenTerms(value);
|
|
107
|
+
return [...acc, key, ...values];
|
|
108
|
+
}, []);
|
|
109
|
+
|
|
110
|
+
const terms = flattenTerms({
|
|
111
|
+
...termsToHighlight,
|
|
112
|
+
...phrasesToHighlight
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
return Array.from(new Set([this.value, ...terms].flat(2))) as string[];
|
|
116
|
+
}
|
|
117
|
+
|
|
97
118
|
private get hasCorrectCoveoConfig(): boolean {
|
|
98
119
|
const coveoConfigurations = [
|
|
99
120
|
this.coveoOrganizationId,
|
|
@@ -147,12 +168,6 @@ export default class SidebarSearch extends LightningElement {
|
|
|
147
168
|
);
|
|
148
169
|
}
|
|
149
170
|
|
|
150
|
-
// If this is the first render and there is a search value, trigger
|
|
151
|
-
// term highlighting
|
|
152
|
-
if (!this.didRender && this.value) {
|
|
153
|
-
this.dispatchHighlightedTermChange();
|
|
154
|
-
}
|
|
155
|
-
|
|
156
171
|
this.didRender = true;
|
|
157
172
|
}
|
|
158
173
|
|
|
@@ -227,10 +242,6 @@ export default class SidebarSearch extends LightningElement {
|
|
|
227
242
|
this.onResultListChange
|
|
228
243
|
);
|
|
229
244
|
|
|
230
|
-
if (this.value) {
|
|
231
|
-
this.dispatchHighlightedTermChange();
|
|
232
|
-
}
|
|
233
|
-
|
|
234
245
|
if (!this.preloadedState) {
|
|
235
246
|
if (this.value) {
|
|
236
247
|
this.submitSearch();
|
|
@@ -333,6 +344,7 @@ export default class SidebarSearch extends LightningElement {
|
|
|
333
344
|
|
|
334
345
|
private dispatchOnChangeEvent(results: Result[]) {
|
|
335
346
|
this.updateSessionStorage();
|
|
347
|
+
this.dispatchHighlightedTermChange();
|
|
336
348
|
this.dispatchEvent(
|
|
337
349
|
new CustomEvent("change", {
|
|
338
350
|
detail: {
|
|
@@ -347,15 +359,20 @@ export default class SidebarSearch extends LightningElement {
|
|
|
347
359
|
this.dispatchEvent(new CustomEvent("loading", { detail: loading }));
|
|
348
360
|
}
|
|
349
361
|
|
|
350
|
-
private dispatchHighlightedTermChange() {
|
|
351
|
-
this.
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
362
|
+
private dispatchHighlightedTermChange = () => {
|
|
363
|
+
if (this.termsToHighlight) {
|
|
364
|
+
this.dispatchEvent(
|
|
365
|
+
new CustomEvent("highlightedtermchange", {
|
|
366
|
+
detail: {
|
|
367
|
+
query: this.value,
|
|
368
|
+
termsToHighlight: this.termsToHighlight
|
|
369
|
+
},
|
|
370
|
+
composed: true,
|
|
371
|
+
bubbles: true
|
|
372
|
+
})
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
359
376
|
|
|
360
377
|
private updateRecentSearches = () =>
|
|
361
378
|
(this.recentSearches = UserRecentSearches.get().map((item: string) => ({
|
|
@@ -410,7 +427,6 @@ export default class SidebarSearch extends LightningElement {
|
|
|
410
427
|
this.value = e.detail;
|
|
411
428
|
|
|
412
429
|
this.handleValueChange(false);
|
|
413
|
-
this.dispatchHighlightedTermChange();
|
|
414
430
|
}
|
|
415
431
|
|
|
416
432
|
private onInputFocus() {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { createSearchRegExp } from "utils
|
|
1
|
+
import { createSearchRegExp } from "utils/regexps";
|
|
2
2
|
|
|
3
|
-
const MARK_TAGS = /<\/?mark
|
|
3
|
+
const MARK_TAGS = /<\/?mark[^>]*>/gi;
|
|
4
|
+
|
|
5
|
+
// mark tags dif color on ref page
|
|
4
6
|
|
|
5
7
|
export const highlightTerms = (
|
|
6
8
|
// eslint-disable-next-line no-undef
|
|
7
|
-
elements: NodeListOf<
|
|
8
|
-
|
|
9
|
+
elements: NodeListOf<HTMLElement>,
|
|
10
|
+
{ query, termsToHighlight }: { query: string; termsToHighlight: string[] }
|
|
9
11
|
): void => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
const searchExp = createSearchRegExp(termsToHighlight);
|
|
13
|
+
let scrolled = false;
|
|
12
14
|
elements.forEach((element) => {
|
|
13
15
|
if (
|
|
14
16
|
element?.innerHTML.includes("<dx-") ||
|
|
@@ -17,16 +19,27 @@ export const highlightTerms = (
|
|
|
17
19
|
return;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
try {
|
|
23
|
+
if (element.innerHTML.match(MARK_TAGS)) {
|
|
24
|
+
// Remove previously added mark tags
|
|
25
|
+
element.innerHTML = element.innerHTML.replace(MARK_TAGS, "");
|
|
26
|
+
}
|
|
27
|
+
if (element.innerHTML.match(searchExp) && query) {
|
|
28
|
+
element.innerHTML = element.innerHTML.replace(
|
|
29
|
+
searchExp,
|
|
30
|
+
'<mark style="background-color:var(--dx-g-yellow-vibrant-90)">$&</mark>'
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
} catch (e) {
|
|
34
|
+
console.error(
|
|
35
|
+
`${element} could not be parsed by the highlight utility: ${e}`
|
|
36
|
+
);
|
|
28
37
|
}
|
|
29
38
|
|
|
30
|
-
|
|
39
|
+
const mark = element.querySelector("mark");
|
|
40
|
+
if (mark && !scrolled) {
|
|
41
|
+
scrolled = true;
|
|
42
|
+
mark.scrollIntoView({ block: "nearest" });
|
|
43
|
+
}
|
|
31
44
|
});
|
|
32
45
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|