xladmin 0.1.8 → 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.
- package/README.md +63 -45
- package/dist/cache.d.ts +22 -0
- package/dist/client.d.ts +9 -6
- package/dist/components/FieldEditor.d.ts +2 -2
- package/dist/components/ModelPage.d.ts +3 -1
- package/dist/components/NavLink.d.ts +3 -1
- package/dist/components/ObjectPage.d.ts +3 -1
- package/dist/components/Shell.d.ts +3 -1
- package/dist/components/layout/AdminDataContext.d.ts +1 -1
- package/dist/components/layout/Sidebar.d.ts +1 -1
- package/dist/components/model-page/ListFiltersBar.d.ts +2 -2
- package/dist/components/model-page/ListRow.d.ts +1 -1
- package/dist/components/model-page/useModelPageController.d.ts +73 -0
- package/dist/components/models-blocks/types.d.ts +1 -1
- package/dist/components/object-page/ObjectField.d.ts +2 -2
- package/dist/components/object-page/ReadonlyObjectField.d.ts +1 -1
- package/dist/components/object-page/useObjectPageController.d.ts +46 -0
- package/dist/hooks/useRemoteChoices.d.ts +15 -0
- package/dist/i18n.d.ts +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1472 -943
- package/dist/router.d.ts +35 -0
- package/dist/utils/adminFields.d.ts +1 -1
- package/dist/utils/isDeepEqual.d.ts +1 -0
- package/package.json +9 -25
package/dist/router.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CSSProperties, MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
|
2
|
+
export type XLAdminLocation = {
|
|
3
|
+
pathname: string;
|
|
4
|
+
search: string;
|
|
5
|
+
};
|
|
6
|
+
export type XLAdminRouter = {
|
|
7
|
+
getLocation: () => XLAdminLocation;
|
|
8
|
+
subscribe: (listener: () => void) => () => void;
|
|
9
|
+
push: (href: string) => void;
|
|
10
|
+
replace: (href: string) => void;
|
|
11
|
+
back: () => void;
|
|
12
|
+
};
|
|
13
|
+
type XLAdminRouterProviderProps = {
|
|
14
|
+
router: XLAdminRouter;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
type NavigateLinkOptions = {
|
|
18
|
+
href: string;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
router: XLAdminRouter;
|
|
21
|
+
};
|
|
22
|
+
export declare function XLAdminRouterProvider({ router, children }: XLAdminRouterProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function createBrowserXLAdminRouter(browserWindow?: Window): XLAdminRouter;
|
|
24
|
+
export declare function useXLAdminRouter(router?: XLAdminRouter): XLAdminRouter;
|
|
25
|
+
export declare function useXLAdminLocation(router?: XLAdminRouter): XLAdminLocation;
|
|
26
|
+
export declare function buildUrlWithParams(pathname: string, query: string, sort: string, page: number, filters: Record<string, string>): string;
|
|
27
|
+
export declare function handleNavLinkClick(event: ReactMouseEvent<HTMLAnchorElement>, { href, onClick, router }: NavigateLinkOptions): void;
|
|
28
|
+
export type XLAdminAnchorProps = {
|
|
29
|
+
href: string;
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
title?: string;
|
|
33
|
+
onClick?: () => void;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AdminFieldMeta, AdminLocale } from '
|
|
1
|
+
import type { AdminFieldMeta, AdminLocale } from '@xladmin-core/types';
|
|
2
2
|
/**
|
|
3
3
|
* Готовит payload для create/patch так, чтобы nullable-поля можно было очищать,
|
|
4
4
|
* а служебные пустые поля вроде пароля не улетали в API без необходимости.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isDeepEqual(left: unknown, right: unknown): boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xladmin",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.8",
|
|
4
|
+
"description": "Framework-agnostic React + MUI admin frontend for xladmin.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git+https://github.com/Artasov/xladmin.git",
|
|
13
|
-
"directory": "xladmin-frontend"
|
|
13
|
+
"directory": "xladmin-frontend/packages/xladmin-core"
|
|
14
14
|
},
|
|
15
|
-
"homepage": "https://github.com/Artasov/xladmin/tree/main/xladmin-frontend",
|
|
15
|
+
"homepage": "https://github.com/Artasov/xladmin/tree/main/xladmin-frontend/packages/xladmin-core",
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/Artasov/xladmin/issues"
|
|
18
18
|
},
|
|
@@ -24,14 +24,16 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
|
-
"dist"
|
|
27
|
+
"dist",
|
|
28
|
+
"README.md"
|
|
28
29
|
],
|
|
29
30
|
"publishConfig": {
|
|
30
31
|
"access": "public"
|
|
31
32
|
},
|
|
32
33
|
"scripts": {
|
|
33
|
-
"build": "tsup src/index.ts --format esm && tsc --emitDeclarationOnly --declaration --outDir .tmp-types -p tsconfig.json && node
|
|
34
|
-
"check": "tsc --noEmit -p tsconfig.json"
|
|
34
|
+
"build": "node ../../scripts/clean.mjs && tsup src/index.ts --format esm && tsc --emitDeclarationOnly --declaration --outDir .tmp-types -p tsconfig.build.json && node ../../scripts/postbuild.mjs",
|
|
35
|
+
"check": "tsc --noEmit -p tsconfig.json",
|
|
36
|
+
"test": "vitest run --environment jsdom --pool threads"
|
|
35
37
|
},
|
|
36
38
|
"peerDependencies": {
|
|
37
39
|
"@emotion/react": ">=11.14.0 <12.0.0",
|
|
@@ -41,7 +43,6 @@
|
|
|
41
43
|
"@mui/x-date-pickers": ">=8.0.0 <9.0.0",
|
|
42
44
|
"axios": ">=1.0.0 <2.0.0",
|
|
43
45
|
"dayjs": ">=1.11.0 <2.0.0",
|
|
44
|
-
"next": ">=15.0.0 <17.0.0",
|
|
45
46
|
"react": ">=19.0.0 <20.0.0",
|
|
46
47
|
"react-dom": ">=19.0.0 <20.0.0"
|
|
47
48
|
},
|
|
@@ -49,22 +50,5 @@
|
|
|
49
50
|
"axios": {
|
|
50
51
|
"optional": true
|
|
51
52
|
}
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"@emotion/react": "^11.14.0",
|
|
55
|
-
"@emotion/styled": "^11.14.0",
|
|
56
|
-
"@mui/icons-material": "^7.0.0",
|
|
57
|
-
"@mui/material": "^7.0.0",
|
|
58
|
-
"@mui/x-date-pickers": "^8.27.0",
|
|
59
|
-
"@types/node": "^24.5.2",
|
|
60
|
-
"@types/react": "^19.1.13",
|
|
61
|
-
"@types/react-dom": "^19.1.9",
|
|
62
|
-
"axios": "^1.12.2",
|
|
63
|
-
"dayjs": "^1.11.19",
|
|
64
|
-
"next": "^15.5.4",
|
|
65
|
-
"react": "^19.1.1",
|
|
66
|
-
"react-dom": "^19.1.1",
|
|
67
|
-
"tsup": "^8.5.0",
|
|
68
|
-
"typescript": "^5.9.2"
|
|
69
53
|
}
|
|
70
54
|
}
|