@ioca/react 1.1.9 → 1.2.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.
@@ -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
  }
@@ -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;
@@ -442,7 +454,6 @@ declare const Input: CompositionInput;
442
454
 
443
455
  declare const List: {
444
456
  (props: IList): react_jsx_runtime.JSX.Element;
445
- Virtual: (props: IVirtual) => react_jsx_runtime.JSX.Element;
446
457
  Item: (props: IListItem) => react_jsx_runtime.JSX.Element;
447
458
  };
448
459
 
@@ -496,12 +507,12 @@ interface IModal extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
496
507
  height?: string | number;
497
508
  customized?: boolean;
498
509
  fixed?: boolean;
499
- shadow?: boolean;
510
+ hideShadow?: boolean;
500
511
  okButtonProps?: IButton;
501
512
  cancelButtonProps?: IButton;
502
513
  footerLeft?: ReactNode;
503
514
  onVisibleChange?: (visible: boolean) => void;
504
- onOk?: () => void;
515
+ onOk?: () => void | Promise<any>;
505
516
  onClose?: () => void;
506
517
  }
507
518
  interface CompositionModal extends FC<IModal> {
@@ -876,13 +887,16 @@ declare const Tree: (props: ITree) => react_jsx_runtime.JSX.Element;
876
887
  interface IUpload extends Omit<BaseInput, "ref">, Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> {
877
888
  ref?: RefObject<RefUpload | null>;
878
889
  files?: IFile[];
890
+ initialFiles?: IFile[] | File[];
879
891
  accept?: string;
880
892
  multiple?: boolean;
881
893
  directory?: boolean;
882
894
  limit?: number;
895
+ sortable?: boolean;
883
896
  mode?: "default" | "card";
884
897
  droppable?: boolean;
885
898
  cardSize?: string;
899
+ defaultText?: ReactNode;
886
900
  shouldUpload?: (file: IFile) => boolean;
887
901
  uploader?: (file: IFile) => Promise<IFile>;
888
902
  renderItem?: (file: IFile, i: number) => ReactNode;
@@ -891,13 +905,14 @@ interface IUpload extends Omit<BaseInput, "ref">, Omit<InputHTMLAttributes<HTMLI
891
905
  onUpload?: (file: IFile) => void;
892
906
  }
893
907
  interface IFile extends File {
894
- uid?: string;
908
+ id: string;
895
909
  instance?: File;
896
910
  src?: string;
897
911
  [key: string]: any;
898
912
  }
899
913
  interface RefUpload {
900
914
  getFileList: () => IFile[];
915
+ setFileList: (files?: IFile[] | File[]) => void;
901
916
  }
902
917
 
903
918
  declare const Upload: (props: IUpload) => react_jsx_runtime.JSX.Element;
@@ -964,4 +979,4 @@ interface IPreview {
964
979
 
965
980
  declare function usePreview(): (config: IPreview) => void;
966
981
 
967
- 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.9",
3
+ "version": "1.2.1",
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",