nitro-web 0.0.189 → 0.0.190
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -20,6 +20,8 @@ type PreFieldDateProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onCh
|
|
|
20
20
|
mode: 'single' | 'multiple' | 'range' | 'time'
|
|
21
21
|
/** show the time picker for single mode*/
|
|
22
22
|
showTime?: boolean
|
|
23
|
+
/** pattern to use for the date picker */
|
|
24
|
+
pattern?: string
|
|
23
25
|
/** prefix to add to the input */
|
|
24
26
|
prefix?: string
|
|
25
27
|
/** number of months to show in the dropdown */
|
|
@@ -61,6 +63,7 @@ export function FieldDate({
|
|
|
61
63
|
Icon,
|
|
62
64
|
numberOfMonths,
|
|
63
65
|
onChange: onChangeProp,
|
|
66
|
+
pattern: patternProp,
|
|
64
67
|
prefix = '',
|
|
65
68
|
showTime,
|
|
66
69
|
DayPickerProps,
|
|
@@ -73,8 +76,10 @@ export function FieldDate({
|
|
|
73
76
|
const [preventInputValueUpdates, setPreventInputValueUpdates] = useState(false)
|
|
74
77
|
const [prefixWidth, setPrefixWidth] = useState(0)
|
|
75
78
|
const dropdownRef = useRef<DropdownRef>(null)
|
|
76
|
-
const pattern = props.mode == 'time' ? 'hh:mmaa' : `d MMM yyyy${showTime && props.mode == 'single' ? ' hh:mmaa' : ''}`
|
|
77
79
|
const id = props.id || props.name
|
|
80
|
+
const pattern = patternProp || (
|
|
81
|
+
props.mode == 'time' ? 'hh:mmaa' : `d MMM yyyy${showTime && props.mode == 'single' ? ' hh:mmaa' : ''}`
|
|
82
|
+
)
|
|
78
83
|
|
|
79
84
|
// Since value and onChange are optional, we need need to create an internal value state
|
|
80
85
|
const [internalValue, setInternalValue] = useState<Timestamp[]>(() => preInternalValue(props))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-web",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.190",
|
|
4
4
|
"repository": "github:boycce/nitro-web",
|
|
5
5
|
"homepage": "https://boycce.github.io/nitro-web/",
|
|
6
6
|
"description": "Nitro is a battle-tested, modular base project to turbocharge your projects, styled using Tailwind 🚀",
|