Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Styling fixes/improvements#649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
FalkWolsky merged 6 commits intolowcoder-org:devfromraheeliftikhar5:table-fixes
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion.github/workflows/publish-lowcoder-cli.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@ on:

jobs:
publish-package:
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder/lowcoder.git'}}
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder-org/lowcoder.git'}}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion.github/workflows/publish-lowcoder-comps.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@ on:

jobs:
publish-package:
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder/lowcoder.git'}}
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder-org/lowcoder.git'}}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion.github/workflows/publish-lowcoder-core.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@ on:

jobs:
publish-package:
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder/lowcoder.git'}}
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder-org/lowcoder.git'}}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion.github/workflows/publish-lowcoder-sdk.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@ on:

jobs:
publish-package:
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder/lowcoder.git'}}
if: ${{ github.repositoryUrl == 'git://github.com/lowcoder-org/lowcoder.git'}}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -57,6 +57,17 @@ import log from "loglevel";
import { DisabledContext } from "comps/generators/uiCompBuilder";
import { LoadingOutlined } from "@ant-design/icons";
import { messageInstance } from "lowcoder-design";
import { styled } from "styled-components";

const FormWrapper = styled.div`
height: 100%;
.ant-spin-nested-loading {
height: 100%;
.ant-spin-container {
height: 100%;
}
}
`;

const eventOptions = [submitEvent] as const;

