-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work for https://github.com/surveyjs/private-tasks/issues/378 - react…
… component and placeholder styles refactoring
- Loading branch information
tsv2013
committed
Sep 13, 2024
1 parent
2cbc629
commit 4b8620d
Showing
13 changed files
with
146 additions
and
116 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/survey-creator-angular/src/tabs/logic/logic.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
packages/survey-creator-core/src/components/surface-placeholder.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
@import "../variables.scss"; | ||
|
||
.svc-surface-placeholder { | ||
display: flex; | ||
width: 100%; | ||
max-width: var(--ctr-surface-placeholder-max-width, 720px); | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 0px; | ||
padding: calcSize(2); | ||
box-sizing: border-box; | ||
} | ||
|
||
.svc-surface-placeholder__image { | ||
display: flex; | ||
flex-direction: row; | ||
gap: 0px; | ||
align-items: center; | ||
justify-content: center; | ||
flex-shrink: 0; | ||
position: relative; | ||
overflow: hidden; | ||
padding: 133px 168px 133px 168px; | ||
display: flex; | ||
flex-direction: row; | ||
gap: 0px; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.svc-surface-placeholder__image--designer { | ||
background: url("../images/placeholder-designer.png") no-repeat; | ||
} | ||
|
||
.svc-surface-placeholder__image--preview { | ||
background: url("../images/placeholder-preview.png") no-repeat; | ||
} | ||
|
||
.svc-surface-placeholder__image--theme { | ||
background: url("../images/placeholder-themes.png") no-repeat; | ||
} | ||
|
||
.svc-surface-placeholder__image--logic { | ||
background: url("../images/placeholder-logic.png") no-repeat; | ||
} | ||
|
||
.svc-surface-placeholder__image--translation { | ||
background: url("../images/placeholder-translations.png") no-repeat; | ||
} | ||
|
||
.svc-surface-placeholder__text { | ||
padding: var(--ctr-surface-placeholder-text-margin-top, 32px) 0px var(--ctr-surface-placeholder-text-margin-bottom, 24px) 0px; | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--ctr-surface-placeholder-text-gap, 8px); | ||
align-items: center; | ||
justify-content: center; | ||
align-self: center; | ||
flex-shrink: 0; | ||
width: 100%; | ||
} | ||
|
||
.svc-surface-placeholder__title { | ||
color: var(--ctr-surface-placeholder-text-title-color, rgba(0, 0, 0, 0.91)); | ||
text-align: center; | ||
font-family: var(--ctr-medium-bold-font-family, "OpenSans-Bold", sans-serif); | ||
font-size: var(--ctr-medium-bold-font-size, 24px); | ||
line-height: var(--ctr-medium-bold-line-height, 32px); | ||
font-weight: var(--ctr-medium-bold-font-weight, 700); | ||
align-self: stretch; | ||
} | ||
|
||
.svc-surface-placeholder__description { | ||
color: var(--ctr-surface-placeholder-text-description-color, | ||
rgba(0, 0, 0, 0.45)); | ||
text-align: center; | ||
font-family: var(--ctr-default-font-family, "OpenSans-Regular", sans-serif); | ||
font-size: var(--ctr-default-font-size, 16px); | ||
line-height: var(--ctr-default-line-height, 24px); | ||
font-weight: var(--ctr-default-font-weight, 400); | ||
align-self: stretch; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/survey-creator-react/src/components/SurfacePlaceholder.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import * as React from "react"; | ||
import { ReactElementFactory } from "survey-react-ui"; | ||
|
||
interface ISurfacePlaceholderProps { | ||
name: string; | ||
placeholderTitleText: string; | ||
placeholderDescriptionText: string; | ||
} | ||
|
||
export class SurfacePlaceholder extends React.Component<ISurfacePlaceholderProps, any> { | ||
constructor(props: ISurfacePlaceholderProps) { | ||
super(props); | ||
} | ||
render(): JSX.Element { | ||
return ( | ||
<div className="svc-surface-placeholder" > | ||
<div className={"svc-surface-placeholder__image svc-surface-placeholder__image--" + this.props.name}></div > | ||
<div className="svc-surface-placeholder__text"> | ||
<div className="svc-surface-placeholder__title">{this.props.placeholderTitleText}</div> | ||
<div className="svc-surface-placeholder__description">{this.props.placeholderDescriptionText}</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
ReactElementFactory.Instance.registerElement("svc-surface-placeholder", | ||
(props: ISurfacePlaceholderProps) => { | ||
return React.createElement(SurfacePlaceholder, props); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters