muffin-admin 7.0.5 → 8.0.0
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/buildRA.js +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/inputs/TimestampInput.d.ts +5 -0
- package/dist/inputs/TimestampInput.js +27 -0
- package/dist/inputs/index.d.ts +1 -0
- package/dist/inputs/index.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/buildRA.tsx +3 -2
- package/src/index.tsx +1 -1
- package/src/inputs/TimestampInput.tsx +20 -0
- package/src/inputs/index.ts +1 -0
package/dist/buildRA.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ArrayField, ArrayInput, AutocompleteArrayInput, AutocompleteInput, BooleanField, BooleanInput, CheckboxGroupInput, ChipField, DateField, DateInput, DateTimeInput, EmailField, FileField, FileInput, ImageField, ImageInput, NullableBooleanInput, NumberField, NumberInput, PasswordInput, RadioButtonGroupInput, ReferenceArrayField, ReferenceArrayInput, ReferenceField, ReferenceInput, ReferenceManyField, required, RichTextField, SelectArrayInput, SelectField, SelectInput, TextField, TextInput, UrlField, } from "react-admin";
|
|
3
3
|
import { AvatarField, EditableBooleanField, FKField, JsonField } from "./fields";
|
|
4
|
-
import { FilterInput, FKInput, JsonInput } from "./inputs";
|
|
4
|
+
import { FilterInput, FKInput, JsonInput, TimestampInput } from "./inputs";
|
|
5
5
|
const UI = {
|
|
6
6
|
// Fields
|
|
7
7
|
BooleanField,
|
|
@@ -42,9 +42,10 @@ const UI = {
|
|
|
42
42
|
RadioButtonGroupInput,
|
|
43
43
|
ReferenceArrayInput,
|
|
44
44
|
ReferenceInput,
|
|
45
|
+
SelectArrayInput,
|
|
45
46
|
SelectInput,
|
|
46
47
|
TextInput,
|
|
47
|
-
|
|
48
|
+
TimestampInput,
|
|
48
49
|
};
|
|
49
50
|
export function buildRAComponent(name, props) {
|
|
50
51
|
const Item = UI[name];
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { format } from "date-fns";
|
|
14
|
+
import { DateTimeInput } from "react-admin";
|
|
15
|
+
export function TimestampInput(_a) {
|
|
16
|
+
var { source, ms } = _a, props = __rest(_a, ["source", "ms"]);
|
|
17
|
+
return (_jsx(DateTimeInput, Object.assign({ source: source }, props, { format: (v) => {
|
|
18
|
+
if (!v)
|
|
19
|
+
return "";
|
|
20
|
+
const value = new Date(ms ? v : v * 1000);
|
|
21
|
+
return format(value, "yyyy-MM-dd'T'HH:mm:ss");
|
|
22
|
+
}, parse: (v) => {
|
|
23
|
+
if (!v)
|
|
24
|
+
return null;
|
|
25
|
+
return new Date(v).valueOf() / (ms ? 1 : 1000);
|
|
26
|
+
} })));
|
|
27
|
+
}
|
package/dist/inputs/index.d.ts
CHANGED
package/dist/inputs/index.js
CHANGED