@morscherlab/mint-sdk 1.4.0-beta.20 → 1.4.0-beta.22
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/{AlertBox-CzLg0UaL.js → AlertBox-DwgNTEqf.js} +3 -3
- package/dist/{AlertBox-CzLg0UaL.js.map → AlertBox-DwgNTEqf.js.map} +1 -1
- package/dist/{AppSidebar-6oTT-gPO.js → AppSidebar-CZZaxni0.js} +7 -7
- package/dist/{AppSidebar-6oTT-gPO.js.map → AppSidebar-CZZaxni0.js.map} +1 -1
- package/dist/{ConfirmDialog-CSls2Nuv.js → ConfirmDialog-CjWoxAD1.js} +2 -2
- package/dist/{ConfirmDialog-CSls2Nuv.js.map → ConfirmDialog-CjWoxAD1.js.map} +1 -1
- package/dist/{ExperimentPopover-9l4QZlvQ.js → ExperimentPopover-DujiuQIO.js} +5 -5
- package/dist/{ExperimentPopover-9l4QZlvQ.js.map → ExperimentPopover-DujiuQIO.js.map} +1 -1
- package/dist/{ExperimentSelectorModal-pR5fK3pA.js → ExperimentSelectorModal-B4j4eUOJ.js} +5 -5
- package/dist/{ExperimentSelectorModal-pR5fK3pA.js.map → ExperimentSelectorModal-B4j4eUOJ.js.map} +1 -1
- package/dist/{SegmentedControl-CJ7EAmOq.js → SegmentedControl-DyUPH3I5.js} +2 -2
- package/dist/{SegmentedControl-CJ7EAmOq.js.map → SegmentedControl-DyUPH3I5.js.map} +1 -1
- package/dist/{SettingsModal-Dyitgzfp.js → SettingsModal-D2MOOtuO.js} +7 -7
- package/dist/{SettingsModal-Dyitgzfp.js.map → SettingsModal-D2MOOtuO.js.map} +1 -1
- package/dist/__tests__/components/FloatingPanelsInModal.test.d.ts +1 -0
- package/dist/__tests__/composables/useFloatingPanel.test.d.ts +1 -0
- package/dist/components/SmartGroupFieldRecipe.vue.d.ts +2 -2
- package/dist/components/internal/AutoGroupModalInternal.vue.d.ts +2 -2
- package/dist/composables/useFileImport.d.ts +7 -0
- package/dist/composables/useFloatingPanel.d.ts +29 -0
- package/dist/{controlSchemaModel-DCUOx8ll.js → controlSchemaModel-Bsg0t5Ab.js} +2 -2
- package/dist/{controlSchemaModel-DCUOx8ll.js.map → controlSchemaModel-Bsg0t5Ab.js.map} +1 -1
- package/dist/{data-DBnmeBZX.js → data-Boeh4uPI.js} +12 -11
- package/dist/{data-DBnmeBZX.js.map → data-Boeh4uPI.js.map} +1 -1
- package/dist/data.d.ts +1 -1
- package/dist/data.js +9 -9
- package/dist/{experimentStatus-BFrKpHAH.js → experimentStatus-DCn2QKG7.js} +2 -2
- package/dist/{experimentStatus-BFrKpHAH.js.map → experimentStatus-DCn2QKG7.js.map} +1 -1
- package/dist/index.js +18 -18
- package/dist/{install-qjELyNwc.js → install-BEHp7Mo-.js} +15 -15
- package/dist/{install-qjELyNwc.js.map → install-BEHp7Mo-.js.map} +1 -1
- package/dist/install.js +1 -1
- package/dist/{lab-UyTbokQC.js → lab-D61eaX6f.js} +10 -10
- package/dist/{lab-UyTbokQC.js.map → lab-D61eaX6f.js.map} +1 -1
- package/dist/lab.js +4 -4
- package/dist/{records-CR_pYzIP.js → records-D4aQXyZu.js} +132 -72
- package/dist/records-D4aQXyZu.js.map +1 -0
- package/dist/{runtime-CoHhBP10.js → runtime-q-R0CNLh.js} +9 -9
- package/dist/{runtime-CoHhBP10.js.map → runtime-q-R0CNLh.js.map} +1 -1
- package/dist/runtime.js +6 -6
- package/dist/{shell-BDuZf2zb.js → shell-6CGFvUUw.js} +5 -5
- package/dist/{shell-BDuZf2zb.js.map → shell-6CGFvUUw.js.map} +1 -1
- package/dist/shell.js +5 -5
- package/dist/styles.css +36 -33
- package/dist/{useDropdownState-Bb2N4m40.js → useDropdownState-uFIz6Yv8.js} +2 -2
- package/dist/useDropdownState-uFIz6Yv8.js.map +1 -0
- package/dist/{useExperimentSamples-Dno1fFMq.js → useExperimentSamples-QEFoq4tf.js} +47 -5
- package/dist/useExperimentSamples-QEFoq4tf.js.map +1 -0
- package/dist/{useListReorder-CQ9OCScc.js → useListReorder-DsuzwWGS.js} +47 -97
- package/dist/useListReorder-DsuzwWGS.js.map +1 -0
- package/dist/{useRackEditor-wL3kPrRT.js → useRackEditor-KpZ4iJ6o.js} +20 -30
- package/dist/useRackEditor-KpZ4iJ6o.js.map +1 -0
- package/dist/{useRealtime-C3whhVvb.js → useRealtime-B58Lo-Tm.js} +3 -3
- package/dist/{useRealtime-C3whhVvb.js.map → useRealtime-B58Lo-Tm.js.map} +1 -1
- package/dist/{useRequest-CDkrXNU7.js → useRequest-BuDmW8Jc.js} +7 -36
- package/dist/useRequest-BuDmW8Jc.js.map +1 -0
- package/package.json +3 -2
- package/src/__tests__/components/ActionMenu.test.ts +2 -2
- package/src/__tests__/components/BaseModal.test.ts +13 -0
- package/src/__tests__/components/FloatingPanelsInModal.test.ts +94 -0
- package/src/__tests__/composables/useFileImport.test.ts +36 -0
- package/src/__tests__/composables/useFloatingPanel.test.ts +68 -0
- package/src/__tests__/fixtures/table-import/cells.xlsx +0 -0
- package/src/__tests__/fixtures/table-import/samples.xlsx +0 -0
- package/src/components/ActionMenu.vue +6 -37
- package/src/components/BaseModal.vue +2 -1
- package/src/components/Tooltip.vue +9 -32
- package/src/components/internal/DatePickerDateInternal.vue +7 -45
- package/src/components/internal/DatePickerDateTimeInternal.vue +7 -1
- package/src/components/internal/DatePickerTimeInternal.vue +8 -1
- package/src/components/internal/NumberUnitInputInternal.vue +4 -18
- package/src/components/internal/SelectMultipleInternal.vue +6 -1
- package/src/components/internal/SelectSearchableInternal.vue +6 -1
- package/src/components/internal/WellEditPopupInternal.vue +11 -22
- package/src/composables/useFileImport.ts +51 -1
- package/src/composables/useFloatingPanel.ts +107 -0
- package/src/data.ts +1 -0
- package/src/styles/components/action-menu.css +1 -1
- package/src/styles/components/app-layout.css +3 -1
- package/src/styles/components/date-picker.css +4 -2
- package/src/styles/components/datetime-picker.css +4 -4
- package/src/styles/components/jobs-status-tray.css +3 -3
- package/src/styles/components/modal.css +1 -1
- package/src/styles/components/onboarding.css +2 -2
- package/src/styles/components/searchable-select.css +3 -7
- package/src/styles/components/time-picker.css +3 -6
- package/src/styles/components/toast.css +1 -1
- package/src/styles/components/tooltip.css +2 -2
- package/src/styles/components/unit-input.css +1 -1
- package/src/styles/components/well-edit-popup.css +2 -2
- package/src/styles/variables.css +6 -0
- package/dist/records-CR_pYzIP.js.map +0 -1
- package/dist/useDropdownState-Bb2N4m40.js.map +0 -1
- package/dist/useExperimentSamples-Dno1fFMq.js.map +0 -1
- package/dist/useListReorder-CQ9OCScc.js.map +0 -1
- package/dist/useRackEditor-wL3kPrRT.js.map +0 -1
- package/dist/useRequest-CDkrXNU7.js.map +0 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
autoUpdate,
|
|
3
|
+
computePosition,
|
|
4
|
+
flip,
|
|
5
|
+
hide,
|
|
6
|
+
offset,
|
|
7
|
+
shift,
|
|
8
|
+
size,
|
|
9
|
+
type Placement,
|
|
10
|
+
type ReferenceElement,
|
|
11
|
+
} from '@floating-ui/dom'
|
|
12
|
+
import { onScopeDispose, ref, toValue, watch, type MaybeRefOrGetter, type Ref } from 'vue'
|
|
13
|
+
|
|
14
|
+
// Internal: not exported from the package entry points.
|
|
15
|
+
|
|
16
|
+
export interface UseFloatingPanelOptions {
|
|
17
|
+
/** Default `'bottom-start'`. */
|
|
18
|
+
placement?: MaybeRefOrGetter<Placement>
|
|
19
|
+
/** Gap to the reference in px. Default 4. */
|
|
20
|
+
offset?: number
|
|
21
|
+
/** At least the reference width, at most 28rem (selects). */
|
|
22
|
+
matchWidth?: boolean
|
|
23
|
+
/** Re-place on scroll, resize and layout shift while open. Default `true`. */
|
|
24
|
+
follow?: boolean
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface UseFloatingPanelReturn {
|
|
28
|
+
/** Bind to the panel: `position: fixed`, `left`, `top`, and `visibility: hidden` while the reference is scrolled out of view. */
|
|
29
|
+
style: Ref<Record<string, string>>
|
|
30
|
+
/** The placement after flip, for arrows and transitions. */
|
|
31
|
+
placement: Ref<Placement>
|
|
32
|
+
update: () => Promise<void>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Places `floating` next to `reference` with fixed positioning (offset, flip,
|
|
37
|
+
* shift, size, hide). A fixed panel escapes the `overflow` of its ancestors (a
|
|
38
|
+
* modal body) unless one of them has a transform, so it can stay in the DOM right
|
|
39
|
+
* after its trigger: Tab order, focus traps and outside-click checks are those of
|
|
40
|
+
* an in-place panel. The size middleware publishes the free height as
|
|
41
|
+
* `--mint-floating-available-height`; a panel whose list scrolls caps its
|
|
42
|
+
* `max-height` with it.
|
|
43
|
+
*/
|
|
44
|
+
export function useFloatingPanel(
|
|
45
|
+
reference: MaybeRefOrGetter<ReferenceElement | null>,
|
|
46
|
+
floating: Ref<HTMLElement | null>,
|
|
47
|
+
open: Ref<boolean>,
|
|
48
|
+
options: UseFloatingPanelOptions = {},
|
|
49
|
+
): UseFloatingPanelReturn {
|
|
50
|
+
const style = ref<Record<string, string>>({ position: 'fixed', left: '0px', top: '0px' })
|
|
51
|
+
const placement = ref<Placement>(toValue(options.placement) ?? 'bottom-start')
|
|
52
|
+
|
|
53
|
+
async function update(): Promise<void> {
|
|
54
|
+
const referenceEl = toValue(reference)
|
|
55
|
+
const floatingEl = floating.value
|
|
56
|
+
if (!referenceEl || !floatingEl) return
|
|
57
|
+
const result = await computePosition(referenceEl, floatingEl, {
|
|
58
|
+
placement: toValue(options.placement) ?? 'bottom-start',
|
|
59
|
+
strategy: 'fixed',
|
|
60
|
+
middleware: [
|
|
61
|
+
offset(options.offset ?? 4),
|
|
62
|
+
flip(),
|
|
63
|
+
shift({ padding: 8 }),
|
|
64
|
+
size({
|
|
65
|
+
padding: 8,
|
|
66
|
+
// Written to the element, not the reactive style: floating-ui measures again right after.
|
|
67
|
+
apply({ availableHeight, rects, elements }) {
|
|
68
|
+
const target = elements.floating.style
|
|
69
|
+
target.setProperty('--mint-floating-available-height', `${Math.max(0, availableHeight)}px`)
|
|
70
|
+
if (options.matchWidth) {
|
|
71
|
+
target.minWidth = `${rects.reference.width}px`
|
|
72
|
+
target.maxWidth = '28rem'
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
}),
|
|
76
|
+
hide(),
|
|
77
|
+
],
|
|
78
|
+
})
|
|
79
|
+
const next: Record<string, string> = { position: 'fixed', left: `${result.x}px`, top: `${result.y}px` }
|
|
80
|
+
// The trigger scrolled out of its scroll container: keep the panel open, but not floating detached.
|
|
81
|
+
if (result.middlewareData.hide?.referenceHidden) next.visibility = 'hidden'
|
|
82
|
+
// autoUpdate fires on every scroll; re-render only when the panel changes.
|
|
83
|
+
const current = style.value
|
|
84
|
+
if (current.left !== next.left || current.top !== next.top || current.visibility !== next.visibility) style.value = next
|
|
85
|
+
placement.value = result.placement
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let stop: (() => void) | undefined
|
|
89
|
+
function release(): void {
|
|
90
|
+
stop?.()
|
|
91
|
+
stop = undefined
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
watch(
|
|
95
|
+
[open, () => toValue(reference), floating],
|
|
96
|
+
([isOpen, referenceEl, floatingEl]) => {
|
|
97
|
+
release()
|
|
98
|
+
if (!isOpen || !referenceEl || !floatingEl) return
|
|
99
|
+
if (options.follow ?? true) stop = autoUpdate(referenceEl, floatingEl, () => void update())
|
|
100
|
+
else void update()
|
|
101
|
+
},
|
|
102
|
+
{ flush: 'post', immediate: true },
|
|
103
|
+
)
|
|
104
|
+
onScopeDispose(release)
|
|
105
|
+
|
|
106
|
+
return { style, placement, update }
|
|
107
|
+
}
|
package/src/data.ts
CHANGED
|
@@ -124,8 +124,10 @@
|
|
|
124
124
|
transform: translateX(calc(100% + 1rem));
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
/* `none`, not translateX(0): any transform makes the sidebar the containing
|
|
128
|
+
block of its fixed dropdown panels, and its overflow would clip them. */
|
|
127
129
|
.mint-layout--responsive-sidebar.mint-layout--sidebar-open .mint-layout__sidebar {
|
|
128
|
-
transform:
|
|
130
|
+
transform: none;
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
.mint-layout--responsive-sidebar .mint-layout__sidebar-toggle {
|
|
@@ -130,11 +130,13 @@
|
|
|
130
130
|
height: 0.875rem;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
/* Calendar dropdown (teleported to body, positioned
|
|
133
|
+
/* Calendar dropdown (teleported to body, positioned by useFloatingPanel). */
|
|
134
134
|
.mint-date-picker__dropdown {
|
|
135
135
|
position: fixed;
|
|
136
|
-
z-index:
|
|
136
|
+
z-index: var(--mint-z-popover);
|
|
137
137
|
width: 252px;
|
|
138
|
+
max-height: var(--mint-floating-available-height, none);
|
|
139
|
+
overflow-y: auto;
|
|
138
140
|
padding: 0.5rem;
|
|
139
141
|
}
|
|
140
142
|
|
|
@@ -97,12 +97,12 @@
|
|
|
97
97
|
color: var(--text-muted);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
/* Dropdown —
|
|
100
|
+
/* Dropdown — the look is .mint-popover; useFloatingPanel sets the fixed position. */
|
|
101
101
|
.mint-datetime-picker__dropdown {
|
|
102
|
-
|
|
103
|
-
z-index: 50;
|
|
104
|
-
margin-top: 0.25rem;
|
|
102
|
+
z-index: var(--mint-z-popover);
|
|
105
103
|
width: 18rem;
|
|
104
|
+
max-height: var(--mint-floating-available-height, none);
|
|
105
|
+
overflow-y: auto;
|
|
106
106
|
padding: 0.625rem;
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
.mint-jobs-tray__scrim {
|
|
15
15
|
position: fixed;
|
|
16
16
|
inset: 0;
|
|
17
|
-
z-index:
|
|
17
|
+
z-index: calc(var(--mint-z-tray) - 1);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.mint-jobs-tray__panel {
|
|
21
21
|
position: fixed;
|
|
22
22
|
top: calc(4.5rem + env(safe-area-inset-top));
|
|
23
23
|
right: max(1rem, env(safe-area-inset-right));
|
|
24
|
-
z-index:
|
|
24
|
+
z-index: var(--mint-z-tray);
|
|
25
25
|
display: flex;
|
|
26
26
|
width: min(360px, calc(100vw - 2rem));
|
|
27
27
|
max-height: 75vh;
|
|
@@ -281,5 +281,5 @@
|
|
|
281
281
|
|
|
282
282
|
/* The tray's confirm dialog sits above the tray and its scrim (BaseModal drops class fallthrough). */
|
|
283
283
|
.mint-modal:has(.mint-jobs-tray__confirm) {
|
|
284
|
-
z-index:
|
|
284
|
+
z-index: calc(var(--mint-z-tray) + 1);
|
|
285
285
|
}
|
|
@@ -94,7 +94,7 @@ html.dark {
|
|
|
94
94
|
|
|
95
95
|
.mint-onboarding-help__panel {
|
|
96
96
|
position: fixed;
|
|
97
|
-
z-index:
|
|
97
|
+
z-index: var(--mint-z-tray);
|
|
98
98
|
width: 18rem;
|
|
99
99
|
padding: 0 0 4px;
|
|
100
100
|
overflow: hidden;
|
|
@@ -229,7 +229,7 @@ html.dark {
|
|
|
229
229
|
.mint-onboarding {
|
|
230
230
|
position: fixed;
|
|
231
231
|
inset: 0;
|
|
232
|
-
z-index:
|
|
232
|
+
z-index: var(--mint-z-tour);
|
|
233
233
|
pointer-events: none;
|
|
234
234
|
}
|
|
235
235
|
|
|
@@ -30,14 +30,10 @@
|
|
|
30
30
|
.mint-searchable-select__value { flex: 1; min-width: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
|
|
31
31
|
.mint-searchable-select__value--placeholder { color: var(--text-muted); }
|
|
32
32
|
|
|
33
|
-
/* Surface = .mint-popover (2d)
|
|
33
|
+
/* Surface = .mint-popover (2d). useFloatingPanel sets the fixed position and width. */
|
|
34
34
|
.mint-searchable-select__panel {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
right: 0;
|
|
38
|
-
left: 0;
|
|
39
|
-
z-index: 30;
|
|
40
|
-
max-height: min(38rem, 80vh);
|
|
35
|
+
z-index: var(--mint-z-popover);
|
|
36
|
+
max-height: min(38rem, 80vh, var(--mint-floating-available-height, 100vh));
|
|
41
37
|
overflow: hidden;
|
|
42
38
|
}
|
|
43
39
|
|
|
@@ -124,13 +124,10 @@
|
|
|
124
124
|
height: 0.875rem;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
/* Dropdown —
|
|
127
|
+
/* Dropdown — the look is .mint-popover; useFloatingPanel sets the fixed position and the field width. */
|
|
128
128
|
.mint-time-picker__dropdown {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
margin-top: 0.25rem;
|
|
132
|
-
width: 100%;
|
|
133
|
-
min-width: 100%;
|
|
129
|
+
z-index: var(--mint-z-popover);
|
|
130
|
+
max-height: var(--mint-floating-available-height, none);
|
|
134
131
|
overflow: hidden;
|
|
135
132
|
}
|
|
136
133
|
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
.mint-well-edit-popup__backdrop {
|
|
6
6
|
position: fixed;
|
|
7
7
|
inset: 0;
|
|
8
|
-
z-index:
|
|
8
|
+
z-index: calc(var(--mint-z-popover) - 1);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.mint-well-edit-popup {
|
|
12
12
|
position: fixed;
|
|
13
|
-
z-index:
|
|
13
|
+
z-index: var(--mint-z-popover);
|
|
14
14
|
width: 300px;
|
|
15
15
|
padding: 0;
|
|
16
16
|
overflow: hidden;
|
package/src/styles/variables.css
CHANGED
|
@@ -192,6 +192,12 @@
|
|
|
192
192
|
--mint-border-focus: var(--color-primary);
|
|
193
193
|
/* Colour-only transitions; no lift, bounce or glow. */
|
|
194
194
|
--mint-transition: 120ms ease;
|
|
195
|
+
/* Stacking layers: modal < jobs tray < onboarding tour < floating panels < tooltips and toasts. */
|
|
196
|
+
--mint-z-modal: 50;
|
|
197
|
+
--mint-z-tray: 1000;
|
|
198
|
+
--mint-z-tour: 1100;
|
|
199
|
+
--mint-z-popover: 1200;
|
|
200
|
+
--mint-z-toast: 9999;
|
|
195
201
|
}
|
|
196
202
|
|
|
197
203
|
/* ==========================================================================
|