Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
37a901a
font style property created and added in textDisplay component
imtananikhwa Feb 14, 2024
8592695
text-area font syle added
imtananikhwa Feb 15, 2024
8fd726c
Text area font style added
imtananikhwa Feb 15, 2024
a603a57
Table column styles working
imtananikhwa Feb 15, 2024
e3463a0
Delete client/packages/lowcoder/vite.config.mts.timestamp-17080052833…
imtananikhwa Feb 17, 2024
4380582
Merge pull request #684 from imtananikhwa/imtanan-task1
FalkWolsky Feb 17, 2024
0886f58
Controls added to divider, button comp, dropdown, nav ,link & mention…
imtananikhwa Feb 17, 2024
12b4551
Merge branch 'imtanan-task1' of https://github.com/imtananikhwa/lowco…
imtananikhwa Feb 17, 2024
5c6a0e1
Merge pull request #686 from imtananikhwa/imtanan-task1
FalkWolsky Feb 18, 2024
5a4e1c4
Common style config added, number input component updated, link compo…
imtananikhwa Feb 20, 2024
a055656
Creating function that helps to replace style from common style array…
imtananikhwa Feb 21, 2024
1d42ee8
Merge pull request #698 from imtananikhwa/imtanan-task1
FalkWolsky Feb 21, 2024
f556fa7
nav component issue fixes, component updates in progress
imtananikhwa Feb 22, 2024
8a63065
Toggle button border Width fixes
imtananikhwa Feb 22, 2024
7b6dda6
FOnt added for testing, circle progress and progress updated
imtananikhwa Feb 22, 2024
cac08a4
File upload component styling and controls added
imtananikhwa Feb 22, 2024
b31e606
Merge pull request #700 from imtananikhwa/imtanan-task1
FalkWolsky Feb 22, 2024
8c7c873
Radio component styling added
imtananikhwa Feb 23, 2024
67d578c
Checkbox, radio input styles complete, select styling in progress
imtananikhwa Feb 23, 2024
f5d941e
Merge pull request #705 from imtananikhwa/imtanan-task1
FalkWolsky Feb 23, 2024
42bb266
Merge branch 'dev' into style-changes-imtaman
FalkWolsky Feb 24, 2024
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
Prev Previous commit
Next Next commit
Text area font style added
  • Loading branch information
imtananikhwa committed Feb 15, 2024
commit 8fd726c954c6cb4de310639a11c65a781fe72159
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export const columnChildrenMap = {
textSize: withDefault(RadiusControl, ""),
textWeight: withDefault(StringControl, "normal"),
fontFamily: withDefault(StringControl, "sans-serif"),
fontStyle: withDefault(StringControl, 'normal'),
cellColor: CellColorComp,
textOverflow: withDefault(TextOverflowControl, "ellipsis"),
linkColor: withDefault(ColorControl, "#3377ff"),
Expand Down Expand Up @@ -155,10 +156,10 @@ export class ColumnComp extends ColumnInitComp {
)
);
}
if(action.type === CompActionTypes.CHANGE_VALUE) {
if (action.type === CompActionTypes.CHANGE_VALUE) {
const title = comp.children.title.unevaledValue;
const dataIndex = comp.children.dataIndex.getView();
if(!Boolean(title)) {
if (!Boolean(title)) {
comp.children.title.dispatchChangeValueAction(dataIndex);
}
}
Expand Down Expand Up @@ -223,10 +224,10 @@ export class ColumnComp extends ColumnInitComp {
})}
{this.children.autoWidth.getView() === "fixed" &&
this.children.width.propertyView({ label: trans("prop.width") })}

