@bluemarble/bm-components 0.0.93 → 0.0.95
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 +82 -24
- package/dist/index.d.ts +82 -24
- package/dist/index.js +346 -92
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +360 -106
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -52,6 +52,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
52
52
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
53
53
|
mod
|
|
54
54
|
));
|
|
55
|
+
var __async = (__this, __arguments, generator) => {
|
|
56
|
+
return new Promise((resolve, reject) => {
|
|
57
|
+
var fulfilled = (value) => {
|
|
58
|
+
try {
|
|
59
|
+
step(generator.next(value));
|
|
60
|
+
} catch (e) {
|
|
61
|
+
reject(e);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var rejected = (value) => {
|
|
65
|
+
try {
|
|
66
|
+
step(generator.throw(value));
|
|
67
|
+
} catch (e) {
|
|
68
|
+
reject(e);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
72
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
73
|
+
});
|
|
74
|
+
};
|
|
55
75
|
|
|
56
76
|
// node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
|
57
77
|
var require_react_is_production_min = __commonJS({
|
|
@@ -3815,7 +3835,328 @@ function BaseGrid({
|
|
|
3815
3835
|
);
|
|
3816
3836
|
}
|
|
3817
3837
|
|
|
3818
|
-
// src/components/
|
|
3838
|
+
// src/components/Modal/index.tsx
|
|
3839
|
+
|
|
3840
|
+
|
|
3841
|
+
|
|
3842
|
+
|
|
3843
|
+
|
|
3844
|
+
var Modal = (_a) => {
|
|
3845
|
+
var _b = _a, { open, onClose } = _b, rest = __objRest(_b, ["open", "onClose"]);
|
|
3846
|
+
return /* @__PURE__ */ React4.default.createElement(_material.Modal, __spreadValues({ open, onClose, disableEnforceFocus: true }, rest), /* @__PURE__ */ React4.default.createElement(
|
|
3847
|
+
_material.Box,
|
|
3848
|
+
{
|
|
3849
|
+
sx: {
|
|
3850
|
+
outline: "none",
|
|
3851
|
+
backgroundColor: "white",
|
|
3852
|
+
position: "absolute",
|
|
3853
|
+
top: "50%",
|
|
3854
|
+
left: "50%",
|
|
3855
|
+
transform: "translate(-50%, -50%)",
|
|
3856
|
+
borderRadius: 1
|
|
3857
|
+
}
|
|
3858
|
+
},
|
|
3859
|
+
/* @__PURE__ */ React4.default.createElement(React4.default.Fragment, null, rest.children)
|
|
3860
|
+
));
|
|
3861
|
+
};
|
|
3862
|
+
|
|
3863
|
+
// src/components/utils/GetInputLabel.ts
|
|
3864
|
+
function GetInputLabel(columns) {
|
|
3865
|
+
return (columnName) => {
|
|
3866
|
+
const column = columns.find((column2) => column2.name === columnName);
|
|
3867
|
+
return { label: column.label, name: column.name };
|
|
3868
|
+
};
|
|
3869
|
+
}
|
|
3870
|
+
|
|
3871
|
+
// src/components/Dialog/index.tsx
|
|
3872
|
+
|
|
3873
|
+
|
|
3874
|
+
|
|
3875
|
+
|
|
3876
|
+
|
|
3877
|
+
|
|
3878
|
+
|
|
3879
|
+
|
|
3880
|
+
|
|
3881
|
+
|
|
3882
|
+
var Dialog = (_a) => {
|
|
3883
|
+
var _b = _a, {
|
|
3884
|
+
open,
|
|
3885
|
+
title,
|
|
3886
|
+
loading,
|
|
3887
|
+
body,
|
|
3888
|
+
options
|
|
3889
|
+
} = _b, rest = __objRest(_b, [
|
|
3890
|
+
"open",
|
|
3891
|
+
"title",
|
|
3892
|
+
"loading",
|
|
3893
|
+
"body",
|
|
3894
|
+
"options"
|
|
3895
|
+
]);
|
|
3896
|
+
return /* @__PURE__ */ React4.default.createElement(_material.Dialog, __spreadValues({ open }, rest), /* @__PURE__ */ React4.default.createElement(_material.Box, { sx: { p: 2 } }, /* @__PURE__ */ React4.default.createElement(_material.DialogTitle, { sx: { fontWeight: "bold" } }, title), /* @__PURE__ */ React4.default.createElement(_material.DialogContentText, { sx: { px: "10px", textAlign: "center", mb: 2 } }, body), /* @__PURE__ */ React4.default.createElement(_material.DialogActions, null, options.map((option, index) => {
|
|
3897
|
+
return /* @__PURE__ */ React4.default.createElement(
|
|
3898
|
+
_material.Button,
|
|
3899
|
+
{
|
|
3900
|
+
key: index,
|
|
3901
|
+
onClick: () => option.cb(option.label),
|
|
3902
|
+
variant: option.focus ? "contained" : "text",
|
|
3903
|
+
sx: {
|
|
3904
|
+
fontWeight: option.focus ? "bold" : "normal",
|
|
3905
|
+
color: option.focus ? "#fff" : "primary.main"
|
|
3906
|
+
},
|
|
3907
|
+
disableElevation: true,
|
|
3908
|
+
disabled: loading
|
|
3909
|
+
},
|
|
3910
|
+
loading && option.focus ? /* @__PURE__ */ React4.default.createElement(_material.CircularProgress, { size: 25, color: "inherit" }) : /* @__PURE__ */ React4.default.createElement(React4.default.Fragment, null, option.label)
|
|
3911
|
+
);
|
|
3912
|
+
}))));
|
|
3913
|
+
};
|
|
3914
|
+
|
|
3915
|
+
// src/errors/HttpError.ts
|
|
3916
|
+
var HttpError = class extends Error {
|
|
3917
|
+
constructor(status, message) {
|
|
3918
|
+
super(message);
|
|
3919
|
+
this.message = message;
|
|
3920
|
+
this.stack = `HttpError: ${message}`;
|
|
3921
|
+
this.status = status;
|
|
3922
|
+
}
|
|
3923
|
+
};
|
|
3924
|
+
|
|
3925
|
+
// src/helpers/apiHelper/index.ts
|
|
3926
|
+
var ApiHelper = class _ApiHelper {
|
|
3927
|
+
onFinally() {
|
|
3928
|
+
}
|
|
3929
|
+
constructor(props) {
|
|
3930
|
+
this.middlewares = (props == null ? void 0 : props.middlewares.reverse()) || [];
|
|
3931
|
+
this.onFinally = props.onFinally;
|
|
3932
|
+
}
|
|
3933
|
+
setMiddlewares(middlewares) {
|
|
3934
|
+
this.middlewares = middlewares.reverse();
|
|
3935
|
+
return this;
|
|
3936
|
+
}
|
|
3937
|
+
createMethods(methods) {
|
|
3938
|
+
return (req, res) => __async(this, null, function* () {
|
|
3939
|
+
const currentMethod = methods[req.method];
|
|
3940
|
+
try {
|
|
3941
|
+
if (!currentMethod)
|
|
3942
|
+
throw new HttpError(405, "M\xE9todo inv\xE1lido");
|
|
3943
|
+
const methodWithMiddlewares = this.middlewares.reduce(
|
|
3944
|
+
(acc, fn) => fn(acc),
|
|
3945
|
+
currentMethod
|
|
3946
|
+
);
|
|
3947
|
+
yield methodWithMiddlewares(req, res);
|
|
3948
|
+
} catch (error) {
|
|
3949
|
+
if (error instanceof HttpError)
|
|
3950
|
+
return res.status(error.status).json(error.message);
|
|
3951
|
+
if (process.env.NODE_ENV === "production")
|
|
3952
|
+
return res.status(500).json({
|
|
3953
|
+
code: "internal.error",
|
|
3954
|
+
error: "Erro interno do servidor",
|
|
3955
|
+
details: error
|
|
3956
|
+
});
|
|
3957
|
+
throw new Error(error);
|
|
3958
|
+
} finally {
|
|
3959
|
+
this.onFinally();
|
|
3960
|
+
}
|
|
3961
|
+
});
|
|
3962
|
+
}
|
|
3963
|
+
static parserErrorWrapper(body, parser) {
|
|
3964
|
+
try {
|
|
3965
|
+
const object = parser.parse(body);
|
|
3966
|
+
return object;
|
|
3967
|
+
} catch (error) {
|
|
3968
|
+
throw new HttpError(400, {
|
|
3969
|
+
code: "invalid.body",
|
|
3970
|
+
error: "Dados inv\xE1lidos",
|
|
3971
|
+
details: error
|
|
3972
|
+
});
|
|
3973
|
+
}
|
|
3974
|
+
}
|
|
3975
|
+
static parseQueyFilters(filters) {
|
|
3976
|
+
return Object.entries(filters).reduce((acc, [key, value]) => {
|
|
3977
|
+
if (value)
|
|
3978
|
+
acc[key] = value;
|
|
3979
|
+
return acc;
|
|
3980
|
+
}, {});
|
|
3981
|
+
}
|
|
3982
|
+
static create({ onFinally }) {
|
|
3983
|
+
return new _ApiHelper({
|
|
3984
|
+
onFinally
|
|
3985
|
+
});
|
|
3986
|
+
}
|
|
3987
|
+
};
|
|
3988
|
+
|
|
3989
|
+
// src/hooks/useFormHelper.ts
|
|
3990
|
+
var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
|
|
3991
|
+
|
|
3992
|
+
|
|
3993
|
+
// src/hooks/useAlert.ts
|
|
3994
|
+
|
|
3995
|
+
|
|
3996
|
+
// src/contexts/AlertContext.tsx
|
|
3997
|
+
|
|
3998
|
+
|
|
3999
|
+
|
|
4000
|
+
// src/components/Toast/index.tsx
|
|
4001
|
+
|
|
4002
|
+
|
|
4003
|
+
|
|
4004
|
+
var Toast = ({ open, onClose, severity, message }) => {
|
|
4005
|
+
return /* @__PURE__ */ React4.default.createElement(React4.default.Fragment, null, /* @__PURE__ */ React4.default.createElement(
|
|
4006
|
+
_material.Snackbar,
|
|
4007
|
+
{
|
|
4008
|
+
open,
|
|
4009
|
+
autoHideDuration: 6e3,
|
|
4010
|
+
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
4011
|
+
sx: { zIndex: 99999999 }
|
|
4012
|
+
},
|
|
4013
|
+
/* @__PURE__ */ React4.default.createElement(
|
|
4014
|
+
_material.Alert,
|
|
4015
|
+
{
|
|
4016
|
+
severity,
|
|
4017
|
+
elevation: 2,
|
|
4018
|
+
sx: { mb: 2 },
|
|
4019
|
+
action: /* @__PURE__ */ React4.default.createElement(
|
|
4020
|
+
_material.IconButton,
|
|
4021
|
+
{
|
|
4022
|
+
"aria-label": "close",
|
|
4023
|
+
color: "inherit",
|
|
4024
|
+
size: "small",
|
|
4025
|
+
onClick: onClose
|
|
4026
|
+
},
|
|
4027
|
+
/* @__PURE__ */ React4.default.createElement(_md.MdClose, { fontSize: "inherit" })
|
|
4028
|
+
)
|
|
4029
|
+
},
|
|
4030
|
+
message
|
|
4031
|
+
)
|
|
4032
|
+
));
|
|
4033
|
+
};
|
|
4034
|
+
|
|
4035
|
+
// src/contexts/AlertContext.tsx
|
|
4036
|
+
var AlertContext = _react.createContext.call(void 0, {});
|
|
4037
|
+
var AlertProvider = ({ children }) => {
|
|
4038
|
+
const [severity, setSeverity] = _react.useState.call(void 0, "info");
|
|
4039
|
+
const [message, setMessage] = _react.useState.call(void 0, "");
|
|
4040
|
+
const [isVisible, setIsVisible] = _react.useState.call(void 0, false);
|
|
4041
|
+
const createAlert = (newMessage, severity2) => {
|
|
4042
|
+
setMessage(newMessage);
|
|
4043
|
+
setSeverity(severity2);
|
|
4044
|
+
setIsVisible(true);
|
|
4045
|
+
};
|
|
4046
|
+
function onCloseToast() {
|
|
4047
|
+
setIsVisible(false);
|
|
4048
|
+
}
|
|
4049
|
+
return /* @__PURE__ */ React4.default.createElement(AlertContext.Provider, { value: { createAlert } }, children, /* @__PURE__ */ React4.default.createElement(
|
|
4050
|
+
Toast,
|
|
4051
|
+
{
|
|
4052
|
+
open: isVisible,
|
|
4053
|
+
onClose: onCloseToast,
|
|
4054
|
+
severity,
|
|
4055
|
+
message
|
|
4056
|
+
}
|
|
4057
|
+
));
|
|
4058
|
+
};
|
|
4059
|
+
|
|
4060
|
+
// src/hooks/useAlert.ts
|
|
4061
|
+
var useAlert = () => {
|
|
4062
|
+
return _react.useContext.call(void 0, AlertContext);
|
|
4063
|
+
};
|
|
4064
|
+
|
|
4065
|
+
// src/hooks/useLoading.ts
|
|
4066
|
+
|
|
4067
|
+
function useLoading() {
|
|
4068
|
+
const [state, setState] = _react.useState.call(void 0, []);
|
|
4069
|
+
const isLoading = (prop) => state.includes(prop);
|
|
4070
|
+
const setLoading = (prop, remove) => {
|
|
4071
|
+
if (remove)
|
|
4072
|
+
setState((prevState) => prevState.filter((state2) => state2 !== prop));
|
|
4073
|
+
else
|
|
4074
|
+
setState((prevState) => [...prevState, prop]);
|
|
4075
|
+
};
|
|
4076
|
+
return { isLoading, setLoading };
|
|
4077
|
+
}
|
|
4078
|
+
|
|
4079
|
+
// src/hooks/useFormHelper.ts
|
|
4080
|
+
function useFormHelper({ formatErrorMessage, api }) {
|
|
4081
|
+
const alertProps = useAlert();
|
|
4082
|
+
const loadingProps = useLoading();
|
|
4083
|
+
const { createAlert } = alertProps;
|
|
4084
|
+
const { setLoading } = loadingProps;
|
|
4085
|
+
const sourceRef = _react.useRef.call(void 0, );
|
|
4086
|
+
function onSubmitWrapper(fn, { name }) {
|
|
4087
|
+
return (fields, methods) => __async(this, null, function* () {
|
|
4088
|
+
const LOADING_NAME = name;
|
|
4089
|
+
setLoading(LOADING_NAME);
|
|
4090
|
+
try {
|
|
4091
|
+
yield fn(fields, methods);
|
|
4092
|
+
} catch (error) {
|
|
4093
|
+
errorHandler(error, methods.setErrors);
|
|
4094
|
+
} finally {
|
|
4095
|
+
setLoading(LOADING_NAME, true);
|
|
4096
|
+
}
|
|
4097
|
+
});
|
|
4098
|
+
}
|
|
4099
|
+
function onRequestWrapper(fn, { name }) {
|
|
4100
|
+
return (...params) => __async(this, null, function* () {
|
|
4101
|
+
if (name.includes("get:"))
|
|
4102
|
+
sourceRef.current = _axios2.default.CancelToken.source();
|
|
4103
|
+
const LOADING_NAME = name;
|
|
4104
|
+
setLoading(LOADING_NAME);
|
|
4105
|
+
api.interceptors.request.use(
|
|
4106
|
+
(config) => {
|
|
4107
|
+
var _a;
|
|
4108
|
+
if (!config.cancelToken && sourceRef.current && config.method === "get") {
|
|
4109
|
+
config.cancelToken = (_a = sourceRef.current) == null ? void 0 : _a.token;
|
|
4110
|
+
}
|
|
4111
|
+
return config;
|
|
4112
|
+
},
|
|
4113
|
+
(error) => {
|
|
4114
|
+
console.log("[middleware]");
|
|
4115
|
+
return Promise.reject(error);
|
|
4116
|
+
}
|
|
4117
|
+
);
|
|
4118
|
+
try {
|
|
4119
|
+
const response = yield fn(...params);
|
|
4120
|
+
return response;
|
|
4121
|
+
} catch (error) {
|
|
4122
|
+
errorHandler(error);
|
|
4123
|
+
} finally {
|
|
4124
|
+
setLoading(LOADING_NAME, true);
|
|
4125
|
+
}
|
|
4126
|
+
});
|
|
4127
|
+
}
|
|
4128
|
+
function errorHandler(error, callback) {
|
|
4129
|
+
if ((error == null ? void 0 : error.message) === "cancel.navigation")
|
|
4130
|
+
return;
|
|
4131
|
+
if (callback) {
|
|
4132
|
+
if (error.response.data.code === "invalid.body") {
|
|
4133
|
+
const errors = error.response.data.details.issues;
|
|
4134
|
+
const currentErrors = errors.reduce((acc, item) => {
|
|
4135
|
+
acc[item.path.join(".")] = item.message;
|
|
4136
|
+
return acc;
|
|
4137
|
+
}, {});
|
|
4138
|
+
callback(currentErrors);
|
|
4139
|
+
}
|
|
4140
|
+
}
|
|
4141
|
+
createAlert(formatErrorMessage(error), "error");
|
|
4142
|
+
}
|
|
4143
|
+
_react.useEffect.call(void 0, () => {
|
|
4144
|
+
return () => {
|
|
4145
|
+
var _a;
|
|
4146
|
+
(_a = sourceRef.current) == null ? void 0 : _a.cancel("cancel.navigation");
|
|
4147
|
+
};
|
|
4148
|
+
}, []);
|
|
4149
|
+
return __spreadProps(__spreadValues(__spreadValues({}, alertProps), loadingProps), {
|
|
4150
|
+
onSubmitWrapper,
|
|
4151
|
+
onRequestWrapper
|
|
4152
|
+
});
|
|
4153
|
+
}
|
|
4154
|
+
|
|
4155
|
+
// src/hooks/useGrid.ts
|
|
4156
|
+
|
|
4157
|
+
|
|
4158
|
+
// src/hooks/useFilter.ts
|
|
4159
|
+
|
|
3819
4160
|
|
|
3820
4161
|
|
|
3821
4162
|
// src/components/utils/getObjectValue.ts
|
|
@@ -3823,9 +4164,7 @@ function getObjectValue(obj) {
|
|
|
3823
4164
|
return (prop) => prop.split(".").reduce((o, k) => o[k], obj);
|
|
3824
4165
|
}
|
|
3825
4166
|
|
|
3826
|
-
// src/
|
|
3827
|
-
|
|
3828
|
-
|
|
4167
|
+
// src/hooks/useFilter.ts
|
|
3829
4168
|
function useFilter() {
|
|
3830
4169
|
const [selectedFilters, setSelectedFilters] = _react.useState.call(void 0, []);
|
|
3831
4170
|
const filterBy = (newFilter) => {
|
|
@@ -3897,7 +4236,7 @@ function createFilter(filters) {
|
|
|
3897
4236
|
};
|
|
3898
4237
|
}
|
|
3899
4238
|
|
|
3900
|
-
// src/
|
|
4239
|
+
// src/hooks/useGrid.ts
|
|
3901
4240
|
function useGrid({
|
|
3902
4241
|
columns,
|
|
3903
4242
|
filters = [],
|
|
@@ -4030,7 +4369,7 @@ function createSearch(options) {
|
|
|
4030
4369
|
};
|
|
4031
4370
|
}
|
|
4032
4371
|
|
|
4033
|
-
// src/
|
|
4372
|
+
// src/hooks/useEvent.ts
|
|
4034
4373
|
|
|
4035
4374
|
function useEvent(event, handler, passive = false) {
|
|
4036
4375
|
_react.useEffect.call(void 0, () => {
|
|
@@ -4041,97 +4380,12 @@ function useEvent(event, handler, passive = false) {
|
|
|
4041
4380
|
});
|
|
4042
4381
|
}
|
|
4043
4382
|
|
|
4044
|
-
// src/components/hooks/useLoading.ts
|
|
4045
4383
|
|
|
4046
|
-
function useLoading() {
|
|
4047
|
-
const [state, setState] = _react.useState.call(void 0, []);
|
|
4048
|
-
const isLoading = (prop) => state.includes(prop);
|
|
4049
|
-
const setLoading = (prop, remove) => {
|
|
4050
|
-
if (remove)
|
|
4051
|
-
setState((prevState) => prevState.filter((state2) => state2 !== prop));
|
|
4052
|
-
else
|
|
4053
|
-
setState((prevState) => [...prevState, prop]);
|
|
4054
|
-
};
|
|
4055
|
-
return { isLoading, setLoading };
|
|
4056
|
-
}
|
|
4057
|
-
|
|
4058
|
-
// src/components/Modal/index.tsx
|
|
4059
4384
|
|
|
4060
4385
|
|
|
4061
4386
|
|
|
4062
4387
|
|
|
4063
4388
|
|
|
4064
|
-
var Modal = (_a) => {
|
|
4065
|
-
var _b = _a, { open, onClose } = _b, rest = __objRest(_b, ["open", "onClose"]);
|
|
4066
|
-
return /* @__PURE__ */ React4.default.createElement(_material.Modal, __spreadValues({ open, onClose, disableEnforceFocus: true }, rest), /* @__PURE__ */ React4.default.createElement(
|
|
4067
|
-
_material.Box,
|
|
4068
|
-
{
|
|
4069
|
-
sx: {
|
|
4070
|
-
outline: "none",
|
|
4071
|
-
backgroundColor: "white",
|
|
4072
|
-
position: "absolute",
|
|
4073
|
-
top: "50%",
|
|
4074
|
-
left: "50%",
|
|
4075
|
-
transform: "translate(-50%, -50%)",
|
|
4076
|
-
borderRadius: 1
|
|
4077
|
-
}
|
|
4078
|
-
},
|
|
4079
|
-
/* @__PURE__ */ React4.default.createElement(React4.default.Fragment, null, rest.children)
|
|
4080
|
-
));
|
|
4081
|
-
};
|
|
4082
|
-
|
|
4083
|
-
// src/components/utils/GetInputLabel.ts
|
|
4084
|
-
function GetInputLabel(columns) {
|
|
4085
|
-
return (columnName) => {
|
|
4086
|
-
const column = columns.find((column2) => column2.name === columnName);
|
|
4087
|
-
return { label: column.label, name: column.name };
|
|
4088
|
-
};
|
|
4089
|
-
}
|
|
4090
|
-
|
|
4091
|
-
// src/components/Dialog/index.tsx
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
var Dialog = (_a) => {
|
|
4103
|
-
var _b = _a, {
|
|
4104
|
-
open,
|
|
4105
|
-
title,
|
|
4106
|
-
loading,
|
|
4107
|
-
body,
|
|
4108
|
-
options
|
|
4109
|
-
} = _b, rest = __objRest(_b, [
|
|
4110
|
-
"open",
|
|
4111
|
-
"title",
|
|
4112
|
-
"loading",
|
|
4113
|
-
"body",
|
|
4114
|
-
"options"
|
|
4115
|
-
]);
|
|
4116
|
-
return /* @__PURE__ */ React4.default.createElement(_material.Dialog, __spreadValues({ open }, rest), /* @__PURE__ */ React4.default.createElement(_material.Box, { sx: { p: 2 } }, /* @__PURE__ */ React4.default.createElement(_material.DialogTitle, { sx: { fontWeight: "bold" } }, title), /* @__PURE__ */ React4.default.createElement(_material.DialogContentText, { sx: { px: "10px", textAlign: "center", mb: 2 } }, body), /* @__PURE__ */ React4.default.createElement(_material.DialogActions, null, options.map((option, index) => {
|
|
4117
|
-
return /* @__PURE__ */ React4.default.createElement(
|
|
4118
|
-
_material.Button,
|
|
4119
|
-
{
|
|
4120
|
-
key: index,
|
|
4121
|
-
onClick: () => option.cb(option.label),
|
|
4122
|
-
variant: option.focus ? "contained" : "text",
|
|
4123
|
-
sx: {
|
|
4124
|
-
fontWeight: option.focus ? "bold" : "normal",
|
|
4125
|
-
color: option.focus ? "#fff" : "primary.main"
|
|
4126
|
-
},
|
|
4127
|
-
disableElevation: true,
|
|
4128
|
-
disabled: loading
|
|
4129
|
-
},
|
|
4130
|
-
loading && option.focus ? /* @__PURE__ */ React4.default.createElement(_material.CircularProgress, { size: 25, color: "inherit" }) : /* @__PURE__ */ React4.default.createElement(React4.default.Fragment, null, option.label)
|
|
4131
|
-
);
|
|
4132
|
-
}))));
|
|
4133
|
-
};
|
|
4134
|
-
|
|
4135
4389
|
|
|
4136
4390
|
|
|
4137
4391
|
|
|
@@ -4156,7 +4410,7 @@ var Dialog = (_a) => {
|
|
|
4156
4410
|
|
|
4157
4411
|
|
|
4158
4412
|
|
|
4159
|
-
exports.Autocomplete = Autocomplete2; exports.BaseGrid = BaseGrid; exports.Checkbox = Checkbox; exports.Dialog = Dialog; exports.EditableTableCell = EditableTableCell; exports.GetInputLabel = GetInputLabel; exports.Grid = Grid_default; 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.createFilter = createFilter; exports.filterData = filterData; exports.getTabProps = getTabProps; exports.useEvent = useEvent; exports.useFilter = useFilter; exports.useGrid = useGrid; exports.useLoading = useLoading;
|
|
4413
|
+
exports.AlertContext = AlertContext; exports.AlertProvider = AlertProvider; exports.ApiHelper = ApiHelper; exports.Autocomplete = Autocomplete2; exports.BaseGrid = BaseGrid; exports.Checkbox = Checkbox; exports.Dialog = Dialog; exports.EditableTableCell = EditableTableCell; 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.createFilter = createFilter; exports.filterData = filterData; exports.getTabProps = getTabProps; exports.useAlert = useAlert; exports.useEvent = useEvent; exports.useFilter = useFilter; exports.useFormHelper = useFormHelper; exports.useGrid = useGrid; exports.useLoading = useLoading;
|
|
4160
4414
|
/*! Bundled license information:
|
|
4161
4415
|
|
|
4162
4416
|
react-is/cjs/react-is.production.min.js:
|