@codezee/sixtify-brahma 0.2.30 → 0.2.31
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/FilterList/FilterListV2.d.ts +1 -2
- package/packages/shared-components/dist/FilterList/FilterListV2.d.ts.map +1 -1
- package/packages/shared-components/dist/FilterList/FilterListV2.js +1 -2
- package/packages/shared-components/dist/FilterList/FilterTypeWrapper.d.ts +1 -2
- package/packages/shared-components/dist/FilterList/FilterTypeWrapper.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/FileUpload/FileUpload.d.ts +7 -3
- package/packages/shared-components/dist/FormFields/FileUpload/FileUpload.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/FileUpload/FileUpload.js +5 -3
- package/packages/shared-components/dist/utils/file.d.ts.map +1 -1
- package/packages/shared-components/dist/utils/file.js +2 -0
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { FieldValues } from "react-hook-form";
|
|
2
2
|
import type { FilterListType } from "./FilterTypeWrapper";
|
|
3
|
-
export type FilterKeys = "company_id" | "business_unit_id" | "department_id" | "switch";
|
|
4
3
|
export type FilterListV2Props = {
|
|
5
4
|
filterListItems: FilterListType[];
|
|
6
5
|
isDisabled?: boolean;
|
|
7
6
|
filterListData?: FieldValues;
|
|
8
|
-
onApply: (data: FieldValues, isPopup?: boolean, key?:
|
|
7
|
+
onApply: (data: FieldValues, isPopup?: boolean, key?: string) => void;
|
|
9
8
|
onChange: (data: FieldValues, isPopup: boolean) => void;
|
|
10
9
|
onClear: () => void;
|
|
11
10
|
resetFormBasedOnFields?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterListV2.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterListV2.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAenD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"FilterListV2.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterListV2.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAenD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AACF,eAAO,MAAM,YAAY,GAAI,wFAQ1B,iBAAiB,4CAwlBnB,CAAC"}
|
|
@@ -175,7 +175,6 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
|
|
|
175
175
|
}, [formData, dirtyFields]);
|
|
176
176
|
const renderChips = (data) => {
|
|
177
177
|
return Object.entries(data).map(([key, value]) => {
|
|
178
|
-
const filterKey = key;
|
|
179
178
|
if (typeof value !== "boolean" && !value) {
|
|
180
179
|
return;
|
|
181
180
|
}
|
|
@@ -191,7 +190,7 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
|
|
|
191
190
|
// eslint-disable-next-line sonarjs/no-base-to-string
|
|
192
191
|
, {
|
|
193
192
|
// eslint-disable-next-line sonarjs/no-base-to-string
|
|
194
|
-
toolTipLabel: `${keyValue}`, children: `${item?.label}: ${keyValue}` }), onDelete: () => handleDelete(
|
|
193
|
+
toolTipLabel: `${keyValue}`, children: `${item?.label}: ${keyValue}` }), onDelete: () => handleDelete(key), onClick: (e) => {
|
|
195
194
|
setOpenFilterPopup(true);
|
|
196
195
|
filterPopupAnchorElm.current = e.currentTarget;
|
|
197
196
|
const item = getFilterItem(key);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Control, FieldValues } from "react-hook-form";
|
|
2
|
-
import { FilterKeys } from "./FilterListV2";
|
|
3
2
|
export type FilterComponentType = "autoComplete" | "text" | "date" | "dateRange" | "checkbox" | "radio" | "switch";
|
|
4
3
|
type Options = readonly {
|
|
5
4
|
label: string;
|
|
@@ -10,7 +9,7 @@ type Options = readonly {
|
|
|
10
9
|
export type FilterListType = {
|
|
11
10
|
label: string;
|
|
12
11
|
isDisabled?: boolean;
|
|
13
|
-
key:
|
|
12
|
+
key: string;
|
|
14
13
|
value: string;
|
|
15
14
|
type: FilterComponentType;
|
|
16
15
|
menuInfo?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterTypeWrapper.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterTypeWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterTypeWrapper.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterTypeWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG5D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,MAAM,GACN,MAAM,GACN,WAAW,GACX,UAAU,GACV,OAAO,GACP,QAAQ,CAAC;AAEb,KAAK,OAAO,GAAG,SAAS;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,EAAE,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/B,CAAC;AACF,eAAO,MAAM,iBAAiB,GAAI,sBAG/B,sBAAsB,4CAqBxB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldValues, UseControllerProps
|
|
1
|
+
import type { FieldError, FieldValues, UseControllerProps } from "react-hook-form";
|
|
2
2
|
export type FileUploadProps<P extends FieldValues> = UseControllerProps<P> & {
|
|
3
3
|
multiple?: boolean;
|
|
4
4
|
loading?: boolean;
|
|
@@ -11,7 +11,11 @@ export type FileUploadProps<P extends FieldValues> = UseControllerProps<P> & {
|
|
|
11
11
|
accept?: string;
|
|
12
12
|
fileNames: JSX.Element;
|
|
13
13
|
acceptTitle?: string;
|
|
14
|
-
setError
|
|
14
|
+
setError: (name: keyof P, error: FieldError | {
|
|
15
|
+
type: string;
|
|
16
|
+
message?: string;
|
|
17
|
+
}) => void;
|
|
15
18
|
};
|
|
16
|
-
export declare
|
|
19
|
+
export declare const error_with_transaltion = "error_with_transaltion";
|
|
20
|
+
export declare function FileUpload<P extends FieldValues>({ loading, onChange, isDisabled, multiple, error, helperText, label, fileNames, size, name, setError, accept, acceptTitle, ...restProps }: FileUploadProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
17
21
|
//# sourceMappingURL=FileUpload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/FormFields/FileUpload/FileUpload.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,
|
|
1
|
+
{"version":3,"file":"FileUpload.d.ts","sourceRoot":"","sources":["../../../src/FormFields/FileUpload/FileUpload.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAQzB,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,IAAI,kBAAkB,CAAC,CAAC,CAAC,GAAG;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,CAAC,EACb,KAAK,EAAE,UAAU,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KACnD,IAAI,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAE/D,wBAAgB,UAAU,CAAC,CAAC,SAAS,WAAW,EAAE,EAChD,OAAe,EACf,QAAQ,EACR,UAAU,EACV,QAAgB,EAChB,KAAK,EACL,UAAU,EACV,KAAK,EACL,SAAS,EACT,IAAS,EACT,IAAI,EACJ,QAAQ,EACR,MAA0C,EAC1C,WAAsD,EACtD,GAAG,SAAS,EACb,EAAE,eAAe,CAAC,CAAC,CAAC,2CA6GpB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.error_with_transaltion = void 0;
|
|
3
4
|
exports.FileUpload = FileUpload;
|
|
4
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
6
|
const material_1 = require("@mui/material");
|
|
@@ -11,7 +12,8 @@ const Svgs_1 = require("../../Svgs");
|
|
|
11
12
|
const utils_1 = require("../../utils");
|
|
12
13
|
const FileUpload_styled_1 = require("./FileUpload.styled");
|
|
13
14
|
const Skeleton_1 = require("./Skeleton");
|
|
14
|
-
|
|
15
|
+
exports.error_with_transaltion = "error_with_transaltion";
|
|
16
|
+
function FileUpload({ loading = false, onChange, isDisabled, multiple = false, error, helperText, label, fileNames, size = 10, name, setError, accept = ".png,.jpg,.jpeg,.doc,.docx,.pdf", acceptTitle = "Only JPG, PNG, PDF files are accepted.", ...restProps }) {
|
|
15
17
|
const theme = (0, material_1.useTheme)();
|
|
16
18
|
const { red } = theme.palette.app.color;
|
|
17
19
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
@@ -42,8 +44,8 @@ function FileUpload({ loading = false, onChange, isDisabled, multiple = false, e
|
|
|
42
44
|
}
|
|
43
45
|
if (isShowError) {
|
|
44
46
|
if ((0, lodash_1.isFunction)(setError)) {
|
|
45
|
-
setError(
|
|
46
|
-
type:
|
|
47
|
+
setError(name, {
|
|
48
|
+
type: exports.error_with_transaltion,
|
|
47
49
|
message: inValidFiles.join("\n"),
|
|
48
50
|
});
|
|
49
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/utils/file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/utils/file.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,EAAE,WAAW,MAAM,YAI5D,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,YAEzC,CAAC"}
|
|
@@ -6,7 +6,9 @@ const SUPPORTED_FILE_TYPES = [
|
|
|
6
6
|
"image/jpeg",
|
|
7
7
|
"image/jpg",
|
|
8
8
|
"application/pdf",
|
|
9
|
+
"application/zip",
|
|
9
10
|
"application/msword",
|
|
11
|
+
"application/x-zip-compressed",
|
|
10
12
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
11
13
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
12
14
|
"application/vnd.ms-excel",
|