Expand DownExpand Up@@ -172,12 +183,18 @@ const FormBaseComp = (function () {
return new ContainerCompBuilder(childrenMap, (props, dispatch) => {
return (
<DisabledContext.Provider value={props.disabled}>
<Spin indicator={loadingIcon} spinning={props.loading}>
<TriContainer
{...props}
hintPlaceholder={<BodyPlaceholder {...props} dispatch={dispatch} />}
/>
</Spin>
<FormWrapper>
<Spin
indicator={loadingIcon}
spinning={props.loading}
style={{height: '100%'}}
>
<TriContainer
{...props}
hintPlaceholder={<BodyPlaceholder {...props} dispatch={dispatch} />}
/>
</Spin>
</FormWrapper>
</DisabledContext.Provider>
);
})
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -106,7 +106,7 @@ export const columnChildrenMap = {
borderWidth: withDefault(RadiusControl, ""),
radius: withDefault(RadiusControl, ""),
textSize: withDefault(RadiusControl, ""),
textWeight: withDefault(StringControl, "regular"),
textWeight: withDefault(StringControl, "normal"),
fontFamily: withDefault(StringControl, "sans-serif"),
cellColor: CellColorComp,
textOverflow: withDefault(TextOverflowControl, "ellipsis"),
Expand DownExpand Up@@ -276,7 +276,7 @@ export class ColumnComp extends ColumnInitComp {
{this.children.textWeight.propertyView({
label: trans('style.textWeight'),
preInputNode: <StyledTextWeightIcon as={TextWeigthIcon} title="" />,
placeholder: 'regular',
placeholder: 'normal',
})}
{this.children.fontFamily.propertyView({
label: trans('style.fontFamily'),
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -212,9 +212,6 @@ const TableWrapper = styled.div<{
border-color: ${(props) => props.$headerStyle.border};
border-width: ${(props) => props.$headerStyle.borderWidth};
color: ${(props) => props.$headerStyle.headerText};
font-size: ${(props) => props.$headerStyle.textSize};
font-weight: ${(props) => props.$headerStyle.textWeight};
font-family: ${(props) => props.$headerStyle.fontFamily};
border-inline-end: ${(props) => `${props.$headerStyle.borderWidth} solid ${props.$headerStyle.border}`} !important;
${(props) =>
props.$fixedHeader && `
Expand All@@ -227,6 +224,12 @@ const TableWrapper = styled.div<{

> div {
margin: ${(props) => props.$headerStyle.margin};

&, .ant-table-column-title > div {
font-size: ${(props) => props.$headerStyle.textSize};
font-weight: ${(props) => props.$headerStyle.textWeight};
font-family: ${(props) => props.$headerStyle.fontFamily};
}
}

&:last-child {
Expand DownExpand Up@@ -516,7 +519,7 @@ function TableCellView(props: {
const cellColor = cellColorFn({
currentCell: record[title.toLowerCase()],
});

const style = {
background: cellColor || rowColor || columnStyle.background || columnsStyle.background,
margin: columnStyle.margin || columnsStyle.margin,
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ import { BooleanStateControl, booleanExposingStateControl, stringExposingStateCo
import { eventHandlerControl } from "comps/controls/eventHandlerControl";
import { TabsOptionControl } from "comps/controls/optionsControl";
import { styleControl } from "comps/controls/styleControl";
import { TabContainerStyle, TabContainerStyleType, heightCalculator, widthCalculator } from "comps/controls/styleControlConstants";
import {ContainerBodyStyle, ContainerBodyStyleType, ContainerHeaderStyle, ContainerHeaderStyleType,TabContainerStyle, TabContainerStyleType, heightCalculator, widthCalculator } from "comps/controls/styleControlConstants";
import { sameTypeMap, UICompBuilder, withDefault } from "comps/generators";
import { addMapChildAction } from "comps/generators/sameTypeMap";
import { NameConfig, NameConfigHidden, withExposingConfigs } from "comps/generators/withExposing";
Expand All@@ -33,9 +33,6 @@ import { DisabledContext } from "comps/generators/uiCompBuilder";
import { EditorContext } from "comps/editorState";
import { checkIsMobile } from "util/commonUtils";
import { messageInstance } from "lowcoder-design";
import { show } from "antd-mobile/es/components/dialog/show";
import { BoolControl } from "@lowcoder-ee/index.sdk";
import { Switch } from "antd";

const EVENT_OPTIONS = [
{
Expand All@@ -57,38 +54,52 @@ const childrenMap = {
disabled: BoolCodeControl,
showHeader: withDefault(BooleanStateControl, "true"),
style: styleControl(TabContainerStyle),
headerStyle: styleControl(ContainerHeaderStyle),
bodyStyle: styleControl(ContainerBodyStyle),
};

type ViewProps = RecordConstructorToView<typeof childrenMap>;
type TabbedContainerProps = ViewProps & { dispatch: DispatchType };

const getStyle = (style: TabContainerStyleType) => {
const getStyle = (
style: TabContainerStyleType,
headerStyle: ContainerHeaderStyleType,
bodyStyle: ContainerBodyStyleType,
) => {
return css`
&.ant-tabs {
overflow: hidden;
border: ${style.borderWidth} solid ${style.border};
border-radius: ${style.radius};
overflow: hidden;
padding: ${style.padding};
background-color: ${style.background};
background-image: ${style.backgroundImage};
background-repeat: ${style.backgroundImageRepeat};
background-size: ${style.backgroundImageSize};
background-position: ${style.backgroundImagePosition};
background-origin: ${style.backgroundImageOrigin};

> .ant-tabs-content-holder > .ant-tabs-content > .ant-tabs-tabpane {
height: 100%;
.react-grid-layout {
border-radius: 0;
background-color: ${bodyStyle.background || 'transparent'};
background-image: ${bodyStyle.backgroundImage};
background-repeat: ${bodyStyle.backgroundImageRepeat};
background-size: ${bodyStyle.backgroundImageSize};
background-position: ${bodyStyle.backgroundImagePosition};
background-origin: ${bodyStyle.backgroundImageOrigin};

> .ant-tabs-content-holder > .ant-tabs-content > div > .react-grid-layout {
background-color: ${style.background};
border-radius: 0;

background-image: ${style.backgroundImage};
background-repeat: ${style.backgroundImageRepeat};
background-size: ${style.backgroundImageSize};
background-position: ${style.backgroundImagePosition};
background-origin: ${style.backgroundImageOrigin};

}
}

> .ant-tabs-nav {
background-color: ${style.headerBackground};
background-image: ${style.headerBackgroundImage};
background-repeat: ${style.headerBackgroundImageRepeat};
background-size: ${style.headerBackgroundImageSize};
background-position: ${style.headerBackgroundImagePosition};
background-origin: ${style.headerBackgroundImageOrigin};
background-color: ${headerStyle.headerBackground || 'transparent'};
background-image: ${headerStyle.headerBackgroundImage};
background-repeat: ${headerStyle.headerBackgroundImageRepeat};
background-size: ${headerStyle.headerBackgroundImageSize};
background-position: ${headerStyle.headerBackgroundImagePosition};
background-origin: ${headerStyle.headerBackgroundImageOrigin};

.ant-tabs-tab {
div {
Expand All@@ -113,7 +124,9 @@ const getStyle = (style: TabContainerStyleType) => {
};

const StyledTabs = styled(Tabs)<{
$style: TabContainerStyleType;
$style: TabContainerStyleType;
$headerStyle: ContainerHeaderStyleType;
$bodyStyle: ContainerBodyStyleType;
$isMobile?: boolean;
$showHeader?: boolean;
}>`
Expand DownExpand Up@@ -145,7 +158,11 @@ const StyledTabs = styled(Tabs)<{
margin-right: -24px;
}

${(props) => props.$style && getStyle(props.$style)}
${(props) => props.$style && getStyle(
props.$style,
props.$headerStyle,
props.$bodyStyle,
)}
`;

const ContainerInTab = (props: ContainerBaseProps) => {
Expand All@@ -155,7 +172,14 @@ const ContainerInTab = (props: ContainerBaseProps) => {
};

const TabbedContainer = (props: TabbedContainerProps) => {
let { tabs, containers, dispatch, style } = props;
let {
tabs,
containers,
dispatch,
style,
headerStyle,
bodyStyle,
} = props;

const visibleTabs = tabs.filter((tab) => !tab.hidden);
const selectedTab = visibleTabs.find((tab) => tab.key === props.selectedTabKey.value);
Expand DownExpand Up@@ -203,7 +227,7 @@ const TabbedContainer = (props: TabbedContainerProps) => {
key: tab.key,
forceRender: true,
children: (
<BackgroundColorContext.Provider value={props.style.background}>
<BackgroundColorContext.Provider value={bodyStyle.background}>
<ContainerInTab
layout={containerProps.layout.getView()}
items={gridItemCompToGridItems(containerProps.items.getView())}
Expand All@@ -222,6 +246,8 @@ const TabbedContainer = (props: TabbedContainerProps) => {
<StyledTabs
activeKey={activeKey}
$style={style}
$headerStyle={headerStyle}
$bodyStyle={bodyStyle}
$showHeader={showHeader}
onChange={(key) => {
if (key !== props.selectedTabKey.value) {
Expand DownExpand Up@@ -277,6 +303,14 @@ export const TabbedContainerBaseComp = (function () {
<Section name={sectionNames.style}>
{children.style.getPropertyView()}
</Section>
{children.showHeader.getView() && (
<Section name={"Header Style"}>
{ children.headerStyle.getPropertyView() }
</Section>
)}
<Section name={"Body Style"}>
{ children.bodyStyle.getPropertyView() }
</Section>
</>
)}
</>
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,12 @@ const getStyle = (style: ContainerStyleType) => {
padding: ${style.padding};
// width: ${widthCalculator(style.margin)};
// height: ${heightCalculator(style.margin)};
${style.background && `background-color: ${style.background};`}
${style.backgroundImage && `background-image: ${style.backgroundImage};`}
${style.backgroundImageRepeat && `background-repeat: ${style.backgroundImageRepeat};`}
${style.backgroundImageSize && `background-size: ${style.backgroundImageSize};`}
${style.backgroundImagePosition && `background-position: ${style.backgroundImagePosition};`}
${style.backgroundImageOrigin && `background-origin: ${style.backgroundImageOrigin};`}
`;
};

Expand DownExpand Up@@ -130,7 +136,7 @@ export function TriContainer(props: TriContainerProps) {
minHeight="46px"
containerPadding={[paddingWidth, 3]}
showName={{ bottom: showBody || showFooter ? 20 : 0 }}
$backgroundColor={headerStyle?.headerBackground}
$backgroundColor={headerStyle?.headerBackground || 'transparent'}
$headerBackgroundImage={headerStyle?.headerBackgroundImage}
$headerBackgroundImageRepeat={headerStyle?.headerBackgroundImageRepeat}
$headerBackgroundImageSize={headerStyle?.headerBackgroundImageSize}
Expand All@@ -154,7 +160,7 @@ export function TriContainer(props: TriContainerProps) {
(showHeader && showFooter) || showHeader ? [paddingWidth, 11.5] : [paddingWidth, 11]
}
hintPlaceholder={props.hintPlaceholder ?? HintPlaceHolder}
$backgroundColor={bodyStyle?.background}
$backgroundColor={bodyStyle?.background || 'transparent'}
$borderColor={style?.border}
$borderWidth={style?.borderWidth}
$backgroundImage={bodyStyle?.backgroundImage}
Expand All@@ -177,7 +183,7 @@ export function TriContainer(props: TriContainerProps) {
minHeight={showBody ? "47px" : "46px"}
containerPadding={showBody || showHeader ? [paddingWidth, 3.5] : [paddingWidth, 3]}
showName={{ top: showHeader || showBody ? 20 : 0 }}
$backgroundColor={footerStyle?.footerBackground}
$backgroundColor={footerStyle?.footerBackground || 'transparent'}
$footerBackgroundImage={footerStyle?.footerBackgroundImage}
$footerBackgroundImageRepeat={footerStyle?.footerBackgroundImageRepeat}
$footerBackgroundImageSize={footerStyle?.footerBackgroundImageSize}
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -393,7 +393,7 @@ function calcColors<ColorMap extends Record<string, string>>(
}
if (isTextWeightConfig(config)) {
// TODO: remove default textWeight after added in theme in backend.
res[name] = themeWithDefault[config.textWeight] || 'regular';
res[name] = themeWithDefault[config.textWeight] || 'normal';
}
if (isFontFamilyConfig(config)) {
res[name] = themeWithDefault[config.fontFamily] || 'sans-serif';
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp