@codezee/sixtify-brahma 0.2.44 → 0.2.45
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 +1 -1
- package/packages/shared-components/dist/Actions/DownloadIconAction.d.ts.map +1 -1
- package/packages/shared-components/dist/Actions/DownloadIconAction.js +3 -1
- package/packages/shared-components/dist/FormFields/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/DateRangePicker/DateRangePicker.js +3 -2
- package/packages/shared-components/dist/FormFields/DateRangeSelector/DateRangeSelector.d.ts +10 -0
- package/packages/shared-components/dist/FormFields/DateRangeSelector/DateRangeSelector.d.ts.map +1 -0
- package/packages/shared-components/dist/FormFields/DateRangeSelector/DateRangeSelector.js +49 -0
- package/packages/shared-components/dist/FormFields/DateRangeSelector/index.d.ts +2 -0
- package/packages/shared-components/dist/FormFields/DateRangeSelector/index.d.ts.map +1 -0
- package/packages/shared-components/dist/FormFields/DateRangeSelector/index.js +17 -0
- package/packages/shared-components/dist/FormFields/FileUpload/FileNames.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/FileUpload/FileNames.js +1 -1
- package/packages/shared-components/dist/FormFields/index.d.ts +1 -0
- package/packages/shared-components/dist/FormFields/index.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/index.js +1 -0
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloadIconAction.d.ts","sourceRoot":"","sources":["../../src/Actions/DownloadIconAction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKrD,MAAM,MAAM,uBAAuB,GAAG,eAAe,CAAC;AAEtD,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,
|
|
1
|
+
{"version":3,"file":"DownloadIconAction.d.ts","sourceRoot":"","sources":["../../src/Actions/DownloadIconAction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKrD,MAAM,MAAM,uBAAuB,GAAG,eAAe,CAAC;AAEtD,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,4CAShE,CAAC"}
|
|
@@ -6,6 +6,8 @@ const material_1 = require("@mui/material");
|
|
|
6
6
|
const Svgs_1 = require("../Svgs");
|
|
7
7
|
const Tooltip_1 = require("../Tooltip");
|
|
8
8
|
const DownloadIconAction = (props) => {
|
|
9
|
-
return (
|
|
9
|
+
return (
|
|
10
|
+
// TODO: Need to add margin top to set the UI in sync with the design
|
|
11
|
+
(0, jsx_runtime_1.jsx)(material_1.IconButton, { ...props, children: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: "Download", children: (0, jsx_runtime_1.jsx)(Svgs_1.SvgDownload, {}) }) }));
|
|
10
12
|
};
|
|
11
13
|
exports.DownloadIconAction = DownloadIconAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/FormFields/DateRangePicker/DateRangePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/FormFields/DateRangePicker/DateRangePicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAIvE,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,WAAW,IACpD,kBAAkB,CAAC,CAAC,CAAC,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,CAAC;AAEJ,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,EAAE,EACrD,OAAO,EACP,YAAY,EACZ,QAAgB,EAChB,KAAK,EACL,IAAI,EACJ,KAAa,EACb,UAAU,EACV,OAAe,EACf,QAAgB,EAChB,KAAK,GACN,EAAE,oBAAoB,CAAC,CAAC,CAAC,2CAkEzB"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DateRangePicker = DateRangePicker;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
|
+
const luxon_1 = require("luxon");
|
|
6
7
|
const react_1 = require("react");
|
|
7
8
|
const react_date_range_1 = require("react-date-range");
|
|
8
9
|
const react_hook_form_1 = require("react-hook-form");
|
|
@@ -31,8 +32,8 @@ function DateRangePicker({ control, defaultValue, disabled = false, label, name,
|
|
|
31
32
|
key: selectedRange.key,
|
|
32
33
|
},
|
|
33
34
|
]);
|
|
34
|
-
const startDate =
|
|
35
|
-
const endDate =
|
|
35
|
+
const startDate = luxon_1.DateTime.fromJSDate(selectedRange.startDate).toISODate();
|
|
36
|
+
const endDate = luxon_1.DateTime.fromJSDate(selectedRange.endDate).toISODate();
|
|
36
37
|
onChange([startDate, endDate]);
|
|
37
38
|
}
|
|
38
39
|
}, months: 1, direction: "horizontal", calendarFocus: "backwards", staticRanges: [], inputRanges: [], moveRangeOnFirstSelection: false, preventSnapRefocus: true }), error && (0, jsx_runtime_1.jsx)(material_1.Typography, { color: "red", children: helperText })] }));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Control, FieldValues, Path, UseFormSetValue, UseFormWatch } from "react-hook-form";
|
|
2
|
+
type DateRangeSelectorProps<T extends FieldValues> = {
|
|
3
|
+
name: Path<T>;
|
|
4
|
+
watch: UseFormWatch<T>;
|
|
5
|
+
control: Control<T>;
|
|
6
|
+
setValue: UseFormSetValue<T>;
|
|
7
|
+
};
|
|
8
|
+
export declare function DateRangeSelector<T extends FieldValues>({ name, watch, control, setValue, }: Readonly<DateRangeSelectorProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=DateRangeSelector.d.ts.map
|
package/packages/shared-components/dist/FormFields/DateRangeSelector/DateRangeSelector.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRangeSelector.d.ts","sourceRoot":"","sources":["../../../src/FormFields/DateRangeSelector/DateRangeSelector.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACX,IAAI,EAEJ,eAAe,EACf,YAAY,EACb,MAAM,iBAAiB,CAAC;AAUzB,KAAK,sBAAsB,CAAC,CAAC,SAAS,WAAW,IAAI;IACnD,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAC9B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,EAAE,EACvD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,QAAQ,GACT,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,2CAkFrC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DateRangeSelector = DateRangeSelector;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const MoreVert_1 = __importDefault(require("@mui/icons-material/MoreVert"));
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
10
|
+
const luxon_1 = require("luxon");
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const PadBox_1 = require("../../PadBox");
|
|
13
|
+
const utils_1 = require("../../utils");
|
|
14
|
+
const DateRangePicker_1 = require("../DateRangePicker");
|
|
15
|
+
function DateRangeSelector({ name, watch, control, setValue, }) {
|
|
16
|
+
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
17
|
+
const [showCustom, setShowCustom] = (0, react_1.useState)(false);
|
|
18
|
+
const dateField = watch(name);
|
|
19
|
+
const castDateRangeToPathValue = (dateField) => {
|
|
20
|
+
return dateField;
|
|
21
|
+
};
|
|
22
|
+
const setRange = (days) => {
|
|
23
|
+
if (!showCustom) {
|
|
24
|
+
const fromDate = luxon_1.DateTime.now().minus({ days }).toISODate();
|
|
25
|
+
const toDate = luxon_1.DateTime.now().toISODate();
|
|
26
|
+
setValue(name, castDateRangeToPathValue([fromDate, toDate]));
|
|
27
|
+
setAnchorEl(null);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const defaultRanges = [
|
|
31
|
+
{ title: "Last 7 days", onClick: () => setRange(7) },
|
|
32
|
+
{ title: "Last 14 days", onClick: () => setRange(14) },
|
|
33
|
+
{ title: "Last 30 days", onClick: () => setRange(30) },
|
|
34
|
+
{ title: "Custom", onClick: () => setShowCustom(true) },
|
|
35
|
+
];
|
|
36
|
+
(0, react_1.useMemo)(() => {
|
|
37
|
+
if (showCustom && Array.isArray(dateField)) {
|
|
38
|
+
setValue(name, castDateRangeToPathValue(dateField));
|
|
39
|
+
}
|
|
40
|
+
}, [showCustom, name]);
|
|
41
|
+
const handleClick = (event) => {
|
|
42
|
+
setAnchorEl(event.currentTarget);
|
|
43
|
+
};
|
|
44
|
+
const handleClose = () => {
|
|
45
|
+
setAnchorEl(null);
|
|
46
|
+
setShowCustom(false);
|
|
47
|
+
};
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "body2", children: [(0, utils_1.formatDate)(dateField[0] ?? "", "dd MMM yyyy"), " -", (0, utils_1.formatDate)(dateField[1] ?? "", "dd MMM yyyy")] }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { component: "div", onClick: handleClick, children: (0, jsx_runtime_1.jsx)(MoreVert_1.default, { fontSize: "small" }) }), !!anchorEl && ((0, jsx_runtime_1.jsx)(material_1.Popover, { open: true, anchorEl: anchorEl, onClose: handleClose, anchorOrigin: { vertical: "bottom", horizontal: "left" }, children: (0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "8px" }, children: showCustom ? ((0, jsx_runtime_1.jsx)(DateRangePicker_1.DateRangePicker, { name: name, control: control })) : (defaultRanges.map((item) => ((0, jsx_runtime_1.jsx)(material_1.ListItemButton, { sx: { width: "100%", textAlign: "center" }, onClick: item.onClick, children: item.title }, item.title)))) }) }))] }));
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/FormFields/DateRangeSelector/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DateRangeSelector"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileNames.d.ts","sourceRoot":"","sources":["../../../src/FormFields/FileUpload/FileNames.tsx"],"names":[],"mappings":"AAYA,KAAK,cAAc,GAAG;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,0CAIvB,cAAc,
|
|
1
|
+
{"version":3,"file":"FileNames.d.ts","sourceRoot":"","sources":["../../../src/FormFields/FileUpload/FileNames.tsx"],"names":[],"mappings":"AAYA,KAAK,cAAc,GAAG;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,0CAIvB,cAAc,4CA+EhB,CAAC"}
|
|
@@ -35,6 +35,6 @@ const FileNames = ({ fileNames, previewEnabled = false, onDelete, }) => {
|
|
|
35
35
|
const dialogRenderer = {
|
|
36
36
|
viewAttachment: selectedFile && ((0, jsx_runtime_1.jsx)(ViewFilePreviewDialog_1.ViewFilePreviewDialog, { open: openedDialog === "viewAttachment", onClose: onDialogClose, fileName: selectedFile })),
|
|
37
37
|
};
|
|
38
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { gap: "5px", maxHeight: "120px", overflow: "auto", children: [names.map((name, index) => ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", gap: "5x", alignItems: "center", maxWidth: "80%", overflow: "hidden", children: [(0, jsx_runtime_1.jsx)(icons_material_1.AttachFile, {}), (0, jsx_runtime_1.jsx)(material_1.Typography, { maxWidth: "100%", textOverflow: "clip", children: name })] }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", children: [previewEnabled && ((0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => fileNames[index] && handlePreviewClick(fileNames[index]), children: (0, jsx_runtime_1.jsx)(icons_material_1.VisibilityOutlined, {}) })), (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => onDelete(index), children: (0, jsx_runtime_1.jsx)(DeleteOutlineOutlined_1.default, {}) })] })] }, (0, uuid_1.v4)()))), openedDialog && dialogRenderer[openedDialog]] }));
|
|
39
39
|
};
|
|
40
40
|
exports.FileNames = FileNames;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormFields/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormFields/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./Autocomplete"), exports);
|
|
18
18
|
__exportStar(require("./CheckBox"), exports);
|
|
19
19
|
__exportStar(require("./DatePicker"), exports);
|
|
20
|
+
__exportStar(require("./DateRangeSelector"), exports);
|
|
20
21
|
__exportStar(require("./DateRangePicker"), exports);
|
|
21
22
|
__exportStar(require("./DateTimePicker"), exports);
|
|
22
23
|
__exportStar(require("./FileUpload"), exports);
|