@erpsquad/common 2.0.9 → 2.0.11
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/chunks/activity-log-CzJ_mSbr.js +122 -0
- package/dist/chunks/activity-log-CzJ_mSbr.js.map +1 -0
- package/dist/chunks/activity-log-IcyRmNTS.esm.js +123 -0
- package/dist/chunks/activity-log-IcyRmNTS.esm.js.map +1 -0
- package/dist/components/activityLog/activity-log/index.esm.js +1 -1
- package/dist/components/activityLog/activity-log/index.js +1 -1
- package/dist/components/activityLog/index.esm.js +1 -1
- package/dist/components/activityLog/index.js +1 -1
- package/dist/components/index.esm.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/constants/defaultColumns/index.esm.js +21 -35
- package/dist/constants/defaultColumns/index.esm.js.map +1 -1
- package/dist/constants/defaultColumns/index.js +21 -35
- package/dist/constants/defaultColumns/index.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/activity-log-1uwdsDd0.js +0 -105
- package/dist/chunks/activity-log-1uwdsDd0.js.map +0 -1
- package/dist/chunks/activity-log-DwUk6OV5.esm.js +0 -106
- package/dist/chunks/activity-log-DwUk6OV5.esm.js.map +0 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const material = require("@mui/material");
|
|
4
|
+
const Timeline = require("@mui/lab/Timeline");
|
|
5
|
+
const TimelineItem = require("@mui/lab/TimelineItem");
|
|
6
|
+
const TimelineSeparator = require("@mui/lab/TimelineSeparator");
|
|
7
|
+
const TimelineConnector = require("@mui/lab/TimelineConnector");
|
|
8
|
+
const TimelineContent = require("@mui/lab/TimelineContent");
|
|
9
|
+
const TimelineDot = require("@mui/lab/TimelineDot");
|
|
10
|
+
;/* empty css */
|
|
11
|
+
const typography = require("./typography-Bqfr1Ksf.js");
|
|
12
|
+
const dayjs = require("dayjs");
|
|
13
|
+
const utils_formatText = require("../utils/format-text/index.js");
|
|
14
|
+
const reactI18next = require("react-i18next");
|
|
15
|
+
const ActivityTag = (props) => {
|
|
16
|
+
const { t } = reactI18next.useTranslation();
|
|
17
|
+
const { data } = props;
|
|
18
|
+
const formatDateTime = (date) => {
|
|
19
|
+
if (!date) return "-";
|
|
20
|
+
const formattedDate = dayjs(date).format("DD MMM, YYYY");
|
|
21
|
+
const formattedTime = dayjs(date).format("HH:mm");
|
|
22
|
+
return `${formattedDate} • ${formattedTime}`;
|
|
23
|
+
};
|
|
24
|
+
const actions = {
|
|
25
|
+
view: t("common.viewed_text") || "viewed",
|
|
26
|
+
delete: t("common.deleted_text") || "deleted",
|
|
27
|
+
create: t("common.created_text") || "created",
|
|
28
|
+
update: t("common.updated_text") || "updated"
|
|
29
|
+
};
|
|
30
|
+
const renderMessage = (item) => {
|
|
31
|
+
if (item.action === "change_status" || item.action === "change_approval_status") {
|
|
32
|
+
return item.message || item.text || `${item.resource || "Status"} changed`;
|
|
33
|
+
}
|
|
34
|
+
if (item.message && !actions[item.action]) {
|
|
35
|
+
return item.message;
|
|
36
|
+
}
|
|
37
|
+
const actorName = item.username || (item.user ? `${item.user.first_name || ""} ${item.user.last_name || ""}`.trim() : "") || item.user_name || "";
|
|
38
|
+
const action = actions[item.action] || item.action || "updated";
|
|
39
|
+
const resource = item.resource ? item.resource.replace(/[-_]/g, " ") : "";
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
41
|
+
actorName ? /* @__PURE__ */ jsxRuntime.jsxs("b", { children: [
|
|
42
|
+
utils_formatText.default(actorName),
|
|
43
|
+
" "
|
|
44
|
+
] }) : null,
|
|
45
|
+
action,
|
|
46
|
+
" ",
|
|
47
|
+
/* @__PURE__ */ jsxRuntime.jsx("b", { children: utils_formatText.default(resource) })
|
|
48
|
+
] });
|
|
49
|
+
};
|
|
50
|
+
return (
|
|
51
|
+
// <Box position='relative'>
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(Timeline, { className: "Timeline", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
53
|
+
material.Box,
|
|
54
|
+
{
|
|
55
|
+
sx: {
|
|
56
|
+
display: "flex",
|
|
57
|
+
flexDirection: "column",
|
|
58
|
+
gap: 2,
|
|
59
|
+
padding: "16px"
|
|
60
|
+
},
|
|
61
|
+
className: "box-class",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx(typography.Typography, { type: "s3", weight: "medium", color: "theme.secondary.800", children: t("common.activities_label") || "Activities" }),
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
65
|
+
material.Box,
|
|
66
|
+
{
|
|
67
|
+
sx: {
|
|
68
|
+
height: 400,
|
|
69
|
+
overflowY: "auto",
|
|
70
|
+
gap: 1.5,
|
|
71
|
+
display: "flex",
|
|
72
|
+
flexDirection: "column"
|
|
73
|
+
},
|
|
74
|
+
children: data == null ? void 0 : data.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "Timeline--Activity", children: /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { children: [
|
|
75
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TimelineSeparator, { children: [
|
|
76
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
77
|
+
TimelineDot,
|
|
78
|
+
{
|
|
79
|
+
color: "primary",
|
|
80
|
+
sx: {
|
|
81
|
+
backgroundColor: "#D3D3D4",
|
|
82
|
+
width: 8,
|
|
83
|
+
height: 8,
|
|
84
|
+
p: 0,
|
|
85
|
+
m: "6px 0 0 0",
|
|
86
|
+
boxShadow: "none",
|
|
87
|
+
border: "none"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
data.length - 1 !== index && /* @__PURE__ */ jsxRuntime.jsx(TimelineConnector, {})
|
|
92
|
+
] }),
|
|
93
|
+
/* @__PURE__ */ jsxRuntime.jsxs(TimelineContent, { className: "Timeline--Content", children: [
|
|
94
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
95
|
+
typography.Typography,
|
|
96
|
+
{
|
|
97
|
+
type: "s5",
|
|
98
|
+
color: "theme.secondary.800",
|
|
99
|
+
className: "Timeline--ActivityLogItem",
|
|
100
|
+
children: renderMessage(item)
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
104
|
+
typography.Typography,
|
|
105
|
+
{
|
|
106
|
+
type: "s5",
|
|
107
|
+
color: "theme.secondary.800",
|
|
108
|
+
className: "Timeline--ActivityLogItem",
|
|
109
|
+
children: formatDateTime((item == null ? void 0 : item.created_at) || (item == null ? void 0 : item.dateTime))
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
] })
|
|
113
|
+
] }) }, index))
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
) }) })
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
exports.ActivityTag = ActivityTag;
|
|
122
|
+
//# sourceMappingURL=activity-log-CzJ_mSbr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-log-CzJ_mSbr.js","sources":["../../src/components/activityLog/activity-log.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Box } from '@mui/material';\nimport Timeline from '@mui/lab/Timeline';\nimport TimelineItem from '@mui/lab/TimelineItem';\nimport TimelineSeparator from '@mui/lab/TimelineSeparator';\nimport TimelineConnector from '@mui/lab/TimelineConnector';\nimport TimelineContent from '@mui/lab/TimelineContent';\nimport TimelineDot from '@mui/lab/TimelineDot';\nimport './activity-log.scss';\nimport Typography from '../typography/typography';\nimport dayjs from 'dayjs';\nimport formatText from '../../utils/format-text';\nimport { useTranslation } from 'react-i18next';\n\nexport const ActivityTag = (props: any) => {\n\tconst { t } = useTranslation();\n\tconst { data } = props;\n\n\tconst formatDateTime = (date: any): string => {\n\t\tif (!date) return '-';\n\t\tconst formattedDate = dayjs(date).format('DD MMM, YYYY');\n\t\tconst formattedTime = dayjs(date).format('HH:mm');\n\t\treturn `${formattedDate} • ${formattedTime}`;\n\t};\n\n\tconst actions: Record<string, string> = {\n\t\tview: t('common.viewed_text') || 'viewed',\n\t\tdelete: t('common.deleted_text') || 'deleted',\n\t\tcreate: t('common.created_text') || 'created',\n\t\tupdate: t('common.updated_text') || 'updated'\n\t};\n\n\tconst renderMessage = (item: any) => {\n\t\tif (item.action === 'change_status' || item.action === 'change_approval_status') {\n\t\t\treturn item.message || item.text || `${item.resource || 'Status'} changed`;\n\t\t}\n\t\tif (item.message && !actions[item.action]) {\n\t\t\treturn item.message;\n\t\t}\n\t\tconst actorName =\n\t\t\titem.username ||\n\t\t\t(item.user\n\t\t\t\t? `${item.user.first_name || ''} ${item.user.last_name || ''}`.trim()\n\t\t\t\t: '') ||\n\t\t\titem.user_name ||\n\t\t\t'';\n\t\tconst action = actions[item.action] || item.action || 'updated';\n\t\tconst resource = item.resource ? item.resource.replace(/[-_]/g, ' ') : '';\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{actorName ? <b>{formatText(actorName)} </b> : null}\n\t\t\t\t{action}{' '}\n\t\t\t\t<b>{formatText(resource)}</b>\n\t\t\t</>\n\t\t);\n\t};\n\n\treturn (\n\t\t// <Box position='relative'>\n\t\t<Box>\n\t\t\t<Timeline className='Timeline'>\n\t\t\t\t<Box\n\t\t\t\t\tsx={{\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\tgap: 2,\n\t\t\t\t\t\tpadding: '16px'\n\t\t\t\t\t}}\n\t\t\t\t\tclassName='box-class'>\n\t\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.800'>\n\t\t\t\t\t\t{t('common.activities_label') || 'Activities'}\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<Box\n\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\theight: 400,\n\t\t\t\t\t\t\toverflowY: 'auto',\n\t\t\t\t\t\t\tgap: 1.5,\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'column'\n\t\t\t\t\t\t}}>\n\t\t\t\t\t\t{data?.map((item: any, index: number) => (\n\t\t\t\t\t\t\t<div className='Timeline--Activity' key={index}>\n\t\t\t\t\t\t\t\t<TimelineItem>\n\t\t\t\t\t\t\t\t\t<TimelineSeparator>\n\t\t\t\t\t\t\t\t\t\t<TimelineDot\n\t\t\t\t\t\t\t\t\t\t\tcolor='primary'\n\t\t\t\t\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor: '#D3D3D4',\n\t\t\t\t\t\t\t\t\t\t\t\twidth: 8,\n\t\t\t\t\t\t\t\t\t\t\t\theight: 8,\n\t\t\t\t\t\t\t\t\t\t\t\tp: 0,\n\t\t\t\t\t\t\t\t\t\t\t\tm: '6px 0 0 0',\n\t\t\t\t\t\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t\t\t\t\t\t\tborder: 'none'\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{data.length - 1 !== index && <TimelineConnector />}\n\t\t\t\t\t\t\t\t\t</TimelineSeparator>\n\t\t\t\t\t\t\t\t\t<TimelineContent className='Timeline--Content'>\n\t\t\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\t\t\ttype='s5'\n\t\t\t\t\t\t\t\t\t\t\tcolor='theme.secondary.800'\n\t\t\t\t\t\t\t\t\t\t\tclassName='Timeline--ActivityLogItem'>\n\t\t\t\t\t\t\t\t\t\t\t{renderMessage(item)}\n\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\t\t\ttype='s5'\n\t\t\t\t\t\t\t\t\t\t\tcolor='theme.secondary.800'\n\t\t\t\t\t\t\t\t\t\t\tclassName='Timeline--ActivityLogItem'>\n\t\t\t\t\t\t\t\t\t\t\t{formatDateTime(item?.created_at || item?.dateTime)}\n\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t</TimelineContent>\n\t\t\t\t\t\t\t\t</TimelineItem>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Box>\n\t\t\t\t</Box>\n\t\t\t</Timeline>\n\t\t</Box>\n\t\t// </Box>\n\t);\n};\n\nexport default ActivityTag;\n"],"names":["useTranslation","jsxs","Fragment","formatText","jsx","Box","Typography"],"mappings":";;;;;;;;;;;;;;AAeO,MAAM,cAAc,CAAC,UAAe;AAC1C,QAAM,EAAE,EAAA,IAAMA,4BAAA;AACd,QAAM,EAAE,SAAS;AAEjB,QAAM,iBAAiB,CAAC,SAAsB;AAC7C,QAAI,CAAC,KAAM,QAAO;AAClB,UAAM,gBAAgB,MAAM,IAAI,EAAE,OAAO,cAAc;AACvD,UAAM,gBAAgB,MAAM,IAAI,EAAE,OAAO,OAAO;AAChD,WAAO,GAAG,aAAa,MAAM,aAAa;AAAA,EAC3C;AAEA,QAAM,UAAkC;AAAA,IACvC,MAAM,EAAE,oBAAoB,KAAK;AAAA,IACjC,QAAQ,EAAE,qBAAqB,KAAK;AAAA,IACpC,QAAQ,EAAE,qBAAqB,KAAK;AAAA,IACpC,QAAQ,EAAE,qBAAqB,KAAK;AAAA,EAAA;AAGrC,QAAM,gBAAgB,CAAC,SAAc;AACpC,QAAI,KAAK,WAAW,mBAAmB,KAAK,WAAW,0BAA0B;AAChF,aAAO,KAAK,WAAW,KAAK,QAAQ,GAAG,KAAK,YAAY,QAAQ;AAAA,IACjE;AACA,QAAI,KAAK,WAAW,CAAC,QAAQ,KAAK,MAAM,GAAG;AAC1C,aAAO,KAAK;AAAA,IACb;AACA,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AA,gBAAAA,gCAAC,mBAAA,EACA,UAAA;AAAA,kBAAAG,2BAAAA;AAAAA,oBAAC;AAAA,oBAAA;AAAA,sBACA,OAAM;AAAA,sBACN,IAAI;AAAA,wBACH,iBAAiB;AAAA,wBACjB,OAAO;AAAA,wBACP,QAAQ;AAAA,wBACR,GAAG;AAAA,wBACH,GAAG;AAAA,wBACH,WAAW;AAAA,wBACX,QAAQ;AAAA,sBAAA;AAAA,oBACT;AAAA,kBAAA;AAAA,kBAEA,KAAK,SAAS,MAAM,wCAAU,mBAAA,CAAA,CAAkB;AAAA,gBAAA,GAClD;AAAA,gBACAH,2BAAAA,KAAC,iBAAA,EAAgB,WAAU,qBAC1B,UAAA;AAAA,kBAAAG,2BAAAA;AAAAA,oBAACE,WAAAA;AAAAA,oBAAA;AAAA,sBACA,MAAK;AAAA,sBACL,OAAM;AAAA,sBACN,WAAU;AAAA,sBACT,wBAAc,IAAI;AAAA,oBAAA;AAAA,kBAAA;AAAA,kBAEpBF,2BAAAA;AAAAA,oBAACE,WAAAA;AAAAA,oBAAA;AAAA,sBACA,MAAK;AAAA,sBACL,OAAM;AAAA,sBACN,WAAU;AAAA,sBACT,UAAA,gBAAe,6BAAM,gBAAc,6BAAM,SAAQ;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACnD,EAAA,CACD;AAAA,cAAA,EAAA,CACD,EAAA,GA/BwC,KAgCzC;AAAA,YACA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA,GAEF,EAAA,CACD;AAAA;AAGF;;"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "@mui/material";
|
|
3
|
+
import Timeline from "@mui/lab/Timeline";
|
|
4
|
+
import TimelineItem from "@mui/lab/TimelineItem";
|
|
5
|
+
import TimelineSeparator from "@mui/lab/TimelineSeparator";
|
|
6
|
+
import TimelineConnector from "@mui/lab/TimelineConnector";
|
|
7
|
+
import TimelineContent from "@mui/lab/TimelineContent";
|
|
8
|
+
import TimelineDot from "@mui/lab/TimelineDot";
|
|
9
|
+
/* empty css */
|
|
10
|
+
import { T as Typography } from "./typography-CG_A0iOJ.esm.js";
|
|
11
|
+
import dayjs from "dayjs";
|
|
12
|
+
import formatText from "../utils/format-text/index.esm.js";
|
|
13
|
+
import { useTranslation } from "react-i18next";
|
|
14
|
+
const ActivityTag = (props) => {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
const { data } = props;
|
|
17
|
+
const formatDateTime = (date) => {
|
|
18
|
+
if (!date) return "-";
|
|
19
|
+
const formattedDate = dayjs(date).format("DD MMM, YYYY");
|
|
20
|
+
const formattedTime = dayjs(date).format("HH:mm");
|
|
21
|
+
return `${formattedDate} • ${formattedTime}`;
|
|
22
|
+
};
|
|
23
|
+
const actions = {
|
|
24
|
+
view: t("common.viewed_text") || "viewed",
|
|
25
|
+
delete: t("common.deleted_text") || "deleted",
|
|
26
|
+
create: t("common.created_text") || "created",
|
|
27
|
+
update: t("common.updated_text") || "updated"
|
|
28
|
+
};
|
|
29
|
+
const renderMessage = (item) => {
|
|
30
|
+
if (item.action === "change_status" || item.action === "change_approval_status") {
|
|
31
|
+
return item.message || item.text || `${item.resource || "Status"} changed`;
|
|
32
|
+
}
|
|
33
|
+
if (item.message && !actions[item.action]) {
|
|
34
|
+
return item.message;
|
|
35
|
+
}
|
|
36
|
+
const actorName = item.username || (item.user ? `${item.user.first_name || ""} ${item.user.last_name || ""}`.trim() : "") || item.user_name || "";
|
|
37
|
+
const action = actions[item.action] || item.action || "updated";
|
|
38
|
+
const resource = item.resource ? item.resource.replace(/[-_]/g, " ") : "";
|
|
39
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
|
+
actorName ? /* @__PURE__ */ jsxs("b", { children: [
|
|
41
|
+
formatText(actorName),
|
|
42
|
+
" "
|
|
43
|
+
] }) : null,
|
|
44
|
+
action,
|
|
45
|
+
" ",
|
|
46
|
+
/* @__PURE__ */ jsx("b", { children: formatText(resource) })
|
|
47
|
+
] });
|
|
48
|
+
};
|
|
49
|
+
return (
|
|
50
|
+
// <Box position='relative'>
|
|
51
|
+
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Timeline, { className: "Timeline", children: /* @__PURE__ */ jsxs(
|
|
52
|
+
Box,
|
|
53
|
+
{
|
|
54
|
+
sx: {
|
|
55
|
+
display: "flex",
|
|
56
|
+
flexDirection: "column",
|
|
57
|
+
gap: 2,
|
|
58
|
+
padding: "16px"
|
|
59
|
+
},
|
|
60
|
+
className: "box-class",
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx(Typography, { type: "s3", weight: "medium", color: "theme.secondary.800", children: t("common.activities_label") || "Activities" }),
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
Box,
|
|
65
|
+
{
|
|
66
|
+
sx: {
|
|
67
|
+
height: 400,
|
|
68
|
+
overflowY: "auto",
|
|
69
|
+
gap: 1.5,
|
|
70
|
+
display: "flex",
|
|
71
|
+
flexDirection: "column"
|
|
72
|
+
},
|
|
73
|
+
children: data == null ? void 0 : data.map((item, index) => /* @__PURE__ */ jsx("div", { className: "Timeline--Activity", children: /* @__PURE__ */ jsxs(TimelineItem, { children: [
|
|
74
|
+
/* @__PURE__ */ jsxs(TimelineSeparator, { children: [
|
|
75
|
+
/* @__PURE__ */ jsx(
|
|
76
|
+
TimelineDot,
|
|
77
|
+
{
|
|
78
|
+
color: "primary",
|
|
79
|
+
sx: {
|
|
80
|
+
backgroundColor: "#D3D3D4",
|
|
81
|
+
width: 8,
|
|
82
|
+
height: 8,
|
|
83
|
+
p: 0,
|
|
84
|
+
m: "6px 0 0 0",
|
|
85
|
+
boxShadow: "none",
|
|
86
|
+
border: "none"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
data.length - 1 !== index && /* @__PURE__ */ jsx(TimelineConnector, {})
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ jsxs(TimelineContent, { className: "Timeline--Content", children: [
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
Typography,
|
|
95
|
+
{
|
|
96
|
+
type: "s5",
|
|
97
|
+
color: "theme.secondary.800",
|
|
98
|
+
className: "Timeline--ActivityLogItem",
|
|
99
|
+
children: renderMessage(item)
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
103
|
+
Typography,
|
|
104
|
+
{
|
|
105
|
+
type: "s5",
|
|
106
|
+
color: "theme.secondary.800",
|
|
107
|
+
className: "Timeline--ActivityLogItem",
|
|
108
|
+
children: formatDateTime((item == null ? void 0 : item.created_at) || (item == null ? void 0 : item.dateTime))
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
] })
|
|
112
|
+
] }) }, index))
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
) }) })
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
export {
|
|
121
|
+
ActivityTag as A
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=activity-log-IcyRmNTS.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-log-IcyRmNTS.esm.js","sources":["../../src/components/activityLog/activity-log.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Box } from '@mui/material';\nimport Timeline from '@mui/lab/Timeline';\nimport TimelineItem from '@mui/lab/TimelineItem';\nimport TimelineSeparator from '@mui/lab/TimelineSeparator';\nimport TimelineConnector from '@mui/lab/TimelineConnector';\nimport TimelineContent from '@mui/lab/TimelineContent';\nimport TimelineDot from '@mui/lab/TimelineDot';\nimport './activity-log.scss';\nimport Typography from '../typography/typography';\nimport dayjs from 'dayjs';\nimport formatText from '../../utils/format-text';\nimport { useTranslation } from 'react-i18next';\n\nexport const ActivityTag = (props: any) => {\n\tconst { t } = useTranslation();\n\tconst { data } = props;\n\n\tconst formatDateTime = (date: any): string => {\n\t\tif (!date) return '-';\n\t\tconst formattedDate = dayjs(date).format('DD MMM, YYYY');\n\t\tconst formattedTime = dayjs(date).format('HH:mm');\n\t\treturn `${formattedDate} • ${formattedTime}`;\n\t};\n\n\tconst actions: Record<string, string> = {\n\t\tview: t('common.viewed_text') || 'viewed',\n\t\tdelete: t('common.deleted_text') || 'deleted',\n\t\tcreate: t('common.created_text') || 'created',\n\t\tupdate: t('common.updated_text') || 'updated'\n\t};\n\n\tconst renderMessage = (item: any) => {\n\t\tif (item.action === 'change_status' || item.action === 'change_approval_status') {\n\t\t\treturn item.message || item.text || `${item.resource || 'Status'} changed`;\n\t\t}\n\t\tif (item.message && !actions[item.action]) {\n\t\t\treturn item.message;\n\t\t}\n\t\tconst actorName =\n\t\t\titem.username ||\n\t\t\t(item.user\n\t\t\t\t? `${item.user.first_name || ''} ${item.user.last_name || ''}`.trim()\n\t\t\t\t: '') ||\n\t\t\titem.user_name ||\n\t\t\t'';\n\t\tconst action = actions[item.action] || item.action || 'updated';\n\t\tconst resource = item.resource ? item.resource.replace(/[-_]/g, ' ') : '';\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{actorName ? <b>{formatText(actorName)} </b> : null}\n\t\t\t\t{action}{' '}\n\t\t\t\t<b>{formatText(resource)}</b>\n\t\t\t</>\n\t\t);\n\t};\n\n\treturn (\n\t\t// <Box position='relative'>\n\t\t<Box>\n\t\t\t<Timeline className='Timeline'>\n\t\t\t\t<Box\n\t\t\t\t\tsx={{\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\tgap: 2,\n\t\t\t\t\t\tpadding: '16px'\n\t\t\t\t\t}}\n\t\t\t\t\tclassName='box-class'>\n\t\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.800'>\n\t\t\t\t\t\t{t('common.activities_label') || 'Activities'}\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<Box\n\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\theight: 400,\n\t\t\t\t\t\t\toverflowY: 'auto',\n\t\t\t\t\t\t\tgap: 1.5,\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tflexDirection: 'column'\n\t\t\t\t\t\t}}>\n\t\t\t\t\t\t{data?.map((item: any, index: number) => (\n\t\t\t\t\t\t\t<div className='Timeline--Activity' key={index}>\n\t\t\t\t\t\t\t\t<TimelineItem>\n\t\t\t\t\t\t\t\t\t<TimelineSeparator>\n\t\t\t\t\t\t\t\t\t\t<TimelineDot\n\t\t\t\t\t\t\t\t\t\t\tcolor='primary'\n\t\t\t\t\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor: '#D3D3D4',\n\t\t\t\t\t\t\t\t\t\t\t\twidth: 8,\n\t\t\t\t\t\t\t\t\t\t\t\theight: 8,\n\t\t\t\t\t\t\t\t\t\t\t\tp: 0,\n\t\t\t\t\t\t\t\t\t\t\t\tm: '6px 0 0 0',\n\t\t\t\t\t\t\t\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t\t\t\t\t\t\t\t\tborder: 'none'\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{data.length - 1 !== index && <TimelineConnector />}\n\t\t\t\t\t\t\t\t\t</TimelineSeparator>\n\t\t\t\t\t\t\t\t\t<TimelineContent className='Timeline--Content'>\n\t\t\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\t\t\ttype='s5'\n\t\t\t\t\t\t\t\t\t\t\tcolor='theme.secondary.800'\n\t\t\t\t\t\t\t\t\t\t\tclassName='Timeline--ActivityLogItem'>\n\t\t\t\t\t\t\t\t\t\t\t{renderMessage(item)}\n\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\t\t\ttype='s5'\n\t\t\t\t\t\t\t\t\t\t\tcolor='theme.secondary.800'\n\t\t\t\t\t\t\t\t\t\t\tclassName='Timeline--ActivityLogItem'>\n\t\t\t\t\t\t\t\t\t\t\t{formatDateTime(item?.created_at || item?.dateTime)}\n\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t</TimelineContent>\n\t\t\t\t\t\t\t\t</TimelineItem>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Box>\n\t\t\t\t</Box>\n\t\t\t</Timeline>\n\t\t</Box>\n\t\t// </Box>\n\t);\n};\n\nexport default ActivityTag;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAeO,MAAM,cAAc,CAAC,UAAe;AAC1C,QAAM,EAAE,EAAA,IAAM,eAAA;AACd,QAAM,EAAE,SAAS;AAEjB,QAAM,iBAAiB,CAAC,SAAsB;AAC7C,QAAI,CAAC,KAAM,QAAO;AAClB,UAAM,gBAAgB,MAAM,IAAI,EAAE,OAAO,cAAc;AACvD,UAAM,gBAAgB,MAAM,IAAI,EAAE,OAAO,OAAO;AAChD,WAAO,GAAG,aAAa,MAAM,aAAa;AAAA,EAC3C;AAEA,QAAM,UAAkC;AAAA,IACvC,MAAM,EAAE,oBAAoB,KAAK;AAAA,IACjC,QAAQ,EAAE,qBAAqB,KAAK;AAAA,IACpC,QAAQ,EAAE,qBAAqB,KAAK;AAAA,IACpC,QAAQ,EAAE,qBAAqB,KAAK;AAAA,EAAA;AAGrC,QAAM,gBAAgB,CAAC,SAAc;AACpC,QAAI,KAAK,WAAW,mBAAmB,KAAK,WAAW,0BAA0B;AAChF,aAAO,KAAK,WAAW,KAAK,QAAQ,GAAG,KAAK,YAAY,QAAQ;AAAA,IACjE;AACA,QAAI,KAAK,WAAW,CAAC,QAAQ,KAAK,MAAM,GAAG;AAC1C,aAAO,KAAK;AAAA,IACb;AACA,UAAM,YACL,KAAK,aACJ,KAAK,OACH,GAAG,KAAK,KAAK,cAAc,EAA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ACR,GAAG;AAAA,wBACH,GAAG;AAAA,wBACH,WAAW;AAAA,wBACX,QAAQ;AAAA,sBAAA;AAAA,oBACT;AAAA,kBAAA;AAAA,kBAEA,KAAK,SAAS,MAAM,6BAAU,mBAAA,CAAA,CAAkB;AAAA,gBAAA,GAClD;AAAA,gBACA,qBAAC,iBAAA,EAAgB,WAAU,qBAC1B,UAAA;AAAA,kBAAA;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACA,MAAK;AAAA,sBACL,OAAM;AAAA,sBACN,WAAU;AAAA,sBACT,wBAAc,IAAI;AAAA,oBAAA;AAAA,kBAAA;AAAA,kBAEpB;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACA,MAAK;AAAA,sBACL,OAAM;AAAA,sBACN,WAAU;AAAA,sBACT,UAAA,gBAAe,6BAAM,gBAAc,6BAAM,SAAQ;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACnD,EAAA,CACD;AAAA,cAAA,EAAA,CACD,EAAA,GA/BwC,KAgCzC;AAAA,YACA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA,GAEF,EAAA,CACD;AAAA;AAGF;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const activityLog = require("../../../chunks/activity-log-
|
|
3
|
+
const activityLog = require("../../../chunks/activity-log-CzJ_mSbr.js");
|
|
4
4
|
exports.ActivityTag = activityLog.ActivityTag;
|
|
5
5
|
exports.default = activityLog.ActivityTag;
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const activityLog = require("../../chunks/activity-log-
|
|
3
|
+
const activityLog = require("../../chunks/activity-log-CzJ_mSbr.js");
|
|
4
4
|
exports.ActivityTag = activityLog.ActivityTag;
|
|
5
5
|
exports.default = activityLog.ActivityTag;
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -3,7 +3,7 @@ import { A } from "../chunks/accordion-DlkIh3BF.esm.js";
|
|
|
3
3
|
import { A as A2 } from "../chunks/action-bar-1Rquyokn.esm.js";
|
|
4
4
|
import { A as A3 } from "../chunks/activity-tag-Bk13Lwtt.esm.js";
|
|
5
5
|
import { A as A4 } from "../chunks/activityArea-BSwK0nxT.esm.js";
|
|
6
|
-
import { A as A5 } from "../chunks/activity-log-
|
|
6
|
+
import { A as A5 } from "../chunks/activity-log-IcyRmNTS.esm.js";
|
|
7
7
|
import { A as A6 } from "../chunks/alert-DSvNY_5z.esm.js";
|
|
8
8
|
import { A as A7 } from "../chunks/appbar-kCY0xo1q.esm.js";
|
|
9
9
|
import { A as A8 } from "../chunks/approval-wrapper-BIi2og8G.esm.js";
|
package/dist/components/index.js
CHANGED
|
@@ -5,7 +5,7 @@ const accordion = require("../chunks/accordion-CHRmZ97h.js");
|
|
|
5
5
|
const actionBar = require("../chunks/action-bar-BQu4SgTj.js");
|
|
6
6
|
const activityTag = require("../chunks/activity-tag-BPE6sv6e.js");
|
|
7
7
|
const activityArea = require("../chunks/activityArea-C9-Nfhjc.js");
|
|
8
|
-
const activityLog = require("../chunks/activity-log-
|
|
8
|
+
const activityLog = require("../chunks/activity-log-CzJ_mSbr.js");
|
|
9
9
|
const alert = require("../chunks/alert-u6hGY38p.js");
|
|
10
10
|
const appbar = require("../chunks/appbar-Dol8xdCz.js");
|
|
11
11
|
const approvalWrapper = require("../chunks/approval-wrapper-Cgweuhjx.js");
|
|
@@ -3545,30 +3545,22 @@ const leadColumns = [
|
|
|
3545
3545
|
type: "string"
|
|
3546
3546
|
},
|
|
3547
3547
|
{
|
|
3548
|
-
header: "crm.leads.
|
|
3549
|
-
accessorKey: "
|
|
3548
|
+
header: "crm.leads.fields.phone_label",
|
|
3549
|
+
accessorKey: "contact_no",
|
|
3550
3550
|
visible: true,
|
|
3551
|
-
type: "
|
|
3552
|
-
typeArrayAccessorKey: "name",
|
|
3553
|
-
custom_class: "leads--StatusChip--company"
|
|
3551
|
+
type: "custom"
|
|
3554
3552
|
},
|
|
3555
3553
|
{
|
|
3556
|
-
header: "crm.leads.
|
|
3557
|
-
accessorKey: "
|
|
3554
|
+
header: "crm.leads.fields.email_label",
|
|
3555
|
+
accessorKey: "email_ids",
|
|
3558
3556
|
visible: true,
|
|
3559
3557
|
type: "custom"
|
|
3560
3558
|
},
|
|
3561
|
-
// {
|
|
3562
|
-
// header: "Client Status",
|
|
3563
|
-
// accessorKey: "client_status",
|
|
3564
|
-
// visible: true,
|
|
3565
|
-
// type: "custom",
|
|
3566
|
-
// },
|
|
3567
3559
|
{
|
|
3568
|
-
header: "crm.leads.table.
|
|
3569
|
-
accessorKey: "
|
|
3560
|
+
header: "crm.leads.table.lead_status_header",
|
|
3561
|
+
accessorKey: "sales_lead_status",
|
|
3570
3562
|
visible: true,
|
|
3571
|
-
type: "
|
|
3563
|
+
type: "custom"
|
|
3572
3564
|
},
|
|
3573
3565
|
{
|
|
3574
3566
|
header: "crm.leads.table.source_header",
|
|
@@ -3577,23 +3569,11 @@ const leadColumns = [
|
|
|
3577
3569
|
type: "custom"
|
|
3578
3570
|
},
|
|
3579
3571
|
{
|
|
3580
|
-
header: "crm.leads.table.
|
|
3581
|
-
accessorKey: "
|
|
3582
|
-
visible: true,
|
|
3583
|
-
type: "custom"
|
|
3584
|
-
},
|
|
3585
|
-
{
|
|
3586
|
-
header: "crm.leads.table.contact_header",
|
|
3587
|
-
accessorKey: "contact_no",
|
|
3572
|
+
header: "crm.leads.table.owner_header",
|
|
3573
|
+
accessorKey: "sales_lead_owner_salesperson_data.name",
|
|
3588
3574
|
visible: true,
|
|
3589
|
-
type: "
|
|
3575
|
+
type: "owner"
|
|
3590
3576
|
}
|
|
3591
|
-
// {
|
|
3592
|
-
// header: "crm.leads.table.credit_limit_header",
|
|
3593
|
-
// accessorKey: "credit_limit",
|
|
3594
|
-
// visible: true,
|
|
3595
|
-
// type: "custom",
|
|
3596
|
-
// },
|
|
3597
3577
|
];
|
|
3598
3578
|
const ekycColumns = [
|
|
3599
3579
|
{
|
|
@@ -3635,7 +3615,13 @@ const ekycColumns = [
|
|
|
3635
3615
|
];
|
|
3636
3616
|
const proposalColumns = [
|
|
3637
3617
|
{
|
|
3638
|
-
header: "crm.proposal.
|
|
3618
|
+
header: "crm.proposal.fields.proposal_id_label",
|
|
3619
|
+
accessorKey: "proposal_id",
|
|
3620
|
+
visible: true,
|
|
3621
|
+
type: "string"
|
|
3622
|
+
},
|
|
3623
|
+
{
|
|
3624
|
+
header: "crm.proposal.fields.client_name",
|
|
3639
3625
|
accessorKey: "customer_name",
|
|
3640
3626
|
visible: true,
|
|
3641
3627
|
type: "string"
|
|
@@ -3667,13 +3653,13 @@ const proposalColumns = [
|
|
|
3667
3653
|
];
|
|
3668
3654
|
const agreementColumns = [
|
|
3669
3655
|
{
|
|
3670
|
-
header: "crm.agreement.table.
|
|
3671
|
-
accessorKey: "
|
|
3656
|
+
header: "crm.agreement.table.agreement_id",
|
|
3657
|
+
accessorKey: "agreement_id",
|
|
3672
3658
|
visible: true,
|
|
3673
3659
|
type: "string"
|
|
3674
3660
|
},
|
|
3675
3661
|
{
|
|
3676
|
-
header: "crm.agreement.
|
|
3662
|
+
header: "crm.agreement.fields.client_name",
|
|
3677
3663
|
accessorKey: "customer_name",
|
|
3678
3664
|
visible: true,
|
|
3679
3665
|
type: "string"
|