enwawa-ui 1.6.1 → 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 +33 -36
- package/lib/index.d.ts.map +1 -1
- package/lib/index.es.js +54 -44
- package/lib/index.es.js.map +1 -1
- package/lib/index.js +53 -43
- 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
|
*/
|
|
@@ -2660,7 +2659,7 @@ export interface OrSelectInputProps {
|
|
|
2660
2659
|
/**
|
|
2661
2660
|
* Rules for validation
|
|
2662
2661
|
* @default []
|
|
2663
|
-
|
|
2662
|
+
*/
|
|
2664
2663
|
rules?: MlFromItemProps['rules'][];
|
|
2665
2664
|
type?: 'number' | 'text';
|
|
2666
2665
|
fieldName: string;
|
|
@@ -2701,6 +2700,8 @@ export interface OrFormInLineItem {
|
|
|
2701
2700
|
* Rules for field validation. Click [here](https://ant.design/components/form#components-form-demo-basic) to see an example
|
|
2702
2701
|
*/
|
|
2703
2702
|
rules?: MlFromItemProps['rules'];
|
|
2703
|
+
compositeRules?: [MlFromItemProps['rules'], MlFromItemProps['rules']];
|
|
2704
|
+
compositeType?: OrSelectInputProps['type'];
|
|
2704
2705
|
hidden?: boolean;
|
|
2705
2706
|
disabled?: boolean;
|
|
2706
2707
|
styles?: CSSProperties;
|
|
@@ -2708,6 +2709,10 @@ export interface OrFormInLineItem {
|
|
|
2708
2709
|
onSearch?: (value: string) => any;
|
|
2709
2710
|
showSearch?: boolean;
|
|
2710
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'];
|
|
2711
2716
|
/**
|
|
2712
2717
|
* Format of the date
|
|
2713
2718
|
*/
|
|
@@ -2861,7 +2866,8 @@ export interface OrModuleTableHeaderProps {
|
|
|
2861
2866
|
secondaryButtonIcon?: string;
|
|
2862
2867
|
}
|
|
2863
2868
|
export const OrModuleTableHeader: React.FC<OrModuleTableHeaderProps>;
|
|
2864
|
-
export
|
|
2869
|
+
export type OrColumnsType<T = unknown> = ColumnsType<T>;
|
|
2870
|
+
export interface OrTableProps<RecordType = AnyObject> {
|
|
2865
2871
|
/**
|
|
2866
2872
|
* Whether to show all table borders
|
|
2867
2873
|
*/
|
|
@@ -2869,23 +2875,23 @@ export interface OrTableProps {
|
|
|
2869
2875
|
/**
|
|
2870
2876
|
* Columns of table
|
|
2871
2877
|
*/
|
|
2872
|
-
columns: TableProps<
|
|
2878
|
+
columns: TableProps<RecordType>['columns'];
|
|
2873
2879
|
/**
|
|
2874
2880
|
* Data record array to be displayed
|
|
2875
2881
|
*/
|
|
2876
|
-
dataSource: TableProps<
|
|
2882
|
+
dataSource: TableProps<RecordType>['dataSource'];
|
|
2877
2883
|
/**
|
|
2878
2884
|
* Loading status of table
|
|
2879
2885
|
*/
|
|
2880
|
-
loading?: TableProps<
|
|
2886
|
+
loading?: TableProps<RecordType>['loading'];
|
|
2881
2887
|
/**
|
|
2882
2888
|
* Config of pagination. You can ref table pagination config or full pagination document, hide it by setting it to false
|
|
2883
2889
|
*/
|
|
2884
|
-
pagination?: TableProps<
|
|
2890
|
+
pagination?: TableProps<RecordType>['pagination'];
|
|
2885
2891
|
/**
|
|
2886
2892
|
* Row's unique key, could be a string or function that returns a string
|
|
2887
2893
|
*/
|
|
2888
|
-
rowKey?: TableProps<
|
|
2894
|
+
rowKey?: TableProps<RecordType>['rowKey'];
|
|
2889
2895
|
/**
|
|
2890
2896
|
* Size of table
|
|
2891
2897
|
*/
|
|
@@ -2897,17 +2903,17 @@ export interface OrTableProps {
|
|
|
2897
2903
|
/**
|
|
2898
2904
|
* Table title renderer
|
|
2899
2905
|
*/
|
|
2900
|
-
title?: TableProps<
|
|
2906
|
+
title?: TableProps<RecordType>['title'];
|
|
2901
2907
|
/**
|
|
2902
2908
|
* Callback executed when pagination, filters or sorter is changed
|
|
2903
2909
|
*/
|
|
2904
|
-
onChange?: TableProps<
|
|
2910
|
+
onChange?: TableProps<RecordType>['onChange'];
|
|
2905
2911
|
/**
|
|
2906
2912
|
* row selection config
|
|
2907
2913
|
*/
|
|
2908
|
-
rowSelection?: TableProps<
|
|
2914
|
+
rowSelection?: TableProps<RecordType>['rowSelection'];
|
|
2909
2915
|
}
|
|
2910
|
-
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;
|
|
2911
2917
|
export interface OrListSelectionProps {
|
|
2912
2918
|
/**
|
|
2913
2919
|
* Text of button to add
|
|
@@ -3205,37 +3211,27 @@ export interface OrStepProp {
|
|
|
3205
3211
|
$margin?: string;
|
|
3206
3212
|
}
|
|
3207
3213
|
export const OrStep: React.FC<OrStepProp>;
|
|
3208
|
-
interface
|
|
3209
|
-
businessName?: string;
|
|
3210
|
-
name?: string;
|
|
3211
|
-
rif?: string;
|
|
3212
|
-
phone: {
|
|
3213
|
-
dialCode: string;
|
|
3214
|
-
phone: string;
|
|
3215
|
-
};
|
|
3216
|
-
city?: string;
|
|
3217
|
-
}
|
|
3218
|
-
export interface IFormStep {
|
|
3214
|
+
export interface IFormStep<T> {
|
|
3219
3215
|
title: string;
|
|
3220
3216
|
inputs?: OrFormItemsInlineProps['inputs'];
|
|
3221
3217
|
submitButtonText?: string;
|
|
3222
3218
|
image?: string;
|
|
3223
3219
|
cancelButtonText?: string;
|
|
3224
3220
|
onCancelClick?: () => void;
|
|
3225
|
-
formInitialItems?:
|
|
3221
|
+
formInitialItems?: T;
|
|
3226
3222
|
form?: OrFormProps['form'];
|
|
3227
3223
|
onFinish?: (e: any) => void;
|
|
3228
3224
|
cancelBtnIcon?: ReactNode;
|
|
3229
3225
|
}
|
|
3230
|
-
export interface TmCrudPageProps {
|
|
3226
|
+
export interface TmCrudPageProps<RecordType = AnyObject, FormType = any> {
|
|
3231
3227
|
/**
|
|
3232
3228
|
* Columns of table
|
|
3233
3229
|
*/
|
|
3234
|
-
columns: OrTableProps['columns'];
|
|
3230
|
+
columns: OrTableProps<RecordType>['columns'];
|
|
3235
3231
|
/**
|
|
3236
3232
|
* Data record array to be displayed
|
|
3237
3233
|
*/
|
|
3238
|
-
data: OrTableProps['dataSource'];
|
|
3234
|
+
data: OrTableProps<RecordType>['dataSource'];
|
|
3239
3235
|
/**
|
|
3240
3236
|
* Loading status of table
|
|
3241
3237
|
*/
|
|
@@ -3311,7 +3307,7 @@ export interface TmCrudPageProps {
|
|
|
3311
3307
|
/**
|
|
3312
3308
|
* Form Steps info
|
|
3313
3309
|
*/
|
|
3314
|
-
formSteps?: IFormStep[];
|
|
3310
|
+
formSteps?: IFormStep<FormType>[];
|
|
3315
3311
|
/**
|
|
3316
3312
|
* current step
|
|
3317
3313
|
*/
|
|
@@ -3401,7 +3397,7 @@ export interface TmCrudPageProps {
|
|
|
3401
3397
|
*/
|
|
3402
3398
|
secondaryOnClick?: () => void;
|
|
3403
3399
|
}
|
|
3404
|
-
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;
|
|
3405
3401
|
export interface OrSimpleBannerProps {
|
|
3406
3402
|
/**
|
|
3407
3403
|
* Id of the OrSimpleBannerProps
|
|
@@ -3705,7 +3701,7 @@ export interface TmRechargePageProps {
|
|
|
3705
3701
|
/**
|
|
3706
3702
|
* Form Steps info
|
|
3707
3703
|
*/
|
|
3708
|
-
currentPaymentSelectedFields: IFormStep
|
|
3704
|
+
currentPaymentSelectedFields: IFormStep<any>;
|
|
3709
3705
|
/**
|
|
3710
3706
|
* on value change function
|
|
3711
3707
|
*/
|
|
@@ -3876,7 +3872,7 @@ export interface OrPaymentMethodsProps {
|
|
|
3876
3872
|
/**
|
|
3877
3873
|
* Form Steps info
|
|
3878
3874
|
*/
|
|
3879
|
-
currentPaymentSelectedFields?: IFormStep
|
|
3875
|
+
currentPaymentSelectedFields?: IFormStep<any>;
|
|
3880
3876
|
/**
|
|
3881
3877
|
* on value change function
|
|
3882
3878
|
*/
|
|
@@ -4068,5 +4064,6 @@ export const OrSpace: React.FC<AtSpaceProps>;
|
|
|
4068
4064
|
export const useMessage: () => readonly [import("antd/es/message/interface").MessageInstance, import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>];
|
|
4069
4065
|
export const useModal: () => readonly [instance: import("antd/es/modal/useModal").HookAPI, contextHolder: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>];
|
|
4070
4066
|
export const useForm: <T = any>() => [import("antd").FormInstance<T>];
|
|
4067
|
+
export const useFormWatch: <T = any>(name: string, form?: FormInstance | WatchOptions<FormInstance>) => T;
|
|
4071
4068
|
|
|
4072
4069
|
//# sourceMappingURL=index.d.ts.map
|