nitro-web 0.0.18 → 0.0.19
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.
|
@@ -17,7 +17,7 @@ export type CalendarProps = {
|
|
|
17
17
|
numberOfMonths?: number
|
|
18
18
|
month?: number // the value may be updated from an outside source, thus the month may have changed
|
|
19
19
|
className?: string
|
|
20
|
-
preserveTime?: boolean
|
|
20
|
+
preserveTime?: boolean // just for single mode
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export function Calendar({ mode='single', onChange, value, numberOfMonths, month: monthProp, className, preserveTime }: CalendarProps) {
|
|
@@ -19,8 +19,13 @@ export type FieldDateProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
|
19
19
|
Icon?: React.ReactNode
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
type TimePickerProps = {
|
|
23
|
+
date: Date|null
|
|
24
|
+
onChange: (mode: Mode, value: number|null) => void
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
export function FieldDate({ mode='single', onChange, prefix='', value, numberOfMonths, Icon, showTime, ...props }: FieldDateProps) {
|
|
23
|
-
const localePattern = `d MMM yyyy${showTime && mode == 'single' ? '
|
|
28
|
+
const localePattern = `d MMM yyyy${showTime && mode == 'single' ? ' hh:mmaa' : ''}`
|
|
24
29
|
const [prefixWidth, setPrefixWidth] = useState(0)
|
|
25
30
|
const dropdownRef = useRef<DropdownRef>(null)
|
|
26
31
|
const id = props.id || props.name
|
|
@@ -120,11 +125,6 @@ export function FieldDate({ mode='single', onChange, prefix='', value, numberOfM
|
|
|
120
125
|
)
|
|
121
126
|
}
|
|
122
127
|
|
|
123
|
-
type TimePickerProps = {
|
|
124
|
-
date: Date|null
|
|
125
|
-
onChange: (mode: Mode, value: number|null) => void
|
|
126
|
-
}
|
|
127
|
-
|
|
128
128
|
function TimePicker({ date, onChange }: TimePickerProps) {
|
|
129
129
|
const lists = [
|
|
130
130
|
[12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], // hours
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Nitro is a battle-tested, modular base project to turbocharge your projects, styled using Tailwind 🚀",
|
|
4
4
|
"repository": "github:boycce/nitro-web",
|
|
5
5
|
"homepage": "https://boycce.github.io/nitro-web/",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.19",
|
|
7
7
|
"main": "./client/index.ts",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"keywords": [
|
package/readme.md
CHANGED
|
@@ -11,7 +11,7 @@ npm i nitro-web
|
|
|
11
11
|
### Install
|
|
12
12
|
|
|
13
13
|
1. Copy ./_example into your project
|
|
14
|
-
2. In package.json, replace `"nitro-web": "file:.."` with `"nitro-web": "~0.0.
|
|
14
|
+
2. In package.json, replace `"nitro-web": "file:.."` with `"nitro-web": "~0.0.19"`
|
|
15
15
|
3. In package.json, replace `"../.eslintrc.json"` with `"./node_modules/nitro-web/.eslintrc.json"`
|
|
16
16
|
4. Run `npm i`
|
|
17
17
|
|