@nubisco/ui 5.24.0 → 5.25.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/dist/{AiLabel-BY0-FfJ4.cjs → AiLabel-BMeJMSLm.cjs} +1 -1
- package/dist/{AiLabel-B4nz_8J3.js → AiLabel-CGxUTm-X.js} +1 -1
- package/dist/AiProvider-BVT_8D6a.js +137 -0
- package/dist/AiProvider-BXWMTzi9.cjs +1 -0
- package/dist/AiUsage-CCMQdmZv.cjs +1 -0
- package/dist/AiUsage-q_WU2toP.js +74 -0
- package/dist/{Banner-BrN9hmXi.cjs → Banner-DQyHNDEP.cjs} +1 -1
- package/dist/{Banner-Bm2Hu1ei.js → Banner-r_cdQAMp.js} +4 -4
- package/dist/{BarChart-Cw-mjG2w.cjs → BarChart-CV1GzXgj.cjs} +1 -1
- package/dist/{BarChart-Bhwk1RAA.js → BarChart-DWH40Q0_.js} +4 -4
- package/dist/{Blueprint-CQW7F5Pi.js → Blueprint-CQ0UBrND.js} +2 -2
- package/dist/{Blueprint-BUMkQPNk.cjs → Blueprint-DxHaLr4P.cjs} +1 -1
- package/dist/{BlueprintCard-WpQ3eWHk.js → BlueprintCard-BpVITfop.js} +1 -1
- package/dist/{BlueprintCard-mGd4_94p.cjs → BlueprintCard-ndSnIVKE.cjs} +1 -1
- package/dist/Briefing-B_D0X4pk.cjs +1 -0
- package/dist/Briefing-Ce2nPMi-.js +90 -0
- package/dist/BriefingDestination-CA8Dv-tJ.js +67 -0
- package/dist/BriefingDestination-DIXsBoE2.cjs +1 -0
- package/dist/{Checkbox-CBEwKXH1.js → Checkbox-B3gBM6xy.js} +1 -1
- package/dist/{Checkbox-BvWPRa40.cjs → Checkbox-lWejJzIQ.cjs} +1 -1
- package/dist/{CheckboxGroup-DB8gbqAF.cjs → CheckboxGroup-OKmBXLpx.cjs} +1 -1
- package/dist/{CheckboxGroup-7MPMIbZT.js → CheckboxGroup-VqnA0eDK.js} +3 -3
- package/dist/{ColorStrip-Mm1SOzmg.cjs → ColorStrip-COhVH__l.cjs} +1 -1
- package/dist/{ColorStrip-BMWm-x-l.js → ColorStrip-c5l3AF0f.js} +14 -14
- package/dist/Confirm--cR6XRZQ.cjs +1 -0
- package/dist/Confirm-CHsxP6G_.js +313 -0
- package/dist/{DataTable-CvLbvDFT.js → DataTable-COfiHgll.js} +2 -2
- package/dist/{DataTable-DcS7jvxA.cjs → DataTable-XSEybeeP.cjs} +1 -1
- package/dist/{DatePicker-CjxX5dia.cjs → DatePicker-DIdEzzsG.cjs} +1 -1
- package/dist/{DatePicker-C4g1DKZM.js → DatePicker-ZiWlM0Ee.js} +13 -13
- package/dist/{EmptyState-v_HI2o5s.js → EmptyState-63UqLFX6.js} +6 -6
- package/dist/{EmptyState-CEF56DXZ.cjs → EmptyState-CV-UfKR6.cjs} +1 -1
- package/dist/{Form-DDnR6mdq.js → Form-2pXj4bhZ.js} +1 -1
- package/dist/{Form-DqGhhQKv.cjs → Form-CYesmztD.cjs} +1 -1
- package/dist/{GanttChart-jvuwmy_5.js → GanttChart-BTvjVa_d.js} +3 -3
- package/dist/{GanttChart-Cl-0ml4x.cjs → GanttChart-owqg5s-X.cjs} +1 -1
- package/dist/{ImageCropper-DJjEcz6Q.js → ImageCropper-CLyH3zZ-.js} +2 -2
- package/dist/{ImageCropper-CAqCuBq3.cjs → ImageCropper-DAU0ddvI.cjs} +1 -1
- package/dist/{InlineLoading-COgGKI27.js → InlineLoading-uGDGiTNv.js} +1 -1
- package/dist/{InlineLoading-C3wUvREF.cjs → InlineLoading-w5XKQdGi.cjs} +1 -1
- package/dist/{InterpolationChart-DB8oZyC7.js → InterpolationChart-Bt3_BiHO.js} +3 -3
- package/dist/{InterpolationChart-Dgol9kmR.cjs → InterpolationChart-C2MFUf1D.cjs} +1 -1
- package/dist/LineChart-D7nlCRxj.cjs +1 -0
- package/dist/LineChart-D869JljU.js +299 -0
- package/dist/{Message-CVzG-irA.js → Message-Cecz48PA.js} +4 -4
- package/dist/{Message-CjM5AAf0.cjs → Message-VfpaGblO.cjs} +1 -1
- package/dist/{Modal-b5eV95gR.js → Modal-CfcTmfeK.js} +1 -1
- package/dist/{Modal-stR5KDNF.cjs → Modal-CtCD-xEb.cjs} +1 -1
- package/dist/{NotificationCenter-kHVey4vK.cjs → NotificationCenter-CGhxyax1.cjs} +1 -1
- package/dist/{NotificationCenter-CltJiPh6.js → NotificationCenter-xL9_6BMt.js} +8 -8
- package/dist/{NotificationCenterItem-CXt7QYRf.cjs → NotificationCenterItem-C8zaSiem.cjs} +1 -1
- package/dist/{NotificationCenterItem-CTtvqo3b.js → NotificationCenterItem-CdzyTsCY.js} +4 -4
- package/dist/{NumberInput-Dt5KpjBd.cjs → NumberInput-BtPQ7p5y.cjs} +1 -1
- package/dist/{NumberInput-7hkGoOn3.js → NumberInput-Dk8ofnNJ.js} +2 -2
- package/dist/{Pagination-B284QH7x.js → Pagination-CSISbmpl.js} +1 -1
- package/dist/{Pagination-TcPX4VkA.cjs → Pagination-Ci1te4UW.cjs} +1 -1
- package/dist/{PieChart-yi1830We.js → PieChart-CQBJlBJI.js} +3 -3
- package/dist/{PieChart-hjwH4zpA.cjs → PieChart-DjFeDqdk.cjs} +1 -1
- package/dist/{ProgressBar-DLDd4cTS.js → ProgressBar-B2EXpOdC.js} +2 -2
- package/dist/{ProgressBar-ClrCBpPp.cjs → ProgressBar-D1O4iAxy.cjs} +1 -1
- package/dist/{Radio-DaN5EUk3.cjs → Radio-DALC1A47.cjs} +1 -1
- package/dist/{Radio-vHh-A9Lw.js → Radio-fgJU2hwQ.js} +2 -2
- package/dist/{Select-Cz9AAfUs.cjs → Select-CHuZfqLt.cjs} +1 -1
- package/dist/{Select-DLSDyOoF.js → Select-CwO5aX8j.js} +22 -22
- package/dist/{SidebarCollapseToggle-DeaWpfzA.js → SidebarCollapseToggle-CA6wQR0x.js} +2 -2
- package/dist/{SidebarCollapseToggle-CAfBF3AN.cjs → SidebarCollapseToggle-Cs4Azqiy.cjs} +1 -1
- package/dist/{Skeleton-Bx3VesCp.js → Skeleton-Ba4m2jYi.js} +1 -1
- package/dist/{Skeleton-D62xVkuM.cjs → Skeleton-Bgo6pIY2.cjs} +1 -1
- package/dist/{Slider-r83oBqJW.js → Slider-BAhq6cJT.js} +10 -10
- package/dist/{Slider-Cnpur-g4.cjs → Slider-BK5yS7Ih.cjs} +1 -1
- package/dist/{Spinner-Cex-1DDr.js → Spinner-BxnDJP1H.js} +1 -1
- package/dist/{Spinner-CLflP0Ge.cjs → Spinner-swPRQ7kf.cjs} +1 -1
- package/dist/{Stepper-ww4PLW-u.js → Stepper-BH7RO00M.js} +1 -1
- package/dist/{Stepper-ExfQjnbC.cjs → Stepper-Da0Ba3PE.cjs} +1 -1
- package/dist/{StepperStep-CyDcCslT.cjs → StepperStep-CI482bzO.cjs} +1 -1
- package/dist/{StepperStep-xCnHtaeb.js → StepperStep-CLd8c1dj.js} +1 -1
- package/dist/{Switch-odyGx4iV.js → Switch-DS297b1b.js} +4 -4
- package/dist/{Switch-Bd7OUmEG.cjs → Switch-a73y1wiu.cjs} +1 -1
- package/dist/{Tabs-DAtxkztl.js → Tabs-BzsQiQ2H.js} +1 -1
- package/dist/{Tabs-B7ZYrItJ.cjs → Tabs-D3daz-Xc.cjs} +1 -1
- package/dist/{TextInput-DWXb6yKh.cjs → TextInput-BkCOQWfT.cjs} +2 -2
- package/dist/{TextInput-BOuAvB8K.js → TextInput-Kt2ciMVI.js} +7 -7
- package/dist/{Toast-YEddFrhn.js → Toast-CeGAznEA.js} +8 -8
- package/dist/{Toast-DTDAT-A4.cjs → Toast-Ci4P6mM0.cjs} +1 -1
- package/dist/{Toaster-BpYvPdSk.cjs → Toaster-Cit4iNYG.cjs} +1 -1
- package/dist/{Toaster-Dfi6bj_6.js → Toaster-zIdIFToW.js} +1 -1
- package/dist/{Tree-aN3f3kZP.cjs → Tree-BiqO99_n.cjs} +1 -1
- package/dist/{Tree-BJv3cwiE.js → Tree-ZtXPSE7w.js} +1 -1
- package/dist/{TreeNode-xfWkYDCS.cjs → TreeNode-BcVuy7zd.cjs} +1 -1
- package/dist/{TreeNode-BD_8vNNF.js → TreeNode-HVTTXuRl.js} +1 -1
- package/dist/{UserMenu-C4SoJOF7.js → UserMenu-DuAQ0yne.js} +2 -2
- package/dist/{UserMenu-Cq2dws0F.cjs → UserMenu-FhWFKqzy.cjs} +1 -1
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +201 -193
- package/dist/component-styles.json +29 -0
- package/dist/components/AiLabel.cjs +1 -1
- package/dist/components/AiLabel.mjs +1 -1
- package/dist/components/AiProvider.cjs +1 -0
- package/dist/components/AiProvider.d.ts +29 -0
- package/dist/components/AiProvider.mjs +2 -0
- package/dist/components/AiProvider.vue.d.ts +36 -0
- package/dist/components/AiProvider.vue.d.ts.map +1 -0
- package/dist/components/AiUsage.cjs +1 -0
- package/dist/components/AiUsage.d.ts +29 -0
- package/dist/components/AiUsage.mjs +2 -0
- package/dist/components/AiUsage.vue.d.ts +28 -0
- package/dist/components/AiUsage.vue.d.ts.map +1 -0
- package/dist/components/Avatar.cjs +1 -1
- package/dist/components/Avatar.mjs +1 -1
- package/dist/components/Avatar.vue.d.ts +1 -1
- package/dist/components/Badge.cjs +1 -1
- package/dist/components/Badge.mjs +1 -1
- package/dist/components/Badge.vue.d.ts +1 -1
- package/dist/components/Banner.cjs +1 -1
- package/dist/components/Banner.mjs +1 -1
- package/dist/components/Blueprint.cjs +1 -1
- package/dist/components/Blueprint.mjs +1 -1
- package/dist/components/BlueprintBackground.cjs +1 -1
- package/dist/components/BlueprintBackground.mjs +1 -1
- package/dist/components/BlueprintCard.cjs +1 -1
- package/dist/components/BlueprintCard.mjs +1 -1
- package/dist/components/BlueprintCard.vue.d.ts +1 -1
- package/dist/components/BlueprintControls.cjs +1 -1
- package/dist/components/BlueprintControls.mjs +1 -1
- package/dist/components/BlueprintMinimap.cjs +1 -1
- package/dist/components/BlueprintMinimap.mjs +1 -1
- package/dist/components/Board.cjs +1 -1
- package/dist/components/Board.mjs +1 -1
- package/dist/components/BottomPanel.cjs +1 -1
- package/dist/components/BottomPanel.mjs +1 -1
- package/dist/components/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs.mjs +1 -1
- package/dist/components/Briefing.cjs +1 -0
- package/dist/components/Briefing.d.ts +22 -0
- package/dist/components/Briefing.mjs +2 -0
- package/dist/components/Briefing.vue.d.ts +36 -0
- package/dist/components/Briefing.vue.d.ts.map +1 -0
- package/dist/components/BriefingDestination.cjs +1 -0
- package/dist/components/BriefingDestination.d.ts +16 -0
- package/dist/components/BriefingDestination.mjs +2 -0
- package/dist/components/BriefingDestination.vue.d.ts +25 -0
- package/dist/components/BriefingDestination.vue.d.ts.map +1 -0
- package/dist/components/Calendar.cjs +1 -1
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/Calendar.vue.d.ts +1 -1
- package/dist/components/Charts/BarChart.cjs +1 -1
- package/dist/components/Charts/BarChart.mjs +1 -1
- package/dist/components/Charts/GanttChart.cjs +1 -1
- package/dist/components/Charts/GanttChart.mjs +1 -1
- package/dist/components/Charts/InterpolationChart.cjs +1 -1
- package/dist/components/Charts/InterpolationChart.mjs +1 -1
- package/dist/components/Charts/LineChart.cjs +1 -1
- package/dist/components/Charts/LineChart.mjs +1 -1
- package/dist/components/Charts/LineChart.vue.d.ts.map +1 -1
- package/dist/components/Charts/PieChart.cjs +1 -1
- package/dist/components/Charts/PieChart.mjs +1 -1
- package/dist/components/Charts/Sparkline.cjs +1 -1
- package/dist/components/Charts/Sparkline.mjs +1 -1
- package/dist/components/Charts/shared/xLabels.d.ts +16 -0
- package/dist/components/Charts/shared/xLabels.d.ts.map +1 -0
- package/dist/components/Checkbox.cjs +1 -1
- package/dist/components/Checkbox.mjs +1 -1
- package/dist/components/CheckboxGroup.cjs +1 -1
- package/dist/components/CheckboxGroup.mjs +1 -1
- package/dist/components/ColorStrip.cjs +1 -1
- package/dist/components/ColorStrip.mjs +1 -1
- package/dist/components/CommandPalette.cjs +1 -1
- package/dist/components/CommandPalette.mjs +1 -1
- package/dist/components/Confirm.cjs +1 -1
- package/dist/components/Confirm.mjs +1 -1
- package/dist/components/DataTable.cjs +1 -1
- package/dist/components/DataTable.mjs +1 -1
- package/dist/components/DatePicker.cjs +1 -1
- package/dist/components/DatePicker.mjs +1 -1
- package/dist/components/DatePicker.vue.d.ts +3 -3
- package/dist/components/DefinitionList.cjs +1 -1
- package/dist/components/DefinitionList.mjs +1 -1
- package/dist/components/DefinitionListItem.cjs +1 -1
- package/dist/components/DefinitionListItem.mjs +1 -1
- package/dist/components/DragHandle.cjs +1 -1
- package/dist/components/DragHandle.mjs +1 -1
- package/dist/components/EmptyState.cjs +1 -1
- package/dist/components/EmptyState.mjs +1 -1
- package/dist/components/Field.cjs +1 -1
- package/dist/components/Field.mjs +1 -1
- package/dist/components/FileUploader.cjs +1 -1
- package/dist/components/FileUploader.mjs +1 -1
- package/dist/components/Flag.cjs +1 -1
- package/dist/components/Flag.mjs +1 -1
- package/dist/components/FloatingToolbar.cjs +1 -1
- package/dist/components/FloatingToolbar.mjs +1 -1
- package/dist/components/Form.cjs +1 -1
- package/dist/components/Form.mjs +1 -1
- package/dist/components/Grid.cjs +1 -1
- package/dist/components/Grid.mjs +1 -1
- package/dist/components/ImageCropper.cjs +1 -1
- package/dist/components/ImageCropper.mjs +1 -1
- package/dist/components/InlineEdit.cjs +1 -1
- package/dist/components/InlineEdit.mjs +1 -1
- package/dist/components/InlineLoading.cjs +1 -1
- package/dist/components/InlineLoading.mjs +1 -1
- package/dist/components/JsonTree.cjs +1 -1
- package/dist/components/JsonTree.mjs +1 -1
- package/dist/components/Label.cjs +1 -1
- package/dist/components/Label.mjs +1 -1
- package/dist/components/Layer.cjs +1 -1
- package/dist/components/Layer.mjs +1 -1
- package/dist/components/MenuBar.cjs +1 -1
- package/dist/components/MenuBar.mjs +1 -1
- package/dist/components/MenuBarItem.cjs +1 -1
- package/dist/components/MenuBarItem.mjs +1 -1
- package/dist/components/MenuDivider.cjs +1 -1
- package/dist/components/MenuDivider.mjs +1 -1
- package/dist/components/Message.cjs +1 -1
- package/dist/components/Message.mjs +1 -1
- package/dist/components/Modal.cjs +1 -1
- package/dist/components/Modal.mjs +1 -1
- package/dist/components/Modal.vue.d.ts +1 -1
- package/dist/components/NotificationCenter.cjs +1 -1
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/NotificationCenterItem.cjs +1 -1
- package/dist/components/NotificationCenterItem.mjs +1 -1
- package/dist/components/NubiscoMark.cjs +1 -1
- package/dist/components/NubiscoMark.mjs +1 -1
- package/dist/components/NubiscoPlatformMark.cjs +1 -1
- package/dist/components/NubiscoPlatformMark.mjs +1 -1
- package/dist/components/NumberInput.cjs +1 -1
- package/dist/components/NumberInput.mjs +1 -1
- package/dist/components/NumberInput.vue.d.ts +1 -1
- package/dist/components/Pagination.cjs +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/Panel.cjs +1 -1
- package/dist/components/Panel.mjs +1 -1
- package/dist/components/ProgressBar.cjs +1 -1
- package/dist/components/ProgressBar.mjs +1 -1
- package/dist/components/Radio.cjs +1 -1
- package/dist/components/Radio.mjs +1 -1
- package/dist/components/ReorderList.cjs +1 -1
- package/dist/components/ReorderList.mjs +1 -1
- package/dist/components/Select.cjs +1 -1
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Select.vue.d.ts +1 -1
- package/dist/components/Shell.cjs +1 -1
- package/dist/components/Shell.mjs +1 -1
- package/dist/components/ShellPanel.cjs +1 -1
- package/dist/components/ShellPanel.mjs +1 -1
- package/dist/components/SidebarBrand.cjs +1 -1
- package/dist/components/SidebarBrand.mjs +1 -1
- package/dist/components/SidebarCollapseToggle.cjs +1 -1
- package/dist/components/SidebarCollapseToggle.mjs +1 -1
- package/dist/components/SidebarLink.cjs +1 -1
- package/dist/components/SidebarLink.mjs +1 -1
- package/dist/components/SidebarMenu.cjs +1 -1
- package/dist/components/SidebarMenu.mjs +1 -1
- package/dist/components/SidebarMenuGroup.cjs +1 -1
- package/dist/components/SidebarMenuGroup.mjs +1 -1
- package/dist/components/SidebarMenuItem.cjs +1 -1
- package/dist/components/SidebarMenuItem.mjs +1 -1
- package/dist/components/Skeleton.cjs +1 -1
- package/dist/components/Skeleton.mjs +1 -1
- package/dist/components/Slider.cjs +1 -1
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/Slider.vue.d.ts +1 -1
- package/dist/components/Spinner.cjs +1 -1
- package/dist/components/Spinner.mjs +1 -1
- package/dist/components/Stepper.cjs +1 -1
- package/dist/components/Stepper.mjs +1 -1
- package/dist/components/StepperStep.cjs +1 -1
- package/dist/components/StepperStep.mjs +1 -1
- package/dist/components/Submenu.cjs +1 -1
- package/dist/components/Submenu.mjs +1 -1
- package/dist/components/Switch.cjs +1 -1
- package/dist/components/Switch.mjs +1 -1
- package/dist/components/TableOfContents.cjs +1 -1
- package/dist/components/TableOfContents.mjs +1 -1
- package/dist/components/TableOfContents.vue.d.ts +1 -1
- package/dist/components/Tabs.cjs +1 -1
- package/dist/components/Tabs.mjs +1 -1
- package/dist/components/TextInput.cjs +1 -1
- package/dist/components/TextInput.mjs +1 -1
- package/dist/components/TextInput.vue.d.ts +2 -2
- package/dist/components/TextInput.vue.d.ts.map +1 -1
- package/dist/components/Toast.cjs +1 -1
- package/dist/components/Toast.mjs +1 -1
- package/dist/components/Toaster.cjs +1 -1
- package/dist/components/Toaster.mjs +1 -1
- package/dist/components/Tree.cjs +1 -1
- package/dist/components/Tree.mjs +1 -1
- package/dist/components/TreeNode.cjs +1 -1
- package/dist/components/TreeNode.mjs +1 -1
- package/dist/components/UserMenu.cjs +1 -1
- package/dist/components/UserMenu.mjs +1 -1
- package/dist/components/Video.cjs +1 -1
- package/dist/components/Video.mjs +1 -1
- package/dist/components/Video.vue.d.ts +1 -1
- package/dist/components/Walkthrough.cjs +1 -1
- package/dist/components/Walkthrough.mjs +1 -1
- package/dist/components/Wireframe.cjs +1 -1
- package/dist/components/Wireframe.mjs +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/manifest.d.ts +4 -0
- package/dist/components/manifest.d.ts.map +1 -1
- package/dist/components/manifest.js +4 -0
- package/dist/composables/useBlueprint.composable.cjs +1 -1
- package/dist/composables/useBlueprint.composable.mjs +1 -1
- package/dist/composables/useConfirm.composable.cjs +1 -1
- package/dist/composables/useConfirm.composable.mjs +3 -3
- package/dist/composables/useInlineLoading.composable.cjs +1 -1
- package/dist/composables/useInlineLoading.composable.mjs +1 -1
- package/dist/composables/useLoadingAnnouncer.composable.cjs +1 -1
- package/dist/composables/useLoadingAnnouncer.composable.mjs +1 -1
- package/dist/global.d.ts +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +108 -104
- package/dist/main.d.ts +8 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/styles/AiProvider.css +1 -0
- package/dist/styles/AiUsage.css +1 -0
- package/dist/styles/Briefing.css +1 -0
- package/dist/styles/BriefingDestination.css +1 -0
- package/dist/styles/LineChart.css +1 -1
- package/dist/ui.css +13 -9
- package/package.json +1 -1
- package/dist/Confirm-CmQzDZFC.js +0 -313
- package/dist/Confirm-DfTjBTuJ.cjs +0 -1
- package/dist/LineChart-DLu7_qcT.js +0 -241
- package/dist/LineChart-Do_NISVc.cjs +0 -1
- /package/dist/{Avatar-4BWmDFhO.js → Avatar-BibgBZuN.js} +0 -0
- /package/dist/{Avatar-BqiwSWeV.cjs → Avatar-BpPczEa8.cjs} +0 -0
- /package/dist/{Badge-CLgaADV-.cjs → Badge-D6nlcs4F.cjs} +0 -0
- /package/dist/{Badge-BH8qD-w8.js → Badge-DJx3RZxk.js} +0 -0
- /package/dist/{Blueprint.context-CfOZcttA.js → Blueprint.context-BU2ujsDD.js} +0 -0
- /package/dist/{Blueprint.context-NmqerYFf.cjs → Blueprint.context-DjbRPuLQ.cjs} +0 -0
- /package/dist/{BlueprintBackground-D52auBfC.cjs → BlueprintBackground-D5i-Rlmm.cjs} +0 -0
- /package/dist/{BlueprintBackground-Y-DxC7zj.js → BlueprintBackground-DtGJCzDy.js} +0 -0
- /package/dist/{BlueprintControls-Dqrr5aoC.cjs → BlueprintControls-BfTyqOwC.cjs} +0 -0
- /package/dist/{BlueprintControls-hQAFAlHB.js → BlueprintControls-COeG8N6G.js} +0 -0
- /package/dist/{BlueprintMinimap-D69cdbyQ.cjs → BlueprintMinimap-CujSRNvs.cjs} +0 -0
- /package/dist/{BlueprintMinimap-Ch9E_5bl.js → BlueprintMinimap-xwEOZlv6.js} +0 -0
- /package/dist/{Board-B_sqwxsN.cjs → Board-DmOzimbT.cjs} +0 -0
- /package/dist/{Board-nGnQkqJb.js → Board-R38Zb5t2.js} +0 -0
- /package/dist/{BottomPanel-DlrKsWHz.cjs → BottomPanel-Cpr7_cZI.cjs} +0 -0
- /package/dist/{BottomPanel-UDdEoJqh.js → BottomPanel-DdjpIyOA.js} +0 -0
- /package/dist/{Breadcrumbs-CRlWYf7S.js → Breadcrumbs-B0nEpUik.js} +0 -0
- /package/dist/{Breadcrumbs-Bw5LdW9D.cjs → Breadcrumbs-B8zyUzRM.cjs} +0 -0
- /package/dist/{Calendar-D-iSzX4T.cjs → Calendar-BPYKfErK.cjs} +0 -0
- /package/dist/{Calendar-CJd9UzLq.js → Calendar-C2KlJvo5.js} +0 -0
- /package/dist/{ChartLegend-C8_vklRf.js → ChartLegend-BtBKVnH3.js} +0 -0
- /package/dist/{ChartLegend-CTqPJ52N.cjs → ChartLegend-ndpGucTZ.cjs} +0 -0
- /package/dist/{CheckboxGroup.context-CcJlyjRV.js → CheckboxGroup.context-B2qjPnB2.js} +0 -0
- /package/dist/{CheckboxGroup.context-BJ_mXMo8.cjs → CheckboxGroup.context-DyFYVLH1.cjs} +0 -0
- /package/dist/{CommandPalette-BevB1sEi.js → CommandPalette-CU8gkgTx.js} +0 -0
- /package/dist/{CommandPalette-BxtsOesP.cjs → CommandPalette-zmNIqPex.cjs} +0 -0
- /package/dist/{DefinitionList-BM-83VTW.cjs → DefinitionList-COgbbyRS.cjs} +0 -0
- /package/dist/{DefinitionList-YSgdnnMD.js → DefinitionList-Xn-f_QhT.js} +0 -0
- /package/dist/{DefinitionListItem-Dx3z7niO.cjs → DefinitionListItem-B4bGJJJj.cjs} +0 -0
- /package/dist/{DefinitionListItem-DfTl4VTm.js → DefinitionListItem-ZRjLrhaI.js} +0 -0
- /package/dist/{DragHandle-DqcKoM4f.js → DragHandle-BbgSL4IW.js} +0 -0
- /package/dist/{DragHandle-C91bypG3.cjs → DragHandle-bosa6iXA.cjs} +0 -0
- /package/dist/{Field-glovCxOq.cjs → Field-DznERREe.cjs} +0 -0
- /package/dist/{Field-Csuq9cqO.js → Field-LiiMobFy.js} +0 -0
- /package/dist/{FileUploader-B8jyhhkN.cjs → FileUploader-BjYXOXxj.cjs} +0 -0
- /package/dist/{FileUploader-BAns0DbJ.js → FileUploader-DwKKUn71.js} +0 -0
- /package/dist/{Flag-B16fkljO.cjs → Flag-C326U1pM.cjs} +0 -0
- /package/dist/{Flag-e7J5iLc8.js → Flag-DBHUM-oa.js} +0 -0
- /package/dist/{FloatingToolbar-DkQDopOX.js → FloatingToolbar-B_VISp4J.js} +0 -0
- /package/dist/{FloatingToolbar-B6xZvl4M.cjs → FloatingToolbar-CMYR7_b_.cjs} +0 -0
- /package/dist/{Grid-By_NqGWQ.cjs → Grid-D8c0StGs.cjs} +0 -0
- /package/dist/{Grid-BF4ObsbF.js → Grid-XtnH-vr_.js} +0 -0
- /package/dist/{InlineEdit-wpQAg80H.cjs → InlineEdit-BLrO3i1p.cjs} +0 -0
- /package/dist/{InlineEdit-ak0WY89o.js → InlineEdit-BemWhcI3.js} +0 -0
- /package/dist/{JsonTree-CnEinkjy.cjs → JsonTree-B3TskapA.cjs} +0 -0
- /package/dist/{JsonTree-DJNeIkMt.js → JsonTree-DzEsyR3A.js} +0 -0
- /package/dist/{Label-CR6g53gz.cjs → Label-CVCNXFn1.cjs} +0 -0
- /package/dist/{Label-DkdjCPeM.js → Label-ciCAG21-.js} +0 -0
- /package/dist/{Layer-Bw8eiq3V.cjs → Layer-BRDO-CDw.cjs} +0 -0
- /package/dist/{Layer--aocK4Jq.js → Layer-DsNOdX44.js} +0 -0
- /package/dist/{MenuBar-DOHhu1YE.js → MenuBar-BTSnSFvG.js} +0 -0
- /package/dist/{MenuBar-IE1c-DnC.cjs → MenuBar-CFCpmpU7.cjs} +0 -0
- /package/dist/{MenuBarItem-B3DXNMZR.js → MenuBarItem-C7TPhYnN.js} +0 -0
- /package/dist/{MenuBarItem-DkJPAdkN.cjs → MenuBarItem-D1LSKPxk.cjs} +0 -0
- /package/dist/{MenuDivider-CZFNkoP5.js → MenuDivider-BosPmiMO.js} +0 -0
- /package/dist/{MenuDivider-D9Dw8VKM.cjs → MenuDivider-kpF-fk4u.cjs} +0 -0
- /package/dist/{NubiscoMark-Dvwu7mri.cjs → NubiscoMark-D4-pm2EX.cjs} +0 -0
- /package/dist/{NubiscoMark-DTPsWWI3.js → NubiscoMark-DgzvBHAd.js} +0 -0
- /package/dist/{NubiscoPlatformMark-COQnCydq.js → NubiscoPlatformMark-CayXaZGB.js} +0 -0
- /package/dist/{NubiscoPlatformMark-D2sQvlRb.cjs → NubiscoPlatformMark-DV2XeqiT.cjs} +0 -0
- /package/dist/{Panel-DXpXMlzK.js → Panel-Drfi9pqS.js} +0 -0
- /package/dist/{Panel-Yrl_AZTB.cjs → Panel-valtWFWI.cjs} +0 -0
- /package/dist/{ReorderList-DlO13mZ8.js → ReorderList-BDLxDc6t.js} +0 -0
- /package/dist/{ReorderList-DaDY714T.cjs → ReorderList-BdHgEL4G.cjs} +0 -0
- /package/dist/{Shell-CtpVIsIr.cjs → Shell-6Dwl2FnC.cjs} +0 -0
- /package/dist/{Shell-Cfdfqfvc.js → Shell-C9DK_Phw.js} +0 -0
- /package/dist/{ShellPanel-B2AgOmD5.js → ShellPanel-Cu3C3H9J.js} +0 -0
- /package/dist/{ShellPanel-Db3C1879.cjs → ShellPanel-rrSF7BQs.cjs} +0 -0
- /package/dist/{SidebarBrand-PUeotNqh.js → SidebarBrand-Ba6QIT1v.js} +0 -0
- /package/dist/{SidebarBrand-CUdKgDWl.cjs → SidebarBrand-BqSqQNPa.cjs} +0 -0
- /package/dist/{SidebarLink-COBTc762.cjs → SidebarLink-BbzeT8Tq.cjs} +0 -0
- /package/dist/{SidebarLink-DFxHQLCu.js → SidebarLink-Bi8GxvCf.js} +0 -0
- /package/dist/{SidebarMenu-DYqo6XE_.cjs → SidebarMenu-B4nng5Fz.cjs} +0 -0
- /package/dist/{SidebarMenu-DWEzNXfe.js → SidebarMenu-DoMgZO7c.js} +0 -0
- /package/dist/{SidebarMenuGroup-BHtxWHBk.cjs → SidebarMenuGroup-BdOpz4N1.cjs} +0 -0
- /package/dist/{SidebarMenuGroup-C2DHT9rs.js → SidebarMenuGroup-CmCPtZJD.js} +0 -0
- /package/dist/{SidebarMenuItem-DFAU-ROX.js → SidebarMenuItem-CWXKdUTX.js} +0 -0
- /package/dist/{SidebarMenuItem-BjdRY91e.cjs → SidebarMenuItem-j21WVpId.cjs} +0 -0
- /package/dist/{Sparkline-DL_g9GtX.js → Sparkline-C4gA55Pc.js} +0 -0
- /package/dist/{Sparkline-CeUnGfSA.cjs → Sparkline-DI7arXX0.cjs} +0 -0
- /package/dist/{Stepper.context-Doy3IafX.cjs → Stepper.context-Dxw8xYGX.cjs} +0 -0
- /package/dist/{Stepper.context-Dj8sqSeB.js → Stepper.context-q_CjX3CO.js} +0 -0
- /package/dist/{Submenu-Bay1plPK.cjs → Submenu-CpNOHf-e.cjs} +0 -0
- /package/dist/{Submenu-CAwlRk1P.js → Submenu-DKpL5htf.js} +0 -0
- /package/dist/{TableOfContents-CFXhJ6cZ.js → TableOfContents-BqF5y-1t.js} +0 -0
- /package/dist/{TableOfContents-CLB6iFCf.cjs → TableOfContents-C6xx7P4d.cjs} +0 -0
- /package/dist/{TreeContext-DXn-HNow.cjs → TreeContext-we7Xt7IP.cjs} +0 -0
- /package/dist/{TreeContext-D_NJ8vrP.js → TreeContext-xtlNBGhB.js} +0 -0
- /package/dist/{Video-B7VqDjou.cjs → Video-Bgzvf-C9.cjs} +0 -0
- /package/dist/{Video-r2VtGVlN.js → Video-CY0UEDLL.js} +0 -0
- /package/dist/{Walkthrough-C0WRD_PK.js → Walkthrough-KmxZqXxV.js} +0 -0
- /package/dist/{Walkthrough-CrmK6nRz.cjs → Walkthrough-oU-NaG_A.cjs} +0 -0
- /package/dist/{Wireframe-u15I8Ldj.js → Wireframe-Bf55dFWu.js} +0 -0
- /package/dist/{Wireframe-pfnyZFGe.cjs → Wireframe-CX8KvGJx.cjs} +0 -0
- /package/dist/{palette-0LscvyqA.cjs → palette-BoABA-De.cjs} +0 -0
- /package/dist/{palette-CxPgs-Dn.js → palette-VMXxKICH.js} +0 -0
- /package/dist/{pixi-scene-CN2JIn7_.js → pixi-scene-D57Y3MvT.js} +0 -0
- /package/dist/{pixi-scene-CRogQbky.cjs → pixi-scene-OOSMyGKD.cjs} +0 -0
- /package/dist/{scales-CFWdZe1z.cjs → scales-BWtB8m5D.cjs} +0 -0
- /package/dist/{scales-DMlq1jQZ.js → scales-DVJzRU1F.js} +0 -0
- /package/dist/{useChartSize-C8SNfQZL.cjs → useChartSize-D9UxUkiU.cjs} +0 -0
- /package/dist/{useChartSize-Dbm1f8au.js → useChartSize-Dyh37PYP.js} +0 -0
- /package/dist/{useLoadingAnnouncer.composable-DCZIIefo.cjs → useLoadingAnnouncer.composable-BMMz4C1C.cjs} +0 -0
- /package/dist/{useLoadingAnnouncer.composable-B9SAlQE6.js → useLoadingAnnouncer.composable-DY8jGEwJ.js} +0 -0
- /package/dist/{vue-i18n-CYAt-t4N.cjs → vue-i18n-B_5xehV9.cjs} +0 -0
- /package/dist/{vue-i18n-D5xWp3Q8.js → vue-i18n-Dzm-MDw4.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./Grid-
|
|
1
|
+
import { t as e } from "./Grid-XtnH-vr_.js";
|
|
2
2
|
import { createBlock as t, createCommentVNode as n, createTextVNode as r, defineComponent as i, openBlock as a, renderSlot as o, toDisplayString as s, withCtx as c } from "vue";
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region src/components/Form.vue
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Grid-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./Grid-D8c0StGs.cjs`);let t=require(`vue`);var n=(0,t.defineComponent)({__name:`Form`,props:{title:{default:void 0}},setup(n){return(r,i)=>((0,t.openBlock)(),(0,t.createBlock)(e.t,{is:`form`,dir:`col`,gap:`md`,class:`nb-form`},{default:(0,t.withCtx)(()=>[n.title?((0,t.openBlock)(),(0,t.createBlock)(e.t,{key:0,is:`h4`,class:`nb-form--header`},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(n.title),1)]),_:1})):(0,t.createCommentVNode)(``,!0),r.$slots.message?((0,t.openBlock)(),(0,t.createBlock)(e.t,{key:1,is:`p`,class:`nb-form--message`},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(r.$slots,`message`)]),_:3})):(0,t.createCommentVNode)(``,!0),r.$slots.default?((0,t.openBlock)(),(0,t.createBlock)(e.t,{key:2,is:`div`,dir:`col`,gap:`sm`,class:`nb-form--body`},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(r.$slots,`default`)]),_:3})):(0,t.createCommentVNode)(``,!0),r.$slots.footer?((0,t.openBlock)(),(0,t.createBlock)(e.t,{key:3,is:`footer`,class:`nb-form--footer`,justify:`end`},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(r.$slots,`footer`)]),_:3})):(0,t.createCommentVNode)(``,!0)]),_:3}))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
|
|
2
|
-
import { i as t, l as n, n as r, r as i, u as a } from "./palette-
|
|
3
|
-
import { t as o } from "./ChartLegend-
|
|
4
|
-
import { a as s, n as c } from "./scales-
|
|
2
|
+
import { i as t, l as n, n as r, r as i, u as a } from "./palette-VMXxKICH.js";
|
|
3
|
+
import { t as o } from "./ChartLegend-BtBKVnH3.js";
|
|
4
|
+
import { a as s, n as c } from "./scales-DVJzRU1F.js";
|
|
5
5
|
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createVNode as h, defineComponent as g, normalizeClass as _, normalizeStyle as v, openBlock as y, reactive as b, ref as x, renderList as S, toDisplayString as C, withCtx as w } from "vue";
|
|
6
6
|
//#region src/components/Charts/GanttChart.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var T = { class: "nb-gantt__list-body" }, ee = ["onClick"], te = { class: "nb-gantt__list-group-label" }, ne = ["onMouseenter"], re = ["title"], ie = ["width"], ae = { class: "nb-gantt__time-header" }, oe = ["x", "y"], se = ["x1", "x2"], ce = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./palette-0LscvyqA.cjs`),n=require(`./ChartLegend-CTqPJ52N.cjs`),r=require(`./scales-CFWdZe1z.cjs`);let i=require(`vue`);var a={class:`nb-gantt__list-body`},o=[`onClick`],s={class:`nb-gantt__list-group-label`},c=[`onMouseenter`],l=[`title`],u=[`width`],d={class:`nb-gantt__time-header`},f=[`x`,`y`],p=[`x1`,`x2`],m=[`width`,`height`,`aria-label`],h={key:0},g=[`x1`,`x2`,`y2`],ee=[`y`,`width`,`height`],te=[`x1`,`x2`,`y2`],ne=[`x`,`y`,`width`,`height`],_=[`points`],v=[`points`],y=[`x`,`y`,`width`,`height`,`fill`,`onMouseenter`,`onMousemove`],b=[`x`,`y`,`width`,`height`,`fill`],x=[`points`,`fill`,`onMouseenter`,`onMousemove`],re=[`d`],ie=[`points`],ae=[`y`,`width`,`height`,`onMouseenter`],S=40,C=(0,i.defineComponent)({__name:`GanttChart`,props:{tasks:{default:()=>[]},dependencies:{default:()=>[]},groups:{default:()=>[]},timeScale:{default:`week`},rowHeight:{default:36},listWidth:{default:200},showTodayMarker:{type:Boolean,default:!0},today:{default:void 0},showProgress:{type:Boolean,default:!0},statusColors:{default:void 0},title:{default:void 0},subtitle:{default:void 0},height:{default:400},showLegend:{type:Boolean,default:!0},showTooltip:{type:Boolean,default:!0},showGrid:{type:Boolean,default:!0},colors:{default:()=>t.n}},setup(e){let C=e,w={default:t.r(1),"on-track":t.r(3),"at-risk":t.r(4),behind:t.r(5),complete:t.r(2)},T=(0,i.computed)(()=>({...w,...C.statusColors})),E=(0,i.computed)(()=>Math.round(C.rowHeight*.22)),D=(0,i.computed)(()=>C.rowHeight-E.value*2),O=(0,i.computed)(()=>Math.round(C.rowHeight*.28)),k=(0,i.ref)(new Set((C.groups??[]).filter(e=>e.collapsed).map(e=>e.id))),A=e=>{let t=new Set(k.value);t.has(e)?t.delete(e):t.add(e),k.value=t},j=(0,i.computed)(()=>(C.groups?.length??0)>0),M=(0,i.computed)(()=>{let e=C.tasks??[],t=C.groups??[];if(!t.length)return e.map(e=>({id:e.id,label:e.label,type:`task`,milestone:e.milestone}));let n=[],r=new Map(t.map(e=>[e.id,e])),i=new Map,a=[];for(let t of e)if(t.group&&r.has(t.group)){let e=i.get(t.group)??[];e.push(t),i.set(t.group,e)}else a.push(t);for(let e of t)if(n.push({id:e.id,label:e.label,type:`group`}),!k.value.has(e.id))for(let t of i.get(e.id)??[])n.push({id:t.id,label:t.label,type:`task`,milestone:t.milestone,indent:!0});for(let e of a)n.push({id:e.id,label:e.label,type:`task`,milestone:e.milestone});return n}),N=(0,i.computed)(()=>M.value.filter(e=>e.type===`task`)),P=(0,i.computed)(()=>{let e=new Map;return M.value.forEach((t,n)=>e.set(t.id,n)),e}),F=e=>typeof e==`string`?new Date(e).getTime():e.getTime(),I=(0,i.computed)(()=>{let e=C.tasks??[];if(!e.length){let e=Date.now();return[e,e+7*864e5]}let t=1/0,n=-1/0;for(let r of e){let e=F(r.start),i=r.end?F(r.end):e;e<t&&(t=e),i>n&&(n=i)}let r=L(C.timeScale);return[t-r,n+r]}),L=e=>{let t=864e5;return e===`day`?t:e===`week`?7*t:e===`month`?30*t:e===`quarter`?91*t:365*t},R=(0,i.computed)(()=>{let e=C.timeScale;return e===`day`?40:e===`week`?120:e===`month`?180:e===`quarter`?240:360}),z=(0,i.computed)(()=>R.value/L(C.timeScale)),B=(0,i.computed)(()=>I.value[0]),V=(0,i.computed)(()=>Math.max(200,Math.ceil((I.value[1]-I.value[0])*z.value))),H=(0,i.computed)(()=>M.value.length*C.rowHeight),U=(0,i.computed)(()=>r.a(new Date(I.value[0]),new Date(I.value[1]),C.timeScale,z.value,B.value)),W=(0,i.computed)(()=>{if(!C.showTodayMarker)return null;let e=r.n(C.today?new Date(C.today):new Date,B.value,z.value);return e<0||e>V.value?null:e}),G=(e,n)=>e.color?e.color:e.status&&e.status!==`default`?T.value[e.status]:t.i(n,C.colors),K=e=>(typeof e==`string`?new Date(e):e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),oe=(0,i.computed)(()=>(C.tasks??[]).filter(e=>!e.milestone&&e.end).map((e,t)=>{let n=P.value.get(e.id);if(n===void 0)return null;let i=r.n(e.start,B.value,z.value),a=r.n(e.end,B.value,z.value);return{id:e.id,x:i,y:n*C.rowHeight,width:Math.max(a-i,4),color:G(e,t),status:e.status??`default`,progress:e.progress??0,label:e.label,start:K(e.start),end:K(e.end)}}).filter(Boolean)),se=(0,i.computed)(()=>(C.tasks??[]).filter(e=>e.milestone).map((e,t)=>{let n=P.value.get(e.id);return n===void 0?null:{id:e.id,x:r.n(e.start,B.value,z.value),y:n*C.rowHeight,color:G(e,t),label:e.label,date:K(e.start)}}).filter(Boolean)),ce=(0,i.computed)(()=>{let e=C.groups??[],t=C.tasks??[];return e.length?e.map(e=>{let n=P.value.get(e.id);if(n===void 0)return null;let i=t.filter(t=>t.group===e.id);if(!i.length)return null;let a=1/0,o=-1/0;for(let e of i){let t=F(e.start),n=e.end?F(e.end):t;t<a&&(a=t),n>o&&(o=n)}let s=r.n(new Date(a),B.value,z.value),c=r.n(new Date(o),B.value,z.value);return{id:e.id,x:s,y:n*C.rowHeight,width:Math.max(c-s,4)}}).filter(Boolean):[]}),q=(e,t)=>`${e},${t} ${e-5},${t+5} ${e+5},${t+5}`,le=(e,t,n)=>`${e},${t-n} ${e+n},${t} ${e},${t+n} ${e-n},${t}`,J=(0,i.computed)(()=>{let e=C.dependencies??[];if(!e.length)return[];let t=new Map((C.tasks??[]).map(e=>[e.id,e]));return e.map(e=>{let n=t.get(e.from),i=t.get(e.to);if(!n||!i)return null;let a=P.value.get(e.from),o=P.value.get(e.to);if(a===void 0||o===void 0)return null;let s=e.type??`finish-to-start`,c=C.rowHeight,l,u,d,f;s===`finish-to-start`?(l=n.milestone?r.n(n.start,B.value,z.value)+O.value:r.n(n.end??n.start,B.value,z.value),u=a*c+c/2,d=i.milestone?r.n(i.start,B.value,z.value)-O.value:r.n(i.start,B.value,z.value),f=o*c+c/2):s===`start-to-start`?(l=r.n(n.start,B.value,z.value),u=a*c+c/2,d=r.n(i.start,B.value,z.value),f=o*c+c/2):s===`finish-to-finish`?(l=r.n(n.end??n.start,B.value,z.value),u=a*c+c/2,d=r.n(i.end??i.start,B.value,z.value),f=o*c+c/2):(l=r.n(n.start,B.value,z.value),u=a*c+c/2,d=r.n(i.end??i.start,B.value,z.value),f=o*c+c/2);let p=l+(d-l)*.5,m=d>l+12?`M${l},${u} H${p} V${f} H${d}`:`M${l},${u} H${l+12} V${(u+f)/2} H${d-12} V${f} H${d}`,h=d,g=f;return{path:m,arrowhead:`${h},${g} ${h-6},${g-4} ${h-6},${g+4}`}}).filter(Boolean)}),Y=(0,i.ref)(null),X=(0,i.ref)(null),Z=(0,i.reactive)({x:0,y:0}),Q=(0,i.ref)(null),ue=(e,t)=>{if(!Y.value)return;let n=Y.value.getBoundingClientRect();Z.x=e.clientX-n.left+12,Z.y=e.clientY-n.top+12,X.value=t.id,Q.value={title:t.label,rows:[{label:`Start`,value:t.start,color:t.color},{label:`End`,value:t.end,color:t.color},...t.progress>0?[{label:`Progress`,value:`${t.progress}%`,color:t.color}]:[]]}},de=(e,t)=>{if(!Y.value)return;let n=Y.value.getBoundingClientRect();Z.x=e.clientX-n.left+12,Z.y=e.clientY-n.top+12,X.value=t.id,Q.value={title:t.label,rows:[{label:`Date`,value:t.date,color:t.color}]}},$=(0,i.computed)(()=>{let e=new Set;for(let t of C.tasks??[])e.add(t.status??`default`);let t={default:`Default`,"on-track":`On track`,"at-risk":`At risk`,behind:`Behind`,complete:`Complete`};return Array.from(e).map(e=>({label:t[e],color:T.value[e]}))});return(r,C)=>((0,i.openBlock)(),(0,i.createBlock)(t.u,{title:e.title,subtitle:e.subtitle,height:e.height,"show-legend":e.showLegend&&$.value.length>1},{legend:(0,i.withCtx)(()=>[(0,i.createVNode)(n.t,{items:$.value},null,8,[`items`])]),default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`div`,{class:(0,i.normalizeClass)([`nb-gantt`,{"nb-gantt--has-groups":j.value}])},[(0,i.createElementVNode)(`div`,{class:`nb-gantt__list`,style:(0,i.normalizeStyle)({width:`${e.listWidth}px`})},[(0,i.createElementVNode)(`div`,{class:`nb-gantt__list-header`,style:(0,i.normalizeStyle)({height:`${S}px`})},` Tasks `,4),(0,i.createElementVNode)(`div`,a,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(M.value,t=>((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:t.id},[t.type===`group`?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:0,class:`nb-gantt__list-group`,style:(0,i.normalizeStyle)({height:`${e.rowHeight}px`}),onClick:e=>A(t.id)},[(0,i.createElementVNode)(`span`,{class:(0,i.normalizeClass)([`nb-gantt__list-caret`,{"is-collapsed":k.value.has(t.id)}])},`▸`,2),(0,i.createElementVNode)(`span`,s,(0,i.toDisplayString)(t.label),1)],12,o)):((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:1,class:(0,i.normalizeClass)([`nb-gantt__list-row`,{"is-hovered":X.value===t.id,"is-milestone":t.milestone}]),style:(0,i.normalizeStyle)({height:`${e.rowHeight}px`,paddingLeft:t.indent?`20px`:void 0}),onMouseenter:e=>X.value=t.id,onMouseleave:C[0]||=e=>X.value=null},[(0,i.createElementVNode)(`span`,{class:`nb-gantt__list-label`,title:t.label},(0,i.toDisplayString)(t.label),9,l)],46,c))],64))),128))])],4),(0,i.createElementVNode)(`div`,{ref_key:`timelineEl`,ref:Y,class:`nb-gantt__timeline`},[((0,i.openBlock)(),(0,i.createElementBlock)(`svg`,{class:`nb-gantt__header-svg`,width:V.value,height:S},[(0,i.createElementVNode)(`g`,d,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(U.value,(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`text`,{key:`th-${t}`,x:e.x+4,y:S-6,class:`nb-gantt__time-label`},(0,i.toDisplayString)(e.label),9,f))),128)),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(U.value,(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`line`,{key:`tl-${t}`,x1:e.x,x2:e.x,y1:0,y2:S,class:`nb-gantt__header-gridline`},null,8,p))),128))])],8,u)),((0,i.openBlock)(),(0,i.createElementBlock)(`svg`,{class:`nb-gantt__svg`,width:V.value,height:H.value,role:`img`,"aria-label":e.title||`Gantt chart`,onMouseleave:C[4]||=e=>X.value=null},[e.showGrid?((0,i.openBlock)(),(0,i.createElementBlock)(`g`,h,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(U.value,(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`line`,{key:`grid-${t}`,class:`nb-gantt__gridline`,x1:e.x,x2:e.x,y1:0,y2:H.value},null,8,g))),128))])):(0,i.createCommentVNode)(``,!0),(0,i.createElementVNode)(`g`,null,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(M.value,(t,n)=>((0,i.openBlock)(),(0,i.createElementBlock)(`rect`,{key:`stripe-${t.id}`,class:(0,i.normalizeClass)([`nb-gantt__row-stripe`,{"is-even":n%2==0,"is-group":t.type===`group`}]),x:0,y:n*e.rowHeight,width:V.value,height:e.rowHeight},null,10,ee))),128))]),e.showTodayMarker&&W.value!==null?((0,i.openBlock)(),(0,i.createElementBlock)(`line`,{key:1,class:`nb-gantt__today-line`,x1:W.value,x2:W.value,y1:0,y2:H.value},null,8,te)):(0,i.createCommentVNode)(``,!0),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(ce.value,t=>((0,i.openBlock)(),(0,i.createElementBlock)(`g`,{key:`summary-${t.id}`},[(0,i.createElementVNode)(`rect`,{class:`nb-gantt__summary-bar`,x:t.x,y:t.y+e.rowHeight*.35,width:Math.max(t.width,2),height:e.rowHeight*.3,rx:`2`},null,8,ne),(0,i.createElementVNode)(`polygon`,{class:`nb-gantt__summary-caret`,points:q(t.x,t.y+e.rowHeight*.65)},null,8,_),(0,i.createElementVNode)(`polygon`,{class:`nb-gantt__summary-caret`,points:q(t.x+t.width,t.y+e.rowHeight*.65)},null,8,v)]))),128)),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(oe.value,t=>((0,i.openBlock)(),(0,i.createElementBlock)(`g`,{key:`bar-${t.id}`},[(0,i.createElementVNode)(`rect`,{class:(0,i.normalizeClass)([`nb-gantt__bar`,[`nb-gantt__bar--${t.status}`,{"is-hovered":X.value===t.id,"is-dim":X.value!==null&&X.value!==t.id}]]),x:t.x,y:t.y+E.value,width:Math.max(t.width,4),height:D.value,rx:`3`,fill:t.color,onMouseenter:e=>X.value=t.id,onMouseleave:C[1]||=e=>X.value=null,onMousemove:e=>ue(e,t)},null,42,y),e.showProgress&&t.progress>0?((0,i.openBlock)(),(0,i.createElementBlock)(`rect`,{key:0,class:`nb-gantt__bar-progress`,x:t.x,y:t.y+E.value,width:Math.max(t.width*(t.progress/100),2),height:D.value,rx:`3`,fill:t.color,"pointer-events":`none`},null,8,b)):(0,i.createCommentVNode)(``,!0)]))),128)),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(se.value,t=>((0,i.openBlock)(),(0,i.createElementBlock)(`g`,{key:`ms-${t.id}`},[(0,i.createElementVNode)(`polygon`,{class:(0,i.normalizeClass)([`nb-gantt__milestone`,{"is-hovered":X.value===t.id,"is-dim":X.value!==null&&X.value!==t.id}]),points:le(t.x,t.y+e.rowHeight/2,O.value),fill:t.color,onMouseenter:e=>X.value=t.id,onMouseleave:C[2]||=e=>X.value=null,onMousemove:e=>de(e,t)},null,42,x)]))),128)),(0,i.createElementVNode)(`g`,null,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(J.value,(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`path`,{key:`dep-${t}`,class:`nb-gantt__dependency`,d:e.path,fill:`none`},null,8,re))),128)),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(J.value,(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`polygon`,{key:`dep-arrow-${t}`,class:`nb-gantt__dependency-arrow`,points:e.arrowhead},null,8,ie))),128))]),(0,i.createElementVNode)(`g`,null,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(N.value,(t,n)=>((0,i.openBlock)(),(0,i.createElementBlock)(`rect`,{key:`hover-${t.id}`,x:0,y:n*e.rowHeight,width:V.value,height:e.rowHeight,fill:`transparent`,onMouseenter:e=>X.value=t.id,onMouseleave:C[3]||=e=>X.value=null},null,40,ae))),128))])],40,m)),(0,i.createVNode)(t.l,{visible:e.showTooltip&&X.value!==null&&Q.value!==null,x:Z.x,y:Z.y,title:Q.value?.title??``,rows:Q.value?.rows??[]},null,8,[`visible`,`x`,`y`,`title`,`rows`])],512)],2)]),_:1},8,[`title`,`subtitle`,`height`,`show-legend`]))}}),w=e.t(C,[[`__scopeId`,`data-v-8b61c468`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return w}});
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./palette-BoABA-De.cjs`),n=require(`./ChartLegend-ndpGucTZ.cjs`),r=require(`./scales-BWtB8m5D.cjs`);let i=require(`vue`);var a={class:`nb-gantt__list-body`},o=[`onClick`],s={class:`nb-gantt__list-group-label`},c=[`onMouseenter`],l=[`title`],u=[`width`],d={class:`nb-gantt__time-header`},f=[`x`,`y`],p=[`x1`,`x2`],m=[`width`,`height`,`aria-label`],h={key:0},g=[`x1`,`x2`,`y2`],ee=[`y`,`width`,`height`],te=[`x1`,`x2`,`y2`],ne=[`x`,`y`,`width`,`height`],_=[`points`],v=[`points`],y=[`x`,`y`,`width`,`height`,`fill`,`onMouseenter`,`onMousemove`],b=[`x`,`y`,`width`,`height`,`fill`],x=[`points`,`fill`,`onMouseenter`,`onMousemove`],re=[`d`],ie=[`points`],ae=[`y`,`width`,`height`,`onMouseenter`],S=40,C=(0,i.defineComponent)({__name:`GanttChart`,props:{tasks:{default:()=>[]},dependencies:{default:()=>[]},groups:{default:()=>[]},timeScale:{default:`week`},rowHeight:{default:36},listWidth:{default:200},showTodayMarker:{type:Boolean,default:!0},today:{default:void 0},showProgress:{type:Boolean,default:!0},statusColors:{default:void 0},title:{default:void 0},subtitle:{default:void 0},height:{default:400},showLegend:{type:Boolean,default:!0},showTooltip:{type:Boolean,default:!0},showGrid:{type:Boolean,default:!0},colors:{default:()=>t.n}},setup(e){let C=e,w={default:t.r(1),"on-track":t.r(3),"at-risk":t.r(4),behind:t.r(5),complete:t.r(2)},T=(0,i.computed)(()=>({...w,...C.statusColors})),E=(0,i.computed)(()=>Math.round(C.rowHeight*.22)),D=(0,i.computed)(()=>C.rowHeight-E.value*2),O=(0,i.computed)(()=>Math.round(C.rowHeight*.28)),k=(0,i.ref)(new Set((C.groups??[]).filter(e=>e.collapsed).map(e=>e.id))),A=e=>{let t=new Set(k.value);t.has(e)?t.delete(e):t.add(e),k.value=t},j=(0,i.computed)(()=>(C.groups?.length??0)>0),M=(0,i.computed)(()=>{let e=C.tasks??[],t=C.groups??[];if(!t.length)return e.map(e=>({id:e.id,label:e.label,type:`task`,milestone:e.milestone}));let n=[],r=new Map(t.map(e=>[e.id,e])),i=new Map,a=[];for(let t of e)if(t.group&&r.has(t.group)){let e=i.get(t.group)??[];e.push(t),i.set(t.group,e)}else a.push(t);for(let e of t)if(n.push({id:e.id,label:e.label,type:`group`}),!k.value.has(e.id))for(let t of i.get(e.id)??[])n.push({id:t.id,label:t.label,type:`task`,milestone:t.milestone,indent:!0});for(let e of a)n.push({id:e.id,label:e.label,type:`task`,milestone:e.milestone});return n}),N=(0,i.computed)(()=>M.value.filter(e=>e.type===`task`)),P=(0,i.computed)(()=>{let e=new Map;return M.value.forEach((t,n)=>e.set(t.id,n)),e}),F=e=>typeof e==`string`?new Date(e).getTime():e.getTime(),I=(0,i.computed)(()=>{let e=C.tasks??[];if(!e.length){let e=Date.now();return[e,e+7*864e5]}let t=1/0,n=-1/0;for(let r of e){let e=F(r.start),i=r.end?F(r.end):e;e<t&&(t=e),i>n&&(n=i)}let r=L(C.timeScale);return[t-r,n+r]}),L=e=>{let t=864e5;return e===`day`?t:e===`week`?7*t:e===`month`?30*t:e===`quarter`?91*t:365*t},R=(0,i.computed)(()=>{let e=C.timeScale;return e===`day`?40:e===`week`?120:e===`month`?180:e===`quarter`?240:360}),z=(0,i.computed)(()=>R.value/L(C.timeScale)),B=(0,i.computed)(()=>I.value[0]),V=(0,i.computed)(()=>Math.max(200,Math.ceil((I.value[1]-I.value[0])*z.value))),H=(0,i.computed)(()=>M.value.length*C.rowHeight),U=(0,i.computed)(()=>r.a(new Date(I.value[0]),new Date(I.value[1]),C.timeScale,z.value,B.value)),W=(0,i.computed)(()=>{if(!C.showTodayMarker)return null;let e=r.n(C.today?new Date(C.today):new Date,B.value,z.value);return e<0||e>V.value?null:e}),G=(e,n)=>e.color?e.color:e.status&&e.status!==`default`?T.value[e.status]:t.i(n,C.colors),K=e=>(typeof e==`string`?new Date(e):e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}),oe=(0,i.computed)(()=>(C.tasks??[]).filter(e=>!e.milestone&&e.end).map((e,t)=>{let n=P.value.get(e.id);if(n===void 0)return null;let i=r.n(e.start,B.value,z.value),a=r.n(e.end,B.value,z.value);return{id:e.id,x:i,y:n*C.rowHeight,width:Math.max(a-i,4),color:G(e,t),status:e.status??`default`,progress:e.progress??0,label:e.label,start:K(e.start),end:K(e.end)}}).filter(Boolean)),se=(0,i.computed)(()=>(C.tasks??[]).filter(e=>e.milestone).map((e,t)=>{let n=P.value.get(e.id);return n===void 0?null:{id:e.id,x:r.n(e.start,B.value,z.value),y:n*C.rowHeight,color:G(e,t),label:e.label,date:K(e.start)}}).filter(Boolean)),ce=(0,i.computed)(()=>{let e=C.groups??[],t=C.tasks??[];return e.length?e.map(e=>{let n=P.value.get(e.id);if(n===void 0)return null;let i=t.filter(t=>t.group===e.id);if(!i.length)return null;let a=1/0,o=-1/0;for(let e of i){let t=F(e.start),n=e.end?F(e.end):t;t<a&&(a=t),n>o&&(o=n)}let s=r.n(new Date(a),B.value,z.value),c=r.n(new Date(o),B.value,z.value);return{id:e.id,x:s,y:n*C.rowHeight,width:Math.max(c-s,4)}}).filter(Boolean):[]}),q=(e,t)=>`${e},${t} ${e-5},${t+5} ${e+5},${t+5}`,le=(e,t,n)=>`${e},${t-n} ${e+n},${t} ${e},${t+n} ${e-n},${t}`,J=(0,i.computed)(()=>{let e=C.dependencies??[];if(!e.length)return[];let t=new Map((C.tasks??[]).map(e=>[e.id,e]));return e.map(e=>{let n=t.get(e.from),i=t.get(e.to);if(!n||!i)return null;let a=P.value.get(e.from),o=P.value.get(e.to);if(a===void 0||o===void 0)return null;let s=e.type??`finish-to-start`,c=C.rowHeight,l,u,d,f;s===`finish-to-start`?(l=n.milestone?r.n(n.start,B.value,z.value)+O.value:r.n(n.end??n.start,B.value,z.value),u=a*c+c/2,d=i.milestone?r.n(i.start,B.value,z.value)-O.value:r.n(i.start,B.value,z.value),f=o*c+c/2):s===`start-to-start`?(l=r.n(n.start,B.value,z.value),u=a*c+c/2,d=r.n(i.start,B.value,z.value),f=o*c+c/2):s===`finish-to-finish`?(l=r.n(n.end??n.start,B.value,z.value),u=a*c+c/2,d=r.n(i.end??i.start,B.value,z.value),f=o*c+c/2):(l=r.n(n.start,B.value,z.value),u=a*c+c/2,d=r.n(i.end??i.start,B.value,z.value),f=o*c+c/2);let p=l+(d-l)*.5,m=d>l+12?`M${l},${u} H${p} V${f} H${d}`:`M${l},${u} H${l+12} V${(u+f)/2} H${d-12} V${f} H${d}`,h=d,g=f;return{path:m,arrowhead:`${h},${g} ${h-6},${g-4} ${h-6},${g+4}`}}).filter(Boolean)}),Y=(0,i.ref)(null),X=(0,i.ref)(null),Z=(0,i.reactive)({x:0,y:0}),Q=(0,i.ref)(null),ue=(e,t)=>{if(!Y.value)return;let n=Y.value.getBoundingClientRect();Z.x=e.clientX-n.left+12,Z.y=e.clientY-n.top+12,X.value=t.id,Q.value={title:t.label,rows:[{label:`Start`,value:t.start,color:t.color},{label:`End`,value:t.end,color:t.color},...t.progress>0?[{label:`Progress`,value:`${t.progress}%`,color:t.color}]:[]]}},de=(e,t)=>{if(!Y.value)return;let n=Y.value.getBoundingClientRect();Z.x=e.clientX-n.left+12,Z.y=e.clientY-n.top+12,X.value=t.id,Q.value={title:t.label,rows:[{label:`Date`,value:t.date,color:t.color}]}},$=(0,i.computed)(()=>{let e=new Set;for(let t of C.tasks??[])e.add(t.status??`default`);let t={default:`Default`,"on-track":`On track`,"at-risk":`At risk`,behind:`Behind`,complete:`Complete`};return Array.from(e).map(e=>({label:t[e],color:T.value[e]}))});return(r,C)=>((0,i.openBlock)(),(0,i.createBlock)(t.u,{title:e.title,subtitle:e.subtitle,height:e.height,"show-legend":e.showLegend&&$.value.length>1},{legend:(0,i.withCtx)(()=>[(0,i.createVNode)(n.t,{items:$.value},null,8,[`items`])]),default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`div`,{class:(0,i.normalizeClass)([`nb-gantt`,{"nb-gantt--has-groups":j.value}])},[(0,i.createElementVNode)(`div`,{class:`nb-gantt__list`,style:(0,i.normalizeStyle)({width:`${e.listWidth}px`})},[(0,i.createElementVNode)(`div`,{class:`nb-gantt__list-header`,style:(0,i.normalizeStyle)({height:`${S}px`})},` Tasks `,4),(0,i.createElementVNode)(`div`,a,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(M.value,t=>((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:t.id},[t.type===`group`?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:0,class:`nb-gantt__list-group`,style:(0,i.normalizeStyle)({height:`${e.rowHeight}px`}),onClick:e=>A(t.id)},[(0,i.createElementVNode)(`span`,{class:(0,i.normalizeClass)([`nb-gantt__list-caret`,{"is-collapsed":k.value.has(t.id)}])},`▸`,2),(0,i.createElementVNode)(`span`,s,(0,i.toDisplayString)(t.label),1)],12,o)):((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:1,class:(0,i.normalizeClass)([`nb-gantt__list-row`,{"is-hovered":X.value===t.id,"is-milestone":t.milestone}]),style:(0,i.normalizeStyle)({height:`${e.rowHeight}px`,paddingLeft:t.indent?`20px`:void 0}),onMouseenter:e=>X.value=t.id,onMouseleave:C[0]||=e=>X.value=null},[(0,i.createElementVNode)(`span`,{class:`nb-gantt__list-label`,title:t.label},(0,i.toDisplayString)(t.label),9,l)],46,c))],64))),128))])],4),(0,i.createElementVNode)(`div`,{ref_key:`timelineEl`,ref:Y,class:`nb-gantt__timeline`},[((0,i.openBlock)(),(0,i.createElementBlock)(`svg`,{class:`nb-gantt__header-svg`,width:V.value,height:S},[(0,i.createElementVNode)(`g`,d,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(U.value,(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`text`,{key:`th-${t}`,x:e.x+4,y:S-6,class:`nb-gantt__time-label`},(0,i.toDisplayString)(e.label),9,f))),128)),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(U.value,(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`line`,{key:`tl-${t}`,x1:e.x,x2:e.x,y1:0,y2:S,class:`nb-gantt__header-gridline`},null,8,p))),128))])],8,u)),((0,i.openBlock)(),(0,i.createElementBlock)(`svg`,{class:`nb-gantt__svg`,width:V.value,height:H.value,role:`img`,"aria-label":e.title||`Gantt chart`,onMouseleave:C[4]||=e=>X.value=null},[e.showGrid?((0,i.openBlock)(),(0,i.createElementBlock)(`g`,h,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(U.value,(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`line`,{key:`grid-${t}`,class:`nb-gantt__gridline`,x1:e.x,x2:e.x,y1:0,y2:H.value},null,8,g))),128))])):(0,i.createCommentVNode)(``,!0),(0,i.createElementVNode)(`g`,null,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(M.value,(t,n)=>((0,i.openBlock)(),(0,i.createElementBlock)(`rect`,{key:`stripe-${t.id}`,class:(0,i.normalizeClass)([`nb-gantt__row-stripe`,{"is-even":n%2==0,"is-group":t.type===`group`}]),x:0,y:n*e.rowHeight,width:V.value,height:e.rowHeight},null,10,ee))),128))]),e.showTodayMarker&&W.value!==null?((0,i.openBlock)(),(0,i.createElementBlock)(`line`,{key:1,class:`nb-gantt__today-line`,x1:W.value,x2:W.value,y1:0,y2:H.value},null,8,te)):(0,i.createCommentVNode)(``,!0),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(ce.value,t=>((0,i.openBlock)(),(0,i.createElementBlock)(`g`,{key:`summary-${t.id}`},[(0,i.createElementVNode)(`rect`,{class:`nb-gantt__summary-bar`,x:t.x,y:t.y+e.rowHeight*.35,width:Math.max(t.width,2),height:e.rowHeight*.3,rx:`2`},null,8,ne),(0,i.createElementVNode)(`polygon`,{class:`nb-gantt__summary-caret`,points:q(t.x,t.y+e.rowHeight*.65)},null,8,_),(0,i.createElementVNode)(`polygon`,{class:`nb-gantt__summary-caret`,points:q(t.x+t.width,t.y+e.rowHeight*.65)},null,8,v)]))),128)),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(oe.value,t=>((0,i.openBlock)(),(0,i.createElementBlock)(`g`,{key:`bar-${t.id}`},[(0,i.createElementVNode)(`rect`,{class:(0,i.normalizeClass)([`nb-gantt__bar`,[`nb-gantt__bar--${t.status}`,{"is-hovered":X.value===t.id,"is-dim":X.value!==null&&X.value!==t.id}]]),x:t.x,y:t.y+E.value,width:Math.max(t.width,4),height:D.value,rx:`3`,fill:t.color,onMouseenter:e=>X.value=t.id,onMouseleave:C[1]||=e=>X.value=null,onMousemove:e=>ue(e,t)},null,42,y),e.showProgress&&t.progress>0?((0,i.openBlock)(),(0,i.createElementBlock)(`rect`,{key:0,class:`nb-gantt__bar-progress`,x:t.x,y:t.y+E.value,width:Math.max(t.width*(t.progress/100),2),height:D.value,rx:`3`,fill:t.color,"pointer-events":`none`},null,8,b)):(0,i.createCommentVNode)(``,!0)]))),128)),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(se.value,t=>((0,i.openBlock)(),(0,i.createElementBlock)(`g`,{key:`ms-${t.id}`},[(0,i.createElementVNode)(`polygon`,{class:(0,i.normalizeClass)([`nb-gantt__milestone`,{"is-hovered":X.value===t.id,"is-dim":X.value!==null&&X.value!==t.id}]),points:le(t.x,t.y+e.rowHeight/2,O.value),fill:t.color,onMouseenter:e=>X.value=t.id,onMouseleave:C[2]||=e=>X.value=null,onMousemove:e=>de(e,t)},null,42,x)]))),128)),(0,i.createElementVNode)(`g`,null,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(J.value,(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`path`,{key:`dep-${t}`,class:`nb-gantt__dependency`,d:e.path,fill:`none`},null,8,re))),128)),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(J.value,(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`polygon`,{key:`dep-arrow-${t}`,class:`nb-gantt__dependency-arrow`,points:e.arrowhead},null,8,ie))),128))]),(0,i.createElementVNode)(`g`,null,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(N.value,(t,n)=>((0,i.openBlock)(),(0,i.createElementBlock)(`rect`,{key:`hover-${t.id}`,x:0,y:n*e.rowHeight,width:V.value,height:e.rowHeight,fill:`transparent`,onMouseenter:e=>X.value=t.id,onMouseleave:C[3]||=e=>X.value=null},null,40,ae))),128))])],40,m)),(0,i.createVNode)(t.l,{visible:e.showTooltip&&X.value!==null&&Q.value!==null,x:Z.x,y:Z.y,title:Q.value?.title??``,rows:Q.value?.rows??[]},null,8,[`visible`,`x`,`y`,`title`,`rows`])],512)],2)]),_:1},8,[`title`,`subtitle`,`height`,`show-legend`]))}}),w=e.t(C,[[`__scopeId`,`data-v-8b61c468`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return w}});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
|
|
2
|
-
import { t } from "./Grid-
|
|
3
|
-
import { t as n } from "./vue-i18n-
|
|
2
|
+
import { t } from "./Grid-XtnH-vr_.js";
|
|
3
|
+
import { t as n } from "./vue-i18n-Dzm-MDw4.js";
|
|
4
4
|
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as ee, onMounted as te, openBlock as m, ref as h, renderList as ne, toDisplayString as g, watch as _, withCtx as v, withModifiers as y } from "vue";
|
|
5
5
|
//#region src/components/ImageCropper.d.ts
|
|
6
6
|
var b = /* @__PURE__ */ function(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./Grid-By_NqGWQ.cjs`),n=require(`./vue-i18n-CYAt-t4N.cjs`);let r=require(`vue`);var i=function(e){return e.TopLeft=`top-left`,e.Top=`top`,e.TopRight=`top-right`,e.Right=`right`,e.BottomRight=`bottom-right`,e.Bottom=`bottom`,e.BottomLeft=`bottom-left`,e.Left=`left`,e}(i||{}),a={class:`nb-image-cropper`},o=[`onMousedown`,`onTouchstart`],s=[`src`,`alt`],c=700,l=400,u=(0,r.defineComponent)({__name:`ImageCropper`,props:{image:{},cropAsCircle:{type:Boolean,default:!1},outputAsCircle:{type:Boolean,default:!1},lockAspectRatio:{type:Boolean,default:!1},showPreview:{type:Boolean,default:!1}},emits:[`crop`],setup(e,{emit:u}){let d={en:{X:`X`,Y:`Y`,WIDTH:`Width`,HEIGHT:`Height`,IMAGE_THUMBNAIL:`Cropped preview`},pt:{X:`X`,Y:`Y`,WIDTH:`Largura`,HEIGHT:`Altura`,IMAGE_THUMBNAIL:`Pré-visualização recortada`}},{t:f,te:p,locale:m}=n.t({useScope:`global`});function h(e){if(p(e))return f(e);let t=e.slice(7);return d[String(m.value).toLowerCase().split(`-`)[0]]?.[t]??d.en[t]??e}let g=e,_=u,v=(0,r.ref)(null),y=null,b=new Image,x=null,S={x:1,y:1},C=(0,r.ref)({x:50,y:50,width:200,height:200}),w=(0,r.ref)(null),T=(0,r.ref)(null),E=!1,D=!1,O={x:0,y:0},k=!1,A={x:0,y:0},j={x:0,y:0,width:0,height:0},M=null,N=!1,P=[{name:i.TopLeft},{name:i.Top},{name:i.TopRight},{name:i.Right},{name:i.BottomRight},{name:i.Bottom},{name:i.BottomLeft},{name:i.Left}],F=()=>{if(!g.image){console.error(`No image file provided`);return}x&&=(URL.revokeObjectURL(x),null),b.onload=()=>{let{drawWidth:e,drawHeight:t}=I();if(v.value){v.value.width=e,v.value.height=t;let n=(v.value.width-b.width*S.x)/2,r=(v.value.height-b.height*S.y)/2;if(g.cropAsCircle||g.lockAspectRatio){let e=Math.min(b.width*S.x,b.height*S.y)*.5;C.value={x:n+(b.width*S.x-e)/2,y:r+(b.height*S.y-e)/2,width:e,height:e}}else C.value={x:n+(b.width*S.x*.5-b.width*S.x*.25),y:r+(b.height*S.y*.5-b.height*S.y*.25),width:b.width*S.x*.5,height:b.height*S.y*.5};L(),Q()}},b.onerror=()=>{console.error(`Failed to load image`)},x=URL.createObjectURL(g.image),b.src=x};(0,r.onMounted)(()=>{v.value&&(y=v.value.getContext(`2d`),y&&(y.imageSmoothingEnabled=!0,y.imageSmoothingQuality=`high`),g.image&&F())}),(0,r.onBeforeUnmount)(()=>{x&&=(URL.revokeObjectURL(x),null);let e=w.value;e&&(URL.revokeObjectURL(e),w.value=null)}),(0,r.watch)(()=>g.image,e=>{e&&F()}),(0,r.watch)(()=>[g.cropAsCircle,g.outputAsCircle,g.lockAspectRatio],()=>{v.value&&y&&L()});let I=()=>{let e=b.width/b.height,t=c,n=l;return e>c/l?n=c/e:t=l*e,S.x=t/b.width,S.y=n/b.height,{drawWidth:t,drawHeight:n}},L=()=>{if(y&&v.value){y.clearRect(0,0,v.value.width,v.value.height);let e=(v.value.width-b.width*S.x)/2,t=(v.value.height-b.height*S.y)/2;y.drawImage(b,0,0,b.width,b.height,e,t,b.width*S.x,b.height*S.y),R()}},R=()=>{y&&v.value&&(y.save(),y.beginPath(),g.cropAsCircle?y.arc(C.value.x+C.value.width/2,C.value.y+C.value.height/2,C.value.width/2,0,Math.PI*2):y.rect(C.value.x,C.value.y,C.value.width,C.value.height),y.rect(0,0,v.value.width,v.value.height),y.clip(`evenodd`),y.fillStyle=`rgba(0, 0, 0, 0.5)`,y.fillRect(0,0,v.value.width,v.value.height),y.restore(),y.save(),y.strokeStyle=`rgba(255, 255, 255, 0.8)`,y.lineWidth=1,y.setLineDash([5,5]),y.imageSmoothingEnabled=!1,g.cropAsCircle?(y.beginPath(),y.arc(C.value.x+C.value.width/2,C.value.y+C.value.height/2,C.value.width/2,0,Math.PI*2),y.stroke()):y.strokeRect(C.value.x,C.value.y,C.value.width,C.value.height),y.restore())},z=(0,r.computed)(()=>{if(g.cropAsCircle){let e=C.value.x+C.value.width/2,t=C.value.y+C.value.height/2,n=C.value.width/2;return{"top-left":{left:`${e-n-5}px`,top:`${t-n-5}px`},top:{left:`${e-5}px`,top:`${t-n-5}px`},"top-right":{left:`${e+n-5}px`,top:`${t-n-5}px`},right:{left:`${e+n-5}px`,top:`${t-5}px`},"bottom-right":{left:`${e+n-5}px`,top:`${t+n-5}px`},bottom:{left:`${e-5}px`,top:`${t+n-5}px`},"bottom-left":{left:`${e-n-5}px`,top:`${t+n-5}px`},left:{left:`${e-n-5}px`,top:`${t-5}px`}}}else return{"top-left":{left:`${C.value.x-5}px`,top:`${C.value.y-5}px`},top:{left:`${C.value.x+C.value.width/2-5}px`,top:`${C.value.y-5}px`},"top-right":{left:`${C.value.x+C.value.width-5}px`,top:`${C.value.y-5}px`},right:{left:`${C.value.x+C.value.width-5}px`,top:`${C.value.y+C.value.height/2-5}px`},"bottom-right":{left:`${C.value.x+C.value.width-5}px`,top:`${C.value.y+C.value.height-5}px`},bottom:{left:`${C.value.x+C.value.width/2-5}px`,top:`${C.value.y+C.value.height-5}px`},"bottom-left":{left:`${C.value.x-5}px`,top:`${C.value.y+C.value.height-5}px`},left:{left:`${C.value.x-5}px`,top:`${C.value.y+C.value.height/2-5}px`}}}),B=e=>{if(`touches`in e&&e.touches.length>0){let t=e.touches[0];return{clientX:t.clientX,clientY:t.clientY}}else if(`clientX`in e&&`clientY`in e)return{clientX:e.clientX,clientY:e.clientY};return{clientX:0,clientY:0}},V=e=>{let t=v.value;if(!t)return null;let{clientX:n,clientY:r}=B(e),{left:i,top:a}=t.getBoundingClientRect();return{x:n-i,y:r-a}},H=e=>{e.preventDefault();let t=V(e);if(!t)return;let{x:n,y:r}=t;X(n,r)&&(D=!0,E=!0,O={x:n-C.value.x,y:r-C.value.y})},U=e=>{D?G(e):k&&J(e)},W=()=>{D&&(K(),D=!1,Q()),k&&(Y(),Q()),E=!1,D=!1},G=e=>{if(E){let t=V(e);if(!t)return;let{x:n,y:r}=t;C.value.x=Math.floor(n-O.x),C.value.y=Math.floor(r-O.y),L()}},K=()=>{E&&=(Z(),L(),!1)},q=(e,t)=>{e.preventDefault();let n=V(e);n&&(k=!0,M=t,A={x:n.x,y:n.y},j={...C.value},N=e instanceof MouseEvent&&e.shiftKey)},J=e=>{if(!k)return;if(g.lockAspectRatio&&v.value){let t=V(e);if(!t)return;let{x:n,y:r}=t,i=j.x+j.width/2,a=j.y+j.height/2;if(g.cropAsCircle){let e=Math.max(Math.abs(n-i),Math.abs(r-a)),t=e*2;C.value={x:i-e,y:a-e,width:t,height:t}}else{let e=j.width/j.height,t=Math.abs(n-i),r=Math.max(t*2,50),o=r/e;C.value={x:i-r/2,y:a-o/2,width:r,height:o}}L();return}let t=V(e);if(!t)return;let{x:n,y:r}=t,i=n-A.x,a=r-A.y;N=e instanceof MouseEvent&&e.shiftKey;let o={...j};switch(M){case`top-left`:o.x+=i,o.y+=a,o.width-=i,o.height-=a;break;case`top`:o.y+=a,o.height-=a;break;case`top-right`:o.y+=a,o.width+=i,o.height-=a;break;case`right`:o.width+=i;break;case`bottom-right`:o.width+=i,o.height+=a;break;case`bottom`:o.height+=a;break;case`bottom-left`:o.x+=i,o.width-=i,o.height+=a;break;case`left`:o.x+=i,o.width-=i;break}if(o.width<50&&(o.width=50),o.height<50&&(o.height=50),N&&M){let e=j.width/j.height;[`left`,`right`].includes(M)?(o.height=o.width/e,M===`left`&&(o.y=j.y-(o.height-j.height)/2)):[`top`,`bottom`].includes(M)&&(o.width=o.height*e,M===`top`&&(o.x=j.x-(o.width-j.width)/2))}C.value=o,L()},Y=()=>{k&&(Z(),L(),k=!1,M=null)},X=(e,t)=>{if(g.cropAsCircle){let n=C.value.x+C.value.width/2,r=C.value.y+C.value.height/2,i=C.value.width/2,a=e-n,o=t-r;return a*a+o*o<=i*i}else return e>=C.value.x-2&&e<=C.value.x+C.value.width+2&&t>=C.value.y-2&&t<=C.value.y+C.value.height+2},Z=()=>{let e=v.value.width,t=v.value.height;if(C.value.width<50&&(C.value.width=50),C.value.height<50&&(C.value.height=50),g.lockAspectRatio)if(g.cropAsCircle)C.value.height=C.value.width;else{let e=j.width/j.height;C.value.height=C.value.width/e}else if(N){let e=j.width/j.height;C.value.height=C.value.width/e}if(g.cropAsCircle||g.lockAspectRatio){let n=C.value.width/C.value.height;(C.value.width>e||C.value.height>t)&&(C.value.width>C.value.height?(C.value.width=e,C.value.height=e/n):(C.value.height=t,C.value.width=t*n)),C.value.x<0&&(C.value.x=0),C.value.y<0&&(C.value.y=0),C.value.x+C.value.width>e&&(C.value.x=e-C.value.width),C.value.y+C.value.height>t&&(C.value.y=t-C.value.height)}else C.value.x<0&&(C.value.x=0),C.value.y<0&&(C.value.y=0),C.value.width>e&&(C.value.width=e,C.value.x=0),C.value.height>t&&(C.value.height=t,C.value.y=0),C.value.x+C.value.width>e&&(C.value.x=e-C.value.width),C.value.y+C.value.height>t&&(C.value.y=t-C.value.height)},Q=()=>{if(v.value&&y){let e=(v.value.width-b.width*S.x)/2,t=(v.value.height-b.height*S.y)/2,n=(C.value.x-e)/S.x,r=(C.value.y-t)/S.y,i=C.value.width/S.x,a=C.value.height/S.y,o={x:Math.round(n),y:Math.round(r),width:Math.round(i),height:Math.round(a)},s=Math.max(0,Math.min(o.x,b.width)),c=Math.max(0,Math.min(o.y,b.height)),l=Math.min(o.width,b.width-s),u=Math.min(o.height,b.height-c),d=document.createElement(`canvas`);d.width=l,d.height=u;let f=d.getContext(`2d`);f&&(f.drawImage(b,s,c,l,u,0,0,l,u),g.cropAsCircle&&g.outputAsCircle&&(f.globalCompositeOperation=`destination-in`,f.beginPath(),f.arc(l/2,u/2,l/2,0,Math.PI*2),f.closePath(),f.fill(),f.globalCompositeOperation=`source-over`),d.toBlob(e=>{if(e){let t=w.value;t&&URL.revokeObjectURL(t),w.value=URL.createObjectURL(e),T.value=o,_(`crop`,{blob:e,geometry:o})}},`image/jpeg`,.8))}};return(0,r.watch)(()=>g,()=>{Q()},{deep:!0}),(n,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,a,[(0,r.createElementVNode)(`div`,{class:`canvas-container`,onMousedown:H,onMousemove:U,onMouseup:W,onMouseleave:W,onTouchstart:H,onTouchmove:U,onTouchend:W},[(0,r.createElementVNode)(`canvas`,{ref_key:`canvas`,ref:v},null,512),((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(P,e=>(0,r.createElementVNode)(`div`,{key:e.name,class:(0,r.normalizeClass)([`resize-handle`,e.name]),style:(0,r.normalizeStyle)(z.value[e.name]),onMousedown:(0,r.withModifiers)(t=>q(t,e.name),[`stop`]),onTouchstart:(0,r.withModifiers)(t=>q(t,e.name),[`stop`])},null,46,o)),64))],32),e.showPreview&&w.value&&T.value?((0,r.openBlock)(),(0,r.createBlock)(t.t,{key:0,class:`cropped-image-preview`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(t.t,{is:`ul`,dir:`col`,justify:`center`,gap:`sm`},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`li`,null,[(0,r.createElementVNode)(`strong`,null,(0,r.toDisplayString)(h(`common.X`)),1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(T.value.x.toFixed(0)),1)]),(0,r.createElementVNode)(`li`,null,[(0,r.createElementVNode)(`strong`,null,(0,r.toDisplayString)(h(`common.Y`)),1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(T.value.y.toFixed(0)),1)]),(0,r.createElementVNode)(`li`,null,[(0,r.createElementVNode)(`strong`,null,(0,r.toDisplayString)(h(`common.WIDTH`)),1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(T.value.width.toFixed(0)),1)]),(0,r.createElementVNode)(`li`,null,[(0,r.createElementVNode)(`strong`,null,(0,r.toDisplayString)(h(`common.HEIGHT`)),1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(T.value.height.toFixed(0)),1)])]),_:1}),(0,r.createElementVNode)(`img`,{src:w.value,alt:h(`common.IMAGE_THUMBNAIL`)},null,8,s)]),_:1})):(0,r.createCommentVNode)(``,!0)]))}}),d=e.t(u,[[`__scopeId`,`data-v-718b196d`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return d}});
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./Grid-D8c0StGs.cjs`),n=require(`./vue-i18n-B_5xehV9.cjs`);let r=require(`vue`);var i=function(e){return e.TopLeft=`top-left`,e.Top=`top`,e.TopRight=`top-right`,e.Right=`right`,e.BottomRight=`bottom-right`,e.Bottom=`bottom`,e.BottomLeft=`bottom-left`,e.Left=`left`,e}(i||{}),a={class:`nb-image-cropper`},o=[`onMousedown`,`onTouchstart`],s=[`src`,`alt`],c=700,l=400,u=(0,r.defineComponent)({__name:`ImageCropper`,props:{image:{},cropAsCircle:{type:Boolean,default:!1},outputAsCircle:{type:Boolean,default:!1},lockAspectRatio:{type:Boolean,default:!1},showPreview:{type:Boolean,default:!1}},emits:[`crop`],setup(e,{emit:u}){let d={en:{X:`X`,Y:`Y`,WIDTH:`Width`,HEIGHT:`Height`,IMAGE_THUMBNAIL:`Cropped preview`},pt:{X:`X`,Y:`Y`,WIDTH:`Largura`,HEIGHT:`Altura`,IMAGE_THUMBNAIL:`Pré-visualização recortada`}},{t:f,te:p,locale:m}=n.t({useScope:`global`});function h(e){if(p(e))return f(e);let t=e.slice(7);return d[String(m.value).toLowerCase().split(`-`)[0]]?.[t]??d.en[t]??e}let g=e,_=u,v=(0,r.ref)(null),y=null,b=new Image,x=null,S={x:1,y:1},C=(0,r.ref)({x:50,y:50,width:200,height:200}),w=(0,r.ref)(null),T=(0,r.ref)(null),E=!1,D=!1,O={x:0,y:0},k=!1,A={x:0,y:0},j={x:0,y:0,width:0,height:0},M=null,N=!1,P=[{name:i.TopLeft},{name:i.Top},{name:i.TopRight},{name:i.Right},{name:i.BottomRight},{name:i.Bottom},{name:i.BottomLeft},{name:i.Left}],F=()=>{if(!g.image){console.error(`No image file provided`);return}x&&=(URL.revokeObjectURL(x),null),b.onload=()=>{let{drawWidth:e,drawHeight:t}=I();if(v.value){v.value.width=e,v.value.height=t;let n=(v.value.width-b.width*S.x)/2,r=(v.value.height-b.height*S.y)/2;if(g.cropAsCircle||g.lockAspectRatio){let e=Math.min(b.width*S.x,b.height*S.y)*.5;C.value={x:n+(b.width*S.x-e)/2,y:r+(b.height*S.y-e)/2,width:e,height:e}}else C.value={x:n+(b.width*S.x*.5-b.width*S.x*.25),y:r+(b.height*S.y*.5-b.height*S.y*.25),width:b.width*S.x*.5,height:b.height*S.y*.5};L(),Q()}},b.onerror=()=>{console.error(`Failed to load image`)},x=URL.createObjectURL(g.image),b.src=x};(0,r.onMounted)(()=>{v.value&&(y=v.value.getContext(`2d`),y&&(y.imageSmoothingEnabled=!0,y.imageSmoothingQuality=`high`),g.image&&F())}),(0,r.onBeforeUnmount)(()=>{x&&=(URL.revokeObjectURL(x),null);let e=w.value;e&&(URL.revokeObjectURL(e),w.value=null)}),(0,r.watch)(()=>g.image,e=>{e&&F()}),(0,r.watch)(()=>[g.cropAsCircle,g.outputAsCircle,g.lockAspectRatio],()=>{v.value&&y&&L()});let I=()=>{let e=b.width/b.height,t=c,n=l;return e>c/l?n=c/e:t=l*e,S.x=t/b.width,S.y=n/b.height,{drawWidth:t,drawHeight:n}},L=()=>{if(y&&v.value){y.clearRect(0,0,v.value.width,v.value.height);let e=(v.value.width-b.width*S.x)/2,t=(v.value.height-b.height*S.y)/2;y.drawImage(b,0,0,b.width,b.height,e,t,b.width*S.x,b.height*S.y),R()}},R=()=>{y&&v.value&&(y.save(),y.beginPath(),g.cropAsCircle?y.arc(C.value.x+C.value.width/2,C.value.y+C.value.height/2,C.value.width/2,0,Math.PI*2):y.rect(C.value.x,C.value.y,C.value.width,C.value.height),y.rect(0,0,v.value.width,v.value.height),y.clip(`evenodd`),y.fillStyle=`rgba(0, 0, 0, 0.5)`,y.fillRect(0,0,v.value.width,v.value.height),y.restore(),y.save(),y.strokeStyle=`rgba(255, 255, 255, 0.8)`,y.lineWidth=1,y.setLineDash([5,5]),y.imageSmoothingEnabled=!1,g.cropAsCircle?(y.beginPath(),y.arc(C.value.x+C.value.width/2,C.value.y+C.value.height/2,C.value.width/2,0,Math.PI*2),y.stroke()):y.strokeRect(C.value.x,C.value.y,C.value.width,C.value.height),y.restore())},z=(0,r.computed)(()=>{if(g.cropAsCircle){let e=C.value.x+C.value.width/2,t=C.value.y+C.value.height/2,n=C.value.width/2;return{"top-left":{left:`${e-n-5}px`,top:`${t-n-5}px`},top:{left:`${e-5}px`,top:`${t-n-5}px`},"top-right":{left:`${e+n-5}px`,top:`${t-n-5}px`},right:{left:`${e+n-5}px`,top:`${t-5}px`},"bottom-right":{left:`${e+n-5}px`,top:`${t+n-5}px`},bottom:{left:`${e-5}px`,top:`${t+n-5}px`},"bottom-left":{left:`${e-n-5}px`,top:`${t+n-5}px`},left:{left:`${e-n-5}px`,top:`${t-5}px`}}}else return{"top-left":{left:`${C.value.x-5}px`,top:`${C.value.y-5}px`},top:{left:`${C.value.x+C.value.width/2-5}px`,top:`${C.value.y-5}px`},"top-right":{left:`${C.value.x+C.value.width-5}px`,top:`${C.value.y-5}px`},right:{left:`${C.value.x+C.value.width-5}px`,top:`${C.value.y+C.value.height/2-5}px`},"bottom-right":{left:`${C.value.x+C.value.width-5}px`,top:`${C.value.y+C.value.height-5}px`},bottom:{left:`${C.value.x+C.value.width/2-5}px`,top:`${C.value.y+C.value.height-5}px`},"bottom-left":{left:`${C.value.x-5}px`,top:`${C.value.y+C.value.height-5}px`},left:{left:`${C.value.x-5}px`,top:`${C.value.y+C.value.height/2-5}px`}}}),B=e=>{if(`touches`in e&&e.touches.length>0){let t=e.touches[0];return{clientX:t.clientX,clientY:t.clientY}}else if(`clientX`in e&&`clientY`in e)return{clientX:e.clientX,clientY:e.clientY};return{clientX:0,clientY:0}},V=e=>{let t=v.value;if(!t)return null;let{clientX:n,clientY:r}=B(e),{left:i,top:a}=t.getBoundingClientRect();return{x:n-i,y:r-a}},H=e=>{e.preventDefault();let t=V(e);if(!t)return;let{x:n,y:r}=t;X(n,r)&&(D=!0,E=!0,O={x:n-C.value.x,y:r-C.value.y})},U=e=>{D?G(e):k&&J(e)},W=()=>{D&&(K(),D=!1,Q()),k&&(Y(),Q()),E=!1,D=!1},G=e=>{if(E){let t=V(e);if(!t)return;let{x:n,y:r}=t;C.value.x=Math.floor(n-O.x),C.value.y=Math.floor(r-O.y),L()}},K=()=>{E&&=(Z(),L(),!1)},q=(e,t)=>{e.preventDefault();let n=V(e);n&&(k=!0,M=t,A={x:n.x,y:n.y},j={...C.value},N=e instanceof MouseEvent&&e.shiftKey)},J=e=>{if(!k)return;if(g.lockAspectRatio&&v.value){let t=V(e);if(!t)return;let{x:n,y:r}=t,i=j.x+j.width/2,a=j.y+j.height/2;if(g.cropAsCircle){let e=Math.max(Math.abs(n-i),Math.abs(r-a)),t=e*2;C.value={x:i-e,y:a-e,width:t,height:t}}else{let e=j.width/j.height,t=Math.abs(n-i),r=Math.max(t*2,50),o=r/e;C.value={x:i-r/2,y:a-o/2,width:r,height:o}}L();return}let t=V(e);if(!t)return;let{x:n,y:r}=t,i=n-A.x,a=r-A.y;N=e instanceof MouseEvent&&e.shiftKey;let o={...j};switch(M){case`top-left`:o.x+=i,o.y+=a,o.width-=i,o.height-=a;break;case`top`:o.y+=a,o.height-=a;break;case`top-right`:o.y+=a,o.width+=i,o.height-=a;break;case`right`:o.width+=i;break;case`bottom-right`:o.width+=i,o.height+=a;break;case`bottom`:o.height+=a;break;case`bottom-left`:o.x+=i,o.width-=i,o.height+=a;break;case`left`:o.x+=i,o.width-=i;break}if(o.width<50&&(o.width=50),o.height<50&&(o.height=50),N&&M){let e=j.width/j.height;[`left`,`right`].includes(M)?(o.height=o.width/e,M===`left`&&(o.y=j.y-(o.height-j.height)/2)):[`top`,`bottom`].includes(M)&&(o.width=o.height*e,M===`top`&&(o.x=j.x-(o.width-j.width)/2))}C.value=o,L()},Y=()=>{k&&(Z(),L(),k=!1,M=null)},X=(e,t)=>{if(g.cropAsCircle){let n=C.value.x+C.value.width/2,r=C.value.y+C.value.height/2,i=C.value.width/2,a=e-n,o=t-r;return a*a+o*o<=i*i}else return e>=C.value.x-2&&e<=C.value.x+C.value.width+2&&t>=C.value.y-2&&t<=C.value.y+C.value.height+2},Z=()=>{let e=v.value.width,t=v.value.height;if(C.value.width<50&&(C.value.width=50),C.value.height<50&&(C.value.height=50),g.lockAspectRatio)if(g.cropAsCircle)C.value.height=C.value.width;else{let e=j.width/j.height;C.value.height=C.value.width/e}else if(N){let e=j.width/j.height;C.value.height=C.value.width/e}if(g.cropAsCircle||g.lockAspectRatio){let n=C.value.width/C.value.height;(C.value.width>e||C.value.height>t)&&(C.value.width>C.value.height?(C.value.width=e,C.value.height=e/n):(C.value.height=t,C.value.width=t*n)),C.value.x<0&&(C.value.x=0),C.value.y<0&&(C.value.y=0),C.value.x+C.value.width>e&&(C.value.x=e-C.value.width),C.value.y+C.value.height>t&&(C.value.y=t-C.value.height)}else C.value.x<0&&(C.value.x=0),C.value.y<0&&(C.value.y=0),C.value.width>e&&(C.value.width=e,C.value.x=0),C.value.height>t&&(C.value.height=t,C.value.y=0),C.value.x+C.value.width>e&&(C.value.x=e-C.value.width),C.value.y+C.value.height>t&&(C.value.y=t-C.value.height)},Q=()=>{if(v.value&&y){let e=(v.value.width-b.width*S.x)/2,t=(v.value.height-b.height*S.y)/2,n=(C.value.x-e)/S.x,r=(C.value.y-t)/S.y,i=C.value.width/S.x,a=C.value.height/S.y,o={x:Math.round(n),y:Math.round(r),width:Math.round(i),height:Math.round(a)},s=Math.max(0,Math.min(o.x,b.width)),c=Math.max(0,Math.min(o.y,b.height)),l=Math.min(o.width,b.width-s),u=Math.min(o.height,b.height-c),d=document.createElement(`canvas`);d.width=l,d.height=u;let f=d.getContext(`2d`);f&&(f.drawImage(b,s,c,l,u,0,0,l,u),g.cropAsCircle&&g.outputAsCircle&&(f.globalCompositeOperation=`destination-in`,f.beginPath(),f.arc(l/2,u/2,l/2,0,Math.PI*2),f.closePath(),f.fill(),f.globalCompositeOperation=`source-over`),d.toBlob(e=>{if(e){let t=w.value;t&&URL.revokeObjectURL(t),w.value=URL.createObjectURL(e),T.value=o,_(`crop`,{blob:e,geometry:o})}},`image/jpeg`,.8))}};return(0,r.watch)(()=>g,()=>{Q()},{deep:!0}),(n,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,a,[(0,r.createElementVNode)(`div`,{class:`canvas-container`,onMousedown:H,onMousemove:U,onMouseup:W,onMouseleave:W,onTouchstart:H,onTouchmove:U,onTouchend:W},[(0,r.createElementVNode)(`canvas`,{ref_key:`canvas`,ref:v},null,512),((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(P,e=>(0,r.createElementVNode)(`div`,{key:e.name,class:(0,r.normalizeClass)([`resize-handle`,e.name]),style:(0,r.normalizeStyle)(z.value[e.name]),onMousedown:(0,r.withModifiers)(t=>q(t,e.name),[`stop`]),onTouchstart:(0,r.withModifiers)(t=>q(t,e.name),[`stop`])},null,46,o)),64))],32),e.showPreview&&w.value&&T.value?((0,r.openBlock)(),(0,r.createBlock)(t.t,{key:0,class:`cropped-image-preview`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(t.t,{is:`ul`,dir:`col`,justify:`center`,gap:`sm`},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`li`,null,[(0,r.createElementVNode)(`strong`,null,(0,r.toDisplayString)(h(`common.X`)),1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(T.value.x.toFixed(0)),1)]),(0,r.createElementVNode)(`li`,null,[(0,r.createElementVNode)(`strong`,null,(0,r.toDisplayString)(h(`common.Y`)),1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(T.value.y.toFixed(0)),1)]),(0,r.createElementVNode)(`li`,null,[(0,r.createElementVNode)(`strong`,null,(0,r.toDisplayString)(h(`common.WIDTH`)),1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(T.value.width.toFixed(0)),1)]),(0,r.createElementVNode)(`li`,null,[(0,r.createElementVNode)(`strong`,null,(0,r.toDisplayString)(h(`common.HEIGHT`)),1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(T.value.height.toFixed(0)),1)])]),_:1}),(0,r.createElementVNode)(`img`,{src:w.value,alt:h(`common.IMAGE_THUMBNAIL`)},null,8,s)]),_:1})):(0,r.createCommentVNode)(``,!0)]))}}),d=e.t(u,[[`__scopeId`,`data-v-718b196d`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return d}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
|
|
2
2
|
import { t } from "./Icon-rREAqsu0.js";
|
|
3
3
|
import { useStableId as n } from "./composables/useStableId.composable.mjs";
|
|
4
|
-
import { t as r } from "./Spinner-
|
|
4
|
+
import { t as r } from "./Spinner-BxnDJP1H.js";
|
|
5
5
|
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, openBlock as m, renderSlot as h, toDisplayString as g, unref as _, watch as v } from "vue";
|
|
6
6
|
import * as y from "@nubisco/ui/icons/warning-circle";
|
|
7
7
|
import * as b from "@nubisco/ui/icons/check-circle";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),n=require(`./Icon-C8R_r_In.cjs`),r=require(`./composables/useStableId.composable.cjs`),i=require(`./Spinner-
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),n=require(`./Icon-C8R_r_In.cjs`),r=require(`./composables/useStableId.composable.cjs`),i=require(`./Spinner-swPRQ7kf.cjs`);let a=require(`vue`),o=require(`@nubisco/ui/icons/warning-circle`);o=e.n(o);let s=require(`@nubisco/ui/icons/check-circle`);s=e.n(s);var c=function(e){return e.Inactive=`inactive`,e.Active=`active`,e.Finished=`finished`,e.Error=`error`,e}(c||{}),l=[`id`,`aria-live`],u={class:`nb-inline-loading__text`},d=(0,a.defineComponent)({__name:`InlineLoading`,props:{status:{default:c.Inactive},label:{default:`Saving`},finishedLabel:{default:`Saved`},errorLabel:{default:`Could not save`},dwell:{default:1600},reserveSpace:{type:Boolean,default:!0},id:{default:void 0}},emits:[`success`],setup(e,{emit:t}){let d=e,f=t,p=r.useStableId(d),m;function h(){m&&=(clearTimeout(m),void 0)}(0,a.watch)(()=>d.status,e=>{h(),e===c.Finished&&(m=setTimeout(()=>{m=void 0,f(`success`)},d.dwell))},{immediate:!0}),(0,a.onBeforeUnmount)(h);let g=(0,a.computed)(()=>{switch(d.status){case c.Active:return d.label;case c.Finished:return d.finishedLabel;case c.Error:return d.errorLabel;default:return``}}),_=(0,a.computed)(()=>d.status===c.Finished?s:d.status===c.Error?o:null),v=(0,a.computed)(()=>d.status===c.Inactive?`off`:d.status===c.Error?`assertive`:`polite`),y=(0,a.computed)(()=>[`nb-inline-loading`,`nb-inline-loading--${d.status}`]),b=(0,a.computed)(()=>{if(!d.reserveSpace)return;let e=Math.max(d.label.length,d.finishedLabel.length,d.errorLabel.length);return{"--nb-inline-loading-reserve":`${e+1}ch`}});return(t,r)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{id:(0,a.unref)(p),class:(0,a.normalizeClass)(y.value),style:(0,a.normalizeStyle)(b.value),role:`status`,"aria-live":v.value},[e.status===`active`?((0,a.openBlock)(),(0,a.createBlock)(i.t,{key:0,class:`nb-inline-loading__spinner`,size:`sm`,tone:`inherit`,decorative:``})):_.value?((0,a.openBlock)(),(0,a.createBlock)(n.t,{key:1,class:`nb-inline-loading__icon`,name:_.value,size:16,"aria-hidden":`true`},null,8,[`name`])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`span`,u,[(0,a.renderSlot)(t.$slots,`default`,{status:e.status,text:g.value},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(g.value),1)],!0)])],14,l))}}),f=t.t(d,[[`__scopeId`,`data-v-077014e8`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
|
|
2
|
-
import { i as t, l as n, u as r } from "./palette-
|
|
3
|
-
import { i, r as a } from "./scales-
|
|
4
|
-
import { t as o } from "./useChartSize-
|
|
2
|
+
import { i as t, l as n, u as r } from "./palette-VMXxKICH.js";
|
|
3
|
+
import { i, r as a } from "./scales-DVJzRU1F.js";
|
|
4
|
+
import { t as o } from "./useChartSize-Dyh37PYP.js";
|
|
5
5
|
import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createVNode as ee, defineComponent as p, normalizeClass as te, onBeforeUnmount as ne, openBlock as m, ref as h, renderList as g, toDisplayString as _, unref as v, withCtx as re, withModifiers as y } from "vue";
|
|
6
6
|
//#region src/components/Charts/InterpolationChart.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var b = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./palette-
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./palette-BoABA-De.cjs`),n=require(`./scales-BWtB8m5D.cjs`),r=require(`./useChartSize-D9UxUkiU.cjs`);let i=require(`vue`);var a=[`width`,`height`,`aria-label`],o={key:0},s=[`x1`,`x2`,`y1`,`y2`],c={class:`nb-chart__axis`},l=[`x`,`y`],u={class:`nb-chart__axis`},d=[`x`,`y`],f=[`x1`,`x2`,`y1`,`y2`],p=[`y`,`transform`],ee=[`x`,`y`],te=[`d`,`fill`],m=[`d`,`stroke`],h=[`cx`,`cy`,`r`,`fill`,`onMousedown`,`onContextmenu`],g={key:5},_=[`x1`,`x2`,`y1`,`y2`],v=[`x1`,`x2`,`y1`,`y2`],y=`var(--nb-c-surface)`,b=(0,i.defineComponent)({__name:`InterpolationChart`,props:{modelValue:{default:()=>[]},inputLabel:{default:void 0},outputLabel:{default:void 0},inputMin:{default:0},inputMax:{default:100},outputMin:{default:0},outputMax:{default:100},editable:{type:Boolean,default:!0},minPoints:{default:2},inputStep:{default:0},outputStep:{default:0},title:{default:void 0},subtitle:{default:void 0},height:{default:280},showLegend:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},showGrid:{type:Boolean,default:!0},colors:{default:()=>[]}},emits:[`update:modelValue`],setup(e,{emit:b}){let x=e,S=b,C=(0,i.computed)(()=>t.i(0,x.colors)),w={top:16,right:16,bottom:32,left:48},T=(0,i.ref)(null),E=r.t(T,{width:480,height:240}),D=(0,i.computed)(()=>Math.max(0,E.value.width-w.left-w.right)),O=(0,i.computed)(()=>Math.max(0,E.value.height-w.top-w.bottom)),k=(0,i.computed)(()=>[...x.modelValue].sort((e,t)=>e.input-t.input)),A=(0,i.computed)(()=>[x.inputMin,x.inputMax]),j=(0,i.computed)(()=>{let e=k.value.map(e=>e.output);return n.i(Math.min(x.outputMin,...e),Math.max(x.outputMax,...e),.05)}),M=(0,i.computed)(()=>n.r(A.value,[w.left,E.value.width-w.right])),N=(0,i.computed)(()=>n.r(j.value,[E.value.height-w.bottom,w.top])),P=(0,i.computed)(()=>M.value.ticks(6)),F=(0,i.computed)(()=>N.value.ticks(5)),I=e=>{let[t,n]=A.value,[r,i]=M.value.range;return t+(e-r)/(i-r)*(n-t)},L=e=>{let[t,n]=j.value,[r,i]=N.value.range;return t+(e-r)/(i-r)*(n-t)},R=(e,t)=>!t||t<=0?e:Math.round(e/t)*t,z=(e,t,n)=>Math.max(t,Math.min(n,e)),B=(e,t=1)=>Math.round(e*10**t)/10**t,V=(0,i.computed)(()=>{let e=k.value;return e.length<2?``:e.map((e,t)=>`${t===0?`M`:`L`}${M.value(e.input)},${N.value(e.output)}`).join(` `)}),H=(0,i.computed)(()=>{let e=k.value;if(e.length<2)return``;let t=E.value.height-w.bottom;return`${e.map((e,t)=>`${t===0?`M`:`L`}${M.value(e.input)},${N.value(e.output)}`).join(` `)} L${M.value(e[e.length-1].input)},${t} L${M.value(e[0].input)},${t} Z`}),U=(0,i.ref)(null),W=(0,i.ref)(null);function G(e){S(`update:modelValue`,[...e].sort((e,t)=>e.input-t.input))}function K(e,t){x.editable&&(U.value=e,window.addEventListener(`mousemove`,J),window.addEventListener(`mouseup`,Y))}function q(e){let t=T.value?.querySelector(`svg`);if(!t)return null;let n=t.getBoundingClientRect();return{px:e.clientX-n.left,py:e.clientY-n.top}}function J(e){if(U.value===null)return;let t=q(e);if(!t)return;let n=I(t.px),r=L(t.py),i=[...k.value],a=U.value,o=x.inputStep>0?x.inputStep:.1;i[a]={input:B(R(z(n,a>0?i[a-1].input+o:x.inputMin,a<i.length-1?i[a+1].input-o:x.inputMax),x.inputStep)),output:B(R(z(r,x.outputMin,x.outputMax),x.outputStep))},G(i)}function Y(){U.value=null,window.removeEventListener(`mousemove`,J),window.removeEventListener(`mouseup`,Y)}function X(e){if(U.value!==null)return;let t=q(e);if(!t)return;let n=-1,r=1/0;for(let e=0;e<k.value.length;e++){let i=k.value[e],a=M.value(i.input)-t.px,o=N.value(i.output)-t.py,s=Math.sqrt(a*a+o*o);s<r&&(r=s,n=e)}W.value=r<20?n:null,Q.value={x:t.px+12,y:t.py-12}}function Z(){U.value===null&&(W.value=null)}function ne(){U.value!==null&&(U.value=null,window.removeEventListener(`mousemove`,J),window.removeEventListener(`mouseup`,Y))}function re(e){if(!x.editable)return;let t=q(e);if(!t)return;let n=I(t.px),r=L(t.py);if(n<x.inputMin||n>x.inputMax||r<x.outputMin||r>x.outputMax)return;let i=B(R(z(n,x.inputMin,x.inputMax),x.inputStep)),a=B(R(z(r,x.outputMin,x.outputMax),x.outputStep));G([...k.value,{input:i,output:a}])}function ie(e){x.editable&&(k.value.length<=x.minPoints||G(k.value.filter((t,n)=>n!==e)))}(0,i.onBeforeUnmount)(()=>{window.removeEventListener(`mousemove`,J),window.removeEventListener(`mouseup`,Y)});let Q=(0,i.ref)({x:0,y:0}),ae=(0,i.computed)(()=>W.value!==null||U.value!==null),oe=(0,i.computed)(()=>{let e=U.value??W.value;return e===null?``:`Point ${e+1}`}),se=(0,i.computed)(()=>{let e=U.value??W.value;if(e===null||e>=k.value.length)return[];let t=k.value[e];return[{label:x.inputLabel||`Input`,value:$(t.input),color:C.value},{label:x.outputLabel||`Output`,value:$(t.output),color:C.value}]}),$=e=>Number.isInteger(e)?String(e):e.toFixed(1);return(n,r)=>((0,i.openBlock)(),(0,i.createBlock)(t.u,{title:e.title,subtitle:e.subtitle,height:e.height,"show-legend":!1},{default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`div`,{ref_key:`root`,ref:T,class:`nb-interpolation-chart`},[((0,i.openBlock)(),(0,i.createElementBlock)(`svg`,{width:(0,i.unref)(E).width,height:(0,i.unref)(E).height,class:`nb-chart__svg`,role:`img`,"aria-label":e.title||`Interpolation chart`,onMousemove:X,onMouseleave:Z,onMouseup:ne,onDblclick:re,onContextmenu:r[0]||=(0,i.withModifiers)(()=>{},[`prevent`])},[e.showGrid&&(0,i.unref)(E).width>0?((0,i.openBlock)(),(0,i.createElementBlock)(`g`,o,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(F.value,e=>((0,i.openBlock)(),(0,i.createElementBlock)(`line`,{key:`grid-${e}`,class:`nb-chart__gridline`,x1:w.left,x2:(0,i.unref)(E).width-w.right,y1:N.value(e),y2:N.value(e)},null,8,s))),128))])):(0,i.createCommentVNode)(``,!0),(0,i.createElementVNode)(`g`,c,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(F.value,e=>((0,i.openBlock)(),(0,i.createElementBlock)(`text`,{key:`yt-${e}`,x:w.left-6,y:N.value(e),"text-anchor":`end`,"dominant-baseline":`middle`},(0,i.toDisplayString)($(e)),9,l))),128))]),(0,i.createElementVNode)(`g`,u,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(P.value,e=>((0,i.openBlock)(),(0,i.createElementBlock)(`text`,{key:`xt-${e}`,x:M.value(e),y:(0,i.unref)(E).height-w.bottom+14,"text-anchor":`middle`},(0,i.toDisplayString)($(e)),9,d))),128))]),(0,i.createElementVNode)(`line`,{class:`nb-chart__axis-line`,x1:w.left,x2:(0,i.unref)(E).width-w.right,y1:(0,i.unref)(E).height-w.bottom,y2:(0,i.unref)(E).height-w.bottom},null,8,f),e.outputLabel?((0,i.openBlock)(),(0,i.createElementBlock)(`text`,{key:1,class:`nb-chart__axis-label`,x:12,y:w.top+O.value/2,"text-anchor":`middle`,transform:`rotate(-90, 12, ${w.top+O.value/2})`},(0,i.toDisplayString)(e.outputLabel),9,p)):(0,i.createCommentVNode)(``,!0),e.inputLabel?((0,i.openBlock)(),(0,i.createElementBlock)(`text`,{key:2,class:`nb-chart__axis-label`,x:w.left+D.value/2,y:(0,i.unref)(E).height-2,"text-anchor":`middle`},(0,i.toDisplayString)(e.inputLabel),9,ee)):(0,i.createCommentVNode)(``,!0),k.value.length>=2?((0,i.openBlock)(),(0,i.createElementBlock)(`path`,{key:3,class:`nb-interpolation-chart__area`,d:H.value,fill:C.value,opacity:`0.12`},null,8,te)):(0,i.createCommentVNode)(``,!0),k.value.length>=2?((0,i.openBlock)(),(0,i.createElementBlock)(`path`,{key:4,class:`nb-interpolation-chart__line`,d:V.value,stroke:C.value,fill:`none`,"stroke-width":`2`,"stroke-linejoin":`round`,"stroke-linecap":`round`},null,8,m)):(0,i.createCommentVNode)(``,!0),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(k.value,(t,n)=>((0,i.openBlock)(),(0,i.createElementBlock)(`circle`,{key:`pt-${n}`,class:(0,i.normalizeClass)([`nb-interpolation-chart__point`,{"nb-interpolation-chart__point--editable":e.editable,"nb-interpolation-chart__point--dragging":U.value===n,"nb-interpolation-chart__point--hover":W.value===n&&U.value===null}]),cx:M.value(t.input),cy:N.value(t.output),r:U.value===n?7:W.value===n?6:5,fill:C.value,stroke:y,"stroke-width":`2`,onMousedown:(0,i.withModifiers)(e=>K(n,e),[`prevent`]),onContextmenu:(0,i.withModifiers)(e=>ie(n),[`prevent`])},null,42,h))),128)),U.value===null?(0,i.createCommentVNode)(``,!0):((0,i.openBlock)(),(0,i.createElementBlock)(`g`,g,[(0,i.createElementVNode)(`line`,{class:`nb-interpolation-chart__crosshair`,x1:M.value(k.value[U.value].input),x2:M.value(k.value[U.value].input),y1:w.top,y2:(0,i.unref)(E).height-w.bottom},null,8,_),(0,i.createElementVNode)(`line`,{class:`nb-interpolation-chart__crosshair`,x1:w.left,x2:(0,i.unref)(E).width-w.right,y1:N.value(k.value[U.value].output),y2:N.value(k.value[U.value].output)},null,8,v)]))],40,a)),(0,i.createVNode)(t.l,{visible:e.showTooltip&&ae.value,x:Q.value.x,y:Q.value.y,title:oe.value,rows:se.value},null,8,[`visible`,`x`,`y`,`title`,`rows`])],512)]),_:1},8,[`title`,`subtitle`,`height`]))}}),x=e.t(b,[[`__scopeId`,`data-v-676875de`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return x}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./palette-BoABA-De.cjs`),n=require(`./ChartLegend-ndpGucTZ.cjs`),r=require(`./scales-BWtB8m5D.cjs`),i=require(`./useChartSize-D9UxUkiU.cjs`);let a=require(`vue`);var o=6,s=8,c=(e,t=o)=>{let n=[];if(e<=0)return n;let r=Math.max(1,Math.ceil(e/t));for(let t=0;t<e;t+=r)n.push(t);return n[n.length-1]!==e-1&&n.push(e-1),n},l=(e,t,n)=>{for(let r=1;r<e.length;r++){let i=e[r-1],a=e[r],o=i.x+t(i.index)/2;if(a.x-t(a.index)/2-o<n)return!1}return!0},u=(e,t,n)=>{if(n===void 0||t>=n)return e;let r=t/2;return Math.min(Math.max(e,r),n-r)},d=({count:e,positionOf:t,widthOf:n,width:r,gap:i=s})=>{let a=c(e).map(e=>({index:e,x:t(e)}));if(!n||l(a,n,0))return a;let d=e-1,f=e=>({index:e,x:u(t(e),n(e),r)}),p=Math.max(1,Math.ceil(e/o))+1;for(let e=p;e<=d;e++){let t=[];for(let n=0;n<d;n+=e)t.push(n);let r=[...t,d].map(f);if(r.length>2&&!l(r.slice(-2),n,i)&&(r=[...r.slice(0,-2),r[r.length-1]]),l(r,n,i))return r}return[f(0)]},f=[`width`,`height`,`aria-label`],p={key:0},m=[`x1`,`x2`,`y1`,`y2`],h={class:`nb-chart__axis`},g=[`x`,`y`],_=[`x`,`y`],v=[`x1`,`x2`,`y1`,`y2`],y=[`d`,`fill`],b=[`d`,`stroke`],x=[`cx`,`cy`,`r`,`fill`],S=[`x1`,`x2`,`y1`,`y2`],C=(0,a.defineComponent)({__name:`LineChart`,props:{series:{default:()=>[]},area:{type:Boolean,default:!1},points:{type:Boolean,default:!1},curve:{default:`smooth`},valueFormatter:{},title:{default:void 0},subtitle:{default:void 0},height:{default:280},showLegend:{type:Boolean,default:!0},showTooltip:{type:Boolean,default:!0},showGrid:{type:Boolean,default:!0},colors:{default:()=>t.n}},setup(e){let o=e,s={top:12,right:16,bottom:28,left:44},c=(0,a.ref)(null),l=i.t(c,{width:480,height:240}),u=(0,a.computed)(()=>o.series.map((e,n)=>({name:e.name,data:e.data,color:e.color??t.i(n,o.colors)}))),C=(0,a.computed)(()=>(o.series[0]?.data??[]).map(e=>e.x)),w=(0,a.computed)(()=>{let e=o.series.flatMap(e=>e.data.map(e=>e.y));return e.length?r.i(Math.min(0,...e),Math.max(...e),.1):[0,1]}),T=(0,a.computed)(()=>r.r(w.value,[Math.max(s.top,l.value.height-s.bottom),s.top])),E=(0,a.computed)(()=>T.value.ticks(5)),D=(0,a.computed)(()=>Math.max(0,l.value.width-s.left-s.right)),O=e=>{let t=C.value.length;return t<=1?s.left+D.value/2:s.left+e/(t-1)*D.value},k=(0,a.ref)(null),A=(0,a.ref)(null),j=()=>{let e=k.value;if(!e||typeof document>`u`)return;let t=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);if(typeof t.getComputedTextLength!=`function`)return;t.setAttribute(`visibility`,`hidden`),t.setAttribute(`aria-hidden`,`true`),e.appendChild(t);let n=new Map;for(let e of C.value){let r=(0,a.toDisplayString)(e);n.has(r)||(t.textContent=r,n.set(r,t.getComputedTextLength()))}e.removeChild(t),A.value=n};(0,a.watch)(C,j,{flush:`post`});let M=typeof document>`u`?void 0:document.fonts;(0,a.onMounted)(()=>{j(),M?.addEventListener?.(`loadingdone`,j)}),(0,a.onBeforeUnmount)(()=>{M?.removeEventListener?.(`loadingdone`,j)});let N=(0,a.computed)(()=>{let e=C.value,t=A.value;return d({count:e.length,positionOf:O,widthOf:t?n=>t.get((0,a.toDisplayString)(e[n]))??0:void 0,width:l.value.width}).map(t=>({...t,value:e[t.index]}))}),P=e=>e.length?I(e.map((e,t)=>[O(t),T.value(e.y)]),o.curve):``,F=e=>{if(!e.length)return``;let t=e.map((e,t)=>[O(t),T.value(e.y)]),n=l.value.height-s.bottom;return`${I(t,o.curve)} L${t[t.length-1][0]},${n} L${t[0][0]},${n} Z`},I=(e,t)=>{if(!e.length)return``;if(e.length===1)return`M${e[0][0]},${e[0][1]}`;if(t===`linear`)return e.map((e,t)=>`${t===0?`M`:`L`}${e[0]},${e[1]}`).join(` `);if(t===`step`){let t=`M${e[0][0]},${e[0][1]}`;for(let n=1;n<e.length;n++){let[r,i]=e[n-1],[a,o]=e[n],s=(r+a)/2;t+=` L${s},${i} L${s},${o} L${a},${o}`}return t}let n=.2,r=`M${e[0][0]},${e[0][1]}`;for(let t=0;t<e.length-1;t++){let i=e[t-1]??e[t],a=e[t],o=e[t+1],s=e[t+2]??o,c=a[0]+(o[0]-i[0])*n,l=a[1]+(o[1]-i[1])*n,u=o[0]-(s[0]-a[0])*n,d=o[1]-(s[1]-a[1])*n;r+=` C${c},${l} ${u},${d} ${o[0]},${o[1]}`}return r},L=e=>Math.abs(e)>=1e3?`${(e/1e3).toFixed(1)}k`:Number.isInteger(e)?String(e):e.toFixed(1),R=e=>o.valueFormatter?o.valueFormatter(e):L(e),z=(0,a.ref)(null),B=(0,a.ref)({x:0,y:0}),V=e=>{let t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,r=C.value.length;if(!r)return;let i=(n-s.left)/Math.max(1,D.value);z.value=Math.round(Math.min(1,Math.max(0,i))*(r-1)),B.value={x:e.clientX-t.left+12,y:e.clientY-t.top+12}},H=(0,a.computed)(()=>z.value===null?[]:u.value.map(e=>{let t=e.data[z.value];return{label:e.name,value:t?.label??R(t?.y??0),color:e.color}}));return(r,i)=>((0,a.openBlock)(),(0,a.createBlock)(t.u,{title:e.title,subtitle:e.subtitle,height:e.height,"show-legend":e.showLegend&&u.value.length>0},{legend:(0,a.withCtx)(()=>[(0,a.createVNode)(n.t,{items:u.value.map(e=>({label:e.name,color:e.color}))},null,8,[`items`])]),default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`div`,{ref_key:`root`,ref:c,class:`nb-line-chart`},[((0,a.openBlock)(),(0,a.createElementBlock)(`svg`,{width:(0,a.unref)(l).width,height:(0,a.unref)(l).height,class:`nb-chart__svg`,role:`img`,"aria-label":e.title||`Line chart`,onMouseleave:i[0]||=e=>z.value=null,onMousemove:V},[e.showGrid&&(0,a.unref)(l).width>0?((0,a.openBlock)(),(0,a.createElementBlock)(`g`,p,[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(E.value,e=>((0,a.openBlock)(),(0,a.createElementBlock)(`line`,{key:`grid-${e}`,class:`nb-chart__gridline`,x1:s.left,x2:(0,a.unref)(l).width-s.right,y1:T.value(e),y2:T.value(e)},null,8,m))),128))])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`g`,h,[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(E.value,e=>((0,a.openBlock)(),(0,a.createElementBlock)(`text`,{key:`yt-${e}`,x:s.left-6,y:T.value(e),"text-anchor":`end`,"dominant-baseline":`middle`},(0,a.toDisplayString)(R(e)),9,g))),128))]),(0,a.createElementVNode)(`g`,{ref_key:`xAxis`,ref:k,class:`nb-chart__axis`},[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(N.value,(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`text`,{key:`xt-${t}`,x:e.x,y:(0,a.unref)(l).height-s.bottom+14,"text-anchor":`middle`},(0,a.toDisplayString)(e.value),9,_))),128))],512),(0,a.createElementVNode)(`line`,{class:`nb-chart__axis-line`,x1:s.left,x2:(0,a.unref)(l).width-s.right,y1:(0,a.unref)(l).height-s.bottom,y2:(0,a.unref)(l).height-s.bottom},null,8,v),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(u.value,(t,n)=>((0,a.openBlock)(),(0,a.createElementBlock)(`g`,{key:`s-${n}`},[e.area?((0,a.openBlock)(),(0,a.createElementBlock)(`path`,{key:0,class:`nb-chart__area`,d:F(t.data),fill:t.color,opacity:`0.18`},null,8,y)):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`path`,{class:`nb-chart__line`,d:P(t.data),stroke:t.color,fill:`none`,"stroke-width":`2`,"stroke-linejoin":`round`,"stroke-linecap":`round`},null,8,b),e.points?((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,{key:1},(0,a.renderList)(t.data,(e,r)=>((0,a.openBlock)(),(0,a.createElementBlock)(`circle`,{key:`p-${n}-${r}`,cx:O(r),cy:T.value(e.y),r:z.value===r?4:3,fill:t.color,class:`nb-chart__point`},null,8,x))),128)):(0,a.createCommentVNode)(``,!0)]))),128)),z.value===null?(0,a.createCommentVNode)(``,!0):((0,a.openBlock)(),(0,a.createElementBlock)(`line`,{key:1,class:`nb-chart__hover-line`,x1:O(z.value),x2:O(z.value),y1:s.top,y2:(0,a.unref)(l).height-s.bottom},null,8,S))],40,f)),(0,a.createVNode)(t.l,{visible:e.showTooltip&&z.value!==null,x:B.value.x,y:B.value.y,title:z.value===null?``:String(C.value[z.value]),rows:H.value},null,8,[`visible`,`x`,`y`,`title`,`rows`])],512)]),_:1},8,[`title`,`subtitle`,`height`,`show-legend`]))}}),w=e.t(C,[[`__scopeId`,`data-v-278daa3d`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return w}});
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
|
|
2
|
+
import { i as t, l as n, n as r, u as i } from "./palette-VMXxKICH.js";
|
|
3
|
+
import { t as a } from "./ChartLegend-BtBKVnH3.js";
|
|
4
|
+
import { i as o, r as s } from "./scales-DVJzRU1F.js";
|
|
5
|
+
import { t as c } from "./useChartSize-Dyh37PYP.js";
|
|
6
|
+
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createVNode as h, defineComponent as g, onBeforeUnmount as _, onMounted as v, openBlock as y, ref as b, renderList as x, toDisplayString as S, unref as C, watch as w, withCtx as T } from "vue";
|
|
7
|
+
//#region src/components/Charts/shared/xLabels.ts
|
|
8
|
+
var E = 6, D = 8, O = (e, t = E) => {
|
|
9
|
+
let n = [];
|
|
10
|
+
if (e <= 0) return n;
|
|
11
|
+
let r = Math.max(1, Math.ceil(e / t));
|
|
12
|
+
for (let t = 0; t < e; t += r) n.push(t);
|
|
13
|
+
return n[n.length - 1] !== e - 1 && n.push(e - 1), n;
|
|
14
|
+
}, k = (e, t, n) => {
|
|
15
|
+
for (let r = 1; r < e.length; r++) {
|
|
16
|
+
let i = e[r - 1], a = e[r], o = i.x + t(i.index) / 2;
|
|
17
|
+
if (a.x - t(a.index) / 2 - o < n) return !1;
|
|
18
|
+
}
|
|
19
|
+
return !0;
|
|
20
|
+
}, A = (e, t, n) => {
|
|
21
|
+
if (n === void 0 || t >= n) return e;
|
|
22
|
+
let r = t / 2;
|
|
23
|
+
return Math.min(Math.max(e, r), n - r);
|
|
24
|
+
}, j = ({ count: e, positionOf: t, widthOf: n, width: r, gap: i = D }) => {
|
|
25
|
+
let a = O(e).map((e) => ({
|
|
26
|
+
index: e,
|
|
27
|
+
x: t(e)
|
|
28
|
+
}));
|
|
29
|
+
if (!n || k(a, n, 0)) return a;
|
|
30
|
+
let o = e - 1, s = (e) => ({
|
|
31
|
+
index: e,
|
|
32
|
+
x: A(t(e), n(e), r)
|
|
33
|
+
}), c = Math.max(1, Math.ceil(e / E)) + 1;
|
|
34
|
+
for (let e = c; e <= o; e++) {
|
|
35
|
+
let t = [];
|
|
36
|
+
for (let n = 0; n < o; n += e) t.push(n);
|
|
37
|
+
let r = [...t, o].map(s);
|
|
38
|
+
if (r.length > 2 && !k(r.slice(-2), n, i) && (r = [...r.slice(0, -2), r[r.length - 1]]), k(r, n, i)) return r;
|
|
39
|
+
}
|
|
40
|
+
return [s(0)];
|
|
41
|
+
}, M = [
|
|
42
|
+
"width",
|
|
43
|
+
"height",
|
|
44
|
+
"aria-label"
|
|
45
|
+
], N = { key: 0 }, P = [
|
|
46
|
+
"x1",
|
|
47
|
+
"x2",
|
|
48
|
+
"y1",
|
|
49
|
+
"y2"
|
|
50
|
+
], F = { class: "nb-chart__axis" }, ee = ["x", "y"], te = ["x", "y"], ne = [
|
|
51
|
+
"x1",
|
|
52
|
+
"x2",
|
|
53
|
+
"y1",
|
|
54
|
+
"y2"
|
|
55
|
+
], re = ["d", "fill"], ie = ["d", "stroke"], I = [
|
|
56
|
+
"cx",
|
|
57
|
+
"cy",
|
|
58
|
+
"r",
|
|
59
|
+
"fill"
|
|
60
|
+
], L = [
|
|
61
|
+
"x1",
|
|
62
|
+
"x2",
|
|
63
|
+
"y1",
|
|
64
|
+
"y2"
|
|
65
|
+
], R = /* @__PURE__ */ e(/* @__PURE__ */ g({
|
|
66
|
+
__name: "LineChart",
|
|
67
|
+
props: {
|
|
68
|
+
series: { default: () => [] },
|
|
69
|
+
area: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: !1
|
|
72
|
+
},
|
|
73
|
+
points: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: !1
|
|
76
|
+
},
|
|
77
|
+
curve: { default: "smooth" },
|
|
78
|
+
valueFormatter: {},
|
|
79
|
+
title: { default: void 0 },
|
|
80
|
+
subtitle: { default: void 0 },
|
|
81
|
+
height: { default: 280 },
|
|
82
|
+
showLegend: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: !0
|
|
85
|
+
},
|
|
86
|
+
showTooltip: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: !0
|
|
89
|
+
},
|
|
90
|
+
showGrid: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: !0
|
|
93
|
+
},
|
|
94
|
+
colors: { default: () => r }
|
|
95
|
+
},
|
|
96
|
+
setup(e) {
|
|
97
|
+
let r = e, g = {
|
|
98
|
+
top: 12,
|
|
99
|
+
right: 16,
|
|
100
|
+
bottom: 28,
|
|
101
|
+
left: 44
|
|
102
|
+
}, E = b(null), D = c(E, {
|
|
103
|
+
width: 480,
|
|
104
|
+
height: 240
|
|
105
|
+
}), O = u(() => r.series.map((e, n) => ({
|
|
106
|
+
name: e.name,
|
|
107
|
+
data: e.data,
|
|
108
|
+
color: e.color ?? t(n, r.colors)
|
|
109
|
+
}))), k = u(() => (r.series[0]?.data ?? []).map((e) => e.x)), A = u(() => {
|
|
110
|
+
let e = r.series.flatMap((e) => e.data.map((e) => e.y));
|
|
111
|
+
return e.length ? o(Math.min(0, ...e), Math.max(...e), .1) : [0, 1];
|
|
112
|
+
}), R = u(() => s(A.value, [Math.max(g.top, D.value.height - g.bottom), g.top])), z = u(() => R.value.ticks(5)), B = u(() => Math.max(0, D.value.width - g.left - g.right)), V = (e) => {
|
|
113
|
+
let t = k.value.length;
|
|
114
|
+
return t <= 1 ? g.left + B.value / 2 : g.left + e / (t - 1) * B.value;
|
|
115
|
+
}, H = b(null), U = b(null), W = () => {
|
|
116
|
+
let e = H.value;
|
|
117
|
+
if (!e || typeof document > "u") return;
|
|
118
|
+
let t = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
119
|
+
if (typeof t.getComputedTextLength != "function") return;
|
|
120
|
+
t.setAttribute("visibility", "hidden"), t.setAttribute("aria-hidden", "true"), e.appendChild(t);
|
|
121
|
+
let n = /* @__PURE__ */ new Map();
|
|
122
|
+
for (let e of k.value) {
|
|
123
|
+
let r = S(e);
|
|
124
|
+
n.has(r) || (t.textContent = r, n.set(r, t.getComputedTextLength()));
|
|
125
|
+
}
|
|
126
|
+
e.removeChild(t), U.value = n;
|
|
127
|
+
};
|
|
128
|
+
w(k, W, { flush: "post" });
|
|
129
|
+
let G = typeof document > "u" ? void 0 : document.fonts;
|
|
130
|
+
v(() => {
|
|
131
|
+
W(), G?.addEventListener?.("loadingdone", W);
|
|
132
|
+
}), _(() => {
|
|
133
|
+
G?.removeEventListener?.("loadingdone", W);
|
|
134
|
+
});
|
|
135
|
+
let K = u(() => {
|
|
136
|
+
let e = k.value, t = U.value;
|
|
137
|
+
return j({
|
|
138
|
+
count: e.length,
|
|
139
|
+
positionOf: V,
|
|
140
|
+
widthOf: t ? (n) => t.get(S(e[n])) ?? 0 : void 0,
|
|
141
|
+
width: D.value.width
|
|
142
|
+
}).map((t) => ({
|
|
143
|
+
...t,
|
|
144
|
+
value: e[t.index]
|
|
145
|
+
}));
|
|
146
|
+
}), q = (e) => e.length ? Y(e.map((e, t) => [V(t), R.value(e.y)]), r.curve) : "", J = (e) => {
|
|
147
|
+
if (!e.length) return "";
|
|
148
|
+
let t = e.map((e, t) => [V(t), R.value(e.y)]), n = D.value.height - g.bottom;
|
|
149
|
+
return `${Y(t, r.curve)} L${t[t.length - 1][0]},${n} L${t[0][0]},${n} Z`;
|
|
150
|
+
}, Y = (e, t) => {
|
|
151
|
+
if (!e.length) return "";
|
|
152
|
+
if (e.length === 1) return `M${e[0][0]},${e[0][1]}`;
|
|
153
|
+
if (t === "linear") return e.map((e, t) => `${t === 0 ? "M" : "L"}${e[0]},${e[1]}`).join(" ");
|
|
154
|
+
if (t === "step") {
|
|
155
|
+
let t = `M${e[0][0]},${e[0][1]}`;
|
|
156
|
+
for (let n = 1; n < e.length; n++) {
|
|
157
|
+
let [r, i] = e[n - 1], [a, o] = e[n], s = (r + a) / 2;
|
|
158
|
+
t += ` L${s},${i} L${s},${o} L${a},${o}`;
|
|
159
|
+
}
|
|
160
|
+
return t;
|
|
161
|
+
}
|
|
162
|
+
let n = .2, r = `M${e[0][0]},${e[0][1]}`;
|
|
163
|
+
for (let t = 0; t < e.length - 1; t++) {
|
|
164
|
+
let i = e[t - 1] ?? e[t], a = e[t], o = e[t + 1], s = e[t + 2] ?? o, c = a[0] + (o[0] - i[0]) * n, l = a[1] + (o[1] - i[1]) * n, u = o[0] - (s[0] - a[0]) * n, d = o[1] - (s[1] - a[1]) * n;
|
|
165
|
+
r += ` C${c},${l} ${u},${d} ${o[0]},${o[1]}`;
|
|
166
|
+
}
|
|
167
|
+
return r;
|
|
168
|
+
}, X = (e) => Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(1)}k` : Number.isInteger(e) ? String(e) : e.toFixed(1), Z = (e) => r.valueFormatter ? r.valueFormatter(e) : X(e), Q = b(null), $ = b({
|
|
169
|
+
x: 0,
|
|
170
|
+
y: 0
|
|
171
|
+
}), ae = (e) => {
|
|
172
|
+
let t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left, r = k.value.length;
|
|
173
|
+
if (!r) return;
|
|
174
|
+
let i = (n - g.left) / Math.max(1, B.value);
|
|
175
|
+
Q.value = Math.round(Math.min(1, Math.max(0, i)) * (r - 1)), $.value = {
|
|
176
|
+
x: e.clientX - t.left + 12,
|
|
177
|
+
y: e.clientY - t.top + 12
|
|
178
|
+
};
|
|
179
|
+
}, oe = u(() => Q.value === null ? [] : O.value.map((e) => {
|
|
180
|
+
let t = e.data[Q.value];
|
|
181
|
+
return {
|
|
182
|
+
label: e.name,
|
|
183
|
+
value: t?.label ?? Z(t?.y ?? 0),
|
|
184
|
+
color: e.color
|
|
185
|
+
};
|
|
186
|
+
}));
|
|
187
|
+
return (t, r) => (y(), d(i, {
|
|
188
|
+
title: e.title,
|
|
189
|
+
subtitle: e.subtitle,
|
|
190
|
+
height: e.height,
|
|
191
|
+
"show-legend": e.showLegend && O.value.length > 0
|
|
192
|
+
}, {
|
|
193
|
+
legend: T(() => [h(a, { items: O.value.map((e) => ({
|
|
194
|
+
label: e.name,
|
|
195
|
+
color: e.color
|
|
196
|
+
})) }, null, 8, ["items"])]),
|
|
197
|
+
default: T(() => [m("div", {
|
|
198
|
+
ref_key: "root",
|
|
199
|
+
ref: E,
|
|
200
|
+
class: "nb-line-chart"
|
|
201
|
+
}, [(y(), p("svg", {
|
|
202
|
+
width: C(D).width,
|
|
203
|
+
height: C(D).height,
|
|
204
|
+
class: "nb-chart__svg",
|
|
205
|
+
role: "img",
|
|
206
|
+
"aria-label": e.title || "Line chart",
|
|
207
|
+
onMouseleave: r[0] ||= (e) => Q.value = null,
|
|
208
|
+
onMousemove: ae
|
|
209
|
+
}, [
|
|
210
|
+
e.showGrid && C(D).width > 0 ? (y(), p("g", N, [(y(!0), p(l, null, x(z.value, (e) => (y(), p("line", {
|
|
211
|
+
key: `grid-${e}`,
|
|
212
|
+
class: "nb-chart__gridline",
|
|
213
|
+
x1: g.left,
|
|
214
|
+
x2: C(D).width - g.right,
|
|
215
|
+
y1: R.value(e),
|
|
216
|
+
y2: R.value(e)
|
|
217
|
+
}, null, 8, P))), 128))])) : f("", !0),
|
|
218
|
+
m("g", F, [(y(!0), p(l, null, x(z.value, (e) => (y(), p("text", {
|
|
219
|
+
key: `yt-${e}`,
|
|
220
|
+
x: g.left - 6,
|
|
221
|
+
y: R.value(e),
|
|
222
|
+
"text-anchor": "end",
|
|
223
|
+
"dominant-baseline": "middle"
|
|
224
|
+
}, S(Z(e)), 9, ee))), 128))]),
|
|
225
|
+
m("g", {
|
|
226
|
+
ref_key: "xAxis",
|
|
227
|
+
ref: H,
|
|
228
|
+
class: "nb-chart__axis"
|
|
229
|
+
}, [(y(!0), p(l, null, x(K.value, (e, t) => (y(), p("text", {
|
|
230
|
+
key: `xt-${t}`,
|
|
231
|
+
x: e.x,
|
|
232
|
+
y: C(D).height - g.bottom + 14,
|
|
233
|
+
"text-anchor": "middle"
|
|
234
|
+
}, S(e.value), 9, te))), 128))], 512),
|
|
235
|
+
m("line", {
|
|
236
|
+
class: "nb-chart__axis-line",
|
|
237
|
+
x1: g.left,
|
|
238
|
+
x2: C(D).width - g.right,
|
|
239
|
+
y1: C(D).height - g.bottom,
|
|
240
|
+
y2: C(D).height - g.bottom
|
|
241
|
+
}, null, 8, ne),
|
|
242
|
+
(y(!0), p(l, null, x(O.value, (t, n) => (y(), p("g", { key: `s-${n}` }, [
|
|
243
|
+
e.area ? (y(), p("path", {
|
|
244
|
+
key: 0,
|
|
245
|
+
class: "nb-chart__area",
|
|
246
|
+
d: J(t.data),
|
|
247
|
+
fill: t.color,
|
|
248
|
+
opacity: "0.18"
|
|
249
|
+
}, null, 8, re)) : f("", !0),
|
|
250
|
+
m("path", {
|
|
251
|
+
class: "nb-chart__line",
|
|
252
|
+
d: q(t.data),
|
|
253
|
+
stroke: t.color,
|
|
254
|
+
fill: "none",
|
|
255
|
+
"stroke-width": "2",
|
|
256
|
+
"stroke-linejoin": "round",
|
|
257
|
+
"stroke-linecap": "round"
|
|
258
|
+
}, null, 8, ie),
|
|
259
|
+
e.points ? (y(!0), p(l, { key: 1 }, x(t.data, (e, r) => (y(), p("circle", {
|
|
260
|
+
key: `p-${n}-${r}`,
|
|
261
|
+
cx: V(r),
|
|
262
|
+
cy: R.value(e.y),
|
|
263
|
+
r: Q.value === r ? 4 : 3,
|
|
264
|
+
fill: t.color,
|
|
265
|
+
class: "nb-chart__point"
|
|
266
|
+
}, null, 8, I))), 128)) : f("", !0)
|
|
267
|
+
]))), 128)),
|
|
268
|
+
Q.value === null ? f("", !0) : (y(), p("line", {
|
|
269
|
+
key: 1,
|
|
270
|
+
class: "nb-chart__hover-line",
|
|
271
|
+
x1: V(Q.value),
|
|
272
|
+
x2: V(Q.value),
|
|
273
|
+
y1: g.top,
|
|
274
|
+
y2: C(D).height - g.bottom
|
|
275
|
+
}, null, 8, L))
|
|
276
|
+
], 40, M)), h(n, {
|
|
277
|
+
visible: e.showTooltip && Q.value !== null,
|
|
278
|
+
x: $.value.x,
|
|
279
|
+
y: $.value.y,
|
|
280
|
+
title: Q.value === null ? "" : String(k.value[Q.value]),
|
|
281
|
+
rows: oe.value
|
|
282
|
+
}, null, 8, [
|
|
283
|
+
"visible",
|
|
284
|
+
"x",
|
|
285
|
+
"y",
|
|
286
|
+
"title",
|
|
287
|
+
"rows"
|
|
288
|
+
])], 512)]),
|
|
289
|
+
_: 1
|
|
290
|
+
}, 8, [
|
|
291
|
+
"title",
|
|
292
|
+
"subtitle",
|
|
293
|
+
"height",
|
|
294
|
+
"show-legend"
|
|
295
|
+
]));
|
|
296
|
+
}
|
|
297
|
+
}), [["__scopeId", "data-v-278daa3d"]]);
|
|
298
|
+
//#endregion
|
|
299
|
+
export { R as t };
|
|
@@ -3,8 +3,8 @@ import { t } from "./Icon-rREAqsu0.js";
|
|
|
3
3
|
import { createCommentVNode as n, createElementBlock as r, createVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, renderSlot as c } from "vue";
|
|
4
4
|
import * as l from "@nubisco/ui/icons/info";
|
|
5
5
|
import * as u from "@nubisco/ui/icons/warning-circle";
|
|
6
|
-
import * as d from "@nubisco/ui/icons/
|
|
7
|
-
import * as f from "@nubisco/ui/icons/
|
|
6
|
+
import * as d from "@nubisco/ui/icons/warning";
|
|
7
|
+
import * as f from "@nubisco/ui/icons/check-circle";
|
|
8
8
|
//#region src/components/Message.d.ts
|
|
9
9
|
var p = /* @__PURE__ */ function(e) {
|
|
10
10
|
return e.Error = "error", e.Warning = "warning", e.Success = "success", e.Helper = "helper", e;
|
|
@@ -27,8 +27,8 @@ var p = /* @__PURE__ */ function(e) {
|
|
|
27
27
|
setup(e) {
|
|
28
28
|
let a = e, p = {
|
|
29
29
|
error: u,
|
|
30
|
-
warning:
|
|
31
|
-
success:
|
|
30
|
+
warning: d,
|
|
31
|
+
success: f,
|
|
32
32
|
helper: l
|
|
33
33
|
};
|
|
34
34
|
return (e, l) => (s(), r("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),n=require(`./Icon-C8R_r_In.cjs`);let r=require(`vue`),i=require(`@nubisco/ui/icons/info`);i=e.n(i);let a=require(`@nubisco/ui/icons/warning-circle`);a=e.n(a);let o=require(`@nubisco/ui/icons/
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),n=require(`./Icon-C8R_r_In.cjs`);let r=require(`vue`),i=require(`@nubisco/ui/icons/info`);i=e.n(i);let a=require(`@nubisco/ui/icons/warning-circle`);a=e.n(a);let o=require(`@nubisco/ui/icons/warning`);o=e.n(o);let s=require(`@nubisco/ui/icons/check-circle`);s=e.n(s);var c=function(e){return e.Error=`error`,e.Warning=`warning`,e.Success=`success`,e.Helper=`helper`,e}(c||{}),l=[`aria-live`],u={key:0,class:`nb-message__text`},d={key:1,class:`nb-message__tooltip`,"aria-hidden":`true`},f=(0,r.defineComponent)({__name:`Message`,props:{variant:{default:c.Helper},iconOnly:{type:Boolean,default:!1}},setup(e){let t=e,c={error:a,warning:o,success:s,helper:i};return(e,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)([`nb-message`,`nb-message--${t.variant}`,{"nb-message--icon-only":t.iconOnly}]),role:`status`,"aria-live":t.variant===`error`?`assertive`:`polite`},[(0,r.createVNode)(n.t,{name:c[t.variant],size:14,class:`nb-message__icon`},null,8,[`name`]),t.iconOnly?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,u,[(0,r.renderSlot)(e.$slots,`default`,{},void 0,!0)])),t.iconOnly?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,d,[(0,r.renderSlot)(e.$slots,`default`,{},void 0,!0)])):(0,r.createCommentVNode)(``,!0)],10,l))}}),p=t.t(f,[[`__scopeId`,`data-v-3b1f8105`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|
|
@@ -3,7 +3,7 @@ import { r as t } from "./Size.d-Bah6vMl3.js";
|
|
|
3
3
|
import { t as n } from "./Icon-rREAqsu0.js";
|
|
4
4
|
import { useSurfaceLayer as r } from "./composables/useSurfaceLayer.composable.mjs";
|
|
5
5
|
import { t as i } from "./Button-IcCXOoCT.js";
|
|
6
|
-
import { t as a } from "./Grid-
|
|
6
|
+
import { t as a } from "./Grid-XtnH-vr_.js";
|
|
7
7
|
import { useVisualViewportVar as o } from "./composables/useVisualViewportVar.composable.mjs";
|
|
8
8
|
import { acquireScrollLock as s, releaseScrollLock as ee } from "./composables/useScrollLock.composable.mjs";
|
|
9
9
|
import { useFocusTrap as c } from "./composables/useFocusTrap.composable.mjs";
|