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.
- package/es/Affix/index.vue.js +1 -0
- package/es/Alert/index.d.ts +3 -3
- package/es/Alert/index.vue.d.ts +1 -1
- package/es/Alert/index.vue.js +1 -0
- package/es/Anchor/Anchor.vue.js +1 -0
- package/es/Anchor/AnchorLink.vue.js +1 -0
- package/es/Anchor/hooks/useContext.js +1 -0
- package/es/AutoComplete/index.d.ts +19 -19
- package/es/AutoComplete/index.vue.d.ts +33 -33
- package/es/AutoComplete/index.vue.js +1 -0
- package/es/Avatar/Avatar.vue.d.ts +2 -2
- package/es/Avatar/Avatar.vue.js +1 -0
- package/es/Avatar/AvatarGroup.vue.js +1 -0
- package/es/Avatar/index.d.ts +5 -5
- package/es/BackTop/index.vue.js +1 -0
- package/es/Badge/index.vue.js +1 -0
- package/es/Breadcrumb/Breadcrumb.vue.js +1 -0
- package/es/Breadcrumb/BreadcrumbItem.vue.js +1 -0
- package/es/Breadcrumb/BreadcrumbMore.vue.js +1 -0
- package/es/Breadcrumb/BreadcrumbSeparator.vue.js +1 -0
- package/es/Button/Button.vue.d.ts +3 -3
- package/es/Button/ButtonGroup.vue.d.ts +1 -1
- package/es/Button/hooks/useContext.js +1 -0
- package/es/Button/index.d.ts +12 -12
- package/es/Calendar/Calendar.vue.js +2 -1
- package/es/Calendar/CalendarMonth.vue.d.ts +1 -1
- package/es/Calendar/CalendarMonth.vue.js +1 -1
- package/es/Calendar/CalendarYear.vue.js +1 -1
- package/es/Card/Card.vue.d.ts +1 -1
- package/es/Card/Card.vue.js +1 -0
- package/es/Card/CardMeta.vue.d.ts +1 -1
- package/es/Card/CardMeta.vue.js +1 -0
- package/es/Card/index.d.ts +6 -6
- package/es/Carousel/Carousel.vue.js +1 -0
- package/es/Carousel/CarouselArrow.vue.js +1 -0
- package/es/Carousel/CarouselIndicator.vue.js +1 -0
- package/es/Carousel/hooks/useContext.js +1 -0
- package/es/Cascader/Cascader.vue.d.ts +17 -17
- package/es/Cascader/Cascader.vue.js +1 -0
- package/es/Cascader/CascaderIcon.vue.js +1 -0
- package/es/Cascader/CascaderOption.vue.js +1 -0
- package/es/Cascader/CascaderPanel.vue.js +1 -0
- package/es/Cascader/CascaderSearchPanel.vue.js +1 -0
- package/es/Cascader/hooks/useContext.js +1 -0
- package/es/Cascader/index.d.ts +16 -16
- package/es/Checkbox/Checkbox.vue.js +1 -0
- package/es/Checkbox/CheckboxGroup.vue.d.ts +1 -1
- package/es/Checkbox/hooks/useContext.js +1 -0
- package/es/Checkbox/index.d.ts +3 -3
- package/es/Collapse/CollapseItem.vue.js +1 -0
- package/es/Collapse/hooks/useContext.js +1 -0
- package/es/ColorPicker/ColorControl.vue.js +1 -0
- package/es/ColorPicker/ColorInput.vue.js +1 -0
- package/es/ColorPicker/ColorList.vue.js +7 -1
- package/es/ColorPicker/ColorPalette.vue.js +1 -0
- package/es/ColorPicker/ColorPanel.vue.js +7 -1
- package/es/ColorPicker/hooks/useContext.js +1 -0
- package/es/Comment/index.vue.js +1 -0
- package/es/ConfigProvider/index.d.ts +3 -3
- package/es/ConfigProvider/index.vue.d.ts +1 -1
- package/es/ConfigProvider/index.vue.js +4 -12
- package/es/ConfigProvider/type.d.ts +3 -2
- package/es/Descriptions/ReuseItem.vue.js +1 -0
- package/es/Descriptions/ReuseTd.vue.js +1 -0
- package/es/Descriptions/hooks/useContext.js +1 -0
- package/es/Divider/index.d.ts +3 -3
- package/es/Divider/index.vue.d.ts +1 -1
- package/es/Divider/index.vue.js +1 -0
- package/es/Drawer/Drawer.vue.d.ts +4 -4
- package/es/Drawer/Drawer.vue.js +2 -1
- package/es/Drawer/DrawerService.vue.d.ts +2 -2
- package/es/Drawer/DrawerService.vue.js +1 -0
- package/es/Drawer/index.d.ts +11 -11
- package/es/Dropdown/Dropdown.vue.js +1 -0
- package/es/Dropdown/DropdownButton.vue.d.ts +1 -1
- package/es/Dropdown/DropdownButton.vue.js +1 -0
- package/es/Dropdown/Dsubmenu.vue.js +1 -0
- package/es/Dropdown/hooks/useContext.js +1 -0
- package/es/Dropdown/index.d.ts +3 -3
- package/es/Empty/index.vue.js +2 -1
- package/es/Grid/Grid.vue.js +1 -0
- package/es/Grid/GridCol.vue.js +1 -0
- package/es/Grid/GridItem.vue.js +1 -0
- package/es/Grid/GridRow.vue.js +1 -0
- package/es/Grid/hooks/useContext.js +1 -0
- package/es/Image/Image.vue.d.ts +2 -2
- package/es/Image/Image.vue.js +2 -1
- package/es/Image/ImagePreview.vue.js +1 -0
- package/es/Image/ImagePreviewArrow.vue.js +1 -0
- package/es/Image/ImagePreviewToolbar.vue.js +8 -7
- package/es/Image/hooks/useContext.js +1 -0
- package/es/Image/index.d.ts +6 -6
- package/es/Input/Input.vue.d.ts +3 -3
- package/es/Input/Input.vue.js +1 -0
- package/es/Input/InputSuffix.vue.js +1 -0
- package/es/Input/hooks/useLimitedInput.js +1 -0
- package/es/Input/index.d.ts +9 -9
- package/es/InputNumber/InputNumber.vue.d.ts +18 -18
- package/es/InputNumber/InputNumber.vue.js +1 -0
- package/es/InputNumber/InputOperaBtn.vue.js +1 -0
- package/es/InputNumber/index.d.ts +19 -19
- package/es/InputTag/index.d.ts +6 -6
- package/es/InputTag/index.vue.d.ts +2 -2
- package/es/InputTag/index.vue.js +1 -0
- package/es/Layout/Layout.vue.js +1 -0
- package/es/Layout/LayoutSider.vue.js +1 -0
- package/es/Layout/hooks/useSiderContext.js +1 -0
- package/es/Link/index.d.ts +3 -3
- package/es/Link/index.vue.d.ts +1 -1
- package/es/Link/index.vue.js +1 -0
- package/es/List/List.vue.d.ts +7 -7
- package/es/List/List.vue.js +1 -0
- package/es/List/ListItemMeta.vue.d.ts +1 -1
- package/es/List/hooks/useScrollReach.js +1 -0
- package/es/List/index.d.ts +9 -9
- package/es/Mention/index.d.ts +22 -22
- package/es/Mention/index.vue.d.ts +39 -39
- package/es/Mention/index.vue.js +1 -0
- package/es/Menu/Menu.vue.js +1 -0
- package/es/Menu/MenuEllipsis.vue.js +1 -0
- package/es/Menu/MenuItem.vue.js +1 -0
- package/es/Menu/MenuItemGroup.vue.js +1 -0
- package/es/Menu/SubMenu.vue.js +1 -0
- package/es/Menu/hooks/useContext.js +1 -0
- package/es/Message/Message.vue.d.ts +1 -1
- package/es/Message/Message.vue.js +1 -0
- package/es/Message/index.d.ts +3 -3
- package/es/Message/index.js +1 -0
- package/es/Modal/Modal.vue.d.ts +4 -4
- package/es/Modal/Modal.vue.js +2 -1
- package/es/Modal/ModalService.vue.d.ts +2 -2
- package/es/Modal/ModalService.vue.js +1 -0
- package/es/Modal/hooks/useModalClose.js +1 -0
- package/es/Modal/hooks/useModalDraggable.js +1 -0
- package/es/Modal/hooks/useOnBeforeClose.js +1 -0
- package/es/Modal/index.d.ts +11 -11
- package/es/Notification/Notification.vue.d.ts +1 -1
- package/es/Notification/Notification.vue.js +1 -0
- package/es/Notification/index.d.ts +3 -3
- package/es/Notification/index.js +1 -0
- package/es/OverflowList/index.d.ts +3 -3
- package/es/OverflowList/index.vue.d.ts +1 -1
- package/es/OverflowList/index.vue.js +1 -0
- package/es/PageHeader/index.vue.js +1 -0
- package/es/Pagination/Pagination.vue.js +6 -2
- package/es/Pagination/PaginationItem.vue.js +1 -0
- package/es/Pagination/hooks/useContext.d.ts +1 -256
- package/es/Pagination/hooks/useContext.js +2 -1
- package/es/Popconfirm/index.d.ts +19 -19
- package/es/Popconfirm/index.vue.d.ts +7 -7
- package/es/Popconfirm/index.vue.js +2 -1
- package/es/Popover/index.vue.js +1 -0
- package/es/Progress/Progress.vue.d.ts +1 -1
- package/es/Progress/Progress.vue.js +1 -0
- package/es/Progress/ProgressCircle.vue.js +1 -0
- package/es/Progress/ProgressLine.vue.js +1 -0
- package/es/Progress/ProgressSteps.vue.js +1 -0
- package/es/Progress/index.d.ts +3 -3
- package/es/Radio/Radio.vue.d.ts +1 -1
- package/es/Radio/Radio.vue.js +1 -0
- package/es/Radio/RadioGroup.vue.d.ts +1 -1
- package/es/Radio/hooks/useContext.js +1 -0
- package/es/Radio/index.d.ts +6 -6
- package/es/Rate/index.vue.js +1 -0
- package/es/ResizeBox/index.vue.js +1 -0
- package/es/Scrollbar/Scrollbar.vue.d.ts +1 -1
- package/es/Scrollbar/Scrollbar.vue.js +1 -0
- package/es/Scrollbar/ScrollbarTrack.vue.js +1 -0
- package/es/Scrollbar/index.d.ts +3 -3
- package/es/Select/Option.vue.js +1 -0
- package/es/Select/Select.vue.d.ts +26 -26
- package/es/Select/Select.vue.js +1 -0
- package/es/Select/SelectIcon.vue.js +1 -0
- package/es/Select/SelectRealList.vue.js +1 -0
- package/es/Select/SelectView.vue.js +1 -0
- package/es/Select/SelectVirtualList.vue.js +1 -0
- package/es/Select/hooks/useContext.js +1 -0
- package/es/Select/hooks/useSelectOptions.js +1 -0
- package/es/Select/index.d.ts +14 -14
- package/es/Skeleton/SkeletonLine.vue.js +1 -0
- package/es/Skeleton/SkeletonShape.vue.js +1 -0
- package/es/Slider/Slider.vue.d.ts +3 -3
- package/es/Slider/SliderBtn.vue.js +1 -0
- package/es/Slider/hooks/useContext.js +1 -0
- package/es/Slider/hooks/useSliderDraggable.js +1 -0
- package/es/Slider/index.d.ts +9 -9
- package/es/Space/index.d.ts +3 -3
- package/es/Space/index.vue.d.ts +1 -1
- package/es/Space/index.vue.js +1 -0
- package/es/Spin/index.d.ts +3 -3
- package/es/Spin/index.vue.d.ts +1 -1
- package/es/Spin/index.vue.js +1 -0
- package/es/Split/index.d.ts +6 -6
- package/es/Split/index.vue.d.ts +2 -2
- package/es/Split/index.vue.js +1 -0
- package/es/Statistic/Countdown.vue.d.ts +2 -2
- package/es/Statistic/Countdown.vue.js +1 -0
- package/es/Statistic/Statistic.vue.d.ts +2 -2
- package/es/Statistic/Statistic.vue.js +1 -0
- package/es/Statistic/index.d.ts +12 -12
- package/es/Steps/Step.vue.d.ts +1 -1
- package/es/Steps/Step.vue.js +1 -0
- package/es/Steps/Steps.vue.d.ts +1 -1
- package/es/Steps/hooks/useContext.js +1 -0
- package/es/Steps/index.d.ts +6 -6
- package/es/Switch/index.d.ts +6 -6
- package/es/Switch/index.vue.d.ts +2 -2
- package/es/Switch/index.vue.js +1 -0
- package/es/Tabs/TabButton.vue.js +1 -0
- package/es/Tabs/TabPane.vue.js +1 -0
- package/es/Tabs/Tabs.vue.d.ts +3 -3
- package/es/Tabs/Tabs.vue.js +1 -0
- package/es/Tabs/TabsNavInk.vue.js +1 -0
- package/es/Tabs/TabsTab.vue.js +1 -0
- package/es/Tabs/hooks/useContext.js +1 -0
- package/es/Tabs/hooks/useTabsScroll.js +1 -0
- package/es/Tabs/index.d.ts +8 -8
- package/es/Tag/index.d.ts +3 -3
- package/es/Tag/index.vue.d.ts +1 -1
- package/es/Tag/index.vue.js +1 -0
- package/es/Textarea/hooks/useTextareaHeight.js +1 -0
- package/es/Textarea/index.d.ts +6 -6
- package/es/Textarea/index.vue.d.ts +2 -2
- package/es/Textarea/index.vue.js +1 -0
- package/es/TimePicker/TimePicker.vue.d.ts +3 -3
- package/es/TimePicker/TimePicker.vue.js +6 -6
- package/es/TimePicker/TimePickerPanel.vue.js +10 -10
- package/es/TimePicker/hooks/useContext.d.ts +1 -0
- package/es/TimePicker/hooks/useContext.js +11 -2
- package/es/TimePicker/index.d.ts +9 -9
- package/es/Timeline/TimelineItemPending.vue.js +1 -0
- package/es/Timeline/hooks/useContext.js +1 -0
- package/es/Tooltip/index.vue.js +1 -0
- package/es/Transfer/Transfer.vue.js +1 -0
- package/es/Transfer/TransferPanel.vue.js +1 -0
- package/es/Transfer/hooks/useContext.js +1 -0
- package/es/Trigger/hooks/useContext.js +1 -0
- package/es/Trigger/hooks/useTriggerPosition.js +1 -0
- package/es/Trigger/hooks/useTriggerVisible.js +1 -0
- package/es/Trigger/index.vue.js +1 -0
- package/es/Typography/TypographyBase.vue.d.ts +19 -19
- package/es/Typography/TypographyBase.vue.js +2 -1
- package/es/VerificationCode/index.d.ts +6 -6
- package/es/VerificationCode/index.vue.d.ts +2 -2
- package/es/VerificationCode/index.vue.js +1 -0
- package/es/Watermark/index.d.ts +3 -3
- package/es/Watermark/index.vue.d.ts +1 -1
- package/es/Watermark/index.vue.js +1 -0
- package/es/_lang/ar-eg.d.ts +206 -0
- package/es/_lang/de-de.d.ts +206 -0
- package/es/_lang/en-us.d.ts +254 -0
- package/es/_lang/es-es.d.ts +206 -0
- package/es/_lang/fr-fr.d.ts +206 -0
- package/es/_lang/id-id.d.ts +206 -0
- package/es/_lang/index.css +0 -0
- package/es/_lang/interface.d.ts +151 -0
- package/es/_lang/it-it.d.ts +206 -0
- package/es/_lang/ja-jp.d.ts +254 -0
- package/es/_lang/km-kh.d.ts +206 -0
- package/es/_lang/ko-kr.d.ts +206 -0
- package/es/_lang/ms-my.d.ts +206 -0
- package/es/_lang/nl-nl.d.ts +254 -0
- package/es/_lang/pt-pt.d.ts +206 -0
- package/es/_lang/ru-ru.d.ts +254 -0
- package/es/_lang/th-th.d.ts +206 -0
- package/es/_lang/vi-vn.d.ts +206 -0
- package/es/{_shared/locale/lang → _lang}/zh-cn.d.ts +39 -38
- package/es/_lang/zh-cn.js +202 -0
- package/es/_lang/zh-tw.d.ts +254 -0
- package/es/_shared/components/ExpandTransition.vue2.js +1 -0
- package/es/_shared/components/Icon.vue3.js +1 -0
- package/es/_shared/components/IconButton.vue.js +1 -0
- package/es/_shared/constants/index.js +1 -0
- package/es/_shared/icons/IconFullScreen.vue.js +1 -17
- package/es/_shared/icons/IconFullScreen.vue2.js +17 -1
- package/es/_shared/icons/IconOriginSize.vue.js +1 -23
- package/es/_shared/icons/IconOriginSize.vue2.js +23 -1
- package/es/_shared/icons/IconRotateLeft.vue.js +1 -17
- package/es/_shared/icons/IconRotateLeft.vue2.js +17 -1
- package/es/_shared/icons/IconRotateRight.vue.js +1 -17
- package/es/_shared/icons/IconRotateRight.vue2.js +17 -1
- package/es/_shared/icons/IconZoomIn.vue.js +1 -17
- package/es/_shared/icons/IconZoomIn.vue2.js +17 -1
- package/es/_shared/icons/IconZoomOut.vue.js +1 -17
- package/es/_shared/icons/IconZoomOut.vue2.js +17 -1
- package/es/_shared/utils/control.js +1 -0
- package/es/_shared/utils/global-config.d.ts +3 -1
- package/es/_shared/utils/global-config.js +4 -0
- package/es/_shared/utils/index.d.ts +1 -0
- package/es/_shared/utils/locale.d.ts +22 -0
- package/es/_shared/utils/locale.js +39 -0
- package/es/index.d.ts +27 -27
- package/es/index.js +0 -2
- package/lib/Affix/index.vue.js +1 -1
- package/lib/Alert/index.d.ts +3 -3
- package/lib/Alert/index.vue.d.ts +1 -1
- package/lib/Alert/index.vue.js +1 -1
- package/lib/Anchor/Anchor.vue.js +1 -1
- package/lib/Anchor/AnchorLink.vue.js +1 -1
- package/lib/Anchor/hooks/useContext.js +1 -1
- package/lib/AutoComplete/index.d.ts +19 -19
- package/lib/AutoComplete/index.vue.d.ts +33 -33
- package/lib/AutoComplete/index.vue.js +1 -1
- package/lib/Avatar/Avatar.vue.d.ts +2 -2
- package/lib/Avatar/Avatar.vue.js +1 -1
- package/lib/Avatar/AvatarGroup.vue.js +1 -1
- package/lib/Avatar/index.d.ts +5 -5
- package/lib/BackTop/index.vue.js +1 -1
- package/lib/Badge/index.vue.js +1 -1
- package/lib/Breadcrumb/Breadcrumb.vue.js +1 -1
- package/lib/Breadcrumb/BreadcrumbItem.vue.js +1 -1
- package/lib/Breadcrumb/BreadcrumbMore.vue.js +1 -1
- package/lib/Breadcrumb/BreadcrumbSeparator.vue.js +1 -1
- package/lib/Button/Button.vue.d.ts +3 -3
- package/lib/Button/ButtonGroup.vue.d.ts +1 -1
- package/lib/Button/hooks/useContext.js +1 -1
- package/lib/Button/index.d.ts +12 -12
- package/lib/Calendar/Calendar.vue.js +1 -1
- package/lib/Calendar/CalendarMonth.vue.d.ts +1 -1
- package/lib/Calendar/CalendarMonth.vue.js +1 -1
- package/lib/Calendar/CalendarYear.vue.js +1 -1
- package/lib/Card/Card.vue.d.ts +1 -1
- package/lib/Card/Card.vue.js +1 -1
- package/lib/Card/CardMeta.vue.d.ts +1 -1
- package/lib/Card/CardMeta.vue.js +1 -1
- package/lib/Card/index.d.ts +6 -6
- package/lib/Carousel/Carousel.vue.js +1 -1
- package/lib/Carousel/CarouselArrow.vue.js +1 -1
- package/lib/Carousel/CarouselIndicator.vue.js +1 -1
- package/lib/Carousel/hooks/useContext.js +1 -1
- package/lib/Cascader/Cascader.vue.d.ts +17 -17
- package/lib/Cascader/Cascader.vue.js +1 -1
- package/lib/Cascader/CascaderIcon.vue.js +1 -1
- package/lib/Cascader/CascaderOption.vue.js +1 -1
- package/lib/Cascader/CascaderPanel.vue.js +1 -1
- package/lib/Cascader/CascaderSearchPanel.vue.js +1 -1
- package/lib/Cascader/hooks/useContext.js +1 -1
- package/lib/Cascader/index.d.ts +16 -16
- package/lib/Checkbox/Checkbox.vue.js +1 -1
- package/lib/Checkbox/CheckboxGroup.vue.d.ts +1 -1
- package/lib/Checkbox/hooks/useContext.js +1 -1
- package/lib/Checkbox/index.d.ts +3 -3
- package/lib/Collapse/CollapseItem.vue.js +1 -1
- package/lib/Collapse/hooks/useContext.js +1 -1
- package/lib/ColorPicker/ColorControl.vue.js +1 -1
- package/lib/ColorPicker/ColorInput.vue.js +1 -1
- package/lib/ColorPicker/ColorList.vue.js +1 -1
- package/lib/ColorPicker/ColorPalette.vue.js +1 -1
- package/lib/ColorPicker/ColorPanel.vue.js +1 -1
- package/lib/ColorPicker/hooks/useContext.js +1 -1
- package/lib/Comment/index.vue.js +1 -1
- package/lib/ConfigProvider/index.d.ts +3 -3
- package/lib/ConfigProvider/index.vue.d.ts +1 -1
- package/lib/ConfigProvider/index.vue.js +1 -1
- package/lib/ConfigProvider/type.d.ts +3 -2
- package/lib/Descriptions/ReuseItem.vue.js +1 -1
- package/lib/Descriptions/ReuseTd.vue.js +1 -1
- package/lib/Descriptions/hooks/useContext.js +1 -1
- package/lib/Divider/index.d.ts +3 -3
- package/lib/Divider/index.vue.d.ts +1 -1
- package/lib/Divider/index.vue.js +1 -1
- package/lib/Drawer/Drawer.vue.d.ts +4 -4
- package/lib/Drawer/Drawer.vue.js +1 -1
- package/lib/Drawer/DrawerService.vue.d.ts +2 -2
- package/lib/Drawer/DrawerService.vue.js +1 -1
- package/lib/Drawer/index.d.ts +11 -11
- package/lib/Dropdown/Dropdown.vue.js +1 -1
- package/lib/Dropdown/DropdownButton.vue.d.ts +1 -1
- package/lib/Dropdown/DropdownButton.vue.js +1 -1
- package/lib/Dropdown/Dsubmenu.vue.js +1 -1
- package/lib/Dropdown/hooks/useContext.js +1 -1
- package/lib/Dropdown/index.d.ts +3 -3
- package/lib/Empty/index.vue.js +1 -1
- package/lib/Grid/Grid.vue.js +1 -1
- package/lib/Grid/GridCol.vue.js +1 -1
- package/lib/Grid/GridItem.vue.js +1 -1
- package/lib/Grid/GridRow.vue.js +1 -1
- package/lib/Grid/hooks/useContext.js +1 -1
- package/lib/Image/Image.vue.d.ts +2 -2
- package/lib/Image/Image.vue.js +1 -1
- package/lib/Image/ImagePreview.vue.js +1 -1
- package/lib/Image/ImagePreviewArrow.vue.js +1 -1
- package/lib/Image/ImagePreviewToolbar.vue.js +1 -1
- package/lib/Image/hooks/useContext.js +1 -1
- package/lib/Image/index.d.ts +6 -6
- package/lib/Input/Input.vue.d.ts +3 -3
- package/lib/Input/Input.vue.js +1 -1
- package/lib/Input/InputSuffix.vue.js +1 -1
- package/lib/Input/hooks/useLimitedInput.js +1 -1
- package/lib/Input/index.d.ts +9 -9
- package/lib/InputNumber/InputNumber.vue.d.ts +18 -18
- package/lib/InputNumber/InputNumber.vue.js +1 -1
- package/lib/InputNumber/InputOperaBtn.vue.js +1 -1
- package/lib/InputNumber/index.d.ts +19 -19
- package/lib/InputTag/index.d.ts +6 -6
- package/lib/InputTag/index.vue.d.ts +2 -2
- package/lib/InputTag/index.vue.js +1 -1
- package/lib/Layout/Layout.vue.js +1 -1
- package/lib/Layout/LayoutSider.vue.js +1 -1
- package/lib/Layout/hooks/useSiderContext.js +1 -1
- package/lib/Link/index.d.ts +3 -3
- package/lib/Link/index.vue.d.ts +1 -1
- package/lib/Link/index.vue.js +1 -1
- package/lib/List/List.vue.d.ts +7 -7
- package/lib/List/List.vue.js +1 -1
- package/lib/List/ListItemMeta.vue.d.ts +1 -1
- package/lib/List/hooks/useScrollReach.js +1 -1
- package/lib/List/index.d.ts +9 -9
- package/lib/Mention/index.d.ts +22 -22
- package/lib/Mention/index.vue.d.ts +39 -39
- package/lib/Mention/index.vue.js +1 -1
- package/lib/Menu/Menu.vue.js +1 -1
- package/lib/Menu/MenuEllipsis.vue.js +1 -1
- package/lib/Menu/MenuItem.vue.js +1 -1
- package/lib/Menu/MenuItemGroup.vue.js +1 -1
- package/lib/Menu/SubMenu.vue.js +1 -1
- package/lib/Menu/hooks/useContext.js +1 -1
- package/lib/Message/Message.vue.d.ts +1 -1
- package/lib/Message/Message.vue.js +1 -1
- package/lib/Message/index.d.ts +3 -3
- package/lib/Message/index.js +1 -1
- package/lib/Modal/Modal.vue.d.ts +4 -4
- package/lib/Modal/Modal.vue.js +1 -1
- package/lib/Modal/ModalService.vue.d.ts +2 -2
- package/lib/Modal/ModalService.vue.js +1 -1
- package/lib/Modal/hooks/useModalClose.js +1 -1
- package/lib/Modal/hooks/useModalDraggable.js +1 -1
- package/lib/Modal/hooks/useOnBeforeClose.js +1 -1
- package/lib/Modal/index.d.ts +11 -11
- package/lib/Notification/Notification.vue.d.ts +1 -1
- package/lib/Notification/Notification.vue.js +1 -1
- package/lib/Notification/index.d.ts +3 -3
- package/lib/Notification/index.js +1 -1
- package/lib/OverflowList/index.d.ts +3 -3
- package/lib/OverflowList/index.vue.d.ts +1 -1
- package/lib/OverflowList/index.vue.js +1 -1
- package/lib/PageHeader/index.vue.js +1 -1
- package/lib/Pagination/Pagination.vue.js +1 -1
- package/lib/Pagination/PaginationItem.vue.js +1 -1
- package/lib/Pagination/hooks/useContext.d.ts +1 -256
- package/lib/Pagination/hooks/useContext.js +1 -1
- package/lib/Popconfirm/index.d.ts +19 -19
- package/lib/Popconfirm/index.vue.d.ts +7 -7
- package/lib/Popconfirm/index.vue.js +1 -1
- package/lib/Popover/index.vue.js +1 -1
- package/lib/Progress/Progress.vue.d.ts +1 -1
- package/lib/Progress/Progress.vue.js +1 -1
- package/lib/Progress/ProgressCircle.vue.js +1 -1
- package/lib/Progress/ProgressLine.vue.js +1 -1
- package/lib/Progress/ProgressSteps.vue.js +1 -1
- package/lib/Progress/index.d.ts +3 -3
- package/lib/Radio/Radio.vue.d.ts +1 -1
- package/lib/Radio/Radio.vue.js +1 -1
- package/lib/Radio/RadioGroup.vue.d.ts +1 -1
- package/lib/Radio/hooks/useContext.js +1 -1
- package/lib/Radio/index.d.ts +6 -6
- package/lib/Rate/index.vue.js +1 -1
- package/lib/ResizeBox/index.vue.js +1 -1
- package/lib/Scrollbar/Scrollbar.vue.d.ts +1 -1
- package/lib/Scrollbar/Scrollbar.vue.js +1 -1
- package/lib/Scrollbar/ScrollbarTrack.vue.js +1 -1
- package/lib/Scrollbar/index.d.ts +3 -3
- package/lib/Select/Option.vue.js +1 -1
- package/lib/Select/Select.vue.d.ts +26 -26
- package/lib/Select/Select.vue.js +1 -1
- package/lib/Select/SelectIcon.vue.js +1 -1
- package/lib/Select/SelectRealList.vue.js +1 -1
- package/lib/Select/SelectView.vue.js +1 -1
- package/lib/Select/SelectVirtualList.vue.js +1 -1
- package/lib/Select/hooks/useContext.js +1 -1
- package/lib/Select/hooks/useSelectOptions.js +1 -1
- package/lib/Select/index.d.ts +14 -14
- package/lib/Skeleton/SkeletonLine.vue.js +1 -1
- package/lib/Skeleton/SkeletonShape.vue.js +1 -1
- package/lib/Slider/Slider.vue.d.ts +3 -3
- package/lib/Slider/SliderBtn.vue.js +1 -1
- package/lib/Slider/hooks/useContext.js +1 -1
- package/lib/Slider/hooks/useSliderDraggable.js +1 -1
- package/lib/Slider/index.d.ts +9 -9
- package/lib/Space/index.d.ts +3 -3
- package/lib/Space/index.vue.d.ts +1 -1
- package/lib/Space/index.vue.js +1 -1
- package/lib/Spin/index.d.ts +3 -3
- package/lib/Spin/index.vue.d.ts +1 -1
- package/lib/Spin/index.vue.js +1 -1
- package/lib/Split/index.d.ts +6 -6
- package/lib/Split/index.vue.d.ts +2 -2
- package/lib/Split/index.vue.js +1 -1
- package/lib/Statistic/Countdown.vue.d.ts +2 -2
- package/lib/Statistic/Countdown.vue.js +1 -1
- package/lib/Statistic/Statistic.vue.d.ts +2 -2
- package/lib/Statistic/Statistic.vue.js +1 -1
- package/lib/Statistic/index.d.ts +12 -12
- package/lib/Steps/Step.vue.d.ts +1 -1
- package/lib/Steps/Step.vue.js +1 -1
- package/lib/Steps/Steps.vue.d.ts +1 -1
- package/lib/Steps/hooks/useContext.js +1 -1
- package/lib/Steps/index.d.ts +6 -6
- package/lib/Switch/index.d.ts +6 -6
- package/lib/Switch/index.vue.d.ts +2 -2
- package/lib/Switch/index.vue.js +1 -1
- package/lib/Tabs/TabButton.vue.js +1 -1
- package/lib/Tabs/TabPane.vue.js +1 -1
- package/lib/Tabs/Tabs.vue.d.ts +3 -3
- package/lib/Tabs/Tabs.vue.js +1 -1
- package/lib/Tabs/TabsNavInk.vue.js +1 -1
- package/lib/Tabs/TabsTab.vue.js +1 -1
- package/lib/Tabs/hooks/useContext.js +1 -1
- package/lib/Tabs/hooks/useTabsScroll.js +1 -1
- package/lib/Tabs/index.d.ts +8 -8
- package/lib/Tag/index.d.ts +3 -3
- package/lib/Tag/index.vue.d.ts +1 -1
- package/lib/Tag/index.vue.js +1 -1
- package/lib/Textarea/hooks/useTextareaHeight.js +1 -1
- package/lib/Textarea/index.d.ts +6 -6
- package/lib/Textarea/index.vue.d.ts +2 -2
- package/lib/Textarea/index.vue.js +1 -1
- package/lib/TimePicker/TimePicker.vue.d.ts +3 -3
- package/lib/TimePicker/TimePicker.vue.js +1 -1
- package/lib/TimePicker/TimePickerPanel.vue.js +1 -1
- package/lib/TimePicker/hooks/useContext.d.ts +1 -0
- package/lib/TimePicker/hooks/useContext.js +1 -1
- package/lib/TimePicker/index.d.ts +9 -9
- package/lib/Timeline/TimelineItemPending.vue.js +1 -1
- package/lib/Timeline/hooks/useContext.js +1 -1
- package/lib/Tooltip/index.vue.js +1 -1
- package/lib/Transfer/Transfer.vue.js +1 -1
- package/lib/Transfer/TransferPanel.vue.js +1 -1
- package/lib/Transfer/hooks/useContext.js +1 -1
- package/lib/Trigger/hooks/useContext.js +1 -1
- package/lib/Trigger/hooks/useTriggerPosition.js +1 -1
- package/lib/Trigger/hooks/useTriggerVisible.js +1 -1
- package/lib/Trigger/index.vue.js +1 -1
- package/lib/Typography/TypographyBase.vue.d.ts +19 -19
- package/lib/Typography/TypographyBase.vue.js +1 -1
- package/lib/VerificationCode/index.d.ts +6 -6
- package/lib/VerificationCode/index.vue.d.ts +2 -2
- package/lib/VerificationCode/index.vue.js +1 -1
- package/lib/Watermark/index.d.ts +3 -3
- package/lib/Watermark/index.vue.d.ts +1 -1
- package/lib/Watermark/index.vue.js +1 -1
- package/lib/_lang/ar-eg.d.ts +206 -0
- package/lib/_lang/de-de.d.ts +206 -0
- package/lib/_lang/en-us.d.ts +254 -0
- package/lib/_lang/es-es.d.ts +206 -0
- package/lib/_lang/fr-fr.d.ts +206 -0
- package/lib/_lang/id-id.d.ts +206 -0
- package/lib/_lang/index.css +0 -0
- package/lib/_lang/interface.d.ts +151 -0
- package/lib/_lang/it-it.d.ts +206 -0
- package/lib/_lang/ja-jp.d.ts +254 -0
- package/lib/_lang/km-kh.d.ts +206 -0
- package/lib/_lang/ko-kr.d.ts +206 -0
- package/lib/_lang/ms-my.d.ts +206 -0
- package/lib/_lang/nl-nl.d.ts +254 -0
- package/lib/_lang/pt-pt.d.ts +206 -0
- package/lib/_lang/ru-ru.d.ts +254 -0
- package/lib/_lang/th-th.d.ts +206 -0
- package/lib/_lang/vi-vn.d.ts +206 -0
- package/lib/{_shared/locale/lang → _lang}/zh-cn.d.ts +39 -38
- package/lib/_lang/zh-cn.js +1 -0
- package/lib/_lang/zh-tw.d.ts +254 -0
- package/lib/_shared/components/ExpandTransition.vue2.js +1 -1
- package/lib/_shared/components/Icon.vue3.js +1 -1
- package/lib/_shared/components/IconButton.vue.js +1 -1
- package/lib/_shared/constants/index.js +1 -1
- package/lib/_shared/icons/IconFullScreen.vue.js +1 -1
- package/lib/_shared/icons/IconFullScreen.vue2.js +1 -1
- package/lib/_shared/icons/IconOriginSize.vue.js +1 -1
- package/lib/_shared/icons/IconOriginSize.vue2.js +1 -1
- package/lib/_shared/icons/IconRotateLeft.vue.js +1 -1
- package/lib/_shared/icons/IconRotateLeft.vue2.js +1 -1
- package/lib/_shared/icons/IconRotateRight.vue.js +1 -1
- package/lib/_shared/icons/IconRotateRight.vue2.js +1 -1
- package/lib/_shared/icons/IconZoomIn.vue.js +1 -1
- package/lib/_shared/icons/IconZoomIn.vue2.js +1 -1
- package/lib/_shared/icons/IconZoomOut.vue.js +1 -1
- package/lib/_shared/icons/IconZoomOut.vue2.js +1 -1
- package/lib/_shared/utils/control.js +1 -1
- package/lib/_shared/utils/global-config.d.ts +3 -1
- package/lib/_shared/utils/global-config.js +1 -1
- package/lib/_shared/utils/index.d.ts +1 -0
- package/lib/_shared/utils/locale.d.ts +22 -0
- package/lib/_shared/utils/locale.js +1 -0
- package/lib/index.d.ts +27 -27
- package/lib/index.js +1 -1
- package/package.json +10 -22
- package/es/_shared/locale/i18n.d.ts +0 -512
- package/es/_shared/locale/i18n.js +0 -43
- package/es/_shared/locale/lang/ar-eg.json.js +0 -251
- package/es/_shared/locale/lang/de-de.json.d.ts +0 -207
- package/es/_shared/locale/lang/de-de.json.js +0 -251
- package/es/_shared/locale/lang/en-us.json.d.ts +0 -210
- package/es/_shared/locale/lang/en-us.json.js +0 -256
- package/es/_shared/locale/lang/es-es.json.d.ts +0 -207
- package/es/_shared/locale/lang/es-es.json.js +0 -251
- package/es/_shared/locale/lang/fr-fr.json.d.ts +0 -207
- package/es/_shared/locale/lang/fr-fr.json.js +0 -251
- package/es/_shared/locale/lang/id-id.json.d.ts +0 -207
- package/es/_shared/locale/lang/id-id.json.js +0 -251
- package/es/_shared/locale/lang/it-it.json.d.ts +0 -207
- package/es/_shared/locale/lang/it-it.json.js +0 -251
- package/es/_shared/locale/lang/ja-jp.json.d.ts +0 -255
- package/es/_shared/locale/lang/ja-jp.json.js +0 -301
- package/es/_shared/locale/lang/km-kh.json.d.ts +0 -207
- package/es/_shared/locale/lang/km-kh.json.js +0 -251
- package/es/_shared/locale/lang/ko-kr.json.d.ts +0 -207
- package/es/_shared/locale/lang/ko-kr.json.js +0 -251
- package/es/_shared/locale/lang/ms-my.json.d.ts +0 -207
- package/es/_shared/locale/lang/ms-my.json.js +0 -251
- package/es/_shared/locale/lang/nl-nl.json.d.ts +0 -255
- package/es/_shared/locale/lang/nl-nl.json.js +0 -301
- package/es/_shared/locale/lang/pt-pt.json.d.ts +0 -207
- package/es/_shared/locale/lang/pt-pt.json.js +0 -251
- package/es/_shared/locale/lang/ru-ru.json.d.ts +0 -255
- package/es/_shared/locale/lang/ru-ru.json.js +0 -301
- package/es/_shared/locale/lang/th-th.json.d.ts +0 -207
- package/es/_shared/locale/lang/th-th.json.js +0 -251
- package/es/_shared/locale/lang/vi-vn.json.d.ts +0 -207
- package/es/_shared/locale/lang/vi-vn.json.js +0 -251
- package/es/_shared/locale/lang/zh-cn.json.d.ts +0 -255
- package/es/_shared/locale/lang/zh-cn.json.js +0 -301
- package/es/_shared/locale/lang/zh-tw.json.d.ts +0 -255
- package/es/_shared/locale/lang/zh-tw.json.js +0 -301
- package/es/node_modules/@intlify/core-base/dist/core-base.js +0 -1126
- package/es/node_modules/@intlify/message-compiler/dist/message-compiler.js +0 -65
- package/es/node_modules/@intlify/shared/dist/shared.js +0 -199
- package/es/node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js +0 -1375
- package/es/node_modules/@vue/devtools-api/lib/esm/const.js +0 -6
- package/es/node_modules/@vue/devtools-api/lib/esm/env.js +0 -12
- package/es/node_modules/@vue/devtools-api/lib/esm/index.js +0 -26
- package/es/node_modules/@vue/devtools-api/lib/esm/proxy.js +0 -103
- package/es/node_modules/@vue/devtools-api/lib/esm/time.js +0 -25
- package/lib/_shared/locale/i18n.d.ts +0 -512
- package/lib/_shared/locale/i18n.js +0 -1
- package/lib/_shared/locale/lang/ar-eg.json.js +0 -1
- package/lib/_shared/locale/lang/de-de.json.d.ts +0 -207
- package/lib/_shared/locale/lang/de-de.json.js +0 -1
- package/lib/_shared/locale/lang/en-us.json.d.ts +0 -210
- package/lib/_shared/locale/lang/en-us.json.js +0 -1
- package/lib/_shared/locale/lang/es-es.json.d.ts +0 -207
- package/lib/_shared/locale/lang/es-es.json.js +0 -1
- package/lib/_shared/locale/lang/fr-fr.json.d.ts +0 -207
- package/lib/_shared/locale/lang/fr-fr.json.js +0 -1
- package/lib/_shared/locale/lang/id-id.json.d.ts +0 -207
- package/lib/_shared/locale/lang/id-id.json.js +0 -1
- package/lib/_shared/locale/lang/it-it.json.d.ts +0 -207
- package/lib/_shared/locale/lang/it-it.json.js +0 -1
- package/lib/_shared/locale/lang/ja-jp.json.d.ts +0 -255
- package/lib/_shared/locale/lang/ja-jp.json.js +0 -1
- package/lib/_shared/locale/lang/km-kh.json.d.ts +0 -207
- package/lib/_shared/locale/lang/km-kh.json.js +0 -1
- package/lib/_shared/locale/lang/ko-kr.json.d.ts +0 -207
- package/lib/_shared/locale/lang/ko-kr.json.js +0 -1
- package/lib/_shared/locale/lang/ms-my.json.d.ts +0 -207
- package/lib/_shared/locale/lang/ms-my.json.js +0 -1
- package/lib/_shared/locale/lang/nl-nl.json.d.ts +0 -255
- package/lib/_shared/locale/lang/nl-nl.json.js +0 -1
- package/lib/_shared/locale/lang/pt-pt.json.d.ts +0 -207
- package/lib/_shared/locale/lang/pt-pt.json.js +0 -1
- package/lib/_shared/locale/lang/ru-ru.json.d.ts +0 -255
- package/lib/_shared/locale/lang/ru-ru.json.js +0 -1
- package/lib/_shared/locale/lang/th-th.json.d.ts +0 -207
- package/lib/_shared/locale/lang/th-th.json.js +0 -1
- package/lib/_shared/locale/lang/vi-vn.json.d.ts +0 -207
- package/lib/_shared/locale/lang/vi-vn.json.js +0 -1
- package/lib/_shared/locale/lang/zh-cn.json.d.ts +0 -255
- package/lib/_shared/locale/lang/zh-cn.json.js +0 -1
- package/lib/_shared/locale/lang/zh-tw.json.d.ts +0 -255
- package/lib/_shared/locale/lang/zh-tw.json.js +0 -1
- package/lib/node_modules/@intlify/core-base/dist/core-base.js +0 -1
- package/lib/node_modules/@intlify/message-compiler/dist/message-compiler.js +0 -6
- package/lib/node_modules/@intlify/shared/dist/shared.js +0 -7
- package/lib/node_modules/@intlify/vue-i18n-core/dist/vue-i18n-core.js +0 -1
- package/lib/node_modules/@vue/devtools-api/lib/esm/const.js +0 -1
- package/lib/node_modules/@vue/devtools-api/lib/esm/env.js +0 -1
- package/lib/node_modules/@vue/devtools-api/lib/esm/index.js +0 -1
- package/lib/node_modules/@vue/devtools-api/lib/esm/proxy.js +0 -1
- 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
|
-
"<": "<",
|
788
|
-
">": ">",
|
789
|
-
'"': """,
|
790
|
-
"&": "&"
|
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
|
-
};
|