@firecms/ui 3.0.0-canary.137 → 3.0.0-canary.139
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.
- package/dist/hooks/index.d.ts +0 -1
- package/dist/index.es.js +79 -894
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +81 -895
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -3
- package/src/components/DateTimeField.tsx +133 -908
- package/src/components/TextField.tsx +2 -2
- package/src/hooks/index.ts +0 -1
- package/dist/hooks/useLocaleConfig.d.ts +0 -1
- package/src/hooks/useLocaleConfig.tsx +0 -18
@@ -79,7 +79,7 @@ export function TextField<T extends string | number>({
|
|
79
79
|
useEffect(() => {
|
80
80
|
if (type !== "number") return;
|
81
81
|
const handleWheel = (event: any) => {
|
82
|
-
event.
|
82
|
+
if (event.target instanceof HTMLElement) event.target.blur()
|
83
83
|
};
|
84
84
|
|
85
85
|
// Current input element
|
@@ -109,7 +109,7 @@ export function TextField<T extends string | number>({
|
|
109
109
|
onChange={onChange}
|
110
110
|
style={inputStyle}
|
111
111
|
className={cls(
|
112
|
-
invisible ? focusedInvisibleMixin :
|
112
|
+
invisible ? focusedInvisibleMixin : "",
|
113
113
|
"rounded-md resize-none w-full outline-none p-[32px] text-base bg-transparent min-h-[64px] px-3 pt-8",
|
114
114
|
disabled && "border border-transparent outline-none opacity-50 text-slate-600 dark:text-slate-500"
|
115
115
|
)}
|
package/src/hooks/index.ts
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
export declare function useLocaleConfig(locale?: string): void;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import * as locales from "date-fns/locale";
|
2
|
-
// @ts-ignore
|
3
|
-
import { registerLocale, setDefaultLocale } from "react-datepicker";
|
4
|
-
import { useEffect } from "react";
|
5
|
-
|
6
|
-
export function useLocaleConfig(locale?: string) {
|
7
|
-
useEffect(() => {
|
8
|
-
if (!locale) {
|
9
|
-
return;
|
10
|
-
}
|
11
|
-
// @ts-ignore
|
12
|
-
const dateFnsLocale = locales[locale];
|
13
|
-
if (dateFnsLocale) {
|
14
|
-
registerLocale(locale, dateFnsLocale);
|
15
|
-
setDefaultLocale(locale);
|
16
|
-
}
|
17
|
-
}, [locale])
|
18
|
-
}
|