@bsol-oss/react-datatable5 13.0.1-beta.36 → 13.0.1-beta.37

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/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import { UseQueryResult } from '@tanstack/react-query';
9
9
  import { RankingInfo } from '@tanstack/match-sorter-utils';
10
10
  import { JSONSchema7 } from 'json-schema';
11
11
  import * as react_hook_form from 'react-hook-form';
12
- import { UseFormReturn, FieldValues, SubmitHandler } from 'react-hook-form';
12
+ import { UseFormReturn, FieldValues } from 'react-hook-form';
13
13
  import dayjs from 'dayjs';
14
14
 
15
15
  interface TableHeaderTexts {
@@ -700,7 +700,6 @@ interface FormRootProps<TData extends FieldValues> {
700
700
  setIdMap: Dispatch<SetStateAction<Record<string, unknown>>>;
701
701
  form: UseFormReturn<TData, any, TData>;
702
702
  children: ReactNode;
703
- onSubmit?: SubmitHandler<TData>;
704
703
  displayConfig?: {
705
704
  showSubmitButton?: boolean;
706
705
  showResetButton?: boolean;
@@ -721,7 +720,7 @@ interface CustomJSONSchema7Definition extends JSONSchema7 {
721
720
  customQueryFn: any;
722
721
  children: ReactNode;
723
722
  }
724
- declare const FormRoot: <TData extends FieldValues>({ schema, idMap, setIdMap, form, children, onSubmit, displayConfig, dateTimePickerLabels, idPickerLabels, enumPickerLabels, filePickerLabels, formButtonLabels, timePickerLabels, insideDialog, }: FormRootProps<TData>) => react_jsx_runtime.JSX.Element;
723
+ declare const FormRoot: <TData extends FieldValues>({ schema, idMap, setIdMap, form, children, displayConfig, dateTimePickerLabels, idPickerLabels, enumPickerLabels, filePickerLabels, formButtonLabels, timePickerLabels, insideDialog, }: FormRootProps<TData>) => react_jsx_runtime.JSX.Element;
725
724
 
726
725
  interface DefaultFormProps<TData extends FieldValues> {
727
726
  formConfig: Omit<FormRootProps<TData>, "children">;
package/dist/index.js CHANGED
@@ -7087,34 +7087,6 @@ function DateTimePicker$1({ value, onChange, format = 'date-time', showSeconds =
7087
7087
  }
7088
7088
  };
7089
7089
  // Display text for buttons
7090
- React.useMemo(() => {
7091
- if (!selectedDate)
7092
- return labels?.selectDateLabel ?? 'Select date';
7093
- return dayjs(selectedDate).tz(tz).format('YYYY-MM-DD');
7094
- }, [selectedDate, tz, labels]);
7095
- React.useMemo(() => {
7096
- const selectTimeLabel = timePickerLabels?.selectTimeLabel ?? 'Select time';
7097
- if (hour === null || minute === null)
7098
- return selectTimeLabel;
7099
- if (is24Hour) {
7100
- // 24-hour format: never show meridiem, always use 24-hour format (0-23)
7101
- const hour24 = hour >= 0 && hour <= 23 ? hour : hour % 24;
7102
- const s = second ?? 0;
7103
- if (showSeconds) {
7104
- return `${hour24.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`;
7105
- }
7106
- return `${hour24.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
7107
- }
7108
- else {
7109
- // 12-hour format: always show meridiem (AM/PM)
7110
- const hour12 = hour >= 1 && hour <= 12 ? hour : hour % 12;
7111
- if (meridiem === null)
7112
- return selectTimeLabel;
7113
- const hourDisplay = hour12.toString();
7114
- const minuteDisplay = minute.toString().padStart(2, '0');
7115
- return `${hourDisplay}:${minuteDisplay} ${meridiem.toUpperCase()}`;
7116
- }
7117
- }, [hour, minute, second, meridiem, is24Hour, showSeconds, timePickerLabels]);
7118
7090
  const timezoneDisplayText = React.useMemo(() => {
7119
7091
  if (!showTimezoneSelector)
7120
7092
  return '';
@@ -7926,15 +7898,13 @@ const FormTitle = () => {
7926
7898
  return jsxRuntime.jsx(react.Heading, { children: schema.title ?? 'Form' });
7927
7899
  };
7928
7900
 
7929
- const FormRoot = ({ schema, idMap, setIdMap, form, children, onSubmit = undefined, displayConfig = {
7930
- showSubmitButton: true,
7931
- showResetButton: true,
7901
+ const FormRoot = ({ schema, idMap, setIdMap, form, children, displayConfig = {
7902
+ showSubmitButton: false,
7903
+ showResetButton: false,
7932
7904
  showTitle: true,
7933
7905
  }, dateTimePickerLabels, idPickerLabels, enumPickerLabels, filePickerLabels, formButtonLabels, timePickerLabels, insideDialog = false, }) => {
7934
7906
  return (jsxRuntime.jsx(SchemaFormContext.Provider, { value: {
7935
7907
  schema,
7936
- // @ts-expect-error TODO: find appropriate types
7937
- onSubmit,
7938
7908
  idMap,
7939
7909
  setIdMap,
7940
7910
  displayConfig,
package/dist/index.mjs CHANGED
@@ -7067,34 +7067,6 @@ function DateTimePicker$1({ value, onChange, format = 'date-time', showSeconds =
7067
7067
  }
7068
7068
  };
7069
7069
  // Display text for buttons
7070
- useMemo(() => {
7071
- if (!selectedDate)
7072
- return labels?.selectDateLabel ?? 'Select date';
7073
- return dayjs(selectedDate).tz(tz).format('YYYY-MM-DD');
7074
- }, [selectedDate, tz, labels]);
7075
- useMemo(() => {
7076
- const selectTimeLabel = timePickerLabels?.selectTimeLabel ?? 'Select time';
7077
- if (hour === null || minute === null)
7078
- return selectTimeLabel;
7079
- if (is24Hour) {
7080
- // 24-hour format: never show meridiem, always use 24-hour format (0-23)
7081
- const hour24 = hour >= 0 && hour <= 23 ? hour : hour % 24;
7082
- const s = second ?? 0;
7083
- if (showSeconds) {
7084
- return `${hour24.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`;
7085
- }
7086
- return `${hour24.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
7087
- }
7088
- else {
7089
- // 12-hour format: always show meridiem (AM/PM)
7090
- const hour12 = hour >= 1 && hour <= 12 ? hour : hour % 12;
7091
- if (meridiem === null)
7092
- return selectTimeLabel;
7093
- const hourDisplay = hour12.toString();
7094
- const minuteDisplay = minute.toString().padStart(2, '0');
7095
- return `${hourDisplay}:${minuteDisplay} ${meridiem.toUpperCase()}`;
7096
- }
7097
- }, [hour, minute, second, meridiem, is24Hour, showSeconds, timePickerLabels]);
7098
7070
  const timezoneDisplayText = useMemo(() => {
7099
7071
  if (!showTimezoneSelector)
7100
7072
  return '';
@@ -7906,15 +7878,13 @@ const FormTitle = () => {
7906
7878
  return jsx(Heading, { children: schema.title ?? 'Form' });
7907
7879
  };
7908
7880
 
7909
- const FormRoot = ({ schema, idMap, setIdMap, form, children, onSubmit = undefined, displayConfig = {
7910
- showSubmitButton: true,
7911
- showResetButton: true,
7881
+ const FormRoot = ({ schema, idMap, setIdMap, form, children, displayConfig = {
7882
+ showSubmitButton: false,
7883
+ showResetButton: false,
7912
7884
  showTitle: true,
7913
7885
  }, dateTimePickerLabels, idPickerLabels, enumPickerLabels, filePickerLabels, formButtonLabels, timePickerLabels, insideDialog = false, }) => {
7914
7886
  return (jsx(SchemaFormContext.Provider, { value: {
7915
7887
  schema,
7916
- // @ts-expect-error TODO: find appropriate types
7917
- onSubmit,
7918
7888
  idMap,
7919
7889
  setIdMap,
7920
7890
  displayConfig,
@@ -1,6 +1,6 @@
1
1
  import { JSONSchema7 } from 'json-schema';
2
2
  import { Dispatch, ReactNode, SetStateAction } from 'react';
3
- import { FieldValues, SubmitHandler, UseFormReturn } from 'react-hook-form';
3
+ import { FieldValues, UseFormReturn } from 'react-hook-form';
4
4
  import { CustomJSONSchema7, DateTimePickerLabels, EnumPickerLabels, FilePickerLabels, FormButtonLabels, IdPickerLabels, TimePickerLabels } from '../types/CustomJSONSchema7';
5
5
  export interface FormRootProps<TData extends FieldValues> {
6
6
  /**
@@ -33,7 +33,6 @@ export interface FormRootProps<TData extends FieldValues> {
33
33
  setIdMap: Dispatch<SetStateAction<Record<string, unknown>>>;
34
34
  form: UseFormReturn<TData, any, TData>;
35
35
  children: ReactNode;
36
- onSubmit?: SubmitHandler<TData>;
37
36
  displayConfig?: {
38
37
  showSubmitButton?: boolean;
39
38
  showResetButton?: boolean;
@@ -54,4 +53,4 @@ export interface CustomJSONSchema7Definition extends JSONSchema7 {
54
53
  customQueryFn: any;
55
54
  children: ReactNode;
56
55
  }
57
- export declare const FormRoot: <TData extends FieldValues>({ schema, idMap, setIdMap, form, children, onSubmit, displayConfig, dateTimePickerLabels, idPickerLabels, enumPickerLabels, filePickerLabels, formButtonLabels, timePickerLabels, insideDialog, }: FormRootProps<TData>) => import("react/jsx-runtime").JSX.Element;
56
+ export declare const FormRoot: <TData extends FieldValues>({ schema, idMap, setIdMap, form, children, displayConfig, dateTimePickerLabels, idPickerLabels, enumPickerLabels, filePickerLabels, formButtonLabels, timePickerLabels, insideDialog, }: FormRootProps<TData>) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsol-oss/react-datatable5",
3
- "version": "13.0.1-beta.36",
3
+ "version": "13.0.1-beta.37",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",