slick-table 1.1.31 → 1.1.33
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/index.cjs.js +89 -89
- package/dist/index.es.js +5151 -5100
- package/dist/types/shared/lib/slickgrid/ui/SlickgridTable/lib/hooks/useGrid.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/ui/SlickgridTable/model/types/Props.d.ts +1 -0
- package/dist/types/shared/lib/slickgrid/ui/SlickgridTable/model/types/Props.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.style.d.ts +4 -1
- package/dist/types/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.style.d.ts.map +1 -1
- package/dist/types/shared/lib/slickgrid/ui/SlickgridTable/ui/Table/Table.d.ts +4 -0
- package/dist/types/shared/lib/slickgrid/ui/SlickgridTable/ui/Table/Table.d.ts.map +1 -0
- package/dist/types/shared/lib/slickgrid/ui/SlickgridTable/ui/Table/Table.style.d.ts +7 -0
- package/dist/types/shared/lib/slickgrid/ui/SlickgridTable/ui/Table/Table.style.d.ts.map +1 -0
- package/dist/types/shared/lib/slickgrid/ui/SlickgridTable/ui/Table/index.d.ts +2 -0
- package/dist/types/shared/lib/slickgrid/ui/SlickgridTable/ui/Table/index.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/shared/lib/slickgrid/ui/SlickgridTable/lib/hooks/useGrid.ts +1 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/model/types/Props.ts +1 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.style.ts +9 -128
- package/src/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.tsx +29 -36
- package/src/shared/lib/slickgrid/ui/SlickgridTable/ui/Table/Table.style.ts +133 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/ui/Table/Table.tsx +66 -0
- package/src/shared/lib/slickgrid/ui/SlickgridTable/ui/Table/index.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGrid.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shared/lib/slickgrid/ui/SlickgridTable/lib/hooks/useGrid.ts"],"names":[],"mappings":"AACA,OAAO,EACN,OAAO,EACP,oBAAoB,EACpB,qBAAqB,EAOrB,MAAM,WAAW,CAAC;AAYnB,OAAO,EAAE,KAAK,EAAkB,MAAM,aAAa,CAAC;AAEpD,wBAAgB,OAAO,CAAC,EACvB,aAAiC,EACjC,kBAAkB,EAClB,SAAiB,EACjB,YAAqB,EACrB,OAAO,EACP,eAAe,EACf,MAAM,EACN,cAAqB,EACrB,KAAK,EACL,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,UAAU,EACV,mBAAmB,EACnB,iBAAkC,EAClC,qBAAqB,EACrB,OAAY,EACZ,KAAK,GACL,EAAE,KAAK,GAAG;IACV,WAAW,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC3C,YAAY,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAC7C,
|
|
1
|
+
{"version":3,"file":"useGrid.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shared/lib/slickgrid/ui/SlickgridTable/lib/hooks/useGrid.ts"],"names":[],"mappings":"AACA,OAAO,EACN,OAAO,EACP,oBAAoB,EACpB,qBAAqB,EAOrB,MAAM,WAAW,CAAC;AAYnB,OAAO,EAAE,KAAK,EAAkB,MAAM,aAAa,CAAC;AAEpD,wBAAgB,OAAO,CAAC,EACvB,aAAiC,EACjC,kBAAkB,EAClB,SAAiB,EACjB,YAAqB,EACrB,OAAO,EACP,eAAe,EACf,MAAM,EACN,cAAqB,EACrB,KAAK,EACL,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,UAAU,EACV,mBAAmB,EACnB,iBAAkC,EAClC,qBAAqB,EACrB,OAAY,EACZ,KAAK,GACL,EAAE,KAAK,GAAG;IACV,WAAW,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC3C,YAAY,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAC7C,QA0HA"}
|
|
@@ -12,6 +12,7 @@ export interface Props {
|
|
|
12
12
|
groups?: Grouping[];
|
|
13
13
|
/** DataView Id property name to use (defaults to "id") */
|
|
14
14
|
idPropertyName?: string;
|
|
15
|
+
isLoading?: boolean;
|
|
15
16
|
items: Record<string, any>[];
|
|
16
17
|
onAddNewRow?: Handler<OnAddNewRowEventArgs>;
|
|
17
18
|
onBeforeEditCell?: Handler<OnBeforeEditCellEventArgs>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Props.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shared/lib/slickgrid/ui/SlickgridTable/model/types/Props.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,2BAA2B,EAC3B,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,0BAA0B,EAC1B,8BAA8B,EAC9B,aAAa,EACb,SAAS,EACT,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,WAAW,KAAK;IACrB,aAAa,CAAC,EAAE,OAAO,aAAa,CAAC;IACrC,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAC/C,yEAAyE;IACzE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,CACjB,QAAQ,EAAE,aAAa,KACnB,CAAC,GAAG,EAAE,MAAM,KAAK,YAAY,GAAG,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACtD,YAAY,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC3D,iBAAiB,CAAC,EAAE,CACnB,KAAK,EAAE,WAAW,KACd,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACzC,qBAAqB,CAAC,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAChE,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;CACnB"}
|
|
1
|
+
{"version":3,"file":"Props.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shared/lib/slickgrid/ui/SlickgridTable/model/types/Props.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,2BAA2B,EAC3B,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,0BAA0B,EAC1B,8BAA8B,EAC9B,aAAa,EACb,SAAS,EACT,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,WAAW,KAAK;IACrB,aAAa,CAAC,EAAE,OAAO,aAAa,CAAC;IACrC,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAC/C,yEAAyE;IACzE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,CACjB,QAAQ,EAAE,aAAa,KACnB,CAAC,GAAG,EAAE,MAAM,KAAK,YAAY,GAAG,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACtD,YAAY,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC3D,iBAAiB,CAAC,EAAE,CACnB,KAAK,EAAE,WAAW,KACd,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACzC,qBAAqB,CAAC,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAChE,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlickgridTable.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SlickgridTable.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,KAAK,CAmDpC,CAAC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
|
|
2
|
+
Skeleton: import('@emotion/styled').StyledComponent<import('@mui/material').SkeletonOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLSpanElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLSpanElement> | null | undefined;
|
|
4
|
+
}, "className" | "style" | "classes" | "children" | "animation" | "height" | "sx" | "variant" | "width"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
5
|
+
Wrapper: import('@emotion/styled').StyledComponent<import('@mui/system').BoxOwnProps<import('@mui/material').Theme> & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
6
|
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
4
7
|
}, keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
5
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlickgridTable.style.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.style.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SlickgridTable.style.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shared/lib/slickgrid/ui/SlickgridTable/ui/SlickgridTable.style.ts"],"names":[],"mappings":";;;;;;;;AAaA,wBAAqD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shared/lib/slickgrid/ui/SlickgridTable/ui/Table/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAS3B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIpC,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,KAAK,CAoD3B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
Container: import('@emotion/styled').StyledComponent<import('@mui/system').BoxOwnProps<import('@mui/material').Theme> & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}, keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=Table.style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.style.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shared/lib/slickgrid/ui/SlickgridTable/ui/Table/Table.style.ts"],"names":[],"mappings":";;;;;AAoIA,wBAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shared/lib/slickgrid/ui/SlickgridTable/ui/Table/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -125,6 +125,7 @@ export function useGrid({
|
|
|
125
125
|
setTimeout(() => {
|
|
126
126
|
grid.setOptions({ ...defaultOptions, ...options });
|
|
127
127
|
grid.render();
|
|
128
|
+
headerButtons.highlightAllColumns(table.filter.args, table.id);
|
|
128
129
|
table.totalCalculator?.calculate(grid);
|
|
129
130
|
table.notifyObservers();
|
|
130
131
|
}, 0);
|
|
@@ -32,6 +32,7 @@ export interface Props {
|
|
|
32
32
|
groups?: Grouping[];
|
|
33
33
|
/** DataView Id property name to use (defaults to "id") */
|
|
34
34
|
idPropertyName?: string;
|
|
35
|
+
isLoading?: boolean;
|
|
35
36
|
items: Record<string, any>[];
|
|
36
37
|
onAddNewRow?: Handler<OnAddNewRowEventArgs>;
|
|
37
38
|
onBeforeEditCell?: Handler<OnBeforeEditCellEventArgs>;
|
|
@@ -1,133 +1,14 @@
|
|
|
1
|
-
import { Box, styled } from "@mui/material";
|
|
1
|
+
import { Box, Skeleton, styled } from "@mui/material";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const fontSize = "0.75rem";
|
|
6
|
-
const cellHeight = "24px";
|
|
7
|
-
|
|
8
|
-
const Container = styled(Box)({
|
|
9
|
-
backgroundColor: "transparent",
|
|
10
|
-
fontFamily: "inherit",
|
|
3
|
+
const Wrapper = styled(Box)({
|
|
11
4
|
height: "100%",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
userSelect: "none",
|
|
15
|
-
|
|
16
|
-
"& .slick-header-column": {
|
|
17
|
-
"&.filter-active .slick-header-button::after": {
|
|
18
|
-
width: "7px",
|
|
19
|
-
height: "7px",
|
|
20
|
-
content: "''",
|
|
21
|
-
backgroundColor: "#2196f3",
|
|
22
|
-
position: "absolute",
|
|
23
|
-
borderRadius: "50%",
|
|
24
|
-
border: "2px solid #f8f8f8",
|
|
25
|
-
top: "3px",
|
|
26
|
-
right: "3px",
|
|
27
|
-
},
|
|
28
|
-
"&:not([data-id=_checkbox_selector]):not([data-id=isEdited])": {
|
|
29
|
-
"& .slick-column-name": {
|
|
30
|
-
textOverflow: "ellipsis",
|
|
31
|
-
whiteSpace: "nowrap",
|
|
32
|
-
overflow: "hidden",
|
|
33
|
-
maxWidth: "calc(100% - 16px)",
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
"&.slick-state-hover": {
|
|
37
|
-
"&.filter-active .slick-header-button::after": {
|
|
38
|
-
border: "2px solid #e8e8e8",
|
|
39
|
-
},
|
|
40
|
-
"& .slick-header-button": {
|
|
41
|
-
"&::before": {
|
|
42
|
-
backgroundColor: "#e8e8e8",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
"& .slick-column-name": {
|
|
47
|
-
fontSize,
|
|
48
|
-
},
|
|
49
|
-
"& .slick-header-button": {
|
|
50
|
-
width: "19px",
|
|
51
|
-
height: "12px",
|
|
52
|
-
"&::before": {
|
|
53
|
-
position: "absolute",
|
|
54
|
-
content: "''",
|
|
55
|
-
width: "19px",
|
|
56
|
-
height: "12px",
|
|
57
|
-
top: "6px",
|
|
58
|
-
right: "5px",
|
|
59
|
-
backgroundImage:
|
|
60
|
-
"repeating-linear-gradient(0deg, #808080, #808080 2px, transparent 2px, transparent 4px)",
|
|
61
|
-
clipPath: "polygon(0% 0%, 100% 0%, 50% 110%)",
|
|
62
|
-
backgroundColor: "#f8f8f8",
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
"& .slick-viewport": {
|
|
68
|
-
// Prevent displaying vertical scroll bar. Override this style when table exceeds available width
|
|
69
|
-
overflowX: "hidden !important",
|
|
70
|
-
backgroundColor: "transparent",
|
|
71
|
-
"& .slick-cell": {
|
|
72
|
-
display: "flex",
|
|
73
|
-
fontSize,
|
|
74
|
-
"&.text-center": {
|
|
75
|
-
justifyContent: "center",
|
|
76
|
-
textAlign: "center",
|
|
77
|
-
},
|
|
78
|
-
"&.text-right": {
|
|
79
|
-
justifyContent: "end",
|
|
80
|
-
textAlign: "right",
|
|
81
|
-
},
|
|
82
|
-
"&.bold": {
|
|
83
|
-
fontWeight: "bold",
|
|
84
|
-
},
|
|
85
|
-
"&.wink": {
|
|
86
|
-
animation: `${wink} infinite 0.5s linear`,
|
|
87
|
-
"& input": {
|
|
88
|
-
animation: `${wink} infinite 0.5s linear`,
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
"& input.editor-text": {
|
|
92
|
-
textAlign: "inherit",
|
|
93
|
-
},
|
|
94
|
-
"& #autocomplete": {
|
|
95
|
-
boxShadow: "0 0 5px 1px gray",
|
|
96
|
-
fontSize,
|
|
97
|
-
margin: 0,
|
|
98
|
-
maxHeight: "300px",
|
|
99
|
-
minWidth: "100%",
|
|
100
|
-
overflow: "auto",
|
|
101
|
-
padding: 0,
|
|
102
|
-
position: "absolute",
|
|
103
|
-
top: cellHeight,
|
|
104
|
-
"& div": {
|
|
105
|
-
"&:hover": {
|
|
106
|
-
cursor: "pointer",
|
|
107
|
-
},
|
|
108
|
-
"& strong": {
|
|
109
|
-
color: "#007bff",
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
},
|
|
5
|
+
width: "100%",
|
|
6
|
+
});
|
|
115
7
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
display: "flex",
|
|
121
|
-
justifyContent: "flex-end",
|
|
122
|
-
alignItems: "center",
|
|
123
|
-
paddingRight: "5px",
|
|
124
|
-
borderBottom: "none",
|
|
125
|
-
fontWeight: "bold",
|
|
126
|
-
"&:last-child": {
|
|
127
|
-
borderRight: "none",
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
8
|
+
const StyledSkeleton = styled(Skeleton)({
|
|
9
|
+
borderRadius: "10px",
|
|
10
|
+
height: "100%",
|
|
11
|
+
width: "100%",
|
|
131
12
|
});
|
|
132
13
|
|
|
133
|
-
export default {
|
|
14
|
+
export default { Skeleton: StyledSkeleton, Wrapper };
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
onCellChange as cellChange,
|
|
5
|
-
useHotKeys,
|
|
6
|
-
useResizeCanvas,
|
|
7
|
-
useUpdateTotal,
|
|
8
|
-
} from "../../../lib";
|
|
9
|
-
import { onAddNewRow as addNewRow, useGrid } from "../lib";
|
|
10
3
|
import { Props } from "../model";
|
|
4
|
+
import { Table } from "./Table";
|
|
11
5
|
|
|
12
6
|
import Styled from "./SlickgridTable.style";
|
|
13
7
|
|
|
@@ -20,6 +14,7 @@ export const SlickgridTable: FC<Props> = ({
|
|
|
20
14
|
getItemMetadata,
|
|
21
15
|
groups,
|
|
22
16
|
idPropertyName,
|
|
17
|
+
isLoading,
|
|
23
18
|
items,
|
|
24
19
|
onAddNewRow,
|
|
25
20
|
onBeforeEditCell,
|
|
@@ -32,35 +27,33 @@ export const SlickgridTable: FC<Props> = ({
|
|
|
32
27
|
options,
|
|
33
28
|
table,
|
|
34
29
|
}) => {
|
|
35
|
-
useGrid({
|
|
36
|
-
SlickDataView,
|
|
37
|
-
applyCellCssStyles,
|
|
38
|
-
assignIds,
|
|
39
|
-
columnSorter,
|
|
40
|
-
columns,
|
|
41
|
-
getItemMetadata,
|
|
42
|
-
groups,
|
|
43
|
-
idPropertyName,
|
|
44
|
-
items,
|
|
45
|
-
onAddNewRow: onAddNewRow || addNewRow(table),
|
|
46
|
-
onBeforeEditCell,
|
|
47
|
-
onCellChange: onCellChange || cellChange(table),
|
|
48
|
-
onClick,
|
|
49
|
-
onDblClick,
|
|
50
|
-
onHeaderMenuCommand,
|
|
51
|
-
onRowCountChanged,
|
|
52
|
-
onSelectedRowsChanged,
|
|
53
|
-
options,
|
|
54
|
-
table,
|
|
55
|
-
});
|
|
56
|
-
useHotKeys(table);
|
|
57
|
-
useUpdateTotal(table);
|
|
58
|
-
useResizeCanvas(table);
|
|
59
|
-
|
|
60
30
|
return (
|
|
61
|
-
<Styled.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
31
|
+
<Styled.Wrapper>
|
|
32
|
+
{isLoading ? (
|
|
33
|
+
<Styled.Skeleton animation="wave" variant={"rectangular"} />
|
|
34
|
+
) : (
|
|
35
|
+
<Table
|
|
36
|
+
SlickDataView={SlickDataView}
|
|
37
|
+
applyCellCssStyles={applyCellCssStyles}
|
|
38
|
+
assignIds={assignIds}
|
|
39
|
+
columnSorter={columnSorter}
|
|
40
|
+
columns={columns}
|
|
41
|
+
getItemMetadata={getItemMetadata}
|
|
42
|
+
groups={groups}
|
|
43
|
+
idPropertyName={idPropertyName}
|
|
44
|
+
items={items}
|
|
45
|
+
onAddNewRow={onAddNewRow}
|
|
46
|
+
onBeforeEditCell={onBeforeEditCell}
|
|
47
|
+
onCellChange={onCellChange}
|
|
48
|
+
onClick={onClick}
|
|
49
|
+
onDblClick={onDblClick}
|
|
50
|
+
onHeaderMenuCommand={onHeaderMenuCommand}
|
|
51
|
+
onRowCountChanged={onRowCountChanged}
|
|
52
|
+
onSelectedRowsChanged={onSelectedRowsChanged}
|
|
53
|
+
options={options}
|
|
54
|
+
table={table}
|
|
55
|
+
/>
|
|
56
|
+
)}
|
|
57
|
+
</Styled.Wrapper>
|
|
65
58
|
);
|
|
66
59
|
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Box, styled } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
import { wink } from "../../../styles";
|
|
4
|
+
|
|
5
|
+
const fontSize = "0.75rem";
|
|
6
|
+
const cellHeight = "24px";
|
|
7
|
+
|
|
8
|
+
const Container = styled(Box)({
|
|
9
|
+
backgroundColor: "transparent",
|
|
10
|
+
fontFamily: "inherit",
|
|
11
|
+
height: "100%",
|
|
12
|
+
maxHeight: "100%",
|
|
13
|
+
maxWidth: "100%",
|
|
14
|
+
userSelect: "none",
|
|
15
|
+
|
|
16
|
+
"& .slick-header-column": {
|
|
17
|
+
"&.filter-active .slick-header-button::after": {
|
|
18
|
+
width: "7px",
|
|
19
|
+
height: "7px",
|
|
20
|
+
content: "''",
|
|
21
|
+
backgroundColor: "#2196f3",
|
|
22
|
+
position: "absolute",
|
|
23
|
+
borderRadius: "50%",
|
|
24
|
+
border: "2px solid #f8f8f8",
|
|
25
|
+
top: "3px",
|
|
26
|
+
right: "3px",
|
|
27
|
+
},
|
|
28
|
+
"&:not([data-id=_checkbox_selector]):not([data-id=isEdited])": {
|
|
29
|
+
"& .slick-column-name": {
|
|
30
|
+
textOverflow: "ellipsis",
|
|
31
|
+
whiteSpace: "nowrap",
|
|
32
|
+
overflow: "hidden",
|
|
33
|
+
maxWidth: "calc(100% - 16px)",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
"&.slick-state-hover": {
|
|
37
|
+
"&.filter-active .slick-header-button::after": {
|
|
38
|
+
border: "2px solid #e8e8e8",
|
|
39
|
+
},
|
|
40
|
+
"& .slick-header-button": {
|
|
41
|
+
"&::before": {
|
|
42
|
+
backgroundColor: "#e8e8e8",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
"& .slick-column-name": {
|
|
47
|
+
fontSize,
|
|
48
|
+
},
|
|
49
|
+
"& .slick-header-button": {
|
|
50
|
+
width: "19px",
|
|
51
|
+
height: "12px",
|
|
52
|
+
"&::before": {
|
|
53
|
+
position: "absolute",
|
|
54
|
+
content: "''",
|
|
55
|
+
width: "19px",
|
|
56
|
+
height: "12px",
|
|
57
|
+
top: "6px",
|
|
58
|
+
right: "5px",
|
|
59
|
+
backgroundImage:
|
|
60
|
+
"repeating-linear-gradient(0deg, #808080, #808080 2px, transparent 2px, transparent 4px)",
|
|
61
|
+
clipPath: "polygon(0% 0%, 100% 0%, 50% 110%)",
|
|
62
|
+
backgroundColor: "#f8f8f8",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
"& .slick-viewport": {
|
|
68
|
+
// Prevent displaying vertical scroll bar. Override this style when table exceeds available width
|
|
69
|
+
overflowX: "hidden !important",
|
|
70
|
+
backgroundColor: "transparent",
|
|
71
|
+
"& .slick-cell": {
|
|
72
|
+
display: "flex",
|
|
73
|
+
fontSize,
|
|
74
|
+
"&.text-center": {
|
|
75
|
+
justifyContent: "center",
|
|
76
|
+
textAlign: "center",
|
|
77
|
+
},
|
|
78
|
+
"&.text-right": {
|
|
79
|
+
justifyContent: "end",
|
|
80
|
+
textAlign: "right",
|
|
81
|
+
},
|
|
82
|
+
"&.bold": {
|
|
83
|
+
fontWeight: "bold",
|
|
84
|
+
},
|
|
85
|
+
"&.wink": {
|
|
86
|
+
animation: `${wink} infinite 0.5s linear`,
|
|
87
|
+
"& input": {
|
|
88
|
+
animation: `${wink} infinite 0.5s linear`,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
"& input.editor-text": {
|
|
92
|
+
textAlign: "inherit",
|
|
93
|
+
},
|
|
94
|
+
"& #autocomplete": {
|
|
95
|
+
boxShadow: "0 0 5px 1px gray",
|
|
96
|
+
fontSize,
|
|
97
|
+
margin: 0,
|
|
98
|
+
maxHeight: "300px",
|
|
99
|
+
minWidth: "100%",
|
|
100
|
+
overflow: "auto",
|
|
101
|
+
padding: 0,
|
|
102
|
+
position: "absolute",
|
|
103
|
+
top: cellHeight,
|
|
104
|
+
"& div": {
|
|
105
|
+
"&:hover": {
|
|
106
|
+
cursor: "pointer",
|
|
107
|
+
},
|
|
108
|
+
"& strong": {
|
|
109
|
+
color: "#007bff",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
"& .slick-footerrow": {
|
|
117
|
+
borderTop: "1px solid silver",
|
|
118
|
+
"& .slick-footerrow-column": {
|
|
119
|
+
height: "100%",
|
|
120
|
+
display: "flex",
|
|
121
|
+
justifyContent: "flex-end",
|
|
122
|
+
alignItems: "center",
|
|
123
|
+
paddingRight: "5px",
|
|
124
|
+
borderBottom: "none",
|
|
125
|
+
fontWeight: "bold",
|
|
126
|
+
"&:last-child": {
|
|
127
|
+
borderRight: "none",
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
export default { Container };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
onCellChange as cellChange,
|
|
5
|
+
useHotKeys,
|
|
6
|
+
useResizeCanvas,
|
|
7
|
+
useUpdateTotal,
|
|
8
|
+
} from "../../../../lib";
|
|
9
|
+
import { onAddNewRow as addNewRow, useGrid } from "../../lib";
|
|
10
|
+
import { Props } from "../../model";
|
|
11
|
+
|
|
12
|
+
import Styled from "./Table.style";
|
|
13
|
+
|
|
14
|
+
export const Table: FC<Props> = ({
|
|
15
|
+
SlickDataView,
|
|
16
|
+
applyCellCssStyles,
|
|
17
|
+
assignIds,
|
|
18
|
+
columnSorter,
|
|
19
|
+
columns,
|
|
20
|
+
getItemMetadata,
|
|
21
|
+
groups,
|
|
22
|
+
idPropertyName,
|
|
23
|
+
items,
|
|
24
|
+
onAddNewRow,
|
|
25
|
+
onBeforeEditCell,
|
|
26
|
+
onCellChange,
|
|
27
|
+
onClick,
|
|
28
|
+
onDblClick,
|
|
29
|
+
onHeaderMenuCommand,
|
|
30
|
+
onRowCountChanged,
|
|
31
|
+
onSelectedRowsChanged,
|
|
32
|
+
options,
|
|
33
|
+
table,
|
|
34
|
+
}) => {
|
|
35
|
+
useGrid({
|
|
36
|
+
SlickDataView,
|
|
37
|
+
applyCellCssStyles,
|
|
38
|
+
assignIds,
|
|
39
|
+
columnSorter,
|
|
40
|
+
columns,
|
|
41
|
+
getItemMetadata,
|
|
42
|
+
groups,
|
|
43
|
+
idPropertyName,
|
|
44
|
+
items,
|
|
45
|
+
onAddNewRow: onAddNewRow || addNewRow(table),
|
|
46
|
+
onBeforeEditCell,
|
|
47
|
+
onCellChange: onCellChange || cellChange(table),
|
|
48
|
+
onClick,
|
|
49
|
+
onDblClick,
|
|
50
|
+
onHeaderMenuCommand,
|
|
51
|
+
onRowCountChanged,
|
|
52
|
+
onSelectedRowsChanged,
|
|
53
|
+
options,
|
|
54
|
+
table,
|
|
55
|
+
});
|
|
56
|
+
useHotKeys(table);
|
|
57
|
+
useUpdateTotal(table);
|
|
58
|
+
useResizeCanvas(table);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Styled.Container
|
|
62
|
+
id={table.id}
|
|
63
|
+
className={"slick-container"}
|
|
64
|
+
></Styled.Container>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table } from "./Table";
|