@lite-code/aui-react 0.0.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.
Files changed (83) hide show
  1. package/README.md +76 -0
  2. package/dist/alert/index.d.ts +14 -0
  3. package/dist/avatar/index.d.ts +28 -0
  4. package/dist/badge/index.d.ts +18 -0
  5. package/dist/breadcrumb/index.d.ts +18 -0
  6. package/dist/button/index.d.ts +11 -0
  7. package/dist/card/index.d.ts +25 -0
  8. package/dist/carousel/index.d.ts +17 -0
  9. package/dist/cascader/index.d.ts +25 -0
  10. package/dist/checkbox/index.d.ts +33 -0
  11. package/dist/collapse/index.d.ts +19 -0
  12. package/dist/datepicker/index.d.ts +26 -0
  13. package/dist/descriptions/index.d.ts +25 -0
  14. package/dist/drawer/index.d.ts +16 -0
  15. package/dist/dropdown/index.d.ts +29 -0
  16. package/dist/empty/index.d.ts +11 -0
  17. package/dist/form/context.d.ts +3 -0
  18. package/dist/form/index.d.ts +39 -0
  19. package/dist/form/item.d.ts +87 -0
  20. package/dist/form/list.d.ts +8 -0
  21. package/dist/form/store.d.ts +49 -0
  22. package/dist/form/types.d.ts +47 -0
  23. package/dist/grid/index.d.ts +35 -0
  24. package/dist/icon/index.d.ts +9 -0
  25. package/dist/image-compressor/engine.d.ts +55 -0
  26. package/dist/image-compressor/index.d.ts +5 -0
  27. package/dist/image-compressor/types.d.ts +44 -0
  28. package/dist/image-compressor/use-image-compressor.d.ts +21 -0
  29. package/dist/index.cjs.js +2 -0
  30. package/dist/index.cjs.js.map +1 -0
  31. package/dist/index.d.ts +93 -0
  32. package/dist/index.esm.js +2 -0
  33. package/dist/index.esm.js.map +1 -0
  34. package/dist/input/index.d.ts +12 -0
  35. package/dist/input-number/index.d.ts +23 -0
  36. package/dist/layer/index.d.ts +18 -0
  37. package/dist/menu/index.d.ts +24 -0
  38. package/dist/message/index.d.ts +18 -0
  39. package/dist/modal/index.d.ts +42 -0
  40. package/dist/pagination/index.d.ts +19 -0
  41. package/dist/popover/index.d.ts +18 -0
  42. package/dist/popover/util.d.ts +28 -0
  43. package/dist/progress/index.d.ts +17 -0
  44. package/dist/radio/index.d.ts +32 -0
  45. package/dist/rate/index.d.ts +20 -0
  46. package/dist/select/index.d.ts +23 -0
  47. package/dist/slider/index.d.ts +19 -0
  48. package/dist/space/index.d.ts +11 -0
  49. package/dist/spin/index.d.ts +12 -0
  50. package/dist/steps/index.d.ts +25 -0
  51. package/dist/switch/index.d.ts +18 -0
  52. package/dist/table/checkbox.d.ts +14 -0
  53. package/dist/table/empty.d.ts +5 -0
  54. package/dist/table/index.d.ts +2 -0
  55. package/dist/table/row-operation-cell.d.ts +9 -0
  56. package/dist/table/table.d.ts +3 -0
  57. package/dist/table/toolbar.d.ts +12 -0
  58. package/dist/table/types.d.ts +84 -0
  59. package/dist/table/utils.d.ts +19 -0
  60. package/dist/tabs/index.d.ts +22 -0
  61. package/dist/textarea/index.d.ts +10 -0
  62. package/dist/theme/theme-provider.d.ts +21 -0
  63. package/dist/timepicker/index.d.ts +12 -0
  64. package/dist/timepicker/scroll-column.d.ts +13 -0
  65. package/dist/timepicker/types.d.ts +43 -0
  66. package/dist/timepicker/utils.d.ts +13 -0
  67. package/dist/tooltip/index.d.ts +19 -0
  68. package/dist/tree/index.d.ts +29 -0
  69. package/dist/tree-select/index.d.ts +21 -0
  70. package/dist/upload/file-item.d.ts +10 -0
  71. package/dist/upload/index.d.ts +12 -0
  72. package/dist/upload/types.d.ts +58 -0
  73. package/dist/upload/use-upload.d.ts +6 -0
  74. package/dist/upload/utils.d.ts +5 -0
  75. package/dist/upload-manager/index.d.ts +10 -0
  76. package/dist/upload-manager/manager-item.d.ts +10 -0
  77. package/dist/upload-manager/preview-modal.d.ts +10 -0
  78. package/dist/upload-manager/types.d.ts +80 -0
  79. package/dist/upload-manager/use-upload-manager.d.ts +19 -0
  80. package/env.d.ts +2 -0
  81. package/package.json +47 -0
  82. package/rollup.config.js +36 -0
  83. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import "./input.css";
