finance-shared 0.0.11 → 0.0.13

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.
@@ -8645,7 +8645,8 @@ function InfoDialog({
8645
8645
  color: color2 = "inherit",
8646
8646
  isLoading = false,
8647
8647
  t: t2,
8648
- discardText = "Cancel"
8648
+ discardText = "Cancel",
8649
+ buttonDataTestId
8649
8650
  }) {
8650
8651
  const handleClose = (_2, reason) => {
8651
8652
  if (reason && reason === "backdropClick") return;
@@ -8665,7 +8666,15 @@ function InfoDialog({
8665
8666
  }
8666
8667
  ) }),
8667
8668
  /* @__PURE__ */ jsxs(DialogActions$1, { className: "flex flex-col gap-10 pointer-events-auto", children: [
8668
- /* @__PURE__ */ jsx(CustomButton, { onClick: onButtonClick, className: "capitalize", children: isLoading ? /* @__PURE__ */ jsx(CircularProgress, { size: 24, className: "button-progress" }) : buttonText }),
8669
+ /* @__PURE__ */ jsx(
8670
+ CustomButton,
8671
+ {
8672
+ onClick: onButtonClick,
8673
+ className: "capitalize",
8674
+ ...buttonDataTestId && { "data-test-id": buttonDataTestId },
8675
+ children: isLoading ? /* @__PURE__ */ jsx(CircularProgress, { size: 24, className: "button-progress" }) : buttonText
8676
+ }
8677
+ ),
8669
8678
  /* @__PURE__ */ jsx(
8670
8679
  Typography$1,
8671
8680
  {
@@ -21797,14 +21806,15 @@ const getUserList = (roleIds, tenantId, pageIndexParam, searchTerm) => async (di
21797
21806
  dispatch(setIsUserListLoading(false));
21798
21807
  }
21799
21808
  };
21800
- const getTenantListForDropdown = ({ pageIndex = 0 } = {}) => async (dispatch, getState) => {
21809
+ const getTenantListForDropdown = ({ pageIndex = 0, pageSize: pageSize2 } = {}) => async (dispatch, getState) => {
21801
21810
  try {
21802
21811
  const pagination = getTenantListForDropdownPaginationData(getState());
21803
21812
  const filters = getDropdownFilters(getState());
21804
21813
  const pageIndexQuery = pageIndex || pagination.pageIndex;
21814
+ const pageSizeQuery = pageSize2 || pagination.pageSize;
21805
21815
  dispatch(setTenantListForDropdownLoading(true));
21806
21816
  const queryParams = [
21807
- pagination.pageSize && `PageSize=${pagination.pageSize}`,
21817
+ pageSizeQuery && `PageSize=${pageSizeQuery}`,
21808
21818
  pageIndexQuery !== void 0 && `PageIndex=${pageIndexQuery + 1}`,
21809
21819
  filters.searchKeyword && `Search=${filters.searchKeyword}`,
21810
21820
  filters.status && `Status=${filters.status}`
@@ -21950,6 +21960,7 @@ const CustomAutocomplete = React.memo(
21950
21960
  getListboxProps = {},
21951
21961
  ref,
21952
21962
  disableClearable = false,
21963
+ optionTestId,
21953
21964
  ...props
21954
21965
  }) => {
21955
21966
  const { t: t2 } = useTranslation("Autocomplete");
@@ -21981,8 +21992,19 @@ const CustomAutocomplete = React.memo(
21981
21992
  }, []);
21982
21993
  const renderOption = React.useCallback((props2, option) => {
21983
21994
  const { key, ...otherProps } = props2;
21984
- return /* @__PURE__ */ createElement("li", { ...otherProps, key: typeof option === "object" ? option.id : option }, typeof option === "object" ? option.label : option);
21985
- }, []);
21995
+ const optionLabel = typeof option === "object" ? option.label : option;
21996
+ const testIdPrefix = optionTestId || "autocomplete-option";
21997
+ const testIdSafeLabel = optionLabel ? String(optionLabel).trim().replace(/\s+/g, "-") : "";
21998
+ return /* @__PURE__ */ createElement(
21999
+ "li",
22000
+ {
22001
+ ...otherProps,
22002
+ key: typeof option === "object" ? option.id : option,
22003
+ "data-test-id": `${testIdPrefix}-${testIdSafeLabel}`
22004
+ },
22005
+ optionLabel
22006
+ );
22007
+ }, [optionTestId]);
21986
22008
  const listboxProps = React.useMemo(() => ({
21987
22009
  onScroll: getListboxProps == null ? void 0 : getListboxProps.onScroll,
21988
22010
  style: {
@@ -27552,6 +27574,7 @@ function useDebounce(callback, delay) {
27552
27574
  const SearchableAutocomplete = memo(
27553
27575
  ({
27554
27576
  dataTestId = "",
27577
+ optionTestId = "autocomplete-option",
27555
27578
  label,
27556
27579
  value,
27557
27580
  variant = "filled",
@@ -27680,6 +27703,7 @@ const SearchableAutocomplete = memo(
27680
27703
  CustomAutocomplete,
27681
27704
  {
27682
27705
  "data-test-id": dataTestId,
27706
+ optionTestId,
27683
27707
  ref,
27684
27708
  label,
27685
27709
  variant,
@@ -27711,6 +27735,7 @@ const MemberAutoComplete = ({
27711
27735
  isTooltipShow = true,
27712
27736
  variant = "filled",
27713
27737
  dataTestId = "",
27738
+ optionTestId = "autocomplete-option",
27714
27739
  tenantId,
27715
27740
  initialSearchTerm = ""
27716
27741
  }) => {
@@ -27754,6 +27779,7 @@ const MemberAutoComplete = ({
27754
27779
  SearchableAutocomplete,
27755
27780
  {
27756
27781
  dataTestId,
27782
+ optionTestId,
27757
27783
  label,
27758
27784
  variant,
27759
27785
  value,
@@ -27926,7 +27952,7 @@ function RemarksDialog({
27926
27952
  return /* @__PURE__ */ jsxs(Fragment, { children: [
27927
27953
  variant === "simple" ? (
27928
27954
  // Simple variant: Icon button trigger
27929
- remarksList.length > 0 && /* @__PURE__ */ jsx(IconButton$1, { onClick: handleOpen, className: "m-0 p-3", children: /* @__PURE__ */ jsx(Badge, { badgeContent: remarksList.length, color: "error", className: "text-white", children: /* @__PURE__ */ jsx(MessageOutlinedIcon, { color: "warning" }) }) })
27955
+ remarksList.length > 0 && /* @__PURE__ */ jsx(IconButton$1, { onClick: handleOpen, className: "m-0 p-3", disabled: isApplicationRejected, children: /* @__PURE__ */ jsx(Badge, { badgeContent: remarksList.length, color: "error", className: "text-white", children: /* @__PURE__ */ jsx(MessageOutlinedIcon, { color: "warning" }) }) })
27930
27956
  ) : (
27931
27957
  // Full variant: Button trigger
27932
27958
  /* @__PURE__ */ jsx(Badge, { badgeContent: displayCount, color: "error", children: /* @__PURE__ */ jsx(
@@ -27939,6 +27965,7 @@ function RemarksDialog({
27939
27965
  startIcon: /* @__PURE__ */ jsx(PendingActionsIcon, {}),
27940
27966
  onClick: handleOpen,
27941
27967
  sx: remarksButtonStyle,
27968
+ disabled: isApplicationRejected,
27942
27969
  children: t2("REMARKS")
27943
27970
  }
27944
27971
  ) })
@@ -41517,7 +41544,8 @@ const TenantAutocomplete = ({
41517
41544
  status = "",
41518
41545
  style: style2 = {},
41519
41546
  disableClearable = false,
41520
- autoSelectFirst = false
41547
+ autoSelectFirst = false,
41548
+ pageSize: pageSize2 = 20
41521
41549
  }) => {
41522
41550
  const dispatch = useDispatch();
41523
41551
  const hasAutoSelected = useRef(false);
@@ -41526,11 +41554,11 @@ const TenantAutocomplete = ({
41526
41554
  onChange(selectedValue, isAutoSelection);
41527
41555
  };
41528
41556
  const fetchTenants = useCallback(
41529
- async ({ status: status2, pageSize: pageSize2, pageIndex, searchKeyword = "" }) => {
41557
+ async ({ status: status2, pageSize: pageSize22, pageIndex, searchKeyword = "" }) => {
41530
41558
  const statusString = status2.length > 0 ? status2.join(",") : "";
41531
41559
  dispatch(setDropdownFilters({ status: statusString, searchKeyword }));
41532
- dispatch(setTenantListForDropdownPagination({ pageSize: pageSize2, pageIndex }));
41533
- const result = await dispatch(getTenantListForDropdown({ pageIndex }));
41560
+ dispatch(setTenantListForDropdownPagination({ pageSize: pageSize22, pageIndex }));
41561
+ const result = await dispatch(getTenantListForDropdown({ pageIndex, pageSize: pageSize22 }));
41534
41562
  return result;
41535
41563
  },
41536
41564
  [dispatch]
@@ -41540,7 +41568,7 @@ const TenantAutocomplete = ({
41540
41568
  const statusArray = Array.isArray(status) ? status : [status].filter((s4) => s4 !== "");
41541
41569
  const tenants = await fetchTenants({
41542
41570
  status: statusArray,
41543
- pageSize: 20,
41571
+ pageSize: pageSize2,
41544
41572
  pageIndex,
41545
41573
  searchKeyword: searchTerm || ""
41546
41574
  });
@@ -41549,7 +41577,7 @@ const TenantAutocomplete = ({
41549
41577
  label: item.name
41550
41578
  }))) || [];
41551
41579
  },
41552
- [fetchTenants, status]
41580
+ [fetchTenants, status, pageSize2]
41553
41581
  );
41554
41582
  useEffect(() => {
41555
41583
  const autoSelectFirstTenant = async () => {
@@ -57395,39 +57423,67 @@ const CustomDatePicker = ({
57395
57423
  required = false,
57396
57424
  locale: locale$12 = locale,
57397
57425
  dataTestId,
57398
- iconColor
57426
+ iconColor,
57427
+ open,
57428
+ anchorEl,
57429
+ onClose,
57430
+ hideTextField = false,
57431
+ applyCustomStyling = false,
57432
+ style: style2
57399
57433
  }) => {
57400
- return /* @__PURE__ */ jsx(LocalizationProvider, { dateAdapter: AdapterDateFns, adapterLocale: locale$12, children: /* @__PURE__ */ jsx(
57401
- DatePicker,
57402
- {
57403
- value,
57404
- onChange,
57405
- maxDate,
57406
- minDate,
57407
- disabled,
57408
- className: "w-full",
57409
- sx: {
57410
- "& .MuiSvgIcon-root": {
57411
- color: iconColor
57412
- }
57434
+ const conditionalStyling = applyCustomStyling && style2 ? {
57435
+ ...style2,
57436
+ "& .MuiFilledInput-root": {
57437
+ backgroundColor: "#ffffff"
57438
+ }
57439
+ } : style2 || {};
57440
+ const datePickerProps = {
57441
+ value,
57442
+ onChange,
57443
+ maxDate,
57444
+ minDate,
57445
+ disabled,
57446
+ className: "w-full",
57447
+ sx: {
57448
+ "& .MuiSvgIcon-root": {
57449
+ color: iconColor
57450
+ }
57451
+ },
57452
+ slotProps: {
57453
+ actionBar: {
57454
+ actions: ["clear", "cancel"]
57413
57455
  },
57414
- slotProps: {
57415
- actionBar: {
57416
- actions: ["clear", "cancel"]
57456
+ textField: hideTextField ? { sx: { display: "none" } } : {
57457
+ label,
57458
+ variant,
57459
+ error: !!error,
57460
+ helperText: error || "",
57461
+ required,
57462
+ inputProps: {
57463
+ "data-test-id": dataTestId
57417
57464
  },
57418
- textField: {
57419
- label,
57420
- variant,
57421
- error: !!error,
57422
- helperText: error || "",
57423
- required,
57424
- inputProps: {
57425
- "data-test-id": dataTestId
57426
- }
57427
- }
57465
+ sx: conditionalStyling
57428
57466
  }
57429
57467
  }
57430
- ) });
57468
+ };
57469
+ if (hideTextField) {
57470
+ datePickerProps.open = open;
57471
+ datePickerProps.onClose = onClose;
57472
+ datePickerProps.slotProps.popper = {
57473
+ anchorEl,
57474
+ placement: "top-start"
57475
+ };
57476
+ }
57477
+ return /* @__PURE__ */ jsx(
57478
+ Tooltip,
57479
+ {
57480
+ title: label,
57481
+ arrow: true,
57482
+ TransitionComponent: Zoom,
57483
+ placement: "top-start",
57484
+ children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(LocalizationProvider, { dateAdapter: AdapterDateFns, adapterLocale: locale$12, children: /* @__PURE__ */ jsx(DatePicker, { ...datePickerProps }) }) })
57485
+ }
57486
+ );
57431
57487
  };
57432
57488
  const defaultConfig = {
57433
57489
  apiUrl: "",
@@ -57492,6 +57548,7 @@ export {
57492
57548
  PdfDialog,
57493
57549
  PreviewMedia,
57494
57550
  RemarksDialog,
57551
+ SaveButton,
57495
57552
  SearchableAutocomplete,
57496
57553
  TenantAutocomplete,
57497
57554
  addSectionWiseRemark,