mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-09 06:34:53 +03:00
Merge branch 'master' of https://github.com/raha1923/redoc
This commit is contained in:
commit
991da3a62b
|
@ -11,15 +11,16 @@ export const PropertiesTableCaption = styled.caption`
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const PropertyCell = styled.td<{ kind?: string }>`
|
export const PropertyCell = styled.td<{ kind?: string }>`
|
||||||
border-left: 1px solid ${props => props.theme.schema.linesColor};
|
border-left: ${({ theme }) => (theme.typography.direction === 'rtl') ? 0 : '1px solid ' } ${props => props.theme.schema.linesColor};
|
||||||
|
border-right: ${({ theme }) => (theme.typography.direction === 'rtl') ? '1px solid ' : 0 } ${props => props.theme.schema.linesColor};
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 10px 10px 10px 0;
|
padding: ${({ theme }) => (theme.typography.direction === 'rtl') ? '10px 0 10px 10px' : '10px 10px 10px 0' }
|
||||||
|
|
||||||
tr:first-of-type > &,
|
tr:first-of-type > &,
|
||||||
tr.last > & {
|
tr.last > & {
|
||||||
border-left-width: 0;
|
border-width: 0;
|
||||||
background-position: top left;
|
background-position: ${({ theme }) => (theme.typography.direction === 'rtl') ? 'top right' : 'top left' };
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 1px 100%;
|
background-size: 1px 100%;
|
||||||
}
|
}
|
||||||
|
@ -79,6 +80,7 @@ export const PropertyDetailsCell = styled.td`
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
width: ${props => props.theme.schema.defaultDetailsWidth};
|
width: ${props => props.theme.schema.defaultDetailsWidth};
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
direction: ltr;
|
||||||
|
|
||||||
tr.expanded & {
|
tr.expanded & {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
|
@ -88,7 +90,7 @@ export const PropertyDetailsCell = styled.td`
|
||||||
export const PropertyBullet = styled.span`
|
export const PropertyBullet = styled.span`
|
||||||
color: ${props => props.theme.schema.linesColor};
|
color: ${props => props.theme.schema.linesColor};
|
||||||
font-family: ${props => props.theme.typography.code.fontFamily};
|
font-family: ${props => props.theme.typography.code.fontFamily};
|
||||||
margin-right: 10px;
|
margin: ${({ theme }) => (theme.typography.direction === 'rtl') ? '0 0 0 10px ' : '0 10px 0 0' }
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: '';
|
content: '';
|
||||||
|
@ -108,7 +110,10 @@ export const PropertyBullet = styled.span`
|
||||||
height: 7px;
|
height: 7px;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
export const WrappedShelfIcon = styled.i`
|
||||||
|
transform: ${({ theme }) => (theme.typography.direction === 'rtl') ? 'rotateY(180deg)' : 'none'};
|
||||||
|
display: inline-block
|
||||||
|
`;
|
||||||
export const InnerPropertiesWrap = styled.div`
|
export const InnerPropertiesWrap = styled.div`
|
||||||
padding: ${({ theme }) => theme.schema.nestingSpacing};
|
padding: ${({ theme }) => theme.schema.nestingSpacing};
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -10,6 +10,7 @@ import {
|
||||||
PropertyCellWithInner,
|
PropertyCellWithInner,
|
||||||
PropertyDetailsCell,
|
PropertyDetailsCell,
|
||||||
PropertyNameCell,
|
PropertyNameCell,
|
||||||
|
WrappedShelfIcon,
|
||||||
} from '../../common-elements/fields-layout';
|
} from '../../common-elements/fields-layout';
|
||||||
|
|
||||||
import { ShelfIcon } from '../../common-elements/';
|
import { ShelfIcon } from '../../common-elements/';
|
||||||
|
@ -46,7 +47,9 @@ export class Field extends React.Component<FieldProps> {
|
||||||
>
|
>
|
||||||
<PropertyBullet />
|
<PropertyBullet />
|
||||||
{name}
|
{name}
|
||||||
<ShelfIcon direction={expanded ? 'down' : 'right'} />
|
<WrappedShelfIcon>
|
||||||
|
<ShelfIcon direction={expanded ? 'down' : 'right'} />
|
||||||
|
</WrappedShelfIcon>
|
||||||
{required && <RequiredLabel> required </RequiredLabel>}
|
{required && <RequiredLabel> required </RequiredLabel>}
|
||||||
</ClickablePropertyNameCell>
|
</ClickablePropertyNameCell>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
@ -24,6 +24,7 @@ export const SearchInput = styled.input.attrs(() => ({
|
||||||
color: ${props => props.theme.menu.textColor};
|
color: ${props => props.theme.menu.textColor};
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
text-align: ${({ theme }) => (theme.typography.direction === 'rtl') ? 'center' : 'inherit'};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const SearchIcon = styled((props: { className?: string }) => (
|
export const SearchIcon = styled((props: { className?: string }) => (
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { ShelfIcon } from '../../common-elements/shelfs';
|
||||||
import { IMenuItem, OperationModel } from '../../services';
|
import { IMenuItem, OperationModel } from '../../services';
|
||||||
import { shortenHTTPVerb } from '../../utils/openapi';
|
import { shortenHTTPVerb } from '../../utils/openapi';
|
||||||
import { MenuItems } from './MenuItems';
|
import { MenuItems } from './MenuItems';
|
||||||
import { MenuItemLabel, MenuItemLi, MenuItemTitle, OperationBadge } from './styled.elements';
|
import { MenuItemLabel, MenuItemLi, MenuItemTitle, OperationBadge, WrappedShelfIcon } from './styled.elements';
|
||||||
|
|
||||||
export interface MenuItemProps {
|
export interface MenuItemProps {
|
||||||
item: IMenuItem;
|
item: IMenuItem;
|
||||||
|
@ -58,7 +58,9 @@ export class MenuItem extends React.Component<MenuItemProps> {
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</MenuItemTitle>
|
</MenuItemTitle>
|
||||||
{(item.depth > 0 && item.items.length > 0 && (
|
{(item.depth > 0 && item.items.length > 0 && (
|
||||||
<ShelfIcon float={'right'} direction={item.expanded ? 'down' : 'right'} />
|
<WrappedShelfIcon>
|
||||||
|
<ShelfIcon float={'right'} direction={item.expanded ? 'down' : 'right'} />
|
||||||
|
</WrappedShelfIcon>
|
||||||
)) ||
|
)) ||
|
||||||
null}
|
null}
|
||||||
</MenuItemLabel>
|
</MenuItemLabel>
|
||||||
|
|
|
@ -131,8 +131,11 @@ export const MenuItemLabel = styled.label.attrs((props: MenuItemLabelType) => ({
|
||||||
padding: 12.5px ${props => props.theme.spacing.unit * 4}px;
|
padding: 12.5px ${props => props.theme.spacing.unit * 4}px;
|
||||||
${({ depth, type, theme }) =>
|
${({ depth, type, theme }) =>
|
||||||
(type === 'section' && depth > 1 && 'padding-left: ' + theme.spacing.unit * 8 + 'px;') || ''}
|
(type === 'section' && depth > 1 && 'padding-left: ' + theme.spacing.unit * 8 + 'px;') || ''}
|
||||||
|
direction: ${({ type, theme}) =>
|
||||||
|
(((['section', 'group', 'tag'].indexOf(type || '') > -1) && (theme.typography.direction === 'rtl')) ? 'rtl' : 'ltr')};
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
text-align: ${({ theme }) => (theme.typography.direction === 'rtl') ? 'right' : 'left'};
|
||||||
font-family: ${props => props.theme.typography.headings.fontFamily};
|
font-family: ${props => props.theme.typography.headings.fontFamily};
|
||||||
${props => menuItemDepth[props.depth]};
|
${props => menuItemDepth[props.depth]};
|
||||||
background-color: ${props => (props.active ? menuItemActiveBg(props.depth, props) : '')};
|
background-color: ${props => (props.active ? menuItemActiveBg(props.depth, props) : '')};
|
||||||
|
@ -179,3 +182,6 @@ export const RedocAttribution = styled.div`
|
||||||
}
|
}
|
||||||
`};
|
`};
|
||||||
`;
|
`;
|
||||||
|
export const WrappedShelfIcon = styled.i`
|
||||||
|
transform: ${({ theme }) => (theme.typography.direction === 'rtl') ? 'rotateY(180deg)' : 'none'};
|
||||||
|
`;
|
||||||
|
|
|
@ -62,5 +62,6 @@ const ChevronContainer = styled.div`
|
||||||
align-self: center;
|
align-self: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
direction: ltr;
|
||||||
color: ${props => props.theme.colors.primary.main};
|
color: ${props => props.theme.colors.primary.main};
|
||||||
`;
|
`;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user