@tetrascience-npm/tetrascience-react-ui 1.0.0-beta.156.1 → 1.0.0-beta.158.1
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/README.md +113 -0
- package/dist/components/composed/DataAppShell/RightPanel.cjs +1 -1
- package/dist/components/composed/DataAppShell/RightPanel.cjs.map +1 -1
- package/dist/components/composed/DataAppShell/RightPanel.d.ts +11 -1
- package/dist/components/composed/DataAppShell/RightPanel.js +128 -126
- package/dist/components/composed/DataAppShell/RightPanel.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.d.ts +5 -1
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.js +32 -30
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.d.ts +269 -13
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.js +392 -310
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapForm.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapForm.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapForm.d.ts +5 -1
- package/dist/components/composed/PlateMapEditor/PlateMapForm.js +19 -15
- package/dist/components/composed/PlateMapEditor/PlateMapForm.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapGrid.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapGrid.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapGrid.d.ts +12 -1
- package/dist/components/composed/PlateMapEditor/PlateMapGrid.js +69 -63
- package/dist/components/composed/PlateMapEditor/PlateMapGrid.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapManifest.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapManifest.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapManifest.d.ts +13 -4
- package/dist/components/composed/PlateMapEditor/PlateMapManifest.js +38 -29
- package/dist/components/composed/PlateMapEditor/PlateMapManifest.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.d.ts +6 -1
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.js +490 -275
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellLegend.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/WellLegend.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellLegend.d.ts +8 -2
- package/dist/components/composed/PlateMapEditor/WellLegend.js +8 -7
- package/dist/components/composed/PlateMapEditor/WellLegend.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellManifestTable.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/WellManifestTable.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellManifestTable.d.ts +6 -2
- package/dist/components/composed/PlateMapEditor/WellManifestTable.js +288 -256
- package/dist/components/composed/PlateMapEditor/WellManifestTable.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.d.ts +5 -1
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.js +61 -66
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellQuickPaint.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/WellQuickPaint.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/WellQuickPaint.d.ts +23 -0
- package/dist/components/composed/PlateMapEditor/WellQuickPaint.js +75 -0
- package/dist/components/composed/PlateMapEditor/WellQuickPaint.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/index.d.ts +6 -2
- package/dist/components/composed/PlateMapEditor/types.d.ts +65 -0
- package/dist/components/composed/PlateMapEditor/usePlateMapEditorState.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/usePlateMapEditorState.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/usePlateMapEditorState.d.ts +109 -0
- package/dist/components/composed/PlateMapEditor/usePlateMapEditorState.js +246 -0
- package/dist/components/composed/PlateMapEditor/usePlateMapEditorState.js.map +1 -0
- package/dist/composed/PlateMapEditor.cjs +1 -1
- package/dist/composed/PlateMapEditor.js +48 -42
- package/dist/composed/PlateMapEditor.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +701 -695
- package/dist/index.js.map +1 -1
- package/dist/index.scoped.css +1 -1
- package/dist/index.tailwind.css +1 -1
- package/package.json +1 -1
|
@@ -1,341 +1,423 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
return l || (n ? void 0 : t[0]);
|
|
1
|
+
import { jsx as t, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { PlateMapActionsMenu as ft } from "./PlateMapActionsMenu.js";
|
|
4
|
+
import { PlateMapForm as ut } from "./PlateMapForm.js";
|
|
5
|
+
import { PlateMapGrid as xt } from "./PlateMapGrid.js";
|
|
6
|
+
import { PlateMapManifest as ht } from "./PlateMapManifest.js";
|
|
7
|
+
import { PlateMapPlateSelector as gt } from "./PlateMapPlateSelector.js";
|
|
8
|
+
import { usePlateMapEditorState as wt, defaultColorForWell as vt } from "./usePlateMapEditorState.js";
|
|
9
|
+
import { getPlateMapScopedWellId as Yt } from "./usePlateMapEditorState.js";
|
|
10
|
+
import { WellQuickPaint as St } from "./WellQuickPaint.js";
|
|
11
|
+
import { Badge as bt } from "../../../ui/badge.js";
|
|
12
|
+
import { Card as T, CardContent as W, CardHeader as K, CardTitle as Y, CardAction as Ct, CardFooter as Et } from "../../../ui/card.js";
|
|
13
|
+
import { cn as w } from "../../../lib/utils.js";
|
|
14
|
+
const Pt = "plateBarcode", yt = "Plate Barcode", Mt = "Sample manifest", Nt = "360px", Dt = {
|
|
15
|
+
sm: "@min-[640px]:flex-row @min-[640px]:items-start",
|
|
16
|
+
md: "@min-[768px]:flex-row @min-[768px]:items-start",
|
|
17
|
+
lg: "@min-[1024px]:flex-row @min-[1024px]:items-start",
|
|
18
|
+
xl: "@min-[1280px]:flex-row @min-[1280px]:items-start",
|
|
19
|
+
never: ""
|
|
20
|
+
}, Tt = {
|
|
21
|
+
sm: "@min-[640px]:w-[var(--plate-map-form-width)] @min-[640px]:shrink-0",
|
|
22
|
+
md: "@min-[768px]:w-[var(--plate-map-form-width)] @min-[768px]:shrink-0",
|
|
23
|
+
lg: "@min-[1024px]:w-[var(--plate-map-form-width)] @min-[1024px]:shrink-0",
|
|
24
|
+
xl: "@min-[1280px]:w-[var(--plate-map-form-width)] @min-[1280px]:shrink-0",
|
|
25
|
+
never: ""
|
|
26
|
+
};
|
|
27
|
+
function Wt(r, a) {
|
|
28
|
+
return r > 0 || !!a;
|
|
30
29
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
c && l.set(c, s);
|
|
37
|
-
}), l;
|
|
30
|
+
function At({ title: r, badges: a }) {
|
|
31
|
+
return !r && !a ? null : /* @__PURE__ */ x("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
32
|
+
r ? /* @__PURE__ */ t("h2", { className: "text-lg font-semibold", children: r }) : /* @__PURE__ */ t("span", {}),
|
|
33
|
+
a ? /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: a }) : null
|
|
34
|
+
] });
|
|
38
35
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
isControlled: l,
|
|
43
|
-
providedPlateCount: s
|
|
36
|
+
function It({
|
|
37
|
+
visible: r,
|
|
38
|
+
...a
|
|
44
39
|
}) {
|
|
45
|
-
|
|
46
|
-
return m ? t.some((c) => c.id === n) ? void 0 : m : !l && s === 0 ? null : void 0;
|
|
47
|
-
}
|
|
48
|
-
function kt(t, n) {
|
|
49
|
-
return t > 0 || !!n;
|
|
40
|
+
return r ? /* @__PURE__ */ t(gt, { ...a }) : null;
|
|
50
41
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
function Lt({
|
|
43
|
+
hidden: r,
|
|
44
|
+
title: a,
|
|
45
|
+
cardClassName: b,
|
|
46
|
+
slot: v,
|
|
47
|
+
manifest: C
|
|
48
|
+
}) {
|
|
49
|
+
return r ? null : /* @__PURE__ */ x(T, { size: "sm", "data-plate-map-region": "manifest", className: w("w-full min-w-0", b), children: [
|
|
50
|
+
a ? /* @__PURE__ */ t(K, { className: "border-b", children: /* @__PURE__ */ t(Y, { children: a }) }) : null,
|
|
51
|
+
/* @__PURE__ */ t(W, { className: "min-w-0", children: v ?? C })
|
|
58
52
|
] });
|
|
59
53
|
}
|
|
60
|
-
function
|
|
61
|
-
format:
|
|
62
|
-
rows:
|
|
63
|
-
columns:
|
|
64
|
-
values:
|
|
65
|
-
onChange:
|
|
66
|
-
selection:
|
|
67
|
-
onSelectionChange:
|
|
68
|
-
fields:
|
|
69
|
-
tableColumns:
|
|
70
|
-
colorForWell:
|
|
54
|
+
function Ut({
|
|
55
|
+
format: r,
|
|
56
|
+
rows: a,
|
|
57
|
+
columns: b,
|
|
58
|
+
values: v,
|
|
59
|
+
onChange: C,
|
|
60
|
+
selection: n,
|
|
61
|
+
onSelectionChange: E,
|
|
62
|
+
fields: f,
|
|
63
|
+
tableColumns: h,
|
|
64
|
+
colorForWell: $ = vt,
|
|
71
65
|
emptyEntry: A,
|
|
72
|
-
mergeOnApply:
|
|
73
|
-
isPopulated:
|
|
74
|
-
cycleFieldOnWellDoubleClick:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
66
|
+
mergeOnApply: J,
|
|
67
|
+
isPopulated: X,
|
|
68
|
+
cycleFieldOnWellDoubleClick: Z,
|
|
69
|
+
quickPaintField: i,
|
|
70
|
+
staged: q,
|
|
71
|
+
onStagedChange: ee,
|
|
72
|
+
title: te,
|
|
73
|
+
badges: le,
|
|
74
|
+
banner: ae,
|
|
75
|
+
legend: P,
|
|
76
|
+
legendPlacement: I = "form",
|
|
77
|
+
formExtras: re,
|
|
78
|
+
formSlot: oe,
|
|
79
|
+
hideForm: ne = !1,
|
|
80
|
+
formPlacement: S = "start",
|
|
81
|
+
stackAt: L = "md",
|
|
82
|
+
formWidth: y = Nt,
|
|
83
|
+
footer: _,
|
|
84
|
+
plateTitle: ie = "Plate",
|
|
85
|
+
plateToolbar: se,
|
|
86
|
+
plateBanner: pe,
|
|
87
|
+
plateFooter: z,
|
|
88
|
+
plates: de,
|
|
89
|
+
activePlateId: ce,
|
|
90
|
+
onPlateChange: me,
|
|
91
|
+
onAddPlate: F,
|
|
92
|
+
onRemovePlate: fe,
|
|
93
|
+
addPlateLabel: ue,
|
|
94
|
+
removePlateLabel: xe,
|
|
95
|
+
plateSelectorLabel: he,
|
|
96
|
+
plateSelectorVariant: ge,
|
|
97
|
+
plateBarcodeField: B,
|
|
98
|
+
applyScope: we,
|
|
99
|
+
plateBarcodeColumnHeader: k = yt,
|
|
95
100
|
hidePlateBarcodeColumn: H = !1,
|
|
96
|
-
groups:
|
|
97
|
-
activeGroupId:
|
|
98
|
-
onGroupClick:
|
|
99
|
-
renderHoverSummary:
|
|
100
|
-
cellSize:
|
|
101
|
-
emptyWellFillColor:
|
|
102
|
-
wellShape:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
101
|
+
groups: ve,
|
|
102
|
+
activeGroupId: Se,
|
|
103
|
+
onGroupClick: be,
|
|
104
|
+
renderHoverSummary: Ce,
|
|
105
|
+
cellSize: Ee,
|
|
106
|
+
emptyWellFillColor: Pe,
|
|
107
|
+
wellShape: ye,
|
|
108
|
+
selectionFillMode: Me,
|
|
109
|
+
framedPlate: Ne,
|
|
110
|
+
wrapWell: De,
|
|
111
|
+
highlightedWellIds: Te,
|
|
112
|
+
onHoveredWellChange: We,
|
|
113
|
+
hideSelectionControls: Ae,
|
|
114
|
+
labels: s,
|
|
115
|
+
hideManifest: Ie = !1,
|
|
116
|
+
manifestSlot: Le,
|
|
117
|
+
manifestTitle: _e = Mt,
|
|
118
|
+
manifest: M,
|
|
119
|
+
manifestFilterable: ze,
|
|
120
|
+
manifestGroupable: Fe,
|
|
121
|
+
autoScaleGrid: Be,
|
|
122
|
+
minCellSize: ke,
|
|
123
|
+
maxCellSize: He,
|
|
124
|
+
className: Oe,
|
|
125
|
+
style: Re,
|
|
126
|
+
classNames: p,
|
|
127
|
+
ref: Ve,
|
|
128
|
+
templates: je,
|
|
129
|
+
templateId: Ge,
|
|
130
|
+
onTemplateChange: Ue,
|
|
131
|
+
onClearTemplate: Qe,
|
|
132
|
+
onImportCsv: O,
|
|
133
|
+
onExportCsv: Ke,
|
|
134
|
+
onImportTemplate: Ye,
|
|
120
135
|
onExportTemplate: $e,
|
|
121
|
-
csvAccept:
|
|
122
|
-
templateAccept:
|
|
123
|
-
label:
|
|
124
|
-
align:
|
|
125
|
-
side:
|
|
126
|
-
importTemplateLabel:
|
|
127
|
-
exportTemplateLabel:
|
|
128
|
-
importCsvLabel:
|
|
129
|
-
exportCsvLabel:
|
|
130
|
-
clearLabel:
|
|
136
|
+
csvAccept: Je,
|
|
137
|
+
templateAccept: Xe,
|
|
138
|
+
label: Ze,
|
|
139
|
+
align: qe,
|
|
140
|
+
side: et,
|
|
141
|
+
importTemplateLabel: tt,
|
|
142
|
+
exportTemplateLabel: lt,
|
|
143
|
+
importCsvLabel: at,
|
|
144
|
+
exportCsvLabel: rt,
|
|
145
|
+
clearLabel: ot
|
|
131
146
|
}) {
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
[
|
|
159
|
-
), b = o.useCallback(
|
|
160
|
-
(e) => !p || !h ? e : { ...e, [x]: h },
|
|
161
|
-
[h, x, p]
|
|
162
|
-
), w = o.useCallback(
|
|
163
|
-
(e) => {
|
|
164
|
-
if (!p || !d) {
|
|
165
|
-
m(e);
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const r = new Map(s);
|
|
169
|
-
[...r.keys()].forEach((i) => {
|
|
170
|
-
te(d, i) && r.delete(i);
|
|
171
|
-
}), e.forEach((i, f) => {
|
|
172
|
-
r.set(J(f), b(i));
|
|
173
|
-
}), m(r);
|
|
174
|
-
},
|
|
175
|
-
[d, p, m, b, J, s]
|
|
147
|
+
const e = wt({
|
|
148
|
+
values: v,
|
|
149
|
+
onChange: C,
|
|
150
|
+
selection: n,
|
|
151
|
+
onSelectionChange: E,
|
|
152
|
+
emptyEntry: A,
|
|
153
|
+
mergeOnApply: J,
|
|
154
|
+
staged: q,
|
|
155
|
+
onStagedChange: ee,
|
|
156
|
+
fields: f,
|
|
157
|
+
cycleFieldOnWellDoubleClick: Z,
|
|
158
|
+
plates: de,
|
|
159
|
+
activePlateId: ce,
|
|
160
|
+
onPlateChange: me,
|
|
161
|
+
plateBarcodeField: B,
|
|
162
|
+
applyScope: we,
|
|
163
|
+
onImportCsv: O
|
|
164
|
+
});
|
|
165
|
+
u.useImperativeHandle(
|
|
166
|
+
Ve,
|
|
167
|
+
() => ({
|
|
168
|
+
apply: (l) => e.applyStagedToSelection(l),
|
|
169
|
+
clear: (l) => e.clearWells(l),
|
|
170
|
+
setStaged: (l) => e.setStaged(l),
|
|
171
|
+
getStaged: () => e.staged
|
|
172
|
+
}),
|
|
173
|
+
[e]
|
|
176
174
|
);
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (c.size === 0) return;
|
|
187
|
-
const e = new Map(g);
|
|
188
|
-
c.forEach((r) => {
|
|
189
|
-
const f = e.get(r) ?? A(r), T = b(nt(f, K, r));
|
|
190
|
-
e.set(r, T);
|
|
191
|
-
}), w(e);
|
|
192
|
-
}, st = () => {
|
|
193
|
-
if (c.size === 0) return;
|
|
194
|
-
const e = new Map(g);
|
|
195
|
-
c.forEach((r) => e.delete(r)), w(e);
|
|
196
|
-
}, lt = o.useCallback(
|
|
197
|
-
(e) => {
|
|
198
|
-
if (!u?.options?.length) return;
|
|
199
|
-
const r = new Map(g), i = r.get(e), f = i?.[u.key], T = u.options.findIndex((B) => B.value === f), Q = u.options[(T + 1) % u.options.length];
|
|
200
|
-
if (!Q) return;
|
|
201
|
-
const ft = i ?? A(e);
|
|
202
|
-
r.set(e, b({ ...ft, [u.key]: Q.value })), w(r), U((B) => ({ wellId: e, key: (B?.key ?? 0) + 1 }));
|
|
203
|
-
},
|
|
204
|
-
[w, u, A, g, b]
|
|
205
|
-
), it = o.useMemo(() => !p || !h || H || S.some(
|
|
206
|
-
(i) => i.field === x || i.id === x
|
|
207
|
-
) ? S : [{
|
|
208
|
-
id: x,
|
|
209
|
-
header: D,
|
|
175
|
+
const d = {
|
|
176
|
+
...M,
|
|
177
|
+
filterable: ze ?? M?.filterable,
|
|
178
|
+
groupable: Fe ?? M?.groupable
|
|
179
|
+
}, g = B ?? Pt, N = e.activePlate?.barcode, nt = u.useMemo(() => !e.isPlateScoped || !N || H || h.some(
|
|
180
|
+
(o) => o.field === g || o.id === g
|
|
181
|
+
) ? h : [{
|
|
182
|
+
id: g,
|
|
183
|
+
header: k,
|
|
210
184
|
minWidth: 150,
|
|
211
|
-
render: ({ row:
|
|
212
|
-
const
|
|
213
|
-
return /* @__PURE__ */
|
|
185
|
+
render: ({ row: o }) => {
|
|
186
|
+
const m = o[g] ?? N;
|
|
187
|
+
return /* @__PURE__ */ t(bt, { variant: "outline", children: String(m) });
|
|
188
|
+
}
|
|
189
|
+
}, ...h], [
|
|
190
|
+
N,
|
|
191
|
+
g,
|
|
192
|
+
H,
|
|
193
|
+
e.isPlateScoped,
|
|
194
|
+
k,
|
|
195
|
+
h
|
|
196
|
+
]), [R, D] = u.useState(!1);
|
|
197
|
+
u.useEffect(() => D(!1), [n]), u.useEffect(() => {
|
|
198
|
+
if (!i) return;
|
|
199
|
+
const l = (c) => {
|
|
200
|
+
const o = c.target;
|
|
201
|
+
o?.closest?.("[data-well]") || o?.closest?.('[data-slot="well-quick-paint"]') || D(!0);
|
|
202
|
+
};
|
|
203
|
+
return document.addEventListener("pointerdown", l, !0), () => document.removeEventListener("pointerdown", l, !0);
|
|
204
|
+
}, [i]);
|
|
205
|
+
const it = u.useMemo(() => {
|
|
206
|
+
if (!i || n.size === 0 || R) return;
|
|
207
|
+
const l = f.find((m) => m.key === i);
|
|
208
|
+
if (l?.kind !== "select" || !l.options?.length) return;
|
|
209
|
+
let c, o = !0;
|
|
210
|
+
for (const m of n) {
|
|
211
|
+
const U = e.scopedValues.get(m)?.[i], Q = typeof U == "string" ? U : void 0;
|
|
212
|
+
if (o)
|
|
213
|
+
c = Q, o = !1;
|
|
214
|
+
else if (c !== Q) {
|
|
215
|
+
c = void 0;
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
214
218
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
return /* @__PURE__ */ t(
|
|
220
|
+
St,
|
|
221
|
+
{
|
|
222
|
+
options: l.options,
|
|
223
|
+
activeValue: c,
|
|
224
|
+
selectionSize: n.size,
|
|
225
|
+
onPick: (m) => {
|
|
226
|
+
e.applyToSelection({ [i]: m }), D(!0);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
}, [f, R, i, n, e]), st = Wt(e.availablePlates.length, F), pt = I === "plate" && P ? /* @__PURE__ */ t("div", { className: "mt-3 border-t pt-3", children: P }) : void 0, V = S === "top" || S === "bottom", dt = S === "start" || S === "top", ct = typeof y == "number" ? `${y}px` : y, j = ne ? null : /* @__PURE__ */ t(
|
|
231
|
+
T,
|
|
232
|
+
{
|
|
233
|
+
"data-plate-map-region": "form",
|
|
234
|
+
className: w(
|
|
235
|
+
// Full-width and free to shrink by default; the fixed column width only
|
|
236
|
+
// applies from `stackAt` up, which is what keeps narrow viewports clean.
|
|
237
|
+
"flex w-full min-w-0 flex-col",
|
|
238
|
+
!V && Tt[L],
|
|
239
|
+
p?.formCard
|
|
240
|
+
),
|
|
241
|
+
size: "sm",
|
|
242
|
+
children: /* @__PURE__ */ t(W, { className: "flex h-full flex-1 flex-col gap-3", children: /* @__PURE__ */ t(
|
|
243
|
+
ut,
|
|
222
244
|
{
|
|
223
|
-
fields:
|
|
224
|
-
value:
|
|
225
|
-
onChange:
|
|
226
|
-
selectionSize:
|
|
227
|
-
onApply:
|
|
228
|
-
onClear:
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
245
|
+
fields: f,
|
|
246
|
+
value: e.staged,
|
|
247
|
+
onChange: e.setStaged,
|
|
248
|
+
selectionSize: n.size,
|
|
249
|
+
onApply: e.applyStagedToSelection,
|
|
250
|
+
onClear: e.clearWells,
|
|
251
|
+
applyLabel: s?.apply,
|
|
252
|
+
clearLabel: s?.clearWells,
|
|
253
|
+
selectionEmptyLabel: s?.selectionEmpty,
|
|
254
|
+
selectionCountLabel: s?.selectionCount,
|
|
255
|
+
extras: re,
|
|
256
|
+
legend: I === "form" ? P : void 0,
|
|
257
|
+
formSlot: oe,
|
|
258
|
+
className: p?.form
|
|
232
259
|
}
|
|
233
|
-
) })
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
260
|
+
) })
|
|
261
|
+
},
|
|
262
|
+
"form"
|
|
263
|
+
), G = /* @__PURE__ */ x(
|
|
264
|
+
T,
|
|
265
|
+
{
|
|
266
|
+
"data-plate-map-region": "plate",
|
|
267
|
+
className: w("flex w-full min-w-0 flex-1 flex-col", p?.plateCard),
|
|
268
|
+
size: "sm",
|
|
269
|
+
children: [
|
|
270
|
+
/* @__PURE__ */ x(K, { className: "border-b", children: [
|
|
271
|
+
/* @__PURE__ */ x("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
|
|
272
|
+
/* @__PURE__ */ t(Y, { className: "min-w-0", children: ie }),
|
|
273
|
+
/* @__PURE__ */ t(
|
|
274
|
+
It,
|
|
240
275
|
{
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
276
|
+
visible: st,
|
|
277
|
+
plates: e.availablePlates,
|
|
278
|
+
activePlateId: e.activePlate?.id,
|
|
279
|
+
onPlateChange: e.canChangePlate ? e.handlePlateChange : void 0,
|
|
280
|
+
onAddPlate: F,
|
|
281
|
+
onRemovePlate: fe,
|
|
282
|
+
addPlateLabel: ue,
|
|
283
|
+
removePlateLabel: xe,
|
|
284
|
+
label: he,
|
|
285
|
+
variant: ge
|
|
250
286
|
}
|
|
251
|
-
)
|
|
287
|
+
)
|
|
252
288
|
] }),
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
-
|
|
289
|
+
/* @__PURE__ */ t(Ct, { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ t(
|
|
290
|
+
ft,
|
|
255
291
|
{
|
|
256
|
-
templates:
|
|
257
|
-
templateId:
|
|
258
|
-
onTemplateChange:
|
|
259
|
-
onClearTemplate:
|
|
260
|
-
hasEntries:
|
|
261
|
-
onImportCsv:
|
|
262
|
-
onExportCsv:
|
|
263
|
-
onImportTemplate:
|
|
292
|
+
templates: je,
|
|
293
|
+
templateId: Ge,
|
|
294
|
+
onTemplateChange: Ue,
|
|
295
|
+
onClearTemplate: Qe,
|
|
296
|
+
hasEntries: v.size > 0,
|
|
297
|
+
onImportCsv: O ? e.handleImportCsv : void 0,
|
|
298
|
+
onExportCsv: Ke,
|
|
299
|
+
onImportTemplate: Ye,
|
|
264
300
|
onExportTemplate: $e,
|
|
265
|
-
csvAccept:
|
|
266
|
-
templateAccept:
|
|
267
|
-
label:
|
|
268
|
-
align:
|
|
269
|
-
side:
|
|
270
|
-
importTemplateLabel:
|
|
271
|
-
exportTemplateLabel:
|
|
272
|
-
importCsvLabel:
|
|
273
|
-
exportCsvLabel:
|
|
274
|
-
clearLabel:
|
|
301
|
+
csvAccept: Je,
|
|
302
|
+
templateAccept: Xe,
|
|
303
|
+
label: Ze,
|
|
304
|
+
align: qe,
|
|
305
|
+
side: et,
|
|
306
|
+
importTemplateLabel: tt,
|
|
307
|
+
exportTemplateLabel: lt,
|
|
308
|
+
importCsvLabel: at,
|
|
309
|
+
exportCsvLabel: rt,
|
|
310
|
+
clearLabel: ot
|
|
275
311
|
}
|
|
276
312
|
) })
|
|
277
313
|
] }),
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
|
|
314
|
+
/* @__PURE__ */ t(W, { className: "min-w-0", children: /* @__PURE__ */ t(
|
|
315
|
+
xt,
|
|
280
316
|
{
|
|
281
|
-
format:
|
|
282
|
-
rows:
|
|
283
|
-
columns:
|
|
284
|
-
values:
|
|
285
|
-
selection:
|
|
286
|
-
onSelectionChange:
|
|
287
|
-
colorForWell:
|
|
288
|
-
fields:
|
|
289
|
-
renderHoverSummary:
|
|
290
|
-
hoveredWellId:
|
|
291
|
-
onHoveredWellChange: (
|
|
292
|
-
|
|
317
|
+
format: r,
|
|
318
|
+
rows: a,
|
|
319
|
+
columns: b,
|
|
320
|
+
values: e.scopedValues,
|
|
321
|
+
selection: n,
|
|
322
|
+
onSelectionChange: E,
|
|
323
|
+
colorForWell: $,
|
|
324
|
+
fields: f,
|
|
325
|
+
renderHoverSummary: Ce,
|
|
326
|
+
hoveredWellId: e.hoveredWellId,
|
|
327
|
+
onHoveredWellChange: (l) => {
|
|
328
|
+
e.setHoveredWellId(l), We?.(l);
|
|
293
329
|
},
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
330
|
+
banner: pe,
|
|
331
|
+
toolbar: se,
|
|
332
|
+
footer: pt,
|
|
333
|
+
hideSelectionControls: Ae,
|
|
334
|
+
selectAllLabel: s?.selectAll,
|
|
335
|
+
deselectAllLabel: s?.deselectAll,
|
|
336
|
+
emptyWellFillColor: Pe,
|
|
337
|
+
wellShape: ye,
|
|
338
|
+
framed: Ne,
|
|
339
|
+
wrapWell: De,
|
|
340
|
+
quickPaint: it,
|
|
341
|
+
highlightedWellIds: Te,
|
|
342
|
+
onWellDoubleClick: e.cycleWellField,
|
|
343
|
+
selectionFillMode: Me,
|
|
344
|
+
flashWellId: e.flashWell?.wellId,
|
|
345
|
+
flashWellKey: e.flashWell?.key,
|
|
346
|
+
cellSize: Ee,
|
|
347
|
+
autoScale: Be,
|
|
348
|
+
minCellSize: ke,
|
|
349
|
+
maxCellSize: He,
|
|
350
|
+
groups: ve,
|
|
351
|
+
activeGroupId: Se,
|
|
352
|
+
onGroupClick: be,
|
|
353
|
+
className: p?.grid
|
|
311
354
|
}
|
|
312
|
-
) })
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
355
|
+
) }),
|
|
356
|
+
z ? /* @__PURE__ */ t(Et, { className: "flex flex-wrap items-center gap-2 border-t", children: z }) : null
|
|
357
|
+
]
|
|
358
|
+
},
|
|
359
|
+
"plate"
|
|
360
|
+
), mt = dt ? [j, G] : [G, j];
|
|
361
|
+
return /* @__PURE__ */ x("div", { "data-slot": "plate-map-editor", className: w("flex w-full min-w-0 flex-col gap-4", Oe), style: Re, children: [
|
|
362
|
+
/* @__PURE__ */ t(At, { title: te, badges: le }),
|
|
363
|
+
ae,
|
|
364
|
+
/* @__PURE__ */ t(
|
|
365
|
+
"div",
|
|
366
|
+
{
|
|
367
|
+
"data-slot": "plate-map-editor-container",
|
|
368
|
+
className: "@container w-full min-w-0",
|
|
369
|
+
style: { "--plate-map-form-width": ct },
|
|
370
|
+
children: /* @__PURE__ */ t(
|
|
371
|
+
"div",
|
|
372
|
+
{
|
|
373
|
+
"data-slot": "plate-map-editor-layout",
|
|
374
|
+
className: w(
|
|
375
|
+
"flex w-full min-w-0 flex-col gap-3",
|
|
376
|
+
!V && Dt[L],
|
|
377
|
+
p?.layout
|
|
378
|
+
),
|
|
379
|
+
children: mt
|
|
380
|
+
}
|
|
381
|
+
)
|
|
382
|
+
}
|
|
383
|
+
),
|
|
384
|
+
/* @__PURE__ */ t(
|
|
385
|
+
Lt,
|
|
386
|
+
{
|
|
387
|
+
hidden: Ie,
|
|
388
|
+
title: _e,
|
|
389
|
+
cardClassName: p?.manifestCard,
|
|
390
|
+
slot: Le,
|
|
391
|
+
manifest: /* @__PURE__ */ t(
|
|
392
|
+
ht,
|
|
393
|
+
{
|
|
394
|
+
values: e.scopedValues,
|
|
395
|
+
onChange: e.commitScopedValues,
|
|
396
|
+
columns: nt,
|
|
397
|
+
fields: f,
|
|
398
|
+
selection: n,
|
|
399
|
+
onSelectionChange: E,
|
|
400
|
+
emptyEntry: A,
|
|
401
|
+
isPopulated: X,
|
|
402
|
+
filterable: d.filterable,
|
|
403
|
+
filterColumns: d.filterColumns,
|
|
404
|
+
groupable: d.groupable,
|
|
405
|
+
defaultGroupBy: d.defaultGroupBy,
|
|
406
|
+
pageSize: d.pageSize,
|
|
407
|
+
pageSizeOptions: d.pageSizeOptions,
|
|
408
|
+
enableFillDown: d.enableFillDown,
|
|
409
|
+
labels: s,
|
|
410
|
+
className: p?.manifest
|
|
411
|
+
}
|
|
412
|
+
)
|
|
413
|
+
}
|
|
414
|
+
),
|
|
415
|
+
_ ? /* @__PURE__ */ t("div", { className: "flex flex-wrap justify-end gap-2 pt-2", children: _ }) : null
|
|
334
416
|
] });
|
|
335
417
|
}
|
|
336
418
|
export {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
419
|
+
bt as PlateBadge,
|
|
420
|
+
Ut as PlateMapEditor,
|
|
421
|
+
Yt as getPlateMapScopedWellId
|
|
340
422
|
};
|
|
341
423
|
//# sourceMappingURL=PlateMapEditor.js.map
|