adminforth 1.1.1 → 1.1.3
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/index.js +23 -7
- package/dist/modules/codeInjector.js +9 -9
- package/dist/plugins/ForeignInlineListPlugin/index.js +2 -1
- package/dist/spa/spa/src/App.vue +1 -1
- package/dist/spa/spa/src/components/ResourceListTable.vue +363 -0
- package/dist/spa/spa/src/stores/core.ts +7 -9
- package/dist/spa/spa/src/utils.ts +2 -2
- package/dist/spa/spa/src/views/CreateView.vue +3 -0
- package/dist/spa/spa/src/views/EditView.vue +3 -0
- package/dist/spa/spa/src/views/ListView.vue +24 -317
- package/dist/spa/spa/src/views/ShowView.vue +8 -11
- package/index.ts +29 -11
- package/modules/codeInjector.ts +12 -12
- package/modules/styles.ts +52 -0
- package/package.json +1 -1
- package/plugins/ForeignInlineListPlugin/custom/InlineList.vue +110 -2
- package/plugins/ForeignInlineListPlugin/index.ts +2 -2
- package/spa/src/App.vue +1 -1
- package/spa/src/components/ResourceListTable.vue +363 -0
- package/spa/src/stores/core.ts +7 -9
- package/spa/src/utils.ts +2 -2
- package/spa/src/views/CreateView.vue +3 -0
- package/spa/src/views/EditView.vue +3 -0
- package/spa/src/views/ListView.vue +24 -317
- package/spa/src/views/ShowView.vue +8 -11
- package/types/AdminForthConfig.ts +79 -23
- package/documentation/README.md +0 -41
- package/documentation/babel.config.js +0 -3
- package/documentation/blog/2019-05-28-first-blog-post.md +0 -12
- package/documentation/blog/2019-05-29-long-blog-post.md +0 -44
- package/documentation/blog/2021-08-01-mdx-blog-post.mdx +0 -20
- package/documentation/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg +0 -0
- package/documentation/blog/2021-08-26-welcome/index.md +0 -25
- package/documentation/blog/authors.yml +0 -17
- package/documentation/blog/tags.yml +0 -16
- package/documentation/docs/Getting Started.md +0 -374
- package/documentation/docs/Glossary.md +0 -37
- package/documentation/docs/image.png +0 -0
- package/documentation/docusaurus.config.ts +0 -171
- package/documentation/package-lock.json +0 -14655
- package/documentation/package.json +0 -51
- package/documentation/sidebars.ts +0 -51
- package/documentation/src/components/HomepageFeatures/index.tsx +0 -68
- package/documentation/src/components/HomepageFeatures/styles.module.css +0 -11
- package/documentation/src/css/custom.css +0 -30
- package/documentation/src/pages/index.module.css +0 -24
- package/documentation/src/pages/index.tsx +0 -43
- package/documentation/src/pages/markdown-page.md +0 -7
- package/documentation/static/.nojekyll +0 -0
- package/documentation/static/CNAME +0 -1
- package/documentation/static/img/css.png +0 -0
- package/documentation/static/img/db.png +0 -0
- package/documentation/static/img/db2.png +0 -0
- package/documentation/static/img/favicon.png +0 -0
- package/documentation/static/img/gen.sh +0 -24
- package/documentation/static/img/logo.svg +0 -19
- package/documentation/static/img/tail.png +0 -0
- package/documentation/static/img/vue.png +0 -0
- package/documentation/typedoc-plugin.mjs +0 -11
- /package/{styles.js → dist/modules/styles.js} +0 -0
|
@@ -482,45 +482,45 @@ export type AdminForthResource = {
|
|
|
482
482
|
/**
|
|
483
483
|
* Custom components which can be injected into resource list page.
|
|
484
484
|
*
|
|
485
|
-
* Component accepts next props: [resource, adminUser]
|
|
485
|
+
* Component accepts next props: [resource, adminUser, meta]
|
|
486
486
|
*/
|
|
487
487
|
list?: {
|
|
488
|
-
beforeBreadcrumbs?:
|
|
489
|
-
afterBreadcrumbs?:
|
|
490
|
-
bottom?:
|
|
488
|
+
beforeBreadcrumbs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
489
|
+
afterBreadcrumbs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
490
|
+
bottom?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
491
491
|
},
|
|
492
492
|
|
|
493
493
|
/**
|
|
494
494
|
* Custom components which can be injected into resource show page.
|
|
495
495
|
*
|
|
496
|
-
* Component accepts next props: [record, resource, adminUser]
|
|
496
|
+
* Component accepts next props: [record, resource, adminUser, meta]
|
|
497
497
|
*/
|
|
498
498
|
show?: {
|
|
499
|
-
beforeBreadcrumbs?:
|
|
500
|
-
afterBreadcrumbs?:
|
|
501
|
-
bottom?:
|
|
499
|
+
beforeBreadcrumbs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
500
|
+
afterBreadcrumbs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
501
|
+
bottom?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
502
502
|
},
|
|
503
503
|
|
|
504
504
|
/**
|
|
505
505
|
* Custom components which can be injected into resource edit page.
|
|
506
506
|
*
|
|
507
|
-
* Component accepts next props: [record, resource, adminUser]
|
|
507
|
+
* Component accepts next props: [record, resource, adminUser, meta]
|
|
508
508
|
*/
|
|
509
509
|
edit?: {
|
|
510
|
-
beforeBreadcrumbs?:
|
|
511
|
-
afterBreadcrumbs?:
|
|
512
|
-
bottom?:
|
|
510
|
+
beforeBreadcrumbs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
511
|
+
afterBreadcrumbs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
512
|
+
bottom?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
513
513
|
},
|
|
514
514
|
|
|
515
515
|
/**
|
|
516
516
|
* Custom components which can be injected into resource create page.
|
|
517
517
|
*
|
|
518
|
-
* Component accepts next props: [resource, adminUser]
|
|
518
|
+
* Component accepts next props: [resource, adminUser, meta]
|
|
519
519
|
*/
|
|
520
520
|
create?: {
|
|
521
|
-
beforeBreadcrumbs?:
|
|
522
|
-
afterBreadcrumbs?:
|
|
523
|
-
bottom?:
|
|
521
|
+
beforeBreadcrumbs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
522
|
+
afterBreadcrumbs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
523
|
+
bottom?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
524
524
|
},
|
|
525
525
|
}
|
|
526
526
|
},
|
|
@@ -771,11 +771,68 @@ export type ValidationObject = {
|
|
|
771
771
|
message: string,
|
|
772
772
|
}
|
|
773
773
|
|
|
774
|
+
export type AdminForthComponentDeclaration = {
|
|
775
|
+
/**
|
|
776
|
+
* Path to custom component which will be used to render field in the admin panel.
|
|
777
|
+
* e.g. `@@/MyCustomComponent.vue`
|
|
778
|
+
*/
|
|
779
|
+
file : string,
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Optional Meta object which will be passed to custom component as props. For example used by plugins
|
|
783
|
+
* to pass plugin options to custom components.
|
|
784
|
+
*
|
|
785
|
+
* Example:
|
|
786
|
+
*
|
|
787
|
+
* ```ts
|
|
788
|
+
* {
|
|
789
|
+
* name: 'Country Flag',
|
|
790
|
+
* virtual: true,
|
|
791
|
+
* showIn: [AdminForthResourcePages.SHOW],
|
|
792
|
+
* components: {
|
|
793
|
+
* show: {
|
|
794
|
+
* file: '@@/Flag.vue',
|
|
795
|
+
* meta: {
|
|
796
|
+
* flagType: 'country',
|
|
797
|
+
* },
|
|
798
|
+
* },
|
|
799
|
+
* },
|
|
800
|
+
* },
|
|
801
|
+
* {
|
|
802
|
+
* name: 'Team Flag',
|
|
803
|
+
* virtual: true,
|
|
804
|
+
* showIn: [AdminForthResourcePages.SHOW],
|
|
805
|
+
* components: {
|
|
806
|
+
* show: {
|
|
807
|
+
* file: '@@/Flag.vue',
|
|
808
|
+
* meta: {
|
|
809
|
+
* flagType: 'team',
|
|
810
|
+
* },
|
|
811
|
+
* },
|
|
812
|
+
* },
|
|
813
|
+
* }
|
|
814
|
+
* ```
|
|
815
|
+
*
|
|
816
|
+
* In Flag.vue you can access this meta object like this:
|
|
817
|
+
*
|
|
818
|
+
* ```vue
|
|
819
|
+
* <template>
|
|
820
|
+
* <img :src="loadFile(`@@/flags/${meta.flagType}/${meta.flagType === 'country' ? record.countryIso : record.teamCode}.png`)" />
|
|
821
|
+
* </template>
|
|
822
|
+
*
|
|
823
|
+
* <script setup>
|
|
824
|
+
* import { loadFile } from '@/utils';
|
|
825
|
+
* defineProps(['meta', 'record']);
|
|
826
|
+
* </script>
|
|
827
|
+
*
|
|
828
|
+
*/
|
|
829
|
+
meta?: any,
|
|
830
|
+
} | string;
|
|
774
831
|
|
|
775
832
|
export type AdminForthFieldComponents = {
|
|
776
833
|
/**
|
|
777
834
|
* Show component is used to redefine cell which renders field value in show view.
|
|
778
|
-
* Component accepts next properties: [record, column, resource, adminUser].
|
|
835
|
+
* Component accepts next properties: [record, column, resource, adminUser, meta].
|
|
779
836
|
*
|
|
780
837
|
* Example: `FullName.vue`
|
|
781
838
|
*
|
|
@@ -801,33 +858,32 @@ export type AdminForthFieldComponents = {
|
|
|
801
858
|
* ```
|
|
802
859
|
*
|
|
803
860
|
*/
|
|
804
|
-
show?:
|
|
861
|
+
show?: AdminForthComponentDeclaration,
|
|
805
862
|
|
|
806
863
|
/**
|
|
807
864
|
* showRow component is similar to {@link AdminForthFieldComponent.show} but rewrites full table row (both \<td\> tags)
|
|
808
865
|
* Accepts next properties: [record, column, resource, adminUser]
|
|
809
866
|
*/
|
|
810
|
-
showRow?:
|
|
867
|
+
showRow?: AdminForthComponentDeclaration,
|
|
811
868
|
|
|
812
869
|
/**
|
|
813
870
|
* Create component is used to redefine input field in create view.
|
|
814
871
|
* Component accepts next properties: [record, column, resource, adminUser].
|
|
815
872
|
*/
|
|
816
|
-
create?:
|
|
873
|
+
create?: AdminForthComponentDeclaration,
|
|
817
874
|
|
|
818
875
|
/**
|
|
819
876
|
* Edit component is used to redefine input field in edit view.
|
|
820
877
|
* Component accepts next properties: [record, column, resource, adminUser].
|
|
821
878
|
*/
|
|
822
|
-
edit?:
|
|
879
|
+
edit?: AdminForthComponentDeclaration,
|
|
823
880
|
|
|
824
881
|
/**
|
|
825
882
|
* List component is used to redefine cell which renders field value in list view.
|
|
826
883
|
* Component accepts next properties: [record, column, resource, adminUser].
|
|
827
884
|
*
|
|
828
|
-
* Exa
|
|
829
885
|
*/
|
|
830
|
-
list?:
|
|
886
|
+
list?: AdminForthComponentDeclaration,
|
|
831
887
|
}
|
|
832
888
|
|
|
833
889
|
export enum AdminForthDataTypes {
|
package/documentation/README.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Website
|
|
2
|
-
|
|
3
|
-
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
|
|
4
|
-
|
|
5
|
-
### Installation
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
$ yarn
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Local Development
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
$ yarn start
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
|
18
|
-
|
|
19
|
-
### Build
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
$ yarn build
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
|
26
|
-
|
|
27
|
-
### Deployment
|
|
28
|
-
|
|
29
|
-
Using SSH:
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
$ USE_SSH=true yarn deploy
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Not using SSH:
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
$ GIT_USER=<Your GitHub username> yarn deploy
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
slug: first-blog-post
|
|
3
|
-
title: First Blog Post
|
|
4
|
-
authors:
|
|
5
|
-
name: Gao Wei
|
|
6
|
-
title: Docusaurus Core Team
|
|
7
|
-
url: https://github.com/wgao19
|
|
8
|
-
image_url: https://github.com/wgao19.png
|
|
9
|
-
tags: [hola, docusaurus]
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
slug: long-blog-post
|
|
3
|
-
title: Long Blog Post
|
|
4
|
-
authors: endi
|
|
5
|
-
tags: [hello, docusaurus]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
This is the summary of a very long blog post,
|
|
9
|
-
|
|
10
|
-
Use a `<!--` `truncate` `-->` comment to limit blog post size in the list view.
|
|
11
|
-
|
|
12
|
-
<!--truncate-->
|
|
13
|
-
|
|
14
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
15
|
-
|
|
16
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
17
|
-
|
|
18
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
19
|
-
|
|
20
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
21
|
-
|
|
22
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
23
|
-
|
|
24
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
25
|
-
|
|
26
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
27
|
-
|
|
28
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
29
|
-
|
|
30
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
31
|
-
|
|
32
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
33
|
-
|
|
34
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
35
|
-
|
|
36
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
37
|
-
|
|
38
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
39
|
-
|
|
40
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
41
|
-
|
|
42
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
43
|
-
|
|
44
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
slug: mdx-blog-post
|
|
3
|
-
title: MDX Blog Post
|
|
4
|
-
authors: [slorber]
|
|
5
|
-
tags: [docusaurus]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/).
|
|
9
|
-
|
|
10
|
-
:::tip
|
|
11
|
-
|
|
12
|
-
Use the power of React to create interactive blog posts.
|
|
13
|
-
|
|
14
|
-
```js
|
|
15
|
-
<button onClick={() => alert('button clicked!')}>Click me!</button>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
<button onClick={() => alert('button clicked!')}>Click me!</button>
|
|
19
|
-
|
|
20
|
-
:::
|
|
Binary file
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
slug: welcome
|
|
3
|
-
title: Welcome
|
|
4
|
-
authors: [slorber, yangshun]
|
|
5
|
-
tags: [facebook, hello, docusaurus]
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).
|
|
9
|
-
|
|
10
|
-
Simply add Markdown files (or folders) to the `blog` directory.
|
|
11
|
-
|
|
12
|
-
Regular blog authors can be added to `authors.yml`.
|
|
13
|
-
|
|
14
|
-
The blog post date can be extracted from filenames, such as:
|
|
15
|
-
|
|
16
|
-
- `2019-05-30-welcome.md`
|
|
17
|
-
- `2019-05-30-welcome/index.md`
|
|
18
|
-
|
|
19
|
-
A blog post folder can be convenient to co-locate blog post images:
|
|
20
|
-
|
|
21
|
-

|
|
22
|
-
|
|
23
|
-
The blog supports tags as well!
|
|
24
|
-
|
|
25
|
-
**And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config.
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
endi:
|
|
2
|
-
name: Endilie Yacop Sucipto
|
|
3
|
-
title: Maintainer of Docusaurus
|
|
4
|
-
url: https://github.com/endiliey
|
|
5
|
-
image_url: https://github.com/endiliey.png
|
|
6
|
-
|
|
7
|
-
yangshun:
|
|
8
|
-
name: Yangshun Tay
|
|
9
|
-
title: Front End Engineer @ Facebook
|
|
10
|
-
url: https://github.com/yangshun
|
|
11
|
-
image_url: https://github.com/yangshun.png
|
|
12
|
-
|
|
13
|
-
slorber:
|
|
14
|
-
name: Sébastien Lorber
|
|
15
|
-
title: Docusaurus maintainer
|
|
16
|
-
url: https://sebastienlorber.com
|
|
17
|
-
image_url: https://github.com/slorber.png
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
facebook:
|
|
2
|
-
label: Facebook
|
|
3
|
-
permalink: /facebook
|
|
4
|
-
description: Facebook tag description
|
|
5
|
-
hello:
|
|
6
|
-
label: Hello
|
|
7
|
-
permalink: /hello
|
|
8
|
-
description: Hello tag description
|
|
9
|
-
docusaurus:
|
|
10
|
-
label: Docusaurus
|
|
11
|
-
permalink: /docusaurus
|
|
12
|
-
description: Docusaurus tag description
|
|
13
|
-
hola:
|
|
14
|
-
label: Hola
|
|
15
|
-
permalink: /hola
|
|
16
|
-
description: Hola tag description
|