File tree Expand file tree Collapse file tree 4 files changed +13
-1
lines changed
Expand file tree Collapse file tree 4 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## Next
4+ - Add ` disabled ` property
5+
36## 2.1.1 - 2022 Aug 15
47- Fix broken month dropdown on Firefox
58- Fix unreliable clamping to min/max dates
Original file line number Diff line number Diff line change 4444 export let placeholder = ' 2020-12-31 23:00:00'
4545 /** Whether the text is valid */
4646 export let valid = true
47+ /** Disable the input **/
48+ export let disabled = false
4749
4850 /** Format string */
4951 export let format = ' yyyy-MM-dd HH:mm:ss'
145147 type =" text"
146148 bind:value ={text }
147149 {placeholder }
150+ {disabled }
148151 on:focus ={() => (visible = true )}
149152 on:mousedown ={() => (visible = true )}
150153 on:input ={input }
151154 />
152- {#if visible }
155+ {#if visible && ! disabled }
153156 <div class ="picker" class:visible transition:fly ={{ duration : 80 , easing : cubicInOut , y : - 5 }}>
154157 <DateTimePicker
155158 on:focusout ={onFocusOut }
182185 & :focus
183186 border-color : var(-- date- picker- highlight- border, #0269f7 )
184187 box-shadow : 0px 0px 0px 2px var(-- date- picker- highlight- shadow, rgba(#0269f7 , 0.4 ))
188+ & :disabled
189+ opacity : 0.5
185190 .invalid
186191 border : 1px solid rgba(#f92f72 , 0.5 )
187192 background-color : rgba(#f92f72 , 0.1 )
Original file line number Diff line number Diff line change 99 let max: Date
1010 let valid: boolean
1111 let visible: boolean
12+ let disabled: boolean
1213 let closeOnSelection: boolean
1314 let browseWithoutSelecting: boolean
1415 let format: string
2425 bind:valid
2526 bind:format
2627 bind:visible
28+ bind:disabled
2729 bind:closeOnSelection
2830 bind:browseWithoutSelecting
2931 />
3739 <Prop label ="valid" bind:value ={valid } />
3840 <Prop label ="format" bind:value ={format } />
3941 <Prop label ="visible" bind:value ={visible } />
42+ <Prop label ="disabled" bind:value ={disabled } />
4043 <Prop label ="closeOnSelection" bind:value ={closeOnSelection } />
4144 <Prop label ="browseWithoutSelecting" bind:value ={browseWithoutSelecting } />
4245 <Prop label =" locale" >Default</Prop >
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ The component will not assign a date value until a specific date is selected in
3838| ` valid ` | bool | Whether the text is valid |
3939| ` format ` | string | Format string |
4040| ` visible ` | bool | Whether the date popup is visible |
41+ | ` disabled ` | bool | Disable the input |
4142| ` closeOnSelection ` | bool | Close the date popup when a date is selected |
4243| ` browseWithoutSelecting ` | bool | Wait with updating the date until a date is selected |
4344| ` locale ` | Locale | Locale object for internationalization |
You can’t perform that action at this time.
0 commit comments