@ioca/react 1.1.8 → 1.2.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.
@@ -1,8 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { HTMLAttributes, ReactNode, CSSProperties, ForwardRefExoticComponent, RefAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, RefObject, ChangeEvent, KeyboardEvent, InputHTMLAttributes, MouseEvent, JSX, FC, TextareaHTMLAttributes, Ref } from 'react';
3
+ import { HTMLAttributes, ReactNode, CSSProperties, ForwardRefExoticComponent, RefAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, RefObject, ChangeEvent, KeyboardEvent, InputHTMLAttributes, MouseEvent, FormEvent, JSX, FC, TextareaHTMLAttributes, Ref } from 'react';
4
4
  import { LinkProps } from 'react-router';
5
- import { ListProps } from 'rc-virtual-list';
6
5
  import { ColorPickerProps } from '@rc-component/color-picker';
7
6
  import { Dayjs } from 'dayjs';
8
7
 
@@ -69,6 +68,7 @@ interface IButtonToggle extends IButton {
69
68
  interface IButtonGroup {
70
69
  children?: ReactNode;
71
70
  vertical?: boolean;
71
+ buttonProps?: IButton;
72
72
  className?: string;
73
73
  style?: CSSProperties;
74
74
  }
@@ -79,7 +79,7 @@ interface CompositionButton extends ForwardRefExoticComponent<IButton & RefAttri
79
79
 
80
80
  declare const _default$3: CompositionButton;
81
81
 
82
- interface ICard {
82
+ interface ICard extends HTMLAttributes<HTMLDivElement> {
83
83
  hideShadow?: boolean;
84
84
  border?: boolean;
85
85
  style?: CSSProperties;
@@ -254,9 +254,6 @@ interface IListItem extends HTMLAttributes<HTMLLIElement>, Pick<IList, "type"> {
254
254
  disabled?: boolean;
255
255
  label?: ReactNode;
256
256
  }
257
- interface IVirtual extends Omit<ListProps<any>, "children"> {
258
- renderItem: (item: any, i: number) => ReactNode;
259
- }
260
257
 
261
258
  interface IPopup {
262
259
  visible?: boolean;
@@ -296,6 +293,21 @@ declare const Dropdown: {
296
293
  Item: (props: IDropItem) => react_jsx_runtime.JSX.Element;
297
294
  };
298
295
 
296
+ interface IEditor {
297
+ ref?: RefObject<RefEditor | null>;
298
+ placeholder?: string;
299
+ width?: string | number;
300
+ height?: string | number;
301
+ controls?: string[] | "simple" | "all";
302
+ onInput?: (html: string, e: FormEvent<HTMLDivElement>) => void;
303
+ }
304
+ interface RefEditor {
305
+ getSafeValue: () => string;
306
+ setValue: (html: string) => void;
307
+ }
308
+
309
+ declare const Editor: (props: IEditor) => react_jsx_runtime.JSX.Element;
310
+
299
311
  interface IFlex {
300
312
  as?: keyof JSX.IntrinsicElements;
301
313
  align?: string;
@@ -337,6 +349,7 @@ interface IForm extends HTMLAttributes<HTMLFormElement> {
337
349
  };
338
350
  initialValues?: Record<string, any>;
339
351
  width?: string | number;
352
+ gap?: string | number;
340
353
  onEnter?: (values: Record<string, any>, form: IFormInstance) => void;
341
354
  }
342
355
  interface IField {
@@ -441,7 +454,6 @@ declare const Input: CompositionInput;
441
454
 
442
455
  declare const List: {
443
456
  (props: IList): react_jsx_runtime.JSX.Element;
444
- Virtual: (props: IVirtual) => react_jsx_runtime.JSX.Element;
445
457
  Item: (props: IListItem) => react_jsx_runtime.JSX.Element;
446
458
  };
447
459
 
@@ -495,12 +507,12 @@ interface IModal extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
495
507
  height?: string | number;
496
508
  customized?: boolean;
497
509
  fixed?: boolean;
498
- shadow?: boolean;
510
+ hideShadow?: boolean;
499
511
  okButtonProps?: IButton;
500
512
  cancelButtonProps?: IButton;
501
513
  footerLeft?: ReactNode;
502
514
  onVisibleChange?: (visible: boolean) => void;
503
- onOk?: () => void;
515
+ onOk?: () => void | Promise<any>;
504
516
  onClose?: () => void;
505
517
  }
506
518
  interface CompositionModal extends FC<IModal> {
@@ -749,6 +761,7 @@ interface ITabs {
749
761
  bar?: boolean;
750
762
  barClass?: string;
751
763
  toggable?: boolean;
764
+ navsJustify?: "start" | "center" | "end";
752
765
  className?: string;
753
766
  children?: ReactNode;
754
767
  style?: CSSProperties;
@@ -773,6 +786,7 @@ interface ITag extends HTMLAttributes<HTMLSpanElement> {
773
786
  outline?: boolean;
774
787
  round?: boolean;
775
788
  size?: "small" | "normal" | "large" | "extreme";
789
+ hoverShowClose?: boolean;
776
790
  onClick?: (e: MouseEvent) => void;
777
791
  onClose?: (e: MouseEvent) => void;
778
792
  }
@@ -873,13 +887,16 @@ declare const Tree: (props: ITree) => react_jsx_runtime.JSX.Element;
873
887
  interface IUpload extends Omit<BaseInput, "ref">, Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> {
874
888
  ref?: RefObject<RefUpload | null>;
875
889
  files?: IFile[];
890
+ initialFiles?: IFile[] | File[];
876
891
  accept?: string;
877
892
  multiple?: boolean;
878
893
  directory?: boolean;
879
894
  limit?: number;
895
+ sortable?: boolean;
880
896
  mode?: "default" | "card";
881
897
  droppable?: boolean;
882
898
  cardSize?: string;
899
+ defaultText?: ReactNode;
883
900
  shouldUpload?: (file: IFile) => boolean;
884
901
  uploader?: (file: IFile) => Promise<IFile>;
885
902
  renderItem?: (file: IFile, i: number) => ReactNode;
@@ -888,13 +905,14 @@ interface IUpload extends Omit<BaseInput, "ref">, Omit<InputHTMLAttributes<HTMLI
888
905
  onUpload?: (file: IFile) => void;
889
906
  }
890
907
  interface IFile extends File {
891
- uid?: string;
908
+ id: string;
892
909
  instance?: File;
893
910
  src?: string;
894
911
  [key: string]: any;
895
912
  }
896
913
  interface RefUpload {
897
914
  getFileList: () => IFile[];
915
+ setFileList: (files?: IFile[] | File[]) => void;
898
916
  }
899
917
 
900
918
  declare const Upload: (props: IUpload) => react_jsx_runtime.JSX.Element;
@@ -961,4 +979,4 @@ interface IPreview {
961
979
 
962
980
  declare function usePreview(): (config: IPreview) => void;
963
981
 
964
- export { Affix, Badge, _default$3 as Button, Card, Checkbox, Collapse, ColorPicker, Datagrid, Datepicker as DatePicker, Description, Drawer, Dropdown, Flex, Form, Icon, _default$2 as Image, Input, List, Loading, message as Message, _default$1 as Modal, Pagination, Popconfirm, Popup, Progress, Radio, Resizable, Select, Step, Swiper, Tabs, Tag, _default as Text, TimePicker, Tree, Upload, Video, usePreview };
982
+ export { Affix, Badge, _default$3 as Button, Card, Checkbox, Collapse, ColorPicker, Datagrid, Datepicker as DatePicker, Description, Drawer, Dropdown, Editor, Flex, Form, Icon, _default$2 as Image, Input, List, Loading, message as Message, _default$1 as Modal, Pagination, Popconfirm, Popup, Progress, Radio, Resizable, Select, Step, Swiper, Tabs, Tag, _default as Text, TimePicker, Tree, Upload, Video, usePreview };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ioca/react",
3
- "version": "1.1.8",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -18,11 +18,12 @@
18
18
  "highlight-words-core": "^1.2.3",
19
19
  "pubsub-js": "^1.9.5",
20
20
  "radash": "^12.1.0",
21
- "rc-virtual-list": "^3.17.0",
22
21
  "react": "^19.0.0",
23
22
  "react-custom-scrollbars-2": "^4.5.0",
24
23
  "react-dom": "^19.0.0",
25
- "react-router": "^7.1.1"
24
+ "react-easy-sort": "^1.6.0",
25
+ "react-router": "^7.1.1",
26
+ "xss": "^1.0.15"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@rollup/plugin-node-resolve": "^15.3.0",