yc-design-vue 1.8.7 → 1.8.9

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.
Files changed (679) hide show
  1. package/es/Affix/index.vue.js +1 -0
  2. package/es/Alert/index.d.ts +3 -3
  3. package/es/Alert/index.vue.d.ts +1 -1
  4. package/es/Alert/index.vue.js +1 -0
  5. package/es/Anchor/Anchor.vue.js +1 -0
  6. package/es/Anchor/AnchorLink.vue.js +1 -0
  7. package/es/Anchor/hooks/useContext.js +1 -0
  8. package/es/AutoComplete/index.d.ts +19 -19
  9. package/es/AutoComplete/index.vue.d.ts +33 -33
  10. package/es/AutoComplete/index.vue.js +1 -0
  11. package/es/Avatar/Avatar.vue.d.ts +2 -2
  12. package/es/Avatar/Avatar.vue.js +1 -0
  13. package/es/Avatar/AvatarGroup.vue.js +1 -0
  14. package/es/Avatar/index.d.ts +5 -5
  15. package/es/BackTop/index.vue.js +1 -0
  16. package/es/Badge/index.vue.js +1 -0
  17. package/es/Breadcrumb/Breadcrumb.vue.js +1 -0
  18. package/es/Breadcrumb/BreadcrumbItem.vue.js +1 -0
  19. package/es/Breadcrumb/BreadcrumbMore.vue.js +1 -0
  20. package/es/Breadcrumb/BreadcrumbSeparator.vue.js +1 -0
  21. package/es/Button/Button.vue.d.ts +3 -3
  22. package/es/Button/ButtonGroup.vue.d.ts +1 -1
  23. package/es/Button/hooks/useContext.js +1 -0
  24. package/es/Button/index.d.ts +12 -12
  25. package/es/Calendar/Calendar.vue.js +2 -1
  26. package/es/Calendar/CalendarMonth.vue.d.ts +1 -1
  27. package/es/Calendar/CalendarMonth.vue.js +1 -1
  28. package/es/Calendar/CalendarYear.vue.js +1 -1
  29. package/es/Card/Card.vue.d.ts +1 -1
  30. package/es/Card/Card.vue.js +1 -0
  31. package/es/Card/CardMeta.vue.d.ts +1 -1
  32. package/es/Card/CardMeta.vue.js +1 -0
  33. package/es/Card/index.d.ts +6 -6
  34. package/es/Carousel/Carousel.vue.js +1 -0
  35. package/es/Carousel/CarouselArrow.vue.js +1 -0
  36. package/es/Carousel/CarouselIndicator.vue.js +1 -0
  37. package/es/Carousel/hooks/useContext.js +1 -0
  38. package/es/Cascader/Cascader.vue.d.ts +17 -17
  39. package/es/Cascader/Cascader.vue.js +1 -0
  40. package/es/Cascader/CascaderIcon.vue.js +1 -0
  41. package/es/Cascader/CascaderOption.vue.js +1 -0
  42. package/es/Cascader/CascaderPanel.vue.js +1 -0
  43. package/es/Cascader/CascaderSearchPanel.vue.js +1 -0
  44. package/es/Cascader/hooks/useContext.js +1 -0
  45. package/es/Cascader/index.d.ts +16 -16
  46. package/es/Checkbox/Checkbox.vue.js +1 -0
  47. package/es/Checkbox/CheckboxGroup.vue.d.ts +1 -1
  48. package/es/Checkbox/hooks/useContext.js +1 -0
  49. package/es/Checkbox/index.d.ts +3 -3
  50. package/es/Collapse/CollapseItem.vue.js +1 -0
  51. package/es/Collapse/hooks/useContext.js +1 -0
  52. package/es/ColorPicker/ColorControl.vue.js +1 -0
  53. package/es/ColorPicker/ColorInput.vue.js +1 -0
  54. package/es/ColorPicker/ColorList.vue.js +7 -1
  55. package/es/ColorPicker/ColorPalette.vue.js +1 -0
  56. package/es/ColorPicker/ColorPanel.vue.js +7 -1
  57. package/es/ColorPicker/hooks/useContext.js +1 -0
  58. package/es/Comment/index.vue.js +1 -0
  59. package/es/ConfigProvider/index.d.ts +3 -3
  60. package/es/ConfigProvider/index.vue.d.ts +1 -1
  61. package/es/ConfigProvider/index.vue.js +4 -12
  62. package/es/ConfigProvider/type.d.ts +3 -2
  63. package/es/Descriptions/ReuseItem.vue.js +1 -0
  64. package/es/Descriptions/ReuseTd.vue.js +1 -0
  65. package/es/Descriptions/hooks/useContext.js +1 -0
  66. package/es/Divider/index.d.ts +3 -3
  67. package/es/Divider/index.vue.d.ts +1 -1
  68. package/es/Divider/index.vue.js +1 -0
  69. package/es/Drawer/Drawer.vue.d.ts +4 -4
  70. package/es/Drawer/Drawer.vue.js +2 -1
  71. package/es/Drawer/DrawerService.vue.d.ts +2 -2
  72. package/es/Drawer/DrawerService.vue.js +1 -0
  73. package/es/Drawer/index.d.ts +11 -11
  74. package/es/Dropdown/Dropdown.vue.js +1 -0
  75. package/es/Dropdown/DropdownButton.vue.d.ts +1 -1
  76. package/es/Dropdown/DropdownButton.vue.js +1 -0
  77. package/es/Dropdown/Dsubmenu.vue.js +1 -0
  78. package/es/Dropdown/hooks/useContext.js +1 -0
  79. package/es/Dropdown/index.d.ts +3 -3
  80. package/es/Empty/index.vue.js +2 -1
  81. package/es/Grid/Grid.vue.js +1 -0
  82. package/es/Grid/GridCol.vue.js +1 -0
  83. package/es/Grid/GridItem.vue.js +1 -0
  84. package/es/Grid/GridRow.vue.js +1 -0
  85. package/es/Grid/hooks/useContext.js +1 -0
  86. package/es/Image/Image.vue.d.ts +2 -2
  87. package/es/Image/Image.vue.js +2 -1
  88. package/es/Image/ImagePreview.vue.js +1 -0
  89. package/es/Image/ImagePreviewArrow.vue.js +1 -0
  90. package/es/Image/ImagePreviewToolbar.vue.js +8 -7
  91. package/es/Image/hooks/useContext.js +1 -0
  92. package/es/Image/index.d.ts +6 -6
  93. package/es/Input/Input.vue.d.ts +3 -3
  94. package/es/Input/Input.vue.js +1 -0
  95. package/es/Input/InputSuffix.vue.js +1 -0
  96. package/es/Input/hooks/useLimitedInput.js +1 -0
  97. package/es/Input/index.d.ts +9 -9
  98. package/es/InputNumber/InputNumber.vue.d.ts +18 -18
  99. package/es/InputNumber/InputNumber.vue.js +1 -0
  100. package/es/InputNumber/InputOperaBtn.vue.js +1 -0
  101. package/es/InputNumber/index.d.ts +19 -19
  102. package/es/InputTag/index.d.ts +6 -6
  103. package/es/InputTag/index.vue.d.ts +2 -2
  104. package/es/InputTag/index.vue.js +1 -0
  105. package/es/Layout/Layout.vue.js +1 -0
  106. package/es/Layout/LayoutSider.vue.js +1 -0
  107. package/es/Layout/hooks/useSiderContext.js +1 -0
  108. package/es/Link/index.d.ts +3 -3
  109. package/es/Link/index.vue.d.ts +1 -1
  110. package/es/Link/index.vue.js +1 -0
  111. package/es/List/List.vue.d.ts +7 -7
  112. package/es/List/List.vue.js +1 -0
  113. package/es/List/ListItemMeta.vue.d.ts +1 -1
  114. package/es/List/hooks/useScrollReach.js +1 -0
  115. package/es/List/index.d.ts +9 -9
  116. package/es/Mention/index.d.ts +22 -22
  117. package/es/Mention/index.vue.d.ts +39 -39
  118. package/es/Mention/index.vue.js +1 -0
  119. package/es/Menu/Menu.vue.js +1 -0
  120. package/es/Menu/MenuEllipsis.vue.js +1 -0
  121. package/es/Menu/MenuItem.vue.js +1 -0
  122. package/es/Menu/MenuItemGroup.vue.js +1 -0
  123. package/es/Menu/SubMenu.vue.js +1 -0
  124. package/es/Menu/hooks/useContext.js +1 -0
  125. package/es/Message/Message.vue.d.ts +1 -1
  126. package/es/Message/Message.vue.js +1 -0
  127. package/es/Message/index.d.ts +3 -3
  128. package/es/Message/index.js +1 -0
  129. package/es/Modal/Modal.vue.d.ts +4 -4
  130. package/es/Modal/Modal.vue.js +2 -1
  131. package/es/Modal/ModalService.vue.d.ts +2 -2
  132. package/es/Modal/ModalService.vue.js +1 -0
  133. package/es/Modal/hooks/useModalClose.js +1 -0
  134. package/es/Modal/hooks/useModalDraggable.js +1 -0
  135. package/es/Modal/hooks/useOnBeforeClose.js +1 -0
  136. package/es/Modal/index.d.ts +11 -11
  137. package/es/Notification/Notification.vue.d.ts +1 -1
  138. package/es/Notification/Notification.vue.js +1 -0
  139. package/es/Notification/index.d.ts +3 -3
  140. package/es/Notification/index.js +1 -0
  141. package/es/OverflowList/index.d.ts +3 -3
  142. package/es/OverflowList/index.vue.d.ts +1 -1
  143. package/es/OverflowList/index.vue.js +1 -0
  144. package/es/PageHeader/index.vue.js +1 -0
  145. package/es/Pagination/Pagination.vue.js +6 -2
  146. package/es/Pagination/PaginationItem.vue.js +1 -0
  147. package/es/Pagination/hooks/useContext.d.ts +1 -256
  148. package/es/Pagination/hooks/useContext.js +2 -1
  149. package/es/Popconfirm/index.d.ts +19 -19
  150. package/es/Popconfirm/index.vue.d.ts +7 -7
  151. package/es/Popconfirm/index.vue.js +2 -1
  152. package/es/Popover/index.vue.js +1 -0
  153. package/es/Progress/Progress.vue.d.ts +1 -1
  154. package/es/Progress/Progress.vue.js +1 -0
  155. package/es/Progress/ProgressCircle.vue.js +1 -0
  156. package/es/Progress/ProgressLine.vue.js +1 -0
  157. package/es/Progress/ProgressSteps.vue.js +1 -0
  158. package/es/Progress/index.d.ts +3 -3
  159. package/es/Radio/Radio.vue.d.ts +1 -1
  160. package/es/Radio/Radio.vue.js +1 -0
  161. package/es/Radio/RadioGroup.vue.d.ts +1 -1
  162. package/es/Radio/hooks/useContext.js +1 -0
  163. package/es/Radio/index.d.ts +6 -6
  164. package/es/Rate/index.vue.js +1 -0
  165. package/es/ResizeBox/index.vue.js +1 -0
  166. package/es/Scrollbar/Scrollbar.vue.d.ts +1 -1
  167. package/es/Scrollbar/Scrollbar.vue.js +1 -0
  168. package/es/Scrollbar/ScrollbarTrack.vue.js +1 -0
  169. package/es/Scrollbar/index.d.ts +3 -3
  170. package/es/Select/Option.vue.js +1 -0
  171. package/es/Select/Select.vue.d.ts +26 -26
  172. package/es/Select/Select.vue.js +1 -0
  173. package/es/Select/SelectIcon.vue.js +1 -0
  174. package/es/Select/SelectRealList.vue.js +1 -0
  175. package/es/Select/SelectView.vue.js +1 -0
  176. package/es/Select/SelectVirtualList.vue.js +1 -0
  177. package/es/Select/hooks/useContext.js +1 -0
  178. package/es/Select/hooks/useSelectOptions.js +1 -0
  179. package/es/Select/index.d.ts +14 -14
  180. package/es/Skeleton/SkeletonLine.vue.js +1 -0
  181. package/es/Skeleton/SkeletonShape.vue.js +1 -0
  182. package/es/Slider/Slider.vue.d.ts +3 -3
  183. package/es/Slider/SliderBtn.vue.js +1 -0
  184. package/es/Slider/hooks/useContext.js +1 -0
  185. package/es/Slider/hooks/useSliderDraggable.js +1 -0
  186. package/es/Slider/index.d.ts +9 -9
  187. package/es/Space/index.d.ts +3 -3
  188. package/es/Space/index.vue.d.ts +1 -1
  189. package/es/Space/index.vue.js +1 -0
  190. package/es/Spin/index.d.ts +3 -3
  191. package/es/Spin/index.vue.d.ts +1 -1
  192. package/es/Spin/index.vue.js +1 -0
  193. package/es/Split/index.d.ts +6 -6
  194. package/es/Split/index.vue.d.ts +2 -2
  195. package/es/Split/index.vue.js +1 -0
  196. package/es/Statistic/Countdown.vue.d.ts +2 -2
  197. package/es/Statistic/Countdown.vue.js +1 -0
  198. package/es/Statistic/Statistic.vue.d.ts +2 -2
  199. package/es/Statistic/Statistic.vue.js +1 -0
  200. package/es/Statistic/index.d.ts +12 -12
  201. package/es/Steps/Step.vue.d.ts +1 -1
  202. package/es/Steps/Step.vue.js +1 -0
  203. package/es/Steps/Steps.vue.d.ts +1 -1
  204. package/es/Steps/hooks/useContext.js +1 -0
  205. package/es/Steps/index.d.ts +6 -6
  206. package/es/Switch/index.d.ts +6 -6
  207. package/es/Switch/index.vue.d.ts +2 -2
  208. package/es/Switch/index.vue.js +1 -0
  209. package/es/Tabs/TabButton.vue.js +1 -0
  210. package/es/Tabs/TabPane.vue.js +1 -0
  211. package/es/Tabs/Tabs.vue.d.ts +3 -3
  212. package/es/Tabs/Tabs.vue.js +1 -0
  213. package/es/Tabs/TabsNavInk.vue.js +1 -0
  214. package/es/Tabs/TabsTab.vue.js +1 -0
  215. package/es/Tabs/hooks/useContext.js +1 -0
  216. package/es/Tabs/hooks/useTabsScroll.js +1 -0
  217. package/es/Tabs/index.d.ts +8 -8
  218. package/es/Tag/index.d.ts +3 -3
  219. package/es/Tag/index.vue.d.ts +1 -1
  220. package/es/Tag/index.vue.js +1 -0
  221. package/es/Textarea/hooks/useTextareaHeight.js +1 -0
  222. package/es/Textarea/index.d.ts +6 -6
  223. package/es/Textarea/index.vue.d.ts +2 -2
  224. package/es/Textarea/index.vue.js +1 -0
  225. package/es/TimePicker/TimePicker.vue.d.ts +3 -3
  226. package/es/TimePicker/TimePicker.vue.js +6 -6
  227. package/es/TimePicker/TimePickerPanel.vue.js +10 -10
  228. package/es/TimePicker/hooks/useContext.d.ts +1 -0
  229. package/es/TimePicker/hooks/useContext.js +11 -2
  230. package/es/TimePicker/index.d.ts +9 -9
  231. package/es/Timeline/TimelineItemPending.vue.js +1 -0
  232. package/es/Timeline/hooks/useContext.js +1 -0
  233. package/es/Tooltip/index.vue.js +1 -0
  234. package/es/Transfer/Transfer.vue.js +1 -0
  235. package/es/Transfer/TransferPanel.vue.js +1 -0
  236. package/es/Transfer/hooks/useContext.js +1 -0
  237. package/es/Trigger/hooks/useContext.js +1 -0
  238. package/es/Trigger/hooks/useTriggerPosition.js +1 -0
  239. package/es/Trigger/hooks/useTriggerVisible.js +1 -0
  240. package/es/Trigger/index.vue.js +1 -0
  241. package/es/Typography/TypographyBase.vue.d.ts +19 -19
  242. package/es/Typography/TypographyBase.vue.js +2 -1
  243. package/es/VerificationCode/index.d.ts +6 -6
  244. package/es/VerificationCode/index.vue.d.ts +2 -2
  245. package/es/VerificationCode/index.vue.js +1 -0
  246. package/es/Watermark/index.d.ts +3 -3
  247. package/es/Watermark/index.vue.d.ts +1 -1
  248. package/es/Watermark/index.vue.js +1 -0
  249. package/es/_lang/ar-eg.d.ts +206 -0
  250. package/es/_lang/de-de.d.ts +206 -0
  251. package/es/_lang/en-us.d.ts +254 -0
  252. package/es/_lang/es-es.d.ts +206 -0
  253. package/es/_lang/fr-fr.d.ts +206 -0
  254. package/es/_lang/id-id.d.ts +206 -0
  255. package/es/_lang/index.css +0 -0
  256. package/es/_lang/interface.d.ts +151 -0
  257. package/es/_lang/it-it.d.ts +206 -0
  258. package/es/_lang/ja-jp.d.ts +254 -0
  259. package/es/_lang/km-kh.d.ts +206 -0
  260. package/es/_lang/ko-kr.d.ts +206 -0
  261. package/es/_lang/ms-my.d.ts +206 -0
  262. package/es/_lang/nl-nl.d.ts +254 -0
  263. package/es/_lang/pt-pt.d.ts +206 -0
  264. package/es/_lang/ru-ru.d.ts +254 -0
  265. package/es/_lang/th-th.d.ts +206 -0
  266. package/es/_lang/vi-vn.d.ts +206 -0
  267. package/es/{_shared/locale/lang → _lang}/zh-cn.d.ts +39 -38
  268. package/es/_lang/zh-cn.js +202 -0
  269. package/es/_lang/zh-tw.d.ts +254 -0
  270. package/es/_shared/components/ExpandTransition.vue2.js +1 -0
  271. package/es/_shared/components/Icon.vue3.js +1 -0
  272. package/es/_shared/components/IconButton.vue.js +1 -0
  273. package/es/_shared/constants/index.js +1 -0
  274. package/es/_shared/icons/IconFullScreen.vue.js +1 -17
  275. package/es/_shared/icons/IconFullScreen.vue2.js +17 -1
  276. package/es/_shared/icons/IconOriginSize.vue.js +1 -23
  277. package/es/_shared/icons/IconOriginSize.vue2.js +23 -1
  278. package/es/_shared/icons/IconRotateLeft.vue.js +1 -17
  279. package/es/_shared/icons/IconRotateLeft.vue2.js +17 -1
  280. package/es/_shared/icons/IconRotateRight.vue.js +1 -17
  281. package/es/_shared/icons/IconRotateRight.vue2.js +17 -1
  282. package/es/_shared/icons/IconZoomIn.vue.js +1 -17
  283. package/es/_shared/icons/IconZoomIn.vue2.js +17 -1
  284. package/es/_shared/icons/IconZoomOut.vue.js +1 -17
  285. package/es/_shared/icons/IconZoomOut.vue2.js +17 -1
  286. package/es/_shared/utils/control.js +1 -0
  287. package/es/_shared/utils/global-config.d.ts +3 -1
  288. package/es/_shared/utils/global-config.js +4 -0
  289. package/es/_shared/utils/index.d.ts +1 -0
  290. package/es/_shared/utils/locale.d.ts +22 -0
  291. package/es/_shared/utils/locale.js +39 -0
  292. package/es/index.d.ts +27 -27
  293. package/es/index.js +0 -2
  294. package/lib/Affix/index.vue.js +1 -1
  295. package/lib/Alert/index.d.ts +3 -3
  296. package/lib/Alert/index.vue.d.ts +1 -1
  297. package/lib/Alert/index.vue.js +1 -1
  298. package/lib/Anchor/Anchor.vue.js +1 -1
  299. package/lib/Anchor/AnchorLink.vue.js +1 -1
  300. package/lib/Anchor/hooks/useContext.js +1 -1
  301. package/lib/AutoComplete/index.d.ts +19 -19
  302. package/lib/AutoComplete/index.vue.d.ts +33 -33
  303. package/lib/AutoComplete/index.vue.js +1 -1
  304. package/lib/Avatar/Avatar.vue.d.ts +2 -2
  305. package/lib/Avatar/Avatar.vue.js +1 -1
  306. package/lib/Avatar/AvatarGroup.vue.js +1 -1
  307. package/lib/Avatar/index.d.ts +5 -5
  308. package/lib/BackTop/index.vue.js +1 -1
  309. package/lib/Badge/index.vue.js +1 -1
  310. package/lib/Breadcrumb/Breadcrumb.vue.js +1 -1
  311. package/lib/Breadcrumb/BreadcrumbItem.vue.js +1 -1
  312. package/lib/Breadcrumb/BreadcrumbMore.vue.js +1 -1
  313. package/lib/Breadcrumb/BreadcrumbSeparator.vue.js +1 -1
  314. package/lib/Button/Button.vue.d.ts +3 -3
  315. package/lib/Button/ButtonGroup.vue.d.ts +1 -1
  316. package/lib/Button/hooks/useContext.js +1 -1
  317. package/lib/Button/index.d.ts +12 -12
  318. package/lib/Calendar/Calendar.vue.js +1 -1
  319. package/lib/Calendar/CalendarMonth.vue.d.ts +1 -1
  320. package/lib/Calendar/CalendarMonth.vue.js +1 -1
  321. package/lib/Calendar/CalendarYear.vue.js +1 -1
  322. package/lib/Card/Card.vue.d.ts +1 -1
  323. package/lib/Card/Card.vue.js +1 -1
  324. package/lib/Card/CardMeta.vue.d.ts +1 -1
  325. package/lib/Card/CardMeta.vue.js +1 -1
  326. package/lib/Card/index.d.ts +6 -6
  327. package/lib/Carousel/Carousel.vue.js +1 -1
  328. package/lib/Carousel/CarouselArrow.vue.js +1 -1
  329. package/lib/Carousel/CarouselIndicator.vue.js +1 -1
  330. package/lib/Carousel/hooks/useContext.js +1 -1
  331. package/lib/Cascader/Cascader.vue.d.ts +17 -17
  332. package/lib/Cascader/Cascader.vue.js +1 -1
  333. package/lib/Cascader/CascaderIcon.vue.js +1 -1
  334. package/lib/Cascader/CascaderOption.vue.js +1 -1
  335. package/lib/Cascader/CascaderPanel.vue.js +1 -1
  336. package/lib/Cascader/CascaderSearchPanel.vue.js +1 -1
  337. package/lib/Cascader/hooks/useContext.js +1 -1
  338. package/lib/Cascader/index.d.ts +16 -16
  339. package/lib/Checkbox/Checkbox.vue.js +1 -1
  340. package/lib/Checkbox/CheckboxGroup.vue.d.ts +1 -1
  341. package/lib/Checkbox/hooks/useContext.js +1 -1
  342. package/lib/Checkbox/index.d.ts +3 -3
  343. package/lib/Collapse/CollapseItem.vue.js +1 -1
  344. package/lib/Collapse/hooks/useContext.js +1 -1
  345. package/lib/ColorPicker/ColorControl.vue.js +1 -1
  346. package/lib/ColorPicker/ColorInput.vue.js +1 -1
  347. package/lib/ColorPicker/ColorList.vue.js +1 -1
  348. package/lib/ColorPicker/ColorPalette.vue.js +1 -1
  349. package/lib/ColorPicker/ColorPanel.vue.js +1 -1
  350. package/lib/ColorPicker/hooks/useContext.js +1 -1
  351. package/lib/Comment/index.vue.js +1 -1
  352. package/lib/ConfigProvider/index.d.ts +3 -3
  353. package/lib/ConfigProvider/index.vue.d.ts +1 -1
  354. package/lib/ConfigProvider/index.vue.js +1 -1
  355. package/lib/ConfigProvider/type.d.ts +3 -2
  356. package/lib/Descriptions/ReuseItem.vue.js +1 -1
  357. package/lib/Descriptions/ReuseTd.vue.js +1 -1
  358. package/lib/Descriptions/hooks/useContext.js +1 -1
  359. package/lib/Divider/index.d.ts +3 -3
  360. package/lib/Divider/index.vue.d.ts +1 -1
  361. package/lib/Divider/index.vue.js +1 -1
  362. package/lib/Drawer/Drawer.vue.d.ts +4 -4
  363. package/lib/Drawer/Drawer.vue.js +1 -1
  364. package/lib/Drawer/DrawerService.vue.d.ts +2 -2
  365. package/lib/Drawer/DrawerService.vue.js +1 -1
  366. package/lib/Drawer/index.d.ts +11 -11
  367. package/lib/Dropdown/Dropdown.vue.js +1 -1
  368. package/lib/Dropdown/DropdownButton.vue.d.ts +1 -1
  369. package/lib/Dropdown/DropdownButton.vue.js +1 -1
  370. package/lib/Dropdown/Dsubmenu.vue.js +1 -1
  371. package/lib/Dropdown/hooks/useContext.js +1 -1
  372. package/lib/Dropdown/index.d.ts +3 -3
  373. package/lib/Empty/index.vue.js +1 -1
  374. package/lib/Grid/Grid.vue.js +1 -1
  375. package/lib/Grid/GridCol.vue.js +1 -1
  376. package/lib/Grid/GridItem.vue.js +1 -1
  377. package/lib/Grid/GridRow.vue.js +1 -1
  378. package/lib/Grid/hooks/useContext.js +1 -1
  379. package/lib/Image/Image.vue.d.ts +2 -2
  380. package/lib/Image/Image.vue.js +1 -1
  381. package/lib/Image/ImagePreview.vue.js +1 -1
  382. package/lib/Image/ImagePreviewArrow.vue.js +1 -1
  383. package/lib/Image/ImagePreviewToolbar.vue.js +1 -1
  384. package/lib/Image/hooks/useContext.js +1 -1
  385. package/lib/Image/index.d.ts +6 -6
  386. package/lib/Input/Input.vue.d.ts +3 -3
  387. package/lib/Input/Input.vue.js +1 -1
  388. package/lib/Input/InputSuffix.vue.js +1 -1
  389. package/lib/Input/hooks/useLimitedInput.js +1 -1
  390. package/lib/Input/index.d.ts +9 -9
  391. package/lib/InputNumber/InputNumber.vue.d.ts +18 -18
  392. package/lib/InputNumber/InputNumber.vue.js +1 -1
  393. package/lib/InputNumber/InputOperaBtn.vue.js +1 -1
  394. package/lib/InputNumber/index.d.ts +19 -19
  395. package/lib/InputTag/index.d.ts +6 -6
  396. package/lib/InputTag/index.vue.d.ts +2 -2
  397. package/lib/InputTag/index.vue.js +1 -1
  398. package/lib/Layout/Layout.vue.js +1 -1
  399. package/lib/Layout/LayoutSider.vue.js +1 -1
  400. package/lib/Layout/hooks/useSiderContext.js +1 -1
  401. package/lib/Link/index.d.ts +3 -3
  402. package/lib/Link/index.vue.d.ts +1 -1
  403. package/lib/Link/index.vue.js +1 -1
  404. package/lib/List/List.vue.d.ts +7 -7
  405. package/lib/List/List.vue.js +1 -1
  406. package/lib/List/ListItemMeta.vue.d.ts +1 -1
  407. package/lib/List/hooks/useScrollReach.js +1 -1
  408. package/lib/List/index.d.ts +9 -9
  409. package/lib/Mention/index.d.ts +22 -22
  410. package/lib/Mention/index.vue.d.ts +39 -39
  411. package/lib/Mention/index.vue.js +1 -1
  412. package/lib/Menu/Menu.vue.js +1 -1
  413. package/lib/Menu/MenuEllipsis.vue.js +1 -1
  414. package/lib/Menu/MenuItem.vue.js +1 -1
  415. package/lib/Menu/MenuItemGroup.vue.js +1 -1
  416. package/lib/Menu/SubMenu.vue.js +1 -1
  417. package/lib/Menu/hooks/useContext.js +1 -1
  418. package/lib/Message/Message.vue.d.ts +1 -1
  419. package/lib/Message/Message.vue.js +1 -1
  420. package/lib/Message/index.d.ts +3 -3
  421. package/lib/Message/index.js +1 -1
  422. package/lib/Modal/Modal.vue.d.ts +4 -4
  423. package/lib/Modal/Modal.vue.js +1 -1
  424. package/lib/Modal/ModalService.vue.d.ts +2 -2
  425. package/lib/Modal/ModalService.vue.js +1 -1
  426. package/lib/Modal/hooks/useModalClose.js +1 -1
  427. package/lib/Modal/hooks/useModalDraggable.js +1 -1
  428. package/lib/Modal/hooks/useOnBeforeClose.js +1 -1
  429. package/lib/Modal/index.d.ts +11 -11
  430. package/lib/Notification/Notification.vue.d.ts +1 -1
  431. package/lib/Notification/Notification.vue.js +1 -1
  432. package/lib/Notification/index.d.ts +3 -3
  433. package/lib/Notification/index.js +1 -1
  434. package/lib/OverflowList/index.d.ts +3 -3
  435. package/lib/OverflowList/index.vue.d.ts +1 -1
  436. package/lib/OverflowList/index.vue.js +1 -1
  437. package/lib/PageHeader/index.vue.js +1 -1
  438. package/lib/Pagination/Pagination.vue.js +1 -1
  439. package/lib/Pagination/PaginationItem.vue.js +1 -1
  440. package/lib/Pagination/hooks/useContext.d.ts +1 -256
  441. package/lib/Pagination/hooks/useContext.js +1 -1
  442. package/lib/Popconfirm/index.d.ts +19 -19
  443. package/lib/Popconfirm/index.vue.d.ts +7 -7
  444. package/lib/Popconfirm/index.vue.js +1 -1
  445. package/lib/Popover/index.vue.js +1 -1
  446. package/lib/Progress/Progress.vue.d.ts +1 -1
  447. package/lib/Progress/Progress.vue.js +1 -1
  448. package/lib/Progress/ProgressCircle.vue.js +1 -1
  449. package/lib/Progress/ProgressLine.vue.js +1 -1
  450. package/lib/Progress/ProgressSteps.vue.js +1 -1
  451. package/lib/Progress/index.d.ts +3 -3
  452. package/lib/Radio/Radio.vue.d.ts +1 -1
  453. package/lib/Radio/Radio.vue.js +1 -1
  454. package/lib/Radio/RadioGroup.vue.d.ts +1 -1
  455. package/lib/Radio/hooks/useContext.js +1 -1
  456. package/lib/Radio/index.d.ts +6 -6
  457. package/lib/Rate/index.vue.js +1 -1
  458. package/lib/ResizeBox/index.vue.js +1 -1
  459. package/lib/Scrollbar/Scrollbar.vue.d.ts +1 -1
  460. package/lib/Scrollbar/Scrollbar.vue.js +1 -1
  461. package/lib/Scrollbar/ScrollbarTrack.vue.js +1 -1
  462. package/lib/Scrollbar/index.d.ts +3 -3
  463. package/lib/Select/Option.vue.js +1 -1
  464. package/lib/Select/Select.vue.d.ts +26 -26
  465. package/lib/Select/Select.vue.js +1 -1
  466. package/lib/Select/SelectIcon.vue.js +1 -1
  467. package/lib/Select/SelectRealList.vue.js +1 -1
  468. package/lib/Select/SelectView.vue.js +1 -1
  469. package/lib/Select/SelectVirtualList.vue.js +1 -1
  470. package/lib/Select/hooks/useContext.js +1 -1
  471. package/lib/Select/hooks/useSelectOptions.js +1 -1
  472. package/lib/Select/index.d.ts +14 -14
  473. package/lib/Skeleton/SkeletonLine.vue.js +1 -1
  474. package/lib/Skeleton/SkeletonShape.vue.js +1 -1
  475. package/lib/Slider/Slider.vue.d.ts +3 -3
  476. package/lib/Slider/SliderBtn.vue.js +1 -1
  477. package/lib/Slider/hooks/useContext.js +1 -1
  478. package/lib/Slider/hooks/useSliderDraggable.js +1 -1
  479. package/lib/Slider/index.d.ts +9 -9
  480. package/lib/Space/index.d.ts +3 -3
  481. package/lib/Space/index.vue.d.ts +1 -1
  482. package/lib/Space/index.vue.js +1 -1
  483. package/lib/Spin/index.d.ts +3 -3
  484. package/lib/Spin/index.vue.d.ts +1 -1
  485. package/lib/Spin/index.vue.js +1 -1
  486. package/lib/Split/index.d.ts +6 -6
  487. package/lib/Split/index.vue.d.ts +2 -2
  488. package/lib/Split/index.vue.js +1 -1
  489. package/lib/Statistic/Countdown.vue.d.ts +2 -2
  490. package/lib/Statistic/Countdown.vue.js +1 -1
  491. package/lib/Statistic/Statistic.vue.d.ts +2 -2
  492. package/lib/Statistic/Statistic.vue.js +1 -1
  493. package/lib/Statistic/index.d.ts +12 -12
  494. package/lib/Steps/Step.vue.d.ts +1 -1
  495. package/lib/Steps/Step.vue.js +1 -1
  496. package/lib/Steps/Steps.vue.d.ts +1 -1
  497. package/lib/Steps/hooks/useContext.js +1 -1
  498. package/lib/Steps/index.d.ts +6 -6
  499. package/lib/Switch/index.d.ts +6 -6
  500. package/lib/Switch/index.vue.d.ts +2 -2
  501. package/lib/Switch/index.vue.js +1 -1
  502. package/lib/Tabs/TabButton.vue.js +1 -1
  503. package/lib/Tabs/TabPane.vue.js +1 -1
  504. package/lib/Tabs/Tabs.vue.d.ts +3 -3
  505. package/lib/Tabs/Tabs.vue.js +1 -1
  506. package/lib/Tabs/TabsNavInk.vue.js +1 -1
  507. package/lib/Tabs/TabsTab.vue.js +1 -1
  508. package/lib/Tabs/hooks/useContext.js +1 -1
  509. package/lib/Tabs/hooks/useTabsScroll.js +1 -1
  510. package/lib/Tabs/index.d.ts +8 -8
  511. package/lib/Tag/index.d.ts +3 -3
  512. package/lib/Tag/index.vue.d.ts +1 -1
  513. package/lib/Tag/index.vue.js +1 -1
  514. package/lib/Textarea/hooks/useTextareaHeight.js +1 -1
  515. package/lib/Textarea/index.d.ts +6 -6
  516. package/lib/Textarea/index.vue.d.ts +2 -2
  517. package/lib/Textarea/index.vue.js +1 -1
  518. package/lib/TimePicker/TimePicker.vue.d.ts +3 -3
  519. package/lib/TimePicker/TimePicker.vue.js +1 -1
  520. package/lib/TimePicker/TimePickerPanel.vue.js +1 -1
  521. package/lib/TimePicker/hooks/useContext.d.ts +1 -0
  522. package/lib/TimePicker/hooks/useContext.js +1 -1
  523. package/lib/TimePicker/index.d.ts +9 -9
  524. package/lib/Timeline/TimelineItemPending.vue.js +1 -1
  525. package/lib/Timeline/hooks/useContext.js +1 -1
  526. package/lib/Tooltip/index.vue.js +1 -1
  527. package/lib/Transfer/Transfer.vue.js +1 -1
  528. package/lib/Transfer/TransferPanel.vue.js +1 -1
  529. package/lib/Transfer/hooks/useContext.js +1 -1
  530. package/lib/Trigger/hooks/useContext.js +1 -1
  531. package/lib/Trigger/hooks/useTriggerPosition.js +1 -1
  532. package/lib/Trigger/hooks/useTriggerVisible.js +1 -1
  533. package/lib/Trigger/index.vue.js +1 -1
  534. package/lib/Typography/TypographyBase.vue.d.ts +19 -19
  535. package/lib/Typography/TypographyBase.vue.js +1 -1
  536. package/lib/VerificationCode/index.d.ts +6 -6
  537. package/lib/VerificationCode/index.vue.d.ts +2 -2
  538. package/lib/VerificationCode/index.vue.js +1 -1
  539. package/lib/Watermark/index.d.ts +3 -3
  540. package/lib/Watermark/index.vue.d.ts +1 -1
  541. package/lib/Watermark/index.vue.js +1 -1
  542. package/lib/_lang/ar-eg.d.ts +206 -0
  543. package/lib/_lang/de-de.d.ts +206 -0
  544. package/lib/_lang/en-us.d.ts +254 -0
  545. package/lib/_lang/es-es.d.ts +206 -0
  546. package/lib/_lang/fr-fr.d.ts +206 -0
  547. package/lib/_lang/id-id.d.ts +206 -0
  548. package/lib/_lang/index.css +0 -0
  549. package/lib/_lang/interface.d.ts +151 -0
  550. package/lib/_lang/it-it.d.ts +206 -0
  551. package/lib/_lang/ja-jp.d.ts +254 -0
  552. package/lib/_lang/km-kh.d.ts +206 -0
  553. package/lib/_lang/ko-kr.d.ts +206 -0
  554. package/lib/_lang/ms-my.d.ts +206 -0
  555. package/lib/_lang/nl-nl.d.ts +254 -0
  556. package/lib/_lang/pt-pt.d.ts +206 -0
  557. package/lib/_lang/ru-ru.d.ts +254 -0
  558. package/lib/_lang/th-th.d.ts +206 -0
  559. package/lib/_lang/vi-vn.d.ts +206 -0
  560. package/lib/{_shared/locale/lang → _lang}/zh-cn.d.ts +39 -38
  561. package/lib/_lang/zh-cn.js +1 -0
  562. package/lib/_lang/zh-tw.d.ts +254 -0
  563. package/lib/_shared/components/ExpandTransition.vue2.js +1 -1
  564. package/lib/_shared/components/Icon.vue3.js +1 -1
  565. package/lib/_shared/components/IconButton.vue.js +1 -1
  566. package/lib/_shared/constants/index.js +1 -1
  567. package/lib/_shared/icons/IconFullScreen.vue.js +1 -1
  568. package/lib/_shared/icons/IconFullScreen.vue2.js +1 -1
  569. package/lib/_shared/icons/IconOriginSize.vue.js +1 -1
  570. package/lib/_shared/icons/IconOriginSize.vue2.js +1 -1
  571. package/lib/_shared/icons/IconRotateLeft.vue.js +1 -1
  572. package/lib/_shared/icons/IconRotateLeft.vue2.js +1 -1
  573. package/lib/_shared/icons/IconRotateRight.vue.js +1 -1
  574. package/lib/_shared/icons/IconRotateRight.vue2.js +1 -1
  575. package/lib/_shared/icons/IconZoomIn.vue.js +1 -1
  576. package/lib/_shared/icons/IconZoomIn.vue2.js +1 -1
  577. package/lib/_shared/icons/IconZoomOut.vue.js +1 -1
  578. package/lib/_shared/icons/IconZoomOut.vue2.js +1 -1
  579. package/lib/_shared/utils/control.js +1 -1
  580. package/lib/_shared/utils/global-config.d.ts +3 -1
  581. package/lib/_shared/utils/global-config.js +1 -1
  582. package/lib/_shared/utils/index.d.ts +1 -0
  583. package/lib/_shared/utils/locale.d.ts +22 -0
  584. package/lib/_shared/utils/locale.js +1 -0
  585. package/lib/index.d.ts +27 -27
  586. package/lib/index.js +1 -1
  587. package/package.json +10 -22
  588. package/es/_shared/locale/i18n.d.ts +0 -512
  589. package/es/_shared/locale/i18n.js +0 -43
  590. package/es/_shared/locale/lang/ar-eg.json.js +0 -251
  591. package/es/_shared/locale/lang/de-de.json.d.ts +0 -207
  592. package/es/_shared/locale/lang/de-de.json.js +0 -251
  593. package/es/_shared/locale/lang/en-us.json.d.ts +0 -210
  594. package/es/_shared/locale/lang/en-us.json.js +0 -256
  595. package/es/_shared/locale/lang/es-es.json.d.ts +0 -207
  596. package/es/_shared/locale/lang/es-es.json.js +0 -251
  597. package/es/_shared/locale/lang/fr-fr.json.d.ts +0 -207
  598. package/es/_shared/locale/lang/fr-fr.json.js +0 -251
  599. package/es/_shared/locale/lang/id-id.json.d.ts +0 -207
  600. package/es/_shared/locale/lang/id-id.json.js +0 -251
  601. package/es/_shared/locale/lang/it-it.json.d.ts +0 -207
  602. package/es/_shared/locale/lang/it-it.json.js +0 -251
  603. package/es/_shared/locale/lang/ja-jp.json.d.ts +0 -255
  604. package/es/_shared/locale/lang/ja-jp.json.js +0 -301
  605. package/es/_shared/locale/lang/km-kh.json.d.ts +0 -207
  606. package/es/_shared/locale/lang/km-kh.json.js +0 -251
  607. package/es/_shared/locale/lang/ko-kr.json.d.ts +0 -207
  608. package/es/_shared/locale/lang/ko-kr.json.js +0 -251
  609. package/es/_shared/locale/lang/ms-my.json.d.ts +0 -207
  610. package/es/_shared/locale/lang/ms-my.json.js +0 -251
  611. package/es/_shared/locale/lang/nl-nl.json.d.ts +0 -255
  612. package/es/_shared/locale/lang/nl-nl.json.js +0 -301
  613. package/es/_shared/locale/lang/pt-pt.json.d.ts +0 -207
  614. package/es/_shared/locale/lang/pt-pt.json.js +0 -251
  615. package/es/_shared/locale/lang/ru-ru.json.d.ts +0 -255
  616. package/es/_shared/locale/lang/ru-ru.json.js +0 -301
  617. package/es/_shared/locale/lang/th-th.json.d.ts +0 -207
  618. package/es/_shared/locale/lang/th-th.json.js +0 -251
  619. package/es/_shared/locale/lang/vi-vn.json.d.ts +0 -207
  620. package/es/_shared/locale/lang/vi-vn.json.js +0 -251
  621. package/es/_shared/locale/lang/zh-cn.json.d.ts +0 -255
  622. package/es/_shared/locale/lang/zh-cn.json.js +0 -301
  623. package/es/_shared/locale/lang/zh-tw.json.d.ts +0 -255
  624. package/es/_shared/locale/lang/zh-tw.json.js +0 -301
  625. package/es/node_modules/@intlify/core-base/dist/core-base.js +0 -1126
  626. package/es/node_modules/@intlify/message-compiler/dist/message-compiler.js +0 -65
  627. package/es/node_modules/@intlify/shared/dist/shared.js +0 -199
  628. package/es/node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js +0 -1375
  629. package/es/node_modules/@vue/devtools-api/lib/esm/const.js +0 -6
  630. package/es/node_modules/@vue/devtools-api/lib/esm/env.js +0 -12
  631. package/es/node_modules/@vue/devtools-api/lib/esm/index.js +0 -26
  632. package/es/node_modules/@vue/devtools-api/lib/esm/proxy.js +0 -103
  633. package/es/node_modules/@vue/devtools-api/lib/esm/time.js +0 -25
  634. package/lib/_shared/locale/i18n.d.ts +0 -512
  635. package/lib/_shared/locale/i18n.js +0 -1
  636. package/lib/_shared/locale/lang/ar-eg.json.js +0 -1
  637. package/lib/_shared/locale/lang/de-de.json.d.ts +0 -207
  638. package/lib/_shared/locale/lang/de-de.json.js +0 -1
  639. package/lib/_shared/locale/lang/en-us.json.d.ts +0 -210
  640. package/lib/_shared/locale/lang/en-us.json.js +0 -1
  641. package/lib/_shared/locale/lang/es-es.json.d.ts +0 -207
  642. package/lib/_shared/locale/lang/es-es.json.js +0 -1
  643. package/lib/_shared/locale/lang/fr-fr.json.d.ts +0 -207
  644. package/lib/_shared/locale/lang/fr-fr.json.js +0 -1
  645. package/lib/_shared/locale/lang/id-id.json.d.ts +0 -207
  646. package/lib/_shared/locale/lang/id-id.json.js +0 -1
  647. package/lib/_shared/locale/lang/it-it.json.d.ts +0 -207
  648. package/lib/_shared/locale/lang/it-it.json.js +0 -1
  649. package/lib/_shared/locale/lang/ja-jp.json.d.ts +0 -255
  650. package/lib/_shared/locale/lang/ja-jp.json.js +0 -1
  651. package/lib/_shared/locale/lang/km-kh.json.d.ts +0 -207
  652. package/lib/_shared/locale/lang/km-kh.json.js +0 -1
  653. package/lib/_shared/locale/lang/ko-kr.json.d.ts +0 -207
  654. package/lib/_shared/locale/lang/ko-kr.json.js +0 -1
  655. package/lib/_shared/locale/lang/ms-my.json.d.ts +0 -207
  656. package/lib/_shared/locale/lang/ms-my.json.js +0 -1
  657. package/lib/_shared/locale/lang/nl-nl.json.d.ts +0 -255
  658. package/lib/_shared/locale/lang/nl-nl.json.js +0 -1
  659. package/lib/_shared/locale/lang/pt-pt.json.d.ts +0 -207
  660. package/lib/_shared/locale/lang/pt-pt.json.js +0 -1
  661. package/lib/_shared/locale/lang/ru-ru.json.d.ts +0 -255
  662. package/lib/_shared/locale/lang/ru-ru.json.js +0 -1
  663. package/lib/_shared/locale/lang/th-th.json.d.ts +0 -207
  664. package/lib/_shared/locale/lang/th-th.json.js +0 -1
  665. package/lib/_shared/locale/lang/vi-vn.json.d.ts +0 -207
  666. package/lib/_shared/locale/lang/vi-vn.json.js +0 -1
  667. package/lib/_shared/locale/lang/zh-cn.json.d.ts +0 -255
  668. package/lib/_shared/locale/lang/zh-cn.json.js +0 -1
  669. package/lib/_shared/locale/lang/zh-tw.json.d.ts +0 -255
  670. package/lib/_shared/locale/lang/zh-tw.json.js +0 -1
  671. package/lib/node_modules/@intlify/core-base/dist/core-base.js +0 -1
  672. package/lib/node_modules/@intlify/message-compiler/dist/message-compiler.js +0 -6
  673. package/lib/node_modules/@intlify/shared/dist/shared.js +0 -7
  674. package/lib/node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js +0 -1
  675. package/lib/node_modules/@vue/devtools-api/lib/esm/const.js +0 -1
  676. package/lib/node_modules/@vue/devtools-api/lib/esm/env.js +0 -1
  677. package/lib/node_modules/@vue/devtools-api/lib/esm/index.js +0 -1
  678. package/lib/node_modules/@vue/devtools-api/lib/esm/proxy.js +0 -1
  679. package/lib/node_modules/@vue/devtools-api/lib/esm/time.js +0 -1
