react-admin-base-bootstrap 0.8.12 → 0.8.14
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.
|
@@ -20,6 +20,12 @@ const RowDataContext = React.createContext(null);
|
|
|
20
20
|
export function useDataTableContext() {
|
|
21
21
|
return useContext(DataTableContext);
|
|
22
22
|
}
|
|
23
|
+
export function useRows() {
|
|
24
|
+
return useContext(RowDatasContext);
|
|
25
|
+
}
|
|
26
|
+
export function useRow() {
|
|
27
|
+
return useContext(RowDataContext);
|
|
28
|
+
}
|
|
23
29
|
export function Actions({ edit, del, rowSpan, children }) {
|
|
24
30
|
const [api] = useAuth();
|
|
25
31
|
const [, setParams] = useContext(DataTableContext);
|
|
@@ -136,7 +142,8 @@ export default function BootstrapTable({ url, bordered, noStrip, defaultParams,
|
|
|
136
142
|
React.createElement("option", { value: "-1" }, intl.formatMessage({ id: "ALL" })))),
|
|
137
143
|
children[2],
|
|
138
144
|
React.createElement(Col, { md: "3", className: "ms-auto" },
|
|
139
|
-
React.createElement(Input, { placeholder: intl.formatMessage({ id: "SEARCH" }), type: "text", value: params.query || '', onChange: e => setParams(Object.assign(Object.assign({}, params), { query: e.currentTarget.value })) })))
|
|
145
|
+
React.createElement(Input, { placeholder: intl.formatMessage({ id: "SEARCH" }), type: "text", value: params.query || '', onChange: e => setParams(Object.assign(Object.assign({}, params), { query: e.currentTarget.value })) }))),
|
|
146
|
+
children[3]),
|
|
140
147
|
data === null ? React.createElement(Alert, { className: "text-center mb-0 mx-3 ", color: "warning" },
|
|
141
148
|
React.createElement("i", { className: "fas fa-spinner fa-spin" })) : !data.length ? React.createElement(Alert, { className: "text-center mx-3", color: "danger" },
|
|
142
149
|
React.createElement("i", { className: "far fa-times-circle" }),
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BootstrapTable, { RowRenderer, CustomRenderer, Actions, ActionsColumn, Column, default as BootstrapDataTable, IdColumn, useDataTableContext } from './Components/BootstrapDataTable';
|
|
1
|
+
import BootstrapTable, { useRows, useRow, 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, CustomRenderer, LanguageProvider, useLanguage, LanguageSwitcher, ErrorBoundary, CheckBox, DragAndDropArrow, useBootstrapOptions, BootstrapOptionsProvider, BootstrapModal, CreateSelect };
|
|
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, CreateSelect, useRow, useRows };
|
package/lib/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BootstrapTable, { RowRenderer, CustomRenderer, Actions, ActionsColumn, Column, default as BootstrapDataTable, IdColumn, useDataTableContext } from './Components/BootstrapDataTable';
|
|
1
|
+
import BootstrapTable, { useRows, useRow, 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, CustomRenderer, LanguageProvider, useLanguage, LanguageSwitcher, ErrorBoundary, CheckBox, DragAndDropArrow, useBootstrapOptions, BootstrapOptionsProvider, BootstrapModal, CreateSelect };
|
|
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, CreateSelect, useRow, useRows };
|
package/package.json
CHANGED
|
@@ -14,6 +14,14 @@ export function useDataTableContext() {
|
|
|
14
14
|
return useContext(DataTableContext);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
export function useRows() {
|
|
18
|
+
return useContext(RowDatasContext);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function useRow() {
|
|
22
|
+
return useContext(RowDataContext);
|
|
23
|
+
}
|
|
24
|
+
|
|
17
25
|
type ActionsProp = {
|
|
18
26
|
edit?: string;
|
|
19
27
|
del?: string;
|
|
@@ -178,6 +186,7 @@ export default function BootstrapTable({url, bordered, noStrip, defaultParams, a
|
|
|
178
186
|
/>
|
|
179
187
|
</Col>
|
|
180
188
|
</Row>
|
|
189
|
+
{children[3]}
|
|
181
190
|
</CardHeader>
|
|
182
191
|
{data === null ? <Alert className="text-center mb-0 mx-3 " color="warning"><i className="fas fa-spinner fa-spin"></i></Alert> : !data.length ? <Alert className="text-center mx-3" color="danger">
|
|
183
192
|
<i className="far fa-times-circle"></i> <FormattedMessage id="NO_DATA_IS_AVAILABLE"/>
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import BootstrapTable, { RowRenderer, CustomRenderer, Actions, ActionsColumn, Column, default as BootstrapDataTable, IdColumn, useDataTableContext } from './Components/BootstrapDataTable';
|
|
2
|
+
import BootstrapTable, { useRows, useRow, 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';
|
|
@@ -55,5 +55,6 @@ export {
|
|
|
55
55
|
useBootstrapOptions,
|
|
56
56
|
BootstrapOptionsProvider,
|
|
57
57
|
BootstrapModal,
|
|
58
|
-
CreateSelect
|
|
58
|
+
CreateSelect,
|
|
59
|
+
useRow, useRows
|
|
59
60
|
};
|