react-admin-base-bootstrap 0.8.16 → 0.8.17
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.
|
@@ -21,11 +21,12 @@ export interface BootstrapTableProps {
|
|
|
21
21
|
add?: string;
|
|
22
22
|
children: any;
|
|
23
23
|
innerRef?: any;
|
|
24
|
+
noSearch?: boolean;
|
|
24
25
|
}
|
|
25
26
|
interface RowRendererProps<Row = any> {
|
|
26
27
|
render: (row: Row) => React.ReactNode;
|
|
27
28
|
}
|
|
28
29
|
export declare function RowRenderer<Row = any>({ render }: RowRendererProps<Row>): React.JSX.Element;
|
|
29
30
|
export declare function CustomRenderer<Row = any>({ render }: RowRendererProps<Row>): React.JSX.Element;
|
|
30
|
-
export default function BootstrapTable({ url, bordered, noStrip, defaultParams, add, children, innerRef, body }: BootstrapTableProps): React.JSX.Element;
|
|
31
|
+
export default function BootstrapTable({ url, bordered, noStrip, defaultParams, add, noSearch, children, innerRef, body }: BootstrapTableProps): React.JSX.Element;
|
|
31
32
|
export {};
|
|
@@ -90,7 +90,7 @@ export function CustomRenderer({ render }) {
|
|
|
90
90
|
const rows = useContext(RowDatasContext);
|
|
91
91
|
return React.createElement(React.Fragment, null, rows.map(render));
|
|
92
92
|
}
|
|
93
|
-
export default function BootstrapTable({ url, bordered, noStrip, defaultParams, add, children, innerRef, body }) {
|
|
93
|
+
export default function BootstrapTable({ url, bordered, noStrip, defaultParams, add, noSearch = false, children, innerRef, body }) {
|
|
94
94
|
const state = useState(Object.assign({ sort: 'id' }, defaultParams));
|
|
95
95
|
const [params, setParams] = state;
|
|
96
96
|
const [page, lastPage, setPage, data, itemPerPage, setItemPerPage, update, count] = useDataTable(url, params, body);
|
|
@@ -141,7 +141,7 @@ export default function BootstrapTable({ url, bordered, noStrip, defaultParams,
|
|
|
141
141
|
React.createElement("option", { value: "200" }, "200"),
|
|
142
142
|
React.createElement("option", { value: "-1" }, intl.formatMessage({ id: "ALL" })))),
|
|
143
143
|
children[2],
|
|
144
|
-
React.createElement(Col, { md: "3", className: "ms-auto" },
|
|
144
|
+
!noSearch && React.createElement(Col, { md: "3", className: "ms-auto" },
|
|
145
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
146
|
children[3]),
|
|
147
147
|
data === null ? React.createElement(Alert, { className: "text-center mb-0 mx-3 ", color: "warning" },
|
package/package.json
CHANGED
|
@@ -101,6 +101,7 @@ export interface BootstrapTableProps {
|
|
|
101
101
|
add?: string;
|
|
102
102
|
children: any;
|
|
103
103
|
innerRef?: any;
|
|
104
|
+
noSearch?: boolean;
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
interface RowRendererProps<Row = any> {
|
|
@@ -123,7 +124,7 @@ export function CustomRenderer<Row = any>({render}: RowRendererProps<Row>) {
|
|
|
123
124
|
</>;
|
|
124
125
|
}
|
|
125
126
|
|
|
126
|
-
export default function BootstrapTable({url, bordered, noStrip, defaultParams, add, children, innerRef, body}: BootstrapTableProps) {
|
|
127
|
+
export default function BootstrapTable({url, bordered, noStrip, defaultParams, add, noSearch = false, children, innerRef, body}: BootstrapTableProps) {
|
|
127
128
|
const state = useState({sort: 'id', ...defaultParams});
|
|
128
129
|
const [params, setParams] = state;
|
|
129
130
|
const [page, lastPage, setPage, data, itemPerPage, setItemPerPage, update, count] = useDataTable(url, params, body);
|
|
@@ -178,13 +179,13 @@ export default function BootstrapTable({url, bordered, noStrip, defaultParams, a
|
|
|
178
179
|
</Input>
|
|
179
180
|
</Col>
|
|
180
181
|
{children[2]}
|
|
181
|
-
<Col md="3" className="ms-auto">
|
|
182
|
+
{!noSearch && <Col md="3" className="ms-auto">
|
|
182
183
|
<Input
|
|
183
184
|
placeholder={intl.formatMessage({id: "SEARCH"})} type="text"
|
|
184
185
|
value={params.query || ''}
|
|
185
186
|
onChange={e => setParams({...params, query: e.currentTarget.value})}
|
|
186
187
|
/>
|
|
187
|
-
</Col>
|
|
188
|
+
</Col>}
|
|
188
189
|
</Row>
|
|
189
190
|
{children[3]}
|
|
190
191
|
</CardHeader>
|