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

Commit052374a

Browse files
added input format option for time/time range comps
1 parent5ba4f59 commit052374a

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

‎client/packages/lowcoder/src/comps/comps/dateComp/timeComp.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const commonChildren = {
7373
label:LabelControl,
7474
placeholder:withDefault(StringControl,trans("time.placeholder")),
7575
format:StringControl,
76+
inputFormat:withDefault(StringControl,TIME_FORMAT),
7677
disabled:BoolCodeControl,
7778
onEvent:eventHandlerControl(EventOptions),
7879
showTime:BoolControl,
@@ -95,7 +96,7 @@ const commonChildren = {
9596
};
9697

9798
consttimePickerComps=(props:RecordConstructorToView<typeofcommonChildren>)=>
98-
_.pick(props,"format","use12Hours","minuteStep","secondStep","placeholder");
99+
_.pick(props,"format","inputFormat","use12Hours","minuteStep","secondStep","placeholder");
99100

100101
/* const commonBasicSection = (children: RecordConstructorToComp<typeof commonChildren>) => [
101102
formatPropertyView({ children }),
@@ -141,7 +142,7 @@ type secondStepType = TimePickerProps['secondStep'];
141142

142143
exporttypeTimeCompViewProps=Pick<
143144
RecordConstructorToView<typeofchildrenMap>,
144-
"disabled"|"use12Hours"|"format"|"viewRef"
145+
"disabled"|"use12Hours"|"format"|"inputFormat"|"viewRef"
145146
>&Pick<
146147
TimePickerProps,"hourStep"|"minuteStep"|"secondStep"
147148
>&{
@@ -252,7 +253,7 @@ const TimePickerTmpCmp = new UICompBuilder(childrenMap, (props) => {
252253
{(useContext(EditorContext).editorModeStatus==="layout"||useContext(EditorContext).editorModeStatus==="both")&&children.label.getPropertyView()}
253254
{(useContext(EditorContext).editorModeStatus==="layout"||useContext(EditorContext).editorModeStatus==="both")&&(
254255
<Sectionname={sectionNames.layout}>
255-
{children.format.propertyView({label:trans("time.format")})}
256+
{formatPropertyView({children,placeholder:TIME_FORMAT})}
256257
{children.placeholder.propertyView({label:trans("time.placeholderText")})}
257258
</Section>
258259
)}
@@ -428,7 +429,7 @@ const TimeRangeTmpCmp = (function () {
428429
{(useContext(EditorContext).editorModeStatus==="layout"||useContext(EditorContext).editorModeStatus==="both")&&children.label.getPropertyView()}
429430
{(useContext(EditorContext).editorModeStatus==="layout"||useContext(EditorContext).editorModeStatus==="both")&&(
430431
<Sectionname={sectionNames.layout}>
431-
{children.format.propertyView({label:trans("time.format")})}
432+
{formatPropertyView({children,placeholder:TIME_FORMAT})}
432433
{children.placeholder.propertyView({label:trans("time.placeholderText")})}
433434
</Section>
434435
)}

‎client/packages/lowcoder/src/comps/comps/dateComp/timeRangeUIView.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@ export const TimeRangeUIView = (props: TimeRangeUIViewProps) => {
5656
returnuseUIView(
5757
<TimeRangeMobileUIView{...props}/>,
5858
<RangePickerStyled
59-
{...omit(props,"onChange","format")}
59+
{...omit(props,"onChange","format","inputFormat")}
6060
value={[props.start,props.end]}
6161
order={true}
6262
hideDisabledOptions
6363
onCalendarChange={(time:any)=>{
6464
props.onChange(time?.[0],time?.[1]);
6565
}}
66+
format={props.inputFormat}
6667
inputReadOnly={checkIsMobile(editorState?.getAppSettings().maxWidth)}
6768
suffixIcon={hasIcon(props.suffixIcon)&&props.suffixIcon}
6869
placeholder={placeholders}

‎client/packages/lowcoder/src/comps/comps/dateComp/timeUIView.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ export const TimeUIView = (props: TimeUIViewProps) => {
4444
returnuseUIView(
4545
<TimeMobileUIView{...props}/>,
4646
<TimePickerStyled
47-
{...omit(props,"format","$childrenInputFieldStyle")}
47+
{...omit(props,"format","inputFormat","$childrenInputFieldStyle")}
4848
ref={props.viewRef}
4949
hideDisabledOptions
50+
format={props.inputFormat}
5051
inputReadOnly={checkIsMobile(editorState?.getAppSettings().maxWidth)}
5152
placeholder={placeholder}
5253
panelRender={(panelNode)=>(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp