norma-library 0.6.894 → 0.6.981
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/esm/components/Accordion.js +2 -3
- package/dist/esm/components/Accordion.js.map +1 -1
- package/dist/esm/components/ProgressBar.js +6 -7
- package/dist/esm/components/ProgressBar.js.map +1 -1
- package/dist/esm/components/UncontrolledTable/{index.js → UncontrolledTable.js} +22 -24
- package/dist/esm/components/UncontrolledTable/UncontrolledTable.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/{styles.d.ts → UncontrolledTable.style.d.ts} +3 -1
- package/dist/esm/components/UncontrolledTable/{styles.js → UncontrolledTable.style.js} +9 -6
- package/dist/esm/components/UncontrolledTable/UncontrolledTable.style.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/TableButton/TableButton.d.ts +15 -0
- package/dist/esm/components/UncontrolledTable/components/TableButton/TableButton.js +45 -0
- package/dist/esm/components/UncontrolledTable/components/TableButton/TableButton.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/TableButton/TableButton.style.d.ts +16 -0
- package/dist/esm/components/UncontrolledTable/components/TableButton/TableButton.style.js +9 -0
- package/dist/esm/components/UncontrolledTable/components/TableButton/TableButton.style.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/header/header.d.ts +15 -0
- package/dist/esm/components/UncontrolledTable/components/header/header.js +48 -0
- package/dist/esm/components/UncontrolledTable/components/header/header.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/header/header.styles.d.ts +4 -0
- package/dist/esm/components/UncontrolledTable/components/header/header.styles.js +8 -0
- package/dist/esm/components/UncontrolledTable/components/header/header.styles.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/index.d.ts +4 -3
- package/dist/esm/components/UncontrolledTable/components/index.js +4 -3
- package/dist/esm/components/UncontrolledTable/components/index.js.map +1 -1
- package/dist/esm/components/UncontrolledTable/components/pagination/{index.js → pagination.js} +2 -2
- package/dist/esm/components/UncontrolledTable/components/pagination/pagination.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/pagination/{styles.js → pagination.styles.js} +1 -1
- package/dist/esm/components/UncontrolledTable/components/pagination/pagination.styles.js.map +1 -0
- package/dist/esm/components/UncontrolledTable/components/row/DraggableRow.js +1 -1
- package/dist/esm/components/UncontrolledTable/components/row/DraggableRow.js.map +1 -1
- package/dist/esm/components/UncontrolledTable/components/row/SimpleRow.js +1 -1
- package/dist/esm/components/UncontrolledTable/components/row/SimpleRow.js.map +1 -1
- package/dist/esm/components/UncontrolledTable/components/row/styles.d.ts +1 -1
- package/dist/esm/components/UncontrolledTable/components/row/styles.js +2 -8
- package/dist/esm/components/UncontrolledTable/components/row/styles.js.map +1 -1
- package/dist/esm/components/UncontrolledTable/interface.d.ts +37 -19
- package/dist/esm/hooks/useClickOutside.js.map +1 -1
- package/dist/esm/hooks/useOutsideScreen.d.ts +7 -0
- package/dist/esm/hooks/useOutsideScreen.js +30 -0
- package/dist/esm/hooks/useOutsideScreen.js.map +1 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Accordion.tsx +19 -15
- package/src/components/ProgressBar.tsx +28 -28
- package/src/components/UncontrolledTable/{styles.tsx → UncontrolledTable.style.tsx} +28 -18
- package/src/components/UncontrolledTable/{index.tsx → UncontrolledTable.tsx} +82 -91
- package/src/components/UncontrolledTable/components/TableButton/TableButton.style.tsx +50 -0
- package/src/components/UncontrolledTable/components/TableButton/TableButton.tsx +83 -0
- package/src/components/UncontrolledTable/components/header/header.styles.tsx +26 -0
- package/src/components/UncontrolledTable/components/header/header.tsx +85 -0
- package/src/components/UncontrolledTable/components/index.tsx +6 -3
- package/src/components/UncontrolledTable/components/pagination/{index.tsx → pagination.tsx} +1 -1
- package/src/components/UncontrolledTable/components/row/DraggableRow.tsx +11 -11
- package/src/components/UncontrolledTable/components/row/SimpleRow.tsx +7 -8
- package/src/components/UncontrolledTable/components/row/styles.tsx +5 -15
- package/src/components/UncontrolledTable/interface.ts +59 -38
- package/src/hooks/useClickOutside.tsx +9 -9
- package/src/hooks/useOutsideScreen.tsx +35 -0
- package/src/index.ts +1 -1
- package/src/stories/UncontrolledTable.stories.tsx +330 -25
- package/dist/esm/components/UncontrolledTable/components/header/index.d.ts +0 -3
- package/dist/esm/components/UncontrolledTable/components/header/index.js +0 -39
- package/dist/esm/components/UncontrolledTable/components/header/index.js.map +0 -1
- package/dist/esm/components/UncontrolledTable/components/header/styles.d.ts +0 -8
- package/dist/esm/components/UncontrolledTable/components/header/styles.js +0 -12
- package/dist/esm/components/UncontrolledTable/components/header/styles.js.map +0 -1
- package/dist/esm/components/UncontrolledTable/components/pagination/index.js.map +0 -1
- package/dist/esm/components/UncontrolledTable/components/pagination/styles.js.map +0 -1
- package/dist/esm/components/UncontrolledTable/index.js.map +0 -1
- package/dist/esm/components/UncontrolledTable/styles.js.map +0 -1
- package/src/components/UncontrolledTable/components/header/index.tsx +0 -89
- package/src/components/UncontrolledTable/components/header/styles.tsx +0 -67
- /package/dist/esm/components/UncontrolledTable/{index.d.ts → UncontrolledTable.d.ts} +0 -0
- /package/dist/esm/components/UncontrolledTable/components/pagination/{index.d.ts → pagination.d.ts} +0 -0
- /package/dist/esm/components/UncontrolledTable/components/pagination/{styles.d.ts → pagination.styles.d.ts} +0 -0
- /package/src/components/UncontrolledTable/components/pagination/{styles.tsx → pagination.styles.tsx} +0 -0
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { __makeTemplateObject } from "tslib";
|
|
2
|
-
import { breakpoints } from '../../../../utils/styledBreakpoints';
|
|
3
2
|
import styled from 'styled-components';
|
|
4
|
-
export var Tr = styled.tr(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: inherit;\n display: table-row;\n vertical-align: middle;\n outline: 0;\n
|
|
5
|
-
export var Td = styled.td(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.5rem;\n letter-spacing: 0.01071em;\n display: table-cell;\n vertical-align: inherit;\n border-bottom: 1px solid rgba(224, 224, 224, 1);\n text-align: left;\n padding:
|
|
6
|
-
cssProp: 'padding',
|
|
7
|
-
cssPropUnits: 'px',
|
|
8
|
-
values: [{ 1440: 8 }],
|
|
9
|
-
mediaQueryType: 'max-width',
|
|
10
|
-
}));
|
|
3
|
+
export var Tr = styled.tr(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: inherit;\n display: table-row;\n vertical-align: middle;\n outline: 0;\n"], ["\n color: inherit;\n display: table-row;\n vertical-align: middle;\n outline: 0;\n"])));
|
|
4
|
+
export var Td = styled.td(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.5rem;\n letter-spacing: 0.01071em;\n display: table-cell;\n vertical-align: inherit;\n border-bottom: 1px solid rgba(224, 224, 224, 1);\n text-align: left;\n padding: 8px;\n color: #666666;\n font-size: 0.875rem;\n"], ["\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.5rem;\n letter-spacing: 0.01071em;\n display: table-cell;\n vertical-align: inherit;\n border-bottom: 1px solid rgba(224, 224, 224, 1);\n text-align: left;\n padding: 8px;\n color: #666666;\n font-size: 0.875rem;\n"])));
|
|
11
5
|
var templateObject_1, templateObject_2;
|
|
12
6
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../src/components/UncontrolledTable/components/row/styles.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../src/components/UncontrolledTable/components/row/styles.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,CAAC,IAAM,EAAE,GAAG,MAAM,CAAC,EAAE,2JAAA,wFAK1B,IAAA,CAAA;AAED,MAAM,CAAC,IAAM,EAAE,GAAG,MAAM,CAAC,EAAE,mWAAA,gSAY1B,IAAA,CAAA"}
|
|
@@ -1,38 +1,56 @@
|
|
|
1
1
|
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
+
import { JSX } from 'react';
|
|
2
3
|
type Labels = {
|
|
3
|
-
orderAsc
|
|
4
|
-
orderDesc
|
|
5
|
-
filter
|
|
6
|
-
clearFilter
|
|
4
|
+
orderAsc?: string;
|
|
5
|
+
orderDesc?: string;
|
|
6
|
+
filter?: string;
|
|
7
|
+
clearFilter?: string;
|
|
8
|
+
columns?: string;
|
|
7
9
|
};
|
|
8
10
|
interface Pagination {
|
|
9
11
|
pageIndex: number;
|
|
10
12
|
pageSize: number;
|
|
11
13
|
}
|
|
14
|
+
interface Sticky {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
top: number;
|
|
17
|
+
}
|
|
18
|
+
export interface TableList {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string | JSX.Element;
|
|
21
|
+
onClick?: (id: string) => void;
|
|
22
|
+
checked?: () => boolean | boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface TableButton {
|
|
26
|
+
render: () => JSX.Element;
|
|
27
|
+
list?: {
|
|
28
|
+
options: TableList[];
|
|
29
|
+
toggleableList?: boolean;
|
|
30
|
+
closeOnClick?: boolean;
|
|
31
|
+
};
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
onClick?: () => void;
|
|
34
|
+
}
|
|
12
35
|
export interface UncontrolledTableProps {
|
|
13
36
|
data: any;
|
|
14
37
|
columns: ColumnDef<ColumnsTable>[];
|
|
15
|
-
onClick: any;
|
|
16
|
-
onMouseOver: any;
|
|
17
|
-
onMouseOut: any;
|
|
18
|
-
showTotalResults: boolean;
|
|
19
|
-
showSettings: boolean;
|
|
20
38
|
pagination?: Pagination;
|
|
21
|
-
totalPages
|
|
22
|
-
showClearFields?: boolean;
|
|
23
|
-
customTotalResults?: string;
|
|
39
|
+
totalPages?: number;
|
|
24
40
|
labels?: Labels;
|
|
25
41
|
tableClassName?: string;
|
|
26
|
-
|
|
27
|
-
stickyHeaderP?: number;
|
|
28
|
-
customIcons?: React.ReactNode[];
|
|
29
|
-
hideColumns?: string[];
|
|
42
|
+
sticky?: Sticky;
|
|
30
43
|
draggable?: boolean;
|
|
31
|
-
|
|
32
|
-
|
|
44
|
+
buttons?: TableButton[];
|
|
45
|
+
configs?: TableButton[];
|
|
46
|
+
hideColumns?: string[];
|
|
47
|
+
onClick?: () => void;
|
|
48
|
+
onMouseOver?: () => void;
|
|
49
|
+
onMouseOut?: () => void;
|
|
50
|
+
onColumnVisibilityChange?: (column: string, value: boolean) => void;
|
|
51
|
+
onChangePage?: (pagination: Pagination) => void;
|
|
33
52
|
onFilterClick?: (column: string) => void;
|
|
34
53
|
onSortClick?: (column: string, direction: string) => void;
|
|
35
|
-
onColumnVisibilityChange?: (columnId: string, isVisible: boolean) => void;
|
|
36
54
|
onDragEnd?: (data: any[]) => void;
|
|
37
55
|
}
|
|
38
56
|
export interface ColumnsTable {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClickOutside.js","sourceRoot":"","sources":["../../../src/hooks/useClickOutside.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"useClickOutside.js","sourceRoot":"","sources":["../../../src/hooks/useClickOutside.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,IAAM,eAAe,GAAG,UAAC,GAAwC,EAAE,QAAoB;IACrF,IAAM,kBAAkB,GAAG,UAAC,KAAiB;QAC3C,IAAI,GAAG,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE,CAAC;YAC/D,QAAQ,EAAE,CAAA;QACZ,CAAC;IACH,CAAC,CAAA;IAED,SAAS,CAAC;QACR,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAA;QAC1D,OAAO;YACL,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAA;QAC/D,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAA;AACrB,CAAC,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Hook that detects when an element is partially visible in the viewport
|
|
4
|
+
* @param elementRef - Reference to the DOM element to observe
|
|
5
|
+
* @returns boolean indicating if the element is partially visible in the viewport
|
|
6
|
+
*/
|
|
7
|
+
export declare const usePartiallyVisible: (elementRef: RefObject<HTMLElement | null>) => boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Hook that detects when an element is partially visible in the viewport
|
|
4
|
+
* @param elementRef - Reference to the DOM element to observe
|
|
5
|
+
* @returns boolean indicating if the element is partially visible in the viewport
|
|
6
|
+
*/
|
|
7
|
+
export var usePartiallyVisible = function (elementRef) {
|
|
8
|
+
var _a = useState(false), isPartiallyVisible = _a[0], setIsPartiallyVisible = _a[1];
|
|
9
|
+
useEffect(function () {
|
|
10
|
+
var element = elementRef.current;
|
|
11
|
+
if (!element)
|
|
12
|
+
return;
|
|
13
|
+
var observer = new IntersectionObserver(function (_a) {
|
|
14
|
+
var entry = _a[0];
|
|
15
|
+
// Element is partially visible if it's intersecting but not completely visible
|
|
16
|
+
var isPartial = entry.isIntersecting && entry.intersectionRatio < 1.0;
|
|
17
|
+
setIsPartiallyVisible(isPartial);
|
|
18
|
+
}, {
|
|
19
|
+
root: null, // Use the viewport as the root
|
|
20
|
+
threshold: [0, 1.0], // Check at these thresholds to determine partial visibility
|
|
21
|
+
});
|
|
22
|
+
observer.observe(element);
|
|
23
|
+
return function () {
|
|
24
|
+
if (element)
|
|
25
|
+
observer.unobserve(element);
|
|
26
|
+
};
|
|
27
|
+
}, [elementRef]);
|
|
28
|
+
return isPartiallyVisible;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=useOutsideScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOutsideScreen.js","sourceRoot":"","sources":["../../../src/hooks/useOutsideScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAa,MAAM,OAAO,CAAA;AAEtD;;;;GAIG;AACH,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,UAAyC;IACnE,IAAA,KAA8C,QAAQ,CAAU,KAAK,CAAC,EAArE,kBAAkB,QAAA,EAAE,qBAAqB,QAA4B,CAAA;IAE5E,SAAS,CAAC;QACN,IAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;QAClC,IAAI,CAAC,OAAO;YAAE,OAAM;QAEpB,IAAM,QAAQ,GAAG,IAAI,oBAAoB,CACrC,UAAC,EAAO;gBAAN,KAAK,QAAA;YACH,+EAA+E;YAC/E,IAAM,SAAS,GAAG,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,iBAAiB,GAAG,GAAG,CAAA;YACvE,qBAAqB,CAAC,SAAS,CAAC,CAAA;QACpC,CAAC,EACD;YACI,IAAI,EAAE,IAAI,EAAE,+BAA+B;YAC3C,SAAS,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,4DAA4D;SACpF,CACJ,CAAA;QAED,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAEzB,OAAO;YACH,IAAI,OAAO;gBAAE,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;QAC5C,CAAC,CAAA;IACL,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;IAEhB,OAAO,kBAAkB,CAAA;AAC7B,CAAC,CAAA"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import MultiSelectInput from './components/MultiSelectInput';
|
|
|
25
25
|
import { Title, Text } from './components/Typography';
|
|
26
26
|
import TextInput from './components/TextInput';
|
|
27
27
|
import Table from './components/Table';
|
|
28
|
-
import UncontrolledTable from './components/UncontrolledTable';
|
|
28
|
+
import UncontrolledTable from './components/UncontrolledTable/UncontrolledTable';
|
|
29
29
|
import UncontrolledTabs from './components/UncontrolledTabs/UncontrolledTabs';
|
|
30
30
|
import { TimeLine, TimeLineData } from './components/TimeLine/TimeLine';
|
|
31
31
|
import { ModalStatus } from './components/StatusModal/StatusModal';
|
package/dist/esm/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import MultiSelectInput from './components/MultiSelectInput';
|
|
|
25
25
|
import { Title, Text } from './components/Typography';
|
|
26
26
|
import TextInput from './components/TextInput';
|
|
27
27
|
import Table from './components/Table';
|
|
28
|
-
import UncontrolledTable from './components/UncontrolledTable';
|
|
28
|
+
import UncontrolledTable from './components/UncontrolledTable/UncontrolledTable';
|
|
29
29
|
import UncontrolledTabs from './components/UncontrolledTabs/UncontrolledTabs';
|
|
30
30
|
import { TimeLine } from './components/TimeLine/TimeLine';
|
|
31
31
|
import { ModalStatus } from './components/StatusModal/StatusModal';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C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AM,wBAAwB,CAAC;AAC/C,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,gBAAgB,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAgB,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EACL,SAAS,EACT,MAAM,EACN,IAAI,EACJ,WAAW,EACX,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,KAAK,EACL,KAAK,EACL,KAAK,EACL,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,GAAG,EACH,SAAS,EACT,aAAa,EACb,MAAM,EACN,SAAS,EACT,GAAG,EACH,UAAU,EACV,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,IAAI,EACJ,KAAK,EACL,SAAS,EACT,KAAK,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,QAAQ,EACR,QAAQ,GAET,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "norma-library",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.981",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Olos/Norma-DS. Design System based on Material UI, developed with TypeScript and Styled Components to create reusable and consistent components in web applications.",
|
|
6
6
|
"scripts": {
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
94
94
|
"@dnd-kit/sortable": "^10.0.0",
|
|
95
95
|
"@emotion/react": "^11.14.0",
|
|
96
|
-
"@emotion/styled": "^11.
|
|
96
|
+
"@emotion/styled": "^11.14.0",
|
|
97
97
|
"@mui/icons-material": "^5.14.9",
|
|
98
98
|
"@mui/lab": "^5.0.0-alpha.152",
|
|
99
99
|
"@mui/material": "^5.16.7",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"react-datepicker": "^7.5.0",
|
|
105
105
|
"react-i18next": "^15.4.0",
|
|
106
106
|
"react-select": "^5.8.0",
|
|
107
|
-
"styled-components": "^6.1.
|
|
107
|
+
"styled-components": "^6.1.18",
|
|
108
108
|
"tslib": "^2.6.2"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import {
|
|
3
3
|
AccordionDetails,
|
|
4
4
|
AccordionSummary,
|
|
5
5
|
Accordion as MuiAccordion,
|
|
6
|
-
Typography
|
|
7
|
-
} from '@mui/material'
|
|
8
|
-
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
|
|
9
|
-
import { AccordionBaseProps } from '../interfaces'
|
|
10
|
-
import { styled } from '@mui/material/styles'
|
|
6
|
+
Typography,
|
|
7
|
+
} from '@mui/material'
|
|
8
|
+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
|
|
9
|
+
import { AccordionBaseProps } from '../interfaces'
|
|
10
|
+
import { styled } from '@mui/material/styles'
|
|
11
11
|
|
|
12
|
-
const AccordionStyled = styled(MuiAccordion)({})
|
|
12
|
+
const AccordionStyled = styled(MuiAccordion)({})
|
|
13
13
|
|
|
14
14
|
export const Accordion = ({ data = [], defaultExpanded = false, ...props }: AccordionBaseProps) => {
|
|
15
|
-
const [expanded, setExpanded] = React.useState<boolean | string>(defaultExpanded)
|
|
15
|
+
const [expanded, setExpanded] = React.useState<boolean | string>(defaultExpanded)
|
|
16
16
|
|
|
17
|
-
const handleChange = (panel: string) => (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
17
|
+
const handleChange = (panel: string) => (_: any, isExpanded: boolean) => {
|
|
18
|
+
setExpanded(isExpanded ? panel : false)
|
|
19
|
+
}
|
|
21
20
|
|
|
22
21
|
return (
|
|
23
22
|
<>
|
|
24
23
|
{data &&
|
|
25
24
|
data.map((item, key) => (
|
|
26
|
-
<AccordionStyled
|
|
25
|
+
<AccordionStyled
|
|
26
|
+
expanded={expanded === item.id}
|
|
27
|
+
onChange={handleChange(item.id)}
|
|
28
|
+
key={key}
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
27
31
|
<AccordionSummary
|
|
28
32
|
expandIcon={<ExpandMoreIcon />}
|
|
29
33
|
aria-controls={`panel-${key}-content`}
|
|
@@ -35,5 +39,5 @@ export const Accordion = ({ data = [], defaultExpanded = false, ...props }: Acco
|
|
|
35
39
|
</AccordionStyled>
|
|
36
40
|
))}
|
|
37
41
|
</>
|
|
38
|
-
)
|
|
39
|
-
}
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import styled from 'styled-components'
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import styled from 'styled-components'
|
|
3
3
|
|
|
4
|
-
import { LinearProgress as MuiProgressBar, linearProgressClasses, Typography } from '@mui/material'
|
|
5
|
-
import { ProgressBarBaseProps, CustomColor } from '../interfaces'
|
|
4
|
+
import { LinearProgress as MuiProgressBar, linearProgressClasses, Typography } from '@mui/material'
|
|
5
|
+
import { ProgressBarBaseProps, CustomColor } from '../interfaces'
|
|
6
6
|
|
|
7
|
-
const ProgressBarStyled = styled(MuiProgressBar)<{ colorCustom?: CustomColor; $h?: number }>(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
[`&.${linearProgressClasses.determinate}`]: {
|
|
7
|
+
const ProgressBarStyled = styled(MuiProgressBar)<{ colorCustom?: CustomColor; $h?: number }>(
|
|
8
|
+
({ colorCustom, $h }) => ({
|
|
9
|
+
width: '100%',
|
|
10
|
+
height: $h ? `${$h}px` : '10px',
|
|
11
|
+
borderRadius: '10px',
|
|
12
|
+
position: 'relative',
|
|
14
13
|
backgroundColor: colorCustom ? colorCustom.root : undefined,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
[`&.${linearProgressClasses.determinate}`]: {
|
|
15
|
+
backgroundColor: colorCustom ? colorCustom.root : undefined,
|
|
16
|
+
},
|
|
17
|
+
[`& .${linearProgressClasses.bar}`]: {
|
|
18
|
+
backgroundColor: colorCustom ? colorCustom.bar : undefined,
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
)
|
|
20
22
|
|
|
21
23
|
const ProgressBarLabelStyled = styled(Typography)<{ $fSize?: string }>`
|
|
22
24
|
display: flex;
|
|
@@ -26,7 +28,7 @@ const ProgressBarLabelStyled = styled(Typography)<{ $fSize?: string }>`
|
|
|
26
28
|
position: relative;
|
|
27
29
|
text-align: left;
|
|
28
30
|
font-size: ${({ $fSize }) => $fSize || '1rem'};
|
|
29
|
-
|
|
31
|
+
`
|
|
30
32
|
|
|
31
33
|
export const ProgressBar = ({
|
|
32
34
|
value = 0,
|
|
@@ -40,20 +42,18 @@ export const ProgressBar = ({
|
|
|
40
42
|
htmlLabel,
|
|
41
43
|
...props
|
|
42
44
|
}: ProgressBarBaseProps) => {
|
|
43
|
-
const percentage = value && total ? (value / total) * 100 : 0
|
|
45
|
+
const percentage = value && total ? (value / total) * 100 : 0
|
|
44
46
|
|
|
45
47
|
return (
|
|
46
48
|
<div className={className} style={{ minWidth: '100px' }}>
|
|
47
49
|
{label ? (
|
|
48
50
|
<ProgressBarLabelStyled $fSize={props.fSize} className="ProgressBarLabel">
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
)}
|
|
56
|
-
</>
|
|
51
|
+
{label}
|
|
52
|
+
{!props.hideValue && (
|
|
53
|
+
<span style={{ right: 0 }}>
|
|
54
|
+
{localeString ? value.toLocaleString() : value} ({percentage.toFixed(2)}%)
|
|
55
|
+
</span>
|
|
56
|
+
)}
|
|
57
57
|
</ProgressBarLabelStyled>
|
|
58
58
|
) : (
|
|
59
59
|
htmlLabel
|
|
@@ -68,5 +68,5 @@ export const ProgressBar = ({
|
|
|
68
68
|
{...props}
|
|
69
69
|
/>
|
|
70
70
|
</div>
|
|
71
|
-
)
|
|
72
|
-
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { breakpoints } from '../../utils/styledBreakpoints'
|
|
2
|
-
import styled from 'styled-components'
|
|
1
|
+
import { breakpoints } from '../../utils/styledBreakpoints'
|
|
2
|
+
import styled from 'styled-components'
|
|
3
3
|
|
|
4
4
|
export const Container = styled.div`
|
|
5
5
|
background-color: #fff;
|
|
6
|
-
|
|
6
|
+
padding: 15px;
|
|
7
|
+
`
|
|
7
8
|
|
|
8
9
|
export const Table = styled.table`
|
|
9
10
|
display: table;
|
|
@@ -12,26 +13,26 @@ export const Table = styled.table`
|
|
|
12
13
|
border-spacing: 0;
|
|
13
14
|
min-width: 650px;
|
|
14
15
|
border: none;
|
|
15
|
-
|
|
16
|
+
`
|
|
16
17
|
|
|
17
18
|
const StickyStyles = (top: number) => `
|
|
18
19
|
position: sticky;
|
|
19
20
|
top: ${top}px;
|
|
20
21
|
z-index: 1;
|
|
21
|
-
|
|
22
|
-
`;
|
|
22
|
+
`
|
|
23
23
|
|
|
24
|
-
export const Thead = styled.thead<{ $sticky?: boolean
|
|
24
|
+
export const Thead = styled.thead<{ $sticky?: boolean; $stickyTopP?: number }>`
|
|
25
25
|
display: table-header-group;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
background-color: #fafafa;
|
|
27
|
+
${(props) => props.$sticky && StickyStyles(props.$stickyTopP || 0)};
|
|
28
|
+
`
|
|
28
29
|
|
|
29
30
|
export const TableRow = styled.tr`
|
|
30
31
|
color: inherit;
|
|
31
32
|
display: table-row;
|
|
32
33
|
vertical-align: middle;
|
|
33
34
|
outline: 0;
|
|
34
|
-
|
|
35
|
+
`
|
|
35
36
|
|
|
36
37
|
export const Th = styled.th`
|
|
37
38
|
font-weight: 500;
|
|
@@ -42,7 +43,7 @@ export const Th = styled.th`
|
|
|
42
43
|
vertical-align: inherit;
|
|
43
44
|
border-bottom: 1px solid rgba(224, 224, 224, 1);
|
|
44
45
|
text-align: left;
|
|
45
|
-
padding: 16px;
|
|
46
|
+
padding: 16px 8px;
|
|
46
47
|
${breakpoints({
|
|
47
48
|
cssProp: 'padding',
|
|
48
49
|
cssPropUnits: 'px',
|
|
@@ -53,20 +54,29 @@ export const Th = styled.th`
|
|
|
53
54
|
color: #666666;
|
|
54
55
|
font-size: 0.875rem;
|
|
55
56
|
font-weight: 700;
|
|
56
|
-
|
|
57
|
+
`
|
|
57
58
|
|
|
58
59
|
export const ColumnContent = styled.div`
|
|
59
60
|
display: flex;
|
|
60
61
|
align-items: center;
|
|
61
62
|
gap: 5px;
|
|
62
|
-
|
|
63
|
+
`
|
|
63
64
|
|
|
64
|
-
export const TextColumn = styled.span
|
|
65
|
+
export const TextColumn = styled.span<{ $size?: string }>`
|
|
66
|
+
line-height: 1.3;
|
|
67
|
+
${(props) =>
|
|
68
|
+
props.$size &&
|
|
69
|
+
` white-space: nowrap;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
text-overflow: ellipsis;
|
|
72
|
+
width: ${props.$size};
|
|
73
|
+
`}
|
|
74
|
+
`
|
|
65
75
|
|
|
66
76
|
export const IconFilterDialog = styled.div`
|
|
67
77
|
height: 20px;
|
|
68
78
|
width: 20px;
|
|
69
|
-
|
|
79
|
+
`
|
|
70
80
|
|
|
71
81
|
export const FilterDialog = styled.div`
|
|
72
82
|
position: absolute;
|
|
@@ -77,7 +87,7 @@ export const FilterDialog = styled.div`
|
|
|
77
87
|
box-shadow: 0px 3px 6px #00000029;
|
|
78
88
|
border: 1px solid #e0e0e0;
|
|
79
89
|
z-index: 99;
|
|
80
|
-
|
|
90
|
+
`
|
|
81
91
|
|
|
82
92
|
export const ListFilterDialog = styled.div`
|
|
83
93
|
display: flex;
|
|
@@ -93,7 +103,7 @@ export const ListFilterDialog = styled.div`
|
|
|
93
103
|
border: 1px solid #e0e0e0;
|
|
94
104
|
padding: 8px 12px;
|
|
95
105
|
}
|
|
96
|
-
|
|
106
|
+
`
|
|
97
107
|
|
|
98
108
|
export const OptionFilterDialog = styled.div`
|
|
99
109
|
display: flex;
|
|
@@ -120,4 +130,4 @@ export const OptionFilterDialog = styled.div`
|
|
|
120
130
|
font-size: 16px;
|
|
121
131
|
font-weight: 400;
|
|
122
132
|
}
|
|
123
|
-
|
|
133
|
+
`
|