@bluemarble/bm-components 1.17.0 → 1.18.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.mts +67 -2
- package/dist/index.d.ts +67 -2
- package/dist/index.js +180 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +252 -75
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { ReactNode, FC, Provider } from 'react';
|
|
3
3
|
import * as _mui_material from '@mui/material';
|
|
4
|
-
import { TableCellProps, TableCell, TextFieldProps, StandardTextFieldProps, SelectProps as SelectProps$1, FormControlProps, InputLabelProps, AutocompleteProps as AutocompleteProps$1, AutocompleteRenderInputParams, CheckboxProps as CheckboxProps$1, FormControlLabelProps, SwitchProps as SwitchProps$1, RadioGroupProps, ButtonProps, CircularProgressProps, Theme, SxProps, TableSortLabelProps, BoxProps, PaperProps, TableProps, TableHeadProps, TableBodyProps, ModalProps, DialogProps, AlertColor } from '@mui/material';
|
|
4
|
+
import { TableCellProps, TableCell, TextFieldProps, StandardTextFieldProps, SelectProps as SelectProps$1, FormControlProps, InputLabelProps, AutocompleteProps as AutocompleteProps$1, AutocompleteRenderInputParams, CheckboxProps as CheckboxProps$1, FormControlLabelProps, SwitchProps as SwitchProps$1, RadioGroupProps, ButtonProps, CircularProgressProps, Theme, SxProps, TableSortLabelProps, BoxProps, PaperProps, TableProps, TableHeadProps, TableBodyProps, ModalProps, DialogProps, StackProps, IconButtonProps, TypographyProps, AlertColor } from '@mui/material';
|
|
5
5
|
import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
|
|
6
6
|
import IMask$1 from 'imask';
|
|
7
7
|
import { IconType } from 'react-icons';
|
|
@@ -355,6 +355,71 @@ declare function UseDialogConfirm(): {
|
|
|
355
355
|
|
|
356
356
|
declare const DialogConfirm: (props: IDialogConfirmProps) => React__default.JSX.Element;
|
|
357
357
|
|
|
358
|
+
interface DialogHeaderProps extends StackProps {
|
|
359
|
+
title: string;
|
|
360
|
+
IconButtonProps?: IconButtonProps;
|
|
361
|
+
TypographyProps?: TypographyProps;
|
|
362
|
+
onClose?: () => void;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
interface IBaseDialogContext {
|
|
366
|
+
opened: symbol[];
|
|
367
|
+
isOpened(dialog: symbol): boolean;
|
|
368
|
+
toggle(dialog: symbol): boolean;
|
|
369
|
+
open(dialog: symbol): void;
|
|
370
|
+
close(dialog: symbol): void;
|
|
371
|
+
closeAll(): void;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
declare function useBaseDialog(): IBaseDialogContext;
|
|
375
|
+
declare function useBaseDialogInstance(): {
|
|
376
|
+
name: symbol;
|
|
377
|
+
actions: IBaseDialogContext;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
interface IBaseDialogInstanceProviderProps {
|
|
381
|
+
children: React__default.ReactNode;
|
|
382
|
+
name: symbol;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
interface IBaseDialogContainerProps extends Omit<TModalProps, 'children' | 'open' | 'onClose'> {
|
|
386
|
+
children: React__default.ReactNode | ((props: {
|
|
387
|
+
close: () => void;
|
|
388
|
+
}) => React__default.ReactNode);
|
|
389
|
+
}
|
|
390
|
+
declare const BaseDialogContainer: ({ children, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
|
|
391
|
+
interface IBaseDialogBodyProps extends BoxProps {
|
|
392
|
+
}
|
|
393
|
+
declare const BaseDialogBody: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
|
|
394
|
+
interface IBaseDialogTriggerProps extends Omit<ButtonProps, 'name'> {
|
|
395
|
+
name: symbol;
|
|
396
|
+
}
|
|
397
|
+
declare const BaseDialogTrigger: ({ name, onClick, ...props }: IBaseDialogTriggerProps) => React__default.JSX.Element;
|
|
398
|
+
declare const BaseDialogCreate: (name?: symbol) => {
|
|
399
|
+
name: symbol;
|
|
400
|
+
Trigger: (props: Omit<IBaseDialogTriggerProps, 'name'>) => React__default.JSX.Element;
|
|
401
|
+
Root: (props: Omit<IBaseDialogInstanceProviderProps, 'name'>) => React__default.JSX.Element;
|
|
402
|
+
Container: ({ children, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
|
|
403
|
+
Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
|
|
404
|
+
Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
|
|
405
|
+
};
|
|
406
|
+
declare const BaseDialog: {
|
|
407
|
+
Create: (name?: symbol) => {
|
|
408
|
+
name: symbol;
|
|
409
|
+
Trigger: (props: Omit<IBaseDialogTriggerProps, 'name'>) => React__default.JSX.Element;
|
|
410
|
+
Root: (props: Omit<IBaseDialogInstanceProviderProps, 'name'>) => React__default.JSX.Element;
|
|
411
|
+
Container: ({ children, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
|
|
412
|
+
Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
|
|
413
|
+
Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
|
|
414
|
+
};
|
|
415
|
+
Trigger: ({ name, onClick, ...props }: IBaseDialogTriggerProps) => React__default.JSX.Element;
|
|
416
|
+
Provider: (props: any) => React__default.JSX.Element;
|
|
417
|
+
Root: (props: IBaseDialogInstanceProviderProps) => React__default.JSX.Element;
|
|
418
|
+
Container: ({ children, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
|
|
419
|
+
Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
|
|
420
|
+
Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
|
|
421
|
+
};
|
|
422
|
+
|
|
358
423
|
declare class HttpError extends Error {
|
|
359
424
|
status: number;
|
|
360
425
|
constructor(status: number, message: any);
|
|
@@ -577,4 +642,4 @@ declare function CreateAuthProvider<T>({ api, children, sessionTokenName, Provid
|
|
|
577
642
|
sessionTokenName: string;
|
|
578
643
|
}): React__default.JSX.Element;
|
|
579
644
|
|
|
580
|
-
export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseGrid, BaseGridAutoRows, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, HttpError, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, Modal, Radio, Select, type SortedByProps$1 as SortedByProps, Switch, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createAuthContext, createFilter, filterData, getTabProps, useAlert, useAsyncGrid, useEvent, useFilter, useFormHelper, useGrid, useLoading };
|
|
645
|
+
export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseDialog, BaseDialogBody, BaseDialogContainer, BaseDialogCreate, BaseDialogTrigger, BaseGrid, BaseGridAutoRows, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, HttpError, type IBaseDialogBodyProps, type IBaseDialogContainerProps, type IBaseDialogTriggerProps, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, Modal, Radio, Select, type SortedByProps$1 as SortedByProps, Switch, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createAuthContext, createFilter, filterData, getTabProps, useAlert, useAsyncGrid, useBaseDialog, useBaseDialogInstance, useEvent, useFilter, useFormHelper, useGrid, useLoading };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { ReactNode, FC, Provider } from 'react';
|
|
3
3
|
import * as _mui_material from '@mui/material';
|
|
4
|
-
import { TableCellProps, TableCell, TextFieldProps, StandardTextFieldProps, SelectProps as SelectProps$1, FormControlProps, InputLabelProps, AutocompleteProps as AutocompleteProps$1, AutocompleteRenderInputParams, CheckboxProps as CheckboxProps$1, FormControlLabelProps, SwitchProps as SwitchProps$1, RadioGroupProps, ButtonProps, CircularProgressProps, Theme, SxProps, TableSortLabelProps, BoxProps, PaperProps, TableProps, TableHeadProps, TableBodyProps, ModalProps, DialogProps, AlertColor } from '@mui/material';
|
|
4
|
+
import { TableCellProps, TableCell, TextFieldProps, StandardTextFieldProps, SelectProps as SelectProps$1, FormControlProps, InputLabelProps, AutocompleteProps as AutocompleteProps$1, AutocompleteRenderInputParams, CheckboxProps as CheckboxProps$1, FormControlLabelProps, SwitchProps as SwitchProps$1, RadioGroupProps, ButtonProps, CircularProgressProps, Theme, SxProps, TableSortLabelProps, BoxProps, PaperProps, TableProps, TableHeadProps, TableBodyProps, ModalProps, DialogProps, StackProps, IconButtonProps, TypographyProps, AlertColor } from '@mui/material';
|
|
5
5
|
import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
|
|
6
6
|
import IMask$1 from 'imask';
|
|
7
7
|
import { IconType } from 'react-icons';
|
|
@@ -355,6 +355,71 @@ declare function UseDialogConfirm(): {
|
|
|
355
355
|
|
|
356
356
|
declare const DialogConfirm: (props: IDialogConfirmProps) => React__default.JSX.Element;
|
|
357
357
|
|
|
358
|
+
interface DialogHeaderProps extends StackProps {
|
|
359
|
+
title: string;
|
|
360
|
+
IconButtonProps?: IconButtonProps;
|
|
361
|
+
TypographyProps?: TypographyProps;
|
|
362
|
+
onClose?: () => void;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
interface IBaseDialogContext {
|
|
366
|
+
opened: symbol[];
|
|
367
|
+
isOpened(dialog: symbol): boolean;
|
|
368
|
+
toggle(dialog: symbol): boolean;
|
|
369
|
+
open(dialog: symbol): void;
|
|
370
|
+
close(dialog: symbol): void;
|
|
371
|
+
closeAll(): void;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
declare function useBaseDialog(): IBaseDialogContext;
|
|
375
|
+
declare function useBaseDialogInstance(): {
|
|
376
|
+
name: symbol;
|
|
377
|
+
actions: IBaseDialogContext;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
interface IBaseDialogInstanceProviderProps {
|
|
381
|
+
children: React__default.ReactNode;
|
|
382
|
+
name: symbol;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
interface IBaseDialogContainerProps extends Omit<TModalProps, 'children' | 'open' | 'onClose'> {
|
|
386
|
+
children: React__default.ReactNode | ((props: {
|
|
387
|
+
close: () => void;
|
|
388
|
+
}) => React__default.ReactNode);
|
|
389
|
+
}
|
|
390
|
+
declare const BaseDialogContainer: ({ children, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
|
|
391
|
+
interface IBaseDialogBodyProps extends BoxProps {
|
|
392
|
+
}
|
|
393
|
+
declare const BaseDialogBody: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
|
|
394
|
+
interface IBaseDialogTriggerProps extends Omit<ButtonProps, 'name'> {
|
|
395
|
+
name: symbol;
|
|
396
|
+
}
|
|
397
|
+
declare const BaseDialogTrigger: ({ name, onClick, ...props }: IBaseDialogTriggerProps) => React__default.JSX.Element;
|
|
398
|
+
declare const BaseDialogCreate: (name?: symbol) => {
|
|
399
|
+
name: symbol;
|
|
400
|
+
Trigger: (props: Omit<IBaseDialogTriggerProps, 'name'>) => React__default.JSX.Element;
|
|
401
|
+
Root: (props: Omit<IBaseDialogInstanceProviderProps, 'name'>) => React__default.JSX.Element;
|
|
402
|
+
Container: ({ children, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
|
|
403
|
+
Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
|
|
404
|
+
Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
|
|
405
|
+
};
|
|
406
|
+
declare const BaseDialog: {
|
|
407
|
+
Create: (name?: symbol) => {
|
|
408
|
+
name: symbol;
|
|
409
|
+
Trigger: (props: Omit<IBaseDialogTriggerProps, 'name'>) => React__default.JSX.Element;
|
|
410
|
+
Root: (props: Omit<IBaseDialogInstanceProviderProps, 'name'>) => React__default.JSX.Element;
|
|
411
|
+
Container: ({ children, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
|
|
412
|
+
Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
|
|
413
|
+
Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
|
|
414
|
+
};
|
|
415
|
+
Trigger: ({ name, onClick, ...props }: IBaseDialogTriggerProps) => React__default.JSX.Element;
|
|
416
|
+
Provider: (props: any) => React__default.JSX.Element;
|
|
417
|
+
Root: (props: IBaseDialogInstanceProviderProps) => React__default.JSX.Element;
|
|
418
|
+
Container: ({ children, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
|
|
419
|
+
Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
|
|
420
|
+
Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
|
|
421
|
+
};
|
|
422
|
+
|
|
358
423
|
declare class HttpError extends Error {
|
|
359
424
|
status: number;
|
|
360
425
|
constructor(status: number, message: any);
|
|
@@ -577,4 +642,4 @@ declare function CreateAuthProvider<T>({ api, children, sessionTokenName, Provid
|
|
|
577
642
|
sessionTokenName: string;
|
|
578
643
|
}): React__default.JSX.Element;
|
|
579
644
|
|
|
580
|
-
export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseGrid, BaseGridAutoRows, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, HttpError, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, Modal, Radio, Select, type SortedByProps$1 as SortedByProps, Switch, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createAuthContext, createFilter, filterData, getTabProps, useAlert, useAsyncGrid, useEvent, useFilter, useFormHelper, useGrid, useLoading };
|
|
645
|
+
export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseDialog, BaseDialogBody, BaseDialogContainer, BaseDialogCreate, BaseDialogTrigger, BaseGrid, BaseGridAutoRows, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, HttpError, type IBaseDialogBodyProps, type IBaseDialogContainerProps, type IBaseDialogTriggerProps, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, Modal, Radio, Select, type SortedByProps$1 as SortedByProps, Switch, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createAuthContext, createFilter, filterData, getTabProps, useAlert, useAsyncGrid, useBaseDialog, useBaseDialogInstance, useEvent, useFilter, useFormHelper, useGrid, useLoading };
|
package/dist/index.js
CHANGED
|
@@ -2404,7 +2404,7 @@ function createBox(options = {}) {
|
|
|
2404
2404
|
const BoxRoot = styled("div", {
|
|
2405
2405
|
shouldForwardProp: (prop) => prop !== "theme" && prop !== "sx" && prop !== "as"
|
|
2406
2406
|
})(styleFunctionSx_default);
|
|
2407
|
-
const
|
|
2407
|
+
const Box9 = /* @__PURE__ */ React3.forwardRef(function Box10(inProps, ref) {
|
|
2408
2408
|
const theme = useTheme_default(defaultTheme);
|
|
2409
2409
|
const _extendSxProp = extendSxProp(inProps), {
|
|
2410
2410
|
className,
|
|
@@ -2417,7 +2417,7 @@ function createBox(options = {}) {
|
|
|
2417
2417
|
theme: themeId ? theme[themeId] || theme : theme
|
|
2418
2418
|
}, other));
|
|
2419
2419
|
});
|
|
2420
|
-
return
|
|
2420
|
+
return Box9;
|
|
2421
2421
|
}
|
|
2422
2422
|
|
|
2423
2423
|
// node_modules/@mui/utils/generateUtilityClass/generateUtilityClass.js
|
|
@@ -4157,6 +4157,176 @@ var DialogConfirm = (props) => {
|
|
|
4157
4157
|
))))));
|
|
4158
4158
|
};
|
|
4159
4159
|
|
|
4160
|
+
// src/components/BaseDialog/BaseDialog.tsx
|
|
4161
|
+
|
|
4162
|
+
|
|
4163
|
+
// src/components/BaseDialog/BaseDialogHook.ts
|
|
4164
|
+
|
|
4165
|
+
|
|
4166
|
+
// src/components/BaseDialog/BaseDialogContext.tsx
|
|
4167
|
+
|
|
4168
|
+
|
|
4169
|
+
var BaseDialogContext = _react.createContext.call(void 0, {});
|
|
4170
|
+
var BaseDialogProvider = (props) => {
|
|
4171
|
+
const [openedDialogs, setOpenedDialogs] = _react.useState.call(void 0, []);
|
|
4172
|
+
const isOpened = _react.useCallback.call(void 0,
|
|
4173
|
+
(dialog) => {
|
|
4174
|
+
return openedDialogs.includes(dialog);
|
|
4175
|
+
},
|
|
4176
|
+
[openedDialogs]
|
|
4177
|
+
);
|
|
4178
|
+
const toggleDialog = _react.useCallback.call(void 0,
|
|
4179
|
+
(dialog) => {
|
|
4180
|
+
return openedDialogs.includes(dialog);
|
|
4181
|
+
},
|
|
4182
|
+
[openedDialogs]
|
|
4183
|
+
);
|
|
4184
|
+
const openDialog = _react.useCallback.call(void 0, (dialog) => {
|
|
4185
|
+
return setOpenedDialogs((prev) => {
|
|
4186
|
+
const filteredArr = prev.filter((item) => item !== dialog);
|
|
4187
|
+
return [...filteredArr, dialog];
|
|
4188
|
+
});
|
|
4189
|
+
}, []);
|
|
4190
|
+
const closeDialog = _react.useCallback.call(void 0, (dialog) => {
|
|
4191
|
+
return setOpenedDialogs((prev) => prev.filter((item) => item !== dialog));
|
|
4192
|
+
}, []);
|
|
4193
|
+
const closeAllDialogs = _react.useCallback.call(void 0, () => {
|
|
4194
|
+
return setOpenedDialogs([]);
|
|
4195
|
+
}, [openedDialogs]);
|
|
4196
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
4197
|
+
BaseDialogContext.Provider,
|
|
4198
|
+
{
|
|
4199
|
+
value: {
|
|
4200
|
+
opened: openedDialogs,
|
|
4201
|
+
isOpened,
|
|
4202
|
+
toggle: toggleDialog,
|
|
4203
|
+
open: openDialog,
|
|
4204
|
+
closeAll: closeAllDialogs,
|
|
4205
|
+
close: closeDialog
|
|
4206
|
+
}
|
|
4207
|
+
},
|
|
4208
|
+
props.children
|
|
4209
|
+
);
|
|
4210
|
+
};
|
|
4211
|
+
|
|
4212
|
+
// src/components/BaseDialog/BaseDialogInstanceContext.tsx
|
|
4213
|
+
|
|
4214
|
+
|
|
4215
|
+
var BaseDialogInstanceContext = _react.createContext.call(void 0,
|
|
4216
|
+
{}
|
|
4217
|
+
);
|
|
4218
|
+
var BaseDialogInstanceProvider = (props) => {
|
|
4219
|
+
const actions = useBaseDialog();
|
|
4220
|
+
return /* @__PURE__ */ React2.default.createElement(BaseDialogInstanceContext.Provider, { value: { name: props.name, actions } }, props.children);
|
|
4221
|
+
};
|
|
4222
|
+
|
|
4223
|
+
// src/components/BaseDialog/BaseDialogHook.ts
|
|
4224
|
+
function useBaseDialog() {
|
|
4225
|
+
return _react.useContext.call(void 0, BaseDialogContext);
|
|
4226
|
+
}
|
|
4227
|
+
function useBaseDialogInstance() {
|
|
4228
|
+
return _react.useContext.call(void 0, BaseDialogInstanceContext);
|
|
4229
|
+
}
|
|
4230
|
+
|
|
4231
|
+
// src/components/BaseDialog/BaseDialog.tsx
|
|
4232
|
+
|
|
4233
|
+
|
|
4234
|
+
// src/components/BaseDialog/BaseDialogHeader.tsx
|
|
4235
|
+
|
|
4236
|
+
|
|
4237
|
+
|
|
4238
|
+
|
|
4239
|
+
|
|
4240
|
+
|
|
4241
|
+
|
|
4242
|
+
var BaseDialogHeader = (_a) => {
|
|
4243
|
+
var _b = _a, {
|
|
4244
|
+
title,
|
|
4245
|
+
onClose,
|
|
4246
|
+
IconButtonProps,
|
|
4247
|
+
TypographyProps: TypographyProps2
|
|
4248
|
+
} = _b, props = __objRest(_b, [
|
|
4249
|
+
"title",
|
|
4250
|
+
"onClose",
|
|
4251
|
+
"IconButtonProps",
|
|
4252
|
+
"TypographyProps"
|
|
4253
|
+
]);
|
|
4254
|
+
const { name } = useBaseDialogInstance();
|
|
4255
|
+
const { close: closeDialog } = useBaseDialog();
|
|
4256
|
+
function handleClose() {
|
|
4257
|
+
if (onClose)
|
|
4258
|
+
return onClose();
|
|
4259
|
+
closeDialog(name);
|
|
4260
|
+
}
|
|
4261
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
4262
|
+
_material.Stack,
|
|
4263
|
+
__spreadValues({
|
|
4264
|
+
direction: "row",
|
|
4265
|
+
alignItems: "center",
|
|
4266
|
+
justifyContent: "space-between",
|
|
4267
|
+
px: 2,
|
|
4268
|
+
my: 1
|
|
4269
|
+
}, props),
|
|
4270
|
+
/* @__PURE__ */ React2.default.createElement(_material.Typography, __spreadValues({ variant: "h6", fontWeight: "bold" }, TypographyProps2), title),
|
|
4271
|
+
/* @__PURE__ */ React2.default.createElement(_material.IconButton, __spreadProps(__spreadValues({}, IconButtonProps), { onClick: handleClose }), /* @__PURE__ */ React2.default.createElement(_md.MdClose, null))
|
|
4272
|
+
);
|
|
4273
|
+
};
|
|
4274
|
+
|
|
4275
|
+
// src/components/BaseDialog/BaseDialog.tsx
|
|
4276
|
+
var BaseDialogContainer = (_a) => {
|
|
4277
|
+
var _b = _a, {
|
|
4278
|
+
children
|
|
4279
|
+
} = _b, rest = __objRest(_b, [
|
|
4280
|
+
"children"
|
|
4281
|
+
]);
|
|
4282
|
+
const { name } = useBaseDialogInstance();
|
|
4283
|
+
const { isOpened, close: closeDialog } = useBaseDialog();
|
|
4284
|
+
return /* @__PURE__ */ React2.default.createElement(Modal, __spreadValues({ open: isOpened(name), onClose: () => closeDialog(name) }, rest), children instanceof Function ? children({ close: () => closeDialog(name) }) : children);
|
|
4285
|
+
};
|
|
4286
|
+
var BaseDialogBody = (props) => {
|
|
4287
|
+
return /* @__PURE__ */ React2.default.createElement(_material.Box, __spreadValues({ px: 2, pb: 2, width: "100vw", maxWidth: 650 }, props), props.children);
|
|
4288
|
+
};
|
|
4289
|
+
var BaseDialogTrigger = (_a) => {
|
|
4290
|
+
var _b = _a, {
|
|
4291
|
+
name,
|
|
4292
|
+
onClick
|
|
4293
|
+
} = _b, props = __objRest(_b, [
|
|
4294
|
+
"name",
|
|
4295
|
+
"onClick"
|
|
4296
|
+
]);
|
|
4297
|
+
const { open } = useBaseDialog();
|
|
4298
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
4299
|
+
_material.Button,
|
|
4300
|
+
__spreadProps(__spreadValues({}, props), {
|
|
4301
|
+
onClick: (...params) => {
|
|
4302
|
+
if (onClick)
|
|
4303
|
+
onClick(...params);
|
|
4304
|
+
open(name);
|
|
4305
|
+
}
|
|
4306
|
+
}),
|
|
4307
|
+
props.children
|
|
4308
|
+
);
|
|
4309
|
+
};
|
|
4310
|
+
var BaseDialogCreate = (name = Symbol()) => {
|
|
4311
|
+
return {
|
|
4312
|
+
name,
|
|
4313
|
+
Trigger: (props) => /* @__PURE__ */ React2.default.createElement(BaseDialogTrigger, __spreadValues({ name }, props)),
|
|
4314
|
+
Root: (props) => /* @__PURE__ */ React2.default.createElement(BaseDialogInstanceProvider, __spreadValues({ name }, props)),
|
|
4315
|
+
Container: BaseDialogContainer,
|
|
4316
|
+
Header: BaseDialogHeader,
|
|
4317
|
+
Body: BaseDialogBody
|
|
4318
|
+
};
|
|
4319
|
+
};
|
|
4320
|
+
var BaseDialog = {
|
|
4321
|
+
Create: BaseDialogCreate,
|
|
4322
|
+
Trigger: BaseDialogTrigger,
|
|
4323
|
+
Provider: BaseDialogProvider,
|
|
4324
|
+
Root: BaseDialogInstanceProvider,
|
|
4325
|
+
Container: BaseDialogContainer,
|
|
4326
|
+
Header: BaseDialogHeader,
|
|
4327
|
+
Body: BaseDialogBody
|
|
4328
|
+
};
|
|
4329
|
+
|
|
4160
4330
|
// src/errors/HttpError.ts
|
|
4161
4331
|
var HttpError = class extends Error {
|
|
4162
4332
|
constructor(status, message) {
|
|
@@ -5306,7 +5476,14 @@ function CreateAuthProvider({
|
|
|
5306
5476
|
|
|
5307
5477
|
|
|
5308
5478
|
|
|
5309
|
-
|
|
5479
|
+
|
|
5480
|
+
|
|
5481
|
+
|
|
5482
|
+
|
|
5483
|
+
|
|
5484
|
+
|
|
5485
|
+
|
|
5486
|
+
exports.AlertContext = AlertContext; exports.AlertProvider = AlertProvider; exports.ApiHelper = ApiHelper; exports.AuthHelper = AuthHelper; exports.Autocomplete = Autocomplete2; exports.BaseDialog = BaseDialog; exports.BaseDialogBody = BaseDialogBody; exports.BaseDialogContainer = BaseDialogContainer; exports.BaseDialogCreate = BaseDialogCreate; exports.BaseDialogTrigger = BaseDialogTrigger; exports.BaseGrid = BaseGrid; exports.BaseGridAutoRows = BaseGridAutoRows; exports.Checkbox = Checkbox; exports.CreateAuthProvider = CreateAuthProvider; exports.Dialog = Dialog; exports.DialogConfirm = DialogConfirm; exports.DomainError = DomainError; exports.EditableTableCell = EditableTableCell; exports.FormHelperContext = FormHelperContext; exports.FormHelperProvider = FormHelperProvider; exports.GetInputLabel = GetInputLabel; exports.Grid = Grid_default; exports.HttpError = HttpError; exports.Input = Input; exports.InputMask = InputMask2; exports.LargeButton = LargeButton; exports.Modal = Modal; exports.Radio = Radio; exports.Select = Select; exports.Switch = Switch; exports.TabPanel = TabPanel; exports.Td = Td; exports.Tr = Tr; exports.UseDialogConfirm = UseDialogConfirm; exports.createAuthContext = createAuthContext; exports.createFilter = createFilter; exports.filterData = filterData; exports.getTabProps = getTabProps; exports.useAlert = useAlert; exports.useAsyncGrid = useAsyncGrid; exports.useBaseDialog = useBaseDialog; exports.useBaseDialogInstance = useBaseDialogInstance; exports.useEvent = useEvent; exports.useFilter = useFilter; exports.useFormHelper = useFormHelper; exports.useGrid = useGrid; exports.useLoading = useLoading;
|
|
5310
5487
|
/*! Bundled license information:
|
|
5311
5488
|
|
|
5312
5489
|
react-is/cjs/react-is.production.min.js:
|