@salesforcedevs/docs-components 0.7.0 → 0.7.59-sppage-alpha2
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 +17 -3
- package/package.json +16 -6
- package/src/modules/README.md +41 -0
- package/src/modules/doc/amfModelParser/amfModelParser.ts +674 -0
- package/src/modules/doc/amfReference/amfReference.css +25 -0
- package/src/modules/doc/amfReference/amfReference.html +60 -0
- package/src/modules/doc/amfReference/amfReference.ts +1494 -0
- package/src/modules/doc/amfReference/constants.ts +76 -0
- package/src/modules/doc/amfReference/types.ts +125 -0
- package/src/modules/doc/amfTopic/amfTopic.css +21 -0
- package/src/modules/doc/amfTopic/amfTopic.html +3 -0
- package/src/modules/doc/amfTopic/amfTopic.ts +111 -0
- package/src/modules/doc/amfTopic/types.ts +56 -0
- package/src/modules/doc/amfTopic/utils.ts +136 -0
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +51 -0
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +5 -0
- package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +71 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.css +27 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.html +58 -0
- package/src/modules/doc/breadcrumbs/breadcrumbs.ts +192 -0
- package/src/modules/doc/content/content.css +94 -70
- package/src/modules/doc/content/content.ts +233 -169
- package/src/modules/doc/contentCallout/contentCallout.css +17 -23
- package/src/modules/doc/contentCallout/contentCallout.html +13 -4
- package/src/modules/doc/contentCallout/contentCallout.ts +16 -3
- package/src/modules/doc/contentLayout/contentLayout.css +131 -0
- package/src/modules/doc/contentLayout/contentLayout.html +64 -0
- package/src/modules/doc/contentLayout/contentLayout.ts +610 -0
- package/src/modules/doc/doDont/doDont.css +47 -0
- package/src/modules/doc/doDont/doDont.html +27 -0
- package/src/modules/doc/doDont/doDont.ts +17 -0
- package/src/modules/doc/header/header.css +70 -37
- package/src/modules/doc/header/header.html +40 -135
- package/src/modules/doc/header/header.ts +29 -78
- package/src/modules/doc/heading/heading.css +33 -0
- package/src/modules/doc/heading/heading.html +14 -0
- package/src/modules/doc/heading/heading.ts +67 -0
- package/src/modules/doc/headingAnchor/headingAnchor.css +33 -0
- package/src/modules/doc/headingAnchor/headingAnchor.html +19 -0
- package/src/modules/doc/headingAnchor/headingAnchor.ts +43 -0
- package/src/modules/doc/headingContent/headingContent.css +53 -0
- package/src/modules/doc/headingContent/headingContent.html +13 -0
- package/src/modules/doc/headingContent/headingContent.ts +30 -0
- package/src/modules/doc/overview/overview.css +40 -0
- package/src/modules/doc/overview/overview.html +34 -0
- package/src/modules/doc/overview/overview.ts +12 -0
- package/src/modules/doc/phase/phase.css +70 -0
- package/src/modules/doc/phase/phase.html +38 -0
- package/src/modules/doc/phase/phase.ts +93 -0
- package/src/modules/doc/specificationContent/specificationContent.css +3 -0
- package/src/modules/doc/specificationContent/specificationContent.html +99 -0
- package/src/modules/doc/specificationContent/specificationContent.ts +56 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.html +20 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +16 -0
- package/src/modules/doc/sprigSurvey/sprigSurvey.ts +16 -0
- package/src/modules/doc/toc/toc.ts +1 -1
- package/src/modules/doc/versionPicker/versionPicker.css +64 -0
- package/src/modules/doc/versionPicker/versionPicker.html +38 -0
- package/src/modules/doc/versionPicker/versionPicker.ts +65 -0
- package/src/modules/doc/xmlContent/types.ts +120 -0
- package/src/modules/doc/xmlContent/utils.ts +163 -0
- package/src/modules/doc/xmlContent/xmlContent.css +54 -0
- package/src/modules/doc/xmlContent/xmlContent.html +52 -0
- package/src/modules/doc/xmlContent/xmlContent.ts +780 -0
- package/src/modules/docHelpers/amfStyle/amfStyle.css +355 -0
- package/src/modules/docHelpers/imgStyle/imgStyle.css +59 -0
- package/src/modules/docHelpers/status/status.css +22 -0
- package/src/modules/docUtils/searchSyncer/searchSyncer.ts +86 -0
- package/src/modules/docUtils/utils/utils.ts +32 -0
- package/LICENSE +0 -12
- package/src/modules/doc/content/__tests__/content.test.ts +0 -120
- package/src/modules/doc/content/__tests__/mockDocContent.ts +0 -292
- package/src/modules/doc/content/__tests__/mockPageReference.ts +0 -8
- package/src/modules/doc/content/content.stories.ts +0 -108
- package/src/modules/doc/contentCallout/__tests__/contentCallout.test.ts +0 -80
- package/src/modules/doc/contentCallout/__tests__/mockProps.ts +0 -14
- package/src/modules/doc/contentCallout/contentCallout.stories.ts +0 -29
- package/src/modules/doc/contentMedia/__tests__/contentMedia.test.ts +0 -97
- package/src/modules/doc/contentMedia/contentMedia.stories.ts +0 -113
- package/src/modules/doc/header/__tests__/coveoConfig.ts +0 -12
- package/src/modules/doc/header/__tests__/header.test.ts +0 -434
- package/src/modules/doc/header/__tests__/mockNavDevelopers.ts +0 -427
- package/src/modules/doc/header/__tests__/mockNavs.ts +0 -115
- package/src/modules/doc/header/__tests__/mockProps.ts +0 -149
- package/src/modules/doc/header/header.stories.ts +0 -160
- package/src/modules/doc/nav/__tests__/mockAvailableLanguages.ts +0 -8
- package/src/modules/doc/nav/__tests__/mockAvailableVersions.ts +0 -122
- package/src/modules/doc/nav/__tests__/mockPageReference.ts +0 -8
- package/src/modules/doc/nav/__tests__/mockPdfUrl.ts +0 -1
- package/src/modules/doc/nav/__tests__/mockSelectedLanguage.ts +0 -8
- package/src/modules/doc/nav/__tests__/mockSelectedVersion.ts +0 -8
- package/src/modules/doc/nav/__tests__/mockToc.ts +0 -146
- package/src/modules/doc/nav/__tests__/nav.test.ts +0 -58
- package/src/modules/doc/toc/__tests__/mockPageReference.ts +0 -8
- package/src/modules/doc/toc/__tests__/mockToc.ts +0 -146
- package/src/modules/doc/toc/__tests__/toc.test.ts +0 -29
- package/src/modules/doc/toolbar/__tests__/mockAvailableLanguages.ts +0 -8
- package/src/modules/doc/toolbar/__tests__/mockAvailableVersions.ts +0 -122
- package/src/modules/doc/toolbar/__tests__/mockPdfUrl.ts +0 -1
- package/src/modules/doc/toolbar/__tests__/mockSelectedLanguage.ts +0 -8
- package/src/modules/doc/toolbar/__tests__/mockSelectedVersion.ts +0 -8
- package/src/modules/doc/toolbar/__tests__/toolbar.test.ts +0 -44
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import { IconSprite, IconSize, IconSymbol } from "typings/custom";
|
|
3
|
+
|
|
4
|
+
export default class HeadingAnchor extends LightningElement {
|
|
5
|
+
@api ariaLabel: string = "copy";
|
|
6
|
+
@api iconSize?: IconSize = "override";
|
|
7
|
+
@api iconSprite?: IconSprite = "utility";
|
|
8
|
+
@api iconSymbol?: IconSymbol;
|
|
9
|
+
@api header: string = "";
|
|
10
|
+
@api urlText: string = "";
|
|
11
|
+
|
|
12
|
+
label: string = "Copy link to clipboard";
|
|
13
|
+
|
|
14
|
+
private async onIconClick() {
|
|
15
|
+
await this.iconClickHandler();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
private async iconClickHandler() {
|
|
19
|
+
this.label = "Copied";
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
this.label = "Copy link to clipboard";
|
|
22
|
+
}, 2000);
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
if (this.header && this.urlText) {
|
|
26
|
+
const [hostUrl] = window.location.href.split("#");
|
|
27
|
+
const url = `${hostUrl}#${this.urlText}`;
|
|
28
|
+
await navigator.clipboard.writeText(url);
|
|
29
|
+
}
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error(error);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private async onKeyDown(e: KeyboardEvent) {
|
|
36
|
+
switch (e.key) {
|
|
37
|
+
case "Enter":
|
|
38
|
+
await this.iconClickHandler();
|
|
39
|
+
break;
|
|
40
|
+
default:
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
|
|
3
|
+
:host {
|
|
4
|
+
--doc-c-heading-anchor-button-bottom: 0;
|
|
5
|
+
--doc-c-heading-anchor-icon-size: 18px;
|
|
6
|
+
--button-size: var(--dx-g-spacing-xl);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
dx-tooltip {
|
|
10
|
+
line-height: var(--button-size);
|
|
11
|
+
padding-right: var(--dx-g-spacing-xs);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.button-container {
|
|
15
|
+
height: 100%;
|
|
16
|
+
margin-right: calc(var(--dx-g-spacing-xl) - 4px);
|
|
17
|
+
position: relative;
|
|
18
|
+
padding-right: var(--dx-g-spacing-xs);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
button {
|
|
22
|
+
position: absolute;
|
|
23
|
+
bottom: var(--doc-c-heading-anchor-button-bottom);
|
|
24
|
+
left: 0;
|
|
25
|
+
opacity: 0;
|
|
26
|
+
color: rgb(11 92 171);
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
align-items: center;
|
|
30
|
+
height: var(--button-size);
|
|
31
|
+
width: var(--button-size);
|
|
32
|
+
border-radius: 4px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
dx-icon {
|
|
36
|
+
--dx-c-icon-size: var(--doc-c-heading-anchor-icon-size);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.title {
|
|
40
|
+
word-break: break-word;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
button:focus {
|
|
44
|
+
box-shadow: 0 0 0 2px rgb(11 92 171);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
button:focus,
|
|
48
|
+
button:hover,
|
|
49
|
+
span:hover dx-tooltip button,
|
|
50
|
+
span:hover ~ dx-tooltip button {
|
|
51
|
+
opacity: 1;
|
|
52
|
+
outline: none;
|
|
53
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template if:false={hash}>{header}</template>
|
|
3
|
+
<template if:true={hash}>
|
|
4
|
+
<span class="title">{header} </span>
|
|
5
|
+
<dx-tooltip placement="top" label={label}>
|
|
6
|
+
<span class="button-container">
|
|
7
|
+
<button onclick={copy} aria-label="copy">
|
|
8
|
+
<dx-icon size="override" symbol="link"></dx-icon>
|
|
9
|
+
</button>
|
|
10
|
+
</span>
|
|
11
|
+
</dx-tooltip>
|
|
12
|
+
</template>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
|
|
3
|
+
export default class HeadingContent extends LightningElement {
|
|
4
|
+
@api header: string = "";
|
|
5
|
+
@api hash: string | null = null;
|
|
6
|
+
|
|
7
|
+
label: string = "Copy link to clipboard";
|
|
8
|
+
timeout: number | null = null;
|
|
9
|
+
|
|
10
|
+
private async copy() {
|
|
11
|
+
if (this.timeout) {
|
|
12
|
+
window.clearTimeout(this.timeout);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
this.label = "Copied";
|
|
16
|
+
this.timeout = window.setTimeout(() => {
|
|
17
|
+
this.label = "Copy link to clipboard";
|
|
18
|
+
}, 2000);
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
if (this.header && this.hash) {
|
|
22
|
+
const [hostUrl] = window.location.href.split("#");
|
|
23
|
+
const url = `${hostUrl}#${this.hash}`;
|
|
24
|
+
await navigator.clipboard.writeText(url);
|
|
25
|
+
}
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error(error);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
doc-phase {
|
|
2
|
+
--doc-c-phase-top: calc(
|
|
3
|
+
var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
|
|
4
|
+
);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
dx-section {
|
|
8
|
+
--dx-c-section-padding-top: 0;
|
|
9
|
+
--dx-c-section-padding-bottom: var(--dx-g-spacing-2xl);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
dx-section::part(content) {
|
|
13
|
+
max-width: 1280px;
|
|
14
|
+
margin: auto;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
dx-group-text:first-of-type {
|
|
18
|
+
margin-top: var(--dx-g-spacing-2xl);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
dx-group-text.features {
|
|
22
|
+
margin-top: var(--dx-g-spacing-xl);
|
|
23
|
+
margin-bottom: var(--dx-g-spacing-xl);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.content {
|
|
27
|
+
padding-right: var(--dx-g-spacing-xl);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (max-width: 1024px) {
|
|
31
|
+
.content {
|
|
32
|
+
padding-right: 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media (max-width: 800px) {
|
|
37
|
+
dx-group-text.description {
|
|
38
|
+
margin-top: var(--dx-g-spacing-lg);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container">
|
|
3
|
+
<doc-phase
|
|
4
|
+
if:true={docPhaseInfo}
|
|
5
|
+
doc-phase-info={docPhaseInfo}
|
|
6
|
+
></doc-phase>
|
|
7
|
+
|
|
8
|
+
<dx-section>
|
|
9
|
+
<dx-grid columns="two-slim-right">
|
|
10
|
+
<div class="content">
|
|
11
|
+
<dx-group-text
|
|
12
|
+
class="description"
|
|
13
|
+
header={header}
|
|
14
|
+
body={description}
|
|
15
|
+
size="large"
|
|
16
|
+
title-aria-level="1"
|
|
17
|
+
primary-link={primaryLink}
|
|
18
|
+
secondary-link={secondaryLink}
|
|
19
|
+
></dx-group-text>
|
|
20
|
+
</div>
|
|
21
|
+
<div>
|
|
22
|
+
<dx-group-text
|
|
23
|
+
header={featuresListTitle}
|
|
24
|
+
size="medium"
|
|
25
|
+
class="features"
|
|
26
|
+
></dx-group-text>
|
|
27
|
+
<dx-features-list
|
|
28
|
+
options={featuresListOptions}
|
|
29
|
+
></dx-features-list>
|
|
30
|
+
</div>
|
|
31
|
+
</dx-grid>
|
|
32
|
+
</dx-section>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import { DocPhaseInfo, FeatureItem, Link } from "typings/custom";
|
|
3
|
+
|
|
4
|
+
export default class Overview extends LightningElement {
|
|
5
|
+
@api docPhaseInfo!: DocPhaseInfo;
|
|
6
|
+
@api header!: string;
|
|
7
|
+
@api description!: string;
|
|
8
|
+
@api primaryLink!: Link;
|
|
9
|
+
@api secondaryLink!: Link;
|
|
10
|
+
@api featuresListTitle!: string;
|
|
11
|
+
@api featuresListOptions!: FeatureItem[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
@import "docHelpers/status";
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
--doc-c-phase-top: 0;
|
|
7
|
+
--doc-c-phase-container-align-items: flex-start;
|
|
8
|
+
|
|
9
|
+
position: sticky;
|
|
10
|
+
top: var(--doc-c-phase-top);
|
|
11
|
+
|
|
12
|
+
/* NOTE: If you are changing z-index value here, ensure it's less than z-index of dx-sidebar in contentLayout.css */
|
|
13
|
+
z-index: var(--dx-g-z-index-100);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.doc-phase-container {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
align-items: var(--doc-c-phase-container-align-items);
|
|
20
|
+
padding-left: var(--dx-g-global-header-padding-horizontal);
|
|
21
|
+
padding-right: var(--dx-g-global-header-padding-horizontal);
|
|
22
|
+
width: 100%;
|
|
23
|
+
border: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.doc-phase-title-container {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: row;
|
|
29
|
+
align-items: center;
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
dx-button {
|
|
34
|
+
margin-left: auto;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
NOTE: Here we are assuming that indicator height won't go beyond 1000px.
|
|
39
|
+
|
|
40
|
+
It's one of the suggested way to achieve the expand/collapse animation
|
|
41
|
+
Ref: https://stackoverflow.com/a/41164095
|
|
42
|
+
|
|
43
|
+
Otherwise we need to change the height when user clicks on button
|
|
44
|
+
Ref: https://stackoverflow.com/a/11837673
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
.doc-phase-body {
|
|
48
|
+
display: block;
|
|
49
|
+
max-height: 1000px;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
padding-top: var(--dx-g-spacing-smd);
|
|
52
|
+
transition: max-height 0.25s ease, padding 0.25s ease;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.doc-phase-body-hidden {
|
|
56
|
+
max-height: 0;
|
|
57
|
+
padding-top: 0;
|
|
58
|
+
transition: max-height 0.1s ease-out, padding 0.25s ease-out;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.doc-phase-body a {
|
|
62
|
+
color: var(--dx-g-blue-vibrant-50);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Small Devices */
|
|
66
|
+
@media screen and (max-width: 480px) {
|
|
67
|
+
.doc-phase-container {
|
|
68
|
+
padding: var(--doc-status-vertical-padding);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class={className} part="container">
|
|
3
|
+
<div class="doc-phase-title-container">
|
|
4
|
+
<dx-icon
|
|
5
|
+
class="doc-status-icon doc-phase-icon"
|
|
6
|
+
symbol={iconName}
|
|
7
|
+
size="large"
|
|
8
|
+
color="status-icon-color"
|
|
9
|
+
></dx-icon>
|
|
10
|
+
<p class="doc-status-title doc-phase-title dx-text-body-3">
|
|
11
|
+
{docPhaseTitle}
|
|
12
|
+
</p>
|
|
13
|
+
<dx-button
|
|
14
|
+
lwc:if={dismissible}
|
|
15
|
+
aria-label="Dismiss"
|
|
16
|
+
icon-color="status-icon-color"
|
|
17
|
+
icon-size="large"
|
|
18
|
+
icon-symbol="close"
|
|
19
|
+
variant="icon-only"
|
|
20
|
+
onclick={onDismiss}
|
|
21
|
+
></dx-button>
|
|
22
|
+
<dx-button
|
|
23
|
+
lwc:else
|
|
24
|
+
variant="inline"
|
|
25
|
+
onclick={onShowHide}
|
|
26
|
+
aria-label={hideBodyText}
|
|
27
|
+
>
|
|
28
|
+
{hideBodyText}
|
|
29
|
+
</dx-button>
|
|
30
|
+
</div>
|
|
31
|
+
<!--
|
|
32
|
+
NOTE: Here we are rendering mark up using lwc:dom & innerHTML
|
|
33
|
+
option instead of slots because the html markup will come as a
|
|
34
|
+
property to the component from a configuration
|
|
35
|
+
-->
|
|
36
|
+
<span lwc:dom="manual" class={bodyClassName}></span>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
|
|
4
|
+
import { DocPhaseInfo } from "typings/custom";
|
|
5
|
+
import { toJson, normalizeBoolean } from "dxUtils/normalizers";
|
|
6
|
+
|
|
7
|
+
export default class Phase extends LightningElement {
|
|
8
|
+
_docPhaseInfo: DocPhaseInfo | null = null;
|
|
9
|
+
_dismissible = false;
|
|
10
|
+
_iconName = "recipe";
|
|
11
|
+
|
|
12
|
+
@api
|
|
13
|
+
get docPhaseInfo(): DocPhaseInfo | null {
|
|
14
|
+
return this._docPhaseInfo;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
set docPhaseInfo(value) {
|
|
18
|
+
this._docPhaseInfo = toJson(value);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@api
|
|
22
|
+
get dismissible(): boolean {
|
|
23
|
+
return this._dismissible;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
set dismissible(value) {
|
|
27
|
+
if (value) {
|
|
28
|
+
this._dismissible = normalizeBoolean(value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@api
|
|
33
|
+
get iconName(): string {
|
|
34
|
+
return this._iconName;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
set iconName(value) {
|
|
38
|
+
if (value) {
|
|
39
|
+
this._iconName = value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
isBodyHidden = false;
|
|
44
|
+
|
|
45
|
+
get docPhaseTitle() {
|
|
46
|
+
return this.docPhaseInfo?.title;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get hideBodyText() {
|
|
50
|
+
return this.isBodyHidden ? "Show" : "Hide";
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get className() {
|
|
54
|
+
return cx(
|
|
55
|
+
"doc-status-base",
|
|
56
|
+
"doc-status-container",
|
|
57
|
+
"doc-phase-container"
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
get bodyClassName() {
|
|
62
|
+
return cx(
|
|
63
|
+
"doc-phase-body",
|
|
64
|
+
"dx-text-body-3",
|
|
65
|
+
this.isBodyHidden && "doc-phase-body-hidden"
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
renderedCallback() {
|
|
70
|
+
const phaseBodyContainer =
|
|
71
|
+
this.template.querySelector(".doc-phase-body");
|
|
72
|
+
if (phaseBodyContainer && this.docPhaseInfo) {
|
|
73
|
+
// eslint-disable-next-line @lwc/lwc/no-inner-html
|
|
74
|
+
phaseBodyContainer.innerHTML = this.docPhaseInfo.body;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
onShowHide() {
|
|
79
|
+
this.isBodyHidden = !this.isBodyHidden;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
onDismiss() {
|
|
83
|
+
this.dispatchEvent(
|
|
84
|
+
new CustomEvent("dismissphase", {
|
|
85
|
+
detail: {
|
|
86
|
+
docPhaseInfo: this.docPhaseInfo
|
|
87
|
+
},
|
|
88
|
+
composed: true,
|
|
89
|
+
bubbles: true
|
|
90
|
+
})
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div title="properties">
|
|
3
|
+
<template if:true={hasAttributes}>
|
|
4
|
+
<doc-heading
|
|
5
|
+
header="Attributes"
|
|
6
|
+
hash="attributes"
|
|
7
|
+
aria-level="2"
|
|
8
|
+
></doc-heading>
|
|
9
|
+
<table>
|
|
10
|
+
<thead>
|
|
11
|
+
<tr>
|
|
12
|
+
<th>Name</th>
|
|
13
|
+
<th>Description</th>
|
|
14
|
+
</tr>
|
|
15
|
+
</thead>
|
|
16
|
+
<tbody>
|
|
17
|
+
<template for:each={attributes} for:item="attribute">
|
|
18
|
+
<tr key={attribute.name}>
|
|
19
|
+
<td>{attribute.nameInKebabCase}</td>
|
|
20
|
+
<td>{attribute.description}</td>
|
|
21
|
+
</tr>
|
|
22
|
+
</template>
|
|
23
|
+
</tbody>
|
|
24
|
+
</table>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<template if:true={hasMethods}>
|
|
28
|
+
<doc-heading
|
|
29
|
+
header="Methods"
|
|
30
|
+
hash="methods"
|
|
31
|
+
aria-level="2"
|
|
32
|
+
></doc-heading>
|
|
33
|
+
<table>
|
|
34
|
+
<thead>
|
|
35
|
+
<tr>
|
|
36
|
+
<th>Name</th>
|
|
37
|
+
<th>Description</th>
|
|
38
|
+
</tr>
|
|
39
|
+
</thead>
|
|
40
|
+
<tbody>
|
|
41
|
+
<template for:each={methods} for:item="method">
|
|
42
|
+
<tr key={method.name}>
|
|
43
|
+
<td>{method.nameInKebabCase}</td>
|
|
44
|
+
<td>{method.description}</td>
|
|
45
|
+
</tr>
|
|
46
|
+
</template>
|
|
47
|
+
</tbody>
|
|
48
|
+
</table>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<template if:true={hasSlots}>
|
|
52
|
+
<doc-heading
|
|
53
|
+
header="Slots"
|
|
54
|
+
hash="slots"
|
|
55
|
+
aria-level="2"
|
|
56
|
+
></doc-heading>
|
|
57
|
+
<table>
|
|
58
|
+
<thead>
|
|
59
|
+
<tr>
|
|
60
|
+
<th>Name</th>
|
|
61
|
+
<th>Description</th>
|
|
62
|
+
</tr>
|
|
63
|
+
</thead>
|
|
64
|
+
<tbody>
|
|
65
|
+
<template for:each={slots} for:item="slot">
|
|
66
|
+
<tr key={slot.name}>
|
|
67
|
+
<td>{slot.nameInKebabCase}</td>
|
|
68
|
+
<td>{slot.description}</td>
|
|
69
|
+
</tr>
|
|
70
|
+
</template>
|
|
71
|
+
</tbody>
|
|
72
|
+
</table>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<template if:true={hasEvents}>
|
|
76
|
+
<doc-heading
|
|
77
|
+
header="Events"
|
|
78
|
+
hash="events"
|
|
79
|
+
aria-level="2"
|
|
80
|
+
></doc-heading>
|
|
81
|
+
<table>
|
|
82
|
+
<thead>
|
|
83
|
+
<tr>
|
|
84
|
+
<th>Name</th>
|
|
85
|
+
<th>Description</th>
|
|
86
|
+
</tr>
|
|
87
|
+
</thead>
|
|
88
|
+
<tbody>
|
|
89
|
+
<template for:each={slots} for:item="slot">
|
|
90
|
+
<tr key={slot.name}>
|
|
91
|
+
<td>{slot.nameInKebabCase}</td>
|
|
92
|
+
<td>{slot.description}</td>
|
|
93
|
+
</tr>
|
|
94
|
+
</template>
|
|
95
|
+
</tbody>
|
|
96
|
+
</table>
|
|
97
|
+
</template>
|
|
98
|
+
</div>
|
|
99
|
+
</template>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { LightningElement, track, api } from "lwc";
|
|
2
|
+
|
|
3
|
+
export default class SpecificationContent extends LightningElement {
|
|
4
|
+
@track data: any;
|
|
5
|
+
@api component: string = "button";
|
|
6
|
+
@api type: string = "lightning";
|
|
7
|
+
|
|
8
|
+
private attributes = [];
|
|
9
|
+
private methods = [];
|
|
10
|
+
private slots = [];
|
|
11
|
+
private events = [];
|
|
12
|
+
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
this.fetchPropertiesData();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async fetchPropertiesData() {
|
|
18
|
+
const url = `http://localhost:3002/get-properties?component=${this.component}&type=${this.type}`;
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
const response = await fetch(url);
|
|
22
|
+
|
|
23
|
+
if (!response.ok) {
|
|
24
|
+
throw new Error(`Failed to fetch: ${response.statusText}`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const result = await response.json();
|
|
28
|
+
this.data = result;
|
|
29
|
+
({
|
|
30
|
+
attributes: this.attributes,
|
|
31
|
+
methods: this.methods,
|
|
32
|
+
slots: this.slots,
|
|
33
|
+
events: this.events
|
|
34
|
+
} = this.data);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
this.data = {};
|
|
37
|
+
console.error("fetchPropertiesData() failed for:" + url);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get hasAttributes() {
|
|
42
|
+
return this.attributes;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
get hasMethods() {
|
|
46
|
+
return this.methods;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get hasSlots() {
|
|
50
|
+
return this.slots;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get hasEvents() {
|
|
54
|
+
return this.events;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template lwc:render-mode="light">
|
|
2
|
+
<dx-hr no-padding spacing="md"></dx-hr>
|
|
3
|
+
<div class="survey-container">
|
|
4
|
+
<div class="text-container">
|
|
5
|
+
<b>DID THIS ARTICLE SOLVE YOUR ISSUE?</b>
|
|
6
|
+
<br />
|
|
7
|
+
Let us know so we can improve!
|
|
8
|
+
</div>
|
|
9
|
+
<div class="btn-container">
|
|
10
|
+
<dx-button
|
|
11
|
+
variant="secondary"
|
|
12
|
+
aria-label="Share Your Feedback"
|
|
13
|
+
onclick={openSurvey}
|
|
14
|
+
>
|
|
15
|
+
Share your feedback
|
|
16
|
+
</dx-button>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<dx-hr no-padding spacing="md"></dx-hr>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
:host .survey-container {
|
|
2
|
+
align-items: center;
|
|
3
|
+
align-content: center;
|
|
4
|
+
width: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
margin: 20px 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
dx-hr:first-of-type::part(hr) {
|
|
11
|
+
margin-top: var(--dx-g-spacing-2xl);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.text-container {
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LightningElement } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
3
|
+
|
|
4
|
+
declare const Sprig: (eventType: string, eventNme: string) => void;
|
|
5
|
+
|
|
6
|
+
export default class Phase extends LightningElement {
|
|
7
|
+
static renderMode = "light";
|
|
8
|
+
|
|
9
|
+
get className() {
|
|
10
|
+
return cx("container");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
openSurvey() {
|
|
14
|
+
Sprig("track", "ProvideFeedback");
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -11,7 +11,7 @@ export default class Toc extends LightningElement {
|
|
|
11
11
|
const newPageReference = { ...this.pageReference };
|
|
12
12
|
// When moving to the new navigation component
|
|
13
13
|
//const target = event.detail.name.split('-')
|
|
14
|
-
const target = event.currentTarget.dataset.id.split("-");
|
|
14
|
+
const target = (event.currentTarget as any).dataset.id.split("-");
|
|
15
15
|
newPageReference.contentDocumentId = target[0] + ".htm";
|
|
16
16
|
newPageReference.hash = target[1];
|
|
17
17
|
this.dispatchEvent(
|