dinocollab-core 2.2.57 → 2.2.59

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 (135) hide show
  1. package/dist/components/index.js +1 -1
  2. package/dist/filter-bar/index.js +1 -1
  3. package/dist/form/index.js +1 -1
  4. package/dist/src/components/confirm-button.js +1 -1
  5. package/dist/src/components/confirm-button.js.map +1 -1
  6. package/dist/src/components/copy-to-clipboard.js +1 -1
  7. package/dist/src/components/copy-to-clipboard.js.map +1 -1
  8. package/dist/src/components/image-with-fallback.js +1 -1
  9. package/dist/src/components/image-with-fallback.js.map +1 -1
  10. package/dist/src/data-surface/index.create.js +1 -1
  11. package/dist/src/data-surface/index.create.js.map +1 -1
  12. package/dist/src/data-surface/types.js.map +1 -1
  13. package/dist/src/data-surface/ui.units.js +1 -1
  14. package/dist/src/data-surface/ui.units.js.map +1 -1
  15. package/dist/src/data-surface/view-grid/index.js +1 -1
  16. package/dist/src/data-surface/view-grid/index.js.map +1 -1
  17. package/dist/src/data-surface/view-list/column-selector.js +1 -1
  18. package/dist/src/data-surface/view-list/column-selector.js.map +1 -1
  19. package/dist/src/data-surface/view-list/helpers.js +1 -1
  20. package/dist/src/data-surface/view-list/helpers.js.map +1 -1
  21. package/dist/src/data-surface/view-list/hooks.js +1 -1
  22. package/dist/src/data-surface/view-list/hooks.js.map +1 -1
  23. package/dist/src/data-surface/view-list/index.js +1 -1
  24. package/dist/src/data-surface/view-list/index.js.map +1 -1
  25. package/dist/src/data-surface/view-list/types.js.map +1 -1
  26. package/dist/src/filter-bar/filter-input.js +1 -1
  27. package/dist/src/filter-bar/filter-input.js.map +1 -1
  28. package/dist/src/filter-bar/filter-input.types.js.map +1 -1
  29. package/dist/src/filter-bar/filter-input.units.js +1 -1
  30. package/dist/src/filter-bar/filter-input.units.js.map +1 -1
  31. package/dist/src/filter-bar/filter-menu.helpers.js +1 -1
  32. package/dist/src/filter-bar/filter-menu.helpers.js.map +1 -1
  33. package/dist/src/filter-bar/filter-menu.js +1 -1
  34. package/dist/src/filter-bar/filter-menu.js.map +1 -1
  35. package/dist/src/filter-bar/filter-summary.js +1 -1
  36. package/dist/src/filter-bar/filter-summary.js.map +1 -1
  37. package/dist/src/filter-bar/form-field/create-form-field-boolean.js +1 -1
  38. package/dist/src/filter-bar/form-field/create-form-field-boolean.js.map +1 -1
  39. package/dist/src/filter-bar/form-field/create-form-field-number.js +1 -1
  40. package/dist/src/filter-bar/form-field/create-form-field-number.js.map +1 -1
  41. package/dist/src/filter-bar/form-field/create-form-field-select-with-api.js +1 -1
  42. package/dist/src/filter-bar/form-field/create-form-field-select-with-api.js.map +1 -1
  43. package/dist/src/filter-bar/form-field/create-form-field-select.fallback.js +1 -1
  44. package/dist/src/filter-bar/form-field/create-form-field-select.fallback.js.map +1 -1
  45. package/dist/src/filter-bar/form-field/create-form-field-select.js +1 -1
  46. package/dist/src/filter-bar/form-field/create-form-field-select.js.map +1 -1
  47. package/dist/src/filter-bar/form-field/create-form-field-string.js +1 -1
  48. package/dist/src/filter-bar/form-field/create-form-field-string.js.map +1 -1
  49. package/dist/src/filter-bar/index.create.js +1 -1
  50. package/dist/src/filter-bar/index.create.js.map +1 -1
  51. package/dist/src/filter-bar/index.dino.js +1 -1
  52. package/dist/src/filter-bar/index.dino.js.map +1 -1
  53. package/dist/src/filter-bar/types.js.map +1 -1
  54. package/dist/src/form/create.form-base.js +1 -1
  55. package/dist/src/form/create.form-base.js.map +1 -1
  56. package/dist/src/form/create.form-confirm.js +2 -0
  57. package/dist/src/form/create.form-confirm.js.map +1 -0
  58. package/dist/src/form/create.form-grid-layout.js +1 -1
  59. package/dist/src/form/create.form-grid-layout.js.map +1 -1
  60. package/dist/src/form/create.form-grid-layout.units.js +1 -1
  61. package/dist/src/form/create.form-grid-layout.units.js.map +1 -1
  62. package/dist/src/form/create.input.object.js +1 -1
  63. package/dist/src/form/create.input.object.js.map +1 -1
  64. package/dist/src/form/create.input.object.styled.js +1 -1
  65. package/dist/src/form/create.input.object.styled.js.map +1 -1
  66. package/dist/src/form/create.input.object.units.js +2 -0
  67. package/dist/src/form/create.input.object.units.js.map +1 -0
  68. package/dist/src/form/decorator.form.js +1 -1
  69. package/dist/src/form/decorator.form.js.map +1 -1
  70. package/dist/src/form/decorator.units.js +1 -1
  71. package/dist/src/form/decorator.units.js.map +1 -1
  72. package/dist/src/form/dino-form.js +1 -1
  73. package/dist/src/form/dino-form.js.map +1 -1
  74. package/dist/src/form/error-handler.js +1 -1
  75. package/dist/src/form/error-handler.js.map +1 -1
  76. package/dist/src/form/v2/create.date-picker.js +1 -1
  77. package/dist/src/form/v2/create.date-picker.js.map +1 -1
  78. package/dist/src/form/v2/create.input.js +1 -1
  79. package/dist/src/form/v2/create.input.js.map +1 -1
  80. package/dist/src/form/v2/create.select-simple.js +1 -1
  81. package/dist/src/form/v2/create.select-simple.js.map +1 -1
  82. package/dist/src/form/validator.js +1 -1
  83. package/dist/src/form/validator.js.map +1 -1
  84. package/dist/src/form/validator.units.js +2 -0
  85. package/dist/src/form/validator.units.js.map +1 -0
  86. package/dist/src/table/create.table.js +1 -1
  87. package/dist/src/table/create.table.js.map +1 -1
  88. package/dist/src/table/dino.js +1 -1
  89. package/dist/src/table/dino.js.map +1 -1
  90. package/dist/src/table/table.error-panel.js +2 -0
  91. package/dist/src/table/table.error-panel.js.map +1 -0
  92. package/dist/table/index.js +1 -1
  93. package/dist/types/components/confirm-button.d.ts +7 -0
  94. package/dist/types/components/copy-to-clipboard.d.ts +2 -1
  95. package/dist/types/data-surface/index.create.d.ts +21 -6
  96. package/dist/types/data-surface/types.d.ts +1 -1
  97. package/dist/types/data-surface/ui.units.d.ts +2 -2
  98. package/dist/types/data-surface/view-list/column-selector.d.ts +2 -2
  99. package/dist/types/data-surface/view-list/helpers.d.ts +9 -4
  100. package/dist/types/data-surface/view-list/types.d.ts +32 -14
  101. package/dist/types/filter-bar/filter-input.types.d.ts +2 -2
  102. package/dist/types/filter-bar/filter-input.units.d.ts +6 -2
  103. package/dist/types/filter-bar/filter-menu.types.d.ts +2 -2
  104. package/dist/types/filter-bar/filter-summary.types.d.ts +2 -2
  105. package/dist/types/filter-bar/form-field/create-form-field-boolean.d.ts +1 -1
  106. package/dist/types/filter-bar/form-field/create-form-field-number.d.ts +1 -1
  107. package/dist/types/filter-bar/form-field/create-form-field-select-with-api.d.ts +1 -1
  108. package/dist/types/filter-bar/form-field/create-form-field-select.d.ts +1 -1
  109. package/dist/types/filter-bar/form-field/create-form-field-string.d.ts +1 -1
  110. package/dist/types/filter-bar/index.dino.d.ts +6 -6
  111. package/dist/types/filter-bar/types.d.ts +4 -2
  112. package/dist/types/form/create.form-confirm.d.ts +33 -0
  113. package/dist/types/form/create.form-grid-layout.d.ts +15 -5
  114. package/dist/types/form/create.form-grid-layout.units.d.ts +15 -1
  115. package/dist/types/form/create.input.object.d.ts +15 -57
  116. package/dist/types/form/create.input.object.styled.d.ts +5 -0
  117. package/dist/types/form/create.input.object.units.d.ts +88 -0
  118. package/dist/types/form/decorator.units.d.ts +3 -1
  119. package/dist/types/form/dino-form.d.ts +2 -2
  120. package/dist/types/form/error-handler.d.ts +34 -4
  121. package/dist/types/form/index.d.ts +4 -1
  122. package/dist/types/form/v2/create.date-picker.d.ts +3 -3
  123. package/dist/types/form/v2/create.input.d.ts +42 -3
  124. package/dist/types/form/v2/create.select-simple.d.ts +1 -1
  125. package/dist/types/form/validator.d.ts +3 -52
  126. package/dist/types/form/validator.units.d.ts +65 -0
  127. package/dist/types/table/create.table.d.ts +7 -2
  128. package/dist/types/table/dino.d.ts +1 -0
  129. package/dist/types/table/index.d.ts +1 -0
  130. package/dist/types/table/table.error-panel.d.ts +7 -0
  131. package/dist/types/table/types.d.ts +2 -0
  132. package/package.json +1 -1
  133. package/dist/src/form/create.form-comfirm.js +0 -2
  134. package/dist/src/form/create.form-comfirm.js.map +0 -1
  135. package/dist/types/form/create.form-comfirm.d.ts +0 -20
