@codezee/sixtify-brahma 0.2.49 → 0.2.50

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codezee/sixtify-brahma",
3
- "version": "0.2.49",
3
+ "version": "0.2.50",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hardikranpariya/sixtify-brahma.git"
@@ -1,7 +1,9 @@
1
1
  import { type WorkDayType } from "../utils/colorVariant";
2
2
  type AttendanceStatusProps = {
3
3
  variant: WorkDayType;
4
+ leaveColor?: string;
5
+ toolTipLabel?: string;
4
6
  };
5
- export declare const AttendanceStatus: ({ variant }: AttendanceStatusProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const AttendanceStatus: ({ variant, leaveColor, toolTipLabel, }: AttendanceStatusProps) => import("react/jsx-runtime").JSX.Element;
6
8
  export {};
7
9
  //# sourceMappingURL=AttendanceStatus.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttendanceStatus.d.ts","sourceRoot":"","sources":["../../src/Timeline/AttendanceStatus.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAE/B,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,aAAa,qBAAqB,4CA4ClE,CAAC"}
1
+ {"version":3,"file":"AttendanceStatus.d.ts","sourceRoot":"","sources":["../../src/Timeline/AttendanceStatus.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAE/B,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,wCAI9B,qBAAqB,4CA6CvB,CAAC"}
@@ -3,28 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AttendanceStatus = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
+ const Tooltip_1 = require("../Tooltip");
6
7
  const colorVariant_1 = require("../utils/colorVariant");
7
- const AttendanceStatus = ({ variant }) => {
8
+ const AttendanceStatus = ({ variant, leaveColor, toolTipLabel, }) => {
8
9
  const color = (0, colorVariant_1.getColorByVariant)(variant);
9
10
  return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { sx: { position: "relative", width: "100%", alignItems: "center" }, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
10
11
  position: "absolute",
11
12
  backgroundColor: "#ffffff",
12
- border: `1px solid ${color}`,
13
+ border: `1px solid ${leaveColor ?? color}`,
13
14
  borderRadius: "7px",
14
15
  padding: "0px 5px",
15
16
  zIndex: 1,
16
- color: `${color}`,
17
+ color: `${leaveColor ?? color}`,
17
18
  height: "28px",
18
19
  display: "flex",
19
20
  alignItems: "center",
20
- }, children: (0, colorVariant_1.getStatusLabel)(variant) }), (0, jsx_runtime_1.jsx)(material_1.Slider, { valueLabelDisplay: "off", value: [0, 2], max: 2, step: 1, sx: {
21
+ cursor: "pointer",
22
+ }, children: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: toolTipLabel, children: (0, colorVariant_1.getStatusLabel)(variant) }) }), (0, jsx_runtime_1.jsx)(material_1.Slider, { valueLabelDisplay: "off", value: [0, 2], max: 2, step: 1, sx: {
21
23
  "& .MuiSlider-track": {
22
- background: `${color}`,
24
+ background: `${leaveColor ?? color}`,
23
25
  height: "2px",
24
26
  border: "none",
25
27
  },
26
28
  "& .MuiSlider-thumb": {
27
- backgroundColor: `${color}`,
29
+ backgroundColor: `${leaveColor ?? color}`,
28
30
  height: 8,
29
31
  width: 8,
30
32
  },
@@ -3,6 +3,8 @@ export type HighlightedInterval = {
3
3
  in_time: string;
4
4
  out_time: string;
5
5
  status_type: WorkDayType;
6
+ name?: string;
7
+ color?: string;
6
8
  };
7
9
  type TimelineProps = {
8
10
  totalDots: number;
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../src/Timeline/Timeline.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;IAC5C,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,WAQzC,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,mFAMtB,aAAa,4CAyHf,CAAC"}
1
+ {"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../src/Timeline/Timeline.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;IAC5C,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,WAQzC,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,mFAMtB,aAAa,4CA0Hf,CAAC"}
@@ -53,7 +53,7 @@ const Timeline = ({ totalDots, highlightedIntervals, shiftStartTime, shiftEndTim
53
53
  top: "12px",
54
54
  zIndex: 2,
55
55
  left: `${(((getArrowPosition(shiftStartTime, shiftEndTime, "END") - slotStartTime) % totalDots) / (totalDots - 0.5)) * 100}%`,
56
- }, children: (0, jsx_runtime_1.jsx)(ArrowUp_1.ArrowUp, {}) }) }), (0, jsx_runtime_1.jsx)(material_1.Slider, { valueLabelDisplay: "off", marks: marks, max: totalDots - 1, step: 1, value: [], sx: {
56
+ }, children: (0, jsx_runtime_1.jsx)(ArrowUp_1.ArrowUp, {}) }) }), (0, jsx_runtime_1.jsx)(material_1.Slider, { disabled: true, valueLabelDisplay: "off", marks: marks, max: totalDots - 1, step: 1, value: [], sx: {
57
57
  zIndex: 1,
58
58
  "& .MuiSlider-track": {
59
59
  background: "transparent",
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineTrackSegments.d.ts","sourceRoot":"","sources":["../../src/Timeline/TimelineTrackSegments.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAErE,KAAK,0BAA0B,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,0CAInC,0BAA0B,4CAiH5B,CAAC"}
1
+ {"version":3,"file":"TimelineTrackSegments.d.ts","sourceRoot":"","sources":["../../src/Timeline/TimelineTrackSegments.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAErE,KAAK,0BAA0B,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,0CAInC,0BAA0B,4CAoH5B,CAAC"}
@@ -32,8 +32,9 @@ const TimelineTrackSegments = ({ totalDots, intervals, startTimeline, }) => {
32
32
  }
33
33
  const startPercent = (((in_time - startTimeline) % totalDots) / (totalDots - 1)) * 100;
34
34
  const endPercent = (((out_time - startTimeline) % totalDots) / (totalDots - 1)) * 100;
35
- const labelText = `In/Out: ${(0, date_1.getTimeInHHmm)(interval.in_time)} - ${(0, date_1.getTimeInHHmm)(interval.out_time)} (${shiftHours})`;
36
- const color = (0, colorVariant_1.getColorByVariant)(interval.status_type);
35
+ const labelText = interval?.name ??
36
+ `In/Out: ${(0, date_1.getTimeInHHmm)(interval.in_time)} - ${(0, date_1.getTimeInHHmm)(interval.out_time)} (${shiftHours})`;
37
+ const color = interval?.color ?? (0, colorVariant_1.getColorByVariant)(interval.status_type);
37
38
  return (
38
39
  // eslint-disable-next-line sonarjs/no-array-index-key
39
40
  (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", children: [isValidInTime && ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { arrow: true, title: inTimeLabel, placement: "top", children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
@@ -1,6 +1,6 @@
1
- export type WorkDayType = "present" | "holiday" | "weekly_off" | "working" | "first_half_off" | "second_half_off" | "full_day_weekly_off" | "first_half_weekly_off" | "second_half_weekly_off" | "paid_leave" | "absent" | "late_in_early_out" | "unpaid_leave" | "loss_of_pay" | "penalty";
2
- export type WorkDayTypeShort = "P" | "H" | "WO" | "HO" | "FHWO" | "SHWO" | "PL" | "A" | "LIEO" | "UPL" | "PEN" | "LOP";
1
+ export type WorkDayType = "present" | "holiday" | "weekly_off" | "working" | "first_half_off" | "second_half_off" | "full_day_weekly_off" | "first_half_weekly_off" | "second_half_weekly_off" | "paid_leave" | "absent" | "late_in_early_out" | "unpaid_leave" | "loss_of_pay" | "penalty" | "first_half_paid_leave" | "second_half_paid_leave" | "full_day_paid_leave" | "first_half_unpaid_leave" | "second_half_unpaid_leave" | "full_day_unpaid_leave" | "leave";
2
+ export type WorkDayTypeShort = "P" | "H" | "WO" | "HO" | "FHWO" | "SHWO" | "PL" | "A" | "LIEO" | "UPL" | "PEN" | "LOP" | "L";
3
3
  export declare const serverityOptions: Record<WorkDayType, WorkDayTypeShort>;
4
4
  export declare const getColorByVariant: (variant: WorkDayType, type?: string) => string | undefined;
5
- export declare const getStatusLabel: (status: WorkDayType) => "Present" | "Absent" | "Weekly Off" | "Working" | "Holiday" | "Paid Leave" | "Unpaid Leave" | "First Half Weekly Off" | "Second Half Weekly Off" | "First Half Off" | "Second Half Off" | "Late In/Early Out" | "Loss of Pay" | "Penalty";
5
+ export declare const getStatusLabel: (status: WorkDayType) => "Present" | "Absent" | "Weekly Off" | "Working" | "Holiday" | "Paid Leave" | "Unpaid Leave" | "First Half Weekly Off" | "Second Half Weekly Off" | "First Half Off" | "Second Half Off" | "Late In/Early Out" | "Loss of Pay" | "Penalty" | "First Half Paid Leave" | "Second Half Paid Leave" | "Full Day Paid Leave" | "First Half Unpaid Leave" | "Second Half Unpaid Leave" | "Full Day Unpaid Leave" | "Leave";
6
6
  //# sourceMappingURL=colorVariant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"colorVariant.d.ts","sourceRoot":"","sources":["../../src/utils/colorVariant.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,SAAS,GACT,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,iBAAiB,GACjB,qBAAqB,GACrB,uBAAuB,GACvB,wBAAwB,GACxB,YAAY,GACZ,QAAQ,GACR,mBAAmB,GACnB,cAAc,GACd,aAAa,GACb,SAAS,CAAC;AAEd,MAAM,MAAM,gBAAgB,GACxB,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,MAAM,GACN,IAAI,GACJ,GAAG,GACH,MAAM,GACN,KAAK,GACL,KAAK,GACL,KAAK,CAAC;AAEV,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAgBlE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,WAAW,EAAE,aAAa,uBA0DpE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,WAAW,8OAkDjD,CAAC"}
1
+ {"version":3,"file":"colorVariant.d.ts","sourceRoot":"","sources":["../../src/utils/colorVariant.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,SAAS,GACT,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,iBAAiB,GACjB,qBAAqB,GACrB,uBAAuB,GACvB,wBAAwB,GACxB,YAAY,GACZ,QAAQ,GACR,mBAAmB,GACnB,cAAc,GACd,aAAa,GACb,SAAS,GACT,uBAAuB,GACvB,wBAAwB,GACxB,qBAAqB,GACrB,yBAAyB,GACzB,0BAA0B,GAC1B,uBAAuB,GACvB,OAAO,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GACxB,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,MAAM,GACN,IAAI,GACJ,GAAG,GACH,MAAM,GACN,KAAK,GACL,KAAK,GACL,KAAK,GACL,GAAG,CAAC;AAER,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAuBlE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,WAAW,EAAE,aAAa,uBA4EpE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,WAAW,wZAuEjD,CAAC"}
@@ -10,14 +10,21 @@ exports.serverityOptions = {
10
10
  first_half_off: "HO",
11
11
  second_half_off: "HO",
12
12
  full_day_weekly_off: "WO",
13
- first_half_weekly_off: "FHWO",
14
- second_half_weekly_off: "SHWO",
13
+ first_half_weekly_off: "WO",
14
+ second_half_weekly_off: "WO",
15
15
  paid_leave: "PL",
16
16
  absent: "A",
17
17
  unpaid_leave: "UPL",
18
18
  late_in_early_out: "LIEO",
19
19
  loss_of_pay: "LOP",
20
20
  penalty: "PEN",
21
+ first_half_paid_leave: "L",
22
+ second_half_paid_leave: "L",
23
+ full_day_paid_leave: "L",
24
+ first_half_unpaid_leave: "L",
25
+ second_half_unpaid_leave: "L",
26
+ full_day_unpaid_leave: "L",
27
+ leave: "L",
21
28
  };
22
29
  const getColorByVariant = (variant, type = "dark") => {
23
30
  const theme = (0, material_1.useTheme)();
@@ -55,6 +62,18 @@ const getColorByVariant = (variant, type = "dark") => {
55
62
  return lipstickRed[800];
56
63
  case "penalty":
57
64
  return lipstickRed[index];
65
+ case "first_half_paid_leave":
66
+ return orchid[index];
67
+ case "second_half_paid_leave":
68
+ return orchid[index];
69
+ case "full_day_paid_leave":
70
+ return orchid[index];
71
+ case "first_half_unpaid_leave":
72
+ return deepAqua[index];
73
+ case "second_half_unpaid_leave":
74
+ return deepAqua[index];
75
+ case "full_day_unpaid_leave":
76
+ return deepAqua[index];
58
77
  default:
59
78
  return lipstickRed[index];
60
79
  }
@@ -92,6 +111,20 @@ const getStatusLabel = (status) => {
92
111
  return "Loss of Pay";
93
112
  case "penalty":
94
113
  return "Penalty";
114
+ case "first_half_paid_leave":
115
+ return "First Half Paid Leave";
116
+ case "second_half_paid_leave":
117
+ return "Second Half Paid Leave";
118
+ case "full_day_paid_leave":
119
+ return "Full Day Paid Leave";
120
+ case "first_half_unpaid_leave":
121
+ return "First Half Unpaid Leave";
122
+ case "second_half_unpaid_leave":
123
+ return "Second Half Unpaid Leave";
124
+ case "full_day_unpaid_leave":
125
+ return "Full Day Unpaid Leave";
126
+ case "leave":
127
+ return "Leave";
95
128
  default:
96
129
  return "Absent";
97
130
  }