3
+ export type InputSize = "sm" | "md" | "lg";
4
+ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "prefix"> {
5
+ size?: InputSize;
6
+ prefix?: React.ReactNode;
7
+ suffix?: React.ReactNode;
8
+ trim?: boolean;
9
+ clearable?: boolean;
10
+ showCount?: boolean;
11
+ }
12
+ export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import type { InputSize } from "../input";
3
+ import "./input-number.css";
4
+ export interface InputNumberProps {
5
+ value?: number | null;
6
+ defaultValue?: number | null;
7
+ min?: number;
8
+ max?: number;
9
+ step?: number;
10
+ precision?: number;
11
+ disabled?: boolean;
12
+ size?: InputSize;
13
+ prefix?: React.ReactNode;
14
+ suffix?: React.ReactNode;
15
+ placeholder?: string;
16
+ className?: string;
17
+ style?: React.CSSProperties;
18
+ onChange?: (value: number | null) => void;
19
+ onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
20
+ formatter?: (value: number | null) => string;
21
+ parser?: (displayValue: string) => number | null;
22
+ }
23
+ export declare const InputNumber: React.ForwardRefExoticComponent<InputNumberProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import "./layer.css";
3
+ export interface LayerProps {
4
+ open: boolean;
5
+ triggerRef: React.RefObject<HTMLElement | null>;
6
+ children: React.ReactNode;
7
+ /** vertical gap between trigger bottom and layer top, default 4 */
8
+ offset?: number;
9
+ /** stretch layer width to match the trigger, default true */
10
+ matchWidth?: boolean;
11
+ /** override z-index, e.g. 2001 when used inside a Modal */
12
+ zIndex?: number;
13
+ className?: string;
14
+ style?: React.CSSProperties;
15
+ onClickOutside?: () => void;
16
+ onEscape?: () => void;
17
+ }
18
+ export declare function Layer({ open, triggerRef, children, offset, matchWidth, zIndex, className, style, onClickOutside, onEscape, }: LayerProps): React.ReactPortal | null;
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ import "./menu.css";
3
+ export type MenuMode = "vertical" | "horizontal" | "inline";
4
+ export interface MenuItemType {
5
+ key: string;
6
+ label: React.ReactNode;
7
+ icon?: React.ReactNode;
8
+ disabled?: boolean;
9
+ children?: MenuItemType[];
10
+ }
11
+ export interface MenuProps {
12
+ items: MenuItemType[];
13
+ selectedKey?: string;
14
+ defaultSelectedKey?: string;
15
+ openKeys?: string[];
16
+ defaultOpenKeys?: string[];
17
+ onSelect?: (key: string) => void;
18
+ onOpenChange?: (openKeys: string[]) => void;
19
+ mode?: MenuMode;
20
+ collapsed?: boolean;
21
+ style?: React.CSSProperties;
22
+ className?: string;
23
+ }
24
+ export declare function Menu({ items, selectedKey, defaultSelectedKey, openKeys, defaultOpenKeys, onSelect, onOpenChange, mode, collapsed, style, className, }: MenuProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import "./message.css";
3
+ export type MessageType = "success" | "error" | "warning" | "info" | "loading";
4
+ export interface MessageOptions {
5
+ duration?: number;
6
+ key?: string;
7
+ closable?: boolean;
8
+ }
9
+ declare function closeAll(): void;
10
+ export declare const message: {
11
+ success: (content: React.ReactNode, options?: number | MessageOptions) => () => void;
12
+ error: (content: React.ReactNode, options?: number | MessageOptions) => () => void;
13
+ warning: (content: React.ReactNode, options?: number | MessageOptions) => () => void;
14
+ info: (content: React.ReactNode, options?: number | MessageOptions) => () => void;
15
+ loading: (content: React.ReactNode, options?: number | MessageOptions) => () => void;
16
+ closeAll: typeof closeAll;
17
+ };
18
+ export {};
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import "./modal.css";
3
+ export interface ModalProps {
4
+ open: boolean;
5
+ onClose?: () => void;
6
+ title?: React.ReactNode;
7
+ children?: React.ReactNode;
8
+ footer?: React.ReactNode | null;
9
+ width?: number | string;
10
+ closable?: boolean;
11
+ mask?: boolean | {
12
+ blur?: boolean;
13
+ };
14
+ }
15
+ export declare function Modal({ open, onClose, title, children, footer, width, closable, mask, }: ModalProps): React.ReactPortal | null;
16
+ export declare namespace Modal {
17
+ var show: (options: StaticModalOptions) => void;
18
+ var info: (options: StaticModalOptions) => void;
19
+ var success: (options: StaticModalOptions) => void;
20
+ var error: (options: StaticModalOptions) => void;
21
+ var warning: (options: StaticModalOptions) => void;
22
+ var confirm: (options: ConfirmModalOptions) => void;
23
+ }
24
+ export type StaticModalType = "info" | "success" | "error" | "warning";
25
+ export interface StaticModalOptions {
26
+ title?: React.ReactNode;
27
+ content?: React.ReactNode;
28
+ width?: number | string;
29
+ okText?: string;
30
+ onClose?: () => void;
31
+ }
32
+ export interface ConfirmModalOptions {
33
+ title?: React.ReactNode;
34
+ content?: React.ReactNode;
35
+ width?: number | string;
36
+ text?: {
37
+ ok?: string;
38
+ cancel?: string;
39
+ };
40
+ onOk?: () => void | Promise<void>;
41
+ onClose?: () => void | Promise<void>;
42
+ }
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import "./pagination.css";
3
+ export interface PaginationProps {
4
+ total: number;
5
+ current?: number;
6
+ defaultCurrent?: number;
7
+ pageSize?: number;
8
+ defaultPageSize?: number;
9
+ pageSizeOptions?: number[];
10
+ showSizeChanger?: boolean;
11
+ showQuickJumper?: boolean;
12
+ showTotal?: (total: number, range: [number, number]) => React.ReactNode;
13
+ onChange?: (page: number, pageSize: number) => void;
14
+ disabled?: boolean;
15
+ size?: "sm" | "md";
16
+ style?: React.CSSProperties;
17
+ className?: string;
18
+ }
19
+ export declare function Pagination({ total, current: controlledPage, defaultCurrent, pageSize: controlledPageSize, defaultPageSize, pageSizeOptions, showSizeChanger, showQuickJumper, showTotal, onChange, disabled, size, style, className, }: PaginationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import "./popover.css";
3
+ export type PopoverPlacement = "top" | "bottom" | "left" | "right";
4
+ export type PopoverTrigger = "click" | "hover";
5
+ export interface PopoverProps {
6
+ children: React.ReactElement;
7
+ title?: React.ReactNode;
8
+ content?: React.ReactNode;
9
+ placement?: PopoverPlacement;
10
+ trigger?: PopoverTrigger;
11
+ open?: boolean;
12
+ defaultOpen?: boolean;
13
+ onOpenChange?: (open: boolean) => void;
14
+ offset?: number;
15
+ style?: React.CSSProperties;
16
+ className?: string;
17
+ }
18
+ export declare function Popover({ children, title, content, placement, trigger, open: openProp, defaultOpen, onOpenChange, offset, style, className, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,28 @@
1
+ export type BasePlacement = "top" | "bottom" | "left" | "right";
2
+ /** Flip a base direction */
3
+ export declare function flipBase(p: string): BasePlacement;
4
+ /** Flip a placement preserving the variant suffix */
5
+ export declare function flipPlacement(p: string): string;
6
+ /**
7
+ * Check if the tooltip/popover overflows the viewport in its primary axis.
8
+ * `pos` must be the raw (unclamped) top/left values.
9
+ */
10
+ export declare function isOverflowing(p: string, top: number, left: number, fW: number, fH: number): boolean;
11
+ /** Clamp top/left so the floating element stays within the viewport */
12
+ export declare function clampToViewport(top: number, left: number, fW: number, fH: number, margin?: number): {
13
+ top: number;
14
+ left: number;
15
+ };
16
+ /**
17
+ * Resolve the effective placement with auto-flip.
18
+ * Tries `preferred`, flips to opposite if it overflows.
19
+ * Returns the final placement and clamped position.
20
+ */
21
+ export declare function resolvePlacement<T extends string>(preferred: T, triggerRect: DOMRect, fW: number, fH: number, offset: number, compute: (p: T, tRect: DOMRect, fW: number, fH: number, offset: number) => {
22
+ top: number;
23
+ left: number;
24
+ }): {
25
+ placement: T;
26
+ top: number;
27
+ left: number;
28
+ };
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import "./progress.css";
3
+ export type ProgressType = "line" | "line-inner" | "circle" | "dashboard";
4
+ export type ProgressStatus = "normal" | "success" | "error" | "warning" | "active";
5
+ export type ProgressSize = "sm" | "md" | "lg";
6
+ export interface ProgressProps {
7
+ percent?: number;
8
+ type?: ProgressType;
9
+ status?: ProgressStatus;
10
+ strokeWidth?: number;
11
+ showInfo?: boolean;
12
+ format?: (percent: number) => React.ReactNode;
13
+ size?: ProgressSize;
14
+ style?: React.CSSProperties;
15
+ className?: string;
16
+ }
17
+ export declare function Progress({ percent, type, status, strokeWidth, showInfo, format, size, style, className, }: ProgressProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ import "./radio.css";
3
+ export type RadioSize = "sm" | "md" | "lg";
4
+ export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange" | "checked" | "defaultChecked" | "value"> {
5
+ checked?: boolean;
6
+ defaultChecked?: boolean;
7
+ onChange?: (checked: boolean, e: React.ChangeEvent<HTMLInputElement>) => void;
8
+ size?: RadioSize;
9
+ children?: React.ReactNode;
10
+ value?: string | number;
11
+ }
12
+ export interface RadioOption {
13
+ label: React.ReactNode;
14
+ value: string | number;
15
+ disabled?: boolean;
16
+ }
17
+ export interface RadioGroupProps {
18
+ value?: string | number;
19
+ defaultValue?: string | number;
20
+ onChange?: (value: string | number) => void;
21
+ options?: RadioOption[];
22
+ disabled?: boolean;
23
+ children?: React.ReactNode;
24
+ className?: string;
25
+ }
26
+ declare function RadioGroup({ value, defaultValue, onChange, options, disabled, children, className, }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
27
+ export declare function Radio({ checked, defaultChecked, onChange, size, disabled, children, value, className, ...rest }: RadioProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare namespace Radio {
29
+ var Group: typeof RadioGroup;
30
+ var displayName: string;
31
+ }
32
+ export {};
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import "./rate.css";
3
+ export type RateSize = "sm" | "md" | "lg";
4
+ export interface RateProps {
5
+ value?: number;
6
+ defaultValue?: number;
7
+ onChange?: (value: number) => void;
8
+ count?: number;
9
+ allowHalf?: boolean;
10
+ allowClear?: boolean;
11
+ disabled?: boolean;
12
+ character?: React.ReactNode;
13
+ size?: RateSize;
14
+ style?: React.CSSProperties;
15
+ className?: string;
16
+ }
17
+ export declare function Rate({ value, defaultValue, onChange, count, allowHalf, allowClear, disabled, character, size, style, className, }: RateProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare namespace Rate {
19
+ var displayName: string;
20
+ }
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import "./select.css";
3
+ export interface SelectOption {
4
+ label: string;
5
+ value: string | number;
6
+ disabled?: boolean;
7
+ }
8
+ export type SelectValue = string | number | (string | number)[];
9
+ export interface SelectProps {
10
+ options?: SelectOption[];
11
+ value?: SelectValue;
12
+ onChange?: (value: SelectValue) => void;
13
+ multiple?: boolean;
14
+ placeholder?: string;
15
+ disabled?: boolean;
16
+ size?: "sm" | "md" | "lg";
17
+ clearable?: boolean;
18
+ searchable?: boolean;
19
+ maxTagCount?: number;
20
+ style?: React.CSSProperties;
21
+ className?: string;
22
+ }
23
+ export declare function Select({ options, value, onChange, multiple, placeholder, disabled, size, clearable, searchable, maxTagCount, style, className, }: SelectProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import "./slider.css";
3
+ export interface SliderProps {
4
+ value?: number | [number, number];
5
+ defaultValue?: number | [number, number];
6
+ onChange?: (value: number | [number, number]) => void;
7
+ min?: number;
8
+ max?: number;
9
+ step?: number;
10
+ disabled?: boolean;
11
+ marks?: Record<number, React.ReactNode>;
12
+ range?: boolean;
13
+ style?: React.CSSProperties;
14
+ className?: string;
15
+ }
16
+ export declare function Slider({ value, defaultValue, onChange, min, max, step, disabled, marks, range, style, className, }: SliderProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare namespace Slider {
18
+ var displayName: string;
19
+ }
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ export interface SpaceProps {
3
+ direction?: "horizontal" | "vertical";
4
+ gap?: number | string;
5
+ align?: "start" | "center" | "end" | "baseline";
6
+ wrap?: boolean;
7
+ style?: React.CSSProperties;
8
+ className?: string;
9
+ children?: React.ReactNode;
10
+ }
11
+ export declare function Space({ direction, gap, align, wrap, style, className, children, }: SpaceProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import "./spin.css";
3
+ export type SpinSize = "sm" | "md" | "lg";
4
+ export interface SpinProps {
5
+ spinning?: boolean;
6
+ size?: SpinSize;
7
+ tip?: string;
8
+ children?: React.ReactNode;
9
+ style?: React.CSSProperties;
10
+ className?: string;
11
+ }
12
+ export declare function Spin({ spinning, size, tip, children, style, className, }: SpinProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import "./steps.css";
3
+ export type StepStatus = "wait" | "process" | "finish" | "error";
4
+ export type StepsDirection = "horizontal" | "vertical";
5
+ export type StepsType = "default" | "dot" | "navigation";
6
+ export type StepsSize = "sm" | "md";
7
+ export interface StepItem {
8
+ title: React.ReactNode;
9
+ description?: React.ReactNode;
10
+ icon?: React.ReactNode;
11
+ status?: StepStatus;
12
+ disabled?: boolean;
13
+ }
14
+ export interface StepsProps {
15
+ current?: number;
16
+ items: StepItem[];
17
+ direction?: StepsDirection;
18
+ type?: StepsType;
19
+ size?: StepsSize;
20
+ status?: StepStatus;
21
+ onChange?: (index: number) => void;
22
+ className?: string;
23
+ style?: React.CSSProperties;
24
+ }
25
+ export declare function Steps({ current, items, direction, type, size, status, onChange, className, style, }: StepsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import "./switch.css";
3
+ export type SwitchSize = "sm" | "md" | "lg";
4
+ export interface SwitchProps {
5
+ checked?: boolean;
6
+ defaultChecked?: boolean;
7
+ onChange?: (checked: boolean) => void;
8
+ disabled?: boolean;
9
+ size?: SwitchSize;
10
+ checkedChildren?: React.ReactNode;
11
+ uncheckedChildren?: React.ReactNode;
12
+ style?: React.CSSProperties;
13
+ className?: string;
14
+ }
15
+ export declare function Switch({ checked, defaultChecked, onChange, disabled, size, checkedChildren, uncheckedChildren, style, className, }: SwitchProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare namespace Switch {
17
+ var displayName: string;
18
+ }
@@ -0,0 +1,14 @@
1
+ interface TableCheckboxProps {
2
+ checked: boolean;
3
+ indeterminate?: boolean;
4
+ disabled?: boolean;
5
+ onChange?: (checked: boolean) => void;
6
+ }
7
+ interface TableRadioProps {
8
+ checked: boolean;
9
+ disabled?: boolean;
10
+ onChange?: () => void;
11
+ }
12
+ export declare function TableRadio({ checked, disabled, onChange }: TableRadioProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function TableCheckbox({ checked, indeterminate, disabled, onChange, }: TableCheckboxProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export declare function EmptyState({ content }: {
3
+ content?: React.ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export declare function LoadingOverlay(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export type { TablePaginationConfig, TableColumn, TableRowSelection, TableToolItem, TableToolbarApi, TableRowOperations, RowMenuItem, RowMenuApi, TableProps, SummaryCell, } from "./types";
2
+ export { Table } from "./table";
@@ -0,0 +1,9 @@
1
+ import type { RowMenuItem } from "./types";
2
+ interface RowOperationCellProps<T> {
3
+ record: T;
4
+ menus: RowMenuItem<T>[];
5
+ maxCount: number;
6
+ search?: () => void | Promise<void>;
7
+ }
8
+ export declare function RowOperationCell<T>({ record, menus, maxCount, search, }: RowOperationCellProps<T>): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,3 @@
1
+ import "./table.css";
2
+ import type { TableProps } from "./types";
3
+ export declare function Table<T extends Record<string, any> = any>({ columns, dataSource, rowKey, bordered, striped, size, scroll, loading, empty, rowSelection, virtual, pagination, title, tools, rowOperations, onRefresh, summary, childrenColumnName, expandedRowKeys, defaultExpandedRowKeys, onExpand, indentSize, style, className, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import type { ButtonSize } from "../button";
3
+ import type { TableToolItem, TableToolbarApi } from "./types";
4
+ interface ToolbarProps<T> {
5
+ title?: React.ReactNode;
6
+ tools?: TableToolItem<T>[];
7
+ onRefresh?: () => void | Promise<void>;
8
+ toolbarApi: TableToolbarApi<T>;
9
+ btnSize: ButtonSize;
10
+ }
11
+ export declare function Toolbar<T>({ title, tools, onRefresh, toolbarApi, btnSize, }: ToolbarProps<T>): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,84 @@
1
+ import type { ReactNode, CSSProperties } from "react";
2
+ import type { PaginationProps } from "../pagination";
3
+ import type { ButtonVariant } from "../button";
4
+ import type { IconName } from "../icon";
5
+ export type SummaryCell = {
6
+ render: () => ReactNode;
7
+ colSpan?: number;
8
+ rowSpan?: number;
9
+ };
10
+ export type TablePaginationConfig = Omit<PaginationProps, "total" | "style" | "className">;
11
+ export interface TableColumn<T = any> {
12
+ key: string;
13
+ title: ReactNode;
14
+ dataIndex?: string;
15
+ width?: number | string;
16
+ align?: "left" | "center" | "right";
17
+ fixed?: "left" | "right";
18
+ group?: string;
19
+ render?: (value: any, record: T, index: number) => ReactNode;
20
+ }
21
+ export interface TableRowSelection<T = any> {
22
+ selectedRowKeys?: (string | number)[];
23
+ onChange?: (keys: (string | number)[], rows: T[]) => void;
24
+ type?: "checkbox" | "radio";
25
+ getCheckboxProps?: (record: T) => {
26
+ disabled?: boolean;
27
+ };
28
+ }
29
+ export interface TableToolbarApi<T = any> {
30
+ data: T[];
31
+ }
32
+ export interface TableToolItem<T = any> {
33
+ label?: ReactNode;
34
+ icon?: IconName;
35
+ type?: ButtonVariant;
36
+ disabled?: boolean | ((api: TableToolbarApi<T>) => boolean);
37
+ onClick?: (api: TableToolbarApi<T>) => void;
38
+ }
39
+ export interface RowMenuApi<T = any> {
40
+ record: T;
41
+ search?: () => void | Promise<void>;
42
+ }
43
+ export interface RowMenuItem<T = any> {
44
+ label: ReactNode;
45
+ confirm?: string;
46
+ disabled?: boolean | ((api: RowMenuApi<T>) => boolean);
47
+ visible?: boolean | ((api: RowMenuApi<T>) => boolean);
48
+ onClick?: (api: RowMenuApi<T>) => void | Promise<void>;
49
+ }
50
+ export interface TableRowOperations<T = any> {
51
+ width?: number;
52
+ maxCount?: number;
53
+ menus?: RowMenuItem<T>[];
54
+ }
55
+ export interface TableProps<T extends Record<string, any> = any> {
56
+ columns: TableColumn<T>[];
57
+ dataSource?: T[];
58
+ rowKey?: string | ((record: T) => string | number);
59
+ bordered?: boolean;
60
+ striped?: boolean;
61
+ size?: "sm" | "md" | "lg";
62
+ scroll?: {
63
+ x?: number | string;
64
+ y?: number | string;
65
+ };
66
+ loading?: boolean;
67
+ empty?: ReactNode;
68
+ rowSelection?: TableRowSelection<T>;
69
+ /** 开启虚拟滚动(需同时设置 scroll.y 为数字) */
70
+ virtual?: boolean;
71
+ pagination?: TablePaginationConfig | false;
72
+ title?: ReactNode;
73
+ tools?: TableToolItem<T>[];
74
+ rowOperations?: TableRowOperations<T>;
75
+ onRefresh?: () => void | Promise<void>;
76
+ summary?: SummaryCell[][];
77
+ childrenColumnName?: string;
78
+ expandedRowKeys?: (string | number)[];
79
+ defaultExpandedRowKeys?: (string | number)[];
80
+ onExpand?: (expanded: boolean, record: T) => void;
81
+ indentSize?: number;
82
+ style?: CSSProperties;
83
+ className?: string;
84
+ }
@@ -0,0 +1,19 @@
1
+ import type { TableColumn, TableProps } from "./types";
2
+ export type HeaderSegment<T> = {
3
+ type: "leaf";
4
+ col: TableColumn<T>;
5
+ } | {
6
+ type: "group";
7
+ label: string;
8
+ cols: TableColumn<T>[];
9
+ };
10
+ export declare function buildHeaderSegments<T>(columns: TableColumn<T>[]): HeaderSegment<T>[];
11
+ export declare function getRowKey<T extends Record<string, any>>(record: T, index: number, rowKey?: TableProps<T>["rowKey"]): string;
12
+ export declare function getCellValue<T extends Record<string, any>>(record: T, col: TableColumn<T>): any;
13
+ export declare function computeStickyOffsets(columns: TableColumn[]): {
14
+ left: Record<string, number>;
15
+ right: Record<string, number>;
16
+ lastLeftKey: string | null;
17
+ firstRightKey: string | null;
18
+ };
19
+ export declare const ROW_HEIGHT: Record<"sm" | "md" | "lg", number>;
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import "./tabs.css";
3
+ export interface TabItem {
4
+ key: string;
5
+ label: React.ReactNode;
6
+ children?: React.ReactNode;
7
+ disabled?: boolean;
8
+ icon?: React.ReactNode;
9
+ }
10
+ export type TabsType = "line" | "segment";
11
+ export type TabsPosition = "top" | "left";
12
+ export interface TabsProps {
13
+ items: TabItem[];
14
+ activeKey?: string;
15
+ defaultActiveKey?: string;
16
+ onChange?: (key: string) => void;
17
+ type?: TabsType;
18
+ position?: TabsPosition;
19
+ style?: React.CSSProperties;
20
+ className?: string;
21
+ }
22
+ export declare function Tabs({ items, activeKey: activeKeyProp, defaultActiveKey, onChange, type, position, style, className, }: TabsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./textarea.css";
3
+ export type TextareaSize = "sm" | "md" | "lg";
4
+ export interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> {
5
+ size?: TextareaSize;
6
+ autoSize?: boolean;
7
+ showCount?: boolean;
8
+ clearable?: boolean;
9
+ }
10
+ export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ export type Theme = "light" | "dark";
3
+ export type AccentColor = string;
4
+ interface ThemeContextValue {
5
+ theme: Theme;
6
+ accentColor: AccentColor;
7
+ setTheme: (t: Theme) => void;
8
+ setAccentColor: (c: AccentColor) => void;
9
+ }
10
+ export declare const ACCENT_PRESETS: {
11
+ label: string;
12
+ value: string;
13
+ }[];
14
+ interface ThemeProviderProps {
15
+ children: React.ReactNode;
16
+ defaultTheme?: Theme;
17
+ defaultAccentColor?: AccentColor;
18
+ }
19
+ export declare function ThemeProvider({ children, defaultTheme, defaultAccentColor, }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function useTheme(): ThemeContextValue;
21
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { TimePickerProps, TimeRangePickerProps } from "./types";
2
+ import "./timepicker.css";
3
+ export type { TimePickerSize, TimePickerProps, TimeRangePickerProps, TimeValue, } from "./types";
4
+ declare function TimePickerBase({ value: controlledValue, defaultValue, onChange, format: fmtProp, use12Hours, hourStep, minuteStep, secondStep, disabledHours, disabledMinutes, disabledSeconds, clearable, disabled, size, placeholder, style, className, }: TimePickerProps): import("react/jsx-runtime").JSX.Element;
5
+ declare function RangePicker({ value: controlledValue, defaultValue, onChange, format: fmtProp, use12Hours, hourStep, minuteStep, secondStep, clearable, disabled, size, placeholder, style, className, }: TimeRangePickerProps): import("react/jsx-runtime").JSX.Element;
6
+ declare namespace RangePicker {
7
+ var displayName: string;
8
+ }
9
+ export declare const TimePicker: typeof TimePickerBase & {
10
+ RangePicker: typeof RangePicker;
11
+ displayName: string;
12
+ };
@@ -0,0 +1,13 @@
1
+ export interface ScrollColumnProps {
2
+ values: number[];
3
+ selected: number;
4
+ disabledValues?: number[];
5
+ onSelect: (val: number) => void;
6
+ label?: string;
7
+ }
8
+ export declare function ScrollColumn({ values, selected, disabledValues, onSelect, label, }: ScrollColumnProps): import("react/jsx-runtime").JSX.Element;
9
+ export interface AmPmColumnProps {
10
+ value: "AM" | "PM";
11
+ onSelect: (v: "AM" | "PM") => void;
12
+ }
13
+ export declare function AmPmColumn({ value, onSelect }: AmPmColumnProps): import("react/jsx-runtime").JSX.Element;