gsintegrations 0.0.487 → 0.0.488
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/bundle.cjs.js +581 -386
- package/dist/bundle.cjs.js.map +2 -2
- package/dist/bundle.esm.js +579 -387
- package/dist/bundle.esm.js.map +2 -2
- package/dist/index.d.ts +55 -26
- package/dist/types/components/molecules/FinanceMobilePeriodBar/FinanceMobilePeriodBar.d.ts +13 -0
- package/dist/types/components/molecules/FinanceMobilePeriodBar/index.d.ts +2 -0
- package/dist/types/components/molecules/index.d.ts +1 -0
- package/dist/types/components/shared/CompactListRow/CompactListRow.d.ts +19 -0
- package/dist/types/components/shared/CompactListRow/index.d.ts +3 -0
- package/dist/types/components/shared/index.d.ts +2 -0
- package/dist/types/pages/ActivityListPage/ActivityListPage.types.d.ts +3 -3
- package/dist/types/pages/EventsPage/EventsPage.types.d.ts +4 -4
- package/dist/types/pages/FinancialAccountsList/FinancialAccountsList.d.ts +3 -3
- package/dist/types/pages/FinancialAccountsList/FinancialAccountsList.types.d.ts +6 -6
- package/dist/types/pages/IncomeListPage/IncomeListPage.d.ts +4 -4
- package/dist/types/pages/IncomeListPage/IncomeListPage.types.d.ts +8 -8
- package/dist/types/pages/OutcomeListPage/OutcomeListPage.d.ts +4 -4
- package/dist/types/pages/OutcomeListPage/OutcomeListPage.types.d.ts +8 -8
- package/dist/types/theme/spacing.d.ts +17 -0
- package/package.json +1 -1
package/dist/bundle.cjs.js
CHANGED
|
@@ -58393,6 +58393,14 @@ const LIST_CARD_CONTENT_ROOT_SX = {
|
|
|
58393
58393
|
};
|
|
58394
58394
|
/** Scroll clearance above FAB / fixed bottom actions on list pages. */
|
|
58395
58395
|
const LIST_CONTENT_BOTTOM_PADDING = { xs: 11, sm: 10 };
|
|
58396
|
+
/** Fixed create button, clear of the home indicator. Hidden from `sm` up. */
|
|
58397
|
+
const LIST_FAB_BOTTOM = "calc(16px + env(safe-area-inset-bottom, 0px))";
|
|
58398
|
+
const LIST_FAB_POSITION_SX = {
|
|
58399
|
+
position: "fixed",
|
|
58400
|
+
display: { xs: "flex", sm: "none" },
|
|
58401
|
+
bottom: { xs: LIST_FAB_BOTTOM, sm: 24 },
|
|
58402
|
+
right: { xs: 16, sm: 24 },
|
|
58403
|
+
};
|
|
58396
58404
|
/** Vertical gap between form fields / sections. */
|
|
58397
58405
|
const SECTION_GAP = { xs: 2, sm: 3 };
|
|
58398
58406
|
/** Grid gap for card grids and form layouts. */
|
|
@@ -59304,6 +59312,10 @@ var TrendingUp$1 = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
|
|
|
59304
59312
|
d: "m16 6 2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"
|
|
59305
59313
|
}), 'TrendingUp');
|
|
59306
59314
|
|
|
59315
|
+
var UndoIcon = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
|
|
59316
|
+
d: "M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8"
|
|
59317
|
+
}), 'Undo');
|
|
59318
|
+
|
|
59307
59319
|
var UpgradeIcon = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
|
|
59308
59320
|
d: "M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"
|
|
59309
59321
|
}), 'Upgrade');
|
|
@@ -90533,6 +90545,145 @@ const AttendanceCheckinCta = ({ contextLabel, isSubmitting = false, onOpen, }) =
|
|
|
90533
90545
|
};
|
|
90534
90546
|
var AttendanceCheckinCta$1 = React$1.memo(AttendanceCheckinCta);
|
|
90535
90547
|
|
|
90548
|
+
const DATE_ONLY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
90549
|
+
const UTC_MIDNIGHT_ISO_PATTERN = /^(\d{4}-\d{2}-\d{2})T00:00:00(?:\.\d{1,3})?Z$/;
|
|
90550
|
+
const isDateOnlyString = (value) => typeof value === "string" && DATE_ONLY_PATTERN.test(value);
|
|
90551
|
+
const parseDateOnlyToLocalDate = (dateOnly) => {
|
|
90552
|
+
if (!isDateOnlyString(dateOnly)) {
|
|
90553
|
+
throw new Error(`Invalid date-only value: "${dateOnly}". Expected format YYYY-MM-DD`);
|
|
90554
|
+
}
|
|
90555
|
+
const [year, month, day] = dateOnly.split("-").map(Number);
|
|
90556
|
+
return new Date(year, month - 1, day);
|
|
90557
|
+
};
|
|
90558
|
+
const parseUtcMidnightIsoToLocalDate = (value) => {
|
|
90559
|
+
const match = value.match(UTC_MIDNIGHT_ISO_PATTERN);
|
|
90560
|
+
if (!match) {
|
|
90561
|
+
return null;
|
|
90562
|
+
}
|
|
90563
|
+
return parseDateOnlyToLocalDate(match[1]);
|
|
90564
|
+
};
|
|
90565
|
+
const normalizeDateInputToLocalDate = (value) => {
|
|
90566
|
+
if (value instanceof Date) {
|
|
90567
|
+
return value;
|
|
90568
|
+
}
|
|
90569
|
+
if (isDateOnlyString(value)) {
|
|
90570
|
+
return parseDateOnlyToLocalDate(value);
|
|
90571
|
+
}
|
|
90572
|
+
const parsedUtcMidnight = parseUtcMidnightIsoToLocalDate(value);
|
|
90573
|
+
if (parsedUtcMidnight) {
|
|
90574
|
+
return parsedUtcMidnight;
|
|
90575
|
+
}
|
|
90576
|
+
const parsed = new Date(value);
|
|
90577
|
+
return parsed;
|
|
90578
|
+
};
|
|
90579
|
+
const toValidDateOrNull = (value) => {
|
|
90580
|
+
if (!value) {
|
|
90581
|
+
return null;
|
|
90582
|
+
}
|
|
90583
|
+
const parsed = normalizeDateInputToLocalDate(value);
|
|
90584
|
+
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
90585
|
+
};
|
|
90586
|
+
const formatDateInputToDateOnly = (value) => {
|
|
90587
|
+
if (typeof value === "string" && isDateOnlyString(value)) {
|
|
90588
|
+
return value;
|
|
90589
|
+
}
|
|
90590
|
+
const date = normalizeDateInputToLocalDate(value);
|
|
90591
|
+
if (Number.isNaN(date.getTime())) {
|
|
90592
|
+
throw new Error(`Invalid date input: "${value}"`);
|
|
90593
|
+
}
|
|
90594
|
+
const year = date.getFullYear();
|
|
90595
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
90596
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
90597
|
+
return `${year}-${month}-${day}`;
|
|
90598
|
+
};
|
|
90599
|
+
const formatDateForDisplay = (value, locale = "pt-BR", options = {
|
|
90600
|
+
day: "2-digit",
|
|
90601
|
+
month: "long",
|
|
90602
|
+
year: "numeric",
|
|
90603
|
+
}) => {
|
|
90604
|
+
const date = value instanceof Date
|
|
90605
|
+
? value
|
|
90606
|
+
: normalizeDateInputToLocalDate(value);
|
|
90607
|
+
if (isNaN(date.getTime())) {
|
|
90608
|
+
return String(value);
|
|
90609
|
+
}
|
|
90610
|
+
return date.toLocaleDateString(locale, options);
|
|
90611
|
+
};
|
|
90612
|
+
|
|
90613
|
+
const compactListDateParts = (value) => {
|
|
90614
|
+
const date = toValidDateOrNull(value);
|
|
90615
|
+
if (!date)
|
|
90616
|
+
return null;
|
|
90617
|
+
const month = date
|
|
90618
|
+
.toLocaleDateString("pt-BR", { month: "short" })
|
|
90619
|
+
.replace(".", "");
|
|
90620
|
+
return {
|
|
90621
|
+
day: String(date.getDate()).padStart(2, "0"),
|
|
90622
|
+
month,
|
|
90623
|
+
};
|
|
90624
|
+
};
|
|
90625
|
+
const CompactListDateBlock = ({ day, month, }) => (React$1.createElement(Box$1, { "aria-hidden": true, sx: {
|
|
90626
|
+
width: 44,
|
|
90627
|
+
flexShrink: 0,
|
|
90628
|
+
textAlign: "center",
|
|
90629
|
+
lineHeight: 1.1,
|
|
90630
|
+
} },
|
|
90631
|
+
React$1.createElement(Typography$1, { component: "span", sx: { display: "block", fontWeight: 700, fontSize: "1rem" } }, day),
|
|
90632
|
+
React$1.createElement(Typography$1, { component: "span", sx: {
|
|
90633
|
+
display: "block",
|
|
90634
|
+
fontSize: "0.7rem",
|
|
90635
|
+
textTransform: "lowercase",
|
|
90636
|
+
color: "text.secondary",
|
|
90637
|
+
} }, month)));
|
|
90638
|
+
const CompactListRow = ({ title, meta, leading, trailing, onClick, isLast = false, ariaLabel, testId, }) => {
|
|
90639
|
+
const interactive = Boolean(onClick);
|
|
90640
|
+
return (React$1.createElement(Box$1, { "data-testid": testId, role: interactive ? "button" : undefined, tabIndex: interactive ? 0 : undefined, "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : (interactive ? title : undefined), onClick: onClick, onKeyDown: (event) => {
|
|
90641
|
+
if (!onClick)
|
|
90642
|
+
return;
|
|
90643
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
90644
|
+
event.preventDefault();
|
|
90645
|
+
onClick();
|
|
90646
|
+
}
|
|
90647
|
+
}, sx: {
|
|
90648
|
+
display: "flex",
|
|
90649
|
+
alignItems: "center",
|
|
90650
|
+
gap: 1.5,
|
|
90651
|
+
width: "100%",
|
|
90652
|
+
textAlign: "left",
|
|
90653
|
+
py: 1.25,
|
|
90654
|
+
px: 1.5,
|
|
90655
|
+
minHeight: 64,
|
|
90656
|
+
cursor: interactive ? "pointer" : "default",
|
|
90657
|
+
border: 0,
|
|
90658
|
+
borderBottom: isLast ? "none" : 1,
|
|
90659
|
+
borderColor: "divider",
|
|
90660
|
+
bgcolor: "transparent",
|
|
90661
|
+
"&:focus-visible": {
|
|
90662
|
+
outline: (theme) => `2px solid ${theme.palette.primary.main}`,
|
|
90663
|
+
outlineOffset: -2,
|
|
90664
|
+
},
|
|
90665
|
+
} },
|
|
90666
|
+
leading,
|
|
90667
|
+
React$1.createElement(Box$1, { sx: { flex: 1, minWidth: 0 } },
|
|
90668
|
+
React$1.createElement(Typography$1, { component: "span", title: title, sx: {
|
|
90669
|
+
display: "-webkit-box",
|
|
90670
|
+
WebkitLineClamp: 2,
|
|
90671
|
+
WebkitBoxOrient: "vertical",
|
|
90672
|
+
overflow: "hidden",
|
|
90673
|
+
fontWeight: 600,
|
|
90674
|
+
fontSize: "0.95rem",
|
|
90675
|
+
lineHeight: 1.3,
|
|
90676
|
+
} }, title),
|
|
90677
|
+
meta ? (React$1.createElement(Typography$1, { component: "span", variant: "body2", color: "text.secondary", sx: {
|
|
90678
|
+
display: "block",
|
|
90679
|
+
mt: 0.25,
|
|
90680
|
+
overflow: "hidden",
|
|
90681
|
+
textOverflow: "ellipsis",
|
|
90682
|
+
whiteSpace: "nowrap",
|
|
90683
|
+
} }, meta)) : null),
|
|
90684
|
+
trailing ? (React$1.createElement(Box$1, { onClick: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), sx: { flexShrink: 0, display: "flex", alignItems: "center" } }, trailing)) : null));
|
|
90685
|
+
};
|
|
90686
|
+
|
|
90536
90687
|
/**
|
|
90537
90688
|
* @module constants
|
|
90538
90689
|
* @summary Useful constants
|
|
@@ -116412,6 +116563,210 @@ const FinanceMetricCard$1 = React$1.memo(({ title, value, month, year, periodLab
|
|
|
116412
116563
|
});
|
|
116413
116564
|
FinanceMetricCard$1.displayName = "FinanceMetricCard";
|
|
116414
116565
|
|
|
116566
|
+
const GenericDrawer = ({ open, onClose, onOpen, anchor = "bottom", zIndex, fullHeight = false, disableEnforceFocus = false, "aria-label": ariaLabel, children, }) => {
|
|
116567
|
+
const theme = useTheme$1();
|
|
116568
|
+
const isVerticalAnchor = anchor === "bottom" || anchor === "top";
|
|
116569
|
+
const isSideAnchor = anchor === "left" || anchor === "right";
|
|
116570
|
+
const showHandle = anchor === "bottom";
|
|
116571
|
+
const verticalMaxHeight = fullHeight ? "100dvh" : "70dvh";
|
|
116572
|
+
return (React$1.createElement(SwipeableDrawer$1, { anchor: anchor, open: open, onClose: onClose, onOpen: onOpen !== null && onOpen !== void 0 ? onOpen : (() => {
|
|
116573
|
+
/* no-op */
|
|
116574
|
+
}), disableEnforceFocus: disableEnforceFocus, "aria-label": ariaLabel, PaperProps: {
|
|
116575
|
+
role: ariaLabel ? "dialog" : undefined,
|
|
116576
|
+
"aria-label": ariaLabel,
|
|
116577
|
+
"aria-modal": ariaLabel ? true : undefined,
|
|
116578
|
+
sx: Object.assign(Object.assign({ display: "flex", flexDirection: "column", borderRadius: drawerSheetRadius(anchor, theme), backgroundColor: theme.palette.mode === "dark"
|
|
116579
|
+
? "rgba(0,0,0,0.95)"
|
|
116580
|
+
: "rgba(255,255,255,0.95)", backdropFilter: "blur(20px)", border: `1px solid ${theme.palette.divider}`, width: "100%", maxWidth: `${theme.breakpoints.values.md}px`, marginX: "auto", left: isVerticalAnchor ? 0 : undefined, right: isVerticalAnchor ? 0 : undefined }, (isVerticalAnchor
|
|
116581
|
+
? Object.assign({ maxHeight: verticalMaxHeight }, (fullHeight ? { height: "100dvh" } : {})) : { maxHeight: "100dvh" })), (isSideAnchor
|
|
116582
|
+
? {
|
|
116583
|
+
top: 0,
|
|
116584
|
+
bottom: 0,
|
|
116585
|
+
["@media (min-width:600px)"]: {
|
|
116586
|
+
top: 0,
|
|
116587
|
+
bottom: 0,
|
|
116588
|
+
height: "min(90dvh, 900px)",
|
|
116589
|
+
marginY: "auto",
|
|
116590
|
+
},
|
|
116591
|
+
}
|
|
116592
|
+
: {})),
|
|
116593
|
+
}, sx: Object.assign({}, (zIndex !== undefined ? { zIndex } : {})) },
|
|
116594
|
+
showHandle && (React$1.createElement(Box$1, { component: "button", type: "button", "aria-label": "Fechar", "data-testid": "generic-drawer-handle", onClick: onClose, sx: {
|
|
116595
|
+
display: "flex",
|
|
116596
|
+
alignItems: "center",
|
|
116597
|
+
justifyContent: "center",
|
|
116598
|
+
flexShrink: 0,
|
|
116599
|
+
width: "100%",
|
|
116600
|
+
minHeight: 44,
|
|
116601
|
+
pt: 1,
|
|
116602
|
+
pb: 0.5,
|
|
116603
|
+
px: 2,
|
|
116604
|
+
border: "none",
|
|
116605
|
+
background: "transparent",
|
|
116606
|
+
cursor: "pointer",
|
|
116607
|
+
WebkitTapHighlightColor: "transparent",
|
|
116608
|
+
"&:focus-visible": {
|
|
116609
|
+
outline: `2px solid ${theme.palette.primary.main}`,
|
|
116610
|
+
outlineOffset: -2,
|
|
116611
|
+
},
|
|
116612
|
+
} },
|
|
116613
|
+
React$1.createElement(Box$1, { "aria-hidden": true, sx: {
|
|
116614
|
+
width: 36,
|
|
116615
|
+
height: 4,
|
|
116616
|
+
borderRadius: RADIUS.pill,
|
|
116617
|
+
bgcolor: alpha(theme.palette.text.primary, 0.28),
|
|
116618
|
+
} }))),
|
|
116619
|
+
children));
|
|
116620
|
+
};
|
|
116621
|
+
|
|
116622
|
+
const COMPETENCE_MONTH_REGEX = /^(\d{4})-(0[1-9]|1[0-2])$/;
|
|
116623
|
+
const isValidCompetenceMonth = (value) => typeof value === "string" && COMPETENCE_MONTH_REGEX.test(value);
|
|
116624
|
+
const parseCompetenceMonth = (value) => {
|
|
116625
|
+
if (!isValidCompetenceMonth(value)) {
|
|
116626
|
+
return null;
|
|
116627
|
+
}
|
|
116628
|
+
const [yearText, monthText] = value.split("-");
|
|
116629
|
+
const year = Number(yearText);
|
|
116630
|
+
const month = Number(monthText);
|
|
116631
|
+
return new Date(year, month - 1, 1);
|
|
116632
|
+
};
|
|
116633
|
+
const toCompetenceMonth = (date) => {
|
|
116634
|
+
if (!date || Number.isNaN(date.getTime())) {
|
|
116635
|
+
return "";
|
|
116636
|
+
}
|
|
116637
|
+
const year = date.getFullYear();
|
|
116638
|
+
const month = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
116639
|
+
return `${year}-${month}`;
|
|
116640
|
+
};
|
|
116641
|
+
const formatCompetenceMonthPtBr = (value, options) => {
|
|
116642
|
+
var _a, _b;
|
|
116643
|
+
if (!value)
|
|
116644
|
+
return "-";
|
|
116645
|
+
const date = parseCompetenceMonth(value);
|
|
116646
|
+
if (!date)
|
|
116647
|
+
return value;
|
|
116648
|
+
const monthFormat = (_a = options === null || options === void 0 ? void 0 : options.monthFormat) !== null && _a !== void 0 ? _a : "long";
|
|
116649
|
+
const capitalize = (_b = options === null || options === void 0 ? void 0 : options.capitalize) !== null && _b !== void 0 ? _b : true;
|
|
116650
|
+
const formatted = date.toLocaleDateString("pt-BR", {
|
|
116651
|
+
month: monthFormat,
|
|
116652
|
+
year: "numeric",
|
|
116653
|
+
});
|
|
116654
|
+
if (!capitalize || formatted.length === 0) {
|
|
116655
|
+
return formatted;
|
|
116656
|
+
}
|
|
116657
|
+
return formatted.charAt(0).toUpperCase() + formatted.slice(1);
|
|
116658
|
+
};
|
|
116659
|
+
|
|
116660
|
+
const useLabeledMonthPicker = (props) => {
|
|
116661
|
+
const { value, onChange, minMonth, maxMonth, disabled } = props;
|
|
116662
|
+
const parsedValue = React$1.useMemo(() => parseCompetenceMonth(value), [value]);
|
|
116663
|
+
const parsedMinMonth = React$1.useMemo(() => parseCompetenceMonth(minMonth), [minMonth]);
|
|
116664
|
+
const parsedMaxMonth = React$1.useMemo(() => parseCompetenceMonth(maxMonth), [maxMonth]);
|
|
116665
|
+
const isOutOfRange = React$1.useMemo(() => {
|
|
116666
|
+
if (!parsedValue)
|
|
116667
|
+
return false;
|
|
116668
|
+
if (parsedMinMonth && parsedValue < parsedMinMonth)
|
|
116669
|
+
return true;
|
|
116670
|
+
if (parsedMaxMonth && parsedValue > parsedMaxMonth)
|
|
116671
|
+
return true;
|
|
116672
|
+
return false;
|
|
116673
|
+
}, [parsedValue, parsedMinMonth, parsedMaxMonth]);
|
|
116674
|
+
const hasInvalidValue = React$1.useMemo(() => value.length > 0 && !isValidCompetenceMonth(value), [value]);
|
|
116675
|
+
const handleMonthChange = React$1.useCallback((nextDate) => {
|
|
116676
|
+
if (disabled)
|
|
116677
|
+
return;
|
|
116678
|
+
onChange(toCompetenceMonth(nextDate));
|
|
116679
|
+
}, [disabled, onChange]);
|
|
116680
|
+
const data = React$1.useMemo(() => ({
|
|
116681
|
+
parsedValue,
|
|
116682
|
+
parsedMinMonth,
|
|
116683
|
+
parsedMaxMonth,
|
|
116684
|
+
isOutOfRange,
|
|
116685
|
+
hasInvalidValue,
|
|
116686
|
+
}), [
|
|
116687
|
+
parsedValue,
|
|
116688
|
+
parsedMinMonth,
|
|
116689
|
+
parsedMaxMonth,
|
|
116690
|
+
isOutOfRange,
|
|
116691
|
+
hasInvalidValue,
|
|
116692
|
+
]);
|
|
116693
|
+
const fns = React$1.useMemo(() => ({
|
|
116694
|
+
handleMonthChange,
|
|
116695
|
+
}), [handleMonthChange]);
|
|
116696
|
+
return { data, fns };
|
|
116697
|
+
};
|
|
116698
|
+
|
|
116699
|
+
const LabeledMonthPicker = (props) => {
|
|
116700
|
+
var _a, _b;
|
|
116701
|
+
const { label, error, helperText, disabled, required, "data-testid": dataTestId, } = props;
|
|
116702
|
+
const { data, fns } = useLabeledMonthPicker(props);
|
|
116703
|
+
return (React$1.createElement(LocalizationProvider, { dateAdapter: AdapterDateFns, adapterLocale: ptBR },
|
|
116704
|
+
React$1.createElement(Box$1, null,
|
|
116705
|
+
React$1.createElement(DatePicker, { value: data.parsedValue, onChange: fns.handleMonthChange, views: ["year", "month"], openTo: "month", minDate: (_a = data.parsedMinMonth) !== null && _a !== void 0 ? _a : undefined, maxDate: (_b = data.parsedMaxMonth) !== null && _b !== void 0 ? _b : undefined, disabled: disabled, format: "MMMM 'de' yyyy", slotProps: {
|
|
116706
|
+
textField: {
|
|
116707
|
+
label,
|
|
116708
|
+
required,
|
|
116709
|
+
fullWidth: true,
|
|
116710
|
+
error: !!error || data.isOutOfRange || data.hasInvalidValue,
|
|
116711
|
+
helperText: error ||
|
|
116712
|
+
(data.hasInvalidValue
|
|
116713
|
+
? "Mês de referência inválido."
|
|
116714
|
+
: data.isOutOfRange
|
|
116715
|
+
? "Mês de referência fora do intervalo permitido"
|
|
116716
|
+
: helperText),
|
|
116717
|
+
InputProps: {
|
|
116718
|
+
readOnly: true,
|
|
116719
|
+
},
|
|
116720
|
+
InputLabelProps: {
|
|
116721
|
+
shrink: true,
|
|
116722
|
+
},
|
|
116723
|
+
inputProps: {
|
|
116724
|
+
"data-testid": dataTestId,
|
|
116725
|
+
},
|
|
116726
|
+
},
|
|
116727
|
+
} }))));
|
|
116728
|
+
};
|
|
116729
|
+
|
|
116730
|
+
const LabeledMonthPickerPropsSchema = objectType({
|
|
116731
|
+
label: stringType(),
|
|
116732
|
+
value: stringType(),
|
|
116733
|
+
onChange: functionType(tupleType([stringType()]), voidType()),
|
|
116734
|
+
error: stringType().optional(),
|
|
116735
|
+
helperText: stringType().optional(),
|
|
116736
|
+
disabled: booleanType().optional(),
|
|
116737
|
+
required: booleanType().optional(),
|
|
116738
|
+
minMonth: stringType().optional(),
|
|
116739
|
+
maxMonth: stringType().optional(),
|
|
116740
|
+
"data-testid": stringType().optional(),
|
|
116741
|
+
});
|
|
116742
|
+
|
|
116743
|
+
const FinanceMobilePeriodBar = ({ periodLabel, amountLabel, periodInputValue, periodInputMin, periodInputMax, onPeriodInputChange, onResetToCurrentPeriod, testIdPrefix, }) => {
|
|
116744
|
+
const [open, setOpen] = React$1.useState(false);
|
|
116745
|
+
const summary = `${periodLabel || "-"} · ${amountLabel}`;
|
|
116746
|
+
return (React$1.createElement(React$1.Fragment, null,
|
|
116747
|
+
React$1.createElement(Button$1, { fullWidth: true, variant: "text", color: "inherit", onClick: () => setOpen(true), "aria-label": `Alterar competência, ${summary}`, "data-testid": `${testIdPrefix}-period-summary`, sx: {
|
|
116748
|
+
justifyContent: "flex-start",
|
|
116749
|
+
minHeight: 44,
|
|
116750
|
+
px: 1.5,
|
|
116751
|
+
py: 1,
|
|
116752
|
+
mb: 1,
|
|
116753
|
+
textTransform: "none",
|
|
116754
|
+
bgcolor: "background.paper",
|
|
116755
|
+
border: 1,
|
|
116756
|
+
borderColor: "divider",
|
|
116757
|
+
borderRadius: 1,
|
|
116758
|
+
} },
|
|
116759
|
+
React$1.createElement(Typography$1, { component: "span", fontWeight: 600, noWrap: true }, summary)),
|
|
116760
|
+
React$1.createElement(GenericDrawer, { anchor: "bottom", open: open, onClose: () => setOpen(false), "aria-label": "Compet\u00EAncia" },
|
|
116761
|
+
React$1.createElement(Stack$1, { spacing: 2, sx: { px: 2, pt: 1, pb: 3 } },
|
|
116762
|
+
React$1.createElement(Typography$1, { fontWeight: 700 }, "Compet\u00EAncia"),
|
|
116763
|
+
React$1.createElement(LabeledMonthPicker, { label: "Selecionar m\u00EAs", value: periodInputValue || "", onChange: (value) => onPeriodInputChange === null || onPeriodInputChange === void 0 ? void 0 : onPeriodInputChange(value), minMonth: periodInputMin || "2000-01", maxMonth: periodInputMax || "2100-12", "data-testid": `${testIdPrefix}-period-input` }),
|
|
116764
|
+
React$1.createElement(Button$1, { variant: "text", onClick: () => {
|
|
116765
|
+
onResetToCurrentPeriod === null || onResetToCurrentPeriod === void 0 ? void 0 : onResetToCurrentPeriod();
|
|
116766
|
+
setOpen(false);
|
|
116767
|
+
}, "data-testid": `${testIdPrefix}-period-current-month-button`, sx: { alignSelf: "flex-start", minHeight: 44 } }, "M\u00EAs atual")))));
|
|
116768
|
+
};
|
|
116769
|
+
|
|
116415
116770
|
const DEFAULT_MIN = 0;
|
|
116416
116771
|
const DEFAULT_MAX = 120;
|
|
116417
116772
|
const formatMinuteValue = (value, fallbackValue) => String(value !== null && value !== void 0 ? value : fallbackValue);
|
|
@@ -116494,20 +116849,35 @@ const InfoSectionCard = ({ icon, title, count, action, children, }) => (React$1.
|
|
|
116494
116849
|
|
|
116495
116850
|
const PageHeaderStatusTabs = ({ tabs, selectedTab, onTabChange, }) => {
|
|
116496
116851
|
const theme = useTheme$1();
|
|
116497
|
-
|
|
116852
|
+
const selectedRef = React$1.useRef(null);
|
|
116853
|
+
React$1.useEffect(() => {
|
|
116854
|
+
var _a, _b;
|
|
116855
|
+
(_b = (_a = selectedRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
116856
|
+
inline: "nearest",
|
|
116857
|
+
block: "nearest",
|
|
116858
|
+
});
|
|
116859
|
+
}, [selectedTab]);
|
|
116860
|
+
return (React$1.createElement(Box$1, { role: "tablist", sx: {
|
|
116861
|
+
display: "flex",
|
|
116862
|
+
flexWrap: "nowrap",
|
|
116863
|
+
gap: 0.75,
|
|
116864
|
+
width: "100%",
|
|
116865
|
+
overflowX: "auto",
|
|
116866
|
+
WebkitOverflowScrolling: "touch",
|
|
116867
|
+
scrollbarWidth: "none",
|
|
116868
|
+
"&::-webkit-scrollbar": { display: "none" },
|
|
116869
|
+
} }, tabs.map((tab) => {
|
|
116498
116870
|
const isSelected = selectedTab === tab.value;
|
|
116499
|
-
return (React$1.createElement(
|
|
116500
|
-
|
|
116501
|
-
|
|
116502
|
-
|
|
116503
|
-
|
|
116504
|
-
|
|
116505
|
-
|
|
116506
|
-
|
|
116507
|
-
|
|
116508
|
-
|
|
116509
|
-
backgroundColor: theme.palette.background.paper,
|
|
116510
|
-
})) }));
|
|
116871
|
+
return (React$1.createElement(Box$1, { key: tab.value, ref: isSelected ? selectedRef : undefined, sx: { flexShrink: 0 } },
|
|
116872
|
+
React$1.createElement(Chip$1, { component: "button", type: "button", role: "tab", "aria-selected": isSelected, tabIndex: isSelected ? 0 : -1, "data-testid": tab.testId, label: tab.label, onClick: () => onTabChange(tab.value), color: isSelected ? "primary" : "default", variant: isSelected ? "filled" : "outlined", sx: Object.assign({ height: 44, minHeight: 44, borderRadius: RADIUS.default, fontWeight: isSelected ? 600 : 500, fontSize: { xs: "0.8rem", sm: "0.875rem" }, "& .MuiChip-label": {
|
|
116873
|
+
whiteSpace: "nowrap",
|
|
116874
|
+
px: 1.25,
|
|
116875
|
+
} }, (isSelected
|
|
116876
|
+
? {}
|
|
116877
|
+
: {
|
|
116878
|
+
borderColor: theme.palette.divider,
|
|
116879
|
+
backgroundColor: theme.palette.background.paper,
|
|
116880
|
+
})) })));
|
|
116511
116881
|
})));
|
|
116512
116882
|
};
|
|
116513
116883
|
const PageHeader$2 = ({ title, onBack, onAdd, addLabel = "Adicionar", showAddButton = true, hideAddButtonOnMobile = false, tabs, selectedTab, onTabChange, startAdornment, endAction, }) => {
|
|
@@ -117682,62 +118052,6 @@ const overlayZIndex = {
|
|
|
117682
118052
|
nestedMenu: (theme) => theme.zIndex.modal + 3,
|
|
117683
118053
|
};
|
|
117684
118054
|
|
|
117685
|
-
const GenericDrawer = ({ open, onClose, onOpen, anchor = "bottom", zIndex, fullHeight = false, disableEnforceFocus = false, "aria-label": ariaLabel, children, }) => {
|
|
117686
|
-
const theme = useTheme$1();
|
|
117687
|
-
const isVerticalAnchor = anchor === "bottom" || anchor === "top";
|
|
117688
|
-
const isSideAnchor = anchor === "left" || anchor === "right";
|
|
117689
|
-
const showHandle = anchor === "bottom";
|
|
117690
|
-
const verticalMaxHeight = fullHeight ? "100dvh" : "70dvh";
|
|
117691
|
-
return (React$1.createElement(SwipeableDrawer$1, { anchor: anchor, open: open, onClose: onClose, onOpen: onOpen !== null && onOpen !== void 0 ? onOpen : (() => {
|
|
117692
|
-
/* no-op */
|
|
117693
|
-
}), disableEnforceFocus: disableEnforceFocus, "aria-label": ariaLabel, PaperProps: {
|
|
117694
|
-
role: ariaLabel ? "dialog" : undefined,
|
|
117695
|
-
"aria-label": ariaLabel,
|
|
117696
|
-
"aria-modal": ariaLabel ? true : undefined,
|
|
117697
|
-
sx: Object.assign(Object.assign({ display: "flex", flexDirection: "column", borderRadius: drawerSheetRadius(anchor, theme), backgroundColor: theme.palette.mode === "dark"
|
|
117698
|
-
? "rgba(0,0,0,0.95)"
|
|
117699
|
-
: "rgba(255,255,255,0.95)", backdropFilter: "blur(20px)", border: `1px solid ${theme.palette.divider}`, width: "100%", maxWidth: `${theme.breakpoints.values.md}px`, marginX: "auto", left: isVerticalAnchor ? 0 : undefined, right: isVerticalAnchor ? 0 : undefined }, (isVerticalAnchor
|
|
117700
|
-
? Object.assign({ maxHeight: verticalMaxHeight }, (fullHeight ? { height: "100dvh" } : {})) : { maxHeight: "100dvh" })), (isSideAnchor
|
|
117701
|
-
? {
|
|
117702
|
-
top: 0,
|
|
117703
|
-
bottom: 0,
|
|
117704
|
-
["@media (min-width:600px)"]: {
|
|
117705
|
-
top: 0,
|
|
117706
|
-
bottom: 0,
|
|
117707
|
-
height: "min(90dvh, 900px)",
|
|
117708
|
-
marginY: "auto",
|
|
117709
|
-
},
|
|
117710
|
-
}
|
|
117711
|
-
: {})),
|
|
117712
|
-
}, sx: Object.assign({}, (zIndex !== undefined ? { zIndex } : {})) },
|
|
117713
|
-
showHandle && (React$1.createElement(Box$1, { component: "button", type: "button", "aria-label": "Fechar", "data-testid": "generic-drawer-handle", onClick: onClose, sx: {
|
|
117714
|
-
display: "flex",
|
|
117715
|
-
alignItems: "center",
|
|
117716
|
-
justifyContent: "center",
|
|
117717
|
-
flexShrink: 0,
|
|
117718
|
-
width: "100%",
|
|
117719
|
-
minHeight: 44,
|
|
117720
|
-
pt: 1,
|
|
117721
|
-
pb: 0.5,
|
|
117722
|
-
px: 2,
|
|
117723
|
-
border: "none",
|
|
117724
|
-
background: "transparent",
|
|
117725
|
-
cursor: "pointer",
|
|
117726
|
-
WebkitTapHighlightColor: "transparent",
|
|
117727
|
-
"&:focus-visible": {
|
|
117728
|
-
outline: `2px solid ${theme.palette.primary.main}`,
|
|
117729
|
-
outlineOffset: -2,
|
|
117730
|
-
},
|
|
117731
|
-
} },
|
|
117732
|
-
React$1.createElement(Box$1, { "aria-hidden": true, sx: {
|
|
117733
|
-
width: 36,
|
|
117734
|
-
height: 4,
|
|
117735
|
-
borderRadius: RADIUS.pill,
|
|
117736
|
-
bgcolor: alpha(theme.palette.text.primary, 0.28),
|
|
117737
|
-
} }))),
|
|
117738
|
-
children));
|
|
117739
|
-
};
|
|
117740
|
-
|
|
117741
118055
|
const cloneFilters = (value) => {
|
|
117742
118056
|
return JSON.parse(JSON.stringify(value));
|
|
117743
118057
|
};
|
|
@@ -117966,127 +118280,6 @@ const LabeledBrazilianStateSelect = (props) => {
|
|
|
117966
118280
|
React$1.createElement(FormHelperText$1, null, error || helperText)));
|
|
117967
118281
|
};
|
|
117968
118282
|
|
|
117969
|
-
const COMPETENCE_MONTH_REGEX = /^(\d{4})-(0[1-9]|1[0-2])$/;
|
|
117970
|
-
const isValidCompetenceMonth = (value) => typeof value === "string" && COMPETENCE_MONTH_REGEX.test(value);
|
|
117971
|
-
const parseCompetenceMonth = (value) => {
|
|
117972
|
-
if (!isValidCompetenceMonth(value)) {
|
|
117973
|
-
return null;
|
|
117974
|
-
}
|
|
117975
|
-
const [yearText, monthText] = value.split("-");
|
|
117976
|
-
const year = Number(yearText);
|
|
117977
|
-
const month = Number(monthText);
|
|
117978
|
-
return new Date(year, month - 1, 1);
|
|
117979
|
-
};
|
|
117980
|
-
const toCompetenceMonth = (date) => {
|
|
117981
|
-
if (!date || Number.isNaN(date.getTime())) {
|
|
117982
|
-
return "";
|
|
117983
|
-
}
|
|
117984
|
-
const year = date.getFullYear();
|
|
117985
|
-
const month = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
117986
|
-
return `${year}-${month}`;
|
|
117987
|
-
};
|
|
117988
|
-
const formatCompetenceMonthPtBr = (value, options) => {
|
|
117989
|
-
var _a, _b;
|
|
117990
|
-
if (!value)
|
|
117991
|
-
return "-";
|
|
117992
|
-
const date = parseCompetenceMonth(value);
|
|
117993
|
-
if (!date)
|
|
117994
|
-
return value;
|
|
117995
|
-
const monthFormat = (_a = options === null || options === void 0 ? void 0 : options.monthFormat) !== null && _a !== void 0 ? _a : "long";
|
|
117996
|
-
const capitalize = (_b = options === null || options === void 0 ? void 0 : options.capitalize) !== null && _b !== void 0 ? _b : true;
|
|
117997
|
-
const formatted = date.toLocaleDateString("pt-BR", {
|
|
117998
|
-
month: monthFormat,
|
|
117999
|
-
year: "numeric",
|
|
118000
|
-
});
|
|
118001
|
-
if (!capitalize || formatted.length === 0) {
|
|
118002
|
-
return formatted;
|
|
118003
|
-
}
|
|
118004
|
-
return formatted.charAt(0).toUpperCase() + formatted.slice(1);
|
|
118005
|
-
};
|
|
118006
|
-
|
|
118007
|
-
const useLabeledMonthPicker = (props) => {
|
|
118008
|
-
const { value, onChange, minMonth, maxMonth, disabled } = props;
|
|
118009
|
-
const parsedValue = React$1.useMemo(() => parseCompetenceMonth(value), [value]);
|
|
118010
|
-
const parsedMinMonth = React$1.useMemo(() => parseCompetenceMonth(minMonth), [minMonth]);
|
|
118011
|
-
const parsedMaxMonth = React$1.useMemo(() => parseCompetenceMonth(maxMonth), [maxMonth]);
|
|
118012
|
-
const isOutOfRange = React$1.useMemo(() => {
|
|
118013
|
-
if (!parsedValue)
|
|
118014
|
-
return false;
|
|
118015
|
-
if (parsedMinMonth && parsedValue < parsedMinMonth)
|
|
118016
|
-
return true;
|
|
118017
|
-
if (parsedMaxMonth && parsedValue > parsedMaxMonth)
|
|
118018
|
-
return true;
|
|
118019
|
-
return false;
|
|
118020
|
-
}, [parsedValue, parsedMinMonth, parsedMaxMonth]);
|
|
118021
|
-
const hasInvalidValue = React$1.useMemo(() => value.length > 0 && !isValidCompetenceMonth(value), [value]);
|
|
118022
|
-
const handleMonthChange = React$1.useCallback((nextDate) => {
|
|
118023
|
-
if (disabled)
|
|
118024
|
-
return;
|
|
118025
|
-
onChange(toCompetenceMonth(nextDate));
|
|
118026
|
-
}, [disabled, onChange]);
|
|
118027
|
-
const data = React$1.useMemo(() => ({
|
|
118028
|
-
parsedValue,
|
|
118029
|
-
parsedMinMonth,
|
|
118030
|
-
parsedMaxMonth,
|
|
118031
|
-
isOutOfRange,
|
|
118032
|
-
hasInvalidValue,
|
|
118033
|
-
}), [
|
|
118034
|
-
parsedValue,
|
|
118035
|
-
parsedMinMonth,
|
|
118036
|
-
parsedMaxMonth,
|
|
118037
|
-
isOutOfRange,
|
|
118038
|
-
hasInvalidValue,
|
|
118039
|
-
]);
|
|
118040
|
-
const fns = React$1.useMemo(() => ({
|
|
118041
|
-
handleMonthChange,
|
|
118042
|
-
}), [handleMonthChange]);
|
|
118043
|
-
return { data, fns };
|
|
118044
|
-
};
|
|
118045
|
-
|
|
118046
|
-
const LabeledMonthPicker = (props) => {
|
|
118047
|
-
var _a, _b;
|
|
118048
|
-
const { label, error, helperText, disabled, required, "data-testid": dataTestId, } = props;
|
|
118049
|
-
const { data, fns } = useLabeledMonthPicker(props);
|
|
118050
|
-
return (React$1.createElement(LocalizationProvider, { dateAdapter: AdapterDateFns, adapterLocale: ptBR },
|
|
118051
|
-
React$1.createElement(Box$1, null,
|
|
118052
|
-
React$1.createElement(DatePicker, { value: data.parsedValue, onChange: fns.handleMonthChange, views: ["year", "month"], openTo: "month", minDate: (_a = data.parsedMinMonth) !== null && _a !== void 0 ? _a : undefined, maxDate: (_b = data.parsedMaxMonth) !== null && _b !== void 0 ? _b : undefined, disabled: disabled, format: "MMMM 'de' yyyy", slotProps: {
|
|
118053
|
-
textField: {
|
|
118054
|
-
label,
|
|
118055
|
-
required,
|
|
118056
|
-
fullWidth: true,
|
|
118057
|
-
error: !!error || data.isOutOfRange || data.hasInvalidValue,
|
|
118058
|
-
helperText: error ||
|
|
118059
|
-
(data.hasInvalidValue
|
|
118060
|
-
? "Mês de referência inválido."
|
|
118061
|
-
: data.isOutOfRange
|
|
118062
|
-
? "Mês de referência fora do intervalo permitido"
|
|
118063
|
-
: helperText),
|
|
118064
|
-
InputProps: {
|
|
118065
|
-
readOnly: true,
|
|
118066
|
-
},
|
|
118067
|
-
InputLabelProps: {
|
|
118068
|
-
shrink: true,
|
|
118069
|
-
},
|
|
118070
|
-
inputProps: {
|
|
118071
|
-
"data-testid": dataTestId,
|
|
118072
|
-
},
|
|
118073
|
-
},
|
|
118074
|
-
} }))));
|
|
118075
|
-
};
|
|
118076
|
-
|
|
118077
|
-
const LabeledMonthPickerPropsSchema = objectType({
|
|
118078
|
-
label: stringType(),
|
|
118079
|
-
value: stringType(),
|
|
118080
|
-
onChange: functionType(tupleType([stringType()]), voidType()),
|
|
118081
|
-
error: stringType().optional(),
|
|
118082
|
-
helperText: stringType().optional(),
|
|
118083
|
-
disabled: booleanType().optional(),
|
|
118084
|
-
required: booleanType().optional(),
|
|
118085
|
-
minMonth: stringType().optional(),
|
|
118086
|
-
maxMonth: stringType().optional(),
|
|
118087
|
-
"data-testid": stringType().optional(),
|
|
118088
|
-
});
|
|
118089
|
-
|
|
118090
118283
|
const LabeledFieldHeaderPropsSchema = objectType({
|
|
118091
118284
|
label: stringType(),
|
|
118092
118285
|
required: booleanType().optional(),
|
|
@@ -129829,71 +130022,6 @@ const QuestionAnswersSheet = ({ open, answers = [], answerCount, isLoading = fal
|
|
|
129829
130022
|
onSubmitAnswer ? (React$1.createElement(SocialMessageComposer, { variant: "drawer", value: draft, onChange: setDraft, onSend: (message) => void handleSend(message), placeholder: "Escreva uma resposta\u2026", disabled: composerDisabled, isSending: isSubmitting })) : null)));
|
|
129830
130023
|
};
|
|
129831
130024
|
|
|
129832
|
-
const DATE_ONLY_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
129833
|
-
const UTC_MIDNIGHT_ISO_PATTERN = /^(\d{4}-\d{2}-\d{2})T00:00:00(?:\.\d{1,3})?Z$/;
|
|
129834
|
-
const isDateOnlyString = (value) => typeof value === "string" && DATE_ONLY_PATTERN.test(value);
|
|
129835
|
-
const parseDateOnlyToLocalDate = (dateOnly) => {
|
|
129836
|
-
if (!isDateOnlyString(dateOnly)) {
|
|
129837
|
-
throw new Error(`Invalid date-only value: "${dateOnly}". Expected format YYYY-MM-DD`);
|
|
129838
|
-
}
|
|
129839
|
-
const [year, month, day] = dateOnly.split("-").map(Number);
|
|
129840
|
-
return new Date(year, month - 1, day);
|
|
129841
|
-
};
|
|
129842
|
-
const parseUtcMidnightIsoToLocalDate = (value) => {
|
|
129843
|
-
const match = value.match(UTC_MIDNIGHT_ISO_PATTERN);
|
|
129844
|
-
if (!match) {
|
|
129845
|
-
return null;
|
|
129846
|
-
}
|
|
129847
|
-
return parseDateOnlyToLocalDate(match[1]);
|
|
129848
|
-
};
|
|
129849
|
-
const normalizeDateInputToLocalDate = (value) => {
|
|
129850
|
-
if (value instanceof Date) {
|
|
129851
|
-
return value;
|
|
129852
|
-
}
|
|
129853
|
-
if (isDateOnlyString(value)) {
|
|
129854
|
-
return parseDateOnlyToLocalDate(value);
|
|
129855
|
-
}
|
|
129856
|
-
const parsedUtcMidnight = parseUtcMidnightIsoToLocalDate(value);
|
|
129857
|
-
if (parsedUtcMidnight) {
|
|
129858
|
-
return parsedUtcMidnight;
|
|
129859
|
-
}
|
|
129860
|
-
const parsed = new Date(value);
|
|
129861
|
-
return parsed;
|
|
129862
|
-
};
|
|
129863
|
-
const toValidDateOrNull = (value) => {
|
|
129864
|
-
if (!value) {
|
|
129865
|
-
return null;
|
|
129866
|
-
}
|
|
129867
|
-
const parsed = normalizeDateInputToLocalDate(value);
|
|
129868
|
-
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
129869
|
-
};
|
|
129870
|
-
const formatDateInputToDateOnly = (value) => {
|
|
129871
|
-
if (typeof value === "string" && isDateOnlyString(value)) {
|
|
129872
|
-
return value;
|
|
129873
|
-
}
|
|
129874
|
-
const date = normalizeDateInputToLocalDate(value);
|
|
129875
|
-
if (Number.isNaN(date.getTime())) {
|
|
129876
|
-
throw new Error(`Invalid date input: "${value}"`);
|
|
129877
|
-
}
|
|
129878
|
-
const year = date.getFullYear();
|
|
129879
|
-
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
129880
|
-
const day = String(date.getDate()).padStart(2, "0");
|
|
129881
|
-
return `${year}-${month}-${day}`;
|
|
129882
|
-
};
|
|
129883
|
-
const formatDateForDisplay = (value, locale = "pt-BR", options = {
|
|
129884
|
-
day: "2-digit",
|
|
129885
|
-
month: "long",
|
|
129886
|
-
year: "numeric",
|
|
129887
|
-
}) => {
|
|
129888
|
-
const date = value instanceof Date
|
|
129889
|
-
? value
|
|
129890
|
-
: normalizeDateInputToLocalDate(value);
|
|
129891
|
-
if (isNaN(date.getTime())) {
|
|
129892
|
-
return String(value);
|
|
129893
|
-
}
|
|
129894
|
-
return date.toLocaleDateString(locale, options);
|
|
129895
|
-
};
|
|
129896
|
-
|
|
129897
130025
|
const AVATAR_SIZE$1 = 84;
|
|
129898
130026
|
const overlayIconSx = {
|
|
129899
130027
|
color: "common.white",
|
|
@@ -135124,9 +135252,30 @@ const ActivityCard = ({ activity, isLast, isPersonalProfile = false, onSelect, o
|
|
|
135124
135252
|
return (React$1.createElement(Avatar$1, { key: idx, src: (_a = item.imageUrl) !== null && _a !== void 0 ? _a : undefined, alt: item.name }, ((_c = (_b = item.name) === null || _b === void 0 ? void 0 : _b.charAt(0)) !== null && _c !== void 0 ? _c : "").toUpperCase()));
|
|
135125
135253
|
})))))));
|
|
135126
135254
|
};
|
|
135255
|
+
const ActivityCompactRow = ({ activity, isLast, isPersonalProfile = false, onSelect, onEdit }) => {
|
|
135256
|
+
var _a;
|
|
135257
|
+
const occurrence = (_a = activity.occurrences) === null || _a === void 0 ? void 0 : _a[0];
|
|
135258
|
+
const dateParts = compactListDateParts(occurrence === null || occurrence === void 0 ? void 0 : occurrence.date);
|
|
135259
|
+
const dateTime = formatActivityDateTime(activity);
|
|
135260
|
+
const configuredCheckinWindow = getConfiguredCheckinWindow$1(activity);
|
|
135261
|
+
const meta = [
|
|
135262
|
+
dateTime.time,
|
|
135263
|
+
configuredCheckinWindow && !isPersonalProfile
|
|
135264
|
+
? `Check-in ${configuredCheckinWindow}`
|
|
135265
|
+
: null,
|
|
135266
|
+
activity.members && activity.members.count > 0
|
|
135267
|
+
? `${activity.members.count} médiuns`
|
|
135268
|
+
: null,
|
|
135269
|
+
]
|
|
135270
|
+
.filter(Boolean)
|
|
135271
|
+
.join(" · ");
|
|
135272
|
+
return (React$1.createElement(CompactListRow, { title: activity.title, meta: meta, isLast: isLast, onClick: () => onSelect(activity.id), leading: dateParts ? (React$1.createElement(CompactListDateBlock, { day: dateParts.day, month: dateParts.month })) : (React$1.createElement(CalendarToday, { fontSize: "small", color: "action" })), trailing: onEdit ? (React$1.createElement(IconButton$1, { "aria-label": `Editar ${activity.title}`, onClick: () => onEdit(activity.id), sx: { width: 44, height: 44 } },
|
|
135273
|
+
React$1.createElement(ArrowForwardIos, { sx: { width: 16 } }))) : undefined }));
|
|
135274
|
+
};
|
|
135127
135275
|
const ActivityListPage = (props) => {
|
|
135128
135276
|
var _a;
|
|
135129
135277
|
const theme = useTheme$1();
|
|
135278
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
135130
135279
|
const { data, fns } = useActivityListPage(props);
|
|
135131
135280
|
const canCreate = props.canCreate || props.isAdmin;
|
|
135132
135281
|
const periodInputValue = (_a = props.periodInputValue) !== null && _a !== void 0 ? _a : `${new Date().getFullYear()}-${String(new Date().getMonth() + 1).padStart(2, "0")}`;
|
|
@@ -135175,7 +135324,9 @@ const ActivityListPage = (props) => {
|
|
|
135175
135324
|
backgroundColor: theme.palette.background.default,
|
|
135176
135325
|
position: "relative",
|
|
135177
135326
|
} },
|
|
135178
|
-
React$1.createElement(PageHeader$2, { title: "Atividades", onBack: fns.handleClose, onAdd: fns.handleActivityAdd, addLabel: "Adicionar", showAddButton: canCreate,
|
|
135327
|
+
React$1.createElement(PageHeader$2, { title: "Atividades", onBack: fns.handleClose, onAdd: fns.handleActivityAdd, addLabel: "Adicionar", showAddButton: canCreate, hideAddButtonOnMobile: true, endAction: props.canExportParticipationReport &&
|
|
135328
|
+
props.onExportParticipationReport ? (React$1.createElement(IconButton$1, { "aria-label": "Exportar Participa\u00E7\u00E3o", onClick: props.onExportParticipationReport, disabled: props.isExportingParticipationReport, "data-testid": "activities-export-participation-icon", sx: { display: { xs: "inline-flex", sm: "none" }, width: 44, height: 44 } },
|
|
135329
|
+
React$1.createElement(Download, null))) : undefined, tabs: tabs.map((status) => ({
|
|
135179
135330
|
value: status,
|
|
135180
135331
|
label: data.getStatusLabel(status),
|
|
135181
135332
|
})), selectedTab: safeSelectedTab, onTabChange: (value) => fns.handleTabChange(value) }),
|
|
@@ -135191,7 +135342,7 @@ const ActivityListPage = (props) => {
|
|
|
135191
135342
|
React$1.createElement(Box$1, { sx: { width: { xs: "100%", sm: 260 } } },
|
|
135192
135343
|
React$1.createElement(LabeledMonthPicker, { label: "Per\u00EDodo", value: periodInputValue, onChange: (nextValue) => { var _a; return (_a = props.onPeriodInputChange) === null || _a === void 0 ? void 0 : _a.call(props, nextValue); }, "data-testid": "activities-period-input" })),
|
|
135193
135344
|
props.canExportParticipationReport &&
|
|
135194
|
-
props.onExportParticipationReport && (React$1.createElement(Button$1, { variant: "outlined", startIcon: React$1.createElement(Download, null), onClick: props.onExportParticipationReport, disabled: props.isExportingParticipationReport, "data-testid": "activities-export-participation-button" }, props.isExportingParticipationReport
|
|
135345
|
+
props.onExportParticipationReport && (React$1.createElement(Button$1, { variant: "outlined", startIcon: React$1.createElement(Download, null), onClick: props.onExportParticipationReport, disabled: props.isExportingParticipationReport, "data-testid": "activities-export-participation-button", sx: { display: { xs: "none", sm: "inline-flex" } } }, props.isExportingParticipationReport
|
|
135195
135346
|
? "Exportando..."
|
|
135196
135347
|
: "Exportar Participação"))),
|
|
135197
135348
|
React$1.createElement(Box$1, { sx: Object.assign({ flex: 1, pb: LIST_CONTENT_BOTTOM_PADDING }, LIST_CARD_CONTENT_ROOT_SX) }, data.activities.length === 0 ? (React$1.createElement(Box$1, { sx: {
|
|
@@ -135208,18 +135359,19 @@ const ActivityListPage = (props) => {
|
|
|
135208
135359
|
canCreate && (React$1.createElement(React$1.Fragment, null,
|
|
135209
135360
|
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mb: SECTION_GAP } }, "Toque no bot\u00E3o + para criar uma nova atividade"),
|
|
135210
135361
|
React$1.createElement(QuotaGuard, { feature: "activities", behavior: "disable" },
|
|
135211
|
-
React$1.createElement(Button$1, { variant: "contained", startIcon: React$1.createElement(Add$1, null), onClick: fns.handleActivityAdd }, "Criar atividade")))))) : (React$1.createElement(
|
|
135362
|
+
React$1.createElement(Button$1, { variant: "contained", startIcon: React$1.createElement(Add$1, null), onClick: fns.handleActivityAdd }, "Criar atividade")))))) : (isMobile ? (React$1.createElement(Box$1, { sx: {
|
|
135363
|
+
bgcolor: "background.paper",
|
|
135364
|
+
borderRadius: RADIUS.default,
|
|
135365
|
+
border: 1,
|
|
135366
|
+
borderColor: "divider",
|
|
135367
|
+
overflow: "hidden",
|
|
135368
|
+
} }, data.activities.map((activity, index) => (React$1.createElement(ActivityCompactRow, { key: activity.id, activity: activity, isLast: index === data.activities.length - 1, isPersonalProfile: props.isPersonalProfile, onSelect: fns.handleActivitySelect, onEdit: props.onActivityEdit ? fns.handleActivityEdit : undefined }))))) : (React$1.createElement(Stack$1, { spacing: LIST_GAP }, data.activities.map((activity, index) => (React$1.createElement(ActivityCard, { key: activity.id, activity: activity, isLast: index === data.activities.length - 1, isPersonalProfile: props.isPersonalProfile, onSelect: fns.handleActivitySelect, onEdit: fns.handleActivityEdit, theme: theme, getStatusLabel: data.getStatusLabel }))))))),
|
|
135212
135369
|
React$1.createElement(Menu$2, { anchorEl: filterAnchorEl, open: Boolean(filterAnchorEl), onClose: handleFilterClose },
|
|
135213
135370
|
React$1.createElement(MenuItem$1, { onClick: () => handleTemplateFilter(null) }, "Todas as atividades"),
|
|
135214
135371
|
React$1.createElement(MenuItem$1, { onClick: () => handleTemplateFilter(true) }, "Apenas modelos"),
|
|
135215
135372
|
React$1.createElement(MenuItem$1, { onClick: () => handleTemplateFilter(false) }, "Apenas atividades")),
|
|
135216
|
-
canCreate && !props.hideAddFab && (React$1.createElement(QuotaGuard, { feature: "activities", behavior: "hide" },
|
|
135217
|
-
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar", onClick: fns.handleActivityAdd, sx: {
|
|
135218
|
-
position: "fixed",
|
|
135219
|
-
bottom: { xs: 16, sm: 24 },
|
|
135220
|
-
right: { xs: 16, sm: 24 },
|
|
135221
|
-
zIndex: theme.zIndex.speedDial,
|
|
135222
|
-
} },
|
|
135373
|
+
canCreate && !props.hideAddFab && data.activities.length > 0 && (React$1.createElement(QuotaGuard, { feature: "activities", behavior: "hide" },
|
|
135374
|
+
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar", onClick: fns.handleActivityAdd, sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.speedDial }) },
|
|
135223
135375
|
React$1.createElement(Add$1, null)))))));
|
|
135224
135376
|
};
|
|
135225
135377
|
|
|
@@ -142272,6 +142424,8 @@ const TicketVoucherPage = ({ isLoading, errorMessage, code, eventTitle, terreiro
|
|
|
142272
142424
|
|
|
142273
142425
|
const EventTicketingManagementPage = ({ eventName, shareUrl, terreiroShareUrl, published = false, publicTitle = "", maxTicketsPerEmail = 2, batches = [], holders = [], isSaving, saveError, checkInMessage, onSave, onExportCsv, onCheckIn, useChat = false, chat, canCheckIn = false, isCheckingIn = false, parseTicketQr, }) => {
|
|
142274
142426
|
var _a;
|
|
142427
|
+
const theme = useTheme$1();
|
|
142428
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
142275
142429
|
const [title, setTitle] = React$1.useState(publicTitle);
|
|
142276
142430
|
const [isPublished, setIsPublished] = React$1.useState(published);
|
|
142277
142431
|
const [emailLimit, setEmailLimit] = React$1.useState(maxTicketsPerEmail);
|
|
@@ -142346,17 +142500,24 @@ const EventTicketingManagementPage = ({ eventName, shareUrl, terreiroShareUrl, p
|
|
|
142346
142500
|
React$1.createElement(CardContent$1, null,
|
|
142347
142501
|
React$1.createElement(Stack$1, { spacing: 2 },
|
|
142348
142502
|
React$1.createElement(Typography$1, { variant: "h6" }, "Check-in na porta"),
|
|
142349
|
-
React$1.createElement(Stack$1, { direction: "row", spacing: 1 },
|
|
142503
|
+
React$1.createElement(Stack$1, { direction: isMobile ? "column" : "row", spacing: 1, alignItems: isMobile ? "stretch" : "center" },
|
|
142350
142504
|
React$1.createElement(TextField$1, { label: "Codigo do ingresso", value: checkInCode, onChange: (event) => setCheckInCode(event.target.value), inputProps: { "data-testid": "ticketing-checkin-code" } }),
|
|
142351
142505
|
React$1.createElement(Button$1, { variant: "contained", onClick: () => onCheckIn === null || onCheckIn === void 0 ? void 0 : onCheckIn(checkInCode), "data-testid": "ticketing-checkin-submit" }, "Validar"),
|
|
142352
142506
|
canCheckIn ? (React$1.createElement(Button$1, { variant: "outlined", onClick: () => setIsScannerOpen(true), "data-testid": "ticketing-checkin-scan" }, "Escanear QR")) : null),
|
|
142353
142507
|
checkInMessage ? React$1.createElement(Alert$1, { severity: "success" }, checkInMessage) : null))),
|
|
142354
142508
|
React$1.createElement(Card$1, null,
|
|
142355
142509
|
React$1.createElement(CardContent$1, null,
|
|
142356
|
-
React$1.createElement(Stack$1, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { mb: 2 } },
|
|
142510
|
+
React$1.createElement(Stack$1, { direction: isMobile ? "column" : "row", justifyContent: "space-between", alignItems: isMobile ? "flex-start" : "center", spacing: 1, sx: { mb: 2 } },
|
|
142357
142511
|
React$1.createElement(Typography$1, { variant: "h6" }, "Titulares"),
|
|
142358
142512
|
React$1.createElement(Button$1, { onClick: onExportCsv, "data-testid": "ticketing-export-csv" }, "Exportar CSV")),
|
|
142359
|
-
React$1.createElement(
|
|
142513
|
+
isMobile ? (React$1.createElement(Stack$1, { divider: React$1.createElement(Box$1, { sx: { borderBottom: 1, borderColor: "divider" } }) }, holders.map((holder) => (React$1.createElement(Box$1, { key: holder.code, sx: { py: 1.25 } },
|
|
142514
|
+
React$1.createElement(Typography$1, { fontWeight: 600 }, holder.holderName),
|
|
142515
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
142516
|
+
holder.status,
|
|
142517
|
+
holder.holderEmail ? ` · ${holder.holderEmail}` : ""),
|
|
142518
|
+
React$1.createElement(Typography$1, { variant: "caption", color: "text.secondary" },
|
|
142519
|
+
holder.code,
|
|
142520
|
+
holder.batchName ? ` · ${holder.batchName}` : "")))))) : (React$1.createElement(Table$1, { size: "small" },
|
|
142360
142521
|
React$1.createElement(TableHead$1, null,
|
|
142361
142522
|
React$1.createElement(TableRow$1, null,
|
|
142362
142523
|
React$1.createElement(TableCell$1, null, "Codigo"),
|
|
@@ -142369,7 +142530,7 @@ const EventTicketingManagementPage = ({ eventName, shareUrl, terreiroShareUrl, p
|
|
|
142369
142530
|
React$1.createElement(TableCell$1, null, holder.holderName),
|
|
142370
142531
|
React$1.createElement(TableCell$1, null, holder.holderEmail),
|
|
142371
142532
|
React$1.createElement(TableCell$1, null, holder.batchName),
|
|
142372
|
-
React$1.createElement(TableCell$1, null, holder.status)))))))),
|
|
142533
|
+
React$1.createElement(TableCell$1, null, holder.status))))))))),
|
|
142373
142534
|
React$1.createElement(Dialog$1, { open: isScannerOpen, onClose: () => setIsScannerOpen(false), fullWidth: true, maxWidth: "sm" },
|
|
142374
142535
|
React$1.createElement(DialogTitle$1, null, "Escanear ingresso"),
|
|
142375
142536
|
React$1.createElement(DialogContent$1, { dividers: true },
|
|
@@ -143242,9 +143403,25 @@ const EventCard = ({ event, isLast, onSelect, onEdit, getEventTypeLabel, theme }
|
|
|
143242
143403
|
event.insumos.count,
|
|
143243
143404
|
")"))))));
|
|
143244
143405
|
};
|
|
143406
|
+
const EventCompactRow = ({ event, isLast, onSelect, onEdit, getEventTypeLabel }) => {
|
|
143407
|
+
var _a, _b;
|
|
143408
|
+
const occurrence = (_b = (_a = event.occurrences) === null || _a === void 0 ? void 0 : _a.list) === null || _b === void 0 ? void 0 : _b[0];
|
|
143409
|
+
const dateParts = compactListDateParts(occurrence === null || occurrence === void 0 ? void 0 : occurrence.date);
|
|
143410
|
+
const dateTime = formatEventDateTime(event);
|
|
143411
|
+
const rawTitle = event.title || event.name || "Sem título";
|
|
143412
|
+
const meta = [
|
|
143413
|
+
dateTime.time,
|
|
143414
|
+
event.type ? getEventTypeLabel(event.type) : null,
|
|
143415
|
+
]
|
|
143416
|
+
.filter(Boolean)
|
|
143417
|
+
.join(" · ");
|
|
143418
|
+
return (React$1.createElement(CompactListRow, { title: rawTitle, meta: meta, isLast: isLast, onClick: () => onSelect(event.id), leading: dateParts ? (React$1.createElement(CompactListDateBlock, { day: dateParts.day, month: dateParts.month })) : (React$1.createElement(CalendarToday, { fontSize: "small", color: "action" })), trailing: onEdit ? (React$1.createElement(IconButton$1, { "aria-label": `Editar ${rawTitle}`, onClick: () => onEdit(event.id), sx: { width: 44, height: 44 } },
|
|
143419
|
+
React$1.createElement(ArrowForwardIos, { sx: { width: 16 } }))) : undefined }));
|
|
143420
|
+
};
|
|
143245
143421
|
const EventsPage = (props) => {
|
|
143246
143422
|
var _a;
|
|
143247
143423
|
const theme = useTheme$1();
|
|
143424
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
143248
143425
|
const { data, fns } = useEventsPage(props);
|
|
143249
143426
|
const periodInputValue = (_a = props.periodInputValue) !== null && _a !== void 0 ? _a : `${new Date().getFullYear()}-${String(new Date().getMonth() + 1).padStart(2, "0")}`;
|
|
143250
143427
|
// Memoized tab list for maintainability
|
|
@@ -143293,7 +143470,13 @@ const EventsPage = (props) => {
|
|
|
143293
143470
|
backgroundColor: theme.palette.background.default,
|
|
143294
143471
|
position: "relative",
|
|
143295
143472
|
} },
|
|
143296
|
-
React$1.createElement(PageHeader$2, { title: "Eventos", onBack: fns.handleBack, onAdd: fns.handleAddEvent, addLabel: "Adicionar", showAddButton: props.isAdmin,
|
|
143473
|
+
React$1.createElement(PageHeader$2, { title: "Eventos", onBack: fns.handleBack, onAdd: fns.handleAddEvent, addLabel: "Adicionar", showAddButton: props.isAdmin, hideAddButtonOnMobile: true, endAction: props.canExportParticipationReport &&
|
|
143474
|
+
props.onExportParticipationReport ? (React$1.createElement(IconButton$1, { "aria-label": "Exportar Participa\u00E7\u00E3o", onClick: props.onExportParticipationReport, disabled: props.isExportingParticipationReport, "data-testid": "events-export-participation-icon", sx: {
|
|
143475
|
+
display: { xs: "inline-flex", sm: "none" },
|
|
143476
|
+
width: 44,
|
|
143477
|
+
height: 44,
|
|
143478
|
+
} },
|
|
143479
|
+
React$1.createElement(Download, null))) : undefined, tabs: tabs.map((status) => ({
|
|
143297
143480
|
value: status,
|
|
143298
143481
|
label: data.getStatusLabel(status),
|
|
143299
143482
|
})), selectedTab: safeSelectedTab, onTabChange: (value) => fns.handleTabChange(value) }),
|
|
@@ -143309,7 +143492,7 @@ const EventsPage = (props) => {
|
|
|
143309
143492
|
React$1.createElement(Box$1, { sx: { width: { xs: "100%", sm: 260 } } },
|
|
143310
143493
|
React$1.createElement(LabeledMonthPicker, { label: "Per\u00EDodo", value: periodInputValue, onChange: (nextValue) => { var _a; return (_a = props.onPeriodInputChange) === null || _a === void 0 ? void 0 : _a.call(props, nextValue); }, "data-testid": "events-period-input" })),
|
|
143311
143494
|
props.canExportParticipationReport &&
|
|
143312
|
-
props.onExportParticipationReport && (React$1.createElement(Button$1, { variant: "outlined", startIcon: React$1.createElement(Download, null), onClick: props.onExportParticipationReport, disabled: props.isExportingParticipationReport, "data-testid": "events-export-participation-button" }, props.isExportingParticipationReport
|
|
143495
|
+
props.onExportParticipationReport && (React$1.createElement(Button$1, { variant: "outlined", startIcon: React$1.createElement(Download, null), onClick: props.onExportParticipationReport, disabled: props.isExportingParticipationReport, "data-testid": "events-export-participation-button", sx: { display: { xs: "none", sm: "inline-flex" } } }, props.isExportingParticipationReport
|
|
143313
143496
|
? "Exportando..."
|
|
143314
143497
|
: "Exportar Participação"))),
|
|
143315
143498
|
React$1.createElement(Box$1, { sx: Object.assign({ flex: 1, pb: LIST_CONTENT_BOTTOM_PADDING }, LIST_CARD_CONTENT_ROOT_SX) }, data.events.length === 0 ? (React$1.createElement(Box$1, { sx: {
|
|
@@ -143326,14 +143509,15 @@ const EventsPage = (props) => {
|
|
|
143326
143509
|
props.isAdmin && (React$1.createElement(React$1.Fragment, null,
|
|
143327
143510
|
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mb: SECTION_GAP } }, "Toque no bot\u00E3o + para criar um novo evento"),
|
|
143328
143511
|
React$1.createElement(QuotaGuard, { feature: "events", behavior: "disable" },
|
|
143329
|
-
React$1.createElement(Button$1, { variant: "contained", startIcon: React$1.createElement(Add$1, null), onClick: fns.handleAddEvent }, "Criar evento")))))) : (React$1.createElement(
|
|
143330
|
-
|
|
143331
|
-
|
|
143332
|
-
|
|
143333
|
-
|
|
143334
|
-
|
|
143335
|
-
|
|
143336
|
-
|
|
143512
|
+
React$1.createElement(Button$1, { variant: "contained", startIcon: React$1.createElement(Add$1, null), onClick: fns.handleAddEvent }, "Criar evento")))))) : (isMobile ? (React$1.createElement(Box$1, { sx: {
|
|
143513
|
+
bgcolor: "background.paper",
|
|
143514
|
+
borderRadius: RADIUS.default,
|
|
143515
|
+
border: 1,
|
|
143516
|
+
borderColor: "divider",
|
|
143517
|
+
overflow: "hidden",
|
|
143518
|
+
} }, data.events.map((event, index) => (React$1.createElement(EventCompactRow, { key: event.id, event: event, isLast: index === data.events.length - 1, onSelect: fns.handleEventSelect, onEdit: props.onEventEdit ? fns.handleEventEdit : undefined, getEventTypeLabel: data.getEventTypeLabel }))))) : (React$1.createElement(Stack$1, { spacing: LIST_GAP }, data.events.map((event, index) => (React$1.createElement(EventCard, { key: event.id, event: event, isLast: index === data.events.length - 1, onSelect: fns.handleEventSelect, onEdit: fns.handleEventEdit, getEventTypeLabel: data.getEventTypeLabel, getStatusLabel: data.getStatusLabel, theme: theme }))))))),
|
|
143519
|
+
props.isAdmin && !props.hideAddFab && data.events.length > 0 && (React$1.createElement(QuotaGuard, { feature: "events", behavior: "hide" },
|
|
143520
|
+
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar evento", onClick: fns.handleAddEvent, sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.speedDial }) },
|
|
143337
143521
|
React$1.createElement(Add$1, null)))))));
|
|
143338
143522
|
};
|
|
143339
143523
|
|
|
@@ -144382,9 +144566,9 @@ const FinancialAccountsList = (props) => {
|
|
|
144382
144566
|
minHeight: "100vh",
|
|
144383
144567
|
backgroundColor: theme.palette.background.default,
|
|
144384
144568
|
position: "relative",
|
|
144385
|
-
pb:
|
|
144569
|
+
pb: 0,
|
|
144386
144570
|
} },
|
|
144387
|
-
React$1.createElement(PageHeader$2, { title: "Financeiro", onBack: props.onBack, onAdd: props.onAddAccount, addLabel: "Adicionar", showAddButton: true }),
|
|
144571
|
+
React$1.createElement(PageHeader$2, { title: "Financeiro", onBack: props.onBack, onAdd: props.onAddAccount, addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
|
|
144388
144572
|
React$1.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
|
|
144389
144573
|
showPeriodFilter && (React$1.createElement(Stack$1, { direction: { xs: "column", sm: "row" }, spacing: SECTION_GAP, alignItems: { xs: "flex-start", sm: "center" }, justifyContent: "space-between", sx: { pb: LIST_CONTROLS_MARGIN_BOTTOM } },
|
|
144390
144574
|
React$1.createElement(Stack$1, { spacing: 0.5 },
|
|
@@ -144426,12 +144610,7 @@ const FinancialAccountsList = (props) => {
|
|
|
144426
144610
|
} },
|
|
144427
144611
|
isEmpty && (React$1.createElement(EmptyState$2, { onAddAccount: props.onAddAccount, theme: theme })),
|
|
144428
144612
|
!isEmpty && accountsList)),
|
|
144429
|
-
isMobile && (React$1.createElement(Fab$1, { "data-testid": "financial-account-fab-add", color: "primary", "aria-label": "Adicionar Conta", onClick: props.onAddAccount, sx: {
|
|
144430
|
-
position: "fixed",
|
|
144431
|
-
bottom: 16,
|
|
144432
|
-
right: 16,
|
|
144433
|
-
zIndex: theme.zIndex.fab,
|
|
144434
|
-
} },
|
|
144613
|
+
isMobile && !isEmpty && (React$1.createElement(Fab$1, { "data-testid": "financial-account-fab-add", color: "primary", "aria-label": "Adicionar Conta", onClick: props.onAddAccount, sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.fab }) },
|
|
144435
144614
|
React$1.createElement(Add$1, null))))));
|
|
144436
144615
|
};
|
|
144437
144616
|
var FinancialAccountsList$1 = React$1.memo(FinancialAccountsList);
|
|
@@ -146073,11 +146252,11 @@ const IncomeListItem = React$1.memo(function IncomeListItem({ item, idx, isLastI
|
|
|
146073
146252
|
React$1.createElement(ListItemSecondaryAction$1, null,
|
|
146074
146253
|
React$1.createElement(Stack$1, { spacing: 1, alignItems: "flex-end" },
|
|
146075
146254
|
React$1.createElement(Typography$1, { variant: "subtitle1", sx: { fontWeight: 600 } }, formattedAmount),
|
|
146076
|
-
canConfirmTransactions && item.id && onToggleSettlementStatus ? (React$1.createElement(
|
|
146255
|
+
canConfirmTransactions && item.id && onToggleSettlementStatus ? (React$1.createElement(IconButton$1, { "aria-label": settlementActionLabel, disabled: Boolean(isUpdatingSettlementStatus), onClick: (event) => {
|
|
146077
146256
|
event.stopPropagation();
|
|
146078
146257
|
item.id &&
|
|
146079
146258
|
onToggleSettlementStatus(item.id, nextSettlementStatus);
|
|
146080
|
-
} },
|
|
146259
|
+
}, sx: { width: 44, height: 44 } }, settlementStatus === "PROJECTED" ? React$1.createElement(Check$1, null) : React$1.createElement(UndoIcon, null))) : null))),
|
|
146081
146260
|
!isLastItem && React$1.createElement(Divider$1, { component: "li", variant: "inset" })));
|
|
146082
146261
|
});
|
|
146083
146262
|
const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue, periodInputMin, periodInputMax, showPeriodFilter, onPeriodInputChange, onResetToCurrentPeriod, canConfirmTransactions, isUpdatingSettlementStatus, onToggleSettlementStatus, data, }) => {
|
|
@@ -146114,14 +146293,18 @@ const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue
|
|
|
146114
146293
|
*
|
|
146115
146294
|
* These numbers are numeric pixel values used for paddingTop on the scrollable container.
|
|
146116
146295
|
*/
|
|
146117
|
-
const headerHeight =
|
|
146296
|
+
const headerHeight = 80;
|
|
146118
146297
|
const shouldShowPeriodFilter = showPeriodFilter !== null && showPeriodFilter !== void 0 ? showPeriodFilter : Boolean(periodLabel ||
|
|
146119
146298
|
periodInputValue ||
|
|
146120
146299
|
onPeriodInputChange ||
|
|
146121
146300
|
onResetToCurrentPeriod);
|
|
146122
|
-
const filterHeight = shouldShowPeriodFilter ?
|
|
146123
|
-
const cardHeight =
|
|
146124
|
-
const contentOffset = filterHeight + cardHeight + 16;
|
|
146301
|
+
const filterHeight = shouldShowPeriodFilter ? 72 : 0;
|
|
146302
|
+
const cardHeight = 96;
|
|
146303
|
+
const contentOffset = isMobile ? 0 : filterHeight + cardHeight + 16;
|
|
146304
|
+
const amountLabel = totalAmountNumber.toLocaleString("pt-BR", {
|
|
146305
|
+
style: "currency",
|
|
146306
|
+
currency: "BRL",
|
|
146307
|
+
});
|
|
146125
146308
|
const incomes = React$1.useMemo(() => (Array.isArray(dataSource.incomes) ? dataSource.incomes : []), [dataSource.incomes]);
|
|
146126
146309
|
return (React$1.createElement(Box$1, { sx: {
|
|
146127
146310
|
display: "flex",
|
|
@@ -146131,8 +146314,10 @@ const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue
|
|
|
146131
146314
|
position: "relative",
|
|
146132
146315
|
//pb: isMobile ? 2 : 0,
|
|
146133
146316
|
} },
|
|
146134
|
-
React$1.createElement(PageHeader$2, { title: "Entradas", onBack: onBack, onAdd: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), addLabel: "Adicionar", showAddButton: true }),
|
|
146135
|
-
React$1.createElement(
|
|
146317
|
+
React$1.createElement(PageHeader$2, { title: "Entradas", onBack: onBack, onAdd: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
|
|
146318
|
+
isMobile && shouldShowPeriodFilter ? (React$1.createElement(Container$1, { maxWidth: "md", sx: { px: PAGE_LIST_CONTAINER_SPACING.px, pt: 1 } },
|
|
146319
|
+
React$1.createElement(FinanceMobilePeriodBar, { periodLabel: periodLabel || metricPeriodLabel, amountLabel: amountLabel, periodInputValue: periodInputValue, periodInputMin: periodInputMin, periodInputMax: periodInputMax, onPeriodInputChange: onPeriodInputChange, onResetToCurrentPeriod: onResetToCurrentPeriod, testIdPrefix: "income" }))) : null,
|
|
146320
|
+
!isMobile && (React$1.createElement(Box$1, { component: "section", "aria-hidden": true, sx: {
|
|
146136
146321
|
position: "fixed",
|
|
146137
146322
|
left: 0,
|
|
146138
146323
|
right: 0,
|
|
@@ -146169,10 +146354,10 @@ const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue
|
|
|
146169
146354
|
style: "currency",
|
|
146170
146355
|
currency: "BRL",
|
|
146171
146356
|
})
|
|
146172
|
-
: `R$: ${amount}` })))),
|
|
146357
|
+
: `R$: ${amount}` }))))),
|
|
146173
146358
|
React$1.createElement(Container$1, { maxWidth: "md", sx: Object.assign(Object.assign({}, PAGE_LIST_CONTAINER_SPACING), {
|
|
146174
146359
|
// push content below the fixed header + card
|
|
146175
|
-
paddingTop: `${contentOffset}px`,
|
|
146360
|
+
paddingTop: isMobile ? undefined : `${contentOffset}px`, pb: LIST_CONTENT_BOTTOM_PADDING,
|
|
146176
146361
|
// ensure content can scroll beneath fixed card
|
|
146177
146362
|
position: "relative", zIndex: 0 }) },
|
|
146178
146363
|
incomes.length === 0 ? (React$1.createElement(Box$1, { sx: {
|
|
@@ -146196,13 +146381,8 @@ const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue
|
|
|
146196
146381
|
var _a, _b;
|
|
146197
146382
|
return (React$1.createElement(IncomeListItem, { key: `${(_a = inc.date) !== null && _a !== void 0 ? _a : ""}-${idx}-${(_b = inc.amount) !== null && _b !== void 0 ? _b : ""}`, item: inc, idx: idx, isLastItem: idx === incomes.length - 1, formatCurrency: formatCurrency, formatDate: formatDate, getAccountName: getAccountName, onSelect: onSelect, canConfirmTransactions: canConfirmTransactions, isUpdatingSettlementStatus: isUpdatingSettlementStatus, onToggleSettlementStatus: onToggleSettlementStatus }));
|
|
146198
146383
|
}))),
|
|
146199
|
-
isMobile && (React$1.createElement(QuotaGuard, { feature: "incomes", behavior: "hide" },
|
|
146200
|
-
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar Entrada", title: "Adicionar Entrada", onClick: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), sx: {
|
|
146201
|
-
position: "fixed",
|
|
146202
|
-
bottom: 16,
|
|
146203
|
-
right: 16,
|
|
146204
|
-
zIndex: theme.zIndex.fab,
|
|
146205
|
-
} },
|
|
146384
|
+
isMobile && incomes.length > 0 && (React$1.createElement(QuotaGuard, { feature: "incomes", behavior: "hide" },
|
|
146385
|
+
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar Entrada", title: "Adicionar Entrada", onClick: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.fab }) },
|
|
146206
146386
|
React$1.createElement(Add$1, null)))))));
|
|
146207
146387
|
};
|
|
146208
146388
|
var IncomeListPage$1 = React$1.memo(IncomeListPage);
|
|
@@ -146697,12 +146877,12 @@ const OutcomeListItem = React$1.memo(function OutcomeListItem({ item, idx, isLas
|
|
|
146697
146877
|
React$1.createElement(ListItemSecondaryAction$1, null,
|
|
146698
146878
|
React$1.createElement(Stack$1, { spacing: 1, alignItems: "flex-end" },
|
|
146699
146879
|
React$1.createElement(Typography$1, { variant: "subtitle1", sx: { fontWeight: 600 } }, formattedAmount),
|
|
146700
|
-
canConfirmTransactions && item.id && onToggleSettlementStatus ? (React$1.createElement(
|
|
146880
|
+
canConfirmTransactions && item.id && onToggleSettlementStatus ? (React$1.createElement(IconButton$1, { "aria-label": settlementActionLabel, disabled: Boolean(isUpdatingSettlementStatus), onClick: (event) => {
|
|
146701
146881
|
event.stopPropagation();
|
|
146702
146882
|
if (!item.id)
|
|
146703
146883
|
return;
|
|
146704
146884
|
onToggleSettlementStatus(item.id, nextSettlementStatus);
|
|
146705
|
-
} },
|
|
146885
|
+
}, sx: { width: 44, height: 44 } }, settlementStatus === "PROJECTED" ? React$1.createElement(Check$1, null) : React$1.createElement(UndoIcon, null))) : null))),
|
|
146706
146886
|
!isLastItem && React$1.createElement(Divider$1, { component: "li" })));
|
|
146707
146887
|
});
|
|
146708
146888
|
const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValue, periodInputMin, periodInputMax, showPeriodFilter, onPeriodInputChange, onResetToCurrentPeriod, canConfirmTransactions, isUpdatingSettlementStatus, onToggleSettlementStatus, data, }) => {
|
|
@@ -146725,14 +146905,18 @@ const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValu
|
|
|
146725
146905
|
*
|
|
146726
146906
|
* These numbers are numeric pixel values used for paddingTop on the scrollable container.
|
|
146727
146907
|
*/
|
|
146728
|
-
const headerHeight =
|
|
146908
|
+
const headerHeight = 64;
|
|
146729
146909
|
const shouldShowPeriodFilter = showPeriodFilter !== null && showPeriodFilter !== void 0 ? showPeriodFilter : Boolean(periodLabel ||
|
|
146730
146910
|
periodInputValue ||
|
|
146731
146911
|
onPeriodInputChange ||
|
|
146732
146912
|
onResetToCurrentPeriod);
|
|
146733
|
-
const filterHeight = shouldShowPeriodFilter ?
|
|
146734
|
-
const cardHeight =
|
|
146735
|
-
const contentOffset = filterHeight + cardHeight + 16;
|
|
146913
|
+
const filterHeight = shouldShowPeriodFilter ? 72 : 0;
|
|
146914
|
+
const cardHeight = 96;
|
|
146915
|
+
const contentOffset = isMobile ? 0 : filterHeight + cardHeight + 16;
|
|
146916
|
+
const amountLabel = totalAmount.toLocaleString("pt-BR", {
|
|
146917
|
+
style: "currency",
|
|
146918
|
+
currency: "BRL",
|
|
146919
|
+
});
|
|
146736
146920
|
const outcomes = React$1.useMemo(() => (Array.isArray(dataSource.outcomes) ? dataSource.outcomes : []), [dataSource.outcomes]);
|
|
146737
146921
|
return (React$1.createElement(Box$1, { sx: {
|
|
146738
146922
|
display: "flex",
|
|
@@ -146740,10 +146924,12 @@ const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValu
|
|
|
146740
146924
|
minHeight: "100vh",
|
|
146741
146925
|
backgroundColor: theme.palette.background.default,
|
|
146742
146926
|
position: "relative",
|
|
146743
|
-
pb:
|
|
146927
|
+
pb: 0,
|
|
146744
146928
|
} },
|
|
146745
|
-
React$1.createElement(PageHeader$2, { title: "Sa\u00EDdas", onBack: onBack, onAdd: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), addLabel: "Adicionar", showAddButton: true }),
|
|
146746
|
-
React$1.createElement(
|
|
146929
|
+
React$1.createElement(PageHeader$2, { title: "Sa\u00EDdas", onBack: onBack, onAdd: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
|
|
146930
|
+
isMobile && shouldShowPeriodFilter ? (React$1.createElement(Container$1, { maxWidth: "md", sx: { px: PAGE_LIST_CONTAINER_SPACING.px, pt: 1 } },
|
|
146931
|
+
React$1.createElement(FinanceMobilePeriodBar, { periodLabel: periodLabel || "-", amountLabel: amountLabel, periodInputValue: periodInputValue, periodInputMin: periodInputMin, periodInputMax: periodInputMax, onPeriodInputChange: onPeriodInputChange, onResetToCurrentPeriod: onResetToCurrentPeriod, testIdPrefix: "outcome" }))) : null,
|
|
146932
|
+
!isMobile && (React$1.createElement(Box$1, { component: "section", "aria-hidden": true, sx: {
|
|
146747
146933
|
position: "fixed",
|
|
146748
146934
|
left: 0,
|
|
146749
146935
|
right: 0,
|
|
@@ -146779,10 +146965,10 @@ const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValu
|
|
|
146779
146965
|
style: "currency",
|
|
146780
146966
|
currency: "BRL",
|
|
146781
146967
|
})
|
|
146782
|
-
: `R$: ${amount}` })))),
|
|
146968
|
+
: `R$: ${amount}` }))))),
|
|
146783
146969
|
React$1.createElement(Container$1, { maxWidth: "md", sx: Object.assign(Object.assign({}, PAGE_LIST_CONTAINER_SPACING), {
|
|
146784
146970
|
// push content below the fixed header + card
|
|
146785
|
-
paddingTop: `${contentOffset}px`,
|
|
146971
|
+
paddingTop: isMobile ? undefined : `${contentOffset}px`, pb: LIST_CONTENT_BOTTOM_PADDING,
|
|
146786
146972
|
// ensure content can scroll beneath fixed card
|
|
146787
146973
|
position: "relative", zIndex: 0 }) },
|
|
146788
146974
|
outcomes.length === 0 ? (React$1.createElement(Box$1, { sx: {
|
|
@@ -146806,13 +146992,8 @@ const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValu
|
|
|
146806
146992
|
var _a, _b;
|
|
146807
146993
|
return (React$1.createElement(OutcomeListItem, { key: `${(_a = out.date) !== null && _a !== void 0 ? _a : ""}-${idx}-${(_b = out.amount) !== null && _b !== void 0 ? _b : ""}`, item: out, idx: idx, isLastItem: idx === outcomes.length - 1, formatCurrency: formatCurrency, formatDate: formatDate, getAccountName: getAccountName, onSelect: onSelect, canConfirmTransactions: canConfirmTransactions, isUpdatingSettlementStatus: isUpdatingSettlementStatus, onToggleSettlementStatus: onToggleSettlementStatus }));
|
|
146808
146994
|
}))),
|
|
146809
|
-
isMobile && (React$1.createElement(QuotaGuard, { feature: "outcomes", behavior: "hide" },
|
|
146810
|
-
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar Sa\u00EDda", title: "Adicionar Sa\u00EDda", onClick: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), sx: {
|
|
146811
|
-
position: "fixed",
|
|
146812
|
-
bottom: 16,
|
|
146813
|
-
right: 16,
|
|
146814
|
-
zIndex: theme.zIndex.fab,
|
|
146815
|
-
} },
|
|
146995
|
+
isMobile && outcomes.length > 0 && (React$1.createElement(QuotaGuard, { feature: "outcomes", behavior: "hide" },
|
|
146996
|
+
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar Sa\u00EDda", title: "Adicionar Sa\u00EDda", onClick: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.fab }) },
|
|
146816
146997
|
React$1.createElement(Add$1, null)))))));
|
|
146817
146998
|
};
|
|
146818
146999
|
var OutcomeListPage$1 = React$1.memo(OutcomeListPage);
|
|
@@ -156886,24 +157067,23 @@ const AttendanceInsightsMobileList = ({ mediums }) => {
|
|
|
156886
157067
|
return (React$1.createElement(Stack$1, { spacing: LIST_GAP }, mediums.map((medium) => {
|
|
156887
157068
|
var _a;
|
|
156888
157069
|
return (React$1.createElement(Paper$1, { key: medium.mediumId, variant: "outlined", sx: LIST_CARD_CONTENT_SX },
|
|
156889
|
-
React$1.createElement(Stack$1, { spacing: LIST_GAP },
|
|
156890
|
-
React$1.createElement(
|
|
156891
|
-
|
|
156892
|
-
React$1.createElement(Typography$1, { fontWeight: 600, noWrap: true }, medium.mediumName)
|
|
156893
|
-
|
|
156894
|
-
|
|
156895
|
-
|
|
156896
|
-
|
|
156897
|
-
|
|
156898
|
-
|
|
156899
|
-
|
|
156900
|
-
"
|
|
156901
|
-
medium.
|
|
156902
|
-
"
|
|
157070
|
+
React$1.createElement(Stack$1, { direction: "row", spacing: LIST_GAP, alignItems: "center" },
|
|
157071
|
+
React$1.createElement(Avatar$1, { src: (_a = medium.mediumAvatarUrl) !== null && _a !== void 0 ? _a : undefined, alt: medium.mediumName, sx: { width: 32, height: 32 } }, medium.mediumName.charAt(0).toUpperCase()),
|
|
157072
|
+
React$1.createElement(Stack$1, { sx: { minWidth: 0 } },
|
|
157073
|
+
React$1.createElement(Typography$1, { fontWeight: 600, noWrap: true }, medium.mediumName),
|
|
157074
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
157075
|
+
medium.invites,
|
|
157076
|
+
" conv. \u00B7 ",
|
|
157077
|
+
medium.confirmed,
|
|
157078
|
+
" conf."),
|
|
157079
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
157080
|
+
medium.present,
|
|
157081
|
+
" pres. \u00B7 ",
|
|
157082
|
+
medium.absent,
|
|
157083
|
+
" aus. \u00B7",
|
|
156903
157084
|
" ",
|
|
156904
157085
|
medium.presenceRate,
|
|
156905
|
-
"%
|
|
156906
|
-
medium.absenceGap)))));
|
|
157086
|
+
"%")))));
|
|
156907
157087
|
})));
|
|
156908
157088
|
};
|
|
156909
157089
|
|
|
@@ -158457,9 +158637,19 @@ const sortOptions = [
|
|
|
158457
158637
|
{ value: "createdAt_desc", label: "Mais recentes" },
|
|
158458
158638
|
{ value: "createdAt_asc", label: "Mais antigos" },
|
|
158459
158639
|
];
|
|
158640
|
+
const InventoryCompactRow = ({ item, isLast, onSelect }) => {
|
|
158641
|
+
var _a, _b, _c, _d;
|
|
158642
|
+
const statusLabel = (_a = statusMap[item.status]) === null || _a === void 0 ? void 0 : _a.label;
|
|
158643
|
+
const meta = [item.location, statusLabel].filter(Boolean).join(" · ");
|
|
158644
|
+
return (React$1.createElement(CompactListRow, { title: item.name, meta: meta || undefined, isLast: isLast, testId: `inventory-item-${item.id}`, onClick: () => onSelect(item.id), leading: React$1.createElement(Avatar$1, { src: (_b = item.imageUrl) !== null && _b !== void 0 ? _b : undefined, alt: "", sx: { width: 40, height: 40 } }, ((_d = (_c = item.name) === null || _c === void 0 ? void 0 : _c.charAt(0)) !== null && _d !== void 0 ? _d : "").toUpperCase()), trailing: React$1.createElement(Typography$1, { variant: "body2", fontWeight: 600, sx: { whiteSpace: "nowrap" } },
|
|
158645
|
+
item.quantity,
|
|
158646
|
+
" ",
|
|
158647
|
+
item.unit) }));
|
|
158648
|
+
};
|
|
158460
158649
|
// --- Main Inventory List Page ---
|
|
158461
158650
|
const InventoryListPage = (props) => {
|
|
158462
158651
|
const theme = useTheme$1();
|
|
158652
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
158463
158653
|
const { data, fns } = useInventoryListPage(props);
|
|
158464
158654
|
const drawerValue = {
|
|
158465
158655
|
status: data.selectedStatus,
|
|
@@ -158483,7 +158673,7 @@ const InventoryListPage = (props) => {
|
|
|
158483
158673
|
backgroundColor: theme.palette.background.default,
|
|
158484
158674
|
position: "relative",
|
|
158485
158675
|
}, "data-testid": "inventory-list-page", "data-cy": "inventory-list-page" },
|
|
158486
|
-
React$1.createElement(PageHeader$2, { title: "Invent\u00E1rio", onBack: fns.handleBack, showAddButton: data.canAdd, onAdd: data.canAdd ? fns.handleAddItem : undefined, addLabel: "Adicionar" }),
|
|
158676
|
+
React$1.createElement(PageHeader$2, { title: "Invent\u00E1rio", onBack: fns.handleBack, showAddButton: data.canAdd, hideAddButtonOnMobile: true, onAdd: data.canAdd ? fns.handleAddItem : undefined, addLabel: "Adicionar" }),
|
|
158487
158677
|
React$1.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
|
|
158488
158678
|
React$1.createElement(Box$1, { sx: {
|
|
158489
158679
|
display: "flex",
|
|
@@ -158525,8 +158715,13 @@ const InventoryListPage = (props) => {
|
|
|
158525
158715
|
pb: LIST_CONTENT_BOTTOM_PADDING,
|
|
158526
158716
|
}, "data-testid": "inventory-list-content", "data-cy": "inventory-list-content" }, data.items.length === 0 ? (React$1.createElement(InventoryEmptyState, { hasActiveFilters: data.hasActiveFilters, onClearFilters: data.hasActiveFilters ? fns.handleClearFilters : undefined, onAdd: data.canAdd && !data.hasActiveFilters
|
|
158527
158717
|
? fns.handleAddItem
|
|
158528
|
-
: undefined })) : (React$1.createElement(Fade$1, { in: true },
|
|
158529
|
-
|
|
158718
|
+
: undefined })) : (React$1.createElement(Fade$1, { in: true }, isMobile ? (React$1.createElement(Box$1, { sx: {
|
|
158719
|
+
bgcolor: "background.paper",
|
|
158720
|
+
borderRadius: RADIUS.default,
|
|
158721
|
+
border: 1,
|
|
158722
|
+
borderColor: "divider",
|
|
158723
|
+
overflow: "hidden",
|
|
158724
|
+
} }, data.items.map((item, index) => (React$1.createElement(InventoryCompactRow, { key: item.id, item: item, isLast: index === data.items.length - 1, onSelect: fns.handleItemSelect }))))) : (React$1.createElement(Stack$1, { spacing: LIST_GAP }, data.items.map((item, index) => (React$1.createElement(InventoryItemCard, { key: item.id, item: item, isLast: index === data.items.length - 1, onSelect: fns.handleItemSelect, onEdit: fns.handleItemEdit }))))))))),
|
|
158530
158725
|
React$1.createElement(FilterDrawer, { open: data.isFilterDrawerOpen, onClose: fns.handleCloseFilterDrawer, onOpen: fns.handleToggleFilterDrawer, value: drawerValue, emptyValue: {
|
|
158531
158726
|
status: "all",
|
|
158532
158727
|
createdAtSort: data.createdAtSort,
|
|
@@ -158540,7 +158735,9 @@ const InventoryListPage = (props) => {
|
|
|
158540
158735
|
React$1.createElement(FormControl$1, { fullWidth: true, size: "small" },
|
|
158541
158736
|
React$1.createElement(InputLabel$1, { id: "inventory-filter-sort-label" }, "Ordena\u00E7\u00E3o"),
|
|
158542
158737
|
React$1.createElement(Select$1, { labelId: "inventory-filter-sort-label", value: draft.createdAtSort, label: "Ordena\u00E7\u00E3o", onChange: (event) => setDraft(Object.assign(Object.assign({}, draft), { createdAtSort: event.target
|
|
158543
|
-
.value })), inputProps: { "data-testid": "inventory-created-at-sort" } }, sortOptions.map((option) => (React$1.createElement(MenuItem$1, { key: option.value, value: option.value }, option.label))))))))
|
|
158738
|
+
.value })), inputProps: { "data-testid": "inventory-created-at-sort" } }, sortOptions.map((option) => (React$1.createElement(MenuItem$1, { key: option.value, value: option.value }, option.label)))))))),
|
|
158739
|
+
data.canAdd && data.items.length > 0 && (React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar item", onClick: fns.handleAddItem, sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.speedDial }) },
|
|
158740
|
+
React$1.createElement(Add$1, null)))));
|
|
158544
158741
|
};
|
|
158545
158742
|
|
|
158546
158743
|
const DetailSectionCard = ({ icon, title, children, theme, }) => {
|
|
@@ -162018,7 +162215,7 @@ objectType({
|
|
|
162018
162215
|
const STATUS_TAB_LABELS = {
|
|
162019
162216
|
ALL: "Todos",
|
|
162020
162217
|
ACTIVE: "Ativos",
|
|
162021
|
-
WAITING_APPROVAL: "Aguardando",
|
|
162218
|
+
WAITING_APPROVAL: "Aguardando aprovação",
|
|
162022
162219
|
INACTIVE: "Inativos",
|
|
162023
162220
|
OTHER: "Outros",
|
|
162024
162221
|
};
|
|
@@ -162358,7 +162555,6 @@ const MediumListItem = ({ medium, onSelect, theme }) => {
|
|
|
162358
162555
|
const MediumListPage = (props) => {
|
|
162359
162556
|
var _a;
|
|
162360
162557
|
const theme = useTheme$1();
|
|
162361
|
-
const isCompactScreen = useMediaQuery(theme.breakpoints.down("sm"));
|
|
162362
162558
|
const { data, fns } = useMediumListPage(props);
|
|
162363
162559
|
// Sort menu state
|
|
162364
162560
|
const [sortAnchorEl, setSortAnchorEl] = React$1.useState(null);
|
|
@@ -162375,17 +162571,12 @@ const MediumListPage = (props) => {
|
|
|
162375
162571
|
};
|
|
162376
162572
|
// Status tabs for PageHeader
|
|
162377
162573
|
const statusTabs = data.showStatusTabs
|
|
162378
|
-
? data.statusTabs.map((tab) => {
|
|
162379
|
-
|
|
162380
|
-
|
|
162381
|
-
|
|
162382
|
-
|
|
162383
|
-
|
|
162384
|
-
label: tab.value === "WAITING_APPROVAL" && tab.count > 0
|
|
162385
|
-
? `${compactLabel} (${tab.count})`
|
|
162386
|
-
: compactLabel,
|
|
162387
|
-
};
|
|
162388
|
-
})
|
|
162574
|
+
? data.statusTabs.map((tab) => ({
|
|
162575
|
+
value: tab.value,
|
|
162576
|
+
label: tab.value === "WAITING_APPROVAL" && tab.count > 0
|
|
162577
|
+
? `${tab.label} (${tab.count})`
|
|
162578
|
+
: tab.label,
|
|
162579
|
+
}))
|
|
162389
162580
|
: undefined;
|
|
162390
162581
|
// Guard clause for loading state - show skeleton
|
|
162391
162582
|
if (data.isLoading) {
|
|
@@ -162395,7 +162586,7 @@ const MediumListPage = (props) => {
|
|
|
162395
162586
|
minHeight: "100vh",
|
|
162396
162587
|
backgroundColor: theme.palette.background.default,
|
|
162397
162588
|
} },
|
|
162398
|
-
React$1.createElement(PageHeader$2, { title: "M\u00E9diuns", onBack: fns.handleBack, onAdd: fns.handleAddMedium, addLabel: "Adicionar", showAddButton: true }),
|
|
162589
|
+
React$1.createElement(PageHeader$2, { title: "M\u00E9diuns", onBack: fns.handleBack, onAdd: fns.handleAddMedium, addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
|
|
162399
162590
|
React$1.createElement(MediumListSkeleton, { count: 6 })));
|
|
162400
162591
|
}
|
|
162401
162592
|
return (React$1.createElement(Box$1, { sx: {
|
|
@@ -162404,12 +162595,12 @@ const MediumListPage = (props) => {
|
|
|
162404
162595
|
minHeight: "100vh",
|
|
162405
162596
|
backgroundColor: theme.palette.background.default,
|
|
162406
162597
|
} },
|
|
162407
|
-
React$1.createElement(PageHeader$2, { title: "M\u00E9diuns", onBack: fns.handleBack, onAdd: fns.handleAddMedium, addLabel: "Adicionar", showAddButton: true, tabs: statusTabs, selectedTab: data.selectedStatusTab, onTabChange: (value) => fns.handleStatusTabChange(value) }),
|
|
162598
|
+
React$1.createElement(PageHeader$2, { title: "M\u00E9diuns", onBack: fns.handleBack, onAdd: fns.handleAddMedium, addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true, tabs: statusTabs, selectedTab: data.selectedStatusTab, onTabChange: (value) => fns.handleStatusTabChange(value) }),
|
|
162408
162599
|
React$1.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
|
|
162409
162600
|
data.showSearch && (React$1.createElement(Box$1, { sx: {
|
|
162410
162601
|
display: "flex",
|
|
162411
|
-
flexDirection:
|
|
162412
|
-
alignItems: "
|
|
162602
|
+
flexDirection: "row",
|
|
162603
|
+
alignItems: "center",
|
|
162413
162604
|
gap: 1,
|
|
162414
162605
|
mb: 2,
|
|
162415
162606
|
} },
|
|
@@ -162422,7 +162613,7 @@ const MediumListPage = (props) => {
|
|
|
162422
162613
|
"aria-label": "Buscar médium",
|
|
162423
162614
|
sx: {
|
|
162424
162615
|
borderRadius: RADIUS.default,
|
|
162425
|
-
minHeight:
|
|
162616
|
+
minHeight: 44,
|
|
162426
162617
|
backgroundColor: theme.palette.background.paper,
|
|
162427
162618
|
"& .MuiInputBase-input": {
|
|
162428
162619
|
fontSize: { xs: "0.9rem", sm: "1rem" },
|
|
@@ -162433,9 +162624,9 @@ const MediumListPage = (props) => {
|
|
|
162433
162624
|
},
|
|
162434
162625
|
} }),
|
|
162435
162626
|
data.showSort && (React$1.createElement(IconButton$1, { onClick: handleSortMenuOpen, sx: {
|
|
162436
|
-
|
|
162437
|
-
width:
|
|
162438
|
-
height:
|
|
162627
|
+
flexShrink: 0,
|
|
162628
|
+
width: 44,
|
|
162629
|
+
height: 44,
|
|
162439
162630
|
backgroundColor: theme.palette.background.paper,
|
|
162440
162631
|
borderRadius: RADIUS.default,
|
|
162441
162632
|
border: `1px solid ${theme.palette.divider}`,
|
|
@@ -162510,19 +162701,9 @@ const MediumListPage = (props) => {
|
|
|
162510
162701
|
vertical: "top",
|
|
162511
162702
|
horizontal: "right",
|
|
162512
162703
|
} }, data.sortOptions.map((option) => (React$1.createElement(MenuItem$1, { key: option.value, onClick: () => handleSortSelect(option.value), selected: option.value === data.sortOption }, option.label)))),
|
|
162513
|
-
React$1.createElement(QuotaGuard, { feature: "mediums", behavior: "hide" },
|
|
162514
|
-
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar", onClick: fns.handleAddMedium, sx: {
|
|
162515
|
-
|
|
162516
|
-
position: "fixed",
|
|
162517
|
-
bottom: {
|
|
162518
|
-
xs: "calc(16px + env(safe-area-inset-bottom, 0px))",
|
|
162519
|
-
sm: 24,
|
|
162520
|
-
md: 32,
|
|
162521
|
-
},
|
|
162522
|
-
right: { xs: 16, sm: 24, md: 32 },
|
|
162523
|
-
boxShadow: 6,
|
|
162524
|
-
} },
|
|
162525
|
-
React$1.createElement(BarcodeIcon, null))))));
|
|
162704
|
+
data.filteredMediums.length > 0 && (React$1.createElement(QuotaGuard, { feature: "mediums", behavior: "hide" },
|
|
162705
|
+
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar", onClick: fns.handleAddMedium, sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.speedDial }) },
|
|
162706
|
+
React$1.createElement(BarcodeIcon, null)))))));
|
|
162526
162707
|
};
|
|
162527
162708
|
|
|
162528
162709
|
const sanitizeBirthDate = (date) => {
|
|
@@ -173804,9 +173985,19 @@ const transformToRitual = (bath, originLabel, statusLabel) => {
|
|
|
173804
173985
|
scheduledCount: (_d = bath.scheduledCount) !== null && _d !== void 0 ? _d : 0,
|
|
173805
173986
|
};
|
|
173806
173987
|
};
|
|
173988
|
+
const RitualBathCompactRow = ({ bath, isLast, originLabel, statusLabel, onSelect, onSchedule }) => {
|
|
173989
|
+
var _a, _b;
|
|
173990
|
+
const meta = [(_a = bath.category) === null || _a === void 0 ? void 0 : _a.name, originLabel, statusLabel]
|
|
173991
|
+
.filter(Boolean)
|
|
173992
|
+
.join(" · ");
|
|
173993
|
+
return (React$1.createElement(CompactListRow, { title: bath.title, meta: meta, isLast: isLast, onClick: () => onSelect(bath.id), leading: React$1.createElement(Avatar$1, { src: (_b = bath.imageUrl) !== null && _b !== void 0 ? _b : undefined, alt: "", sx: { width: 40, height: 40 } },
|
|
173994
|
+
React$1.createElement(Spa, { fontSize: "small" })), trailing: onSchedule ? (React$1.createElement(IconButton$1, { "aria-label": `Agendar ${bath.title}`, onClick: () => onSchedule(bath.id), sx: { width: 44, height: 44 } },
|
|
173995
|
+
React$1.createElement(CalendarMonth$1, null))) : undefined }));
|
|
173996
|
+
};
|
|
173807
173997
|
const RitualBathListPage = (props) => {
|
|
173808
173998
|
var _a, _b, _c;
|
|
173809
173999
|
const theme = useTheme$1();
|
|
174000
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
173810
174001
|
const { data, fns } = useRitualBathListPage(props);
|
|
173811
174002
|
const showOriginFilter = data.activeTab === "all" && !data.isTerreiro;
|
|
173812
174003
|
const drawerValue = Object.assign(Object.assign({}, (data.filters.categoryId !== undefined
|
|
@@ -173836,7 +174027,7 @@ const RitualBathListPage = (props) => {
|
|
|
173836
174027
|
backgroundColor: theme.palette.background.default,
|
|
173837
174028
|
position: "relative",
|
|
173838
174029
|
} },
|
|
173839
|
-
React$1.createElement(PageHeader$2, { title: "Banhos Rituais", onBack: fns.handleBack, onAdd: fns.handleBathCreate, addLabel: "Adicionar", showAddButton: data.isAdmin, tabs: tabs, selectedTab: data.activeTab, onTabChange: (value) => fns.handleTabChange(value) }),
|
|
174030
|
+
React$1.createElement(PageHeader$2, { title: "Banhos Rituais", onBack: fns.handleBack, onAdd: fns.handleBathCreate, addLabel: "Adicionar", showAddButton: data.isAdmin, hideAddButtonOnMobile: true, tabs: tabs, selectedTab: data.activeTab, onTabChange: (value) => fns.handleTabChange(value) }),
|
|
173840
174031
|
React$1.createElement(Container$1, { maxWidth: "md", sx: Object.assign(Object.assign({}, PAGE_LIST_CONTAINER_SPACING), { flex: 1 }) },
|
|
173841
174032
|
React$1.createElement(Box$1, { sx: {
|
|
173842
174033
|
display: "flex",
|
|
@@ -173905,8 +174096,14 @@ const RitualBathListPage = (props) => {
|
|
|
173905
174096
|
data.hasActiveFilters ? (React$1.createElement(Button$1, { variant: "outlined", onClick: fns.handleClearFilters, startIcon: React$1.createElement(Clear$1, null) }, "Limpar filtros")) : (data.isAdmin && (React$1.createElement(Button$1, { variant: "contained", startIcon: React$1.createElement(Add$1, null), onClick: fns.handleBathCreate }, "Criar banho ritual"))))),
|
|
173906
174097
|
!data.isLoading && !data.error && data.ritualBaths.length > 0 && (React$1.createElement(Box$1, { sx: { pb: LIST_CONTENT_BOTTOM_PADDING } },
|
|
173907
174098
|
React$1.createElement(InfiniteScroll, { hasNextPage: data.hasNextPage, isFetchingNextPage: data.isFetchingNextPage, onLoadMore: fns.handleLoadMore, threshold: 200 },
|
|
173908
|
-
|
|
173909
|
-
|
|
174099
|
+
isMobile ? (React$1.createElement(Box$1, { sx: {
|
|
174100
|
+
bgcolor: "background.paper",
|
|
174101
|
+
borderRadius: RADIUS.default,
|
|
174102
|
+
border: 1,
|
|
174103
|
+
borderColor: "divider",
|
|
174104
|
+
overflow: "hidden",
|
|
174105
|
+
} }, data.ritualBaths.map((bath, index) => (React$1.createElement(RitualBathCompactRow, { key: bath.id, bath: bath, isLast: index === data.ritualBaths.length - 1, originLabel: fns.getOriginLabel(bath.origin), statusLabel: fns.getStatusLabel(bath.status), onSelect: fns.handleBathSelect, onSchedule: fns.handleScheduleBath }))))) : (React$1.createElement(Grid$1, { container: true, spacing: LIST_GAP }, data.ritualBaths.map((bath) => (React$1.createElement(Grid$1, { item: true, xs: 12, key: bath.id },
|
|
174106
|
+
React$1.createElement(RitualCard, { ritual: transformToRitual(bath, fns.getOriginLabel(bath.origin), fns.getStatusLabel(bath.status)), onClick: () => fns.handleBathSelect(bath.id), onSchedule: fns.handleScheduleBath })))))),
|
|
173910
174107
|
data.isFetchingNextPage && (React$1.createElement(Box$1, { sx: {
|
|
173911
174108
|
display: "flex",
|
|
173912
174109
|
justifyContent: "center",
|
|
@@ -173915,13 +174112,8 @@ const RitualBathListPage = (props) => {
|
|
|
173915
174112
|
} },
|
|
173916
174113
|
React$1.createElement(CircularProgress$1, { size: 28 }))),
|
|
173917
174114
|
!data.hasNextPage && data.ritualBaths.length > 0 && (React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { textAlign: "center", py: 2 } }, "Todos os banhos foram carregados")))))),
|
|
173918
|
-
data.isAdmin && (React$1.createElement(QuotaGuard, { feature: "baths", behavior: "hide" },
|
|
173919
|
-
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Criar banho ritual", onClick: fns.handleBathCreate, sx: {
|
|
173920
|
-
position: "fixed",
|
|
173921
|
-
bottom: { xs: 16, sm: 24 },
|
|
173922
|
-
right: { xs: 16, sm: 24 },
|
|
173923
|
-
zIndex: theme.zIndex.speedDial,
|
|
173924
|
-
} },
|
|
174115
|
+
data.isAdmin && data.ritualBaths.length > 0 && (React$1.createElement(QuotaGuard, { feature: "baths", behavior: "hide" },
|
|
174116
|
+
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Criar banho ritual", onClick: fns.handleBathCreate, sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.speedDial }) },
|
|
173925
174117
|
React$1.createElement(Add$1, null)))),
|
|
173926
174118
|
React$1.createElement(FilterDrawer, { open: data.isFilterDrawerOpen, onClose: fns.handleCloseFilterDrawer, onOpen: fns.handleToggleFilterDrawer, value: drawerValue, emptyValue: {}, countActiveFilters: countRitualBathDrawerFilters, "data-testid": "ritual-bath-filter-drawer", onFilter: (filters) => {
|
|
173927
174119
|
fns.handleCategoryFilter(filters.categoryId);
|
|
@@ -195692,6 +195884,8 @@ exports.CREATE_QUESTION_STEP_LABELS = CREATE_QUESTION_STEP_LABELS;
|
|
|
195692
195884
|
exports.CREATE_QUESTION_STEP_ORDER = CREATE_QUESTION_STEP_ORDER;
|
|
195693
195885
|
exports.CellphoneInput = CellphoneInput;
|
|
195694
195886
|
exports.CellphoneInputPropsSchema = CellphoneInputPropsSchema;
|
|
195887
|
+
exports.CompactListDateBlock = CompactListDateBlock;
|
|
195888
|
+
exports.CompactListRow = CompactListRow;
|
|
195695
195889
|
exports.CompletenessCard = CompletenessCard;
|
|
195696
195890
|
exports.ConnectionButton = ConnectionButton;
|
|
195697
195891
|
exports.ContactArraySchema = ContactArraySchema;
|
|
@@ -196123,6 +196317,7 @@ exports.buildAcademyCertificatePreviewNode = buildAcademyCertificatePreviewNode;
|
|
|
196123
196317
|
exports.buildItemReasonText = buildItemReasonText;
|
|
196124
196318
|
exports.buildMergedInsumos = buildMergedInsumos$1;
|
|
196125
196319
|
exports.buildMergedMediums = buildMergedMediums$1;
|
|
196320
|
+
exports.compactListDateParts = compactListDateParts;
|
|
196126
196321
|
exports.defaultDisplayProps = defaultDisplayProps;
|
|
196127
196322
|
exports.defaultInputProps = defaultInputProps;
|
|
196128
196323
|
exports.drawerSheetRadius = drawerSheetRadius;
|