synapse-react-client 4.0.7 → 4.0.8
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/SWC.index.js +1 -1
- package/dist/components/DataGrid/DataGridTypes.d.ts +8 -2
- package/dist/components/DataGrid/DataGridTypes.d.ts.map +1 -1
- package/dist/components/DataGrid/DataGridTypes.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +190 -176
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/hooks/useGridReplicaUsers.d.ts +15 -0
- package/dist/components/DataGrid/hooks/useGridReplicaUsers.d.ts.map +1 -0
- package/dist/components/DataGrid/hooks/useGridReplicaUsers.js +55 -0
- package/dist/components/DataGrid/hooks/useGridReplicaUsers.js.map +1 -0
- package/dist/components/DataGrid/utils/DataGridUtils.js +31 -31
- package/dist/components/DataGrid/utils/DataGridUtils.js.map +1 -1
- package/dist/components/DataGrid/utils/applyModelChange.d.ts +1 -1
- package/dist/components/DataGrid/utils/applyModelChange.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/applyModelChange.js +28 -23
- package/dist/components/DataGrid/utils/applyModelChange.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +90 -49
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DataGrid/utils/enrichRowsWithChangeInfo.d.ts +14 -0
- package/dist/components/DataGrid/utils/enrichRowsWithChangeInfo.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/enrichRowsWithChangeInfo.js +24 -0
- package/dist/components/DataGrid/utils/enrichRowsWithChangeInfo.js.map +1 -0
- package/dist/components/DataGrid/utils/getCellAuthorSid.d.ts +7 -0
- package/dist/components/DataGrid/utils/getCellAuthorSid.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/getCellAuthorSid.js +11 -0
- package/dist/components/DataGrid/utils/getCellAuthorSid.js.map +1 -0
- package/dist/components/DataGrid/utils/getCellClassName.d.ts +0 -1
- package/dist/components/DataGrid/utils/getCellClassName.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/getCellClassName.js +19 -17
- package/dist/components/DataGrid/utils/getCellClassName.js.map +1 -1
- package/dist/components/DataGrid/utils/getChangeTooltipText.d.ts +7 -0
- package/dist/components/DataGrid/utils/getChangeTooltipText.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/getChangeTooltipText.js +18 -0
- package/dist/components/DataGrid/utils/getChangeTooltipText.js.map +1 -0
- package/dist/components/DataGrid/utils/getReplicaCategory.d.ts +12 -0
- package/dist/components/DataGrid/utils/getReplicaCategory.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/getReplicaCategory.js +13 -0
- package/dist/components/DataGrid/utils/getReplicaCategory.js.map +1 -0
- package/dist/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.js +4 -8
- package/dist/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.js.map +1 -1
- package/dist/style/components/_data-grid-extra.css +1 -1
- package/dist/style/components/_data-grid-extra.scss +33 -0
- package/dist/synapse-queries/index.js +42 -41
- package/dist/synapse-queries/user/index.js +17 -16
- package/dist/synapse-queries/user/useUserBundle.d.ts +9 -0
- package/dist/synapse-queries/user/useUserBundle.d.ts.map +1 -1
- package/dist/synapse-queries/user/useUserBundle.js +45 -37
- package/dist/synapse-queries/user/useUserBundle.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -1,39 +1,80 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { dateTimeColumn as
|
|
3
|
-
import { createTextColumn as
|
|
4
|
-
import { autocompleteColumn as
|
|
5
|
-
import { autocompleteMultipleEnumColumn as
|
|
6
|
-
import { calculateDefaultColumnWidth as
|
|
7
|
-
import { ColumnHeaderWithTooltip as
|
|
8
|
-
|
|
1
|
+
import { jsx as i, jsxs as d, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { dateTimeColumn as c } from "../columns/DateTimeColumn.js";
|
|
3
|
+
import { createTextColumn as h, keyColumn as y, floatColumn as T } from "@sage-bionetworks/react-datasheet-grid";
|
|
4
|
+
import { autocompleteColumn as a } from "../columns/AutocompleteColumn.js";
|
|
5
|
+
import { autocompleteMultipleEnumColumn as C } from "../columns/AutocompleteMultipleEnumColumn.js";
|
|
6
|
+
import { calculateDefaultColumnWidth as s } from "./calculateColumnWidth.js";
|
|
7
|
+
import { ColumnHeaderWithTooltip as I } from "../components/ColumnHeaderWithTooltip.js";
|
|
8
|
+
import { Tooltip as m } from "@mui/material";
|
|
9
|
+
import { SmartToyTwoTone as w } from "@mui/icons-material";
|
|
10
|
+
function b(e, t) {
|
|
11
|
+
function n(r) {
|
|
12
|
+
const o = r.rowData.__cellChangeInfo?.[t], u = o?.category === "own-agent" || o?.category === "other-agent";
|
|
13
|
+
return /* @__PURE__ */ d(p, { children: [
|
|
14
|
+
/* @__PURE__ */ i(e, { ...r }),
|
|
15
|
+
o && !u && /* @__PURE__ */ i(m, { title: o.tooltipText, placement: "top-end", children: /* @__PURE__ */ i(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
style: {
|
|
19
|
+
position: "absolute",
|
|
20
|
+
top: 0,
|
|
21
|
+
right: 0,
|
|
22
|
+
width: 7,
|
|
23
|
+
height: 7,
|
|
24
|
+
zIndex: 21,
|
|
25
|
+
pointerEvents: "auto"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
) }),
|
|
29
|
+
u && !r.focus && /* @__PURE__ */ i(m, { title: o.tooltipText, placement: "left", children: /* @__PURE__ */ i(
|
|
30
|
+
w,
|
|
31
|
+
{
|
|
32
|
+
sx: {
|
|
33
|
+
fontSize: "1em",
|
|
34
|
+
alignSelf: "center",
|
|
35
|
+
flexShrink: 0,
|
|
36
|
+
mr: 0.5,
|
|
37
|
+
zIndex: 21,
|
|
38
|
+
pointerEvents: "auto",
|
|
39
|
+
color: "grey.400",
|
|
40
|
+
backgroundColor: "transparent"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
) })
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
return n.displayName = `CellWithTooltip(${t})`, n;
|
|
47
|
+
}
|
|
48
|
+
function x(e) {
|
|
9
49
|
return e ? "header-cell-required" : "header-cell";
|
|
10
50
|
}
|
|
11
|
-
function
|
|
12
|
-
return ({ rowData:
|
|
13
|
-
...
|
|
51
|
+
function P(e, t) {
|
|
52
|
+
return ({ rowData: n }) => ({
|
|
53
|
+
...n,
|
|
14
54
|
[e]: t ? null : void 0
|
|
15
55
|
});
|
|
16
56
|
}
|
|
17
|
-
function
|
|
57
|
+
function v(e) {
|
|
18
58
|
return (t) => {
|
|
19
|
-
const
|
|
20
|
-
return
|
|
59
|
+
const n = t.trim();
|
|
60
|
+
return n === "" ? e ? null : void 0 : n;
|
|
21
61
|
};
|
|
22
62
|
}
|
|
23
|
-
function
|
|
24
|
-
const
|
|
63
|
+
function l(e, t) {
|
|
64
|
+
const n = {
|
|
25
65
|
showPinIcon: e.showPinIcon,
|
|
26
66
|
hasDescription: !!e.description
|
|
27
|
-
},
|
|
67
|
+
}, r = e.customWidth ?? s(
|
|
28
68
|
e.columnName,
|
|
29
69
|
void 0,
|
|
30
70
|
// propertyInfo is not available here, passed from higher level
|
|
31
|
-
|
|
32
|
-
);
|
|
71
|
+
n
|
|
72
|
+
), o = y(e.columnName, t);
|
|
33
73
|
return {
|
|
34
|
-
...
|
|
35
|
-
|
|
36
|
-
|
|
74
|
+
...o,
|
|
75
|
+
component: b(o.component, e.columnName),
|
|
76
|
+
title: /* @__PURE__ */ i(
|
|
77
|
+
I,
|
|
37
78
|
{
|
|
38
79
|
name: e.columnName,
|
|
39
80
|
description: e.description,
|
|
@@ -42,83 +83,83 @@ function u(e, t) {
|
|
|
42
83
|
onTogglePin: e.onTogglePin
|
|
43
84
|
}
|
|
44
85
|
),
|
|
45
|
-
headerClassName:
|
|
46
|
-
minWidth:
|
|
47
|
-
basis:
|
|
86
|
+
headerClassName: x(e.isRequired),
|
|
87
|
+
minWidth: r,
|
|
88
|
+
basis: r,
|
|
48
89
|
grow: 0,
|
|
49
90
|
shrink: 0,
|
|
50
91
|
disabled: e.disabled,
|
|
51
|
-
deleteValue:
|
|
92
|
+
deleteValue: P(e.columnName, e.isRequired),
|
|
52
93
|
stickyLeft: e.isPinned
|
|
53
94
|
};
|
|
54
95
|
}
|
|
55
|
-
const
|
|
56
|
-
multipleEnum: (e) =>
|
|
96
|
+
const N = {
|
|
97
|
+
multipleEnum: (e) => l(
|
|
57
98
|
e,
|
|
58
|
-
|
|
99
|
+
C({
|
|
59
100
|
choices: e.enumeratedValues ?? [],
|
|
60
101
|
colType: e.typeInfo?.type || null,
|
|
61
102
|
limitTags: 3,
|
|
62
103
|
clearValue: e.isRequired ? null : void 0
|
|
63
104
|
})
|
|
64
105
|
),
|
|
65
|
-
boolean: (e) =>
|
|
106
|
+
boolean: (e) => l(
|
|
66
107
|
e,
|
|
67
|
-
|
|
108
|
+
a({
|
|
68
109
|
choices: [!0, !1],
|
|
69
110
|
colType: "boolean",
|
|
70
111
|
clearValue: e.isRequired ? null : void 0
|
|
71
112
|
})
|
|
72
113
|
),
|
|
73
|
-
number: (e) =>
|
|
74
|
-
enumerated: (e) =>
|
|
114
|
+
number: (e) => l(e, T),
|
|
115
|
+
enumerated: (e) => l(
|
|
75
116
|
e,
|
|
76
|
-
|
|
117
|
+
a({
|
|
77
118
|
choices: e.enumeratedValues ?? [],
|
|
78
119
|
colType: e.typeInfo?.type || null,
|
|
79
120
|
clearValue: e.isRequired ? null : void 0
|
|
80
121
|
})
|
|
81
122
|
),
|
|
82
123
|
"date-time": (e) => {
|
|
83
|
-
const t =
|
|
124
|
+
const t = c({
|
|
84
125
|
colType: e.typeInfo?.type || null
|
|
85
|
-
}),
|
|
126
|
+
}), n = {
|
|
86
127
|
showPinIcon: e.showPinIcon,
|
|
87
128
|
hasDescription: !!e.description
|
|
88
|
-
},
|
|
129
|
+
}, r = e.customWidth ?? s(
|
|
89
130
|
e.columnName,
|
|
90
131
|
{
|
|
91
132
|
type: e.typeInfo ?? void 0,
|
|
92
133
|
isRequired: e.isRequired
|
|
93
134
|
},
|
|
94
|
-
|
|
135
|
+
n
|
|
95
136
|
);
|
|
96
137
|
return {
|
|
97
|
-
...
|
|
98
|
-
minWidth:
|
|
99
|
-
basis:
|
|
138
|
+
...l(e, t),
|
|
139
|
+
minWidth: r,
|
|
140
|
+
basis: r
|
|
100
141
|
};
|
|
101
142
|
},
|
|
102
143
|
text: (e) => {
|
|
103
|
-
const t =
|
|
144
|
+
const t = h({
|
|
104
145
|
continuousUpdates: !1,
|
|
105
146
|
deletedValue: void 0,
|
|
106
|
-
parseUserInput:
|
|
147
|
+
parseUserInput: v(e.isRequired)
|
|
107
148
|
});
|
|
108
149
|
return {
|
|
109
|
-
...
|
|
150
|
+
...l(e, t),
|
|
110
151
|
cellClassName: "MuiInputBase-input"
|
|
111
152
|
};
|
|
112
153
|
}
|
|
113
154
|
};
|
|
114
|
-
function
|
|
155
|
+
function q(e, t) {
|
|
115
156
|
return e ? e.format === "date-time" ? "date-time" : e.isArray ? "multipleEnum" : e.type === "boolean" ? "boolean" : e.type === "number" || e.type === "integer" ? "number" : t && t.length > 0 ? "enumerated" : "text" : t && t.length > 0 ? "enumerated" : "text";
|
|
116
157
|
}
|
|
117
|
-
function
|
|
118
|
-
const t =
|
|
119
|
-
return
|
|
158
|
+
function U(e) {
|
|
159
|
+
const t = q(e.typeInfo, e.enumeratedValues);
|
|
160
|
+
return N[t](e);
|
|
120
161
|
}
|
|
121
162
|
export {
|
|
122
|
-
|
|
163
|
+
U as createColumn
|
|
123
164
|
};
|
|
124
165
|
//# sourceMappingURL=columnFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnFactory.js","sources":["../../../../src/components/DataGrid/utils/columnFactory.tsx"],"sourcesContent":["import { dateTimeColumn } from '@/components/DataGrid/columns/DateTimeColumn'\nimport { EnumeratedValue } from '@/utils/jsonschema/getEnumeratedValues'\nimport { FlatTypeInfo } from '@/utils/jsonschema/getType'\nimport {\n Column,\n createTextColumn,\n floatColumn,\n keyColumn,\n} from '@sage-bionetworks/react-datasheet-grid'\nimport { autocompleteColumn } from '../columns/AutocompleteColumn'\nimport { autocompleteMultipleEnumColumn } from '../columns/AutocompleteMultipleEnumColumn'\nimport {\n calculateDefaultColumnWidth,\n HeaderOptions,\n} from './calculateColumnWidth'\nimport { ColumnHeaderWithTooltip } from '../components/ColumnHeaderWithTooltip'\n\ntype ColumnConfig = {\n columnName: string\n description?: string\n disabled?: boolean\n typeInfo: FlatTypeInfo | null\n enumeratedValues: EnumeratedValue[] | string[] | null\n isRequired: boolean\n customWidth?: number\n showPinIcon?: boolean\n isPinned?: boolean\n onTogglePin?: () => void\n}\n\nfunction getHeaderClassName(isRequired: boolean): string {\n return isRequired ? 'header-cell-required' : 'header-cell'\n}\n\nfunction createDeleteValue(columnName: string, isRequired?: boolean) {\n return ({ rowData }: { rowData: Record<string, unknown> }) => ({\n ...rowData,\n [columnName]: isRequired ? null : undefined,\n })\n}\n\nfunction createParseUserInput(isRequired?: boolean) {\n return (value: string) => {\n const trimmedValue = value.trim()\n if (trimmedValue === '') {\n return isRequired ? null : undefined\n }\n return trimmedValue\n }\n}\n\nfunction createBaseColumn(config: ColumnConfig, columnImpl: any) {\n const headerOptions: HeaderOptions = {\n showPinIcon: config.showPinIcon,\n hasDescription: !!config.description,\n }\n\n const width =\n config.customWidth ??\n calculateDefaultColumnWidth(\n config.columnName,\n undefined, // propertyInfo is not available here, passed from higher level\n headerOptions,\n )\n\n return {\n ...keyColumn(config.columnName, columnImpl),\n title: (\n <ColumnHeaderWithTooltip\n name={config.columnName}\n description={config.description}\n showPinIcon={config.showPinIcon}\n isPinned={config.isPinned}\n onTogglePin={config.onTogglePin}\n />\n ),\n headerClassName: getHeaderClassName(config.isRequired),\n minWidth: width,\n basis: width,\n grow: 0,\n shrink: 0,\n disabled: config.disabled,\n deleteValue: createDeleteValue(config.columnName, config.isRequired),\n stickyLeft: config.isPinned,\n }\n}\n\nconst COLUMN_FACTORIES = {\n multipleEnum: (config: ColumnConfig) => {\n return createBaseColumn(\n config,\n autocompleteMultipleEnumColumn({\n choices: config.enumeratedValues ?? [],\n colType: config.typeInfo?.type || null,\n limitTags: 3,\n clearValue: config.isRequired ? null : undefined,\n }),\n )\n },\n\n boolean: (config: ColumnConfig) => {\n return createBaseColumn(\n config,\n autocompleteColumn({\n choices: [true, false],\n colType: 'boolean',\n clearValue: config.isRequired ? null : undefined,\n }),\n )\n },\n\n number: (config: ColumnConfig) => {\n return createBaseColumn(config, floatColumn)\n },\n\n enumerated: (config: ColumnConfig) => {\n return createBaseColumn(\n config,\n autocompleteColumn({\n choices: config.enumeratedValues ?? [],\n colType: config.typeInfo?.type || null,\n clearValue: config.isRequired ? null : undefined,\n }),\n )\n },\n\n 'date-time': (config: ColumnConfig) => {\n const columnImpl = dateTimeColumn({\n colType: config.typeInfo?.type || null,\n })\n\n // Date-time needs special width calculation\n const headerOptions: HeaderOptions = {\n showPinIcon: config.showPinIcon,\n hasDescription: !!config.description,\n }\n\n const width =\n config.customWidth ??\n calculateDefaultColumnWidth(\n config.columnName,\n {\n type: config.typeInfo ?? undefined,\n isRequired: config.isRequired,\n enumeratedValues: null,\n },\n headerOptions,\n )\n\n return {\n ...createBaseColumn(config, columnImpl),\n minWidth: width,\n basis: width,\n }\n },\n\n text: (config: ColumnConfig) => {\n const columnImpl = createTextColumn({\n continuousUpdates: false,\n deletedValue: undefined,\n parseUserInput: createParseUserInput(config.isRequired),\n })\n\n return {\n ...createBaseColumn(config, columnImpl),\n cellClassName: 'MuiInputBase-input',\n }\n },\n}\n\nfunction getColumnType(\n typeInfo: FlatTypeInfo | null,\n enumeratedValues?: EnumeratedValue[] | string[] | null,\n): keyof typeof COLUMN_FACTORIES {\n if (!typeInfo) {\n return enumeratedValues && enumeratedValues.length > 0\n ? 'enumerated'\n : 'text'\n }\n\n if (typeInfo.format === 'date-time') {\n return 'date-time'\n }\n\n // Handle arrays - check if it's an array of enums\n if (typeInfo.isArray) {\n return 'multipleEnum'\n }\n\n if (typeInfo.type === 'boolean') {\n return 'boolean'\n }\n\n if (typeInfo.type === 'number' || typeInfo.type === 'integer') {\n return 'number'\n }\n\n if (enumeratedValues && enumeratedValues.length > 0) {\n return 'enumerated'\n }\n\n return 'text'\n}\n\nexport function createColumn(config: ColumnConfig): Column {\n const columnType = getColumnType(config.typeInfo, config.enumeratedValues)\n return COLUMN_FACTORIES[columnType](config)\n}\n"],"names":["getHeaderClassName","isRequired","createDeleteValue","columnName","rowData","createParseUserInput","value","trimmedValue","createBaseColumn","config","columnImpl","headerOptions","width","calculateDefaultColumnWidth","keyColumn","jsx","ColumnHeaderWithTooltip","COLUMN_FACTORIES","autocompleteMultipleEnumColumn","autocompleteColumn","floatColumn","dateTimeColumn","createTextColumn","getColumnType","typeInfo","enumeratedValues","createColumn","columnType"],"mappings":";;;;;;;AA8BA,SAASA,EAAmBC,GAA6B;AACvD,SAAOA,IAAa,yBAAyB;AAC/C;AAEA,SAASC,EAAkBC,GAAoBF,GAAsB;AACnE,SAAO,CAAC,EAAE,SAAAG,SAAqD;AAAA,IAC7D,GAAGA;AAAA,IACH,CAACD,CAAU,GAAGF,IAAa,OAAO;AAAA,EAAA;AAEtC;AAEA,SAASI,EAAqBJ,GAAsB;AAClD,SAAO,CAACK,MAAkB;AACxB,UAAMC,IAAeD,EAAM,KAAA;AAC3B,WAAIC,MAAiB,KACZN,IAAa,OAAO,SAEtBM;AAAA,EACT;AACF;AAEA,SAASC,EAAiBC,GAAsBC,GAAiB;AAC/D,QAAMC,IAA+B;AAAA,IACnC,aAAaF,EAAO;AAAA,IACpB,gBAAgB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nFactory.tsx"],"sourcesContent":["import { dateTimeColumn } from '@/components/DataGrid/columns/DateTimeColumn'\nimport { EnumeratedValue } from '@/utils/jsonschema/getEnumeratedValues'\nimport { FlatTypeInfo } from '@/utils/jsonschema/getType'\nimport {\n CellComponent,\n CellProps,\n Column,\n createTextColumn,\n floatColumn,\n keyColumn,\n} from '@sage-bionetworks/react-datasheet-grid'\nimport { autocompleteColumn } from '../columns/AutocompleteColumn'\nimport { autocompleteMultipleEnumColumn } from '../columns/AutocompleteMultipleEnumColumn'\nimport {\n calculateDefaultColumnWidth,\n HeaderOptions,\n} from './calculateColumnWidth'\nimport { ColumnHeaderWithTooltip } from '../components/ColumnHeaderWithTooltip'\nimport { Tooltip } from '@mui/material'\nimport { SmartToyTwoTone } from '@mui/icons-material'\nimport type { DataGridRow } from '../DataGridTypes'\n\n/**\n * Wraps a column cell component to overlay change-attribution indicators:\n * - Non-agent changes: invisible 7×7px tooltip trigger over the CSS triangle (top-right).\n * - Agent changes: robot icon (1em, vertically centered on the right) with no triangle.\n */\nfunction withChangeIndicatorTooltip<T, C>(\n OriginalComponent: CellComponent<T, C>,\n colName: string,\n): CellComponent<T, C> {\n function CellWithTooltip(props: CellProps<T, C>) {\n const changeInfo = (props.rowData as DataGridRow).__cellChangeInfo?.[\n colName\n ]\n const isAgent =\n changeInfo?.category === 'own-agent' ||\n changeInfo?.category === 'other-agent'\n return (\n <>\n <OriginalComponent {...props} />\n {changeInfo && !isAgent && (\n <Tooltip title={changeInfo.tooltipText} placement=\"top-end\">\n <div\n style={{\n position: 'absolute',\n top: 0,\n right: 0,\n width: 7,\n height: 7,\n zIndex: 21,\n pointerEvents: 'auto',\n }}\n />\n </Tooltip>\n )}\n {isAgent && !props.focus && (\n <Tooltip title={changeInfo.tooltipText} placement=\"left\">\n <SmartToyTwoTone\n sx={{\n fontSize: '1em',\n alignSelf: 'center',\n flexShrink: 0,\n mr: 0.5,\n zIndex: 21,\n pointerEvents: 'auto',\n color: 'grey.400',\n backgroundColor: 'transparent',\n }}\n />\n </Tooltip>\n )}\n </>\n )\n }\n CellWithTooltip.displayName = `CellWithTooltip(${colName})`\n return CellWithTooltip\n}\n\ntype ColumnConfig = {\n columnName: string\n description?: string\n disabled?: boolean\n typeInfo: FlatTypeInfo | null\n enumeratedValues: EnumeratedValue[] | string[] | null\n isRequired: boolean\n customWidth?: number\n showPinIcon?: boolean\n isPinned?: boolean\n onTogglePin?: () => void\n}\n\nfunction getHeaderClassName(isRequired: boolean): string {\n return isRequired ? 'header-cell-required' : 'header-cell'\n}\n\nfunction createDeleteValue(columnName: string, isRequired?: boolean) {\n return ({ rowData }: { rowData: Record<string, unknown> }) => ({\n ...rowData,\n [columnName]: isRequired ? null : undefined,\n })\n}\n\nfunction createParseUserInput(isRequired?: boolean) {\n return (value: string) => {\n const trimmedValue = value.trim()\n if (trimmedValue === '') {\n return isRequired ? null : undefined\n }\n return trimmedValue\n }\n}\n\nfunction createBaseColumn(config: ColumnConfig, columnImpl: any) {\n const headerOptions: HeaderOptions = {\n showPinIcon: config.showPinIcon,\n hasDescription: !!config.description,\n }\n\n const width =\n config.customWidth ??\n calculateDefaultColumnWidth(\n config.columnName,\n undefined, // propertyInfo is not available here, passed from higher level\n headerOptions,\n )\n\n const keyed = keyColumn(config.columnName, columnImpl)\n return {\n ...keyed,\n component: withChangeIndicatorTooltip(keyed.component!, config.columnName),\n title: (\n <ColumnHeaderWithTooltip\n name={config.columnName}\n description={config.description}\n showPinIcon={config.showPinIcon}\n isPinned={config.isPinned}\n onTogglePin={config.onTogglePin}\n />\n ),\n headerClassName: getHeaderClassName(config.isRequired),\n minWidth: width,\n basis: width,\n grow: 0,\n shrink: 0,\n disabled: config.disabled,\n deleteValue: createDeleteValue(config.columnName, config.isRequired),\n stickyLeft: config.isPinned,\n }\n}\n\nconst COLUMN_FACTORIES = {\n multipleEnum: (config: ColumnConfig) => {\n return createBaseColumn(\n config,\n autocompleteMultipleEnumColumn({\n choices: config.enumeratedValues ?? [],\n colType: config.typeInfo?.type || null,\n limitTags: 3,\n clearValue: config.isRequired ? null : undefined,\n }),\n )\n },\n\n boolean: (config: ColumnConfig) => {\n return createBaseColumn(\n config,\n autocompleteColumn({\n choices: [true, false],\n colType: 'boolean',\n clearValue: config.isRequired ? null : undefined,\n }),\n )\n },\n\n number: (config: ColumnConfig) => {\n return createBaseColumn(config, floatColumn)\n },\n\n enumerated: (config: ColumnConfig) => {\n return createBaseColumn(\n config,\n autocompleteColumn({\n choices: config.enumeratedValues ?? [],\n colType: config.typeInfo?.type || null,\n clearValue: config.isRequired ? null : undefined,\n }),\n )\n },\n\n 'date-time': (config: ColumnConfig) => {\n const columnImpl = dateTimeColumn({\n colType: config.typeInfo?.type || null,\n })\n\n // Date-time needs special width calculation\n const headerOptions: HeaderOptions = {\n showPinIcon: config.showPinIcon,\n hasDescription: !!config.description,\n }\n\n const width =\n config.customWidth ??\n calculateDefaultColumnWidth(\n config.columnName,\n {\n type: config.typeInfo ?? undefined,\n isRequired: config.isRequired,\n enumeratedValues: null,\n },\n headerOptions,\n )\n\n return {\n ...createBaseColumn(config, columnImpl),\n minWidth: width,\n basis: width,\n }\n },\n\n text: (config: ColumnConfig) => {\n const columnImpl = createTextColumn({\n continuousUpdates: false,\n deletedValue: undefined,\n parseUserInput: createParseUserInput(config.isRequired),\n })\n\n return {\n ...createBaseColumn(config, columnImpl),\n cellClassName: 'MuiInputBase-input',\n }\n },\n}\n\nfunction getColumnType(\n typeInfo: FlatTypeInfo | null,\n enumeratedValues?: EnumeratedValue[] | string[] | null,\n): keyof typeof COLUMN_FACTORIES {\n if (!typeInfo) {\n return enumeratedValues && enumeratedValues.length > 0\n ? 'enumerated'\n : 'text'\n }\n\n if (typeInfo.format === 'date-time') {\n return 'date-time'\n }\n\n // Handle arrays - check if it's an array of enums\n if (typeInfo.isArray) {\n return 'multipleEnum'\n }\n\n if (typeInfo.type === 'boolean') {\n return 'boolean'\n }\n\n if (typeInfo.type === 'number' || typeInfo.type === 'integer') {\n return 'number'\n }\n\n if (enumeratedValues && enumeratedValues.length > 0) {\n return 'enumerated'\n }\n\n return 'text'\n}\n\nexport function createColumn(config: ColumnConfig): Column {\n const columnType = getColumnType(config.typeInfo, config.enumeratedValues)\n return COLUMN_FACTORIES[columnType](config)\n}\n"],"names":["withChangeIndicatorTooltip","OriginalComponent","colName","CellWithTooltip","props","changeInfo","isAgent","jsxs","Fragment","jsx","Tooltip","SmartToyTwoTone","getHeaderClassName","isRequired","createDeleteValue","columnName","rowData","createParseUserInput","value","trimmedValue","createBaseColumn","config","columnImpl","headerOptions","width","calculateDefaultColumnWidth","keyed","keyColumn","ColumnHeaderWithTooltip","COLUMN_FACTORIES","autocompleteMultipleEnumColumn","autocompleteColumn","floatColumn","dateTimeColumn","createTextColumn","getColumnType","typeInfo","enumeratedValues","createColumn","columnType"],"mappings":";;;;;;;;;AA2BA,SAASA,EACPC,GACAC,GACqB;AACrB,WAASC,EAAgBC,GAAwB;AAC/C,UAAMC,IAAcD,EAAM,QAAwB,mBAChDF,CACF,GACMI,IACJD,GAAY,aAAa,eACzBA,GAAY,aAAa;AAC3B,WACE,gBAAAE,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAC,EAACR,GAAA,EAAmB,GAAGG,GAAO;AAAA,MAC7BC,KAAc,CAACC,KACd,gBAAAG,EAACC,KAAQ,OAAOL,EAAW,aAAa,WAAU,WAChD,UAAA,gBAAAI;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,OAAO;AAAA,YACL,UAAU;AAAA,YACV,KAAK;AAAA,YACL,OAAO;AAAA,YACP,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,QAAQ;AAAA,YACR,eAAe;AAAA,UAAA;AAAA,QACjB;AAAA,MAAA,GAEJ;AAAA,MAEDH,KAAW,CAACF,EAAM,SACjB,gBAAAK,EAACC,KAAQ,OAAOL,EAAW,aAAa,WAAU,QAChD,UAAA,gBAAAI;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,IAAI;AAAA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AO;AAAA,MACL,GAAGH,EAAiBC,GAAQC,CAAU;AAAA,MACtC,UAAUE;AAAA,MACV,OAAOA;AAAA,IAAA;AAAA,EAEX;AAAA,EAEA,MAAM,CAACH,MAAyB;AAC9B,UAAMC,IAAaY,EAAiB;AAAA,MAClC,mBAAmB;AAAA,MACnB,cAAc;AAAA,MACd,gBAAgBjB,EAAqBI,EAAO,UAAU;AAAA,IAAA,CACvD;AAED,WAAO;AAAA,MACL,GAAGD,EAAiBC,GAAQC,CAAU;AAAA,MACtC,eAAe;AAAA,IAAA;AAAA,EAEnB;AACF;AAEA,SAASa,EACPC,GACAC,GAC+B;AAC/B,SAAKD,IAMDA,EAAS,WAAW,cACf,cAILA,EAAS,UACJ,iBAGLA,EAAS,SAAS,YACb,YAGLA,EAAS,SAAS,YAAYA,EAAS,SAAS,YAC3C,WAGLC,KAAoBA,EAAiB,SAAS,IACzC,eAGF,SA1BEA,KAAoBA,EAAiB,SAAS,IACjD,eACA;AAyBR;AAEO,SAASC,EAAajB,GAA8B;AACzD,QAAMkB,IAAaJ,EAAcd,EAAO,UAAUA,EAAO,gBAAgB;AACzE,SAAOQ,EAAiBU,CAAU,EAAElB,CAAM;AAC5C;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DataGridRow, GridModel, GridModelSnapshot } from '../DataGridTypes';
|
|
2
|
+
import type { ReplicaUserInfo } from '../hooks/useGridReplicaUsers';
|
|
3
|
+
/**
|
|
4
|
+
* Enriches each row in `rows` with a `__cellChangeInfo` map that records the
|
|
5
|
+
* change category and tooltip text for every cell whose last author is present
|
|
6
|
+
* in `replicaUserMap`.
|
|
7
|
+
*
|
|
8
|
+
* Short-circuits (returning the original array reference) when the model or
|
|
9
|
+
* snapshot is absent, or when no replica attribution data is available yet.
|
|
10
|
+
* Rows with no attributed cells are returned by reference to preserve React
|
|
11
|
+
* referential equality.
|
|
12
|
+
*/
|
|
13
|
+
export declare function enrichRowsWithChangeInfo(rows: DataGridRow[], model: GridModel | null, modelSnapshot: GridModelSnapshot | null, replicaUserMap: ReadonlyMap<number, ReplicaUserInfo>): DataGridRow[];
|
|
14
|
+
//# sourceMappingURL=enrichRowsWithChangeInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enrichRowsWithChangeInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/utils/enrichRowsWithChangeInfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EACX,SAAS,EACT,iBAAiB,EAClB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAInE;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,WAAW,EAAE,EACnB,KAAK,EAAE,SAAS,GAAG,IAAI,EACvB,aAAa,EAAE,iBAAiB,GAAG,IAAI,EACvC,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,GACnD,WAAW,EAAE,CA4Bf"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getCellAuthorSid as s } from "./getCellAuthorSid.js";
|
|
2
|
+
import { getChangeTooltipText as a } from "./getChangeTooltipText.js";
|
|
3
|
+
function T(e, o, r, c) {
|
|
4
|
+
if (!o || !r || c.size === 0) return e;
|
|
5
|
+
const { columnNames: l, columnOrder: h } = r;
|
|
6
|
+
return e.map((i, m) => {
|
|
7
|
+
const t = {};
|
|
8
|
+
return h.forEach((f) => {
|
|
9
|
+
const u = l[f];
|
|
10
|
+
if (!u) return;
|
|
11
|
+
const g = s(o, m, f);
|
|
12
|
+
if (g === null) return;
|
|
13
|
+
const n = c.get(g);
|
|
14
|
+
n && (t[u] = {
|
|
15
|
+
category: n.category,
|
|
16
|
+
tooltipText: a(n)
|
|
17
|
+
});
|
|
18
|
+
}), Object.keys(t).length > 0 ? { ...i, __cellChangeInfo: t } : i;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
T as enrichRowsWithChangeInfo
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=enrichRowsWithChangeInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enrichRowsWithChangeInfo.js","sources":["../../../../src/components/DataGrid/utils/enrichRowsWithChangeInfo.ts"],"sourcesContent":["import type {\n CellChangeInfo,\n DataGridRow,\n GridModel,\n GridModelSnapshot,\n} from '../DataGridTypes'\nimport type { ReplicaUserInfo } from '../hooks/useGridReplicaUsers'\nimport { getCellAuthorSid } from './getCellAuthorSid'\nimport { getChangeTooltipText } from './getChangeTooltipText'\n\n/**\n * Enriches each row in `rows` with a `__cellChangeInfo` map that records the\n * change category and tooltip text for every cell whose last author is present\n * in `replicaUserMap`.\n *\n * Short-circuits (returning the original array reference) when the model or\n * snapshot is absent, or when no replica attribution data is available yet.\n * Rows with no attributed cells are returned by reference to preserve React\n * referential equality.\n */\nexport function enrichRowsWithChangeInfo(\n rows: DataGridRow[],\n model: GridModel | null,\n modelSnapshot: GridModelSnapshot | null,\n replicaUserMap: ReadonlyMap<number, ReplicaUserInfo>,\n): DataGridRow[] {\n if (!model || !modelSnapshot || replicaUserMap.size === 0) return rows\n\n const { columnNames, columnOrder } = modelSnapshot\n\n return rows.map((row, rowIndex) => {\n const cellChangeInfo: Record<string, CellChangeInfo> = {}\n\n columnOrder.forEach((colArrayIndex: number) => {\n const columnName = columnNames[colArrayIndex]\n if (!columnName) return\n\n const sid = getCellAuthorSid(model, rowIndex, colArrayIndex)\n if (sid === null) return\n\n const info = replicaUserMap.get(sid)\n if (!info) return\n\n cellChangeInfo[columnName] = {\n category: info.category,\n tooltipText: getChangeTooltipText(info),\n }\n })\n\n return Object.keys(cellChangeInfo).length > 0\n ? { ...row, __cellChangeInfo: cellChangeInfo }\n : row\n })\n}\n"],"names":["enrichRowsWithChangeInfo","rows","model","modelSnapshot","replicaUserMap","columnNames","columnOrder","row","rowIndex","cellChangeInfo","colArrayIndex","columnName","sid","getCellAuthorSid","info","getChangeTooltipText"],"mappings":";;AAoBO,SAASA,EACdC,GACAC,GACAC,GACAC,GACe;AACf,MAAI,CAACF,KAAS,CAACC,KAAiBC,EAAe,SAAS,EAAG,QAAOH;AAElE,QAAM,EAAE,aAAAI,GAAa,aAAAC,EAAA,IAAgBH;AAErC,SAAOF,EAAK,IAAI,CAACM,GAAKC,MAAa;AACjC,UAAMC,IAAiD,CAAA;AAEvD,WAAAH,EAAY,QAAQ,CAACI,MAA0B;AAC7C,YAAMC,IAAaN,EAAYK,CAAa;AAC5C,UAAI,CAACC,EAAY;AAEjB,YAAMC,IAAMC,EAAiBX,GAAOM,GAAUE,CAAa;AAC3D,UAAIE,MAAQ,KAAM;AAElB,YAAME,IAAOV,EAAe,IAAIQ,CAAG;AACnC,MAAKE,MAELL,EAAeE,CAAU,IAAI;AAAA,QAC3B,UAAUG,EAAK;AAAA,QACf,aAAaC,EAAqBD,CAAI;AAAA,MAAA;AAAA,IAE1C,CAAC,GAEM,OAAO,KAAKL,CAAc,EAAE,SAAS,IACxC,EAAE,GAAGF,GAAK,kBAAkBE,EAAA,IAC5BF;AAAA,EACN,CAAC;AACH;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GridModel } from '@/components/DataGrid/DataGridTypes';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the sid (replica ID) of the last writer for a given cell in the CRDT
|
|
4
|
+
* model, or null if the cell is unreachable (e.g. out-of-bounds row/column).
|
|
5
|
+
*/
|
|
6
|
+
export declare function getCellAuthorSid(model: GridModel, rowIndex: number, colIndex: number): number | null;
|
|
7
|
+
//# sourceMappingURL=getCellAuthorSid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCellAuthorSid.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/utils/getCellAuthorSid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAEpE;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CAOf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCellAuthorSid.js","sources":["../../../../src/components/DataGrid/utils/getCellAuthorSid.ts"],"sourcesContent":["import type { GridModel } from '@/components/DataGrid/DataGridTypes'\n\n/**\n * Returns the sid (replica ID) of the last writer for a given cell in the CRDT\n * model, or null if the cell is unreachable (e.g. out-of-bounds row/column).\n */\nexport function getCellAuthorSid(\n model: GridModel,\n rowIndex: number,\n colIndex: number,\n): number | null {\n try {\n return model.api.vec(['rows', String(rowIndex), 'data']).get(colIndex).node\n .id.sid\n } catch {\n return null\n }\n}\n"],"names":["getCellAuthorSid","model","rowIndex","colIndex"],"mappings":"AAMO,SAASA,EACdC,GACAC,GACAC,GACe;AACf,MAAI;AACF,WAAOF,EAAM,IAAI,IAAI,CAAC,QAAQ,OAAOC,CAAQ,GAAG,MAAM,CAAC,EAAE,IAAIC,CAAQ,EAAE,KACpE,GAAG;AAAA,EACR,QAAQ;AACN,WAAO;AAAA,EACT;AACF;"}
|
|
@@ -9,7 +9,6 @@ export declare function getCellClassName(params: {
|
|
|
9
9
|
selectedRowIndex: number | null;
|
|
10
10
|
lastSelection?: SelectionWithId | null;
|
|
11
11
|
colValues?: Column[];
|
|
12
|
-
/** Remote replica selection ranges to visualise as tinted backgrounds. */
|
|
13
12
|
remoteSelections?: readonly RemoteSelection[];
|
|
14
13
|
}): string | undefined;
|
|
15
14
|
//# sourceMappingURL=getCellClassName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCellClassName.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/utils/getCellClassName.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAEnE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,OAAO,EAAE,WAAW,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,aAAa,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;IACtC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,
|
|
1
|
+
{"version":3,"file":"getCellClassName.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/utils/getCellClassName.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAEnE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,OAAO,EAAE,WAAW,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,aAAa,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;IACtC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,gBAAgB,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;CAC9C,GAAG,MAAM,GAAG,SAAS,CA+DrB"}
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
1
|
+
import w from "classnames";
|
|
2
|
+
function v(f) {
|
|
3
3
|
const {
|
|
4
|
-
rowData:
|
|
5
|
-
rowIndex:
|
|
4
|
+
rowData: t,
|
|
5
|
+
rowIndex: n,
|
|
6
6
|
columnId: e,
|
|
7
|
-
selectedRowIndex:
|
|
8
|
-
lastSelection:
|
|
9
|
-
colValues:
|
|
10
|
-
remoteSelections:
|
|
11
|
-
} =
|
|
12
|
-
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
selectedRowIndex: u,
|
|
8
|
+
lastSelection: s,
|
|
9
|
+
colValues: c,
|
|
10
|
+
remoteSelections: i
|
|
11
|
+
} = f, h = u === n, a = t.__cellValidationResults, I = a && e && a.has(e), l = [];
|
|
12
|
+
h && l.push("cell-row-selected");
|
|
13
|
+
let d = !1;
|
|
14
|
+
s && e && c && (d = n >= s.min.row && n <= s.max.row && c.findIndex((o) => o.id === e) >= s.min.col && c.findIndex((o) => o.id === e) <= s.max.col, d && l.push("cell-selected")), I && l.push("cell-invalid");
|
|
15
|
+
const r = e ? t.__cellChangeInfo?.[e] : void 0;
|
|
16
|
+
if (r && l.push(`cell-changed--${r.category}`), i && e)
|
|
17
|
+
for (const o of i) {
|
|
18
|
+
const { minRow: x, maxRow: p, columnNames: m } = o.range;
|
|
19
|
+
if (!(n < x || n > p) && !(m !== void 0 && !m.has(e))) {
|
|
18
20
|
l.push("cell-remote-selected"), l.push(`cell-remote-selected--color-${o.colorIndex}`);
|
|
19
21
|
break;
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
|
-
return l.length ?
|
|
24
|
+
return l.length ? w(l) : void 0;
|
|
23
25
|
}
|
|
24
26
|
export {
|
|
25
|
-
|
|
27
|
+
v as getCellClassName
|
|
26
28
|
};
|
|
27
29
|
//# sourceMappingURL=getCellClassName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCellClassName.js","sources":["../../../../src/components/DataGrid/utils/getCellClassName.ts"],"sourcesContent":["import classNames from 'classnames'\nimport { DataGridRow } from '../DataGridTypes'\nimport { SelectionWithId } from '@sage-bionetworks/react-datasheet-grid'\nimport { Column } from '@sage-bionetworks/react-datasheet-grid'\nimport type { RemoteSelection } from '../hooks/useRemoteSelections'\n\nexport function getCellClassName(params: {\n rowData: DataGridRow\n rowIndex: number\n columnId?: string\n selectedRowIndex: number | null\n lastSelection?: SelectionWithId | null\n colValues?: Column[]\n
|
|
1
|
+
{"version":3,"file":"getCellClassName.js","sources":["../../../../src/components/DataGrid/utils/getCellClassName.ts"],"sourcesContent":["import classNames from 'classnames'\nimport { DataGridRow } from '../DataGridTypes'\nimport { SelectionWithId } from '@sage-bionetworks/react-datasheet-grid'\nimport { Column } from '@sage-bionetworks/react-datasheet-grid'\nimport type { RemoteSelection } from '../hooks/useRemoteSelections'\n\nexport function getCellClassName(params: {\n rowData: DataGridRow\n rowIndex: number\n columnId?: string\n selectedRowIndex: number | null\n lastSelection?: SelectionWithId | null\n colValues?: Column[]\n remoteSelections?: readonly RemoteSelection[]\n}): string | undefined {\n const {\n rowData,\n rowIndex,\n columnId,\n selectedRowIndex,\n lastSelection,\n colValues,\n remoteSelections,\n } = params\n\n const isSelected = selectedRowIndex === rowIndex\n const cellValidationResults = rowData.__cellValidationResults\n const isInvalid =\n cellValidationResults && columnId && cellValidationResults.has(columnId)\n\n const classList: string[] = []\n\n if (isSelected) {\n classList.push('cell-row-selected')\n }\n\n // Add selection styling based on lastSelection\n let isInSelection = false\n if (lastSelection && columnId && colValues) {\n isInSelection =\n rowIndex >= lastSelection.min.row &&\n rowIndex <= lastSelection.max.row &&\n colValues.findIndex(col => col.id === columnId) >=\n lastSelection.min.col &&\n colValues.findIndex(col => col.id === columnId) <= lastSelection.max.col\n\n if (isInSelection) {\n classList.push('cell-selected')\n }\n }\n\n if (isInvalid) {\n classList.push('cell-invalid')\n }\n\n // ── Cell change indicator ─────────────────────────────────────────────────\n const cellChangeInfo = columnId\n ? rowData.__cellChangeInfo?.[columnId]\n : undefined\n if (cellChangeInfo) {\n classList.push(`cell-changed--${cellChangeInfo.category}`)\n }\n\n // ── Remote selection tint ─────────────────────────────────────────────────\n if (remoteSelections && columnId) {\n for (const remote of remoteSelections) {\n const { minRow, maxRow, columnNames: remoteColumnNames } = remote.range\n if (rowIndex < minRow || rowIndex > maxRow) continue\n if (remoteColumnNames !== undefined && !remoteColumnNames.has(columnId))\n continue\n classList.push('cell-remote-selected')\n classList.push(`cell-remote-selected--color-${remote.colorIndex}`)\n break // apply the first matching remote selection only\n }\n }\n\n return classList.length ? classNames(classList) : undefined\n}\n"],"names":["getCellClassName","params","rowData","rowIndex","columnId","selectedRowIndex","lastSelection","colValues","remoteSelections","isSelected","cellValidationResults","isInvalid","classList","isInSelection","col","cellChangeInfo","remote","minRow","maxRow","remoteColumnNames","classNames"],"mappings":";AAMO,SAASA,EAAiBC,GAQV;AACrB,QAAM;AAAA,IACJ,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,kBAAAC;AAAA,EAAA,IACEP,GAEEQ,IAAaJ,MAAqBF,GAClCO,IAAwBR,EAAQ,yBAChCS,IACJD,KAAyBN,KAAYM,EAAsB,IAAIN,CAAQ,GAEnEQ,IAAsB,CAAA;AAE5B,EAAIH,KACFG,EAAU,KAAK,mBAAmB;AAIpC,MAAIC,IAAgB;AACpB,EAAIP,KAAiBF,KAAYG,MAC/BM,IACEV,KAAYG,EAAc,IAAI,OAC9BH,KAAYG,EAAc,IAAI,OAC9BC,EAAU,UAAU,CAAAO,MAAOA,EAAI,OAAOV,CAAQ,KAC5CE,EAAc,IAAI,OACpBC,EAAU,UAAU,CAAAO,MAAOA,EAAI,OAAOV,CAAQ,KAAKE,EAAc,IAAI,KAEnEO,KACFD,EAAU,KAAK,eAAe,IAI9BD,KACFC,EAAU,KAAK,cAAc;AAI/B,QAAMG,IAAiBX,IACnBF,EAAQ,mBAAmBE,CAAQ,IACnC;AAMJ,MALIW,KACFH,EAAU,KAAK,iBAAiBG,EAAe,QAAQ,EAAE,GAIvDP,KAAoBJ;AACtB,eAAWY,KAAUR,GAAkB;AACrC,YAAM,EAAE,QAAAS,GAAQ,QAAAC,GAAQ,aAAaC,EAAA,IAAsBH,EAAO;AAClE,UAAI,EAAAb,IAAWc,KAAUd,IAAWe,MAChC,EAAAC,MAAsB,UAAa,CAACA,EAAkB,IAAIf,CAAQ,IAEtE;AAAA,QAAAQ,EAAU,KAAK,sBAAsB,GACrCA,EAAU,KAAK,+BAA+BI,EAAO,UAAU,EAAE;AACjE;AAAA;AAAA,IACF;AAGF,SAAOJ,EAAU,SAASQ,EAAWR,CAAS,IAAI;AACpD;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReplicaUserInfo } from '../hooks/useGridReplicaUsers';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a human-readable tooltip string describing who last changed a cell,
|
|
4
|
+
* based on the replica's category and (if available) the user's profile.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getChangeTooltipText(info: ReplicaUserInfo): string;
|
|
7
|
+
//# sourceMappingURL=getChangeTooltipText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getChangeTooltipText.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/utils/getChangeTooltipText.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAEnE;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAmBlE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function a(t) {
|
|
2
|
+
switch (t.category) {
|
|
3
|
+
case "self":
|
|
4
|
+
return "You changed this";
|
|
5
|
+
case "own-agent":
|
|
6
|
+
return "Changed by your agent";
|
|
7
|
+
case "other-agent":
|
|
8
|
+
return "Changed by an agent";
|
|
9
|
+
case "other-user": {
|
|
10
|
+
const { profile: e } = t;
|
|
11
|
+
return e ? `Changed by ${[e.firstName, e.lastName].filter(Boolean).join(" ").trim() || e.userName}` : "Changed by another user";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
a as getChangeTooltipText
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=getChangeTooltipText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getChangeTooltipText.js","sources":["../../../../src/components/DataGrid/utils/getChangeTooltipText.ts"],"sourcesContent":["import type { ReplicaUserInfo } from '../hooks/useGridReplicaUsers'\n\n/**\n * Returns a human-readable tooltip string describing who last changed a cell,\n * based on the replica's category and (if available) the user's profile.\n */\nexport function getChangeTooltipText(info: ReplicaUserInfo): string {\n switch (info.category) {\n case 'self':\n return 'You changed this'\n case 'own-agent':\n return 'Changed by your agent'\n case 'other-agent':\n return 'Changed by an agent'\n case 'other-user': {\n const { profile } = info\n if (!profile) return 'Changed by another user'\n const name =\n [profile.firstName, profile.lastName]\n .filter(Boolean)\n .join(' ')\n .trim() || profile.userName\n return `Changed by ${name}`\n }\n }\n}\n"],"names":["getChangeTooltipText","info","profile"],"mappings":"AAMO,SAASA,EAAqBC,GAA+B;AAClE,UAAQA,EAAK,UAAA;AAAA,IACX,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK,cAAc;AACjB,YAAM,EAAE,SAAAC,MAAYD;AACpB,aAAKC,IAME,cAJL,CAACA,EAAQ,WAAWA,EAAQ,QAAQ,EACjC,OAAO,OAAO,EACd,KAAK,GAAG,EACR,KAAA,KAAUA,EAAQ,QACE,KANJ;AAAA,IAOvB;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GridReplicaInfo } from '@sage-bionetworks/synapse-client';
|
|
2
|
+
/**
|
|
3
|
+
* Categories used for attributing cell changes and coloring indicators.
|
|
4
|
+
* SERVICE replica changes are excluded entirely.
|
|
5
|
+
*/
|
|
6
|
+
export type ReplicaCategory = 'self' | 'own-agent' | 'other-user' | 'other-agent';
|
|
7
|
+
/**
|
|
8
|
+
* Classify a replica relative to the current user.
|
|
9
|
+
* Returns null for SERVICE replicas, which should be ignored for attribution.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getReplicaCategory(replica: GridReplicaInfo, currentUserId: string, localReplicaId: number): ReplicaCategory | null;
|
|
12
|
+
//# sourceMappingURL=getReplicaCategory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getReplicaCategory.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/utils/getReplicaCategory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE;;;GAGG;AACH,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,WAAW,GACX,YAAY,GACZ,aAAa,CAAA;AAEjB;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,eAAe,EACxB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,GACrB,eAAe,GAAG,IAAI,CAmBxB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function c(t, n, i) {
|
|
2
|
+
const { replicaType: e, createdBy: o, replicaId: a } = t;
|
|
3
|
+
if (e === "SERVICE")
|
|
4
|
+
return null;
|
|
5
|
+
if (a === i)
|
|
6
|
+
return "self";
|
|
7
|
+
const r = o === n;
|
|
8
|
+
return e === "AGENT" ? r ? "own-agent" : "other-agent" : r ? "self" : "other-user";
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
c as getReplicaCategory
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=getReplicaCategory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getReplicaCategory.js","sources":["../../../../src/components/DataGrid/utils/getReplicaCategory.ts"],"sourcesContent":["import type { GridReplicaInfo } from '@sage-bionetworks/synapse-client'\n\n/**\n * Categories used for attributing cell changes and coloring indicators.\n * SERVICE replica changes are excluded entirely.\n */\nexport type ReplicaCategory =\n | 'self' // this client's own replica\n | 'own-agent' // an AGENT replica created by this user\n | 'other-user' // a USER replica created by another user\n | 'other-agent' // an AGENT replica created by another user\n\n/**\n * Classify a replica relative to the current user.\n * Returns null for SERVICE replicas, which should be ignored for attribution.\n */\nexport function getReplicaCategory(\n replica: GridReplicaInfo,\n currentUserId: string,\n localReplicaId: number,\n): ReplicaCategory | null {\n const { replicaType, createdBy, replicaId } = replica\n\n if (replicaType === 'SERVICE') {\n return null\n }\n\n if (replicaId === localReplicaId) {\n return 'self'\n }\n\n const isOwnUser = createdBy === currentUserId\n\n if (replicaType === 'AGENT') {\n return isOwnUser ? 'own-agent' : 'other-agent'\n }\n\n // USER\n return isOwnUser ? 'self' : 'other-user'\n}\n"],"names":["getReplicaCategory","replica","currentUserId","localReplicaId","replicaType","createdBy","replicaId","isOwnUser"],"mappings":"AAgBO,SAASA,EACdC,GACAC,GACAC,GACwB;AACxB,QAAM,EAAE,aAAAC,GAAa,WAAAC,GAAW,WAAAC,EAAA,IAAcL;AAE9C,MAAIG,MAAgB;AAClB,WAAO;AAGT,MAAIE,MAAcH;AAChB,WAAO;AAGT,QAAMI,IAAYF,MAAcH;AAEhC,SAAIE,MAAgB,UACXG,IAAY,cAAc,gBAI5BA,IAAY,SAAS;AAC9B;"}
|
package/dist/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCreateGridRequestForMetadataTask.d.ts","sourceRoot":"","sources":["../../../../../src/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,YAAY,EACb,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"getCreateGridRequestForMetadataTask.d.ts","sourceRoot":"","sources":["../../../../../src/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,YAAY,EACb,MAAM,kCAAkC,CAAA;AAEzC;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,YAAY,GACjB,iBAAiB,CAuBnB"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
function i(r) {
|
|
1
|
+
function t(r) {
|
|
3
2
|
const e = r.taskProperties;
|
|
4
3
|
if (!e)
|
|
5
4
|
throw new Error("CurationTask is missing taskProperties");
|
|
6
|
-
const t = o(r) ? r.assigneePrincipalId : void 0;
|
|
7
5
|
switch (e.concreteType) {
|
|
8
6
|
case "org.sagebionetworks.repo.model.curation.metadata.FileBasedMetadataTaskProperties":
|
|
9
7
|
return {
|
|
10
8
|
concreteType: "org.sagebionetworks.repo.model.grid.CreateGridRequest",
|
|
11
|
-
initialQuery: { sql: `SELECT * FROM ${e.fileViewId}` }
|
|
12
|
-
ownerPrincipalId: t
|
|
9
|
+
initialQuery: { sql: `SELECT * FROM ${e.fileViewId}` }
|
|
13
10
|
};
|
|
14
11
|
case "org.sagebionetworks.repo.model.curation.metadata.RecordBasedMetadataTaskProperties":
|
|
15
12
|
return {
|
|
16
13
|
concreteType: "org.sagebionetworks.repo.model.grid.CreateGridRequest",
|
|
17
|
-
recordSetId: e.recordSetId
|
|
18
|
-
ownerPrincipalId: t
|
|
14
|
+
recordSetId: e.recordSetId
|
|
19
15
|
};
|
|
20
16
|
default:
|
|
21
17
|
throw new Error(
|
|
@@ -25,6 +21,6 @@ function i(r) {
|
|
|
25
21
|
}
|
|
26
22
|
}
|
|
27
23
|
export {
|
|
28
|
-
|
|
24
|
+
t as getCreateGridRequestForMetadataTask
|
|
29
25
|
};
|
|
30
26
|
//# sourceMappingURL=getCreateGridRequestForMetadataTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCreateGridRequestForMetadataTask.js","sources":["../../../../../src/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.tsx"],"sourcesContent":["import {\n CreateGridRequest,\n CurationTask,\n} from '@sage-bionetworks/synapse-client'\
|
|
1
|
+
{"version":3,"file":"getCreateGridRequestForMetadataTask.js","sources":["../../../../../src/features/entity/metadata-task/utils/getCreateGridRequestForMetadataTask.tsx"],"sourcesContent":["import {\n CreateGridRequest,\n CurationTask,\n} from '@sage-bionetworks/synapse-client'\n\n/**\n * Generates a CreateGridRequest for a metadata task based on its properties.\n * @param taskProperties The properties of the metadata task.\n * @returns A CreateGridRequest object.\n */\nexport function getCreateGridRequestForMetadataTask(\n task: CurationTask,\n): CreateGridRequest {\n const taskProperties = task.taskProperties\n if (!taskProperties) {\n throw new Error('CurationTask is missing taskProperties')\n }\n\n switch (taskProperties.concreteType) {\n case 'org.sagebionetworks.repo.model.curation.metadata.FileBasedMetadataTaskProperties':\n return {\n concreteType: 'org.sagebionetworks.repo.model.grid.CreateGridRequest',\n initialQuery: { sql: `SELECT * FROM ${taskProperties.fileViewId!}` },\n }\n case 'org.sagebionetworks.repo.model.curation.metadata.RecordBasedMetadataTaskProperties':\n return {\n concreteType: 'org.sagebionetworks.repo.model.grid.CreateGridRequest',\n recordSetId: taskProperties.recordSetId!,\n }\n default:\n throw new Error(\n // @ts-expect-error - This will fail if a new concreteType is introduced until it is handled in the switch statement.\n `Unknown taskProperties concreteType: ${taskProperties.concreteType}`,\n )\n }\n}\n"],"names":["getCreateGridRequestForMetadataTask","task","taskProperties"],"mappings":"AAUO,SAASA,EACdC,GACmB;AACnB,QAAMC,IAAiBD,EAAK;AAC5B,MAAI,CAACC;AACH,UAAM,IAAI,MAAM,wCAAwC;AAG1D,UAAQA,EAAe,cAAA;AAAA,IACrB,KAAK;AACH,aAAO;AAAA,QACL,cAAc;AAAA,QACd,cAAc,EAAE,KAAK,iBAAiBA,EAAe,UAAW,GAAA;AAAA,MAAG;AAAA,IAEvE,KAAK;AACH,aAAO;AAAA,QACL,cAAc;AAAA,QACd,aAAaA,EAAe;AAAA,MAAA;AAAA,IAEhC;AACE,YAAM,IAAI;AAAA;AAAA,QAER,wCAAwCA,EAAe,YAAY;AAAA,MAAA;AAAA,EACrE;AAEN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.dsg-input{font-size:inherit;color:#353a3f}.dsg-cell-disabled input{color:#71767f}.row-deleted .dsg-cell{background:#fff1f0}.row-deleted .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fff1f0}.row-created .dsg-cell{background:#f6ffed}.row-created .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#f6ffed}.row-updated .dsg-cell{background:#fff7e6}.row-updated .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fff7e6}.row-valid .dsg-cell-gutter{background:#def0dd}.row-valid .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#def0dd}.row-invalid .dsg-cell-gutter{background:#fccfcc}.row-invalid .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fccfcc}.row-unknown .dsg-cell-gutter{background:#fdfeeb}.row-unknown .dsg-cell-gutter:after{content:"";display:block;position:absolute;top:50%;left:50%;width:16px;height:16px;margin:-8px 0 0 -8px;border:2px solid #e6c200;border-top:2px solid transparent;border-radius:50%;animation:spin 1s linear infinite;z-index:1}.row-unknown .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fdfeeb}.dsg-cell.cell-invalid{background:#fccfcc}.dsg-cell.cell-invalid.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fccfcc}.dsg-cell.cell-valid.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#def0dd}.dsg-cell.cell-unknown.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fdfeeb}.dsg-cell.dsg-cell-sticky-left:not(.cell-invalid):not(.cell-valid):not(.cell-unknown):not(.dsg-cell-header):not(.dsg-cell-gutter){background:var(--dsg-cell-background-color, white)}@keyframes spin{to{transform:rotate(360deg)}}.dsg-cell-header.header-cell-required{background-color:#395979;color:#fff;font-weight:700}.multi-value-cell{min-height:40px}.multi-value-cell-large{min-height:80px}.cell-selected{border:1px solid rgb(25,118,210)}.dsg-container:not(:focus-within) .cell-selected{border:1px solid rgb(25,118,210);background-color:#1976d20d;z-index:25}.dsg-container{position:relative}.column-resize-handle{position:absolute;width:8px;cursor:col-resize;-webkit-user-select:none;user-select:none;z-index:100;background-color:transparent;transition:background-color .15s ease}.column-resize-handle:before{content:"";position:absolute;top:8px;left:50%;transform:translate(-50%);width:4px;height:16px;background:transparent;border-left:1px solid transparent;border-right:1px solid transparent;transition:border-color .15s ease}.column-resize-handle:hover{background-color:#80808026}.column-resize-handle:hover:before{border-left-color:#80808080;border-right-color:#80808080}.column-resize-handle.is-resizing{background-color:#8080804d}.column-resize-handle.is-resizing:before{border-left-color:#646464cc;border-right-color:#646464cc}body.col-resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}body.col-resizing .dsg-container,body.col-resizing .dsg-container *{cursor:col-resize}.dsg-cell.cell-remote-selected--color-0{background-color:#1677ff1f!important;box-shadow:inset 0 0 0 1px #1677ff66}.dsg-cell.cell-remote-selected--color-1{background-color:#52c41a1f!important;box-shadow:inset 0 0 0 1px #52c41a66}.dsg-cell.cell-remote-selected--color-2{background-color:#fa8c161f!important;box-shadow:inset 0 0 0 1px #fa8c1666}.dsg-cell.cell-remote-selected--color-3{background-color:#eb2f961f!important;box-shadow:inset 0 0 0 1px #eb2f9666}.dsg-cell.cell-remote-selected--color-4{background-color:#13c2c21f!important;box-shadow:inset 0 0 0 1px #13c2c266}.dsg-cell.cell-remote-selected--color-5{background-color:#9254de1f!important;box-shadow:inset 0 0 0 1px #9254de66}.dsg-cell.cell-remote-selected--color-6{background-color:#f5222d1f!important;box-shadow:inset 0 0 0 1px #f5222d66}.dsg-cell.cell-remote-selected--color-7{background-color:#faad141f!important;box-shadow:inset 0 0 0 1px #faad1466}
|
|
1
|
+
.dsg-input{font-size:inherit;color:#353a3f}.dsg-cell-disabled input{color:#71767f}.row-deleted .dsg-cell{background:#fff1f0}.row-deleted .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fff1f0}.row-created .dsg-cell{background:#f6ffed}.row-created .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#f6ffed}.row-updated .dsg-cell{background:#fff7e6}.row-updated .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fff7e6}.row-valid .dsg-cell-gutter{background:#def0dd}.row-valid .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#def0dd}.row-invalid .dsg-cell-gutter{background:#fccfcc}.row-invalid .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fccfcc}.row-unknown .dsg-cell-gutter{background:#fdfeeb}.row-unknown .dsg-cell-gutter:after{content:"";display:block;position:absolute;top:50%;left:50%;width:16px;height:16px;margin:-8px 0 0 -8px;border:2px solid #e6c200;border-top:2px solid transparent;border-radius:50%;animation:spin 1s linear infinite;z-index:1}.row-unknown .dsg-cell.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fdfeeb}.dsg-cell.cell-invalid{background:#fccfcc}.dsg-cell.cell-invalid.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fccfcc}.dsg-cell.cell-valid.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#def0dd}.dsg-cell.cell-unknown.dsg-cell-sticky-left:not(.dsg-cell-header):not(.dsg-cell-gutter){background:#fdfeeb}.dsg-cell.dsg-cell-sticky-left:not(.cell-invalid):not(.cell-valid):not(.cell-unknown):not(.dsg-cell-header):not(.dsg-cell-gutter){background:var(--dsg-cell-background-color, white)}@keyframes spin{to{transform:rotate(360deg)}}.dsg-cell-header.header-cell-required{background-color:#395979;color:#fff;font-weight:700}.multi-value-cell{min-height:40px}.multi-value-cell-large{min-height:80px}.cell-selected{border:1px solid rgb(25,118,210)}.dsg-container:not(:focus-within) .cell-selected{border:1px solid rgb(25,118,210);background-color:#1976d20d;z-index:25}.dsg-container{position:relative}.column-resize-handle{position:absolute;width:8px;cursor:col-resize;-webkit-user-select:none;user-select:none;z-index:100;background-color:transparent;transition:background-color .15s ease}.column-resize-handle:before{content:"";position:absolute;top:8px;left:50%;transform:translate(-50%);width:4px;height:16px;background:transparent;border-left:1px solid transparent;border-right:1px solid transparent;transition:border-color .15s ease}.column-resize-handle:hover{background-color:#80808026}.column-resize-handle:hover:before{border-left-color:#80808080;border-right-color:#80808080}.column-resize-handle.is-resizing{background-color:#8080804d}.column-resize-handle.is-resizing:before{border-left-color:#646464cc;border-right-color:#646464cc}body.col-resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}body.col-resizing .dsg-container,body.col-resizing .dsg-container *{cursor:col-resize}.dsg-cell.cell-changed--self:after{content:"";position:absolute;top:0;right:0;width:0;height:0;border-style:solid;border-width:0 7px 7px 0;border-color:transparent #52c41a transparent transparent;z-index:20;pointer-events:none}.dsg-cell.cell-changed--other-user:after{content:"";position:absolute;top:0;right:0;width:0;height:0;border-style:solid;border-width:0 7px 7px 0;border-color:transparent #1677ff transparent transparent;z-index:20;pointer-events:none}.dsg-cell.cell-remote-selected--color-0{background-color:#1677ff1f!important;box-shadow:inset 0 0 0 1px #1677ff66}.dsg-cell.cell-remote-selected--color-1{background-color:#52c41a1f!important;box-shadow:inset 0 0 0 1px #52c41a66}.dsg-cell.cell-remote-selected--color-2{background-color:#fa8c161f!important;box-shadow:inset 0 0 0 1px #fa8c1666}.dsg-cell.cell-remote-selected--color-3{background-color:#eb2f961f!important;box-shadow:inset 0 0 0 1px #eb2f9666}.dsg-cell.cell-remote-selected--color-4{background-color:#13c2c21f!important;box-shadow:inset 0 0 0 1px #13c2c266}.dsg-cell.cell-remote-selected--color-5{background-color:#9254de1f!important;box-shadow:inset 0 0 0 1px #9254de66}.dsg-cell.cell-remote-selected--color-6{background-color:#f5222d1f!important;box-shadow:inset 0 0 0 1px #f5222d66}.dsg-cell.cell-remote-selected--color-7{background-color:#faad141f!important;box-shadow:inset 0 0 0 1px #faad1466}
|