enwawa-ui 1.6.0 → 1.6.2
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/lib/index.d.ts +98 -45
- package/lib/index.d.ts.map +1 -1
- package/lib/index.es.js +193 -14
- package/lib/index.es.js.map +1 -1
- package/lib/index.js +192 -13
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { CSSProperties, ReactNode, ChangeEvent, JSXElementConstructor, ReactElement } from "react";
|
|
2
2
|
import { ButtonShape, ButtonSize, ButtonType } from "antd/es/button";
|
|
3
|
-
import { CheckboxProps, CountdownProps, DatePickerProps, ImageProps, InputNumberProps, SelectProps, TagProps, BreadcrumbProps, DropdownProps, MenuProps, ColProps, PaginationProps, RadioChangeEvent as _RadioChangeEvent1, TooltipProps, AlertProps, RowProps, LayoutProps, SiderProps, FormProps, TableProps, ModalFuncProps, ModalProps, StepsProps, SpaceProps } from "antd";
|
|
3
|
+
import { CheckboxProps, CountdownProps, DatePickerProps, ImageProps, InputNumberProps, SelectProps, TagProps, BreadcrumbProps, DropdownProps, MenuProps, ColProps, PaginationProps, RadioChangeEvent as _RadioChangeEvent1, TooltipProps, AlertProps, RowProps, LayoutProps, SiderProps, FormProps, TableProps, ModalFuncProps, ModalProps, StepsProps, SpaceProps, FormInstance } from "antd";
|
|
4
4
|
import { Dayjs } from "dayjs";
|
|
5
5
|
import { IconComponentProps } from "@ant-design/icons/lib/components/Icon";
|
|
6
6
|
import * as Icons from "@ant-design/icons";
|
|
@@ -19,9 +19,11 @@ import { LabelTooltipType } from "antd/es/form/FormItemLabel";
|
|
|
19
19
|
import { Gutter } from "antd/es/grid/row";
|
|
20
20
|
import { DrawerProps } from "antd/es/drawer";
|
|
21
21
|
import { AnyObject } from "antd/es/_util/type";
|
|
22
|
+
import { ColumnsType } from "antd/es/table";
|
|
22
23
|
import { TableRowSelection } from "antd/es/table/interface";
|
|
23
24
|
import { GoogleMap, GoogleMapProps } from "@react-google-maps/api";
|
|
24
25
|
import { CheckboxChangeEvent } from "antd/es/checkbox";
|
|
26
|
+
import { WatchOptions } from "rc-field-form/es/interface";
|
|
25
27
|
export interface AtAvatarProps {
|
|
26
28
|
/**
|
|
27
29
|
* This attribute defines the alternative text describing the image
|
|
@@ -468,10 +470,7 @@ export interface AtNumberInputProps {
|
|
|
468
470
|
/**
|
|
469
471
|
* Specifies the format of the value presented
|
|
470
472
|
*/
|
|
471
|
-
formatter?:
|
|
472
|
-
userTyping: boolean;
|
|
473
|
-
input: string;
|
|
474
|
-
}) => string;
|
|
473
|
+
formatter?: InputNumberProps['formatter'];
|
|
475
474
|
/**
|
|
476
475
|
* If enable keyboard behavior
|
|
477
476
|
*/
|
|
@@ -487,7 +486,7 @@ export interface AtNumberInputProps {
|
|
|
487
486
|
/**
|
|
488
487
|
* Specifies the value extracted from formatter
|
|
489
488
|
*/
|
|
490
|
-
parser?:
|
|
489
|
+
parser?: InputNumberProps['parser'];
|
|
491
490
|
/**
|
|
492
491
|
* The precision of input value. Will use formatter when config of formatter
|
|
493
492
|
*/
|
|
@@ -985,11 +984,15 @@ export interface AtTextProps {
|
|
|
985
984
|
/**
|
|
986
985
|
* Element width
|
|
987
986
|
*/
|
|
988
|
-
$width?: number;
|
|
987
|
+
$width?: number | string;
|
|
989
988
|
/**
|
|
990
989
|
* font size
|
|
991
990
|
*/
|
|
992
991
|
$fontSize?: number;
|
|
992
|
+
/**
|
|
993
|
+
* textAlign
|
|
994
|
+
*/
|
|
995
|
+
$textAlign?: "center" | "left" | "right" | "justify" | "initial" | "inherit" | "unset";
|
|
993
996
|
}
|
|
994
997
|
export const AtText: React.FC<AtTextProps>;
|
|
995
998
|
export interface AtTitleProps {
|
|
@@ -1834,6 +1837,24 @@ export interface OrTicketCardProps {
|
|
|
1834
1837
|
onChange?: (e: string | React.MouseEvent<HTMLAnchorElement, MouseEvent> | React.MouseEvent<HTMLButtonElement, MouseEvent> | number | null) => void;
|
|
1835
1838
|
}
|
|
1836
1839
|
export const OrTicketCard: React.FC<OrTicketCardProps>;
|
|
1840
|
+
export interface OrPlanCardsProps {
|
|
1841
|
+
/**
|
|
1842
|
+
* Active subscriptions
|
|
1843
|
+
*/
|
|
1844
|
+
activeSubscriptions?: Array<{
|
|
1845
|
+
title: string;
|
|
1846
|
+
description: string;
|
|
1847
|
+
}>;
|
|
1848
|
+
/**
|
|
1849
|
+
* subscriptions onChange event
|
|
1850
|
+
*/
|
|
1851
|
+
subscriptionOnChange?: (e: _RadioChangeEvent1) => void;
|
|
1852
|
+
/**
|
|
1853
|
+
* Plans and Subscriptions
|
|
1854
|
+
*/
|
|
1855
|
+
subscriptions: Array<MlSubscriptionCardProps>;
|
|
1856
|
+
}
|
|
1857
|
+
export const OrPlanCards: React.FC<OrPlanCardsProps>;
|
|
1837
1858
|
export interface OrCoinTableProps {
|
|
1838
1859
|
/**
|
|
1839
1860
|
* List of coins available
|
|
@@ -2160,6 +2181,22 @@ export interface OrContentProps extends LayoutProps {
|
|
|
2160
2181
|
$main?: boolean;
|
|
2161
2182
|
}
|
|
2162
2183
|
export const OrContent: React.FC<OrContentProps>;
|
|
2184
|
+
export type Size = 'large' | 'middle' | 'small';
|
|
2185
|
+
declare const sizes: {
|
|
2186
|
+
[key in Size]: {
|
|
2187
|
+
fontSize: number;
|
|
2188
|
+
height: number;
|
|
2189
|
+
};
|
|
2190
|
+
};
|
|
2191
|
+
export interface OrCopyInfoProps {
|
|
2192
|
+
text?: string;
|
|
2193
|
+
copyable?: boolean;
|
|
2194
|
+
size?: keyof typeof sizes;
|
|
2195
|
+
id?: string;
|
|
2196
|
+
onCopy?: () => {};
|
|
2197
|
+
textProps?: AtTextProps;
|
|
2198
|
+
}
|
|
2199
|
+
export const OrCopyInfo: React.FC<OrCopyInfoProps>;
|
|
2163
2200
|
export interface OrCountryCardProps {
|
|
2164
2201
|
/**
|
|
2165
2202
|
* The ID for card
|
|
@@ -2610,11 +2647,31 @@ export interface OrPhoneInputProps {
|
|
|
2610
2647
|
rules?: MlFromItemProps['rules'];
|
|
2611
2648
|
}
|
|
2612
2649
|
export const OrPhoneInput: React.FC<OrPhoneInputProps>;
|
|
2650
|
+
export interface OrSelectInputProps {
|
|
2651
|
+
/**
|
|
2652
|
+
* Dial codes options
|
|
2653
|
+
*/
|
|
2654
|
+
options: AtSelectProps['options'];
|
|
2655
|
+
/**
|
|
2656
|
+
* Disabled input
|
|
2657
|
+
*/
|
|
2658
|
+
disabled?: boolean;
|
|
2659
|
+
/**
|
|
2660
|
+
* Rules for validation
|
|
2661
|
+
* @default []
|
|
2662
|
+
*/
|
|
2663
|
+
rules?: MlFromItemProps['rules'][];
|
|
2664
|
+
type?: 'number' | 'text';
|
|
2665
|
+
fieldName: string;
|
|
2666
|
+
inputProps?: AtTextInputProps | AtNumberInputProps;
|
|
2667
|
+
selectProps?: AtSelectProps;
|
|
2668
|
+
}
|
|
2669
|
+
export const OrSelectInput: React.FC<OrSelectInputProps>;
|
|
2613
2670
|
export interface OrFormInLineItem {
|
|
2614
2671
|
/**
|
|
2615
2672
|
* Type of components available for the form
|
|
2616
2673
|
*/
|
|
2617
|
-
component: 'radio' | 'number-input' | 'checkbox' | 'select' | 'select-multiple' | 'text' | 'phone' | 'date-picker' | 'cvc' | 'name';
|
|
2674
|
+
component: 'radio' | 'number-input' | 'checkbox' | 'select' | 'select-multiple' | 'text' | 'phone' | 'date-picker' | 'cvc' | 'name' | 'select-input' | 'info' | 'copy-info';
|
|
2618
2675
|
/**
|
|
2619
2676
|
* Label of the field
|
|
2620
2677
|
*/
|
|
@@ -2643,6 +2700,8 @@ export interface OrFormInLineItem {
|
|
|
2643
2700
|
* Rules for field validation. Click [here](https://ant.design/components/form#components-form-demo-basic) to see an example
|
|
2644
2701
|
*/
|
|
2645
2702
|
rules?: MlFromItemProps['rules'];
|
|
2703
|
+
compositeRules?: [MlFromItemProps['rules'], MlFromItemProps['rules']];
|
|
2704
|
+
compositeType?: OrSelectInputProps['type'];
|
|
2646
2705
|
hidden?: boolean;
|
|
2647
2706
|
disabled?: boolean;
|
|
2648
2707
|
styles?: CSSProperties;
|
|
@@ -2650,10 +2709,18 @@ export interface OrFormInLineItem {
|
|
|
2650
2709
|
onSearch?: (value: string) => any;
|
|
2651
2710
|
showSearch?: boolean;
|
|
2652
2711
|
onChange?: (value: any, option: DefaultOptionType | Array<DefaultOptionType>) => any;
|
|
2712
|
+
filterOption?: AtSelectProps['filterOption'];
|
|
2713
|
+
disabledDate?: AtDatePickerPros['disabledDate'];
|
|
2714
|
+
formatter?: AtNumberInputProps['formatter'];
|
|
2715
|
+
parser?: AtNumberInputProps['parser'];
|
|
2653
2716
|
/**
|
|
2654
2717
|
* Format of the date
|
|
2655
2718
|
*/
|
|
2656
2719
|
format?: string;
|
|
2720
|
+
textProps?: AtTextProps & {
|
|
2721
|
+
text?: string;
|
|
2722
|
+
};
|
|
2723
|
+
onClick?: () => any;
|
|
2657
2724
|
}
|
|
2658
2725
|
export interface OrFormItemsInlineProps {
|
|
2659
2726
|
inputs?: Array<OrFormInLineItem | OrFormInLineItem[]>;
|
|
@@ -2799,7 +2866,8 @@ export interface OrModuleTableHeaderProps {
|
|
|
2799
2866
|
secondaryButtonIcon?: string;
|
|
2800
2867
|
}
|
|
2801
2868
|
export const OrModuleTableHeader: React.FC<OrModuleTableHeaderProps>;
|
|
2802
|
-
export
|
|
2869
|
+
export type OrColumnsType<T = unknown> = ColumnsType<T>;
|
|
2870
|
+
export interface OrTableProps<RecordType = AnyObject> {
|
|
2803
2871
|
/**
|
|
2804
2872
|
* Whether to show all table borders
|
|
2805
2873
|
*/
|
|
@@ -2807,23 +2875,23 @@ export interface OrTableProps {
|
|
|
2807
2875
|
/**
|
|
2808
2876
|
* Columns of table
|
|
2809
2877
|
*/
|
|
2810
|
-
columns: TableProps<
|
|
2878
|
+
columns: TableProps<RecordType>['columns'];
|
|
2811
2879
|
/**
|
|
2812
2880
|
* Data record array to be displayed
|
|
2813
2881
|
*/
|
|
2814
|
-
dataSource: TableProps<
|
|
2882
|
+
dataSource: TableProps<RecordType>['dataSource'];
|
|
2815
2883
|
/**
|
|
2816
2884
|
* Loading status of table
|
|
2817
2885
|
*/
|
|
2818
|
-
loading?: TableProps<
|
|
2886
|
+
loading?: TableProps<RecordType>['loading'];
|
|
2819
2887
|
/**
|
|
2820
2888
|
* Config of pagination. You can ref table pagination config or full pagination document, hide it by setting it to false
|
|
2821
2889
|
*/
|
|
2822
|
-
pagination?: TableProps<
|
|
2890
|
+
pagination?: TableProps<RecordType>['pagination'];
|
|
2823
2891
|
/**
|
|
2824
2892
|
* Row's unique key, could be a string or function that returns a string
|
|
2825
2893
|
*/
|
|
2826
|
-
rowKey?: TableProps<
|
|
2894
|
+
rowKey?: TableProps<RecordType>['rowKey'];
|
|
2827
2895
|
/**
|
|
2828
2896
|
* Size of table
|
|
2829
2897
|
*/
|
|
@@ -2835,17 +2903,17 @@ export interface OrTableProps {
|
|
|
2835
2903
|
/**
|
|
2836
2904
|
* Table title renderer
|
|
2837
2905
|
*/
|
|
2838
|
-
title?: TableProps<
|
|
2906
|
+
title?: TableProps<RecordType>['title'];
|
|
2839
2907
|
/**
|
|
2840
2908
|
* Callback executed when pagination, filters or sorter is changed
|
|
2841
2909
|
*/
|
|
2842
|
-
onChange?: TableProps<
|
|
2910
|
+
onChange?: TableProps<RecordType>['onChange'];
|
|
2843
2911
|
/**
|
|
2844
2912
|
* row selection config
|
|
2845
2913
|
*/
|
|
2846
|
-
rowSelection?: TableProps<
|
|
2914
|
+
rowSelection?: TableProps<RecordType>['rowSelection'];
|
|
2847
2915
|
}
|
|
2848
|
-
export const OrTable:
|
|
2916
|
+
export const OrTable: <RecordType extends AnyObject>({ bordered, loading, pagination, size, sticky, rowSelection, ...props }: OrTableProps<RecordType>) => import("react/jsx-runtime").JSX.Element;
|
|
2849
2917
|
export interface OrListSelectionProps {
|
|
2850
2918
|
/**
|
|
2851
2919
|
* Text of button to add
|
|
@@ -2944,20 +3012,14 @@ export interface OrLoginLayoutProps {
|
|
|
2944
3012
|
children?: React.ReactNode;
|
|
2945
3013
|
}
|
|
2946
3014
|
export const OrLoginLayout: React.FC<OrLoginLayoutProps>;
|
|
2947
|
-
|
|
2948
|
-
export const sizes: {
|
|
2949
|
-
[key in Size]: {
|
|
2950
|
-
width: number;
|
|
2951
|
-
height: number;
|
|
2952
|
-
};
|
|
2953
|
-
};
|
|
3015
|
+
type _Size2 = 'large' | 'middle' | 'small';
|
|
2954
3016
|
export interface OrMarkProps {
|
|
2955
3017
|
id?: string;
|
|
2956
3018
|
text?: string;
|
|
2957
3019
|
color?: AtTextProps['color'];
|
|
2958
3020
|
backgroundColor?: string;
|
|
2959
3021
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
2960
|
-
size?:
|
|
3022
|
+
size?: _Size2;
|
|
2961
3023
|
position: {
|
|
2962
3024
|
lat: number;
|
|
2963
3025
|
lng: number;
|
|
@@ -3149,37 +3211,27 @@ export interface OrStepProp {
|
|
|
3149
3211
|
$margin?: string;
|
|
3150
3212
|
}
|
|
3151
3213
|
export const OrStep: React.FC<OrStepProp>;
|
|
3152
|
-
interface
|
|
3153
|
-
businessName?: string;
|
|
3154
|
-
name?: string;
|
|
3155
|
-
rif?: string;
|
|
3156
|
-
phone: {
|
|
3157
|
-
dialCode: string;
|
|
3158
|
-
phone: string;
|
|
3159
|
-
};
|
|
3160
|
-
city?: string;
|
|
3161
|
-
}
|
|
3162
|
-
export interface IFormStep {
|
|
3214
|
+
export interface IFormStep<T> {
|
|
3163
3215
|
title: string;
|
|
3164
3216
|
inputs?: OrFormItemsInlineProps['inputs'];
|
|
3165
3217
|
submitButtonText?: string;
|
|
3166
3218
|
image?: string;
|
|
3167
3219
|
cancelButtonText?: string;
|
|
3168
3220
|
onCancelClick?: () => void;
|
|
3169
|
-
formInitialItems?:
|
|
3221
|
+
formInitialItems?: T;
|
|
3170
3222
|
form?: OrFormProps['form'];
|
|
3171
3223
|
onFinish?: (e: any) => void;
|
|
3172
3224
|
cancelBtnIcon?: ReactNode;
|
|
3173
3225
|
}
|
|
3174
|
-
export interface TmCrudPageProps {
|
|
3226
|
+
export interface TmCrudPageProps<RecordType = AnyObject, FormType = any> {
|
|
3175
3227
|
/**
|
|
3176
3228
|
* Columns of table
|
|
3177
3229
|
*/
|
|
3178
|
-
columns: OrTableProps['columns'];
|
|
3230
|
+
columns: OrTableProps<RecordType>['columns'];
|
|
3179
3231
|
/**
|
|
3180
3232
|
* Data record array to be displayed
|
|
3181
3233
|
*/
|
|
3182
|
-
data: OrTableProps['dataSource'];
|
|
3234
|
+
data: OrTableProps<RecordType>['dataSource'];
|
|
3183
3235
|
/**
|
|
3184
3236
|
* Loading status of table
|
|
3185
3237
|
*/
|
|
@@ -3255,7 +3307,7 @@ export interface TmCrudPageProps {
|
|
|
3255
3307
|
/**
|
|
3256
3308
|
* Form Steps info
|
|
3257
3309
|
*/
|
|
3258
|
-
formSteps?: IFormStep[];
|
|
3310
|
+
formSteps?: IFormStep<FormType>[];
|
|
3259
3311
|
/**
|
|
3260
3312
|
* current step
|
|
3261
3313
|
*/
|
|
@@ -3345,7 +3397,7 @@ export interface TmCrudPageProps {
|
|
|
3345
3397
|
*/
|
|
3346
3398
|
secondaryOnClick?: () => void;
|
|
3347
3399
|
}
|
|
3348
|
-
export const TmCrudPage:
|
|
3400
|
+
export const TmCrudPage: <RecordType extends AnyObject, FormType extends Store>({ columns, data, loadingTable, formSteps, onValuesChange, onCloseLeftDrawer, leftDrawerContent, openLeftDrawer, subtitle, subContent, open, pageSize, currentPage, currentFormStep, titleLeftDrawer, leftDrawerWidth, drawerContent, showDrawerContent, showSearchBox, drawerTitle, drawerWidth, firstButtonText, secondButtonText, onClickFirstButton, onClickSecondButton, $margin, title, tableTitle, buttonAddText, addButtonOnClick, onChangePagination, total, showTotal, disabledButtons, searchBoxOnSearch, searchBoxPlaceholder, tableHeaderCustomLeftElements, pagination, handleCloseCallback, tableTitleLevel, secondaryButtonText, secondaryOnClick, }: TmCrudPageProps<RecordType, FormType>) => import("react/jsx-runtime").JSX.Element;
|
|
3349
3401
|
export interface OrSimpleBannerProps {
|
|
3350
3402
|
/**
|
|
3351
3403
|
* Id of the OrSimpleBannerProps
|
|
@@ -3649,7 +3701,7 @@ export interface TmRechargePageProps {
|
|
|
3649
3701
|
/**
|
|
3650
3702
|
* Form Steps info
|
|
3651
3703
|
*/
|
|
3652
|
-
currentPaymentSelectedFields: IFormStep
|
|
3704
|
+
currentPaymentSelectedFields: IFormStep<any>;
|
|
3653
3705
|
/**
|
|
3654
3706
|
* on value change function
|
|
3655
3707
|
*/
|
|
@@ -3820,7 +3872,7 @@ export interface OrPaymentMethodsProps {
|
|
|
3820
3872
|
/**
|
|
3821
3873
|
* Form Steps info
|
|
3822
3874
|
*/
|
|
3823
|
-
currentPaymentSelectedFields?: IFormStep
|
|
3875
|
+
currentPaymentSelectedFields?: IFormStep<any>;
|
|
3824
3876
|
/**
|
|
3825
3877
|
* on value change function
|
|
3826
3878
|
*/
|
|
@@ -4012,5 +4064,6 @@ export const OrSpace: React.FC<AtSpaceProps>;
|
|
|
4012
4064
|
export const useMessage: () => readonly [import("antd/es/message/interface").MessageInstance, import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>];
|
|
4013
4065
|
export const useModal: () => readonly [instance: import("antd/es/modal/useModal").HookAPI, contextHolder: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>];
|
|
4014
4066
|
export const useForm: <T = any>() => [import("antd").FormInstance<T>];
|
|
4067
|
+
export const useFormWatch: <T = any>(name: string, form?: FormInstance | WatchOptions<FormInstance>) => T;
|
|
4015
4068
|
|
|
4016
4069
|
//# sourceMappingURL=index.d.ts.map
|