@bsol-oss/react-datatable5 12.0.0-beta.90 → 12.0.0-beta.92

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.
Files changed (31) hide show
  1. package/dist/index.d.ts +38 -7
  2. package/dist/index.js +1242 -521
  3. package/dist/index.mjs +1244 -525
  4. package/dist/types/components/DataTable/display/RecordDisplay.d.ts +2 -2
  5. package/dist/types/components/DataTable/display/TextCell.d.ts +11 -4
  6. package/dist/types/components/DataTable/display/TextWithCopy.d.ts +8 -0
  7. package/dist/types/components/DatePicker/DatePickerInput.d.ts +18 -0
  8. package/dist/types/components/DatePicker/DateTimePicker.d.ts +4 -1
  9. package/dist/types/components/DatePicker/IsoTimePicker.d.ts +2 -1
  10. package/dist/types/components/DatePicker/index.d.ts +2 -1
  11. package/dist/types/components/Form/SchemaFormContext.d.ts +2 -1
  12. package/dist/types/components/Form/components/core/FormRoot.d.ts +3 -4
  13. package/dist/types/components/Form/components/fields/ArrayRenderer.d.ts +1 -1
  14. package/dist/types/components/Form/components/fields/StringInputField.d.ts +0 -1
  15. package/dist/types/components/Form/components/fields/TextAreaInput.d.ts +0 -5
  16. package/dist/types/components/Form/components/types/CustomJSONSchema7.d.ts +8 -0
  17. package/dist/types/components/Form/components/viewers/ArrayViewer.d.ts +1 -1
  18. package/dist/types/components/Form/components/viewers/BooleanViewer.d.ts +1 -1
  19. package/dist/types/components/Form/components/viewers/DateTimeViewer.d.ts +1 -1
  20. package/dist/types/components/Form/components/viewers/DateViewer.d.ts +1 -1
  21. package/dist/types/components/Form/components/viewers/IdViewer.d.ts +1 -1
  22. package/dist/types/components/Form/components/viewers/ObjectViewer.d.ts +1 -1
  23. package/dist/types/components/Form/components/viewers/RecordViewer.d.ts +2 -2
  24. package/dist/types/components/Form/components/viewers/StringViewer.d.ts +1 -6
  25. package/dist/types/components/Form/components/viewers/TextAreaViewer.d.ts +1 -6
  26. package/dist/types/components/Form/components/viewers/TimeViewer.d.ts +1 -1
  27. package/dist/types/components/Form/utils/useFormI18n.d.ts +5 -3
  28. package/dist/types/components/TimePicker/TimePicker.d.ts +2 -1
  29. package/dist/types/components/ui/pagination.d.ts +10 -7
  30. package/dist/types/index.d.ts +1 -0
  31. package/package.json +4 -4
