muffin-admin 7.0.5 → 8.1.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 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
- SelectArrayInput,
48
+ TimestampInput,
48
49
  };
49
50
  export function buildRAComponent(name, props) {
50
51
  const Item = UI[name];
package/dist/index.d.ts CHANGED
@@ -17,4 +17,4 @@ export * from "./fields";
17
17
  export * from "./hooks";
18
18
  export * from "./types";
19
19
  export declare function initAdmin(prefix?: string, containerId?: string): Promise<void>;
20
- export declare const VERSION = "7.0.5";
20
+ export declare const VERSION = "8.1.0";
package/dist/index.js CHANGED
@@ -40,4 +40,4 @@ export function initAdmin() {
40
40
  root.render(_jsx(MuffinAdminContext.Provider, { value: adminOpts, children: _jsx(MuffinAdmin, {}) }));
41
41
  });
42
42
  }
43
- export const VERSION = "7.0.5";
43
+ export const VERSION = "8.1.0";
@@ -0,0 +1,5 @@
1
+ export declare function TimestampInput({ source, ms, ...props }: {
2
+ [x: string]: any;
3
+ source: any;
4
+ ms: any;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -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
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./FilterInput";
2
2
  export * from "./FKInput";
3
3
  export * from "./JsonInput";
4
+ export * from "./TimestampInput";
@@ -1,3 +1,4 @@
1
1
  export * from "./FilterInput";
2
2
  export * from "./FKInput";
3
3
  export * from "./JsonInput";
4
+ export * from "./TimestampInput";