@danikokonn/yarik-frontend-lib 2.0.58-test32 → 2.0.58-test33

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.
@@ -1 +1 @@
1
- {"version":3,"file":"RowContent.d.ts","sourceRoot":"","sources":["../../../src/components/SmartTable/RowContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,UAAU,eAAe,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;CAAE;IACjD,GAAG,EAAE,CAAC,CAAC;IACP,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC3C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,gBAAgB,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC;IACrC,qBAAqB,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACxC;AAUD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,EAAE,EACpC,GAAG,EACH,OAAO,EACP,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,qBAAqB,GACtB,EAAE,eAAe,CAAC,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;CAAE,CAAC,qBAoCtC"}
1
+ {"version":3,"file":"RowContent.d.ts","sourceRoot":"","sources":["../../../src/components/SmartTable/RowContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAiC,MAAM,eAAe,CAAC;AAG9E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,UAAU,eAAe,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;CAAE;IACjD,GAAG,EAAE,CAAC,CAAC;IACP,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC3C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,gBAAgB,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC;IACrC,qBAAqB,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACxC;AAUD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,EAAE,EACpC,GAAG,EACH,OAAO,EACP,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,qBAAqB,GACtB,EAAE,eAAe,CAAC,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;CAAE,CAAC,qBAwEtC"}
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { useColorScheme, useMediaQuery } from "@mui/material";
2
3
  import TableCell from "@mui/material/TableCell";
3
4
  import { JSONTree } from 'react-json-tree';
4
5
  const hiddenTextStyle = {
@@ -9,6 +10,41 @@ const hiddenTextStyle = {
9
10
  paddingBottom: "0.25rem",
10
11
  };
11
12
  export default function RowContent({ row, columns, onSelectRow, onDoubleClick, controlComponent, controlComponentColSx, }) {
13
+ const theme = {
14
+ scheme: 'google',
15
+ author: 'seth wright (http://sethawright.com)',
16
+ base00: '#1d1f21',
17
+ base01: '#282a2e',
18
+ base02: '#373b41',
19
+ base03: '#969896',
20
+ base04: '#b4b7b4',
21
+ base05: '#c5c8c6',
22
+ base06: '#e0e0e0',
23
+ base07: '#ffffff',
24
+ base08: '#CC342B',
25
+ base09: '#F96A38',
26
+ base0A: '#FBA922',
27
+ base0B: '#198844',
28
+ base0C: '#3971ED',
29
+ base0D: '#3971ED',
30
+ base0E: '#A36AC7',
31
+ base0F: '#3971ED'
32
+ };
33
+ const { mode } = useColorScheme();
34
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
35
+ let invertTheme = false;
36
+ if (mode === "light")
37
+ invertTheme = true;
38
+ else if (mode === "dark")
39
+ invertTheme = false;
40
+ else {
41
+ if (prefersDarkMode) {
42
+ invertTheme = false;
43
+ }
44
+ else {
45
+ invertTheme = true;
46
+ }
47
+ }
12
48
  return (React.createElement(React.Fragment, null,
13
49
  columns.map((col, idx) => (React.createElement(TableCell, { sx: {
14
50
  ...hiddenTextStyle,
@@ -20,7 +56,7 @@ export default function RowContent({ row, columns, onSelectRow, onDoubleClick, c
20
56
  onSelectRow(row.id);
21
57
  }, onDoubleClick: (_) => (onDoubleClick || (() => { }))(row.id) }, col.cellContentComponent
22
58
  ? col.cellContentComponent(row)
23
- : typeof Object(row)[col.name] === "object" && Object(row)[col.name] != null ? (React.createElement(JSONTree, { shouldExpandNodeInitially: () => false, data: Object(row)[col.name] })) : Object(row)[col.name] || "N/A"))),
59
+ : typeof Object(row)[col.name] === "object" && Object(row)[col.name] != null ? (React.createElement(JSONTree, { invertTheme: invertTheme, theme: theme, shouldExpandNodeInitially: () => false, data: Object(row)[col.name] })) : Object(row)[col.name] || "N/A"))),
24
60
  controlComponent && (React.createElement(TableCell, { sx: {
25
61
  textAlign: "center",
26
62
  cursor: "default",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danikokonn/yarik-frontend-lib",
3
- "version": "2.0.58-test32",
3
+ "version": "2.0.58-test33",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "author": "",