@jasperoosthoek/react-toolbox 0.5.6 → 0.6.0

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/change-log.md CHANGED
@@ -243,3 +243,9 @@
243
243
  ##### Version 0.5.6
244
244
  - Rename `CreateEditModal` & `CreateEditModalProvider` to `FormModal` & `FormModalProvider`
245
245
  - Remove out of context error when clicking row to open `EditModal` on `DataTable`
246
+
247
+ ##### Version 0.5.7
248
+ - New optional footer with sum of values in `DataTable` component
249
+
250
+ ##### Version 0.6.0
251
+ - Update to React 19
@@ -1,7 +1,6 @@
1
1
  import React, { ReactElement } from 'react';
2
2
  import { BadgeProps, FormControlProps, FormCheckProps } from 'react-bootstrap';
3
3
  import { Variant } from 'react-bootstrap/types';
4
- import PropTypes from 'prop-types';
5
4
  import { Moment } from 'moment';
6
5
  export type FormValue = boolean | string | string[] | number | number[];
7
6
  export type FormOnChange = (((value: FormValue) => void) | ((value: FormValue, formData: any) => any));
@@ -65,12 +64,7 @@ export type FormSelectProps = Omit<FormInputProps, 'disabled' | 'onChange'> & {
65
64
  idKey?: string;
66
65
  disabled?: boolean | ((props: DisabledProps) => boolean);
67
66
  };
68
- export declare const FormSelect: {
69
- ({ list, idKey, integer, value, defaultValue, onChange, label, controlId, htmlSize, state, formatTitle, multiple, disabled, isInvalid, initialState, initialValue, keyName, pristine, }: FormSelectProps): React.JSX.Element;
70
- propTypes: {
71
- onChange: PropTypes.Validator<(...args: any[]) => any>;
72
- };
73
- };
67
+ export declare const FormSelect: ({ list, idKey, integer, value, defaultValue, onChange, label, controlId, htmlSize, state, formatTitle, multiple, disabled, isInvalid, initialState, initialValue, keyName, pristine, }: FormSelectProps) => React.JSX.Element;
74
68
  export interface BadgeSelectionProps extends BadgeProps {
75
69
  selected: boolean;
76
70
  cursor: string;
@@ -12,6 +12,8 @@ export type DataTableColumn<R> = {
12
12
  orderBy?: OrderByColumn<R>;
13
13
  optionsDropdown?: OptionsDropdown;
14
14
  className?: string;
15
+ value?: number | string | ((row: R) => number);
16
+ formatSum?: ((value: number) => ReactElement | string | number) | ReactElement | string | number;
15
17
  selector: number | string | ((row: R) => ReactElement | string | number | (ReactElement | string | number)[]);
16
18
  onClick?: OnClickRow<R>;
17
19
  };
@@ -47,5 +49,6 @@ export type DataTableProps<D extends any[]> = {
47
49
  className?: string;
48
50
  rowClassName?: string | ((row: D[number]) => string);
49
51
  style?: any;
52
+ showSum?: boolean;
50
53
  };
51
- export declare const DataTable: <D extends any[]>({ data: allData, columns, rowsPerPage: rowsPerPageDefault, rowsPerPageOptions, filterColumn, orderByDefault, orderByDefaultDirection, onMove, moveId, moveIsLoading, showHeader, onClickRow, showEditModalOnClickRow, textOnEmpty, className, rowClassName, style, ...restProps }: DataTableProps<D>) => React.JSX.Element;
54
+ export declare const DataTable: <D extends any[]>({ data: allData, columns, rowsPerPage: rowsPerPageDefault, rowsPerPageOptions, filterColumn, orderByDefault, orderByDefaultDirection, onMove, moveId, moveIsLoading, showHeader, onClickRow, showEditModalOnClickRow, textOnEmpty, className, rowClassName, style, showSum, ...restProps }: DataTableProps<D>) => React.JSX.Element;