@teselagen/ove 0.8.20 → 0.8.21

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/index.cjs.js CHANGED
@@ -17289,7 +17289,8 @@ function rowClick(e, rowInfo, entities, {
17289
17289
  onMultiRowSelect,
17290
17290
  noDeselectAll,
17291
17291
  onRowSelect,
17292
- change
17292
+ change,
17293
+ getCheckboxGroupId
17293
17294
  }) {
17294
17295
  const entity = rowInfo.original;
17295
17296
  onRowClick(e, entity, rowInfo);
@@ -17361,6 +17362,38 @@ function rowClick(e, rowInfo, entities, {
17361
17362
  }
17362
17363
  }
17363
17364
  }
17365
+ if (getCheckboxGroupId) {
17366
+ const clickedRowId = rowId;
17367
+ const clickedEntity = entity;
17368
+ const clickedGroupId = getCheckboxGroupId(clickedEntity, rowInfo.index);
17369
+ if (!newIdMap[clickedRowId] && clickedGroupId) {
17370
+ entities.forEach((e2, i) => {
17371
+ if (getCheckboxGroupId(e2, i) === clickedGroupId) {
17372
+ const id2 = getIdOrCodeOrIndex(e2, i);
17373
+ delete newIdMap[id2];
17374
+ }
17375
+ });
17376
+ }
17377
+ const selectedGroupIds = /* @__PURE__ */ new Set();
17378
+ entities.forEach((e2, i) => {
17379
+ const id2 = getIdOrCodeOrIndex(e2, i);
17380
+ if (newIdMap[id2]) {
17381
+ const gid = getCheckboxGroupId(e2, i);
17382
+ if (gid) selectedGroupIds.add(gid);
17383
+ }
17384
+ });
17385
+ if (selectedGroupIds.size > 0) {
17386
+ entities.forEach((e2, i) => {
17387
+ const gid = getCheckboxGroupId(e2, i);
17388
+ if (gid && selectedGroupIds.has(gid)) {
17389
+ const id2 = getIdOrCodeOrIndex(e2, i);
17390
+ if (!newIdMap[id2]) {
17391
+ newIdMap[id2] = { entity: e2, time: Date.now() };
17392
+ }
17393
+ }
17394
+ });
17395
+ }
17396
+ }
17364
17397
  finalizeSelection({
17365
17398
  idMap: newIdMap,
17366
17399
  entities,
@@ -51856,6 +51889,7 @@ const useColumns = /* @__PURE__ */ __name(({
51856
51889
  resetDefaultVisibility,
51857
51890
  currentParams,
51858
51891
  compact,
51892
+ hideExpandSubCompColumn,
51859
51893
  editingCell,
51860
51894
  editingCellSelectAll,
51861
51895
  entities,
@@ -51903,7 +51937,8 @@ const useColumns = /* @__PURE__ */ __name(({
51903
51937
  withSort = true,
51904
51938
  recordIdToIsVisibleMap,
51905
51939
  setRecordIdToIsVisibleMap,
51906
- withDisplayOptions
51940
+ withDisplayOptions,
51941
+ getCheckboxGroupId
51907
51942
  }) => {
51908
51943
  const dispatch = reactRedux.useDispatch();
51909
51944
  const change = React.useCallback(
@@ -52151,6 +52186,14 @@ const useColumns = /* @__PURE__ */ __name(({
52151
52186
  return /* @__PURE__ */ React.createElement("div", null);
52152
52187
  }
52153
52188
  const entity = entities[rowIndex];
52189
+ if (getCheckboxGroupId) {
52190
+ const currentGroupId = getCheckboxGroupId(entity, rowIndex);
52191
+ const previousEntity = entities[rowIndex - 1];
52192
+ const previousGroupId = previousEntity ? getCheckboxGroupId(previousEntity, rowIndex - 1) : void 0;
52193
+ if (currentGroupId && currentGroupId === previousGroupId) {
52194
+ return /* @__PURE__ */ React.createElement("div", null);
52195
+ }
52196
+ }
52154
52197
  return /* @__PURE__ */ React.createElement(
52155
52198
  core.Checkbox,
52156
52199
  {
@@ -52169,7 +52212,8 @@ const useColumns = /* @__PURE__ */ __name(({
52169
52212
  onMultiRowSelect,
52170
52213
  noDeselectAll,
52171
52214
  onRowSelect,
52172
- change
52215
+ change,
52216
+ getCheckboxGroupId
52173
52217
  });
52174
52218
  }, "onClick"),
52175
52219
  checked: isSelected
@@ -52190,7 +52234,8 @@ const useColumns = /* @__PURE__ */ __name(({
52190
52234
  onRowSelect,
52191
52235
  onSingleRowSelect,
52192
52236
  reduxFormSelectedEntityIdMap,
52193
- withCheckboxes
52237
+ withCheckboxes,
52238
+ getCheckboxGroupId
52194
52239
  ]
52195
52240
  );
52196
52241
  const finishCellEdit = React.useCallback(
@@ -52265,13 +52310,14 @@ const useColumns = /* @__PURE__ */ __name(({
52265
52310
  );
52266
52311
  }, "Header")
52267
52312
  }), {
52313
+ show: !hideExpandSubCompColumn,
52268
52314
  expander: true,
52269
52315
  Expander: /* @__PURE__ */ __name(({ isExpanded, original: record }) => {
52270
52316
  let shouldShow = true;
52271
52317
  if (shouldShowSubComponent) {
52272
52318
  shouldShow = shouldShowSubComponent(record);
52273
52319
  }
52274
- if (!shouldShow) return null;
52320
+ if (!shouldShow || hideExpandSubCompColumn) return null;
52275
52321
  return /* @__PURE__ */ React.createElement(
52276
52322
  core.Button,
52277
52323
  {
@@ -56813,6 +56859,7 @@ const DataTable = /* @__PURE__ */ __name((_w) => {
56813
56859
  minimalStyle,
56814
56860
  mustClickCheckboxToSelect,
56815
56861
  noDeselectAll,
56862
+ hideExpandSubCompColumn,
56816
56863
  noFooter = isSimple ? !withPaging : false,
56817
56864
  noFullscreenButton = isSimple,
56818
56865
  noHeader = false,
@@ -56860,7 +56907,8 @@ const DataTable = /* @__PURE__ */ __name((_w) => {
56860
56907
  withSort,
56861
56908
  withTitle = !isSimple,
56862
56909
  noExcessiveCheck,
56863
- isEntityCountLoading
56910
+ isEntityCountLoading,
56911
+ getCheckboxGroupId
56864
56912
  } = props;
56865
56913
  const _entities = React.useMemo(
56866
56914
  () => ((reduxFormEntities == null ? void 0 : reduxFormEntities.length) ? reduxFormEntities : _origEntities) || [],
@@ -58397,6 +58445,15 @@ const DataTable = /* @__PURE__ */ __name((_w) => {
58397
58445
  const isExpanded = expandedEntityIdMap[rowId];
58398
58446
  const rowDisabled = isEntityDisabled(entity);
58399
58447
  const dataId = entity.id || entity.code;
58448
+ let noGroupBorder = false;
58449
+ if (getCheckboxGroupId) {
58450
+ const currentGroupId = getCheckboxGroupId(entity, rowInfo.index);
58451
+ const nextEntity = entities[rowInfo.index + 1];
58452
+ const nextGroupId = nextEntity ? getCheckboxGroupId(nextEntity, rowInfo.index + 1) : void 0;
58453
+ if (currentGroupId && currentGroupId === nextGroupId) {
58454
+ noGroupBorder = true;
58455
+ }
58456
+ }
58400
58457
  return {
58401
58458
  onClick: /* @__PURE__ */ __name((e) => {
58402
58459
  if (isCellEditable) return;
@@ -58423,7 +58480,8 @@ const DataTable = /* @__PURE__ */ __name((_w) => {
58423
58480
  onMultiRowSelect,
58424
58481
  noDeselectAll,
58425
58482
  onRowSelect,
58426
- change
58483
+ change,
58484
+ getCheckboxGroupId
58427
58485
  });
58428
58486
  }, "onClick"),
58429
58487
  //row right click
@@ -58465,9 +58523,11 @@ const DataTable = /* @__PURE__ */ __name((_w) => {
58465
58523
  {
58466
58524
  disabled: rowDisabled,
58467
58525
  selected: rowSelected && !withCheckboxes,
58468
- "rt-tr-last-row": rowInfo.index === entities.length - 1
58526
+ "rt-tr-last-row": rowInfo.index === entities.length - 1,
58527
+ "no-group-border": noGroupBorder
58469
58528
  }
58470
58529
  ),
58530
+ "data-test-selected": !!rowSelected,
58471
58531
  "data-test-id": dataId === void 0 ? rowInfo.index : dataId,
58472
58532
  "data-index": rowInfo.index,
58473
58533
  "data-tip": typeof rowDisabled === "string" ? rowDisabled : void 0,
@@ -58498,7 +58558,8 @@ const DataTable = /* @__PURE__ */ __name((_w) => {
58498
58558
  reduxFormSelectedEntityIdMap,
58499
58559
  selectedCells,
58500
58560
  showContextMenu2,
58501
- withCheckboxes
58561
+ withCheckboxes,
58562
+ getCheckboxGroupId
58502
58563
  ]
58503
58564
  );
58504
58565
  const getTableCellProps = React.useCallback(
@@ -58811,6 +58872,7 @@ const DataTable = /* @__PURE__ */ __name((_w) => {
58811
58872
  isSingleSelect,
58812
58873
  isSelectionARectangle,
58813
58874
  noDeselectAll,
58875
+ hideExpandSubCompColumn,
58814
58876
  noSelect,
58815
58877
  noUserSelect,
58816
58878
  onDeselect,
@@ -58842,6 +58904,7 @@ const DataTable = /* @__PURE__ */ __name((_w) => {
58842
58904
  withFilter,
58843
58905
  withSort,
58844
58906
  recordIdToIsVisibleMap,
58907
+ getCheckboxGroupId,
58845
58908
  setRecordIdToIsVisibleMap
58846
58909
  });
58847
58910
  const scrollToTop = React.useCallback(
@@ -66966,9 +67029,19 @@ function AdvancedOptions({
66966
67029
  content: content2,
66967
67030
  label,
66968
67031
  style: style2,
66969
- isOpenByDefault
67032
+ isOpenByDefault,
67033
+ localStorageKey
66970
67034
  }) {
66971
- const [isOpen, setOpen] = React.useState(isOpenByDefault);
67035
+ const [isOpen, setOpen] = React.useState(() => {
67036
+ if (localStorageKey) {
67037
+ if (window.localStorage.getItem(localStorageKey) === "true") {
67038
+ return true;
67039
+ } else if (window.localStorage.getItem(localStorageKey) === "false") {
67040
+ return false;
67041
+ }
67042
+ }
67043
+ return isOpenByDefault;
67044
+ });
66972
67045
  if (!(content2 || children)) {
66973
67046
  return null;
66974
67047
  }
@@ -66976,20 +67049,28 @@ function AdvancedOptions({
66976
67049
  "div",
66977
67050
  {
66978
67051
  onClick: /* @__PURE__ */ __name(() => {
66979
- setOpen(!isOpen);
67052
+ const newIsOpen = !isOpen;
67053
+ setOpen(newIsOpen);
67054
+ if (localStorageKey) {
67055
+ window.localStorage.setItem(localStorageKey, newIsOpen);
67056
+ }
66980
67057
  }, "onClick"),
66981
- style: { cursor: "pointer", display: "flex", alignItems: "flex-end" },
66982
- className: "tg-toggle-advanced-options"
67058
+ style: {
67059
+ cursor: "pointer",
67060
+ display: "flex",
67061
+ alignItems: "center",
67062
+ userSelect: "none"
67063
+ },
67064
+ className: `tg-toggle-advanced-options`
66983
67065
  },
66984
- label || "Advanced",
66985
- " ",
66986
67066
  /* @__PURE__ */ React.createElement(
66987
67067
  core.Icon,
66988
67068
  {
66989
67069
  icon: isOpen ? "caret-down" : "caret-right",
66990
- style: { marginLeft: 5 }
67070
+ style: { marginRight: 5 }
66991
67071
  }
66992
- )
67072
+ ),
67073
+ /* @__PURE__ */ React.createElement("strong", null, label || "Advanced")
66993
67074
  ), isOpen && /* @__PURE__ */ React.createElement("div", { style: { marginTop: 10 } }, content2 || children));
66994
67075
  }
66995
67076
  __name(AdvancedOptions, "AdvancedOptions");
@@ -70283,6 +70364,7 @@ const _ResizableDraggableDialog = class _ResizableDraggableDialog extends React.
70283
70364
  topLeft: true,
70284
70365
  topRight: true
70285
70366
  },
70367
+ resizeHandleWrapperClass: "tg-dialog-resize-handle",
70286
70368
  maxHeight: windowHeight,
70287
70369
  maxWidth: windowWidth,
70288
70370
  bounds: "window",
@@ -97192,6 +97274,30 @@ const selectedPartTags$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.
97192
97274
  default: selectedPartTags,
97193
97275
  updateSelectedPartTags
97194
97276
  }, Symbol.toStringTag, { value: "Module" }));
97277
+ const updateTemporaryAnnotations = createMetaAction(
97278
+ "TEMPORARY_ANNOTATIONS_UPDATE"
97279
+ );
97280
+ const temporaryAnnotations = createMergedDefaultStateReducer(
97281
+ {
97282
+ TEMPORARY_ANNOTATIONS_UPDATE: /* @__PURE__ */ __name((state2, payload) => {
97283
+ return __spreadValues(__spreadValues({}, state2), payload);
97284
+ }, "TEMPORARY_ANNOTATIONS_UPDATE"),
97285
+ VECTOR_EDITOR_UPDATE: /* @__PURE__ */ __name((state2, payload) => {
97286
+ return __spreadValues(__spreadValues({}, state2), payload.temporaryAnnotations);
97287
+ }, "VECTOR_EDITOR_UPDATE")
97288
+ },
97289
+ {
97290
+ features: {},
97291
+ primers: {},
97292
+ parts: {},
97293
+ selectionLayer: {}
97294
+ }
97295
+ );
97296
+ const temporaryAnnotations$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
97297
+ __proto__: null,
97298
+ default: temporaryAnnotations,
97299
+ updateTemporaryAnnotations
97300
+ }, Symbol.toStringTag, { value: "Module" }));
97195
97301
  const vectorEditorMiddleware = /* @__PURE__ */ __name((store2) => (next) => (action2) => {
97196
97302
  if (action2.meta && action2.meta.disregardUndo) {
97197
97303
  return next(action2);
@@ -97307,7 +97413,8 @@ const subReducers = {
97307
97413
  partLengthsToHide: partLengthsToHide$1,
97308
97414
  primerLengthsToHide: primerLengthsToHide$1,
97309
97415
  featureLengthsToHide: featureLengthsToHide$1,
97310
- selectedPartTags: selectedPartTags$1
97416
+ selectedPartTags: selectedPartTags$1,
97417
+ temporaryAnnotations: temporaryAnnotations$1
97311
97418
  };
97312
97419
  const vectorEditorInitialize = createMetaAction("VECTOR_EDITOR_UPDATE");
97313
97420
  const vectorEditorClear = createMetaAction("VECTOR_EDITOR_CLEAR");
@@ -98072,11 +98179,16 @@ const translationSearchMatchesSelector = createSelector(
98072
98179
  return searchLayers;
98073
98180
  }
98074
98181
  );
98075
- function featuresRawSelector(sequenceData2) {
98076
- return sequenceData2.features;
98182
+ const temporaryAnnotationsSelector = /* @__PURE__ */ __name((editor) => editor.temporaryAnnotations, "temporaryAnnotationsSelector");
98183
+ function featuresRawSelector(sequenceData2, temporaryAnnotations2) {
98184
+ return __spreadValues(__spreadValues({}, sequenceData2.features), temporaryAnnotations2 == null ? void 0 : temporaryAnnotations2.features);
98077
98185
  }
98078
98186
  __name(featuresRawSelector, "featuresRawSelector");
98079
- const featuresSelector = createSelector(sequenceDataSelector, featuresRawSelector);
98187
+ const featuresSelector = createSelector(
98188
+ sequenceDataSelector,
98189
+ temporaryAnnotationsSelector,
98190
+ featuresRawSelector
98191
+ );
98080
98192
  function cdsFeaturesRawSelector(features2) {
98081
98193
  return filter(features2, ({ type: type2 }) => type2 && type2.toUpperCase() === "CDS");
98082
98194
  }
@@ -98356,11 +98468,15 @@ const filteredFeaturesSelector$1 = createSelector(
98356
98468
  (state2) => state2.featureLengthsToHide,
98357
98469
  filteredFeaturesSelector
98358
98470
  );
98359
- function primersRawSelector(sequenceData2) {
98360
- return sequenceData2.primers;
98471
+ function primersRawSelector(sequenceData2, temporaryAnnotations2) {
98472
+ return __spreadValues(__spreadValues({}, sequenceData2.primers), temporaryAnnotations2 == null ? void 0 : temporaryAnnotations2.primers);
98361
98473
  }
98362
98474
  __name(primersRawSelector, "primersRawSelector");
98363
- const primersSelector = createSelector(sequenceDataSelector, primersRawSelector);
98475
+ const primersSelector = createSelector(
98476
+ sequenceDataSelector,
98477
+ temporaryAnnotationsSelector,
98478
+ primersRawSelector
98479
+ );
98364
98480
  function filteredPrimersSelector(primers2, seqLen, primerIndividualToHide, lengthsToHide) {
98365
98481
  return omitBy(primers2, (ann) => {
98366
98482
  const hideIndividually = primerIndividualToHide[ann.id];
@@ -98375,11 +98491,15 @@ const filteredPrimersSelector$1 = createSelector(
98375
98491
  (state2) => state2.primerLengthsToHide,
98376
98492
  filteredPrimersSelector
98377
98493
  );
98378
- function partsRawSelector(sequenceData2) {
98379
- return sequenceData2.parts;
98494
+ function partsRawSelector(sequenceData2, temporaryAnnotations2) {
98495
+ return __spreadValues(__spreadValues({}, sequenceData2.parts), temporaryAnnotations2 == null ? void 0 : temporaryAnnotations2.parts);
98380
98496
  }
98381
98497
  __name(partsRawSelector, "partsRawSelector");
98382
- const partsSelector = createSelector(sequenceDataSelector, partsRawSelector);
98498
+ const partsSelector = createSelector(
98499
+ sequenceDataSelector,
98500
+ temporaryAnnotationsSelector,
98501
+ partsRawSelector
98502
+ );
98383
98503
  const tagsToBoldSelector = /* @__PURE__ */ __name((state2) => state2.selectedPartTags.parts, "tagsToBoldSelector");
98384
98504
  function addWrappedAddons(anns, seqLen) {
98385
98505
  return flatMap(anns, (ann) => {
@@ -99206,7 +99326,8 @@ function updateEditor(store2, editorName, initialValues2 = {}, extraMeta = {}, {
99206
99326
  annotationVisibility: annotationVisibility2,
99207
99327
  annotationsToSupport: annotationsToSupport2,
99208
99328
  findTool: findTool2,
99209
- justPassingPartialSeqData
99329
+ justPassingPartialSeqData,
99330
+ temporaryAnnotations: temporaryAnnotations2
99210
99331
  } = initialValues2;
99211
99332
  const currentEditor = store2.getState().VectorEditor[editorName] || {};
99212
99333
  const isAlreadyProteinEditor = currentEditor.sequenceData && currentEditor.sequenceData.isProtein;
@@ -99328,12 +99449,14 @@ function updateEditor(store2, editorName, initialValues2 = {}, extraMeta = {}, {
99328
99449
  };
99329
99450
  }
99330
99451
  }
99331
- payload = __spreadValues(__spreadValues(__spreadValues({}, initialValues2), toSpread), sequenceData2 && {
99452
+ payload = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, initialValues2), toSpread), sequenceData2 && {
99332
99453
  sequenceData: tidyUpSequenceData(sequenceData2, {
99333
99454
  convertAnnotationsFromAAIndices,
99334
99455
  //if we have sequence data coming in make sure to tidy it up for the user :)
99335
99456
  annotationsAsObjects: true
99336
99457
  })
99458
+ }), temporaryAnnotations2 && {
99459
+ temporaryAnnotations: temporaryAnnotations2
99337
99460
  });
99338
99461
  }
99339
99462
  annotationTypes.forEach((t2) => {
@@ -116808,7 +116931,7 @@ function showFileDialog({ multiple = false, onSelect }) {
116808
116931
  input.click();
116809
116932
  }
116810
116933
  __name(showFileDialog, "showFileDialog");
116811
- const version = "0.8.19";
116934
+ const version = "0.8.20";
116812
116935
  const packageJson = {
116813
116936
  version
116814
116937
  };