@@ -1,1375 +0,0 @@
1
- import { DEFAULT_LOCALE, updateFallbackLocale, createCoreContext, clearDateTimeFormat, clearNumberFormat, isMessageAST, AST_NODE_PROPS_KEYS, setAdditionalMeta, getFallbackContext, NOT_RESOLVED, isTranslateFallbackWarn, isTranslateMissingWarn, CORE_ERROR_CODES_EXTEND_POINT, fallbackWithLocaleChain, CORE_WARN_CODES_EXTEND_POINT, setFallbackContext, parseTranslateArgs, translate, MISSING_RESOLVE_VALUE, parseDateTimeArgs, datetime, parseNumberArgs, number, isMessageFunction, DATETIME_FORMAT_OPTIONS_KEYS, NUMBER_FORMAT_OPTIONS_KEYS, setDevToolsHook } from "../../core-base/dist/core-base.js";
2
- import { isBoolean, makeSymbol, isPlainObject, createEmitter, isString, isArray, isRegExp, isFunction, inBrowser, create, deepCopy, hasOwn, isObject, assign, isNumber, warn, format, isEmptyObject, getGlobalThis } from "../../shared/dist/shared.js";
3
- import { effectScope, ref, shallowRef, computed, watch, isRef, defineComponent, getCurrentInstance, h, Fragment, inject, onMounted, onUnmounted, createVNode, Text } from "vue";
4
- import { setupDevtoolsPlugin } from "../../../@vue/devtools-api/lib/esm/index.js";
5
- import { createCompileError } from "../../message-compiler/dist/message-compiler.js";
6
- /*!
7
- * vue-i18n-core v12.0.0-alpha.3
8
- * (c) 2016-present kazuya kawaguchi and contributors
9
- * Released under the MIT License.
10
- */
11
- const VERSION = "12.0.0-alpha.3";
12
- function initFeatureFlags() {
13
- if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") {
14
- getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
15
- }
16
- }
17
- const I18nErrorCodes = {
18
- // composer module errors
19
- UNEXPECTED_RETURN_TYPE: CORE_ERROR_CODES_EXTEND_POINT,
20
- // 24
21
- // legacy module errors
22
- INVALID_ARGUMENT: 25,
23
- // i18n module errors
24
- MUST_BE_CALL_SETUP_TOP: 26,
25
- NOT_INSTALLED: 27,
26
- // directive module errors
27
- REQUIRED_VALUE: 28,
28
- INVALID_VALUE: 29,
29
- // vue-devtools errors
30
- CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: 30,
31
- NOT_INSTALLED_WITH_PROVIDE: 31,
32
- // unexpected error
33
- UNEXPECTED_ERROR: 32,
34
- // duplicate `useI18n` calling
35
- DUPLICATE_USE_I18N_CALLING: 33
36
- };
37
- function createI18nError(code, ...args) {
38
- return createCompileError(code, null, process.env.NODE_ENV !== "production" ? { messages: errorMessages, args } : void 0);
39
- }
40
- const errorMessages = {
41
- [I18nErrorCodes.UNEXPECTED_RETURN_TYPE]: "Unexpected return type in composer",
42
- [I18nErrorCodes.INVALID_ARGUMENT]: "Invalid argument",
43
- [I18nErrorCodes.MUST_BE_CALL_SETUP_TOP]: "Must be called at the top of a `setup` function",
44
- [I18nErrorCodes.NOT_INSTALLED]: "Need to install with `app.use` function",
45
- [I18nErrorCodes.UNEXPECTED_ERROR]: "Unexpected error",
46
- [I18nErrorCodes.REQUIRED_VALUE]: `Required in value: {0}`,
47
- [I18nErrorCodes.INVALID_VALUE]: `Invalid value`,
48
- [I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]: `Cannot setup vue-devtools plugin`,
49
- [I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE]: "Need to install with `provide` function",
50
- [I18nErrorCodes.DUPLICATE_USE_I18N_CALLING]: "Duplicate local-scope `useI18n` call detected. Call `useI18n` only once per component."
51
- };
52
- const TranslateVNodeSymbol = /* @__PURE__ */ makeSymbol("__translateVNode");
53
- const DatetimePartsSymbol = /* @__PURE__ */ makeSymbol("__datetimeParts");
54
- const NumberPartsSymbol = /* @__PURE__ */ makeSymbol("__numberParts");
55
- const EnableEmitter = /* @__PURE__ */ makeSymbol("__enableEmitter");
56
- const DisableEmitter = /* @__PURE__ */ makeSymbol("__disableEmitter");
57
- const SetPluralRulesSymbol = makeSymbol("__setPluralRules");
58
- const InejctWithOptionSymbol = /* @__PURE__ */ makeSymbol("__injectWithOption");
59
- const DisposeSymbol = /* @__PURE__ */ makeSymbol("__dispose");
60
- const I18nWarnCodes = {
61
- FALLBACK_TO_ROOT: CORE_WARN_CODES_EXTEND_POINT,
62
- // 8
63
- NOT_FOUND_PARENT_SCOPE: 9,
64
- IGNORE_OBJ_FLATTEN: 10
65
- };
66
- const warnMessages = {
67
- [I18nWarnCodes.FALLBACK_TO_ROOT]: `Fall back to {type} '{key}' with root locale.`,
68
- [I18nWarnCodes.NOT_FOUND_PARENT_SCOPE]: `Not found parent scope. use the global scope.`,
69
- [I18nWarnCodes.IGNORE_OBJ_FLATTEN]: `Ignore object flatten: '{key}' key has an string value`
70
- };
71
- function getWarnMessage(code, ...args) {
72
- return format(warnMessages[code], ...args);
73
- }
74
- function handleFlatJson(obj) {
75
- if (!isObject(obj)) {
76
- return obj;
77
- }
78
- if (isMessageAST(obj)) {
79
- return obj;
80
- }
81
- for (const key in obj) {
82
- if (!hasOwn(obj, key)) {
83
- continue;
84
- }
85
- if (!key.includes(".")) {
86
- if (isObject(obj[key])) {
87
- handleFlatJson(obj[key]);
88
- }
89
- } else {
90
- const subKeys = key.split(".");
91
- const lastIndex = subKeys.length - 1;
92
- let currentObj = obj;
93
- let hasStringValue = false;
94
- for (let i = 0; i < lastIndex; i++) {
95
- if (subKeys[i] === "__proto__") {
96
- throw new Error(`unsafe key: ${subKeys[i]}`);
97
- }
98
- if (!(subKeys[i] in currentObj)) {
99
- currentObj[subKeys[i]] = create();
100
- }
101
- if (!isObject(currentObj[subKeys[i]])) {
102
- process.env.NODE_ENV !== "production" && warn(getWarnMessage(I18nWarnCodes.IGNORE_OBJ_FLATTEN, {
103
- key: subKeys[i]
104
- }));
105
- hasStringValue = true;
106
- break;
107
- }
108
- currentObj = currentObj[subKeys[i]];
109
- }
110
- if (!hasStringValue) {
111
- if (!isMessageAST(currentObj)) {
112
- currentObj[subKeys[lastIndex]] = obj[key];
113
- delete obj[key];
114
- } else {
115
- if (!AST_NODE_PROPS_KEYS.includes(subKeys[lastIndex])) {
116
- delete obj[key];
117
- }
118
- }
119
- }
120
- if (!isMessageAST(currentObj)) {
121
- const target = currentObj[subKeys[lastIndex]];
122
- if (isObject(target)) {
123
- handleFlatJson(target);
124
- }
125
- }
126
- }
127
- }
128
- return obj;
129
- }
130
- function getLocaleMessages(locale, options) {
131
- const { messages, __i18n, messageResolver, flatJson } = options;
132
- const ret = isPlainObject(messages) ? messages : isArray(__i18n) ? create() : { [locale]: create() };
133
- if (isArray(__i18n)) {
134
- __i18n.forEach((custom) => {
135
- if ("locale" in custom && "resource" in custom) {
136
- const { locale: locale2, resource } = custom;
137
- if (locale2) {
138
- ret[locale2] = ret[locale2] || create();
139
- deepCopy(resource, ret[locale2]);
140
- } else {
141
- deepCopy(resource, ret);
142
- }
143
- } else {
144
- isString(custom) && deepCopy(JSON.parse(custom), ret);
145
- }
146
- });
147
- }
148
- if (messageResolver == null && flatJson) {
149
- for (const key in ret) {
150
- if (hasOwn(ret, key)) {
151
- handleFlatJson(ret[key]);
152
- }
153
- }
154
- }
155
- return ret;
156
- }
157
- function getComponentOptions(instance) {
158
- return instance.type;
159
- }
160
- function adjustI18nResources(gl, options, componentOptions) {
161
- let messages = isObject(options.messages) ? options.messages : create();
162
- if ("__i18nGlobal" in componentOptions) {
163
- messages = getLocaleMessages(gl.locale.value, {
164
- messages,
165
- __i18n: componentOptions.__i18nGlobal
166
- });
167
- }
168
- const locales = Object.keys(messages);
169
- if (locales.length) {
170
- locales.forEach((locale) => {
171
- gl.mergeLocaleMessage(locale, messages[locale]);
172
- });
173
- }
174
- {
175
- if (isObject(options.datetimeFormats)) {
176
- const locales2 = Object.keys(options.datetimeFormats);
177
- if (locales2.length) {
178
- locales2.forEach((locale) => {
179
- gl.mergeDateTimeFormat(locale, options.datetimeFormats[locale]);
180
- });
181
- }
182
- }
183
- if (isObject(options.numberFormats)) {
184
- const locales2 = Object.keys(options.numberFormats);
185
- if (locales2.length) {
186
- locales2.forEach((locale) => {
187
- gl.mergeNumberFormat(locale, options.numberFormats[locale]);
188
- });
189
- }
190
- }
191
- }
192
- }
193
- function createTextNode(key) {
194
- return createVNode(Text, null, key, 0);
195
- }
196
- const DEVTOOLS_META = "__INTLIFY_META__";
197
- const NOOP_RETURN_ARRAY = () => [];
198
- const NOOP_RETURN_FALSE = () => false;
199
- let composerID = 0;
200
- function defineCoreMissingHandler(missing) {
201
- return (ctx, locale, key, type) => {
202
- return missing(locale, key, getCurrentInstance() || void 0, type);
203
- };
204
- }
205
- const getMetaInfo = /* @__NO_SIDE_EFFECTS__ */ () => {
206
- const instance = getCurrentInstance();
207
- let meta = null;
208
- return instance && (meta = getComponentOptions(instance)[DEVTOOLS_META]) ? { [DEVTOOLS_META]: meta } : null;
209
- };
210
- function createComposer(options = {}) {
211
- const { __root, __injectWithOption } = options;
212
- const _isGlobal = __root === void 0;
213
- const flatJson = options.flatJson;
214
- const _ref = inBrowser ? ref : shallowRef;
215
- let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
216
- const _locale = _ref(
217
- // prettier-ignore
218
- __root && _inheritLocale ? __root.locale.value : isString(options.locale) ? options.locale : DEFAULT_LOCALE
219
- );
220
- const _fallbackLocale = _ref(
221
- // prettier-ignore
222
- __root && _inheritLocale ? __root.fallbackLocale.value : isString(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value
223
- );
224
- const _messages = _ref(getLocaleMessages(_locale.value, options));
225
- const _datetimeFormats = _ref(isPlainObject(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
226
- const _numberFormats = _ref(isPlainObject(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
227
- let _missingWarn = __root ? __root.missingWarn : isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
228
- let _fallbackWarn = __root ? __root.fallbackWarn : isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
229
- let _fallbackRoot = __root ? __root.fallbackRoot : isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
230
- let _fallbackFormat = !!options.fallbackFormat;
231
- let _missing = isFunction(options.missing) ? options.missing : null;
232
- let _runtimeMissing = isFunction(options.missing) ? defineCoreMissingHandler(options.missing) : null;
233
- let _postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null;
234
- let _warnHtmlMessage = __root ? __root.warnHtmlMessage : isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
235
- let _escapeParameter = !!options.escapeParameter;
236
- const _modifiers = __root ? __root.modifiers : isPlainObject(options.modifiers) ? options.modifiers : {};
237
- let _pluralRules = options.pluralRules || __root && __root.pluralRules;
238
- let _context;
239
- const getCoreContext = () => {
240
- _isGlobal && setFallbackContext(null);
241
- const ctxOptions = {
242
- version: VERSION,
243
- locale: _locale.value,
244
- fallbackLocale: _fallbackLocale.value,
245
- messages: _messages.value,
246
- modifiers: _modifiers,
247
- pluralRules: _pluralRules,
248
- missing: _runtimeMissing === null ? void 0 : _runtimeMissing,
249
- missingWarn: _missingWarn,
250
- fallbackWarn: _fallbackWarn,
251
- fallbackFormat: _fallbackFormat,
252
- unresolving: true,
253
- postTranslation: _postTranslation === null ? void 0 : _postTranslation,
254
- warnHtmlMessage: _warnHtmlMessage,
255
- escapeParameter: _escapeParameter,
256
- messageResolver: options.messageResolver,
257
- messageCompiler: options.messageCompiler,
258
- __meta: { framework: "vue" }
259
- };
260
- {
261
- ctxOptions.datetimeFormats = _datetimeFormats.value;
262
- ctxOptions.numberFormats = _numberFormats.value;
263
- ctxOptions.__datetimeFormatters = isPlainObject(_context) ? _context.__datetimeFormatters : void 0;
264
- ctxOptions.__numberFormatters = isPlainObject(_context) ? _context.__numberFormatters : void 0;
265
- }
266
- if (process.env.NODE_ENV !== "production") {
267
- ctxOptions.__v_emitter = isPlainObject(_context) ? _context.__v_emitter : void 0;
268
- }
269
- const ctx = createCoreContext(ctxOptions);
270
- _isGlobal && setFallbackContext(ctx);
271
- return ctx;
272
- };
273
- _context = getCoreContext();
274
- updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
275
- function trackReactivityValues() {
276
- return [
277
- _locale.value,
278
- _fallbackLocale.value,
279
- _messages.value,
280
- _datetimeFormats.value,
281
- _numberFormats.value
282
- ];
283
- }
284
- const locale = computed({
285
- get: () => _locale.value,
286
- set: (val) => {
287
- _context.locale = val;
288
- _locale.value = val;
289
- }
290
- });
291
- const fallbackLocale = computed({
292
- get: () => _fallbackLocale.value,
293
- set: (val) => {
294
- _context.fallbackLocale = val;
295
- _fallbackLocale.value = val;
296
- updateFallbackLocale(_context, _locale.value, val);
297
- }
298
- });
299
- const messages = computed(() => _messages.value);
300
- const availableLocales = computed(() => Object.keys(_messages.value).sort());
301
- const datetimeFormats = /* @__PURE__ */ computed(() => _datetimeFormats.value);
302
- const numberFormats = /* @__PURE__ */ computed(() => _numberFormats.value);
303
- function getPostTranslationHandler() {
304
- return isFunction(_postTranslation) ? _postTranslation : null;
305
- }
306
- function setPostTranslationHandler(handler) {
307
- _postTranslation = handler;
308
- _context.postTranslation = handler;
309
- }
310
- function getMissingHandler() {
311
- return _missing;
312
- }
313
- function setMissingHandler(handler) {
314
- if (handler !== null) {
315
- _runtimeMissing = defineCoreMissingHandler(handler);
316
- }
317
- _missing = handler;
318
- _context.missing = _runtimeMissing;
319
- }
320
- function isResolvedTranslateMessage(type, arg) {
321
- return type !== "translate" || !arg.resolvedMessage;
322
- }
323
- const wrapWithDeps = (fn, argumentParser, warnType, fallbackSuccess, fallbackFail, successCondition) => {
324
- trackReactivityValues();
325
- let ret;
326
- try {
327
- if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
328
- setAdditionalMeta(/* @__PURE__ */ getMetaInfo());
329
- }
330
- if (!_isGlobal) {
331
- _context.fallbackContext = __root ? getFallbackContext() : void 0;
332
- }
333
- ret = fn(_context);
334
- } finally {
335
- if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) ;
336
- if (!_isGlobal) {
337
- _context.fallbackContext = void 0;
338
- }
339
- }
340
- if (warnType !== "translate exists" && // for not `te` (e.g `t`)
341
- isNumber(ret) && ret === NOT_RESOLVED || warnType === "translate exists" && !ret) {
342
- const [key, arg2] = argumentParser();
343
- if (process.env.NODE_ENV !== "production" && __root && isString(key) && isResolvedTranslateMessage(warnType, arg2)) {
344
- if (_fallbackRoot && (isTranslateFallbackWarn(_fallbackWarn, key) || isTranslateMissingWarn(_missingWarn, key))) {
345
- warn(getWarnMessage(I18nWarnCodes.FALLBACK_TO_ROOT, {
346
- key,
347
- type: warnType
348
- }));
349
- }
350
- if (process.env.NODE_ENV !== "production") {
351
- const { __v_emitter: emitter } = _context;
352
- if (emitter && _fallbackRoot) {
353
- emitter.emit("fallback", {
354
- type: warnType,
355
- key,
356
- to: "global",
357
- groupId: `${warnType}:${key}`
358
- });
359
- }
360
- }
361
- }
362
- return __root && _fallbackRoot ? fallbackSuccess(__root) : fallbackFail(key);
363
- } else if (successCondition(ret)) {
364
- return ret;
365
- } else {
366
- throw createI18nError(I18nErrorCodes.UNEXPECTED_RETURN_TYPE);
367
- }
368
- };
369
- function t(...args) {
370
- return wrapWithDeps((context) => Reflect.apply(translate, null, [context, ...args]), () => parseTranslateArgs(...args), "translate", (root) => Reflect.apply(root.t, root, [...args]), (key) => key, (val) => isString(val));
371
- }
372
- function rt(...args) {
373
- const [arg1, arg2, arg3] = args;
374
- if (arg3 && !isObject(arg3)) {
375
- throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT);
376
- }
377
- return t(...[arg1, arg2, assign({ resolvedMessage: true }, arg3 || {})]);
378
- }
379
- function d(...args) {
380
- 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));
381
- }
382
- function n(...args) {
383
- 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));
384
- }
385
- function normalize(values) {
386
- return values.map((val) => isString(val) || isNumber(val) || isBoolean(val) ? createTextNode(String(val)) : val);
387
- }
388
- const interpolate = (val) => val;
389
- const processor = {
390
- normalize,
391
- interpolate,
392
- type: "vnode"
393
- };
394
- function translateVNode(...args) {
395
- return wrapWithDeps((context) => {
396
- let ret;
397
- const _context2 = context;
398
- try {
399
- _context2.processor = processor;
400
- ret = Reflect.apply(translate, null, [_context2, ...args]);
401
- } finally {
402
- _context2.processor = null;
403
- }
404
- return ret;
405
- }, () => parseTranslateArgs(...args), "translate", (root) => root[TranslateVNodeSymbol](...args), (key) => [createTextNode(key)], (val) => isArray(val));
406
- }
407
- function numberParts(...args) {
408
- 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));
409
- }
410
- function datetimeParts(...args) {
411
- 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));
412
- }
413
- function setPluralRules(rules) {
414
- _pluralRules = rules;
415
- _context.pluralRules = _pluralRules;
416
- }
417
- function te(key, locale2) {
418
- return wrapWithDeps(() => {
419
- if (!key) {
420
- return false;
421
- }
422
- const targetLocale = isString(locale2) ? locale2 : _locale.value;
423
- const message = getLocaleMessage(targetLocale);
424
- const resolved = _context.messageResolver(message, key);
425
- return isMessageAST(resolved) || isMessageFunction(resolved) || isString(resolved);
426
- }, () => [key], "translate exists", (root) => {
427
- return Reflect.apply(root.te, root, [key, locale2]);
428
- }, NOOP_RETURN_FALSE, (val) => isBoolean(val));
429
- }
430
- function resolveMessages(key) {
431
- let messages2 = null;
432
- const locales = fallbackWithLocaleChain(_context, _fallbackLocale.value, _locale.value);
433
- for (let i = 0; i < locales.length; i++) {
434
- const targetLocaleMessages = _messages.value[locales[i]] || {};
435
- const messageValue = _context.messageResolver(targetLocaleMessages, key);
436
- if (messageValue != null) {
437
- messages2 = messageValue;
438
- break;
439
- }
440
- }
441
- return messages2;
442
- }
443
- function tm(key) {
444
- const messages2 = resolveMessages(key);
445
- return messages2 != null ? messages2 : __root ? __root.tm(key) || {} : {};
446
- }
447
- function getLocaleMessage(locale2) {
448
- return _messages.value[locale2] || {};
449
- }
450
- function setLocaleMessage(locale2, message) {
451
- if (flatJson) {
452
- const _message = { [locale2]: message };
453
- for (const key in _message) {
454
- if (hasOwn(_message, key)) {
455
- handleFlatJson(_message[key]);
456
- }
457
- }
458
- message = _message[locale2];
459
- }
460
- _messages.value[locale2] = message;
461
- _context.messages = _messages.value;
462
- }
463
- function mergeLocaleMessage(locale2, message) {
464
- _messages.value[locale2] = _messages.value[locale2] || {};
465
- const _message = { [locale2]: message };
466
- if (flatJson) {
467
- for (const key in _message) {
468
- if (hasOwn(_message, key)) {
469
- handleFlatJson(_message[key]);
470
- }
471
- }
472
- }
473
- message = _message[locale2];
474
- deepCopy(message, _messages.value[locale2]);
475
- _context.messages = _messages.value;
476
- }
477
- function getDateTimeFormat(locale2) {
478
- return _datetimeFormats.value[locale2] || {};
479
- }
480
- function setDateTimeFormat(locale2, format2) {
481
- _datetimeFormats.value[locale2] = format2;
482
- _context.datetimeFormats = _datetimeFormats.value;
483
- clearDateTimeFormat(_context, locale2, format2);
484
- }
485
- function mergeDateTimeFormat(locale2, format2) {
486
- _datetimeFormats.value[locale2] = assign(_datetimeFormats.value[locale2] || {}, format2);
487
- _context.datetimeFormats = _datetimeFormats.value;
488
- clearDateTimeFormat(_context, locale2, format2);
489
- }
490
- function getNumberFormat(locale2) {
491
- return _numberFormats.value[locale2] || {};
492
- }
493
- function setNumberFormat(locale2, format2) {
494
- _numberFormats.value[locale2] = format2;
495
- _context.numberFormats = _numberFormats.value;
496
- clearNumberFormat(_context, locale2, format2);
497
- }
498
- function mergeNumberFormat(locale2, format2) {
499
- _numberFormats.value[locale2] = assign(_numberFormats.value[locale2] || {}, format2);
500
- _context.numberFormats = _numberFormats.value;
501
- clearNumberFormat(_context, locale2, format2);
502
- }
503
- composerID++;
504
- if (__root && inBrowser) {
505
- watch(__root.locale, (val) => {
506
- if (_inheritLocale) {
507
- _locale.value = val;
508
- _context.locale = val;
509
- updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
510
- }
511
- });
512
- watch(__root.fallbackLocale, (val) => {
513
- if (_inheritLocale) {
514
- _fallbackLocale.value = val;
515
- _context.fallbackLocale = val;
516
- updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
517
- }
518
- });
519
- }
520
- const composer = {
521
- id: composerID,
522
- locale,
523
- fallbackLocale,
524
- get inheritLocale() {
525
- return _inheritLocale;
526
- },
527
- set inheritLocale(val) {
528
- _inheritLocale = val;
529
- if (val && __root) {
530
- _locale.value = __root.locale.value;
531
- _fallbackLocale.value = __root.fallbackLocale.value;
532
- updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
533
- }
534
- },
535
- availableLocales,
536
- messages,
537
- get modifiers() {
538
- return _modifiers;
539
- },
540
- get pluralRules() {
541
- return _pluralRules || {};
542
- },
543
- get isGlobal() {
544
- return _isGlobal;
545
- },
546
- get missingWarn() {
547
- return _missingWarn;
548
- },
549
- set missingWarn(val) {
550
- _missingWarn = val;
551
- _context.missingWarn = _missingWarn;
552
- },
553
- get fallbackWarn() {
554
- return _fallbackWarn;
555
- },
556
- set fallbackWarn(val) {
557
- _fallbackWarn = val;
558
- _context.fallbackWarn = _fallbackWarn;
559
- },
560
- get fallbackRoot() {
561
- return _fallbackRoot;
562
- },
563
- set fallbackRoot(val) {
564
- _fallbackRoot = val;
565
- },
566
- get fallbackFormat() {
567
- return _fallbackFormat;
568
- },
569
- set fallbackFormat(val) {
570
- _fallbackFormat = val;
571
- _context.fallbackFormat = _fallbackFormat;
572
- },
573
- get warnHtmlMessage() {
574
- return _warnHtmlMessage;
575
- },
576
- set warnHtmlMessage(val) {
577
- _warnHtmlMessage = val;
578
- _context.warnHtmlMessage = val;
579
- },
580
- get escapeParameter() {
581
- return _escapeParameter;
582
- },
583
- set escapeParameter(val) {
584
- _escapeParameter = val;
585
- _context.escapeParameter = val;
586
- },
587
- t,
588
- getLocaleMessage,
589
- setLocaleMessage,
590
- mergeLocaleMessage,
591
- getPostTranslationHandler,
592
- setPostTranslationHandler,
593
- getMissingHandler,
594
- setMissingHandler,
595
- [SetPluralRulesSymbol]: setPluralRules
596
- };
597
- {
598
- composer.datetimeFormats = datetimeFormats;
599
- composer.numberFormats = numberFormats;
600
- composer.rt = rt;
601
- composer.te = te;
602
- composer.tm = tm;
603
- composer.d = d;
604
- composer.n = n;
605
- composer.getDateTimeFormat = getDateTimeFormat;
606
- composer.setDateTimeFormat = setDateTimeFormat;
607
- composer.mergeDateTimeFormat = mergeDateTimeFormat;
608
- composer.getNumberFormat = getNumberFormat;
609
- composer.setNumberFormat = setNumberFormat;
610
- composer.mergeNumberFormat = mergeNumberFormat;
611
- composer[InejctWithOptionSymbol] = __injectWithOption;
612
- composer[TranslateVNodeSymbol] = translateVNode;
613
- composer[DatetimePartsSymbol] = datetimeParts;
614
- composer[NumberPartsSymbol] = numberParts;
615
- }
616
- if (process.env.NODE_ENV !== "production") {
617
- composer[EnableEmitter] = (emitter) => {
618
- _context.__v_emitter = emitter;
619
- };
620
- composer[DisableEmitter] = () => {
621
- _context.__v_emitter = void 0;
622
- };
623
- }
624
- return composer;
625
- }
626
- const VUE_I18N_COMPONENT_TYPES = "vue-i18n: composer properties";
627
- const VueDevToolsLabels = {
628
- "vue-devtools-plugin-vue-i18n": "Vue I18n DevTools",
629
- "vue-i18n-resource-inspector": "Vue I18n DevTools",
630
- "vue-i18n-timeline": "Vue I18n"
631
- };
632
- const VueDevToolsPlaceholders = {
633
- "vue-i18n-resource-inspector": "Search for scopes ..."
634
- };
635
- const VueDevToolsTimelineColors = {
636
- "vue-i18n-timeline": 16764185
637
- };
638
- let devtoolsApi;
639
- async function enableDevTools(app, i18n) {
640
- return new Promise((resolve, reject) => {
641
- try {
642
- setupDevtoolsPlugin({
643
- id: "vue-devtools-plugin-vue-i18n",
644
- label: VueDevToolsLabels["vue-devtools-plugin-vue-i18n"],
645
- packageName: "vue-i18n",
646
- homepage: "https://vue-i18n.intlify.dev",
647
- logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",
648
- componentStateTypes: [VUE_I18N_COMPONENT_TYPES],
649
- app
650
- // eslint-disable-line @typescript-eslint/no-explicit-any
651
- }, (api) => {
652
- devtoolsApi = api;
653
- api.on.visitComponentTree(({ componentInstance, treeNode }) => {
654
- updateComponentTreeTags(componentInstance, treeNode, i18n);
655
- });
656
- api.on.inspectComponent(({ componentInstance, instanceData }) => {
657
- if (componentInstance.vnode.el && componentInstance.vnode.el.__VUE_I18N__ && instanceData) {
658
- inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__);
659
- }
660
- });
661
- api.addInspector({
662
- id: "vue-i18n-resource-inspector",
663
- label: VueDevToolsLabels["vue-i18n-resource-inspector"],
664
- icon: "language",
665
- treeFilterPlaceholder: VueDevToolsPlaceholders["vue-i18n-resource-inspector"]
666
- });
667
- api.on.getInspectorTree((payload) => {
668
- if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
669
- registerScope(payload, i18n);
670
- }
671
- });
672
- const roots = /* @__PURE__ */ new Map();
673
- api.on.getInspectorState(async (payload) => {
674
- if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
675
- api.unhighlightElement();
676
- inspectScope(payload, i18n);
677
- if (payload.nodeId === "global") {
678
- if (!roots.has(payload.app)) {
679
- const [root] = await api.getComponentInstances(payload.app);
680
- roots.set(payload.app, root);
681
- }
682
- api.highlightElement(roots.get(payload.app));
683
- } else {
684
- const instance = getComponentInstance(payload.nodeId, i18n);
685
- instance && api.highlightElement(instance);
686
- }
687
- }
688
- });
689
- api.on.editInspectorState((payload) => {
690
- if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") {
691
- editScope(payload, i18n);
692
- }
693
- });
694
- api.addTimelineLayer({
695
- id: "vue-i18n-timeline",
696
- label: VueDevToolsLabels["vue-i18n-timeline"],
697
- color: VueDevToolsTimelineColors["vue-i18n-timeline"]
698
- });
699
- resolve(true);
700
- });
701
- } catch (e) {
702
- console.error(e);
703
- reject(false);
704
- }
705
- });
706
- }
707
- function getI18nScopeLable(instance) {
708
- return instance.type.name || instance.type.displayName || instance.type.__file || "Anonymous";
709
- }
710
- function updateComponentTreeTags(instance, treeNode, i18n) {
711
- const global = i18n.global;
712
- if (instance && instance.vnode.el && instance.vnode.el.__VUE_I18N__) {
713
- if (instance.vnode.el.__VUE_I18N__ !== global) {
714
- const tag = {
715
- label: `i18n (${getI18nScopeLable(instance)} Scope)`,
716
- textColor: 0,
717
- backgroundColor: 16764185
718
- };
719
- treeNode.tags.push(tag);
720
- }
721
- }
722
- }
723
- function inspectComposer(instanceData, composer) {
724
- const type = VUE_I18N_COMPONENT_TYPES;
725
- instanceData.state.push({
726
- type,
727
- key: "locale",
728
- editable: true,
729
- value: composer.locale.value
730
- });
731
- instanceData.state.push({
732
- type,
733
- key: "availableLocales",
734
- editable: false,
735
- value: composer.availableLocales
736
- });
737
- instanceData.state.push({
738
- type,
739
- key: "fallbackLocale",
740
- editable: true,
741
- value: composer.fallbackLocale.value
742
- });
743
- instanceData.state.push({
744
- type,
745
- key: "inheritLocale",
746
- editable: true,
747
- value: composer.inheritLocale
748
- });
749
- instanceData.state.push({
750
- type,
751
- key: "messages",
752
- editable: false,
753
- value: getLocaleMessageValue(composer.messages.value)
754
- });
755
- {
756
- instanceData.state.push({
757
- type,
758
- key: "datetimeFormats",
759
- editable: false,
760
- value: composer.datetimeFormats.value
761
- });
762
- instanceData.state.push({
763
- type,
764
- key: "numberFormats",
765
- editable: false,
766
- value: composer.numberFormats.value
767
- });
768
- }
769
- }
770
- function getLocaleMessageValue(messages) {
771
- const value = {};
772
- Object.keys(messages).forEach((key) => {
773
- const v = messages[key];
774
- if (isFunction(v) && "source" in v) {
775
- value[key] = getMessageFunctionDetails(v);
776
- } else if (isMessageAST(v) && v.loc && v.loc.source) {
777
- value[key] = v.loc.source;
778
- } else if (isObject(v)) {
779
- value[key] = getLocaleMessageValue(v);
780
- } else {
781
- value[key] = v;
782
- }
783
- });
784
- return value;
785
- }
786
- const ESC = {
787
- "<": "&lt;",
788
- ">": "&gt;",
789
- '"': "&quot;",
790
- "&": "&amp;"
791
- };
792
- function escape(s) {
793
- return s.replace(/[<>"&]/g, escapeChar);
794
- }
795
- function escapeChar(a) {
796
- return ESC[a] || a;
797
- }
798
- function getMessageFunctionDetails(func) {
799
- const argString = func.source ? `("${escape(func.source)}")` : `(?)`;
800
- return {
801
- _custom: {
802
- type: "function",
803
- display: `<span>ƒ</span> ${argString}`
804
- }
805
- };
806
- }
807
- function registerScope(payload, i18n) {
808
- payload.rootNodes.push({
809
- id: "global",
810
- label: "Global Scope"
811
- });
812
- const global = i18n.global;
813
- for (const [keyInstance, instance] of i18n.__instances) {
814
- const composer = instance;
815
- if (global === composer) {
816
- continue;
817
- }
818
- payload.rootNodes.push({
819
- id: composer.id.toString(),
820
- label: `${getI18nScopeLable(keyInstance)} Scope`
821
- });
822
- }
823
- }
824
- function getComponentInstance(nodeId, i18n) {
825
- let instance = null;
826
- if (nodeId !== "global") {
827
- for (const [component, composer] of i18n.__instances.entries()) {
828
- if (composer.id.toString() === nodeId) {
829
- instance = component;
830
- break;
831
- }
832
- }
833
- }
834
- return instance;
835
- }
836
- function getComposer$1(nodeId, i18n) {
837
- if (nodeId === "global") {
838
- return i18n.global;
839
- } else {
840
- const instance = Array.from(i18n.__instances.values()).find((item) => item.id.toString() === nodeId);
841
- if (instance) {
842
- return instance;
843
- } else {
844
- return null;
845
- }
846
- }
847
- }
848
- function inspectScope(payload, i18n) {
849
- const composer = getComposer$1(payload.nodeId, i18n);
850
- if (composer) {
851
- payload.state = makeScopeInspectState(composer);
852
- }
853
- return null;
854
- }
855
- function makeScopeInspectState(composer) {
856
- const state = {};
857
- const localeType = "Locale related info";
858
- const localeStates = [
859
- {
860
- type: localeType,
861
- key: "locale",
862
- editable: true,
863
- value: composer.locale.value
864
- },
865
- {
866
- type: localeType,
867
- key: "fallbackLocale",
868
- editable: true,
869
- value: composer.fallbackLocale.value
870
- },
871
- {
872
- type: localeType,
873
- key: "availableLocales",
874
- editable: false,
875
- value: composer.availableLocales
876
- },
877
- {
878
- type: localeType,
879
- key: "inheritLocale",
880
- editable: true,
881
- value: composer.inheritLocale
882
- }
883
- ];
884
- state[localeType] = localeStates;
885
- const localeMessagesType = "Locale messages info";
886
- const localeMessagesStates = [
887
- {
888
- type: localeMessagesType,
889
- key: "messages",
890
- editable: false,
891
- value: getLocaleMessageValue(composer.messages.value)
892
- }
893
- ];
894
- state[localeMessagesType] = localeMessagesStates;
895
- {
896
- const datetimeFormatsType = "Datetime formats info";
897
- const datetimeFormatsStates = [
898
- {
899
- type: datetimeFormatsType,
900
- key: "datetimeFormats",
901
- editable: false,
902
- value: composer.datetimeFormats.value
903
- }
904
- ];
905
- state[datetimeFormatsType] = datetimeFormatsStates;
906
- const numberFormatsType = "Datetime formats info";
907
- const numberFormatsStates = [
908
- {
909
- type: numberFormatsType,
910
- key: "numberFormats",
911
- editable: false,
912
- value: composer.numberFormats.value
913
- }
914
- ];
915
- state[numberFormatsType] = numberFormatsStates;
916
- }
917
- return state;
918
- }
919
- function addTimelineEvent(event, payload) {
920
- if (devtoolsApi) {
921
- let groupId;
922
- if (payload && "groupId" in payload) {
923
- groupId = payload.groupId;
924
- delete payload.groupId;
925
- }
926
- devtoolsApi.addTimelineEvent({
927
- layerId: "vue-i18n-timeline",
928
- event: {
929
- title: event,
930
- groupId,
931
- time: Date.now(),
932
- meta: {},
933
- data: payload || {},
934
- logType: event === "compile-error" ? "error" : event === "fallback" || event === "missing" ? "warning" : "default"
935
- }
936
- });
937
- }
938
- }
939
- function editScope(payload, i18n) {
940
- const composer = getComposer$1(payload.nodeId, i18n);
941
- if (composer) {
942
- const [field] = payload.path;
943
- if (field === "locale" && isString(payload.state.value)) {
944
- composer.locale.value = payload.state.value;
945
- } else if (field === "fallbackLocale" && (isString(payload.state.value) || isArray(payload.state.value) || isObject(payload.state.value))) {
946
- composer.fallbackLocale.value = payload.state.value;
947
- } else if (field === "inheritLocale" && isBoolean(payload.state.value)) {
948
- composer.inheritLocale = payload.state.value;
949
- }
950
- }
951
- }
952
- const BaseFormatPropsValidators = {
953
- tag: {
954
- type: [String, Object]
955
- },
956
- locale: {
957
- type: String
958
- },
959
- scope: {
960
- type: String,
961
- // NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
962
- validator: (val) => val === "parent" || val === "global",
963
- default: "parent"
964
- /* ComponentI18nScope */
965
- },
966
- i18n: {
967
- type: Object
968
- }
969
- };
970
- function getInterpolateArg({ slots }, keys) {
971
- if (keys.length === 1 && keys[0] === "default") {
972
- const ret = slots.default ? slots.default() : [];
973
- return ret.reduce((slot, current) => {
974
- return [
975
- ...slot,
976
- // prettier-ignore
977
- ...current.type === Fragment ? current.children : [current]
978
- ];
979
- }, []);
980
- } else {
981
- return keys.reduce((arg, key) => {
982
- const slot = slots[key];
983
- if (slot) {
984
- arg[key] = slot();
985
- }
986
- return arg;
987
- }, create());
988
- }
989
- }
990
- function getFragmentableTag() {
991
- return Fragment;
992
- }
993
- function isVNode(target) {
994
- return isArray(target) && !isString(target[0]);
995
- }
996
- function renderFormatter(props, context, slotKeys, partFormatter) {
997
- const { slots, attrs } = context;
998
- return () => {
999
- const options = { part: true };
1000
- let overrides = create();
1001
- if (props.locale) {
1002
- options.locale = props.locale;
1003
- }
1004
- if (isString(props.format)) {
1005
- options.key = props.format;
1006
- } else if (isObject(props.format)) {
1007
- if (isString(props.format.key)) {
1008
- options.key = props.format.key;
1009
- }
1010
- overrides = Object.keys(props.format).reduce((options2, prop) => {
1011
- return slotKeys.includes(prop) ? assign(create(), options2, { [prop]: props.format[prop] }) : options2;
1012
- }, create());
1013
- }
1014
- const parts = partFormatter(...[props.value, options, overrides]);
1015
- let children = [options.key];
1016
- if (isArray(parts)) {
1017
- children = parts.map((part, index) => {
1018
- const slot = slots[part.type];
1019
- const node = slot ? slot({ [part.type]: part.value, index, parts }) : [part.value];
1020
- if (isVNode(node)) {
1021
- node[0].key = `${part.type}-${index}`;
1022
- }
1023
- return node;
1024
- });
1025
- } else if (isString(parts)) {
1026
- children = [parts];
1027
- }
1028
- const assignedAttrs = assign(create(), attrs);
1029
- const tag = isString(props.tag) || isObject(props.tag) ? props.tag : getFragmentableTag();
1030
- return h(tag, assignedAttrs, children);
1031
- };
1032
- }
1033
- const DatetimeFormatImpl = /* @__PURE__ */ defineComponent({
1034
- name: "i18n-d",
1035
- // eslint-disable-line vue/component-definition-name-casing
1036
- props: /* @__PURE__ */ assign({
1037
- value: {
1038
- type: [Number, Date],
1039
- required: true
1040
- },
1041
- format: {
1042
- type: [String, Object]
1043
- }
1044
- }, BaseFormatPropsValidators),
1045
- setup(props, context) {
1046
- const i18n = props.i18n || useI18n({
1047
- useScope: props.scope,
1048
- __useComponent: true
1049
- });
1050
- return renderFormatter(props, context, DATETIME_FORMAT_OPTIONS_KEYS, (...args) => (
1051
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1052
- i18n[DatetimePartsSymbol](...args)
1053
- ));
1054
- }
1055
- });
1056
- const DatetimeFormat = DatetimeFormatImpl;
1057
- const NumberFormatImpl = /* @__PURE__ */ defineComponent({
1058
- name: "i18n-n",
1059
- // eslint-disable-line vue/component-definition-name-casing
1060
- props: /* @__PURE__ */ assign({
1061
- value: {
1062
- type: Number,
1063
- required: true
1064
- },
1065
- format: {
1066
- type: [String, Object]
1067
- }
1068
- }, BaseFormatPropsValidators),
1069
- setup(props, context) {
1070
- const i18n = props.i18n || useI18n({
1071
- useScope: props.scope,
1072
- __useComponent: true
1073
- });
1074
- return renderFormatter(props, context, NUMBER_FORMAT_OPTIONS_KEYS, (...args) => (
1075
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1076
- i18n[NumberPartsSymbol](...args)
1077
- ));
1078
- }
1079
- });
1080
- const NumberFormat = NumberFormatImpl;
1081
- const TranslationImpl = /* @__PURE__ */ defineComponent({
1082
- name: "i18n-t",
1083
- // eslint-disable-line vue/component-definition-name-casing
1084
- props: /* @__PURE__ */ assign({}, {
1085
- keypath: {
1086
- type: String,
1087
- required: true
1088
- },
1089
- plural: {
1090
- type: [Number, String],
1091
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1092
- validator: (val) => isNumber(val) || !isNaN(val)
1093
- }
1094
- }, BaseFormatPropsValidators),
1095
- setup(props, context) {
1096
- const { slots, attrs } = context;
1097
- const i18n = props.i18n || useI18n({
1098
- useScope: props.scope,
1099
- __useComponent: true
1100
- });
1101
- return () => {
1102
- const keys = Object.keys(slots).filter((key) => key[0] !== "_");
1103
- const options = create();
1104
- if (props.locale) {
1105
- options.locale = props.locale;
1106
- }
1107
- if (props.plural !== void 0) {
1108
- options.plural = isString(props.plural) ? +props.plural : props.plural;
1109
- }
1110
- const arg = getInterpolateArg(context, keys);
1111
- const children = i18n[TranslateVNodeSymbol](props.keypath, arg, options);
1112
- const assignedAttrs = assign(create(), attrs);
1113
- const tag = isString(props.tag) || isObject(props.tag) ? props.tag : getFragmentableTag();
1114
- return h(tag, assignedAttrs, children);
1115
- };
1116
- }
1117
- });
1118
- const Translation = TranslationImpl;
1119
- function apply(app, ...options) {
1120
- const pluginOptions = isPlainObject(options[0]) ? options[0] : {};
1121
- const globalInstall = isBoolean(pluginOptions.globalInstall) ? pluginOptions.globalInstall : true;
1122
- if (globalInstall) {
1123
- [Translation.name, "I18nT"].forEach((name) => app.component(name, Translation));
1124
- [NumberFormat.name, "I18nN"].forEach((name) => app.component(name, NumberFormat));
1125
- [DatetimeFormat.name, "I18nD"].forEach((name) => app.component(name, DatetimeFormat));
1126
- }
1127
- }
1128
- const I18nInjectionKey = /* @__PURE__ */ makeSymbol("global-vue-i18n");
1129
- function createI18n(options = {}) {
1130
- const __globalInjection = isBoolean(options.globalInjection) ? options.globalInjection : true;
1131
- const __instances = /* @__PURE__ */ new Map();
1132
- const [globalScope, __global] = createGlobal(options);
1133
- const symbol = /* @__PURE__ */ makeSymbol(process.env.NODE_ENV !== "production" ? "vue-i18n" : "");
1134
- function __getInstance(component) {
1135
- return __instances.get(component) || null;
1136
- }
1137
- function __setInstance(component, instance) {
1138
- __instances.set(component, instance);
1139
- }
1140
- function __deleteInstance(component) {
1141
- __instances.delete(component);
1142
- }
1143
- const i18n = {
1144
- // install plugin
1145
- async install(app, ...options2) {
1146
- if ((process.env.NODE_ENV !== "production" || false) && true) {
1147
- app.__VUE_I18N__ = i18n;
1148
- }
1149
- app.__VUE_I18N_SYMBOL__ = symbol;
1150
- app.provide(app.__VUE_I18N_SYMBOL__, i18n);
1151
- if (isPlainObject(options2[0])) {
1152
- const opts = options2[0];
1153
- i18n.__composerExtend = opts.__composerExtend;
1154
- }
1155
- let globalReleaseHandler = null;
1156
- if (__globalInjection) {
1157
- globalReleaseHandler = injectGlobalFields(app, i18n.global);
1158
- }
1159
- {
1160
- apply(app, ...options2);
1161
- }
1162
- const unmountApp = app.unmount;
1163
- app.unmount = () => {
1164
- globalReleaseHandler && globalReleaseHandler();
1165
- i18n.dispose();
1166
- unmountApp();
1167
- };
1168
- if ((process.env.NODE_ENV !== "production" || false) && true) {
1169
- const ret = await enableDevTools(app, i18n);
1170
- if (!ret) {
1171
- throw createI18nError(I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);
1172
- }
1173
- const emitter = createEmitter();
1174
- const _composer = __global;
1175
- _composer[EnableEmitter] && _composer[EnableEmitter](emitter);
1176
- emitter.on("*", addTimelineEvent);
1177
- }
1178
- },
1179
- // global accessor
1180
- get global() {
1181
- return __global;
1182
- },
1183
- dispose() {
1184
- globalScope.stop();
1185
- },
1186
- // @internal
1187
- __instances,
1188
- // @internal
1189
- __getInstance,
1190
- // @internal
1191
- __setInstance,
1192
- // @internal
1193
- __deleteInstance
1194
- };
1195
- return i18n;
1196
- }
1197
- function useI18n(options = {}) {
1198
- const instance = getCurrentInstance();
1199
- if (instance == null) {
1200
- throw createI18nError(I18nErrorCodes.MUST_BE_CALL_SETUP_TOP);
1201
- }
1202
- if (!instance.isCE && instance.appContext.app != null && !instance.appContext.app.__VUE_I18N_SYMBOL__) {
1203
- throw createI18nError(I18nErrorCodes.NOT_INSTALLED);
1204
- }
1205
- const i18n = getI18nInstance(instance);
1206
- const gl = getGlobalComposer(i18n);
1207
- const componentOptions = getComponentOptions(instance);
1208
- const scope = getScope(options, componentOptions);
1209
- if (scope === "global") {
1210
- adjustI18nResources(gl, options, componentOptions);
1211
- return gl;
1212
- }
1213
- if (scope === "parent") {
1214
- let composer2 = getComposer(i18n, instance, options.__useComponent);
1215
- if (composer2 == null) {
1216
- if (process.env.NODE_ENV !== "production") {
1217
- warn(getWarnMessage(I18nWarnCodes.NOT_FOUND_PARENT_SCOPE));
1218
- }
1219
- composer2 = gl;
1220
- }
1221
- return composer2;
1222
- }
1223
- const i18nInternal = i18n;
1224
- let composer = i18nInternal.__getInstance(instance);
1225
- if (composer == null) {
1226
- const composerOptions = assign({}, options);
1227
- if ("__i18n" in componentOptions) {
1228
- composerOptions.__i18n = componentOptions.__i18n;
1229
- }
1230
- if (gl) {
1231
- composerOptions.__root = gl;
1232
- }
1233
- composer = createComposer(composerOptions);
1234
- if (i18nInternal.__composerExtend) {
1235
- composer[DisposeSymbol] = i18nInternal.__composerExtend(composer);
1236
- }
1237
- setupLifeCycle(i18nInternal, instance, composer);
1238
- i18nInternal.__setInstance(instance, composer);
1239
- } else {
1240
- if (process.env.NODE_ENV !== "production" && scope === "local") {
1241
- throw createI18nError(I18nErrorCodes.DUPLICATE_USE_I18N_CALLING);
1242
- }
1243
- }
1244
- return composer;
1245
- }
1246
- function createGlobal(options) {
1247
- const scope = effectScope();
1248
- const obj = scope.run(() => createComposer(options));
1249
- if (obj == null) {
1250
- throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
1251
- }
1252
- return [scope, obj];
1253
- }
1254
- function getI18nInstance(instance) {
1255
- const i18n = inject(!instance.isCE ? instance.appContext.app.__VUE_I18N_SYMBOL__ : I18nInjectionKey);
1256
- if (!i18n) {
1257
- throw createI18nError(!instance.isCE ? I18nErrorCodes.UNEXPECTED_ERROR : I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE);
1258
- }
1259
- return i18n;
1260
- }
1261
- function getScope(options, componentOptions) {
1262
- return isEmptyObject(options) ? "__i18n" in componentOptions ? "local" : "global" : !options.useScope ? "local" : options.useScope;
1263
- }
1264
- function getGlobalComposer(i18n) {
1265
- return i18n.global;
1266
- }
1267
- function getComposer(i18n, target, useComponent = false) {
1268
- let composer = null;
1269
- const root = target.root;
1270
- let current = getParentComponentInstance(target, useComponent);
1271
- while (current != null) {
1272
- const i18nInternal = i18n;
1273
- composer = i18nInternal.__getInstance(current);
1274
- if (composer != null) {
1275
- break;
1276
- }
1277
- if (root === current) {
1278
- break;
1279
- }
1280
- current = current.parent;
1281
- }
1282
- return composer;
1283
- }
1284
- function getParentComponentInstance(target, useComponent = false) {
1285
- if (target == null) {
1286
- return null;
1287
- }
1288
- return !useComponent ? target.parent : target.vnode.ctx || target.parent;
1289
- }
1290
- function setupLifeCycle(i18n, target, composer) {
1291
- let emitter = null;
1292
- onMounted(() => {
1293
- if ((process.env.NODE_ENV !== "production" || false) && true && target.vnode.el) {
1294
- target.vnode.el.__VUE_I18N__ = composer;
1295
- emitter = createEmitter();
1296
- const _composer = composer;
1297
- _composer[EnableEmitter] && _composer[EnableEmitter](emitter);
1298
- emitter.on("*", addTimelineEvent);
1299
- }
1300
- }, target);
1301
- onUnmounted(() => {
1302
- const _composer = composer;
1303
- if ((process.env.NODE_ENV !== "production" || false) && true && target.vnode.el && target.vnode.el.__VUE_I18N__) {
1304
- emitter && emitter.off("*", addTimelineEvent);
1305
- _composer[DisableEmitter] && _composer[DisableEmitter]();
1306
- delete target.vnode.el.__VUE_I18N__;
1307
- }
1308
- i18n.__deleteInstance(target);
1309
- const dispose = _composer[DisposeSymbol];
1310
- if (dispose) {
1311
- dispose();
1312
- delete _composer[DisposeSymbol];
1313
- }
1314
- }, target);
1315
- }
1316
- const globalExportProps = [
1317
- "locale",
1318
- "fallbackLocale",
1319
- "availableLocales"
1320
- ];
1321
- const globalExportMethods = ["t", "rt", "d", "n", "tm", "te"];
1322
- function injectGlobalFields(app, composer) {
1323
- const i18n = /* @__PURE__ */ Object.create(null);
1324
- globalExportProps.forEach((prop) => {
1325
- const desc = Object.getOwnPropertyDescriptor(composer, prop);
1326
- if (!desc) {
1327
- throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
1328
- }
1329
- const wrap = isRef(desc.value) ? {
1330
- get() {
1331
- return desc.value.value;
1332
- },
1333
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1334
- set(val) {
1335
- desc.value.value = val;
1336
- }
1337
- } : {
1338
- get() {
1339
- return desc.get && desc.get();
1340
- }
1341
- };
1342
- Object.defineProperty(i18n, prop, wrap);
1343
- });
1344
- app.config.globalProperties.$i18n = i18n;
1345
- globalExportMethods.forEach((method) => {
1346
- const desc = Object.getOwnPropertyDescriptor(composer, method);
1347
- if (!desc || !desc.value) {
1348
- throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR);
1349
- }
1350
- Object.defineProperty(app.config.globalProperties, `$${method}`, desc);
1351
- });
1352
- const dispose = () => {
1353
- delete app.config.globalProperties.$i18n;
1354
- globalExportMethods.forEach((method) => {
1355
- delete app.config.globalProperties[`$${method}`];
1356
- });
1357
- };
1358
- return dispose;
1359
- }
1360
- {
1361
- initFeatureFlags();
1362
- }
1363
- if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
1364
- const target = getGlobalThis();
1365
- target.__INTLIFY__ = true;
1366
- setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
1367
- }
1368
- if (process.env.NODE_ENV !== "production") ;
1369
- export {
1370
- I18nInjectionKey,
1371
- VERSION,
1372
- createI18n,
1373
- initFeatureFlags,
1374
- useI18n
1375
- };