@morscherlab/mint-sdk 1.0.0-alpha.2
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 +326 -0
- package/dist/__stories__/experiment-helpers.d.ts +25 -0
- package/dist/__tests__/components/AppLayout.test.d.ts +1 -0
- package/dist/__tests__/components/AppSidebar.test.d.ts +1 -0
- package/dist/__tests__/components/AppTopBar.test.d.ts +1 -0
- package/dist/__tests__/components/BaseInput.test.d.ts +1 -0
- package/dist/__tests__/components/BasePill.test.d.ts +1 -0
- package/dist/__tests__/components/Calendar.test.d.ts +1 -0
- package/dist/__tests__/components/CollapsibleCard.test.d.ts +1 -0
- package/dist/__tests__/components/DataFrame.test.d.ts +1 -0
- package/dist/__tests__/components/DropdownButton.test.d.ts +1 -0
- package/dist/__tests__/composables/formBuilderRegistry.test.d.ts +1 -0
- package/dist/__tests__/composables/useAppExperiment.test.d.ts +1 -0
- package/dist/__tests__/composables/useAuth.test.d.ts +1 -0
- package/dist/__tests__/composables/useAutoGroup.test.d.ts +1 -0
- package/dist/__tests__/composables/useExperimentData.test.d.ts +13 -0
- package/dist/__tests__/composables/useExperimentSave.test.d.ts +1 -0
- package/dist/__tests__/composables/useForm.test.d.ts +1 -0
- package/dist/__tests__/composables/useFormBuilder.test.d.ts +1 -0
- package/dist/__tests__/composables/usePlatformContext.test.d.ts +1 -0
- package/dist/__tests__/composables/usePluginApi.test.d.ts +13 -0
- package/dist/__tests__/composables/usePluginConfig.test.d.ts +14 -0
- package/dist/__tests__/utils/color.test.d.ts +1 -0
- package/dist/auth-BYmxZdJl.js +297 -0
- package/dist/auth-BYmxZdJl.js.map +1 -0
- package/dist/components/AlertBox.vue.d.ts +34 -0
- package/dist/components/AppAvatarMenu.vue.d.ts +58 -0
- package/dist/components/AppContainer.vue.d.ts +28 -0
- package/dist/components/AppLayout.vue.d.ts +31 -0
- package/dist/components/AppPageSelector.vue.d.ts +43 -0
- package/dist/components/AppPillNav.vue.d.ts +11 -0
- package/dist/components/AppPluginSwitcher.vue.d.ts +38 -0
- package/dist/components/AppSidebar.vue.d.ts +47 -0
- package/dist/components/AppTopBar.vue.d.ts +111 -0
- package/dist/components/AuditTrail.vue.d.ts +38 -0
- package/dist/components/AutoGroupModal.vue.d.ts +124 -0
- package/dist/components/Avatar.vue.d.ts +14 -0
- package/dist/components/BaseButton.vue.d.ts +37 -0
- package/dist/components/BaseCheckbox.vue.d.ts +17 -0
- package/dist/components/BaseInput.vue.d.ts +34 -0
- package/dist/components/BaseModal.vue.d.ts +46 -0
- package/dist/components/BasePill.vue.d.ts +57 -0
- package/dist/components/BaseRadioGroup.vue.d.ts +21 -0
- package/dist/components/BaseSelect.vue.d.ts +20 -0
- package/dist/components/BaseSlider.vue.d.ts +22 -0
- package/dist/components/BaseTabs.vue.d.ts +14 -0
- package/dist/components/BaseTextarea.vue.d.ts +30 -0
- package/dist/components/BaseToggle.vue.d.ts +19 -0
- package/dist/components/BatchProgressList.vue.d.ts +43 -0
- package/dist/components/Breadcrumb.vue.d.ts +33 -0
- package/dist/components/Calendar.vue.d.ts +107 -0
- package/dist/components/ChartContainer.vue.d.ts +31 -0
- package/dist/components/ChemicalFormula.vue.d.ts +8 -0
- package/dist/components/CollapsibleCard.vue.d.ts +41 -0
- package/dist/components/ColorSlider.vue.d.ts +34 -0
- package/dist/components/ConcentrationInput.vue.d.ts +25 -0
- package/dist/components/ConfirmDialog.vue.d.ts +42 -0
- package/dist/components/DataFrame.vue.d.ts +107 -0
- package/dist/components/DatePicker.vue.d.ts +25 -0
- package/dist/components/DateTimePicker.vue.d.ts +30 -0
- package/dist/components/Divider.vue.d.ts +14 -0
- package/dist/components/DoseCalculator.vue.d.ts +19 -0
- package/dist/components/DropdownButton.vue.d.ts +47 -0
- package/dist/components/EmptyState.vue.d.ts +36 -0
- package/dist/components/ExperimentCodeBadge.vue.d.ts +14 -0
- package/dist/components/ExperimentDataViewer.vue.d.ts +29 -0
- package/dist/components/ExperimentPopover.vue.d.ts +32 -0
- package/dist/components/ExperimentSelectorModal.vue.d.ts +28 -0
- package/dist/components/ExperimentTimeline.vue.d.ts +44 -0
- package/dist/components/FileUploader.vue.d.ts +40 -0
- package/dist/components/FitPanel.vue.d.ts +46 -0
- package/dist/components/FormActions.vue.d.ts +33 -0
- package/dist/components/FormBuilder.vue.d.ts +287 -0
- package/dist/components/FormField.vue.d.ts +28 -0
- package/dist/components/FormFieldRenderer.vue.d.ts +31 -0
- package/dist/components/FormSection.vue.d.ts +43 -0
- package/dist/components/FormulaInput.vue.d.ts +25 -0
- package/dist/components/GroupAssigner.vue.d.ts +25 -0
- package/dist/components/GroupingModal.vue.d.ts +12 -0
- package/dist/components/IconButton.vue.d.ts +34 -0
- package/dist/components/LoadingSpinner.vue.d.ts +12 -0
- package/dist/components/MoleculeInput.vue.d.ts +27 -0
- package/dist/components/MultiSelect.vue.d.ts +19 -0
- package/dist/components/NumberInput.vue.d.ts +22 -0
- package/dist/components/PlateMapEditor.vue.d.ts +50 -0
- package/dist/components/ProgressBar.vue.d.ts +23 -0
- package/dist/components/ProtocolStepEditor.vue.d.ts +24 -0
- package/dist/components/RackEditor.vue.d.ts +40 -0
- package/dist/components/ReagentEditor.vue.d.ts +30 -0
- package/dist/components/ReagentList.vue.d.ts +32 -0
- package/dist/components/ResourceCard.vue.d.ts +50 -0
- package/dist/components/SampleHierarchyTree.vue.d.ts +26 -0
- package/dist/components/SampleLegend.vue.d.ts +32 -0
- package/dist/components/SampleSelector.vue.d.ts +29 -0
- package/dist/components/ScheduleCalendar.vue.d.ts +110 -0
- package/dist/components/ScientificNumber.vue.d.ts +14 -0
- package/dist/components/SegmentedControl.vue.d.ts +20 -0
- package/dist/components/SequenceInput.vue.d.ts +54 -0
- package/dist/components/SettingsButton.vue.d.ts +30 -0
- package/dist/components/SettingsModal.vue.d.ts +36 -0
- package/dist/components/Skeleton.vue.d.ts +11 -0
- package/dist/components/StatusIndicator.vue.d.ts +13 -0
- package/dist/components/StepWizard.vue.d.ts +65 -0
- package/dist/components/TagsInput.vue.d.ts +39 -0
- package/dist/components/ThemeToggle.vue.d.ts +7 -0
- package/dist/components/TimePicker.vue.d.ts +29 -0
- package/dist/components/TimeRangeInput.vue.d.ts +27 -0
- package/dist/components/ToastNotification.vue.d.ts +2 -0
- package/dist/components/Tooltip.vue.d.ts +35 -0
- package/dist/components/UnitInput.vue.d.ts +39 -0
- package/dist/components/WellEditPopup.vue.d.ts +25 -0
- package/dist/components/WellPlate.vue.d.ts +73 -0
- package/dist/components/index.d.ts +87 -0
- package/dist/components/index.js +3 -0
- package/dist/components-CKf-UpGi.js +15089 -0
- package/dist/components-CKf-UpGi.js.map +1 -0
- package/dist/composables/experiment-utils.d.ts +8 -0
- package/dist/composables/formBuilderRegistry.d.ts +13 -0
- package/dist/composables/index.d.ts +28 -0
- package/dist/composables/index.js +3 -0
- package/dist/composables/useApi.d.ts +20 -0
- package/dist/composables/useAppExperiment.d.ts +37 -0
- package/dist/composables/useAsync.d.ts +128 -0
- package/dist/composables/useAuth.d.ts +47 -0
- package/dist/composables/useAutoGroup.d.ts +106 -0
- package/dist/composables/useChemicalFormula.d.ts +21 -0
- package/dist/composables/useConcentrationUnits.d.ts +29 -0
- package/dist/composables/useDoseCalculator.d.ts +58 -0
- package/dist/composables/useExperimentData.d.ts +18 -0
- package/dist/composables/useExperimentSave.d.ts +36 -0
- package/dist/composables/useExperimentSelector.d.ts +30 -0
- package/dist/composables/useForm.d.ts +92 -0
- package/dist/composables/useFormBuilder.d.ts +24 -0
- package/dist/composables/usePasskey.d.ts +10 -0
- package/dist/composables/usePlatformContext.d.ts +131 -0
- package/dist/composables/usePluginApi.d.ts +29 -0
- package/dist/composables/usePluginConfig.d.ts +13 -0
- package/dist/composables/useProtocolTemplates.d.ts +44 -0
- package/dist/composables/useRackEditor.d.ts +31 -0
- package/dist/composables/useReagentSeries.d.ts +23 -0
- package/dist/composables/useScheduleDrag.d.ts +78 -0
- package/dist/composables/useSequenceUtils.d.ts +14 -0
- package/dist/composables/useTheme.d.ts +8 -0
- package/dist/composables/useTimeUtils.d.ts +29 -0
- package/dist/composables/useToast.d.ts +22 -0
- package/dist/composables/useWellPlateEditor.d.ts +33 -0
- package/dist/composables-D0QfFzq1.js +805 -0
- package/dist/composables-D0QfFzq1.js.map +1 -0
- package/dist/histoire.setup.d.ts +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/install.d.ts +16 -0
- package/dist/install.js +23 -0
- package/dist/install.js.map +1 -0
- package/dist/stores/auth.d.ts +146 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/index.js +2 -0
- package/dist/stores/settings.d.ts +75 -0
- package/dist/styles.css +29728 -0
- package/dist/tailwind.preset.d.ts +58 -0
- package/dist/tailwind.preset.js +66 -0
- package/dist/tailwind.preset.js.map +1 -0
- package/dist/types/auth.d.ts +42 -0
- package/dist/types/auto-group.d.ts +34 -0
- package/dist/types/components.d.ts +528 -0
- package/dist/types/form-builder.d.ts +167 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +0 -0
- package/dist/types/platform.d.ts +75 -0
- package/dist/useScheduleDrag-DAJueTbK.js +7181 -0
- package/dist/useScheduleDrag-DAJueTbK.js.map +1 -0
- package/dist/utils/color.d.ts +24 -0
- package/package.json +114 -0
- package/src/__stories__/experiment-helpers.ts +83 -0
- package/src/__tests__/components/AppLayout.test.ts +163 -0
- package/src/__tests__/components/AppSidebar.test.ts +292 -0
- package/src/__tests__/components/AppTopBar.test.ts +683 -0
- package/src/__tests__/components/BaseInput.test.ts +99 -0
- package/src/__tests__/components/BasePill.test.ts +291 -0
- package/src/__tests__/components/Calendar.test.ts +566 -0
- package/src/__tests__/components/CollapsibleCard.test.ts +524 -0
- package/src/__tests__/components/DataFrame.test.ts +767 -0
- package/src/__tests__/components/DropdownButton.test.ts +471 -0
- package/src/__tests__/composables/formBuilderRegistry.test.ts +187 -0
- package/src/__tests__/composables/useAppExperiment.test.ts +560 -0
- package/src/__tests__/composables/useAuth.test.ts +188 -0
- package/src/__tests__/composables/useAutoGroup.test.ts +860 -0
- package/src/__tests__/composables/useExperimentData.test.ts +127 -0
- package/src/__tests__/composables/useExperimentSave.test.ts +347 -0
- package/src/__tests__/composables/useForm.test.ts +205 -0
- package/src/__tests__/composables/useFormBuilder.test.ts +917 -0
- package/src/__tests__/composables/usePlatformContext.test.ts +116 -0
- package/src/__tests__/composables/usePluginApi.test.ts +81 -0
- package/src/__tests__/composables/usePluginConfig.test.ts +176 -0
- package/src/__tests__/utils/color.test.ts +96 -0
- package/src/components/AlertBox.story.vue +204 -0
- package/src/components/AlertBox.vue +88 -0
- package/src/components/AppAvatarMenu.story.vue +155 -0
- package/src/components/AppAvatarMenu.vue +184 -0
- package/src/components/AppContainer.story.vue +104 -0
- package/src/components/AppContainer.vue +34 -0
- package/src/components/AppLayout.story.vue +292 -0
- package/src/components/AppLayout.vue +75 -0
- package/src/components/AppPageSelector.vue +159 -0
- package/src/components/AppPillNav.vue +66 -0
- package/src/components/AppPluginSwitcher.vue +241 -0
- package/src/components/AppSidebar.story.vue +309 -0
- package/src/components/AppSidebar.vue +119 -0
- package/src/components/AppTopBar.story.vue +304 -0
- package/src/components/AppTopBar.vue +661 -0
- package/src/components/AuditTrail.story.vue +163 -0
- package/src/components/AuditTrail.vue +151 -0
- package/src/components/AutoGroupModal.story.vue +273 -0
- package/src/components/AutoGroupModal.vue +566 -0
- package/src/components/Avatar.story.vue +115 -0
- package/src/components/Avatar.vue +79 -0
- package/src/components/BaseButton.story.vue +96 -0
- package/src/components/BaseButton.vue +73 -0
- package/src/components/BaseCheckbox.story.vue +73 -0
- package/src/components/BaseCheckbox.vue +69 -0
- package/src/components/BaseInput.story.vue +98 -0
- package/src/components/BaseInput.vue +74 -0
- package/src/components/BaseModal.story.vue +237 -0
- package/src/components/BaseModal.vue +182 -0
- package/src/components/BasePill.story.vue +142 -0
- package/src/components/BasePill.vue +89 -0
- package/src/components/BaseRadioGroup.story.vue +145 -0
- package/src/components/BaseRadioGroup.vue +124 -0
- package/src/components/BaseSelect.story.vue +120 -0
- package/src/components/BaseSelect.vue +71 -0
- package/src/components/BaseSlider.story.vue +122 -0
- package/src/components/BaseSlider.vue +126 -0
- package/src/components/BaseTabs.story.vue +127 -0
- package/src/components/BaseTabs.vue +59 -0
- package/src/components/BaseTextarea.story.vue +91 -0
- package/src/components/BaseTextarea.vue +62 -0
- package/src/components/BaseToggle.story.vue +81 -0
- package/src/components/BaseToggle.vue +76 -0
- package/src/components/BatchProgressList.story.vue +92 -0
- package/src/components/BatchProgressList.vue +184 -0
- package/src/components/Breadcrumb.story.vue +106 -0
- package/src/components/Breadcrumb.vue +75 -0
- package/src/components/Calendar.story.vue +106 -0
- package/src/components/Calendar.vue +363 -0
- package/src/components/ChartContainer.story.vue +113 -0
- package/src/components/ChartContainer.vue +64 -0
- package/src/components/ChemicalFormula.story.vue +102 -0
- package/src/components/ChemicalFormula.vue +39 -0
- package/src/components/CollapsibleCard.story.vue +135 -0
- package/src/components/CollapsibleCard.vue +167 -0
- package/src/components/ColorSlider.story.vue +120 -0
- package/src/components/ColorSlider.vue +164 -0
- package/src/components/ConcentrationInput.story.vue +77 -0
- package/src/components/ConcentrationInput.vue +185 -0
- package/src/components/ConfirmDialog.story.vue +248 -0
- package/src/components/ConfirmDialog.vue +93 -0
- package/src/components/DataFrame.story.vue +148 -0
- package/src/components/DataFrame.vue +419 -0
- package/src/components/DatePicker.story.vue +119 -0
- package/src/components/DatePicker.vue +330 -0
- package/src/components/DateTimePicker.story.vue +112 -0
- package/src/components/DateTimePicker.vue +392 -0
- package/src/components/Divider.story.vue +80 -0
- package/src/components/Divider.vue +49 -0
- package/src/components/DoseCalculator.story.vue +68 -0
- package/src/components/DoseCalculator.vue +476 -0
- package/src/components/DropdownButton.story.vue +102 -0
- package/src/components/DropdownButton.vue +181 -0
- package/src/components/EmptyState.story.vue +135 -0
- package/src/components/EmptyState.vue +69 -0
- package/src/components/ExperimentCodeBadge.story.vue +77 -0
- package/src/components/ExperimentCodeBadge.vue +64 -0
- package/src/components/ExperimentDataViewer.story.vue +174 -0
- package/src/components/ExperimentDataViewer.vue +288 -0
- package/src/components/ExperimentPopover.story.vue +384 -0
- package/src/components/ExperimentPopover.vue +241 -0
- package/src/components/ExperimentSelectorModal.story.vue +391 -0
- package/src/components/ExperimentSelectorModal.vue +387 -0
- package/src/components/ExperimentTimeline.story.vue +161 -0
- package/src/components/ExperimentTimeline.vue +382 -0
- package/src/components/FileUploader.story.vue +107 -0
- package/src/components/FileUploader.vue +386 -0
- package/src/components/FitPanel.story.vue +125 -0
- package/src/components/FitPanel.vue +120 -0
- package/src/components/FormActions.vue +92 -0
- package/src/components/FormBuilder.vue +214 -0
- package/src/components/FormField.story.vue +132 -0
- package/src/components/FormField.vue +59 -0
- package/src/components/FormFieldRenderer.vue +58 -0
- package/src/components/FormSection.vue +90 -0
- package/src/components/FormulaInput.story.vue +96 -0
- package/src/components/FormulaInput.vue +125 -0
- package/src/components/GroupAssigner.story.vue +83 -0
- package/src/components/GroupAssigner.vue +284 -0
- package/src/components/GroupingModal.story.vue +52 -0
- package/src/components/GroupingModal.vue +422 -0
- package/src/components/IconButton.story.vue +135 -0
- package/src/components/IconButton.vue +73 -0
- package/src/components/LoadingSpinner.story.vue +70 -0
- package/src/components/LoadingSpinner.vue +50 -0
- package/src/components/MoleculeInput.story.vue +66 -0
- package/src/components/MoleculeInput.vue +426 -0
- package/src/components/MultiSelect.story.vue +132 -0
- package/src/components/MultiSelect.vue +118 -0
- package/src/components/NumberInput.story.vue +122 -0
- package/src/components/NumberInput.vue +160 -0
- package/src/components/PlateMapEditor.story.vue +92 -0
- package/src/components/PlateMapEditor.vue +513 -0
- package/src/components/ProgressBar.story.vue +148 -0
- package/src/components/ProgressBar.vue +114 -0
- package/src/components/ProtocolStepEditor.story.vue +69 -0
- package/src/components/ProtocolStepEditor.vue +522 -0
- package/src/components/RackEditor.story.vue +100 -0
- package/src/components/RackEditor.vue +371 -0
- package/src/components/ReagentEditor.story.vue +153 -0
- package/src/components/ReagentEditor.vue +418 -0
- package/src/components/ReagentList.story.vue +137 -0
- package/src/components/ReagentList.vue +463 -0
- package/src/components/ResourceCard.story.vue +150 -0
- package/src/components/ResourceCard.vue +161 -0
- package/src/components/SampleHierarchyTree.story.vue +161 -0
- package/src/components/SampleHierarchyTree.vue +256 -0
- package/src/components/SampleLegend.story.vue +91 -0
- package/src/components/SampleLegend.vue +119 -0
- package/src/components/SampleSelector.story.vue +111 -0
- package/src/components/SampleSelector.vue +1033 -0
- package/src/components/ScheduleCalendar.story.vue +195 -0
- package/src/components/ScheduleCalendar.vue +569 -0
- package/src/components/ScientificNumber.story.vue +127 -0
- package/src/components/ScientificNumber.vue +197 -0
- package/src/components/SegmentedControl.story.vue +132 -0
- package/src/components/SegmentedControl.vue +79 -0
- package/src/components/SequenceInput.story.vue +119 -0
- package/src/components/SequenceInput.vue +209 -0
- package/src/components/SettingsButton.story.vue +58 -0
- package/src/components/SettingsButton.vue +76 -0
- package/src/components/SettingsModal.story.vue +145 -0
- package/src/components/SettingsModal.vue +146 -0
- package/src/components/Skeleton.story.vue +141 -0
- package/src/components/Skeleton.vue +74 -0
- package/src/components/StatusIndicator.story.vue +99 -0
- package/src/components/StatusIndicator.vue +40 -0
- package/src/components/StepWizard.story.vue +155 -0
- package/src/components/StepWizard.vue +223 -0
- package/src/components/TagsInput.story.vue +155 -0
- package/src/components/TagsInput.vue +265 -0
- package/src/components/ThemeToggle.story.vue +36 -0
- package/src/components/ThemeToggle.vue +54 -0
- package/src/components/TimePicker.story.vue +96 -0
- package/src/components/TimePicker.vue +273 -0
- package/src/components/TimeRangeInput.story.vue +104 -0
- package/src/components/TimeRangeInput.vue +122 -0
- package/src/components/ToastNotification.story.vue +157 -0
- package/src/components/ToastNotification.vue +62 -0
- package/src/components/Tooltip.story.vue +138 -0
- package/src/components/Tooltip.vue +119 -0
- package/src/components/UnitInput.story.vue +194 -0
- package/src/components/UnitInput.vue +213 -0
- package/src/components/WellEditPopup.vue +234 -0
- package/src/components/WellPlate.story.vue +282 -0
- package/src/components/WellPlate.vue +830 -0
- package/src/components/index.ts +118 -0
- package/src/composables/experiment-utils.ts +57 -0
- package/src/composables/formBuilderRegistry.ts +79 -0
- package/src/composables/index.ts +140 -0
- package/src/composables/useApi.ts +167 -0
- package/src/composables/useAppExperiment.ts +159 -0
- package/src/composables/useAsync.ts +323 -0
- package/src/composables/useAuth.ts +445 -0
- package/src/composables/useAutoGroup.ts +641 -0
- package/src/composables/useChemicalFormula.ts +275 -0
- package/src/composables/useConcentrationUnits.ts +246 -0
- package/src/composables/useDoseCalculator.ts +370 -0
- package/src/composables/useExperimentData.ts +86 -0
- package/src/composables/useExperimentSave.ts +192 -0
- package/src/composables/useExperimentSelector.ts +292 -0
- package/src/composables/useForm.ts +416 -0
- package/src/composables/useFormBuilder.ts +383 -0
- package/src/composables/usePasskey.ts +216 -0
- package/src/composables/usePlatformContext.ts +299 -0
- package/src/composables/usePluginApi.ts +39 -0
- package/src/composables/usePluginConfig.ts +93 -0
- package/src/composables/useProtocolTemplates.ts +518 -0
- package/src/composables/useRackEditor.ts +222 -0
- package/src/composables/useReagentSeries.ts +91 -0
- package/src/composables/useScheduleDrag.ts +245 -0
- package/src/composables/useSequenceUtils.ts +105 -0
- package/src/composables/useTheme.ts +58 -0
- package/src/composables/useTimeUtils.ts +131 -0
- package/src/composables/useToast.ts +40 -0
- package/src/composables/useWellPlateEditor.ts +421 -0
- package/src/histoire.setup.ts +17 -0
- package/src/index.ts +367 -0
- package/src/install.ts +32 -0
- package/src/stores/auth.ts +152 -0
- package/src/stores/index.ts +2 -0
- package/src/stores/settings.ts +218 -0
- package/src/styles/components/alert-box.css +150 -0
- package/src/styles/components/app-avatar-menu.css +155 -0
- package/src/styles/components/app-container.css +33 -0
- package/src/styles/components/app-layout.css +98 -0
- package/src/styles/components/app-page-selector.css +191 -0
- package/src/styles/components/app-pill-nav.css +57 -0
- package/src/styles/components/app-plugin-switcher.css +209 -0
- package/src/styles/components/app-sidebar.css +145 -0
- package/src/styles/components/app-top-bar.css +492 -0
- package/src/styles/components/audit-trail.css +143 -0
- package/src/styles/components/auto-group-modal.css +644 -0
- package/src/styles/components/avatar.css +73 -0
- package/src/styles/components/batch-progress-list.css +196 -0
- package/src/styles/components/breadcrumb.css +64 -0
- package/src/styles/components/button.css +188 -0
- package/src/styles/components/calendar.css +192 -0
- package/src/styles/components/chart-container.css +69 -0
- package/src/styles/components/checkbox.css +123 -0
- package/src/styles/components/chemical-formula.css +46 -0
- package/src/styles/components/collapsible-card.css +253 -0
- package/src/styles/components/color-slider.css +110 -0
- package/src/styles/components/concentration-input.css +156 -0
- package/src/styles/components/confirm-dialog.css +183 -0
- package/src/styles/components/dataframe.css +382 -0
- package/src/styles/components/date-picker.css +243 -0
- package/src/styles/components/datetime-picker.css +229 -0
- package/src/styles/components/divider.css +63 -0
- package/src/styles/components/dose-calculator.css +301 -0
- package/src/styles/components/dropdown-button.css +280 -0
- package/src/styles/components/empty-state.css +151 -0
- package/src/styles/components/experiment-code-badge.css +33 -0
- package/src/styles/components/experiment-data-viewer.css +138 -0
- package/src/styles/components/experiment-popover.css +562 -0
- package/src/styles/components/experiment-selector-modal.css +285 -0
- package/src/styles/components/experiment-timeline.css +529 -0
- package/src/styles/components/file-uploader.css +310 -0
- package/src/styles/components/fit-panel.css +67 -0
- package/src/styles/components/form-builder.css +69 -0
- package/src/styles/components/form-field.css +48 -0
- package/src/styles/components/formula-input.css +103 -0
- package/src/styles/components/group-assigner.css +200 -0
- package/src/styles/components/grouping-modal.css +323 -0
- package/src/styles/components/icon-button.css +192 -0
- package/src/styles/components/input.css +66 -0
- package/src/styles/components/loading-spinner.css +67 -0
- package/src/styles/components/modal.css +350 -0
- package/src/styles/components/molecule-input.css +186 -0
- package/src/styles/components/multi-select.css +131 -0
- package/src/styles/components/number-input.css +199 -0
- package/src/styles/components/pill.css +188 -0
- package/src/styles/components/plate-map-editor.css +464 -0
- package/src/styles/components/progress-bar.css +133 -0
- package/src/styles/components/protocol-step-editor.css +449 -0
- package/src/styles/components/rack-editor.css +265 -0
- package/src/styles/components/radio-group.css +240 -0
- package/src/styles/components/reagent-editor.css +510 -0
- package/src/styles/components/reagent-list.css +407 -0
- package/src/styles/components/resource-card.css +360 -0
- package/src/styles/components/sample-hierarchy-tree.css +314 -0
- package/src/styles/components/sample-legend.css +201 -0
- package/src/styles/components/sample-selector.css +751 -0
- package/src/styles/components/schedule-calendar.css +478 -0
- package/src/styles/components/scientific-number.css +63 -0
- package/src/styles/components/segmented-control.css +197 -0
- package/src/styles/components/select.css +77 -0
- package/src/styles/components/sequence-input.css +184 -0
- package/src/styles/components/settings-button.css +94 -0
- package/src/styles/components/settings-modal.css +95 -0
- package/src/styles/components/skeleton.css +49 -0
- package/src/styles/components/slider.css +74 -0
- package/src/styles/components/status-indicator.css +66 -0
- package/src/styles/components/step-wizard.css +192 -0
- package/src/styles/components/tabs.css +95 -0
- package/src/styles/components/tags-input.css +195 -0
- package/src/styles/components/textarea.css +82 -0
- package/src/styles/components/theme-toggle.css +69 -0
- package/src/styles/components/time-picker.css +171 -0
- package/src/styles/components/time-range-input.css +42 -0
- package/src/styles/components/toast.css +91 -0
- package/src/styles/components/toggle.css +146 -0
- package/src/styles/components/tooltip.css +91 -0
- package/src/styles/components/unit-input.css +123 -0
- package/src/styles/components/well-edit-popup.css +252 -0
- package/src/styles/components/well-plate.css +307 -0
- package/src/styles/index.css +87 -0
- package/src/styles/variables.css +1117 -0
- package/src/tailwind.preset.ts +61 -0
- package/src/types/auth.ts +55 -0
- package/src/types/auto-group.ts +40 -0
- package/src/types/components.ts +710 -0
- package/src/types/form-builder.ts +197 -0
- package/src/types/index.ts +207 -0
- package/src/types/platform.ts +116 -0
- package/src/utils/color.ts +96 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/** Drag-and-drop file upload zone with type filtering, size validation, and folder mode. */
|
|
3
|
+
import { ref, computed } from 'vue'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
accept?: string
|
|
7
|
+
multiple?: boolean
|
|
8
|
+
maxSize?: number
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
size?: 'sm' | 'md' | 'lg'
|
|
11
|
+
mode?: 'file' | 'folder'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
15
|
+
multiple: false,
|
|
16
|
+
disabled: false,
|
|
17
|
+
size: 'md',
|
|
18
|
+
mode: 'file',
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const emit = defineEmits<{
|
|
22
|
+
upload: [files: File[]]
|
|
23
|
+
error: [message: string]
|
|
24
|
+
}>()
|
|
25
|
+
|
|
26
|
+
const isDragOver = ref(false)
|
|
27
|
+
const inputRef = ref<HTMLInputElement>()
|
|
28
|
+
const selectedFiles = ref<File[]>([])
|
|
29
|
+
const folderName = ref<string | null>(null)
|
|
30
|
+
|
|
31
|
+
const isFolder = computed(() => props.mode === 'folder')
|
|
32
|
+
|
|
33
|
+
const acceptLabel = computed(() => {
|
|
34
|
+
if (!props.accept) return 'any file'
|
|
35
|
+
return props.accept.split(',').map(a => a.trim().replace('.', '').toUpperCase()).join(', ')
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const maxSizeLabel = computed(() => {
|
|
39
|
+
if (!props.maxSize) return null
|
|
40
|
+
if (props.maxSize >= 1024 * 1024 * 1024) {
|
|
41
|
+
return `${(props.maxSize / (1024 * 1024 * 1024)).toFixed(1)} GB`
|
|
42
|
+
}
|
|
43
|
+
if (props.maxSize >= 1024 * 1024) {
|
|
44
|
+
return `${(props.maxSize / (1024 * 1024)).toFixed(1)} MB`
|
|
45
|
+
}
|
|
46
|
+
if (props.maxSize >= 1024) {
|
|
47
|
+
return `${(props.maxSize / 1024).toFixed(1)} KB`
|
|
48
|
+
}
|
|
49
|
+
return `${props.maxSize} bytes`
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
const fileTypeMap: Record<string, { color: string; label: string }> = {
|
|
53
|
+
csv: { color: '#10B981', label: 'CSV' },
|
|
54
|
+
tsv: { color: '#10B981', label: 'TSV' },
|
|
55
|
+
xlsx: { color: '#10B981', label: 'XLSX' },
|
|
56
|
+
xls: { color: '#10B981', label: 'XLS' },
|
|
57
|
+
pdf: { color: '#EF4444', label: 'PDF' },
|
|
58
|
+
png: { color: '#8B5CF6', label: 'PNG' },
|
|
59
|
+
jpg: { color: '#8B5CF6', label: 'JPG' },
|
|
60
|
+
jpeg: { color: '#8B5CF6', label: 'JPEG' },
|
|
61
|
+
gif: { color: '#8B5CF6', label: 'GIF' },
|
|
62
|
+
svg: { color: '#8B5CF6', label: 'SVG' },
|
|
63
|
+
webp: { color: '#8B5CF6', label: 'WEBP' },
|
|
64
|
+
json: { color: '#F59E0B', label: 'JSON' },
|
|
65
|
+
xml: { color: '#F59E0B', label: 'XML' },
|
|
66
|
+
txt: { color: '#64748B', label: 'TXT' },
|
|
67
|
+
zip: { color: '#6366F1', label: 'ZIP' },
|
|
68
|
+
gz: { color: '#6366F1', label: 'GZ' },
|
|
69
|
+
py: { color: '#3B82F6', label: 'PY' },
|
|
70
|
+
js: { color: '#EAB308', label: 'JS' },
|
|
71
|
+
ts: { color: '#3B82F6', label: 'TS' },
|
|
72
|
+
fasta: { color: '#EC4899', label: 'FASTA' },
|
|
73
|
+
fastq: { color: '#EC4899', label: 'FASTQ' },
|
|
74
|
+
bam: { color: '#EC4899', label: 'BAM' },
|
|
75
|
+
vcf: { color: '#EC4899', label: 'VCF' },
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function getFileType(filename: string): { color: string; label: string } {
|
|
79
|
+
const ext = filename.split('.').pop()?.toLowerCase() || ''
|
|
80
|
+
return fileTypeMap[ext] || { color: '#94A3B8', label: ext.toUpperCase() || 'FILE' }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function validateFiles(files: FileList | File[]): File[] {
|
|
84
|
+
const validFiles: File[] = []
|
|
85
|
+
|
|
86
|
+
for (const file of Array.from(files)) {
|
|
87
|
+
if (props.maxSize && file.size > props.maxSize) {
|
|
88
|
+
emit('error', `File "${file.name}" exceeds maximum size of ${maxSizeLabel.value}`)
|
|
89
|
+
continue
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (props.accept) {
|
|
93
|
+
const acceptedTypes = props.accept.split(',').map(t => t.trim().toLowerCase())
|
|
94
|
+
const fileExt = '.' + file.name.split('.').pop()?.toLowerCase()
|
|
95
|
+
const fileType = file.type.toLowerCase()
|
|
96
|
+
|
|
97
|
+
const isAccepted = acceptedTypes.some(type => {
|
|
98
|
+
if (type.startsWith('.')) {
|
|
99
|
+
return fileExt === type
|
|
100
|
+
}
|
|
101
|
+
if (type.endsWith('/*')) {
|
|
102
|
+
return fileType.startsWith(type.replace('/*', '/'))
|
|
103
|
+
}
|
|
104
|
+
return fileType === type
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
if (!isAccepted) {
|
|
108
|
+
emit('error', `File "${file.name}" is not an accepted file type`)
|
|
109
|
+
continue
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
validFiles.push(file)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return validFiles
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function handleFiles(files: FileList | File[], folder?: string) {
|
|
120
|
+
const validFiles = validateFiles(files)
|
|
121
|
+
if (validFiles.length === 0) return
|
|
122
|
+
|
|
123
|
+
if (isFolder.value) {
|
|
124
|
+
folderName.value = folder || extractFolderName(validFiles)
|
|
125
|
+
selectedFiles.value = validFiles
|
|
126
|
+
emit('upload', validFiles)
|
|
127
|
+
} else if (!props.multiple) {
|
|
128
|
+
selectedFiles.value = [validFiles[0]]
|
|
129
|
+
emit('upload', [validFiles[0]])
|
|
130
|
+
} else {
|
|
131
|
+
selectedFiles.value = [...selectedFiles.value, ...validFiles]
|
|
132
|
+
emit('upload', validFiles)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function extractFolderName(files: File[]): string | null {
|
|
137
|
+
if (files.length === 0) return null
|
|
138
|
+
const firstPath = files[0].webkitRelativePath
|
|
139
|
+
if (firstPath) {
|
|
140
|
+
return firstPath.split('/')[0]
|
|
141
|
+
}
|
|
142
|
+
return null
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function handleDrop(event: DragEvent) {
|
|
146
|
+
event.preventDefault()
|
|
147
|
+
isDragOver.value = false
|
|
148
|
+
if (props.disabled) return
|
|
149
|
+
|
|
150
|
+
if (isFolder.value && event.dataTransfer?.items) {
|
|
151
|
+
handleFolderDrop(event.dataTransfer.items)
|
|
152
|
+
} else if (event.dataTransfer?.files) {
|
|
153
|
+
handleFiles(event.dataTransfer.files)
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
async function handleFolderDrop(items: DataTransferItemList) {
|
|
158
|
+
const files: File[] = []
|
|
159
|
+
let folderNameFromDrop: string | undefined
|
|
160
|
+
|
|
161
|
+
for (const item of Array.from(items)) {
|
|
162
|
+
const entry = item.webkitGetAsEntry?.()
|
|
163
|
+
if (entry?.isDirectory) {
|
|
164
|
+
folderNameFromDrop = entry.name
|
|
165
|
+
await readDirectory(entry as FileSystemDirectoryEntry, files)
|
|
166
|
+
} else if (entry?.isFile) {
|
|
167
|
+
const file = await getFile(entry as FileSystemFileEntry)
|
|
168
|
+
if (file) files.push(file)
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (files.length > 0) {
|
|
173
|
+
handleFiles(files, folderNameFromDrop)
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
async function readDirectory(directory: FileSystemDirectoryEntry, files: File[]): Promise<void> {
|
|
178
|
+
const reader = directory.createReader()
|
|
179
|
+
// readEntries returns at most 100 entries per call per spec — must loop
|
|
180
|
+
let batch: FileSystemEntry[]
|
|
181
|
+
do {
|
|
182
|
+
batch = await new Promise<FileSystemEntry[]>((resolve, reject) => {
|
|
183
|
+
reader.readEntries(resolve, reject)
|
|
184
|
+
})
|
|
185
|
+
for (const entry of batch) {
|
|
186
|
+
if (entry.isFile) {
|
|
187
|
+
const file = await getFile(entry as FileSystemFileEntry)
|
|
188
|
+
if (file) files.push(file)
|
|
189
|
+
} else if (entry.isDirectory) {
|
|
190
|
+
await readDirectory(entry as FileSystemDirectoryEntry, files)
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
} while (batch.length > 0)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function getFile(entry: FileSystemFileEntry): Promise<File | null> {
|
|
197
|
+
return new Promise((resolve) => {
|
|
198
|
+
entry.file(resolve, () => resolve(null))
|
|
199
|
+
})
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function handleDragOver(event: DragEvent) {
|
|
203
|
+
event.preventDefault()
|
|
204
|
+
if (!props.disabled) {
|
|
205
|
+
isDragOver.value = true
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function handleDragLeave() {
|
|
210
|
+
isDragOver.value = false
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function handleInputChange(event: Event) {
|
|
214
|
+
const target = event.target as HTMLInputElement
|
|
215
|
+
if (target.files) {
|
|
216
|
+
handleFiles(target.files)
|
|
217
|
+
}
|
|
218
|
+
target.value = ''
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function openFilePicker() {
|
|
222
|
+
if (!props.disabled) {
|
|
223
|
+
inputRef.value?.click()
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function removeFile(index: number) {
|
|
228
|
+
selectedFiles.value = selectedFiles.value.filter((_, i) => i !== index)
|
|
229
|
+
if (isFolder.value && selectedFiles.value.length === 0) {
|
|
230
|
+
folderName.value = null
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function clearAll() {
|
|
235
|
+
selectedFiles.value = []
|
|
236
|
+
folderName.value = null
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function formatFileSize(bytes: number): string {
|
|
240
|
+
if (bytes >= 1024 * 1024) {
|
|
241
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`
|
|
242
|
+
}
|
|
243
|
+
if (bytes >= 1024) {
|
|
244
|
+
return `${(bytes / 1024).toFixed(1)} KB`
|
|
245
|
+
}
|
|
246
|
+
return `${bytes} bytes`
|
|
247
|
+
}
|
|
248
|
+
</script>
|
|
249
|
+
|
|
250
|
+
<template>
|
|
251
|
+
<div class="mld-file-uploader">
|
|
252
|
+
<!-- Dropzone -->
|
|
253
|
+
<div
|
|
254
|
+
role="button"
|
|
255
|
+
tabindex="0"
|
|
256
|
+
:aria-label="disabled ? 'File upload disabled' : 'Click or drag files to upload'"
|
|
257
|
+
:aria-disabled="disabled"
|
|
258
|
+
:class="[
|
|
259
|
+
'mld-file-uploader__dropzone',
|
|
260
|
+
`mld-file-uploader__dropzone--${size}`,
|
|
261
|
+
isDragOver ? 'mld-file-uploader__dropzone--dragover' : '',
|
|
262
|
+
disabled ? 'mld-file-uploader__dropzone--disabled' : '',
|
|
263
|
+
selectedFiles.length > 0 ? 'mld-file-uploader__dropzone--has-files' : '',
|
|
264
|
+
]"
|
|
265
|
+
@click="openFilePicker"
|
|
266
|
+
@keydown.enter="openFilePicker"
|
|
267
|
+
@keydown.space.prevent="openFilePicker"
|
|
268
|
+
@drop="handleDrop"
|
|
269
|
+
@dragover="handleDragOver"
|
|
270
|
+
@dragleave="handleDragLeave"
|
|
271
|
+
>
|
|
272
|
+
<input
|
|
273
|
+
ref="inputRef"
|
|
274
|
+
type="file"
|
|
275
|
+
:accept="accept"
|
|
276
|
+
:multiple="isFolder || multiple"
|
|
277
|
+
:disabled="disabled"
|
|
278
|
+
:webkitdirectory="isFolder || undefined"
|
|
279
|
+
class="mld-file-uploader__input"
|
|
280
|
+
@change="handleInputChange"
|
|
281
|
+
/>
|
|
282
|
+
|
|
283
|
+
<div class="mld-file-uploader__content">
|
|
284
|
+
<svg
|
|
285
|
+
v-if="isFolder"
|
|
286
|
+
class="mld-file-uploader__icon"
|
|
287
|
+
fill="none"
|
|
288
|
+
stroke="currentColor"
|
|
289
|
+
stroke-width="1.5"
|
|
290
|
+
stroke-linecap="round"
|
|
291
|
+
stroke-linejoin="round"
|
|
292
|
+
viewBox="0 0 24 24"
|
|
293
|
+
>
|
|
294
|
+
<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" />
|
|
295
|
+
</svg>
|
|
296
|
+
<svg
|
|
297
|
+
v-else
|
|
298
|
+
class="mld-file-uploader__icon"
|
|
299
|
+
fill="none"
|
|
300
|
+
stroke="currentColor"
|
|
301
|
+
stroke-width="1.5"
|
|
302
|
+
stroke-linecap="round"
|
|
303
|
+
stroke-linejoin="round"
|
|
304
|
+
viewBox="0 0 24 24"
|
|
305
|
+
>
|
|
306
|
+
<path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" /><path d="m16 16-4-4-4 4" /><path d="M12 12v9" />
|
|
307
|
+
</svg>
|
|
308
|
+
|
|
309
|
+
<p class="mld-file-uploader__text">
|
|
310
|
+
Drop {{ acceptLabel }} or click
|
|
311
|
+
</p>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
|
|
315
|
+
<!-- Actions slot (e.g. template buttons) -->
|
|
316
|
+
<div v-if="$slots.actions" class="mld-file-uploader__actions">
|
|
317
|
+
<slot name="actions" />
|
|
318
|
+
</div>
|
|
319
|
+
|
|
320
|
+
<!-- Folder summary display -->
|
|
321
|
+
<div v-if="isFolder && folderName && selectedFiles.length > 0" class="mld-file-uploader__folder-summary">
|
|
322
|
+
<div class="mld-file-uploader__folder-info">
|
|
323
|
+
<div class="mld-file-uploader__folder-icon-wrapper">
|
|
324
|
+
<svg class="mld-file-uploader__folder-icon" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24">
|
|
325
|
+
<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2" />
|
|
326
|
+
</svg>
|
|
327
|
+
</div>
|
|
328
|
+
<div class="mld-file-uploader__folder-details">
|
|
329
|
+
<span class="mld-file-uploader__folder-name">{{ folderName }}</span>
|
|
330
|
+
<span class="mld-file-uploader__folder-count">{{ selectedFiles.length }} file{{ selectedFiles.length !== 1 ? 's' : '' }}</span>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
<button
|
|
334
|
+
type="button"
|
|
335
|
+
aria-label="Clear folder"
|
|
336
|
+
class="mld-file-uploader__remove-btn"
|
|
337
|
+
@click.stop="clearAll"
|
|
338
|
+
>
|
|
339
|
+
<svg class="mld-file-uploader__remove-icon" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24">
|
|
340
|
+
<path d="M18 6 6 18" /><path d="m6 6 12 12" />
|
|
341
|
+
</svg>
|
|
342
|
+
</button>
|
|
343
|
+
</div>
|
|
344
|
+
|
|
345
|
+
<!-- File list display -->
|
|
346
|
+
<TransitionGroup
|
|
347
|
+
v-if="!isFolder && selectedFiles.length > 0"
|
|
348
|
+
tag="ul"
|
|
349
|
+
name="mld-file-uploader-item"
|
|
350
|
+
class="mld-file-uploader__list"
|
|
351
|
+
>
|
|
352
|
+
<li
|
|
353
|
+
v-for="(file, index) in selectedFiles"
|
|
354
|
+
:key="`${file.name}-${file.size}-${index}`"
|
|
355
|
+
class="mld-file-uploader__file"
|
|
356
|
+
>
|
|
357
|
+
<div class="mld-file-uploader__file-info">
|
|
358
|
+
<span
|
|
359
|
+
class="mld-file-uploader__file-badge"
|
|
360
|
+
:style="{ '--badge-color': getFileType(file.name).color }"
|
|
361
|
+
>
|
|
362
|
+
{{ getFileType(file.name).label }}
|
|
363
|
+
</span>
|
|
364
|
+
<div class="mld-file-uploader__file-meta">
|
|
365
|
+
<span class="mld-file-uploader__file-name">{{ file.name }}</span>
|
|
366
|
+
<span class="mld-file-uploader__file-size">{{ formatFileSize(file.size) }}</span>
|
|
367
|
+
</div>
|
|
368
|
+
</div>
|
|
369
|
+
<button
|
|
370
|
+
type="button"
|
|
371
|
+
:aria-label="`Remove ${file.name}`"
|
|
372
|
+
class="mld-file-uploader__remove-btn"
|
|
373
|
+
@click.stop="removeFile(index)"
|
|
374
|
+
>
|
|
375
|
+
<svg class="mld-file-uploader__remove-icon" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24">
|
|
376
|
+
<path d="M18 6 6 18" /><path d="m6 6 12 12" />
|
|
377
|
+
</svg>
|
|
378
|
+
</button>
|
|
379
|
+
</li>
|
|
380
|
+
</TransitionGroup>
|
|
381
|
+
</div>
|
|
382
|
+
</template>
|
|
383
|
+
|
|
384
|
+
<style>
|
|
385
|
+
@import '../styles/components/file-uploader.css';
|
|
386
|
+
</style>
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import FitPanel from './FitPanel.vue'
|
|
4
|
+
import type { FitState, FitResultSummary } from '../types'
|
|
5
|
+
|
|
6
|
+
const states: FitState[] = ['idle', 'running', 'completed', 'error']
|
|
7
|
+
|
|
8
|
+
const sampleResults: FitResultSummary[] = [
|
|
9
|
+
{ label: 'IC50', value: '2.34 uM', variant: 'success' },
|
|
10
|
+
{ label: 'Hill Slope', value: '-1.12' },
|
|
11
|
+
{ label: 'R-squared', value: '0.987', variant: 'success' },
|
|
12
|
+
{ label: 'Max Response', value: '98.2%' },
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
const playgroundState = ref<FitState>('idle')
|
|
16
|
+
const playgroundProgress = ref(45)
|
|
17
|
+
const playgroundDisabled = ref(false)
|
|
18
|
+
|
|
19
|
+
function handleRun() {
|
|
20
|
+
playgroundState.value = 'running'
|
|
21
|
+
playgroundProgress.value = 0
|
|
22
|
+
const interval = setInterval(() => {
|
|
23
|
+
playgroundProgress.value += 10
|
|
24
|
+
if (playgroundProgress.value >= 100) {
|
|
25
|
+
clearInterval(interval)
|
|
26
|
+
playgroundState.value = 'completed'
|
|
27
|
+
}
|
|
28
|
+
}, 500)
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<Story title="Experiment/FitPanel">
|
|
34
|
+
<Variant title="Playground">
|
|
35
|
+
<template #default="{ state }">
|
|
36
|
+
<div style="padding: 2rem; max-width: 320px; margin: 0 auto;">
|
|
37
|
+
<FitPanel
|
|
38
|
+
:state="state.state"
|
|
39
|
+
:progress="state.progress"
|
|
40
|
+
:disabled="state.disabled"
|
|
41
|
+
:indeterminate="state.indeterminate"
|
|
42
|
+
progress-label="Fitting dose-response curve..."
|
|
43
|
+
:results="state.state === 'completed' ? sampleResults : []"
|
|
44
|
+
:error-message="state.state === 'error' ? 'Convergence failed: insufficient data points for 4PL fit' : undefined"
|
|
45
|
+
run-label="Run IC50 Fit"
|
|
46
|
+
@run="state.state = 'running'"
|
|
47
|
+
@cancel="state.state = 'idle'"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<template #controls="{ state }">
|
|
53
|
+
<HstSelect
|
|
54
|
+
v-model="state.state"
|
|
55
|
+
title="State"
|
|
56
|
+
:options="states.map(s => ({ label: s, value: s }))"
|
|
57
|
+
/>
|
|
58
|
+
<HstSlider v-model="state.progress" title="Progress" :min="0" :max="100" />
|
|
59
|
+
<HstCheckbox v-model="state.disabled" title="Disabled" />
|
|
60
|
+
<HstCheckbox v-model="state.indeterminate" title="Indeterminate" />
|
|
61
|
+
</template>
|
|
62
|
+
</Variant>
|
|
63
|
+
|
|
64
|
+
<Variant title="Idle">
|
|
65
|
+
<div style="padding: 2rem; max-width: 320px; margin: 0 auto;">
|
|
66
|
+
<FitPanel
|
|
67
|
+
state="idle"
|
|
68
|
+
run-label="Run IC50 Fit"
|
|
69
|
+
@run="() => console.log('Run fit')"
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
</Variant>
|
|
73
|
+
|
|
74
|
+
<Variant title="Running">
|
|
75
|
+
<div style="padding: 2rem; max-width: 320px; margin: 0 auto;">
|
|
76
|
+
<FitPanel
|
|
77
|
+
state="running"
|
|
78
|
+
:progress="65"
|
|
79
|
+
progress-label="Fitting dose-response curve..."
|
|
80
|
+
@cancel="() => console.log('Cancel fit')"
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
</Variant>
|
|
84
|
+
|
|
85
|
+
<Variant title="Completed">
|
|
86
|
+
<div style="padding: 2rem; max-width: 320px; margin: 0 auto;">
|
|
87
|
+
<FitPanel
|
|
88
|
+
state="completed"
|
|
89
|
+
:results="sampleResults"
|
|
90
|
+
run-label="Re-run Fit"
|
|
91
|
+
@run="() => console.log('Re-run fit')"
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
</Variant>
|
|
95
|
+
|
|
96
|
+
<Variant title="Error">
|
|
97
|
+
<div style="padding: 2rem; max-width: 320px; margin: 0 auto;">
|
|
98
|
+
<FitPanel
|
|
99
|
+
state="error"
|
|
100
|
+
error-message="Convergence failed: insufficient data points for 4PL fit. Ensure at least 4 dose levels with valid responses."
|
|
101
|
+
run-label="Retry Fit"
|
|
102
|
+
@run="() => console.log('Retry fit')"
|
|
103
|
+
/>
|
|
104
|
+
</div>
|
|
105
|
+
</Variant>
|
|
106
|
+
|
|
107
|
+
<Variant title="Interactive Demo">
|
|
108
|
+
<div style="padding: 2rem; max-width: 320px; margin: 0 auto;">
|
|
109
|
+
<p style="font-size: 0.8125rem; color: var(--text-muted, #94a3b8); margin: 0 0 1rem;">
|
|
110
|
+
Click "Run IC50 Fit" to see the full state flow
|
|
111
|
+
</p>
|
|
112
|
+
<FitPanel
|
|
113
|
+
:state="playgroundState"
|
|
114
|
+
:progress="playgroundProgress"
|
|
115
|
+
:disabled="playgroundDisabled"
|
|
116
|
+
progress-label="Fitting dose-response curve..."
|
|
117
|
+
:results="playgroundState === 'completed' ? sampleResults : []"
|
|
118
|
+
run-label="Run IC50 Fit"
|
|
119
|
+
@run="handleRun"
|
|
120
|
+
@cancel="playgroundState = 'idle'"
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
</Variant>
|
|
124
|
+
</Story>
|
|
125
|
+
</template>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/** Control panel for running a curve-fit job with progress bar, results table, and error display. */
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import type { FitState, FitResultSummary } from '../types'
|
|
5
|
+
import BaseButton from './BaseButton.vue'
|
|
6
|
+
import ProgressBar from './ProgressBar.vue'
|
|
7
|
+
import AlertBox from './AlertBox.vue'
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
state?: FitState
|
|
11
|
+
progress?: number
|
|
12
|
+
progressLabel?: string
|
|
13
|
+
indeterminate?: boolean
|
|
14
|
+
results?: FitResultSummary[]
|
|
15
|
+
errorMessage?: string
|
|
16
|
+
runLabel?: string
|
|
17
|
+
cancelLabel?: string
|
|
18
|
+
disabled?: boolean
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
22
|
+
state: 'idle',
|
|
23
|
+
progress: 0,
|
|
24
|
+
progressLabel: 'Fitting...',
|
|
25
|
+
indeterminate: false,
|
|
26
|
+
results: () => [],
|
|
27
|
+
runLabel: 'Run Fit',
|
|
28
|
+
cancelLabel: 'Cancel',
|
|
29
|
+
disabled: false,
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const emit = defineEmits<{
|
|
33
|
+
run: []
|
|
34
|
+
cancel: []
|
|
35
|
+
}>()
|
|
36
|
+
|
|
37
|
+
const isRunning = computed(() => props.state === 'running')
|
|
38
|
+
const showRunButton = computed(() => !isRunning.value)
|
|
39
|
+
const showResults = computed(() => props.state === 'completed' && props.results.length > 0)
|
|
40
|
+
const showError = computed(() => props.state === 'error' && props.errorMessage)
|
|
41
|
+
|
|
42
|
+
function variantClass(variant?: string): string {
|
|
43
|
+
if (!variant || variant === 'default') return ''
|
|
44
|
+
return `mld-fit-panel__result-value--${variant}`
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<div class="mld-fit-panel">
|
|
50
|
+
<!-- Plugin controls slot -->
|
|
51
|
+
<slot name="controls" />
|
|
52
|
+
|
|
53
|
+
<!-- Action bar -->
|
|
54
|
+
<div class="mld-fit-panel__actions">
|
|
55
|
+
<BaseButton
|
|
56
|
+
v-if="showRunButton"
|
|
57
|
+
variant="primary"
|
|
58
|
+
size="sm"
|
|
59
|
+
:disabled="disabled"
|
|
60
|
+
full-width
|
|
61
|
+
@click="emit('run')"
|
|
62
|
+
>
|
|
63
|
+
{{ runLabel }}
|
|
64
|
+
</BaseButton>
|
|
65
|
+
<BaseButton
|
|
66
|
+
v-if="isRunning"
|
|
67
|
+
variant="ghost"
|
|
68
|
+
size="sm"
|
|
69
|
+
full-width
|
|
70
|
+
@click="emit('cancel')"
|
|
71
|
+
>
|
|
72
|
+
{{ cancelLabel }}
|
|
73
|
+
</BaseButton>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<!-- Progress -->
|
|
77
|
+
<div v-if="isRunning" class="mld-fit-panel__progress">
|
|
78
|
+
<ProgressBar
|
|
79
|
+
:value="progress"
|
|
80
|
+
:label="progressLabel"
|
|
81
|
+
:indeterminate="indeterminate"
|
|
82
|
+
:show-value="!indeterminate"
|
|
83
|
+
size="sm"
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<!-- Results -->
|
|
88
|
+
<div v-if="showResults" class="mld-fit-panel__results">
|
|
89
|
+
<slot name="results">
|
|
90
|
+
<div class="mld-fit-panel__result-list">
|
|
91
|
+
<div
|
|
92
|
+
v-for="(item, idx) in results"
|
|
93
|
+
:key="idx"
|
|
94
|
+
class="mld-fit-panel__result-row"
|
|
95
|
+
>
|
|
96
|
+
<span class="mld-fit-panel__result-label">{{ item.label }}</span>
|
|
97
|
+
<span
|
|
98
|
+
class="mld-fit-panel__result-value"
|
|
99
|
+
:class="variantClass(item.variant)"
|
|
100
|
+
>
|
|
101
|
+
{{ item.value }}
|
|
102
|
+
</span>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</slot>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<!-- Error -->
|
|
109
|
+
<AlertBox v-if="showError" type="error">
|
|
110
|
+
{{ errorMessage }}
|
|
111
|
+
</AlertBox>
|
|
112
|
+
|
|
113
|
+
<!-- Footer slot -->
|
|
114
|
+
<slot name="footer" />
|
|
115
|
+
</div>
|
|
116
|
+
</template>
|
|
117
|
+
|
|
118
|
+
<style>
|
|
119
|
+
@import '../styles/components/fit-panel.css';
|
|
120
|
+
</style>
|