xladmin 0.2.7 → 0.2.8

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.
@@ -1,5 +1,5 @@
1
- import type { XLAdminClient } from '../client';
2
- import type { AdminFieldMeta } from '../types';
1
+ import type { XLAdminClient } from '@xladmin-core/client';
2
+ import type { AdminFieldMeta } from '@xladmin-core/types';
3
3
  type AdminFieldEditorProps = {
4
4
  field: AdminFieldMeta;
5
5
  value: unknown;
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- import type { AdminLocale, AdminModelMeta, AdminModelsBlockMeta } from '../../types';
2
+ import type { AdminLocale, AdminModelMeta, AdminModelsBlockMeta } from '@xladmin-core/types';
3
3
  type AdminDataContextValue = {
4
4
  locale: AdminLocale;
5
5
  models: AdminModelMeta[];
@@ -1,4 +1,4 @@
1
- import type { AdminModelMeta, AdminModelsBlockMeta } from '../../types';
1
+ import type { AdminModelMeta, AdminModelsBlockMeta } from '@xladmin-core/types';
2
2
  type SidebarProps = {
3
3
  models: AdminModelMeta[];
4
4
  blocks: AdminModelsBlockMeta[];
@@ -1,5 +1,5 @@
1
- import type { XLAdminClient } from '../../client';
2
- import type { AdminListFilterMeta } from '../../types';
1
+ import type { XLAdminClient } from '@xladmin-core/client';
2
+ import type { AdminListFilterMeta } from '@xladmin-core/types';
3
3
  type ListFiltersSidebarProps = {
4
4
  client: XLAdminClient;
5
5
  slug: string;
@@ -1,5 +1,5 @@
1
1
  import type { MouseEvent } from 'react';
2
- import type { AdminFieldMeta, AdminLocale } from '../../types';
2
+ import type { AdminFieldMeta, AdminLocale } from '@xladmin-core/types';
3
3
  export type ListRowProps = {
4
4
  row: Record<string, unknown>;
5
5
  pkField: string;
@@ -1,7 +1,7 @@
1
- import type { XLAdminClient } from '../../client';
2
- import type { AdminTranslationKey } from '../../i18n';
3
- import type { XLAdminRouter } from '../../router';
4
- import type { AdminDeletePreviewResponse, AdminListResponse } from '../../types';
1
+ import type { XLAdminClient } from '@xladmin-core/client';
2
+ import type { AdminTranslationKey } from '@xladmin-core/i18n';
3
+ import type { XLAdminRouter } from '@xladmin-core/router';
4
+ import type { AdminDeletePreviewResponse, AdminListResponse } from '@xladmin-core/types';
5
5
  type UseModelPageControllerOptions = {
6
6
  client: XLAdminClient;
7
7
  slug: string;
@@ -15,7 +15,7 @@ export declare function useModelPageController({ client, slug, pathname, locatio
15
15
  appliedFilters: Record<string, string>;
16
16
  appliedQuery: string;
17
17
  bulkActionMenuAnchor: HTMLElement | null;
18
- bulkActions: import("../..").AdminBulkActionMeta[];
18
+ bulkActions: import("@xladmin-core/types").AdminBulkActionMeta[];
19
19
  createOpen: boolean;
20
20
  currentPage: number;
21
21
  data: AdminListResponse | null;
@@ -23,7 +23,7 @@ export declare function useModelPageController({ client, slug, pathname, locatio
23
23
  deletePreviewError: string | null;
24
24
  deletePreviewOpen: boolean;
25
25
  error: string | null;
26
- fieldMap: Map<string, import("../..").AdminFieldMeta>;
26
+ fieldMap: Map<string, import("@xladmin-core/types").AdminFieldMeta>;
27
27
  filtersOpen: boolean;
28
28
  handleConfirmDelete: () => Promise<void>;
29
29
  handleFilterChange: (filterSlug: string, value: string) => void;
@@ -44,8 +44,8 @@ export declare function useModelPageController({ client, slug, pathname, locatio
44
44
  isDeleteSubmitting: boolean;
45
45
  isLoading: boolean;
46
46
  listFields: string[];
47
- listFilters: import("../..").AdminListFilterMeta[];
48
- meta: import("../..").AdminModelMeta | null;
47
+ listFilters: import("@xladmin-core/types").AdminListFilterMeta[];
48
+ meta: import("@xladmin-core/types").AdminModelMeta | null;
49
49
  pageInput: string;
50
50
  pendingDeleteIds: (string | number)[];
51
51
  pendingDeleteMode: "single" | "bulk";
@@ -1,4 +1,4 @@
1
- import type { AdminModelMeta } from '../../types';
1
+ import type { AdminModelMeta } from '@xladmin-core/types';
2
2
  export type NormalizedBlock = {
3
3
  slug: string;
4
4
  title: string;
@@ -1,5 +1,5 @@
1
- import type { XLAdminClient } from '../../client';
2
- import type { AdminFieldMeta } from '../../types';
1
+ import type { XLAdminClient } from '@xladmin-core/client';
2
+ import type { AdminFieldMeta } from '@xladmin-core/types';
3
3
  type ObjectFieldProps = {
4
4
  field: AdminFieldMeta;
5
5
  value: unknown;
@@ -1,4 +1,4 @@
1
- import type { AdminFieldMeta } from '../../types';
1
+ import type { AdminFieldMeta } from '@xladmin-core/types';
2
2
  type ReadonlyObjectFieldProps = {
3
3
  field: AdminFieldMeta;
4
4
  value: string;
@@ -1,7 +1,7 @@
1
- import type { XLAdminClient } from '../../client';
2
- import type { AdminTranslationKey } from '../../i18n';
3
- import type { XLAdminRouter } from '../../router';
4
- import type { AdminDeletePreviewResponse, AdminDetailResponse } from '../../types';
1
+ import type { XLAdminClient } from '@xladmin-core/client';
2
+ import type { AdminTranslationKey } from '@xladmin-core/i18n';
3
+ import type { XLAdminRouter } from '@xladmin-core/router';
4
+ import type { AdminDeletePreviewResponse, AdminDetailResponse } from '@xladmin-core/types';
5
5
  type UseObjectPageControllerOptions = {
6
6
  client: XLAdminClient;
7
7
  slug: string;
@@ -20,7 +20,7 @@ export declare function useObjectPageController({ client, slug, id, listPath, ro
20
20
  detailFields: string[];
21
21
  editableFieldNames: Set<string>;
22
22
  error: string | null;
23
- fieldMap: Map<string, import("../..").AdminFieldMeta>;
23
+ fieldMap: Map<string, import("@xladmin-core/types").AdminFieldMeta>;
24
24
  handleDelete: () => Promise<void>;
25
25
  handleFieldChange: (fieldName: string, nextValue: unknown) => void;
26
26
  handleNavigateBack: () => void;
@@ -34,8 +34,8 @@ export declare function useObjectPageController({ client, slug, id, listPath, ro
34
34
  isDirty: boolean;
35
35
  isLoading: boolean;
36
36
  isSaving: boolean;
37
- meta: import("../..").AdminModelMeta | null;
38
- objectActions: import("../..").AdminObjectActionMeta[];
37
+ meta: import("@xladmin-core/types").AdminModelMeta | null;
38
+ objectActions: import("@xladmin-core/types").AdminObjectActionMeta[];
39
39
  objectTitle: string;
40
40
  setActionsAnchorEl: import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>;
41
41
  setDeleteConfirmOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
package/dist/index.js CHANGED
@@ -762,7 +762,7 @@ var FieldEditor = memo(function FieldEditor2({
762
762
  label: field.label,
763
763
  disabled: readOnly,
764
764
  value: value ? dayjs(String(value)) : null,
765
- onChange: (nextValue) => onChange(nextValue ? nextValue.format("YYYY-MM-DDTHH:mm:ss") : null),
765
+ onChange: (nextValue) => onChange(nextValue ? nextValue.format("YYYY-MM-DD[T]HH:mm:ss") : null),
766
766
  slotProps: {
767
767
  popper: { disablePortal: true },
768
768
  desktopPaper: buildPickerPaperProps(),
@@ -898,17 +898,19 @@ function renderChoiceEditor({
898
898
  label: field.label,
899
899
  placeholder: searchPlaceholder,
900
900
  helperText: (_a2 = field.help_text) != null ? _a2 : void 0,
901
- InputProps: {
902
- ...InputProps,
903
- endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
904
- isLoadingChoices ? /* @__PURE__ */ jsx3(CircularProgress, { color: "inherit", size: 16 }) : null,
905
- InputProps.endAdornment
906
- ] })
907
- },
908
- inputProps: {
909
- ...inputProps,
910
- autoComplete: "new-password",
911
- name: `admin-choice-${field.name}`
901
+ slotProps: {
902
+ input: {
903
+ ...InputProps,
904
+ endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
905
+ isLoadingChoices ? /* @__PURE__ */ jsx3(CircularProgress, { color: "inherit", size: 16 }) : null,
906
+ InputProps.endAdornment
907
+ ] })
908
+ },
909
+ htmlInput: {
910
+ ...inputProps,
911
+ autoComplete: "new-password",
912
+ name: `admin-choice-${field.name}`
913
+ }
912
914
  }
913
915
  }
914
916
  );
@@ -954,17 +956,19 @@ function renderChoiceEditor({
954
956
  label: field.label,
955
957
  placeholder: searchPlaceholder,
956
958
  helperText: (_a2 = field.help_text) != null ? _a2 : void 0,
957
- InputProps: {
958
- ...InputProps,
959
- endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
960
- isLoadingChoices ? /* @__PURE__ */ jsx3(CircularProgress, { color: "inherit", size: 16 }) : null,
961
- InputProps.endAdornment
962
- ] })
963
- },
964
- inputProps: {
965
- ...inputProps,
966
- autoComplete: "new-password",
967
- name: `admin-choice-${field.name}`
959
+ slotProps: {
960
+ input: {
961
+ ...InputProps,
962
+ endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
963
+ isLoadingChoices ? /* @__PURE__ */ jsx3(CircularProgress, { color: "inherit", size: 16 }) : null,
964
+ InputProps.endAdornment
965
+ ] })
966
+ },
967
+ htmlInput: {
968
+ ...inputProps,
969
+ autoComplete: "new-password",
970
+ name: `admin-choice-${field.name}`
971
+ }
968
972
  }
969
973
  }
970
974
  );
@@ -2238,14 +2242,16 @@ function ListFilterField({ client, slug, filter, value, onChange, debounceMs })
2238
2242
  ...textFieldParams,
2239
2243
  label: filter.label,
2240
2244
  placeholder: (_a2 = filter.placeholder) != null ? _a2 : t("search"),
2241
- InputProps: {
2242
- ...InputProps,
2243
- endAdornment: /* @__PURE__ */ jsxs9(Fragment2, { children: [
2244
- isLoadingChoices ? /* @__PURE__ */ jsx15(CircularProgress3, { color: "inherit", size: 16 }) : null,
2245
- InputProps.endAdornment
2246
- ] })
2247
- },
2248
- inputProps
2245
+ slotProps: {
2246
+ input: {
2247
+ ...InputProps,
2248
+ endAdornment: /* @__PURE__ */ jsxs9(Fragment2, { children: [
2249
+ isLoadingChoices ? /* @__PURE__ */ jsx15(CircularProgress3, { color: "inherit", size: 16 }) : null,
2250
+ InputProps.endAdornment
2251
+ ] })
2252
+ },
2253
+ htmlInput: inputProps
2254
+ }
2249
2255
  }
2250
2256
  );
2251
2257
  })()
@@ -1,4 +1,4 @@
1
- import type { AdminFieldMeta, AdminLocale } from '../types';
1
+ import type { AdminFieldMeta, AdminLocale } from '@xladmin-core/types';
2
2
  /**
3
3
  * Готовит payload для create/patch так, чтобы nullable-поля можно было очищать,
4
4
  * а служебные пустые поля вроде пароля не улетали в API без необходимости.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xladmin",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Framework-agnostic React + MUI admin frontend for xladmin.",
5
5
  "license": "MIT",
6
6
  "type": "module",