enwawa-ui 3.1.0 → 3.2.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/lib/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React, { CSSProperties, ReactNode, ChangeEvent, JSXElementConstructor, ReactElement } from "react";
2
2
  import { ButtonShape, ButtonSize, ButtonType } from "antd/es/button";
3
- import { ButtonProps, AutoCompleteProps, DescriptionsProps, BreadcrumbProps as _BreadcrumbProps1, SwitchProps } from "antd/lib";
4
- import { CheckboxProps, AlertProps, ColProps, BreadcrumbProps, TooltipProps, InputNumberProps, DropdownProps, MenuProps, SelectProps, PaginationProps, RadioChangeEvent, UploadProps, RowProps, CollapseProps, LayoutProps, SiderProps, SpaceProps, StepsProps, FormProps, ModalFuncProps, FormInstance, TableProps, ModalProps as _ModalProps1, CountdownProps, DatePickerProps, ImageProps, SpinProps, TagProps } from "antd";
3
+ import { ButtonProps, AutoCompleteProps, DescriptionsProps, TableProps as _TableProps1, BreadcrumbProps as _BreadcrumbProps1, SwitchProps } from "antd/lib";
4
+ import { CheckboxProps, AlertProps, ColProps, BreadcrumbProps, TooltipProps, InputNumberProps, DropdownProps, MenuProps, SelectProps, PaginationProps, RadioChangeEvent, UploadProps, RowProps as _RowProps1, CollapseProps, LayoutProps, SiderProps, SpaceProps, StepsProps, TableProps, TableColumnsType, FormProps, ModalFuncProps, FormInstance, ModalProps as _ModalProps1, CountdownProps, DatePickerProps, ImageProps, SpinProps, TagProps } from "antd";
5
5
  import { TabsProps } from "antd/es/tabs";
6
6
  import { CardTabListType } from "antd/es/card";
7
7
  import { CardType } from "antd/es/card/Card";
@@ -16,13 +16,14 @@ import { Gutter } from "antd/es/grid/row";
16
16
  import { BlockProps, EllipsisConfig, BaseType } from "antd/es/typography/Base";
17
17
  import { TextProps as _TextProps1 } from "antd/es/typography/Text";
18
18
  import { AnyObject } from "antd/es/_util/type";
19
+ import { ColumnsType, TablePaginationConfig } from "antd/es/table";
20
+ import { ExpandableConfig, FilterValue, SorterResult, TableCurrentDataSource, TableRowSelection } from "antd/es/table/interface";
21
+ import { DragEndEvent } from "@dnd-kit/core";
19
22
  import { DrawerProps } from "antd/es/drawer";
20
23
  import { IconComponentProps } from "@ant-design/icons/lib/components/Icon";
21
24
  import * as Icons from "@ant-design/icons";
22
25
  import { GoogleMapProps, CircleProps, GoogleMap } from "@react-google-maps/api";
23
26
  import { WatchOptions } from "rc-field-form/es/interface";
24
- import { ColumnsType, TablePaginationConfig } from "antd/es/table";
25
- import { ExpandableConfig, FilterValue, SorterResult, TableCurrentDataSource, TableRowSelection } from "antd/es/table/interface";
26
27
  import { CSSProperties as _CSSProperties1 } from "styled-components";
27
28
  import { CheckboxChangeEvent } from "antd/es/checkbox";
28
29
  import { Dayjs } from "dayjs";
@@ -153,6 +154,14 @@ export interface AtButtonProps {
153
154
  * Set background button transparent
154
155
  */
155
156
  bgTransparent?: boolean;
157
+ /**
158
+ * button cursor
159
+ */
160
+ $cursor?: string;
161
+ /**
162
+ * ref element
163
+ */
164
+ ref?: (element: HTMLElement | null) => void;
156
165
  }
157
166
  export const AtButton: React.FC<AtButtonProps>;
