@@ -20,7 +20,7 @@ import { UICompBuilder, withDefault } from "../../generators";
2020import { CommonNameConfig , depsConfig , withExposingConfigs } from "../../generators/withExposing" ;
2121import { formDataChildren , FormDataPropertyView } from "../formComp/formDataConstants" ;
2222import { styleControl } from "comps/controls/styleControl" ;
23- import { DateTimeStyle , DateTimeStyleType } from "comps/controls/styleControlConstants" ;
23+ import { DateTimeStyle , DateTimeStyleType , LabelStyle } from "comps/controls/styleControlConstants" ;
2424import { withMethodExposing } from "../../generators/withMethodExposing" ;
2525import {
2626 disabledPropertyView ,
@@ -72,6 +72,7 @@ const commonChildren = {
7272 minuteStep : RangeControl . closed ( 1 , 60 , 1 ) ,
7373 secondStep : RangeControl . closed ( 1 , 60 , 1 ) ,
7474 style : styleControl ( DateTimeStyle ) ,
75+ labelStyle : styleControl ( LabelStyle . filter ( ( style ) => [ 'accent' , 'validate' ] . includes ( style . name ) === false ) ) ,
7576 suffixIcon : withDefault ( IconControl , "/icon:regular/calendar" ) ,
7677 ...validationChildren ,
7778 viewRef : RefControl < CommonPickerMethods > ,
@@ -159,12 +160,13 @@ export type DateCompViewProps = Pick<
159160
160161export const datePickerControl = new UICompBuilder ( childrenMap , ( props ) => {
161162 let time = dayjs ( null ) ;
162- if ( props . value . value !== '' ) {
163+ if ( props . value . value !== '' ) {
163164 time = dayjs ( props . value . value , DateParser ) ;
164165 }
165166 return props . label ( {
166167 required : props . required ,
167168 style : props . style ,
169+ labelStyle :props . labelStyle ,
168170 children : (
169171 < DateUIView
170172 viewRef = { props . viewRef }
@@ -212,11 +214,11 @@ export const datePickerControl = new UICompBuilder(childrenMap, (props) => {
212214
213215 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
214216 < > < Section name = { sectionNames . validation } >
215- { requiredPropertyView ( children ) }
216- { dateValidationFields ( children ) }
217- { timeValidationFields ( children ) }
218- { children . customRule . propertyView ( { } ) }
219- </ Section >
217+ { requiredPropertyView ( children ) }
218+ { dateValidationFields ( children ) }
219+ { timeValidationFields ( children ) }
220+ { children . customRule . propertyView ( { } ) }
221+ </ Section >
220222 < Section name = { sectionNames . interaction } >
221223 { children . onEvent . getPropertyView ( ) }
222224 { disabledPropertyView ( children ) }
@@ -234,19 +236,24 @@ export const datePickerControl = new UICompBuilder(childrenMap, (props) => {
234236 { children . placeholder . propertyView ( { label : trans ( "date.placeholderText" ) } ) }
235237 </ Section >
236238 ) }
237-
239+
238240 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
239- < > < Section name = { sectionNames . advanced } >
241+ < > < Section name = { sectionNames . advanced } >
240242 { timeFields ( children , isMobile ) }
241243 { children . suffixIcon . propertyView ( { label : trans ( "button.suffixIcon" ) } ) }
242244 </ Section > </ >
243245 ) }
244246 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && ! isMobile && commonAdvanceSection ( children ) }
245247
246248 { ( useContext ( EditorContext ) . editorModeStatus === "layout" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
247- < Section name = { sectionNames . style } >
248- { children . style . getPropertyView ( ) }
249- </ Section >
249+ < >
250+ < Section name = { sectionNames . style } >
251+ { children . style . getPropertyView ( ) }
252+ </ Section >
253+ < Section name = { sectionNames . labelStyle } >
254+ { children . labelStyle . getPropertyView ( ) }
255+ </ Section >
256+ </ >
250257 ) }
251258 </ >
252259 ) ;
@@ -264,10 +271,10 @@ export const dateRangeControl = (function () {
264271 return new UICompBuilder ( childrenMap , ( props ) => {
265272 let start = dayjs ( null ) ;
266273 let end = dayjs ( null ) ;
267- if ( props . start . value !== '' ) {
274+ if ( props . start . value !== '' ) {
268275 start = dayjs ( props . start . value , DateParser ) ;
269276 }
270- if ( props . end . value !== '' ) {
277+ if ( props . end . value !== '' ) {
271278 end = dayjs ( props . end . value , DateParser ) ;
272279 }
273280
@@ -310,12 +317,13 @@ export const dateRangeControl = (function () {
310317 return props . label ( {
311318 required : props . required ,
312319 style : props . style ,
320+ labelStyle :props . labelStyle ,
313321 children : children ,
314322 ...( startResult . validateStatus !== "success"
315323 ? startResult
316324 : endResult . validateStatus !== "success"
317- ? endResult
318- : startResult ) ,
325+ ? endResult
326+ : startResult ) ,
319327 } ) ;
320328 } )
321329 . setPropertyViewFn ( ( children ) => {
@@ -337,11 +345,11 @@ export const dateRangeControl = (function () {
337345
338346 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
339347 < > < Section name = { sectionNames . validation } >
340- { requiredPropertyView ( children ) }
341- { dateValidationFields ( children ) }
342- { timeValidationFields ( children ) }
343- { children . customRule . propertyView ( { } ) }
344- </ Section >
348+ { requiredPropertyView ( children ) }
349+ { dateValidationFields ( children ) }
350+ { timeValidationFields ( children ) }
351+ { children . customRule . propertyView ( { } ) }
352+ </ Section >
345353 < Section name = { sectionNames . interaction } >
346354 { children . onEvent . getPropertyView ( ) }
347355 { disabledPropertyView ( children ) }
@@ -358,7 +366,7 @@ export const dateRangeControl = (function () {
358366 { children . placeholder . propertyView ( { label : trans ( "date.placeholderText" ) } ) }
359367 </ Section >
360368 ) }
361-
369+
362370 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
363371 < > < Section name = { sectionNames . advanced } >
364372 { timeFields ( children , isMobile ) }
@@ -368,9 +376,14 @@ export const dateRangeControl = (function () {
368376 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && commonAdvanceSection ( children ) }
369377
370378 { ( useContext ( EditorContext ) . editorModeStatus === "layout" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
371- < Section name = { sectionNames . style } >
372- { children . style . getPropertyView ( ) }
373- </ Section >
379+ < >
380+ < Section name = { sectionNames . style } >
381+ { children . style . getPropertyView ( ) }
382+ </ Section >
383+ < Section name = { sectionNames . labelStyle } >
384+ { children . labelStyle . getPropertyView ( ) }
385+ </ Section >
386+ </ >
374387 ) }
375388
376389 </ >
0 commit comments