@ioca/react 1.1.4 → 1.1.5

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,9 +1,10 @@
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, ChangeEvent, KeyboardEvent, InputHTMLAttributes, MouseEvent, TextareaHTMLAttributes, FC, Ref } from 'react';
3
+ import { HTMLAttributes, ReactNode, CSSProperties, ForwardRefExoticComponent, RefAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, ChangeEvent, KeyboardEvent, InputHTMLAttributes, MouseEvent, FC, TextareaHTMLAttributes, Ref } from 'react';
4
4
  import { LinkProps } from 'react-router-dom';
5
- import { Dayjs } from 'dayjs';
6
5
  import { ListProps } from 'rc-virtual-list';
6
+ import { ColorPickerProps } from '@rc-component/color-picker';
7
+ import { Dayjs } from 'dayjs';
7
8
 
8
9
  interface IAffix extends HTMLAttributes<HTMLElement> {
9
10
  position?: "fixed" | "absolute" | "sticky" | "static";
@@ -206,93 +207,6 @@ interface IDatagrid {
206
207
 
207
208
  declare const Datagrid: (props: IDatagrid) => JSX.Element;
208
209
 
209
- declare const Number$2: react.ForwardRefExoticComponent<IInputNumber & react.RefAttributes<HTMLInputElement>>;
210
-
211
- declare const Range: (props: IInputRange) => react_jsx_runtime.JSX.Element;
212
-
213
- declare const Textarea: react.ForwardRefExoticComponent<ITextarea & react.RefAttributes<HTMLTextAreaElement>>;
214
-
215
- interface IInput extends BaseInput, Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange"> {
216
- prepend?: ReactNode;
217
- append?: ReactNode;
218
- hideVisible?: boolean;
219
- }
220
- interface ITextarea extends BaseInput, Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue" | "onChange"> {
221
- autoSize?: boolean;
222
- }
223
- interface IInputNumber extends BaseInput, Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "defaultValue"> {
224
- value?: string | number;
225
- prepend?: ReactNode;
226
- append?: ReactNode;
227
- step?: number;
228
- min?: number;
229
- max?: number;
230
- thousand?: string;
231
- precision?: number;
232
- hideControl?: boolean;
233
- }
234
- interface IInputRange extends Omit<BaseInput, "value" | "onChange">, Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "placeholder" | "onChange"> {
235
- value?: (number | string | undefined)[];
236
- placeholder?: string[];
237
- min?: number;
238
- max?: number;
239
- prepend?: ReactNode;
240
- append?: ReactNode;
241
- step?: number;
242
- thousand?: string;
243
- precision?: number;
244
- hideControl?: boolean;
245
- onChange?: (value: (number | string | undefined)[], e?: ChangeEvent<HTMLInputElement> | MouseEvent<Element>) => void;
246
- }
247
- type CompositionInput = ForwardRefExoticComponent<IInput & RefAttributes<HTMLInputElement>> & {
248
- Textarea: typeof Textarea;
249
- Number: typeof Number$2;
250
- Range: typeof Range;
251
- };
252
-
253
- interface IPopup {
254
- visible?: boolean;
255
- content?: ReactNode;
256
- trigger?: "hover" | "click" | "focus" | "none" | "contextmenu";
257
- gap?: number;
258
- offset?: number;
259
- fixed?: boolean;
260
- position?: TPosition;
261
- arrow?: boolean;
262
- align?: "start" | "center" | "end";
263
- showDelay?: number;
264
- hideDelay?: number;
265
- touchable?: boolean;
266
- fitSize?: boolean;
267
- watchResize?: boolean;
268
- clickOutside?: boolean;
269
- disabled?: boolean;
270
- referToWindow?: boolean;
271
- style?: CSSProperties;
272
- children?: ReactNode;
273
- className?: string;
274
- getContainer?: (trigger?: HTMLElement) => HTMLElement;
275
- onVisibleChange?: (visible: boolean) => void;
276
- }
277
-
278
- interface IDatePicker extends BaseInput, IInput, Omit<IBaseDates, "value"> {
279
- popupProps?: IPopup;
280
- }
281
- interface IBaseDates {
282
- value?: any;
283
- format?: string;
284
- weeks?: ReactNode[];
285
- unitYear?: ReactNode;
286
- unitMonth?: ReactNode;
287
- renderDate?: (date: Dayjs) => ReactNode;
288
- renderMonth?: (month: number) => ReactNode;
289
- renderYear?: (year: number) => ReactNode;
290
- onDateClick?: (date: Dayjs) => void;
291
- disabledDate?: (date: Dayjs) => boolean;
292
- }
293
-
294
- declare const Datepicker: (props: IDatePicker) => JSX.Element;
295
-
296
210
  type IData = {
297
211
  label: ReactNode;
298
212
  value: ReactNode;
@@ -344,6 +258,31 @@ interface IVirtual extends Omit<ListProps<any>, "children"> {
344
258
  renderItem: (item: any, i: number) => ReactNode;
345
259
  }
346
260
 
261
+ interface IPopup {
262
+ visible?: boolean;
263
+ content?: ReactNode;
264
+ trigger?: "hover" | "click" | "focus" | "none" | "contextmenu";
265
+ gap?: number;
266
+ offset?: number;
267
+ fixed?: boolean;
268
+ position?: TPosition;
269
+ arrow?: boolean;
270
+ align?: "start" | "center" | "end";
271
+ showDelay?: number;
272
+ hideDelay?: number;
273
+ touchable?: boolean;
274
+ fitSize?: boolean;
275
+ watchResize?: boolean;
276
+ clickOutside?: boolean;
277
+ disabled?: boolean;
278
+ referToWindow?: boolean;
279
+ style?: CSSProperties;
280
+ children?: ReactNode;
281
+ className?: string;
282
+ getContainer?: (trigger?: HTMLElement) => HTMLElement;
283
+ onVisibleChange?: (visible: boolean) => void;
284
+ }
285
+
347
286
  interface IDropdown extends IPopup {
348
287
  width?: string | number;
349
288
  }
@@ -452,6 +391,50 @@ interface CompositionImage extends FC<IImage> {
452
391
 
453
392
  declare const _default$2: CompositionImage;
454
393
 
394
+ declare const Number$2: react.ForwardRefExoticComponent<IInputNumber & react.RefAttributes<HTMLInputElement>>;
395
+
396
+ declare const Range: (props: IInputRange) => react_jsx_runtime.JSX.Element;
397
+
398
+ declare const Textarea: react.ForwardRefExoticComponent<ITextarea & react.RefAttributes<HTMLTextAreaElement>>;
399
+
400
+ interface IInput extends BaseInput, Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange"> {
401
+ prepend?: ReactNode;
402
+ append?: ReactNode;
403
+ hideVisible?: boolean;
404
+ }
405
+ interface ITextarea extends BaseInput, Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue" | "onChange"> {
406
+ autoSize?: boolean;
407
+ }
408
+ interface IInputNumber extends BaseInput, Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "defaultValue"> {
409
+ value?: string | number;
410
+ prepend?: ReactNode;
411
+ append?: ReactNode;
412
+ step?: number;
413
+ min?: number;
414
+ max?: number;
415
+ thousand?: string;
416
+ precision?: number;
417
+ hideControl?: boolean;
418
+ }
419
+ interface IInputRange extends Omit<BaseInput, "value" | "onChange">, Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "placeholder" | "onChange"> {
420
+ value?: (number | string | undefined)[];
421
+ placeholder?: string[];
422
+ min?: number;
423
+ max?: number;
424
+ prepend?: ReactNode;
425
+ append?: ReactNode;
426
+ step?: number;
427
+ thousand?: string;
428
+ precision?: number;
429
+ hideControl?: boolean;
430
+ onChange?: (value: (number | string | undefined)[], e?: ChangeEvent<HTMLInputElement> | MouseEvent<Element>) => void;
431
+ }
432
+ type CompositionInput = ForwardRefExoticComponent<IInput & RefAttributes<HTMLInputElement>> & {
433
+ Textarea: typeof Textarea;
434
+ Number: typeof Number$2;
435
+ Range: typeof Range;
436
+ };
437
+
455
438
  declare const Input: CompositionInput;
