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

Commitce21056

Browse files
committed
[Fix]: Add Prefix/Suffix icons in Time-Only Column Type Table Component (#1549)
1 parent8a100b5 commitce21056

File tree

1 file changed

+23
-1
lines changed
  • client/packages/lowcoder/src/comps/comps/tableComp/column/columnTypeComps

1 file changed

+23
-1
lines changed

‎client/packages/lowcoder/src/comps/comps/tableComp/column/columnTypeComps/columnTimeComp.tsx‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import dayjs from "dayjs";
1212
import{useEffect,useRef,useState}from"react";
1313
importstyledfrom"styled-components";
1414
import{TIME_FORMAT}from"util/dateTimeUtils";
15+
import{hasIcon}from"comps/utils";
16+
import{IconControl}from"comps/controls/iconControl";
17+
1518

1619
constTimePickerStyled=styled(TimePicker)<{$open:boolean}>`
1720
width: 100%;
@@ -52,6 +55,8 @@ export function formatTime(time: string, format: string) {
5255

5356
constchildrenMap={
5457
text:StringControl,
58+
prefixIcon:IconControl,
59+
suffixIcon:IconControl,
5560
format:withDefault(StringControl,TIME_FORMAT),
5661
inputFormat:withDefault(StringControl,TIME_FORMAT),
5762
};
@@ -118,7 +123,18 @@ export const TimeComp = (function () {
118123
(props,dispatch)=>{
119124
inputFormat=props.inputFormat;
120125
constvalue=props.changeValue??getBaseValue(props,dispatch);
121-
returnformatTime(value,props.format);
126+
return(
127+
<>
128+
{hasIcon(props.prefixIcon)&&(
129+
<span>{props.prefixIcon}</span>
130+
)}
131+
<span>{value}</span>
132+
{hasIcon(props.suffixIcon)&&(
133+
<span>{props.suffixIcon}</span>
134+
)}
135+
</>
136+
);
137+
122138
},
123139
(nodeValue)=>formatTime(nodeValue.text.value,nodeValue.format.value),
124140
getBaseValue
@@ -137,6 +153,12 @@ export const TimeComp = (function () {
137153
label:trans("table.columnValue"),
138154
tooltip:ColumnValueTooltip,
139155
})}
156+
{children.prefixIcon.propertyView({
157+
label:trans("button.prefixIcon"),
158+
})}
159+
{children.suffixIcon.propertyView({
160+
label:trans("button.suffixIcon"),
161+
})}
140162
{formatPropertyView({ children,placeholder:TIME_FORMAT})}
141163
</>
142164
))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp