tp-react-elements 1.3.13 → 1.3.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.
@@ -1,3 +1,3 @@
1
- var Month = {};
1
+ var InputRangeField = {};
2
2
 
3
- export { Month as __exports };
3
+ export { InputRangeField as __exports };
@@ -1,3 +1,3 @@
1
- var InputRangeField = {};
1
+ var Month = {};
2
2
 
3
- export { InputRangeField as __exports };
3
+ export { Month as __exports };
@@ -1,3 +1,3 @@
1
- var DateRangePicker = {};
1
+ var DefinedRange = {};
2
2
 
3
- export { DateRangePicker as __exports };
3
+ export { DefinedRange as __exports };
@@ -1,3 +1,3 @@
1
- var Calendar = {};
1
+ var DateRangePicker = {};
2
2
 
3
- export { Calendar as __exports };
3
+ export { DateRangePicker as __exports };
@@ -1,3 +1,3 @@
1
- var DefinedRange = {};
1
+ var Calendar = {};
2
2
 
3
- export { DefinedRange as __exports };
3
+ export { Calendar as __exports };
@@ -16,55 +16,39 @@ import type { MRT_ColumnDef } from 'material-react-table';
16
16
  */
17
17
  export type ColumnFilterType = 'text' | 'date' | 'select' | 'searchable-select' | 'number' | 'multi-select';
18
18
  /**
19
- * Drop-in replacement for `MRT_ColumnDef` that adds top-level
20
- * `filterType` and `options` so you never have to write `meta` blocks
21
- * or custom `filterFn` — the grid handles both automatically.
19
+ * `TValue` (second generic) is passed straight through to
20
+ * `MRT_ColumnDef<TData, TValue>` and **defaults to `any`** so that
21
+ * `cell.getValue()` returns `any` inside `Cell`, `muiTableBodyCellProps`,
22
+ * and all other MRT callbacks — exactly as you'd expect from a plain
23
+ * `MRT_ColumnDef` column. Set `TValue` explicitly only when you want
24
+ * strict return-type checking on `cell.getValue()`.
22
25
  *
23
- * @example
24
26
  * ```ts
25
- * import type { TPColumnDef } from './types';
26
- *
27
- * const columns: TPColumnDef<MyRow>[] = [
28
- * // Date picker chip
29
- * { accessorKey: 'invoiceDate', header: 'Invoice Date', filterType: 'date' },
30
- *
31
- * // Searchable single-select chip
27
+ * // Default — cell.getValue() is `any` (no cast needed)
28
+ * const cols: TPColumnDef<MyRow>[] = [
32
29
  * {
33
- * accessorKey: 'status',
34
- * header: 'Status',
35
- * filterType: 'searchable-select',
36
- * options: [
37
- * { label: 'Active', value: 'A' },
38
- * { label: 'Inactive', value: 'I' },
39
- * ],
30
+ * accessorKey: 'name',
31
+ * muiTableBodyCellProps: ({ cell }) => ({ title: cell.getValue(), className: 'body_cell' }),
40
32
  * },
41
- *
42
- * // Multi-select checkbox chip — pick many values, client-side
43
- * {
44
- * accessorKey: 'priority',
45
- * header: 'Priority',
46
- * filterType: 'multi-select',
47
- * options: [
48
- * { label: 'Low', value: 'Low' },
49
- * { label: 'Medium', value: 'Medium' },
50
- * { label: 'High', value: 'High' },
51
- * ],
52
- * },
53
- *
54
- * // Hidden from Manage Filters (numeric column)
55
- * { accessorKey: 'qty', header: 'Qty', enableColumnFilter: false },
56
33
  * ];
34
+ *
35
+ * // Strict — cell.getValue() is `number`
36
+ * const strictCol: TPColumnDef<MyRow, number> = {
37
+ * accessorKey: 'qty',
38
+ * Cell: ({ cell }) => <b>{cell.getValue().toFixed(2)}</b>,
39
+ * };
57
40
  * ```
58
41
  */
59
- export type TPColumnDef<TData extends object = object> = MRT_ColumnDef<TData> & {
42
+ export type TPColumnDef<TData extends object = object, TValue = any> = MRT_ColumnDef<TData, TValue> & {
60
43
  /**
61
44
  * Which filter chip to show in Manage Filters → Column Filters.
62
45
  * Omit (or set to `'text'`) for a plain text-input chip.
63
46
  */
64
47
  filterType?: ColumnFilterType;
65
48
  /**
66
- * Option pairs for `'select'` and `'searchable-select'` filter types.
67
- * Each entry needs `label` (display text) and `value` (filter value sent).
49
+ * Option pairs for `'select'`, `'searchable-select'`, and `'multi-select'`
50
+ * filter types. Each entry needs `label` (display text) and `value` (filter
51
+ * value sent to the server / used for client-side matching).
68
52
  */
69
53
  options?: {
70
54
  label: string;
@@ -1,4 +1,4 @@
1
- import { __exports as Calendar } from '../../../../../_virtual/index.esm5.js';
1
+ import { __exports as Calendar } from '../../../../../_virtual/index.esm6.js';
2
2
  import React__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireDayCell } from '../DayCell/index.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as DateRangePicker } from '../../../../../_virtual/index.esm4.js';
1
+ import { __exports as DateRangePicker } from '../../../../../_virtual/index.esm5.js';
2
2
  import React__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireDateRange } from '../DateRange/index.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as DefinedRange } from '../../../../../_virtual/index.esm6.js';
1
+ import { __exports as DefinedRange } from '../../../../../_virtual/index.esm4.js';
2
2
  import React__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireStyles } from '../../styles.esm.js';
@@ -1,4 +1,4 @@
1
- import { __exports as InputRangeField } from '../../../../../_virtual/index.esm13.js';
1
+ import { __exports as InputRangeField } from '../../../../../_virtual/index.esm12.js';
2
2
  import React__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { __exports as Month } from '../../../../../_virtual/index.esm12.js';
1
+ import { __exports as Month } from '../../../../../_virtual/index.esm13.js';
2
2
  import React__default from 'react';
3
3
  import { __require as requirePropTypes } from '../../../../prop-types/index.esm.js';
4
4
  import { __require as requireDayCell } from '../DayCell/index.esm.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tp-react-elements",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "React form components library built with React Hook Form and Yup",