@vc-shell/framework 1.1.44 → 1.1.45
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/CHANGELOG.md +11 -0
- package/core/plugins/modularity/loader.ts +120 -74
- package/core/services/app-bar-mobile-buttons-service.ts +1 -1
- package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
- package/dist/core/services/app-bar-mobile-buttons-service.d.ts +1 -1
- package/dist/core/services/app-bar-mobile-buttons-service.d.ts.map +1 -1
- package/dist/framework.js +33347 -295
- package/dist/index.css +1 -9
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/locales/de.json +0 -84
- package/dist/locales/en.json +0 -84
- package/dist/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts +1 -1
- package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts.map +1 -1
- package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.d.ts.map +1 -1
- package/dist/shared/components/change-password-button/change-password-button.vue.d.ts.map +1 -1
- package/dist/shared/components/logout-button/logout-button.vue.d.ts.map +1 -1
- package/dist/shared/components/settings-menu-item/settings-menu-item.vue.d.ts.map +1 -1
- package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -2
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +6 -6
- package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/atoms/vc-hint/vc-hint.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/icons/index.d.ts +0 -26
- package/dist/ui/components/atoms/vc-icon/icons/index.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts +0 -5
- package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts +0 -20
- package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts +36 -0
- package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts +17 -0
- package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts.map +1 -0
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +16 -2381
- package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-form/vc-form.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +1 -1
- package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts.map +1 -1
- package/dist/vendor-boolbase-Cp9L0GAZ.js +25 -0
- package/dist/vendor-cheerio-HN9zIPZn.js +3135 -0
- package/dist/vendor-cheerio-select-5Ry0HvBq.js +306 -0
- package/dist/vendor-core-js-l0sNRNKZ.js +1 -0
- package/dist/vendor-css-select-DRIZ9kfZ.js +966 -0
- package/dist/vendor-css-what-DuPJ1HEF.js +448 -0
- package/dist/vendor-cypress-signalr-mock-BKdBJpdt.js +778 -0
- package/dist/vendor-date-fns-515YWkk-.js +6724 -0
- package/dist/vendor-dom-serializer-nQMsqjYW.js +286 -0
- package/dist/vendor-dom7-CJLPMwy5.js +941 -0
- package/dist/vendor-domelementtype-CjSzQey5.js +53 -0
- package/dist/vendor-domhandler-9z8cS16a.js +484 -0
- package/dist/vendor-dompurify-CRFzu7ib.js +1336 -0
- package/dist/vendor-domutils-Bc-Opz-v.js +981 -0
- package/dist/vendor-entities-Bfsx4xOQ.js +636 -0
- package/dist/vendor-floating-ui-core-wV8u8QP4.js +511 -0
- package/dist/vendor-floating-ui-dom-DDnRPs17.js +706 -0
- package/dist/vendor-floating-ui-utils-OMIFy1QU.js +296 -0
- package/dist/vendor-floating-ui-vue-D-tCDAMm.js +167 -0
- package/dist/vendor-fontsource-plus-jakarta-sans.css +1 -0
- package/dist/vendor-headlessui-vue-CY9FRgTb.js +83 -0
- package/dist/vendor-htmlparser2-B1dhFPOs.js +1426 -0
- package/dist/vendor-iconify-vue-DfRGgyNu.js +1840 -0
- package/dist/vendor-intlify-core-base-BuknsFQe.js +1876 -0
- package/dist/vendor-intlify-message-compiler-CuOQDWx1.js +1508 -0
- package/dist/vendor-intlify-shared-Cz4YRMuC.js +241 -0
- package/dist/vendor-iso-639-1-BJCk9DvE.js +819 -0
- package/dist/vendor-linkify-it-CKUf4vsc.js +830 -0
- package/dist/vendor-linkifyjs-BfyGgbCh.js +1756 -0
- package/dist/vendor-lodash-es-BySUOlwf.js +18333 -0
- package/dist/vendor-markdown-it-D-apazHa.js +6000 -0
- package/dist/vendor-markdown-it-task-lists-rxMVH6Ku.js +131 -0
- package/dist/vendor-mdurl-BNh2CCgT.js +537 -0
- package/dist/vendor-microsoft-applicationinsights-analytics-js-kG3lLg8X.js +1275 -0
- package/dist/vendor-microsoft-applicationinsights-cfgsync-js-C0uQkiQq.js +591 -0
- package/dist/vendor-microsoft-applicationinsights-channel-js-Dyd_PXA3.js +2153 -0
- package/dist/vendor-microsoft-applicationinsights-common-CfmP1_Qr.js +2470 -0
- package/dist/vendor-microsoft-applicationinsights-core-js-Cq4YSEvZ.js +6589 -0
- package/dist/vendor-microsoft-applicationinsights-dependencies-js-C56OBFr4.js +1510 -0
- package/dist/vendor-microsoft-applicationinsights-properties-js-CBJTBawx.js +761 -0
- package/dist/vendor-microsoft-applicationinsights-shims-CX8sJgar.js +70 -0
- package/dist/vendor-microsoft-applicationinsights-web-pim2ri-g.js +667 -0
- package/dist/vendor-microsoft-dynamicproto-js-CFBBUu9p.js +520 -0
- package/dist/vendor-microsoft-signalr-dUnlRsGm.js +3339 -0
- package/dist/vendor-moment-Mki5YqAR.js +5679 -0
- package/dist/vendor-nevware21-ts-async-CLMApQ9E.js +395 -0
- package/dist/vendor-nevware21-ts-utils-e8v8Jty3.js +1160 -0
- package/dist/vendor-normalize-css.css +1 -0
- package/dist/vendor-nth-check-Bx8TxtJt.js +157 -0
- package/dist/vendor-orderedmap-dGG6uMFJ.js +137 -0
- package/dist/vendor-parse5-Bt2NhSzR.js +8432 -0
- package/dist/vendor-parse5-htmlparser2-tree-adapter-BUUtKzf8.js +216 -0
- package/dist/vendor-popperjs-core-Cr2byIky.js +1790 -0
- package/dist/vendor-prettier-B4PaeWRQ.js +98 -0
- package/dist/vendor-prosemirror-commands-BH9lWGpW.js +561 -0
- package/dist/vendor-prosemirror-dropcursor-CeyPcxrA.js +146 -0
- package/dist/vendor-prosemirror-gapcursor-U8UoUJII.js +236 -0
- package/dist/vendor-prosemirror-history-BDaJkvNx.js +414 -0
- package/dist/vendor-prosemirror-keymap-BbWvIWmH.js +128 -0
- package/dist/vendor-prosemirror-markdown-gB0PXBbz.js +866 -0
- package/dist/vendor-prosemirror-model-BZu3WVcD.js +3463 -0
- package/dist/vendor-prosemirror-schema-list-Bl9NpKA7.js +158 -0
- package/dist/vendor-prosemirror-state-BvL9Pxph.js +1003 -0
- package/dist/vendor-prosemirror-tables-17qAnviK.js +2159 -0
- package/dist/vendor-prosemirror-transform-CE9VV3qg.js +2156 -0
- package/dist/vendor-prosemirror-view-CU2WTHT7.js +5811 -0
- package/dist/vendor-punycode-js-iAs5RxMf.js +441 -0
- package/dist/vendor-rope-sequence-BdXDKoGt.js +207 -0
- package/dist/vendor-semver-CVLMK-S4.js +2702 -0
- package/dist/vendor-ssr-window-s6OpKa3O.js +150 -0
- package/dist/vendor-swiper-CdiyNHVt.js +5679 -0
- package/dist/vendor-swiper.css +1 -0
- package/dist/vendor-tanstack-virtual-core-l0sNRNKZ.js +1 -0
- package/dist/vendor-tanstack-vue-virtual-l0sNRNKZ.js +1 -0
- package/dist/vendor-tippy-js-DWFe2TfK.js +1647 -0
- package/dist/vendor-tiptap-core-NfwGfaQk.js +4910 -0
- package/dist/vendor-tiptap-extension-blockquote-jmWBTtsI.js +57 -0
- package/dist/vendor-tiptap-extension-bold-p5frh4ak.js +97 -0
- package/dist/vendor-tiptap-extension-bubble-menu-KUhZSfrs.js +218 -0
- package/dist/vendor-tiptap-extension-bullet-list-COmZRoSB.js +73 -0
- package/dist/vendor-tiptap-extension-code-block-DyTARZss.js +221 -0
- package/dist/vendor-tiptap-extension-code-jVv6CXpX.js +75 -0
- package/dist/vendor-tiptap-extension-document-DssuotYs.js +13 -0
- package/dist/vendor-tiptap-extension-dropcursor-BoO0Qv91.js +26 -0
- package/dist/vendor-tiptap-extension-floating-menu-CrO8CN5w.js +165 -0
- package/dist/vendor-tiptap-extension-gapcursor-KpsWEoMD.js +30 -0
- package/dist/vendor-tiptap-extension-hard-break-ldOzhSvf.js +68 -0
- package/dist/vendor-tiptap-extension-heading-CKz2llX0.js +77 -0
- package/dist/vendor-tiptap-extension-history-DeKZ2VQ9.js +48 -0
- package/dist/vendor-tiptap-extension-horizontal-rule-CAjWRyDS.js +92 -0
- package/dist/vendor-tiptap-extension-image-ZagcEYuk.js +76 -0
- package/dist/vendor-tiptap-extension-italic-CM4xdznY.js +96 -0
- package/dist/vendor-tiptap-extension-link-Z-AMC4Ri.js +414 -0
- package/dist/vendor-tiptap-extension-list-item-BJi5QpXc.js +37 -0
- package/dist/vendor-tiptap-extension-ordered-list-C_TMrfBE.js +97 -0
- package/dist/vendor-tiptap-extension-paragraph-CQw0E0Au.js +39 -0
- package/dist/vendor-tiptap-extension-placeholder-BBNVKfa_.js +66 -0
- package/dist/vendor-tiptap-extension-strike-DUyMYX1Z.js +79 -0
- package/dist/vendor-tiptap-extension-table-cell-CoDIMPA5.js +47 -0
- package/dist/vendor-tiptap-extension-table-header-DvbGHnmw.js +47 -0
- package/dist/vendor-tiptap-extension-table-row-D1uqN5Aj.js +26 -0
- package/dist/vendor-tiptap-extension-table-tKS4MOM4.js +354 -0
- package/dist/vendor-tiptap-extension-text-DtRBhKB2.js +12 -0
- package/dist/vendor-tiptap-extension-underline-DqaSFp_P.js +50 -0
- package/dist/vendor-tiptap-markdown-7-PCADTU.js +1017 -0
- package/dist/vendor-tiptap-pm-l0sNRNKZ.js +1 -0
- package/dist/vendor-tiptap-starter-kit-CDSV_Zuu.js +88 -0
- package/dist/vendor-tiptap-vue-3-DZg2fjq_.js +268 -0
- package/dist/vendor-truncate-html-3qQY0Djo.js +196 -0
- package/dist/vendor-uc-micro-jjt6LQ65.js +23 -0
- package/dist/vendor-vee-validate-i18n-v_gHjRmD.js +154 -0
- package/dist/vendor-vee-validate-rules-DzV3VY3N.js +536 -0
- package/dist/vendor-vue-currency-input-DGAkEFBO.js +545 -0
- package/dist/vendor-vue-demi-l0sNRNKZ.js +1 -0
- package/dist/vendor-vue-devtools-api-DXYR8qBG.js +169 -0
- package/dist/vendor-vue-i18n-Co752uk3.js +1897 -0
- package/dist/vendor-vue3-application-insights-CYWFCr_J.js +119 -0
- package/dist/vendor-vue3-touch-events-BJEAiSa3.js +416 -0
- package/dist/vendor-vuepic-vue-datepicker-BSWXRSiu.js +5019 -0
- package/dist/vendor-vuepic-vue-datepicker.css +1 -0
- package/dist/vendor-vueuse-components-l1bL12mE.js +339 -0
- package/dist/vendor-vueuse-core-DGcJOmwG.js +7743 -0
- package/dist/vendor-vueuse-shared-_mOXsFuM.js +1568 -0
- package/dist/vendor-w3c-keyname-BOm2dtJm.js +121 -0
- package/package.json +22 -11
- package/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue +3 -3
- package/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.ts +2 -1
- package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.ts +1 -0
- package/shared/components/change-password-button/change-password-button.vue +1 -2
- package/shared/components/logout-button/logout-button.vue +1 -2
- package/shared/components/notifications/components/notification-container/index.ts +1 -1
- package/shared/components/notifications/core/notification.ts +1 -1
- package/shared/components/settings-menu-item/settings-menu-item.vue +1 -0
- package/shared/components/sidebar/sidebar.vue +2 -2
- package/shared/modules/dynamic/pages/dynamic-blade-list.vue +2 -1
- package/ui/components/atoms/vc-hint/vc-hint.vue +2 -0
- package/ui/components/atoms/vc-icon/composables/use-icon.ts +1 -1
- package/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue +18 -14
- package/ui/components/atoms/vc-icon/icons/index.ts +1 -27
- package/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue +7 -11
- package/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue +37 -31
- package/ui/components/atoms/vc-icon/vc-icon-examples.vue +1 -1
- package/ui/components/atoms/vc-icon/vc-icon.stories.ts +4 -5
- package/ui/components/atoms/vc-icon/vc-icon.vue +33 -163
- package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +22 -70
- package/ui/components/atoms/vc-icon/vc-material-icon.vue +28 -59
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +2 -3
- package/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue +103 -0
- package/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue +252 -0
- package/ui/components/molecules/vc-editor/vc-editor.stories.ts +1 -4
- package/ui/components/molecules/vc-editor/vc-editor.vue +666 -360
- package/ui/components/molecules/vc-form/vc-form.vue +7 -5
- package/ui/components/molecules/vc-input/vc-input.vue +1 -1
- package/ui/components/molecules/vc-pagination/vc-pagination.vue +4 -17
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarMobileActions.vue +1 -1
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue +1 -3
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +1 -4
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +1 -3
- package/ui/components/organisms/vc-app/vc-app.backupsb.ts +214 -214
- package/ui/components/organisms/vc-app/vc-app.vue +3 -5
- package/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +3 -10
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/mobile/vc-blade-toolbar-mobile.vue +1 -1
- package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue +2 -2
- package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue +2 -2
- package/ui/components/organisms/vc-blade/vc-blade.vue +4 -5
- package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +1 -3
- package/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue +1 -2
- package/ui/components/organisms/vc-table/composables/useTableState.ts +5 -5
- package/dist/apl-B2DGVGxc.js +0 -76
- package/dist/asciiarmor-2LVJmxlE.js +0 -34
- package/dist/asn1-jKiBa2Ya.js +0 -95
- package/dist/asterisk-DS281yxp.js +0 -271
- package/dist/brainfuck-C_p9pTT8.js +0 -34
- package/dist/clike-DGTaUp48.js +0 -620
- package/dist/clojure-CCKyeQKf.js +0 -800
- package/dist/cmake-CuaCgAKt.js +0 -28
- package/dist/cobol-BlTKFDRj.js +0 -72
- package/dist/coffeescript-BVCvwO8I.js +0 -179
- package/dist/commonlisp-D_kxz07b.js +0 -75
- package/dist/crystal-D309uH6_.js +0 -217
- package/dist/css-BkF-NPzE.js +0 -1553
- package/dist/cypher-BMq4Fwjl.js +0 -68
- package/dist/d-BZcgY6La.js +0 -127
- package/dist/diff-Cg9d_RX2.js +0 -18
- package/dist/dockerfile-DIy8NleC.js +0 -194
- package/dist/dtd-CtLokQ-U.js +0 -84
- package/dist/dylan-QYeExnWK.js +0 -234
- package/dist/ebnf-DUPDuY4r.js +0 -78
- package/dist/ecl-CiXN-g_D.js +0 -121
- package/dist/eiffel-yQhjl4T1.js +0 -110
- package/dist/elm-CNT9vbN0.js +0 -108
- package/dist/erlang-CFOYdy9e.js +0 -487
- package/dist/factor-DDOC7X6P.js +0 -65
- package/dist/fcl-CPC2WYrI.js +0 -103
- package/dist/forth-BmxRyE9S.js +0 -60
- package/dist/fortran-9bvPyrOW.js +0 -442
- package/dist/gas-cpmYfFX2.js +0 -183
- package/dist/gherkin-CJuwpceU.js +0 -34
- package/dist/groovy-DZeT_VM-.js +0 -146
- package/dist/haskell-Bvt3Qq1t.js +0 -375
- package/dist/haxe-70NVW1pR.js +0 -359
- package/dist/http-D9LttvKF.js +0 -44
- package/dist/idl-B6TRFYjl.js +0 -947
- package/dist/index-4DWvmoYg.js +0 -71
- package/dist/index-52o7mJaX.js +0 -156
- package/dist/index-B0KatioT.js +0 -98
- package/dist/index-BP3W8zuk.js +0 -268
- package/dist/index-BykT5L1A.js +0 -148134
- package/dist/index-CfXo9hsG.js +0 -75
- package/dist/index-Ch37pBUt.js +0 -308
- package/dist/index-D2KGkAYT.js +0 -93
- package/dist/index-D83zQom_.js +0 -58
- package/dist/index-DuQrVLbu.js +0 -134
- package/dist/index-_fdMid5h.js +0 -288
- package/dist/index-a1wO-owY.js +0 -545
- package/dist/index-crMpNSFe.js +0 -611
- package/dist/index-dmBRpHHY.js +0 -137
- package/dist/index-kBdB14Fz.js +0 -341
- package/dist/index-uBhy41le.js +0 -249
- package/dist/index-zZrijNsr.js +0 -299
- package/dist/javascript-C2yteZeJ.js +0 -691
- package/dist/jinja2-DnB6dQmV.js +0 -154
- package/dist/julia-DpvXAuO6.js +0 -241
- package/dist/livescript-CanGTf8u.js +0 -272
- package/dist/lua-XplVlWi_.js +0 -217
- package/dist/mathematica-jaRHnSxC.js +0 -35
- package/dist/mbox-BctzC1hL.js +0 -76
- package/dist/mirc-CFBPAOaF.js +0 -72
- package/dist/mllike-BSnXJBGA.js +0 -272
- package/dist/modelica-vUgVs--1.js +0 -93
- package/dist/mscgen-Cpl0NYLN.js +0 -104
- package/dist/mumps-CQoS1kWX.js +0 -25
- package/dist/nginx-zDPm3Z74.js +0 -89
- package/dist/nsis-fePjrhq7.js +0 -62
- package/dist/ntriples-CsNjv2QF.js +0 -79
- package/dist/octave-C8PmmSRH.js +0 -143
- package/dist/oz-Ce8aN8oE.js +0 -151
- package/dist/pascal-De0D6mP7.js +0 -77
- package/dist/perl-B4bSCe1C.js +0 -915
- package/dist/pig-D24Z8EXi.js +0 -54
- package/dist/powershell-DkYVfTzP.js +0 -249
- package/dist/properties-Dn9wna3M.js +0 -26
- package/dist/protobuf-BPIjwpzm.js +0 -49
- package/dist/pug-CwAQJzGR.js +0 -248
- package/dist/puppet-nyd4dhjf.js +0 -45
- package/dist/python-BkR3uSy8.js +0 -313
- package/dist/q-DXjKs-tC.js +0 -83
- package/dist/r-LKEuhEGI.js +0 -104
- package/dist/rpm-IznJm2Xc.js +0 -57
- package/dist/ruby-CcYfvIk6.js +0 -228
- package/dist/sas-7E8yHoCW.js +0 -105
- package/dist/scheme-DjibxsNh.js +0 -124
- package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts +0 -113
- package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts.map +0 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts +0 -3
- package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts.map +0 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts +0 -102
- package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts.map +0 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts +0 -4
- package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts.map +0 -1
- package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts +0 -3
- package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts.map +0 -1
- package/dist/shell-C0C2sNA_.js +0 -182
- package/dist/sieve-Bwz7vjP5.js +0 -72
- package/dist/simple-mode-B0dvCdAA.js +0 -89
- package/dist/smalltalk-Bhddl2pB.js +0 -48
- package/dist/solr-BNlsLglM.js +0 -41
- package/dist/sparql-FarWu_Gb.js +0 -197
- package/dist/spreadsheet-C-cy4P5N.js +0 -49
- package/dist/sql-CfG5lQ3l.js +0 -282
- package/dist/stex-Du4h4KAU.js +0 -129
- package/dist/stylus-CAdqWld3.js +0 -250
- package/dist/swift-DSxqR9R6.js +0 -230
- package/dist/tcl-xfoLljhY.js +0 -81
- package/dist/textile-D1AWE-pc.js +0 -295
- package/dist/tiddlywiki-5wqsXtSk.js +0 -155
- package/dist/tiki-__Kn3CeS.js +0 -181
- package/dist/toml-BHiuTcfn.js +0 -49
- package/dist/troff-D2UO-fKf.js +0 -35
- package/dist/ttcn-Bsa4sfRm.js +0 -123
- package/dist/ttcn-cfg-Bac_acMi.js +0 -88
- package/dist/turtle-xwJUxoPV.js +0 -80
- package/dist/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/BellIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/BellIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/LogoutIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/LogoutIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/SearchIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/SearchIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue.d.ts.map +0 -1
- package/dist/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue.d.ts +0 -7
- package/dist/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue.d.ts.map +0 -1
- package/dist/vb-c2kQGd6-.js +0 -74
- package/dist/vbscript-1f_Dhg5H.js +0 -324
- package/dist/velocity-DJd0pTTC.js +0 -96
- package/dist/verilog-CiS1jyi5.js +0 -262
- package/dist/vhdl-T9HkrbI2.js +0 -106
- package/dist/webidl-CjfDENEo.js +0 -155
- package/dist/xquery-BUQdORAS.js +0 -422
- package/dist/yacas-C0absKBh.js +0 -73
- package/dist/z80-Pki2zAjW.js +0 -61
- package/shared/modules/dynamic/components/fields/storybook/Button.stories.ts +0 -186
- package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +0 -175
- package/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.ts +0 -185
- package/shared/modules/dynamic/components/fields/storybook/ContentField.stories.ts +0 -245
- package/shared/modules/dynamic/components/fields/storybook/EditorField.stories.ts +0 -192
- package/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.ts +0 -347
- package/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.ts +0 -239
- package/shared/modules/dynamic/components/fields/storybook/ImageField.stories.ts +0 -186
- package/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.ts +0 -281
- package/shared/modules/dynamic/components/fields/storybook/InputField.stories.ts +0 -312
- package/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.ts +0 -361
- package/shared/modules/dynamic/components/fields/storybook/RadioButtonGroup.stories.ts +0 -224
- package/shared/modules/dynamic/components/fields/storybook/RatingField.stories.ts +0 -131
- package/shared/modules/dynamic/components/fields/storybook/SelectField.stories.ts +0 -666
- package/shared/modules/dynamic/components/fields/storybook/StatusField.stories.ts +0 -202
- package/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.ts +0 -178
- package/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.ts +0 -203
- package/shared/modules/dynamic/components/fields/storybook/VideoField.stories.ts +0 -92
- package/shared/modules/dynamic/components/fields/storybook/common/args.ts +0 -130
- package/shared/modules/dynamic/components/fields/storybook/common/templates.ts +0 -8
- package/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.ts +0 -54
- package/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.ts +0 -16
- package/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.ts +0 -41
- package/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue +0 -15
- package/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue +0 -20
- package/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue +0 -13
- package/ui/components/atoms/vc-icon/icons/BellIcon.vue +0 -14
- package/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue +0 -13
- package/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue +0 -13
- package/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue +0 -13
- package/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue +0 -13
- package/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue +0 -16
- package/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue +0 -20
- package/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue +0 -14
- package/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue +0 -14
- package/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue +0 -27
- package/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue +0 -22
- package/ui/components/atoms/vc-icon/icons/LogoutIcon.vue +0 -13
- package/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue +0 -14
- package/ui/components/atoms/vc-icon/icons/OffersIcon.vue +0 -23
- package/ui/components/atoms/vc-icon/icons/OrdersIcon.vue +0 -19
- package/ui/components/atoms/vc-icon/icons/PeopleIcon.vue +0 -21
- package/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue +0 -20
- package/ui/components/atoms/vc-icon/icons/ProductsIcon.vue +0 -23
- package/ui/components/atoms/vc-icon/icons/ProfileIcon.vue +0 -18
- package/ui/components/atoms/vc-icon/icons/SearchIcon.vue +0 -14
- package/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue +0 -21
- package/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue +0 -16
- package/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue +0 -26
- package/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue +0 -19
|
@@ -0,0 +1,1897 @@
|
|
|
1
|
+
import { C as CORE_WARN_CODES_EXTEND_POINT, D as DEFAULT_LOCALE, u as updateFallbackLocale, c as createCoreContext, a as clearDateTimeFormat, b as clearNumberFormat, i as isMessageAST, A as AST_NODE_PROPS_KEYS, s as setAdditionalMeta, g as getFallbackContext, N as NOT_REOSLVED, d as isTranslateFallbackWarn, e as isTranslateMissingWarn, f as fallbackWithLocaleChain, h as CORE_ERROR_CODES_EXTEND_POINT, j as setFallbackContext, p as parseTranslateArgs, t as translate, M as MISSING_RESOLVE_VALUE, k as parseDateTimeArgs, l as datetime, m as parseNumberArgs, n as number, o as isMessageFunction, q as NUMBER_FORMAT_OPTIONS_KEYS, r as DATETIME_FORMAT_OPTIONS_KEYS, v as registerMessageCompiler, w as registerMessageResolver, x as registerLocaleFallbacker, y as compile, z as resolveValue, B as setDevToolsHook } from './vendor-intlify-core-base-BuknsFQe.js';
|
|
2
|
+
import { w as warnOnce, e as isBoolean, l as format, A as makeSymbol, a as isPlainObject, B as createEmitter, b as isString, i as isArray, f as isRegExp, r as inBrowser, d as assign, c as create, C as deepCopy, k as hasOwn, j as isObject, g as isFunction, n as isNumber, h as warn, o as isEmptyObject, m as getGlobalThis } from './vendor-intlify-shared-Cz4YRMuC.js';
|
|
3
|
+
import { effectScope, ref, shallowRef, computed, watch, isRef, defineComponent, getCurrentInstance, h, Fragment, inject, onMounted, onUnmounted, createVNode, Text } from 'vue';
|
|
4
|
+
import { s as setupDevtoolsPlugin } from './vendor-vue-devtools-api-DXYR8qBG.js';
|
|
5
|
+
import { c as createCompileError } from './vendor-intlify-message-compiler-CuOQDWx1.js';
|
|
6
|
+
|
|
7
|
+
/*!
|
|
8
|
+
* vue-i18n v11.1.7
|
|
9
|
+
* (c) 2025 kazuya kawaguchi
|
|
10
|
+
* Released under the MIT License.
|
|
11
|
+
*/
|
|
12
|
+
const VERSION = "11.1.7";
|
|
13
|
+
function initFeatureFlags() {
|
|
14
|
+
if (typeof __VUE_I18N_FULL_INSTALL__ !== "boolean") {
|
|
15
|
+
getGlobalThis().__VUE_I18N_FULL_INSTALL__ = true;
|
|
16
|
+
}
|
|
17
|
+
if (typeof __VUE_I18N_LEGACY_API__ !== "boolean") {
|
|
18
|
+
getGlobalThis().__VUE_I18N_LEGACY_API__ = true;
|
|
19
|
+
}
|
|
20
|
+
if (typeof __INTLIFY_DROP_MESSAGE_COMPILER__ !== "boolean") {
|
|
21
|
+
getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__ = false;
|
|
22
|
+
}
|
|
23
|
+
if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") {
|
|
24
|
+
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const I18nErrorCodes = {
|
|
28
|
+
// composer module errors
|
|
29
|
+
UNEXPECTED_RETURN_TYPE: CORE_ERROR_CODES_EXTEND_POINT,
|
|
30
|
+
// 24
|
|
31
|
+
// legacy module errors
|
|
32
|
+
INVALID_ARGUMENT: 25,
|
|
33
|
+
// i18n module errors
|
|
34
|
+
MUST_BE_CALL_SETUP_TOP: 26,
|
|
35
|
+
NOT_INSTALLED: 27,
|
|
36
|
+
// directive module errors
|
|
37
|
+
REQUIRED_VALUE: 28,
|
|
38
|
+
INVALID_VALUE: 29,
|
|
39
|
+
// vue-devtools errors
|
|
40
|
+
CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: 30,
|
|
41
|
+
NOT_INSTALLED_WITH_PROVIDE: 31,
|
|
42
|
+
// unexpected error
|
|
43
|
+
UNEXPECTED_ERROR: 32,
|
|
44
|
+
// not compatible legacy vue-i18n constructor
|
|
45
|
+
NOT_COMPATIBLE_LEGACY_VUE_I18N: 33,
|
|
46
|
+
// Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly
|
|
47
|
+
NOT_AVAILABLE_COMPOSITION_IN_LEGACY: 34,
|
|
48
|
+
// duplicate `useI18n` calling
|
|
49
|
+
DUPLICATE_USE_I18N_CALLING: 35
|
|
50
|
+
};
|
|
51
|
+
function createI18nError(code, ...args) {
|
|
52
|
+
return createCompileError(code, null, process.env.NODE_ENV !== "production" ? { messages: errorMessages, args } : void 0);
|
|
53
|
+
}
|
|
54
|
+
const errorMessages = {
|
|
55
|
+
[I18nErrorCodes.UNEXPECTED_RETURN_TYPE]: "Unexpected return type in composer",
|
|
56
|
+
[I18nErrorCodes.INVALID_ARGUMENT]: "Invalid argument",
|
|
57
|
+
[I18nErrorCodes.MUST_BE_CALL_SETUP_TOP]: "Must be called at the top of a `setup` function",
|
|
58
|
+
[I18nErrorCodes.NOT_INSTALLED]: "Need to install with `app.use` function",
|
|
59
|
+
[I18nErrorCodes.UNEXPECTED_ERROR]: "Unexpected error",
|
|
60
|
+
[I18nErrorCodes.REQUIRED_VALUE]: `Required in value: {0}`,
|
|
61
|
+
[I18nErrorCodes.INVALID_VALUE]: `Invalid value`,
|
|
62
|
+
[I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]: `Cannot setup vue-devtools plugin`,
|
|
63
|
+
[I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE]: "Need to install with `provide` function",
|
|
64
|
+
[I18nErrorCodes.NOT_COMPATIBLE_LEGACY_VUE_I18N]: "Not compatible legacy VueI18n.",
|
|
65
|
+
[I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]: "Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly",
|
|
66
|
+
[I18nErrorCodes.DUPLICATE_USE_I18N_CALLING]: "Duplicate `useI18n` calling by local scope. Please don't call it on local scope"
|
|
67
|
+
};
|
|
68
|
+
const TranslateVNodeSymbol = /* @__PURE__ */ makeSymbol("__translateVNode");
|
|
69
|
+
const DatetimePartsSymbol = /* @__PURE__ */ makeSymbol("__datetimeParts");
|
|
70
|
+
const NumberPartsSymbol = /* @__PURE__ */ makeSymbol("__numberParts");
|
|
71
|
+
const EnableEmitter = /* @__PURE__ */ makeSymbol("__enableEmitter");
|
|
72
|
+
const DisableEmitter = /* @__PURE__ */ makeSymbol("__disableEmitter");
|
|
73
|
+
const SetPluralRulesSymbol = makeSymbol("__setPluralRules");
|
|
74
|
+
const InejctWithOptionSymbol = /* @__PURE__ */ makeSymbol("__injectWithOption");
|
|
75
|
+
const DisposeSymbol = /* @__PURE__ */ makeSymbol("__dispose");
|
|
76
|
+
const I18nWarnCodes = {
|
|
77
|
+
FALLBACK_TO_ROOT: CORE_WARN_CODES_EXTEND_POINT,
|
|
78
|
+
// 8
|
|
79
|
+
NOT_FOUND_PARENT_SCOPE: 9,
|
|
80
|
+
IGNORE_OBJ_FLATTEN: 10,
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated will be removed at vue-i18n v12
|
|
83
|
+
*/
|
|
84
|
+
DEPRECATE_LEGACY_MODE: 11,
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated will be removed at vue-i18n v12
|
|
87
|
+
*/
|
|
88
|
+
DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE: 12
|
|
89
|
+
};
|
|
90
|
+
const warnMessages = {
|
|
91
|
+
[I18nWarnCodes.FALLBACK_TO_ROOT]: `Fall back to {type} '{key}' with root locale.`,
|
|
92
|
+
[I18nWarnCodes.NOT_FOUND_PARENT_SCOPE]: `Not found parent scope. use the global scope.`,
|
|
93
|
+
[I18nWarnCodes.IGNORE_OBJ_FLATTEN]: `Ignore object flatten: '{key}' key has an string value`,
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated will be removed at vue-i18n v12
|
|
96
|
+
*/
|
|
97
|
+
[I18nWarnCodes.DEPRECATE_LEGACY_MODE]: `Legacy API mode has been deprecated in v11. Use Composition API mode instead.
|
|
98
|
+
About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,
|
|
99
|
+
/**
|
|
100
|
+
* @deprecated will be removed at vue-i18n v12
|
|
101
|
+
*/
|
|
102
|
+
[I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]: `'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead.`
|
|
103
|
+
};
|
|
104
|
+
function getWarnMessage(code, ...args) {
|
|
105
|
+
return format(warnMessages[code], ...args);
|
|
106
|
+
}
|
|
107
|
+
function handleFlatJson(obj) {
|
|
108
|
+
if (!isObject(obj)) {
|
|
109
|
+
return obj;
|
|
110
|
+
}
|
|
111
|
+
if (isMessageAST(obj)) {
|
|
112
|
+
return obj;
|
|
113
|
+
}
|
|
114
|
+
for (const key in obj) {
|
|
115
|
+
if (!hasOwn(obj, key)) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (!key.includes(".")) {
|
|
119
|
+
if (isObject(obj[key])) {
|
|
120
|
+
handleFlatJson(obj[key]);
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
const subKeys = key.split(".");
|
|
124
|
+
const lastIndex = subKeys.length - 1;
|
|
125
|
+
let currentObj = obj;
|
|
126
|
+
let hasStringValue = false;
|
|
127
|
+
for (let i = 0; i < lastIndex; i++) {
|
|
128
|
+
if (subKeys[i] === "__proto__") {
|
|
129
|
+
throw new Error(`unsafe key: ${subKeys[i]}`);
|
|
130
|
+
}
|
|
131
|
+
if (!(subKeys[i] in currentObj)) {
|
|
132
|
+
currentObj[subKeys[i]] = create();
|
|
133
|
+
}
|
|
134
|
+
if (!isObject(currentObj[subKeys[i]])) {
|
|
135
|
+
process.env.NODE_ENV !== "production" && warn(getWarnMessage(I18nWarnCodes.IGNORE_OBJ_FLATTEN, {
|
|
136
|
+
key: subKeys[i]
|
|
137
|
+
}));
|
|
138
|
+
hasStringValue = true;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
currentObj = currentObj[subKeys[i]];
|
|
142
|
+
}
|
|
143
|
+
if (!hasStringValue) {
|
|
144
|
+
if (!isMessageAST(currentObj)) {
|
|
145
|
+
currentObj[subKeys[lastIndex]] = obj[key];
|
|
146
|
+
delete obj[key];
|
|
147
|
+
} else {
|
|
148
|
+
if (!AST_NODE_PROPS_KEYS.includes(subKeys[lastIndex])) {
|
|
149
|
+
delete obj[key];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (!isMessageAST(currentObj)) {
|
|
154
|
+
const target = currentObj[subKeys[lastIndex]];
|
|
155
|
+
if (isObject(target)) {
|
|
156
|
+
handleFlatJson(target);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return obj;
|
|
162
|
+
}
|
|
163
|
+
function getLocaleMessages(locale, options) {
|
|
164
|
+
const { messages, __i18n, messageResolver, flatJson } = options;
|
|
165
|
+
const ret = isPlainObject(messages) ? messages : isArray(__i18n) ? create() : { [locale]: create() };
|
|
166
|
+
if (isArray(__i18n)) {
|
|
167
|
+
__i18n.forEach((custom) => {
|
|
168
|
+
if ("locale" in custom && "resource" in custom) {
|
|
169
|
+
const { locale: locale2, resource } = custom;
|
|
170
|
+
if (locale2) {
|
|
171
|
+
ret[locale2] = ret[locale2] || create();
|
|
172
|
+
deepCopy(resource, ret[locale2]);
|
|
173
|
+
} else {
|
|
174
|
+
deepCopy(resource, ret);
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
isString(custom) && deepCopy(JSON.parse(custom), ret);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
if (messageResolver == null && flatJson) {
|
|
182
|
+
for (const key in ret) {
|
|
183
|
+
if (hasOwn(ret, key)) {
|
|
184
|
+
handleFlatJson(ret[key]);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return ret;
|
|
189
|
+
}
|
|
190
|
+
function getComponentOptions(instance) {
|
|
191
|
+
return instance.type;
|
|
192
|
+
}
|
|
193
|
+
function adjustI18nResources(gl, options, componentOptions) {
|
|
194
|
+
let messages = isObject(options.messages) ? options.messages : create();
|
|
195
|
+
if ("__i18nGlobal" in componentOptions) {
|
|
196
|
+
messages = getLocaleMessages(gl.locale.value, {
|
|
197
|
+
messages,
|
|
198
|
+
__i18n: componentOptions.__i18nGlobal
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
const locales = Object.keys(messages);
|
|
202
|
+
if (locales.length) {
|
|
203
|
+
locales.forEach((locale) => {
|
|
204
|
+
gl.mergeLocaleMessage(locale, messages[locale]);
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
{
|
|
208
|
+
if (isObject(options.datetimeFormats)) {
|
|
209
|
+
const locales2 = Object.keys(options.datetimeFormats);
|
|
210
|
+
if (locales2.length) {
|
|
211
|
+
locales2.forEach((locale) => {
|
|
212
|
+
gl.mergeDateTimeFormat(locale, options.datetimeFormats[locale]);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (isObject(options.numberFormats)) {
|
|
217
|
+
const locales2 = Object.keys(options.numberFormats);
|
|
218
|
+
if (locales2.length) {
|
|
219
|
+
locales2.forEach((locale) => {
|
|
220
|
+
gl.mergeNumberFormat(locale, options.numberFormats[locale]);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function createTextNode(key) {
|
|
227
|
+
return createVNode(Text, null, key, 0);
|
|
228
|
+
}
|
|
229
|
+
const DEVTOOLS_META = "__INTLIFY_META__";
|
|
230
|
+
const NOOP_RETURN_ARRAY = () => [];
|
|
231
|
+
const NOOP_RETURN_FALSE = () => false;
|
|
232
|
+
let composerID = 0;
|
|
233
|
+
function defineCoreMissingHandler(missing) {
|
|
234
|
+
return (ctx, locale, key, type) => {
|
|
235
|
+
return missing(locale, key, getCurrentInstance() || void 0, type);
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
const getMetaInfo = /* @__NO_SIDE_EFFECTS__ */ () => {
|
|
239
|
+
const instance = getCurrentInstance();
|
|
240
|
+
let meta = null;
|
|
241
|
+
return instance && (meta = getComponentOptions(instance)[DEVTOOLS_META]) ? { [DEVTOOLS_META]: meta } : null;
|
|
242
|
+
};
|
|
243
|
+
function createComposer(options = {}) {
|
|
244
|
+
const { __root, __injectWithOption } = options;
|
|
245
|
+
const _isGlobal = __root === void 0;
|
|
246
|
+
const flatJson = options.flatJson;
|
|
247
|
+
const _ref = inBrowser ? ref : shallowRef;
|
|
248
|
+
let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
|
|
249
|
+
const _locale = _ref(
|
|
250
|
+
// prettier-ignore
|
|
251
|
+
__root && _inheritLocale ? __root.locale.value : isString(options.locale) ? options.locale : DEFAULT_LOCALE
|
|
252
|
+
);
|
|
253
|
+
const _fallbackLocale = _ref(
|
|
254
|
+
// prettier-ignore
|
|
255
|
+
__root && _inheritLocale ? __root.fallbackLocale.value : isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value
|
|
256
|
+
);
|
|
257
|
+
const _messages = _ref(getLocaleMessages(_locale.value, options));
|
|
258
|
+
const _datetimeFormats = _ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
|
|
259
|
+
const _numberFormats = _ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
|
|
260
|
+
let _missingWarn = __root ? __root.missingWarn : isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
|
|
261
|
+
let _fallbackWarn = __root ? __root.fallbackWarn : isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
|
|
262
|
+
let _fallbackRoot = __root ? __root.fallbackRoot : isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
|
|
263
|
+
let _fallbackFormat = !!options.fallbackFormat;
|
|
264
|
+
let _missing = isFunction(options.missing) ? options.missing : null;
|
|
265
|
+
let _runtimeMissing = isFunction(options.missing) ? defineCoreMissingHandler(options.missing) : null;
|
|
266
|
+
let _postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null;
|
|
267
|
+
let _warnHtmlMessage = __root ? __root.warnHtmlMessage : isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
|
|
268
|
+
let _escapeParameter = !!options.escapeParameter;
|
|
269
|
+
const _modifiers = __root ? __root.modifiers : isPlainObject(options.modifiers) ? options.modifiers : {};
|
|
270
|
+
let _pluralRules = options.pluralRules || __root && __root.pluralRules;
|
|
271
|
+
let _context;
|
|
272
|
+
const getCoreContext = () => {
|
|
273
|
+
_isGlobal && setFallbackContext(null);
|
|
274
|
+
const ctxOptions = {
|
|
275
|
+
version: VERSION,
|
|
276
|
+
locale: _locale.value,
|
|
277
|
+
fallbackLocale: _fallbackLocale.value,
|
|
278
|
+
messages: _messages.value,
|
|
279
|
+
modifiers: _modifiers,
|
|
280
|
+
pluralRules: _pluralRules,
|
|
281
|
+
missing: _runtimeMissing === null ? void 0 : _runtimeMissing,
|
|
282
|
+
missingWarn: _missingWarn,
|
|
283
|
+
fallbackWarn: _fallbackWarn,
|
|
284
|
+
fallbackFormat: _fallbackFormat,
|
|
285
|
+
unresolving: true,
|
|
286
|
+
postTranslation: _postTranslation === null ? void 0 : _postTranslation,
|
|
287
|
+
warnHtmlMessage: _warnHtmlMessage,
|
|
288
|
+
escapeParameter: _escapeParameter,
|
|
289
|
+
messageResolver: options.messageResolver,
|
|
290
|
+
messageCompiler: options.messageCompiler,
|
|
291
|
+
__meta: { framework: "vue" }
|
|
292
|
+
};
|
|
293
|
+
{
|
|
294
|
+
ctxOptions.datetimeFormats = _datetimeFormats.value;
|
|
295
|
+
ctxOptions.numberFormats = _numberFormats.value;
|
|
296
|
+
ctxOptions.__datetimeFormatters = isPlainObject(_context) ? _context.__datetimeFormatters : void 0;
|
|
297
|
+
ctxOptions.__numberFormatters = isPlainObject(_context) ? _context.__numberFormatters : void 0;
|
|
298
|
+
}
|
|
299
|
+
if (process.env.NODE_ENV !== "production") {
|
|
300
|
+
ctxOptions.__v_emitter = isPlainObject(_context) ? _context.__v_emitter : void 0;
|
|
301
|
+
}
|
|
302
|
+
const ctx = createCoreContext(ctxOptions);
|
|
303
|
+
_isGlobal && setFallbackContext(ctx);
|
|
304
|
+
return ctx;
|
|
305
|
+
};
|
|
306
|
+
_context = getCoreContext();
|
|
307
|
+
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
|
|
308
|
+
const locale = computed({
|
|
309
|
+
get: () => _locale.value,
|
|
310
|
+
set: (val) => {
|
|
311
|
+
_context.locale = val;
|
|
312
|
+
_locale.value = val;
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
const fallbackLocale = computed({
|
|
316
|
+
get: () => _fallbackLocale.value,
|
|
317
|
+
set: (val) => {
|
|
318
|
+
_context.fallbackLocale = val;
|
|
319
|
+
_fallbackLocale.value = val;
|
|
320
|
+
updateFallbackLocale(_context, _locale.value, val);
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
const messages = computed(() => _messages.value);
|
|
324
|
+
const datetimeFormats = /* @__PURE__ */ computed(() => _datetimeFormats.value);
|
|
325
|
+
const numberFormats = /* @__PURE__ */ computed(() => _numberFormats.value);
|
|
326
|
+
function getPostTranslationHandler() {
|
|
327
|
+
return isFunction(_postTranslation) ? _postTranslation : null;
|
|
328
|
+
}
|
|
329
|
+
function setPostTranslationHandler(handler) {
|
|
330
|
+
_postTranslation = handler;
|
|
331
|
+
_context.postTranslation = handler;
|
|
332
|
+
}
|
|
333
|
+
function getMissingHandler() {
|
|
334
|
+
return _missing;
|
|
335
|
+
}
|
|
336
|
+
function setMissingHandler(handler) {
|
|
337
|
+
if (handler !== null) {
|
|
338
|
+
_runtimeMissing = defineCoreMissingHandler(handler);
|
|
339
|
+
}
|
|
340
|
+
_missing = handler;
|
|
341
|
+
_context.missing = _runtimeMissing;
|
|
342
|
+
}
|
|
343
|
+
function isResolvedTranslateMessage(type, arg) {
|
|
344
|
+
return type !== "translate" || !arg.resolvedMessage;
|
|
345
|
+
}
|
|
346
|
+
const wrapWithDeps = (fn, argumentParser, warnType, fallbackSuccess, fallbackFail, successCondition) => {
|
|
347
|
+
let ret;
|
|
348
|
+
try {
|
|
349
|
+
if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
|
|
350
|
+
setAdditionalMeta(/* @__PURE__ */ getMetaInfo());
|
|
351
|
+
}
|
|
352
|
+
if (!_isGlobal) {
|
|
353
|
+
_context.fallbackContext = __root ? getFallbackContext() : void 0;
|
|
354
|
+
}
|
|
355
|
+
ret = fn(_context);
|
|
356
|
+
} finally {
|
|
357
|
+
if (!_isGlobal) {
|
|
358
|
+
_context.fallbackContext = void 0;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (warnType !== "translate exists" && // for not `te` (e.g `t`)
|
|
362
|
+
isNumber(ret) && ret === NOT_REOSLVED || warnType === "translate exists" && !ret) {
|
|
363
|
+
const [key, arg2] = argumentParser();
|
|
364
|
+
if (process.env.NODE_ENV !== "production" && __root && isString(key) && isResolvedTranslateMessage(warnType, arg2)) {
|
|
365
|
+
if (_fallbackRoot && (isTranslateFallbackWarn(_fallbackWarn, key) || isTranslateMissingWarn(_missingWarn, key))) {
|
|
366
|
+
warn(getWarnMessage(I18nWarnCodes.FALLBACK_TO_ROOT, {
|
|
367
|
+
key,
|
|
368
|
+
type: warnType
|
|
369
|
+
}));
|
|
370
|
+
}
|
|
371
|
+
if (process.env.NODE_ENV !== "production") {
|
|
372
|
+
const { __v_emitter: emitter } = _context;
|
|
373
|
+
if (emitter && _fallbackRoot) {
|
|
374
|
+
emitter.emit("fallback", {
|
|
375
|
+
type: warnType,
|
|
376
|
+
key,
|
|
377
|
+
to: "global",
|
|
378
|
+
groupId: `${warnType}:${key}`
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return __root && _fallbackRoot ? fallbackSuccess(__root) : fallbackFail(key);
|
|
384
|
+
} else if (successCondition(ret)) {
|
|
385
|
+
return ret;
|
|
386
|
+
} else {
|
|
387
|
+
throw createI18nError(I18nErrorCodes.UNEXPECTED_RETURN_TYPE);
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
function t(...args) {
|
|
391
|
+
return wrapWithDeps((context) => Reflect.apply(translate, null, [context, ...args]), () => parseTranslateArgs(...args), "translate", (root) => Reflect.apply(root.t, root, [...args]), (key) => key, (val) => isString(val));
|
|
392
|
+
}
|
|
393
|
+
function rt(...args) {
|
|
394
|
+
const [arg1, arg2, arg3] = args;
|
|
395
|
+
if (arg3 && !isObject(arg3)) {
|
|
396
|
+
throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);
|
|
397
|
+
}
|
|
398
|
+
return t(...[arg1, arg2, assign({ resolvedMessage: true }, arg3 || {})]);
|
|
399
|
+
}
|
|
400
|
+
function d(...args) {
|
|
401
|
+
return wrapWithDeps((context) => Reflect.apply(datetime, null, [context, ...args]), () => parseDateTimeArgs(...args), "datetime format", (root) => Reflect.apply(root.d, root, [...args]), () => MISSING_RESOLVE_VALUE, (val) => isString(val) || isArray(val));
|
|
402
|
+
}
|
|
403
|
+
function n(...args) {
|
|
404
|
+
return wrapWithDeps((context) => Reflect.apply(number, null, [context, ...args]), () => parseNumberArgs(...args), "number format", (root) => Reflect.apply(root.n, root, [...args]), () => MISSING_RESOLVE_VALUE, (val) => isString(val) || isArray(val));
|
|
405
|
+
}
|
|
406
|
+
function normalize(values) {
|
|
407
|
+
return values.map((val) => isString(val) || isNumber(val) || isBoolean(val) ? createTextNode(String(val)) : val);
|
|
408
|
+
}
|
|
409
|
+
const interpolate = (val) => val;
|
|
410
|
+
const processor = {
|
|
411
|
+
normalize,
|
|
412
|
+
interpolate,
|
|
413
|
+
type: "vnode"
|
|
414
|
+
};
|
|
415
|
+
function translateVNode(...args) {
|
|
416
|
+
return wrapWithDeps((context) => {
|
|
417
|
+
let ret;
|
|
418
|
+
const _context2 = context;
|
|
419
|
+
try {
|
|
420
|
+
_context2.processor = processor;
|
|
421
|
+
ret = Reflect.apply(translate, null, [_context2, ...args]);
|
|
422
|
+
} finally {
|
|
423
|
+
_context2.processor = null;
|
|
424
|
+
}
|
|
425
|
+
return ret;
|
|
426
|
+
}, () => parseTranslateArgs(...args), "translate", (root) => root[TranslateVNodeSymbol](...args), (key) => [createTextNode(key)], (val) => isArray(val));
|
|
427
|
+
}
|
|
428
|
+
function numberParts(...args) {
|
|
429
|
+
return wrapWithDeps((context) => Reflect.apply(number, null, [context, ...args]), () => parseNumberArgs(...args), "number format", (root) => root[NumberPartsSymbol](...args), NOOP_RETURN_ARRAY, (val) => isString(val) || isArray(val));
|
|
430
|
+
}
|
|
431
|
+
function datetimeParts(...args) {
|
|
432
|
+
return wrapWithDeps((context) => Reflect.apply(datetime, null, [context, ...args]), () => parseDateTimeArgs(...args), "datetime format", (root) => root[DatetimePartsSymbol](...args), NOOP_RETURN_ARRAY, (val) => isString(val) || isArray(val));
|
|
433
|
+
}
|
|
434
|
+
function setPluralRules(rules) {
|
|
435
|
+
_pluralRules = rules;
|
|
436
|
+
_context.pluralRules = _pluralRules;
|
|
437
|
+
}
|
|
438
|
+
function te(key, locale2) {
|
|
439
|
+
return wrapWithDeps(() => {
|
|
440
|
+
if (!key) {
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
const targetLocale = isString(locale2) ? locale2 : _locale.value;
|
|
444
|
+
const message = getLocaleMessage(targetLocale);
|
|
445
|
+
const resolved = _context.messageResolver(message, key);
|
|
446
|
+
return isMessageAST(resolved) || isMessageFunction(resolved) || isString(resolved);
|
|
447
|
+
}, () => [key], "translate exists", (root) => {
|
|
448
|
+
return Reflect.apply(root.te, root, [key, locale2]);
|
|
449
|
+
}, NOOP_RETURN_FALSE, (val) => isBoolean(val));
|
|
450
|
+
}
|
|
451
|
+
function resolveMessages(key) {
|
|
452
|
+
let messages2 = null;
|
|
453
|
+
const locales = fallbackWithLocaleChain(_context, _fallbackLocale.value, _locale.value);
|
|
454
|
+
for (let i = 0; i < locales.length; i++) {
|
|
455
|
+
const targetLocaleMessages = _messages.value[locales[i]] || {};
|
|
456
|
+
const messageValue = _context.messageResolver(targetLocaleMessages, key);
|
|
457
|
+
if (messageValue != null) {
|
|
458
|
+
messages2 = messageValue;
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
return messages2;
|
|
463
|
+
}
|
|
464
|
+
function tm(key) {
|
|
465
|
+
const messages2 = resolveMessages(key);
|
|
466
|
+
return messages2 != null ? messages2 : __root ? __root.tm(key) || {} : {};
|
|
467
|
+
}
|
|
468
|
+
function getLocaleMessage(locale2) {
|
|
469
|
+
return _messages.value[locale2] || {};
|
|
470
|
+
}
|
|
471
|
+
function setLocaleMessage(locale2, message) {
|
|
472
|
+
if (flatJson) {
|
|
473
|
+
const _message = { [locale2]: message };
|
|
474
|
+
for (const key in _message) {
|
|
475
|
+
if (hasOwn(_message, key)) {
|
|
476
|
+
handleFlatJson(_message[key]);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
message = _message[locale2];
|
|
480
|
+
}
|
|
481
|
+
_messages.value[locale2] = message;
|
|
482
|
+
_context.messages = _messages.value;
|
|
483
|
+
}
|
|
484
|
+
function mergeLocaleMessage(locale2, message) {
|
|
485
|
+
_messages.value[locale2] = _messages.value[locale2] || {};
|
|
486
|
+
const _message = { [locale2]: message };
|
|
487
|
+
if (flatJson) {
|
|
488
|
+
for (const key in _message) {
|
|
489
|
+
if (hasOwn(_message, key)) {
|
|
490
|
+
handleFlatJson(_message[key]);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
message = _message[locale2];
|
|
495
|
+
deepCopy(message, _messages.value[locale2]);
|
|
496
|
+
_context.messages = _messages.value;
|
|
497
|
+
}
|
|
498
|
+
function getDateTimeFormat(locale2) {
|
|
499
|
+
return _datetimeFormats.value[locale2] || {};
|
|
500
|
+
}
|
|
501
|
+
function setDateTimeFormat(locale2, format2) {
|
|
502
|
+
_datetimeFormats.value[locale2] = format2;
|
|
503
|
+
_context.datetimeFormats = _datetimeFormats.value;
|
|
504
|
+
clearDateTimeFormat(_context, locale2, format2);
|
|
505
|
+
}
|
|
506
|
+
function mergeDateTimeFormat(locale2, format2) {
|
|
507
|
+
_datetimeFormats.value[locale2] = assign(_datetimeFormats.value[locale2] || {}, format2);
|
|
508
|
+
_context.datetimeFormats = _datetimeFormats.value;
|
|
509
|
+
clearDateTimeFormat(_context, locale2, format2);
|
|
510
|
+
}
|
|
511
|
+
function getNumberFormat(locale2) {
|
|
512
|
+
return _numberFormats.value[locale2] || {};
|
|
513
|
+
}
|
|
514
|
+
function setNumberFormat(locale2, format2) {
|
|
515
|
+
_numberFormats.value[locale2] = format2;
|
|
516
|
+
_context.numberFormats = _numberFormats.value;
|
|
517
|
+
clearNumberFormat(_context, locale2, format2);
|
|
518
|
+
}
|
|
519
|
+
function mergeNumberFormat(locale2, format2) {
|
|
520
|
+
_numberFormats.value[locale2] = assign(_numberFormats.value[locale2] || {}, format2);
|
|
521
|
+
_context.numberFormats = _numberFormats.value;
|
|
522
|
+
clearNumberFormat(_context, locale2, format2);
|
|
523
|
+
}
|
|
524
|
+
composerID++;
|
|
525
|
+
if (__root && inBrowser) {
|
|
526
|
+
watch(__root.locale, (val) => {
|
|
527
|
+
if (_inheritLocale) {
|
|
528
|
+
_locale.value = val;
|
|
529
|
+
_context.locale = val;
|
|
530
|
+
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
watch(__root.fallbackLocale, (val) => {
|
|
534
|
+
if (_inheritLocale) {
|
|
535
|
+
_fallbackLocale.value = val;
|
|
536
|
+
_context.fallbackLocale = val;
|
|
537
|
+
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
const composer = {
|
|
542
|
+
id: composerID,
|
|
543
|
+
locale,
|
|
544
|
+
fallbackLocale,
|
|
545
|
+
get inheritLocale() {
|
|
546
|
+
return _inheritLocale;
|
|
547
|
+
},
|
|
548
|
+
set inheritLocale(val) {
|
|
549
|
+
_inheritLocale = val;
|
|
550
|
+
if (val && __root) {
|
|
551
|
+
_locale.value = __root.locale.value;
|
|
552
|
+
_fallbackLocale.value = __root.fallbackLocale.value;
|
|
553
|
+
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
get availableLocales() {
|
|
557
|
+
return Object.keys(_messages.value).sort();
|
|
558
|
+
},
|
|
559
|
+
messages,
|
|
560
|
+
get modifiers() {
|
|
561
|
+
return _modifiers;
|
|
562
|
+
},
|
|
563
|
+
get pluralRules() {
|
|
564
|
+
return _pluralRules || {};
|
|
565
|
+
},
|
|
566
|
+
get isGlobal() {
|
|
567
|
+
return _isGlobal;
|
|
568
|
+
},
|
|
569
|
+
get missingWarn() {
|
|
570
|
+
return _missingWarn;
|
|
571
|
+
},
|
|
572
|
+
set missingWarn(val) {
|
|
573
|
+
_missingWarn = val;
|
|
574
|
+
_context.missingWarn = _missingWarn;
|
|
575
|
+
},
|
|
576
|
+
get fallbackWarn() {
|
|
577
|
+
return _fallbackWarn;
|
|
578
|
+
},
|
|
579
|
+
set fallbackWarn(val) {
|
|
580
|
+
_fallbackWarn = val;
|
|
581
|
+
_context.fallbackWarn = _fallbackWarn;
|
|
582
|
+
},
|
|
583
|
+
get fallbackRoot() {
|
|
584
|
+
return _fallbackRoot;
|
|
585
|
+
},
|
|
586
|
+
set fallbackRoot(val) {
|
|
587
|
+
_fallbackRoot = val;
|
|
588
|
+
},
|
|
589
|
+
get fallbackFormat() {
|
|
590
|
+
return _fallbackFormat;
|
|
591
|
+
},
|
|
592
|
+
set fallbackFormat(val) {
|
|
593
|
+
_fallbackFormat = val;
|
|
594
|
+
_context.fallbackFormat = _fallbackFormat;
|
|
595
|
+
},
|
|
596
|
+
get warnHtmlMessage() {
|
|
597
|
+
return _warnHtmlMessage;
|
|
598
|
+
},
|
|
599
|
+
set warnHtmlMessage(val) {
|
|
600
|
+
_warnHtmlMessage = val;
|
|
601
|
+
_context.warnHtmlMessage = val;
|
|
602
|
+
},
|
|
603
|
+
get escapeParameter() {
|
|
604
|
+
return _escapeParameter;
|
|
605
|
+
},
|
|
606
|
+
set escapeParameter(val) {
|
|
607
|
+
_escapeParameter = val;
|
|
608
|
+
_context.escapeParameter = val;
|
|
609
|
+
},
|
|
610
|
+
t,
|
|
611
|
+
getLocaleMessage,
|
|
612
|
+
setLocaleMessage,
|
|
613
|
+
mergeLocaleMessage,
|
|
614
|
+
getPostTranslationHandler,
|
|
615
|
+
setPostTranslationHandler,
|
|
616
|
+
getMissingHandler,
|
|
617
|
+
setMissingHandler,
|
|
618
|
+
[SetPluralRulesSymbol]: setPluralRules
|
|
619
|
+
};
|
|
620
|
+
{
|
|
621
|
+
composer.datetimeFormats = datetimeFormats;
|
|
622
|
+
composer.numberFormats = numberFormats;
|
|
623
|
+
composer.rt = rt;
|
|
624
|
+
composer.te = te;
|
|
625
|
+
composer.tm = tm;
|
|
626
|
+
composer.d = d;
|
|
627
|
+
composer.n = n;
|
|
628
|
+
composer.getDateTimeFormat = getDateTimeFormat;
|
|
629
|
+
composer.setDateTimeFormat = setDateTimeFormat;
|
|
630
|
+
composer.mergeDateTimeFormat = mergeDateTimeFormat;
|
|
631
|
+
composer.getNumberFormat = getNumberFormat;
|
|
632
|
+
composer.setNumberFormat = setNumberFormat;
|
|
633
|
+
composer.mergeNumberFormat = mergeNumberFormat;
|
|
634
|
+
composer[InejctWithOptionSymbol] = __injectWithOption;
|
|
635
|
+
composer[TranslateVNodeSymbol] = translateVNode;
|
|
636
|
+
composer[DatetimePartsSymbol] = datetimeParts;
|
|
637
|
+
composer[NumberPartsSymbol] = numberParts;
|
|
638
|
+
}
|
|
639
|
+
if (process.env.NODE_ENV !== "production") {
|
|
640
|
+
composer[EnableEmitter] = (emitter) => {
|
|
641
|
+
_context.__v_emitter = emitter;
|
|
642
|
+
};
|
|
643
|
+
composer[DisableEmitter] = () => {
|
|
644
|
+
_context.__v_emitter = void 0;
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
return composer;
|
|
648
|
+
}
|
|
649
|
+
const VUE_I18N_COMPONENT_TYPES = "vue-i18n: composer properties";
|
|
650
|
+
const VueDevToolsLabels = {
|
|
651
|
+
"vue-devtools-plugin-vue-i18n": "Vue I18n DevTools",
|
|
652
|
+
"vue-i18n-resource-inspector": "Vue I18n DevTools",
|
|
653
|
+
"vue-i18n-timeline": "Vue I18n"
|
|
654
|
+
};
|
|
655
|
+
const VueDevToolsPlaceholders = {
|
|
656
|
+
"vue-i18n-resource-inspector": "Search for scopes ..."
|
|
657
|
+
};
|
|
658
|
+
const VueDevToolsTimelineColors = {
|
|
659
|
+
"vue-i18n-timeline": 16764185
|
|
660
|
+
};
|
|
661
|
+
let devtoolsApi;
|
|
662
|
+
async function enableDevTools(app, i18n) {
|
|
663
|
+
return new Promise((resolve, reject) => {
|
|
664
|
+
try {
|
|
665
|
+
setupDevtoolsPlugin({
|
|
666
|
+
id: "vue-devtools-plugin-vue-i18n",
|
|
667
|
+
label: VueDevToolsLabels["vue-devtools-plugin-vue-i18n"],
|
|
668
|
+
packageName: "vue-i18n",
|
|
669
|
+
homepage: "https://vue-i18n.intlify.dev",
|
|
670
|
+
logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",
|
|
671
|
+
componentStateTypes: [VUE_I18N_COMPONENT_TYPES],
|
|
672
|
+
app
|
|
673
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
674
|
+
}, (api) => {
|
|
675
|
+
devtoolsApi = api;
|
|
676
|
+
api.on.visitComponentTree(({ componentInstance, treeNode }) => {
|
|
677
|
+
updateComponentTreeTags(componentInstance, treeNode, i18n);
|
|
678
|
+
});
|
|
679
|
+
api.on.inspectComponent(({ componentInstance, instanceData }) => {
|
|
680
|
+
if (componentInstance.vnode.el && componentInstance.vnode.el.__VUE_I18N__ && instanceData) {
|
|
681
|
+
if (i18n.mode === "legacy") {
|
|
682
|
+
if (componentInstance.vnode.el.__VUE_I18N__ !== i18n.global.__composer) {
|
|
683
|
+
inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
|
|
684
|
+
}
|
|
685
|
+
} else {
|
|
686
|
+
inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
api.addInspector({
|
|
691
|
+
id: "vue-i18n-resource-inspector",
|
|
692
|
+
label: VueDevToolsLabels["vue-i18n-resource-inspector"],
|
|
693
|
+
icon: "language",
|
|
694
|
+
treeFilterPlaceholder: VueDevToolsPlaceholders["vue-i18n-resource-inspector"]
|
|
695
|
+
});
|
|
696
|
+
api.on.getInspectorTree((payload) => {
|
|
697
|
+
if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
|
|
698
|
+
registerScope(payload, i18n);
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
const roots = /* @__PURE__ */ new Map();
|
|
702
|
+
api.on.getInspectorState(async (payload) => {
|
|
703
|
+
if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
|
|
704
|
+
api.unhighlightElement();
|
|
705
|
+
inspectScope(payload, i18n);
|
|
706
|
+
if (payload.nodeId === "global") {
|
|
707
|
+
if (!roots.has(payload.app)) {
|
|
708
|
+
const [root] = await api.getComponentInstances(payload.app);
|
|
709
|
+
roots.set(payload.app, root);
|
|
710
|
+
}
|
|
711
|
+
api.highlightElement(roots.get(payload.app));
|
|
712
|
+
} else {
|
|
713
|
+
const instance = getComponentInstance(payload.nodeId, i18n);
|
|
714
|
+
instance && api.highlightElement(instance);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
api.on.editInspectorState((payload) => {
|
|
719
|
+
if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
|
|
720
|
+
editScope(payload, i18n);
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
api.addTimelineLayer({
|
|
724
|
+
id: "vue-i18n-timeline",
|
|
725
|
+
label: VueDevToolsLabels["vue-i18n-timeline"],
|
|
726
|
+
color: VueDevToolsTimelineColors["vue-i18n-timeline"]
|
|
727
|
+
});
|
|
728
|
+
resolve(true);
|
|
729
|
+
});
|
|
730
|
+
} catch (e) {
|
|
731
|
+
console.error(e);
|
|
732
|
+
reject(false);
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
function getI18nScopeLable(instance) {
|
|
737
|
+
return instance.type.name || instance.type.displayName || instance.type.__file || "Anonymous";
|
|
738
|
+
}
|
|
739
|
+
function updateComponentTreeTags(instance, treeNode, i18n) {
|
|
740
|
+
const global = i18n.mode === "composition" ? i18n.global : i18n.global.__composer;
|
|
741
|
+
if (instance && instance.vnode.el && instance.vnode.el.__VUE_I18N__) {
|
|
742
|
+
if (instance.vnode.el.__VUE_I18N__ !== global) {
|
|
743
|
+
const tag = {
|
|
744
|
+
label: `i18n (${getI18nScopeLable(instance)} Scope)`,
|
|
745
|
+
textColor: 0,
|
|
746
|
+
backgroundColor: 16764185
|
|
747
|
+
};
|
|
748
|
+
treeNode.tags.push(tag);
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
function inspectComposer(instanceData, composer) {
|
|
753
|
+
const type = VUE_I18N_COMPONENT_TYPES;
|
|
754
|
+
instanceData.state.push({
|
|
755
|
+
type,
|
|
756
|
+
key: "locale",
|
|
757
|
+
editable: true,
|
|
758
|
+
value: composer.locale.value
|
|
759
|
+
});
|
|
760
|
+
instanceData.state.push({
|
|
761
|
+
type,
|
|
762
|
+
key: "availableLocales",
|
|
763
|
+
editable: false,
|
|
764
|
+
value: composer.availableLocales
|
|
765
|
+
});
|
|
766
|
+
instanceData.state.push({
|
|
767
|
+
type,
|
|
768
|
+
key: "fallbackLocale",
|
|
769
|
+
editable: true,
|
|
770
|
+
value: composer.fallbackLocale.value
|
|
771
|
+
});
|
|
772
|
+
instanceData.state.push({
|
|
773
|
+
type,
|
|
774
|
+
key: "inheritLocale",
|
|
775
|
+
editable: true,
|
|
776
|
+
value: composer.inheritLocale
|
|
777
|
+
});
|
|
778
|
+
instanceData.state.push({
|
|
779
|
+
type,
|
|
780
|
+
key: "messages",
|
|
781
|
+
editable: false,
|
|
782
|
+
value: getLocaleMessageValue(composer.messages.value)
|
|
783
|
+
});
|
|
784
|
+
{
|
|
785
|
+
instanceData.state.push({
|
|
786
|
+
type,
|
|
787
|
+
key: "datetimeFormats",
|
|
788
|
+
editable: false,
|
|
789
|
+
value: composer.datetimeFormats.value
|
|
790
|
+
});
|
|
791
|
+
instanceData.state.push({
|
|
792
|
+
type,
|
|
793
|
+
key: "numberFormats",
|
|
794
|
+
editable: false,
|
|
795
|
+
value: composer.numberFormats.value
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
function getLocaleMessageValue(messages) {
|
|
800
|
+
const value = {};
|
|
801
|
+
Object.keys(messages).forEach((key) => {
|
|
802
|
+
const v = messages[key];
|
|
803
|
+
if (isFunction(v) && "source" in v) {
|
|
804
|
+
value[key] = getMessageFunctionDetails(v);
|
|
805
|
+
} else if (isMessageAST(v) && v.loc && v.loc.source) {
|
|
806
|
+
value[key] = v.loc.source;
|
|
807
|
+
} else if (isObject(v)) {
|
|
808
|
+
value[key] = getLocaleMessageValue(v);
|
|
809
|
+
} else {
|
|
810
|
+
value[key] = v;
|
|
811
|
+
}
|
|
812
|
+
});
|
|
813
|
+
return value;
|
|
814
|
+
}
|
|
815
|
+
const ESC = {
|
|
816
|
+
"<": "<",
|
|
817
|
+
">": ">",
|
|
818
|
+
'"': """,
|
|
819
|
+
"&": "&"
|
|
820
|
+
};
|
|
821
|
+
function escape(s) {
|
|
822
|
+
return s.replace(/[<>"&]/g, escapeChar);
|
|
823
|
+
}
|
|
824
|
+
function escapeChar(a) {
|
|
825
|
+
return ESC[a] || a;
|
|
826
|
+
}
|
|
827
|
+
function getMessageFunctionDetails(func) {
|
|
828
|
+
const argString = func.source ? `("${escape(func.source)}")` : `(?)`;
|
|
829
|
+
return {
|
|
830
|
+
_custom: {
|
|
831
|
+
type: "function",
|
|
832
|
+
display: `<span>ƒ</span> ${argString}`
|
|
833
|
+
}
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
function registerScope(payload, i18n) {
|
|
837
|
+
payload.rootNodes.push({
|
|
838
|
+
id: "global",
|
|
839
|
+
label: "Global Scope"
|
|
840
|
+
});
|
|
841
|
+
const global = i18n.mode === "composition" ? i18n.global : i18n.global.__composer;
|
|
842
|
+
for (const [keyInstance, instance] of i18n.__instances) {
|
|
843
|
+
const composer = i18n.mode === "composition" ? instance : instance.__composer;
|
|
844
|
+
if (global === composer) {
|
|
845
|
+
continue;
|
|
846
|
+
}
|
|
847
|
+
payload.rootNodes.push({
|
|
848
|
+
id: composer.id.toString(),
|
|
849
|
+
label: `${getI18nScopeLable(keyInstance)} Scope`
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
function getComponentInstance(nodeId, i18n) {
|
|
854
|
+
let instance = null;
|
|
855
|
+
if (nodeId !== "global") {
|
|
856
|
+
for (const [component, composer] of i18n.__instances.entries()) {
|
|
857
|
+
if (composer.id.toString() === nodeId) {
|
|
858
|
+
instance = component;
|
|
859
|
+
break;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
return instance;
|
|
864
|
+
}
|
|
865
|
+
function getComposer$2(nodeId, i18n) {
|
|
866
|
+
if (nodeId === "global") {
|
|
867
|
+
return i18n.mode === "composition" ? i18n.global : i18n.global.__composer;
|
|
868
|
+
} else {
|
|
869
|
+
const instance = Array.from(i18n.__instances.values()).find((item) => item.id.toString() === nodeId);
|
|
870
|
+
if (instance) {
|
|
871
|
+
return i18n.mode === "composition" ? instance : instance.__composer;
|
|
872
|
+
} else {
|
|
873
|
+
return null;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
function inspectScope(payload, i18n) {
|
|
878
|
+
const composer = getComposer$2(payload.nodeId, i18n);
|
|
879
|
+
if (composer) {
|
|
880
|
+
payload.state = makeScopeInspectState(composer);
|
|
881
|
+
}
|
|
882
|
+
return null;
|
|
883
|
+
}
|
|
884
|
+
function makeScopeInspectState(composer) {
|
|
885
|
+
const state = {};
|
|
886
|
+
const localeType = "Locale related info";
|
|
887
|
+
const localeStates = [
|
|
888
|
+
{
|
|
889
|
+
type: localeType,
|
|
890
|
+
key: "locale",
|
|
891
|
+
editable: true,
|
|
892
|
+
value: composer.locale.value
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
type: localeType,
|
|
896
|
+
key: "fallbackLocale",
|
|
897
|
+
editable: true,
|
|
898
|
+
value: composer.fallbackLocale.value
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
type: localeType,
|
|
902
|
+
key: "availableLocales",
|
|
903
|
+
editable: false,
|
|
904
|
+
value: composer.availableLocales
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
type: localeType,
|
|
908
|
+
key: "inheritLocale",
|
|
909
|
+
editable: true,
|
|
910
|
+
value: composer.inheritLocale
|
|
911
|
+
}
|
|
912
|
+
];
|
|
913
|
+
state[localeType] = localeStates;
|
|
914
|
+
const localeMessagesType = "Locale messages info";
|
|
915
|
+
const localeMessagesStates = [
|
|
916
|
+
{
|
|
917
|
+
type: localeMessagesType,
|
|
918
|
+
key: "messages",
|
|
919
|
+
editable: false,
|
|
920
|
+
value: getLocaleMessageValue(composer.messages.value)
|
|
921
|
+
}
|
|
922
|
+
];
|
|
923
|
+
state[localeMessagesType] = localeMessagesStates;
|
|
924
|
+
{
|
|
925
|
+
const datetimeFormatsType = "Datetime formats info";
|
|
926
|
+
const datetimeFormatsStates = [
|
|
927
|
+
{
|
|
928
|
+
type: datetimeFormatsType,
|
|
929
|
+
key: "datetimeFormats",
|
|
930
|
+
editable: false,
|
|
931
|
+
value: composer.datetimeFormats.value
|
|
932
|
+
}
|
|
933
|
+
];
|
|
934
|
+
state[datetimeFormatsType] = datetimeFormatsStates;
|
|
935
|
+
const numberFormatsType = "Datetime formats info";
|
|
936
|
+
const numberFormatsStates = [
|
|
937
|
+
{
|
|
938
|
+
type: numberFormatsType,
|
|
939
|
+
key: "numberFormats",
|
|
940
|
+
editable: false,
|
|
941
|
+
value: composer.numberFormats.value
|
|
942
|
+
}
|
|
943
|
+
];
|
|
944
|
+
state[numberFormatsType] = numberFormatsStates;
|
|
945
|
+
}
|
|
946
|
+
return state;
|
|
947
|
+
}
|
|
948
|
+
function addTimelineEvent(event, payload) {
|
|
949
|
+
if (devtoolsApi) {
|
|
950
|
+
let groupId;
|
|
951
|
+
if (payload && "groupId" in payload) {
|
|
952
|
+
groupId = payload.groupId;
|
|
953
|
+
delete payload.groupId;
|
|
954
|
+
}
|
|
955
|
+
devtoolsApi.addTimelineEvent({
|
|
956
|
+
layerId: "vue-i18n-timeline",
|
|
957
|
+
event: {
|
|
958
|
+
title: event,
|
|
959
|
+
groupId,
|
|
960
|
+
time: Date.now(),
|
|
961
|
+
meta: {},
|
|
962
|
+
data: payload || {},
|
|
963
|
+
logType: event === "compile-error" ? "error" : event === "fallback" || event === "missing" ? "warning" : "default"
|
|
964
|
+
}
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
function editScope(payload, i18n) {
|
|
969
|
+
const composer = getComposer$2(payload.nodeId, i18n);
|
|
970
|
+
if (composer) {
|
|
971
|
+
const [field] = payload.path;
|
|
972
|
+
if (field === "locale" && isString(payload.state.value)) {
|
|
973
|
+
composer.locale.value = payload.state.value;
|
|
974
|
+
} else if (field === "fallbackLocale" && (isString(payload.state.value) || isArray(payload.state.value) || isObject(payload.state.value))) {
|
|
975
|
+
composer.fallbackLocale.value = payload.state.value;
|
|
976
|
+
} else if (field === "inheritLocale" && isBoolean(payload.state.value)) {
|
|
977
|
+
composer.inheritLocale = payload.state.value;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
function convertComposerOptions(options) {
|
|
982
|
+
const locale = isString(options.locale) ? options.locale : DEFAULT_LOCALE;
|
|
983
|
+
const fallbackLocale = isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : locale;
|
|
984
|
+
const missing = isFunction(options.missing) ? options.missing : void 0;
|
|
985
|
+
const missingWarn = isBoolean(options.silentTranslationWarn) || isRegExp(options.silentTranslationWarn) ? !options.silentTranslationWarn : true;
|
|
986
|
+
const fallbackWarn = isBoolean(options.silentFallbackWarn) || isRegExp(options.silentFallbackWarn) ? !options.silentFallbackWarn : true;
|
|
987
|
+
const fallbackRoot = isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
|
|
988
|
+
const fallbackFormat = !!options.formatFallbackMessages;
|
|
989
|
+
const modifiers = isPlainObject(options.modifiers) ? options.modifiers : {};
|
|
990
|
+
const pluralizationRules = options.pluralizationRules;
|
|
991
|
+
const postTranslation = isFunction(options.postTranslation) ? options.postTranslation : void 0;
|
|
992
|
+
const warnHtmlMessage = isString(options.warnHtmlInMessage) ? options.warnHtmlInMessage !== "off" : true;
|
|
993
|
+
const escapeParameter = !!options.escapeParameterHtml;
|
|
994
|
+
const inheritLocale = isBoolean(options.sync) ? options.sync : true;
|
|
995
|
+
let messages = options.messages;
|
|
996
|
+
if (isPlainObject(options.sharedMessages)) {
|
|
997
|
+
const sharedMessages = options.sharedMessages;
|
|
998
|
+
const locales = Object.keys(sharedMessages);
|
|
999
|
+
messages = locales.reduce((messages2, locale2) => {
|
|
1000
|
+
const message = messages2[locale2] || (messages2[locale2] = {});
|
|
1001
|
+
assign(message, sharedMessages[locale2]);
|
|
1002
|
+
return messages2;
|
|
1003
|
+
}, messages || {});
|
|
1004
|
+
}
|
|
1005
|
+
const { __i18n, __root, __injectWithOption } = options;
|
|
1006
|
+
const datetimeFormats = options.datetimeFormats;
|
|
1007
|
+
const numberFormats = options.numberFormats;
|
|
1008
|
+
const flatJson = options.flatJson;
|
|
1009
|
+
return {
|
|
1010
|
+
locale,
|
|
1011
|
+
fallbackLocale,
|
|
1012
|
+
messages,
|
|
1013
|
+
flatJson,
|
|
1014
|
+
datetimeFormats,
|
|
1015
|
+
numberFormats,
|
|
1016
|
+
missing,
|
|
1017
|
+
missingWarn,
|
|
1018
|
+
fallbackWarn,
|
|
1019
|
+
fallbackRoot,
|
|
1020
|
+
fallbackFormat,
|
|
1021
|
+
modifiers,
|
|
1022
|
+
pluralRules: pluralizationRules,
|
|
1023
|
+
postTranslation,
|
|
1024
|
+
warnHtmlMessage,
|
|
1025
|
+
escapeParameter,
|
|
1026
|
+
messageResolver: options.messageResolver,
|
|
1027
|
+
inheritLocale,
|
|
1028
|
+
__i18n,
|
|
1029
|
+
__root,
|
|
1030
|
+
__injectWithOption
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
function createVueI18n(options = {}) {
|
|
1034
|
+
const composer = createComposer(convertComposerOptions(options));
|
|
1035
|
+
const { __extender } = options;
|
|
1036
|
+
const vueI18n = {
|
|
1037
|
+
// id
|
|
1038
|
+
id: composer.id,
|
|
1039
|
+
// locale
|
|
1040
|
+
get locale() {
|
|
1041
|
+
return composer.locale.value;
|
|
1042
|
+
},
|
|
1043
|
+
set locale(val) {
|
|
1044
|
+
composer.locale.value = val;
|
|
1045
|
+
},
|
|
1046
|
+
// fallbackLocale
|
|
1047
|
+
get fallbackLocale() {
|
|
1048
|
+
return composer.fallbackLocale.value;
|
|
1049
|
+
},
|
|
1050
|
+
set fallbackLocale(val) {
|
|
1051
|
+
composer.fallbackLocale.value = val;
|
|
1052
|
+
},
|
|
1053
|
+
// messages
|
|
1054
|
+
get messages() {
|
|
1055
|
+
return composer.messages.value;
|
|
1056
|
+
},
|
|
1057
|
+
// datetimeFormats
|
|
1058
|
+
get datetimeFormats() {
|
|
1059
|
+
return composer.datetimeFormats.value;
|
|
1060
|
+
},
|
|
1061
|
+
// numberFormats
|
|
1062
|
+
get numberFormats() {
|
|
1063
|
+
return composer.numberFormats.value;
|
|
1064
|
+
},
|
|
1065
|
+
// availableLocales
|
|
1066
|
+
get availableLocales() {
|
|
1067
|
+
return composer.availableLocales;
|
|
1068
|
+
},
|
|
1069
|
+
// missing
|
|
1070
|
+
get missing() {
|
|
1071
|
+
return composer.getMissingHandler();
|
|
1072
|
+
},
|
|
1073
|
+
set missing(handler) {
|
|
1074
|
+
composer.setMissingHandler(handler);
|
|
1075
|
+
},
|
|
1076
|
+
// silentTranslationWarn
|
|
1077
|
+
get silentTranslationWarn() {
|
|
1078
|
+
return isBoolean(composer.missingWarn) ? !composer.missingWarn : composer.missingWarn;
|
|
1079
|
+
},
|
|
1080
|
+
set silentTranslationWarn(val) {
|
|
1081
|
+
composer.missingWarn = isBoolean(val) ? !val : val;
|
|
1082
|
+
},
|
|
1083
|
+
// silentFallbackWarn
|
|
1084
|
+
get silentFallbackWarn() {
|
|
1085
|
+
return isBoolean(composer.fallbackWarn) ? !composer.fallbackWarn : composer.fallbackWarn;
|
|
1086
|
+
},
|
|
1087
|
+
set silentFallbackWarn(val) {
|
|
1088
|
+
composer.fallbackWarn = isBoolean(val) ? !val : val;
|
|
1089
|
+
},
|
|
1090
|
+
// modifiers
|
|
1091
|
+
get modifiers() {
|
|
1092
|
+
return composer.modifiers;
|
|
1093
|
+
},
|
|
1094
|
+
// formatFallbackMessages
|
|
1095
|
+
get formatFallbackMessages() {
|
|
1096
|
+
return composer.fallbackFormat;
|
|
1097
|
+
},
|
|
1098
|
+
set formatFallbackMessages(val) {
|
|
1099
|
+
composer.fallbackFormat = val;
|
|
1100
|
+
},
|
|
1101
|
+
// postTranslation
|
|
1102
|
+
get postTranslation() {
|
|
1103
|
+
return composer.getPostTranslationHandler();
|
|
1104
|
+
},
|
|
1105
|
+
set postTranslation(handler) {
|
|
1106
|
+
composer.setPostTranslationHandler(handler);
|
|
1107
|
+
},
|
|
1108
|
+
// sync
|
|
1109
|
+
get sync() {
|
|
1110
|
+
return composer.inheritLocale;
|
|
1111
|
+
},
|
|
1112
|
+
set sync(val) {
|
|
1113
|
+
composer.inheritLocale = val;
|
|
1114
|
+
},
|
|
1115
|
+
// warnInHtmlMessage
|
|
1116
|
+
get warnHtmlInMessage() {
|
|
1117
|
+
return composer.warnHtmlMessage ? "warn" : "off";
|
|
1118
|
+
},
|
|
1119
|
+
set warnHtmlInMessage(val) {
|
|
1120
|
+
composer.warnHtmlMessage = val !== "off";
|
|
1121
|
+
},
|
|
1122
|
+
// escapeParameterHtml
|
|
1123
|
+
get escapeParameterHtml() {
|
|
1124
|
+
return composer.escapeParameter;
|
|
1125
|
+
},
|
|
1126
|
+
set escapeParameterHtml(val) {
|
|
1127
|
+
composer.escapeParameter = val;
|
|
1128
|
+
},
|
|
1129
|
+
// pluralizationRules
|
|
1130
|
+
get pluralizationRules() {
|
|
1131
|
+
return composer.pluralRules || {};
|
|
1132
|
+
},
|
|
1133
|
+
// for internal
|
|
1134
|
+
__composer: composer,
|
|
1135
|
+
// t
|
|
1136
|
+
t(...args) {
|
|
1137
|
+
return Reflect.apply(composer.t, composer, [...args]);
|
|
1138
|
+
},
|
|
1139
|
+
// rt
|
|
1140
|
+
rt(...args) {
|
|
1141
|
+
return Reflect.apply(composer.rt, composer, [...args]);
|
|
1142
|
+
},
|
|
1143
|
+
// te
|
|
1144
|
+
te(key, locale) {
|
|
1145
|
+
return composer.te(key, locale);
|
|
1146
|
+
},
|
|
1147
|
+
// tm
|
|
1148
|
+
tm(key) {
|
|
1149
|
+
return composer.tm(key);
|
|
1150
|
+
},
|
|
1151
|
+
// getLocaleMessage
|
|
1152
|
+
getLocaleMessage(locale) {
|
|
1153
|
+
return composer.getLocaleMessage(locale);
|
|
1154
|
+
},
|
|
1155
|
+
// setLocaleMessage
|
|
1156
|
+
setLocaleMessage(locale, message) {
|
|
1157
|
+
composer.setLocaleMessage(locale, message);
|
|
1158
|
+
},
|
|
1159
|
+
// mergeLocaleMessage
|
|
1160
|
+
mergeLocaleMessage(locale, message) {
|
|
1161
|
+
composer.mergeLocaleMessage(locale, message);
|
|
1162
|
+
},
|
|
1163
|
+
// d
|
|
1164
|
+
d(...args) {
|
|
1165
|
+
return Reflect.apply(composer.d, composer, [...args]);
|
|
1166
|
+
},
|
|
1167
|
+
// getDateTimeFormat
|
|
1168
|
+
getDateTimeFormat(locale) {
|
|
1169
|
+
return composer.getDateTimeFormat(locale);
|
|
1170
|
+
},
|
|
1171
|
+
// setDateTimeFormat
|
|
1172
|
+
setDateTimeFormat(locale, format2) {
|
|
1173
|
+
composer.setDateTimeFormat(locale, format2);
|
|
1174
|
+
},
|
|
1175
|
+
// mergeDateTimeFormat
|
|
1176
|
+
mergeDateTimeFormat(locale, format2) {
|
|
1177
|
+
composer.mergeDateTimeFormat(locale, format2);
|
|
1178
|
+
},
|
|
1179
|
+
// n
|
|
1180
|
+
n(...args) {
|
|
1181
|
+
return Reflect.apply(composer.n, composer, [...args]);
|
|
1182
|
+
},
|
|
1183
|
+
// getNumberFormat
|
|
1184
|
+
getNumberFormat(locale) {
|
|
1185
|
+
return composer.getNumberFormat(locale);
|
|
1186
|
+
},
|
|
1187
|
+
// setNumberFormat
|
|
1188
|
+
setNumberFormat(locale, format2) {
|
|
1189
|
+
composer.setNumberFormat(locale, format2);
|
|
1190
|
+
},
|
|
1191
|
+
// mergeNumberFormat
|
|
1192
|
+
mergeNumberFormat(locale, format2) {
|
|
1193
|
+
composer.mergeNumberFormat(locale, format2);
|
|
1194
|
+
}
|
|
1195
|
+
};
|
|
1196
|
+
vueI18n.__extender = __extender;
|
|
1197
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1198
|
+
vueI18n.__enableEmitter = (emitter) => {
|
|
1199
|
+
const __composer = composer;
|
|
1200
|
+
__composer[EnableEmitter] && __composer[EnableEmitter](emitter);
|
|
1201
|
+
};
|
|
1202
|
+
vueI18n.__disableEmitter = () => {
|
|
1203
|
+
const __composer = composer;
|
|
1204
|
+
__composer[DisableEmitter] && __composer[DisableEmitter]();
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
return vueI18n;
|
|
1208
|
+
}
|
|
1209
|
+
function defineMixin(vuei18n, composer, i18n) {
|
|
1210
|
+
return {
|
|
1211
|
+
beforeCreate() {
|
|
1212
|
+
const instance = getCurrentInstance();
|
|
1213
|
+
if (!instance) {
|
|
1214
|
+
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
1215
|
+
}
|
|
1216
|
+
const options = this.$options;
|
|
1217
|
+
if (options.i18n) {
|
|
1218
|
+
const optionsI18n = options.i18n;
|
|
1219
|
+
if (options.__i18n) {
|
|
1220
|
+
optionsI18n.__i18n = options.__i18n;
|
|
1221
|
+
}
|
|
1222
|
+
optionsI18n.__root = composer;
|
|
1223
|
+
if (this === this.$root) {
|
|
1224
|
+
this.$i18n = mergeToGlobal(vuei18n, optionsI18n);
|
|
1225
|
+
} else {
|
|
1226
|
+
optionsI18n.__injectWithOption = true;
|
|
1227
|
+
optionsI18n.__extender = i18n.__vueI18nExtend;
|
|
1228
|
+
this.$i18n = createVueI18n(optionsI18n);
|
|
1229
|
+
const _vueI18n = this.$i18n;
|
|
1230
|
+
if (_vueI18n.__extender) {
|
|
1231
|
+
_vueI18n.__disposer = _vueI18n.__extender(this.$i18n);
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
} else if (options.__i18n) {
|
|
1235
|
+
if (this === this.$root) {
|
|
1236
|
+
this.$i18n = mergeToGlobal(vuei18n, options);
|
|
1237
|
+
} else {
|
|
1238
|
+
this.$i18n = createVueI18n({
|
|
1239
|
+
__i18n: options.__i18n,
|
|
1240
|
+
__injectWithOption: true,
|
|
1241
|
+
__extender: i18n.__vueI18nExtend,
|
|
1242
|
+
__root: composer
|
|
1243
|
+
});
|
|
1244
|
+
const _vueI18n = this.$i18n;
|
|
1245
|
+
if (_vueI18n.__extender) {
|
|
1246
|
+
_vueI18n.__disposer = _vueI18n.__extender(this.$i18n);
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
} else {
|
|
1250
|
+
this.$i18n = vuei18n;
|
|
1251
|
+
}
|
|
1252
|
+
if (options.__i18nGlobal) {
|
|
1253
|
+
adjustI18nResources(composer, options, options);
|
|
1254
|
+
}
|
|
1255
|
+
this.$t = (...args) => this.$i18n.t(...args);
|
|
1256
|
+
this.$rt = (...args) => this.$i18n.rt(...args);
|
|
1257
|
+
this.$te = (key, locale) => this.$i18n.te(key, locale);
|
|
1258
|
+
this.$d = (...args) => this.$i18n.d(...args);
|
|
1259
|
+
this.$n = (...args) => this.$i18n.n(...args);
|
|
1260
|
+
this.$tm = (key) => this.$i18n.tm(key);
|
|
1261
|
+
i18n.__setInstance(instance, this.$i18n);
|
|
1262
|
+
},
|
|
1263
|
+
mounted() {
|
|
1264
|
+
if ((process.env.NODE_ENV !== "production" || false) && true && this.$el && this.$i18n) {
|
|
1265
|
+
const _vueI18n = this.$i18n;
|
|
1266
|
+
this.$el.__VUE_I18N__ = _vueI18n.__composer;
|
|
1267
|
+
const emitter = this.__v_emitter = createEmitter();
|
|
1268
|
+
_vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
|
|
1269
|
+
emitter.on("*", addTimelineEvent);
|
|
1270
|
+
}
|
|
1271
|
+
},
|
|
1272
|
+
unmounted() {
|
|
1273
|
+
const instance = getCurrentInstance();
|
|
1274
|
+
if (!instance) {
|
|
1275
|
+
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
1276
|
+
}
|
|
1277
|
+
const _vueI18n = this.$i18n;
|
|
1278
|
+
if ((process.env.NODE_ENV !== "production" || false) && true && this.$el && this.$el.__VUE_I18N__) {
|
|
1279
|
+
if (this.__v_emitter) {
|
|
1280
|
+
this.__v_emitter.off("*", addTimelineEvent);
|
|
1281
|
+
delete this.__v_emitter;
|
|
1282
|
+
}
|
|
1283
|
+
if (this.$i18n) {
|
|
1284
|
+
_vueI18n.__disableEmitter && _vueI18n.__disableEmitter();
|
|
1285
|
+
delete this.$el.__VUE_I18N__;
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
delete this.$t;
|
|
1289
|
+
delete this.$rt;
|
|
1290
|
+
delete this.$te;
|
|
1291
|
+
delete this.$d;
|
|
1292
|
+
delete this.$n;
|
|
1293
|
+
delete this.$tm;
|
|
1294
|
+
if (_vueI18n.__disposer) {
|
|
1295
|
+
_vueI18n.__disposer();
|
|
1296
|
+
delete _vueI18n.__disposer;
|
|
1297
|
+
delete _vueI18n.__extender;
|
|
1298
|
+
}
|
|
1299
|
+
i18n.__deleteInstance(instance);
|
|
1300
|
+
delete this.$i18n;
|
|
1301
|
+
}
|
|
1302
|
+
};
|
|
1303
|
+
}
|
|
1304
|
+
function mergeToGlobal(g, options) {
|
|
1305
|
+
g.locale = options.locale || g.locale;
|
|
1306
|
+
g.fallbackLocale = options.fallbackLocale || g.fallbackLocale;
|
|
1307
|
+
g.missing = options.missing || g.missing;
|
|
1308
|
+
g.silentTranslationWarn = options.silentTranslationWarn || g.silentFallbackWarn;
|
|
1309
|
+
g.silentFallbackWarn = options.silentFallbackWarn || g.silentFallbackWarn;
|
|
1310
|
+
g.formatFallbackMessages = options.formatFallbackMessages || g.formatFallbackMessages;
|
|
1311
|
+
g.postTranslation = options.postTranslation || g.postTranslation;
|
|
1312
|
+
g.warnHtmlInMessage = options.warnHtmlInMessage || g.warnHtmlInMessage;
|
|
1313
|
+
g.escapeParameterHtml = options.escapeParameterHtml || g.escapeParameterHtml;
|
|
1314
|
+
g.sync = options.sync || g.sync;
|
|
1315
|
+
g.__composer[SetPluralRulesSymbol](options.pluralizationRules || g.pluralizationRules);
|
|
1316
|
+
const messages = getLocaleMessages(g.locale, {
|
|
1317
|
+
messages: options.messages,
|
|
1318
|
+
__i18n: options.__i18n
|
|
1319
|
+
});
|
|
1320
|
+
Object.keys(messages).forEach((locale) => g.mergeLocaleMessage(locale, messages[locale]));
|
|
1321
|
+
if (options.datetimeFormats) {
|
|
1322
|
+
Object.keys(options.datetimeFormats).forEach((locale) => g.mergeDateTimeFormat(locale, options.datetimeFormats[locale]));
|
|
1323
|
+
}
|
|
1324
|
+
if (options.numberFormats) {
|
|
1325
|
+
Object.keys(options.numberFormats).forEach((locale) => g.mergeNumberFormat(locale, options.numberFormats[locale]));
|
|
1326
|
+
}
|
|
1327
|
+
return g;
|
|
1328
|
+
}
|
|
1329
|
+
const baseFormatProps = {
|
|
1330
|
+
tag: {
|
|
1331
|
+
type: [String, Object]
|
|
1332
|
+
},
|
|
1333
|
+
locale: {
|
|
1334
|
+
type: String
|
|
1335
|
+
},
|
|
1336
|
+
scope: {
|
|
1337
|
+
type: String,
|
|
1338
|
+
// NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
|
|
1339
|
+
validator: (val) => val === "parent" || val === "global",
|
|
1340
|
+
default: "parent"
|
|
1341
|
+
/* ComponentI18nScope */
|
|
1342
|
+
},
|
|
1343
|
+
i18n: {
|
|
1344
|
+
type: Object
|
|
1345
|
+
}
|
|
1346
|
+
};
|
|
1347
|
+
function getInterpolateArg({ slots }, keys) {
|
|
1348
|
+
if (keys.length === 1 && keys[0] === "default") {
|
|
1349
|
+
const ret = slots.default ? slots.default() : [];
|
|
1350
|
+
return ret.reduce((slot, current) => {
|
|
1351
|
+
return [
|
|
1352
|
+
...slot,
|
|
1353
|
+
// prettier-ignore
|
|
1354
|
+
...current.type === Fragment ? current.children : [current]
|
|
1355
|
+
];
|
|
1356
|
+
}, []);
|
|
1357
|
+
} else {
|
|
1358
|
+
return keys.reduce((arg, key) => {
|
|
1359
|
+
const slot = slots[key];
|
|
1360
|
+
if (slot) {
|
|
1361
|
+
arg[key] = slot();
|
|
1362
|
+
}
|
|
1363
|
+
return arg;
|
|
1364
|
+
}, create());
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
function getFragmentableTag() {
|
|
1368
|
+
return Fragment;
|
|
1369
|
+
}
|
|
1370
|
+
const TranslationImpl = /* @__PURE__ */ defineComponent({
|
|
1371
|
+
/* eslint-disable */
|
|
1372
|
+
name: "i18n-t",
|
|
1373
|
+
props: assign({
|
|
1374
|
+
keypath: {
|
|
1375
|
+
type: String,
|
|
1376
|
+
required: true
|
|
1377
|
+
},
|
|
1378
|
+
plural: {
|
|
1379
|
+
type: [Number, String],
|
|
1380
|
+
validator: (val) => isNumber(val) || !isNaN(val)
|
|
1381
|
+
}
|
|
1382
|
+
}, baseFormatProps),
|
|
1383
|
+
/* eslint-enable */
|
|
1384
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1385
|
+
setup(props, context) {
|
|
1386
|
+
const { slots, attrs } = context;
|
|
1387
|
+
const i18n = props.i18n || useI18n({
|
|
1388
|
+
useScope: props.scope,
|
|
1389
|
+
__useComponent: true
|
|
1390
|
+
});
|
|
1391
|
+
return () => {
|
|
1392
|
+
const keys = Object.keys(slots).filter((key) => key[0] !== "_");
|
|
1393
|
+
const options = create();
|
|
1394
|
+
if (props.locale) {
|
|
1395
|
+
options.locale = props.locale;
|
|
1396
|
+
}
|
|
1397
|
+
if (props.plural !== void 0) {
|
|
1398
|
+
options.plural = isString(props.plural) ? +props.plural : props.plural;
|
|
1399
|
+
}
|
|
1400
|
+
const arg = getInterpolateArg(context, keys);
|
|
1401
|
+
const children = i18n[TranslateVNodeSymbol](props.keypath, arg, options);
|
|
1402
|
+
const assignedAttrs = assign(create(), attrs);
|
|
1403
|
+
const tag = isString(props.tag) || isObject(props.tag) ? props.tag : getFragmentableTag();
|
|
1404
|
+
return h(tag, assignedAttrs, children);
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
});
|
|
1408
|
+
const Translation = TranslationImpl;
|
|
1409
|
+
const I18nT = Translation;
|
|
1410
|
+
function isVNode(target) {
|
|
1411
|
+
return isArray(target) && !isString(target[0]);
|
|
1412
|
+
}
|
|
1413
|
+
function renderFormatter(props, context, slotKeys, partFormatter) {
|
|
1414
|
+
const { slots, attrs } = context;
|
|
1415
|
+
return () => {
|
|
1416
|
+
const options = { part: true };
|
|
1417
|
+
let overrides = create();
|
|
1418
|
+
if (props.locale) {
|
|
1419
|
+
options.locale = props.locale;
|
|
1420
|
+
}
|
|
1421
|
+
if (isString(props.format)) {
|
|
1422
|
+
options.key = props.format;
|
|
1423
|
+
} else if (isObject(props.format)) {
|
|
1424
|
+
if (isString(props.format.key)) {
|
|
1425
|
+
options.key = props.format.key;
|
|
1426
|
+
}
|
|
1427
|
+
overrides = Object.keys(props.format).reduce((options2, prop) => {
|
|
1428
|
+
return slotKeys.includes(prop) ? assign(create(), options2, { [prop]: props.format[prop] }) : options2;
|
|
1429
|
+
}, create());
|
|
1430
|
+
}
|
|
1431
|
+
const parts = partFormatter(...[props.value, options, overrides]);
|
|
1432
|
+
let children = [options.key];
|
|
1433
|
+
if (isArray(parts)) {
|
|
1434
|
+
children = parts.map((part, index) => {
|
|
1435
|
+
const slot = slots[part.type];
|
|
1436
|
+
const node = slot ? slot({ [part.type]: part.value, index, parts }) : [part.value];
|
|
1437
|
+
if (isVNode(node)) {
|
|
1438
|
+
node[0].key = `${part.type}-${index}`;
|
|
1439
|
+
}
|
|
1440
|
+
return node;
|
|
1441
|
+
});
|
|
1442
|
+
} else if (isString(parts)) {
|
|
1443
|
+
children = [parts];
|
|
1444
|
+
}
|
|
1445
|
+
const assignedAttrs = assign(create(), attrs);
|
|
1446
|
+
const tag = isString(props.tag) || isObject(props.tag) ? props.tag : getFragmentableTag();
|
|
1447
|
+
return h(tag, assignedAttrs, children);
|
|
1448
|
+
};
|
|
1449
|
+
}
|
|
1450
|
+
const NumberFormatImpl = /* @__PURE__ */ defineComponent({
|
|
1451
|
+
/* eslint-disable */
|
|
1452
|
+
name: "i18n-n",
|
|
1453
|
+
props: assign({
|
|
1454
|
+
value: {
|
|
1455
|
+
type: Number,
|
|
1456
|
+
required: true
|
|
1457
|
+
},
|
|
1458
|
+
format: {
|
|
1459
|
+
type: [String, Object]
|
|
1460
|
+
}
|
|
1461
|
+
}, baseFormatProps),
|
|
1462
|
+
/* eslint-enable */
|
|
1463
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1464
|
+
setup(props, context) {
|
|
1465
|
+
const i18n = props.i18n || useI18n({
|
|
1466
|
+
useScope: props.scope,
|
|
1467
|
+
__useComponent: true
|
|
1468
|
+
});
|
|
1469
|
+
return renderFormatter(props, context, NUMBER_FORMAT_OPTIONS_KEYS, (...args) => (
|
|
1470
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1471
|
+
i18n[NumberPartsSymbol](...args)
|
|
1472
|
+
));
|
|
1473
|
+
}
|
|
1474
|
+
});
|
|
1475
|
+
const NumberFormat = NumberFormatImpl;
|
|
1476
|
+
const I18nN = NumberFormat;
|
|
1477
|
+
function getComposer$1(i18n, instance) {
|
|
1478
|
+
const i18nInternal = i18n;
|
|
1479
|
+
if (i18n.mode === "composition") {
|
|
1480
|
+
return i18nInternal.__getInstance(instance) || i18n.global;
|
|
1481
|
+
} else {
|
|
1482
|
+
const vueI18n = i18nInternal.__getInstance(instance);
|
|
1483
|
+
return vueI18n != null ? vueI18n.__composer : i18n.global.__composer;
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
function vTDirective(i18n) {
|
|
1487
|
+
const _process = (binding) => {
|
|
1488
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1489
|
+
warnOnce(getWarnMessage(I18nWarnCodes.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));
|
|
1490
|
+
}
|
|
1491
|
+
const { instance, value } = binding;
|
|
1492
|
+
if (!instance || !instance.$) {
|
|
1493
|
+
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
1494
|
+
}
|
|
1495
|
+
const composer = getComposer$1(i18n, instance.$);
|
|
1496
|
+
const parsedValue = parseValue(value);
|
|
1497
|
+
return [
|
|
1498
|
+
Reflect.apply(composer.t, composer, [...makeParams(parsedValue)]),
|
|
1499
|
+
composer
|
|
1500
|
+
];
|
|
1501
|
+
};
|
|
1502
|
+
const register = (el, binding) => {
|
|
1503
|
+
const [textContent, composer] = _process(binding);
|
|
1504
|
+
if (inBrowser && i18n.global === composer) {
|
|
1505
|
+
el.__i18nWatcher = watch(composer.locale, () => {
|
|
1506
|
+
binding.instance && binding.instance.$forceUpdate();
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1509
|
+
el.__composer = composer;
|
|
1510
|
+
el.textContent = textContent;
|
|
1511
|
+
};
|
|
1512
|
+
const unregister = (el) => {
|
|
1513
|
+
if (inBrowser && el.__i18nWatcher) {
|
|
1514
|
+
el.__i18nWatcher();
|
|
1515
|
+
el.__i18nWatcher = void 0;
|
|
1516
|
+
delete el.__i18nWatcher;
|
|
1517
|
+
}
|
|
1518
|
+
if (el.__composer) {
|
|
1519
|
+
el.__composer = void 0;
|
|
1520
|
+
delete el.__composer;
|
|
1521
|
+
}
|
|
1522
|
+
};
|
|
1523
|
+
const update = (el, { value }) => {
|
|
1524
|
+
if (el.__composer) {
|
|
1525
|
+
const composer = el.__composer;
|
|
1526
|
+
const parsedValue = parseValue(value);
|
|
1527
|
+
el.textContent = Reflect.apply(composer.t, composer, [
|
|
1528
|
+
...makeParams(parsedValue)
|
|
1529
|
+
]);
|
|
1530
|
+
}
|
|
1531
|
+
};
|
|
1532
|
+
const getSSRProps = (binding) => {
|
|
1533
|
+
const [textContent] = _process(binding);
|
|
1534
|
+
return { textContent };
|
|
1535
|
+
};
|
|
1536
|
+
return {
|
|
1537
|
+
created: register,
|
|
1538
|
+
unmounted: unregister,
|
|
1539
|
+
beforeUpdate: update,
|
|
1540
|
+
getSSRProps
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
function parseValue(value) {
|
|
1544
|
+
if (isString(value)) {
|
|
1545
|
+
return { path: value };
|
|
1546
|
+
} else if (isPlainObject(value)) {
|
|
1547
|
+
if (!("path" in value)) {
|
|
1548
|
+
throw createI18nError(I18nErrorCodes.REQUIRED_VALUE, "path");
|
|
1549
|
+
}
|
|
1550
|
+
return value;
|
|
1551
|
+
} else {
|
|
1552
|
+
throw createI18nError(I18nErrorCodes.INVALID_VALUE);
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
function makeParams(value) {
|
|
1556
|
+
const { path, locale, args, choice, plural } = value;
|
|
1557
|
+
const options = {};
|
|
1558
|
+
const named = args || {};
|
|
1559
|
+
if (isString(locale)) {
|
|
1560
|
+
options.locale = locale;
|
|
1561
|
+
}
|
|
1562
|
+
if (isNumber(choice)) {
|
|
1563
|
+
options.plural = choice;
|
|
1564
|
+
}
|
|
1565
|
+
if (isNumber(plural)) {
|
|
1566
|
+
options.plural = plural;
|
|
1567
|
+
}
|
|
1568
|
+
return [path, named, options];
|
|
1569
|
+
}
|
|
1570
|
+
function apply(app, i18n, ...options) {
|
|
1571
|
+
const pluginOptions = isPlainObject(options[0]) ? options[0] : {};
|
|
1572
|
+
const globalInstall = isBoolean(pluginOptions.globalInstall) ? pluginOptions.globalInstall : true;
|
|
1573
|
+
if (globalInstall) {
|
|
1574
|
+
[Translation.name, "I18nT"].forEach((name) => app.component(name, Translation));
|
|
1575
|
+
[NumberFormat.name, "I18nN"].forEach((name) => app.component(name, NumberFormat));
|
|
1576
|
+
[DatetimeFormat.name, "I18nD"].forEach((name) => app.component(name, DatetimeFormat));
|
|
1577
|
+
}
|
|
1578
|
+
{
|
|
1579
|
+
app.directive("t", vTDirective(i18n));
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
const I18nInjectionKey = /* @__PURE__ */ makeSymbol("global-vue-i18n");
|
|
1583
|
+
function createI18n(options = {}) {
|
|
1584
|
+
const __legacyMode = __VUE_I18N_LEGACY_API__ && isBoolean(options.legacy) ? options.legacy : __VUE_I18N_LEGACY_API__;
|
|
1585
|
+
if (process.env.NODE_ENV !== "production" && __legacyMode) {
|
|
1586
|
+
warnOnce(getWarnMessage(I18nWarnCodes.DEPRECATE_LEGACY_MODE));
|
|
1587
|
+
}
|
|
1588
|
+
const __globalInjection = isBoolean(options.globalInjection) ? options.globalInjection : true;
|
|
1589
|
+
const __instances = /* @__PURE__ */ new Map();
|
|
1590
|
+
const [globalScope, __global] = createGlobal(options, __legacyMode);
|
|
1591
|
+
const symbol = /* @__PURE__ */ makeSymbol(process.env.NODE_ENV !== "production" ? "vue-i18n" : "");
|
|
1592
|
+
function __getInstance(component) {
|
|
1593
|
+
return __instances.get(component) || null;
|
|
1594
|
+
}
|
|
1595
|
+
function __setInstance(component, instance) {
|
|
1596
|
+
__instances.set(component, instance);
|
|
1597
|
+
}
|
|
1598
|
+
function __deleteInstance(component) {
|
|
1599
|
+
__instances.delete(component);
|
|
1600
|
+
}
|
|
1601
|
+
const i18n = {
|
|
1602
|
+
// mode
|
|
1603
|
+
get mode() {
|
|
1604
|
+
return __VUE_I18N_LEGACY_API__ && __legacyMode ? "legacy" : "composition";
|
|
1605
|
+
},
|
|
1606
|
+
// install plugin
|
|
1607
|
+
async install(app, ...options2) {
|
|
1608
|
+
if ((process.env.NODE_ENV !== "production" || false) && true) {
|
|
1609
|
+
app.__VUE_I18N__ = i18n;
|
|
1610
|
+
}
|
|
1611
|
+
app.__VUE_I18N_SYMBOL__ = symbol;
|
|
1612
|
+
app.provide(app.__VUE_I18N_SYMBOL__, i18n);
|
|
1613
|
+
if (isPlainObject(options2[0])) {
|
|
1614
|
+
const opts = options2[0];
|
|
1615
|
+
i18n.__composerExtend = opts.__composerExtend;
|
|
1616
|
+
i18n.__vueI18nExtend = opts.__vueI18nExtend;
|
|
1617
|
+
}
|
|
1618
|
+
let globalReleaseHandler = null;
|
|
1619
|
+
if (!__legacyMode && __globalInjection) {
|
|
1620
|
+
globalReleaseHandler = injectGlobalFields(app, i18n.global);
|
|
1621
|
+
}
|
|
1622
|
+
if (__VUE_I18N_FULL_INSTALL__) {
|
|
1623
|
+
apply(app, i18n, ...options2);
|
|
1624
|
+
}
|
|
1625
|
+
if (__VUE_I18N_LEGACY_API__ && __legacyMode) {
|
|
1626
|
+
app.mixin(defineMixin(__global, __global.__composer, i18n));
|
|
1627
|
+
}
|
|
1628
|
+
const unmountApp = app.unmount;
|
|
1629
|
+
app.unmount = () => {
|
|
1630
|
+
globalReleaseHandler && globalReleaseHandler();
|
|
1631
|
+
i18n.dispose();
|
|
1632
|
+
unmountApp();
|
|
1633
|
+
};
|
|
1634
|
+
if ((process.env.NODE_ENV !== "production" || false) && true) {
|
|
1635
|
+
const ret = await enableDevTools(app, i18n);
|
|
1636
|
+
if (!ret) {
|
|
1637
|
+
throw createI18nError(I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);
|
|
1638
|
+
}
|
|
1639
|
+
const emitter = createEmitter();
|
|
1640
|
+
if (__legacyMode) {
|
|
1641
|
+
const _vueI18n = __global;
|
|
1642
|
+
_vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter);
|
|
1643
|
+
} else {
|
|
1644
|
+
const _composer = __global;
|
|
1645
|
+
_composer[EnableEmitter] && _composer[EnableEmitter](emitter);
|
|
1646
|
+
}
|
|
1647
|
+
emitter.on("*", addTimelineEvent);
|
|
1648
|
+
}
|
|
1649
|
+
},
|
|
1650
|
+
// global accessor
|
|
1651
|
+
get global() {
|
|
1652
|
+
return __global;
|
|
1653
|
+
},
|
|
1654
|
+
dispose() {
|
|
1655
|
+
globalScope.stop();
|
|
1656
|
+
},
|
|
1657
|
+
// @internal
|
|
1658
|
+
__instances,
|
|
1659
|
+
// @internal
|
|
1660
|
+
__getInstance,
|
|
1661
|
+
// @internal
|
|
1662
|
+
__setInstance,
|
|
1663
|
+
// @internal
|
|
1664
|
+
__deleteInstance
|
|
1665
|
+
};
|
|
1666
|
+
return i18n;
|
|
1667
|
+
}
|
|
1668
|
+
function useI18n(options = {}) {
|
|
1669
|
+
const instance = getCurrentInstance();
|
|
1670
|
+
if (instance == null) {
|
|
1671
|
+
throw createI18nError(I18nErrorCodes.MUST_BE_CALL_SETUP_TOP);
|
|
1672
|
+
}
|
|
1673
|
+
if (!instance.isCE && instance.appContext.app != null && !instance.appContext.app.__VUE_I18N_SYMBOL__) {
|
|
1674
|
+
throw createI18nError(I18nErrorCodes.NOT_INSTALLED);
|
|
1675
|
+
}
|
|
1676
|
+
const i18n = getI18nInstance(instance);
|
|
1677
|
+
const gl = getGlobalComposer(i18n);
|
|
1678
|
+
const componentOptions = getComponentOptions(instance);
|
|
1679
|
+
const scope = getScope(options, componentOptions);
|
|
1680
|
+
if (scope === "global") {
|
|
1681
|
+
adjustI18nResources(gl, options, componentOptions);
|
|
1682
|
+
return gl;
|
|
1683
|
+
}
|
|
1684
|
+
if (scope === "parent") {
|
|
1685
|
+
let composer2 = getComposer(i18n, instance, options.__useComponent);
|
|
1686
|
+
if (composer2 == null) {
|
|
1687
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1688
|
+
warn(getWarnMessage(I18nWarnCodes.NOT_FOUND_PARENT_SCOPE));
|
|
1689
|
+
}
|
|
1690
|
+
composer2 = gl;
|
|
1691
|
+
}
|
|
1692
|
+
return composer2;
|
|
1693
|
+
}
|
|
1694
|
+
const i18nInternal = i18n;
|
|
1695
|
+
let composer = i18nInternal.__getInstance(instance);
|
|
1696
|
+
if (composer == null) {
|
|
1697
|
+
const composerOptions = assign({}, options);
|
|
1698
|
+
if ("__i18n" in componentOptions) {
|
|
1699
|
+
composerOptions.__i18n = componentOptions.__i18n;
|
|
1700
|
+
}
|
|
1701
|
+
if (gl) {
|
|
1702
|
+
composerOptions.__root = gl;
|
|
1703
|
+
}
|
|
1704
|
+
composer = createComposer(composerOptions);
|
|
1705
|
+
if (i18nInternal.__composerExtend) {
|
|
1706
|
+
composer[DisposeSymbol] = i18nInternal.__composerExtend(composer);
|
|
1707
|
+
}
|
|
1708
|
+
setupLifeCycle(i18nInternal, instance, composer);
|
|
1709
|
+
i18nInternal.__setInstance(instance, composer);
|
|
1710
|
+
} else {
|
|
1711
|
+
if (process.env.NODE_ENV !== "production" && scope === "local") {
|
|
1712
|
+
throw createI18nError(I18nErrorCodes.DUPLICATE_USE_I18N_CALLING);
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
return composer;
|
|
1716
|
+
}
|
|
1717
|
+
function createGlobal(options, legacyMode) {
|
|
1718
|
+
const scope = effectScope();
|
|
1719
|
+
const obj = __VUE_I18N_LEGACY_API__ && legacyMode ? scope.run(() => createVueI18n(options)) : scope.run(() => createComposer(options));
|
|
1720
|
+
if (obj == null) {
|
|
1721
|
+
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
1722
|
+
}
|
|
1723
|
+
return [scope, obj];
|
|
1724
|
+
}
|
|
1725
|
+
function getI18nInstance(instance) {
|
|
1726
|
+
const i18n = inject(!instance.isCE ? instance.appContext.app.__VUE_I18N_SYMBOL__ : I18nInjectionKey);
|
|
1727
|
+
if (!i18n) {
|
|
1728
|
+
throw createI18nError(!instance.isCE ? I18nErrorCodes.UNEXPECTED_ERROR : I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE);
|
|
1729
|
+
}
|
|
1730
|
+
return i18n;
|
|
1731
|
+
}
|
|
1732
|
+
function getScope(options, componentOptions) {
|
|
1733
|
+
return isEmptyObject(options) ? "__i18n" in componentOptions ? "local" : "global" : !options.useScope ? "local" : options.useScope;
|
|
1734
|
+
}
|
|
1735
|
+
function getGlobalComposer(i18n) {
|
|
1736
|
+
return i18n.mode === "composition" ? i18n.global : i18n.global.__composer;
|
|
1737
|
+
}
|
|
1738
|
+
function getComposer(i18n, target, useComponent = false) {
|
|
1739
|
+
let composer = null;
|
|
1740
|
+
const root = target.root;
|
|
1741
|
+
let current = getParentComponentInstance(target, useComponent);
|
|
1742
|
+
while (current != null) {
|
|
1743
|
+
const i18nInternal = i18n;
|
|
1744
|
+
if (i18n.mode === "composition") {
|
|
1745
|
+
composer = i18nInternal.__getInstance(current);
|
|
1746
|
+
} else {
|
|
1747
|
+
if (__VUE_I18N_LEGACY_API__) {
|
|
1748
|
+
const vueI18n = i18nInternal.__getInstance(current);
|
|
1749
|
+
if (vueI18n != null) {
|
|
1750
|
+
composer = vueI18n.__composer;
|
|
1751
|
+
if (useComponent && composer && !composer[InejctWithOptionSymbol]) {
|
|
1752
|
+
composer = null;
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
if (composer != null) {
|
|
1758
|
+
break;
|
|
1759
|
+
}
|
|
1760
|
+
if (root === current) {
|
|
1761
|
+
break;
|
|
1762
|
+
}
|
|
1763
|
+
current = current.parent;
|
|
1764
|
+
}
|
|
1765
|
+
return composer;
|
|
1766
|
+
}
|
|
1767
|
+
function getParentComponentInstance(target, useComponent = false) {
|
|
1768
|
+
if (target == null) {
|
|
1769
|
+
return null;
|
|
1770
|
+
}
|
|
1771
|
+
return !useComponent ? target.parent : target.vnode.ctx || target.parent;
|
|
1772
|
+
}
|
|
1773
|
+
function setupLifeCycle(i18n, target, composer) {
|
|
1774
|
+
let emitter = null;
|
|
1775
|
+
onMounted(() => {
|
|
1776
|
+
if ((process.env.NODE_ENV !== "production" || false) && true && target.vnode.el) {
|
|
1777
|
+
target.vnode.el.__VUE_I18N__ = composer;
|
|
1778
|
+
emitter = createEmitter();
|
|
1779
|
+
const _composer = composer;
|
|
1780
|
+
_composer[EnableEmitter] && _composer[EnableEmitter](emitter);
|
|
1781
|
+
emitter.on("*", addTimelineEvent);
|
|
1782
|
+
}
|
|
1783
|
+
}, target);
|
|
1784
|
+
onUnmounted(() => {
|
|
1785
|
+
const _composer = composer;
|
|
1786
|
+
if ((process.env.NODE_ENV !== "production" || false) && true && target.vnode.el && target.vnode.el.__VUE_I18N__) {
|
|
1787
|
+
emitter && emitter.off("*", addTimelineEvent);
|
|
1788
|
+
_composer[DisableEmitter] && _composer[DisableEmitter]();
|
|
1789
|
+
delete target.vnode.el.__VUE_I18N__;
|
|
1790
|
+
}
|
|
1791
|
+
i18n.__deleteInstance(target);
|
|
1792
|
+
const dispose = _composer[DisposeSymbol];
|
|
1793
|
+
if (dispose) {
|
|
1794
|
+
dispose();
|
|
1795
|
+
delete _composer[DisposeSymbol];
|
|
1796
|
+
}
|
|
1797
|
+
}, target);
|
|
1798
|
+
}
|
|
1799
|
+
const globalExportProps = [
|
|
1800
|
+
"locale",
|
|
1801
|
+
"fallbackLocale",
|
|
1802
|
+
"availableLocales"
|
|
1803
|
+
];
|
|
1804
|
+
const globalExportMethods = ["t", "rt", "d", "n", "tm", "te"];
|
|
1805
|
+
function injectGlobalFields(app, composer) {
|
|
1806
|
+
const i18n = /* @__PURE__ */ Object.create(null);
|
|
1807
|
+
globalExportProps.forEach((prop) => {
|
|
1808
|
+
const desc = Object.getOwnPropertyDescriptor(composer, prop);
|
|
1809
|
+
if (!desc) {
|
|
1810
|
+
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
1811
|
+
}
|
|
1812
|
+
const wrap = isRef(desc.value) ? {
|
|
1813
|
+
get() {
|
|
1814
|
+
return desc.value.value;
|
|
1815
|
+
},
|
|
1816
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1817
|
+
set(val) {
|
|
1818
|
+
desc.value.value = val;
|
|
1819
|
+
}
|
|
1820
|
+
} : {
|
|
1821
|
+
get() {
|
|
1822
|
+
return desc.get && desc.get();
|
|
1823
|
+
}
|
|
1824
|
+
};
|
|
1825
|
+
Object.defineProperty(i18n, prop, wrap);
|
|
1826
|
+
});
|
|
1827
|
+
app.config.globalProperties.$i18n = i18n;
|
|
1828
|
+
globalExportMethods.forEach((method) => {
|
|
1829
|
+
const desc = Object.getOwnPropertyDescriptor(composer, method);
|
|
1830
|
+
if (!desc || !desc.value) {
|
|
1831
|
+
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
|
|
1832
|
+
}
|
|
1833
|
+
Object.defineProperty(app.config.globalProperties, `$${method}`, desc);
|
|
1834
|
+
});
|
|
1835
|
+
const dispose = () => {
|
|
1836
|
+
delete app.config.globalProperties.$i18n;
|
|
1837
|
+
globalExportMethods.forEach((method) => {
|
|
1838
|
+
delete app.config.globalProperties[`$${method}`];
|
|
1839
|
+
});
|
|
1840
|
+
};
|
|
1841
|
+
return dispose;
|
|
1842
|
+
}
|
|
1843
|
+
const DatetimeFormatImpl = /* @__PURE__ */ defineComponent({
|
|
1844
|
+
/* eslint-disable */
|
|
1845
|
+
name: "i18n-d",
|
|
1846
|
+
props: assign({
|
|
1847
|
+
value: {
|
|
1848
|
+
type: [Number, Date],
|
|
1849
|
+
required: true
|
|
1850
|
+
},
|
|
1851
|
+
format: {
|
|
1852
|
+
type: [String, Object]
|
|
1853
|
+
}
|
|
1854
|
+
}, baseFormatProps),
|
|
1855
|
+
/* eslint-enable */
|
|
1856
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1857
|
+
setup(props, context) {
|
|
1858
|
+
const i18n = props.i18n || useI18n({
|
|
1859
|
+
useScope: props.scope,
|
|
1860
|
+
__useComponent: true
|
|
1861
|
+
});
|
|
1862
|
+
return renderFormatter(props, context, DATETIME_FORMAT_OPTIONS_KEYS, (...args) => (
|
|
1863
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1864
|
+
i18n[DatetimePartsSymbol](...args)
|
|
1865
|
+
));
|
|
1866
|
+
}
|
|
1867
|
+
});
|
|
1868
|
+
const DatetimeFormat = DatetimeFormatImpl;
|
|
1869
|
+
const I18nD = DatetimeFormat;
|
|
1870
|
+
{
|
|
1871
|
+
initFeatureFlags();
|
|
1872
|
+
}
|
|
1873
|
+
registerMessageCompiler(compile);
|
|
1874
|
+
registerMessageResolver(resolveValue);
|
|
1875
|
+
registerLocaleFallbacker(fallbackWithLocaleChain);
|
|
1876
|
+
if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
|
|
1877
|
+
const target = getGlobalThis();
|
|
1878
|
+
target.__INTLIFY__ = true;
|
|
1879
|
+
setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
const VueI18n = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
1883
|
+
__proto__: null,
|
|
1884
|
+
DatetimeFormat,
|
|
1885
|
+
I18nD,
|
|
1886
|
+
I18nInjectionKey,
|
|
1887
|
+
I18nN,
|
|
1888
|
+
I18nT,
|
|
1889
|
+
NumberFormat,
|
|
1890
|
+
Translation,
|
|
1891
|
+
VERSION,
|
|
1892
|
+
createI18n,
|
|
1893
|
+
useI18n,
|
|
1894
|
+
vTDirective
|
|
1895
|
+
}, Symbol.toStringTag, { value: 'Module' }));
|
|
1896
|
+
|
|
1897
|
+
export { VueI18n as V, createI18n as c, useI18n as u };
|