456
439
 
457
440
  declare const List: {
@@ -541,6 +524,45 @@ interface IPagination extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
541
524
 
542
525
  declare const Pagination: (props: IPagination) => JSX.Element;
543
526
 
527
+ interface IDatePicker extends BaseInput, IInput, Omit<IBaseDates, "value"> {
528
+ popupProps?: IPopup;
529
+ }
530
+ interface IBaseDates {
531
+ value?: any;
532
+ format?: string;
533
+ weeks?: ReactNode[];
534
+ unitYear?: ReactNode;
535
+ unitMonth?: ReactNode;
536
+ renderDate?: (date: Dayjs) => ReactNode;
537
+ renderMonth?: (month: number) => ReactNode;
538
+ renderYear?: (year: number) => ReactNode;
539
+ onDateClick?: (date: Dayjs) => void;
540
+ disabledDate?: (date: Dayjs) => boolean;
541
+ }
542
+ interface ITimePicker extends BaseInput, IInput {
543
+ value?: any;
544
+ format?: string;
545
+ periods?: string[];
546
+ renderItem?: (number: number, active: boolean, unit: "hour" | "minute" | "second") => ReactNode;
547
+ popupProps?: IPopup;
548
+ }
549
+ interface IColorPicker extends ColorPickerProps {
550
+ value?: any;
551
+ type?: "HEX" | "RGB" | "HSB";
552
+ children?: ReactNode;
553
+ popupProps?: IPopup;
554
+ usePanel?: boolean;
555
+ handle?: "text" | "square" | "both";
556
+ placeholder?: ReactNode;
557
+ onChange?: (value: any) => void;
558
+ }
559
+
560
+ declare function ColorPicker(props: IColorPicker): react_jsx_runtime.JSX.Element;
561
+
562
+ declare function Timepicker(props: ITimePicker): react_jsx_runtime.JSX.Element;
563
+
564
+ declare const Datepicker: (props: IDatePicker) => JSX.Element;
565
+
544
566
  interface IPopconfirm extends IPopup {
545
567
  icon?: ReactNode;
546
568
  okButtonProps?: IButton;
@@ -591,12 +613,31 @@ declare namespace Radio {
591
613
  var Item: typeof RadioItem;
592
614
  }
593
615
 
616
+ interface IResizable {
617
+ other?: ReactNode;
618
+ children?: ReactNode;
619
+ style?: CSSProperties;
620
+ className?: string;
621
+ asPercent?: boolean;
622
+ vertical?: boolean;
623
+ line?: ReactNode;
624
+ height?: string | number;
625
+ size?: string | number;
626
+ minSize?: string | number;
627
+ maxSize?: string | number;
628
+ onResize?: (size: string | number) => void;
629
+ onResizeComplete?: (size: string | number) => void;
630
+ }
631
+
632
+ declare const Resizable: (props: IResizable) => JSX.Element;
633
+
594
634
  interface ISelect extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onSelect" | "onChange">, BaseInput {
595
635
  options: TOptions;
596
636
  multiple?: boolean;
597
637
  prepend?: ReactNode;
598
638
  append?: ReactNode;
599
639
  hideClear?: boolean;
640
+ hideArrow?: boolean;
600
641
  max?: number;
601
642
  maxDisplay?: number;
602
643
  filter?: boolean | (() => boolean);
@@ -901,4 +942,4 @@ interface IPreview {
901
942
 
902
943
  declare function usePreview(): (config: IPreview) => void;
903
944
 
904
- export { Affix, Badge, Button, Card, Checkbox, Collapse, Datagrid, 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, Select, Step, Swiper, Tabs, Tag, _default as Text, Tree, Upload, Video, usePreview };
945
+ export { Affix, Badge, 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 as TimePicker, Tree, Upload, Video, usePreview };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ioca/react",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -10,12 +10,13 @@
10
10
  "lib": "rm -rf lib && npx rollup -c"
11
11
  },
12
12
  "dependencies": {
13
+ "@rc-component/color-picker": "^2.0.1",
13
14
  "@ricons/material": "^0.12.0",
14
- "radash": "^12.1.0",
15
- "classnames": "^2.5.1",
16
15
  "ahooks": "^3.8.1",
16
+ "classnames": "^2.5.1",
17
17
  "dayjs": "^1.11.13",
18
18
  "pubsub-js": "^1.9.5",
19
+ "radash": "^12.1.0",
19
20
  "rc-virtual-list": "^3.15.0",
20
21
  "react": "^18.3.1",
21
22
  "react-custom-scrollbars-2": "^4.5.0",
@@ -32,6 +33,8 @@
32
33
  "@types/react": "18.2.52",
33
34
  "@types/react-dom": "^18.3.1",
34
35
  "@vitejs/plugin-react": "^4.3.3",
36
+ "chalk": "^5.4.1",
37
+ "fs": "^0.0.1-security",
35
38
  "mockjs": "^1.1.0",
36
39
  "path": "^0.12.7",
37
40
  "react-syntax-highlighter": "^15.6.1",
@@ -55,6 +58,9 @@
55
58
  "types": "./lib/types/index.d.ts",
56
59
  "import": "./lib/index.js"
57
60
  },
61
+ "./types": {
62
+ "import": "./lib/types/index.d.ts"
63
+ },
58
64
  "./index.css": {
59
65
  "import": "./lib/css/index.css"
60
66
  }