@@ -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,12 @@ 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 ,
167- style : props . style ,
168+ style : props . labelStyle ,
168169 children : (
169170 < DateUIView
170171 viewRef = { props . viewRef }
@@ -212,11 +213,11 @@ export const datePickerControl = new UICompBuilder(childrenMap, (props) => {
212213
213214 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
214215 < > < Section name = { sectionNames . validation } >
215- { requiredPropertyView ( children ) }
216- { dateValidationFields ( children ) }
217- { timeValidationFields ( children ) }
218- { children . customRule . propertyView ( { } ) }
219- </ Section >
216+ { requiredPropertyView ( children ) }
217+ { dateValidationFields ( children ) }
218+ { timeValidationFields ( children ) }
219+ { children . customRule . propertyView ( { } ) }
220+ </ Section >
220221 < Section name = { sectionNames . interaction } >
221222 { children . onEvent . getPropertyView ( ) }
222223 { disabledPropertyView ( children ) }
@@ -234,19 +235,24 @@ export const datePickerControl = new UICompBuilder(childrenMap, (props) => {
234235 { children . placeholder . propertyView ( { label : trans ( "date.placeholderText" ) } ) }
235236 </ Section >
236237 ) }
237-
238+
238239 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
239- < > < Section name = { sectionNames . advanced } >
240+ < > < Section name = { sectionNames . advanced } >
240241 { timeFields ( children , isMobile ) }
241242 { children . suffixIcon . propertyView ( { label : trans ( "button.suffixIcon" ) } ) }
242243 </ Section > </ >
243244 ) }
244245 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && ! isMobile && commonAdvanceSection ( children ) }
245246
246247 { ( useContext ( EditorContext ) . editorModeStatus === "layout" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
247- < Section name = { sectionNames . style } >
248- { children . style . getPropertyView ( ) }
249- </ Section >
248+ < >
249+ < Section name = { sectionNames . style } >
250+ { children . style . getPropertyView ( ) }
251+ </ Section >
252+ < Section name = { sectionNames . labelStyle } >
253+ { children . labelStyle . getPropertyView ( ) }
254+ </ Section >
255+ </ >
250256 ) }
251257 </ >
252258 ) ;
@@ -264,10 +270,10 @@ export const dateRangeControl = (function () {
264270 return new UICompBuilder ( childrenMap , ( props ) => {
265271 let start = dayjs ( null ) ;
266272 let end = dayjs ( null ) ;
267- if ( props . start . value !== '' ) {
273+ if ( props . start . value !== '' ) {
268274 start = dayjs ( props . start . value , DateParser ) ;
269275 }
270- if ( props . end . value !== '' ) {
276+ if ( props . end . value !== '' ) {
271277 end = dayjs ( props . end . value , DateParser ) ;
272278 }
273279
@@ -309,13 +315,13 @@ export const dateRangeControl = (function () {
309315
310316 return props . label ( {
311317 required : props . required ,
312- style : props . style ,
318+ style : props . labelStyle ,
313319 children : children ,
314320 ...( startResult . validateStatus !== "success"
315321 ? startResult
316322 : endResult . validateStatus !== "success"
317- ? endResult
318- : startResult ) ,
323+ ? endResult
324+ : startResult ) ,
319325 } ) ;
320326 } )
321327 . setPropertyViewFn ( ( children ) => {
@@ -337,11 +343,11 @@ export const dateRangeControl = (function () {
337343
338344 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
339345 < > < Section name = { sectionNames . validation } >
340- { requiredPropertyView ( children ) }
341- { dateValidationFields ( children ) }
342- { timeValidationFields ( children ) }
343- { children . customRule . propertyView ( { } ) }
344- </ Section >
346+ { requiredPropertyView ( children ) }
347+ { dateValidationFields ( children ) }
348+ { timeValidationFields ( children ) }
349+ { children . customRule . propertyView ( { } ) }
350+ </ Section >
345351 < Section name = { sectionNames . interaction } >
346352 { children . onEvent . getPropertyView ( ) }
347353 { disabledPropertyView ( children ) }
@@ -358,7 +364,7 @@ export const dateRangeControl = (function () {
358364 { children . placeholder . propertyView ( { label : trans ( "date.placeholderText" ) } ) }
359365 </ Section >
360366 ) }
361-
367+
362368 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
363369 < > < Section name = { sectionNames . advanced } >
364370 { timeFields ( children , isMobile ) }
@@ -368,9 +374,14 @@ export const dateRangeControl = (function () {
368374 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && commonAdvanceSection ( children ) }
369375
370376 { ( useContext ( EditorContext ) . editorModeStatus === "layout" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
371- < Section name = { sectionNames . style } >
372- { children . style . getPropertyView ( ) }
373- </ Section >
377+ < >
378+ < Section name = { sectionNames . style } >
379+ { children . style . getPropertyView ( ) }
380+ </ Section >
381+ < Section name = { sectionNames . labelStyle } >
382+ { children . labelStyle . getPropertyView ( ) }
383+ </ Section >
384+ </ >
374385 ) }
375386
376387 </ >
0 commit comments