{(columnType === 'link' || columnType === 'links') && (
<>
<Divider style={{margin: '12px 0'}} />
<Divider style={{ margin: '12px 0' }} />
{controlItem({}, (
<div>
<b>{"Link Style"}</b>
Expand All @@ -243,10 +244,10 @@ export class ColumnComp extends ColumnInitComp {
})}
</>
)}
<Divider style={{margin: '12px 0'}} />
<Divider style={{ margin: '12px 0' }} />
{controlItem({}, (
<div>
<b>{"Column Style"}</b>
<b>{"Column Style"}</b>
</div>
))}
{this.children.background.propertyView({
Expand All @@ -260,29 +261,34 @@ export class ColumnComp extends ColumnInitComp {
})}
{this.children.borderWidth.propertyView({
label: trans('style.borderWidth'),
preInputNode: <StyledBorderIcon as={BorderWidthIcon} title="" />,
preInputNode: <StyledBorderIcon as={BorderWidthIcon} title="" />,
placeholder: '1px',
})}
{this.children.radius.propertyView({
label: trans('style.borderRadius'),
preInputNode: <StyledBorderRadiusIcon as={IconRadius} title="" />,
preInputNode: <StyledBorderRadiusIcon as={IconRadius} title="" />,
placeholder: '3px',
})}
{this.children.textSize.propertyView({
label: trans('style.textSize'),
preInputNode: <StyledTextSizeIcon as={TextSizeIcon} title="" />,
preInputNode: <StyledTextSizeIcon as={TextSizeIcon} title="" />,
placeholder: '14px',
})}
{this.children.textWeight.propertyView({
label: trans('style.textWeight'),
preInputNode: <StyledTextWeightIcon as={TextWeigthIcon} title="" />,
preInputNode: <StyledTextWeightIcon as={TextWeigthIcon} title="" />,
placeholder: 'normal',
})}
{this.children.fontFamily.propertyView({
label: trans('style.fontFamily'),
preInputNode: <StyledFontFamilyIcon as={FontFamilyIcon} title="" />,
preInputNode: <StyledFontFamilyIcon as={FontFamilyIcon} title="" />,
placeholder: 'sans-serif',
})}
{this.children.fontStyle.propertyView({
label: trans('style.fontStyle'),
preInputNode: <StyledFontFamilyIcon as={FontFamilyIcon} title="" />,
placeholder: 'normal'
})}
{this.children.textOverflow.getPropertyView()}
{this.children.cellColor.getPropertyView()}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const getStyle = (
style: TableStyleType,
rowStyle: TableRowStyleType,
headerStyle: TableHeaderStyleType,
toolbarStyle: TableToolbarStyleType
toolbarStyle: TableToolbarStyleType,
) => {
const background = genLinerGradient(style.background);
const selectedRowBackground = genLinerGradient(rowStyle.selectedRowBackground);
Expand Down Expand Up @@ -140,7 +140,8 @@ const BackgroundWrapper = styled.div<{
background: ${(props) => props.$style.background} !important;
border: ${(props) => `${props.$style.borderWidth} solid ${props.$style.border} !important`};
border-radius: ${(props) => props.$style.radius} !important;
padding: unset !important;
// padding: unset !important;
padding: ${(props) => props.$style.padding} !important
margin: ${(props) => props.$style.margin} !important;
overflow: scroll !important;
${(props) => props.$style}
Expand Down Expand Up @@ -209,18 +210,19 @@ const TableWrapper = styled.div<{
> .ant-table-thead {
> tr > th {
background-color: ${(props) => props.$headerStyle.headerBackground};

border-color: ${(props) => props.$headerStyle.border};
border-width: ${(props) => props.$headerStyle.borderWidth};
color: ${(props) => props.$headerStyle.headerText};
border-inline-end: ${(props) => `${props.$headerStyle.borderWidth} solid ${props.$headerStyle.border}`} !important;
${(props) =>
props.$fixedHeader && `
${(props) =>
props.$fixedHeader && `
position: sticky;
position: -webkit-sticky;
top: ${props.$fixedToolbar ? '47px' : '0'};
z-index: 99;
`
}
}

> div {
margin: ${(props) => props.$headerStyle.margin};
Expand All @@ -229,6 +231,8 @@ const TableWrapper = styled.div<{
font-size: ${(props) => props.$headerStyle.textSize};
font-weight: ${(props) => props.$headerStyle.textWeight};
font-family: ${(props) => props.$headerStyle.fontFamily};
font-style: ${(props) => props.$headerStyle.fontStyle};
color:${(props) => props.$headerStyle.text}
}
}

Expand Down Expand Up @@ -286,8 +290,8 @@ const TableWrapper = styled.div<{

// hide the bottom border of the last row
${(props) =>
props.$toolbarPosition !== "below" &&
`
props.$toolbarPosition !== "below" &&
`
tbody > tr:last-child > td {
border-bottom: unset;
}
Expand All @@ -300,10 +304,10 @@ const TableWrapper = styled.div<{
}
}

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

const TableTh = styled.th<{ width?: number }>`
overflow: hidden;

Expand All @@ -318,7 +322,7 @@ const TableTh = styled.th<{ width?: number }>`

const TableTd = styled.td<{
$background: string;
$style: TableColumnStyleType & {rowHeight?: string};
$style: TableColumnStyleType & { rowHeight?: string };
$defaultThemeDetail: ThemeDetail;
$linkStyle?: TableColumnLinkStyleType;
$isEditing: boolean;
Expand Down Expand Up @@ -348,7 +352,8 @@ const TableTd = styled.td<{

${(props) => props.$tableSize === 'small' && `
padding: 1px 8px;
font-size: ${props.$defaultThemeDetail.textSize == props.$style.textSize ? '14px !important' : props.$style.textSize + ' !important' };
font-size: ${props.$defaultThemeDetail.textSize == props.$style.textSize ? '14px !important' : props.$style.textSize + ' !important'};
font-style:${props.$style.fontStyle} !important;
min-height: ${props.$style.rowHeight || '14px'};
line-height: 20px;
${!props.$autoHeight && `
Expand All @@ -358,7 +363,8 @@ const TableTd = styled.td<{
`};
${(props) => props.$tableSize === 'middle' && `
padding: 8px 8px;
font-size: ${props.$defaultThemeDetail.textSize == props.$style.textSize ? '16px !important' : props.$style.textSize + ' !important' };
font-size: ${props.$defaultThemeDetail.textSize == props.$style.textSize ? '16px !important' : props.$style.textSize + ' !important'};
font-style:${props.$style.fontStyle} !important;
min-height: ${props.$style.rowHeight || '24px'};
line-height: 24px;
${!props.$autoHeight && `
Expand All @@ -368,7 +374,8 @@ const TableTd = styled.td<{
`};
${(props) => props.$tableSize === 'large' && `
padding: 16px 16px;
font-size: ${props.$defaultThemeDetail.textSize == props.$style.textSize ? '18px !important' : props.$style.textSize + ' !important' };
font-size: ${props.$defaultThemeDetail.textSize == props.$style.textSize ? '18px !important' : props.$style.textSize + ' !important'};
font-style:${props.$style.fontStyle} !important;
min-height: ${props.$style.rowHeight || '48px'};
${!props.$autoHeight && `
overflow-y: auto;
Expand Down Expand Up @@ -444,7 +451,7 @@ const ResizeableTitle = (props: any) => {
draggableOpts={{ enableUserSelectHack: false }}
handle={(axis: ResizeHandleAxis, ref: ReactRef<HTMLDivElement>) => (
<TitleResizeHandle
ref={ref}
ref={ref}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
Expand Down Expand Up @@ -519,7 +526,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 All @@ -530,6 +537,7 @@ function TableCellView(props: {
textSize: columnStyle.textSize || columnsStyle.textSize,
textWeight: columnStyle.textWeight || columnsStyle.textWeight,
fontFamily: columnStyle.fontFamily || columnsStyle.fontFamily,
fontStyle: columnStyle.fontStyle || columnsStyle.fontStyle,
rowHeight: rowHeight,
}
let { background } = style;
Expand All @@ -554,7 +562,7 @@ function TableCellView(props: {
</TableTd>
);
}

return (
<TableCellContext.Provider value={{ isEditing: editing, setIsEditing: setEditing }}>
{tdView}
Expand Down Expand Up @@ -804,7 +812,7 @@ export function TableCompView(props: {

return (
<BackgroundColorContext.Provider value={style.background} >

<BackgroundWrapper ref={ref} $style={style} $tableAutoHeight={tableAutoHeight}>
{toolbar.position === "above" && toolbarView}
<TableWrapper
Expand All @@ -826,11 +834,11 @@ export function TableCompView(props: {
: "OB_CHILDREN_KEY_PLACEHOLDER",
fixed: "left",
onExpand: (expanded) => {
if(expanded) {
handleChangeEvent('rowExpand')
} else {
handleChangeEvent('rowShrink')
}
if (expanded) {
handleChangeEvent('rowExpand')
} else {
handleChangeEvent('rowShrink')
}
}
}}
rowColorFn={compChildren.rowColor.getView() as any}
Expand All @@ -857,14 +865,14 @@ export function TableCompView(props: {
compChildren.loading.getView()
}
/>

<SlotConfigContext.Provider value={{ modalWidth: width && Math.max(width, 300) }}>
{expansion.expandModalView}
</SlotConfigContext.Provider>
</TableWrapper>
{toolbar.position === "below" && toolbarView}
</BackgroundWrapper>

</BackgroundColorContext.Provider>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const tableChildrenMap = {
toolbarStyle: styleControl(TableToolbarStyle),
headerStyle: styleControl(TableHeaderStyle),
searchText: StringControl,
columnsStyle: withDefault(styleControl(TableColumnStyle), {borderWidth: '1px', radius: '0px'}),
columnsStyle: withDefault(styleControl(TableColumnStyle), {borderWidth: '1px', radius: '0px',fontStyle:'italic'}),
viewModeResizable: BoolControl,
visibleResizables: BoolControl,
// sample data for regenerating columns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ export function columnsToAntdFormat(
status: StatusType;
}[];
const title = renderTitle({ title: column.title, editable: column.editable });

return {
title: column.showTitle ? title : '',
titleText: column.title,
Expand All @@ -326,6 +327,7 @@ export function columnsToAntdFormat(
radius: column.radius,
textSize: column.textSize,
textWeight: column.textWeight,
fontStyle:column.fontStyle,
fontFamily: column.fontFamily,
borderWidth: column.borderWidth,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ const LinkTextStyle = [

export const TableStyle = [
MARGIN,
PADDING,
...BG_STATIC_BORDER_RADIUS,
{
name: "borderWidth",
Expand All @@ -943,6 +944,10 @@ export const TableToolbarStyle = [

export const TableHeaderStyle = [
MARGIN,
PADDING,
FONT_FAMILY,
FONT_STYLE,
TEXT,
{
name: "headerBackground",
label: trans("style.tableHeaderBackground"),
Expand Down Expand Up @@ -1000,7 +1005,8 @@ export const TableColumnStyle = [
TEXT,
TEXT_SIZE,
TEXT_WEIGHT,
FONT_FAMILY
FONT_FAMILY,
FONT_STYLE,
] as const;

export const TableColumnLinkStyle = [
Expand Down