@atom8n/n8n-editor-ui 2.2.0
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/.stylelintcache +1 -0
- package/README.md +59 -0
- package/biome.jsonc +8 -0
- package/build.log +55 -0
- package/data/node-popularity.json +3998 -0
- package/dist/assets/AddDataTableModal-UINkk54_.js +1555 -0
- package/dist/assets/AgentEditorModal-CVww87TJ.js +358 -0
- package/dist/assets/Alert-Dy86dyOr.js +102 -0
- package/dist/assets/AnimatedSpinner-DmPN4poP.js +15 -0
- package/dist/assets/AnnotationTagsDropdown.ee-BJ7N9lek.js +71 -0
- package/dist/assets/AuthView-D2LWHrMp.js +106 -0
- package/dist/assets/BottomMenu-CIQiK_dJ.js +532 -0
- package/dist/assets/CalendarDate-DgQUMbNo.js +875 -0
- package/dist/assets/ChangePasswordView-Z6tUkw0u.js +133 -0
- package/dist/assets/ChatAgentAvatar-50YBnv3N.js +67 -0
- package/dist/assets/ChatFile-xZxmc2nV.js +146 -0
- package/dist/assets/ChatLayout-CTE_5SiM.js +96 -0
- package/dist/assets/ChatPersonalAgentsView-BGpHk03K.js +149 -0
- package/dist/assets/ChatSidebar-BkVwIypC.js +528 -0
- package/dist/assets/ChatView-BbbdeU9x.js +1559 -0
- package/dist/assets/ChatWorkflowAgentsView-BtunOxlC.js +116 -0
- package/dist/assets/CollectionParameter-BdcPG1lu.js +52 -0
- package/dist/assets/CommitMonoVariable-ytizKI8U.woff2 +0 -0
- package/dist/assets/CommunityNodeUpdateInfo-C37kca4W.js +273 -0
- package/dist/assets/CopyInput-DDZVu2iU.js +74 -0
- package/dist/assets/CredentialIcon-8YdTTFZ1.js +80 -0
- package/dist/assets/CredentialPicker-DWtj314o.js +293 -0
- package/dist/assets/CredentialSelectorModal-DTW2fKh0.js +138 -0
- package/dist/assets/CredentialsView-BjUchcCu.js +480 -0
- package/dist/assets/DataTableActions-DpAkoxg_.js +95 -0
- package/dist/assets/DataTableDetailsView-Coq7zdW5.js +41922 -0
- package/dist/assets/DataTableView-Cs-BIkzw.js +293 -0
- package/dist/assets/DemoFooter-Cga3jvi-.js +65 -0
- package/dist/assets/Draggable-vfvXl9Sp.js +105 -0
- package/dist/assets/EmptySharedSectionActionBox-DOXZtTCv.js +36 -0
- package/dist/assets/EnterpriseEdition.ee-D_rCFexM.js +15 -0
- package/dist/assets/EntityNotFound-3dhTRWsE.js +85 -0
- package/dist/assets/EntityUnAuthorised-ChJYZakE.js +66 -0
- package/dist/assets/ErrorView-zT9cX76a.js +61 -0
- package/dist/assets/EvaluationsRootView-C-OVWYnY.js +523 -0
- package/dist/assets/EvaluationsView-CJwJTruc.js +469 -0
- package/dist/assets/ExecutionsTime-DEQiyozR.js +573 -0
- package/dist/assets/ExecutionsView-Bd5Oh8TH.js +791 -0
- package/dist/assets/ExternalSecretsProviderConnectionSwitch.ee-C7Ih-uRo.js +191 -0
- package/dist/assets/FixedCollectionParameter-CYuTDW9t.js +496 -0
- package/dist/assets/ForgotMyPasswordView-Bs_L9P27.js +102 -0
- package/dist/assets/InsightsChartAverageRuntime-Bp3VA8_7.js +62 -0
- package/dist/assets/InsightsChartFailed-KPaNWoEr.js +52 -0
- package/dist/assets/InsightsChartFailureRate-DE6kE3FM.js +54 -0
- package/dist/assets/InsightsChartTimeSaved-auABNZlc.js +68 -0
- package/dist/assets/InsightsChartTotal-BKzYRKE7.js +56 -0
- package/dist/assets/InsightsDashboard-JWx4W6Db.js +473 -0
- package/dist/assets/InsightsPaywall-C8zLLKe8.js +63 -0
- package/dist/assets/InsightsSummary-cmN1lHDm.js +210 -0
- package/dist/assets/InsightsTableWorkflows-CqcC3IbQ.js +203 -0
- package/dist/assets/InterVariable-DiVDrmQJ.woff2 +0 -0
- package/dist/assets/InterVariable-Italic-FCBEiFp6.woff2 +0 -0
- package/dist/assets/ItemsRenderer-DC8WVyMv.js +922 -0
- package/dist/assets/KeyboardShortcutTooltip-D8PAK5JP.js +31 -0
- package/dist/assets/LogsPanel-BR06u9RK.js +52 -0
- package/dist/assets/LogsPanel-C-_acMHp.js +2325 -0
- package/dist/assets/MCPConnectWorkflowsModal-3g8_iUa4.js +303 -0
- package/dist/assets/MainHeader-DiQc1edn.js +2153 -0
- package/dist/assets/MainSidebar-CoPGG5Ea.js +804 -0
- package/dist/assets/MigrationRuleDetail-BAxk1Pvl.js +295 -0
- package/dist/assets/MigrationRules-IW9lZMpE.js +285 -0
- package/dist/assets/Modal-CIzXlZdZ.js +204 -0
- package/dist/assets/ModelByIdSelectorModal-DLvBjzJO.js +115 -0
- package/dist/assets/NDVEmptyState-33UoX00I.js +19743 -0
- package/dist/assets/NodeCreation-BNzbSWSB.js +240 -0
- package/dist/assets/NodeCreator-BftgCKx7.js +1288 -0
- package/dist/assets/NodeDetailsView-CsoQCpcF.js +1075 -0
- package/dist/assets/NodeDetailsViewV2-C_wNQR_3.js +981 -0
- package/dist/assets/NodeIcon-B9VW6tX6.js +87 -0
- package/dist/assets/NodeSettings-ZwVip6VR.js +1872 -0
- package/dist/assets/NodeView-D4WUEvLB.js +2452 -0
- package/dist/assets/OAuthConsentView-DlrUqZbT.js +230 -0
- package/dist/assets/PageViewLayout-NT1KPFgy.js +12 -0
- package/dist/assets/ParameterInputList-sG2nz-Jo.js +38091 -0
- package/dist/assets/PrebuiltAgentTemplatesView-Csi5U8dc.js +154 -0
- package/dist/assets/ProjectBreadcrumb-C_XiY7sc.js +98 -0
- package/dist/assets/ProjectCardBadge-t_hs7vzx.js +209 -0
- package/dist/assets/ProjectHeader-Dq5Ihb26.js +549 -0
- package/dist/assets/ProjectIcon-DY8gGuHX.js +64 -0
- package/dist/assets/ProjectRoleView-Du-KTrAC.js +435 -0
- package/dist/assets/ProjectRolesView-DjxM_y4u.js +239 -0
- package/dist/assets/ProjectSettings-C6kWuV21.js +966 -0
- package/dist/assets/ProjectSharing-CVUgNWAY.js +262 -0
- package/dist/assets/ProjectVariables-CJlAo3dv.js +467 -0
- package/dist/assets/ProviderSettingsModal-BUFC2ZLv.js +307 -0
- package/dist/assets/PushConnectionTracker-DPBnGV0v.js +27 -0
- package/dist/assets/ResolversView-3BdkvvYA.js +209 -0
- package/dist/assets/ResourceFiltersDropdown-dgyXpcEX.js +159 -0
- package/dist/assets/ResourcesListLayout-qBLtomK6.js +631 -0
- package/dist/assets/RunDataHtml-BrW0OQra.js +7 -0
- package/dist/assets/RunDataHtml-Cleia4Cj.js +40 -0
- package/dist/assets/RunDataJson-uxkrhYRK.js +227 -0
- package/dist/assets/RunDataJsonActions-DkPk7E8d.js +5007 -0
- package/dist/assets/RunDataParsedAiContent-CtPRjig-.js +26 -0
- package/dist/assets/RunDataParsedAiContent-WAuqLQ5M.js +192 -0
- package/dist/assets/RunDataSearch-YBWUr93C.js +141 -0
- package/dist/assets/RunDataTable-DcXaBynW.js +631 -0
- package/dist/assets/SamlOnboarding-BTdQ_hr3.js +78 -0
- package/dist/assets/SaveButton-D5sQSxIk.js +89 -0
- package/dist/assets/SelectedItemsInfo-BHZ-NvF5.js +58 -0
- package/dist/assets/SettingsApiView-IfZTMXx1.js +313 -0
- package/dist/assets/SettingsChatHubView-gWh2X6vX.js +285 -0
- package/dist/assets/SettingsCommunityNodesView-D8VQtpGY.js +349 -0
- package/dist/assets/SettingsExternalSecrets-CpMc7mkW.js +233 -0
- package/dist/assets/SettingsLdapView-CU5a2MAy.js +2553 -0
- package/dist/assets/SettingsLogStreamingView-uojTe-oX.js +375 -0
- package/dist/assets/SettingsMCPView-B5Swp1C_.js +1214 -0
- package/dist/assets/SettingsPersonalView-Cr3aGood.js +402 -0
- package/dist/assets/SettingsSourceControl-DXOvFDEY.js +547 -0
- package/dist/assets/SettingsSso-27MfU1HV.js +1032 -0
- package/dist/assets/SettingsUsageAndPlan-DqIO-G46.js +419 -0
- package/dist/assets/SettingsUsersView-DfHB4_Kh.js +833 -0
- package/dist/assets/SettingsView-C4sA7Uny.js +90 -0
- package/dist/assets/SetupTemplateFormStep-BmiSzZin.js +258 -0
- package/dist/assets/SetupView-VORZ-L_u.js +112 -0
- package/dist/assets/SetupWorkflowCredentialsButton-DTmkOAW5.js +73 -0
- package/dist/assets/SetupWorkflowFromTemplateView-B9NupdJE.js +286 -0
- package/dist/assets/SeverityTag-CX1qTTNA.js +45 -0
- package/dist/assets/SigninView-D9_Pm16j.js +358 -0
- package/dist/assets/SignoutView-BFsjEAGz.js +19 -0
- package/dist/assets/SignupView-Am4ot0QZ.js +137 -0
- package/dist/assets/SkeletonAgentCard-C5TL-h8F.js +191 -0
- package/dist/assets/TagsDropdown-Bvx_Hd6Q.js +230 -0
- package/dist/assets/TemplateCard-CyQ1GuVz.js +105 -0
- package/dist/assets/TemplateDetails-CZRusTxE.js +124 -0
- package/dist/assets/TemplateList-DKvbwuiY.js +333 -0
- package/dist/assets/TemplatesCollectionView-D8dxU8By.js +184 -0
- package/dist/assets/TemplatesSearchView-CebC_GLs.js +1230 -0
- package/dist/assets/TemplatesView-025CcmIY.js +57 -0
- package/dist/assets/TemplatesWorkflowView-C2JfwJAn.js +170 -0
- package/dist/assets/TestRunDetailView-Ck78TTWO.js +395 -0
- package/dist/assets/TextWithHighlights-BxumwGnv.js +57 -0
- package/dist/assets/TimeAgo-C6EN4lCs.js +123 -0
- package/dist/assets/ToolsSelectorModal-8QJoUvRL.js +368 -0
- package/dist/assets/TriggerPanel-B6pacLkk.js +1225 -0
- package/dist/assets/VirtualSchema-B3zGe_8b.js +2402 -0
- package/dist/assets/VirtualSchema-Dkh0Cu5z.js +37 -0
- package/dist/assets/VueMarkdown-CQqJL9vK.js +28 -0
- package/dist/assets/WorkerView-Caznsljo.js +563 -0
- package/dist/assets/WorkflowActivationErrorMessage-CGrfPi9O.js +17 -0
- package/dist/assets/WorkflowActivator-BINnz0f7.js +362 -0
- package/dist/assets/WorkflowExecutionsInfoAccordion-Dg37yEfT.js +166 -0
- package/dist/assets/WorkflowExecutionsLandingPage-V2wdubhK.js +93 -0
- package/dist/assets/WorkflowExecutionsPreview-DdJaqYV6.js +616 -0
- package/dist/assets/WorkflowExecutionsView-DV8ySTfn.js +808 -0
- package/dist/assets/WorkflowHistory-GtaBMzIM.js +973 -0
- package/dist/assets/WorkflowLocation-CQ9Sq-2y.js +164 -0
- package/dist/assets/WorkflowOnboardingView-C49gt0Jr.js +61 -0
- package/dist/assets/WorkflowPreview-CXdvv4Nq.js +186 -0
- package/dist/assets/WorkflowTagsDropdown-QwbICWjN.js +71 -0
- package/dist/assets/WorkflowsView-B-MWIECO.js +3253 -0
- package/dist/assets/_MapCache-CcdIl4Ae.js +363 -0
- package/dist/assets/_baseOrderBy-N8Be_6z6.js +2989 -0
- package/dist/assets/_initCloneObject-viQQyT6o.js +80 -0
- package/dist/assets/_plugin-vue_export-helper-BwBpWJRZ.js +6 -0
- package/dist/assets/aiTemplatesStarterCollection.store-nL9nePkK.js +656 -0
- package/dist/assets/apiKeys.store-BhOFmP2j.js +51 -0
- package/dist/assets/assistant.store-CNywgN4S.js +518 -0
- package/dist/assets/auth.eventBus-CWXS0Qp7.js +5 -0
- package/dist/assets/banners.store-CGEcBTDn.js +195 -0
- package/dist/assets/builder.store-Czk2ipDE.js +31417 -0
- package/dist/assets/buttons.esm-yintpW2E.js +364 -0
- package/dist/assets/chart-CNvyywtJ.js +10958 -0
- package/dist/assets/chartjs.utils-BAE52Cv9.js +155 -0
- package/dist/assets/chat.store-290YeyrQ.js +865 -0
- package/dist/assets/chatPanel.store-NDaawEZL.js +118 -0
- package/dist/assets/chunk-6z4oVpB-.js +36 -0
- package/dist/assets/col-Cmt4cmuS.js +158 -0
- package/dist/assets/constants-C8OH4tTq.js +106256 -0
- package/dist/assets/constants-DMrsrpD7.js +32 -0
- package/dist/assets/core-B9gt_4yk.js +4 -0
- package/dist/assets/core-CP5FY4aX.js +1202 -0
- package/dist/assets/core-CRbPymLT.js +9741 -0
- package/dist/assets/dataTable.store-DmipQsol.js +207 -0
- package/dist/assets/date-picker-2IDsBs2n.js +4115 -0
- package/dist/assets/dateFormatter-ik4-9_9r.js +33 -0
- package/dist/assets/dateformat-hG8NERse.js +181 -0
- package/dist/assets/dialog-lMho1TD8.js +425 -0
- package/dist/assets/dist-Cw46Is-h.js +151 -0
- package/dist/assets/doppler-B__k0MeW.webp +0 -0
- package/dist/assets/element-icons-B-tDfklg.woff +0 -0
- package/dist/assets/element-icons-_lZGOqcG.ttf +0 -0
- package/dist/assets/empty-BuGRxzl4.js +2210 -0
- package/dist/assets/en-CF30SCh2.js +95 -0
- package/dist/assets/en-DyO2pPiC.js +2 -0
- package/dist/assets/es-BkUFJVtD.js +43338 -0
- package/dist/assets/evaluation.constants-GYAwmJnh.js +284 -0
- package/dist/assets/executions.store-B9uRYwgv.js +205 -0
- package/dist/assets/exports-Crx_gvt_.js +1799 -0
- package/dist/assets/externalSecrets.ee.store-BJh4a_6G.js +118 -0
- package/dist/assets/fileUtils-CRWqOQje.js +20 -0
- package/dist/assets/folders.store-yAFj-5Vl.js +235 -0
- package/dist/assets/get-BcEmeOxn.js +2781 -0
- package/dist/assets/index-SL8542zQ.js +28372 -0
- package/dist/assets/insights.constants-BkJCYJTL.js +55 -0
- package/dist/assets/insights.store-BFc3kDUo.js +61 -0
- package/dist/assets/insights.utils-CcLXdrrz.js +77 -0
- package/dist/assets/isEmpty-C3XXoHqJ.js +35216 -0
- package/dist/assets/languageModules-9LyndCqU.js +13862 -0
- package/dist/assets/logStreaming.store-IZhWe_VK.js +190 -0
- package/dist/assets/mcp.constants-_Jcn7fPq.js +10 -0
- package/dist/assets/mcp.store-B9yfcAN9.js +116 -0
- package/dist/assets/merge-DhuTk1HM.js +564 -0
- package/dist/assets/nodeCreator.store-Bpnrwp2l.js +5444 -0
- package/dist/assets/nodeIcon-D6X-ENYt.js +102 -0
- package/dist/assets/nodeTransforms-RzcOM0v2.js +42 -0
- package/dist/assets/orderBy-Cu9F9DU_.js +15 -0
- package/dist/assets/path-browserify-RUt2u7iT.js +328 -0
- package/dist/assets/personalizedTemplatesV3.store-BGYp0YBN.js +334 -0
- package/dist/assets/pickBy-UI0Jt4wC.js +18 -0
- package/dist/assets/preload-helper-dyVz7ck7.js +59 -0
- package/dist/assets/radio-CSce3UT0.js +262 -0
- package/dist/assets/readyToRun.store-YEMvPUqo.js +626 -0
- package/dist/assets/readyToRunWorkflows.store-G3srgIze.js +1319 -0
- package/dist/assets/retry-BgHaYzbB.js +23 -0
- package/dist/assets/roles.store-CRf_zJTb.js +51 -0
- package/dist/assets/router-DNpzz3GH.js +2631 -0
- package/dist/assets/sanitize-html-CbW56HUN.js +10758 -0
- package/dist/assets/schemaPreview.store-DUgN1yVE.js +113 -0
- package/dist/assets/semver-Bk6DGseV.js +1306 -0
- package/dist/assets/smartDecimal-DAZl4HKA.js +6 -0
- package/dist/assets/sortByProperty-Cn7iGKYu.js +8 -0
- package/dist/assets/sourceControl.eventBus-D47xXSc_.js +3 -0
- package/dist/assets/sqlite3-DBpDb1lf.wasm +0 -0
- package/dist/assets/sqlite3-opfs-async-proxy-vVtmDGHX.js +461 -0
- package/dist/assets/sqlite3-worker1-bundler-friendly-DLarOZDL.js +9405 -0
- package/dist/assets/src-jviYSG25.js +55454 -0
- package/dist/assets/sso.store-DyApJwhx.js +139 -0
- package/dist/assets/style-E3CrYFV8.css +111829 -0
- package/dist/assets/table-we1DjFMV.js +3944 -0
- package/dist/assets/templateActions-bEDSARw2.js +65 -0
- package/dist/assets/templateTransforms-BHWiRbtR.js +43 -0
- package/dist/assets/truncate-C0KYt7i3.js +4176 -0
- package/dist/assets/typescript.worker-CYqLvLHh.js +152048 -0
- package/dist/assets/uniqBy-xDyuCRP0.js +10 -0
- package/dist/assets/usage.store-CU5J_nGm.js +100 -0
- package/dist/assets/useActions-B1JckIRj.js +255 -0
- package/dist/assets/useBeforeUnload-DiDkvI8p.js +40 -0
- package/dist/assets/useCanvasMapping-BXT7rGhC.js +12570 -0
- package/dist/assets/useCanvasOperations-8ULLtMkY.js +1765 -0
- package/dist/assets/useClipboard-DvjhVHqJ.js +39 -0
- package/dist/assets/useCommandBar-C4tLJbKt.js +2425 -0
- package/dist/assets/useCredentialResolvers-BKeFGJnY.js +78 -0
- package/dist/assets/useCustomAgent-DpILEt5e.js +471 -0
- package/dist/assets/useDebounce-Br5_1ug-.js +147 -0
- package/dist/assets/useExecutionData-M5iKsX6z.js +23 -0
- package/dist/assets/useExecutionDebugging-8azMzbnd.js +191 -0
- package/dist/assets/useExecutionHelpers-BgRRhpBM.js +91 -0
- package/dist/assets/useImportCurlCommand-CKiEmX5P.js +8891 -0
- package/dist/assets/useIntersectionObserver-BWMwOueh.js +33 -0
- package/dist/assets/useKeybindings-B2jfN6rd.js +62 -0
- package/dist/assets/useLogsTreeExpand-sZViUfdM.js +843 -0
- package/dist/assets/useMcp-DoMOIfqT.js +27 -0
- package/dist/assets/usePageRedirectionHelper-DjkznpX6.js +51 -0
- package/dist/assets/usePinnedData-BhZkqttf.js +203 -0
- package/dist/assets/usePushConnection-DMS-F_IW.js +513 -0
- package/dist/assets/useRecentResources-BVORr7eM.js +118 -0
- package/dist/assets/useRunWorkflow-LO7ffLp9.js +950 -0
- package/dist/assets/useSettingsItems-BhZXwMZn.js +144 -0
- package/dist/assets/useTelemetryContext-V6bv4YRq.js +34 -0
- package/dist/assets/useWorkflowActivate-DeSmDXjI.js +152 -0
- package/dist/assets/useWorkflowsCache-DtcEEAIR.js +179 -0
- package/dist/assets/userRoleProvisioning.store-kkSIdeTo.js +33 -0
- package/dist/assets/utils-DI7dLldp.js +54 -0
- package/dist/assets/versions.store-B1z2OrLE.js +191 -0
- package/dist/assets/vue-CydWIhxN.js +4378 -0
- package/dist/assets/vue-json-pretty-CsGX66mG.js +1130 -0
- package/dist/assets/vue.runtime.esm-bundler-tP5dCd7J.js +7325 -0
- package/dist/assets/xml-B_oj6Mle.js +2060 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.html +157 -0
- package/dist/static/base-path.js +1 -0
- package/dist/static/community_package_tooltip_img.png +0 -0
- package/dist/static/data-mapping-gif.gif +0 -0
- package/dist/static/form-grey.svg +1 -0
- package/dist/static/google-auth/disabled.dark.png +0 -0
- package/dist/static/google-auth/disabled.png +0 -0
- package/dist/static/google-auth/focus.dark.png +0 -0
- package/dist/static/google-auth/focus.png +0 -0
- package/dist/static/google-auth/normal.dark.png +0 -0
- package/dist/static/google-auth/normal.png +0 -0
- package/dist/static/google-auth/pressed.dark.png +0 -0
- package/dist/static/google-auth/pressed.png +0 -0
- package/dist/static/n8n-logo.png +0 -0
- package/dist/static/og_image.png +0 -0
- package/dist/static/open-ai.svg +1 -0
- package/dist/static/openChat.png +0 -0
- package/dist/static/posthog.init.js +41 -0
- package/dist/static/prefers-color-scheme.css +5 -0
- package/dist/static/webhook-icon.svg +1 -0
- package/dist/tree-sitter-bash.wasm +0 -0
- package/dist/tree-sitter.wasm +0 -0
- package/eslint.config.mjs +59 -0
- package/index.html +45 -0
- package/index.js +0 -0
- package/package.json +147 -0
- package/postcss.config.cjs +6 -0
- package/scripts/fetch-node-popularity.mjs +102 -0
- package/stylelint.config.mjs +9 -0
- package/tailwind.config.js +8 -0
- package/tsconfig.json +36 -0
- package/vite/i18n-locales-hmr-helpers.ts +19 -0
- package/vite/source-map-js-shim.ts +1 -0
- package/vite/vite-plugin-node-popularity.mts +32 -0
- package/vite.config.mts +304 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { o as __toESM } from "./chunk-6z4oVpB-.js";
|
|
2
|
+
import { et as i18n } from "./core-CRbPymLT.js";
|
|
3
|
+
import { t as require_dateformat } from "./dateformat-hG8NERse.js";
|
|
4
|
+
var import_dateformat = /* @__PURE__ */ __toESM(require_dateformat());
|
|
5
|
+
const convertToDisplayDateComponents = (fullDate) => {
|
|
6
|
+
const [date, time] = (0, import_dateformat.default)(fullDate, `d mmm${new Date(fullDate).getFullYear() === (/* @__PURE__ */ new Date()).getFullYear() ? "" : ", yyyy"}#HH:MM:ss`).split("#");
|
|
7
|
+
return {
|
|
8
|
+
date,
|
|
9
|
+
time
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
function convertToDisplayDate(fullDate) {
|
|
13
|
+
const [date, time] = (0, import_dateformat.default)(fullDate, `mmm d${new Date(fullDate).getFullYear() === (/* @__PURE__ */ new Date()).getFullYear() ? "" : ", yyyy"}#HH:MM:ss`).split("#");
|
|
14
|
+
return {
|
|
15
|
+
date,
|
|
16
|
+
time
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const toDayMonth = (fullDate) => (0, import_dateformat.default)(fullDate, "d mmm");
|
|
20
|
+
const toTime = (fullDate, includeMillis = false) => (0, import_dateformat.default)(fullDate, includeMillis ? "HH:MM:ss.l" : "HH:MM:ss");
|
|
21
|
+
const formatTimeAgo = (fullDate) => {
|
|
22
|
+
const now = /* @__PURE__ */ new Date();
|
|
23
|
+
const date = new Date(fullDate);
|
|
24
|
+
const diffInMs = now.getTime() - date.getTime();
|
|
25
|
+
const diffInDays = Math.floor(diffInMs / (1e3 * 60 * 60 * 24));
|
|
26
|
+
if (diffInDays === 0) return i18n.baseText("userActivity.today");
|
|
27
|
+
else if (diffInDays === 1) return i18n.baseText("userActivity.yesterday");
|
|
28
|
+
else if (diffInDays >= 2 && diffInDays <= 6) return (0, import_dateformat.default)(date, "dddd");
|
|
29
|
+
else if (diffInDays >= 7 && diffInDays <= 13) return i18n.baseText("userActivity.lastTime", { interpolate: { time: (0, import_dateformat.default)(date, "dddd") } });
|
|
30
|
+
else if (diffInDays >= 14 && diffInDays <= 30) return i18n.baseText("userActivity.daysAgo", { interpolate: { count: diffInDays.toString() } });
|
|
31
|
+
else return (0, import_dateformat.default)(date, "mmmm d, yyyy");
|
|
32
|
+
};
|
|
33
|
+
export { toTime as a, toDayMonth as i, convertToDisplayDateComponents as n, formatTimeAgo as r, convertToDisplayDate as t };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { t as __commonJSMin } from "./chunk-6z4oVpB-.js";
|
|
2
|
+
var require_dateformat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3
|
+
(function(global) {
|
|
4
|
+
var dateFormat = (function() {
|
|
5
|
+
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|"[^"]*"|'[^']*'/g;
|
|
6
|
+
var timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g;
|
|
7
|
+
var timezoneClip = /[^-+\dA-Z]/g;
|
|
8
|
+
return function(date, mask, utc, gmt) {
|
|
9
|
+
if (arguments.length === 1 && kindOf(date) === "string" && !/\d/.test(date)) {
|
|
10
|
+
mask = date;
|
|
11
|
+
date = void 0;
|
|
12
|
+
}
|
|
13
|
+
date = date || /* @__PURE__ */ new Date();
|
|
14
|
+
if (!(date instanceof Date)) date = new Date(date);
|
|
15
|
+
if (isNaN(date)) throw TypeError("Invalid date");
|
|
16
|
+
mask = String(dateFormat.masks[mask] || mask || dateFormat.masks["default"]);
|
|
17
|
+
var maskSlice = mask.slice(0, 4);
|
|
18
|
+
if (maskSlice === "UTC:" || maskSlice === "GMT:") {
|
|
19
|
+
mask = mask.slice(4);
|
|
20
|
+
utc = true;
|
|
21
|
+
if (maskSlice === "GMT:") gmt = true;
|
|
22
|
+
}
|
|
23
|
+
var _ = utc ? "getUTC" : "get";
|
|
24
|
+
var d = date[_ + "Date"]();
|
|
25
|
+
var D = date[_ + "Day"]();
|
|
26
|
+
var m = date[_ + "Month"]();
|
|
27
|
+
var y = date[_ + "FullYear"]();
|
|
28
|
+
var H = date[_ + "Hours"]();
|
|
29
|
+
var M = date[_ + "Minutes"]();
|
|
30
|
+
var s = date[_ + "Seconds"]();
|
|
31
|
+
var L = date[_ + "Milliseconds"]();
|
|
32
|
+
var o = utc ? 0 : date.getTimezoneOffset();
|
|
33
|
+
var W = getWeek(date);
|
|
34
|
+
var N = getDayOfWeek(date);
|
|
35
|
+
var flags = {
|
|
36
|
+
d,
|
|
37
|
+
dd: pad(d),
|
|
38
|
+
ddd: dateFormat.i18n.dayNames[D],
|
|
39
|
+
dddd: dateFormat.i18n.dayNames[D + 7],
|
|
40
|
+
m: m + 1,
|
|
41
|
+
mm: pad(m + 1),
|
|
42
|
+
mmm: dateFormat.i18n.monthNames[m],
|
|
43
|
+
mmmm: dateFormat.i18n.monthNames[m + 12],
|
|
44
|
+
yy: String(y).slice(2),
|
|
45
|
+
yyyy: y,
|
|
46
|
+
h: H % 12 || 12,
|
|
47
|
+
hh: pad(H % 12 || 12),
|
|
48
|
+
H,
|
|
49
|
+
HH: pad(H),
|
|
50
|
+
M,
|
|
51
|
+
MM: pad(M),
|
|
52
|
+
s,
|
|
53
|
+
ss: pad(s),
|
|
54
|
+
l: pad(L, 3),
|
|
55
|
+
L: pad(Math.round(L / 10)),
|
|
56
|
+
t: H < 12 ? dateFormat.i18n.timeNames[0] : dateFormat.i18n.timeNames[1],
|
|
57
|
+
tt: H < 12 ? dateFormat.i18n.timeNames[2] : dateFormat.i18n.timeNames[3],
|
|
58
|
+
T: H < 12 ? dateFormat.i18n.timeNames[4] : dateFormat.i18n.timeNames[5],
|
|
59
|
+
TT: H < 12 ? dateFormat.i18n.timeNames[6] : dateFormat.i18n.timeNames[7],
|
|
60
|
+
Z: gmt ? "GMT" : utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
|
|
61
|
+
o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
|
|
62
|
+
S: [
|
|
63
|
+
"th",
|
|
64
|
+
"st",
|
|
65
|
+
"nd",
|
|
66
|
+
"rd"
|
|
67
|
+
][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10],
|
|
68
|
+
W,
|
|
69
|
+
N
|
|
70
|
+
};
|
|
71
|
+
return mask.replace(token, function(match) {
|
|
72
|
+
if (match in flags) return flags[match];
|
|
73
|
+
return match.slice(1, match.length - 1);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
})();
|
|
77
|
+
dateFormat.masks = {
|
|
78
|
+
"default": "ddd mmm dd yyyy HH:MM:ss",
|
|
79
|
+
"shortDate": "m/d/yy",
|
|
80
|
+
"mediumDate": "mmm d, yyyy",
|
|
81
|
+
"longDate": "mmmm d, yyyy",
|
|
82
|
+
"fullDate": "dddd, mmmm d, yyyy",
|
|
83
|
+
"shortTime": "h:MM TT",
|
|
84
|
+
"mediumTime": "h:MM:ss TT",
|
|
85
|
+
"longTime": "h:MM:ss TT Z",
|
|
86
|
+
"isoDate": "yyyy-mm-dd",
|
|
87
|
+
"isoTime": "HH:MM:ss",
|
|
88
|
+
"isoDateTime": "yyyy-mm-dd'T'HH:MM:sso",
|
|
89
|
+
"isoUtcDateTime": "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",
|
|
90
|
+
"expiresHeaderFormat": "ddd, dd mmm yyyy HH:MM:ss Z"
|
|
91
|
+
};
|
|
92
|
+
dateFormat.i18n = {
|
|
93
|
+
dayNames: [
|
|
94
|
+
"Sun",
|
|
95
|
+
"Mon",
|
|
96
|
+
"Tue",
|
|
97
|
+
"Wed",
|
|
98
|
+
"Thu",
|
|
99
|
+
"Fri",
|
|
100
|
+
"Sat",
|
|
101
|
+
"Sunday",
|
|
102
|
+
"Monday",
|
|
103
|
+
"Tuesday",
|
|
104
|
+
"Wednesday",
|
|
105
|
+
"Thursday",
|
|
106
|
+
"Friday",
|
|
107
|
+
"Saturday"
|
|
108
|
+
],
|
|
109
|
+
monthNames: [
|
|
110
|
+
"Jan",
|
|
111
|
+
"Feb",
|
|
112
|
+
"Mar",
|
|
113
|
+
"Apr",
|
|
114
|
+
"May",
|
|
115
|
+
"Jun",
|
|
116
|
+
"Jul",
|
|
117
|
+
"Aug",
|
|
118
|
+
"Sep",
|
|
119
|
+
"Oct",
|
|
120
|
+
"Nov",
|
|
121
|
+
"Dec",
|
|
122
|
+
"January",
|
|
123
|
+
"February",
|
|
124
|
+
"March",
|
|
125
|
+
"April",
|
|
126
|
+
"May",
|
|
127
|
+
"June",
|
|
128
|
+
"July",
|
|
129
|
+
"August",
|
|
130
|
+
"September",
|
|
131
|
+
"October",
|
|
132
|
+
"November",
|
|
133
|
+
"December"
|
|
134
|
+
],
|
|
135
|
+
timeNames: [
|
|
136
|
+
"a",
|
|
137
|
+
"p",
|
|
138
|
+
"am",
|
|
139
|
+
"pm",
|
|
140
|
+
"A",
|
|
141
|
+
"P",
|
|
142
|
+
"AM",
|
|
143
|
+
"PM"
|
|
144
|
+
]
|
|
145
|
+
};
|
|
146
|
+
function pad(val, len) {
|
|
147
|
+
val = String(val);
|
|
148
|
+
len = len || 2;
|
|
149
|
+
while (val.length < len) val = "0" + val;
|
|
150
|
+
return val;
|
|
151
|
+
}
|
|
152
|
+
function getWeek(date) {
|
|
153
|
+
var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
154
|
+
targetThursday.setDate(targetThursday.getDate() - (targetThursday.getDay() + 6) % 7 + 3);
|
|
155
|
+
var firstThursday = new Date(targetThursday.getFullYear(), 0, 4);
|
|
156
|
+
firstThursday.setDate(firstThursday.getDate() - (firstThursday.getDay() + 6) % 7 + 3);
|
|
157
|
+
var ds = targetThursday.getTimezoneOffset() - firstThursday.getTimezoneOffset();
|
|
158
|
+
targetThursday.setHours(targetThursday.getHours() - ds);
|
|
159
|
+
var weekDiff = (targetThursday - firstThursday) / (864e5 * 7);
|
|
160
|
+
return 1 + Math.floor(weekDiff);
|
|
161
|
+
}
|
|
162
|
+
function getDayOfWeek(date) {
|
|
163
|
+
var dow = date.getDay();
|
|
164
|
+
if (dow === 0) dow = 7;
|
|
165
|
+
return dow;
|
|
166
|
+
}
|
|
167
|
+
function kindOf(val) {
|
|
168
|
+
if (val === null) return "null";
|
|
169
|
+
if (val === void 0) return "undefined";
|
|
170
|
+
if (typeof val !== "object") return typeof val;
|
|
171
|
+
if (Array.isArray(val)) return "array";
|
|
172
|
+
return {}.toString.call(val).slice(8, -1).toLowerCase();
|
|
173
|
+
}
|
|
174
|
+
if (typeof define === "function" && define.amd) define(function() {
|
|
175
|
+
return dateFormat;
|
|
176
|
+
});
|
|
177
|
+
else if (typeof exports === "object") module.exports = dateFormat;
|
|
178
|
+
else global.dateFormat = dateFormat;
|
|
179
|
+
})(exports);
|
|
180
|
+
}));
|
|
181
|
+
export { require_dateformat as t };
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import { C as computed, Cn as toDisplayString, D as createElementBlock, E as createCommentVNode, F as getCurrentInstance, G as nextTick, Gt as unref, It as ref, M as createVNode, P as defineComponent, T as createBlock, W as mergeProps, Z as onMounted, _t as watch, at as renderSlot, b as Teleport, bn as normalizeStyle, bt as withCtx, ct as resolveDynamicComponent, et as openBlock, k as createSlots, n as Transition, nt as provide, p as vShow, pt as useSlots, vn as normalizeClass, w as createBaseVNode, xt as withDirectives, z as inject } from "./vue.runtime.esm-bundler-tP5dCd7J.js";
|
|
2
|
+
import { Gt as composeRefs, Kt as isUndefined_default } from "./src-jviYSG25.js";
|
|
3
|
+
import { $ as buildProps, A as useLocale, D as defaultNamespace, Dn as useTimeoutFn, Et as addUnit, It as isBoolean, T as useId, V as UPDATE_MODEL_EVENT, W as withInstall, Z as iconPropType, d as FOCUS_TRAP_INJECTION_KEY, et as definePropType, j as useDeprecated, k as useNamespace, q as CloseComponents, u as ElFocusTrap, v as ElIcon, w as useZIndex, wn as isClient, x as useGlobalConfig, y as _export_sfc } from "./truncate-C0KYt7i3.js";
|
|
4
|
+
import { Ac as useSameTarget, Mc as useDraggable, jc as useLockscreen, kc as ElOverlay } from "./builder.store-Czk2ipDE.js";
|
|
5
|
+
var dialogInjectionKey = Symbol("dialogInjectionKey");
|
|
6
|
+
var dialogContentProps = buildProps({
|
|
7
|
+
center: Boolean,
|
|
8
|
+
alignCenter: Boolean,
|
|
9
|
+
closeIcon: { type: iconPropType },
|
|
10
|
+
customClass: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
draggable: Boolean,
|
|
15
|
+
fullscreen: Boolean,
|
|
16
|
+
showClose: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: true
|
|
19
|
+
},
|
|
20
|
+
title: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: ""
|
|
23
|
+
},
|
|
24
|
+
ariaLevel: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "2"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
var dialogContentEmits = { close: () => true };
|
|
30
|
+
var _hoisted_1$1 = ["aria-level"];
|
|
31
|
+
var _hoisted_2 = ["aria-label"];
|
|
32
|
+
var _hoisted_3 = ["id"];
|
|
33
|
+
var ElDialogContent = /* @__PURE__ */ _export_sfc(/* @__PURE__ */ defineComponent({
|
|
34
|
+
...defineComponent({ name: "ElDialogContent" }),
|
|
35
|
+
props: dialogContentProps,
|
|
36
|
+
emits: dialogContentEmits,
|
|
37
|
+
setup(__props) {
|
|
38
|
+
const props = __props;
|
|
39
|
+
const { t } = useLocale();
|
|
40
|
+
const { Close } = CloseComponents;
|
|
41
|
+
const { dialogRef, headerRef, bodyId, ns, style } = inject(dialogInjectionKey);
|
|
42
|
+
const { focusTrapRef } = inject(FOCUS_TRAP_INJECTION_KEY);
|
|
43
|
+
const dialogKls = computed(() => [
|
|
44
|
+
ns.b(),
|
|
45
|
+
ns.is("fullscreen", props.fullscreen),
|
|
46
|
+
ns.is("draggable", props.draggable),
|
|
47
|
+
ns.is("align-center", props.alignCenter),
|
|
48
|
+
{ [ns.m("center")]: props.center },
|
|
49
|
+
props.customClass
|
|
50
|
+
]);
|
|
51
|
+
const composedDialogRef = composeRefs(focusTrapRef, dialogRef);
|
|
52
|
+
useDraggable(dialogRef, headerRef, computed(() => props.draggable));
|
|
53
|
+
return (_ctx, _cache) => {
|
|
54
|
+
return openBlock(), createElementBlock("div", {
|
|
55
|
+
ref: unref(composedDialogRef),
|
|
56
|
+
class: normalizeClass(unref(dialogKls)),
|
|
57
|
+
style: normalizeStyle(unref(style)),
|
|
58
|
+
tabindex: "-1"
|
|
59
|
+
}, [
|
|
60
|
+
createBaseVNode("header", {
|
|
61
|
+
ref_key: "headerRef",
|
|
62
|
+
ref: headerRef,
|
|
63
|
+
class: normalizeClass(unref(ns).e("header"))
|
|
64
|
+
}, [renderSlot(_ctx.$slots, "header", {}, () => [createBaseVNode("span", {
|
|
65
|
+
role: "heading",
|
|
66
|
+
"aria-level": _ctx.ariaLevel,
|
|
67
|
+
class: normalizeClass(unref(ns).e("title"))
|
|
68
|
+
}, toDisplayString(_ctx.title), 11, _hoisted_1$1)]), _ctx.showClose ? (openBlock(), createElementBlock("button", {
|
|
69
|
+
key: 0,
|
|
70
|
+
"aria-label": unref(t)("el.dialog.close"),
|
|
71
|
+
class: normalizeClass(unref(ns).e("headerbtn")),
|
|
72
|
+
type: "button",
|
|
73
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
|
|
74
|
+
}, [createVNode(unref(ElIcon), { class: normalizeClass(unref(ns).e("close")) }, {
|
|
75
|
+
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon || unref(Close))))]),
|
|
76
|
+
_: 1
|
|
77
|
+
}, 8, ["class"])], 10, _hoisted_2)) : createCommentVNode("v-if", true)], 2),
|
|
78
|
+
createBaseVNode("div", {
|
|
79
|
+
id: unref(bodyId),
|
|
80
|
+
class: normalizeClass(unref(ns).e("body"))
|
|
81
|
+
}, [renderSlot(_ctx.$slots, "default")], 10, _hoisted_3),
|
|
82
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("footer", {
|
|
83
|
+
key: 0,
|
|
84
|
+
class: normalizeClass(unref(ns).e("footer"))
|
|
85
|
+
}, [renderSlot(_ctx.$slots, "footer")], 2)) : createCommentVNode("v-if", true)
|
|
86
|
+
], 6);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}), [["__file", "/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog-content.vue"]]);
|
|
90
|
+
var dialogProps = buildProps({
|
|
91
|
+
...dialogContentProps,
|
|
92
|
+
appendToBody: Boolean,
|
|
93
|
+
appendTo: {
|
|
94
|
+
type: definePropType(String),
|
|
95
|
+
default: "body"
|
|
96
|
+
},
|
|
97
|
+
beforeClose: { type: definePropType(Function) },
|
|
98
|
+
destroyOnClose: Boolean,
|
|
99
|
+
closeOnClickModal: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: true
|
|
102
|
+
},
|
|
103
|
+
closeOnPressEscape: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: true
|
|
106
|
+
},
|
|
107
|
+
lockScroll: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: true
|
|
110
|
+
},
|
|
111
|
+
modal: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: true
|
|
114
|
+
},
|
|
115
|
+
openDelay: {
|
|
116
|
+
type: Number,
|
|
117
|
+
default: 0
|
|
118
|
+
},
|
|
119
|
+
closeDelay: {
|
|
120
|
+
type: Number,
|
|
121
|
+
default: 0
|
|
122
|
+
},
|
|
123
|
+
top: { type: String },
|
|
124
|
+
modelValue: Boolean,
|
|
125
|
+
modalClass: String,
|
|
126
|
+
width: { type: [String, Number] },
|
|
127
|
+
zIndex: { type: Number },
|
|
128
|
+
trapFocus: {
|
|
129
|
+
type: Boolean,
|
|
130
|
+
default: false
|
|
131
|
+
},
|
|
132
|
+
headerAriaLevel: {
|
|
133
|
+
type: String,
|
|
134
|
+
default: "2"
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
var dialogEmits = {
|
|
138
|
+
open: () => true,
|
|
139
|
+
opened: () => true,
|
|
140
|
+
close: () => true,
|
|
141
|
+
closed: () => true,
|
|
142
|
+
[UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
|
|
143
|
+
openAutoFocus: () => true,
|
|
144
|
+
closeAutoFocus: () => true
|
|
145
|
+
};
|
|
146
|
+
var useDialog = (props, targetRef) => {
|
|
147
|
+
var _a;
|
|
148
|
+
const emit = getCurrentInstance().emit;
|
|
149
|
+
const { nextZIndex } = useZIndex();
|
|
150
|
+
let lastPosition = "";
|
|
151
|
+
const titleId = useId();
|
|
152
|
+
const bodyId = useId();
|
|
153
|
+
const visible = ref(false);
|
|
154
|
+
const closed = ref(false);
|
|
155
|
+
const rendered = ref(false);
|
|
156
|
+
const zIndex = ref((_a = props.zIndex) != null ? _a : nextZIndex());
|
|
157
|
+
let openTimer = void 0;
|
|
158
|
+
let closeTimer = void 0;
|
|
159
|
+
const namespace = useGlobalConfig("namespace", "el");
|
|
160
|
+
const style = computed(() => {
|
|
161
|
+
const style2 = {};
|
|
162
|
+
const varPrefix = `--${namespace.value}-dialog`;
|
|
163
|
+
if (!props.fullscreen) {
|
|
164
|
+
if (props.top) style2[`${varPrefix}-margin-top`] = props.top;
|
|
165
|
+
if (props.width) style2[`${varPrefix}-width`] = addUnit(props.width);
|
|
166
|
+
}
|
|
167
|
+
return style2;
|
|
168
|
+
});
|
|
169
|
+
const overlayDialogStyle = computed(() => {
|
|
170
|
+
if (props.alignCenter) return { display: "flex" };
|
|
171
|
+
return {};
|
|
172
|
+
});
|
|
173
|
+
function afterEnter() {
|
|
174
|
+
emit("opened");
|
|
175
|
+
}
|
|
176
|
+
function afterLeave() {
|
|
177
|
+
emit("closed");
|
|
178
|
+
emit(UPDATE_MODEL_EVENT, false);
|
|
179
|
+
if (props.destroyOnClose) rendered.value = false;
|
|
180
|
+
}
|
|
181
|
+
function beforeLeave() {
|
|
182
|
+
emit("close");
|
|
183
|
+
}
|
|
184
|
+
function open() {
|
|
185
|
+
closeTimer?.();
|
|
186
|
+
openTimer?.();
|
|
187
|
+
if (props.openDelay && props.openDelay > 0) ({stop: openTimer} = useTimeoutFn(() => doOpen(), props.openDelay));
|
|
188
|
+
else doOpen();
|
|
189
|
+
}
|
|
190
|
+
function close() {
|
|
191
|
+
openTimer?.();
|
|
192
|
+
closeTimer?.();
|
|
193
|
+
if (props.closeDelay && props.closeDelay > 0) ({stop: closeTimer} = useTimeoutFn(() => doClose(), props.closeDelay));
|
|
194
|
+
else doClose();
|
|
195
|
+
}
|
|
196
|
+
function handleClose() {
|
|
197
|
+
function hide(shouldCancel) {
|
|
198
|
+
if (shouldCancel) return;
|
|
199
|
+
closed.value = true;
|
|
200
|
+
visible.value = false;
|
|
201
|
+
}
|
|
202
|
+
if (props.beforeClose) props.beforeClose(hide);
|
|
203
|
+
else close();
|
|
204
|
+
}
|
|
205
|
+
function onModalClick() {
|
|
206
|
+
if (props.closeOnClickModal) handleClose();
|
|
207
|
+
}
|
|
208
|
+
function doOpen() {
|
|
209
|
+
if (!isClient) return;
|
|
210
|
+
visible.value = true;
|
|
211
|
+
}
|
|
212
|
+
function doClose() {
|
|
213
|
+
visible.value = false;
|
|
214
|
+
}
|
|
215
|
+
function onOpenAutoFocus() {
|
|
216
|
+
emit("openAutoFocus");
|
|
217
|
+
}
|
|
218
|
+
function onCloseAutoFocus() {
|
|
219
|
+
emit("closeAutoFocus");
|
|
220
|
+
}
|
|
221
|
+
function onFocusoutPrevented(event) {
|
|
222
|
+
var _a2;
|
|
223
|
+
if (((_a2 = event.detail) == null ? void 0 : _a2.focusReason) === "pointer") event.preventDefault();
|
|
224
|
+
}
|
|
225
|
+
if (props.lockScroll) useLockscreen(visible);
|
|
226
|
+
function onCloseRequested() {
|
|
227
|
+
if (props.closeOnPressEscape) handleClose();
|
|
228
|
+
}
|
|
229
|
+
watch(() => props.modelValue, (val) => {
|
|
230
|
+
if (val) {
|
|
231
|
+
closed.value = false;
|
|
232
|
+
open();
|
|
233
|
+
rendered.value = true;
|
|
234
|
+
zIndex.value = isUndefined_default(props.zIndex) ? nextZIndex() : zIndex.value++;
|
|
235
|
+
nextTick(() => {
|
|
236
|
+
emit("open");
|
|
237
|
+
if (targetRef.value) targetRef.value.scrollTop = 0;
|
|
238
|
+
});
|
|
239
|
+
} else if (visible.value) close();
|
|
240
|
+
});
|
|
241
|
+
watch(() => props.fullscreen, (val) => {
|
|
242
|
+
if (!targetRef.value) return;
|
|
243
|
+
if (val) {
|
|
244
|
+
lastPosition = targetRef.value.style.transform;
|
|
245
|
+
targetRef.value.style.transform = "";
|
|
246
|
+
} else targetRef.value.style.transform = lastPosition;
|
|
247
|
+
});
|
|
248
|
+
onMounted(() => {
|
|
249
|
+
if (props.modelValue) {
|
|
250
|
+
visible.value = true;
|
|
251
|
+
rendered.value = true;
|
|
252
|
+
open();
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
return {
|
|
256
|
+
afterEnter,
|
|
257
|
+
afterLeave,
|
|
258
|
+
beforeLeave,
|
|
259
|
+
handleClose,
|
|
260
|
+
onModalClick,
|
|
261
|
+
close,
|
|
262
|
+
doClose,
|
|
263
|
+
onOpenAutoFocus,
|
|
264
|
+
onCloseAutoFocus,
|
|
265
|
+
onCloseRequested,
|
|
266
|
+
onFocusoutPrevented,
|
|
267
|
+
titleId,
|
|
268
|
+
bodyId,
|
|
269
|
+
closed,
|
|
270
|
+
style,
|
|
271
|
+
overlayDialogStyle,
|
|
272
|
+
rendered,
|
|
273
|
+
visible,
|
|
274
|
+
zIndex
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
var _hoisted_1 = [
|
|
278
|
+
"aria-label",
|
|
279
|
+
"aria-labelledby",
|
|
280
|
+
"aria-describedby"
|
|
281
|
+
];
|
|
282
|
+
var ElDialog = withInstall(/* @__PURE__ */ _export_sfc(/* @__PURE__ */ defineComponent({
|
|
283
|
+
...defineComponent({
|
|
284
|
+
name: "ElDialog",
|
|
285
|
+
inheritAttrs: false
|
|
286
|
+
}),
|
|
287
|
+
props: dialogProps,
|
|
288
|
+
emits: dialogEmits,
|
|
289
|
+
setup(__props, { expose }) {
|
|
290
|
+
const props = __props;
|
|
291
|
+
const slots = useSlots();
|
|
292
|
+
useDeprecated({
|
|
293
|
+
scope: "el-dialog",
|
|
294
|
+
from: "the title slot",
|
|
295
|
+
replacement: "the header slot",
|
|
296
|
+
version: "3.0.0",
|
|
297
|
+
ref: "https://element-plus.org/en-US/component/dialog.html#slots"
|
|
298
|
+
}, computed(() => !!slots.title));
|
|
299
|
+
useDeprecated({
|
|
300
|
+
scope: "el-dialog",
|
|
301
|
+
from: "custom-class",
|
|
302
|
+
replacement: "class",
|
|
303
|
+
version: "2.3.0",
|
|
304
|
+
ref: "https://element-plus.org/en-US/component/dialog.html#attributes",
|
|
305
|
+
type: "Attribute"
|
|
306
|
+
}, computed(() => !!props.customClass));
|
|
307
|
+
const ns = useNamespace("dialog");
|
|
308
|
+
const dialogRef = ref();
|
|
309
|
+
const headerRef = ref();
|
|
310
|
+
const dialogContentRef = ref();
|
|
311
|
+
const { visible, titleId, bodyId, style, overlayDialogStyle, rendered, zIndex, afterEnter, afterLeave, beforeLeave, handleClose, onModalClick, onOpenAutoFocus, onCloseAutoFocus, onCloseRequested, onFocusoutPrevented } = useDialog(props, dialogRef);
|
|
312
|
+
provide(dialogInjectionKey, {
|
|
313
|
+
dialogRef,
|
|
314
|
+
headerRef,
|
|
315
|
+
bodyId,
|
|
316
|
+
ns,
|
|
317
|
+
rendered,
|
|
318
|
+
style
|
|
319
|
+
});
|
|
320
|
+
const overlayEvent = useSameTarget(onModalClick);
|
|
321
|
+
const draggable = computed(() => props.draggable && !props.fullscreen);
|
|
322
|
+
expose({
|
|
323
|
+
visible,
|
|
324
|
+
dialogContentRef
|
|
325
|
+
});
|
|
326
|
+
return (_ctx, _cache) => {
|
|
327
|
+
return openBlock(), createBlock(Teleport, {
|
|
328
|
+
to: _ctx.appendTo,
|
|
329
|
+
disabled: _ctx.appendTo !== "body" ? false : !_ctx.appendToBody
|
|
330
|
+
}, [createVNode(Transition, {
|
|
331
|
+
name: "dialog-fade",
|
|
332
|
+
onAfterEnter: unref(afterEnter),
|
|
333
|
+
onAfterLeave: unref(afterLeave),
|
|
334
|
+
onBeforeLeave: unref(beforeLeave),
|
|
335
|
+
persisted: ""
|
|
336
|
+
}, {
|
|
337
|
+
default: withCtx(() => [withDirectives(createVNode(unref(ElOverlay), {
|
|
338
|
+
"custom-mask-event": "",
|
|
339
|
+
mask: _ctx.modal,
|
|
340
|
+
"overlay-class": _ctx.modalClass,
|
|
341
|
+
"z-index": unref(zIndex)
|
|
342
|
+
}, {
|
|
343
|
+
default: withCtx(() => [createBaseVNode("div", {
|
|
344
|
+
role: "dialog",
|
|
345
|
+
"aria-modal": "true",
|
|
346
|
+
"aria-label": _ctx.title || void 0,
|
|
347
|
+
"aria-labelledby": !_ctx.title ? unref(titleId) : void 0,
|
|
348
|
+
"aria-describedby": unref(bodyId),
|
|
349
|
+
class: normalizeClass(`${unref(ns).namespace.value}-overlay-dialog`),
|
|
350
|
+
style: normalizeStyle(unref(overlayDialogStyle)),
|
|
351
|
+
onClick: _cache[0] || (_cache[0] = (...args) => unref(overlayEvent).onClick && unref(overlayEvent).onClick(...args)),
|
|
352
|
+
onMousedown: _cache[1] || (_cache[1] = (...args) => unref(overlayEvent).onMousedown && unref(overlayEvent).onMousedown(...args)),
|
|
353
|
+
onMouseup: _cache[2] || (_cache[2] = (...args) => unref(overlayEvent).onMouseup && unref(overlayEvent).onMouseup(...args))
|
|
354
|
+
}, [createVNode(unref(ElFocusTrap), {
|
|
355
|
+
loop: "",
|
|
356
|
+
trapped: unref(visible),
|
|
357
|
+
"focus-start-el": "container",
|
|
358
|
+
onFocusAfterTrapped: unref(onOpenAutoFocus),
|
|
359
|
+
onFocusAfterReleased: unref(onCloseAutoFocus),
|
|
360
|
+
onFocusoutPrevented: unref(onFocusoutPrevented),
|
|
361
|
+
onReleaseRequested: unref(onCloseRequested)
|
|
362
|
+
}, {
|
|
363
|
+
default: withCtx(() => [unref(rendered) ? (openBlock(), createBlock(ElDialogContent, mergeProps({
|
|
364
|
+
key: 0,
|
|
365
|
+
ref_key: "dialogContentRef",
|
|
366
|
+
ref: dialogContentRef
|
|
367
|
+
}, _ctx.$attrs, {
|
|
368
|
+
"custom-class": _ctx.customClass,
|
|
369
|
+
center: _ctx.center,
|
|
370
|
+
"align-center": _ctx.alignCenter,
|
|
371
|
+
"close-icon": _ctx.closeIcon,
|
|
372
|
+
draggable: unref(draggable),
|
|
373
|
+
fullscreen: _ctx.fullscreen,
|
|
374
|
+
"show-close": _ctx.showClose,
|
|
375
|
+
title: _ctx.title,
|
|
376
|
+
"aria-level": _ctx.headerAriaLevel,
|
|
377
|
+
onClose: unref(handleClose)
|
|
378
|
+
}), createSlots({
|
|
379
|
+
header: withCtx(() => [!_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
|
|
380
|
+
key: 0,
|
|
381
|
+
close: unref(handleClose),
|
|
382
|
+
titleId: unref(titleId),
|
|
383
|
+
titleClass: unref(ns).e("title")
|
|
384
|
+
}) : renderSlot(_ctx.$slots, "title", { key: 1 })]),
|
|
385
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
386
|
+
_: 2
|
|
387
|
+
}, [_ctx.$slots.footer ? {
|
|
388
|
+
name: "footer",
|
|
389
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "footer")])
|
|
390
|
+
} : void 0]), 1040, [
|
|
391
|
+
"custom-class",
|
|
392
|
+
"center",
|
|
393
|
+
"align-center",
|
|
394
|
+
"close-icon",
|
|
395
|
+
"draggable",
|
|
396
|
+
"fullscreen",
|
|
397
|
+
"show-close",
|
|
398
|
+
"title",
|
|
399
|
+
"aria-level",
|
|
400
|
+
"onClose"
|
|
401
|
+
])) : createCommentVNode("v-if", true)]),
|
|
402
|
+
_: 3
|
|
403
|
+
}, 8, [
|
|
404
|
+
"trapped",
|
|
405
|
+
"onFocusAfterTrapped",
|
|
406
|
+
"onFocusAfterReleased",
|
|
407
|
+
"onFocusoutPrevented",
|
|
408
|
+
"onReleaseRequested"
|
|
409
|
+
])], 46, _hoisted_1)]),
|
|
410
|
+
_: 3
|
|
411
|
+
}, 8, [
|
|
412
|
+
"mask",
|
|
413
|
+
"overlay-class",
|
|
414
|
+
"z-index"
|
|
415
|
+
]), [[vShow, unref(visible)]])]),
|
|
416
|
+
_: 3
|
|
417
|
+
}, 8, [
|
|
418
|
+
"onAfterEnter",
|
|
419
|
+
"onAfterLeave",
|
|
420
|
+
"onBeforeLeave"
|
|
421
|
+
])], 8, ["to", "disabled"]);
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
}), [["__file", "/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog.vue"]]));
|
|
425
|
+
export { dialogProps as i, useDialog as n, dialogEmits as r, ElDialog as t };
|