@@ -0,0 +1,65 @@
1
+ export declare enum EValidateRule {
2
+ Required = "Required",
3
+ Regex = "Regex",
4
+ RequiredValue = "RequiredValue",
5
+ Array = "Array",
6
+ Number = "Number",
7
+ Email = "Email",
8
+ PhoneNumber = "PhoneNumber",
9
+ Url = "Url",
10
+ File = "File",
11
+ FileImage = "FileImage",
12
+ FileRequired = "FileRequired",
13
+ Custom = "Custom"
14
+ }
15
+ type IDefaultMessage = {
16
+ [key in EValidateRule]: string;
17
+ };
18
+ export declare const defaultMessage: IDefaultMessage;
19
+ export interface IFileRuleOptions {
20
+ /** Max size of single file in bytes */
21
+ maxSize?: number;
22
+ /** If true, maxSize applies to the total combined size of all files instead of each individual file */
23
+ sumSize?: boolean;
24
+ /** Exact number of files required */
25
+ count?: number;
26
+ /** Max number of files allowed */
27
+ maxCount?: number;
28
+ /** Min number of files required */
29
+ minCount?: number;
30
+ }
31
+ export interface IFileImageRuleOptions extends IFileRuleOptions {
32
+ /** Max image width in pixels */
33
+ maxWidth?: number;
34
+ /** Max image height in pixels */
35
+ maxHeight?: number;
36
+ /** Min image width in pixels */
37
+ minWidth?: number;
38
+ /** Min image height in pixels */
39
+ minHeight?: number;
40
+ }
41
+ export interface IArrayRuleOptions {
42
+ /** Exact number of items required in the array */
43
+ count?: number;
44
+ /** Max number of items allowed in the array */
45
+ maxCount?: number;
46
+ /** Min number of items required in the array */
47
+ minCount?: number;
48
+ }
49
+ export interface INumberRuleOptions {
50
+ /** Max number of value */
51
+ max?: number;
52
+ /** Min number of value */
53
+ min?: number;
54
+ }
55
+ export interface IRuleOptions {
56
+ /** Only apply for file rule */
57
+ file?: IFileRuleOptions;
58
+ /** Only apply for file image rule */
59
+ image?: IFileImageRuleOptions;
60
+ /** Only apply for array rule */
61
+ array?: IArrayRuleOptions;
62
+ /** Only apply for number rule */
63
+ number?: INumberRuleOptions;
64
+ }
65
+ export {};
@@ -2,10 +2,11 @@ import { BoxProps } from '@mui/material';
2
2
  import { DataGridProps, GridColDef, GridFeatureMode, GridFilterOperator } from '@mui/x-data-grid';
