react-admin-base-bootstrap 0.8.8 → 0.8.9
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/lib/esm/Components/BootstrapDataTable.d.ts +1 -0
- package/lib/esm/Components/BootstrapDataTable.js +4 -0
- package/lib/esm/Components/TitleOrTranslate.d.ts +6 -0
- package/lib/esm/Components/TitleOrTranslate.js +5 -0
- package/lib/esm/index.d.ts +2 -2
- package/lib/esm/index.js +2 -2
- package/package.json +12 -12
- package/src/Components/BootstrapDataTable.tsx +8 -0
- package/src/Components/TitleOrTranslate.tsx +12 -0
- package/src/index.ts +2 -2
|
@@ -24,5 +24,6 @@ interface RowRendererProps<Row = any> {
|
|
|
24
24
|
render: (row: Row) => React.ReactNode;
|
|
25
25
|
}
|
|
26
26
|
export declare function RowRenderer<Row = any>({ render }: RowRendererProps<Row>): JSX.Element;
|
|
27
|
+
export declare function CustomRenderer<Row = any>({ render }: RowRendererProps<Row>): JSX.Element;
|
|
27
28
|
export default function BootstrapTable({ url, bordered, noStrip, defaultParams, add, children, innerRef, body }: BootstrapTableProps): JSX.Element;
|
|
28
29
|
export {};
|
|
@@ -80,6 +80,10 @@ export function RowRenderer({ render }) {
|
|
|
80
80
|
const rows = useContext(RowDatasContext);
|
|
81
81
|
return React.createElement("tbody", null, rows.map(render));
|
|
82
82
|
}
|
|
83
|
+
export function CustomRenderer({ render }) {
|
|
84
|
+
const rows = useContext(RowDatasContext);
|
|
85
|
+
return React.createElement(React.Fragment, null, rows.map(render));
|
|
86
|
+
}
|
|
83
87
|
export default function BootstrapTable({ url, bordered, noStrip, defaultParams, add, children, innerRef, body }) {
|
|
84
88
|
const state = useState(Object.assign({ sort: 'id' }, defaultParams));
|
|
85
89
|
const [params, setParams] = state;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormattedMessage } from "react-intl";
|
|
3
|
+
export default function TitleOrTranslate({ title, translate, values }) {
|
|
4
|
+
return title ? React.createElement(React.Fragment, null, title) : React.createElement(FormattedMessage, { id: translate, values: values });
|
|
5
|
+
}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BootstrapTable, { RowRenderer, Actions, ActionsColumn, Column, default as BootstrapDataTable, IdColumn, useDataTableContext } from './Components/BootstrapDataTable';
|
|
1
|
+
import BootstrapTable, { RowRenderer, CustomRenderer, Actions, ActionsColumn, Column, default as BootstrapDataTable, IdColumn, useDataTableContext } from './Components/BootstrapDataTable';
|
|
2
2
|
import CRUD, { CRUDActions, ModalEntityEditor } from './Components/CRUD';
|
|
3
3
|
import EntityEditor from "./Components/EntityEditor";
|
|
4
4
|
import ExcelExportButton from './Components/ExcelExportButton';
|
|
@@ -23,4 +23,4 @@ import DefaultValidatorOptions from './Components/DefaultValidatorOptions';
|
|
|
23
23
|
import DragAndDropArrow from './Components/DragAndDropArrow';
|
|
24
24
|
import BootstrapOptionsProvider, { useBootstrapOptions } from './Components/BootstrapOptions';
|
|
25
25
|
import BootstrapModal from './Components/BootstrapModal';
|
|
26
|
-
export { ThemeProvider, useTheme, useAllThemes, useIsMobile, useMenuState, DefaultValidatorOptions, PasswordInput, StepList, StepItem, TopProgressBar, CRUD, ModalEntityEditor, CRUDActions, Relative, ApiSelect, Preview, ExcelExportButton, ExternalLoginButton, SingleFilePicker, MultiFilePicker, ImagePicker, BootstrapTable, EntityEditor, GoToTop, Validator, ValueValidator, ValidationErrors, LoadingButton, BootstrapDataTable, IdColumn, Column, ActionsColumn, Actions, useDataTableContext, RowRenderer, LanguageProvider, useLanguage, LanguageSwitcher, ErrorBoundary, CheckBox, DragAndDropArrow, useBootstrapOptions, BootstrapOptionsProvider, BootstrapModal };
|
|
26
|
+
export { ThemeProvider, useTheme, useAllThemes, useIsMobile, useMenuState, DefaultValidatorOptions, PasswordInput, StepList, StepItem, TopProgressBar, CRUD, ModalEntityEditor, CRUDActions, Relative, ApiSelect, Preview, ExcelExportButton, ExternalLoginButton, SingleFilePicker, MultiFilePicker, ImagePicker, BootstrapTable, EntityEditor, GoToTop, Validator, ValueValidator, ValidationErrors, LoadingButton, BootstrapDataTable, IdColumn, Column, ActionsColumn, Actions, useDataTableContext, RowRenderer, CustomRenderer, LanguageProvider, useLanguage, LanguageSwitcher, ErrorBoundary, CheckBox, DragAndDropArrow, useBootstrapOptions, BootstrapOptionsProvider, BootstrapModal };
|
package/lib/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BootstrapTable, { RowRenderer, Actions, ActionsColumn, Column, default as BootstrapDataTable, IdColumn, useDataTableContext } from './Components/BootstrapDataTable';
|
|
1
|
+
import BootstrapTable, { RowRenderer, CustomRenderer, Actions, ActionsColumn, Column, default as BootstrapDataTable, IdColumn, useDataTableContext } from './Components/BootstrapDataTable';
|
|
2
2
|
import CRUD, { CRUDActions, ModalEntityEditor } from './Components/CRUD';
|
|
3
3
|
import EntityEditor from "./Components/EntityEditor";
|
|
4
4
|
import ExcelExportButton from './Components/ExcelExportButton';
|
|
@@ -23,4 +23,4 @@ import DefaultValidatorOptions from './Components/DefaultValidatorOptions';
|
|
|
23
23
|
import DragAndDropArrow from './Components/DragAndDropArrow';
|
|
24
24
|
import BootstrapOptionsProvider, { useBootstrapOptions } from './Components/BootstrapOptions';
|
|
25
25
|
import BootstrapModal from './Components/BootstrapModal';
|
|
26
|
-
export { ThemeProvider, useTheme, useAllThemes, useIsMobile, useMenuState, DefaultValidatorOptions, PasswordInput, StepList, StepItem, TopProgressBar, CRUD, ModalEntityEditor, CRUDActions, Relative, ApiSelect, Preview, ExcelExportButton, ExternalLoginButton, SingleFilePicker, MultiFilePicker, ImagePicker, BootstrapTable, EntityEditor, GoToTop, Validator, ValueValidator, ValidationErrors, LoadingButton, BootstrapDataTable, IdColumn, Column, ActionsColumn, Actions, useDataTableContext, RowRenderer, LanguageProvider, useLanguage, LanguageSwitcher, ErrorBoundary, CheckBox, DragAndDropArrow, useBootstrapOptions, BootstrapOptionsProvider, BootstrapModal };
|
|
26
|
+
export { ThemeProvider, useTheme, useAllThemes, useIsMobile, useMenuState, DefaultValidatorOptions, PasswordInput, StepList, StepItem, TopProgressBar, CRUD, ModalEntityEditor, CRUDActions, Relative, ApiSelect, Preview, ExcelExportButton, ExternalLoginButton, SingleFilePicker, MultiFilePicker, ImagePicker, BootstrapTable, EntityEditor, GoToTop, Validator, ValueValidator, ValidationErrors, LoadingButton, BootstrapDataTable, IdColumn, Column, ActionsColumn, Actions, useDataTableContext, RowRenderer, CustomRenderer, LanguageProvider, useLanguage, LanguageSwitcher, ErrorBoundary, CheckBox, DragAndDropArrow, useBootstrapOptions, BootstrapOptionsProvider, BootstrapModal };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-admin-base-bootstrap",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -27,32 +27,32 @@
|
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^18.2.0",
|
|
29
29
|
"react-dom": "^18.2.0",
|
|
30
|
-
"react-intl": "^6.2.
|
|
31
|
-
"react-router-dom": "^6.
|
|
30
|
+
"react-intl": "^6.2.10",
|
|
31
|
+
"react-router-dom": "^6.8.2"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@emotion/react": "^11.10.
|
|
35
|
-
"@fortawesome/fontawesome-free": "^6.
|
|
34
|
+
"@emotion/react": "^11.10.6",
|
|
35
|
+
"@fortawesome/fontawesome-free": "^6.3.0",
|
|
36
36
|
"bootstrap": "^5.2.3",
|
|
37
37
|
"file-dialog": "^0.0.8",
|
|
38
38
|
"modal-cropper": "^1.2.3",
|
|
39
39
|
"nprogress": "^0.2.0",
|
|
40
40
|
"prettysize": "^2.0.0",
|
|
41
|
-
"react-admin-base": "^0.8.
|
|
41
|
+
"react-admin-base": "^0.8.4",
|
|
42
42
|
"react-dnd": "^16.0.1",
|
|
43
43
|
"react-dnd-html5-backend": "^16.0.1",
|
|
44
44
|
"react-password-strength-bar": "^0.4.1",
|
|
45
45
|
"react-responsive": "^9.0.2",
|
|
46
46
|
"react-select": "^5.7.0",
|
|
47
|
-
"reactstrap": "^9.1.
|
|
47
|
+
"reactstrap": "^9.1.6",
|
|
48
48
|
"rewire": "^6.0.0",
|
|
49
|
-
"sweetalert2": "^11.
|
|
49
|
+
"sweetalert2": "^11.7.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@types/react": "^18.0.
|
|
52
|
+
"@types/react": "^18.0.28",
|
|
53
53
|
"cross-env": "^7.0.3",
|
|
54
|
-
"nodemon": "^2.0.
|
|
55
|
-
"react-intl": "^6.2.
|
|
56
|
-
"typescript": "^4.9.
|
|
54
|
+
"nodemon": "^2.0.21",
|
|
55
|
+
"react-intl": "^6.2.10",
|
|
56
|
+
"typescript": "^4.9.5"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -107,6 +107,14 @@ export function RowRenderer<Row = any>({render}: RowRendererProps<Row>) {
|
|
|
107
107
|
</tbody>;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
export function CustomRenderer<Row = any>({render}: RowRendererProps<Row>) {
|
|
111
|
+
const rows = useContext(RowDatasContext);
|
|
112
|
+
|
|
113
|
+
return <>
|
|
114
|
+
{ rows.map(render) }
|
|
115
|
+
</>;
|
|
116
|
+
}
|
|
117
|
+
|
|
110
118
|
export default function BootstrapTable({url, bordered, noStrip, defaultParams, add, children, innerRef, body}: BootstrapTableProps) {
|
|
111
119
|
const state = useState({sort: 'id', ...defaultParams});
|
|
112
120
|
const [params, setParams] = state;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormattedMessage } from "react-intl";
|
|
3
|
+
|
|
4
|
+
export interface TitleOrTranslateProps {
|
|
5
|
+
title?: string;
|
|
6
|
+
translate?: string;
|
|
7
|
+
values?: Record<string, any>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default function TitleOrTranslate({ title, translate, values }: TitleOrTranslateProps){
|
|
11
|
+
return title ? <>{title}</> : <FormattedMessage id={translate} values={values} />;
|
|
12
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import BootstrapTable, { RowRenderer, Actions, ActionsColumn, Column, default as BootstrapDataTable, IdColumn, useDataTableContext } from './Components/BootstrapDataTable';
|
|
2
|
+
import BootstrapTable, { RowRenderer, CustomRenderer, Actions, ActionsColumn, Column, default as BootstrapDataTable, IdColumn, useDataTableContext } from './Components/BootstrapDataTable';
|
|
3
3
|
import CRUD, { CRUDActions, ModalEntityEditor } from './Components/CRUD';
|
|
4
4
|
import EntityEditor from "./Components/EntityEditor";
|
|
5
5
|
import ExcelExportButton from './Components/ExcelExportButton';
|
|
@@ -47,7 +47,7 @@ export {
|
|
|
47
47
|
Validator, ValueValidator, ValidationErrors,
|
|
48
48
|
LoadingButton,
|
|
49
49
|
BootstrapDataTable, IdColumn, Column, ActionsColumn, Actions, useDataTableContext,
|
|
50
|
-
RowRenderer,
|
|
50
|
+
RowRenderer, CustomRenderer,
|
|
51
51
|
LanguageProvider, useLanguage, LanguageSwitcher,
|
|
52
52
|
ErrorBoundary,
|
|
53
53
|
CheckBox,
|