@bluemarble/bm-components 2.1.0 → 2.1.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/dist/{index.mjs → index.cjs} +610 -610
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +609 -609
- package/dist/index.js.map +1 -1
- package/package.json +12 -8
- package/dist/index.mjs.map +0 -1
- /package/dist/{index.d.mts → index.d.cts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -1180,31 +1180,31 @@ var require_react_is2 = __commonJS({
|
|
|
1180
1180
|
});
|
|
1181
1181
|
|
|
1182
1182
|
// src/components/Grid/Grid.tsx
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
|
|
1188
|
+
var _react = require('react'); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react);
|
|
1189
|
+
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
|
|
1193
|
+
|
|
1194
|
+
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
|
|
1198
|
+
|
|
1199
|
+
|
|
1200
|
+
|
|
1201
|
+
|
|
1202
|
+
|
|
1203
|
+
var _material = require('@mui/material');
|
|
1204
1204
|
|
|
1205
1205
|
// src/components/Grid/Header.tsx
|
|
1206
|
-
|
|
1207
|
-
|
|
1206
|
+
|
|
1207
|
+
|
|
1208
1208
|
var GridHeader = ({
|
|
1209
1209
|
setOrder,
|
|
1210
1210
|
setOrderBy,
|
|
@@ -1232,16 +1232,16 @@ var GridHeader = ({
|
|
|
1232
1232
|
break;
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
1235
|
-
return /* @__PURE__ */
|
|
1236
|
-
return /* @__PURE__ */
|
|
1237
|
-
TableCell,
|
|
1235
|
+
return /* @__PURE__ */ React2.default.createElement(_material.TableHead, null, /* @__PURE__ */ React2.default.createElement(_material.TableRow, { sx: { backgroundColor: "background.default" } }, titles.map((title) => {
|
|
1236
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
1237
|
+
_material.TableCell,
|
|
1238
1238
|
{
|
|
1239
1239
|
key: title.name,
|
|
1240
1240
|
sortDirection: orderBy === title.name ? order : false,
|
|
1241
1241
|
sx: { fontWeight: "bold", ...title.sx }
|
|
1242
1242
|
},
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
TableSortLabel,
|
|
1243
|
+
/* @__PURE__ */ React2.default.createElement(
|
|
1244
|
+
_material.TableSortLabel,
|
|
1245
1245
|
{
|
|
1246
1246
|
onClick: () => onRequestSort(title.name),
|
|
1247
1247
|
active: orderBy === title.name,
|
|
@@ -1258,7 +1258,7 @@ var GridHeader = ({
|
|
|
1258
1258
|
};
|
|
1259
1259
|
|
|
1260
1260
|
// src/components/Grid/Filters.tsx
|
|
1261
|
-
|
|
1261
|
+
|
|
1262
1262
|
|
|
1263
1263
|
// node_modules/@mui/utils/esm/formatMuiErrorMessage/formatMuiErrorMessage.js
|
|
1264
1264
|
function formatMuiErrorMessage(code, ...args) {
|
|
@@ -1268,10 +1268,10 @@ function formatMuiErrorMessage(code, ...args) {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
|
|
1270
1270
|
// node_modules/@mui/styled-engine/esm/index.js
|
|
1271
|
-
|
|
1272
|
-
|
|
1271
|
+
var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);
|
|
1272
|
+
var _react2 = require('@emotion/react');
|
|
1273
1273
|
function styled(tag, options) {
|
|
1274
|
-
const stylesFactory =
|
|
1274
|
+
const stylesFactory = _styled2.default.call(void 0, tag, options);
|
|
1275
1275
|
if (process.env.NODE_ENV !== "production") {
|
|
1276
1276
|
return (...styles2) => {
|
|
1277
1277
|
const component = typeof tag === "string" ? `"${tag}"` : "component";
|
|
@@ -1288,7 +1288,7 @@ function styled(tag, options) {
|
|
|
1288
1288
|
|
|
1289
1289
|
// node_modules/@mui/utils/esm/deepmerge/deepmerge.js
|
|
1290
1290
|
var import_react_is = __toESM(require_react_is2(), 1);
|
|
1291
|
-
|
|
1291
|
+
|
|
1292
1292
|
function isPlainObject(item) {
|
|
1293
1293
|
if (typeof item !== "object" || item === null) {
|
|
1294
1294
|
return false;
|
|
@@ -1413,7 +1413,7 @@ function sortContainerQueries(theme, css2) {
|
|
|
1413
1413
|
}
|
|
1414
1414
|
const sorted = Object.keys(css2).filter((key) => key.startsWith("@container")).sort((a, b) => {
|
|
1415
1415
|
const regex = /min-width:\s*([0-9.]+)/;
|
|
1416
|
-
return +(a.match(regex)
|
|
1416
|
+
return +(_optionalChain([a, 'access', _2 => _2.match, 'call', _3 => _3(regex), 'optionalAccess', _4 => _4[1]]) || 0) - +(_optionalChain([b, 'access', _5 => _5.match, 'call', _6 => _6(regex), 'optionalAccess', _7 => _7[1]]) || 0);
|
|
1417
1417
|
});
|
|
1418
1418
|
if (!sorted.length) {
|
|
1419
1419
|
return css2;
|
|
@@ -1554,11 +1554,11 @@ function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
|
1554
1554
|
return output;
|
|
1555
1555
|
}
|
|
1556
1556
|
function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
1557
|
-
const breakpointsInOrder = breakpointsInput.keys
|
|
1557
|
+
const breakpointsInOrder = _optionalChain([breakpointsInput, 'access', _8 => _8.keys, 'optionalAccess', _9 => _9.reduce, 'call', _10 => _10((acc, key) => {
|
|
1558
1558
|
const breakpointStyleKey = breakpointsInput.up(key);
|
|
1559
1559
|
acc[breakpointStyleKey] = {};
|
|
1560
1560
|
return acc;
|
|
1561
|
-
}, {});
|
|
1561
|
+
}, {})]);
|
|
1562
1562
|
return breakpointsInOrder || {};
|
|
1563
1563
|
}
|
|
1564
1564
|
function removeUnusedBreakpoints(breakpointKeys, style3) {
|
|
@@ -1695,7 +1695,7 @@ var marginKeys = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop"
|
|
|
1695
1695
|
var paddingKeys = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"];
|
|
1696
1696
|
var spacingKeys = [...marginKeys, ...paddingKeys];
|
|
1697
1697
|
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
|
|
1698
|
-
const themeSpacing = getPath(theme, themeKey, true)
|
|
1698
|
+
const themeSpacing = _nullishCoalesce(getPath(theme, themeKey, true), () => ( defaultValue));
|
|
1699
1699
|
if (typeof themeSpacing === "number" || typeof themeSpacing === "string") {
|
|
1700
1700
|
return (val) => {
|
|
1701
1701
|
if (typeof val === "string") {
|
|
@@ -2000,13 +2000,13 @@ var width = style_default({
|
|
|
2000
2000
|
var maxWidth = (props) => {
|
|
2001
2001
|
if (props.maxWidth !== void 0 && props.maxWidth !== null) {
|
|
2002
2002
|
const styleFromPropValue = (propValue) => {
|
|
2003
|
-
const breakpoint = props.theme
|
|
2003
|
+
const breakpoint = _optionalChain([props, 'access', _11 => _11.theme, 'optionalAccess', _12 => _12.breakpoints, 'optionalAccess', _13 => _13.values, 'optionalAccess', _14 => _14[propValue]]) || values[propValue];
|
|
2004
2004
|
if (!breakpoint) {
|
|
2005
2005
|
return {
|
|
2006
2006
|
maxWidth: sizingTransform(propValue)
|
|
2007
2007
|
};
|
|
2008
2008
|
}
|
|
2009
|
-
if (props.theme
|
|
2009
|
+
if (_optionalChain([props, 'access', _15 => _15.theme, 'optionalAccess', _16 => _16.breakpoints, 'optionalAccess', _17 => _17.unit]) !== "px") {
|
|
2010
2010
|
return {
|
|
2011
2011
|
maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
|
|
2012
2012
|
};
|
|
@@ -2404,7 +2404,7 @@ function unstable_createStyleFunctionSx() {
|
|
|
2404
2404
|
if (!sx) {
|
|
2405
2405
|
return null;
|
|
2406
2406
|
}
|
|
2407
|
-
const config = theme.unstable_sxConfig
|
|
2407
|
+
const config = _nullishCoalesce(theme.unstable_sxConfig, () => ( defaultSxConfig_default));
|
|
2408
2408
|
function traverse(sxInput) {
|
|
2409
2409
|
let sxObject = sxInput;
|
|
2410
2410
|
if (typeof sxInput === "function") {
|
|
@@ -2464,7 +2464,7 @@ var styleFunctionSx_default = styleFunctionSx;
|
|
|
2464
2464
|
function applyStyles(key, styles2) {
|
|
2465
2465
|
const theme = this;
|
|
2466
2466
|
if (theme.vars) {
|
|
2467
|
-
if (!theme.colorSchemes
|
|
2467
|
+
if (!_optionalChain([theme, 'access', _18 => _18.colorSchemes, 'optionalAccess', _19 => _19[key]]) || typeof theme.getColorSchemeSelector !== "function") {
|
|
2468
2468
|
return {};
|
|
2469
2469
|
}
|
|
2470
2470
|
let selector = theme.getColorSchemeSelector(key);
|
|
@@ -2515,7 +2515,7 @@ function createTheme(options = {}, ...args) {
|
|
|
2515
2515
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
2516
2516
|
muiTheme.unstable_sxConfig = {
|
|
2517
2517
|
...defaultSxConfig_default,
|
|
2518
|
-
...other
|
|
2518
|
+
..._optionalChain([other, 'optionalAccess', _20 => _20.unstable_sxConfig])
|
|
2519
2519
|
};
|
|
2520
2520
|
muiTheme.unstable_sx = function sx(props) {
|
|
2521
2521
|
return styleFunctionSx_default({
|
|
@@ -2528,12 +2528,12 @@ function createTheme(options = {}, ...args) {
|
|
|
2528
2528
|
var createTheme_default = createTheme;
|
|
2529
2529
|
|
|
2530
2530
|
// node_modules/@mui/system/esm/useThemeWithoutDefault/useThemeWithoutDefault.js
|
|
2531
|
-
|
|
2531
|
+
|
|
2532
2532
|
function isObjectEmpty(obj) {
|
|
2533
2533
|
return Object.keys(obj).length === 0;
|
|
2534
2534
|
}
|
|
2535
2535
|
function useTheme(defaultTheme = null) {
|
|
2536
|
-
const contextTheme = React3.useContext(ThemeContext);
|
|
2536
|
+
const contextTheme = React3.useContext(_react2.ThemeContext);
|
|
2537
2537
|
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
2538
2538
|
}
|
|
2539
2539
|
var useThemeWithoutDefault_default = useTheme;
|
|
@@ -2551,7 +2551,7 @@ var splitProps = (props) => {
|
|
|
2551
2551
|
systemProps: {},
|
|
2552
2552
|
otherProps: {}
|
|
2553
2553
|
};
|
|
2554
|
-
const config = props
|
|
2554
|
+
const config = _nullishCoalesce(_optionalChain([props, 'optionalAccess', _21 => _21.theme, 'optionalAccess', _22 => _22.unstable_sxConfig]), () => ( defaultSxConfig_default));
|
|
2555
2555
|
Object.keys(props).forEach((prop) => {
|
|
2556
2556
|
if (config[prop]) {
|
|
2557
2557
|
result.systemProps[prop] = props[prop];
|
|
@@ -2619,7 +2619,7 @@ var ClassNameGenerator = createClassNameGenerator();
|
|
|
2619
2619
|
var ClassNameGenerator_default = ClassNameGenerator;
|
|
2620
2620
|
|
|
2621
2621
|
// node_modules/@mui/system/esm/createBox/createBox.js
|
|
2622
|
-
|
|
2622
|
+
|
|
2623
2623
|
|
|
2624
2624
|
// node_modules/clsx/dist/clsx.mjs
|
|
2625
2625
|
function r(e) {
|
|
@@ -2638,7 +2638,7 @@ function clsx() {
|
|
|
2638
2638
|
var clsx_default = clsx;
|
|
2639
2639
|
|
|
2640
2640
|
// node_modules/@mui/system/esm/createBox/createBox.js
|
|
2641
|
-
|
|
2641
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
2642
2642
|
function createBox(options = {}) {
|
|
2643
2643
|
const {
|
|
2644
2644
|
themeId,
|
|
@@ -2656,7 +2656,7 @@ function createBox(options = {}) {
|
|
|
2656
2656
|
component = "div",
|
|
2657
2657
|
...other
|
|
2658
2658
|
} = extendSxProp(inProps);
|
|
2659
|
-
return /* @__PURE__ */
|
|
2659
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BoxRoot, {
|
|
2660
2660
|
as: component,
|
|
2661
2661
|
ref,
|
|
2662
2662
|
className: clsx_default(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),
|
|
@@ -2727,8 +2727,8 @@ process.env.NODE_ENV !== "production" ? Box.propTypes = {
|
|
|
2727
2727
|
var Box_default = Box;
|
|
2728
2728
|
|
|
2729
2729
|
// src/components/Grid/Filters.tsx
|
|
2730
|
-
|
|
2731
|
-
|
|
2730
|
+
var _md = require('react-icons/md');
|
|
2731
|
+
|
|
2732
2732
|
var FiltersBar = ({
|
|
2733
2733
|
customButtons,
|
|
2734
2734
|
selectedFilters,
|
|
@@ -2739,7 +2739,7 @@ var FiltersBar = ({
|
|
|
2739
2739
|
setAnchorEl,
|
|
2740
2740
|
noFilters
|
|
2741
2741
|
}) => {
|
|
2742
|
-
return /* @__PURE__ */
|
|
2742
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
2743
2743
|
Box_default,
|
|
2744
2744
|
{
|
|
2745
2745
|
sx: {
|
|
@@ -2749,9 +2749,9 @@ var FiltersBar = ({
|
|
|
2749
2749
|
width: "100%"
|
|
2750
2750
|
}
|
|
2751
2751
|
},
|
|
2752
|
-
!noFilters && /* @__PURE__ */
|
|
2753
|
-
return /* @__PURE__ */
|
|
2754
|
-
Chip,
|
|
2752
|
+
!noFilters && /* @__PURE__ */ React2.default.createElement(Box_default, { sx: { pl: 1 } }, selectedFilters.map((item, index) => {
|
|
2753
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
2754
|
+
_material.Chip,
|
|
2755
2755
|
{
|
|
2756
2756
|
key: index,
|
|
2757
2757
|
label: item.value,
|
|
@@ -2759,19 +2759,19 @@ var FiltersBar = ({
|
|
|
2759
2759
|
}
|
|
2760
2760
|
);
|
|
2761
2761
|
})),
|
|
2762
|
-
/* @__PURE__ */
|
|
2763
|
-
IconButton,
|
|
2762
|
+
/* @__PURE__ */ React2.default.createElement(Box_default, { ref: searchAnchorEl, sx: { minHeight: 30, width: "100%" } }, customButtons, !noFilterButtons && /* @__PURE__ */ React2.default.createElement(React2.default.Fragment, null, /* @__PURE__ */ React2.default.createElement(_material.Tooltip, { title: "Buscar" }, /* @__PURE__ */ React2.default.createElement(_material.IconButton, { onClick: () => setOpenSearch(true) }, /* @__PURE__ */ React2.default.createElement(_md.MdSearch, { size: 8 * 3 }))), /* @__PURE__ */ React2.default.createElement(_material.Tooltip, { title: "Filtrar" }, /* @__PURE__ */ React2.default.createElement(
|
|
2763
|
+
_material.IconButton,
|
|
2764
2764
|
{
|
|
2765
2765
|
sx: { position: "relative" },
|
|
2766
2766
|
onClick: ({ currentTarget }) => setAnchorEl(currentTarget)
|
|
2767
2767
|
},
|
|
2768
|
-
/* @__PURE__ */
|
|
2768
|
+
/* @__PURE__ */ React2.default.createElement(_md.MdFilterList, { size: 8 * 3 })
|
|
2769
2769
|
))))
|
|
2770
2770
|
);
|
|
2771
2771
|
};
|
|
2772
2772
|
|
|
2773
2773
|
// src/components/Grid/Grid.tsx
|
|
2774
|
-
|
|
2774
|
+
|
|
2775
2775
|
|
|
2776
2776
|
// src/components/Grid/utils.ts
|
|
2777
2777
|
function filterData(filters, defaultData) {
|
|
@@ -2793,15 +2793,15 @@ function getPropertyValue(obj, property) {
|
|
|
2793
2793
|
}
|
|
2794
2794
|
|
|
2795
2795
|
// src/components/Grid/AutoCreatedRows.tsx
|
|
2796
|
-
|
|
2796
|
+
|
|
2797
2797
|
|
|
2798
2798
|
// src/components/Grid/Td.tsx
|
|
2799
|
-
|
|
2800
|
-
var Td =
|
|
2799
|
+
|
|
2800
|
+
var Td = _material.TableCell;
|
|
2801
2801
|
|
|
2802
2802
|
// src/components/Grid/Tr.tsx
|
|
2803
|
-
|
|
2804
|
-
var Tr =
|
|
2803
|
+
|
|
2804
|
+
var Tr = _material.TableRow;
|
|
2805
2805
|
|
|
2806
2806
|
// src/components/Grid/AutoCreatedRows.tsx
|
|
2807
2807
|
var AutoCreatedRows = ({
|
|
@@ -2809,9 +2809,9 @@ var AutoCreatedRows = ({
|
|
|
2809
2809
|
columns,
|
|
2810
2810
|
primaryKey
|
|
2811
2811
|
}) => {
|
|
2812
|
-
return /* @__PURE__ */
|
|
2812
|
+
return /* @__PURE__ */ React2.default.createElement(React2.default.Fragment, null, tableData.map((row) => /* @__PURE__ */ React2.default.createElement(Tr, { key: row[primaryKey] }, columns.map((column) => {
|
|
2813
2813
|
const cellValue = column.transformer ? column.transformer(row[column.name]) : row[column.name];
|
|
2814
|
-
return /* @__PURE__ */
|
|
2814
|
+
return /* @__PURE__ */ React2.default.createElement(Td, { key: column.name }, cellValue);
|
|
2815
2815
|
}))));
|
|
2816
2816
|
};
|
|
2817
2817
|
|
|
@@ -2834,20 +2834,20 @@ var Grid = (props) => {
|
|
|
2834
2834
|
primaryKey,
|
|
2835
2835
|
noFilters
|
|
2836
2836
|
} = props;
|
|
2837
|
-
const [order, setOrder] = useState(void 0);
|
|
2838
|
-
const [orderBy, setOrderBy] = useState("");
|
|
2839
|
-
const [page, setPage] = useState(0);
|
|
2840
|
-
const [rowsPerPage, setRowsPerPage] = useState(rowOptions[0]);
|
|
2841
|
-
const [selectedTitle, setSelectedTitle] = useState(
|
|
2837
|
+
const [order, setOrder] = _react.useState.call(void 0, void 0);
|
|
2838
|
+
const [orderBy, setOrderBy] = _react.useState.call(void 0, "");
|
|
2839
|
+
const [page, setPage] = _react.useState.call(void 0, 0);
|
|
2840
|
+
const [rowsPerPage, setRowsPerPage] = _react.useState.call(void 0, rowOptions[0]);
|
|
2841
|
+
const [selectedTitle, setSelectedTitle] = _react.useState.call(void 0,
|
|
2842
2842
|
void 0
|
|
2843
2843
|
);
|
|
2844
|
-
const [selectedFilterValue, setSelectedFilterValue] = useState(void 0);
|
|
2845
|
-
const [valuesToFilter, setValuesToFilter] = useState([]);
|
|
2846
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
2847
|
-
const [searchText, setSearchText] = useState("");
|
|
2848
|
-
const [openSearch, setOpenSearch] = useState(false);
|
|
2849
|
-
const searchAnchorEl = useRef(null);
|
|
2850
|
-
const countRows = useMemo(() => {
|
|
2844
|
+
const [selectedFilterValue, setSelectedFilterValue] = _react.useState.call(void 0, void 0);
|
|
2845
|
+
const [valuesToFilter, setValuesToFilter] = _react.useState.call(void 0, []);
|
|
2846
|
+
const [anchorEl, setAnchorEl] = _react.useState.call(void 0, null);
|
|
2847
|
+
const [searchText, setSearchText] = _react.useState.call(void 0, "");
|
|
2848
|
+
const [openSearch, setOpenSearch] = _react.useState.call(void 0, false);
|
|
2849
|
+
const searchAnchorEl = _react.useRef.call(void 0, null);
|
|
2850
|
+
const countRows = _react.useMemo.call(void 0, () => {
|
|
2851
2851
|
if (searchText.length > 0) {
|
|
2852
2852
|
const array = handleFilterBySearch(searchText);
|
|
2853
2853
|
return array.length;
|
|
@@ -2905,11 +2905,11 @@ var Grid = (props) => {
|
|
|
2905
2905
|
});
|
|
2906
2906
|
return newArray;
|
|
2907
2907
|
}
|
|
2908
|
-
useEffect(() => {
|
|
2908
|
+
_react.useEffect.call(void 0, () => {
|
|
2909
2909
|
const maxPage = Math.floor(countRows / rowsPerPage);
|
|
2910
2910
|
if (page > maxPage) setPage(maxPage - 1);
|
|
2911
2911
|
}, [countRows]);
|
|
2912
|
-
useEffect(() => {
|
|
2912
|
+
_react.useEffect.call(void 0, () => {
|
|
2913
2913
|
if (order) {
|
|
2914
2914
|
const newArray = searchText.length > 0 ? handleFilterBySearch(searchText) : defaultData;
|
|
2915
2915
|
const sortedArray = handleSort(newArray);
|
|
@@ -2927,7 +2927,7 @@ var Grid = (props) => {
|
|
|
2927
2927
|
setTableData(data);
|
|
2928
2928
|
}
|
|
2929
2929
|
}, [defaultData]);
|
|
2930
|
-
useEffect(() => {
|
|
2930
|
+
_react.useEffect.call(void 0, () => {
|
|
2931
2931
|
const newArray = searchText.length > 0 ? handleFilterBySearch(searchText) : defaultData;
|
|
2932
2932
|
const sortedArray = handleSort(newArray);
|
|
2933
2933
|
const paginatedArray = sortedArray.slice(
|
|
@@ -2936,7 +2936,7 @@ var Grid = (props) => {
|
|
|
2936
2936
|
);
|
|
2937
2937
|
setTableData(paginatedArray);
|
|
2938
2938
|
}, [order, orderBy]);
|
|
2939
|
-
useEffect(() => {
|
|
2939
|
+
_react.useEffect.call(void 0, () => {
|
|
2940
2940
|
if (order) {
|
|
2941
2941
|
const newArray = searchText.length > 0 ? handleFilterBySearch(searchText) : defaultData;
|
|
2942
2942
|
const sortedArray = handleSort(newArray);
|
|
@@ -2954,7 +2954,7 @@ var Grid = (props) => {
|
|
|
2954
2954
|
setTableData(dados);
|
|
2955
2955
|
}
|
|
2956
2956
|
}, [page, rowsPerPage]);
|
|
2957
|
-
useEffect(() => {
|
|
2957
|
+
_react.useEffect.call(void 0, () => {
|
|
2958
2958
|
setValuesToFilter([]);
|
|
2959
2959
|
setSelectedFilterValue(void 0);
|
|
2960
2960
|
if (selectedTitle) {
|
|
@@ -2968,7 +2968,7 @@ var Grid = (props) => {
|
|
|
2968
2968
|
setValuesToFilter(values2);
|
|
2969
2969
|
}
|
|
2970
2970
|
}, [selectedTitle]);
|
|
2971
|
-
useEffect(() => {
|
|
2971
|
+
_react.useEffect.call(void 0, () => {
|
|
2972
2972
|
if (order) {
|
|
2973
2973
|
const newArray = handleFilterBySearch(searchText);
|
|
2974
2974
|
const sortedArray = handleSort(newArray);
|
|
@@ -2986,10 +2986,10 @@ var Grid = (props) => {
|
|
|
2986
2986
|
setTableData(dados);
|
|
2987
2987
|
}
|
|
2988
2988
|
}, [searchText]);
|
|
2989
|
-
useEffect(() => {
|
|
2989
|
+
_react.useEffect.call(void 0, () => {
|
|
2990
2990
|
updateFilters(selectedFilters);
|
|
2991
2991
|
}, [selectedFilters]);
|
|
2992
|
-
return /* @__PURE__ */
|
|
2992
|
+
return /* @__PURE__ */ React2.default.createElement(_material.Paper, null, isLoading && /* @__PURE__ */ React2.default.createElement(_material.LinearProgress, null), /* @__PURE__ */ React2.default.createElement(
|
|
2993
2993
|
FiltersBar,
|
|
2994
2994
|
{
|
|
2995
2995
|
setAnchorEl,
|
|
@@ -3001,7 +3001,7 @@ var Grid = (props) => {
|
|
|
3001
3001
|
customButtons,
|
|
3002
3002
|
handleCloseFilter
|
|
3003
3003
|
}
|
|
3004
|
-
), /* @__PURE__ */
|
|
3004
|
+
), /* @__PURE__ */ React2.default.createElement(_material.TableContainer, null, /* @__PURE__ */ React2.default.createElement(_material.Table, { size: "small" }, /* @__PURE__ */ React2.default.createElement(
|
|
3005
3005
|
GridHeader,
|
|
3006
3006
|
{
|
|
3007
3007
|
titles: columnTitles,
|
|
@@ -3010,15 +3010,15 @@ var Grid = (props) => {
|
|
|
3010
3010
|
setOrder,
|
|
3011
3011
|
setOrderBy
|
|
3012
3012
|
}
|
|
3013
|
-
), /* @__PURE__ */
|
|
3013
|
+
), /* @__PURE__ */ React2.default.createElement(_material.TableBody, null, props.children ? props.children : primaryKey ? /* @__PURE__ */ React2.default.createElement(
|
|
3014
3014
|
AutoCreatedRows,
|
|
3015
3015
|
{
|
|
3016
3016
|
tableData,
|
|
3017
3017
|
columns: columnTitles,
|
|
3018
3018
|
primaryKey
|
|
3019
3019
|
}
|
|
3020
|
-
) : null, footer))), !noPagination && /* @__PURE__ */
|
|
3021
|
-
TablePagination,
|
|
3020
|
+
) : null, footer))), !noPagination && /* @__PURE__ */ React2.default.createElement(
|
|
3021
|
+
_material.TablePagination,
|
|
3022
3022
|
{
|
|
3023
3023
|
page,
|
|
3024
3024
|
component: "div",
|
|
@@ -3032,8 +3032,8 @@ var Grid = (props) => {
|
|
|
3032
3032
|
},
|
|
3033
3033
|
onRowsPerPageChange: handleChangeRowsPerPage
|
|
3034
3034
|
}
|
|
3035
|
-
), /* @__PURE__ */
|
|
3036
|
-
Popover,
|
|
3035
|
+
), /* @__PURE__ */ React2.default.createElement(
|
|
3036
|
+
_material.Popover,
|
|
3037
3037
|
{
|
|
3038
3038
|
anchorEl,
|
|
3039
3039
|
open: !!anchorEl,
|
|
@@ -3047,16 +3047,16 @@ var Grid = (props) => {
|
|
|
3047
3047
|
horizontal: "right"
|
|
3048
3048
|
}
|
|
3049
3049
|
},
|
|
3050
|
-
/* @__PURE__ */
|
|
3051
|
-
Autocomplete,
|
|
3050
|
+
/* @__PURE__ */ React2.default.createElement(_material.Box, { sx: { minWidth: 300, padding: 2 } }, /* @__PURE__ */ React2.default.createElement(_material.Typography, { fontWeight: "bold", variant: "body2" }, "Filtrar por:"), /* @__PURE__ */ React2.default.createElement(
|
|
3051
|
+
_material.Autocomplete,
|
|
3052
3052
|
{
|
|
3053
3053
|
value: selectedTitle || "",
|
|
3054
3054
|
onChange: ({ target }) => {
|
|
3055
3055
|
!target.innerHTML.includes("path") ? setSelectedTitle(target.innerHTML) : setSelectedTitle(void 0);
|
|
3056
3056
|
},
|
|
3057
3057
|
options: columnTitles.map((title) => title.label),
|
|
3058
|
-
renderInput: (params) => /* @__PURE__ */
|
|
3059
|
-
TextField,
|
|
3058
|
+
renderInput: (params) => /* @__PURE__ */ React2.default.createElement(
|
|
3059
|
+
_material.TextField,
|
|
3060
3060
|
{
|
|
3061
3061
|
variant: "standard",
|
|
3062
3062
|
margin: "dense",
|
|
@@ -3065,8 +3065,8 @@ var Grid = (props) => {
|
|
|
3065
3065
|
}
|
|
3066
3066
|
)
|
|
3067
3067
|
}
|
|
3068
|
-
), /* @__PURE__ */
|
|
3069
|
-
Autocomplete,
|
|
3068
|
+
), /* @__PURE__ */ React2.default.createElement(
|
|
3069
|
+
_material.Autocomplete,
|
|
3070
3070
|
{
|
|
3071
3071
|
value: selectedFilterValue || "",
|
|
3072
3072
|
onChange: ({ target }) => {
|
|
@@ -3074,8 +3074,8 @@ var Grid = (props) => {
|
|
|
3074
3074
|
},
|
|
3075
3075
|
disabled: valuesToFilter.length < 1,
|
|
3076
3076
|
options: valuesToFilter.map((title) => title),
|
|
3077
|
-
renderInput: (params) => /* @__PURE__ */
|
|
3078
|
-
TextField,
|
|
3077
|
+
renderInput: (params) => /* @__PURE__ */ React2.default.createElement(
|
|
3078
|
+
_material.TextField,
|
|
3079
3079
|
{
|
|
3080
3080
|
variant: "standard",
|
|
3081
3081
|
margin: "dense",
|
|
@@ -3084,8 +3084,8 @@ var Grid = (props) => {
|
|
|
3084
3084
|
}
|
|
3085
3085
|
)
|
|
3086
3086
|
}
|
|
3087
|
-
), /* @__PURE__ */
|
|
3088
|
-
Button,
|
|
3087
|
+
), /* @__PURE__ */ React2.default.createElement(_material.Box, { sx: { py: 1 } }), /* @__PURE__ */ React2.default.createElement(
|
|
3088
|
+
_material.Button,
|
|
3089
3089
|
{
|
|
3090
3090
|
disabled: !selectedFilterValue,
|
|
3091
3091
|
onClick: handleAddFilter,
|
|
@@ -3093,8 +3093,8 @@ var Grid = (props) => {
|
|
|
3093
3093
|
},
|
|
3094
3094
|
"Adicionar filtro"
|
|
3095
3095
|
))
|
|
3096
|
-
), /* @__PURE__ */
|
|
3097
|
-
Popover,
|
|
3096
|
+
), /* @__PURE__ */ React2.default.createElement(
|
|
3097
|
+
_material.Popover,
|
|
3098
3098
|
{
|
|
3099
3099
|
anchorEl: searchAnchorEl.current,
|
|
3100
3100
|
open: openSearch,
|
|
@@ -3108,8 +3108,8 @@ var Grid = (props) => {
|
|
|
3108
3108
|
horizontal: "left"
|
|
3109
3109
|
}
|
|
3110
3110
|
},
|
|
3111
|
-
/* @__PURE__ */
|
|
3112
|
-
|
|
3111
|
+
/* @__PURE__ */ React2.default.createElement(
|
|
3112
|
+
_material.Box,
|
|
3113
3113
|
{
|
|
3114
3114
|
sx: {
|
|
3115
3115
|
minWidth: 300,
|
|
@@ -3120,8 +3120,8 @@ var Grid = (props) => {
|
|
|
3120
3120
|
alignItems: "flex-end"
|
|
3121
3121
|
}
|
|
3122
3122
|
},
|
|
3123
|
-
/* @__PURE__ */
|
|
3124
|
-
TextField,
|
|
3123
|
+
/* @__PURE__ */ React2.default.createElement(
|
|
3124
|
+
_material.TextField,
|
|
3125
3125
|
{
|
|
3126
3126
|
variant: "standard",
|
|
3127
3127
|
margin: "dense",
|
|
@@ -3130,15 +3130,15 @@ var Grid = (props) => {
|
|
|
3130
3130
|
onChange: ({ currentTarget }) => setSearchText(currentTarget.value)
|
|
3131
3131
|
}
|
|
3132
3132
|
),
|
|
3133
|
-
/* @__PURE__ */
|
|
3134
|
-
|
|
3133
|
+
/* @__PURE__ */ React2.default.createElement(_material.Box, null, /* @__PURE__ */ React2.default.createElement(
|
|
3134
|
+
_material.IconButton,
|
|
3135
3135
|
{
|
|
3136
3136
|
onClick: () => {
|
|
3137
3137
|
setSearchText("");
|
|
3138
3138
|
setOpenSearch(false);
|
|
3139
3139
|
}
|
|
3140
3140
|
},
|
|
3141
|
-
/* @__PURE__ */
|
|
3141
|
+
/* @__PURE__ */ React2.default.createElement(_md.MdClose, { size: 8 * 3 })
|
|
3142
3142
|
))
|
|
3143
3143
|
)
|
|
3144
3144
|
));
|
|
@@ -3146,13 +3146,13 @@ var Grid = (props) => {
|
|
|
3146
3146
|
var Grid_default = Grid;
|
|
3147
3147
|
|
|
3148
3148
|
// src/components/Grid/EditableTableCell/index.tsx
|
|
3149
|
-
|
|
3150
|
-
|
|
3149
|
+
|
|
3150
|
+
|
|
3151
3151
|
|
|
3152
3152
|
// src/components/Grid/EditableTableCell/DefaultInput.tsx
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3153
|
+
|
|
3154
|
+
|
|
3155
|
+
var _moment = require('moment'); var _moment2 = _interopRequireDefault(_moment);
|
|
3156
3156
|
var DefaultInput = (allProps) => {
|
|
3157
3157
|
const {
|
|
3158
3158
|
TextFieldProps: TextFieldProps3,
|
|
@@ -3171,21 +3171,21 @@ var DefaultInput = (allProps) => {
|
|
|
3171
3171
|
if (formatInputDefautvalue) return formatInputDefautvalue(value);
|
|
3172
3172
|
switch (type) {
|
|
3173
3173
|
case "date":
|
|
3174
|
-
return
|
|
3174
|
+
return _moment2.default.call(void 0, value).format("YYYY-MM-DD");
|
|
3175
3175
|
case "datetime-local":
|
|
3176
|
-
return
|
|
3176
|
+
return _moment2.default.call(void 0, value).format("YYYY-MM-DDTHH:mm:ss");
|
|
3177
3177
|
default:
|
|
3178
3178
|
return String(value);
|
|
3179
3179
|
}
|
|
3180
3180
|
};
|
|
3181
3181
|
const handleSave = (event) => {
|
|
3182
|
-
onUpdateValue(String(event.target
|
|
3182
|
+
onUpdateValue(String(_optionalChain([event, 'access', _23 => _23.target, 'optionalAccess', _24 => _24.value])));
|
|
3183
3183
|
setIsEditing(false);
|
|
3184
3184
|
const response = {
|
|
3185
3185
|
name,
|
|
3186
3186
|
event,
|
|
3187
|
-
value: event.target
|
|
3188
|
-
data: { ...rowData, [name]: event.target
|
|
3187
|
+
value: _optionalChain([event, 'access', _25 => _25.target, 'optionalAccess', _26 => _26.value]),
|
|
3188
|
+
data: { ...rowData, [name]: _optionalChain([event, 'access', _27 => _27.target, 'optionalAccess', _28 => _28.value]) }
|
|
3189
3189
|
};
|
|
3190
3190
|
onSave(response);
|
|
3191
3191
|
};
|
|
@@ -3193,8 +3193,8 @@ var DefaultInput = (allProps) => {
|
|
|
3193
3193
|
if (ev.code === "Enter") handleSave(ev);
|
|
3194
3194
|
if (ev.code === "Escape") handleCancelEditing();
|
|
3195
3195
|
};
|
|
3196
|
-
return /* @__PURE__ */
|
|
3197
|
-
|
|
3196
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3197
|
+
_material.TextField,
|
|
3198
3198
|
{
|
|
3199
3199
|
name,
|
|
3200
3200
|
focused: isEditing,
|
|
@@ -3202,10 +3202,10 @@ var DefaultInput = (allProps) => {
|
|
|
3202
3202
|
autoFocus: true,
|
|
3203
3203
|
type,
|
|
3204
3204
|
size: "small",
|
|
3205
|
-
defaultValue: formatDefaultValue(rowData
|
|
3205
|
+
defaultValue: formatDefaultValue(_optionalChain([rowData, 'optionalAccess', _29 => _29[name]])),
|
|
3206
3206
|
sx: {
|
|
3207
3207
|
width: fullWidth ? "100%" : "intial",
|
|
3208
|
-
...TextFieldProps3
|
|
3208
|
+
..._optionalChain([TextFieldProps3, 'optionalAccess', _30 => _30.sx])
|
|
3209
3209
|
},
|
|
3210
3210
|
inputProps: {
|
|
3211
3211
|
style: {
|
|
@@ -3215,11 +3215,11 @@ var DefaultInput = (allProps) => {
|
|
|
3215
3215
|
onKeyDown
|
|
3216
3216
|
},
|
|
3217
3217
|
InputProps: {
|
|
3218
|
-
...TextFieldProps3
|
|
3218
|
+
..._optionalChain([TextFieldProps3, 'optionalAccess', _31 => _31.InputProps]),
|
|
3219
3219
|
sx: {
|
|
3220
3220
|
fontSize: 14,
|
|
3221
3221
|
pl: 0.2,
|
|
3222
|
-
...TextFieldProps3
|
|
3222
|
+
..._optionalChain([TextFieldProps3, 'optionalAccess', _32 => _32.InputProps, 'optionalAccess', _33 => _33.sx])
|
|
3223
3223
|
}
|
|
3224
3224
|
},
|
|
3225
3225
|
...TextFieldProps3
|
|
@@ -3228,9 +3228,9 @@ var DefaultInput = (allProps) => {
|
|
|
3228
3228
|
};
|
|
3229
3229
|
|
|
3230
3230
|
// src/components/Grid/EditableTableCell/InputMask.tsx
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3231
|
+
var _reactimask = require('react-imask');
|
|
3232
|
+
|
|
3233
|
+
|
|
3234
3234
|
var InputMask = (allProps) => {
|
|
3235
3235
|
const {
|
|
3236
3236
|
TextFieldProps: TextFieldProps3,
|
|
@@ -3243,18 +3243,18 @@ var InputMask = (allProps) => {
|
|
|
3243
3243
|
handleCancelEditing,
|
|
3244
3244
|
setIsEditing
|
|
3245
3245
|
} = allProps;
|
|
3246
|
-
const { ref, unmaskedValue, setValue } = useIMask(
|
|
3246
|
+
const { ref, unmaskedValue, setValue } = _reactimask.useIMask.call(void 0,
|
|
3247
3247
|
mask
|
|
3248
3248
|
);
|
|
3249
3249
|
const handleSave = (event) => {
|
|
3250
3250
|
setIsEditing(false);
|
|
3251
|
-
setValue(String(event.target
|
|
3251
|
+
setValue(String(_optionalChain([event, 'access', _34 => _34.target, 'optionalAccess', _35 => _35.value])));
|
|
3252
3252
|
const response = {
|
|
3253
3253
|
name,
|
|
3254
3254
|
event,
|
|
3255
|
-
value: event.target
|
|
3255
|
+
value: _optionalChain([event, 'access', _36 => _36.target, 'optionalAccess', _37 => _37.value]),
|
|
3256
3256
|
unmaskedValue,
|
|
3257
|
-
data: { ...rowData, [name]: event.target
|
|
3257
|
+
data: { ...rowData, [name]: _optionalChain([event, 'access', _38 => _38.target, 'optionalAccess', _39 => _39.value]) }
|
|
3258
3258
|
};
|
|
3259
3259
|
onSave(response);
|
|
3260
3260
|
};
|
|
@@ -3262,11 +3262,11 @@ var InputMask = (allProps) => {
|
|
|
3262
3262
|
if (ev.code === "Enter") handleSave(ev);
|
|
3263
3263
|
if (ev.code === "Escape") handleCancelEditing();
|
|
3264
3264
|
};
|
|
3265
|
-
|
|
3266
|
-
if (rowData
|
|
3267
|
-
}, [rowData
|
|
3268
|
-
return /* @__PURE__ */
|
|
3269
|
-
|
|
3265
|
+
_react.useEffect.call(void 0, () => {
|
|
3266
|
+
if (_optionalChain([rowData, 'optionalAccess', _40 => _40[name]])) setValue(String(_optionalChain([rowData, 'optionalAccess', _41 => _41[name]])));
|
|
3267
|
+
}, [_optionalChain([rowData, 'optionalAccess', _42 => _42[name]])]);
|
|
3268
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3269
|
+
_material.TextField,
|
|
3270
3270
|
{
|
|
3271
3271
|
inputRef: ref,
|
|
3272
3272
|
name,
|
|
@@ -3276,7 +3276,7 @@ var InputMask = (allProps) => {
|
|
|
3276
3276
|
size: "small",
|
|
3277
3277
|
sx: {
|
|
3278
3278
|
width: fullWidth ? "100%" : "intial",
|
|
3279
|
-
...TextFieldProps3
|
|
3279
|
+
..._optionalChain([TextFieldProps3, 'optionalAccess', _43 => _43.sx])
|
|
3280
3280
|
},
|
|
3281
3281
|
inputProps: {
|
|
3282
3282
|
style: {
|
|
@@ -3286,11 +3286,11 @@ var InputMask = (allProps) => {
|
|
|
3286
3286
|
onKeyDown
|
|
3287
3287
|
},
|
|
3288
3288
|
InputProps: {
|
|
3289
|
-
...TextFieldProps3
|
|
3289
|
+
..._optionalChain([TextFieldProps3, 'optionalAccess', _44 => _44.InputProps]),
|
|
3290
3290
|
sx: {
|
|
3291
3291
|
fontSize: 14,
|
|
3292
3292
|
pl: 0.2,
|
|
3293
|
-
...TextFieldProps3
|
|
3293
|
+
..._optionalChain([TextFieldProps3, 'optionalAccess', _45 => _45.InputProps, 'optionalAccess', _46 => _46.sx])
|
|
3294
3294
|
}
|
|
3295
3295
|
},
|
|
3296
3296
|
...TextFieldProps3
|
|
@@ -3316,14 +3316,14 @@ var EditableTableCell = (allProps) => {
|
|
|
3316
3316
|
rowIndex,
|
|
3317
3317
|
...props
|
|
3318
3318
|
} = allProps;
|
|
3319
|
-
const [isEditing, setIsEditing] =
|
|
3320
|
-
const [value, setValue] =
|
|
3319
|
+
const [isEditing, setIsEditing] = _react.useState.call(void 0, false);
|
|
3320
|
+
const [value, setValue] = _react.useState.call(void 0, _optionalChain([rowData, 'optionalAccess', _47 => _47[name]]));
|
|
3321
3321
|
const handleCancelEditing = () => {
|
|
3322
3322
|
setIsEditing(false);
|
|
3323
3323
|
if (onCancel) onCancel();
|
|
3324
3324
|
};
|
|
3325
|
-
return /* @__PURE__ */
|
|
3326
|
-
|
|
3325
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3326
|
+
_material.TableCell,
|
|
3327
3327
|
{
|
|
3328
3328
|
...props,
|
|
3329
3329
|
sx: {
|
|
@@ -3334,7 +3334,7 @@ var EditableTableCell = (allProps) => {
|
|
|
3334
3334
|
},
|
|
3335
3335
|
onDoubleClick: () => setIsEditing(true)
|
|
3336
3336
|
},
|
|
3337
|
-
isEditing ? /* @__PURE__ */
|
|
3337
|
+
isEditing ? /* @__PURE__ */ React2.default.createElement(React2.default.Fragment, null, mask ? /* @__PURE__ */ React2.default.createElement(
|
|
3338
3338
|
InputMask,
|
|
3339
3339
|
{
|
|
3340
3340
|
mask,
|
|
@@ -3349,7 +3349,7 @@ var EditableTableCell = (allProps) => {
|
|
|
3349
3349
|
handleCancelEditing,
|
|
3350
3350
|
formatInputDefautvalue
|
|
3351
3351
|
}
|
|
3352
|
-
) : /* @__PURE__ */
|
|
3352
|
+
) : /* @__PURE__ */ React2.default.createElement(
|
|
3353
3353
|
DefaultInput,
|
|
3354
3354
|
{
|
|
3355
3355
|
onUpdateValue: (newValue) => {
|
|
@@ -3364,23 +3364,23 @@ var EditableTableCell = (allProps) => {
|
|
|
3364
3364
|
formatInputDefautvalue,
|
|
3365
3365
|
type
|
|
3366
3366
|
}
|
|
3367
|
-
)) : /* @__PURE__ */
|
|
3367
|
+
)) : /* @__PURE__ */ React2.default.createElement(React2.default.Fragment, null, formatCellValue(value))
|
|
3368
3368
|
);
|
|
3369
3369
|
};
|
|
3370
3370
|
|
|
3371
3371
|
// src/components/Input/index.tsx
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3372
|
+
|
|
3373
|
+
|
|
3374
|
+
var _formik = require('formik');
|
|
3375
3375
|
var Input = ({ withFormik = true, ...rest }) => {
|
|
3376
|
-
if (withFormik) return /* @__PURE__ */
|
|
3377
|
-
else return /* @__PURE__ */
|
|
3376
|
+
if (withFormik) return /* @__PURE__ */ React2.default.createElement(FormikInput, { ...rest });
|
|
3377
|
+
else return /* @__PURE__ */ React2.default.createElement(BaseInput, { ...rest });
|
|
3378
3378
|
};
|
|
3379
3379
|
var BaseInput = (props) => {
|
|
3380
|
-
return /* @__PURE__ */
|
|
3380
|
+
return /* @__PURE__ */ React2.default.createElement(_material.TextField, { fullWidth: true, ...props });
|
|
3381
3381
|
};
|
|
3382
3382
|
var FormikInput = ({ name, shrink, ...rest }) => {
|
|
3383
|
-
return /* @__PURE__ */
|
|
3383
|
+
return /* @__PURE__ */ React2.default.createElement(_formik.Field, { name }, ({ field: { value, ...field }, meta: { error } }) => /* @__PURE__ */ React2.default.createElement(
|
|
3384
3384
|
BaseInput,
|
|
3385
3385
|
{
|
|
3386
3386
|
defaultValue: value,
|
|
@@ -3394,12 +3394,12 @@ var FormikInput = ({ name, shrink, ...rest }) => {
|
|
|
3394
3394
|
};
|
|
3395
3395
|
|
|
3396
3396
|
// src/components/InputMask/index.tsx
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3397
|
+
|
|
3398
|
+
|
|
3399
|
+
|
|
3400
3400
|
function InputMask2({ withFormik = true, ...rest }) {
|
|
3401
|
-
if (withFormik) return /* @__PURE__ */
|
|
3402
|
-
else return /* @__PURE__ */
|
|
3401
|
+
if (withFormik) return /* @__PURE__ */ React2.default.createElement(FormikInputMask, { ...rest });
|
|
3402
|
+
else return /* @__PURE__ */ React2.default.createElement(BaseInputMask, { ...rest });
|
|
3403
3403
|
}
|
|
3404
3404
|
var BaseInputMask = ({
|
|
3405
3405
|
mask,
|
|
@@ -3408,7 +3408,7 @@ var BaseInputMask = ({
|
|
|
3408
3408
|
value: controlledValue,
|
|
3409
3409
|
...rest
|
|
3410
3410
|
}) => {
|
|
3411
|
-
const { ref, value, setValue, maskRef, unmaskedValue } =
|
|
3411
|
+
const { ref, value, setValue, maskRef, unmaskedValue } = _reactimask.useIMask.call(void 0,
|
|
3412
3412
|
mask,
|
|
3413
3413
|
{
|
|
3414
3414
|
onAccept: (...params) => {
|
|
@@ -3416,15 +3416,15 @@ var BaseInputMask = ({
|
|
|
3416
3416
|
}
|
|
3417
3417
|
}
|
|
3418
3418
|
);
|
|
3419
|
-
|
|
3419
|
+
_react.useEffect.call(void 0, () => {
|
|
3420
3420
|
if (!value) setValue(String(defaultValue));
|
|
3421
3421
|
maskRef.current.value = String(defaultValue);
|
|
3422
3422
|
}, [defaultValue]);
|
|
3423
|
-
|
|
3423
|
+
_react.useEffect.call(void 0, () => {
|
|
3424
3424
|
setValue(controlledValue);
|
|
3425
3425
|
maskRef.current.value = controlledValue;
|
|
3426
3426
|
}, [controlledValue]);
|
|
3427
|
-
return /* @__PURE__ */
|
|
3427
|
+
return /* @__PURE__ */ React2.default.createElement(BaseInput, { inputRef: ref, ...rest });
|
|
3428
3428
|
};
|
|
3429
3429
|
function FormikInputMask({
|
|
3430
3430
|
mask,
|
|
@@ -3432,13 +3432,13 @@ function FormikInputMask({
|
|
|
3432
3432
|
name,
|
|
3433
3433
|
...rest
|
|
3434
3434
|
}) {
|
|
3435
|
-
const { ref, value, unmaskedValue, maskRef, setValue } =
|
|
3435
|
+
const { ref, value, unmaskedValue, maskRef, setValue } = _reactimask.useIMask.call(void 0,
|
|
3436
3436
|
mask
|
|
3437
3437
|
);
|
|
3438
|
-
const initialValue =
|
|
3439
|
-
const formikSaveFunction =
|
|
3438
|
+
const initialValue = _react.useRef.call(void 0, "");
|
|
3439
|
+
const formikSaveFunction = _react.useRef.call(void 0, () => {
|
|
3440
3440
|
});
|
|
3441
|
-
|
|
3441
|
+
_react.useEffect.call(void 0, () => {
|
|
3442
3442
|
if (!value && defaultValue) {
|
|
3443
3443
|
setValue(String(defaultValue));
|
|
3444
3444
|
maskRef.current.value = String(defaultValue);
|
|
@@ -3447,18 +3447,18 @@ function FormikInputMask({
|
|
|
3447
3447
|
maskRef.current.value = String(initialValue.current);
|
|
3448
3448
|
}
|
|
3449
3449
|
}, [defaultValue]);
|
|
3450
|
-
|
|
3450
|
+
_react.useEffect.call(void 0, () => {
|
|
3451
3451
|
if (formikSaveFunction.current)
|
|
3452
3452
|
formikSaveFunction.current(name, unmaskedValue);
|
|
3453
3453
|
}, [value]);
|
|
3454
|
-
return /* @__PURE__ */
|
|
3454
|
+
return /* @__PURE__ */ React2.default.createElement(_formik.Field, { name }, ({
|
|
3455
3455
|
field: { value: value2, ...field },
|
|
3456
3456
|
meta: { error },
|
|
3457
3457
|
form: { setFieldValue }
|
|
3458
3458
|
}) => {
|
|
3459
3459
|
initialValue.current = value2;
|
|
3460
3460
|
formikSaveFunction.current = setFieldValue;
|
|
3461
|
-
return /* @__PURE__ */
|
|
3461
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3462
3462
|
BaseInput,
|
|
3463
3463
|
{
|
|
3464
3464
|
...rest,
|
|
@@ -3472,18 +3472,18 @@ function FormikInputMask({
|
|
|
3472
3472
|
}
|
|
3473
3473
|
|
|
3474
3474
|
// src/components/Select/index.tsx
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
var CustomInputLabel = InputLabel;
|
|
3475
|
+
|
|
3476
|
+
|
|
3477
|
+
|
|
3478
|
+
|
|
3479
|
+
|
|
3480
|
+
|
|
3481
|
+
|
|
3482
|
+
|
|
3483
|
+
var CustomInputLabel = _material.InputLabel;
|
|
3484
3484
|
function Select({ withFormik = true, ...rest }) {
|
|
3485
|
-
if (withFormik) return /* @__PURE__ */
|
|
3486
|
-
else return /* @__PURE__ */
|
|
3485
|
+
if (withFormik) return /* @__PURE__ */ React2.default.createElement(FormikSelect, { ...rest });
|
|
3486
|
+
else return /* @__PURE__ */ React2.default.createElement(BaseSelect, { ...rest });
|
|
3487
3487
|
}
|
|
3488
3488
|
function BaseSelect({
|
|
3489
3489
|
name,
|
|
@@ -3493,8 +3493,8 @@ function BaseSelect({
|
|
|
3493
3493
|
InputLabelProps: InputLabelProps2,
|
|
3494
3494
|
...rest
|
|
3495
3495
|
}) {
|
|
3496
|
-
return /* @__PURE__ */
|
|
3497
|
-
|
|
3496
|
+
return /* @__PURE__ */ React2.default.createElement(_material.FormControl, { fullWidth: true, ...FormControlProps2 }, /* @__PURE__ */ React2.default.createElement(CustomInputLabel, { ...InputLabelProps2 }, label), /* @__PURE__ */ React2.default.createElement(
|
|
3497
|
+
_material.Select,
|
|
3498
3498
|
{
|
|
3499
3499
|
name,
|
|
3500
3500
|
inputProps: {
|
|
@@ -3515,12 +3515,12 @@ function FormikSelect({
|
|
|
3515
3515
|
helperText,
|
|
3516
3516
|
...rest
|
|
3517
3517
|
}) {
|
|
3518
|
-
const [{ value, ...field }, meta, { setValue }] = useField({ name });
|
|
3518
|
+
const [{ value, ...field }, meta, { setValue }] = _formik.useField.call(void 0, { name });
|
|
3519
3519
|
const onChange = (_, { props: { value: value2 } }) => {
|
|
3520
3520
|
setValue(value2);
|
|
3521
3521
|
};
|
|
3522
|
-
return /* @__PURE__ */
|
|
3523
|
-
|
|
3522
|
+
return /* @__PURE__ */ React2.default.createElement(_material.FormControl, { fullWidth: true, ...FormControlProps2, error: Boolean(_optionalChain([meta, 'optionalAccess', _48 => _48.error])) }, /* @__PURE__ */ React2.default.createElement(CustomInputLabel, { ...InputLabelProps2 }, label), /* @__PURE__ */ React2.default.createElement(
|
|
3523
|
+
_material.Select,
|
|
3524
3524
|
{
|
|
3525
3525
|
inputProps: {
|
|
3526
3526
|
name
|
|
@@ -3532,22 +3532,22 @@ function FormikSelect({
|
|
|
3532
3532
|
onChange
|
|
3533
3533
|
},
|
|
3534
3534
|
children
|
|
3535
|
-
), /* @__PURE__ */
|
|
3535
|
+
), /* @__PURE__ */ React2.default.createElement(_material.FormHelperText, null, helperText || _optionalChain([meta, 'optionalAccess', _49 => _49.error])));
|
|
3536
3536
|
}
|
|
3537
3537
|
|
|
3538
3538
|
// src/components/Autocomplete/index.tsx
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3539
|
+
|
|
3540
|
+
|
|
3541
|
+
|
|
3542
|
+
|
|
3543
|
+
|
|
3544
|
+
|
|
3545
|
+
|
|
3546
|
+
|
|
3547
|
+
|
|
3548
|
+
|
|
3549
|
+
|
|
3550
|
+
var _styles = require('@mui/material/styles');
|
|
3551
3551
|
function Autocomplete2({
|
|
3552
3552
|
withFormik = true,
|
|
3553
3553
|
name,
|
|
@@ -3555,13 +3555,13 @@ function Autocomplete2({
|
|
|
3555
3555
|
...rest
|
|
3556
3556
|
}) {
|
|
3557
3557
|
if (withFormik) {
|
|
3558
|
-
const theme =
|
|
3559
|
-
const isLegacyBehaviorDisabledTheme =
|
|
3560
|
-
return theme.components
|
|
3558
|
+
const theme = _styles.useTheme.call(void 0, );
|
|
3559
|
+
const isLegacyBehaviorDisabledTheme = _react.useMemo.call(void 0, () => {
|
|
3560
|
+
return _optionalChain([theme, 'access', _50 => _50.components, 'optionalAccess', _51 => _51.MuiAutocomplete, 'optionalAccess', _52 => _52.defaultProps, 'optionalAccess', _53 => _53["data-legacy-behavior"]]) === "disabled";
|
|
3561
3561
|
}, [theme]);
|
|
3562
|
-
const isLegacyBehaviorDisabled = typeof rest
|
|
3562
|
+
const isLegacyBehaviorDisabled = typeof _optionalChain([rest, 'optionalAccess', _54 => _54["data-legacy-behavior"]]) !== "undefined" ? rest["data-legacy-behavior"] === "disabled" : isLegacyBehaviorDisabledTheme;
|
|
3563
3563
|
if (isLegacyBehaviorDisabled)
|
|
3564
|
-
return /* @__PURE__ */
|
|
3564
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3565
3565
|
FormikAutocomplete,
|
|
3566
3566
|
{
|
|
3567
3567
|
name,
|
|
@@ -3569,7 +3569,7 @@ function Autocomplete2({
|
|
|
3569
3569
|
...rest
|
|
3570
3570
|
}
|
|
3571
3571
|
);
|
|
3572
|
-
return /* @__PURE__ */
|
|
3572
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3573
3573
|
FormikAutocompleteLegacy,
|
|
3574
3574
|
{
|
|
3575
3575
|
name,
|
|
@@ -3578,14 +3578,14 @@ function Autocomplete2({
|
|
|
3578
3578
|
}
|
|
3579
3579
|
);
|
|
3580
3580
|
}
|
|
3581
|
-
return /* @__PURE__ */
|
|
3581
|
+
return /* @__PURE__ */ React2.default.createElement(BaseInput2, { ...rest });
|
|
3582
3582
|
}
|
|
3583
3583
|
function BaseInput2(props) {
|
|
3584
|
-
return /* @__PURE__ */
|
|
3585
|
-
|
|
3584
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3585
|
+
_material.Autocomplete,
|
|
3586
3586
|
{
|
|
3587
3587
|
fullWidth: true,
|
|
3588
|
-
renderInput: (params) => /* @__PURE__ */
|
|
3588
|
+
renderInput: (params) => /* @__PURE__ */ React2.default.createElement(_material.TextField, { label: props.label, ...params }),
|
|
3589
3589
|
...props
|
|
3590
3590
|
}
|
|
3591
3591
|
);
|
|
@@ -3595,18 +3595,18 @@ function FormikAutocompleteLegacy({
|
|
|
3595
3595
|
option,
|
|
3596
3596
|
...props
|
|
3597
3597
|
}) {
|
|
3598
|
-
const [{ value, ...field }, meta, { setValue }] =
|
|
3598
|
+
const [{ value, ...field }, meta, { setValue }] = _formik.useField.call(void 0, {
|
|
3599
3599
|
name: props.name
|
|
3600
3600
|
});
|
|
3601
|
-
const [defaultOption] =
|
|
3602
|
-
const key = option
|
|
3601
|
+
const [defaultOption] = _react.useState.call(void 0, () => {
|
|
3602
|
+
const key = _optionalChain([option, 'optionalAccess', _55 => _55.key]);
|
|
3603
3603
|
if (key) return props.options.find((option2) => option2[key] === value);
|
|
3604
3604
|
return props.options.find(
|
|
3605
3605
|
(option2) => Object.values(option2)[0] === value
|
|
3606
3606
|
);
|
|
3607
3607
|
});
|
|
3608
3608
|
const onChange = (_, newValue) => {
|
|
3609
|
-
const value2 = option
|
|
3609
|
+
const value2 = _optionalChain([option, 'optionalAccess', _56 => _56.value]);
|
|
3610
3610
|
if (getOptionValue) {
|
|
3611
3611
|
setValue(getOptionValue(newValue));
|
|
3612
3612
|
} else if (value2) {
|
|
@@ -3614,30 +3614,30 @@ function FormikAutocompleteLegacy({
|
|
|
3614
3614
|
} else setValue(newValue);
|
|
3615
3615
|
};
|
|
3616
3616
|
const getOptionLabel = (item) => {
|
|
3617
|
-
if (props
|
|
3618
|
-
if (option
|
|
3617
|
+
if (_optionalChain([props, 'optionalAccess', _57 => _57.getOptionLabel])) return props.getOptionLabel(item);
|
|
3618
|
+
if (_optionalChain([option, 'optionalAccess', _58 => _58.label])) return String(item[option.label]);
|
|
3619
3619
|
return "[getOptionLabel] error";
|
|
3620
3620
|
};
|
|
3621
3621
|
const isOptionEqualToValue = (a, b) => {
|
|
3622
|
-
const key = option
|
|
3623
|
-
if (props
|
|
3622
|
+
const key = _optionalChain([option, 'optionalAccess', _59 => _59.key]);
|
|
3623
|
+
if (_optionalChain([props, 'optionalAccess', _60 => _60.isOptionEqualToValue])) return props.isOptionEqualToValue(a, b);
|
|
3624
3624
|
if (key) return a[key] === b[key];
|
|
3625
3625
|
return Object.values(a)[0] === Object.values(b)[0];
|
|
3626
3626
|
};
|
|
3627
|
-
return /* @__PURE__ */
|
|
3628
|
-
|
|
3627
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3628
|
+
_material.Autocomplete,
|
|
3629
3629
|
{
|
|
3630
3630
|
getOptionLabel,
|
|
3631
|
-
renderInput: (params) => /* @__PURE__ */
|
|
3632
|
-
|
|
3631
|
+
renderInput: (params) => /* @__PURE__ */ React2.default.createElement(
|
|
3632
|
+
_material.TextField,
|
|
3633
3633
|
{
|
|
3634
|
-
error: Boolean(meta
|
|
3635
|
-
helperText: meta
|
|
3634
|
+
error: Boolean(_optionalChain([meta, 'optionalAccess', _61 => _61.error])),
|
|
3635
|
+
helperText: _optionalChain([meta, 'optionalAccess', _62 => _62.error]),
|
|
3636
3636
|
...params,
|
|
3637
3637
|
...field,
|
|
3638
3638
|
InputProps: {
|
|
3639
3639
|
...params.InputProps,
|
|
3640
|
-
endAdornment: /* @__PURE__ */
|
|
3640
|
+
endAdornment: /* @__PURE__ */ React2.default.createElement(_react.Fragment, null, props.loading ? /* @__PURE__ */ React2.default.createElement(_material.CircularProgress, { color: "inherit", size: 20 }) : null, params.InputProps.endAdornment)
|
|
3641
3641
|
},
|
|
3642
3642
|
label: props.label,
|
|
3643
3643
|
required: props.required,
|
|
@@ -3657,31 +3657,31 @@ function FormikAutocomplete({
|
|
|
3657
3657
|
option,
|
|
3658
3658
|
...props
|
|
3659
3659
|
}) {
|
|
3660
|
-
const [{ value, ...field }, meta, { setValue }] =
|
|
3660
|
+
const [{ value, ...field }, meta, { setValue }] = _formik.useField.call(void 0, {
|
|
3661
3661
|
name: props.name
|
|
3662
3662
|
});
|
|
3663
|
-
const [defaultValue] =
|
|
3663
|
+
const [defaultValue] = _react.useState.call(void 0, value);
|
|
3664
3664
|
const onChange = (_, newValue) => {
|
|
3665
|
-
const value2 = option
|
|
3665
|
+
const value2 = _optionalChain([option, 'optionalAccess', _63 => _63.value]);
|
|
3666
3666
|
if (getOptionValue) {
|
|
3667
3667
|
setValue(getOptionValue(newValue));
|
|
3668
3668
|
} else if (value2) {
|
|
3669
3669
|
setValue(newValue[value2]);
|
|
3670
3670
|
} else setValue(newValue);
|
|
3671
3671
|
};
|
|
3672
|
-
return /* @__PURE__ */
|
|
3673
|
-
|
|
3672
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3673
|
+
_material.Autocomplete,
|
|
3674
3674
|
{
|
|
3675
|
-
renderInput: (params) => /* @__PURE__ */
|
|
3676
|
-
|
|
3675
|
+
renderInput: (params) => /* @__PURE__ */ React2.default.createElement(
|
|
3676
|
+
_material.TextField,
|
|
3677
3677
|
{
|
|
3678
|
-
error: Boolean(meta
|
|
3679
|
-
helperText: meta
|
|
3678
|
+
error: Boolean(_optionalChain([meta, 'optionalAccess', _64 => _64.error])),
|
|
3679
|
+
helperText: _optionalChain([meta, 'optionalAccess', _65 => _65.error]),
|
|
3680
3680
|
...params,
|
|
3681
3681
|
...field,
|
|
3682
3682
|
InputProps: {
|
|
3683
3683
|
...params.InputProps,
|
|
3684
|
-
endAdornment: /* @__PURE__ */
|
|
3684
|
+
endAdornment: /* @__PURE__ */ React2.default.createElement(_react.Fragment, null, props.loading ? /* @__PURE__ */ React2.default.createElement(_material.CircularProgress, { color: "inherit", size: 20 }) : null, params.InputProps.endAdornment)
|
|
3685
3685
|
},
|
|
3686
3686
|
label: props.label,
|
|
3687
3687
|
required: props.required,
|
|
@@ -3697,30 +3697,30 @@ function FormikAutocomplete({
|
|
|
3697
3697
|
}
|
|
3698
3698
|
|
|
3699
3699
|
// src/components/Checkbox/index.tsx
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3700
|
+
|
|
3701
|
+
|
|
3702
|
+
|
|
3703
|
+
|
|
3704
|
+
|
|
3705
|
+
|
|
3706
3706
|
var Checkbox = ({
|
|
3707
3707
|
withFormik = true,
|
|
3708
3708
|
name,
|
|
3709
3709
|
...props
|
|
3710
3710
|
}) => {
|
|
3711
|
-
if (withFormik && name) return /* @__PURE__ */
|
|
3712
|
-
else return /* @__PURE__ */
|
|
3711
|
+
if (withFormik && name) return /* @__PURE__ */ React2.default.createElement(FormikCheckbox, { name, ...props });
|
|
3712
|
+
else return /* @__PURE__ */ React2.default.createElement(BaseCheckbox, { ...props });
|
|
3713
3713
|
};
|
|
3714
3714
|
var BaseCheckbox = ({
|
|
3715
3715
|
label,
|
|
3716
3716
|
FormControlLabelProps: FormControlLabelProps3,
|
|
3717
3717
|
...props
|
|
3718
3718
|
}) => {
|
|
3719
|
-
return /* @__PURE__ */
|
|
3720
|
-
FormControlLabel,
|
|
3719
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3720
|
+
_material.FormControlLabel,
|
|
3721
3721
|
{
|
|
3722
3722
|
label,
|
|
3723
|
-
control: /* @__PURE__ */
|
|
3723
|
+
control: /* @__PURE__ */ React2.default.createElement(_material.Checkbox, { ...props }),
|
|
3724
3724
|
...FormControlLabelProps3
|
|
3725
3725
|
}
|
|
3726
3726
|
);
|
|
@@ -3731,17 +3731,17 @@ var FormikCheckbox = ({
|
|
|
3731
3731
|
FormControlLabelProps: FormControlLabelProps3,
|
|
3732
3732
|
...props
|
|
3733
3733
|
}) => {
|
|
3734
|
-
const [{ value, ...field }, , { setValue }] =
|
|
3734
|
+
const [{ value, ...field }, , { setValue }] = _formik.useField.call(void 0, {
|
|
3735
3735
|
name
|
|
3736
3736
|
});
|
|
3737
3737
|
const onChange = (_, value2) => {
|
|
3738
3738
|
setValue(value2);
|
|
3739
3739
|
};
|
|
3740
|
-
return /* @__PURE__ */
|
|
3741
|
-
FormControlLabel,
|
|
3740
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3741
|
+
_material.FormControlLabel,
|
|
3742
3742
|
{
|
|
3743
3743
|
label,
|
|
3744
|
-
control: /* @__PURE__ */
|
|
3744
|
+
control: /* @__PURE__ */ React2.default.createElement(_material.Checkbox, { ...props, defaultChecked: Boolean(value) }),
|
|
3745
3745
|
...field,
|
|
3746
3746
|
onChange,
|
|
3747
3747
|
...FormControlLabelProps3
|
|
@@ -3750,26 +3750,26 @@ var FormikCheckbox = ({
|
|
|
3750
3750
|
};
|
|
3751
3751
|
|
|
3752
3752
|
// src/components/Switch/index.tsx
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3753
|
+
|
|
3754
|
+
|
|
3755
|
+
|
|
3756
|
+
|
|
3757
|
+
|
|
3758
|
+
|
|
3759
3759
|
var Switch = ({ withFormik = true, name, ...props }) => {
|
|
3760
|
-
if (withFormik && name) return /* @__PURE__ */
|
|
3761
|
-
else return /* @__PURE__ */
|
|
3760
|
+
if (withFormik && name) return /* @__PURE__ */ React2.default.createElement(FormikSwitch, { name, ...props });
|
|
3761
|
+
else return /* @__PURE__ */ React2.default.createElement(BaseSwitch, { ...props });
|
|
3762
3762
|
};
|
|
3763
3763
|
var BaseSwitch = ({
|
|
3764
3764
|
label,
|
|
3765
3765
|
FormControlLabelProps: FormControlLabelProps3,
|
|
3766
3766
|
...props
|
|
3767
3767
|
}) => {
|
|
3768
|
-
return /* @__PURE__ */
|
|
3769
|
-
|
|
3768
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3769
|
+
_material.FormControlLabel,
|
|
3770
3770
|
{
|
|
3771
3771
|
label,
|
|
3772
|
-
control: /* @__PURE__ */
|
|
3772
|
+
control: /* @__PURE__ */ React2.default.createElement(_material.Switch, { ...props }),
|
|
3773
3773
|
...FormControlLabelProps3
|
|
3774
3774
|
}
|
|
3775
3775
|
);
|
|
@@ -3780,18 +3780,18 @@ var FormikSwitch = ({
|
|
|
3780
3780
|
FormControlLabelProps: FormControlLabelProps3,
|
|
3781
3781
|
...props
|
|
3782
3782
|
}) => {
|
|
3783
|
-
const [{ value, onChange: unused, ...field }, , { setValue }] =
|
|
3783
|
+
const [{ value, onChange: unused, ...field }, , { setValue }] = _formik.useField.call(void 0, {
|
|
3784
3784
|
name
|
|
3785
3785
|
});
|
|
3786
3786
|
const onChange = (_, value2) => {
|
|
3787
3787
|
setValue(value2);
|
|
3788
3788
|
};
|
|
3789
|
-
return /* @__PURE__ */
|
|
3790
|
-
|
|
3789
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3790
|
+
_material.FormControlLabel,
|
|
3791
3791
|
{
|
|
3792
3792
|
label,
|
|
3793
3793
|
onChange,
|
|
3794
|
-
control: /* @__PURE__ */
|
|
3794
|
+
control: /* @__PURE__ */ React2.default.createElement(_material.Switch, { defaultChecked: value, ...props }),
|
|
3795
3795
|
...field,
|
|
3796
3796
|
...FormControlLabelProps3
|
|
3797
3797
|
}
|
|
@@ -3799,35 +3799,35 @@ var FormikSwitch = ({
|
|
|
3799
3799
|
};
|
|
3800
3800
|
|
|
3801
3801
|
// src/components/Radio/index.tsx
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3802
|
+
|
|
3803
|
+
|
|
3804
|
+
|
|
3805
|
+
|
|
3806
|
+
|
|
3807
|
+
|
|
3808
|
+
|
|
3809
|
+
|
|
3810
|
+
|
|
3811
3811
|
var Radio = ({
|
|
3812
3812
|
name,
|
|
3813
3813
|
withFormik = true,
|
|
3814
3814
|
...rest
|
|
3815
3815
|
}) => {
|
|
3816
|
-
if (withFormik && name) return /* @__PURE__ */
|
|
3817
|
-
else return /* @__PURE__ */
|
|
3816
|
+
if (withFormik && name) return /* @__PURE__ */ React2.default.createElement(FormikRadio, { name, ...rest });
|
|
3817
|
+
else return /* @__PURE__ */ React2.default.createElement(BaseRadio, { ...rest });
|
|
3818
3818
|
};
|
|
3819
3819
|
var BaseRadio = ({
|
|
3820
3820
|
label,
|
|
3821
3821
|
options,
|
|
3822
3822
|
...rest
|
|
3823
3823
|
}) => {
|
|
3824
|
-
return /* @__PURE__ */
|
|
3825
|
-
|
|
3824
|
+
return /* @__PURE__ */ React2.default.createElement(_material.FormControl, null, label && /* @__PURE__ */ React2.default.createElement(_material.FormLabel, null, label), /* @__PURE__ */ React2.default.createElement(_material.RadioGroup, { ...rest }, options.map((option) => /* @__PURE__ */ React2.default.createElement(
|
|
3825
|
+
_material.FormControlLabel,
|
|
3826
3826
|
{
|
|
3827
3827
|
key: String(option.value),
|
|
3828
3828
|
value: option.value,
|
|
3829
3829
|
label: option.label,
|
|
3830
|
-
control: /* @__PURE__ */
|
|
3830
|
+
control: /* @__PURE__ */ React2.default.createElement(_material.Radio, null)
|
|
3831
3831
|
}
|
|
3832
3832
|
))));
|
|
3833
3833
|
};
|
|
@@ -3840,31 +3840,31 @@ var FormikRadio = ({
|
|
|
3840
3840
|
const onChange = (setFieldValue, value) => {
|
|
3841
3841
|
setFieldValue(name, value);
|
|
3842
3842
|
};
|
|
3843
|
-
return /* @__PURE__ */
|
|
3844
|
-
RadioGroup,
|
|
3843
|
+
return /* @__PURE__ */ React2.default.createElement(_formik.Field, null, ({ field: { value }, form: { setFieldValue } }) => /* @__PURE__ */ React2.default.createElement(_material.FormControl, null, label && /* @__PURE__ */ React2.default.createElement(_material.FormLabel, null, label), /* @__PURE__ */ React2.default.createElement(
|
|
3844
|
+
_material.RadioGroup,
|
|
3845
3845
|
{
|
|
3846
3846
|
defaultValue: value,
|
|
3847
3847
|
onChange: (_, value2) => onChange(setFieldValue, value2),
|
|
3848
3848
|
...rest
|
|
3849
3849
|
},
|
|
3850
|
-
options.map((option) => /* @__PURE__ */
|
|
3851
|
-
|
|
3850
|
+
options.map((option) => /* @__PURE__ */ React2.default.createElement(
|
|
3851
|
+
_material.FormControlLabel,
|
|
3852
3852
|
{
|
|
3853
3853
|
key: String(option.value),
|
|
3854
3854
|
value: option.value,
|
|
3855
3855
|
label: option.label,
|
|
3856
|
-
control: /* @__PURE__ */
|
|
3856
|
+
control: /* @__PURE__ */ React2.default.createElement(_material.Radio, null)
|
|
3857
3857
|
}
|
|
3858
3858
|
))
|
|
3859
3859
|
)));
|
|
3860
3860
|
};
|
|
3861
3861
|
|
|
3862
3862
|
// src/components/LargeButton/index.tsx
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3863
|
+
|
|
3864
|
+
|
|
3865
|
+
|
|
3866
|
+
|
|
3867
|
+
|
|
3868
3868
|
var LargeButton = ({
|
|
3869
3869
|
loading,
|
|
3870
3870
|
children,
|
|
@@ -3872,8 +3872,8 @@ var LargeButton = ({
|
|
|
3872
3872
|
sx,
|
|
3873
3873
|
...rest
|
|
3874
3874
|
}) => {
|
|
3875
|
-
return /* @__PURE__ */
|
|
3876
|
-
|
|
3875
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3876
|
+
_material.Button,
|
|
3877
3877
|
{
|
|
3878
3878
|
variant: "contained",
|
|
3879
3879
|
fullWidth: true,
|
|
@@ -3881,8 +3881,8 @@ var LargeButton = ({
|
|
|
3881
3881
|
disabled: rest.disabled || loading,
|
|
3882
3882
|
...rest
|
|
3883
3883
|
},
|
|
3884
|
-
loading ? /* @__PURE__ */
|
|
3885
|
-
|
|
3884
|
+
loading ? /* @__PURE__ */ React2.default.createElement(
|
|
3885
|
+
_material.CircularProgress,
|
|
3886
3886
|
{
|
|
3887
3887
|
size: 25,
|
|
3888
3888
|
color: "inherit",
|
|
@@ -3893,7 +3893,7 @@ var LargeButton = ({
|
|
|
3893
3893
|
};
|
|
3894
3894
|
|
|
3895
3895
|
// src/components/TabPanel/index.tsx
|
|
3896
|
-
|
|
3896
|
+
|
|
3897
3897
|
function getTabProps(index) {
|
|
3898
3898
|
return {
|
|
3899
3899
|
id: `tab-${index}`,
|
|
@@ -3902,7 +3902,7 @@ function getTabProps(index) {
|
|
|
3902
3902
|
}
|
|
3903
3903
|
var TabPanel = (props) => {
|
|
3904
3904
|
const { children, value, index, ...other } = props;
|
|
3905
|
-
return /* @__PURE__ */
|
|
3905
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3906
3906
|
"div",
|
|
3907
3907
|
{
|
|
3908
3908
|
role: "tabpanel",
|
|
@@ -3911,35 +3911,35 @@ var TabPanel = (props) => {
|
|
|
3911
3911
|
"aria-labelledby": `tab-${index}`,
|
|
3912
3912
|
...other
|
|
3913
3913
|
},
|
|
3914
|
-
value === index && /* @__PURE__ */
|
|
3914
|
+
value === index && /* @__PURE__ */ React2.default.createElement(React2.default.Fragment, null, children)
|
|
3915
3915
|
);
|
|
3916
3916
|
};
|
|
3917
3917
|
|
|
3918
3918
|
// src/components/BaseGrid/index.tsx
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3919
|
+
|
|
3920
|
+
|
|
3921
|
+
|
|
3922
|
+
|
|
3923
|
+
|
|
3924
|
+
|
|
3925
|
+
|
|
3926
|
+
|
|
3927
|
+
|
|
3928
|
+
|
|
3929
|
+
|
|
3930
|
+
|
|
3931
3931
|
|
|
3932
3932
|
// src/components/BaseGrid/Pagination/index.tsx
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3933
|
+
|
|
3934
|
+
|
|
3935
|
+
|
|
3936
|
+
|
|
3937
|
+
|
|
3938
|
+
|
|
3939
|
+
|
|
3940
|
+
|
|
3941
|
+
|
|
3942
|
+
|
|
3943
3943
|
var GridPagination = ({
|
|
3944
3944
|
currentPage,
|
|
3945
3945
|
totalNumberOfPages,
|
|
@@ -3949,8 +3949,8 @@ var GridPagination = ({
|
|
|
3949
3949
|
rowsPerPage,
|
|
3950
3950
|
dense
|
|
3951
3951
|
}) => {
|
|
3952
|
-
return /* @__PURE__ */
|
|
3953
|
-
Stack,
|
|
3952
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
3953
|
+
_material.Stack,
|
|
3954
3954
|
{
|
|
3955
3955
|
direction: "row",
|
|
3956
3956
|
justifyContent: "space-between",
|
|
@@ -3958,9 +3958,9 @@ var GridPagination = ({
|
|
|
3958
3958
|
width: "100%",
|
|
3959
3959
|
py: dense ? 0.5 : 1
|
|
3960
3960
|
},
|
|
3961
|
-
/* @__PURE__ */
|
|
3962
|
-
/* @__PURE__ */
|
|
3963
|
-
|
|
3961
|
+
/* @__PURE__ */ React2.default.createElement(_material.Box, null),
|
|
3962
|
+
/* @__PURE__ */ React2.default.createElement(_material.Stack, { direction: "row", alignItems: "center" }, /* @__PURE__ */ React2.default.createElement(
|
|
3963
|
+
_material.Select,
|
|
3964
3964
|
{
|
|
3965
3965
|
variant: "standard",
|
|
3966
3966
|
size: "small",
|
|
@@ -3969,23 +3969,23 @@ var GridPagination = ({
|
|
|
3969
3969
|
value: rowsPerPage,
|
|
3970
3970
|
onChange: ({ target }) => setRowsPerPage(parseInt(target.value))
|
|
3971
3971
|
},
|
|
3972
|
-
rowsPerPageOptions.map((option) => /* @__PURE__ */
|
|
3973
|
-
), /* @__PURE__ */
|
|
3974
|
-
|
|
3972
|
+
rowsPerPageOptions.map((option) => /* @__PURE__ */ React2.default.createElement(_material.MenuItem, { key: option, value: option }, option))
|
|
3973
|
+
), /* @__PURE__ */ React2.default.createElement(_material.Typography, { variant: "body2" }, currentPage + 1, " de ", totalNumberOfPages + 1), /* @__PURE__ */ React2.default.createElement(
|
|
3974
|
+
_material.IconButton,
|
|
3975
3975
|
{
|
|
3976
3976
|
size: "small",
|
|
3977
3977
|
disabled: currentPage === 0,
|
|
3978
3978
|
onClick: () => onPageChange(currentPage - 1)
|
|
3979
3979
|
},
|
|
3980
|
-
/* @__PURE__ */
|
|
3981
|
-
), /* @__PURE__ */
|
|
3982
|
-
|
|
3980
|
+
/* @__PURE__ */ React2.default.createElement(_md.MdArrowBackIosNew, { size: 8 * 2 })
|
|
3981
|
+
), /* @__PURE__ */ React2.default.createElement(
|
|
3982
|
+
_material.IconButton,
|
|
3983
3983
|
{
|
|
3984
3984
|
size: "small",
|
|
3985
3985
|
disabled: currentPage === totalNumberOfPages,
|
|
3986
3986
|
onClick: () => onPageChange(currentPage + 1)
|
|
3987
3987
|
},
|
|
3988
|
-
/* @__PURE__ */
|
|
3988
|
+
/* @__PURE__ */ React2.default.createElement(_md.MdArrowForwardIos, { size: 8 * 2 })
|
|
3989
3989
|
))
|
|
3990
3990
|
);
|
|
3991
3991
|
};
|
|
@@ -4054,8 +4054,8 @@ function BaseGrid({
|
|
|
4054
4054
|
loadingColSpan,
|
|
4055
4055
|
isLoading
|
|
4056
4056
|
}) {
|
|
4057
|
-
return /* @__PURE__ */
|
|
4058
|
-
|
|
4057
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
4058
|
+
_material.Paper,
|
|
4059
4059
|
{
|
|
4060
4060
|
...paperProps,
|
|
4061
4061
|
sx: {
|
|
@@ -4063,60 +4063,60 @@ function BaseGrid({
|
|
|
4063
4063
|
...styles.bordered(bordered),
|
|
4064
4064
|
...styles.striped(striped),
|
|
4065
4065
|
...styles.lastRowBorder(hideFooter),
|
|
4066
|
-
...paperProps
|
|
4066
|
+
..._optionalChain([paperProps, 'optionalAccess', _66 => _66.sx])
|
|
4067
4067
|
}
|
|
4068
4068
|
},
|
|
4069
|
-
/* @__PURE__ */
|
|
4070
|
-
|
|
4069
|
+
/* @__PURE__ */ React2.default.createElement(
|
|
4070
|
+
_material.Box,
|
|
4071
4071
|
{
|
|
4072
4072
|
...boxContainerProps,
|
|
4073
|
-
sx: { overflowX: "auto", ...boxContainerProps
|
|
4073
|
+
sx: { overflowX: "auto", ..._optionalChain([boxContainerProps, 'optionalAccess', _67 => _67.sx]) }
|
|
4074
4074
|
},
|
|
4075
|
-
/* @__PURE__ */
|
|
4076
|
-
|
|
4075
|
+
/* @__PURE__ */ React2.default.createElement(
|
|
4076
|
+
_material.Table,
|
|
4077
4077
|
{
|
|
4078
4078
|
size: "small",
|
|
4079
4079
|
stickyHeader: true,
|
|
4080
4080
|
...tableProps,
|
|
4081
4081
|
sx: {
|
|
4082
|
-
...tableProps
|
|
4082
|
+
..._optionalChain([tableProps, 'optionalAccess', _68 => _68.sx])
|
|
4083
4083
|
}
|
|
4084
4084
|
},
|
|
4085
|
-
/* @__PURE__ */
|
|
4086
|
-
|
|
4085
|
+
/* @__PURE__ */ React2.default.createElement(_material.TableHead, { ...tableHeadProps }, /* @__PURE__ */ React2.default.createElement(_material.TableRow, null, prependColumn, columns.map((column) => /* @__PURE__ */ React2.default.createElement(
|
|
4086
|
+
_material.TableCell,
|
|
4087
4087
|
{
|
|
4088
4088
|
key: column.name,
|
|
4089
4089
|
padding: dense ? "none" : "normal",
|
|
4090
4090
|
...column.props,
|
|
4091
4091
|
sx: {
|
|
4092
4092
|
pl: 2,
|
|
4093
|
-
...column
|
|
4093
|
+
..._optionalChain([column, 'optionalAccess', _69 => _69.sx])
|
|
4094
4094
|
}
|
|
4095
4095
|
},
|
|
4096
|
-
column.children ? column.children : /* @__PURE__ */
|
|
4097
|
-
|
|
4096
|
+
column.children ? column.children : /* @__PURE__ */ React2.default.createElement(
|
|
4097
|
+
_material.TableSortLabel,
|
|
4098
4098
|
{
|
|
4099
4099
|
active: sortedBy.some((p) => p.prop === column.name),
|
|
4100
|
-
direction: sortedBy.find((p) => p.prop === column.name)
|
|
4100
|
+
direction: _optionalChain([sortedBy, 'access', _70 => _70.find, 'call', _71 => _71((p) => p.prop === column.name), 'optionalAccess', _72 => _72.direction]) || "desc",
|
|
4101
4101
|
onClick: () => onSortBy(column.name),
|
|
4102
4102
|
disabled: column.canSort === false,
|
|
4103
4103
|
...tableSortLabelProps,
|
|
4104
|
-
sx: { ...tableSortLabelProps
|
|
4104
|
+
sx: { ..._optionalChain([tableSortLabelProps, 'optionalAccess', _73 => _73.sx]) }
|
|
4105
4105
|
},
|
|
4106
4106
|
column.label
|
|
4107
4107
|
)
|
|
4108
|
-
)), appendColumn), isLoading && /* @__PURE__ */
|
|
4109
|
-
|
|
4108
|
+
)), appendColumn), isLoading && /* @__PURE__ */ React2.default.createElement(_material.TableRow, null, /* @__PURE__ */ React2.default.createElement(
|
|
4109
|
+
_material.TableCell,
|
|
4110
4110
|
{
|
|
4111
4111
|
colSpan: loadingColSpan || columns.length,
|
|
4112
4112
|
sx: { p: 0, border: "none" }
|
|
4113
4113
|
},
|
|
4114
|
-
/* @__PURE__ */
|
|
4114
|
+
/* @__PURE__ */ React2.default.createElement(_material.LinearProgress, null)
|
|
4115
4115
|
))),
|
|
4116
|
-
/* @__PURE__ */
|
|
4116
|
+
/* @__PURE__ */ React2.default.createElement(_material.TableBody, { ...tableBodyProps }, children)
|
|
4117
4117
|
)
|
|
4118
4118
|
),
|
|
4119
|
-
!hideFooter && /* @__PURE__ */
|
|
4119
|
+
!hideFooter && /* @__PURE__ */ React2.default.createElement(
|
|
4120
4120
|
GridPagination,
|
|
4121
4121
|
{
|
|
4122
4122
|
rowsPerPageOptions,
|
|
@@ -4132,26 +4132,26 @@ function BaseGrid({
|
|
|
4132
4132
|
}
|
|
4133
4133
|
|
|
4134
4134
|
// src/components/BaseGrid/BaseGridAutoRows.tsx
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4135
|
+
|
|
4136
|
+
|
|
4137
|
+
|
|
4138
4138
|
function BaseGridAutoRows({
|
|
4139
4139
|
data,
|
|
4140
4140
|
columns,
|
|
4141
4141
|
rowKey
|
|
4142
4142
|
}) {
|
|
4143
|
-
return /* @__PURE__ */
|
|
4143
|
+
return /* @__PURE__ */ React2.default.createElement(_react.Fragment, null, data.map((row) => /* @__PURE__ */ React2.default.createElement(_material.TableRow, { key: row[rowKey] }, columns.map((column) => /* @__PURE__ */ React2.default.createElement(_material.TableCell, { key: column.name }, row[column.name])))));
|
|
4144
4144
|
}
|
|
4145
4145
|
|
|
4146
4146
|
// src/components/Modal/index.tsx
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4147
|
+
|
|
4148
|
+
|
|
4149
|
+
|
|
4150
|
+
|
|
4151
|
+
|
|
4152
4152
|
var Modal = ({ open, onClose, BoxProps: BoxProps3, ...rest }) => {
|
|
4153
|
-
return /* @__PURE__ */
|
|
4154
|
-
|
|
4153
|
+
return /* @__PURE__ */ React2.default.createElement(_material.Modal, { open, onClose, ...rest }, /* @__PURE__ */ React2.default.createElement(
|
|
4154
|
+
_material.Box,
|
|
4155
4155
|
{
|
|
4156
4156
|
...BoxProps3,
|
|
4157
4157
|
sx: {
|
|
@@ -4162,7 +4162,7 @@ var Modal = ({ open, onClose, BoxProps: BoxProps3, ...rest }) => {
|
|
|
4162
4162
|
left: "50%",
|
|
4163
4163
|
transform: "translate(-50%, -50%)",
|
|
4164
4164
|
borderRadius: 1,
|
|
4165
|
-
...BoxProps3
|
|
4165
|
+
..._optionalChain([BoxProps3, 'optionalAccess', _74 => _74.sx])
|
|
4166
4166
|
}
|
|
4167
4167
|
},
|
|
4168
4168
|
rest.children
|
|
@@ -4178,16 +4178,16 @@ function GetInputLabel(columns) {
|
|
|
4178
4178
|
}
|
|
4179
4179
|
|
|
4180
4180
|
// src/components/Dialog/index.tsx
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4181
|
+
|
|
4182
|
+
|
|
4183
|
+
|
|
4184
|
+
|
|
4185
|
+
|
|
4186
|
+
|
|
4187
|
+
|
|
4188
|
+
|
|
4189
|
+
|
|
4190
|
+
|
|
4191
4191
|
var Dialog = ({
|
|
4192
4192
|
open,
|
|
4193
4193
|
title,
|
|
@@ -4196,9 +4196,9 @@ var Dialog = ({
|
|
|
4196
4196
|
options,
|
|
4197
4197
|
...rest
|
|
4198
4198
|
}) => {
|
|
4199
|
-
return /* @__PURE__ */
|
|
4200
|
-
return /* @__PURE__ */
|
|
4201
|
-
|
|
4199
|
+
return /* @__PURE__ */ React2.default.createElement(_material.Dialog, { open, ...rest }, /* @__PURE__ */ React2.default.createElement(_material.Box, { sx: { p: 2 } }, /* @__PURE__ */ React2.default.createElement(_material.DialogTitle, { sx: { fontWeight: "bold" } }, title), /* @__PURE__ */ React2.default.createElement(_material.DialogContentText, { sx: { px: "10px", textAlign: "center", mb: 2 } }, body), /* @__PURE__ */ React2.default.createElement(_material.DialogActions, null, options.map((option, index) => {
|
|
4200
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
4201
|
+
_material.Button,
|
|
4202
4202
|
{
|
|
4203
4203
|
key: index,
|
|
4204
4204
|
onClick: () => option.cb(option.label),
|
|
@@ -4210,25 +4210,25 @@ var Dialog = ({
|
|
|
4210
4210
|
disableElevation: true,
|
|
4211
4211
|
disabled: loading
|
|
4212
4212
|
},
|
|
4213
|
-
loading && option.focus ? /* @__PURE__ */
|
|
4213
|
+
loading && option.focus ? /* @__PURE__ */ React2.default.createElement(_material.CircularProgress, { size: 25, color: "inherit" }) : /* @__PURE__ */ React2.default.createElement(React2.default.Fragment, null, option.label)
|
|
4214
4214
|
);
|
|
4215
4215
|
}))));
|
|
4216
4216
|
};
|
|
4217
4217
|
|
|
4218
4218
|
// src/components/DialogConfirm/DialogConfirm.view.tsx
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4219
|
+
|
|
4220
|
+
|
|
4221
|
+
var _colors = require('@mui/material/colors');
|
|
4222
|
+
|
|
4223
4223
|
|
|
4224
4224
|
// src/components/DialogConfirm/DialogConfirm.model.ts
|
|
4225
|
-
|
|
4225
|
+
|
|
4226
4226
|
function UseDialogConfirm() {
|
|
4227
|
-
const [opened, setOpened] =
|
|
4228
|
-
const [isLoading, setLoading] =
|
|
4229
|
-
const onConfirmFn =
|
|
4227
|
+
const [opened, setOpened] = _react.useState.call(void 0, false);
|
|
4228
|
+
const [isLoading, setLoading] = _react.useState.call(void 0, false);
|
|
4229
|
+
const onConfirmFn = _react.useRef.call(void 0, async () => {
|
|
4230
4230
|
});
|
|
4231
|
-
const paramsFn =
|
|
4231
|
+
const paramsFn = _react.useRef.call(void 0, []);
|
|
4232
4232
|
const onConfirm = (fn) => {
|
|
4233
4233
|
onConfirmFn.current = fn;
|
|
4234
4234
|
return async (...params) => {
|
|
@@ -4237,8 +4237,8 @@ function UseDialogConfirm() {
|
|
|
4237
4237
|
};
|
|
4238
4238
|
};
|
|
4239
4239
|
const onProceed = async (event) => {
|
|
4240
|
-
event
|
|
4241
|
-
event
|
|
4240
|
+
_optionalChain([event, 'optionalAccess', _75 => _75.preventDefault, 'call', _76 => _76()]);
|
|
4241
|
+
_optionalChain([event, 'optionalAccess', _77 => _77.stopPropagation, 'call', _78 => _78()]);
|
|
4242
4242
|
setLoading(true);
|
|
4243
4243
|
try {
|
|
4244
4244
|
if (!onConfirmFn.current) return;
|
|
@@ -4249,8 +4249,8 @@ function UseDialogConfirm() {
|
|
|
4249
4249
|
}
|
|
4250
4250
|
};
|
|
4251
4251
|
const onCancel = (event) => {
|
|
4252
|
-
event
|
|
4253
|
-
event
|
|
4252
|
+
_optionalChain([event, 'optionalAccess', _79 => _79.preventDefault, 'call', _80 => _80()]);
|
|
4253
|
+
_optionalChain([event, 'optionalAccess', _81 => _81.stopPropagation, 'call', _82 => _82()]);
|
|
4254
4254
|
setOpened(false);
|
|
4255
4255
|
};
|
|
4256
4256
|
const onCloseModal = () => {
|
|
@@ -4268,19 +4268,19 @@ function UseDialogConfirm() {
|
|
|
4268
4268
|
}
|
|
4269
4269
|
|
|
4270
4270
|
// src/components/DialogConfirm/DialogConfirm.view.tsx
|
|
4271
|
-
var DEFAULT_ICON = MdOutlineWarningAmber;
|
|
4271
|
+
var DEFAULT_ICON = _md.MdOutlineWarningAmber;
|
|
4272
4272
|
var DialogConfirm = (props) => {
|
|
4273
4273
|
const model = UseDialogConfirm();
|
|
4274
4274
|
const Icon = props.icon || DEFAULT_ICON;
|
|
4275
|
-
return /* @__PURE__ */
|
|
4275
|
+
return /* @__PURE__ */ React2.default.createElement(React2.default.Fragment, null, props.children({
|
|
4276
4276
|
onConfirm: model.onConfirm,
|
|
4277
4277
|
onCancel: model.onCancel
|
|
4278
|
-
}), /* @__PURE__ */
|
|
4279
|
-
|
|
4278
|
+
}), /* @__PURE__ */ React2.default.createElement(_material.Portal, null, /* @__PURE__ */ React2.default.createElement(Modal, { open: model.opened, onClose: model.onCloseModal }, /* @__PURE__ */ React2.default.createElement(_material.Box, { sx: { p: 2, maxWidth: 400, textAlign: "center" } }, /* @__PURE__ */ React2.default.createElement(
|
|
4279
|
+
_material.Stack,
|
|
4280
4280
|
{
|
|
4281
4281
|
mx: "auto",
|
|
4282
|
-
color: orange[800],
|
|
4283
|
-
bgcolor: orange[50],
|
|
4282
|
+
color: _colors.orange[800],
|
|
4283
|
+
bgcolor: _colors.orange[50],
|
|
4284
4284
|
borderRadius: "50%",
|
|
4285
4285
|
height: 8 * 5,
|
|
4286
4286
|
width: 8 * 5,
|
|
@@ -4288,8 +4288,8 @@ var DialogConfirm = (props) => {
|
|
|
4288
4288
|
justifyContent: "center",
|
|
4289
4289
|
alignItems: "center"
|
|
4290
4290
|
},
|
|
4291
|
-
/* @__PURE__ */
|
|
4292
|
-
), /* @__PURE__ */
|
|
4291
|
+
/* @__PURE__ */ React2.default.createElement(Icon, { size: 8 * 3 })
|
|
4292
|
+
), /* @__PURE__ */ React2.default.createElement(_material.Typography, { fontWeight: "bold", variant: "h6", mt: 1 }, props.title || "Aten\xE7\xE3o"), /* @__PURE__ */ React2.default.createElement(_material.Typography, { my: 1 }, props.body || "Tem certeza que deseja realizar essa a\xE7\xE3o?"), /* @__PURE__ */ React2.default.createElement(_material.Stack, { gap: 1, mt: 3, color: _colors.grey[600] }, /* @__PURE__ */ React2.default.createElement(
|
|
4293
4293
|
LargeButton,
|
|
4294
4294
|
{
|
|
4295
4295
|
color: "warning",
|
|
@@ -4297,7 +4297,7 @@ var DialogConfirm = (props) => {
|
|
|
4297
4297
|
onClick: model.onProceed
|
|
4298
4298
|
},
|
|
4299
4299
|
props.confirmButtonText || "Confirmar"
|
|
4300
|
-
), /* @__PURE__ */
|
|
4300
|
+
), /* @__PURE__ */ React2.default.createElement(
|
|
4301
4301
|
LargeButton,
|
|
4302
4302
|
{
|
|
4303
4303
|
variant: "outlined",
|
|
@@ -4310,42 +4310,42 @@ var DialogConfirm = (props) => {
|
|
|
4310
4310
|
};
|
|
4311
4311
|
|
|
4312
4312
|
// src/components/BaseDialog/BaseDialog.tsx
|
|
4313
|
-
|
|
4313
|
+
|
|
4314
4314
|
|
|
4315
4315
|
// src/components/BaseDialog/BaseDialogHook.ts
|
|
4316
|
-
|
|
4316
|
+
|
|
4317
4317
|
|
|
4318
4318
|
// src/components/BaseDialog/BaseDialogContext.tsx
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
var BaseDialogContext = createContext({});
|
|
4319
|
+
|
|
4320
|
+
|
|
4321
|
+
var BaseDialogContext = _react.createContext.call(void 0, {});
|
|
4322
4322
|
var BaseDialogProvider = (props) => {
|
|
4323
|
-
const [openedDialogs, setOpenedDialogs] =
|
|
4324
|
-
const isOpened = useCallback(
|
|
4323
|
+
const [openedDialogs, setOpenedDialogs] = _react.useState.call(void 0, []);
|
|
4324
|
+
const isOpened = _react.useCallback.call(void 0,
|
|
4325
4325
|
(dialog) => {
|
|
4326
4326
|
return openedDialogs.includes(dialog);
|
|
4327
4327
|
},
|
|
4328
4328
|
[openedDialogs]
|
|
4329
4329
|
);
|
|
4330
|
-
const toggleDialog = useCallback(
|
|
4330
|
+
const toggleDialog = _react.useCallback.call(void 0,
|
|
4331
4331
|
(dialog) => {
|
|
4332
4332
|
return openedDialogs.includes(dialog);
|
|
4333
4333
|
},
|
|
4334
4334
|
[openedDialogs]
|
|
4335
4335
|
);
|
|
4336
|
-
const openDialog = useCallback((dialog) => {
|
|
4336
|
+
const openDialog = _react.useCallback.call(void 0, (dialog) => {
|
|
4337
4337
|
return setOpenedDialogs((prev) => {
|
|
4338
4338
|
const filteredArr = prev.filter((item) => item !== dialog);
|
|
4339
4339
|
return [...filteredArr, dialog];
|
|
4340
4340
|
});
|
|
4341
4341
|
}, []);
|
|
4342
|
-
const closeDialog = useCallback((dialog) => {
|
|
4342
|
+
const closeDialog = _react.useCallback.call(void 0, (dialog) => {
|
|
4343
4343
|
return setOpenedDialogs((prev) => prev.filter((item) => item !== dialog));
|
|
4344
4344
|
}, []);
|
|
4345
|
-
const closeAllDialogs = useCallback(() => {
|
|
4345
|
+
const closeAllDialogs = _react.useCallback.call(void 0, () => {
|
|
4346
4346
|
return setOpenedDialogs([]);
|
|
4347
4347
|
}, [openedDialogs]);
|
|
4348
|
-
return /* @__PURE__ */
|
|
4348
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
4349
4349
|
BaseDialogContext.Provider,
|
|
4350
4350
|
{
|
|
4351
4351
|
value: {
|
|
@@ -4362,35 +4362,35 @@ var BaseDialogProvider = (props) => {
|
|
|
4362
4362
|
};
|
|
4363
4363
|
|
|
4364
4364
|
// src/components/BaseDialog/BaseDialogInstanceContext.tsx
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
var BaseDialogInstanceContext =
|
|
4365
|
+
|
|
4366
|
+
|
|
4367
|
+
var BaseDialogInstanceContext = _react.createContext.call(void 0,
|
|
4368
4368
|
{}
|
|
4369
4369
|
);
|
|
4370
4370
|
var BaseDialogInstanceProvider = (props) => {
|
|
4371
4371
|
const actions = useBaseDialog();
|
|
4372
|
-
return /* @__PURE__ */
|
|
4372
|
+
return /* @__PURE__ */ React2.default.createElement(BaseDialogInstanceContext.Provider, { value: { name: props.name, actions } }, props.children);
|
|
4373
4373
|
};
|
|
4374
4374
|
|
|
4375
4375
|
// src/components/BaseDialog/BaseDialogHook.ts
|
|
4376
4376
|
function useBaseDialog() {
|
|
4377
|
-
return
|
|
4377
|
+
return _react.useContext.call(void 0, BaseDialogContext);
|
|
4378
4378
|
}
|
|
4379
4379
|
function useBaseDialogInstance() {
|
|
4380
|
-
return
|
|
4380
|
+
return _react.useContext.call(void 0, BaseDialogInstanceContext);
|
|
4381
4381
|
}
|
|
4382
4382
|
|
|
4383
4383
|
// src/components/BaseDialog/BaseDialog.tsx
|
|
4384
|
-
|
|
4384
|
+
|
|
4385
4385
|
|
|
4386
4386
|
// src/components/BaseDialog/BaseDialogHeader.tsx
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4387
|
+
|
|
4388
|
+
|
|
4389
|
+
|
|
4390
|
+
|
|
4391
|
+
|
|
4392
|
+
|
|
4393
|
+
|
|
4394
4394
|
var BaseDialogHeader = ({
|
|
4395
4395
|
title,
|
|
4396
4396
|
onClose,
|
|
@@ -4404,8 +4404,8 @@ var BaseDialogHeader = ({
|
|
|
4404
4404
|
if (onClose) return onClose();
|
|
4405
4405
|
closeDialog(name);
|
|
4406
4406
|
}
|
|
4407
|
-
return /* @__PURE__ */
|
|
4408
|
-
|
|
4407
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
4408
|
+
_material.Stack,
|
|
4409
4409
|
{
|
|
4410
4410
|
direction: "row",
|
|
4411
4411
|
alignItems: "center",
|
|
@@ -4414,8 +4414,8 @@ var BaseDialogHeader = ({
|
|
|
4414
4414
|
my: 1,
|
|
4415
4415
|
...props
|
|
4416
4416
|
},
|
|
4417
|
-
/* @__PURE__ */
|
|
4418
|
-
/* @__PURE__ */
|
|
4417
|
+
/* @__PURE__ */ React2.default.createElement(_material.Typography, { variant: "h6", fontWeight: "bold", ...TypographyProps2 }, title),
|
|
4418
|
+
/* @__PURE__ */ React2.default.createElement(_material.IconButton, { ...IconButtonProps, onClick: handleClose }, /* @__PURE__ */ React2.default.createElement(_md.MdClose, null))
|
|
4419
4419
|
);
|
|
4420
4420
|
};
|
|
4421
4421
|
|
|
@@ -4426,10 +4426,10 @@ var BaseDialogContainer = ({
|
|
|
4426
4426
|
}) => {
|
|
4427
4427
|
const { name } = useBaseDialogInstance();
|
|
4428
4428
|
const { isOpened, close: closeDialog } = useBaseDialog();
|
|
4429
|
-
return /* @__PURE__ */
|
|
4429
|
+
return /* @__PURE__ */ React2.default.createElement(Modal, { open: isOpened(name), onClose: () => closeDialog(name), ...rest }, children instanceof Function ? children({ close: () => closeDialog(name) }) : children);
|
|
4430
4430
|
};
|
|
4431
4431
|
var BaseDialogBody = (props) => {
|
|
4432
|
-
return /* @__PURE__ */
|
|
4432
|
+
return /* @__PURE__ */ React2.default.createElement(_material.Box, { px: 2, pb: 2, width: "100vw", maxWidth: 650, ...props }, props.children);
|
|
4433
4433
|
};
|
|
4434
4434
|
var BaseDialogTrigger = ({
|
|
4435
4435
|
name,
|
|
@@ -4437,8 +4437,8 @@ var BaseDialogTrigger = ({
|
|
|
4437
4437
|
...props
|
|
4438
4438
|
}) => {
|
|
4439
4439
|
const { open } = useBaseDialog();
|
|
4440
|
-
return /* @__PURE__ */
|
|
4441
|
-
|
|
4440
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
4441
|
+
_material.Button,
|
|
4442
4442
|
{
|
|
4443
4443
|
...props,
|
|
4444
4444
|
onClick: (...params) => {
|
|
@@ -4452,8 +4452,8 @@ var BaseDialogTrigger = ({
|
|
|
4452
4452
|
var BaseDialogCreate = (name = /* @__PURE__ */ Symbol()) => {
|
|
4453
4453
|
return {
|
|
4454
4454
|
name,
|
|
4455
|
-
Trigger: (props) => /* @__PURE__ */
|
|
4456
|
-
Root: (props) => /* @__PURE__ */
|
|
4455
|
+
Trigger: (props) => /* @__PURE__ */ React2.default.createElement(BaseDialogTrigger, { name, ...props }),
|
|
4456
|
+
Root: (props) => /* @__PURE__ */ React2.default.createElement(BaseDialogInstanceProvider, { name, ...props }),
|
|
4457
4457
|
Container: BaseDialogContainer,
|
|
4458
4458
|
Header: BaseDialogHeader,
|
|
4459
4459
|
Body: BaseDialogBody
|
|
@@ -4506,10 +4506,10 @@ var _ApiHelper = class _ApiHelper {
|
|
|
4506
4506
|
async onError(req, res, error) {
|
|
4507
4507
|
}
|
|
4508
4508
|
constructor(props) {
|
|
4509
|
-
this.middlewares = (props
|
|
4510
|
-
this.onFinally = props
|
|
4509
|
+
this.middlewares = (_optionalChain([props, 'optionalAccess', _83 => _83.middlewares]) || []).reverse();
|
|
4510
|
+
this.onFinally = _optionalChain([props, 'optionalAccess', _84 => _84.onFinally]) || (async () => {
|
|
4511
4511
|
});
|
|
4512
|
-
this.onError = props
|
|
4512
|
+
this.onError = _optionalChain([props, 'optionalAccess', _85 => _85.onError]) || (async () => {
|
|
4513
4513
|
});
|
|
4514
4514
|
}
|
|
4515
4515
|
setMiddlewares(middlewares) {
|
|
@@ -4571,22 +4571,22 @@ _ApiHelper.parse = _ApiHelper.parserErrorWrapper;
|
|
|
4571
4571
|
var ApiHelper = _ApiHelper;
|
|
4572
4572
|
|
|
4573
4573
|
// src/hooks/useFormHelper.ts
|
|
4574
|
-
|
|
4574
|
+
|
|
4575
4575
|
|
|
4576
4576
|
// src/hooks/useAlert.ts
|
|
4577
|
-
|
|
4577
|
+
|
|
4578
4578
|
|
|
4579
4579
|
// src/contexts/AlertContext.tsx
|
|
4580
|
-
|
|
4581
|
-
|
|
4580
|
+
|
|
4581
|
+
|
|
4582
4582
|
|
|
4583
4583
|
// src/components/Toast/index.tsx
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4584
|
+
|
|
4585
|
+
|
|
4586
|
+
|
|
4587
4587
|
var Toast = ({ open, onClose, severity, message }) => {
|
|
4588
|
-
return /* @__PURE__ */
|
|
4589
|
-
Snackbar,
|
|
4588
|
+
return /* @__PURE__ */ React2.default.createElement(React2.default.Fragment, null, /* @__PURE__ */ React2.default.createElement(
|
|
4589
|
+
_material.Snackbar,
|
|
4590
4590
|
{
|
|
4591
4591
|
open,
|
|
4592
4592
|
autoHideDuration: 6e3,
|
|
@@ -4594,20 +4594,20 @@ var Toast = ({ open, onClose, severity, message }) => {
|
|
|
4594
4594
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
4595
4595
|
sx: { zIndex: 99999999 }
|
|
4596
4596
|
},
|
|
4597
|
-
/* @__PURE__ */
|
|
4598
|
-
Alert,
|
|
4597
|
+
/* @__PURE__ */ React2.default.createElement(
|
|
4598
|
+
_material.Alert,
|
|
4599
4599
|
{
|
|
4600
4600
|
severity,
|
|
4601
4601
|
elevation: 2,
|
|
4602
|
-
action: /* @__PURE__ */
|
|
4603
|
-
|
|
4602
|
+
action: /* @__PURE__ */ React2.default.createElement(
|
|
4603
|
+
_material.IconButton,
|
|
4604
4604
|
{
|
|
4605
4605
|
"aria-label": "close",
|
|
4606
4606
|
color: "inherit",
|
|
4607
4607
|
size: "small",
|
|
4608
4608
|
onClick: onClose
|
|
4609
4609
|
},
|
|
4610
|
-
/* @__PURE__ */
|
|
4610
|
+
/* @__PURE__ */ React2.default.createElement(_md.MdClose, { fontSize: "inherit" })
|
|
4611
4611
|
)
|
|
4612
4612
|
},
|
|
4613
4613
|
message
|
|
@@ -4616,12 +4616,12 @@ var Toast = ({ open, onClose, severity, message }) => {
|
|
|
4616
4616
|
};
|
|
4617
4617
|
|
|
4618
4618
|
// src/contexts/AlertContext.tsx
|
|
4619
|
-
var AlertContext =
|
|
4619
|
+
var AlertContext = _react.createContext.call(void 0, {});
|
|
4620
4620
|
var AlertProvider = ({ children }) => {
|
|
4621
|
-
const [severity, setSeverity] =
|
|
4622
|
-
const [message, setMessage] =
|
|
4623
|
-
const [isVisible, setIsVisible] =
|
|
4624
|
-
const createAlert =
|
|
4621
|
+
const [severity, setSeverity] = _react.useState.call(void 0, "info");
|
|
4622
|
+
const [message, setMessage] = _react.useState.call(void 0, "");
|
|
4623
|
+
const [isVisible, setIsVisible] = _react.useState.call(void 0, false);
|
|
4624
|
+
const createAlert = _react.useCallback.call(void 0,
|
|
4625
4625
|
(newMessage, severity2) => {
|
|
4626
4626
|
setMessage(newMessage);
|
|
4627
4627
|
setSeverity(severity2);
|
|
@@ -4629,10 +4629,10 @@ var AlertProvider = ({ children }) => {
|
|
|
4629
4629
|
},
|
|
4630
4630
|
[]
|
|
4631
4631
|
);
|
|
4632
|
-
const onCloseToast =
|
|
4632
|
+
const onCloseToast = _react.useCallback.call(void 0, () => {
|
|
4633
4633
|
setIsVisible(false);
|
|
4634
4634
|
}, []);
|
|
4635
|
-
return /* @__PURE__ */
|
|
4635
|
+
return /* @__PURE__ */ React2.default.createElement(AlertContext.Provider, { value: { createAlert } }, children, /* @__PURE__ */ React2.default.createElement(
|
|
4636
4636
|
Toast,
|
|
4637
4637
|
{
|
|
4638
4638
|
open: isVisible,
|
|
@@ -4645,15 +4645,15 @@ var AlertProvider = ({ children }) => {
|
|
|
4645
4645
|
|
|
4646
4646
|
// src/hooks/useAlert.ts
|
|
4647
4647
|
var useAlert = () => {
|
|
4648
|
-
return
|
|
4648
|
+
return _react.useContext.call(void 0, AlertContext);
|
|
4649
4649
|
};
|
|
4650
4650
|
|
|
4651
4651
|
// src/hooks/useLoading.ts
|
|
4652
|
-
|
|
4652
|
+
|
|
4653
4653
|
function useLoading() {
|
|
4654
|
-
const [state, setState] =
|
|
4655
|
-
const isLoading =
|
|
4656
|
-
const setLoading =
|
|
4654
|
+
const [state, setState] = _react.useState.call(void 0, []);
|
|
4655
|
+
const isLoading = _react.useCallback.call(void 0, (prop) => state.includes(prop), [state]);
|
|
4656
|
+
const setLoading = _react.useCallback.call(void 0, (prop, remove) => {
|
|
4657
4657
|
if (remove)
|
|
4658
4658
|
setState((prevState) => prevState.filter((state2) => state2 !== prop));
|
|
4659
4659
|
else setState((prevState) => [...prevState, prop]);
|
|
@@ -4662,22 +4662,22 @@ function useLoading() {
|
|
|
4662
4662
|
}
|
|
4663
4663
|
|
|
4664
4664
|
// src/contexts/FormHelperProvider.tsx
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
var FormHelperContext =
|
|
4665
|
+
|
|
4666
|
+
|
|
4667
|
+
var FormHelperContext = _react.createContext.call(void 0, {});
|
|
4668
4668
|
var FormHelperProvider = ({ formatErrorMessage, api, children }) => {
|
|
4669
|
-
return /* @__PURE__ */
|
|
4669
|
+
return /* @__PURE__ */ React2.default.createElement(FormHelperContext.Provider, { value: { formatErrorMessage, api } }, children);
|
|
4670
4670
|
};
|
|
4671
4671
|
|
|
4672
4672
|
// src/hooks/useFormHelper.ts
|
|
4673
4673
|
function useFormHelper() {
|
|
4674
4674
|
const alertProps = useAlert();
|
|
4675
4675
|
const loadingProps = useLoading();
|
|
4676
|
-
const { api, formatErrorMessage } =
|
|
4676
|
+
const { api, formatErrorMessage } = _react.useContext.call(void 0, FormHelperContext);
|
|
4677
4677
|
const { createAlert } = alertProps;
|
|
4678
4678
|
const { setLoading } = loadingProps;
|
|
4679
|
-
const sourceRef =
|
|
4680
|
-
const onSubmitWrapper =
|
|
4679
|
+
const sourceRef = _react.useRef.call(void 0, new AbortController());
|
|
4680
|
+
const onSubmitWrapper = _react.useCallback.call(void 0,
|
|
4681
4681
|
(fn, { name }) => {
|
|
4682
4682
|
return async (fields, methods) => {
|
|
4683
4683
|
const LOADING_NAME = name;
|
|
@@ -4693,7 +4693,7 @@ function useFormHelper() {
|
|
|
4693
4693
|
},
|
|
4694
4694
|
[setLoading]
|
|
4695
4695
|
);
|
|
4696
|
-
const onRequestWrapper =
|
|
4696
|
+
const onRequestWrapper = _react.useCallback.call(void 0,
|
|
4697
4697
|
(fn, { name }) => {
|
|
4698
4698
|
return async (...params) => {
|
|
4699
4699
|
const LOADING_NAME = name;
|
|
@@ -4721,9 +4721,9 @@ function useFormHelper() {
|
|
|
4721
4721
|
},
|
|
4722
4722
|
[setLoading, api]
|
|
4723
4723
|
);
|
|
4724
|
-
const errorHandler =
|
|
4724
|
+
const errorHandler = _react.useCallback.call(void 0,
|
|
4725
4725
|
(error, callback) => {
|
|
4726
|
-
if (error
|
|
4726
|
+
if (_optionalChain([error, 'optionalAccess', _86 => _86.message]) === "cancel.navigation") return;
|
|
4727
4727
|
if (callback) {
|
|
4728
4728
|
if (error.response.data.code === "invalid.body") {
|
|
4729
4729
|
const errors = error.response.data.details.issues;
|
|
@@ -4738,7 +4738,7 @@ function useFormHelper() {
|
|
|
4738
4738
|
},
|
|
4739
4739
|
[formatErrorMessage, createAlert]
|
|
4740
4740
|
);
|
|
4741
|
-
|
|
4741
|
+
_react.useEffect.call(void 0, () => {
|
|
4742
4742
|
return () => {
|
|
4743
4743
|
sourceRef.current.abort();
|
|
4744
4744
|
sourceRef.current = new AbortController();
|
|
@@ -4753,26 +4753,26 @@ function useFormHelper() {
|
|
|
4753
4753
|
}
|
|
4754
4754
|
|
|
4755
4755
|
// src/helpers/authHelper.ts
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4756
|
+
var _cookie = require('cookie');
|
|
4757
|
+
var _nookies = require('nookies');
|
|
4758
|
+
var _uuid = require('uuid');
|
|
4759
|
+
var _jsonwebtoken = require('jsonwebtoken'); var _jsonwebtoken2 = _interopRequireDefault(_jsonwebtoken);
|
|
4760
4760
|
function decodeSessionToken({
|
|
4761
4761
|
req,
|
|
4762
4762
|
res,
|
|
4763
4763
|
sessionTokenName,
|
|
4764
4764
|
validate
|
|
4765
4765
|
}) {
|
|
4766
|
-
const token = req.headers.authorization
|
|
4766
|
+
const token = _optionalChain([req, 'access', _87 => _87.headers, 'access', _88 => _88.authorization, 'optionalAccess', _89 => _89.split, 'call', _90 => _90(" "), 'access', _91 => _91[1]]) || req.cookies[sessionTokenName];
|
|
4767
4767
|
if (!token) {
|
|
4768
4768
|
res.status(401).json({ error: "Token inv\xE1lido", code: "token.invalid" });
|
|
4769
4769
|
return true;
|
|
4770
4770
|
}
|
|
4771
4771
|
const jwtDecode = (token2) => {
|
|
4772
4772
|
if (validate) {
|
|
4773
|
-
return
|
|
4773
|
+
return _jsonwebtoken2.default.verify(token2, process.env.JWT_SECRET);
|
|
4774
4774
|
}
|
|
4775
|
-
return
|
|
4775
|
+
return _jsonwebtoken2.default.decode(token2);
|
|
4776
4776
|
};
|
|
4777
4777
|
try {
|
|
4778
4778
|
const decoded = jwtDecode(token);
|
|
@@ -4794,12 +4794,12 @@ var AuthHelper = class {
|
|
|
4794
4794
|
onGetUserData
|
|
4795
4795
|
}) {
|
|
4796
4796
|
this.generateJwtAndRefreshToken = async (userId, payload = {}) => {
|
|
4797
|
-
const token =
|
|
4797
|
+
const token = _jsonwebtoken2.default.sign(payload, process.env.JWT_SECRET, {
|
|
4798
4798
|
subject: String(userId),
|
|
4799
4799
|
expiresIn: this.tokenExpTimeInSeconds || 60 * 15
|
|
4800
4800
|
// 15 minutos
|
|
4801
4801
|
});
|
|
4802
|
-
const uniqueToken =
|
|
4802
|
+
const uniqueToken = _uuid.v4.call(void 0, );
|
|
4803
4803
|
await this.onCreateRefreshToken(userId, uniqueToken);
|
|
4804
4804
|
return {
|
|
4805
4805
|
token,
|
|
@@ -4808,11 +4808,11 @@ var AuthHelper = class {
|
|
|
4808
4808
|
};
|
|
4809
4809
|
this.invalidateCookies = (res) => {
|
|
4810
4810
|
return res.setHeader("Set-Cookie", [
|
|
4811
|
-
serialize(this.cookies.sessionToken, "", {
|
|
4811
|
+
_cookie.serialize.call(void 0, this.cookies.sessionToken, "", {
|
|
4812
4812
|
maxAge: -1,
|
|
4813
4813
|
path: "/"
|
|
4814
4814
|
}),
|
|
4815
|
-
serialize(this.cookies.refreshToken, "", {
|
|
4815
|
+
_cookie.serialize.call(void 0, this.cookies.refreshToken, "", {
|
|
4816
4816
|
maxAge: -1,
|
|
4817
4817
|
path: "/"
|
|
4818
4818
|
})
|
|
@@ -4836,14 +4836,14 @@ var AuthHelper = class {
|
|
|
4836
4836
|
loginResult.userId,
|
|
4837
4837
|
{}
|
|
4838
4838
|
);
|
|
4839
|
-
setCookie({ res }, this.cookies.sessionToken, token, {
|
|
4839
|
+
_nookies.setCookie.call(void 0, { res }, this.cookies.sessionToken, token, {
|
|
4840
4840
|
secure: true,
|
|
4841
4841
|
maxAge: 60 * 60 * 24 * 30,
|
|
4842
4842
|
// 30 days
|
|
4843
4843
|
path: "/",
|
|
4844
4844
|
sameSite: true
|
|
4845
4845
|
});
|
|
4846
|
-
setCookie({ res }, this.cookies.refreshToken, refreshToken, {
|
|
4846
|
+
_nookies.setCookie.call(void 0, { res }, this.cookies.refreshToken, refreshToken, {
|
|
4847
4847
|
secure: true,
|
|
4848
4848
|
maxAge: 60 * 60 * 24 * 30,
|
|
4849
4849
|
// 30 days
|
|
@@ -4867,7 +4867,7 @@ var AuthHelper = class {
|
|
|
4867
4867
|
});
|
|
4868
4868
|
if (error) return;
|
|
4869
4869
|
const userId = String(req.user);
|
|
4870
|
-
const refreshToken = parseCookies({ req })[this.cookies.refreshToken];
|
|
4870
|
+
const refreshToken = _nookies.parseCookies.call(void 0, { req })[this.cookies.refreshToken];
|
|
4871
4871
|
if (!refreshToken) {
|
|
4872
4872
|
this.invalidateCookies(res);
|
|
4873
4873
|
return res.status(400).json({
|
|
@@ -4886,14 +4886,14 @@ var AuthHelper = class {
|
|
|
4886
4886
|
}
|
|
4887
4887
|
await this.onInvalidateRefreshToken(userId, refreshToken);
|
|
4888
4888
|
const { token, refreshToken: newRefreshToken } = await this.generateJwtAndRefreshToken(userId, {});
|
|
4889
|
-
setCookie({ res }, this.cookies.sessionToken, token, {
|
|
4889
|
+
_nookies.setCookie.call(void 0, { res }, this.cookies.sessionToken, token, {
|
|
4890
4890
|
secure: true,
|
|
4891
4891
|
maxAge: 60 * 60 * 24 * 30,
|
|
4892
4892
|
// 30 days
|
|
4893
4893
|
path: "/",
|
|
4894
4894
|
sameSite: true
|
|
4895
4895
|
});
|
|
4896
|
-
setCookie({ res }, this.cookies.refreshToken, newRefreshToken, {
|
|
4896
|
+
_nookies.setCookie.call(void 0, { res }, this.cookies.refreshToken, newRefreshToken, {
|
|
4897
4897
|
secure: true,
|
|
4898
4898
|
maxAge: 60 * 60 * 24 * 30,
|
|
4899
4899
|
// 30 days
|
|
@@ -4956,9 +4956,9 @@ var AuthHelper = class {
|
|
|
4956
4956
|
}
|
|
4957
4957
|
);
|
|
4958
4958
|
const data = await response.json();
|
|
4959
|
-
const decodedToken =
|
|
4959
|
+
const decodedToken = _jsonwebtoken2.default.decode(data.access_token);
|
|
4960
4960
|
const email = decodedToken.upn;
|
|
4961
|
-
const fullName = `${decodedToken
|
|
4961
|
+
const fullName = `${_optionalChain([decodedToken, 'optionalAccess', _92 => _92.given_name])} ${_optionalChain([decodedToken, 'optionalAccess', _93 => _93.family_name])}`;
|
|
4962
4962
|
return { decodedToken, email, fullName };
|
|
4963
4963
|
}
|
|
4964
4964
|
createOauthCallbackGetServerSideProps({
|
|
@@ -4987,13 +4987,13 @@ var AuthHelper = class {
|
|
|
4987
4987
|
email,
|
|
4988
4988
|
{}
|
|
4989
4989
|
);
|
|
4990
|
-
setCookie(ctx, this.cookies.sessionToken, token, {
|
|
4990
|
+
_nookies.setCookie.call(void 0, ctx, this.cookies.sessionToken, token, {
|
|
4991
4991
|
secure: true,
|
|
4992
4992
|
maxAge: 60 * 60 * 24 * 30,
|
|
4993
4993
|
// 30 days
|
|
4994
4994
|
path: "/"
|
|
4995
4995
|
});
|
|
4996
|
-
setCookie(ctx, this.cookies.refreshToken, refreshToken, {
|
|
4996
|
+
_nookies.setCookie.call(void 0, ctx, this.cookies.refreshToken, refreshToken, {
|
|
4997
4997
|
secure: true,
|
|
4998
4998
|
maxAge: 60 * 60 * 24 * 30,
|
|
4999
4999
|
// 30 days
|
|
@@ -5018,11 +5018,11 @@ var AuthHelper = class {
|
|
|
5018
5018
|
};
|
|
5019
5019
|
|
|
5020
5020
|
// src/hooks/useGrid.ts
|
|
5021
|
-
|
|
5021
|
+
|
|
5022
5022
|
|
|
5023
5023
|
// src/hooks/useFilter.ts
|
|
5024
|
-
|
|
5025
|
-
|
|
5024
|
+
|
|
5025
|
+
|
|
5026
5026
|
|
|
5027
5027
|
// src/components/utils/getObjectValue.ts
|
|
5028
5028
|
function getObjectValue(obj) {
|
|
@@ -5037,12 +5037,12 @@ function getObjectValue(obj) {
|
|
|
5037
5037
|
|
|
5038
5038
|
// src/hooks/useFilter.ts
|
|
5039
5039
|
function useFilter(props = { defaultFilters: [] }) {
|
|
5040
|
-
const [selectedFilters, setSelectedFilters] =
|
|
5040
|
+
const [selectedFilters, setSelectedFilters] = _react.useState.call(void 0, () => {
|
|
5041
5041
|
const { defaultFilters } = props;
|
|
5042
5042
|
return defaultFilters || [];
|
|
5043
5043
|
});
|
|
5044
|
-
const filterBy =
|
|
5045
|
-
const propToCompare = newFilter
|
|
5044
|
+
const filterBy = _react.useCallback.call(void 0, (newFilter) => {
|
|
5045
|
+
const propToCompare = _optionalChain([newFilter, 'optionalAccess', _94 => _94.id]) ? "id" : "prop";
|
|
5046
5046
|
function removeRepeatedFilters(filter) {
|
|
5047
5047
|
return filter[propToCompare] !== newFilter[propToCompare];
|
|
5048
5048
|
}
|
|
@@ -5051,7 +5051,7 @@ function useFilter(props = { defaultFilters: [] }) {
|
|
|
5051
5051
|
newFilter
|
|
5052
5052
|
]);
|
|
5053
5053
|
}, []);
|
|
5054
|
-
const removeFilter =
|
|
5054
|
+
const removeFilter = _react.useCallback.call(void 0,
|
|
5055
5055
|
(prop, isId) => {
|
|
5056
5056
|
const propToCompare = isId ? "id" : "prop";
|
|
5057
5057
|
setSelectedFilters(
|
|
@@ -5092,13 +5092,13 @@ function compareFilter(item, filter) {
|
|
|
5092
5092
|
case "valueNotIn":
|
|
5093
5093
|
return !itemValue.includes(filter.value);
|
|
5094
5094
|
case "gte":
|
|
5095
|
-
return isDate(itemValue) ?
|
|
5095
|
+
return isDate(itemValue) ? _moment2.default.call(void 0, String(itemValue)).isSameOrAfter(filter.value) : itemValue >= filter.value;
|
|
5096
5096
|
case "gt":
|
|
5097
|
-
return isDate(itemValue) ?
|
|
5097
|
+
return isDate(itemValue) ? _moment2.default.call(void 0, String(itemValue)).isAfter(filter.value) : itemValue > filter.value;
|
|
5098
5098
|
case "lte":
|
|
5099
|
-
return isDate(itemValue) ?
|
|
5099
|
+
return isDate(itemValue) ? _moment2.default.call(void 0, String(itemValue)).isSameOrBefore(filter.value) : itemValue <= filter.value;
|
|
5100
5100
|
case "lt":
|
|
5101
|
-
return isDate(itemValue) ?
|
|
5101
|
+
return isDate(itemValue) ? _moment2.default.call(void 0, String(itemValue)).isBefore(filter.value) : itemValue < filter.value;
|
|
5102
5102
|
}
|
|
5103
5103
|
}
|
|
5104
5104
|
function createFilter(filters) {
|
|
@@ -5115,7 +5115,7 @@ function createFilter(filters) {
|
|
|
5115
5115
|
}
|
|
5116
5116
|
|
|
5117
5117
|
// src/hooks/useGrid.ts
|
|
5118
|
-
|
|
5118
|
+
var _sortby = require('sort-by'); var _sortby2 = _interopRequireDefault(_sortby);
|
|
5119
5119
|
function useGrid({
|
|
5120
5120
|
columns,
|
|
5121
5121
|
filters,
|
|
@@ -5125,29 +5125,29 @@ function useGrid({
|
|
|
5125
5125
|
defaultCurrentPage,
|
|
5126
5126
|
defaultSortedBy
|
|
5127
5127
|
}) {
|
|
5128
|
-
const [defaultData, setDefaultData] =
|
|
5129
|
-
const [sortedBy, setSortedBy] =
|
|
5128
|
+
const [defaultData, setDefaultData] = _react.useState.call(void 0, externalDefaultData || []);
|
|
5129
|
+
const [sortedBy, setSortedBy] = _react.useState.call(void 0,
|
|
5130
5130
|
defaultSortedBy || []
|
|
5131
5131
|
);
|
|
5132
|
-
const [currentPage, setCurrentPage] =
|
|
5133
|
-
const [rowsPerPage, setRowsPerPage] =
|
|
5134
|
-
const toggleSortedDirection =
|
|
5132
|
+
const [currentPage, setCurrentPage] = _react.useState.call(void 0, defaultCurrentPage || 0);
|
|
5133
|
+
const [rowsPerPage, setRowsPerPage] = _react.useState.call(void 0, rowsPerPageOptions[0]);
|
|
5134
|
+
const toggleSortedDirection = _react.useCallback.call(void 0,
|
|
5135
5135
|
(direction) => {
|
|
5136
5136
|
if (direction === "asc") return "desc";
|
|
5137
5137
|
return "asc";
|
|
5138
5138
|
},
|
|
5139
5139
|
[]
|
|
5140
5140
|
);
|
|
5141
|
-
const clearSort =
|
|
5141
|
+
const clearSort = _react.useCallback.call(void 0, () => {
|
|
5142
5142
|
setSortedBy([]);
|
|
5143
5143
|
}, []);
|
|
5144
|
-
const appendSort =
|
|
5144
|
+
const appendSort = _react.useCallback.call(void 0, (prop, direction) => {
|
|
5145
5145
|
setSortedBy((prev) => [...prev, { prop, direction }]);
|
|
5146
5146
|
}, []);
|
|
5147
|
-
const setSort =
|
|
5147
|
+
const setSort = _react.useCallback.call(void 0, (prop, direction) => {
|
|
5148
5148
|
setSortedBy([{ prop, direction }]);
|
|
5149
5149
|
}, []);
|
|
5150
|
-
const onSortBy =
|
|
5150
|
+
const onSortBy = _react.useCallback.call(void 0,
|
|
5151
5151
|
(prop) => {
|
|
5152
5152
|
if (!prop) return;
|
|
5153
5153
|
const currentSorted = sortedBy.find((p) => p.prop === prop);
|
|
@@ -5172,10 +5172,10 @@ function useGrid({
|
|
|
5172
5172
|
},
|
|
5173
5173
|
[toggleSortedDirection, sortedBy]
|
|
5174
5174
|
);
|
|
5175
|
-
const set =
|
|
5175
|
+
const set = _react.useCallback.call(void 0, (data) => {
|
|
5176
5176
|
setDefaultData(data);
|
|
5177
5177
|
}, []);
|
|
5178
|
-
const sortData =
|
|
5178
|
+
const sortData = _react.useCallback.call(void 0,
|
|
5179
5179
|
(data) => {
|
|
5180
5180
|
if (sortedBy.length > 0) {
|
|
5181
5181
|
const symbolDir = {
|
|
@@ -5185,7 +5185,7 @@ function useGrid({
|
|
|
5185
5185
|
const formattedKeys = sortedBy.map(
|
|
5186
5186
|
({ prop, direction }) => `${symbolDir[direction]}${prop}`
|
|
5187
5187
|
);
|
|
5188
|
-
return data.sort(
|
|
5188
|
+
return data.sort(_sortby2.default.call(void 0, ...formattedKeys));
|
|
5189
5189
|
} else return data;
|
|
5190
5190
|
},
|
|
5191
5191
|
[sortedBy]
|
|
@@ -5195,7 +5195,7 @@ function useGrid({
|
|
|
5195
5195
|
if (pageNumber > totalNumberOfPages) return;
|
|
5196
5196
|
setCurrentPage(pageNumber);
|
|
5197
5197
|
};
|
|
5198
|
-
const onChangeRowsPerPage =
|
|
5198
|
+
const onChangeRowsPerPage = _react.useCallback.call(void 0,
|
|
5199
5199
|
(rows) => {
|
|
5200
5200
|
let totalNumberOfPages2 = Math.round(filteredData.length / rows) - 1;
|
|
5201
5201
|
totalNumberOfPages2 = totalNumberOfPages2 <= 0 ? 0 : 1;
|
|
@@ -5204,13 +5204,13 @@ function useGrid({
|
|
|
5204
5204
|
},
|
|
5205
5205
|
[currentPage]
|
|
5206
5206
|
);
|
|
5207
|
-
const orderedData =
|
|
5207
|
+
const orderedData = _react.useMemo.call(void 0, () => {
|
|
5208
5208
|
if (sortedBy.length === 0) return defaultData;
|
|
5209
5209
|
const newData = defaultData.slice(0);
|
|
5210
5210
|
const sortedData = sortData(newData);
|
|
5211
5211
|
return sortedData;
|
|
5212
5212
|
}, [defaultData, sortData, sortedBy]);
|
|
5213
|
-
const filteredData =
|
|
5213
|
+
const filteredData = _react.useMemo.call(void 0, () => {
|
|
5214
5214
|
let newData = orderedData.slice(0);
|
|
5215
5215
|
if (search && search.value !== "") {
|
|
5216
5216
|
const searchBy = createSearch(search);
|
|
@@ -5220,13 +5220,13 @@ function useGrid({
|
|
|
5220
5220
|
const newFilter = createFilter(filters);
|
|
5221
5221
|
return newData.filter(newFilter.apply);
|
|
5222
5222
|
}, [orderedData, search, filters]);
|
|
5223
|
-
const paginatedData =
|
|
5223
|
+
const paginatedData = _react.useMemo.call(void 0, () => {
|
|
5224
5224
|
const startPage = currentPage * rowsPerPage;
|
|
5225
5225
|
const endPage = startPage + rowsPerPage;
|
|
5226
5226
|
return filteredData.slice(startPage, endPage);
|
|
5227
5227
|
}, [currentPage, rowsPerPage, filteredData]);
|
|
5228
5228
|
const totalNumberOfPages = Math.ceil(filteredData.length / rowsPerPage) - 1;
|
|
5229
|
-
|
|
5229
|
+
_react.useEffect.call(void 0, () => {
|
|
5230
5230
|
if (externalDefaultData) setDefaultData(externalDefaultData);
|
|
5231
5231
|
}, [externalDefaultData]);
|
|
5232
5232
|
return {
|
|
@@ -5301,7 +5301,7 @@ function createSearch(options) {
|
|
|
5301
5301
|
}
|
|
5302
5302
|
|
|
5303
5303
|
// src/hooks/useAsyncGrid.ts
|
|
5304
|
-
|
|
5304
|
+
|
|
5305
5305
|
function useAsyncGrid({
|
|
5306
5306
|
columns,
|
|
5307
5307
|
filters = [],
|
|
@@ -5314,26 +5314,26 @@ function useAsyncGrid({
|
|
|
5314
5314
|
defaultCurrentPage,
|
|
5315
5315
|
defaultSortedBy
|
|
5316
5316
|
}) {
|
|
5317
|
-
const [defaultData, setDefaultData] =
|
|
5318
|
-
const [sortedBy, setSortedBy] =
|
|
5317
|
+
const [defaultData, setDefaultData] = _react.useState.call(void 0, externalDefaultData || []);
|
|
5318
|
+
const [sortedBy, setSortedBy] = _react.useState.call(void 0,
|
|
5319
5319
|
defaultSortedBy || []
|
|
5320
5320
|
);
|
|
5321
|
-
const [totalNumberOfItems, setTotalNumberOfItems] =
|
|
5322
|
-
const [isLoading, setIsLoading] =
|
|
5323
|
-
const [currentPage, setCurrentPage] =
|
|
5324
|
-
const [rowsPerPage, setRowsPerPage] =
|
|
5321
|
+
const [totalNumberOfItems, setTotalNumberOfItems] = _react.useState.call(void 0, 0);
|
|
5322
|
+
const [isLoading, setIsLoading] = _react.useState.call(void 0, false);
|
|
5323
|
+
const [currentPage, setCurrentPage] = _react.useState.call(void 0, defaultCurrentPage || 0);
|
|
5324
|
+
const [rowsPerPage, setRowsPerPage] = _react.useState.call(void 0, rowsPerPageOptions[0]);
|
|
5325
5325
|
const totalNumberOfPages = Math.ceil(totalNumberOfItems / rowsPerPage) - 1;
|
|
5326
|
-
const toggleSortedDirection =
|
|
5326
|
+
const toggleSortedDirection = _react.useCallback.call(void 0,
|
|
5327
5327
|
(direction) => {
|
|
5328
5328
|
if (direction === "asc") return "desc";
|
|
5329
5329
|
return "asc";
|
|
5330
5330
|
},
|
|
5331
5331
|
[]
|
|
5332
5332
|
);
|
|
5333
|
-
const setSort =
|
|
5333
|
+
const setSort = _react.useCallback.call(void 0, (prop, direction) => {
|
|
5334
5334
|
setSortedBy((prev) => [...prev, { prop, direction }]);
|
|
5335
5335
|
}, []);
|
|
5336
|
-
const onSortBy =
|
|
5336
|
+
const onSortBy = _react.useCallback.call(void 0,
|
|
5337
5337
|
async (prop) => {
|
|
5338
5338
|
if (!prop) return;
|
|
5339
5339
|
let finalArr = [];
|
|
@@ -5361,10 +5361,10 @@ function useAsyncGrid({
|
|
|
5361
5361
|
},
|
|
5362
5362
|
[sortedBy, toggleSortedDirection, rowsPerPage, currentPage]
|
|
5363
5363
|
);
|
|
5364
|
-
const set =
|
|
5364
|
+
const set = _react.useCallback.call(void 0, (data) => {
|
|
5365
5365
|
setDefaultData(data);
|
|
5366
5366
|
}, []);
|
|
5367
|
-
const baseRequest =
|
|
5367
|
+
const baseRequest = _react.useCallback.call(void 0,
|
|
5368
5368
|
async ({
|
|
5369
5369
|
page,
|
|
5370
5370
|
search: search2,
|
|
@@ -5377,7 +5377,7 @@ function useAsyncGrid({
|
|
|
5377
5377
|
const params = new URLSearchParams({
|
|
5378
5378
|
page: String(page),
|
|
5379
5379
|
rowsPerPage: String(rowsPerPage2),
|
|
5380
|
-
searchText: search2
|
|
5380
|
+
searchText: _optionalChain([search2, 'optionalAccess', _95 => _95.value]) || "",
|
|
5381
5381
|
sort: sortedBy2.map(({ prop, direction }) => `${prop}:${direction}`).join(","),
|
|
5382
5382
|
filters: filters2.map(
|
|
5383
5383
|
(filter) => `${filter.prop}:${filter.compareType}:${filter.value}`
|
|
@@ -5393,7 +5393,7 @@ function useAsyncGrid({
|
|
|
5393
5393
|
},
|
|
5394
5394
|
[axiosInstance, url]
|
|
5395
5395
|
);
|
|
5396
|
-
const updateGridContent =
|
|
5396
|
+
const updateGridContent = _react.useCallback.call(void 0,
|
|
5397
5397
|
async ({
|
|
5398
5398
|
page,
|
|
5399
5399
|
sortedBy: sortedBy2,
|
|
@@ -5419,7 +5419,7 @@ function useAsyncGrid({
|
|
|
5419
5419
|
},
|
|
5420
5420
|
[set, search, filters, onRequest, baseRequest]
|
|
5421
5421
|
);
|
|
5422
|
-
const onPageChange =
|
|
5422
|
+
const onPageChange = _react.useCallback.call(void 0,
|
|
5423
5423
|
(pageNumber) => {
|
|
5424
5424
|
if (pageNumber < 0) return;
|
|
5425
5425
|
if (pageNumber > totalNumberOfPages) return;
|
|
@@ -5427,7 +5427,7 @@ function useAsyncGrid({
|
|
|
5427
5427
|
},
|
|
5428
5428
|
[updateGridContent, totalNumberOfPages, sortedBy, rowsPerPage]
|
|
5429
5429
|
);
|
|
5430
|
-
const onChangeRowsPerPage =
|
|
5430
|
+
const onChangeRowsPerPage = _react.useCallback.call(void 0,
|
|
5431
5431
|
(rows) => {
|
|
5432
5432
|
let totalNumberOfPages2 = Math.round(totalNumberOfItems / rows) - 1;
|
|
5433
5433
|
totalNumberOfPages2 = totalNumberOfPages2 <= 0 ? 0 : 1;
|
|
@@ -5446,7 +5446,7 @@ function useAsyncGrid({
|
|
|
5446
5446
|
[updateGridContent, totalNumberOfItems, sortedBy, currentPage]
|
|
5447
5447
|
);
|
|
5448
5448
|
const displayData = defaultData;
|
|
5449
|
-
|
|
5449
|
+
_react.useEffect.call(void 0, () => {
|
|
5450
5450
|
updateGridContent({ page: 0, sortedBy: [], rowsPerPage });
|
|
5451
5451
|
}, [updateGridContent, rowsPerPage]);
|
|
5452
5452
|
return {
|
|
@@ -5469,9 +5469,9 @@ function useAsyncGrid({
|
|
|
5469
5469
|
}
|
|
5470
5470
|
|
|
5471
5471
|
// src/hooks/useEvent.ts
|
|
5472
|
-
|
|
5472
|
+
|
|
5473
5473
|
function useEvent(event, handler, passive = false) {
|
|
5474
|
-
|
|
5474
|
+
_react.useEffect.call(void 0, () => {
|
|
5475
5475
|
window.addEventListener(event, handler, passive);
|
|
5476
5476
|
return function cleanup() {
|
|
5477
5477
|
window.removeEventListener(event, handler);
|
|
@@ -5480,15 +5480,15 @@ function useEvent(event, handler, passive = false) {
|
|
|
5480
5480
|
}
|
|
5481
5481
|
|
|
5482
5482
|
// src/contexts/AuthContext.tsx
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5483
|
+
|
|
5484
|
+
|
|
5485
|
+
|
|
5486
|
+
|
|
5487
|
+
|
|
5488
|
+
|
|
5489
|
+
|
|
5490
5490
|
function createAuthContext() {
|
|
5491
|
-
return
|
|
5491
|
+
return _react.createContext.call(void 0, {});
|
|
5492
5492
|
}
|
|
5493
5493
|
function CreateAuthProvider({
|
|
5494
5494
|
api,
|
|
@@ -5496,10 +5496,10 @@ function CreateAuthProvider({
|
|
|
5496
5496
|
sessionTokenName,
|
|
5497
5497
|
Provider
|
|
5498
5498
|
}) {
|
|
5499
|
-
const [user, setUser] =
|
|
5500
|
-
const [status, setStatus] =
|
|
5499
|
+
const [user, setUser] = _react.useState.call(void 0, );
|
|
5500
|
+
const [status, setStatus] = _react.useState.call(void 0, "unauthenticated");
|
|
5501
5501
|
const { createAlert } = useAlert();
|
|
5502
|
-
const signIn =
|
|
5502
|
+
const signIn = _react.useCallback.call(void 0,
|
|
5503
5503
|
async ({ email, password }) => {
|
|
5504
5504
|
setStatus("loading");
|
|
5505
5505
|
try {
|
|
@@ -5514,19 +5514,19 @@ function CreateAuthProvider({
|
|
|
5514
5514
|
setStatus("autenticated");
|
|
5515
5515
|
return true;
|
|
5516
5516
|
} catch (error) {
|
|
5517
|
-
createAlert(error
|
|
5517
|
+
createAlert(_optionalChain([error, 'optionalAccess', _96 => _96.response, 'optionalAccess', _97 => _97.data, 'optionalAccess', _98 => _98.error]), "error");
|
|
5518
5518
|
setStatus("unauthenticated");
|
|
5519
5519
|
throw error;
|
|
5520
5520
|
}
|
|
5521
5521
|
},
|
|
5522
5522
|
[createAlert, api]
|
|
5523
5523
|
);
|
|
5524
|
-
const ClientSignOut =
|
|
5524
|
+
const ClientSignOut = _react.useCallback.call(void 0, async () => {
|
|
5525
5525
|
await api.get("/auth/logout");
|
|
5526
5526
|
setUser(void 0);
|
|
5527
5527
|
}, [api]);
|
|
5528
|
-
|
|
5529
|
-
const token =
|
|
5528
|
+
_react.useEffect.call(void 0, () => {
|
|
5529
|
+
const token = _nookies.parseCookies.call(void 0, )[sessionTokenName];
|
|
5530
5530
|
if (token) {
|
|
5531
5531
|
setStatus("loading");
|
|
5532
5532
|
api.get("/auth/me").then((response) => {
|
|
@@ -5537,7 +5537,7 @@ function CreateAuthProvider({
|
|
|
5537
5537
|
});
|
|
5538
5538
|
}
|
|
5539
5539
|
}, [api, sessionTokenName]);
|
|
5540
|
-
return /* @__PURE__ */
|
|
5540
|
+
return /* @__PURE__ */ React2.default.createElement(
|
|
5541
5541
|
Provider,
|
|
5542
5542
|
{
|
|
5543
5543
|
value: {
|
|
@@ -5550,55 +5550,55 @@ function CreateAuthProvider({
|
|
|
5550
5550
|
children
|
|
5551
5551
|
);
|
|
5552
5552
|
}
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5553
|
+
|
|
5554
|
+
|
|
5555
|
+
|
|
5556
|
+
|
|
5557
|
+
|
|
5558
|
+
|
|
5559
|
+
|
|
5560
|
+
|
|
5561
|
+
|
|
5562
|
+
|
|
5563
|
+
|
|
5564
|
+
|
|
5565
|
+
|
|
5566
|
+
|
|
5567
|
+
|
|
5568
|
+
|
|
5569
|
+
|
|
5570
|
+
|
|
5571
|
+
|
|
5572
|
+
|
|
5573
|
+
|
|
5574
|
+
|
|
5575
|
+
|
|
5576
|
+
|
|
5577
|
+
|
|
5578
|
+
|
|
5579
|
+
|
|
5580
|
+
|
|
5581
|
+
|
|
5582
|
+
|
|
5583
|
+
|
|
5584
|
+
|
|
5585
|
+
|
|
5586
|
+
|
|
5587
|
+
|
|
5588
|
+
|
|
5589
|
+
|
|
5590
|
+
|
|
5591
|
+
|
|
5592
|
+
|
|
5593
|
+
|
|
5594
|
+
|
|
5595
|
+
|
|
5596
|
+
|
|
5597
|
+
|
|
5598
|
+
|
|
5599
|
+
|
|
5600
|
+
|
|
5601
|
+
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;
|
|
5602
5602
|
/*! Bundled license information:
|
|
5603
5603
|
|
|
5604
5604
|
react-is/cjs/react-is.production.min.js:
|
|
@@ -5668,4 +5668,4 @@ react-is/cjs/react-is.development.js:
|
|
|
5668
5668
|
* LICENSE file in the root directory of this source tree.
|
|
5669
5669
|
*)
|
|
5670
5670
|
*/
|
|
5671
|
-
//# sourceMappingURL=index.
|
|
5671
|
+
//# sourceMappingURL=index.cjs.map
|