gsintegrations 0.0.487 → 0.0.489
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 +573 -386
- package/dist/bundle.cjs.js.map +2 -2
- package/dist/bundle.esm.js +571 -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,17 @@ 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
|
+
overflow: "hidden",
|
|
135366
|
+
} }, 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
135367
|
React$1.createElement(Menu$2, { anchorEl: filterAnchorEl, open: Boolean(filterAnchorEl), onClose: handleFilterClose },
|
|
135213
135368
|
React$1.createElement(MenuItem$1, { onClick: () => handleTemplateFilter(null) }, "Todas as atividades"),
|
|
135214
135369
|
React$1.createElement(MenuItem$1, { onClick: () => handleTemplateFilter(true) }, "Apenas modelos"),
|
|
135215
135370
|
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
|
-
} },
|
|
135371
|
+
canCreate && !props.hideAddFab && data.activities.length > 0 && (React$1.createElement(QuotaGuard, { feature: "activities", behavior: "hide" },
|
|
135372
|
+
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
135373
|
React$1.createElement(Add$1, null)))))));
|
|
135224
135374
|
};
|
|
135225
135375
|
|
|
@@ -142272,6 +142422,8 @@ const TicketVoucherPage = ({ isLoading, errorMessage, code, eventTitle, terreiro
|
|
|
142272
142422
|
|
|
142273
142423
|
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
142424
|
var _a;
|
|
142425
|
+
const theme = useTheme$1();
|
|
142426
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
142275
142427
|
const [title, setTitle] = React$1.useState(publicTitle);
|
|
142276
142428
|
const [isPublished, setIsPublished] = React$1.useState(published);
|
|
142277
142429
|
const [emailLimit, setEmailLimit] = React$1.useState(maxTicketsPerEmail);
|
|
@@ -142346,17 +142498,24 @@ const EventTicketingManagementPage = ({ eventName, shareUrl, terreiroShareUrl, p
|
|
|
142346
142498
|
React$1.createElement(CardContent$1, null,
|
|
142347
142499
|
React$1.createElement(Stack$1, { spacing: 2 },
|
|
142348
142500
|
React$1.createElement(Typography$1, { variant: "h6" }, "Check-in na porta"),
|
|
142349
|
-
React$1.createElement(Stack$1, { direction: "row", spacing: 1 },
|
|
142501
|
+
React$1.createElement(Stack$1, { direction: isMobile ? "column" : "row", spacing: 1, alignItems: isMobile ? "stretch" : "center" },
|
|
142350
142502
|
React$1.createElement(TextField$1, { label: "Codigo do ingresso", value: checkInCode, onChange: (event) => setCheckInCode(event.target.value), inputProps: { "data-testid": "ticketing-checkin-code" } }),
|
|
142351
142503
|
React$1.createElement(Button$1, { variant: "contained", onClick: () => onCheckIn === null || onCheckIn === void 0 ? void 0 : onCheckIn(checkInCode), "data-testid": "ticketing-checkin-submit" }, "Validar"),
|
|
142352
142504
|
canCheckIn ? (React$1.createElement(Button$1, { variant: "outlined", onClick: () => setIsScannerOpen(true), "data-testid": "ticketing-checkin-scan" }, "Escanear QR")) : null),
|
|
142353
142505
|
checkInMessage ? React$1.createElement(Alert$1, { severity: "success" }, checkInMessage) : null))),
|
|
142354
142506
|
React$1.createElement(Card$1, null,
|
|
142355
142507
|
React$1.createElement(CardContent$1, null,
|
|
142356
|
-
React$1.createElement(Stack$1, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { mb: 2 } },
|
|
142508
|
+
React$1.createElement(Stack$1, { direction: isMobile ? "column" : "row", justifyContent: "space-between", alignItems: isMobile ? "flex-start" : "center", spacing: 1, sx: { mb: 2 } },
|
|
142357
142509
|
React$1.createElement(Typography$1, { variant: "h6" }, "Titulares"),
|
|
142358
142510
|
React$1.createElement(Button$1, { onClick: onExportCsv, "data-testid": "ticketing-export-csv" }, "Exportar CSV")),
|
|
142359
|
-
React$1.createElement(
|
|
142511
|
+
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 } },
|
|
142512
|
+
React$1.createElement(Typography$1, { fontWeight: 600 }, holder.holderName),
|
|
142513
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
142514
|
+
holder.status,
|
|
142515
|
+
holder.holderEmail ? ` · ${holder.holderEmail}` : ""),
|
|
142516
|
+
React$1.createElement(Typography$1, { variant: "caption", color: "text.secondary" },
|
|
142517
|
+
holder.code,
|
|
142518
|
+
holder.batchName ? ` · ${holder.batchName}` : "")))))) : (React$1.createElement(Table$1, { size: "small" },
|
|
142360
142519
|
React$1.createElement(TableHead$1, null,
|
|
142361
142520
|
React$1.createElement(TableRow$1, null,
|
|
142362
142521
|
React$1.createElement(TableCell$1, null, "Codigo"),
|
|
@@ -142369,7 +142528,7 @@ const EventTicketingManagementPage = ({ eventName, shareUrl, terreiroShareUrl, p
|
|
|
142369
142528
|
React$1.createElement(TableCell$1, null, holder.holderName),
|
|
142370
142529
|
React$1.createElement(TableCell$1, null, holder.holderEmail),
|
|
142371
142530
|
React$1.createElement(TableCell$1, null, holder.batchName),
|
|
142372
|
-
React$1.createElement(TableCell$1, null, holder.status)))))))),
|
|
142531
|
+
React$1.createElement(TableCell$1, null, holder.status))))))))),
|
|
142373
142532
|
React$1.createElement(Dialog$1, { open: isScannerOpen, onClose: () => setIsScannerOpen(false), fullWidth: true, maxWidth: "sm" },
|
|
142374
142533
|
React$1.createElement(DialogTitle$1, null, "Escanear ingresso"),
|
|
142375
142534
|
React$1.createElement(DialogContent$1, { dividers: true },
|
|
@@ -143242,9 +143401,25 @@ const EventCard = ({ event, isLast, onSelect, onEdit, getEventTypeLabel, theme }
|
|
|
143242
143401
|
event.insumos.count,
|
|
143243
143402
|
")"))))));
|
|
143244
143403
|
};
|
|
143404
|
+
const EventCompactRow = ({ event, isLast, onSelect, onEdit, getEventTypeLabel }) => {
|
|
143405
|
+
var _a, _b;
|
|
143406
|
+
const occurrence = (_b = (_a = event.occurrences) === null || _a === void 0 ? void 0 : _a.list) === null || _b === void 0 ? void 0 : _b[0];
|
|
143407
|
+
const dateParts = compactListDateParts(occurrence === null || occurrence === void 0 ? void 0 : occurrence.date);
|
|
143408
|
+
const dateTime = formatEventDateTime(event);
|
|
143409
|
+
const rawTitle = event.title || event.name || "Sem título";
|
|
143410
|
+
const meta = [
|
|
143411
|
+
dateTime.time,
|
|
143412
|
+
event.type ? getEventTypeLabel(event.type) : null,
|
|
143413
|
+
]
|
|
143414
|
+
.filter(Boolean)
|
|
143415
|
+
.join(" · ");
|
|
143416
|
+
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 } },
|
|
143417
|
+
React$1.createElement(ArrowForwardIos, { sx: { width: 16 } }))) : undefined }));
|
|
143418
|
+
};
|
|
143245
143419
|
const EventsPage = (props) => {
|
|
143246
143420
|
var _a;
|
|
143247
143421
|
const theme = useTheme$1();
|
|
143422
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
143248
143423
|
const { data, fns } = useEventsPage(props);
|
|
143249
143424
|
const periodInputValue = (_a = props.periodInputValue) !== null && _a !== void 0 ? _a : `${new Date().getFullYear()}-${String(new Date().getMonth() + 1).padStart(2, "0")}`;
|
|
143250
143425
|
// Memoized tab list for maintainability
|
|
@@ -143293,7 +143468,13 @@ const EventsPage = (props) => {
|
|
|
143293
143468
|
backgroundColor: theme.palette.background.default,
|
|
143294
143469
|
position: "relative",
|
|
143295
143470
|
} },
|
|
143296
|
-
React$1.createElement(PageHeader$2, { title: "Eventos", onBack: fns.handleBack, onAdd: fns.handleAddEvent, addLabel: "Adicionar", showAddButton: props.isAdmin,
|
|
143471
|
+
React$1.createElement(PageHeader$2, { title: "Eventos", onBack: fns.handleBack, onAdd: fns.handleAddEvent, addLabel: "Adicionar", showAddButton: props.isAdmin, hideAddButtonOnMobile: true, endAction: props.canExportParticipationReport &&
|
|
143472
|
+
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: {
|
|
143473
|
+
display: { xs: "inline-flex", sm: "none" },
|
|
143474
|
+
width: 44,
|
|
143475
|
+
height: 44,
|
|
143476
|
+
} },
|
|
143477
|
+
React$1.createElement(Download, null))) : undefined, tabs: tabs.map((status) => ({
|
|
143297
143478
|
value: status,
|
|
143298
143479
|
label: data.getStatusLabel(status),
|
|
143299
143480
|
})), selectedTab: safeSelectedTab, onTabChange: (value) => fns.handleTabChange(value) }),
|
|
@@ -143309,7 +143490,7 @@ const EventsPage = (props) => {
|
|
|
143309
143490
|
React$1.createElement(Box$1, { sx: { width: { xs: "100%", sm: 260 } } },
|
|
143310
143491
|
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
143492
|
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
|
|
143493
|
+
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
143494
|
? "Exportando..."
|
|
143314
143495
|
: "Exportar Participação"))),
|
|
143315
143496
|
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 +143507,13 @@ const EventsPage = (props) => {
|
|
|
143326
143507
|
props.isAdmin && (React$1.createElement(React$1.Fragment, null,
|
|
143327
143508
|
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mb: SECTION_GAP } }, "Toque no bot\u00E3o + para criar um novo evento"),
|
|
143328
143509
|
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
|
-
} },
|
|
143510
|
+
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: {
|
|
143511
|
+
bgcolor: "background.paper",
|
|
143512
|
+
borderRadius: RADIUS.default,
|
|
143513
|
+
overflow: "hidden",
|
|
143514
|
+
} }, 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 }))))))),
|
|
143515
|
+
props.isAdmin && !props.hideAddFab && data.events.length > 0 && (React$1.createElement(QuotaGuard, { feature: "events", behavior: "hide" },
|
|
143516
|
+
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
143517
|
React$1.createElement(Add$1, null)))))));
|
|
143338
143518
|
};
|
|
143339
143519
|
|
|
@@ -144382,9 +144562,9 @@ const FinancialAccountsList = (props) => {
|
|
|
144382
144562
|
minHeight: "100vh",
|
|
144383
144563
|
backgroundColor: theme.palette.background.default,
|
|
144384
144564
|
position: "relative",
|
|
144385
|
-
pb:
|
|
144565
|
+
pb: 0,
|
|
144386
144566
|
} },
|
|
144387
|
-
React$1.createElement(PageHeader$2, { title: "Financeiro", onBack: props.onBack, onAdd: props.onAddAccount, addLabel: "Adicionar", showAddButton: true }),
|
|
144567
|
+
React$1.createElement(PageHeader$2, { title: "Financeiro", onBack: props.onBack, onAdd: props.onAddAccount, addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
|
|
144388
144568
|
React$1.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
|
|
144389
144569
|
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
144570
|
React$1.createElement(Stack$1, { spacing: 0.5 },
|
|
@@ -144426,12 +144606,7 @@ const FinancialAccountsList = (props) => {
|
|
|
144426
144606
|
} },
|
|
144427
144607
|
isEmpty && (React$1.createElement(EmptyState$2, { onAddAccount: props.onAddAccount, theme: theme })),
|
|
144428
144608
|
!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
|
-
} },
|
|
144609
|
+
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
144610
|
React$1.createElement(Add$1, null))))));
|
|
144436
144611
|
};
|
|
144437
144612
|
var FinancialAccountsList$1 = React$1.memo(FinancialAccountsList);
|
|
@@ -146073,11 +146248,11 @@ const IncomeListItem = React$1.memo(function IncomeListItem({ item, idx, isLastI
|
|
|
146073
146248
|
React$1.createElement(ListItemSecondaryAction$1, null,
|
|
146074
146249
|
React$1.createElement(Stack$1, { spacing: 1, alignItems: "flex-end" },
|
|
146075
146250
|
React$1.createElement(Typography$1, { variant: "subtitle1", sx: { fontWeight: 600 } }, formattedAmount),
|
|
146076
|
-
canConfirmTransactions && item.id && onToggleSettlementStatus ? (React$1.createElement(
|
|
146251
|
+
canConfirmTransactions && item.id && onToggleSettlementStatus ? (React$1.createElement(IconButton$1, { "aria-label": settlementActionLabel, disabled: Boolean(isUpdatingSettlementStatus), onClick: (event) => {
|
|
146077
146252
|
event.stopPropagation();
|
|
146078
146253
|
item.id &&
|
|
146079
146254
|
onToggleSettlementStatus(item.id, nextSettlementStatus);
|
|
146080
|
-
} },
|
|
146255
|
+
}, sx: { width: 44, height: 44 } }, settlementStatus === "PROJECTED" ? React$1.createElement(Check$1, null) : React$1.createElement(UndoIcon, null))) : null))),
|
|
146081
146256
|
!isLastItem && React$1.createElement(Divider$1, { component: "li", variant: "inset" })));
|
|
146082
146257
|
});
|
|
146083
146258
|
const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue, periodInputMin, periodInputMax, showPeriodFilter, onPeriodInputChange, onResetToCurrentPeriod, canConfirmTransactions, isUpdatingSettlementStatus, onToggleSettlementStatus, data, }) => {
|
|
@@ -146114,14 +146289,18 @@ const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue
|
|
|
146114
146289
|
*
|
|
146115
146290
|
* These numbers are numeric pixel values used for paddingTop on the scrollable container.
|
|
146116
146291
|
*/
|
|
146117
|
-
const headerHeight =
|
|
146292
|
+
const headerHeight = 80;
|
|
146118
146293
|
const shouldShowPeriodFilter = showPeriodFilter !== null && showPeriodFilter !== void 0 ? showPeriodFilter : Boolean(periodLabel ||
|
|
146119
146294
|
periodInputValue ||
|
|
146120
146295
|
onPeriodInputChange ||
|
|
146121
146296
|
onResetToCurrentPeriod);
|
|
146122
|
-
const filterHeight = shouldShowPeriodFilter ?
|
|
146123
|
-
const cardHeight =
|
|
146124
|
-
const contentOffset = filterHeight + cardHeight + 16;
|
|
146297
|
+
const filterHeight = shouldShowPeriodFilter ? 72 : 0;
|
|
146298
|
+
const cardHeight = 96;
|
|
146299
|
+
const contentOffset = isMobile ? 0 : filterHeight + cardHeight + 16;
|
|
146300
|
+
const amountLabel = totalAmountNumber.toLocaleString("pt-BR", {
|
|
146301
|
+
style: "currency",
|
|
146302
|
+
currency: "BRL",
|
|
146303
|
+
});
|
|
146125
146304
|
const incomes = React$1.useMemo(() => (Array.isArray(dataSource.incomes) ? dataSource.incomes : []), [dataSource.incomes]);
|
|
146126
146305
|
return (React$1.createElement(Box$1, { sx: {
|
|
146127
146306
|
display: "flex",
|
|
@@ -146131,8 +146310,10 @@ const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue
|
|
|
146131
146310
|
position: "relative",
|
|
146132
146311
|
//pb: isMobile ? 2 : 0,
|
|
146133
146312
|
} },
|
|
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(
|
|
146313
|
+
React$1.createElement(PageHeader$2, { title: "Entradas", onBack: onBack, onAdd: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
|
|
146314
|
+
isMobile && shouldShowPeriodFilter ? (React$1.createElement(Container$1, { maxWidth: "md", sx: { px: PAGE_LIST_CONTAINER_SPACING.px, pt: 1 } },
|
|
146315
|
+
React$1.createElement(FinanceMobilePeriodBar, { periodLabel: periodLabel || metricPeriodLabel, amountLabel: amountLabel, periodInputValue: periodInputValue, periodInputMin: periodInputMin, periodInputMax: periodInputMax, onPeriodInputChange: onPeriodInputChange, onResetToCurrentPeriod: onResetToCurrentPeriod, testIdPrefix: "income" }))) : null,
|
|
146316
|
+
!isMobile && (React$1.createElement(Box$1, { component: "section", "aria-hidden": true, sx: {
|
|
146136
146317
|
position: "fixed",
|
|
146137
146318
|
left: 0,
|
|
146138
146319
|
right: 0,
|
|
@@ -146169,10 +146350,10 @@ const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue
|
|
|
146169
146350
|
style: "currency",
|
|
146170
146351
|
currency: "BRL",
|
|
146171
146352
|
})
|
|
146172
|
-
: `R$: ${amount}` })))),
|
|
146353
|
+
: `R$: ${amount}` }))))),
|
|
146173
146354
|
React$1.createElement(Container$1, { maxWidth: "md", sx: Object.assign(Object.assign({}, PAGE_LIST_CONTAINER_SPACING), {
|
|
146174
146355
|
// push content below the fixed header + card
|
|
146175
|
-
paddingTop: `${contentOffset}px`,
|
|
146356
|
+
paddingTop: isMobile ? undefined : `${contentOffset}px`, pb: LIST_CONTENT_BOTTOM_PADDING,
|
|
146176
146357
|
// ensure content can scroll beneath fixed card
|
|
146177
146358
|
position: "relative", zIndex: 0 }) },
|
|
146178
146359
|
incomes.length === 0 ? (React$1.createElement(Box$1, { sx: {
|
|
@@ -146196,13 +146377,8 @@ const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue
|
|
|
146196
146377
|
var _a, _b;
|
|
146197
146378
|
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
146379
|
}))),
|
|
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
|
-
} },
|
|
146380
|
+
isMobile && incomes.length > 0 && (React$1.createElement(QuotaGuard, { feature: "incomes", behavior: "hide" },
|
|
146381
|
+
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
146382
|
React$1.createElement(Add$1, null)))))));
|
|
146207
146383
|
};
|
|
146208
146384
|
var IncomeListPage$1 = React$1.memo(IncomeListPage);
|
|
@@ -146697,12 +146873,12 @@ const OutcomeListItem = React$1.memo(function OutcomeListItem({ item, idx, isLas
|
|
|
146697
146873
|
React$1.createElement(ListItemSecondaryAction$1, null,
|
|
146698
146874
|
React$1.createElement(Stack$1, { spacing: 1, alignItems: "flex-end" },
|
|
146699
146875
|
React$1.createElement(Typography$1, { variant: "subtitle1", sx: { fontWeight: 600 } }, formattedAmount),
|
|
146700
|
-
canConfirmTransactions && item.id && onToggleSettlementStatus ? (React$1.createElement(
|
|
146876
|
+
canConfirmTransactions && item.id && onToggleSettlementStatus ? (React$1.createElement(IconButton$1, { "aria-label": settlementActionLabel, disabled: Boolean(isUpdatingSettlementStatus), onClick: (event) => {
|
|
146701
146877
|
event.stopPropagation();
|
|
146702
146878
|
if (!item.id)
|
|
146703
146879
|
return;
|
|
146704
146880
|
onToggleSettlementStatus(item.id, nextSettlementStatus);
|
|
146705
|
-
} },
|
|
146881
|
+
}, sx: { width: 44, height: 44 } }, settlementStatus === "PROJECTED" ? React$1.createElement(Check$1, null) : React$1.createElement(UndoIcon, null))) : null))),
|
|
146706
146882
|
!isLastItem && React$1.createElement(Divider$1, { component: "li" })));
|
|
146707
146883
|
});
|
|
146708
146884
|
const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValue, periodInputMin, periodInputMax, showPeriodFilter, onPeriodInputChange, onResetToCurrentPeriod, canConfirmTransactions, isUpdatingSettlementStatus, onToggleSettlementStatus, data, }) => {
|
|
@@ -146725,14 +146901,18 @@ const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValu
|
|
|
146725
146901
|
*
|
|
146726
146902
|
* These numbers are numeric pixel values used for paddingTop on the scrollable container.
|
|
146727
146903
|
*/
|
|
146728
|
-
const headerHeight =
|
|
146904
|
+
const headerHeight = 64;
|
|
146729
146905
|
const shouldShowPeriodFilter = showPeriodFilter !== null && showPeriodFilter !== void 0 ? showPeriodFilter : Boolean(periodLabel ||
|
|
146730
146906
|
periodInputValue ||
|
|
146731
146907
|
onPeriodInputChange ||
|
|
146732
146908
|
onResetToCurrentPeriod);
|
|
146733
|
-
const filterHeight = shouldShowPeriodFilter ?
|
|
146734
|
-
const cardHeight =
|
|
146735
|
-
const contentOffset = filterHeight + cardHeight + 16;
|
|
146909
|
+
const filterHeight = shouldShowPeriodFilter ? 72 : 0;
|
|
146910
|
+
const cardHeight = 96;
|
|
146911
|
+
const contentOffset = isMobile ? 0 : filterHeight + cardHeight + 16;
|
|
146912
|
+
const amountLabel = totalAmount.toLocaleString("pt-BR", {
|
|
146913
|
+
style: "currency",
|
|
146914
|
+
currency: "BRL",
|
|
146915
|
+
});
|
|
146736
146916
|
const outcomes = React$1.useMemo(() => (Array.isArray(dataSource.outcomes) ? dataSource.outcomes : []), [dataSource.outcomes]);
|
|
146737
146917
|
return (React$1.createElement(Box$1, { sx: {
|
|
146738
146918
|
display: "flex",
|
|
@@ -146740,10 +146920,12 @@ const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValu
|
|
|
146740
146920
|
minHeight: "100vh",
|
|
146741
146921
|
backgroundColor: theme.palette.background.default,
|
|
146742
146922
|
position: "relative",
|
|
146743
|
-
pb:
|
|
146923
|
+
pb: 0,
|
|
146744
146924
|
} },
|
|
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(
|
|
146925
|
+
React$1.createElement(PageHeader$2, { title: "Sa\u00EDdas", onBack: onBack, onAdd: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
|
|
146926
|
+
isMobile && shouldShowPeriodFilter ? (React$1.createElement(Container$1, { maxWidth: "md", sx: { px: PAGE_LIST_CONTAINER_SPACING.px, pt: 1 } },
|
|
146927
|
+
React$1.createElement(FinanceMobilePeriodBar, { periodLabel: periodLabel || "-", amountLabel: amountLabel, periodInputValue: periodInputValue, periodInputMin: periodInputMin, periodInputMax: periodInputMax, onPeriodInputChange: onPeriodInputChange, onResetToCurrentPeriod: onResetToCurrentPeriod, testIdPrefix: "outcome" }))) : null,
|
|
146928
|
+
!isMobile && (React$1.createElement(Box$1, { component: "section", "aria-hidden": true, sx: {
|
|
146747
146929
|
position: "fixed",
|
|
146748
146930
|
left: 0,
|
|
146749
146931
|
right: 0,
|
|
@@ -146779,10 +146961,10 @@ const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValu
|
|
|
146779
146961
|
style: "currency",
|
|
146780
146962
|
currency: "BRL",
|
|
146781
146963
|
})
|
|
146782
|
-
: `R$: ${amount}` })))),
|
|
146964
|
+
: `R$: ${amount}` }))))),
|
|
146783
146965
|
React$1.createElement(Container$1, { maxWidth: "md", sx: Object.assign(Object.assign({}, PAGE_LIST_CONTAINER_SPACING), {
|
|
146784
146966
|
// push content below the fixed header + card
|
|
146785
|
-
paddingTop: `${contentOffset}px`,
|
|
146967
|
+
paddingTop: isMobile ? undefined : `${contentOffset}px`, pb: LIST_CONTENT_BOTTOM_PADDING,
|
|
146786
146968
|
// ensure content can scroll beneath fixed card
|
|
146787
146969
|
position: "relative", zIndex: 0 }) },
|
|
146788
146970
|
outcomes.length === 0 ? (React$1.createElement(Box$1, { sx: {
|
|
@@ -146806,13 +146988,8 @@ const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValu
|
|
|
146806
146988
|
var _a, _b;
|
|
146807
146989
|
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
146990
|
}))),
|
|
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
|
-
} },
|
|
146991
|
+
isMobile && outcomes.length > 0 && (React$1.createElement(QuotaGuard, { feature: "outcomes", behavior: "hide" },
|
|
146992
|
+
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
146993
|
React$1.createElement(Add$1, null)))))));
|
|
146817
146994
|
};
|
|
146818
146995
|
var OutcomeListPage$1 = React$1.memo(OutcomeListPage);
|
|
@@ -156886,24 +157063,23 @@ const AttendanceInsightsMobileList = ({ mediums }) => {
|
|
|
156886
157063
|
return (React$1.createElement(Stack$1, { spacing: LIST_GAP }, mediums.map((medium) => {
|
|
156887
157064
|
var _a;
|
|
156888
157065
|
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
|
-
"
|
|
157066
|
+
React$1.createElement(Stack$1, { direction: "row", spacing: LIST_GAP, alignItems: "center" },
|
|
157067
|
+
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()),
|
|
157068
|
+
React$1.createElement(Stack$1, { sx: { minWidth: 0 } },
|
|
157069
|
+
React$1.createElement(Typography$1, { fontWeight: 600, noWrap: true }, medium.mediumName),
|
|
157070
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
157071
|
+
medium.invites,
|
|
157072
|
+
" conv. \u00B7 ",
|
|
157073
|
+
medium.confirmed,
|
|
157074
|
+
" conf."),
|
|
157075
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
157076
|
+
medium.present,
|
|
157077
|
+
" pres. \u00B7 ",
|
|
157078
|
+
medium.absent,
|
|
157079
|
+
" aus. \u00B7",
|
|
156903
157080
|
" ",
|
|
156904
157081
|
medium.presenceRate,
|
|
156905
|
-
"%
|
|
156906
|
-
medium.absenceGap)))));
|
|
157082
|
+
"%")))));
|
|
156907
157083
|
})));
|
|
156908
157084
|
};
|
|
156909
157085
|
|
|
@@ -158457,9 +158633,19 @@ const sortOptions = [
|
|
|
158457
158633
|
{ value: "createdAt_desc", label: "Mais recentes" },
|
|
158458
158634
|
{ value: "createdAt_asc", label: "Mais antigos" },
|
|
158459
158635
|
];
|
|
158636
|
+
const InventoryCompactRow = ({ item, isLast, onSelect }) => {
|
|
158637
|
+
var _a, _b, _c, _d;
|
|
158638
|
+
const statusLabel = (_a = statusMap[item.status]) === null || _a === void 0 ? void 0 : _a.label;
|
|
158639
|
+
const meta = [item.location, statusLabel].filter(Boolean).join(" · ");
|
|
158640
|
+
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" } },
|
|
158641
|
+
item.quantity,
|
|
158642
|
+
" ",
|
|
158643
|
+
item.unit) }));
|
|
158644
|
+
};
|
|
158460
158645
|
// --- Main Inventory List Page ---
|
|
158461
158646
|
const InventoryListPage = (props) => {
|
|
158462
158647
|
const theme = useTheme$1();
|
|
158648
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
158463
158649
|
const { data, fns } = useInventoryListPage(props);
|
|
158464
158650
|
const drawerValue = {
|
|
158465
158651
|
status: data.selectedStatus,
|
|
@@ -158483,7 +158669,7 @@ const InventoryListPage = (props) => {
|
|
|
158483
158669
|
backgroundColor: theme.palette.background.default,
|
|
158484
158670
|
position: "relative",
|
|
158485
158671
|
}, "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" }),
|
|
158672
|
+
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
158673
|
React$1.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
|
|
158488
158674
|
React$1.createElement(Box$1, { sx: {
|
|
158489
158675
|
display: "flex",
|
|
@@ -158525,8 +158711,11 @@ const InventoryListPage = (props) => {
|
|
|
158525
158711
|
pb: LIST_CONTENT_BOTTOM_PADDING,
|
|
158526
158712
|
}, "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
158713
|
? fns.handleAddItem
|
|
158528
|
-
: undefined })) : (React$1.createElement(Fade$1, { in: true },
|
|
158529
|
-
|
|
158714
|
+
: undefined })) : (React$1.createElement(Fade$1, { in: true }, isMobile ? (React$1.createElement(Box$1, { sx: {
|
|
158715
|
+
bgcolor: "background.paper",
|
|
158716
|
+
borderRadius: RADIUS.default,
|
|
158717
|
+
overflow: "hidden",
|
|
158718
|
+
} }, 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
158719
|
React$1.createElement(FilterDrawer, { open: data.isFilterDrawerOpen, onClose: fns.handleCloseFilterDrawer, onOpen: fns.handleToggleFilterDrawer, value: drawerValue, emptyValue: {
|
|
158531
158720
|
status: "all",
|
|
158532
158721
|
createdAtSort: data.createdAtSort,
|
|
@@ -158540,7 +158729,9 @@ const InventoryListPage = (props) => {
|
|
|
158540
158729
|
React$1.createElement(FormControl$1, { fullWidth: true, size: "small" },
|
|
158541
158730
|
React$1.createElement(InputLabel$1, { id: "inventory-filter-sort-label" }, "Ordena\u00E7\u00E3o"),
|
|
158542
158731
|
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))))))))
|
|
158732
|
+
.value })), inputProps: { "data-testid": "inventory-created-at-sort" } }, sortOptions.map((option) => (React$1.createElement(MenuItem$1, { key: option.value, value: option.value }, option.label)))))))),
|
|
158733
|
+
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 }) },
|
|
158734
|
+
React$1.createElement(Add$1, null)))));
|
|
158544
158735
|
};
|
|
158545
158736
|
|
|
158546
158737
|
const DetailSectionCard = ({ icon, title, children, theme, }) => {
|
|
@@ -162018,7 +162209,7 @@ objectType({
|
|
|
162018
162209
|
const STATUS_TAB_LABELS = {
|
|
162019
162210
|
ALL: "Todos",
|
|
162020
162211
|
ACTIVE: "Ativos",
|
|
162021
|
-
WAITING_APPROVAL: "Aguardando",
|
|
162212
|
+
WAITING_APPROVAL: "Aguardando aprovação",
|
|
162022
162213
|
INACTIVE: "Inativos",
|
|
162023
162214
|
OTHER: "Outros",
|
|
162024
162215
|
};
|
|
@@ -162358,7 +162549,6 @@ const MediumListItem = ({ medium, onSelect, theme }) => {
|
|
|
162358
162549
|
const MediumListPage = (props) => {
|
|
162359
162550
|
var _a;
|
|
162360
162551
|
const theme = useTheme$1();
|
|
162361
|
-
const isCompactScreen = useMediaQuery(theme.breakpoints.down("sm"));
|
|
162362
162552
|
const { data, fns } = useMediumListPage(props);
|
|
162363
162553
|
// Sort menu state
|
|
162364
162554
|
const [sortAnchorEl, setSortAnchorEl] = React$1.useState(null);
|
|
@@ -162375,17 +162565,12 @@ const MediumListPage = (props) => {
|
|
|
162375
162565
|
};
|
|
162376
162566
|
// Status tabs for PageHeader
|
|
162377
162567
|
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
|
-
})
|
|
162568
|
+
? data.statusTabs.map((tab) => ({
|
|
162569
|
+
value: tab.value,
|
|
162570
|
+
label: tab.value === "WAITING_APPROVAL" && tab.count > 0
|
|
162571
|
+
? `${tab.label} (${tab.count})`
|
|
162572
|
+
: tab.label,
|
|
162573
|
+
}))
|
|
162389
162574
|
: undefined;
|
|
162390
162575
|
// Guard clause for loading state - show skeleton
|
|
162391
162576
|
if (data.isLoading) {
|
|
@@ -162395,7 +162580,7 @@ const MediumListPage = (props) => {
|
|
|
162395
162580
|
minHeight: "100vh",
|
|
162396
162581
|
backgroundColor: theme.palette.background.default,
|
|
162397
162582
|
} },
|
|
162398
|
-
React$1.createElement(PageHeader$2, { title: "M\u00E9diuns", onBack: fns.handleBack, onAdd: fns.handleAddMedium, addLabel: "Adicionar", showAddButton: true }),
|
|
162583
|
+
React$1.createElement(PageHeader$2, { title: "M\u00E9diuns", onBack: fns.handleBack, onAdd: fns.handleAddMedium, addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
|
|
162399
162584
|
React$1.createElement(MediumListSkeleton, { count: 6 })));
|
|
162400
162585
|
}
|
|
162401
162586
|
return (React$1.createElement(Box$1, { sx: {
|
|
@@ -162404,12 +162589,12 @@ const MediumListPage = (props) => {
|
|
|
162404
162589
|
minHeight: "100vh",
|
|
162405
162590
|
backgroundColor: theme.palette.background.default,
|
|
162406
162591
|
} },
|
|
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) }),
|
|
162592
|
+
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
162593
|
React$1.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
|
|
162409
162594
|
data.showSearch && (React$1.createElement(Box$1, { sx: {
|
|
162410
162595
|
display: "flex",
|
|
162411
|
-
flexDirection:
|
|
162412
|
-
alignItems: "
|
|
162596
|
+
flexDirection: "row",
|
|
162597
|
+
alignItems: "center",
|
|
162413
162598
|
gap: 1,
|
|
162414
162599
|
mb: 2,
|
|
162415
162600
|
} },
|
|
@@ -162422,7 +162607,7 @@ const MediumListPage = (props) => {
|
|
|
162422
162607
|
"aria-label": "Buscar médium",
|
|
162423
162608
|
sx: {
|
|
162424
162609
|
borderRadius: RADIUS.default,
|
|
162425
|
-
minHeight:
|
|
162610
|
+
minHeight: 44,
|
|
162426
162611
|
backgroundColor: theme.palette.background.paper,
|
|
162427
162612
|
"& .MuiInputBase-input": {
|
|
162428
162613
|
fontSize: { xs: "0.9rem", sm: "1rem" },
|
|
@@ -162433,9 +162618,9 @@ const MediumListPage = (props) => {
|
|
|
162433
162618
|
},
|
|
162434
162619
|
} }),
|
|
162435
162620
|
data.showSort && (React$1.createElement(IconButton$1, { onClick: handleSortMenuOpen, sx: {
|
|
162436
|
-
|
|
162437
|
-
width:
|
|
162438
|
-
height:
|
|
162621
|
+
flexShrink: 0,
|
|
162622
|
+
width: 44,
|
|
162623
|
+
height: 44,
|
|
162439
162624
|
backgroundColor: theme.palette.background.paper,
|
|
162440
162625
|
borderRadius: RADIUS.default,
|
|
162441
162626
|
border: `1px solid ${theme.palette.divider}`,
|
|
@@ -162510,19 +162695,9 @@ const MediumListPage = (props) => {
|
|
|
162510
162695
|
vertical: "top",
|
|
162511
162696
|
horizontal: "right",
|
|
162512
162697
|
} }, 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))))));
|
|
162698
|
+
data.filteredMediums.length > 0 && (React$1.createElement(QuotaGuard, { feature: "mediums", behavior: "hide" },
|
|
162699
|
+
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 }) },
|
|
162700
|
+
React$1.createElement(BarcodeIcon, null)))))));
|
|
162526
162701
|
};
|
|
162527
162702
|
|
|
162528
162703
|
const sanitizeBirthDate = (date) => {
|
|
@@ -173804,9 +173979,19 @@ const transformToRitual = (bath, originLabel, statusLabel) => {
|
|
|
173804
173979
|
scheduledCount: (_d = bath.scheduledCount) !== null && _d !== void 0 ? _d : 0,
|
|
173805
173980
|
};
|
|
173806
173981
|
};
|
|
173982
|
+
const RitualBathCompactRow = ({ bath, isLast, originLabel, statusLabel, onSelect, onSchedule }) => {
|
|
173983
|
+
var _a, _b;
|
|
173984
|
+
const meta = [(_a = bath.category) === null || _a === void 0 ? void 0 : _a.name, originLabel, statusLabel]
|
|
173985
|
+
.filter(Boolean)
|
|
173986
|
+
.join(" · ");
|
|
173987
|
+
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 } },
|
|
173988
|
+
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 } },
|
|
173989
|
+
React$1.createElement(CalendarMonth$1, null))) : undefined }));
|
|
173990
|
+
};
|
|
173807
173991
|
const RitualBathListPage = (props) => {
|
|
173808
173992
|
var _a, _b, _c;
|
|
173809
173993
|
const theme = useTheme$1();
|
|
173994
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
173810
173995
|
const { data, fns } = useRitualBathListPage(props);
|
|
173811
173996
|
const showOriginFilter = data.activeTab === "all" && !data.isTerreiro;
|
|
173812
173997
|
const drawerValue = Object.assign(Object.assign({}, (data.filters.categoryId !== undefined
|
|
@@ -173836,7 +174021,7 @@ const RitualBathListPage = (props) => {
|
|
|
173836
174021
|
backgroundColor: theme.palette.background.default,
|
|
173837
174022
|
position: "relative",
|
|
173838
174023
|
} },
|
|
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) }),
|
|
174024
|
+
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
174025
|
React$1.createElement(Container$1, { maxWidth: "md", sx: Object.assign(Object.assign({}, PAGE_LIST_CONTAINER_SPACING), { flex: 1 }) },
|
|
173841
174026
|
React$1.createElement(Box$1, { sx: {
|
|
173842
174027
|
display: "flex",
|
|
@@ -173905,8 +174090,12 @@ const RitualBathListPage = (props) => {
|
|
|
173905
174090
|
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
174091
|
!data.isLoading && !data.error && data.ritualBaths.length > 0 && (React$1.createElement(Box$1, { sx: { pb: LIST_CONTENT_BOTTOM_PADDING } },
|
|
173907
174092
|
React$1.createElement(InfiniteScroll, { hasNextPage: data.hasNextPage, isFetchingNextPage: data.isFetchingNextPage, onLoadMore: fns.handleLoadMore, threshold: 200 },
|
|
173908
|
-
|
|
173909
|
-
|
|
174093
|
+
isMobile ? (React$1.createElement(Box$1, { sx: {
|
|
174094
|
+
bgcolor: "background.paper",
|
|
174095
|
+
borderRadius: RADIUS.default,
|
|
174096
|
+
overflow: "hidden",
|
|
174097
|
+
} }, 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 },
|
|
174098
|
+
React$1.createElement(RitualCard, { ritual: transformToRitual(bath, fns.getOriginLabel(bath.origin), fns.getStatusLabel(bath.status)), onClick: () => fns.handleBathSelect(bath.id), onSchedule: fns.handleScheduleBath })))))),
|
|
173910
174099
|
data.isFetchingNextPage && (React$1.createElement(Box$1, { sx: {
|
|
173911
174100
|
display: "flex",
|
|
173912
174101
|
justifyContent: "center",
|
|
@@ -173915,13 +174104,8 @@ const RitualBathListPage = (props) => {
|
|
|
173915
174104
|
} },
|
|
173916
174105
|
React$1.createElement(CircularProgress$1, { size: 28 }))),
|
|
173917
174106
|
!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
|
-
} },
|
|
174107
|
+
data.isAdmin && data.ritualBaths.length > 0 && (React$1.createElement(QuotaGuard, { feature: "baths", behavior: "hide" },
|
|
174108
|
+
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
174109
|
React$1.createElement(Add$1, null)))),
|
|
173926
174110
|
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
174111
|
fns.handleCategoryFilter(filters.categoryId);
|
|
@@ -195692,6 +195876,8 @@ exports.CREATE_QUESTION_STEP_LABELS = CREATE_QUESTION_STEP_LABELS;
|
|
|
195692
195876
|
exports.CREATE_QUESTION_STEP_ORDER = CREATE_QUESTION_STEP_ORDER;
|
|
195693
195877
|
exports.CellphoneInput = CellphoneInput;
|
|
195694
195878
|
exports.CellphoneInputPropsSchema = CellphoneInputPropsSchema;
|
|
195879
|
+
exports.CompactListDateBlock = CompactListDateBlock;
|
|
195880
|
+
exports.CompactListRow = CompactListRow;
|
|
195695
195881
|
exports.CompletenessCard = CompletenessCard;
|
|
195696
195882
|
exports.ConnectionButton = ConnectionButton;
|
|
195697
195883
|
exports.ContactArraySchema = ContactArraySchema;
|
|
@@ -196123,6 +196309,7 @@ exports.buildAcademyCertificatePreviewNode = buildAcademyCertificatePreviewNode;
|
|
|
196123
196309
|
exports.buildItemReasonText = buildItemReasonText;
|
|
196124
196310
|
exports.buildMergedInsumos = buildMergedInsumos$1;
|
|
196125
196311
|
exports.buildMergedMediums = buildMergedMediums$1;
|
|
196312
|
+
exports.compactListDateParts = compactListDateParts;
|
|
196126
196313
|
exports.defaultDisplayProps = defaultDisplayProps;
|
|
196127
196314
|
exports.defaultInputProps = defaultInputProps;
|
|
196128
196315
|
exports.drawerSheetRadius = drawerSheetRadius;
|