@ioca/react 1.2.9 → 1.3.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.
@@ -117,19 +117,23 @@ interface BaseInput extends TValidate {
117
117
  }
118
118
  type TPosition = "top" | "right" | "left" | "bottom";
119
119
 
120
+ type TRenderCheckboxItem = (checked: boolean, value: any) => ReactNode;
120
121
  interface ICheckbox extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange">, TValidate {
121
122
  label?: ReactNode;
122
123
  options: TOption[] | (string | number)[];
123
124
  type?: "default" | "switch" | "button";
124
125
  optionInline?: boolean;
125
126
  labelInline?: boolean;
127
+ renderItem?: TRenderCheckboxItem;
126
128
  onChange?: (value: any[], option: TOption, e: ChangeEvent<HTMLInputElement>) => void;
127
129
  }
128
- interface ICheckboxItem extends Omit<InputHTMLAttributes<HTMLElement>, "value" | "onChange">, TValidate {
130
+ interface ICheckboxItem extends Omit<InputHTMLAttributes<HTMLElement>, "value" | "children" | "onChange">, TValidate {
129
131
  type?: "default" | "switch" | "button";
130
132
  label?: ReactNode;
131
133
  value?: boolean;
134
+ optionValue?: any;
132
135
  partof?: boolean;
136
+ children?: ReactNode | TRenderCheckboxItem;
133
137
  onChange?: (value: boolean, e: ChangeEvent<HTMLInputElement>) => void;
134
138
  }
135
139
 
@@ -344,7 +348,7 @@ type TRule = {
344
348
  validator: TValidator;
345
349
  message?: string;
346
350
  };
347
- interface IForm extends HTMLAttributes<HTMLFormElement> {
351
+ interface IForm extends Omit<HTMLAttributes<HTMLFormElement>, "onChange"> {
348
352
  form?: IFormInstance;
349
353
  rules?: {
350
354
  [key: string]: boolean | TValidator | TRule;
@@ -353,7 +357,11 @@ interface IForm extends HTMLAttributes<HTMLFormElement> {
353
357
  initialValues?: Record<string, any>;
354
358
  width?: string | number;
355
359
  gap?: string | number;
360
+ labelWidth?: string;
361
+ labelInline?: boolean;
362
+ labelRight?: boolean;
356
363
  onEnter?: (values: Record<string, any>, form: IFormInstance) => void;
364
+ onChange?: (name: any, value: any) => void;
357
365
  }
358
366
  interface IField {
359
367
  name?: string;
@@ -631,8 +639,10 @@ interface IProgress extends Omit<BaseInput, "value" | "hideClear" | "onChange">
631
639
 
632
640
  declare const Progress: (props: IProgress) => react_jsx_runtime.JSX.Element;
633
641
 
634
- interface IRadioItem extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
642
+ type TRenderRadioItem = (checked: boolean, value: any) => ReactNode;
643
+ interface IRadioItem extends Omit<InputHTMLAttributes<HTMLInputElement>, "children" | "onChange"> {
635
644
  type?: "default" | "button";
645
+ children?: ReactNode | TRenderRadioItem;
636
646
  onChange?: (value: any, e: ChangeEvent) => void;
637
647
  }
638
648
  interface IRadio extends IRadioItem {
@@ -642,6 +652,7 @@ interface IRadio extends IRadioItem {
642
652
  labelInline?: boolean;
643
653
  status?: TStatus;
644
654
  message?: string;
655
+ renderItem?: TRenderRadioItem;
645
656
  }
646
657
 
647
658
  declare function RadioItem(props: IRadioItem): react_jsx_runtime.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ioca/react",
3
- "version": "1.2.9",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",