schummar-table 0.13.1 → 0.14.1

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,11 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { CommonFilterProps } from '../types';
3
3
  import { DatePickerProps, DateRange } from './datePicker';
4
- export declare function DateFilter<T, V>({ locale, firstDayOfWeek, singleSelect, filterBy, ...props }: {
5
- /** Which locale to use to render the calendar. */
6
- locale?: string;
7
- /** Which day of the week should be in the first column. */
8
- firstDayOfWeek?: DatePickerProps['firstDayOfWeek'];
4
+ export declare function DateFilter<T, V>({ locale, firstDayOfWeek, defaultDateInView, quickOptions, singleSelect, filterBy, ...props }: {
9
5
  /** If enabled, only single days can be selected. Ranges otherwise. */
10
6
  singleSelect?: boolean;
11
- } & CommonFilterProps<T, V, Date | DateRange | null, Date | DateRange | null>): JSX.Element;
7
+ } & Pick<DatePickerProps, 'locale' | 'firstDayOfWeek' | 'defaultDateInView' | 'quickOptions'> & CommonFilterProps<T, V, Date | DateRange | null, Date | DateRange | null>): JSX.Element;
@@ -1,7 +1,12 @@
1
+ import { ReactNode } from 'react';
1
2
  export declare type DateRange = {
2
3
  min: Date;
3
4
  max: Date;
4
5
  };
6
+ export declare type DatePickerQuickOption = {
7
+ label: ReactNode;
8
+ value: Date | DateRange | (() => Date | DateRange);
9
+ };
5
10
  export declare type DatePickerProps = {
6
11
  /** Currently selected day or range of days. */
7
12
  value: Date | DateRange | null;
@@ -13,6 +18,10 @@ export declare type DatePickerProps = {
13
18
  locale?: string;
14
19
  /** Which day of the week should be in the first column. */
15
20
  firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
21
+ /** Which month to show initially */
22
+ defaultDateInView?: Date;
23
+ /** Show buttons to quickly select suggested dates or date ranges */
24
+ quickOptions?: DatePickerQuickOption[] | ((onChange: (value: Date | DateRange | null) => void) => ReactNode);
16
25
  };
17
26
  /** Rounds a date down to the start of the day. */
18
27
  export declare const startOfDay: (d: Date) => Date;
@@ -22,4 +31,4 @@ export declare const today: () => DateRange;
22
31
  export declare const thisWeek: (firstDayOfWeek?: number) => DateRange;
23
32
  /** Returns whether two dates and/or date ranges intersect. Intersection is considered per day. */
24
33
  export declare function dateIntersect(a: Date | null | DateRange, b: Date | null | DateRange): boolean;
25
- export declare function DatePicker({ value, onChange, rangeSelect, locale, firstDayOfWeek }: DatePickerProps): import("@emotion/react/jsx-runtime").JSX.Element;
34
+ export declare function DatePicker({ value, onChange, rangeSelect, locale, firstDayOfWeek, defaultDateInView, quickOptions, }: DatePickerProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  export { AutoFocusTextField } from './components/autoFocusTextField';
2
2
  export { DateFilter } from './components/dateFilter';
3
- export { dateIntersect, DatePicker, endOfDay, startOfDay } from './components/datePicker';
3
+ export { dateIntersect, DatePicker, endOfDay, startOfDay, thisWeek, today } from './components/datePicker';
4
4
  export type { DatePickerProps, DateRange } from './components/datePicker';
5
5
  export { SelectFilter } from './components/selectFilter';
6
6
  export { ColumnContext, Table, TableContext, useColumnContext, useTableContext } from './components/table';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "schummar-table",
3
3
  "repository": "schummar/schummar-table",
4
- "version": "0.13.1",
4
+ "version": "0.14.1",
5
5
  "description": "",
6
6
  "type": "module",
7
7
  "sideEffects": false,
@@ -84,23 +84,23 @@
84
84
  "devDependencies": {
85
85
  "@emotion/styled": "11.10.4",
86
86
  "@material-ui/core": "4.12.4",
87
- "@mui/material": "5.10.3",
87
+ "@mui/material": "5.10.4",
88
88
  "@schummar/runp": "1.5.3",
89
89
  "@types/react": "18.0.18",
90
90
  "@types/react-dom": "18.0.6",
91
- "@typescript-eslint/eslint-plugin": "5.36.1",
92
- "@typescript-eslint/parser": "5.36.1",
93
- "@vitejs/plugin-react": "2.0.1",
91
+ "@typescript-eslint/eslint-plugin": "5.36.2",
92
+ "@typescript-eslint/parser": "5.36.2",
93
+ "@vitejs/plugin-react": "2.1.0",
94
94
  "eslint": "8.23.0",
95
95
  "eslint-plugin-storybook": "0.6.4",
96
- "npm-run-all": "^4.1.5",
96
+ "npm-run-all": "4.1.5",
97
97
  "prettier": "2.7.1",
98
98
  "react": "18.2.0",
99
99
  "react-dom": "18.2.0",
100
100
  "rimraf": "3.0.2",
101
101
  "semantic-release": "19.0.5",
102
102
  "typescript": "4.8.2",
103
- "vite": "3.0.9"
103
+ "vite": "3.1.0"
104
104
  },
105
105
  "files": [
106
106
  "dist"