@datagrok/helm 2.4.5 → 2.4.6
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/CHANGELOG.md +4 -0
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +1 -1
- package/src/package.ts +14 -11
- package/src/utils/helm-grid-cell-renderer.ts +1 -2
package/package.json
CHANGED
package/src/package.ts
CHANGED
|
@@ -86,7 +86,7 @@ export function helmCellRenderer(): HelmCellRenderer {
|
|
|
86
86
|
return new HelmGridCellRenderer(); // new
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
function checkMonomersAndOpenWebEditor(cell: DG.
|
|
89
|
+
function checkMonomersAndOpenWebEditor(cell: DG.GridCell, value?: string, units?: string) {
|
|
90
90
|
openWebEditor(cell, value, units);
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -95,7 +95,7 @@ function checkMonomersAndOpenWebEditor(cell: DG.Cell, value?: string, units?: st
|
|
|
95
95
|
//input: grid_cell cell
|
|
96
96
|
//meta.columnTags: quality=Macromolecule, units=helm
|
|
97
97
|
export function editMoleculeCell(cell: DG.GridCell): void {
|
|
98
|
-
checkMonomersAndOpenWebEditor(cell
|
|
98
|
+
checkMonomersAndOpenWebEditor(cell, undefined, undefined);
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
//name: Open Helm Web Editor
|
|
@@ -107,11 +107,14 @@ export function openEditor(mol: string): void {
|
|
|
107
107
|
const col = df.columns.bySemType('Macromolecule')! as DG.Column<string>;
|
|
108
108
|
const colSh = SeqHandler.forColumn(col);
|
|
109
109
|
const colUnits = col.meta.units;
|
|
110
|
+
if (df.currentRowIdx === -1)
|
|
111
|
+
return;
|
|
112
|
+
const gCell = DG.GridCell.fromColumnRow(grok.shell.tv.grid, col.name, df.currentRowIdx);
|
|
110
113
|
if (colUnits === NOTATION.HELM)
|
|
111
|
-
checkMonomersAndOpenWebEditor(
|
|
114
|
+
checkMonomersAndOpenWebEditor(gCell, undefined, undefined);
|
|
112
115
|
const convert = colSh.getConverter(NOTATION.HELM);
|
|
113
116
|
const helmMol = convert(mol);
|
|
114
|
-
checkMonomersAndOpenWebEditor(
|
|
117
|
+
checkMonomersAndOpenWebEditor(gCell, helmMol, col.meta.units!);
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
//name: Properties
|
|
@@ -122,14 +125,14 @@ export function propertiesWidget(sequence: DG.SemanticValue): DG.Widget {
|
|
|
122
125
|
return getPropertiesWidget(sequence);
|
|
123
126
|
}
|
|
124
127
|
|
|
125
|
-
function openWebEditor(cell: DG.
|
|
128
|
+
function openWebEditor(cell: DG.GridCell, value?: string, units?: string) {
|
|
126
129
|
const view = ui.div();
|
|
127
130
|
// const df = grok.shell.tv.grid.dataFrame;
|
|
128
|
-
// const col = df.columns.bySemType('Macromolecule')
|
|
129
|
-
const col = cell.column as DG.Column<string>;
|
|
131
|
+
// const col = df.columns.bySemType('Macromolecule')!
|
|
132
|
+
const col = cell.cell.column as DG.Column<string>;
|
|
130
133
|
const sh = SeqHandler.forColumn(col);
|
|
131
|
-
const
|
|
132
|
-
|
|
134
|
+
const app: App =
|
|
135
|
+
_package.helmHelper.createWebEditorApp(view, !!cell && units === undefined ? cell.cell.value : value!);
|
|
133
136
|
const dlg = ui.dialog({showHeader: false, showFooter: true});
|
|
134
137
|
dlg.add(view)
|
|
135
138
|
.onOK(() => {
|
|
@@ -137,10 +140,10 @@ function openWebEditor(cell: DG.Cell, value?: string, units?: string) {
|
|
|
137
140
|
.replace(/<span style='background:#bbf;'>/g, '');
|
|
138
141
|
if (!!cell) {
|
|
139
142
|
if (units === undefined)
|
|
140
|
-
cell.
|
|
143
|
+
cell.setValue(helmValue);
|
|
141
144
|
else {
|
|
142
145
|
const convertedRes = sh.convertHelmToFastaSeparator(helmValue, units!, sh.separator);
|
|
143
|
-
cell.
|
|
146
|
+
cell.setValue(convertedRes);
|
|
144
147
|
}
|
|
145
148
|
}
|
|
146
149
|
}).show({modal: true, fullScreen: true});
|
|
@@ -146,9 +146,8 @@ export class HelmGridCellRendererBack extends CellRendererBackAsyncBase<HelmProp
|
|
|
146
146
|
gridCell: DG.GridCell, cellStyle: DG.GridCellStyle) {
|
|
147
147
|
if (!this.monomerLib) {
|
|
148
148
|
this.monomerLib = _package.monomerLib;
|
|
149
|
-
if (this.monomerLib)
|
|
149
|
+
if (this.monomerLib)
|
|
150
150
|
this.subs.push(this.monomerLib.onChanged.subscribe(this.monomerLibOnChanged.bind(this)));
|
|
151
|
-
}
|
|
152
151
|
}
|
|
153
152
|
super.render(g, x, y, w, h, gridCell, cellStyle);
|
|
154
153
|
}
|