3
3
  import { GridValidRowModel, GridRowIdGetter } from '@mui/x-data-grid';
4
4
  import { GridDensity } from '@mui/x-data-grid';
5
- import type { ComponentType } from 'react';
5
+ import type { ComponentType, ReactNode } from 'react';
6
6
  import { IActionRowProps } from './create.action-row';
7
7
  import { ICustomGridColDef, ITableData, ITableQueryParams } from './types';
8
8
  import { IToolbarPannelProps } from './toolbar-pannel';
9
+ import { ITableErrorPanelProps } from './table.error-panel';
9
10
  export interface ITableSlots<T> {
10
11
  maxSelection?: number;
11
12
  density?: GridDensity;
@@ -14,12 +15,16 @@ export interface ITableSlots<T> {
14
15
  toolbarProps?: IToolbarPannelProps;
15
16
  dataGridProps?: DataGridProps;
16
17
  wrapProps?: BoxProps;
18
+ errorPanel?: ComponentType<ITableErrorPanelProps>;
19
+ noRowsOverlay?: ComponentType<any>;
17
20
  }
18
- export type ITableParamsSlots<T> = Pick<ITableSlots<T>, 'maxSelection' | 'toolbarProps' | 'dataGridProps' | 'wrapProps'>;
21
+ export type ITableParamsSlots<T> = Pick<ITableSlots<T>, 'maxSelection' | 'toolbarProps' | 'dataGridProps' | 'wrapProps' | 'errorPanel' | 'noRowsOverlay'>;
19
22
  export interface ITableProps<T> {
20
23
  data?: ITableData<T>;
21
24
  query?: ITableQueryParams<T>;
22
25
  loading?: boolean;
26
+ error?: boolean | string | Error | ReactNode;
27
+ onRetry?: () => void;
23
28
  onChange?: (query: ITableQueryParams<T>) => void;
24
29
  onRowSelectionChange?: DataGridProps['onRowSelectionModelChange'];
25
30
  slots?: ITableSlots<T>;
@@ -32,6 +32,7 @@ declare class DinoTableBase {
32
32
  BtnDetail: FC<import("./ui.buttons").IBtnDetailProps>;
33
33
  createBreadcrumbConfigs: (value: IBreadcrumbConfig[]) => IBreadcrumbConfig[];
34
34
  createBreadcrumbs: (value: IBreadcrumbConfig[]) => FC;
35
+ ErrorPanel: FC<import("./table.error-panel").ITableErrorPanelProps>;
35
36
  createStatusCell: <T extends string>(config: IStatusCellConfig<T>, options?: IStatusCellOptions | undefined) => import("react").ComponentType<import("./ui.units").IStatusCellProps<T>>;
36
37
  formatterDate: (value: any, options?: FormatterDateOptions) => string;
37
38
  valueFormatterDate: (options?: FormatterDateOptions) => (params: GridValueFormatterParams<any>) => string;
@@ -2,6 +2,7 @@ export * from './types';
2
2
  export * from './model-filter';
3
3
  export * from './create.action-row';
4
4
  export * from './create.table';
5
+ export * from './table.error-panel';
5
6
  export { default as DinoTable } from './dino';
6
7
  export { dinoTableClasses } from './styled';
7
8
  export type { IStatusCellConfig } from './ui.units';
@@ -0,0 +1,7 @@
1
+ import type { FC, ReactNode } from 'react';
2
+ export interface ITableErrorPanelProps {
3
+ error?: boolean | string | Error | ReactNode;
4
+ onRetry?: () => void;
5
+ }
6
+ export declare const TableErrorPanel: FC<ITableErrorPanelProps>;
7
+ export default TableErrorPanel;
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from 'react';
1
2
  import { GridColDef, GridLogicOperator, GridPaginationModel, GridSortDirection, GridValidRowModel } from '@mui/x-data-grid';
2
3
  export type ICustomGridColDef<T extends GridValidRowModel> = {
3
4
  [key in keyof T]?: Omit<GridColDef, 'field'>;
@@ -26,6 +27,7 @@ export interface ITableQueryParams<T> {
26
27
  filter?: ICustomGridFilterModel<T>;
27
28
  sort?: ICustomGridSortModel<T>;
28
29
  loading?: boolean;
30
+ error?: boolean | string | Error | ReactNode;
29
31
  detail?: ITableQueryDetail;
30
32
  }
31
33
  export interface ITableData<T> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dinocollab-core",
3
- "version": "2.2.57",
3
+ "version": "2.2.59",
4
4
  "description": "Dinocollab core - libraries for building collaborative applications with React 18",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -1,2 +0,0 @@
1
- import{inherits as r,createClass as n,classCallCheck as e,callSuper as t,defineProperty as o,asyncToGenerator as i,regenerator as l}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as a,jsxs as s}from"react/jsx-runtime";import{Component as c}from"react";import{styled as u,Button as d,Box as p,Card as f,DialogTitle as h,DialogContent as m,DialogActions as v,Typography as g}from"@mui/material";import{fetchDelay as C}from"../utils/helpers.js";import"../utils/dayjs-config.js";import"../utils/query-param.js";import{mapGlobalModalContext as y}from"../api-context/global-modal.js";function k(u){var d=function(){function d(r){var n;return e(this,d),n=t(this,d,[r]),o(n,"renderTitle",function(){var r,e,t=null!==(r=null!==(e=n.props.title)&&void 0!==e?e:null==u?void 0:u.title)&&void 0!==r?r:"";return"string"!=typeof t&&t?t:a(g,{variant:"subtitle1",children:null!=t?t:"Are you sure?"})}),o(n,"renderContent",function(){var r=n.props.children||(null!=u&&u.content?null==u?void 0:u.content(n.props.data):void 0);return r?"string"==typeof r?a(g,{variant:"body2",children:r}):r:null}),o(n,"handleClickNo",function(r){r.close(),n.props.onCancel&&n.props.onCancel()}),o(n,"handleClickYes",function(){var r=i(l().m(function r(e){var t;return l().w(function(r){for(;;)switch(r.p=r.n){case 0:if(n.props.onSubmit){r.n=1;break}return r.a(2);case 1:return r.p=1,n.setState({loading:!0}),r.n=2,C(function(){return n.props.onSubmit(n.props.data)},700);case 2:e.close(),r.n=4;break;case 3:r.p=3,t=r.v,console.log("Handle Click Yes error:",t);case 4:return r.p=4,n.setState({loading:!1}),r.f(4);case 5:return r.a(2)}},r,null,[[1,3,4,5]])}));return function(n){return r.apply(this,arguments)}}()),n.state={loading:!1},n}return r(d,c),n(d,[{key:"render",value:function(){var r=this;return y(function(n){var e,t;return a(p,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:s(f,{children:[a(h,{id:"alert-dialog-title",children:r.renderTitle()}),a(m,{sx:{minWidth:"300px"},children:r.renderContent()}),s(v,{children:[a(b,{disabled:r.state.loading,color:(null==u||null===(e=u.colors)||void 0===e?void 0:e.no)||"inherit",onClick:function(){return r.handleClickNo(n)},children:"No"}),a(b,{color:(null==u||null===(t=u.colors)||void 0===t?void 0:t.yes)||"error",disabled:r.state.loading,onClick:function(){return r.handleClickYes(n)},children:"Yes"})]})]})})})}}])}();return d}var b=u(d)({textTransform:"capitalize",fontWeight:600,"&.MuiButton-colorInherit":{color:"#606060!important"}});export{k as createFormComfirm,k as default};
2
- //# sourceMappingURL=create.form-comfirm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.form-comfirm.js","sources":["../../../src/form/create.form-comfirm.tsx"],"sourcesContent":["import { Component } from 'react'\r\nimport { Box, Button, Card, DialogActions, DialogContent, DialogTitle, styled, Typography } from '@mui/material'\r\nimport { fetchDelay } from '../utils'\r\nimport { IGlobalModalContext, mapGlobalModalContext } from '../api-context'\r\nimport type { ButtonProps } from '@mui/material'\r\nimport type { ComponentType, PropsWithChildren, ReactNode } from 'react'\r\n\r\nexport interface IFormComfirmParam<T> {\r\n title?: ReactNode\r\n content: (value?: T) => ReactNode\r\n colors?: { [key in 'yes' | 'no']?: ButtonProps['color'] }\r\n}\r\n\r\nexport interface IFormComfirmProps<T> extends PropsWithChildren {\r\n data?: T\r\n title?: ReactNode\r\n onSubmit: (value?: T) => Promise<void>\r\n onCancel?: () => void\r\n}\r\n\r\nexport interface IFormComfirmState {\r\n loading?: boolean\r\n}\r\n\r\nexport function createFormComfirm<T = any>(param?: IFormComfirmParam<T>): ComponentType<IFormComfirmProps<T>> {\r\n class FormConfirm extends Component<IFormComfirmProps<T>, IFormComfirmState> {\r\n constructor(props: IFormComfirmProps<T>) {\r\n super(props)\r\n this.state = { loading: false }\r\n }\r\n\r\n renderTitle = () => {\r\n const title = this.props.title ?? param?.title ?? ''\r\n if (typeof title === 'string' || !title) {\r\n return <Typography variant='subtitle1'>{title ?? 'Are you sure?'}</Typography>\r\n }\r\n return title\r\n }\r\n\r\n renderContent = () => {\r\n let content = this.props.children || (param?.content ? param?.content(this.props.data) : undefined)\r\n if (!content) return null\r\n if (typeof content === 'string') {\r\n return <Typography variant='body2'>{content}</Typography>\r\n }\r\n return content\r\n }\r\n\r\n render() {\r\n return mapGlobalModalContext((context) => (\r\n <Box sx={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\r\n <Card>\r\n <DialogTitle id='alert-dialog-title'>{this.renderTitle()}</DialogTitle>\r\n <DialogContent sx={{ minWidth: '300px' }}>{this.renderContent()}</DialogContent>\r\n <DialogActions>\r\n <ButtonStyled disabled={this.state.loading} color={param?.colors?.no || 'inherit'} onClick={() => this.handleClickNo(context)}>\r\n No\r\n </ButtonStyled>\r\n <ButtonStyled color={param?.colors?.yes || 'error'} disabled={this.state.loading} onClick={() => this.handleClickYes(context)}>\r\n Yes\r\n </ButtonStyled>\r\n </DialogActions>\r\n </Card>\r\n </Box>\r\n ))\r\n }\r\n\r\n handleClickNo = (context: IGlobalModalContext) => {\r\n context.close()\r\n this.props.onCancel && this.props.onCancel()\r\n }\r\n\r\n handleClickYes = async (context: IGlobalModalContext) => {\r\n if (!this.props.onSubmit) return\r\n try {\r\n this.setState({ loading: true })\r\n await fetchDelay(() => this.props.onSubmit(this.props.data), 700)\r\n context.close()\r\n } catch (error) {\r\n console.log('Handle Click Yes error:', error)\r\n } finally {\r\n this.setState({ loading: false })\r\n }\r\n }\r\n }\r\n\r\n return FormConfirm\r\n}\r\n\r\nexport default createFormComfirm\r\n\r\nconst ButtonStyled = styled(Button)({\r\n textTransform: 'capitalize',\r\n fontWeight: 600,\r\n '&.MuiButton-colorInherit': { color: '#606060!important' }\r\n})\r\n"],"names":["createFormComfirm","param","FormConfirm","props","_this","_classCallCheck","_callSuper","_defineProperty","_ref","_this$props$title","title","_jsx","Typography","variant","children","content","data","undefined","context","close","onCancel","_ref2","_asyncToGenerator","_regenerator","m","_callee","_t","w","_context","p","n","onSubmit","a","setState","loading","fetchDelay","v","console","log","f","_x","apply","this","arguments","state","_inherits","Component","_createClass","key","value","_this2","mapGlobalModalContext","_param$colors","_param$colors2","Box","sx","flex","display","alignItems","justifyContent","_jsxs","Card","DialogTitle","id","renderTitle","DialogContent","minWidth","renderContent","DialogActions","ButtonStyled","disabled","color","colors","no","onClick","handleClickNo","yes","handleClickYes","styled","Button","textTransform","fontWeight"],"mappings":"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"}
@@ -1,20 +0,0 @@
1
- import type { ButtonProps } from '@mui/material';
2
- import type { ComponentType, PropsWithChildren, ReactNode } from 'react';
3
- export interface IFormComfirmParam<T> {
4
- title?: ReactNode;
5
- content: (value?: T) => ReactNode;
6
- colors?: {
7
- [key in 'yes' | 'no']?: ButtonProps['color'];
8
- };
9
- }
10
- export interface IFormComfirmProps<T> extends PropsWithChildren {
11
- data?: T;
12
- title?: ReactNode;
13
- onSubmit: (value?: T) => Promise<void>;
14
- onCancel?: () => void;
15
- }
16
- export interface IFormComfirmState {
17
- loading?: boolean;
18
- }
19
- export declare function createFormComfirm<T = any>(param?: IFormComfirmParam<T>): ComponentType<IFormComfirmProps<T>>;
20
- export default createFormComfirm;