@webiny/app-audit-logs 0.0.0-unstable.06b2ede40f
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/LICENSE +21 -0
- package/README.md +1 -0
- package/components/Text.d.ts +4 -0
- package/components/Text.js +25 -0
- package/components/Text.js.map +1 -0
- package/config/list/AuditLogsListConfig.d.ts +42 -0
- package/config/list/AuditLogsListConfig.js +21 -0
- package/config/list/AuditLogsListConfig.js.map +1 -0
- package/config/list/Browser/Filter.d.ts +39 -0
- package/config/list/Browser/Filter.js +44 -0
- package/config/list/Browser/Filter.js.map +1 -0
- package/config/list/Browser/FiltersToWhere.d.ts +7 -0
- package/config/list/Browser/FiltersToWhere.js +16 -0
- package/config/list/Browser/FiltersToWhere.js.map +1 -0
- package/config/list/Browser/index.d.ts +39 -0
- package/config/list/Browser/index.js +8 -0
- package/config/list/Browser/index.js.map +1 -0
- package/config/list/index.d.ts +1 -0
- package/config/list/index.js +3 -0
- package/config/list/index.js.map +1 -0
- package/constants/index.d.ts +1 -0
- package/constants/index.js +3 -0
- package/constants/index.js.map +1 -0
- package/graphql.d.ts +1 -0
- package/graphql.js +27 -0
- package/graphql.js.map +1 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +3 -0
- package/hooks/index.js.map +1 -0
- package/hooks/useAuditLogsList.d.ts +21 -0
- package/hooks/useAuditLogsList.js +105 -0
- package/hooks/useAuditLogsList.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.js +52 -0
- package/index.js.map +1 -0
- package/package.json +51 -0
- package/plugins/permissionRenderer/AuditLogsPermissions.d.ts +8 -0
- package/plugins/permissionRenderer/AuditLogsPermissions.js +100 -0
- package/plugins/permissionRenderer/AuditLogsPermissions.js.map +1 -0
- package/plugins/permissionRenderer/index.d.ts +1 -0
- package/plugins/permissionRenderer/index.js +32 -0
- package/plugins/permissionRenderer/index.js.map +1 -0
- package/types.d.ts +30 -0
- package/types.js +14 -0
- package/types.js.map +1 -0
- package/utils/transformCmsContentEntriesToRecordEntries.d.ts +25 -0
- package/utils/transformCmsContentEntriesToRecordEntries.js +36 -0
- package/utils/transformCmsContentEntriesToRecordEntries.js.map +1 -0
- package/views/Logs/Filters/FilterByAction.d.ts +2 -0
- package/views/Logs/Filters/FilterByAction.js +47 -0
- package/views/Logs/Filters/FilterByAction.js.map +1 -0
- package/views/Logs/Filters/FilterByApp.d.ts +2 -0
- package/views/Logs/Filters/FilterByApp.js +36 -0
- package/views/Logs/Filters/FilterByApp.js.map +1 -0
- package/views/Logs/Filters/FilterByEntity.d.ts +2 -0
- package/views/Logs/Filters/FilterByEntity.js +47 -0
- package/views/Logs/Filters/FilterByEntity.js.map +1 -0
- package/views/Logs/Filters/FilterByInitiator.d.ts +2 -0
- package/views/Logs/Filters/FilterByInitiator.js +39 -0
- package/views/Logs/Filters/FilterByInitiator.js.map +1 -0
- package/views/Logs/Filters/FilterByTimestamp.d.ts +2 -0
- package/views/Logs/Filters/FilterByTimestamp.js +40 -0
- package/views/Logs/Filters/FilterByTimestamp.js.map +1 -0
- package/views/Logs/Filters/Filters.d.ts +8 -0
- package/views/Logs/Filters/Filters.js +32 -0
- package/views/Logs/Filters/Filters.js.map +1 -0
- package/views/Logs/Filters/index.d.ts +6 -0
- package/views/Logs/Filters/index.js +8 -0
- package/views/Logs/Filters/index.js.map +1 -0
- package/views/Logs/Filters/styled.d.ts +5 -0
- package/views/Logs/Filters/styled.js +18 -0
- package/views/Logs/Filters/styled.js.map +1 -0
- package/views/Logs/Header/ButtonFilters/ButtonFilters.d.ts +8 -0
- package/views/Logs/Header/ButtonFilters/ButtonFilters.js +48 -0
- package/views/Logs/Header/ButtonFilters/ButtonFilters.js.map +1 -0
- package/views/Logs/Header/ButtonFilters/index.d.ts +1 -0
- package/views/Logs/Header/ButtonFilters/index.js +3 -0
- package/views/Logs/Header/ButtonFilters/index.js.map +1 -0
- package/views/Logs/Header/Header.d.ts +11 -0
- package/views/Logs/Header/Header.js +79 -0
- package/views/Logs/Header/Header.js.map +1 -0
- package/views/Logs/Header/index.d.ts +1 -0
- package/views/Logs/Header/index.js +3 -0
- package/views/Logs/Header/index.js.map +1 -0
- package/views/Logs/LoadMoreButton/LoadMoreButton.d.ts +9 -0
- package/views/Logs/LoadMoreButton/LoadMoreButton.js +23 -0
- package/views/Logs/LoadMoreButton/LoadMoreButton.js.map +1 -0
- package/views/Logs/LoadMoreButton/index.d.ts +1 -0
- package/views/Logs/LoadMoreButton/index.js +3 -0
- package/views/Logs/LoadMoreButton/index.js.map +1 -0
- package/views/Logs/LoadMoreButton/styled.d.ts +5 -0
- package/views/Logs/LoadMoreButton/styled.js +18 -0
- package/views/Logs/LoadMoreButton/styled.js.map +1 -0
- package/views/Logs/LoadingMore/index.d.ts +2 -0
- package/views/Logs/LoadingMore/index.js +16 -0
- package/views/Logs/LoadingMore/index.js.map +1 -0
- package/views/Logs/LoadingMore/styled.d.ts +9 -0
- package/views/Logs/LoadingMore/styled.js +32 -0
- package/views/Logs/LoadingMore/styled.js.map +1 -0
- package/views/Logs/Logs.d.ts +3 -0
- package/views/Logs/Logs.js +84 -0
- package/views/Logs/Logs.js.map +1 -0
- package/views/Logs/LogsModule.d.ts +2 -0
- package/views/Logs/LogsModule.js +26 -0
- package/views/Logs/LogsModule.js.map +1 -0
- package/views/Logs/Preview/Preview.d.ts +9 -0
- package/views/Logs/Preview/Preview.js +90 -0
- package/views/Logs/Preview/Preview.js.map +1 -0
- package/views/Logs/Preview/index.d.ts +1 -0
- package/views/Logs/Preview/index.js +3 -0
- package/views/Logs/Preview/index.js.map +1 -0
- package/views/Logs/Preview/styled.d.ts +6 -0
- package/views/Logs/Preview/styled.js +25 -0
- package/views/Logs/Preview/styled.js.map +1 -0
- package/views/Logs/Table/Table.d.ts +25 -0
- package/views/Logs/Table/Table.js +130 -0
- package/views/Logs/Table/Table.js.map +1 -0
- package/views/Logs/Table/index.d.ts +1 -0
- package/views/Logs/Table/index.js +3 -0
- package/views/Logs/Table/index.js.map +1 -0
- package/views/Logs/Table/styled.d.ts +17 -0
- package/views/Logs/Table/styled.js +81 -0
- package/views/Logs/Table/styled.js.map +1 -0
- package/views/Logs/styled.d.ts +9 -0
- package/views/Logs/styled.js +32 -0
- package/views/Logs/styled.js.map +1 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AuditLogsListConfig } from "../../config/list";
|
|
3
|
+
import { FilterByTimestamp, FilterByInitiator, FilterByApp, FilterByEntity, FilterByAction } from "./Filters";
|
|
4
|
+
const {
|
|
5
|
+
Browser
|
|
6
|
+
} = AuditLogsListConfig;
|
|
7
|
+
export const LogsModule = () => {
|
|
8
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AuditLogsListConfig, null, /*#__PURE__*/React.createElement(Browser.Filter, {
|
|
9
|
+
name: "timestamp",
|
|
10
|
+
element: /*#__PURE__*/React.createElement(FilterByTimestamp, null)
|
|
11
|
+
}), /*#__PURE__*/React.createElement(Browser.Filter, {
|
|
12
|
+
name: "initiator",
|
|
13
|
+
element: /*#__PURE__*/React.createElement(FilterByInitiator, null)
|
|
14
|
+
}), /*#__PURE__*/React.createElement(Browser.Filter, {
|
|
15
|
+
name: "app",
|
|
16
|
+
element: /*#__PURE__*/React.createElement(FilterByApp, null)
|
|
17
|
+
}), /*#__PURE__*/React.createElement(Browser.Filter, {
|
|
18
|
+
name: "entity",
|
|
19
|
+
element: /*#__PURE__*/React.createElement(FilterByEntity, null)
|
|
20
|
+
}), /*#__PURE__*/React.createElement(Browser.Filter, {
|
|
21
|
+
name: "action",
|
|
22
|
+
element: /*#__PURE__*/React.createElement(FilterByAction, null)
|
|
23
|
+
})));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=LogsModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","AuditLogsListConfig","FilterByTimestamp","FilterByInitiator","FilterByApp","FilterByEntity","FilterByAction","Browser","LogsModule","createElement","Fragment","Filter","name","element"],"sources":["LogsModule.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { AuditLogsListConfig } from \"~/config/list\";\nimport {\n FilterByTimestamp,\n FilterByInitiator,\n FilterByApp,\n FilterByEntity,\n FilterByAction\n} from \"~/views/Logs/Filters\";\n\nconst { Browser } = AuditLogsListConfig;\n\nexport const LogsModule = () => {\n return (\n <>\n <AuditLogsListConfig>\n <Browser.Filter name={\"timestamp\"} element={<FilterByTimestamp />} />\n <Browser.Filter name={\"initiator\"} element={<FilterByInitiator />} />\n <Browser.Filter name={\"app\"} element={<FilterByApp />} />\n <Browser.Filter name={\"entity\"} element={<FilterByEntity />} />\n <Browser.Filter name={\"action\"} element={<FilterByAction />} />\n </AuditLogsListConfig>\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,mBAAmB;AAC5B,SACIC,iBAAiB,EACjBC,iBAAiB,EACjBC,WAAW,EACXC,cAAc,EACdC,cAAc;AAGlB,MAAM;EAAEC;AAAQ,CAAC,GAAGN,mBAAmB;AAEvC,OAAO,MAAMO,UAAU,GAAGA,CAAA,KAAM;EAC5B,oBACIR,KAAA,CAAAS,aAAA,CAAAT,KAAA,CAAAU,QAAA,qBACIV,KAAA,CAAAS,aAAA,CAACR,mBAAmB,qBAChBD,KAAA,CAAAS,aAAA,CAACF,OAAO,CAACI,MAAM;IAACC,IAAI,EAAE,WAAY;IAACC,OAAO,eAAEb,KAAA,CAAAS,aAAA,CAACP,iBAAiB,MAAE;EAAE,CAAE,CAAC,eACrEF,KAAA,CAAAS,aAAA,CAACF,OAAO,CAACI,MAAM;IAACC,IAAI,EAAE,WAAY;IAACC,OAAO,eAAEb,KAAA,CAAAS,aAAA,CAACN,iBAAiB,MAAE;EAAE,CAAE,CAAC,eACrEH,KAAA,CAAAS,aAAA,CAACF,OAAO,CAACI,MAAM;IAACC,IAAI,EAAE,KAAM;IAACC,OAAO,eAAEb,KAAA,CAAAS,aAAA,CAACL,WAAW,MAAE;EAAE,CAAE,CAAC,eACzDJ,KAAA,CAAAS,aAAA,CAACF,OAAO,CAACI,MAAM;IAACC,IAAI,EAAE,QAAS;IAACC,OAAO,eAAEb,KAAA,CAAAS,aAAA,CAACJ,cAAc,MAAE;EAAE,CAAE,CAAC,eAC/DL,KAAA,CAAAS,aAAA,CAACF,OAAO,CAACI,MAAM;IAACC,IAAI,EAAE,QAAS;IAACC,OAAO,eAAEb,KAAA,CAAAS,aAAA,CAACH,cAAc,MAAE;EAAE,CAAE,CAC7C,CACvB,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Entry } from "../../../utils/transformCmsContentEntriesToRecordEntries";
|
|
3
|
+
type HeaderProps = {
|
|
4
|
+
auditLog: Entry | null;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
hasAccessToUsers: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const Preview: ({ auditLog, onClose, hasAccessToUsers }: HeaderProps) => React.JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { format, addMinutes } from "date-fns";
|
|
3
|
+
import { Grid, Cell } from "@webiny/ui/Grid";
|
|
4
|
+
import { Dialog, DialogContent, DialogTitle, DialogCancel, DialogActions } from "@webiny/ui/Dialog";
|
|
5
|
+
import { CodeEditor } from "@webiny/ui/CodeEditor";
|
|
6
|
+
import { Tooltip } from "@webiny/ui/Tooltip";
|
|
7
|
+
import { Action } from "../Table";
|
|
8
|
+
import { Text } from "../../../components/Text";
|
|
9
|
+
import { PayloadWrapper, previewDialog } from "./styled";
|
|
10
|
+
export const Preview = ({
|
|
11
|
+
auditLog,
|
|
12
|
+
onClose,
|
|
13
|
+
hasAccessToUsers
|
|
14
|
+
}) => {
|
|
15
|
+
if (!auditLog) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const date = new Date(auditLog.savedOn);
|
|
19
|
+
return /*#__PURE__*/React.createElement(Dialog, {
|
|
20
|
+
open: !!auditLog,
|
|
21
|
+
onClose: onClose,
|
|
22
|
+
className: previewDialog
|
|
23
|
+
}, /*#__PURE__*/React.createElement(DialogTitle, null, auditLog.message, /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: "title-actions",
|
|
25
|
+
tabIndex: 0
|
|
26
|
+
})), /*#__PURE__*/React.createElement(DialogContent, null, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
27
|
+
span: 6
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
29
|
+
use: "overline"
|
|
30
|
+
}, "Application"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Text, {
|
|
31
|
+
use: "subtitle2"
|
|
32
|
+
}, auditLog.app)), /*#__PURE__*/React.createElement(Cell, {
|
|
33
|
+
span: 6
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
35
|
+
use: "overline"
|
|
36
|
+
}, "Date"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Tooltip, {
|
|
37
|
+
placement: "right",
|
|
38
|
+
content: `UTC: ${format(addMinutes(date, date.getTimezoneOffset()), "yyyy-MM-dd HH:mm:ss")}`
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
40
|
+
use: "subtitle2"
|
|
41
|
+
}, format(date, "yyyy-MM-dd HH:mm:ss (O)")))), /*#__PURE__*/React.createElement(Cell, {
|
|
42
|
+
span: 6
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
44
|
+
use: "overline"
|
|
45
|
+
}, "Entity"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Text, {
|
|
46
|
+
use: "subtitle2"
|
|
47
|
+
}, auditLog.entity.label)), /*#__PURE__*/React.createElement(Cell, {
|
|
48
|
+
span: 6
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
50
|
+
use: "overline"
|
|
51
|
+
}, "Entity Id"), /*#__PURE__*/React.createElement("br", null), auditLog.entity.link ? /*#__PURE__*/React.createElement("a", {
|
|
52
|
+
href: auditLog.entity.link,
|
|
53
|
+
target: "blank"
|
|
54
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
55
|
+
use: "subtitle2"
|
|
56
|
+
}, auditLog.entityId)) : /*#__PURE__*/React.createElement(Text, {
|
|
57
|
+
use: "subtitle2"
|
|
58
|
+
}, auditLog.entityId)), /*#__PURE__*/React.createElement(Cell, {
|
|
59
|
+
span: 6
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
61
|
+
use: "overline"
|
|
62
|
+
}, "Action"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Action, {
|
|
63
|
+
label: auditLog.action.label,
|
|
64
|
+
value: auditLog.action.value
|
|
65
|
+
})), hasAccessToUsers && /*#__PURE__*/React.createElement(Cell, {
|
|
66
|
+
span: 6
|
|
67
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
68
|
+
use: "overline"
|
|
69
|
+
}, "Initiator"), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("a", {
|
|
70
|
+
href: `/admin-users?id=${auditLog.initiator.id}`,
|
|
71
|
+
target: "blank"
|
|
72
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
73
|
+
use: "subtitle2"
|
|
74
|
+
}, auditLog.initiator.name)), /*#__PURE__*/React.createElement(Text, {
|
|
75
|
+
use: "body2"
|
|
76
|
+
}, ` (${auditLog.initiator.role})`)), /*#__PURE__*/React.createElement(Cell, {
|
|
77
|
+
span: 12
|
|
78
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
79
|
+
use: "overline"
|
|
80
|
+
}, "Payload"), /*#__PURE__*/React.createElement(PayloadWrapper, null, /*#__PURE__*/React.createElement(CodeEditor, {
|
|
81
|
+
mode: "json",
|
|
82
|
+
theme: "chrome",
|
|
83
|
+
value: JSON.stringify(JSON.parse(auditLog.data), null, 2),
|
|
84
|
+
readOnly: true
|
|
85
|
+
}))))), /*#__PURE__*/React.createElement(DialogActions, null, /*#__PURE__*/React.createElement(DialogCancel, {
|
|
86
|
+
onClick: onClose
|
|
87
|
+
}, "Close")));
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=Preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","format","addMinutes","Grid","Cell","Dialog","DialogContent","DialogTitle","DialogCancel","DialogActions","CodeEditor","Tooltip","Action","Text","PayloadWrapper","previewDialog","Preview","auditLog","onClose","hasAccessToUsers","date","Date","savedOn","createElement","open","className","message","tabIndex","span","use","app","placement","content","getTimezoneOffset","entity","label","link","href","target","entityId","action","value","initiator","id","name","role","mode","theme","JSON","stringify","parse","data","readOnly","onClick"],"sources":["Preview.tsx"],"sourcesContent":["import React from \"react\";\nimport { format, addMinutes } from \"date-fns\";\n\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { Dialog, DialogContent, DialogTitle, DialogCancel, DialogActions } from \"@webiny/ui/Dialog\";\nimport { CodeEditor } from \"@webiny/ui/CodeEditor\";\nimport { Tooltip } from \"@webiny/ui/Tooltip\";\n\nimport { Action } from \"~/views/Logs/Table\";\nimport { Text } from \"~/components/Text\";\nimport type { Entry } from \"~/utils/transformCmsContentEntriesToRecordEntries\";\nimport { PayloadWrapper, previewDialog } from \"./styled\";\n\ntype HeaderProps = {\n auditLog: Entry | null;\n onClose: () => void;\n hasAccessToUsers: boolean;\n};\n\nexport const Preview = ({ auditLog, onClose, hasAccessToUsers }: HeaderProps) => {\n if (!auditLog) {\n return null;\n }\n\n const date = new Date(auditLog.savedOn);\n\n return (\n <Dialog open={!!auditLog} onClose={onClose} className={previewDialog}>\n <DialogTitle>\n {auditLog.message}\n <div className=\"title-actions\" tabIndex={0}></div>\n </DialogTitle>\n\n <DialogContent>\n <Grid>\n <Cell span={6}>\n <Text use=\"overline\">Application</Text>\n <br />\n <Text use=\"subtitle2\">{auditLog.app}</Text>\n </Cell>\n <Cell span={6}>\n <Text use=\"overline\">Date</Text>\n <br />\n <Tooltip\n placement=\"right\"\n content={`UTC: ${format(\n addMinutes(date, date.getTimezoneOffset()),\n \"yyyy-MM-dd HH:mm:ss\"\n )}`}\n >\n <Text use={\"subtitle2\"}>{format(date, \"yyyy-MM-dd HH:mm:ss (O)\")}</Text>\n </Tooltip>\n </Cell>\n <Cell span={6}>\n <Text use=\"overline\">Entity</Text>\n <br />\n <Text use=\"subtitle2\">{auditLog.entity.label}</Text>\n </Cell>\n <Cell span={6}>\n <Text use=\"overline\">Entity Id</Text>\n <br />\n {auditLog.entity.link ? (\n <a href={auditLog.entity.link} target={\"blank\"}>\n <Text use=\"subtitle2\">{auditLog.entityId}</Text>\n </a>\n ) : (\n <Text use=\"subtitle2\">{auditLog.entityId}</Text>\n )}\n </Cell>\n <Cell span={6}>\n <Text use=\"overline\">Action</Text>\n <br />\n <Action label={auditLog.action.label} value={auditLog.action.value} />\n </Cell>\n {hasAccessToUsers && (\n <Cell span={6}>\n <Text use=\"overline\">Initiator</Text>\n <br />\n <a href={`/admin-users?id=${auditLog.initiator.id}`} target={\"blank\"}>\n <Text use={\"subtitle2\"}>{auditLog.initiator.name}</Text>\n </a>\n <Text use={\"body2\"}>{` (${auditLog.initiator.role})`}</Text>\n </Cell>\n )}\n <Cell span={12}>\n <Text use=\"overline\">Payload</Text>\n <PayloadWrapper>\n <CodeEditor\n mode=\"json\"\n theme=\"chrome\"\n value={JSON.stringify(JSON.parse(auditLog.data), null, 2)}\n readOnly\n />\n </PayloadWrapper>\n </Cell>\n </Grid>\n </DialogContent>\n <DialogActions>\n <DialogCancel onClick={onClose}>Close</DialogCancel>\n </DialogActions>\n </Dialog>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAE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AA,CAACT,cAAc,qBACXd,KAAA,CAAAuB,aAAA,CAACb,UAAU;IACPoC,IAAI,EAAC,MAAM;IACXC,KAAK,EAAC,QAAQ;IACdN,KAAK,EAAEO,IAAI,CAACC,SAAS,CAACD,IAAI,CAACE,KAAK,CAACjC,QAAQ,CAACkC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAE;IAC1DC,QAAQ;EAAA,CACX,CACW,CACd,CACJ,CACK,CAAC,eAChBpD,KAAA,CAAAuB,aAAA,CAACd,aAAa,qBACVT,KAAA,CAAAuB,aAAA,CAACf,YAAY;IAAC6C,OAAO,EAAEnC;EAAQ,GAAC,OAAmB,CACxC,CACX,CAAC;AAEjB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Preview";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * from \"./Preview\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const PayloadWrapper: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const previewDialog: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
3
|
+
import { css } from "emotion";
|
|
4
|
+
export const PayloadWrapper = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
5
|
+
target: "e1r0qp7f0"
|
|
6
|
+
} : {
|
|
7
|
+
target: "e1r0qp7f0",
|
|
8
|
+
label: "PayloadWrapper"
|
|
9
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
10
|
+
name: "y8n0ve",
|
|
11
|
+
styles: "#brace-editor{height:280px!important;}.ace_print-margin,.ace_active-line,.ace_gutter-active-line,.ace_cursor-layer{display:none;}.ace_line,.ace_gutter-cell{height:12px!important;}.ace_gutter-layer{width:47px!important;}"
|
|
12
|
+
} : {
|
|
13
|
+
name: "y8n0ve",
|
|
14
|
+
styles: "#brace-editor{height:280px!important;}.ace_print-margin,.ace_active-line,.ace_gutter-active-line,.ace_cursor-layer{display:none;}.ace_line,.ace_gutter-cell{height:12px!important;}.ace_gutter-layer{width:47px!important;}",
|
|
15
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRzJDIiwiZmlsZSI6InN0eWxlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB7IGNzcyB9IGZyb20gXCJlbW90aW9uXCI7XG5cbmV4cG9ydCBjb25zdCBQYXlsb2FkV3JhcHBlciA9IHN0eWxlZChcImRpdlwiKWBcbiAgICAjYnJhY2UtZWRpdG9yIHtcbiAgICAgICAgaGVpZ2h0OiAyODBweCAhaW1wb3J0YW50O1xuICAgIH1cblxuICAgIC5hY2VfcHJpbnQtbWFyZ2luLFxuICAgIC5hY2VfYWN0aXZlLWxpbmUsXG4gICAgLmFjZV9ndXR0ZXItYWN0aXZlLWxpbmUsXG4gICAgLmFjZV9jdXJzb3ItbGF5ZXIge1xuICAgICAgICBkaXNwbGF5OiBub25lO1xuICAgIH1cblxuICAgIC5hY2VfbGluZSxcbiAgICAuYWNlX2d1dHRlci1jZWxsIHtcbiAgICAgICAgaGVpZ2h0OiAxMnB4ICFpbXBvcnRhbnQ7XG4gICAgfVxuXG4gICAgLmFjZV9ndXR0ZXItbGF5ZXIge1xuICAgICAgICB3aWR0aDogNDdweCAhaW1wb3J0YW50O1xuICAgIH1cbmA7XG5cbmV4cG9ydCBjb25zdCBwcmV2aWV3RGlhbG9nID0gY3NzYFxuICAgICYgLm1kYy1kaWFsb2dfX3N1cmZhY2Uge1xuICAgICAgICB3aWR0aDogODAwcHg7XG4gICAgICAgIG1pbi13aWR0aDogODAwcHg7XG4gICAgfVxuYDtcbiJdfQ== */",
|
|
16
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
17
|
+
});
|
|
18
|
+
export const previewDialog = css`
|
|
19
|
+
& .mdc-dialog__surface {
|
|
20
|
+
width: 800px;
|
|
21
|
+
min-width: 800px;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["css","PayloadWrapper","_styled","process","env","NODE_ENV","target","label","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","previewDialog"],"sources":["styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { css } from \"emotion\";\n\nexport const PayloadWrapper = styled(\"div\")`\n #brace-editor {\n height: 280px !important;\n }\n\n .ace_print-margin,\n .ace_active-line,\n .ace_gutter-active-line,\n .ace_cursor-layer {\n display: none;\n }\n\n .ace_line,\n .ace_gutter-cell {\n height: 12px !important;\n }\n\n .ace_gutter-layer {\n width: 47px !important;\n }\n`;\n\nexport const previewDialog = css`\n & .mdc-dialog__surface {\n width: 800px;\n min-width: 800px;\n }\n`;\n"],"mappings":";;AACA,SAASA,GAAG,QAAQ,SAAS;AAE7B,OAAO,MAAMC,cAAc,gBAAGC,OAAA,CAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,EAoB1C;AAED,OAAO,MAAMC,aAAa,GAAGb,GAAG;AAChC;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { OnSortingChange, Sorting } from "@webiny/ui/DataTable";
|
|
3
|
+
import type { Entry } from "../../../utils/transformCmsContentEntriesToRecordEntries";
|
|
4
|
+
import type { ActionType } from "../../../types";
|
|
5
|
+
type ActionProps = {
|
|
6
|
+
label: string;
|
|
7
|
+
value: ActionType;
|
|
8
|
+
};
|
|
9
|
+
export declare const Action: ({ label, value }: ActionProps) => React.JSX.Element;
|
|
10
|
+
export interface TableProps {
|
|
11
|
+
records: Entry[];
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
handleRecordSelect: (auditLog: Entry) => void;
|
|
14
|
+
sorting: Sorting;
|
|
15
|
+
onSortingChange: OnSortingChange;
|
|
16
|
+
hasAccessToUsers: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface EntryWithPreview extends Entry {
|
|
19
|
+
/**
|
|
20
|
+
* We need the preview property because data table is expecting it in columns.
|
|
21
|
+
*/
|
|
22
|
+
preview?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React, { forwardRef, useMemo } from "react";
|
|
2
|
+
import { format, addMinutes } from "date-fns";
|
|
3
|
+
import { ReactComponent as PreviewIcon } from "@webiny/icons/info.svg";
|
|
4
|
+
import { DataTable } from "@webiny/ui/DataTable";
|
|
5
|
+
import { IconButton } from "@webiny/ui/Button";
|
|
6
|
+
import { Tooltip } from "@webiny/ui/Tooltip";
|
|
7
|
+
import { Text } from "../../../components/Text";
|
|
8
|
+
import { ActionWrapper, TextGray, TimezoneText, wideColumn, appColumn, previewColumn } from "./styled";
|
|
9
|
+
export const Action = ({
|
|
10
|
+
label,
|
|
11
|
+
value
|
|
12
|
+
}) => {
|
|
13
|
+
return /*#__PURE__*/React.createElement(ActionWrapper, {
|
|
14
|
+
value: value
|
|
15
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
16
|
+
use: "subtitle1"
|
|
17
|
+
}, label));
|
|
18
|
+
};
|
|
19
|
+
export const Table = /*#__PURE__*/forwardRef((props, ref) => {
|
|
20
|
+
const {
|
|
21
|
+
records,
|
|
22
|
+
loading,
|
|
23
|
+
handleRecordSelect,
|
|
24
|
+
sorting,
|
|
25
|
+
onSortingChange,
|
|
26
|
+
hasAccessToUsers
|
|
27
|
+
} = props;
|
|
28
|
+
const columns = {
|
|
29
|
+
savedOn: {
|
|
30
|
+
header: "Timestamp",
|
|
31
|
+
cell: ({
|
|
32
|
+
savedOn
|
|
33
|
+
}) => {
|
|
34
|
+
const date = new Date(savedOn);
|
|
35
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
36
|
+
placement: "right",
|
|
37
|
+
content: `UTC: ${format(addMinutes(date, date.getTimezoneOffset()), "yyyy-MM-dd HH:mm:ss")}`
|
|
38
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
39
|
+
use: "subtitle1"
|
|
40
|
+
}, format(date, "yyyy-MM-dd HH:mm:ss")), /*#__PURE__*/React.createElement(TimezoneText, {
|
|
41
|
+
use: "body2"
|
|
42
|
+
}, format(date, "(O)")));
|
|
43
|
+
},
|
|
44
|
+
enableSorting: true
|
|
45
|
+
},
|
|
46
|
+
app: {
|
|
47
|
+
header: "App/Entity",
|
|
48
|
+
cell: ({
|
|
49
|
+
app,
|
|
50
|
+
entity,
|
|
51
|
+
entityId
|
|
52
|
+
}) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
|
|
53
|
+
use: "subtitle1"
|
|
54
|
+
}, app), entity && /*#__PURE__*/React.createElement(TextGray, {
|
|
55
|
+
use: "body2"
|
|
56
|
+
}, ` [Entity: ${entity.label}]`), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(TextGray, {
|
|
57
|
+
use: "body2"
|
|
58
|
+
}, `ID: `), entity.link ? /*#__PURE__*/React.createElement("a", {
|
|
59
|
+
href: entity.link,
|
|
60
|
+
target: "blank"
|
|
61
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
62
|
+
use: "body2"
|
|
63
|
+
}, entityId)) : /*#__PURE__*/React.createElement(Text, {
|
|
64
|
+
use: "body2"
|
|
65
|
+
}, entityId)),
|
|
66
|
+
className: appColumn
|
|
67
|
+
},
|
|
68
|
+
action: {
|
|
69
|
+
header: "Action",
|
|
70
|
+
cell: ({
|
|
71
|
+
action
|
|
72
|
+
}) => /*#__PURE__*/React.createElement(Action, {
|
|
73
|
+
label: action.label,
|
|
74
|
+
value: action.value
|
|
75
|
+
})
|
|
76
|
+
},
|
|
77
|
+
message: {
|
|
78
|
+
header: "Message",
|
|
79
|
+
cell: ({
|
|
80
|
+
message
|
|
81
|
+
}) => /*#__PURE__*/React.createElement(Text, {
|
|
82
|
+
use: "subtitle1"
|
|
83
|
+
}, message),
|
|
84
|
+
className: wideColumn
|
|
85
|
+
},
|
|
86
|
+
...(hasAccessToUsers && {
|
|
87
|
+
initiator: {
|
|
88
|
+
header: "Initiator",
|
|
89
|
+
cell: ({
|
|
90
|
+
initiator
|
|
91
|
+
}) => /*#__PURE__*/React.createElement("a", {
|
|
92
|
+
href: `/admin-users?id=${initiator.id}`,
|
|
93
|
+
target: "blank"
|
|
94
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
95
|
+
use: "subtitle1"
|
|
96
|
+
}, initiator.name))
|
|
97
|
+
}
|
|
98
|
+
}),
|
|
99
|
+
preview: {
|
|
100
|
+
header: "",
|
|
101
|
+
cell: auditLog => /*#__PURE__*/React.createElement(IconButton, {
|
|
102
|
+
onClick: () => handleRecordSelect(auditLog),
|
|
103
|
+
icon: /*#__PURE__*/React.createElement(PreviewIcon, null)
|
|
104
|
+
}),
|
|
105
|
+
className: previewColumn
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const tableSorting = useMemo(() => {
|
|
109
|
+
if (!Array.isArray(sorting) || sorting.length === 0) {
|
|
110
|
+
return [{
|
|
111
|
+
id: "savedOn",
|
|
112
|
+
desc: true
|
|
113
|
+
}];
|
|
114
|
+
}
|
|
115
|
+
return sorting;
|
|
116
|
+
}, [sorting]);
|
|
117
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
ref: ref
|
|
119
|
+
}, /*#__PURE__*/React.createElement(DataTable, {
|
|
120
|
+
columns: columns,
|
|
121
|
+
data: records,
|
|
122
|
+
loadingInitial: loading,
|
|
123
|
+
stickyRows: 1,
|
|
124
|
+
sorting: tableSorting,
|
|
125
|
+
onSortingChange: onSortingChange
|
|
126
|
+
}));
|
|
127
|
+
});
|
|
128
|
+
Table.displayName = "Table";
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=Table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useMemo","format","addMinutes","ReactComponent","PreviewIcon","DataTable","IconButton","Tooltip","Text","ActionWrapper","TextGray","TimezoneText","wideColumn","appColumn","previewColumn","Action","label","value","createElement","use","Table","props","ref","records","loading","handleRecordSelect","sorting","onSortingChange","hasAccessToUsers","columns","savedOn","header","cell","date","Date","placement","content","getTimezoneOffset","enableSorting","app","entity","entityId","Fragment","link","href","target","className","action","message","initiator","id","name","preview","auditLog","onClick","icon","tableSorting","Array","isArray","length","desc","data","loadingInitial","stickyRows","displayName"],"sources":["Table.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from \"react\";\nimport { format, addMinutes } from \"date-fns\";\n\nimport { ReactComponent as PreviewIcon } from \"@webiny/icons/info.svg\";\nimport type { Columns, OnSortingChange, Sorting } from \"@webiny/ui/DataTable\";\nimport { DataTable } from \"@webiny/ui/DataTable\";\nimport { IconButton } from \"@webiny/ui/Button\";\nimport { Tooltip } from \"@webiny/ui/Tooltip\";\n\nimport type { Entry } from \"~/utils/transformCmsContentEntriesToRecordEntries\";\nimport { Text } from \"~/components/Text\";\nimport {\n ActionWrapper,\n TextGray,\n TimezoneText,\n wideColumn,\n appColumn,\n previewColumn\n} from \"./styled\";\nimport type { ActionType } from \"~/types\";\n\ntype ActionProps = {\n label: string;\n value: ActionType;\n};\n\nexport const Action = ({ label, value }: ActionProps) => {\n return (\n <ActionWrapper value={value}>\n <Text use={\"subtitle1\"}>{label}</Text>\n </ActionWrapper>\n );\n};\n\nexport interface TableProps {\n records: Entry[];\n loading?: boolean;\n handleRecordSelect: (auditLog: Entry) => void;\n sorting: Sorting;\n onSortingChange: OnSortingChange;\n hasAccessToUsers: boolean;\n}\n\nexport interface EntryWithPreview extends Entry {\n /**\n * We need the preview property because data table is expecting it in columns.\n */\n preview?: string;\n}\n\nexport const Table = forwardRef<HTMLDivElement, TableProps>((props, ref) => {\n const { records, loading, handleRecordSelect, sorting, onSortingChange, hasAccessToUsers } =\n props;\n\n const columns: Columns<EntryWithPreview> = {\n savedOn: {\n header: \"Timestamp\",\n cell: ({ savedOn }) => {\n const date = new Date(savedOn);\n\n return (\n <Tooltip\n placement=\"right\"\n content={`UTC: ${format(\n addMinutes(date, date.getTimezoneOffset()),\n \"yyyy-MM-dd HH:mm:ss\"\n )}`}\n >\n <Text use={\"subtitle1\"}>{format(date, \"yyyy-MM-dd HH:mm:ss\")}</Text>\n <TimezoneText use={\"body2\"}>{format(date, \"(O)\")}</TimezoneText>\n </Tooltip>\n );\n },\n enableSorting: true\n },\n app: {\n header: \"App/Entity\",\n cell: ({ app, entity, entityId }) => (\n <>\n <Text use={\"subtitle1\"}>{app}</Text>\n {entity && <TextGray use={\"body2\"}>{` [Entity: ${entity.label}]`}</TextGray>}\n <br />\n <TextGray use={\"body2\"}>{`ID: `}</TextGray>\n {entity.link ? (\n <a href={entity.link} target={\"blank\"}>\n <Text use={\"body2\"}>{entityId}</Text>\n </a>\n ) : (\n <Text use={\"body2\"}>{entityId}</Text>\n )}\n </>\n ),\n className: appColumn\n },\n action: {\n header: \"Action\",\n cell: ({ action }) => <Action label={action.label} value={action.value} />\n },\n message: {\n header: \"Message\",\n cell: ({ message }) => <Text use={\"subtitle1\"}>{message}</Text>,\n className: wideColumn\n },\n ...(hasAccessToUsers && {\n initiator: {\n header: \"Initiator\",\n cell: ({ initiator }) => (\n <a href={`/admin-users?id=${initiator.id}`} target={\"blank\"}>\n <Text use={\"subtitle1\"}>{initiator.name}</Text>\n </a>\n )\n }\n }),\n preview: {\n header: \"\",\n cell: auditLog => (\n <IconButton onClick={() => handleRecordSelect(auditLog)} icon={<PreviewIcon />} />\n ),\n className: previewColumn\n }\n };\n\n const tableSorting = useMemo(() => {\n if (!Array.isArray(sorting) || sorting.length === 0) {\n return [\n {\n id: \"savedOn\",\n desc: true\n }\n ];\n }\n\n return sorting;\n }, [sorting]);\n\n return (\n <div ref={ref}>\n <DataTable\n columns={columns}\n data={records}\n loadingInitial={loading}\n stickyRows={1}\n sorting={tableSorting}\n onSortingChange={onSortingChange}\n />\n </div>\n );\n});\n\nTable.displayName = \"Table\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAClD,SAASC,MAAM,EAAEC,UAAU,QAAQ,UAAU;AAE7C,SAASC,cAAc,IAAIC,WAAW,QAAQ,wBAAwB;AAEtE,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,OAAO,QAAQ,oBAAoB;AAG5C,SAASC,IAAI;AACb,SACIC,aAAa,EACbC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,SAAS,EACTC,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AAC4C,WAAW,GAAG,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Table";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * from \"./Table\";\n"],"mappings":"AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ActionType } from "../../../types";
|
|
3
|
+
export declare const ActionWrapper: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
6
|
+
} & {
|
|
7
|
+
value: ActionType;
|
|
8
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
+
export declare const wideColumn: string;
|
|
10
|
+
export declare const appColumn: string;
|
|
11
|
+
export declare const previewColumn: string;
|
|
12
|
+
export declare const TextGray: import("@emotion/styled").StyledComponent<import("@webiny/ui/Typography/Typography").TypographyProps & {
|
|
13
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
14
|
+
}, {}, {}>;
|
|
15
|
+
export declare const TimezoneText: import("@emotion/styled").StyledComponent<import("@webiny/ui/Typography/Typography").TypographyProps & {
|
|
16
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
17
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
3
|
+
import { css } from "emotion";
|
|
4
|
+
import { Text } from "../../../components/Text";
|
|
5
|
+
import { ActionType } from "../../../types";
|
|
6
|
+
const ACTION_TYPES_COLORS_MAP = {
|
|
7
|
+
YELLOW: [ActionType.UPDATE],
|
|
8
|
+
RED: [ActionType.DELETE, ActionType.UNPUBLISH, ActionType.MOVE_TO_TRASH]
|
|
9
|
+
};
|
|
10
|
+
export const ActionWrapper = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
11
|
+
target: "e1raj95o2"
|
|
12
|
+
} : {
|
|
13
|
+
target: "e1raj95o2",
|
|
14
|
+
label: "ActionWrapper"
|
|
15
|
+
})("padding:0 8px;width:fit-content;border:1px solid;border-radius:5px;", ({
|
|
16
|
+
value: actionType
|
|
17
|
+
}) => {
|
|
18
|
+
// Yellow.
|
|
19
|
+
if (ACTION_TYPES_COLORS_MAP.YELLOW.includes(actionType)) {
|
|
20
|
+
return `
|
|
21
|
+
background-color: #fac42810;
|
|
22
|
+
border-color: #fac428;
|
|
23
|
+
color: #fac428;
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Red.
|
|
28
|
+
if (ACTION_TYPES_COLORS_MAP.RED.includes(actionType)) {
|
|
29
|
+
return `
|
|
30
|
+
background-color: #ff000010;
|
|
31
|
+
border-color: #ff0000;
|
|
32
|
+
color: #ff0000;
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Green.
|
|
37
|
+
return `
|
|
38
|
+
background-color: #00ccb010;
|
|
39
|
+
border-color: #00ccb0;
|
|
40
|
+
color: #00ccb0;
|
|
41
|
+
`;
|
|
42
|
+
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBVThEIiwiZmlsZSI6InN0eWxlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB7IGNzcy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AgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2ZmMDAwMDEwO1xuICAgICAgICAgICAgICAgIGJvcmRlci1jb2xvcjogI2ZmMDAwMDtcbiAgICAgICAgICAgICAgICBjb2xvcjogI2ZmMDAwMDtcbiAgICAgICAgICAgIGA7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBHcmVlbi5cbiAgICAgICAgcmV0dXJuIGBcbiAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICMwMGNjYjAxMDtcbiAgICAgICAgICAgIGJvcmRlci1jb2xvcjogIzAwY2NiMDtcbiAgICAgICAgICAgIGNvbG9yOiAjMDBjY2IwO1xuICAgICAgICBgO1xuICAgIH19XG5gO1xuXG5leHBvcnQgY29uc3Qgd2lkZUNvbHVtbiA9IGNzc2BcbiAgICB3aWR0aDogYXV0byAhaW1wb3J0YW50O1xuYDtcblxuZXhwb3J0IGNvbnN0IGFwcENvbHVtbiA9IGNzc2BcbiAgICB3aWR0aDogMjgwcHggIWltcG9ydGFudDtcbmA7XG5cbmV4cG9ydCBjb25zdCBwcmV2aWV3Q29sdW1uID0gY3NzYFxuICAgIHdpZHRoOiAxMDBweCAhaW1wb3J0YW50O1xuYDtcblxuZXhwb3J0IGNvbnN0IFRleHRHcmF5ID0gc3R5bGVkKFRleHQpYFxuICAgIGNvbG9yOiBcIiM2MTYxNjFcIjtcbmA7XG5cbmV4cG9ydCBjb25zdCBUaW1lem9uZVRleHQgPSBzdHlsZWQoVGV4dEdyYXkpYFxuICAgIHBhZGRpbmctbGVmdDogNnB4O1xuICAgIHBhZGRpbmctcmlnaHQ6IDZweDtcbmA7XG4iXX0= */"));
|
|
43
|
+
export const wideColumn = css`
|
|
44
|
+
width: auto !important;
|
|
45
|
+
`;
|
|
46
|
+
export const appColumn = css`
|
|
47
|
+
width: 280px !important;
|
|
48
|
+
`;
|
|
49
|
+
export const previewColumn = css`
|
|
50
|
+
width: 100px !important;
|
|
51
|
+
`;
|
|
52
|
+
export const TextGray = /*#__PURE__*/_styled(Text, process.env.NODE_ENV === "production" ? {
|
|
53
|
+
target: "e1raj95o1"
|
|
54
|
+
} : {
|
|
55
|
+
target: "e1raj95o1",
|
|
56
|
+
label: "TextGray"
|
|
57
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
58
|
+
name: "1n69aae",
|
|
59
|
+
styles: "color:\"#616161\""
|
|
60
|
+
} : {
|
|
61
|
+
name: "1n69aae",
|
|
62
|
+
styles: "color:\"#616161\"",
|
|
63
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBd0RvQyIsImZpbGUiOiJzdHlsZWQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tIFwiQGVtb3Rpb24vc3R5bGVkXCI7XG5pbXBvcnQgeyBjc3MgfSBmcm9tIFwiZW1vdGlvblwiO1xuaW1wb3J0IHsgVGV4dCB9IGZyb20gXCJ+L2NvbXBvbmVudHMvVGV4dFwiO1xuaW1wb3J0IHsgQWN0aW9uVHlwZSB9IGZyb20gXCJ+L3R5cGVzXCI7XG5cbmNvbnN0IEFDVElPTl9UWVBFU19DT0xPUlNfTUFQID0ge1xuICAgIFlFTExPVzogW0FjdGlvblR5cGUuVVBEQVRFXSxcbiAgICBSRUQ6IFtBY3Rpb25UeXBlLkRFTEVURSwgQWN0aW9uVHlwZS5VTlBVQkxJU0gsIEFjdGlvblR5cGUuTU9WRV9UT19UUkFTSF1cbn07XG5cbmV4cG9ydCBjb25zdCBBY3Rpb25XcmFwcGVyID0gc3R5bGVkLmRpdjx7IHZhbHVlOiBBY3Rpb25UeXBlIH0+YFxuICAgIHBhZGRpbmc6IDAgOHB4O1xuICAgIHdpZHRoOiBmaXQtY29udGVudDtcbiAgICBib3JkZXI6IDFweCBzb2xpZDtcbiAgICBib3JkZXItcmFkaXVzOiA1cHg7XG5cbiAgICAkeyh7IHZhbHVlOiBhY3Rpb25UeXBlIH0pID0+IHtcbiAgICAgICAgLy8gWWVsbG93LlxuICAgICAgICBpZiAoQUNUSU9OX1RZUEVTX0NPTE9SU19NQVAuWUVMTE9XLmluY2x1ZGVzKGFjdGlvblR5cGUpKSB7XG4gICAgICAgICAgICByZXR1cm4gYFxuICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmYWM0MjgxMDtcbiAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6ICNmYWM0Mjg7XG4gICAgICAgICAgICAgICAgY29sb3I6ICNmYWM0Mjg7XG4gICAgICAgICAgICBgO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gUmVkLlxuICAgICAgICBpZiAoQUNUSU9OX1RZUEVTX0NPTE9SU19NQVAuUkVELmluY2x1ZGVzKGFjdGlvblR5cGUpKSB7XG4gICAgICAgICAgICByZXR1cm4gYFxuICAgICAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICNmZjAwMDAxMDtcbiAgICAgICAgICAgICAgICBib3JkZXItY29sb3I6ICNmZjAwMDA7XG4gICAgICAgICAgICAgICAgY29sb3I6ICNmZjAwMDA7XG4gICAgICAgICAgICBgO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gR3JlZW4uXG4gICAgICAgIHJldHVybiBgXG4gICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjMDBjY2IwMTA7XG4gICAgICAgICAgICBib3JkZXItY29sb3I6ICMwMGNjYjA7XG4gICAgICAgICAgICBjb2xvcjogIzAwY2NiMDtcbiAgICAgICAgYDtcbiAgICB9fVxuYDtcblxuZXhwb3J0IGNvbnN0IHdpZGVDb2x1bW4gPSBjc3NgXG4gICAgd2lkdGg6IGF1dG8gIWltcG9ydGFudDtcbmA7XG5cbmV4cG9ydCBjb25zdCBhcHBDb2x1bW4gPSBjc3NgXG4gICAgd2lkdGg6IDI4MHB4ICFpbXBvcnRhbnQ7XG5gO1xuXG5leHBvcnQgY29uc3QgcHJldmlld0NvbHVtbiA9IGNzc2BcbiAgICB3aWR0aDogMTAwcHggIWltcG9ydGFudDtcbmA7XG5cbmV4cG9ydCBjb25zdCBUZXh0R3JheSA9IHN0eWxlZChUZXh0KWBcbiAgICBjb2xvcjogXCIjNjE2MTYxXCI7XG5gO1xuXG5leHBvcnQgY29uc3QgVGltZXpvbmVUZXh0ID0gc3R5bGVkKFRleHRHcmF5KWBcbiAgICBwYWRkaW5nLWxlZnQ6IDZweDtcbiAgICBwYWRkaW5nLXJpZ2h0OiA2cHg7XG5gO1xuIl19 */",
|
|
64
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
65
|
+
});
|
|
66
|
+
export const TimezoneText = /*#__PURE__*/_styled(TextGray, process.env.NODE_ENV === "production" ? {
|
|
67
|
+
target: "e1raj95o0"
|
|
68
|
+
} : {
|
|
69
|
+
target: "e1raj95o0",
|
|
70
|
+
label: "TimezoneText"
|
|
71
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
72
|
+
name: "19lbh5u",
|
|
73
|
+
styles: "padding-left:6px;padding-right:6px"
|
|
74
|
+
} : {
|
|
75
|
+
name: "19lbh5u",
|
|
76
|
+
styles: "padding-left:6px;padding-right:6px",
|
|
77
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBNEQ0QyIsImZpbGUiOiJzdHlsZWQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tIFwiQGVtb3Rpb24vc3R5bGVkXCI7XG5pbXBvcnQgeyBjc3MgfSBmcm9tIFwiZW1vdGlvblwiO1xuaW1wb3J0IHsgVGV4dCB9IGZyb20gXCJ+L2NvbXBvbmVudHMvVGV4dFwiO1xuaW1wb3J0IHsgQWN0aW9uVHlwZSB9IGZyb20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wMDA7XG4gICAgICAgICAgICBgO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gR3JlZW4uXG4gICAgICAgIHJldHVybiBgXG4gICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjMDBjY2IwMTA7XG4gICAgICAgICAgICBib3JkZXItY29sb3I6ICMwMGNjYjA7XG4gICAgICAgICAgICBjb2xvcjogIzAwY2NiMDtcbiAgICAgICAgYDtcbiAgICB9fVxuYDtcblxuZXhwb3J0IGNvbnN0IHdpZGVDb2x1bW4gPSBjc3NgXG4gICAgd2lkdGg6IGF1dG8gIWltcG9ydGFudDtcbmA7XG5cbmV4cG9ydCBjb25zdCBhcHBDb2x1bW4gPSBjc3NgXG4gICAgd2lkdGg6IDI4MHB4ICFpbXBvcnRhbnQ7XG5gO1xuXG5leHBvcnQgY29uc3QgcHJldmlld0NvbHVtbiA9IGNzc2BcbiAgICB3aWR0aDogMTAwcHggIWltcG9ydGFudDtcbmA7XG5cbmV4cG9ydCBjb25zdCBUZXh0R3JheSA9IHN0eWxlZChUZXh0KWBcbiAgICBjb2xvcjogXCIjNjE2MTYxXCI7XG5gO1xuXG5leHBvcnQgY29uc3QgVGltZXpvbmVUZXh0ID0gc3R5bGVkKFRleHRHcmF5KWBcbiAgICBwYWRkaW5nLWxlZnQ6IDZweDtcbiAgICBwYWRkaW5nLXJpZ2h0OiA2cHg7XG5gO1xuIl19 */",
|
|
78
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["css","Text","ActionType","ACTION_TYPES_COLORS_MAP","YELLOW","UPDATE","RED","DELETE","UNPUBLISH","MOVE_TO_TRASH","ActionWrapper","_styled","process","env","NODE_ENV","target","label","value","actionType","includes","wideColumn","appColumn","previewColumn","TextGray","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","TimezoneText"],"sources":["styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { css } from \"emotion\";\nimport { Text } from \"~/components/Text\";\nimport { ActionType } from \"~/types\";\n\nconst ACTION_TYPES_COLORS_MAP = {\n YELLOW: [ActionType.UPDATE],\n RED: [ActionType.DELETE, ActionType.UNPUBLISH, ActionType.MOVE_TO_TRASH]\n};\n\nexport const ActionWrapper = styled.div<{ value: ActionType }>`\n padding: 0 8px;\n width: fit-content;\n border: 1px solid;\n border-radius: 5px;\n\n ${({ value: actionType }) => {\n // Yellow.\n if (ACTION_TYPES_COLORS_MAP.YELLOW.includes(actionType)) {\n return `\n background-color: #fac42810;\n border-color: #fac428;\n color: #fac428;\n `;\n }\n\n // Red.\n if (ACTION_TYPES_COLORS_MAP.RED.includes(actionType)) {\n return `\n background-color: #ff000010;\n border-color: #ff0000;\n color: #ff0000;\n `;\n }\n\n // Green.\n return `\n background-color: #00ccb010;\n border-color: #00ccb0;\n color: #00ccb0;\n `;\n }}\n`;\n\nexport const wideColumn = css`\n width: auto !important;\n`;\n\nexport const appColumn = css`\n width: 280px !important;\n`;\n\nexport const previewColumn = css`\n width: 100px !important;\n`;\n\nexport const TextGray = styled(Text)`\n color: \"#616161\";\n`;\n\nexport const TimezoneText = styled(TextGray)`\n padding-left: 6px;\n padding-right: 6px;\n`;\n"],"mappings":";;AACA,SAASA,GAAG,QAAQ,SAAS;AAC7B,SAASC,IAAI;AACb,SAASC,UAAU;AAEnB,MAAMC,uBAAuB,GAAG;EAC5BC,MAAM,EAAE,CAACF,UAAU,CAACG,MAAM,CAAC;EAC3BC,GAAG,EAAE,CAACJ,UAAU,CAACK,MAAM,EAAEL,UAAU,CAACM,SAAS,EAAEN,UAAU,CAACO,aAAa;AAC3E,CAAC;AAED,OAAO,MAAMC,aAAa,gBAAAC,OAAA,QAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,0EAMpB,C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are const MainContainer: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const Wrapper: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
3
|
+
export const MainContainer = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
4
|
+
target: "e18huwys1"
|
|
5
|
+
} : {
|
|
6
|
+
target: "e18huwys1",
|
|
7
|
+
label: "MainContainer"
|
|
8
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
9
|
+
name: "sn3pg",
|
|
10
|
+
styles: "overflow:hidden;position:relative;height:calc(100vh - 70px)"
|
|
11
|
+
} : {
|
|
12
|
+
name: "sn3pg",
|
|
13
|
+
styles: "overflow:hidden;position:relative;height:calc(100vh - 70px)",
|
|
14
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRTBDIiwiZmlsZSI6InN0eWxlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcblxuZXhwb3J0IGNvbnN0IE1haW5Db250YWluZXIgPSBzdHlsZWQoXCJkaXZcIilgXG4gICAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgaGVpZ2h0OiBjYWxjKDEwMHZoIC0gNzBweCk7XG5gO1xuXG5leHBvcnQgY29uc3QgV3JhcHBlciA9IHN0eWxlZChcImRpdlwiKWBcbiAgICB3aWR0aDogMTAwJTtcbiAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgdG9wOiA2NXB4O1xuICAgIGJvdHRvbTogMDtcbiAgICBsZWZ0OiAwO1xuICAgIGJvcmRlci1yYWRpdXM6IDRweDtcbiAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcblxuICAgIC5tZGMtZGF0YS10YWJsZSB7XG4gICAgICAgIGRpc3BsYXk6IGlubGluZS10YWJsZTtcbiAgICB9XG5gO1xuIl19 */",
|
|
15
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
16
|
+
});
|
|
17
|
+
export const Wrapper = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
18
|
+
target: "e18huwys0"
|
|
19
|
+
} : {
|
|
20
|
+
target: "e18huwys0",
|
|
21
|
+
label: "Wrapper"
|
|
22
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
23
|
+
name: "5aj25c",
|
|
24
|
+
styles: "width:100%;position:absolute;top:65px;bottom:0;left:0;border-radius:4px;overflow:hidden;display:flex;flex-direction:column;.mdc-data-table{display:inline-table;}"
|
|
25
|
+
} : {
|
|
26
|
+
name: "5aj25c",
|
|
27
|
+
styles: "width:100%;position:absolute;top:65px;bottom:0;left:0;border-radius:4px;overflow:hidden;display:flex;flex-direction:column;.mdc-data-table{display:inline-table;}",
|
|
28
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlZC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBUW9DIiwiZmlsZSI6InN0eWxlZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcblxuZXhwb3J0IGNvbnN0IE1haW5Db250YWluZXIgPSBzdHlsZWQoXCJkaXZcIilgXG4gICAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgaGVpZ2h0OiBjYWxjKDEwMHZoIC0gNzBweCk7XG5gO1xuXG5leHBvcnQgY29uc3QgV3JhcHBlciA9IHN0eWxlZChcImRpdlwiKWBcbiAgICB3aWR0aDogMTAwJTtcbiAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgdG9wOiA2NXB4O1xuICAgIGJvdHRvbTogMDtcbiAgICBsZWZ0OiAwO1xuICAgIGJvcmRlci1yYWRpdXM6IDRweDtcbiAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcblxuICAgIC5tZGMtZGF0YS10YWJsZSB7XG4gICAgICAgIGRpc3BsYXk6IGlubGluZS10YWJsZTtcbiAgICB9XG5gO1xuIl19 */",
|
|
29
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MainContainer","_styled","process","env","NODE_ENV","target","label","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","Wrapper"],"sources":["styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\n\nexport const MainContainer = styled(\"div\")`\n overflow: hidden;\n position: relative;\n height: calc(100vh - 70px);\n`;\n\nexport const Wrapper = styled(\"div\")`\n width: 100%;\n position: absolute;\n top: 65px;\n bottom: 0;\n left: 0;\n border-radius: 4px;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n .mdc-data-table {\n display: inline-table;\n }\n`;\n"],"mappings":";;AAEA,OAAO,MAAMA,aAAa,gBAAGC,OAAA,CAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,EAIzC;AAED,OAAO,MAAMC,OAAO,gBAAGX,OAAA,CAAO,KAAK,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,EAAC,CAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAC;AAAA,EAcnC","ignoreList":[]}
|