158
167
  export interface AtCheckboxProps extends CheckboxProps {
@@ -1608,7 +1617,7 @@ export interface OrRowProps {
1608
1617
  /**
1609
1618
  * Vertical alignment
1610
1619
  */
1611
- align?: RowProps['align'] | "center";
1620
+ align?: _RowProps1['align'] | "center";
1612
1621
  /**
1613
1622
  * Container background source
1614
1623
  */
@@ -1620,7 +1629,7 @@ export interface OrRowProps {
1620
1629
  /**
1621
1630
  * Horizontal arrangement
1622
1631
  */
1623
- justify?: RowProps['justify'];
1632
+ justify?: _RowProps1['justify'];
1624
1633
  /**
1625
1634
  * Auto wrap line
1626
1635
  */
@@ -1707,7 +1716,7 @@ export interface OrTwoButtons {
1707
1716
  /**
1708
1717
  * justify buttons
1709
1718
  */
1710
- justify?: RowProps['justify'];
1719
+ justify?: _RowProps1['justify'];
1711
1720
  }
1712
1721
  export const OrTwoButtons: React.FC<OrTwoButtons>;
1713
1722
  export interface OrAssignBalanceProps {
@@ -1982,13 +1991,12 @@ export interface OrCardLocationProps {
1982
1991
  */
1983
1992
  backgroundColor?: string;
1984
1993
  /**
1985
- * type of card info
1994
+ * Color of the card
1986
1995
  */
1987
- type: 'add' | 'oneWay' | 'return';
1996
+ buttonText?: string;
1988
1997
  /**
1989
- * Text of the action button
1998
+ * Content of the card
1990
1999
  */
1991
- buttonText?: string;
1992
2000
  content: React.ReactNode;
1993
2001
  }
1994
2002
  /**
@@ -2924,6 +2932,109 @@ export interface OrDownloadUploadProps {
2924
2932
  mode?: 'drag' | 'basic';
2925
2933
  }
2926
2934
  export const OrDownloadUpload: React.FC<OrDownloadUploadProps>;
2935
+ export type OrColumnsType<T = unknown> = ColumnsType<T>;
2936
+ export type OnChangeTable<RecordType = AnyObject> = (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<RecordType> | SorterResult<RecordType>[], extra: TableCurrentDataSource<RecordType>) => void;
2937
+ export interface OrTableProps<RecordType = AnyObject> {
2938
+ /**
2939
+ * Whether to show all table borders
2940
+ */
2941
+ bordered?: boolean;
2942
+ /**
2943
+ * Columns of table
2944
+ */
2945
+ columns: TableProps<RecordType>['columns'];
2946
+ /**
2947
+ * Data record array to be displayed
2948
+ */
2949
+ dataSource: TableProps<RecordType>['dataSource'];
2950
+ /**
2951
+ * Loading status of table
2952
+ */
2953
+ loading?: TableProps<RecordType>['loading'];
2954
+ /**
2955
+ * Config of pagination. You can ref table pagination config or full pagination document, hide it by setting it to false
2956
+ */
2957
+ pagination?: TableProps<RecordType>['pagination'];
2958
+ /**
2959
+ * Row's unique key, could be a string or function that returns a string
2960
+ */
2961
+ rowKey?: TableProps<RecordType>['rowKey'];
2962
+ /**
2963
+ * Size of table
2964
+ */
2965
+ size?: 'large' | 'middle' | 'small';
2966
+ /**
2967
+ * Set sticky header and scroll bar
2968
+ */
2969
+ sticky?: boolean;
2970
+ /**
2971
+ * Table title renderer
2972
+ */
2973
+ title?: TableProps<RecordType>['title'];
2974
+ /**
2975
+ * Callback executed when pagination, filters or sorter is changed
2976
+ */
2977
+ onChange?: OnChangeTable<RecordType>;
2978
+ /**
2979
+ * row selection config
2980
+ */
2981
+ rowSelection?: TableProps<RecordType>['rowSelection'];
2982
+ /**
2983
+ * Set the scroll of table, could be a number that indicates the width of the scroll area, or an object that has the following properties: x number | string, y number | string
2984
+ */
2985
+ scroll?: TableProps<RecordType>['scroll'];
2986
+ /**
2987
+ * Set the expandable of table
2988
+ * */
2989
+ expandable?: ExpandableConfig<RecordType> | undefined;
2990
+ /**
2991
+ * components of table
2992
+ */
2993
+ components?: TableProps<RecordType>['components'];
2994
+ }
2995
+ export const OrTable: <RecordType extends AnyObject>({ bordered, loading, pagination, size, sticky, rowSelection, ...props }: OrTableProps<RecordType>) => import("react/jsx-runtime").JSX.Element;
2996
+ /**
2997
+ * Props for the SortableContextWrapper component.
2998
+ */
2999
+ export interface OrSortableContextWrapperProps<RecordType = AnyObject> {
3000
+ /**
3001
+ * An array of items to be sorted.
3002
+ */
3003
+ items: TableProps<RecordType>['dataSource'];
3004
+ /**
3005
+ * Callback function that is called when dragging ends.
3006
+ */
3007
+ onDragEnd: (event: DragEndEvent) => any;
3008
+ /**
3009
+ * The child nodes to be rendered within the sortable context.
3010
+ */
3011
+ children: React.ReactNode;
3012
+ }
3013
+ export const OrSortableContextWrapper: React.FC<OrSortableContextWrapperProps>;
3014
+ interface RowProps extends React.HTMLAttributes<HTMLTableRowElement> {
3015
+ 'data-row-key': string;
3016
+ }
3017
+ export const OrSortableRow: React.FC<RowProps>;
3018
+ export interface OrDraggableTableProps<RecordType = AnyObject> {
3019
+ /**
3020
+ * Whether to show all table borders
3021
+ */
3022
+ bordered?: boolean;
3023
+ /**
3024
+ * Columns of table
3025
+ */
3026
+ columns: TableColumnsType<any>;
3027
+ /**
3028
+ * Data record array to be displayed
3029
+ */
3030
+ data: _TableProps1<RecordType>['dataSource'];
3031
+ /**
3032
+ *
3033
+ * onDragEnd function to execute
3034
+ */
3035
+ onDragEnd: (event: DragEndEvent) => any;
3036
+ }
3037
+ export const OrDraggableTable: <RecordType extends AnyObject>({ data, columns, onDragEnd, }: OrDraggableTableProps<RecordType>) => import("react/jsx-runtime").JSX.Element;
2927
3038
  export interface OrDrawerProps {
2928
3039
  /**
2929
3040
  * The ID for input
@@ -3329,63 +3440,6 @@ export const useModal: () => {
3329
3440
  };
3330
3441
  export const useForm: <T = any>() => [import("antd").FormInstance<T>];
3331
3442
  export const useFormWatch: <T = any>(name: string | string[], form?: FormInstance | WatchOptions<FormInstance>) => T;
3332
- export type OrColumnsType<T = unknown> = ColumnsType<T>;
3333
- export type OnChangeTable<RecordType = AnyObject> = (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<RecordType> | SorterResult<RecordType>[], extra: TableCurrentDataSource<RecordType>) => void;
3334
- export interface OrTableProps<RecordType = AnyObject> {
3335
- /**
3336
- * Whether to show all table borders
3337
- */
3338
- bordered?: boolean;
3339
- /**
3340
- * Columns of table
3341
- */
3342
- columns: TableProps<RecordType>['columns'];
3343
- /**
3344
- * Data record array to be displayed
3345
- */
3346
- dataSource: TableProps<RecordType>['dataSource'];
3347
- /**
3348
- * Loading status of table
3349
- */
3350
- loading?: TableProps<RecordType>['loading'];
3351
- /**
3352
- * Config of pagination. You can ref table pagination config or full pagination document, hide it by setting it to false
3353
- */
3354
- pagination?: TableProps<RecordType>['pagination'];
3355
- /**
3356
- * Row's unique key, could be a string or function that returns a string
3357
- */
3358
- rowKey?: TableProps<RecordType>['rowKey'];
3359
- /**
3360
- * Size of table
3361
- */
3362
- size?: 'large' | 'middle' | 'small';
3363
- /**
3364
- * Set sticky header and scroll bar
3365
- */
3366
- sticky?: boolean;
3367
- /**
3368
- * Table title renderer
3369
- */
3370
- title?: TableProps<RecordType>['title'];
3371
- /**
3372
- * Callback executed when pagination, filters or sorter is changed
3373
- */
3374
- onChange?: OnChangeTable<RecordType>;
3375
- /**
3376
- * row selection config
3377
- */
3378
- rowSelection?: TableProps<RecordType>['rowSelection'];
3379
- /**
3380
- * Set the scroll of table, could be a number that indicates the width of the scroll area, or an object that has the following properties: x number | string, y number | string
3381
- */
3382
- scroll?: TableProps<RecordType>['scroll'];
3383
- /**
3384
- * Set the expandable of table
3385
- * */
3386
- expandable?: ExpandableConfig<RecordType> | undefined;
3387
- }
3388
- export const OrTable: <RecordType extends AnyObject>({ bordered, loading, pagination, size, sticky, rowSelection, ...props }: OrTableProps<RecordType>) => import("react/jsx-runtime").JSX.Element;
3389
3443
  export type OrSelectTableOption<T = any> = {
3390
3444
  label: string;
3391
3445
  value: string;
@@ -3406,7 +3460,7 @@ export interface OrFormInLineItem {
3406
3460
  /**
3407
3461
  * Type of components available for the form
3408
3462
  */
3409
- component: 'radio' | 'radio-cards' | 'number-input' | 'checkbox' | 'select' | 'select-multiple' | 'text' | 'phone' | 'date-picker' | 'date-range-picker' | 'cvc' | 'name' | 'select-input' | 'info' | 'copy-info' | 'status-info' | 'file-input' | 'collapse' | 'download-upload' | 'summary' | 'qr-code' | 'select-table' | 'google-map' | 'google-autocomplete-search' | 'stepper' | 'input-list' | 'button' | 'image' | 'time-range-picker' | 'autocomplete-search' | 'tabs' | 'descriptions-table' | 'badge-ribbon';
3463
+ component: 'radio' | 'radio-cards' | 'number-input' | 'checkbox' | 'select' | 'select-multiple' | 'text' | 'phone' | 'date-picker' | 'date-range-picker' | 'cvc' | 'name' | 'select-input' | 'info' | 'copy-info' | 'status-info' | 'file-input' | 'collapse' | 'download-upload' | 'summary' | 'qr-code' | 'select-table' | 'google-map' | 'google-autocomplete-search' | 'stepper' | 'input-list' | 'button' | 'image' | 'time-range-picker' | 'autocomplete-search' | 'tabs' | 'descriptions-table' | 'draggable-table' | 'badge-ribbon';
3410
3464
  /**
3411
3465
  * Label of the field
3412
3466
  */
@@ -3616,6 +3670,10 @@ export interface OrFormInLineItem {
3616
3670
  * Allow auto clear for a select field
3617
3671
  */
3618
3672
  autoClearSearchValue?: boolean | undefined;
3673
+ /**
3674
+ * Props for the draggable table
3675
+ */
3676
+ draggableTableProps?: OrDraggableTableProps;
3619
3677
  }
3620
3678
  export interface OrFormItemsInlineProps {
3621
3679
  inputs?: Array<OrFormInLineItem | Array<OrFormInLineItem | OrFormInLineItem[]>>;
@@ -4033,10 +4091,18 @@ export interface TmCustomMapPageProps<FormType = any> extends OrModuleTableHeade
4033
4091
  * Drawer Title
4034
4092
  */
4035
4093
  drawerTitle?: React.ReactNode;
4094
+ /**
4095
+ * Drawer Title
4096
+ */
4097
+ drawerTitleSecondary?: React.ReactNode;
4036
4098
  /**
4037
4099
  * Drawer Width
4038
4100
  */
4039
4101
  drawerWidth?: number;
4102
+ /**
4103
+ * Drawer Width
4104
+ */
4105
+ drawerWidthSecondary?: number;
4040
4106
  /**
4041
4107
  * Text of first button
4042
4108
  */
@@ -4105,7 +4171,9 @@ export interface TmCustomMapPageProps<FormType = any> extends OrModuleTableHeade
4105
4171
  visible: boolean;
4106
4172
  lat: number;
4107
4173
  lng: number;
4108
- item: React.ReactNode;
4174
+ item: any;
4175
+ id: string | null;
4176
+ pictureUrl?: string;
4109
4177
  };
4110
4178
  /**
4111
4179
  * Custom icon rendered to select a point in the map
@@ -4119,6 +4187,32 @@ export interface TmCustomMapPageProps<FormType = any> extends OrModuleTableHeade
4119
4187
  * Circle props
4120
4188
  */
4121
4189
  circle?: CircleProps;
4190
+ /**
4191
+ * Open routes modal
4192
+ */
4193
+ openRoutesModal?: boolean;
4194
+ /**
4195
+ * On press cancel and close button function
4196
+ */
4197
+ handleCloseCallbackSecondary?: () => void;
4198
+ /**
4199
+ * Routes items
4200
+ */
4201
+ routesItems?: React.ReactNode;
4202
+ /**
4203
+ * Polylines
4204
+ */
4205
+ polylines?: {
4206
+ color: string | null | undefined;
4207
+ stops: {
4208
+ latitude: number;
4209
+ longitude: number;
4210
+ }[];
4211
+ }[];
4212
+ /**
4213
+ * On click polyline
4214
+ */
4215
+ onClickPolyline?: (event: google.maps.MapMouseEvent | null, route?: any) => void;
4122
4216
  }
4123
4217
  export const TmCustomMapPage: React.FC<TmCustomMapPageProps>;
4124
4218
  export interface TmCustomTabsPageProps<FormType = any> {
@@ -4235,13 +4329,13 @@ export interface TmDashboardProps {
4235
4329
  /**
4236
4330
  * items from left for render on the dashboard
4237
4331
  */
4238
- items_left: IDashboardItems[];
4332
+ itemsLeft: IDashboardItems[];
4239
4333
  /**
4240
4334
  * items from right for render on the dashboard
4241
4335
  */
4242
- items_right: IDashboardItems[];
4336
+ itemsRight: IDashboardItems[];
4243
4337
  }
4244
- export const TmDashboard: ({ headerProps, items_left, items_right }: TmDashboardProps) => import("react/jsx-runtime").JSX.Element;
4338
+ export const TmDashboard: ({ headerProps, itemsLeft, itemsRight }: TmDashboardProps) => import("react/jsx-runtime").JSX.Element;
4245
4339
  export interface TmDescriptionsPageProps {
4246
4340
  /**
4247
4341
  * The ID for input