@@ -1,5 +1,5 @@
1
- import { BoxProps } from "@chakra-ui/react";
2
- import { UseTranslationResponse } from "react-i18next";
1
+ import { BoxProps } from '@chakra-ui/react';
2
+ import { UseTranslationResponse } from 'react-i18next';
3
3
  export interface RecordDisplayProps {
4
4
  object: object | null;
5
5
  boxProps?: BoxProps;
@@ -1,10 +1,17 @@
1
- import { FlexProps, TextProps } from "@chakra-ui/react";
2
- import { ReactNode } from "react";
1
+ import { FlexProps, TextProps } from '@chakra-ui/react';
2
+ import { ReactNode } from 'react';
3
3
  export interface TextCellProps {
4
+ text?: string | number | null | undefined | string[];
5
+ href?: string;
6
+ onClick?: () => void;
7
+ isCopyable?: boolean;
8
+ isBadge?: boolean;
9
+ badgeColor?: 'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink';
10
+ colorPalette?: 'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink';
4
11
  label?: string;
5
12
  noOfLines?: number[];
6
- children: string | number | ReactNode | ReactNode[];
13
+ children?: string | number | ReactNode | ReactNode[];
7
14
  containerProps?: FlexProps;
8
15
  textProps?: TextProps;
9
16
  }
10
- export declare const TextCell: ({ label, containerProps, textProps, children, }: TextCellProps) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const TextCell: ({ text, href, onClick, isCopyable, isBadge, badgeColor, colorPalette, label, containerProps, textProps, children, }: TextCellProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ interface TextWithCopyProps {
3
+ text: string | number | null | undefined;
4
+ globalFilter?: string;
5
+ highlightedText?: ReactNode;
6
+ }
7
+ export declare const TextWithCopy: ({ text, globalFilter, highlightedText, }: TextWithCopyProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,18 @@
1
+ import { DatePickerLabels } from './DatePicker';
2
+ export interface DatePickerInputProps {
3
+ value?: string | Date;
4
+ onChange?: (date?: string) => void;
5
+ placeholder?: string;
6
+ dateFormat?: string;
7
+ displayFormat?: string;
8
+ labels?: DatePickerLabels;
9
+ timezone?: string;
10
+ minDate?: Date;
11
+ maxDate?: Date;
12
+ firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
13
+ showOutsideDays?: boolean;
14
+ monthsToDisplay?: number;
15
+ insideDialog?: boolean;
16
+ readOnly?: boolean;
17
+ }
18
+ export declare function DatePickerInput({ value, onChange, placeholder, dateFormat, displayFormat, labels, timezone, minDate, maxDate, firstDayOfWeek, showOutsideDays, monthsToDisplay, insideDialog, readOnly, }: DatePickerInputProps): import("react/jsx-runtime").JSX.Element;
@@ -7,6 +7,9 @@ interface DateTimePickerProps {
7
7
  labels?: DatePickerLabels;
8
8
  timezone?: string;
9
9
  startTime?: string;
10
+ minDate?: Date;
11
+ maxDate?: Date;
12
+ portalled?: boolean;
10
13
  }
11
- export declare function DateTimePicker({ value, onChange, format, showSeconds, labels, timezone, startTime, }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function DateTimePicker({ value, onChange, format, showSeconds, labels, timezone, startTime, minDate, maxDate, portalled, }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
12
15
  export {};
@@ -14,6 +14,7 @@ interface IsoTimePickerProps {
14
14
  startTime?: string;
15
15
  selectedDate?: string;
16
16
  timezone?: string;
17
+ portalled?: boolean;
17
18
  }
18
- export declare function IsoTimePicker({ hour, setHour, minute, setMinute, second, setSecond, onChange, startTime, selectedDate, timezone, }: IsoTimePickerProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare function IsoTimePicker({ hour, setHour, minute, setMinute, second, setSecond, onChange, startTime, selectedDate, timezone, portalled, }: IsoTimePickerProps): import("react/jsx-runtime").JSX.Element;
19
20
  export {};
@@ -4,4 +4,5 @@ export { IsoTimePicker } from './IsoTimePicker';
4
4
  export { DateTimePicker } from './DateTimePicker';
5
5
  export { DurationPicker } from './DurationPicker';
6
6
  export { UniversalPicker } from './UniversalPicker';
7
- export type { DatePickerProps, CalendarProps, GetDateColorProps, GetVariantProps } from './DatePicker';
7
+ export { DatePickerInput } from './DatePickerInput';
8
+ export type { DatePickerProps, CalendarProps, GetDateColorProps, GetVariantProps, } from './DatePicker';
@@ -3,7 +3,7 @@ import { JSONSchema7 } from 'json-schema';
3
3
  import { Dispatch, ReactNode, SetStateAction } from 'react';
4
4
  import { FieldValues, Resolver } from 'react-hook-form';
5
5
  import { UseTranslationResponse } from 'react-i18next';
6
- import { DateTimePickerLabels, IdPickerLabels, EnumPickerLabels, FilePickerLabels } from './components/types/CustomJSONSchema7';
6
+ import { DateTimePickerLabels, IdPickerLabels, EnumPickerLabels, FilePickerLabels, FormButtonLabels } from './components/types/CustomJSONSchema7';
7
7
  export interface SchemaFormContext<TData extends FieldValues> {
8
8
  schema: JSONSchema7;
9
9
  serverUrl: string;
@@ -44,6 +44,7 @@ export interface SchemaFormContext<TData extends FieldValues> {
44
44
  idPickerLabels?: IdPickerLabels;
45
45
  enumPickerLabels?: EnumPickerLabels;
46
46
  filePickerLabels?: FilePickerLabels;
47
+ formButtonLabels?: FormButtonLabels;
47
48
  ajvResolver: Resolver<FieldValues>;
48
49
  insideDialog?: boolean;
49
50
  }
@@ -4,7 +4,7 @@ import { JSONSchema7 } from 'json-schema';
4
4
  import { Dispatch, ReactNode, SetStateAction } from 'react';
5
5
  import { FieldValues, SubmitHandler, UseFormReturn } from 'react-hook-form';
6
6
  import { UseTranslationResponse } from 'react-i18next';
7
- import { CustomJSONSchema7, DateTimePickerLabels, IdPickerLabels, EnumPickerLabels, FilePickerLabels } from '../types/CustomJSONSchema7';
7
+ import { CustomJSONSchema7, DateTimePickerLabels, IdPickerLabels, EnumPickerLabels, FilePickerLabels, FormButtonLabels } from '../types/CustomJSONSchema7';
8
8
  export interface FormRootProps<TData extends FieldValues> {
9
9
  schema: CustomJSONSchema7;
10
10
  serverUrl: string;
@@ -33,13 +33,13 @@ export interface FormRootProps<TData extends FieldValues> {
33
33
  idPickerLabels?: IdPickerLabels;
34
34
  enumPickerLabels?: EnumPickerLabels;
35
35
  filePickerLabels?: FilePickerLabels;
36
+ formButtonLabels?: FormButtonLabels;
36
37
  insideDialog?: boolean;
37
38
  }
38
39
  export interface CustomJSONSchema7Definition extends JSONSchema7 {
39
40
  variant: string;
40
41
  in_table: string;
41
42
  column_ref: string;
42
- display_column: string;
43
43
  gridColumn: string;
44
44
  gridRow: string;
45
45
  foreign_key: ForeignKeyProps;
@@ -48,6 +48,5 @@ export interface CustomJSONSchema7Definition extends JSONSchema7 {
48
48
  export declare const idPickerSanityCheck: (column: string, foreign_key?: {
49
49
  table?: string | undefined;
50
50
  column?: string | undefined;
51
- display_column?: string | undefined;
52
51
  } | undefined) => void;
53
- export declare const FormRoot: <TData extends FieldValues>({ schema, idMap, setIdMap, form, serverUrl, translate, children, order, ignore, include, onSubmit, rowNumber, requestOptions, getUpdatedData, customErrorRenderer, customSuccessRenderer, displayConfig, requireConfirmation, dateTimePickerLabels, idPickerLabels, enumPickerLabels, filePickerLabels, insideDialog, }: FormRootProps<TData>) => import("react/jsx-runtime").JSX.Element;
52
+ export declare const FormRoot: <TData extends FieldValues>({ schema, idMap, setIdMap, form, serverUrl, translate, children, order, ignore, include, onSubmit, rowNumber, requestOptions, getUpdatedData, customErrorRenderer, customSuccessRenderer, displayConfig, requireConfirmation, dateTimePickerLabels, idPickerLabels, enumPickerLabels, filePickerLabels, formButtonLabels, insideDialog, }: FormRootProps<TData>) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
1
+ import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
2
2
  export interface ArrayRendererProps {
3
3
  column: string;
4
4
  schema: CustomJSONSchema7;
@@ -24,7 +24,6 @@ export type CustomQueryFn = (params: CustomQueryFnParams) => Promise<CustomQuery
24
24
  export interface ForeignKeyProps {
25
25
  column: string;
26
26
  table: string;
27
- display_column: string;
28
27
  customQueryFn?: CustomQueryFn;
29
28
  }
30
29
  export declare const StringInputField: ({ column, schema, prefix, }: StringInputFieldProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,9 +4,4 @@ export interface TextAreaInputProps {
4
4
  schema: CustomJSONSchema7;
5
5
  prefix: string;
6
6
  }
7
- export interface ForeignKeyProps {
8
- column: string;
9
- table: string;
10
- display_column: string;
11
- }
12
7
  export declare const TextAreaInput: ({ column, schema, prefix, }: TextAreaInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -44,6 +44,13 @@ export interface FilePickerLabels {
44
44
  uploading?: string;
45
45
  uploadFailed?: string;
46
46
  }
47
+ export interface FormButtonLabels {
48
+ submit?: string;
49
+ reset?: string;
50
+ cancel?: string;
51
+ confirm?: string;
52
+ submitAgain?: string;
53
+ }
47
54
  export interface CustomJSONSchema7 extends JSONSchema7 {
48
55
  gridColumn?: string;
49
56
  gridRow?: string;
@@ -72,6 +79,7 @@ export interface CustomJSONSchema7 extends JSONSchema7 {
72
79
  errorMessages?: Partial<Record<ValidationErrorType | string, string>>;
73
80
  filePicker?: FilePickerProps;
74
81
  }
82
+ export declare const defaultRenderDisplay: (item: unknown) => ReactNode;
75
83
  export interface TagPickerProps {
76
84
  column: string;
77
85
  schema: CustomJSONSchema7;
@@ -1,4 +1,4 @@
1
- import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
1
+ import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
2
2
  export interface ArrayViewerProps {
3
3
  column: string;
4
4
  schema: CustomJSONSchema7;
@@ -1,4 +1,4 @@
1
- import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
1
+ import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
2
2
  export interface BooleanViewerProps {
3
3
  column: string;
4
4
  schema: CustomJSONSchema7;
@@ -1,4 +1,4 @@
1
- import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
1
+ import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
2
2
  export interface DateViewerProps {
3
3
  column: string;
4
4
  schema: CustomJSONSchema7;
@@ -1,4 +1,4 @@
1
- import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
1
+ import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
2
2
  export interface DateViewerProps {
3
3
  column: string;
4
4
  schema: CustomJSONSchema7;
@@ -1,4 +1,4 @@
1
- import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
1
+ import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
2
2
  export interface IdViewerProps {
3
3
  column: string;
4
4
  schema: CustomJSONSchema7;
@@ -1,4 +1,4 @@
1
- import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
1
+ import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
2
2
  export interface ObjectViewerProps {
3
3
  schema: CustomJSONSchema7;
4
4
  column: string;
@@ -1,7 +1,7 @@
1
- import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
1
+ import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
2
2
  export interface DatePickerProps {
3
3
  schema: CustomJSONSchema7;
4
4
  column: string;
5
5
  prefix: string;
6
6
  }
7
- export declare const RecordInput: ({ column, schema, prefix }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const RecordViewer: ({ column, schema, prefix }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,7 @@
1
- import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
1
+ import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
2
2
  export interface StringInputFieldProps {
3
3
  column: string;
4
4
  schema: CustomJSONSchema7;
5
5
  prefix: string;
6
6
  }
7
- export interface ForeignKeyProps {
8
- column: string;
9
- table: string;
10
- display_column: string;
11
- }
12
7
  export declare const StringViewer: ({ column, schema, prefix, }: StringInputFieldProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,7 @@
1
- import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
1
+ import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
2
2
  export interface TextAreaViewerProps {
3
3
  column: string;
4
4
  schema: CustomJSONSchema7;
5
5
  prefix: string;
6
6
  }
7
- export interface ForeignKeyProps {
8
- column: string;
9
- table: string;
10
- display_column: string;
11
- }
12
7
  export declare const TextAreaViewer: ({ column, schema, prefix, }: TextAreaViewerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { CustomJSONSchema7 } from "../types/CustomJSONSchema7";
1
+ import { CustomJSONSchema7 } from '../types/CustomJSONSchema7';
2
2
  export interface TimeViewerProps {
3
3
  column: string;
4
4
  schema: CustomJSONSchema7;
@@ -23,14 +23,16 @@
23
23
  * const colLabel = formI18n.colLabel;
24
24
  * ```
25
25
  */
26
- export declare const useFormI18n: (column: string, prefix?: string) => {
26
+ export declare const useFormI18n: (column: string, prefix?: string, schema?: {
27
+ title?: string;
28
+ }) => {
27
29
  /**
28
30
  * The constructed column label (prefix + column)
29
31
  */
30
32
  colLabel: string;
31
33
  /**
32
- * Get the field label translation
33
- * Equivalent to: translate.t(removeIndex(`${colLabel}.field_label`))
34
+ * Get the field label from schema title prop, or fall back to translation
35
+ * Uses schema.title if available, otherwise: translate.t(removeIndex(`${colLabel}.field_label`))
34
36
  */
35
37
  label: (options?: any) => string;
36
38
  /**
@@ -18,6 +18,7 @@ interface TimePickerProps {
18
18
  timezone?: string;
19
19
  startTime?: string;
20
20
  selectedDate?: string;
21
+ portalled?: boolean;
21
22
  }
22
- export declare function TimePicker({ hour, setHour, minute, setMinute, meridiem, setMeridiem, meridiemLabel: _meridiemLabel, onChange, timezone, startTime, selectedDate, }: TimePickerProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function TimePicker({ hour, setHour, minute, setMinute, meridiem, setMeridiem, meridiemLabel: _meridiemLabel, onChange, timezone, startTime, selectedDate, portalled, }: TimePickerProps): import("react/jsx-runtime").JSX.Element;
23
24
  export {};
@@ -1,11 +1,14 @@
1
- import type { ButtonProps, TextProps } from "@chakra-ui/react";
2
- import { Pagination as ChakraPagination } from "@chakra-ui/react";
3
- import * as React from "react";
4
- type PaginationVariant = "outline" | "solid" | "subtle";
5
- export interface PaginationRootProps extends Omit<ChakraPagination.RootProps, "type"> {
6
- size?: ButtonProps["size"];
1
+ import type { ButtonProps, TextProps } from '@chakra-ui/react';
2
+ import { Pagination as ChakraPagination } from '@chakra-ui/react';
3
+ import * as React from 'react';
4
+ type PaginationVariant = 'outline' | 'solid' | 'subtle';
5
+ export interface PaginationRootProps extends Omit<ChakraPagination.RootProps, 'type'> {
6
+ size?: ButtonProps['size'];
7
7
  variant?: PaginationVariant;
8
8
  getHref?: (page: number) => string;
9
+ siblingCount?: number;
10
+ minSiblingCount?: number;
11
+ maxSiblingCount?: number;
9
12
  }
10
13
  export declare const PaginationRoot: React.ForwardRefExoticComponent<PaginationRootProps & React.RefAttributes<HTMLDivElement>>;
11
14
  export declare const PaginationEllipsis: React.ForwardRefExoticComponent<ChakraPagination.EllipsisProps & React.RefAttributes<HTMLDivElement>>;
@@ -14,7 +17,7 @@ export declare const PaginationPrevTrigger: React.ForwardRefExoticComponent<Chak
14
17
  export declare const PaginationNextTrigger: React.ForwardRefExoticComponent<ChakraPagination.NextTriggerProps & React.RefAttributes<HTMLButtonElement>>;
15
18
  export declare const PaginationItems: (props: React.HTMLAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
16
19
  interface PageTextProps extends TextProps {
17
- format?: "short" | "compact" | "long";
20
+ format?: 'short' | 'compact' | 'long';
18
21
  }
19
22
  export declare const PaginationPageText: React.ForwardRefExoticComponent<PageTextProps & React.RefAttributes<HTMLParagraphElement>>;
20
23
  export {};
@@ -126,6 +126,7 @@ export * from './components/DatePicker/DatePicker';
126
126
  export * from './components/DatePicker/getMultiDates';
127
127
  export * from './components/DatePicker/getRangeDates';
128
128
  export * from './components/DatePicker/RangeDatePicker';
129
+ export * from './components/DatePicker/DatePickerInput';
129
130
  export * from './components/DataTable/display/RecordDisplay';
130
131
  export * from './components/DataTable/display/TableDataDisplay';
131
132
  export * from './components/DataTable/DefaultTable';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsol-oss/react-datatable5",
3
- "version": "12.0.0-beta.90",
3
+ "version": "12.0.0-beta.92",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -53,13 +53,14 @@
53
53
  "react": "^19.0.0",
54
54
  "react-dom": "^19.0.0",
55
55
  "react-hook-form": "^7.54.2",
56
- "react-i18next": "^15.4.1",
56
+ "react-i18next": "^16.3.5",
57
57
  "react-icons": "^5.4.0",
58
58
  "tiny-invariant": "^1.3.3"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@rollup/plugin-alias": "^5.1.1",
62
62
  "@rollup/plugin-typescript": "^11.1.6",
63
+ "@storybook/addon-docs": "^10.0.7",
63
64
  "@storybook/addon-onboarding": "^10.0.7",
64
65
  "@storybook/react-vite": "^10.0.7",
65
66
  "@types/ajv-errors": "^2.0.0",
@@ -83,8 +84,7 @@
83
84
  "rollup-plugin-dts": "^6.1.0",
84
85
  "storybook": "^10.0.7",
85
86
  "typescript": "^5.2.2",
86
- "vite": "^5.2.0",
87
- "@storybook/addon-docs": "^10.0.7"
87
+ "vite": "^5.2.0"
88
88
  },
89
89
  "lint-staged": {
90
90
  "*.{ts,js,json,md,tsx}": [