amp-workflow-ui 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -447,6 +447,22 @@ function WorkflowRequestCard({
447
447
  ),
448
448
  arrow: true,
449
449
  placement: "top",
450
+ componentsProps: {
451
+ tooltip: {
452
+ sx: {
453
+ backgroundColor: "#fff",
454
+ color: "#000",
455
+ boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
456
+ borderRadius: "6px",
457
+ p: 1
458
+ }
459
+ },
460
+ arrow: {
461
+ sx: {
462
+ color: "#fff"
463
+ }
464
+ }
465
+ },
450
466
  children: /* @__PURE__ */ jsxs(
451
467
  Typography,
452
468
  {
@@ -588,7 +604,8 @@ function SendBackDialog({
588
604
  openModal,
589
605
  closeModal,
590
606
  header,
591
- workflowLogId
607
+ workflowLogId,
608
+ onSuccess
592
609
  }) {
593
610
  const { userInfo, api } = useWorkflowContext();
594
611
  const [comment, setComment] = useState("");
@@ -695,6 +712,7 @@ function SendBackDialog({
695
712
  setFileName("");
696
713
  setLoading(false);
697
714
  closeModal && closeModal();
715
+ onSuccess && onSuccess();
698
716
  }
699
717
  };
700
718
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -839,7 +857,8 @@ function ApproveDialog({
839
857
  closeModal,
840
858
  header,
841
859
  workflowLogId,
842
- statusId
860
+ statusId,
861
+ onSuccess
843
862
  }) {
844
863
  const { userInfo, api } = useWorkflowContext();
845
864
  const theme = useTheme();
@@ -891,6 +910,7 @@ function ApproveDialog({
891
910
  setComment("");
892
911
  setLoading(false);
893
912
  closeModal && closeModal();
913
+ onSuccess && onSuccess();
894
914
  }
895
915
  };
896
916
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1000,7 +1020,8 @@ function RejectDialog({
1000
1020
  header,
1001
1021
  workflowLogId,
1002
1022
  statusId,
1003
- rejection_reason_master
1023
+ rejection_reason_master,
1024
+ onSuccess
1004
1025
  }) {
1005
1026
  const { userInfo, api } = useWorkflowContext();
1006
1027
  const theme = useTheme();
@@ -1092,6 +1113,7 @@ function RejectDialog({
1092
1113
  setRejectReasons("");
1093
1114
  setLoading(false);
1094
1115
  closeModal && closeModal();
1116
+ onSuccess && onSuccess();
1095
1117
  }
1096
1118
  };
1097
1119
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1218,7 +1240,8 @@ function OnHoldDialog({
1218
1240
  closeModal,
1219
1241
  header,
1220
1242
  workflowLogId,
1221
- statusId
1243
+ statusId,
1244
+ onSuccess
1222
1245
  }) {
1223
1246
  const { userInfo, api } = useWorkflowContext();
1224
1247
  const theme = useTheme();
@@ -1270,6 +1293,7 @@ function OnHoldDialog({
1270
1293
  setComment("");
1271
1294
  closeModal && closeModal();
1272
1295
  setLoading(false);
1296
+ onSuccess && onSuccess();
1273
1297
  }
1274
1298
  };
1275
1299
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1400,6 +1424,12 @@ var SearchBox = ({
1400
1424
  placeholder: placeHolderTitle,
1401
1425
  autoComplete: "off",
1402
1426
  className: "custom-search",
1427
+ sx: {
1428
+ "& .MuiOutlinedInput-root": {
1429
+ height: "38px",
1430
+ borderRadius: "20px"
1431
+ }
1432
+ },
1403
1433
  InputProps: {
1404
1434
  startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx("span", { className: "icon-search-normal-1" }) }),
1405
1435
  endAdornment: searchText ? /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(
@@ -1642,8 +1672,8 @@ function FilterButton({ onClick }) {
1642
1672
  variant: "contained",
1643
1673
  startIcon: /* @__PURE__ */ jsx(FilterAlt, { sx: { fontSize: "18px" } }),
1644
1674
  sx: {
1645
- backgroundColor: "#f4f0ef",
1646
- color: "#666",
1675
+ backgroundColor: "#f4f0ef !important",
1676
+ color: "#666 !important",
1647
1677
  fontFamily: "Poppins, sans-serif",
1648
1678
  fontWeight: 500,
1649
1679
  fontSize: "14px",
@@ -1658,7 +1688,7 @@ function FilterButton({ onClick }) {
1658
1688
  gap: "8px",
1659
1689
  boxShadow: "none",
1660
1690
  "&:hover": {
1661
- backgroundColor: "#ebe7e6",
1691
+ backgroundColor: "#ebe7e6 !important",
1662
1692
  boxShadow: "none"
1663
1693
  },
1664
1694
  "&:active": {
@@ -1775,7 +1805,7 @@ function ApprovalWorkflow({
1775
1805
  }, [selectedOption]);
1776
1806
  useEffect(() => {
1777
1807
  var _a2, _b2;
1778
- if (debouncedSearchTerm !== tabs[selectedOption].search) {
1808
+ if (debouncedSearchTerm !== tabs[selectedOption].search && ((_a2 = tabs[selectedOption]) == null ? void 0 : _a2.initialized)) {
1779
1809
  setTabs((prev) => ({
1780
1810
  ...prev,
1781
1811
  [selectedOption]: {
@@ -1787,16 +1817,14 @@ function ApprovalWorkflow({
1787
1817
  // Clear data on new search
1788
1818
  }
1789
1819
  }));
1790
- if ((_a2 = tabs[selectedOption]) == null ? void 0 : _a2.initialized) {
1791
- fetchData(
1792
- selectedOption,
1793
- 1,
1794
- debouncedSearchTerm,
1795
- (_b2 = tabs[selectedOption]) == null ? void 0 : _b2.filters
1796
- );
1797
- }
1820
+ fetchData(
1821
+ selectedOption,
1822
+ 1,
1823
+ debouncedSearchTerm,
1824
+ (_b2 = tabs[selectedOption]) == null ? void 0 : _b2.filters
1825
+ );
1798
1826
  }
1799
- }, [debouncedSearchTerm, selectedOption]);
1827
+ }, [debouncedSearchTerm]);
1800
1828
  const handleClearSearch = useCallback(() => {
1801
1829
  setSearchText("");
1802
1830
  }, []);
@@ -2081,7 +2109,13 @@ function ApprovalWorkflow({
2081
2109
  children: /* @__PURE__ */ jsxs(
2082
2110
  Box$1,
2083
2111
  {
2084
- sx: { width: "100%", height: "100%", overflow: "hidden !important" },
2112
+ sx: {
2113
+ width: "1141px",
2114
+ maxWidth: "1141px",
2115
+ minWidth: "1141px",
2116
+ height: "100%",
2117
+ overflow: "hidden !important"
2118
+ },
2085
2119
  children: [
2086
2120
  /* @__PURE__ */ jsxs(
2087
2121
  Box$1,
@@ -2227,7 +2261,16 @@ function ApprovalWorkflow({
2227
2261
  openModal: !!sendDialog,
2228
2262
  closeModal: () => setSendDialog(null),
2229
2263
  header: "Send Back",
2230
- workflowLogId: sendDialog || ""
2264
+ workflowLogId: sendDialog || "",
2265
+ onSuccess: () => {
2266
+ var _a2, _b2;
2267
+ return fetchData(
2268
+ selectedOption,
2269
+ 1,
2270
+ (_a2 = tabs[selectedOption]) == null ? void 0 : _a2.search,
2271
+ (_b2 = tabs[selectedOption]) == null ? void 0 : _b2.filters
2272
+ );
2273
+ }
2231
2274
  }
2232
2275
  ),
2233
2276
  /* @__PURE__ */ jsx(
@@ -2237,7 +2280,16 @@ function ApprovalWorkflow({
2237
2280
  closeModal: () => setApproveTarget(null),
2238
2281
  header: "Approve",
2239
2282
  workflowLogId: (_m = approveTarget == null ? void 0 : approveTarget.split("|")) == null ? void 0 : _m[0],
2240
- statusId: (_n = approveTarget == null ? void 0 : approveTarget.split("|")) == null ? void 0 : _n[1]
2283
+ statusId: (_n = approveTarget == null ? void 0 : approveTarget.split("|")) == null ? void 0 : _n[1],
2284
+ onSuccess: () => {
2285
+ var _a2, _b2;
2286
+ return fetchData(
2287
+ selectedOption,
2288
+ 1,
2289
+ (_a2 = tabs[selectedOption]) == null ? void 0 : _a2.search,
2290
+ (_b2 = tabs[selectedOption]) == null ? void 0 : _b2.filters
2291
+ );
2292
+ }
2241
2293
  }
2242
2294
  ),
2243
2295
  /* @__PURE__ */ jsx(
@@ -2248,7 +2300,16 @@ function ApprovalWorkflow({
2248
2300
  header: "Reject",
2249
2301
  workflowLogId: (_o = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _o[0],
2250
2302
  statusId: (_p = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _p[1],
2251
- rejection_reason_master: (_q = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _q[2]
2303
+ rejection_reason_master: (_q = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _q[2],
2304
+ onSuccess: () => {
2305
+ var _a2, _b2;
2306
+ return fetchData(
2307
+ selectedOption,
2308
+ 1,
2309
+ (_a2 = tabs[selectedOption]) == null ? void 0 : _a2.search,
2310
+ (_b2 = tabs[selectedOption]) == null ? void 0 : _b2.filters
2311
+ );
2312
+ }
2252
2313
  }
2253
2314
  ),
2254
2315
  /* @__PURE__ */ jsx(
@@ -2258,7 +2319,16 @@ function ApprovalWorkflow({
2258
2319
  closeModal: () => setOnHoldTarget(null),
2259
2320
  header: "On Hold",
2260
2321
  workflowLogId: (_r = onHoldTarget == null ? void 0 : onHoldTarget.split("|")) == null ? void 0 : _r[0],
2261
- statusId: (_s = onHoldTarget == null ? void 0 : onHoldTarget.split("|")) == null ? void 0 : _s[1]
2322
+ statusId: (_s = onHoldTarget == null ? void 0 : onHoldTarget.split("|")) == null ? void 0 : _s[1],
2323
+ onSuccess: () => {
2324
+ var _a2, _b2;
2325
+ return fetchData(
2326
+ selectedOption,
2327
+ 1,
2328
+ (_a2 = tabs[selectedOption]) == null ? void 0 : _a2.search,
2329
+ (_b2 = tabs[selectedOption]) == null ? void 0 : _b2.filters
2330
+ );
2331
+ }
2262
2332
  }
2263
2333
  ),
2264
2334
  /* @__PURE__ */ jsxs(