@stackone/malachite 0.8.0 → 0.9.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.
- package/dist/index.d.ts +119 -0
- package/dist/index.js +2364 -1916
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { default as default_2 } from 'react';
|
|
|
4
4
|
import { FC } from 'react';
|
|
5
5
|
import { FieldPath } from 'react-hook-form';
|
|
6
6
|
import { FieldValues } from 'react-hook-form';
|
|
7
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
7
8
|
import { ReactNode } from 'react';
|
|
8
9
|
import { UseFormReturn } from 'react-hook-form';
|
|
9
10
|
|
|
@@ -447,6 +448,12 @@ declare interface MalachiteContextProps {
|
|
|
447
448
|
}
|
|
448
449
|
|
|
449
450
|
export declare interface MalachiteTheme {
|
|
451
|
+
radius: {
|
|
452
|
+
sm: string;
|
|
453
|
+
md: string;
|
|
454
|
+
lg: string;
|
|
455
|
+
xl: string;
|
|
456
|
+
};
|
|
450
457
|
shadows: {
|
|
451
458
|
sm: string;
|
|
452
459
|
md: string;
|
|
@@ -599,6 +606,26 @@ export declare interface MalachiteTheme {
|
|
|
599
606
|
shadow: string;
|
|
600
607
|
};
|
|
601
608
|
};
|
|
609
|
+
table: {
|
|
610
|
+
header: {
|
|
611
|
+
background: string;
|
|
612
|
+
foreground: string;
|
|
613
|
+
border: string;
|
|
614
|
+
};
|
|
615
|
+
row: {
|
|
616
|
+
background: string;
|
|
617
|
+
foreground: string;
|
|
618
|
+
hoverBackground: string;
|
|
619
|
+
border: string;
|
|
620
|
+
};
|
|
621
|
+
border: string;
|
|
622
|
+
error: {
|
|
623
|
+
iconBackground: string;
|
|
624
|
+
iconForeground: string;
|
|
625
|
+
titleForeground: string;
|
|
626
|
+
subtitleForeground: string;
|
|
627
|
+
};
|
|
628
|
+
};
|
|
602
629
|
text: {
|
|
603
630
|
primary: string;
|
|
604
631
|
secondary: string;
|
|
@@ -644,6 +671,8 @@ declare interface PaddedProps {
|
|
|
644
671
|
|
|
645
672
|
declare type PaddingSize = 'small' | 'medium' | 'large' | 'none';
|
|
646
673
|
|
|
674
|
+
declare type PaddingSize_2 = 'default' | 'compact';
|
|
675
|
+
|
|
647
676
|
declare interface PageTitleProps {
|
|
648
677
|
children: default_2.ReactNode;
|
|
649
678
|
margin?: string;
|
|
@@ -652,6 +681,7 @@ declare interface PageTitleProps {
|
|
|
652
681
|
}
|
|
653
682
|
|
|
654
683
|
export declare interface PartialMalachiteTheme {
|
|
684
|
+
radius?: Partial<MalachiteTheme['radius']>;
|
|
655
685
|
shadows?: Partial<MalachiteTheme['shadows']>;
|
|
656
686
|
colors?: {
|
|
657
687
|
shadowColor?: string;
|
|
@@ -669,6 +699,7 @@ export declare interface PartialMalachiteTheme {
|
|
|
669
699
|
buttonList?: Partial<MalachiteTheme['colors']['buttonList']>;
|
|
670
700
|
pillButton?: Partial<MalachiteTheme['colors']['pillButton']>;
|
|
671
701
|
tag?: Partial<MalachiteTheme['colors']['tag']>;
|
|
702
|
+
table?: Partial<MalachiteTheme['colors']['table']>;
|
|
672
703
|
text?: Partial<MalachiteTheme['colors']['text']>;
|
|
673
704
|
codeBlock?: Partial<MalachiteTheme['colors']['codeBlock']>;
|
|
674
705
|
};
|
|
@@ -755,6 +786,93 @@ declare interface StatisticValueProps {
|
|
|
755
786
|
style?: default_2.CSSProperties;
|
|
756
787
|
}
|
|
757
788
|
|
|
789
|
+
export declare const Table: <T extends Record<string, unknown> = Record<string, unknown>>({ columns, data, loading, error, errorTitle, errorSubTitle, showHeader, rowKey, scrollHeight, size, layout, rowClassName, onRow, rowSelection, pagination, className, style, }: TableProps<T>) => JSX_2.Element;
|
|
790
|
+
|
|
791
|
+
export declare type TableColumnDefinition<T = Record<string, unknown>> = {
|
|
792
|
+
title: string | default_2.ReactNode;
|
|
793
|
+
dataIndex: keyof T;
|
|
794
|
+
key: string;
|
|
795
|
+
width?: string | number;
|
|
796
|
+
ellipsis?: boolean;
|
|
797
|
+
render?: (value: unknown, record?: T, index?: number) => default_2.ReactNode;
|
|
798
|
+
sorter?: boolean | ((a: T, b: T) => number);
|
|
799
|
+
sortIcon?: (props: {
|
|
800
|
+
sortOrder: 'desc' | 'asc' | null;
|
|
801
|
+
}) => default_2.ReactNode;
|
|
802
|
+
onHeaderCell?: (data: T, index?: number) => default_2.HTMLAttributes<HTMLTableCellElement> | default_2.TdHTMLAttributes<HTMLTableCellElement>;
|
|
803
|
+
defaultSortOrder?: 'ascend' | 'descend';
|
|
804
|
+
sortDirections?: ('ascend' | 'descend')[];
|
|
805
|
+
fixed?: 'left' | 'right';
|
|
806
|
+
align?: 'left' | 'center' | 'right';
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
export declare type TableColumns<T = Record<string, unknown>> = TableColumnDefinition<T>[];
|
|
810
|
+
|
|
811
|
+
export declare type TablePaginationPosition = 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
|
|
812
|
+
|
|
813
|
+
declare type TableProps<T = Record<string, unknown>> = {
|
|
814
|
+
columns: TableColumns<T>;
|
|
815
|
+
data: T[];
|
|
816
|
+
loading?: boolean;
|
|
817
|
+
error?: boolean;
|
|
818
|
+
errorTitle?: string;
|
|
819
|
+
errorSubTitle?: string;
|
|
820
|
+
bordered?: boolean;
|
|
821
|
+
showHeader?: boolean;
|
|
822
|
+
rowKey?: string | ((record: T) => string);
|
|
823
|
+
scrollHeight?: string | number;
|
|
824
|
+
type?: TableType;
|
|
825
|
+
size?: TableSize;
|
|
826
|
+
layout?: 'fixed' | 'auto';
|
|
827
|
+
rowClassName?: (record: T, index: number) => string;
|
|
828
|
+
onRow?: (record: T, index: number) => TableRowActions<T>;
|
|
829
|
+
rowSelection?: TableRowSelection<T>;
|
|
830
|
+
pagination?: {
|
|
831
|
+
current?: number;
|
|
832
|
+
pageSize?: number;
|
|
833
|
+
total?: number;
|
|
834
|
+
showSizeChanger?: boolean;
|
|
835
|
+
showQuickJumper?: boolean;
|
|
836
|
+
showTotal?: (total: number, range: [number, number]) => default_2.ReactNode;
|
|
837
|
+
pageSizeOptions?: string[];
|
|
838
|
+
position?: TablePaginationPosition[];
|
|
839
|
+
onChange?: (page: number, pageSize: number) => void;
|
|
840
|
+
onShowSizeChange?: (current: number, size: number) => void;
|
|
841
|
+
};
|
|
842
|
+
className?: string;
|
|
843
|
+
style?: default_2.CSSProperties;
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
declare type TableRowActions<T = Record<string, unknown>> = {
|
|
847
|
+
onClick?: (record: T, index: number) => void;
|
|
848
|
+
onDoubleClick?: (record: T, index: number) => void;
|
|
849
|
+
onContextMenu?: (record: T, index: number) => void;
|
|
850
|
+
onMouseEnter?: (record: T, index: number) => void;
|
|
851
|
+
onMouseLeave?: (record: T, index: number) => void;
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
export declare type TableRowSelection<T = Record<string, unknown>> = {
|
|
855
|
+
type?: 'checkbox' | 'radio';
|
|
856
|
+
selectedRowKeys?: default_2.Key[];
|
|
857
|
+
onChange?: (selectedRowKeys: default_2.Key[], selectedRows: T[]) => void;
|
|
858
|
+
onSelect?: (record: T, selected: boolean, selectedRows: T[], nativeEvent: Event) => void;
|
|
859
|
+
onSelectAll?: (selected: boolean, selectedRows: T[], changeRows: T[]) => void;
|
|
860
|
+
getCheckboxProps?: (record: T) => {
|
|
861
|
+
disabled?: boolean;
|
|
862
|
+
name?: string;
|
|
863
|
+
};
|
|
864
|
+
hideSelectAll?: boolean;
|
|
865
|
+
preserveSelectedRowKeys?: boolean;
|
|
866
|
+
fixed?: boolean;
|
|
867
|
+
columnWidth?: string | number;
|
|
868
|
+
columnTitle?: string | default_2.ReactNode;
|
|
869
|
+
selections?: boolean | default_2.ReactNode[];
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
export declare type TableSize = 'small' | 'medium' | 'large';
|
|
873
|
+
|
|
874
|
+
export declare type TableType = 'default' | 'compact' | 'bordered';
|
|
875
|
+
|
|
758
876
|
export declare const Tag: default_2.FC<TagProps>;
|
|
759
877
|
|
|
760
878
|
export declare interface TagProps {
|
|
@@ -764,6 +882,7 @@ export declare interface TagProps {
|
|
|
764
882
|
shadow?: boolean;
|
|
765
883
|
textTransform?: 'none' | 'uppercase';
|
|
766
884
|
width?: WidthSize;
|
|
885
|
+
paddingSize?: PaddingSize_2;
|
|
767
886
|
icon?: default_2.ReactNode;
|
|
768
887
|
iconPosition?: 'left' | 'right';
|
|
769
888
|
pointerType?: 'pointer' | 'default';
|