@economic/taco 2.71.0-table3-changes.0 → 2.71.0-type-check.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/dist/taco.d.ts CHANGED
@@ -671,7 +671,7 @@ export declare function createShortcutKeyDownHandler<T = Element>(key: string |
671
671
 
672
672
  export declare type CurveType = 'natural' | 'linear' | 'step';
673
673
 
674
- export declare const Datepicker: React_2.ForwardRefExoticComponent<Omit<InputProps, "value"> & {
674
+ export declare const Datepicker: React_2.ForwardRefExoticComponent<Omit<InputProps, "onChange" | "value"> & {
675
675
  /** [Calendar](component:calendar) component associated with the DatePicker */
676
676
  calendar?: CalendarProps;
677
677
  /** List of shortcuts */
@@ -685,9 +685,12 @@ export declare const Datepicker: React_2.ForwardRefExoticComponent<Omit<InputPro
685
685
  * This will be displayed in DatePicker's input in the format given to the [Provider](component:provider) component
686
686
  */
687
687
  value?: Date | string;
688
+ onChange: (event: React_2.ChangeEvent<HTMLInputElement> & {
689
+ detail?: Date;
690
+ }) => void;
688
691
  } & React_2.RefAttributes<HTMLInputElement>>;
689
692
 
690
- export declare type DatepickerProps = Omit<InputProps, 'value'> & {
693
+ export declare type DatepickerProps = Omit<InputProps, 'value' | 'onChange'> & {
691
694
  /** [Calendar](component:calendar) component associated with the DatePicker */
692
695
  calendar?: CalendarProps;
693
696
  /** List of shortcuts */
@@ -701,6 +704,9 @@ export declare type DatepickerProps = Omit<InputProps, 'value'> & {
701
704
  * This will be displayed in DatePicker's input in the format given to the [Provider](component:provider) component
702
705
  */
703
706
  value?: Date | string;
707
+ onChange: (event: React_2.ChangeEvent<HTMLInputElement> & {
708
+ detail?: Date;
709
+ }) => void;
704
710
  };
705
711
 
706
712
  export declare type DatePickerShortcut = {
@@ -2237,10 +2243,10 @@ declare type MenuButtonProps = {
2237
2243
  onClick: () => void;
2238
2244
  };
2239
2245
 
2240
- export declare type MenuCheckboxItemProps = Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onSelect'> & {
2246
+ export declare type MenuCheckboxItemProps = Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onSelect' | 'onChange'> & {
2241
2247
  disabled?: boolean;
2242
2248
  checked: boolean;
2243
- onChange: (checked: boolean | 'indeterminate') => void;
2249
+ onChange: (checked: boolean) => void;
2244
2250
  };
2245
2251
 
2246
2252
  export declare type MenuContentProps = Omit<DropdownMenuPrimitive.DropdownMenuContentProps, 'children' | 'side'> & {
@@ -2289,7 +2295,7 @@ declare type MenuRadioGroupItemProps<T = HTMLDivElement> = Omit<React_2.HTMLAttr
2289
2295
  value: RadioGroupItemValue;
2290
2296
  };
2291
2297
 
2292
- declare type MenuRadioGroupProps = React_2.HTMLAttributes<HTMLDivElement> & {
2298
+ declare type MenuRadioGroupProps = Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onChange'> & {
2293
2299
  disabled?: boolean;
2294
2300
  /** Handler called when the value changes */
2295
2301
  onChange: (value: RadioGroupItemValue) => void;
@@ -3040,7 +3046,6 @@ export declare interface Table3CommonProps<TType = unknown> extends Table3Featur
3040
3046
  onEditingChange?: Table3EditingChangeHandler<TType>;
3041
3047
  onEditingCreate?: Table3EditingCreateHandler<TType>;
3042
3048
  onEditingDiscard?: Table3EditingDiscardHandler;
3043
- onHasChanges?: Table3HasChangesHandler;
3044
3049
  validator?: Table3EditingValidatorFn<TType>;
3045
3050
  showEditingActions?: boolean;
3046
3051
  }
@@ -3063,8 +3068,6 @@ export declare interface Table3FeatureProps<TType = unknown> extends TableFeatur
3063
3068
 
3064
3069
  export declare type Table3GroupProps = TableGroupProps;
3065
3070
 
3066
- declare type Table3HasChangesHandler = (hasChanges: boolean) => void;
3067
-
3068
3071
  export declare type Table3Props<TType = unknown> = Table3WithoutEditingWithClientProps<TType> | Table3WithoutEditingWithServerProps<TType> | Table3WithEditingWithClientProps<TType> | Table3WithEditingWithServerProps<TType>;
3069
3072
 
3070
3073
  export declare type Table3Ref = TableRef & {
@@ -3075,7 +3078,6 @@ export declare type Table3Ref = TableRef & {
3075
3078
  save: (rowId?: string) => Promise<boolean>;
3076
3079
  removeRowChanges: (rowId: string) => Promise<void>;
3077
3080
  forceValidate?: () => Promise<string[]>;
3078
- hasChanges: () => boolean;
3079
3081
  };
3080
3082
  };
3081
3083
  };
@@ -3663,7 +3665,7 @@ export declare type TabListProps = React_2.HTMLAttributes<HTMLDivElement>;
3663
3665
 
3664
3666
  export declare const Tabs: ForwardedTabsWithStatics;
3665
3667
 
3666
- export declare type TabsProps = React_2.HTMLAttributes<HTMLDivElement> & {
3668
+ export declare type TabsProps = Omit<React_2.HTMLAttributes<HTMLDivElement>, 'onChange'> & {
3667
3669
  /**
3668
3670
  * The controlled value of the tab to activate. Should be used in conjunction with `onChange`.
3669
3671
  */
package/dist/taco.js CHANGED
@@ -36794,16 +36794,7 @@ const RadioGroup$1 = React.forwardRef(function MenuRadioItem(props, ref) {
36794
36794
  }, [props.children]);
36795
36795
  const handleChange = (value2) => props.onChange(getRadioItemByValue(values, value2));
36796
36796
  const value = String(props.value ?? "");
36797
- return /* @__PURE__ */ React.createElement(MenuRadioGroupContext.Provider, { value: { disabled: props.disabled } }, /* @__PURE__ */ React.createElement(
36798
- $d08ef79370b62062$export$a98f0dcb43a68a25,
36799
- {
36800
- ...props,
36801
- className: "flex flex-col",
36802
- onValueChange: handleChange,
36803
- ref,
36804
- value
36805
- }
36806
- ));
36797
+ return /* @__PURE__ */ React.createElement(MenuRadioGroupContext.Provider, { value: { disabled: props.disabled } }, /* @__PURE__ */ React.createElement($d08ef79370b62062$export$a98f0dcb43a68a25, { className: "flex flex-col", onValueChange: handleChange, ref, value }, props.children));
36807
36798
  });
36808
36799
  RadioGroup$1.Item = RadioItem;
36809
36800
  const Separator = React.forwardRef(function Separator2(props, ref) {
@@ -63299,8 +63290,7 @@ function useTable3(props, ref) {
63299
63290
  instance.editing = {
63300
63291
  toggleEditing,
63301
63292
  removeRowChanges: (rowId) => table.meta.editing.discardChanges(rowId, table.instance),
63302
- save: (rowId) => table.meta.editing.saveChanges(table.instance, rowId),
63303
- hasChanges: () => table.meta.editing.hasChanges() || table.meta.editing.temporaryRows.length > 0
63293
+ save: (rowId) => table.meta.editing.saveChanges(table.instance, rowId)
63304
63294
  };
63305
63295
  if (props.onEditingCreate && instance.editing) {
63306
63296
  instance.editing.createRow = (row) => table.meta.editing.createRow(table.instance, row);
@@ -63316,16 +63306,6 @@ function useTable3(props, ref) {
63316
63306
  }
63317
63307
  }
63318
63308
  }, [table.meta.editing.forceValidate]);
63319
- const hasChanges = editing.isEnabled && (editing.hasChanges() || editing.temporaryRows.length > 0);
63320
- React__default.useEffect(() => {
63321
- const instance = table.ref.current.instance;
63322
- if (instance.editing) {
63323
- instance.editing.hasChanges = () => hasChanges;
63324
- }
63325
- if (props.onHasChanges) {
63326
- props.onHasChanges(hasChanges);
63327
- }
63328
- }, [hasChanges, props.onHasChanges]);
63329
63309
  return table;
63330
63310
  }
63331
63311
  function Alert(props) {
@@ -63548,7 +63528,6 @@ const BaseTable3 = fixedForwardRef(function BaseTable32(props, ref) {
63548
63528
  const table3 = useTable3(props, ref);
63549
63529
  const gridAttributes = {
63550
63530
  "data-table-editing-mode": ((_a = table3.meta.editing) == null ? void 0 : _a.isEditing) ? ((_b = table3.meta.editing) == null ? void 0 : _b.isDetailedMode) ? "detailed" : "normal" : void 0,
63551
- "data-has-changes": table3.meta.editing.isEnabled && (table3.meta.editing.hasChanges() || table3.meta.editing.temporaryRows.length > 0) ? "true" : void 0,
63552
63531
  enableHorizontalArrowKeyNavigation: table3.meta.editing.isEditing
63553
63532
  };
63554
63533
  const rowsById = table3.instance.getCoreRowModel().rowsById;