@oliasoft-open-source/react-ui-library 4.13.1 → 4.13.2

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
@@ -134,7 +134,7 @@ export declare interface IAccordionWithDefaultToggleProps {
134
134
  toggleLabel: string;
135
135
  expanded?: boolean;
136
136
  defaultEnabled?: boolean;
137
- onClickDefaultToggle?: (evt: ChangeEvent<HTMLInputElement>) => void;
137
+ onClickDefaultToggle?: TCheckBoxClickHandler;
138
138
  padding?: boolean;
139
139
  children?: ReactNode;
140
140
  }
@@ -241,17 +241,25 @@ declare interface ICheckBoxCell extends TCommonCell {
241
241
  label?: string | null;
242
242
  checked: boolean;
243
243
  type: TCellType;
244
- onChange: TChangeEventHandler;
244
+ onChange: TCheckBoxClickHandler;
245
245
  disabled?: boolean;
246
246
  }
247
247
 
248
+ export declare interface ICheckBoxClickEvent {
249
+ target: {
250
+ name: string;
251
+ checked: boolean;
252
+ value: boolean;
253
+ };
254
+ }
255
+
248
256
  export declare interface ICheckBoxProps {
249
257
  checked?: boolean;
250
258
  isInTable?: boolean;
251
259
  label?: string | null;
252
260
  name?: string;
253
261
  noMargin?: boolean;
254
- onChange: TChangeEventHandler;
262
+ onChange: TCheckBoxClickHandler;
255
263
  tabIndex?: number;
256
264
  disabled?: boolean;
257
265
  small?: boolean;
@@ -1744,6 +1752,10 @@ export declare type TChangeEventHandler<T extends HTMLElement = HTMLInputElement
1744
1752
  [key: string]: any;
1745
1753
  }[]) => void;
1746
1754
 
1755
+ export declare type TCheckBoxClickHandler = (evt: default_2.MouseEvent<HTMLDivElement, MouseEvent> & {
1756
+ target: ICheckBoxClickEvent['target'];
1757
+ }) => void;
1758
+
1747
1759
  export declare type TColor = 'danger' | 'red' | 'white' | 'success' | 'green' | 'muted';
1748
1760
 
1749
1761
  declare interface TCommonCell {
package/dist/index.js CHANGED
@@ -3888,9 +3888,14 @@ const CheckBox = ({
3888
3888
  if (!isDisabled) {
3889
3889
  const target = evt.target;
3890
3890
  target.name = name2;
3891
- target.value = !checked;
3892
3891
  target.checked = !checked;
3893
- onChange(evt);
3892
+ onChange({
3893
+ ...evt,
3894
+ target: {
3895
+ ...target,
3896
+ value: target.checked
3897
+ }
3898
+ });
3894
3899
  }
3895
3900
  },
3896
3901
  "data-testid": testId,