gsintegrations 0.0.486 → 0.0.488
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.cjs.js +719 -482
- package/dist/bundle.cjs.js.map +2 -2
- package/dist/bundle.esm.js +717 -483
- package/dist/bundle.esm.js.map +2 -2
- package/dist/index.d.ts +106 -26
- package/dist/types/components/FormChatAssistant/FormChatAssistant.types.d.ts +2 -0
- 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/ActivityDetailPage/ActivityDetailPage.d.ts +1 -0
- package/dist/types/pages/ActivityDetailPage/ActivityDetailPage.types.d.ts +8 -0
- package/dist/types/pages/ActivityDetailPage/useActivityDetailPage.d.ts +1 -0
- package/dist/types/pages/ActivityListPage/ActivityListPage.types.d.ts +11 -3
- package/dist/types/pages/ActivityListPage/useActivityListPage.d.ts +1 -0
- package/dist/types/pages/ActivityOnboardingPage/ActivityOnboarding.types.d.ts +8 -0
- package/dist/types/pages/EventDetailPage/EventDetailPage.d.ts +2 -0
- package/dist/types/pages/EventDetailPage/EventDetailPage.types.d.ts +27 -0
- package/dist/types/pages/EventDetailPage/useEventDetailPage.d.ts +2 -0
- package/dist/types/pages/EventOnboardingPage/EventOnboarding.types.d.ts +22 -0
- package/dist/types/pages/EventOnboardingPage/components/EventActivitySelectionStep.d.ts +1 -0
- package/dist/types/pages/EventsPage/EventsPage.types.d.ts +12 -4
- package/dist/types/pages/EventsPage/useEventsPage.d.ts +1 -0
- 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/HomePage/HomePage.types.d.ts +12 -0
- 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(),
|
|
@@ -126888,7 +127081,7 @@ const ActivityFormChatSummaryCard = ({ summary, confirmLabel = "Criar atividade"
|
|
|
126888
127081
|
React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Hor\u00E1rio", value: summary.isAllDay
|
|
126889
127082
|
? "Dia inteiro"
|
|
126890
127083
|
: `${formatTime$2(summary.startTime)} – ${formatTime$2(summary.endTime)}` }))) : null,
|
|
126891
|
-
summary.checkinStartWindowMinutes !== undefined ? (React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Check-in", value: `${summary.checkinStartWindowMinutes} min antes / ${(_e = summary.checkinEndWindowMinutes) !== null && _e !== void 0 ? _e : 15} min depois` })) : null,
|
|
127084
|
+
summary.qrCheckinEnabled === false ? (React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Check-in", value: "Desativado" })) : summary.checkinStartWindowMinutes !== undefined ? (React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Check-in", value: `${summary.checkinStartWindowMinutes} min antes / ${(_e = summary.checkinEndWindowMinutes) !== null && _e !== void 0 ? _e : 15} min depois` })) : null,
|
|
126892
127085
|
React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$Z, { fontSize: "small" }), label: "Participantes", value: members }),
|
|
126893
127086
|
summary.minConfirmedMembers !== undefined ? (React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$Z, { fontSize: "small" }), label: "Qu\u00F3rum m\u00EDnimo", value: String(summary.minConfirmedMembers) })) : null,
|
|
126894
127087
|
React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$Y, { fontSize: "small" }), label: "Materiais", value: insumos })),
|
|
@@ -127036,7 +127229,7 @@ const EventFormChatSummaryCard = ({ summary, confirmLabel = "Criar evento", edit
|
|
|
127036
127229
|
React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Hor\u00E1rio", value: summary.isAllDay
|
|
127037
127230
|
? "Dia inteiro"
|
|
127038
127231
|
: `${formatTime$1(summary.startTime)} – ${formatTime$1(summary.endTime)}` }))) : null,
|
|
127039
|
-
summary.checkinStartWindowMinutes !== undefined ? (React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Check-in", value: `${summary.checkinStartWindowMinutes} min antes / ${(_g = summary.checkinEndWindowMinutes) !== null && _g !== void 0 ? _g : 15} min depois` })) : null,
|
|
127232
|
+
summary.qrCheckinEnabled === false ? (React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Check-in", value: "Desativado" })) : summary.checkinStartWindowMinutes !== undefined ? (React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Check-in", value: `${summary.checkinStartWindowMinutes} min antes / ${(_g = summary.checkinEndWindowMinutes) !== null && _g !== void 0 ? _g : 15} min depois` })) : null,
|
|
127040
127233
|
React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$14, { fontSize: "small" }), label: "Local", value: formatLocation(summary) }),
|
|
127041
127234
|
React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$W, { fontSize: "small" }), label: "Atividades", value: activities }),
|
|
127042
127235
|
React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$Z, { fontSize: "small" }), label: "Participantes", value: members }),
|
|
@@ -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",
|
|
@@ -133252,27 +133380,31 @@ const ActivityCheckinWindowStep = ({ formState, validationErrors, onChange, setF
|
|
|
133252
133380
|
});
|
|
133253
133381
|
}
|
|
133254
133382
|
}, [setFieldValue, onChange]);
|
|
133383
|
+
const checkinEnabled = formState.qrCheckinEnabled !== false;
|
|
133255
133384
|
return (React$1.createElement(Box$1, { sx: { p: { xs: 0.5, sm: 1 } } },
|
|
133256
|
-
React$1.createElement(
|
|
133257
|
-
|
|
133258
|
-
|
|
133259
|
-
|
|
133260
|
-
|
|
133261
|
-
|
|
133262
|
-
|
|
133263
|
-
|
|
133264
|
-
|
|
133265
|
-
|
|
133266
|
-
|
|
133267
|
-
|
|
133268
|
-
"
|
|
133269
|
-
|
|
133270
|
-
|
|
133271
|
-
|
|
133272
|
-
|
|
133273
|
-
|
|
133274
|
-
|
|
133275
|
-
|
|
133385
|
+
React$1.createElement(FormControlLabel$1, { control: React$1.createElement(Switch$1, { checked: checkinEnabled, onChange: (_, checked) => updateField("qrCheckinEnabled", checked), inputProps: { "aria-label": "Habilitar check-in" }, "data-testid": "activity-checkin-enabled-switch" }), label: "Habilitar check-in", sx: { mb: 2, ml: 0 } }),
|
|
133386
|
+
!checkinEnabled ? (React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" }, "Esta atividade n\u00E3o ter\u00E1 check-in na porta. A janela e o QR ficam ocultos.")) : null,
|
|
133387
|
+
checkinEnabled ? (React$1.createElement(React$1.Fragment, null,
|
|
133388
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mb: { xs: 2, sm: 3 } } },
|
|
133389
|
+
"Configure o intervalo de tempo permitido para check-in. O check-in estar\u00E1 dispon\u00EDvel a partir de X minutos ",
|
|
133390
|
+
React$1.createElement("strong", null, "antes"),
|
|
133391
|
+
" da atividade at\u00E9 Y minutos",
|
|
133392
|
+
React$1.createElement("strong", null, " ap\u00F3s"),
|
|
133393
|
+
" o in\u00EDcio."),
|
|
133394
|
+
React$1.createElement(Alert$1, { severity: "info", icon: React$1.createElement(Info$1, null), sx: { mb: { xs: 2, sm: 3 } } },
|
|
133395
|
+
React$1.createElement(Typography$1, { variant: "body2" },
|
|
133396
|
+
React$1.createElement("strong", null, "Exemplo:"),
|
|
133397
|
+
" Com os valores padr\u00E3o (10 e 15), se a atividade come\u00E7a \u00E0s 19h, o check-in abrir\u00E1 \u00E0s 18h50 e fechar\u00E1 \u00E0s 19h15.")),
|
|
133398
|
+
React$1.createElement(Box$1, { sx: { mb: { xs: 2, sm: 3 } } },
|
|
133399
|
+
React$1.createElement(LabeledMinuteInput, { name: "checkinStartWindowMinutes", label: "Abrir check-in (minutos antes)", value: formState.checkinStartWindowMinutes, onChange: (value) => updateField("checkinStartWindowMinutes", value), error: validationErrors.checkinStartWindowMinutes, helperText: validationErrors.checkinStartWindowMinutes ||
|
|
133400
|
+
"Quantos minutos antes da atividade checar entrada (0-120)", fallbackValue: 10, presets: [10, 20, 30], min: 0, max: 120, "data-testid": "activity-checkin-start-window-input" })),
|
|
133401
|
+
React$1.createElement(Box$1, { sx: { mb: { xs: 2, sm: 3 } } },
|
|
133402
|
+
React$1.createElement(LabeledMinuteInput, { name: "checkinEndWindowMinutes", label: "Fechar check-in (minutos ap\u00F3s)", value: formState.checkinEndWindowMinutes, onChange: (value) => updateField("checkinEndWindowMinutes", value), error: validationErrors.checkinEndWindowMinutes, helperText: validationErrors.checkinEndWindowMinutes ||
|
|
133403
|
+
"Quantos minutos após o início da atividade checar entrada (0-120)", fallbackValue: 15, presets: [10, 20, 30], min: 0, max: 120, "data-testid": "activity-checkin-end-window-input" })),
|
|
133404
|
+
React$1.createElement(Box$1, { sx: { p: { xs: 1.5, sm: 2 }, bgcolor: "action.hover", borderRadius: RADIUS.default } },
|
|
133405
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
133406
|
+
React$1.createElement("strong", null, "Dica:"),
|
|
133407
|
+
" Para atividades ritualisticas, manter a precis\u00E3o \u00E9 importante. Use 10 minutos de abertura e 15 minutos de fechamento como padr\u00E3o para manter a disciplina energ\u00E9tica.")))) : null));
|
|
133276
133408
|
};
|
|
133277
133409
|
|
|
133278
133410
|
const MembersSelectionStep = ({ formState, validationErrors, onChange, availableMembers = [], }) => {
|
|
@@ -134074,6 +134206,7 @@ const TemplateSchema = objectType({
|
|
|
134074
134206
|
isTemplate: booleanType(),
|
|
134075
134207
|
});
|
|
134076
134208
|
const ActivityCheckinWindowSchema = objectType({
|
|
134209
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
134077
134210
|
checkinStartWindowMinutes: numberType()
|
|
134078
134211
|
.int()
|
|
134079
134212
|
.min(0, "Deve ser 0 ou maior")
|
|
@@ -134101,6 +134234,7 @@ objectType({
|
|
|
134101
134234
|
.int("Quórum mínimo deve ser um número inteiro")
|
|
134102
134235
|
.min(1, "Quórum mínimo deve ser pelo menos 1")
|
|
134103
134236
|
.optional(),
|
|
134237
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
134104
134238
|
checkinStartWindowMinutes: numberType()
|
|
134105
134239
|
.int()
|
|
134106
134240
|
.min(0)
|
|
@@ -134193,13 +134327,18 @@ const DEFAULT_FORM_STATE$4 = {
|
|
|
134193
134327
|
insumos: [],
|
|
134194
134328
|
isTemplate: false,
|
|
134195
134329
|
minConfirmedMembers: undefined,
|
|
134330
|
+
qrCheckinEnabled: true,
|
|
134196
134331
|
};
|
|
134197
134332
|
const useActivityOnboarding = (props) => {
|
|
134198
134333
|
const [isLoading, setIsLoading] = React$1.useState(false);
|
|
134199
134334
|
const [error, setError] = React$1.useState();
|
|
134200
134335
|
const formState = React$1.useMemo(() => {
|
|
134201
|
-
|
|
134202
|
-
|
|
134336
|
+
const base = props.initialData || DEFAULT_FORM_STATE$4;
|
|
134337
|
+
if (props.isPersonalProfile) {
|
|
134338
|
+
return Object.assign(Object.assign({}, base), { qrCheckinEnabled: false });
|
|
134339
|
+
}
|
|
134340
|
+
return base;
|
|
134341
|
+
}, [props.initialData, props.isPersonalProfile]);
|
|
134203
134342
|
const steps = React$1.useMemo(() => {
|
|
134204
134343
|
return [
|
|
134205
134344
|
{
|
|
@@ -134232,7 +134371,7 @@ const useActivityOnboarding = (props) => {
|
|
|
134232
134371
|
id: "checkin-window",
|
|
134233
134372
|
label: "Check-in",
|
|
134234
134373
|
title: "Configurar Check-in",
|
|
134235
|
-
description: "
|
|
134374
|
+
description: "Escolha se haverá check-in e, se houver, o período permitido",
|
|
134236
134375
|
component: ActivityCheckinWindowStep,
|
|
134237
134376
|
},
|
|
134238
134377
|
]),
|
|
@@ -134973,6 +135112,8 @@ const formatMinutesToHHMM$3 = (totalMinutes) => {
|
|
|
134973
135112
|
};
|
|
134974
135113
|
const getConfiguredCheckinWindow$1 = (activity) => {
|
|
134975
135114
|
var _a, _b, _c, _d;
|
|
135115
|
+
if (activity.qrCheckinEnabled === false)
|
|
135116
|
+
return null;
|
|
134976
135117
|
const startTime = (_b = (_a = activity.occurrences) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.startTime;
|
|
134977
135118
|
const startMinutes = parseTimeToMinutes$3(startTime);
|
|
134978
135119
|
if (startMinutes === null)
|
|
@@ -135111,9 +135252,30 @@ const ActivityCard = ({ activity, isLast, isPersonalProfile = false, onSelect, o
|
|
|
135111
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()));
|
|
135112
135253
|
})))))));
|
|
135113
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
|
+
};
|
|
135114
135275
|
const ActivityListPage = (props) => {
|
|
135115
135276
|
var _a;
|
|
135116
135277
|
const theme = useTheme$1();
|
|
135278
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
135117
135279
|
const { data, fns } = useActivityListPage(props);
|
|
135118
135280
|
const canCreate = props.canCreate || props.isAdmin;
|
|
135119
135281
|
const periodInputValue = (_a = props.periodInputValue) !== null && _a !== void 0 ? _a : `${new Date().getFullYear()}-${String(new Date().getMonth() + 1).padStart(2, "0")}`;
|
|
@@ -135162,7 +135324,9 @@ const ActivityListPage = (props) => {
|
|
|
135162
135324
|
backgroundColor: theme.palette.background.default,
|
|
135163
135325
|
position: "relative",
|
|
135164
135326
|
} },
|
|
135165
|
-
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) => ({
|
|
135166
135330
|
value: status,
|
|
135167
135331
|
label: data.getStatusLabel(status),
|
|
135168
135332
|
})), selectedTab: safeSelectedTab, onTabChange: (value) => fns.handleTabChange(value) }),
|
|
@@ -135178,7 +135342,7 @@ const ActivityListPage = (props) => {
|
|
|
135178
135342
|
React$1.createElement(Box$1, { sx: { width: { xs: "100%", sm: 260 } } },
|
|
135179
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" })),
|
|
135180
135344
|
props.canExportParticipationReport &&
|
|
135181
|
-
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
|
|
135182
135346
|
? "Exportando..."
|
|
135183
135347
|
: "Exportar Participação"))),
|
|
135184
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: {
|
|
@@ -135195,18 +135359,19 @@ const ActivityListPage = (props) => {
|
|
|
135195
135359
|
canCreate && (React$1.createElement(React$1.Fragment, null,
|
|
135196
135360
|
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mb: SECTION_GAP } }, "Toque no bot\u00E3o + para criar uma nova atividade"),
|
|
135197
135361
|
React$1.createElement(QuotaGuard, { feature: "activities", behavior: "disable" },
|
|
135198
|
-
React$1.createElement(Button$1, { variant: "contained", startIcon: React$1.createElement(Add$1, null), onClick: fns.handleActivityAdd }, "Criar atividade")))))) : (React$1.createElement(
|
|
135362
|
+
React$1.createElement(Button$1, { variant: "contained", startIcon: React$1.createElement(Add$1, null), onClick: fns.handleActivityAdd }, "Criar atividade")))))) : (isMobile ? (React$1.createElement(Box$1, { sx: {
|
|
135363
|
+
bgcolor: "background.paper",
|
|
135364
|
+
borderRadius: RADIUS.default,
|
|
135365
|
+
border: 1,
|
|
135366
|
+
borderColor: "divider",
|
|
135367
|
+
overflow: "hidden",
|
|
135368
|
+
} }, data.activities.map((activity, index) => (React$1.createElement(ActivityCompactRow, { key: activity.id, activity: activity, isLast: index === data.activities.length - 1, isPersonalProfile: props.isPersonalProfile, onSelect: fns.handleActivitySelect, onEdit: props.onActivityEdit ? fns.handleActivityEdit : undefined }))))) : (React$1.createElement(Stack$1, { spacing: LIST_GAP }, data.activities.map((activity, index) => (React$1.createElement(ActivityCard, { key: activity.id, activity: activity, isLast: index === data.activities.length - 1, isPersonalProfile: props.isPersonalProfile, onSelect: fns.handleActivitySelect, onEdit: fns.handleActivityEdit, theme: theme, getStatusLabel: data.getStatusLabel }))))))),
|
|
135199
135369
|
React$1.createElement(Menu$2, { anchorEl: filterAnchorEl, open: Boolean(filterAnchorEl), onClose: handleFilterClose },
|
|
135200
135370
|
React$1.createElement(MenuItem$1, { onClick: () => handleTemplateFilter(null) }, "Todas as atividades"),
|
|
135201
135371
|
React$1.createElement(MenuItem$1, { onClick: () => handleTemplateFilter(true) }, "Apenas modelos"),
|
|
135202
135372
|
React$1.createElement(MenuItem$1, { onClick: () => handleTemplateFilter(false) }, "Apenas atividades")),
|
|
135203
|
-
canCreate && !props.hideAddFab && (React$1.createElement(QuotaGuard, { feature: "activities", behavior: "hide" },
|
|
135204
|
-
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar", onClick: fns.handleActivityAdd, sx: {
|
|
135205
|
-
position: "fixed",
|
|
135206
|
-
bottom: { xs: 16, sm: 24 },
|
|
135207
|
-
right: { xs: 16, sm: 24 },
|
|
135208
|
-
zIndex: theme.zIndex.speedDial,
|
|
135209
|
-
} },
|
|
135373
|
+
canCreate && !props.hideAddFab && data.activities.length > 0 && (React$1.createElement(QuotaGuard, { feature: "activities", behavior: "hide" },
|
|
135374
|
+
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar", onClick: fns.handleActivityAdd, sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.speedDial }) },
|
|
135210
135375
|
React$1.createElement(Add$1, null)))))));
|
|
135211
135376
|
};
|
|
135212
135377
|
|
|
@@ -135277,26 +135442,27 @@ const ActivityDateTime = ({ activity, checkinWindow, formatDate, formatTime, the
|
|
|
135277
135442
|
? formatTime(occurrence.endTime)
|
|
135278
135443
|
: "Não definido"))))))) : (React$1.createElement(Box$1, { sx: { textAlign: "center", py: 2 } },
|
|
135279
135444
|
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" }, "Nenhuma data definida"))),
|
|
135280
|
-
React$1.createElement(
|
|
135281
|
-
React$1.createElement(
|
|
135282
|
-
|
|
135283
|
-
"
|
|
135284
|
-
|
|
135285
|
-
|
|
135286
|
-
React$1.createElement(
|
|
135287
|
-
|
|
135288
|
-
|
|
135289
|
-
|
|
135290
|
-
|
|
135291
|
-
|
|
135292
|
-
|
|
135293
|
-
|
|
135294
|
-
|
|
135295
|
-
|
|
135296
|
-
|
|
135297
|
-
|
|
135298
|
-
|
|
135299
|
-
|
|
135445
|
+
activity.qrCheckinEnabled !== false ? (React$1.createElement(React$1.Fragment, null,
|
|
135446
|
+
React$1.createElement(Box$1, { sx: { display: "flex", alignItems: "center", mt: 1 } },
|
|
135447
|
+
React$1.createElement(AccessTime, { sx: { mr: 1.5, color: "text.secondary" } }),
|
|
135448
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mr: 1 } },
|
|
135449
|
+
"Check-in v\u00E1lido: ",
|
|
135450
|
+
getCheckinSummary()),
|
|
135451
|
+
checkinWindow ? (React$1.createElement(Box$1, { component: "span" },
|
|
135452
|
+
React$1.createElement(Typography$1, { component: "span", variant: "caption", sx: {
|
|
135453
|
+
px: 1,
|
|
135454
|
+
py: 0.25,
|
|
135455
|
+
borderRadius: RADIUS.default,
|
|
135456
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
135457
|
+
color: checkinWindow.state === "active"
|
|
135458
|
+
? theme.palette.success.main
|
|
135459
|
+
: checkinWindow.state === "scheduled"
|
|
135460
|
+
? theme.palette.warning.main
|
|
135461
|
+
: checkinWindow.state === "closed"
|
|
135462
|
+
? theme.palette.error.main
|
|
135463
|
+
: theme.palette.text.secondary,
|
|
135464
|
+
} }, stateLabel[checkinWindow.state]))) : null),
|
|
135465
|
+
getCheckinExplanation() ? (React$1.createElement(Typography$1, { variant: "caption", color: "text.secondary", sx: { mt: 0.5 } }, getCheckinExplanation())) : null)) : null)));
|
|
135300
135466
|
};
|
|
135301
135467
|
var ActivityDateTime$1 = React$1.memo(ActivityDateTime);
|
|
135302
135468
|
|
|
@@ -135882,6 +136048,7 @@ const ActivitySchema$3 = objectType({
|
|
|
135882
136048
|
title: stringType(),
|
|
135883
136049
|
description: stringType(),
|
|
135884
136050
|
isTemplate: booleanType(),
|
|
136051
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
135885
136052
|
qrReleaseOffsetMinutes: numberType().nullable().optional(),
|
|
135886
136053
|
qrCheckinGraceMinutes: numberType().nullable().optional(),
|
|
135887
136054
|
checkinStartWindowMinutes: numberType().nullable().optional(),
|
|
@@ -135997,6 +136164,7 @@ const ActivityDetailSchema = objectType({
|
|
|
135997
136164
|
title: stringType(),
|
|
135998
136165
|
description: stringType(),
|
|
135999
136166
|
isTemplate: booleanType(),
|
|
136167
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
136000
136168
|
qrReleaseOffsetMinutes: numberType().nullable().optional(),
|
|
136001
136169
|
qrCheckinGraceMinutes: numberType().nullable().optional(),
|
|
136002
136170
|
checkinStartWindowMinutes: numberType().nullable().optional(),
|
|
@@ -136405,7 +136573,9 @@ const ActivityDetailPage = (props) => {
|
|
|
136405
136573
|
const bTime = b.confirmedAt ? new Date(b.confirmedAt).getTime() : 0;
|
|
136406
136574
|
return bTime - aTime;
|
|
136407
136575
|
});
|
|
136408
|
-
const
|
|
136576
|
+
const checkinEnabled = data.activity.qrCheckinEnabled !== false;
|
|
136577
|
+
const canShowCheckinCta = checkinEnabled &&
|
|
136578
|
+
props.canScanCheckin &&
|
|
136409
136579
|
((_a = props.checkinWindow) === null || _a === void 0 ? void 0 : _a.state) === "active" &&
|
|
136410
136580
|
!(currentMember === null || currentMember === void 0 ? void 0 : currentMember.confirmedAt) &&
|
|
136411
136581
|
!props.isPersonalProfile;
|
|
@@ -136430,7 +136600,7 @@ const ActivityDetailPage = (props) => {
|
|
|
136430
136600
|
React$1.createElement(Stack$1, { spacing: LIST_GAP },
|
|
136431
136601
|
React$1.createElement(ActivityInfo$1, { activity: data.activity, canChangeStatus: props.canChangeStatus || false, canUseModel: props.canUseModel || false, statusOptions: statusOptions, onStatusChange: fns.handleChangeStatus, onUseModel: fns.handleUseModel, theme: theme }),
|
|
136432
136602
|
React$1.createElement(ActivityDateTime$1, { activity: data.activity, checkinWindow: props.checkinWindow, formatDate: data.formatDate, formatTime: data.formatTime, theme: theme }),
|
|
136433
|
-
props.canManageQr && !props.isPersonalProfile && (React$1.createElement(ActivityAttendanceQr, { attendanceQr: props.attendanceQr, onRefreshQrState: props.onRefreshQrState })),
|
|
136603
|
+
checkinEnabled && props.canManageQr && !props.isPersonalProfile && (React$1.createElement(ActivityAttendanceQr, { attendanceQr: props.attendanceQr, onRefreshQrState: props.onRefreshQrState })),
|
|
136434
136604
|
React$1.createElement(ActivityMediums$1, { activity: data.activity, onAddMedium: fns.handleAddMedium, isAdmin: data.isAdmin, theme: theme, currentMemberId: data.currentMemberId, onConfirmParticipation: fns.handleConfirmParticipation, onDeclineParticipation: fns.handleDeclineParticipation }),
|
|
136435
136605
|
attendanceMembers.length > 0 && (React$1.createElement(ConfirmedAttendanceCard$3, { attendanceMembers: attendanceMembers, theme: theme, formatConfirmedAt: formatConfirmedAt })),
|
|
136436
136606
|
React$1.createElement(ActivitySupplies$1, { activity: data.activity, onAddSupply: fns.handleAddSupply, theme: theme })))),
|
|
@@ -137279,6 +137449,7 @@ const EventSchema = objectType({
|
|
|
137279
137449
|
name: stringType().optional(),
|
|
137280
137450
|
description: stringType().optional(),
|
|
137281
137451
|
isTemplate: booleanType().optional(),
|
|
137452
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
137282
137453
|
qrReleaseOffsetMinutes: numberType().nullable().optional(),
|
|
137283
137454
|
qrCheckinGraceMinutes: numberType().nullable().optional(),
|
|
137284
137455
|
checkinStartWindowMinutes: numberType().nullable().optional(),
|
|
@@ -137527,27 +137698,31 @@ const EventCheckinWindowStep = ({ formState, validationErrors, onChange, setFiel
|
|
|
137527
137698
|
onChange(createFieldEvent(name, value));
|
|
137528
137699
|
}
|
|
137529
137700
|
}, [setFieldValue, onChange]);
|
|
137701
|
+
const checkinEnabled = formState.qrCheckinEnabled !== false;
|
|
137530
137702
|
return (React$1.createElement(Box$1, { sx: { p: { xs: 0.5, sm: 1 } } },
|
|
137531
|
-
React$1.createElement(
|
|
137532
|
-
|
|
137533
|
-
|
|
137534
|
-
|
|
137535
|
-
|
|
137536
|
-
|
|
137537
|
-
|
|
137538
|
-
|
|
137539
|
-
|
|
137540
|
-
|
|
137541
|
-
|
|
137542
|
-
|
|
137543
|
-
"
|
|
137544
|
-
|
|
137545
|
-
|
|
137546
|
-
|
|
137547
|
-
|
|
137548
|
-
|
|
137549
|
-
|
|
137550
|
-
|
|
137703
|
+
React$1.createElement(FormControlLabel$1, { control: React$1.createElement(Switch$1, { checked: checkinEnabled, onChange: (_, checked) => updateField("qrCheckinEnabled", checked), inputProps: { "aria-label": "Habilitar check-in" }, "data-testid": "event-checkin-enabled-switch" }), label: "Habilitar check-in", sx: { mb: 2, ml: 0 } }),
|
|
137704
|
+
!checkinEnabled ? (React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" }, "Este evento n\u00E3o ter\u00E1 check-in na porta. A janela e o QR ficam ocultos.")) : null,
|
|
137705
|
+
checkinEnabled ? (React$1.createElement(React$1.Fragment, null,
|
|
137706
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mb: 2.5 } },
|
|
137707
|
+
"Configure o intervalo de tempo permitido para check-in. O check-in estar\u00E1 dispon\u00EDvel a partir de X minutos ",
|
|
137708
|
+
React$1.createElement("strong", null, "antes"),
|
|
137709
|
+
" do evento at\u00E9 Y minutos",
|
|
137710
|
+
React$1.createElement("strong", null, " ap\u00F3s"),
|
|
137711
|
+
" o in\u00EDcio."),
|
|
137712
|
+
React$1.createElement(Alert$1, { severity: "info", icon: React$1.createElement(Info$1, null), sx: { mb: 2.5 } },
|
|
137713
|
+
React$1.createElement(Typography$1, { variant: "body2" },
|
|
137714
|
+
React$1.createElement("strong", null, "Exemplo:"),
|
|
137715
|
+
" Com os valores padr\u00E3o (10 e 15), se o evento come\u00E7a \u00E0s 19h, o check-in abrir\u00E1 \u00E0s 18h50 e fechar\u00E1 \u00E0s 19h15.")),
|
|
137716
|
+
React$1.createElement(Box$1, { sx: { mb: 2.5 } },
|
|
137717
|
+
React$1.createElement(LabeledMinuteInput, { name: "checkinStartWindowMinutes", label: "Abrir check-in (minutos antes)", value: formState.checkinStartWindowMinutes, onChange: (value) => updateField("checkinStartWindowMinutes", value), error: validationErrors.checkinStartWindowMinutes, helperText: validationErrors.checkinStartWindowMinutes ||
|
|
137718
|
+
"Quantos minutos antes do evento checar entrada (0-120)", fallbackValue: 10, min: 0, max: 120, "data-testid": "event-checkin-start-window-input" })),
|
|
137719
|
+
React$1.createElement(Box$1, { sx: { mb: 2.5 } },
|
|
137720
|
+
React$1.createElement(LabeledMinuteInput, { name: "checkinEndWindowMinutes", label: "Fechar check-in (minutos ap\u00F3s)", value: formState.checkinEndWindowMinutes, onChange: (value) => updateField("checkinEndWindowMinutes", value), error: validationErrors.checkinEndWindowMinutes, helperText: validationErrors.checkinEndWindowMinutes ||
|
|
137721
|
+
"Quantos minutos após o início do evento checar entrada (0-120)", fallbackValue: 15, min: 0, max: 120, "data-testid": "event-checkin-end-window-input" })),
|
|
137722
|
+
React$1.createElement(Box$1, { sx: { p: { xs: 1.5, sm: 2 }, bgcolor: "action.hover", borderRadius: RADIUS.default } },
|
|
137723
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
137724
|
+
React$1.createElement("strong", null, "Dica:"),
|
|
137725
|
+
" Para eventos grandes, aumentar o intervalo de abertura (e.g. 20 minutos antes) permite que mais pessoas cheguem a tempo. Para eventos pequenos, 10 e 15 minutos geralmente \u00E9 o ideal.")))) : null));
|
|
137551
137726
|
};
|
|
137552
137727
|
|
|
137553
137728
|
let googleMapsScriptPromise = null;
|
|
@@ -138592,7 +138767,7 @@ const EventReviewStep = ({ formState, availableActivities, }) => {
|
|
|
138592
138767
|
React$1.createElement(Typography$1, { variant: "h6", sx: { mb: 2, display: "flex", alignItems: "center" } },
|
|
138593
138768
|
React$1.createElement(AccessTime, { sx: { mr: 1 } }),
|
|
138594
138769
|
" Janela de Check-in"),
|
|
138595
|
-
!formState.isAllDay ? (React$1.createElement(React$1.Fragment, null,
|
|
138770
|
+
formState.qrCheckinEnabled === false ? (React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" }, "Check-in desativado para este evento.")) : !formState.isAllDay ? (React$1.createElement(React$1.Fragment, null,
|
|
138596
138771
|
React$1.createElement(Typography$1, { variant: "body2", sx: { mb: 1 } },
|
|
138597
138772
|
React$1.createElement("strong", null, "Evento:"),
|
|
138598
138773
|
" ",
|
|
@@ -139451,7 +139626,7 @@ const EventActivitySelectionStep = ({ formState, validationErrors, onChange, ava
|
|
|
139451
139626
|
"):"),
|
|
139452
139627
|
React$1.createElement(Button$1, { variant: "text", size: "small", startIcon: React$1.createElement(Clear$1, null), onClick: handleClear, sx: { alignSelf: { xs: "stretch", sm: "flex-start" } } }, "Limpar todas")),
|
|
139453
139628
|
selectedActivities.map((activity) => {
|
|
139454
|
-
var _a, _b, _c, _d, _e, _f;
|
|
139629
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
139455
139630
|
return (React$1.createElement(Box$1, { key: activity.id, sx: {
|
|
139456
139631
|
mb: 1.5,
|
|
139457
139632
|
p: { xs: 1.25, sm: 1.5 },
|
|
@@ -139495,8 +139670,9 @@ const EventActivitySelectionStep = ({ formState, validationErrors, onChange, ava
|
|
|
139495
139670
|
} },
|
|
139496
139671
|
React$1.createElement(LabeledTimePicker, { label: "In\u00EDcio", value: activity.startTime || "", error: (_a = activityTimeValidation.errorsByActivityId[String(activity.id)]) === null || _a === void 0 ? void 0 : _a.startTime, helperText: ((_b = activityTimeValidation.errorsByActivityId[String(activity.id)]) === null || _b === void 0 ? void 0 : _b.startTime) || " ", onChange: (value) => handleActivityTimeChange(activity.id, "startTime", value), "data-testid": `event-activity-start-time-${activity.id}` }),
|
|
139497
139672
|
React$1.createElement(LabeledTimePicker, { label: "T\u00E9rmino", value: activity.endTime || "", error: (_c = activityTimeValidation.errorsByActivityId[String(activity.id)]) === null || _c === void 0 ? void 0 : _c.endTime, helperText: ((_d = activityTimeValidation.errorsByActivityId[String(activity.id)]) === null || _d === void 0 ? void 0 : _d.endTime) || " ", onChange: (value) => handleActivityTimeChange(activity.id, "endTime", value), "data-testid": `event-activity-end-time-${activity.id}` }),
|
|
139498
|
-
|
|
139499
|
-
|
|
139673
|
+
((_e = availableActivities.find((item) => String(item.id) === String(activity.id))) === null || _e === void 0 ? void 0 : _e.qrCheckinEnabled) !== false ? (React$1.createElement(React$1.Fragment, null,
|
|
139674
|
+
React$1.createElement(TextField$1, { fullWidth: true, label: checkinOpenLabel, type: "number", size: "small", value: (_f = activity.checkinStartWindowMinutes) !== null && _f !== void 0 ? _f : 10, onChange: (e) => handleActivityCheckinWindowChange(activity.id, "checkinStartWindowMinutes", e.target.value), InputLabelProps: { shrink: true }, inputProps: { min: 0, max: 120 }, helperText: isMobile ? "Antes do início" : "Minutos antes do início" }),
|
|
139675
|
+
React$1.createElement(TextField$1, { fullWidth: true, label: checkinCloseLabel, type: "number", size: "small", value: (_g = activity.checkinEndWindowMinutes) !== null && _g !== void 0 ? _g : 15, onChange: (e) => handleActivityCheckinWindowChange(activity.id, "checkinEndWindowMinutes", e.target.value), InputLabelProps: { shrink: true }, inputProps: { min: 0, max: 120 }, helperText: isMobile ? "Após o início" : "Minutos após o início" }))) : null),
|
|
139500
139676
|
React$1.createElement(Box$1, { sx: {
|
|
139501
139677
|
display: "flex",
|
|
139502
139678
|
alignItems: { xs: "flex-start", sm: "center" },
|
|
@@ -139736,6 +139912,7 @@ const EventLocationSchema = objectType({
|
|
|
139736
139912
|
}
|
|
139737
139913
|
});
|
|
139738
139914
|
const EventCheckinWindowSchema = objectType({
|
|
139915
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
139739
139916
|
checkinStartWindowMinutes: numberType()
|
|
139740
139917
|
.int()
|
|
139741
139918
|
.min(0, "Deve ser 0 ou maior")
|
|
@@ -139788,6 +139965,7 @@ const ActivitySchema$1 = objectType({
|
|
|
139788
139965
|
durationMinutes: numberType().optional(),
|
|
139789
139966
|
startTime: stringType().optional(), // HH:MM — per-activity start time for the event
|
|
139790
139967
|
endTime: stringType().optional(), // HH:MM — per-activity end time for the event
|
|
139968
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
139791
139969
|
checkinStartWindowMinutes: numberType().int().min(0).max(120).optional(),
|
|
139792
139970
|
checkinEndWindowMinutes: numberType().int().min(0).max(120).optional(),
|
|
139793
139971
|
qrReleaseOffsetMinutes: numberType().int().min(0).max(180).optional(),
|
|
@@ -139847,6 +140025,7 @@ const EventFormValuesSchema = objectType({
|
|
|
139847
140025
|
insumos: arrayType(anyType()).optional(),
|
|
139848
140026
|
activities: arrayType(ActivitySchema$1).optional(), // Changed from activity to activities
|
|
139849
140027
|
requiredActivityIds: arrayType(stringType()).optional(),
|
|
140028
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
139850
140029
|
checkinStartWindowMinutes: numberType()
|
|
139851
140030
|
.int()
|
|
139852
140031
|
.min(0)
|
|
@@ -139964,6 +140143,7 @@ const DEFAULT_FORM_STATE$3 = {
|
|
|
139964
140143
|
isAllDay: false,
|
|
139965
140144
|
startTime: "",
|
|
139966
140145
|
endTime: "",
|
|
140146
|
+
qrCheckinEnabled: true,
|
|
139967
140147
|
checkinStartWindowMinutes: 10,
|
|
139968
140148
|
checkinEndWindowMinutes: 15,
|
|
139969
140149
|
location: {
|
|
@@ -140004,24 +140184,26 @@ const EMPTY_SCHEMA = objectType({});
|
|
|
140004
140184
|
* Computes the initial form state from props, applying terreiro address
|
|
140005
140185
|
* defaults when the location type is "in terreiro".
|
|
140006
140186
|
*/
|
|
140007
|
-
const buildInitialFormState = (initialData, isTerreiroAddressEmpty, knownLocations) => {
|
|
140187
|
+
const buildInitialFormState = (initialData, isTerreiroAddressEmpty, knownLocations, isPersonalProfile = false) => {
|
|
140008
140188
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
140009
140189
|
const baseState = initialData !== null && initialData !== void 0 ? initialData : DEFAULT_FORM_STATE$3;
|
|
140010
|
-
const
|
|
140190
|
+
const withCheckin = isPersonalProfile
|
|
140191
|
+
? Object.assign(Object.assign({}, baseState), { qrCheckinEnabled: false }) : baseState;
|
|
140192
|
+
const isCreateFlow = !withCheckin.id;
|
|
140011
140193
|
if (isCreateFlow) {
|
|
140012
140194
|
const fallback = (knownLocations && knownLocations[0]) || "Endereço do Terreiro";
|
|
140013
|
-
const existingKnownLocation = ((_c = (_b = (_a =
|
|
140014
|
-
return Object.assign(Object.assign({},
|
|
140195
|
+
const existingKnownLocation = ((_c = (_b = (_a = withCheckin.location) === null || _a === void 0 ? void 0 : _a.knownLocation) === null || _b === void 0 ? void 0 : _b.trim) === null || _c === void 0 ? void 0 : _c.call(_b)) || "";
|
|
140196
|
+
return Object.assign(Object.assign({}, withCheckin), { location: Object.assign(Object.assign({}, withCheckin.location), { isInTerreiro: !isTerreiroAddressEmpty, knownLocation: !isTerreiroAddressEmpty
|
|
140015
140197
|
? existingKnownLocation || fallback
|
|
140016
|
-
: (_e = (_d =
|
|
140198
|
+
: (_e = (_d = withCheckin.location) === null || _d === void 0 ? void 0 : _d.knownLocation) !== null && _e !== void 0 ? _e : "" }) });
|
|
140017
140199
|
}
|
|
140018
|
-
const shouldDefaultToTerreiro = (_g = (_f =
|
|
140200
|
+
const shouldDefaultToTerreiro = (_g = (_f = withCheckin.location) === null || _f === void 0 ? void 0 : _f.isInTerreiro) !== null && _g !== void 0 ? _g : true;
|
|
140019
140201
|
if (shouldDefaultToTerreiro && !isTerreiroAddressEmpty) {
|
|
140020
|
-
const existing = ((_k = (_j = (_h =
|
|
140202
|
+
const existing = ((_k = (_j = (_h = withCheckin.location) === null || _h === void 0 ? void 0 : _h.knownLocation) === null || _j === void 0 ? void 0 : _j.trim) === null || _k === void 0 ? void 0 : _k.call(_j)) || "";
|
|
140021
140203
|
const fallback = (knownLocations && knownLocations[0]) || "Endereço do Terreiro";
|
|
140022
|
-
return Object.assign(Object.assign({},
|
|
140204
|
+
return Object.assign(Object.assign({}, withCheckin), { location: Object.assign(Object.assign({}, withCheckin.location), { isInTerreiro: true, knownLocation: existing || fallback }) });
|
|
140023
140205
|
}
|
|
140024
|
-
return
|
|
140206
|
+
return withCheckin;
|
|
140025
140207
|
};
|
|
140026
140208
|
// ---------------------------------------------------------------------------
|
|
140027
140209
|
// Hook
|
|
@@ -140031,7 +140213,7 @@ const useEventOnboarding = (props) => {
|
|
|
140031
140213
|
const { initialData, isTerreiroAddressEmpty, knownLocations, createFromModel, availableActivities, canAddActivities = true, activityQuotaMessage, canCreateTemplates = true, templateQuotaMessage, availableMembers, availableInsumos, onComplete, onCancel, onStepChange: onStepChangeProp, onRequestAISuggestions, isAISuggestionsLoading = false, isPersonalProfile = false, enableGoogleAddress = false, googleMapsApiKey, googleCountryCode = "br", googleLanguage = "pt-BR", } = props;
|
|
140032
140214
|
const [isLoading, setIsLoading] = React$1.useState(false);
|
|
140033
140215
|
const [error, setError] = React$1.useState();
|
|
140034
|
-
const initialFormState = React$1.useMemo(() => buildInitialFormState(initialData, isTerreiroAddressEmpty, knownLocations), [initialData, isTerreiroAddressEmpty, knownLocations]);
|
|
140216
|
+
const initialFormState = React$1.useMemo(() => buildInitialFormState(initialData, isTerreiroAddressEmpty, knownLocations, isPersonalProfile), [initialData, isTerreiroAddressEmpty, knownLocations, isPersonalProfile]);
|
|
140035
140217
|
// -----------------------------------------------------------------------
|
|
140036
140218
|
// Step definitions — pure data, no inline wrapper components
|
|
140037
140219
|
// -----------------------------------------------------------------------
|
|
@@ -140074,7 +140256,7 @@ const useEventOnboarding = (props) => {
|
|
|
140074
140256
|
id: "checkin-window",
|
|
140075
140257
|
label: "Check-in",
|
|
140076
140258
|
title: "Configurar Check-in",
|
|
140077
|
-
description: "
|
|
140259
|
+
description: "Escolha se haverá check-in e, se houver, o período permitido",
|
|
140078
140260
|
component: EventCheckinWindowStep,
|
|
140079
140261
|
},
|
|
140080
140262
|
]),
|
|
@@ -140391,17 +140573,18 @@ const EventDateTime = ({ event, checkinWindow, formatDate, formatTime, theme, })
|
|
|
140391
140573
|
? formatTime(firstOccurrence.endTime)
|
|
140392
140574
|
: "Não definido"))),
|
|
140393
140575
|
isAllDay && (React$1.createElement(Chip$1, { label: "Dia inteiro", size: "small", color: "primary", variant: "outlined", sx: { mb: 1.5 } })),
|
|
140394
|
-
React$1.createElement(
|
|
140395
|
-
React$1.createElement(
|
|
140396
|
-
|
|
140397
|
-
|
|
140398
|
-
|
|
140399
|
-
|
|
140400
|
-
|
|
140401
|
-
"
|
|
140402
|
-
|
|
140403
|
-
|
|
140404
|
-
|
|
140576
|
+
event.qrCheckinEnabled !== false ? (React$1.createElement(React$1.Fragment, null,
|
|
140577
|
+
React$1.createElement(Box$1, { sx: { display: "flex", alignItems: "center", mb: 0.75 } },
|
|
140578
|
+
React$1.createElement(AccessTime, { sx: {
|
|
140579
|
+
mr: 1.5,
|
|
140580
|
+
color: "text.secondary",
|
|
140581
|
+
fontSize: { xs: 18, sm: 20 },
|
|
140582
|
+
} }),
|
|
140583
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mr: 1 } },
|
|
140584
|
+
"Check-in v\u00E1lido: ",
|
|
140585
|
+
getCheckinSummary()),
|
|
140586
|
+
checkinWindow ? (React$1.createElement(Chip$1, { label: stateLabel[checkinWindow.state], size: "small", color: stateColor[checkinWindow.state], variant: "outlined" })) : null),
|
|
140587
|
+
getCheckinExplanation() ? (React$1.createElement(Typography$1, { variant: "caption", color: "text.secondary" }, getCheckinExplanation())) : null)) : null)));
|
|
140405
140588
|
};
|
|
140406
140589
|
var EventDateTime$1 = React$1.memo(EventDateTime);
|
|
140407
140590
|
|
|
@@ -140932,7 +141115,9 @@ const EventActivities = ({ event, theme, formatDate, formatTime, canChangeActivi
|
|
|
140932
141115
|
} },
|
|
140933
141116
|
React$1.createElement(Typography$1, { variant: "h6", fontWeight: "medium" }, activity.title),
|
|
140934
141117
|
React$1.createElement(Box$1, { sx: { display: "flex", gap: 1, alignItems: "flex-start" } },
|
|
140935
|
-
!isModelEvent &&
|
|
141118
|
+
!isModelEvent &&
|
|
141119
|
+
onActivityQrOpen &&
|
|
141120
|
+
activity.qrCheckinEnabled !== false && (React$1.createElement(Box$1, { sx: {
|
|
140936
141121
|
display: "flex",
|
|
140937
141122
|
flexDirection: "column",
|
|
140938
141123
|
alignItems: "flex-end",
|
|
@@ -140989,6 +141174,7 @@ const EventActivities = ({ event, theme, formatDate, formatTime, canChangeActivi
|
|
|
140989
141174
|
? formatTime(activity.occurrences[0].endTime)
|
|
140990
141175
|
: "Não definido")))),
|
|
140991
141176
|
!isModelEvent &&
|
|
141177
|
+
activity.qrCheckinEnabled !== false &&
|
|
140992
141178
|
(() => {
|
|
140993
141179
|
var _a, _b, _c, _d;
|
|
140994
141180
|
const startMinutes = parseTimeToMinutes$2((_b = (_a = activity.occurrences) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.startTime);
|
|
@@ -141465,6 +141651,7 @@ const TerreiroSchema = objectType({
|
|
|
141465
141651
|
const ActivitySchema = objectType({
|
|
141466
141652
|
id: stringType(),
|
|
141467
141653
|
requiredForConfirmation: booleanType().optional(),
|
|
141654
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
141468
141655
|
qrReleaseOffsetMinutes: numberType().nullable().optional(),
|
|
141469
141656
|
qrCheckinGraceMinutes: numberType().nullable().optional(),
|
|
141470
141657
|
checkinStartWindowMinutes: numberType().nullable().optional(),
|
|
@@ -141491,6 +141678,7 @@ const EventDetailSchema = objectType({
|
|
|
141491
141678
|
name: stringType().optional(),
|
|
141492
141679
|
description: stringType().optional(),
|
|
141493
141680
|
isTemplate: booleanType().optional(),
|
|
141681
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
141494
141682
|
qrReleaseOffsetMinutes: numberType().nullable().optional(),
|
|
141495
141683
|
qrCheckinGraceMinutes: numberType().nullable().optional(),
|
|
141496
141684
|
checkinStartWindowMinutes: numberType().nullable().optional(),
|
|
@@ -142018,7 +142206,9 @@ const EventDetailPage = (props) => {
|
|
|
142018
142206
|
}
|
|
142019
142207
|
const statusOptions = data.getStatusMenuOptions(data.event);
|
|
142020
142208
|
const currentMember = (_c = data.event.members) === null || _c === void 0 ? void 0 : _c.list.find((m) => m.id === data.currentMemberId);
|
|
142021
|
-
const
|
|
142209
|
+
const checkinEnabled = data.event.qrCheckinEnabled !== false;
|
|
142210
|
+
const canShowCheckinCta = checkinEnabled &&
|
|
142211
|
+
props.canScanCheckin &&
|
|
142022
142212
|
((_d = props.checkinWindow) === null || _d === void 0 ? void 0 : _d.state) === "active" &&
|
|
142023
142213
|
!(currentMember === null || currentMember === void 0 ? void 0 : currentMember.confirmedAt) &&
|
|
142024
142214
|
!props.isPersonalProfile;
|
|
@@ -142053,7 +142243,7 @@ const EventDetailPage = (props) => {
|
|
|
142053
142243
|
React$1.createElement(Stack$1, { spacing: LIST_GAP },
|
|
142054
142244
|
React$1.createElement(EventInfo$1, { event: data.event, canChangeStatus: props.canChangeStatus || false, canUseModel: props.canUseModel || false, statusOptions: statusOptions, onStatusChange: (status) => fns.handleChangeStatus(status), onUseModel: fns.handleUseModel, theme: theme }),
|
|
142055
142245
|
React$1.createElement(EventDateTime$1, { event: data.event, checkinWindow: props.checkinWindow, formatDate: data.formatDate, formatTime: data.formatTime, theme: theme }),
|
|
142056
|
-
props.canManageQr && (React$1.createElement(EventAttendanceQr, { attendanceQr: props.attendanceQr, onRefreshQrState: props.onRefreshQrState, onCopyCode: fns.handleCopyCode })),
|
|
142246
|
+
props.canManageQr && checkinEnabled && (React$1.createElement(EventAttendanceQr, { attendanceQr: props.attendanceQr, onRefreshQrState: props.onRefreshQrState, onCopyCode: fns.handleCopyCode })),
|
|
142057
142247
|
props.canManageTickets && (React$1.createElement(EventPublicTickets$1, { onManageTickets: props.onManageTickets, theme: theme })),
|
|
142058
142248
|
data.event.address && (React$1.createElement(EventAddress$1, { event: data.event, theme: theme })),
|
|
142059
142249
|
data.event.activities && data.event.activities.count > 0 && (React$1.createElement(EventActivities$1, { event: data.event, theme: theme, formatDate: data.formatDate, formatTime: data.formatTime, activityAttendanceQrById: props.activityAttendanceQrById, canChangeActivityStatus: props.canChangeActivityStatus || false, getStatusMenuOptions: data.getActivityStatusMenuOptions, onChangeActivityStatus: fns.handleChangeActivityStatus, onBulkChangeActivityStatus: fns.handleBulkChangeActivityStatus, onActivityQrOpen: props.canManageQr ? setSelectedActivityQrId : undefined })),
|
|
@@ -142234,6 +142424,8 @@ const TicketVoucherPage = ({ isLoading, errorMessage, code, eventTitle, terreiro
|
|
|
142234
142424
|
|
|
142235
142425
|
const EventTicketingManagementPage = ({ eventName, shareUrl, terreiroShareUrl, published = false, publicTitle = "", maxTicketsPerEmail = 2, batches = [], holders = [], isSaving, saveError, checkInMessage, onSave, onExportCsv, onCheckIn, useChat = false, chat, canCheckIn = false, isCheckingIn = false, parseTicketQr, }) => {
|
|
142236
142426
|
var _a;
|
|
142427
|
+
const theme = useTheme$1();
|
|
142428
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
142237
142429
|
const [title, setTitle] = React$1.useState(publicTitle);
|
|
142238
142430
|
const [isPublished, setIsPublished] = React$1.useState(published);
|
|
142239
142431
|
const [emailLimit, setEmailLimit] = React$1.useState(maxTicketsPerEmail);
|
|
@@ -142308,17 +142500,24 @@ const EventTicketingManagementPage = ({ eventName, shareUrl, terreiroShareUrl, p
|
|
|
142308
142500
|
React$1.createElement(CardContent$1, null,
|
|
142309
142501
|
React$1.createElement(Stack$1, { spacing: 2 },
|
|
142310
142502
|
React$1.createElement(Typography$1, { variant: "h6" }, "Check-in na porta"),
|
|
142311
|
-
React$1.createElement(Stack$1, { direction: "row", spacing: 1 },
|
|
142503
|
+
React$1.createElement(Stack$1, { direction: isMobile ? "column" : "row", spacing: 1, alignItems: isMobile ? "stretch" : "center" },
|
|
142312
142504
|
React$1.createElement(TextField$1, { label: "Codigo do ingresso", value: checkInCode, onChange: (event) => setCheckInCode(event.target.value), inputProps: { "data-testid": "ticketing-checkin-code" } }),
|
|
142313
142505
|
React$1.createElement(Button$1, { variant: "contained", onClick: () => onCheckIn === null || onCheckIn === void 0 ? void 0 : onCheckIn(checkInCode), "data-testid": "ticketing-checkin-submit" }, "Validar"),
|
|
142314
142506
|
canCheckIn ? (React$1.createElement(Button$1, { variant: "outlined", onClick: () => setIsScannerOpen(true), "data-testid": "ticketing-checkin-scan" }, "Escanear QR")) : null),
|
|
142315
142507
|
checkInMessage ? React$1.createElement(Alert$1, { severity: "success" }, checkInMessage) : null))),
|
|
142316
142508
|
React$1.createElement(Card$1, null,
|
|
142317
142509
|
React$1.createElement(CardContent$1, null,
|
|
142318
|
-
React$1.createElement(Stack$1, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { mb: 2 } },
|
|
142510
|
+
React$1.createElement(Stack$1, { direction: isMobile ? "column" : "row", justifyContent: "space-between", alignItems: isMobile ? "flex-start" : "center", spacing: 1, sx: { mb: 2 } },
|
|
142319
142511
|
React$1.createElement(Typography$1, { variant: "h6" }, "Titulares"),
|
|
142320
142512
|
React$1.createElement(Button$1, { onClick: onExportCsv, "data-testid": "ticketing-export-csv" }, "Exportar CSV")),
|
|
142321
|
-
React$1.createElement(
|
|
142513
|
+
isMobile ? (React$1.createElement(Stack$1, { divider: React$1.createElement(Box$1, { sx: { borderBottom: 1, borderColor: "divider" } }) }, holders.map((holder) => (React$1.createElement(Box$1, { key: holder.code, sx: { py: 1.25 } },
|
|
142514
|
+
React$1.createElement(Typography$1, { fontWeight: 600 }, holder.holderName),
|
|
142515
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
142516
|
+
holder.status,
|
|
142517
|
+
holder.holderEmail ? ` · ${holder.holderEmail}` : ""),
|
|
142518
|
+
React$1.createElement(Typography$1, { variant: "caption", color: "text.secondary" },
|
|
142519
|
+
holder.code,
|
|
142520
|
+
holder.batchName ? ` · ${holder.batchName}` : "")))))) : (React$1.createElement(Table$1, { size: "small" },
|
|
142322
142521
|
React$1.createElement(TableHead$1, null,
|
|
142323
142522
|
React$1.createElement(TableRow$1, null,
|
|
142324
142523
|
React$1.createElement(TableCell$1, null, "Codigo"),
|
|
@@ -142331,7 +142530,7 @@ const EventTicketingManagementPage = ({ eventName, shareUrl, terreiroShareUrl, p
|
|
|
142331
142530
|
React$1.createElement(TableCell$1, null, holder.holderName),
|
|
142332
142531
|
React$1.createElement(TableCell$1, null, holder.holderEmail),
|
|
142333
142532
|
React$1.createElement(TableCell$1, null, holder.batchName),
|
|
142334
|
-
React$1.createElement(TableCell$1, null, holder.status)))))))),
|
|
142533
|
+
React$1.createElement(TableCell$1, null, holder.status))))))))),
|
|
142335
142534
|
React$1.createElement(Dialog$1, { open: isScannerOpen, onClose: () => setIsScannerOpen(false), fullWidth: true, maxWidth: "sm" },
|
|
142336
142535
|
React$1.createElement(DialogTitle$1, null, "Escanear ingresso"),
|
|
142337
142536
|
React$1.createElement(DialogContent$1, { dividers: true },
|
|
@@ -143073,6 +143272,8 @@ const formatMinutesToHHMM$1 = (totalMinutes) => {
|
|
|
143073
143272
|
};
|
|
143074
143273
|
const getConfiguredCheckinWindow = (event) => {
|
|
143075
143274
|
var _a, _b, _c, _d, _e;
|
|
143275
|
+
if (event.qrCheckinEnabled === false)
|
|
143276
|
+
return null;
|
|
143076
143277
|
const startTime = (_c = (_b = (_a = event.occurrences) === null || _a === void 0 ? void 0 : _a.list) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.startTime;
|
|
143077
143278
|
const startMinutes = parseTimeToMinutes$1(startTime);
|
|
143078
143279
|
if (startMinutes === null)
|
|
@@ -143202,9 +143403,25 @@ const EventCard = ({ event, isLast, onSelect, onEdit, getEventTypeLabel, theme }
|
|
|
143202
143403
|
event.insumos.count,
|
|
143203
143404
|
")"))))));
|
|
143204
143405
|
};
|
|
143406
|
+
const EventCompactRow = ({ event, isLast, onSelect, onEdit, getEventTypeLabel }) => {
|
|
143407
|
+
var _a, _b;
|
|
143408
|
+
const occurrence = (_b = (_a = event.occurrences) === null || _a === void 0 ? void 0 : _a.list) === null || _b === void 0 ? void 0 : _b[0];
|
|
143409
|
+
const dateParts = compactListDateParts(occurrence === null || occurrence === void 0 ? void 0 : occurrence.date);
|
|
143410
|
+
const dateTime = formatEventDateTime(event);
|
|
143411
|
+
const rawTitle = event.title || event.name || "Sem título";
|
|
143412
|
+
const meta = [
|
|
143413
|
+
dateTime.time,
|
|
143414
|
+
event.type ? getEventTypeLabel(event.type) : null,
|
|
143415
|
+
]
|
|
143416
|
+
.filter(Boolean)
|
|
143417
|
+
.join(" · ");
|
|
143418
|
+
return (React$1.createElement(CompactListRow, { title: rawTitle, meta: meta, isLast: isLast, onClick: () => onSelect(event.id), leading: dateParts ? (React$1.createElement(CompactListDateBlock, { day: dateParts.day, month: dateParts.month })) : (React$1.createElement(CalendarToday, { fontSize: "small", color: "action" })), trailing: onEdit ? (React$1.createElement(IconButton$1, { "aria-label": `Editar ${rawTitle}`, onClick: () => onEdit(event.id), sx: { width: 44, height: 44 } },
|
|
143419
|
+
React$1.createElement(ArrowForwardIos, { sx: { width: 16 } }))) : undefined }));
|
|
143420
|
+
};
|
|
143205
143421
|
const EventsPage = (props) => {
|
|
143206
143422
|
var _a;
|
|
143207
143423
|
const theme = useTheme$1();
|
|
143424
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
143208
143425
|
const { data, fns } = useEventsPage(props);
|
|
143209
143426
|
const periodInputValue = (_a = props.periodInputValue) !== null && _a !== void 0 ? _a : `${new Date().getFullYear()}-${String(new Date().getMonth() + 1).padStart(2, "0")}`;
|
|
143210
143427
|
// Memoized tab list for maintainability
|
|
@@ -143253,7 +143470,13 @@ const EventsPage = (props) => {
|
|
|
143253
143470
|
backgroundColor: theme.palette.background.default,
|
|
143254
143471
|
position: "relative",
|
|
143255
143472
|
} },
|
|
143256
|
-
React$1.createElement(PageHeader$2, { title: "Eventos", onBack: fns.handleBack, onAdd: fns.handleAddEvent, addLabel: "Adicionar", showAddButton: props.isAdmin,
|
|
143473
|
+
React$1.createElement(PageHeader$2, { title: "Eventos", onBack: fns.handleBack, onAdd: fns.handleAddEvent, addLabel: "Adicionar", showAddButton: props.isAdmin, hideAddButtonOnMobile: true, endAction: props.canExportParticipationReport &&
|
|
143474
|
+
props.onExportParticipationReport ? (React$1.createElement(IconButton$1, { "aria-label": "Exportar Participa\u00E7\u00E3o", onClick: props.onExportParticipationReport, disabled: props.isExportingParticipationReport, "data-testid": "events-export-participation-icon", sx: {
|
|
143475
|
+
display: { xs: "inline-flex", sm: "none" },
|
|
143476
|
+
width: 44,
|
|
143477
|
+
height: 44,
|
|
143478
|
+
} },
|
|
143479
|
+
React$1.createElement(Download, null))) : undefined, tabs: tabs.map((status) => ({
|
|
143257
143480
|
value: status,
|
|
143258
143481
|
label: data.getStatusLabel(status),
|
|
143259
143482
|
})), selectedTab: safeSelectedTab, onTabChange: (value) => fns.handleTabChange(value) }),
|
|
@@ -143269,7 +143492,7 @@ const EventsPage = (props) => {
|
|
|
143269
143492
|
React$1.createElement(Box$1, { sx: { width: { xs: "100%", sm: 260 } } },
|
|
143270
143493
|
React$1.createElement(LabeledMonthPicker, { label: "Per\u00EDodo", value: periodInputValue, onChange: (nextValue) => { var _a; return (_a = props.onPeriodInputChange) === null || _a === void 0 ? void 0 : _a.call(props, nextValue); }, "data-testid": "events-period-input" })),
|
|
143271
143494
|
props.canExportParticipationReport &&
|
|
143272
|
-
props.onExportParticipationReport && (React$1.createElement(Button$1, { variant: "outlined", startIcon: React$1.createElement(Download, null), onClick: props.onExportParticipationReport, disabled: props.isExportingParticipationReport, "data-testid": "events-export-participation-button" }, props.isExportingParticipationReport
|
|
143495
|
+
props.onExportParticipationReport && (React$1.createElement(Button$1, { variant: "outlined", startIcon: React$1.createElement(Download, null), onClick: props.onExportParticipationReport, disabled: props.isExportingParticipationReport, "data-testid": "events-export-participation-button", sx: { display: { xs: "none", sm: "inline-flex" } } }, props.isExportingParticipationReport
|
|
143273
143496
|
? "Exportando..."
|
|
143274
143497
|
: "Exportar Participação"))),
|
|
143275
143498
|
React$1.createElement(Box$1, { sx: Object.assign({ flex: 1, pb: LIST_CONTENT_BOTTOM_PADDING }, LIST_CARD_CONTENT_ROOT_SX) }, data.events.length === 0 ? (React$1.createElement(Box$1, { sx: {
|
|
@@ -143286,14 +143509,15 @@ const EventsPage = (props) => {
|
|
|
143286
143509
|
props.isAdmin && (React$1.createElement(React$1.Fragment, null,
|
|
143287
143510
|
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mb: SECTION_GAP } }, "Toque no bot\u00E3o + para criar um novo evento"),
|
|
143288
143511
|
React$1.createElement(QuotaGuard, { feature: "events", behavior: "disable" },
|
|
143289
|
-
React$1.createElement(Button$1, { variant: "contained", startIcon: React$1.createElement(Add$1, null), onClick: fns.handleAddEvent }, "Criar evento")))))) : (React$1.createElement(
|
|
143290
|
-
|
|
143291
|
-
|
|
143292
|
-
|
|
143293
|
-
|
|
143294
|
-
|
|
143295
|
-
|
|
143296
|
-
|
|
143512
|
+
React$1.createElement(Button$1, { variant: "contained", startIcon: React$1.createElement(Add$1, null), onClick: fns.handleAddEvent }, "Criar evento")))))) : (isMobile ? (React$1.createElement(Box$1, { sx: {
|
|
143513
|
+
bgcolor: "background.paper",
|
|
143514
|
+
borderRadius: RADIUS.default,
|
|
143515
|
+
border: 1,
|
|
143516
|
+
borderColor: "divider",
|
|
143517
|
+
overflow: "hidden",
|
|
143518
|
+
} }, data.events.map((event, index) => (React$1.createElement(EventCompactRow, { key: event.id, event: event, isLast: index === data.events.length - 1, onSelect: fns.handleEventSelect, onEdit: props.onEventEdit ? fns.handleEventEdit : undefined, getEventTypeLabel: data.getEventTypeLabel }))))) : (React$1.createElement(Stack$1, { spacing: LIST_GAP }, data.events.map((event, index) => (React$1.createElement(EventCard, { key: event.id, event: event, isLast: index === data.events.length - 1, onSelect: fns.handleEventSelect, onEdit: fns.handleEventEdit, getEventTypeLabel: data.getEventTypeLabel, getStatusLabel: data.getStatusLabel, theme: theme }))))))),
|
|
143519
|
+
props.isAdmin && !props.hideAddFab && data.events.length > 0 && (React$1.createElement(QuotaGuard, { feature: "events", behavior: "hide" },
|
|
143520
|
+
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar evento", onClick: fns.handleAddEvent, sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.speedDial }) },
|
|
143297
143521
|
React$1.createElement(Add$1, null)))))));
|
|
143298
143522
|
};
|
|
143299
143523
|
|
|
@@ -144342,9 +144566,9 @@ const FinancialAccountsList = (props) => {
|
|
|
144342
144566
|
minHeight: "100vh",
|
|
144343
144567
|
backgroundColor: theme.palette.background.default,
|
|
144344
144568
|
position: "relative",
|
|
144345
|
-
pb:
|
|
144569
|
+
pb: 0,
|
|
144346
144570
|
} },
|
|
144347
|
-
React$1.createElement(PageHeader$2, { title: "Financeiro", onBack: props.onBack, onAdd: props.onAddAccount, addLabel: "Adicionar", showAddButton: true }),
|
|
144571
|
+
React$1.createElement(PageHeader$2, { title: "Financeiro", onBack: props.onBack, onAdd: props.onAddAccount, addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
|
|
144348
144572
|
React$1.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
|
|
144349
144573
|
showPeriodFilter && (React$1.createElement(Stack$1, { direction: { xs: "column", sm: "row" }, spacing: SECTION_GAP, alignItems: { xs: "flex-start", sm: "center" }, justifyContent: "space-between", sx: { pb: LIST_CONTROLS_MARGIN_BOTTOM } },
|
|
144350
144574
|
React$1.createElement(Stack$1, { spacing: 0.5 },
|
|
@@ -144386,12 +144610,7 @@ const FinancialAccountsList = (props) => {
|
|
|
144386
144610
|
} },
|
|
144387
144611
|
isEmpty && (React$1.createElement(EmptyState$2, { onAddAccount: props.onAddAccount, theme: theme })),
|
|
144388
144612
|
!isEmpty && accountsList)),
|
|
144389
|
-
isMobile && (React$1.createElement(Fab$1, { "data-testid": "financial-account-fab-add", color: "primary", "aria-label": "Adicionar Conta", onClick: props.onAddAccount, sx: {
|
|
144390
|
-
position: "fixed",
|
|
144391
|
-
bottom: 16,
|
|
144392
|
-
right: 16,
|
|
144393
|
-
zIndex: theme.zIndex.fab,
|
|
144394
|
-
} },
|
|
144613
|
+
isMobile && !isEmpty && (React$1.createElement(Fab$1, { "data-testid": "financial-account-fab-add", color: "primary", "aria-label": "Adicionar Conta", onClick: props.onAddAccount, sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.fab }) },
|
|
144395
144614
|
React$1.createElement(Add$1, null))))));
|
|
144396
144615
|
};
|
|
144397
144616
|
var FinancialAccountsList$1 = React$1.memo(FinancialAccountsList);
|
|
@@ -146033,11 +146252,11 @@ const IncomeListItem = React$1.memo(function IncomeListItem({ item, idx, isLastI
|
|
|
146033
146252
|
React$1.createElement(ListItemSecondaryAction$1, null,
|
|
146034
146253
|
React$1.createElement(Stack$1, { spacing: 1, alignItems: "flex-end" },
|
|
146035
146254
|
React$1.createElement(Typography$1, { variant: "subtitle1", sx: { fontWeight: 600 } }, formattedAmount),
|
|
146036
|
-
canConfirmTransactions && item.id && onToggleSettlementStatus ? (React$1.createElement(
|
|
146255
|
+
canConfirmTransactions && item.id && onToggleSettlementStatus ? (React$1.createElement(IconButton$1, { "aria-label": settlementActionLabel, disabled: Boolean(isUpdatingSettlementStatus), onClick: (event) => {
|
|
146037
146256
|
event.stopPropagation();
|
|
146038
146257
|
item.id &&
|
|
146039
146258
|
onToggleSettlementStatus(item.id, nextSettlementStatus);
|
|
146040
|
-
} },
|
|
146259
|
+
}, sx: { width: 44, height: 44 } }, settlementStatus === "PROJECTED" ? React$1.createElement(Check$1, null) : React$1.createElement(UndoIcon, null))) : null))),
|
|
146041
146260
|
!isLastItem && React$1.createElement(Divider$1, { component: "li", variant: "inset" })));
|
|
146042
146261
|
});
|
|
146043
146262
|
const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue, periodInputMin, periodInputMax, showPeriodFilter, onPeriodInputChange, onResetToCurrentPeriod, canConfirmTransactions, isUpdatingSettlementStatus, onToggleSettlementStatus, data, }) => {
|
|
@@ -146074,14 +146293,18 @@ const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue
|
|
|
146074
146293
|
*
|
|
146075
146294
|
* These numbers are numeric pixel values used for paddingTop on the scrollable container.
|
|
146076
146295
|
*/
|
|
146077
|
-
const headerHeight =
|
|
146296
|
+
const headerHeight = 80;
|
|
146078
146297
|
const shouldShowPeriodFilter = showPeriodFilter !== null && showPeriodFilter !== void 0 ? showPeriodFilter : Boolean(periodLabel ||
|
|
146079
146298
|
periodInputValue ||
|
|
146080
146299
|
onPeriodInputChange ||
|
|
146081
146300
|
onResetToCurrentPeriod);
|
|
146082
|
-
const filterHeight = shouldShowPeriodFilter ?
|
|
146083
|
-
const cardHeight =
|
|
146084
|
-
const contentOffset = filterHeight + cardHeight + 16;
|
|
146301
|
+
const filterHeight = shouldShowPeriodFilter ? 72 : 0;
|
|
146302
|
+
const cardHeight = 96;
|
|
146303
|
+
const contentOffset = isMobile ? 0 : filterHeight + cardHeight + 16;
|
|
146304
|
+
const amountLabel = totalAmountNumber.toLocaleString("pt-BR", {
|
|
146305
|
+
style: "currency",
|
|
146306
|
+
currency: "BRL",
|
|
146307
|
+
});
|
|
146085
146308
|
const incomes = React$1.useMemo(() => (Array.isArray(dataSource.incomes) ? dataSource.incomes : []), [dataSource.incomes]);
|
|
146086
146309
|
return (React$1.createElement(Box$1, { sx: {
|
|
146087
146310
|
display: "flex",
|
|
@@ -146091,8 +146314,10 @@ const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue
|
|
|
146091
146314
|
position: "relative",
|
|
146092
146315
|
//pb: isMobile ? 2 : 0,
|
|
146093
146316
|
} },
|
|
146094
|
-
React$1.createElement(PageHeader$2, { title: "Entradas", onBack: onBack, onAdd: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), addLabel: "Adicionar", showAddButton: true }),
|
|
146095
|
-
React$1.createElement(
|
|
146317
|
+
React$1.createElement(PageHeader$2, { title: "Entradas", onBack: onBack, onAdd: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
|
|
146318
|
+
isMobile && shouldShowPeriodFilter ? (React$1.createElement(Container$1, { maxWidth: "md", sx: { px: PAGE_LIST_CONTAINER_SPACING.px, pt: 1 } },
|
|
146319
|
+
React$1.createElement(FinanceMobilePeriodBar, { periodLabel: periodLabel || metricPeriodLabel, amountLabel: amountLabel, periodInputValue: periodInputValue, periodInputMin: periodInputMin, periodInputMax: periodInputMax, onPeriodInputChange: onPeriodInputChange, onResetToCurrentPeriod: onResetToCurrentPeriod, testIdPrefix: "income" }))) : null,
|
|
146320
|
+
!isMobile && (React$1.createElement(Box$1, { component: "section", "aria-hidden": true, sx: {
|
|
146096
146321
|
position: "fixed",
|
|
146097
146322
|
left: 0,
|
|
146098
146323
|
right: 0,
|
|
@@ -146129,10 +146354,10 @@ const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue
|
|
|
146129
146354
|
style: "currency",
|
|
146130
146355
|
currency: "BRL",
|
|
146131
146356
|
})
|
|
146132
|
-
: `R$: ${amount}` })))),
|
|
146357
|
+
: `R$: ${amount}` }))))),
|
|
146133
146358
|
React$1.createElement(Container$1, { maxWidth: "md", sx: Object.assign(Object.assign({}, PAGE_LIST_CONTAINER_SPACING), {
|
|
146134
146359
|
// push content below the fixed header + card
|
|
146135
|
-
paddingTop: `${contentOffset}px`,
|
|
146360
|
+
paddingTop: isMobile ? undefined : `${contentOffset}px`, pb: LIST_CONTENT_BOTTOM_PADDING,
|
|
146136
146361
|
// ensure content can scroll beneath fixed card
|
|
146137
146362
|
position: "relative", zIndex: 0 }) },
|
|
146138
146363
|
incomes.length === 0 ? (React$1.createElement(Box$1, { sx: {
|
|
@@ -146156,13 +146381,8 @@ const IncomeListPage = ({ onBack, onAdd, onSelect, periodLabel, periodInputValue
|
|
|
146156
146381
|
var _a, _b;
|
|
146157
146382
|
return (React$1.createElement(IncomeListItem, { key: `${(_a = inc.date) !== null && _a !== void 0 ? _a : ""}-${idx}-${(_b = inc.amount) !== null && _b !== void 0 ? _b : ""}`, item: inc, idx: idx, isLastItem: idx === incomes.length - 1, formatCurrency: formatCurrency, formatDate: formatDate, getAccountName: getAccountName, onSelect: onSelect, canConfirmTransactions: canConfirmTransactions, isUpdatingSettlementStatus: isUpdatingSettlementStatus, onToggleSettlementStatus: onToggleSettlementStatus }));
|
|
146158
146383
|
}))),
|
|
146159
|
-
isMobile && (React$1.createElement(QuotaGuard, { feature: "incomes", behavior: "hide" },
|
|
146160
|
-
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar Entrada", title: "Adicionar Entrada", onClick: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), sx: {
|
|
146161
|
-
position: "fixed",
|
|
146162
|
-
bottom: 16,
|
|
146163
|
-
right: 16,
|
|
146164
|
-
zIndex: theme.zIndex.fab,
|
|
146165
|
-
} },
|
|
146384
|
+
isMobile && incomes.length > 0 && (React$1.createElement(QuotaGuard, { feature: "incomes", behavior: "hide" },
|
|
146385
|
+
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar Entrada", title: "Adicionar Entrada", onClick: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.fab }) },
|
|
146166
146386
|
React$1.createElement(Add$1, null)))))));
|
|
146167
146387
|
};
|
|
146168
146388
|
var IncomeListPage$1 = React$1.memo(IncomeListPage);
|
|
@@ -146657,12 +146877,12 @@ const OutcomeListItem = React$1.memo(function OutcomeListItem({ item, idx, isLas
|
|
|
146657
146877
|
React$1.createElement(ListItemSecondaryAction$1, null,
|
|
146658
146878
|
React$1.createElement(Stack$1, { spacing: 1, alignItems: "flex-end" },
|
|
146659
146879
|
React$1.createElement(Typography$1, { variant: "subtitle1", sx: { fontWeight: 600 } }, formattedAmount),
|
|
146660
|
-
canConfirmTransactions && item.id && onToggleSettlementStatus ? (React$1.createElement(
|
|
146880
|
+
canConfirmTransactions && item.id && onToggleSettlementStatus ? (React$1.createElement(IconButton$1, { "aria-label": settlementActionLabel, disabled: Boolean(isUpdatingSettlementStatus), onClick: (event) => {
|
|
146661
146881
|
event.stopPropagation();
|
|
146662
146882
|
if (!item.id)
|
|
146663
146883
|
return;
|
|
146664
146884
|
onToggleSettlementStatus(item.id, nextSettlementStatus);
|
|
146665
|
-
} },
|
|
146885
|
+
}, sx: { width: 44, height: 44 } }, settlementStatus === "PROJECTED" ? React$1.createElement(Check$1, null) : React$1.createElement(UndoIcon, null))) : null))),
|
|
146666
146886
|
!isLastItem && React$1.createElement(Divider$1, { component: "li" })));
|
|
146667
146887
|
});
|
|
146668
146888
|
const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValue, periodInputMin, periodInputMax, showPeriodFilter, onPeriodInputChange, onResetToCurrentPeriod, canConfirmTransactions, isUpdatingSettlementStatus, onToggleSettlementStatus, data, }) => {
|
|
@@ -146685,14 +146905,18 @@ const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValu
|
|
|
146685
146905
|
*
|
|
146686
146906
|
* These numbers are numeric pixel values used for paddingTop on the scrollable container.
|
|
146687
146907
|
*/
|
|
146688
|
-
const headerHeight =
|
|
146908
|
+
const headerHeight = 64;
|
|
146689
146909
|
const shouldShowPeriodFilter = showPeriodFilter !== null && showPeriodFilter !== void 0 ? showPeriodFilter : Boolean(periodLabel ||
|
|
146690
146910
|
periodInputValue ||
|
|
146691
146911
|
onPeriodInputChange ||
|
|
146692
146912
|
onResetToCurrentPeriod);
|
|
146693
|
-
const filterHeight = shouldShowPeriodFilter ?
|
|
146694
|
-
const cardHeight =
|
|
146695
|
-
const contentOffset = filterHeight + cardHeight + 16;
|
|
146913
|
+
const filterHeight = shouldShowPeriodFilter ? 72 : 0;
|
|
146914
|
+
const cardHeight = 96;
|
|
146915
|
+
const contentOffset = isMobile ? 0 : filterHeight + cardHeight + 16;
|
|
146916
|
+
const amountLabel = totalAmount.toLocaleString("pt-BR", {
|
|
146917
|
+
style: "currency",
|
|
146918
|
+
currency: "BRL",
|
|
146919
|
+
});
|
|
146696
146920
|
const outcomes = React$1.useMemo(() => (Array.isArray(dataSource.outcomes) ? dataSource.outcomes : []), [dataSource.outcomes]);
|
|
146697
146921
|
return (React$1.createElement(Box$1, { sx: {
|
|
146698
146922
|
display: "flex",
|
|
@@ -146700,10 +146924,12 @@ const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValu
|
|
|
146700
146924
|
minHeight: "100vh",
|
|
146701
146925
|
backgroundColor: theme.palette.background.default,
|
|
146702
146926
|
position: "relative",
|
|
146703
|
-
pb:
|
|
146927
|
+
pb: 0,
|
|
146704
146928
|
} },
|
|
146705
|
-
React$1.createElement(PageHeader$2, { title: "Sa\u00EDdas", onBack: onBack, onAdd: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), addLabel: "Adicionar", showAddButton: true }),
|
|
146706
|
-
React$1.createElement(
|
|
146929
|
+
React$1.createElement(PageHeader$2, { title: "Sa\u00EDdas", onBack: onBack, onAdd: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
|
|
146930
|
+
isMobile && shouldShowPeriodFilter ? (React$1.createElement(Container$1, { maxWidth: "md", sx: { px: PAGE_LIST_CONTAINER_SPACING.px, pt: 1 } },
|
|
146931
|
+
React$1.createElement(FinanceMobilePeriodBar, { periodLabel: periodLabel || "-", amountLabel: amountLabel, periodInputValue: periodInputValue, periodInputMin: periodInputMin, periodInputMax: periodInputMax, onPeriodInputChange: onPeriodInputChange, onResetToCurrentPeriod: onResetToCurrentPeriod, testIdPrefix: "outcome" }))) : null,
|
|
146932
|
+
!isMobile && (React$1.createElement(Box$1, { component: "section", "aria-hidden": true, sx: {
|
|
146707
146933
|
position: "fixed",
|
|
146708
146934
|
left: 0,
|
|
146709
146935
|
right: 0,
|
|
@@ -146739,10 +146965,10 @@ const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValu
|
|
|
146739
146965
|
style: "currency",
|
|
146740
146966
|
currency: "BRL",
|
|
146741
146967
|
})
|
|
146742
|
-
: `R$: ${amount}` })))),
|
|
146968
|
+
: `R$: ${amount}` }))))),
|
|
146743
146969
|
React$1.createElement(Container$1, { maxWidth: "md", sx: Object.assign(Object.assign({}, PAGE_LIST_CONTAINER_SPACING), {
|
|
146744
146970
|
// push content below the fixed header + card
|
|
146745
|
-
paddingTop: `${contentOffset}px`,
|
|
146971
|
+
paddingTop: isMobile ? undefined : `${contentOffset}px`, pb: LIST_CONTENT_BOTTOM_PADDING,
|
|
146746
146972
|
// ensure content can scroll beneath fixed card
|
|
146747
146973
|
position: "relative", zIndex: 0 }) },
|
|
146748
146974
|
outcomes.length === 0 ? (React$1.createElement(Box$1, { sx: {
|
|
@@ -146766,13 +146992,8 @@ const OutcomeListPage = ({ onSelect, onBack, onAdd, periodLabel, periodInputValu
|
|
|
146766
146992
|
var _a, _b;
|
|
146767
146993
|
return (React$1.createElement(OutcomeListItem, { key: `${(_a = out.date) !== null && _a !== void 0 ? _a : ""}-${idx}-${(_b = out.amount) !== null && _b !== void 0 ? _b : ""}`, item: out, idx: idx, isLastItem: idx === outcomes.length - 1, formatCurrency: formatCurrency, formatDate: formatDate, getAccountName: getAccountName, onSelect: onSelect, canConfirmTransactions: canConfirmTransactions, isUpdatingSettlementStatus: isUpdatingSettlementStatus, onToggleSettlementStatus: onToggleSettlementStatus }));
|
|
146768
146994
|
}))),
|
|
146769
|
-
isMobile && (React$1.createElement(QuotaGuard, { feature: "outcomes", behavior: "hide" },
|
|
146770
|
-
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar Sa\u00EDda", title: "Adicionar Sa\u00EDda", onClick: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), sx: {
|
|
146771
|
-
position: "fixed",
|
|
146772
|
-
bottom: 16,
|
|
146773
|
-
right: 16,
|
|
146774
|
-
zIndex: theme.zIndex.fab,
|
|
146775
|
-
} },
|
|
146995
|
+
isMobile && outcomes.length > 0 && (React$1.createElement(QuotaGuard, { feature: "outcomes", behavior: "hide" },
|
|
146996
|
+
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar Sa\u00EDda", title: "Adicionar Sa\u00EDda", onClick: onAdd !== null && onAdd !== void 0 ? onAdd : (() => { }), sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.fab }) },
|
|
146776
146997
|
React$1.createElement(Add$1, null)))))));
|
|
146777
146998
|
};
|
|
146778
146999
|
var OutcomeListPage$1 = React$1.memo(OutcomeListPage);
|
|
@@ -153269,6 +153490,8 @@ const formatMinutesToHHMM = (totalMinutes) => {
|
|
|
153269
153490
|
};
|
|
153270
153491
|
const getCheckinWindowRange = (event) => {
|
|
153271
153492
|
var _a, _b;
|
|
153493
|
+
if (event.qrCheckinEnabled === false)
|
|
153494
|
+
return null;
|
|
153272
153495
|
const startMinutes = parseTimeToMinutes(event.time);
|
|
153273
153496
|
if (startMinutes === null)
|
|
153274
153497
|
return null;
|
|
@@ -156844,24 +157067,23 @@ const AttendanceInsightsMobileList = ({ mediums }) => {
|
|
|
156844
157067
|
return (React$1.createElement(Stack$1, { spacing: LIST_GAP }, mediums.map((medium) => {
|
|
156845
157068
|
var _a;
|
|
156846
157069
|
return (React$1.createElement(Paper$1, { key: medium.mediumId, variant: "outlined", sx: LIST_CARD_CONTENT_SX },
|
|
156847
|
-
React$1.createElement(Stack$1, { spacing: LIST_GAP },
|
|
156848
|
-
React$1.createElement(
|
|
156849
|
-
|
|
156850
|
-
React$1.createElement(Typography$1, { fontWeight: 600, noWrap: true }, medium.mediumName)
|
|
156851
|
-
|
|
156852
|
-
|
|
156853
|
-
|
|
156854
|
-
|
|
156855
|
-
|
|
156856
|
-
|
|
156857
|
-
|
|
156858
|
-
"
|
|
156859
|
-
medium.
|
|
156860
|
-
"
|
|
157070
|
+
React$1.createElement(Stack$1, { direction: "row", spacing: LIST_GAP, alignItems: "center" },
|
|
157071
|
+
React$1.createElement(Avatar$1, { src: (_a = medium.mediumAvatarUrl) !== null && _a !== void 0 ? _a : undefined, alt: medium.mediumName, sx: { width: 32, height: 32 } }, medium.mediumName.charAt(0).toUpperCase()),
|
|
157072
|
+
React$1.createElement(Stack$1, { sx: { minWidth: 0 } },
|
|
157073
|
+
React$1.createElement(Typography$1, { fontWeight: 600, noWrap: true }, medium.mediumName),
|
|
157074
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
157075
|
+
medium.invites,
|
|
157076
|
+
" conv. \u00B7 ",
|
|
157077
|
+
medium.confirmed,
|
|
157078
|
+
" conf."),
|
|
157079
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
157080
|
+
medium.present,
|
|
157081
|
+
" pres. \u00B7 ",
|
|
157082
|
+
medium.absent,
|
|
157083
|
+
" aus. \u00B7",
|
|
156861
157084
|
" ",
|
|
156862
157085
|
medium.presenceRate,
|
|
156863
|
-
"%
|
|
156864
|
-
medium.absenceGap)))));
|
|
157086
|
+
"%")))));
|
|
156865
157087
|
})));
|
|
156866
157088
|
};
|
|
156867
157089
|
|
|
@@ -158415,9 +158637,19 @@ const sortOptions = [
|
|
|
158415
158637
|
{ value: "createdAt_desc", label: "Mais recentes" },
|
|
158416
158638
|
{ value: "createdAt_asc", label: "Mais antigos" },
|
|
158417
158639
|
];
|
|
158640
|
+
const InventoryCompactRow = ({ item, isLast, onSelect }) => {
|
|
158641
|
+
var _a, _b, _c, _d;
|
|
158642
|
+
const statusLabel = (_a = statusMap[item.status]) === null || _a === void 0 ? void 0 : _a.label;
|
|
158643
|
+
const meta = [item.location, statusLabel].filter(Boolean).join(" · ");
|
|
158644
|
+
return (React$1.createElement(CompactListRow, { title: item.name, meta: meta || undefined, isLast: isLast, testId: `inventory-item-${item.id}`, onClick: () => onSelect(item.id), leading: React$1.createElement(Avatar$1, { src: (_b = item.imageUrl) !== null && _b !== void 0 ? _b : undefined, alt: "", sx: { width: 40, height: 40 } }, ((_d = (_c = item.name) === null || _c === void 0 ? void 0 : _c.charAt(0)) !== null && _d !== void 0 ? _d : "").toUpperCase()), trailing: React$1.createElement(Typography$1, { variant: "body2", fontWeight: 600, sx: { whiteSpace: "nowrap" } },
|
|
158645
|
+
item.quantity,
|
|
158646
|
+
" ",
|
|
158647
|
+
item.unit) }));
|
|
158648
|
+
};
|
|
158418
158649
|
// --- Main Inventory List Page ---
|
|
158419
158650
|
const InventoryListPage = (props) => {
|
|
158420
158651
|
const theme = useTheme$1();
|
|
158652
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
158421
158653
|
const { data, fns } = useInventoryListPage(props);
|
|
158422
158654
|
const drawerValue = {
|
|
158423
158655
|
status: data.selectedStatus,
|
|
@@ -158441,7 +158673,7 @@ const InventoryListPage = (props) => {
|
|
|
158441
158673
|
backgroundColor: theme.palette.background.default,
|
|
158442
158674
|
position: "relative",
|
|
158443
158675
|
}, "data-testid": "inventory-list-page", "data-cy": "inventory-list-page" },
|
|
158444
|
-
React$1.createElement(PageHeader$2, { title: "Invent\u00E1rio", onBack: fns.handleBack, showAddButton: data.canAdd, onAdd: data.canAdd ? fns.handleAddItem : undefined, addLabel: "Adicionar" }),
|
|
158676
|
+
React$1.createElement(PageHeader$2, { title: "Invent\u00E1rio", onBack: fns.handleBack, showAddButton: data.canAdd, hideAddButtonOnMobile: true, onAdd: data.canAdd ? fns.handleAddItem : undefined, addLabel: "Adicionar" }),
|
|
158445
158677
|
React$1.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
|
|
158446
158678
|
React$1.createElement(Box$1, { sx: {
|
|
158447
158679
|
display: "flex",
|
|
@@ -158483,8 +158715,13 @@ const InventoryListPage = (props) => {
|
|
|
158483
158715
|
pb: LIST_CONTENT_BOTTOM_PADDING,
|
|
158484
158716
|
}, "data-testid": "inventory-list-content", "data-cy": "inventory-list-content" }, data.items.length === 0 ? (React$1.createElement(InventoryEmptyState, { hasActiveFilters: data.hasActiveFilters, onClearFilters: data.hasActiveFilters ? fns.handleClearFilters : undefined, onAdd: data.canAdd && !data.hasActiveFilters
|
|
158485
158717
|
? fns.handleAddItem
|
|
158486
|
-
: undefined })) : (React$1.createElement(Fade$1, { in: true },
|
|
158487
|
-
|
|
158718
|
+
: undefined })) : (React$1.createElement(Fade$1, { in: true }, isMobile ? (React$1.createElement(Box$1, { sx: {
|
|
158719
|
+
bgcolor: "background.paper",
|
|
158720
|
+
borderRadius: RADIUS.default,
|
|
158721
|
+
border: 1,
|
|
158722
|
+
borderColor: "divider",
|
|
158723
|
+
overflow: "hidden",
|
|
158724
|
+
} }, data.items.map((item, index) => (React$1.createElement(InventoryCompactRow, { key: item.id, item: item, isLast: index === data.items.length - 1, onSelect: fns.handleItemSelect }))))) : (React$1.createElement(Stack$1, { spacing: LIST_GAP }, data.items.map((item, index) => (React$1.createElement(InventoryItemCard, { key: item.id, item: item, isLast: index === data.items.length - 1, onSelect: fns.handleItemSelect, onEdit: fns.handleItemEdit }))))))))),
|
|
158488
158725
|
React$1.createElement(FilterDrawer, { open: data.isFilterDrawerOpen, onClose: fns.handleCloseFilterDrawer, onOpen: fns.handleToggleFilterDrawer, value: drawerValue, emptyValue: {
|
|
158489
158726
|
status: "all",
|
|
158490
158727
|
createdAtSort: data.createdAtSort,
|
|
@@ -158498,7 +158735,9 @@ const InventoryListPage = (props) => {
|
|
|
158498
158735
|
React$1.createElement(FormControl$1, { fullWidth: true, size: "small" },
|
|
158499
158736
|
React$1.createElement(InputLabel$1, { id: "inventory-filter-sort-label" }, "Ordena\u00E7\u00E3o"),
|
|
158500
158737
|
React$1.createElement(Select$1, { labelId: "inventory-filter-sort-label", value: draft.createdAtSort, label: "Ordena\u00E7\u00E3o", onChange: (event) => setDraft(Object.assign(Object.assign({}, draft), { createdAtSort: event.target
|
|
158501
|
-
.value })), inputProps: { "data-testid": "inventory-created-at-sort" } }, sortOptions.map((option) => (React$1.createElement(MenuItem$1, { key: option.value, value: option.value }, option.label))))))))
|
|
158738
|
+
.value })), inputProps: { "data-testid": "inventory-created-at-sort" } }, sortOptions.map((option) => (React$1.createElement(MenuItem$1, { key: option.value, value: option.value }, option.label)))))))),
|
|
158739
|
+
data.canAdd && data.items.length > 0 && (React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar item", onClick: fns.handleAddItem, sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.speedDial }) },
|
|
158740
|
+
React$1.createElement(Add$1, null)))));
|
|
158502
158741
|
};
|
|
158503
158742
|
|
|
158504
158743
|
const DetailSectionCard = ({ icon, title, children, theme, }) => {
|
|
@@ -161976,7 +162215,7 @@ objectType({
|
|
|
161976
162215
|
const STATUS_TAB_LABELS = {
|
|
161977
162216
|
ALL: "Todos",
|
|
161978
162217
|
ACTIVE: "Ativos",
|
|
161979
|
-
WAITING_APPROVAL: "Aguardando",
|
|
162218
|
+
WAITING_APPROVAL: "Aguardando aprovação",
|
|
161980
162219
|
INACTIVE: "Inativos",
|
|
161981
162220
|
OTHER: "Outros",
|
|
161982
162221
|
};
|
|
@@ -162316,7 +162555,6 @@ const MediumListItem = ({ medium, onSelect, theme }) => {
|
|
|
162316
162555
|
const MediumListPage = (props) => {
|
|
162317
162556
|
var _a;
|
|
162318
162557
|
const theme = useTheme$1();
|
|
162319
|
-
const isCompactScreen = useMediaQuery(theme.breakpoints.down("sm"));
|
|
162320
162558
|
const { data, fns } = useMediumListPage(props);
|
|
162321
162559
|
// Sort menu state
|
|
162322
162560
|
const [sortAnchorEl, setSortAnchorEl] = React$1.useState(null);
|
|
@@ -162333,17 +162571,12 @@ const MediumListPage = (props) => {
|
|
|
162333
162571
|
};
|
|
162334
162572
|
// Status tabs for PageHeader
|
|
162335
162573
|
const statusTabs = data.showStatusTabs
|
|
162336
|
-
? data.statusTabs.map((tab) => {
|
|
162337
|
-
|
|
162338
|
-
|
|
162339
|
-
|
|
162340
|
-
|
|
162341
|
-
|
|
162342
|
-
label: tab.value === "WAITING_APPROVAL" && tab.count > 0
|
|
162343
|
-
? `${compactLabel} (${tab.count})`
|
|
162344
|
-
: compactLabel,
|
|
162345
|
-
};
|
|
162346
|
-
})
|
|
162574
|
+
? data.statusTabs.map((tab) => ({
|
|
162575
|
+
value: tab.value,
|
|
162576
|
+
label: tab.value === "WAITING_APPROVAL" && tab.count > 0
|
|
162577
|
+
? `${tab.label} (${tab.count})`
|
|
162578
|
+
: tab.label,
|
|
162579
|
+
}))
|
|
162347
162580
|
: undefined;
|
|
162348
162581
|
// Guard clause for loading state - show skeleton
|
|
162349
162582
|
if (data.isLoading) {
|
|
@@ -162353,7 +162586,7 @@ const MediumListPage = (props) => {
|
|
|
162353
162586
|
minHeight: "100vh",
|
|
162354
162587
|
backgroundColor: theme.palette.background.default,
|
|
162355
162588
|
} },
|
|
162356
|
-
React$1.createElement(PageHeader$2, { title: "M\u00E9diuns", onBack: fns.handleBack, onAdd: fns.handleAddMedium, addLabel: "Adicionar", showAddButton: true }),
|
|
162589
|
+
React$1.createElement(PageHeader$2, { title: "M\u00E9diuns", onBack: fns.handleBack, onAdd: fns.handleAddMedium, addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true }),
|
|
162357
162590
|
React$1.createElement(MediumListSkeleton, { count: 6 })));
|
|
162358
162591
|
}
|
|
162359
162592
|
return (React$1.createElement(Box$1, { sx: {
|
|
@@ -162362,12 +162595,12 @@ const MediumListPage = (props) => {
|
|
|
162362
162595
|
minHeight: "100vh",
|
|
162363
162596
|
backgroundColor: theme.palette.background.default,
|
|
162364
162597
|
} },
|
|
162365
|
-
React$1.createElement(PageHeader$2, { title: "M\u00E9diuns", onBack: fns.handleBack, onAdd: fns.handleAddMedium, addLabel: "Adicionar", showAddButton: true, tabs: statusTabs, selectedTab: data.selectedStatusTab, onTabChange: (value) => fns.handleStatusTabChange(value) }),
|
|
162598
|
+
React$1.createElement(PageHeader$2, { title: "M\u00E9diuns", onBack: fns.handleBack, onAdd: fns.handleAddMedium, addLabel: "Adicionar", showAddButton: true, hideAddButtonOnMobile: true, tabs: statusTabs, selectedTab: data.selectedStatusTab, onTabChange: (value) => fns.handleStatusTabChange(value) }),
|
|
162366
162599
|
React$1.createElement(Container$1, { maxWidth: "md", sx: PAGE_LIST_CONTAINER_SPACING },
|
|
162367
162600
|
data.showSearch && (React$1.createElement(Box$1, { sx: {
|
|
162368
162601
|
display: "flex",
|
|
162369
|
-
flexDirection:
|
|
162370
|
-
alignItems: "
|
|
162602
|
+
flexDirection: "row",
|
|
162603
|
+
alignItems: "center",
|
|
162371
162604
|
gap: 1,
|
|
162372
162605
|
mb: 2,
|
|
162373
162606
|
} },
|
|
@@ -162380,7 +162613,7 @@ const MediumListPage = (props) => {
|
|
|
162380
162613
|
"aria-label": "Buscar médium",
|
|
162381
162614
|
sx: {
|
|
162382
162615
|
borderRadius: RADIUS.default,
|
|
162383
|
-
minHeight:
|
|
162616
|
+
minHeight: 44,
|
|
162384
162617
|
backgroundColor: theme.palette.background.paper,
|
|
162385
162618
|
"& .MuiInputBase-input": {
|
|
162386
162619
|
fontSize: { xs: "0.9rem", sm: "1rem" },
|
|
@@ -162391,9 +162624,9 @@ const MediumListPage = (props) => {
|
|
|
162391
162624
|
},
|
|
162392
162625
|
} }),
|
|
162393
162626
|
data.showSort && (React$1.createElement(IconButton$1, { onClick: handleSortMenuOpen, sx: {
|
|
162394
|
-
|
|
162395
|
-
width:
|
|
162396
|
-
height:
|
|
162627
|
+
flexShrink: 0,
|
|
162628
|
+
width: 44,
|
|
162629
|
+
height: 44,
|
|
162397
162630
|
backgroundColor: theme.palette.background.paper,
|
|
162398
162631
|
borderRadius: RADIUS.default,
|
|
162399
162632
|
border: `1px solid ${theme.palette.divider}`,
|
|
@@ -162468,19 +162701,9 @@ const MediumListPage = (props) => {
|
|
|
162468
162701
|
vertical: "top",
|
|
162469
162702
|
horizontal: "right",
|
|
162470
162703
|
} }, data.sortOptions.map((option) => (React$1.createElement(MenuItem$1, { key: option.value, onClick: () => handleSortSelect(option.value), selected: option.value === data.sortOption }, option.label)))),
|
|
162471
|
-
React$1.createElement(QuotaGuard, { feature: "mediums", behavior: "hide" },
|
|
162472
|
-
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar", onClick: fns.handleAddMedium, sx: {
|
|
162473
|
-
|
|
162474
|
-
position: "fixed",
|
|
162475
|
-
bottom: {
|
|
162476
|
-
xs: "calc(16px + env(safe-area-inset-bottom, 0px))",
|
|
162477
|
-
sm: 24,
|
|
162478
|
-
md: 32,
|
|
162479
|
-
},
|
|
162480
|
-
right: { xs: 16, sm: 24, md: 32 },
|
|
162481
|
-
boxShadow: 6,
|
|
162482
|
-
} },
|
|
162483
|
-
React$1.createElement(BarcodeIcon, null))))));
|
|
162704
|
+
data.filteredMediums.length > 0 && (React$1.createElement(QuotaGuard, { feature: "mediums", behavior: "hide" },
|
|
162705
|
+
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Adicionar", onClick: fns.handleAddMedium, sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.speedDial }) },
|
|
162706
|
+
React$1.createElement(BarcodeIcon, null)))))));
|
|
162484
162707
|
};
|
|
162485
162708
|
|
|
162486
162709
|
const sanitizeBirthDate = (date) => {
|
|
@@ -173762,9 +173985,19 @@ const transformToRitual = (bath, originLabel, statusLabel) => {
|
|
|
173762
173985
|
scheduledCount: (_d = bath.scheduledCount) !== null && _d !== void 0 ? _d : 0,
|
|
173763
173986
|
};
|
|
173764
173987
|
};
|
|
173988
|
+
const RitualBathCompactRow = ({ bath, isLast, originLabel, statusLabel, onSelect, onSchedule }) => {
|
|
173989
|
+
var _a, _b;
|
|
173990
|
+
const meta = [(_a = bath.category) === null || _a === void 0 ? void 0 : _a.name, originLabel, statusLabel]
|
|
173991
|
+
.filter(Boolean)
|
|
173992
|
+
.join(" · ");
|
|
173993
|
+
return (React$1.createElement(CompactListRow, { title: bath.title, meta: meta, isLast: isLast, onClick: () => onSelect(bath.id), leading: React$1.createElement(Avatar$1, { src: (_b = bath.imageUrl) !== null && _b !== void 0 ? _b : undefined, alt: "", sx: { width: 40, height: 40 } },
|
|
173994
|
+
React$1.createElement(Spa, { fontSize: "small" })), trailing: onSchedule ? (React$1.createElement(IconButton$1, { "aria-label": `Agendar ${bath.title}`, onClick: () => onSchedule(bath.id), sx: { width: 44, height: 44 } },
|
|
173995
|
+
React$1.createElement(CalendarMonth$1, null))) : undefined }));
|
|
173996
|
+
};
|
|
173765
173997
|
const RitualBathListPage = (props) => {
|
|
173766
173998
|
var _a, _b, _c;
|
|
173767
173999
|
const theme = useTheme$1();
|
|
174000
|
+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
173768
174001
|
const { data, fns } = useRitualBathListPage(props);
|
|
173769
174002
|
const showOriginFilter = data.activeTab === "all" && !data.isTerreiro;
|
|
173770
174003
|
const drawerValue = Object.assign(Object.assign({}, (data.filters.categoryId !== undefined
|
|
@@ -173794,7 +174027,7 @@ const RitualBathListPage = (props) => {
|
|
|
173794
174027
|
backgroundColor: theme.palette.background.default,
|
|
173795
174028
|
position: "relative",
|
|
173796
174029
|
} },
|
|
173797
|
-
React$1.createElement(PageHeader$2, { title: "Banhos Rituais", onBack: fns.handleBack, onAdd: fns.handleBathCreate, addLabel: "Adicionar", showAddButton: data.isAdmin, tabs: tabs, selectedTab: data.activeTab, onTabChange: (value) => fns.handleTabChange(value) }),
|
|
174030
|
+
React$1.createElement(PageHeader$2, { title: "Banhos Rituais", onBack: fns.handleBack, onAdd: fns.handleBathCreate, addLabel: "Adicionar", showAddButton: data.isAdmin, hideAddButtonOnMobile: true, tabs: tabs, selectedTab: data.activeTab, onTabChange: (value) => fns.handleTabChange(value) }),
|
|
173798
174031
|
React$1.createElement(Container$1, { maxWidth: "md", sx: Object.assign(Object.assign({}, PAGE_LIST_CONTAINER_SPACING), { flex: 1 }) },
|
|
173799
174032
|
React$1.createElement(Box$1, { sx: {
|
|
173800
174033
|
display: "flex",
|
|
@@ -173863,8 +174096,14 @@ const RitualBathListPage = (props) => {
|
|
|
173863
174096
|
data.hasActiveFilters ? (React$1.createElement(Button$1, { variant: "outlined", onClick: fns.handleClearFilters, startIcon: React$1.createElement(Clear$1, null) }, "Limpar filtros")) : (data.isAdmin && (React$1.createElement(Button$1, { variant: "contained", startIcon: React$1.createElement(Add$1, null), onClick: fns.handleBathCreate }, "Criar banho ritual"))))),
|
|
173864
174097
|
!data.isLoading && !data.error && data.ritualBaths.length > 0 && (React$1.createElement(Box$1, { sx: { pb: LIST_CONTENT_BOTTOM_PADDING } },
|
|
173865
174098
|
React$1.createElement(InfiniteScroll, { hasNextPage: data.hasNextPage, isFetchingNextPage: data.isFetchingNextPage, onLoadMore: fns.handleLoadMore, threshold: 200 },
|
|
173866
|
-
|
|
173867
|
-
|
|
174099
|
+
isMobile ? (React$1.createElement(Box$1, { sx: {
|
|
174100
|
+
bgcolor: "background.paper",
|
|
174101
|
+
borderRadius: RADIUS.default,
|
|
174102
|
+
border: 1,
|
|
174103
|
+
borderColor: "divider",
|
|
174104
|
+
overflow: "hidden",
|
|
174105
|
+
} }, data.ritualBaths.map((bath, index) => (React$1.createElement(RitualBathCompactRow, { key: bath.id, bath: bath, isLast: index === data.ritualBaths.length - 1, originLabel: fns.getOriginLabel(bath.origin), statusLabel: fns.getStatusLabel(bath.status), onSelect: fns.handleBathSelect, onSchedule: fns.handleScheduleBath }))))) : (React$1.createElement(Grid$1, { container: true, spacing: LIST_GAP }, data.ritualBaths.map((bath) => (React$1.createElement(Grid$1, { item: true, xs: 12, key: bath.id },
|
|
174106
|
+
React$1.createElement(RitualCard, { ritual: transformToRitual(bath, fns.getOriginLabel(bath.origin), fns.getStatusLabel(bath.status)), onClick: () => fns.handleBathSelect(bath.id), onSchedule: fns.handleScheduleBath })))))),
|
|
173868
174107
|
data.isFetchingNextPage && (React$1.createElement(Box$1, { sx: {
|
|
173869
174108
|
display: "flex",
|
|
173870
174109
|
justifyContent: "center",
|
|
@@ -173873,13 +174112,8 @@ const RitualBathListPage = (props) => {
|
|
|
173873
174112
|
} },
|
|
173874
174113
|
React$1.createElement(CircularProgress$1, { size: 28 }))),
|
|
173875
174114
|
!data.hasNextPage && data.ritualBaths.length > 0 && (React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { textAlign: "center", py: 2 } }, "Todos os banhos foram carregados")))))),
|
|
173876
|
-
data.isAdmin && (React$1.createElement(QuotaGuard, { feature: "baths", behavior: "hide" },
|
|
173877
|
-
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Criar banho ritual", onClick: fns.handleBathCreate, sx: {
|
|
173878
|
-
position: "fixed",
|
|
173879
|
-
bottom: { xs: 16, sm: 24 },
|
|
173880
|
-
right: { xs: 16, sm: 24 },
|
|
173881
|
-
zIndex: theme.zIndex.speedDial,
|
|
173882
|
-
} },
|
|
174115
|
+
data.isAdmin && data.ritualBaths.length > 0 && (React$1.createElement(QuotaGuard, { feature: "baths", behavior: "hide" },
|
|
174116
|
+
React$1.createElement(Fab$1, { color: "primary", "aria-label": "Criar banho ritual", onClick: fns.handleBathCreate, sx: Object.assign(Object.assign({}, LIST_FAB_POSITION_SX), { zIndex: theme.zIndex.speedDial }) },
|
|
173883
174117
|
React$1.createElement(Add$1, null)))),
|
|
173884
174118
|
React$1.createElement(FilterDrawer, { open: data.isFilterDrawerOpen, onClose: fns.handleCloseFilterDrawer, onOpen: fns.handleToggleFilterDrawer, value: drawerValue, emptyValue: {}, countActiveFilters: countRitualBathDrawerFilters, "data-testid": "ritual-bath-filter-drawer", onFilter: (filters) => {
|
|
173885
174119
|
fns.handleCategoryFilter(filters.categoryId);
|
|
@@ -195650,6 +195884,8 @@ exports.CREATE_QUESTION_STEP_LABELS = CREATE_QUESTION_STEP_LABELS;
|
|
|
195650
195884
|
exports.CREATE_QUESTION_STEP_ORDER = CREATE_QUESTION_STEP_ORDER;
|
|
195651
195885
|
exports.CellphoneInput = CellphoneInput;
|
|
195652
195886
|
exports.CellphoneInputPropsSchema = CellphoneInputPropsSchema;
|
|
195887
|
+
exports.CompactListDateBlock = CompactListDateBlock;
|
|
195888
|
+
exports.CompactListRow = CompactListRow;
|
|
195653
195889
|
exports.CompletenessCard = CompletenessCard;
|
|
195654
195890
|
exports.ConnectionButton = ConnectionButton;
|
|
195655
195891
|
exports.ContactArraySchema = ContactArraySchema;
|
|
@@ -196081,6 +196317,7 @@ exports.buildAcademyCertificatePreviewNode = buildAcademyCertificatePreviewNode;
|
|
|
196081
196317
|
exports.buildItemReasonText = buildItemReasonText;
|
|
196082
196318
|
exports.buildMergedInsumos = buildMergedInsumos$1;
|
|
196083
196319
|
exports.buildMergedMediums = buildMergedMediums$1;
|
|
196320
|
+
exports.compactListDateParts = compactListDateParts;
|
|
196084
196321
|
exports.defaultDisplayProps = defaultDisplayProps;
|
|
196085
196322
|
exports.defaultInputProps = defaultInputProps;
|
|
196086
196323
|
exports.drawerSheetRadius = drawerSheetRadius;
|