@rhino-design/vue 0.2.2 → 0.2.6
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/README.md +1 -1
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/_virtual/alignment-pattern.js +4 -0
- package/dist/_virtual/browser.js +4 -0
- package/dist/_virtual/canvas.js +4 -0
- package/dist/_virtual/dijkstra.js +4 -0
- package/dist/_virtual/error-correction-code.js +4 -0
- package/dist/_virtual/error-correction-level.js +4 -0
- package/dist/_virtual/finder-pattern.js +4 -0
- package/dist/_virtual/format-info.js +4 -0
- package/dist/_virtual/galois-field.js +4 -0
- package/dist/_virtual/mask-pattern.js +4 -0
- package/dist/_virtual/mode.js +4 -0
- package/dist/_virtual/polynomial.js +4 -0
- package/dist/_virtual/qrcode.js +4 -0
- package/dist/_virtual/regex.js +4 -0
- package/dist/_virtual/segments.js +4 -0
- package/dist/_virtual/svg-tag.js +4 -0
- package/dist/_virtual/utils.js +4 -0
- package/dist/_virtual/utils2.js +4 -0
- package/dist/_virtual/version-check.js +4 -0
- package/dist/_virtual/version.js +4 -0
- package/dist/arco.less +14834 -0
- package/dist/components/XAffix.vue.js +7 -0
- package/dist/components/XAffix.vue2.js +181 -0
- package/dist/components/XAlert.vue.js +106 -0
- package/dist/components/XAlert.vue2.js +4 -0
- package/dist/components/XAnchor.vue.js +9 -0
- package/dist/components/XAnchor.vue2.js +204 -0
- package/dist/components/XAnchorLink.vue.js +7 -0
- package/dist/components/XAnchorLink.vue2.js +44 -0
- package/dist/components/XApp.vue.js +12 -0
- package/dist/components/XAutoComplete.vue.js +399 -0
- package/dist/components/XAutoComplete.vue2.js +4 -0
- package/dist/components/XAvatar.vue.js +166 -0
- package/dist/components/XAvatar.vue2.js +4 -0
- package/dist/components/XAvatarGroup.vue.js +27 -0
- package/dist/components/XAvatarGroup.vue2.js +4 -0
- package/dist/components/XBackTop.vue.js +118 -0
- package/dist/components/XBackTop.vue2.js +4 -0
- package/dist/components/XBadge.vue.js +64 -0
- package/dist/components/XBadge.vue2.js +4 -0
- package/dist/components/XBaseMenu.vue.js +37 -0
- package/dist/components/XBaseMenu.vue2.js +334 -0
- package/dist/components/XBreadcrumb.vue.d.ts +12 -7
- package/dist/components/XBreadcrumb.vue.js +97 -0
- package/dist/components/XBreadcrumb.vue2.js +4 -0
- package/dist/components/XBreadcrumbItem.vue.d.ts +7 -4
- package/dist/components/XBreadcrumbItem.vue.js +136 -0
- package/dist/components/XBreadcrumbItem.vue2.js +4 -0
- package/dist/components/XButton.vue.js +7 -0
- package/dist/components/XButton.vue2.js +142 -0
- package/dist/components/XButtonG.vue.js +7 -0
- package/dist/components/XButtonG.vue2.js +67 -0
- package/dist/components/XButtonGroup.vue.js +39 -0
- package/dist/components/XButtonGroup.vue3.js +5 -0
- package/dist/components/XCalendar.vue.js +309 -0
- package/dist/components/XCalendar.vue2.js +4 -0
- package/dist/components/XCard.vue.js +80 -0
- package/dist/components/XCard.vue2.js +4 -0
- package/dist/components/XCarousel.vue.js +7 -0
- package/dist/components/XCarousel.vue2.js +150 -0
- package/dist/components/XCarouselItem.vue.js +7 -0
- package/dist/components/XCarouselItem.vue2.js +112 -0
- package/dist/components/XCascader.vue.js +1015 -0
- package/dist/components/XCascader.vue2.js +4 -0
- package/dist/components/XCascaderPanel.vue.js +466 -0
- package/dist/components/XCascaderPanel.vue2.js +4 -0
- package/dist/components/XChatInput.vue.js +7 -0
- package/dist/components/XChatInput.vue2.js +454 -0
- package/dist/components/XCheckbox.vue.js +154 -0
- package/dist/components/XCheckbox.vue2.js +4 -0
- package/dist/components/XCheckboxGroup.vue.js +87 -0
- package/dist/components/XCheckboxGroup.vue2.js +4 -0
- package/dist/components/XCollapse.vue.js +54 -0
- package/dist/components/XCollapse.vue2.js +4 -0
- package/dist/components/XCollapseItem.vue.js +152 -0
- package/dist/components/XCollapseItem.vue2.js +4 -0
- package/dist/components/XColorGroup.vue.js +7 -0
- package/dist/components/XColorGroup.vue2.js +306 -0
- package/dist/components/XColorPicker.vue.js +62 -0
- package/dist/components/XColorPicker.vue2.js +4 -0
- package/dist/components/XComment.vue.js +129 -0
- package/dist/components/XComment.vue2.js +4 -0
- package/dist/components/XCompact.vue.js +17 -0
- package/dist/components/XCompact.vue2.js +4 -0
- package/dist/components/XConfigProvider.vue.js +78 -0
- package/dist/components/XConfigProvider.vue2.js +4 -0
- package/dist/components/XCountdown.vue.js +7 -0
- package/dist/components/XCountdown.vue2.js +104 -0
- package/dist/components/XCropper.vue.js +7 -0
- package/dist/components/XCropper.vue2.js +525 -0
- package/dist/components/XDatePicker.vue.js +1798 -0
- package/dist/components/XDatePicker.vue2.js +4 -0
- package/dist/components/XDescriptions.vue.js +260 -0
- package/dist/components/XDescriptions.vue2.js +4 -0
- package/dist/components/XDescriptionsItem.vue.js +21 -0
- package/dist/components/XDescriptionsItem.vue2.js +4 -0
- package/dist/components/XDgroup.vue.js +21 -0
- package/dist/components/XDgroup.vue2.js +4 -0
- package/dist/components/XDivider.vue.js +54 -0
- package/dist/components/XDivider.vue2.js +4 -0
- package/dist/components/XDoption.vue.js +59 -0
- package/dist/components/XDoption.vue2.js +4 -0
- package/dist/components/XDrawer.vue.js +7 -0
- package/dist/components/XDrawer.vue2.js +320 -0
- package/dist/components/XDrawerService.d.ts +2 -0
- package/dist/components/XDrawerService.js +97 -0
- package/dist/components/XDropdown.vue.d.ts +8 -7
- package/dist/components/XDropdown.vue.js +127 -0
- package/dist/components/XDropdown.vue2.js +4 -0
- package/dist/components/XDropdownButton.vue.js +84 -0
- package/dist/components/XDropdownButton.vue2.js +4 -0
- package/dist/components/XDropdownItem.vue.js +47 -0
- package/dist/components/XDropdownItem.vue2.js +4 -0
- package/dist/components/XDropdownPanel.vue.js +58 -0
- package/dist/components/XDropdownPanel.vue2.js +4 -0
- package/dist/components/XDsubmenu.vue.js +82 -0
- package/dist/components/XDsubmenu.vue2.js +4 -0
- package/dist/components/XEmpty.vue.js +54 -0
- package/dist/components/XEmpty.vue2.js +4 -0
- package/dist/components/XFlex.vue.js +7 -0
- package/dist/components/XFlex.vue2.js +122 -0
- package/dist/components/XFloatButton.vue.js +28 -0
- package/dist/components/XFloatButton.vue2.js +4 -0
- package/dist/components/XFloatButtonGroup.vue.js +17 -0
- package/dist/components/XFloatButtonGroup.vue2.js +4 -0
- package/dist/components/XForm.vue.js +156 -0
- package/dist/components/XForm.vue2.js +4 -0
- package/dist/components/XFormItem.vue.js +425 -0
- package/dist/components/XFormItem.vue2.js +4 -0
- package/dist/components/XGrid.vue.js +7 -0
- package/dist/components/XGrid.vue2.js +88 -0
- package/dist/components/XGridItem.vue.js +8 -0
- package/dist/components/XGridItem.vue2.js +112 -0
- package/dist/components/XGridLayout.vue.js +7 -0
- package/dist/components/XGridLayout.vue2.js +66 -0
- package/dist/components/XGridLayoutItem.vue.js +7 -0
- package/dist/components/XGridLayoutItem.vue2.js +56 -0
- package/dist/components/XIcon.js +5 -0
- package/dist/components/XIconLite.js +8 -0
- package/dist/components/XImage.vue.js +7 -0
- package/dist/components/XImage.vue2.js +241 -0
- package/dist/components/XImageGroup.vue.js +7 -0
- package/dist/components/XImageGroup.vue2.js +22 -0
- package/dist/components/XInput.vue.js +7 -0
- package/dist/components/XInput.vue2.js +537 -0
- package/dist/components/XInputComposite.vue.js +7 -0
- package/dist/components/XInputComposite.vue2.js +176 -0
- package/dist/components/XInputGroup.vue.js +19 -0
- package/dist/components/XInputGroup.vue3.js +5 -0
- package/dist/components/XInputNumber.vue.js +7 -0
- package/dist/components/XInputNumber.vue2.js +344 -0
- package/dist/components/XInputPassword.vue.js +7 -0
- package/dist/components/XInputPassword.vue2.js +125 -0
- package/dist/components/XInputSearch.vue.js +7 -0
- package/dist/components/XInputSearch.vue2.js +154 -0
- package/dist/components/XInputTag.vue.js +367 -0
- package/dist/components/XInputTag.vue2.js +4 -0
- package/dist/components/XLayout.vue.js +22 -0
- package/dist/components/XLayout.vue2.js +4 -0
- package/dist/components/XLayoutContent.vue.js +13 -0
- package/dist/components/XLayoutContent.vue2.js +4 -0
- package/dist/components/XLayoutFooter.vue.js +22 -0
- package/dist/components/XLayoutFooter.vue2.js +4 -0
- package/dist/components/XLayoutHeader.vue.js +128 -0
- package/dist/components/XLayoutHeader.vue2.js +4 -0
- package/dist/components/XLayoutSider.vue.js +108 -0
- package/dist/components/XLayoutSider.vue2.js +4 -0
- package/dist/components/XLink.vue.js +21 -0
- package/dist/components/XLink.vue2.js +4 -0
- package/dist/components/XList.vue.js +295 -0
- package/dist/components/XList.vue2.js +4 -0
- package/dist/components/XListItem.vue.js +53 -0
- package/dist/components/XListItem.vue2.js +4 -0
- package/dist/components/XListItemMeta.vue.js +43 -0
- package/dist/components/XListItemMeta.vue2.js +4 -0
- package/dist/components/XMention.vue.js +456 -0
- package/dist/components/XMention.vue2.js +4 -0
- package/dist/components/XMentions.vue.js +16 -0
- package/dist/components/XMentions.vue2.js +4 -0
- package/dist/components/XMenu.vue.js +57 -0
- package/dist/components/XMenu.vue2.js +123 -0
- package/dist/components/XMenuIndent.vue.js +19 -0
- package/dist/components/XMenuIndent.vue2.js +21 -0
- package/dist/components/XMenuItem.vue.js +71 -0
- package/dist/components/XMenuItem.vue2.js +92 -0
- package/dist/components/XMenuItemGroup.vue.js +27 -0
- package/dist/components/XMenuItemGroup.vue2.js +26 -0
- package/dist/components/XMenuOverflowWrap.vue.js +116 -0
- package/dist/components/XMenuOverflowWrap.vue2.js +4 -0
- package/dist/components/XMessage.vue.js +7 -0
- package/dist/components/XMessage.vue2.js +89 -0
- package/dist/components/XMessageList.js +61 -0
- package/dist/components/XMessageService.js +118 -0
- package/dist/components/XModal.vue.js +7 -0
- package/dist/components/XModal.vue2.js +364 -0
- package/dist/components/XModalService.js +157 -0
- package/dist/components/XNotification.vue.js +7 -0
- package/dist/components/XNotification.vue2.js +107 -0
- package/dist/components/XNotificationList.js +70 -0
- package/dist/components/XNotificationService.js +119 -0
- package/dist/components/XOptgroup.vue.js +14 -0
- package/dist/components/XOptgroup.vue2.js +4 -0
- package/dist/components/XOption.vue.js +21 -0
- package/dist/components/XOption.vue2.js +4 -0
- package/dist/components/XOverflowList.vue.js +149 -0
- package/dist/components/XOverflowList.vue2.js +4 -0
- package/dist/components/XPageHeader.vue.js +84 -0
- package/dist/components/XPageHeader.vue2.js +4 -0
- package/dist/components/XPagination.vue.js +121 -0
- package/dist/components/XPagination.vue2.js +4 -0
- package/dist/components/XPopconfirm.vue.js +90 -0
- package/dist/components/XPopconfirm.vue2.js +4 -0
- package/dist/components/XPopover.vue.js +53 -0
- package/dist/components/XPopover.vue2.js +4 -0
- package/dist/components/XProgress.vue.js +263 -0
- package/dist/components/XProgress.vue2.js +4 -0
- package/dist/components/XQRCode.vue.js +141 -0
- package/dist/components/XQRCode.vue2.js +4 -0
- package/dist/components/XRadio.vue.js +138 -0
- package/dist/components/XRadio.vue2.js +4 -0
- package/dist/components/XRadioButton.vue.js +41 -0
- package/dist/components/XRadioButton.vue2.js +4 -0
- package/dist/components/XRadioGroup.vue.js +168 -0
- package/dist/components/XRadioGroup.vue2.js +4 -0
- package/dist/components/XRate.vue.js +145 -0
- package/dist/components/XRate.vue2.js +4 -0
- package/dist/components/XResizeBox.vue.js +184 -0
- package/dist/components/XResizeBox.vue2.js +4 -0
- package/dist/components/XResult.vue.js +78 -0
- package/dist/components/XResult.vue2.js +4 -0
- package/dist/components/XRichTextEditor.vue.js +7 -0
- package/dist/components/XRichTextEditor.vue2.js +742 -0
- package/dist/components/XScrollbar.vue.d.ts +192 -0
- package/dist/components/XScrollbar.vue.js +190 -0
- package/dist/components/XScrollbar.vue2.js +4 -0
- package/dist/components/XScrollbarThumb.vue.d.ts +2 -6
- package/dist/components/XScrollbarThumb.vue.js +97 -0
- package/dist/components/XScrollbarThumb.vue2.js +4 -0
- package/dist/components/XSegmented.vue.js +7 -0
- package/dist/components/XSegmented.vue2.js +71 -0
- package/dist/components/XSelect.vue.js +858 -0
- package/dist/components/XSelect.vue2.js +4 -0
- package/dist/components/XSkeleton.vue.js +37 -0
- package/dist/components/XSkeleton.vue2.js +59 -0
- package/dist/components/XSkeletonLine.vue.js +36 -0
- package/dist/components/XSkeletonLine.vue2.js +4 -0
- package/dist/components/XSkeletonShape.vue.js +21 -0
- package/dist/components/XSkeletonShape.vue2.js +4 -0
- package/dist/components/XSlider.vue.js +402 -0
- package/dist/components/XSlider.vue2.js +4 -0
- package/dist/components/XSpace.vue.js +125 -0
- package/dist/components/XSpace.vue2.js +4 -0
- package/dist/components/XSpin.vue.js +54 -0
- package/dist/components/XSpin.vue2.js +4 -0
- package/dist/components/XSplit.vue.js +7 -0
- package/dist/components/XSplit.vue2.js +126 -0
- package/dist/components/XStatistic.vue.js +7 -0
- package/dist/components/XStatistic.vue2.js +176 -0
- package/dist/components/XStep.vue.js +91 -0
- package/dist/components/XStep.vue2.js +4 -0
- package/dist/components/XSteps.vue.js +73 -0
- package/dist/components/XSteps.vue2.js +4 -0
- package/dist/components/XSubMenu.vue.js +109 -0
- package/dist/components/XSubMenu.vue2.js +69 -0
- package/dist/components/XSubMenuInline.vue.js +74 -0
- package/dist/components/XSubMenuInline.vue2.js +56 -0
- package/dist/components/XSubMenuPop.vue.js +91 -0
- package/dist/components/XSubMenuPop.vue2.js +113 -0
- package/dist/components/XSwitch.vue.js +133 -0
- package/dist/components/XSwitch.vue2.js +4 -0
- package/dist/components/XTabPane.vue.js +59 -0
- package/dist/components/XTabPane.vue2.js +4 -0
- package/dist/components/XTable.vue.js +7 -0
- package/dist/components/XTable.vue2.js +1059 -0
- package/dist/components/XTableFilter.vue.js +7 -0
- package/dist/components/XTableFilter.vue2.js +141 -0
- package/dist/components/XTabs.vue.js +402 -0
- package/dist/components/XTabs.vue2.js +4 -0
- package/dist/components/XTag.vue.js +126 -0
- package/dist/components/XTag.vue2.js +4 -0
- package/dist/components/XTextarea.vue.js +261 -0
- package/dist/components/XTextarea.vue2.js +4 -0
- package/dist/components/XTimePicker.vue.js +827 -0
- package/dist/components/XTimePicker.vue2.js +4 -0
- package/dist/components/XTimeline.vue.js +84 -0
- package/dist/components/XTimeline.vue2.js +4 -0
- package/dist/components/XTimelineItem.vue.js +202 -0
- package/dist/components/XTimelineItem.vue2.js +4 -0
- package/dist/components/XTooltip.vue.js +78 -0
- package/dist/components/XTooltip.vue2.js +4 -0
- package/dist/components/XTour.vue.js +120 -0
- package/dist/components/XTour.vue2.js +4 -0
- package/dist/components/XTr.vue.js +12 -0
- package/dist/components/XTransfer.vue.js +128 -0
- package/dist/components/XTransfer.vue2.js +4 -0
- package/dist/components/XTree.vue.js +7 -0
- package/dist/components/XTree.vue2.js +601 -0
- package/dist/components/XTreeNode.vue.js +7 -0
- package/dist/components/XTreeNode.vue2.js +314 -0
- package/dist/components/XTreeSelect.vue.js +7 -0
- package/dist/components/XTreeSelect.vue2.js +715 -0
- package/dist/components/XTrigger.vue.js +492 -0
- package/dist/components/XTrigger.vue2.js +4 -0
- package/dist/components/XTypography.vue.js +51 -0
- package/dist/components/XTypography.vue2.js +126 -0
- package/dist/components/XTypographyParagraph.vue.js +83 -0
- package/dist/components/XTypographyParagraph.vue2.js +4 -0
- package/dist/components/XTypographyText.vue.js +76 -0
- package/dist/components/XTypographyText.vue2.js +4 -0
- package/dist/components/XTypographyTitle.vue.js +77 -0
- package/dist/components/XTypographyTitle.vue2.js +4 -0
- package/dist/components/XUpload.vue.js +7 -0
- package/dist/components/XUpload.vue2.js +1060 -0
- package/dist/components/XVerificationCode.vue.js +149 -0
- package/dist/components/XVerificationCode.vue2.js +4 -0
- package/dist/components/XWatermark.vue.js +204 -0
- package/dist/components/XWatermark.vue2.js +4 -0
- package/dist/components/index.d.ts +10 -6
- package/dist/components/index.js +308 -0
- package/dist/components/result-assets/result-403.svg.js +4 -0
- package/dist/components/result-assets/result-404.svg.js +4 -0
- package/dist/components/result-assets/result-500.svg.js +4 -0
- package/dist/components/statistic-utils.js +81 -0
- package/dist/components/timelineContext.js +4 -0
- package/dist/components/x-breadcrumb-context.js +4 -0
- package/dist/components/x-checkbox-context.js +4 -0
- package/dist/components/x-dropdown-context.js +4 -0
- package/dist/components/x-icon-shared.js +151 -0
- package/dist/components/x-radio-context.js +4 -0
- package/dist/components/x-scrollbar-types.d.ts +5 -0
- package/dist/composables/collapse.js +9 -0
- package/dist/composables/config-provider.js +48 -0
- package/dist/composables/config.js +39 -0
- package/dist/composables/form.js +397 -0
- package/dist/composables/i18n.js +257 -0
- package/dist/composables/menu-context.js +6 -0
- package/dist/composables/menu-hooks/use-level.js +25 -0
- package/dist/composables/menu-hooks/use-menu-context.js +8 -0
- package/dist/composables/menu-hooks/use-menu-data-collector.js +63 -0
- package/dist/composables/menu-hooks/use-menu-open-state.js +120 -0
- package/dist/composables/menu-hooks/use-menu.js +19 -0
- package/dist/composables/popup.js +177 -0
- package/dist/composables/scrollbar-visibility.js +96 -0
- package/dist/composables/steps.js +9 -0
- package/dist/composables/tabs.js +10 -0
- package/dist/composables/theme-context.js +24 -0
- package/dist/composables/theme.js +53 -0
- package/dist/composables/useMergeState.js +27 -0
- package/dist/composables/useResponsive.js +36 -0
- package/dist/iconfont/generated/icons/guanbi.js +7 -0
- package/dist/iconfont/generated/icons/shijian.js +7 -0
- package/dist/iconfont/internal-icons.js +71 -0
- package/dist/index.cjs +1 -2
- package/dist/index.css +14834 -0
- package/dist/index.js +382 -31255
- package/dist/index.less +14834 -0
- package/dist/install.js +39 -0
- package/dist/locales/ar-EG.js +5 -0
- package/dist/locales/da-DK.js +5 -0
- package/dist/locales/de-DE.js +5 -0
- package/dist/locales/en-US.js +312 -0
- package/dist/locales/es-ES.js +5 -0
- package/dist/locales/fr-FR.js +5 -0
- package/dist/locales/id-ID.js +5 -0
- package/dist/locales/it-IT.js +5 -0
- package/dist/locales/ja-JP.js +5 -0
- package/dist/locales/km-KH.js +5 -0
- package/dist/locales/ko-KR.js +5 -0
- package/dist/locales/ms-MY.js +5 -0
- package/dist/locales/nl-NL.js +5 -0
- package/dist/locales/pt-PT.js +5 -0
- package/dist/locales/ru-RU.js +5 -0
- package/dist/locales/th-TH.js +5 -0
- package/dist/locales/vi-VN.js +5 -0
- package/dist/locales/zh-CN.js +312 -0
- package/dist/locales/zh-TW.js +5 -0
- package/dist/node_modules/dijkstrajs/dijkstra.js +70 -0
- package/dist/node_modules/qrcode/lib/browser.js +45 -0
- package/dist/node_modules/qrcode/lib/can-promise.js +6 -0
- package/dist/node_modules/qrcode/lib/core/alignment-pattern.js +21 -0
- package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js +73 -0
- package/dist/node_modules/qrcode/lib/core/bit-buffer.js +24 -0
- package/dist/node_modules/qrcode/lib/core/bit-matrix.js +22 -0
- package/dist/node_modules/qrcode/lib/core/byte-data.js +23 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-code.js +359 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-level.js +35 -0
- package/dist/node_modules/qrcode/lib/core/finder-pattern.js +18 -0
- package/dist/node_modules/qrcode/lib/core/format-info.js +14 -0
- package/dist/node_modules/qrcode/lib/core/galois-field.js +22 -0
- package/dist/node_modules/qrcode/lib/core/kanji-data.js +37 -0
- package/dist/node_modules/qrcode/lib/core/mask-pattern.js +96 -0
- package/dist/node_modules/qrcode/lib/core/mode.js +64 -0
- package/dist/node_modules/qrcode/lib/core/numeric-data.js +26 -0
- package/dist/node_modules/qrcode/lib/core/polynomial.js +29 -0
- package/dist/node_modules/qrcode/lib/core/qrcode.js +159 -0
- package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js +25 -0
- package/dist/node_modules/qrcode/lib/core/regex.js +24 -0
- package/dist/node_modules/qrcode/lib/core/segments.js +143 -0
- package/dist/node_modules/qrcode/lib/core/utils.js +74 -0
- package/dist/node_modules/qrcode/lib/core/version-check.js +7 -0
- package/dist/node_modules/qrcode/lib/core/version.js +74 -0
- package/dist/node_modules/qrcode/lib/renderer/canvas.js +27 -0
- package/dist/node_modules/qrcode/lib/renderer/svg-tag.js +28 -0
- package/dist/node_modules/qrcode/lib/renderer/utils.js +52 -0
- package/dist/style.css +14834 -1
- package/dist/style.less +14834 -0
- package/package.json +10 -40
- package/dist/components/XRangePicker.vue.d.ts +0 -45
- package/dist/components/__tests__/XAffix.test.d.ts +0 -1
- package/dist/components/__tests__/XAutoComplete.test.d.ts +0 -1
- package/dist/components/__tests__/XBackTop.test.d.ts +0 -1
- package/dist/components/__tests__/XBreadcrumb.test.d.ts +0 -1
- package/dist/components/__tests__/XButton.test.d.ts +0 -1
- package/dist/components/__tests__/XCard.test.d.ts +0 -1
- package/dist/components/__tests__/XCarousel.test.d.ts +0 -1
- package/dist/components/__tests__/XCascader.test.d.ts +0 -1
- package/dist/components/__tests__/XCheckbox.test.d.ts +0 -1
- package/dist/components/__tests__/XCollapse.test.d.ts +0 -1
- package/dist/components/__tests__/XComplexTriggerTheme.test.d.ts +0 -1
- package/dist/components/__tests__/XCropper.test.d.ts +0 -1
- package/dist/components/__tests__/XDropdown.test.d.ts +0 -1
- package/dist/components/__tests__/XImage.test.d.ts +0 -1
- package/dist/components/__tests__/XMention.test.d.ts +0 -1
- package/dist/components/__tests__/XMenuAccordion.test.d.ts +0 -1
- package/dist/components/__tests__/XOverflowList.test.d.ts +0 -1
- package/dist/components/__tests__/XOverlayServiceTheme.test.d.ts +0 -1
- package/dist/components/__tests__/XPageHeader.test.d.ts +0 -1
- package/dist/components/__tests__/XRadioGroup.test.d.ts +0 -1
- package/dist/components/__tests__/XResizeBox.test.d.ts +0 -1
- package/dist/components/__tests__/XSkeleton.test.d.ts +0 -1
- package/dist/components/__tests__/XStatistic.test.d.ts +0 -1
- package/dist/components/__tests__/XSteps.test.d.ts +0 -1
- package/dist/components/__tests__/XSwitch.test.d.ts +0 -1
- package/dist/components/__tests__/XTable.test.d.ts +0 -1
- package/dist/components/__tests__/XTabs.test.d.ts +0 -1
- package/dist/components/__tests__/XTag.test.d.ts +0 -1
- package/dist/components/__tests__/XThemeAttrAllComponentsSmoke.test.d.ts +0 -1
- package/dist/components/__tests__/XThemeAttrsForwarding.test.d.ts +0 -1
- package/dist/components/__tests__/XTimePicker.test.d.ts +0 -1
- package/dist/components/__tests__/XTour.test.d.ts +0 -1
- package/dist/components/__tests__/XTree.test.d.ts +0 -1
- package/dist/components/__tests__/XTreeSelect.test.d.ts +0 -1
- package/dist/components/__tests__/XTrigger.test.d.ts +0 -1
- package/dist/components/__tests__/XTriggerWrappersTheme.test.d.ts +0 -1
- package/dist/components/__tests__/XWatermark.test.d.ts +0 -1
- package/dist/favicon.ico +0 -1
- package/dist/favicon.svg +0 -5
- package/dist/images/carousel-0.png +0 -0
- package/dist/images/carousel-2.png +0 -0
- package/dist/images/carousel-3.png +0 -0
- package/dist/images/image-1.png +0 -0
- package/dist/img/avatar-1.jpg +0 -0
- package/dist/img/avatar.jpg +0 -0
- package/dist/img/avatar0.jpg +0 -0
- package/dist/img/avatar1.jpg +0 -0
- package/dist/img/image-1.png +0 -0
- package/dist/img/image-2.png +0 -0
- package/dist/img/image-3.png +0 -0
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
import { defineComponent as _e, computed as v, ref as _, watch as T, nextTick as k, onMounted as be, openBlock as d, createElementBlock as f, normalizeClass as V, unref as y, createElementVNode as l, toDisplayString as b, createCommentVNode as h, renderSlot as x, Fragment as xe, renderList as ye, createVNode as X, normalizeStyle as we } from "vue";
|
|
2
|
+
import { useXConfig as Ce, sizeClass as Se } from "../composables/config.js";
|
|
3
|
+
import { useXI18n as $e } from "../composables/i18n.js";
|
|
4
|
+
import j from "./XIcon.js";
|
|
5
|
+
const Ie = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "x-chat-input__drag-overlay"
|
|
8
|
+
}, ke = { class: "x-chat-input__drag-text" }, Fe = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "x-chat-input__header"
|
|
11
|
+
}, Le = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "x-chat-input__header-extra"
|
|
14
|
+
}, De = {
|
|
15
|
+
key: 2,
|
|
16
|
+
class: "x-chat-input__files"
|
|
17
|
+
}, Ae = { class: "x-chat-input__file-icon" }, Re = ["title"], Ee = { class: "x-chat-input__file-size" }, ze = ["onClick"], Be = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "x-chat-input__file-progress"
|
|
20
|
+
}, Te = { class: "x-chat-input__main" }, Ve = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "x-chat-input__prefix"
|
|
23
|
+
}, He = { class: "x-chat-input__editor-wrap" }, Me = ["contenteditable", "placeholder"], Ne = {
|
|
24
|
+
key: 1,
|
|
25
|
+
class: "x-chat-input__suffix"
|
|
26
|
+
}, We = { class: "x-chat-input__footer" }, qe = { class: "x-chat-input__footer-left" }, Pe = ["disabled"], Ke = { class: "x-chat-input__toolbar-text" }, Oe = { class: "x-chat-input__footer-right" }, Ue = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "x-chat-input__char-count"
|
|
29
|
+
}, Xe = ["disabled", "aria-label"], je = {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: "x-chat-input__send-spinner"
|
|
32
|
+
}, Ye = {
|
|
33
|
+
key: 1,
|
|
34
|
+
class: "x-chat-input__send-icon",
|
|
35
|
+
"aria-hidden": "true"
|
|
36
|
+
}, Ze = { class: "x-chat-input__send-text" }, Ge = ["accept"], it = /* @__PURE__ */ _e({
|
|
37
|
+
__name: "XChatInput",
|
|
38
|
+
props: {
|
|
39
|
+
modelValue: { default: "" },
|
|
40
|
+
placeholder: { default: "输入消息..." },
|
|
41
|
+
disabled: { type: Boolean, default: !1 },
|
|
42
|
+
loading: { type: Boolean, default: !1 },
|
|
43
|
+
size: { default: void 0 },
|
|
44
|
+
maxLength: { default: void 0 },
|
|
45
|
+
autoSize: { type: [Boolean, Object], default: !0 },
|
|
46
|
+
allowClear: { type: Boolean, default: !0 },
|
|
47
|
+
sendOnEnter: { type: Boolean, default: !0 },
|
|
48
|
+
draggable: { type: Boolean, default: !0 },
|
|
49
|
+
accept: { default: "*" },
|
|
50
|
+
maxFiles: { default: 5 },
|
|
51
|
+
maxFileSize: { default: 10 },
|
|
52
|
+
fileList: { default: () => [] },
|
|
53
|
+
images: { default: () => [] },
|
|
54
|
+
showAttachButton: { type: Boolean, default: !1 },
|
|
55
|
+
allowImagePaste: { type: Boolean, default: !0 },
|
|
56
|
+
allowImageDrop: { type: Boolean, default: !0 },
|
|
57
|
+
uploadAction: { type: Function, default: void 0 }
|
|
58
|
+
},
|
|
59
|
+
emits: ["update:modelValue", "update:fileList", "update:images", "send", "file-change", "file-remove", "file-drop", "image-insert", "image-remove", "image-upload", "focus", "blur", "clear"],
|
|
60
|
+
setup(u, { expose: Y, emit: Z }) {
|
|
61
|
+
const i = u, p = Z, G = Ce(), { t: C } = $e(), J = v(() => i.size ?? G.size.value), Q = v(() => i.placeholder === "输入消息..." ? C("chatInput.placeholder", void 0, "输入消息...") : i.placeholder), o = _(), H = _(), D = _(!1), S = _(!1), F = _(0), A = _([...i.fileList]), R = _([...i.images]), E = _(null), g = v({
|
|
62
|
+
get: () => i.fileList ?? A.value,
|
|
63
|
+
set: (e) => {
|
|
64
|
+
A.value = e, p("update:fileList", e);
|
|
65
|
+
}
|
|
66
|
+
}), m = v({
|
|
67
|
+
get: () => i.images ?? R.value,
|
|
68
|
+
set: (e) => {
|
|
69
|
+
R.value = e, p("update:images", e);
|
|
70
|
+
}
|
|
71
|
+
}), M = v(() => o.value ? o.value.innerText.trim().length > 0 || m.value.length > 0 : i.modelValue.length > 0), N = v(() => g.value.length > 0), ee = v(() => !i.disabled && !i.loading && M.value), te = v(() => i.disabled || i.loading), W = v(() => {
|
|
72
|
+
var e, t;
|
|
73
|
+
return typeof i.autoSize == "boolean" ? i.autoSize ? { minRows: 1, maxRows: 6 } : { minRows: 1, maxRows: 1 } : {
|
|
74
|
+
minRows: ((e = i.autoSize) == null ? void 0 : e.minRows) ?? 1,
|
|
75
|
+
maxRows: ((t = i.autoSize) == null ? void 0 : t.maxRows) ?? 6
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
function $() {
|
|
79
|
+
if (!o.value) return;
|
|
80
|
+
const e = o.value, t = 22, a = W.value.minRows * t + 24, n = W.value.maxRows * t + 24;
|
|
81
|
+
e.style.height = "auto";
|
|
82
|
+
const s = e.scrollHeight, r = Math.min(Math.max(s, a), n);
|
|
83
|
+
e.style.height = `${r}px`, e.style.overflowY = s > n ? "auto" : "hidden";
|
|
84
|
+
}
|
|
85
|
+
function q() {
|
|
86
|
+
if (!o.value) return "";
|
|
87
|
+
const e = o.value.cloneNode(!0);
|
|
88
|
+
return e.querySelectorAll("[data-image]").forEach((a) => {
|
|
89
|
+
const n = a.getAttribute("data-uid");
|
|
90
|
+
m.value.find((r) => r.uid === n) && a.replaceWith(`[img:${n}]`);
|
|
91
|
+
}), e.innerText || "";
|
|
92
|
+
}
|
|
93
|
+
function z() {
|
|
94
|
+
const e = q();
|
|
95
|
+
p("update:modelValue", e);
|
|
96
|
+
}
|
|
97
|
+
function ae() {
|
|
98
|
+
z(), k($);
|
|
99
|
+
}
|
|
100
|
+
function L() {
|
|
101
|
+
const e = window.getSelection();
|
|
102
|
+
e && e.rangeCount > 0 && (E.value = e.getRangeAt(0).cloneRange());
|
|
103
|
+
}
|
|
104
|
+
function ne() {
|
|
105
|
+
if (!E.value || !o.value) return;
|
|
106
|
+
const e = window.getSelection();
|
|
107
|
+
e && (e.removeAllRanges(), e.addRange(E.value));
|
|
108
|
+
}
|
|
109
|
+
function ie(e) {
|
|
110
|
+
i.sendOnEnter && e.key === "Enter" && !e.shiftKey && (e.preventDefault(), P());
|
|
111
|
+
}
|
|
112
|
+
function P() {
|
|
113
|
+
if (!ee.value) return;
|
|
114
|
+
const e = q();
|
|
115
|
+
p("send", e, g.value, m.value);
|
|
116
|
+
}
|
|
117
|
+
function K() {
|
|
118
|
+
o.value && (o.value.innerHTML = ""), g.value = [], m.value = [], p("update:modelValue", ""), p("clear"), k($);
|
|
119
|
+
}
|
|
120
|
+
function O() {
|
|
121
|
+
return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
122
|
+
}
|
|
123
|
+
function se(e) {
|
|
124
|
+
const t = document.createElement("span");
|
|
125
|
+
t.className = "x-chat-input__image-wrapper", t.setAttribute("contenteditable", "false"), t.setAttribute("data-image", "true"), t.setAttribute("data-uid", e.uid);
|
|
126
|
+
const a = document.createElement("img");
|
|
127
|
+
a.src = e.url, a.className = "x-chat-input__image", e.status === "uploading" && (a.style.opacity = "0.6");
|
|
128
|
+
const n = document.createElement("span");
|
|
129
|
+
if (n.className = "x-chat-input__image-remove", n.innerHTML = "×", n.onclick = (c) => {
|
|
130
|
+
c.stopPropagation(), le(e.uid);
|
|
131
|
+
}, e.status === "uploading") {
|
|
132
|
+
const c = document.createElement("span");
|
|
133
|
+
c.className = "x-chat-input__image-progress", c.textContent = `${e.percent || 0}%`, t.appendChild(c);
|
|
134
|
+
}
|
|
135
|
+
t.appendChild(a), t.appendChild(n);
|
|
136
|
+
const s = document.createElement("span");
|
|
137
|
+
s.innerHTML = " ", s.setAttribute("data-cursor-space", "true");
|
|
138
|
+
const r = document.createElement("span");
|
|
139
|
+
return r.appendChild(t), r.appendChild(s), r;
|
|
140
|
+
}
|
|
141
|
+
function oe(e) {
|
|
142
|
+
if (!o.value) return;
|
|
143
|
+
o.value.focus(), ne();
|
|
144
|
+
const t = window.getSelection();
|
|
145
|
+
if (!t) return;
|
|
146
|
+
const a = t.rangeCount > 0 ? t.getRangeAt(0) : null, n = se(e);
|
|
147
|
+
a ? (a.deleteContents(), a.insertNode(n), a.setStartAfter(n), a.setEndAfter(n), t.removeAllRanges(), t.addRange(a)) : o.value.appendChild(n);
|
|
148
|
+
const s = [...m.value, e];
|
|
149
|
+
m.value = s, p("image-insert", e, s), z(), k($);
|
|
150
|
+
}
|
|
151
|
+
function I(e, t) {
|
|
152
|
+
const a = m.value.map(
|
|
153
|
+
(s) => s.uid === e ? { ...s, ...t } : s
|
|
154
|
+
);
|
|
155
|
+
if (m.value = a, !o.value) return;
|
|
156
|
+
const n = o.value.querySelector(`[data-uid="${e}"]`);
|
|
157
|
+
if (n) {
|
|
158
|
+
const s = n.querySelector("img");
|
|
159
|
+
s && t.status === "done" && (s.style.opacity = "1");
|
|
160
|
+
const r = n.querySelector(".x-chat-input__image-progress");
|
|
161
|
+
r && t.percent !== void 0 && (r.textContent = t.percent >= 100 ? "" : `${t.percent}%`, t.percent >= 100 && r.remove());
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function le(e) {
|
|
165
|
+
const t = m.value.find((n) => n.uid === e);
|
|
166
|
+
if (!t) return;
|
|
167
|
+
if (o.value) {
|
|
168
|
+
const n = o.value.querySelector(`[data-uid="${e}"]`);
|
|
169
|
+
if (n) {
|
|
170
|
+
const s = n.parentElement;
|
|
171
|
+
if (s) {
|
|
172
|
+
const r = s.querySelector("[data-cursor-space]");
|
|
173
|
+
r && r.remove(), s.remove();
|
|
174
|
+
} else
|
|
175
|
+
n.remove();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
const a = m.value.filter((n) => n.uid !== e);
|
|
179
|
+
m.value = a, p("image-remove", t, a), z();
|
|
180
|
+
}
|
|
181
|
+
async function B(e) {
|
|
182
|
+
const t = O(), a = {
|
|
183
|
+
uid: t,
|
|
184
|
+
url: URL.createObjectURL(e),
|
|
185
|
+
name: e.name,
|
|
186
|
+
status: "uploading",
|
|
187
|
+
percent: 0
|
|
188
|
+
};
|
|
189
|
+
if (oe(a), i.uploadAction)
|
|
190
|
+
try {
|
|
191
|
+
const n = await i.uploadAction(e);
|
|
192
|
+
I(t, { status: "done", url: n, percent: 100 });
|
|
193
|
+
} catch {
|
|
194
|
+
I(t, { status: "error" });
|
|
195
|
+
}
|
|
196
|
+
else
|
|
197
|
+
p(
|
|
198
|
+
"image-upload",
|
|
199
|
+
e,
|
|
200
|
+
(n) => I(t, { percent: n }),
|
|
201
|
+
(n) => I(t, { status: "done", url: n, percent: 100 }),
|
|
202
|
+
() => I(t, { status: "error" })
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
function re(e) {
|
|
206
|
+
var a;
|
|
207
|
+
if (!i.allowImagePaste || i.disabled) return;
|
|
208
|
+
const t = (a = e.clipboardData) == null ? void 0 : a.items;
|
|
209
|
+
if (t) {
|
|
210
|
+
for (const n of t)
|
|
211
|
+
if (n.type.startsWith("image/")) {
|
|
212
|
+
e.preventDefault();
|
|
213
|
+
const s = n.getAsFile();
|
|
214
|
+
s && B(s);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function ue(e) {
|
|
219
|
+
const t = e.type.startsWith("image/");
|
|
220
|
+
return {
|
|
221
|
+
uid: O(),
|
|
222
|
+
name: e.name,
|
|
223
|
+
size: e.size,
|
|
224
|
+
type: e.type,
|
|
225
|
+
raw: e,
|
|
226
|
+
status: "done",
|
|
227
|
+
percent: 100,
|
|
228
|
+
isImage: t
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
function ce(e) {
|
|
232
|
+
return e < 1024 ? `${e}B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)}KB` : `${(e / 1024 / 1024).toFixed(1)}MB`;
|
|
233
|
+
}
|
|
234
|
+
function U(e) {
|
|
235
|
+
const t = [], a = [];
|
|
236
|
+
e.forEach((c) => {
|
|
237
|
+
c.type.startsWith("image/") && i.allowImageDrop ? t.push(c) : a.push(c);
|
|
238
|
+
}), t.forEach((c) => B(c));
|
|
239
|
+
const s = a.filter((c) => !(c.size > i.maxFileSize * 1024 * 1024 || i.accept !== "*" && !i.accept.split(",").map((w) => w.trim()).some((w) => w.includes("*") ? c.type.startsWith(w.replace("/*", "")) : c.type === w || c.name.endsWith(w)))).map(ue), r = [...g.value, ...s].slice(0, i.maxFiles);
|
|
240
|
+
g.value = r, p("file-change", s, r);
|
|
241
|
+
}
|
|
242
|
+
function de(e) {
|
|
243
|
+
const t = g.value.find((n) => n.uid === e);
|
|
244
|
+
if (!t) return;
|
|
245
|
+
const a = g.value.filter((n) => n.uid !== e);
|
|
246
|
+
g.value = a, p("file-remove", t, a);
|
|
247
|
+
}
|
|
248
|
+
function fe(e) {
|
|
249
|
+
var a;
|
|
250
|
+
const t = e.target;
|
|
251
|
+
(a = t.files) != null && a.length && (U(Array.from(t.files)), t.value = "");
|
|
252
|
+
}
|
|
253
|
+
function pe(e) {
|
|
254
|
+
var t;
|
|
255
|
+
!i.draggable || i.disabled || (e.preventDefault(), F.value++, (t = e.dataTransfer) != null && t.types.includes("Files") && (S.value = !0));
|
|
256
|
+
}
|
|
257
|
+
function me(e) {
|
|
258
|
+
!i.draggable || i.disabled || (e.preventDefault(), F.value--, F.value === 0 && (S.value = !1));
|
|
259
|
+
}
|
|
260
|
+
function he(e) {
|
|
261
|
+
!i.draggable || i.disabled || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "copy"));
|
|
262
|
+
}
|
|
263
|
+
function ge(e) {
|
|
264
|
+
var a;
|
|
265
|
+
if (!i.draggable || i.disabled) return;
|
|
266
|
+
e.preventDefault(), F.value = 0, S.value = !1;
|
|
267
|
+
const t = (a = e.dataTransfer) == null ? void 0 : a.files;
|
|
268
|
+
if (t != null && t.length) {
|
|
269
|
+
const n = Array.from(t);
|
|
270
|
+
U(n), p("file-drop", n, e);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function ve(e) {
|
|
274
|
+
return e.startsWith("image/") ? "🖼️" : e.startsWith("video/") ? "🎬" : e.startsWith("audio/") ? "🎵" : e.includes("pdf") ? "📄" : e.includes("zip") || e.includes("rar") ? "📦" : "📎";
|
|
275
|
+
}
|
|
276
|
+
return T(() => i.fileList, (e) => {
|
|
277
|
+
e && (A.value = [...e]);
|
|
278
|
+
}, { deep: !0 }), T(() => i.images, (e) => {
|
|
279
|
+
e && (R.value = [...e]);
|
|
280
|
+
}, { deep: !0 }), T(() => i.modelValue, (e) => {
|
|
281
|
+
o.value && o.value.innerText !== e && (o.value.matches(":focus") || (o.value.innerText = e, k($)));
|
|
282
|
+
}, { immediate: !0 }), be(() => {
|
|
283
|
+
o.value && i.modelValue && (o.value.innerText = i.modelValue, k($));
|
|
284
|
+
}), Y({
|
|
285
|
+
focus: () => {
|
|
286
|
+
var e;
|
|
287
|
+
return (e = o.value) == null ? void 0 : e.focus();
|
|
288
|
+
},
|
|
289
|
+
blur: () => {
|
|
290
|
+
var e;
|
|
291
|
+
return (e = o.value) == null ? void 0 : e.blur();
|
|
292
|
+
},
|
|
293
|
+
clear: K,
|
|
294
|
+
insertImage: B,
|
|
295
|
+
editor: o
|
|
296
|
+
}), (e, t) => (d(), f("div", {
|
|
297
|
+
class: V(["x-chat-input", [
|
|
298
|
+
y(Se)(J.value),
|
|
299
|
+
{
|
|
300
|
+
"is-focused": D.value,
|
|
301
|
+
"is-disabled": u.disabled,
|
|
302
|
+
"is-dragging": S.value,
|
|
303
|
+
"has-files": N.value
|
|
304
|
+
}
|
|
305
|
+
]]),
|
|
306
|
+
onDragenter: pe,
|
|
307
|
+
onDragleave: me,
|
|
308
|
+
onDragover: he,
|
|
309
|
+
onDrop: ge
|
|
310
|
+
}, [
|
|
311
|
+
S.value && u.draggable ? (d(), f("div", Ie, [
|
|
312
|
+
t[3] || (t[3] = l("span", { class: "x-chat-input__drag-icon" }, "📁", -1)),
|
|
313
|
+
l("span", ke, b(y(C)("chatInput.dragUpload", void 0, "释放以上传文件")), 1)
|
|
314
|
+
])) : h("", !0),
|
|
315
|
+
e.$slots.header || e.$slots["header-extra"] ? (d(), f("div", Fe, [
|
|
316
|
+
x(e.$slots, "header", {}, void 0, !0),
|
|
317
|
+
e.$slots["header-extra"] ? (d(), f("div", Le, [
|
|
318
|
+
x(e.$slots, "header-extra", {}, void 0, !0)
|
|
319
|
+
])) : h("", !0)
|
|
320
|
+
])) : h("", !0),
|
|
321
|
+
N.value ? (d(), f("div", De, [
|
|
322
|
+
(d(!0), f(xe, null, ye(g.value, (a) => (d(), f("div", {
|
|
323
|
+
key: a.uid,
|
|
324
|
+
class: V(["x-chat-input__file-item", { "is-error": a.status === "error" }])
|
|
325
|
+
}, [
|
|
326
|
+
l("span", Ae, b(ve(a.type)), 1),
|
|
327
|
+
l("span", {
|
|
328
|
+
class: "x-chat-input__file-name",
|
|
329
|
+
title: a.name
|
|
330
|
+
}, b(a.name), 9, Re),
|
|
331
|
+
l("span", Ee, b(ce(a.size)), 1),
|
|
332
|
+
l("button", {
|
|
333
|
+
type: "button",
|
|
334
|
+
class: "x-chat-input__file-remove",
|
|
335
|
+
onClick: (n) => de(a.uid)
|
|
336
|
+
}, [
|
|
337
|
+
X(y(j), {
|
|
338
|
+
name: "guanbi",
|
|
339
|
+
size: 10
|
|
340
|
+
})
|
|
341
|
+
], 8, ze),
|
|
342
|
+
a.status === "uploading" && a.percent !== void 0 ? (d(), f("div", Be, [
|
|
343
|
+
l("div", {
|
|
344
|
+
class: "x-chat-input__file-progress-bar",
|
|
345
|
+
style: we({ width: `${a.percent}%` })
|
|
346
|
+
}, null, 4)
|
|
347
|
+
])) : h("", !0)
|
|
348
|
+
], 2))), 128))
|
|
349
|
+
])) : h("", !0),
|
|
350
|
+
l("div", Te, [
|
|
351
|
+
e.$slots.prefix ? (d(), f("div", Ve, [
|
|
352
|
+
x(e.$slots, "prefix", {}, void 0, !0)
|
|
353
|
+
])) : h("", !0),
|
|
354
|
+
l("div", He, [
|
|
355
|
+
l("div", {
|
|
356
|
+
ref_key: "editorRef",
|
|
357
|
+
ref: o,
|
|
358
|
+
class: "x-chat-input__editor",
|
|
359
|
+
contenteditable: !u.disabled,
|
|
360
|
+
placeholder: Q.value,
|
|
361
|
+
onInput: ae,
|
|
362
|
+
onKeydown: ie,
|
|
363
|
+
onFocus: t[0] || (t[0] = (a) => {
|
|
364
|
+
D.value = !0, L(), e.$emit("focus", a);
|
|
365
|
+
}),
|
|
366
|
+
onBlur: t[1] || (t[1] = (a) => {
|
|
367
|
+
D.value = !1, L(), e.$emit("blur", a);
|
|
368
|
+
}),
|
|
369
|
+
onMouseup: L,
|
|
370
|
+
onKeyup: L,
|
|
371
|
+
onPaste: re
|
|
372
|
+
}, null, 40, Me),
|
|
373
|
+
u.allowClear && M.value && !u.disabled ? (d(), f("button", {
|
|
374
|
+
key: 0,
|
|
375
|
+
type: "button",
|
|
376
|
+
class: "x-chat-input__clear",
|
|
377
|
+
onClick: K
|
|
378
|
+
}, [
|
|
379
|
+
X(y(j), {
|
|
380
|
+
name: "guanbi",
|
|
381
|
+
size: 12
|
|
382
|
+
})
|
|
383
|
+
])) : h("", !0)
|
|
384
|
+
]),
|
|
385
|
+
e.$slots.suffix ? (d(), f("div", Ne, [
|
|
386
|
+
x(e.$slots, "suffix", {}, void 0, !0)
|
|
387
|
+
])) : h("", !0)
|
|
388
|
+
]),
|
|
389
|
+
x(e.$slots, "foot", {}, () => [
|
|
390
|
+
l("div", We, [
|
|
391
|
+
l("div", qe, [
|
|
392
|
+
x(e.$slots, "toolbar", {}, () => [
|
|
393
|
+
u.draggable && u.showAttachButton ? (d(), f("button", {
|
|
394
|
+
key: 0,
|
|
395
|
+
type: "button",
|
|
396
|
+
class: "x-chat-input__toolbar-btn x-chat-input__toolbar-btn--attach",
|
|
397
|
+
disabled: u.disabled,
|
|
398
|
+
onClick: t[2] || (t[2] = (a) => {
|
|
399
|
+
var n;
|
|
400
|
+
return (n = H.value) == null ? void 0 : n.click();
|
|
401
|
+
})
|
|
402
|
+
}, [
|
|
403
|
+
t[4] || (t[4] = l("span", { class: "x-chat-input__toolbar-icon" }, "📎", -1)),
|
|
404
|
+
l("span", Ke, b(y(C)("chatInput.attachment", void 0, "附件")), 1)
|
|
405
|
+
], 8, Pe)) : h("", !0)
|
|
406
|
+
], !0),
|
|
407
|
+
x(e.$slots, "toolbar-extra", {}, void 0, !0)
|
|
408
|
+
]),
|
|
409
|
+
l("div", Oe, [
|
|
410
|
+
x(e.$slots, "footer", {}, () => [
|
|
411
|
+
u.maxLength ? (d(), f("span", Ue, b(u.modelValue.length) + "/" + b(u.maxLength), 1)) : h("", !0),
|
|
412
|
+
l("button", {
|
|
413
|
+
type: "button",
|
|
414
|
+
class: V(["x-chat-input__send-btn", { "is-loading": u.loading }]),
|
|
415
|
+
disabled: te.value,
|
|
416
|
+
"aria-label": y(C)("chatInput.send", void 0, "发送"),
|
|
417
|
+
onClick: P
|
|
418
|
+
}, [
|
|
419
|
+
u.loading ? (d(), f("span", je)) : (d(), f("span", Ye, [...t[5] || (t[5] = [
|
|
420
|
+
l("svg", {
|
|
421
|
+
width: "16",
|
|
422
|
+
height: "16",
|
|
423
|
+
viewBox: "0 0 16 16",
|
|
424
|
+
fill: "none",
|
|
425
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
426
|
+
}, [
|
|
427
|
+
l("path", {
|
|
428
|
+
d: "M8.3125 0.981587C8.66767 1.0545 8.97902 1.20558 9.2627 1.43374C9.48724 1.61438 9.73029 1.85933 9.97949 2.10854L14.707 6.83608L13.293 8.25014L9 3.95717V15.0431H7V3.95717L2.70703 8.25014L1.29297 6.83608L6.02051 2.10854C6.26971 1.85933 6.51277 1.61438 6.7373 1.43374C6.97662 1.24126 7.28445 1.04542 7.6875 0.981587C7.8973 0.94841 8.1031 0.956564 8.3125 0.981587Z",
|
|
429
|
+
fill: "currentColor"
|
|
430
|
+
})
|
|
431
|
+
], -1)
|
|
432
|
+
])])),
|
|
433
|
+
l("span", Ze, b(y(C)("chatInput.send", void 0, "发送")), 1)
|
|
434
|
+
], 10, Xe)
|
|
435
|
+
], !0)
|
|
436
|
+
])
|
|
437
|
+
])
|
|
438
|
+
], !0),
|
|
439
|
+
u.draggable ? (d(), f("input", {
|
|
440
|
+
key: 3,
|
|
441
|
+
ref_key: "fileInput",
|
|
442
|
+
ref: H,
|
|
443
|
+
type: "file",
|
|
444
|
+
accept: u.accept,
|
|
445
|
+
multiple: "",
|
|
446
|
+
style: { display: "none" },
|
|
447
|
+
onChange: fe
|
|
448
|
+
}, null, 40, Ge)) : h("", !0)
|
|
449
|
+
], 34));
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
export {
|
|
453
|
+
it as default
|
|
454
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { defineComponent as V, useSlots as K, ref as A, inject as M, computed as i, watch as b, openBlock as s, createElementBlock as y, normalizeClass as T, createElementVNode as g, unref as h, createBlock as p, createCommentVNode as C, renderSlot as H, nextTick as J } from "vue";
|
|
2
|
+
import { useXFormField as L } from "../composables/form.js";
|
|
3
|
+
import S from "./XIcon.js";
|
|
4
|
+
import { xCheckboxGroupKey as O } from "./x-checkbox-context.js";
|
|
5
|
+
const Q = ["aria-disabled"], U = ["id", "checked", "value", "disabled", "aria-checked"], W = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "x-checkbox__icon-hover"
|
|
8
|
+
}, Y = { class: "x-checkbox__box" }, Z = {
|
|
9
|
+
key: 2,
|
|
10
|
+
class: "x-checkbox__label"
|
|
11
|
+
}, le = /* @__PURE__ */ V({
|
|
12
|
+
__name: "XCheckbox",
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: { type: [Boolean, Array], default: void 0 },
|
|
15
|
+
defaultChecked: { type: Boolean, default: !1 },
|
|
16
|
+
value: { type: [String, Number, Boolean], default: !0 },
|
|
17
|
+
disabled: { type: Boolean, default: !1 },
|
|
18
|
+
indeterminate: { type: Boolean, default: !1 },
|
|
19
|
+
uninjectGroupContext: { type: Boolean, default: !1 }
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:modelValue", "change"],
|
|
22
|
+
setup(_, { expose: F, emit: X }) {
|
|
23
|
+
const l = _, x = X, R = K(), o = A(null), r = A(l.defaultChecked), t = L(), a = l.uninjectGroupContext ? void 0 : M(O, void 0), f = i(() => (a == null ? void 0 : a.name) === "XCheckboxGroup"), v = i(() => l.value ?? !0), d = i(() => f.value ? (a == null ? void 0 : a.computedValue.value) ?? [] : Array.isArray(l.modelValue) || typeof l.modelValue == "boolean" ? l.modelValue : r.value), u = i(() => Array.isArray(d.value) ? d.value.includes(v.value) : !!d.value), m = i(() => !!(a != null && a.disabled.value || l.disabled || t != null && t.disabled.value || !u.value && (a != null && a.isMaxed.value))), j = i(() => l.indeterminate ? "mixed" : u.value ? "true" : "false"), q = i(() => [
|
|
24
|
+
"x-checkbox",
|
|
25
|
+
{
|
|
26
|
+
"x-checkbox-checked": u.value,
|
|
27
|
+
"x-checkbox-indeterminate": l.indeterminate,
|
|
28
|
+
"x-checkbox-disabled": m.value,
|
|
29
|
+
"is-checked": u.value,
|
|
30
|
+
"is-indeterminate": l.indeterminate,
|
|
31
|
+
"is-disabled": m.value
|
|
32
|
+
}
|
|
33
|
+
]), B = i(() => R.checkbox ?? (a == null ? void 0 : a.checkboxSlot));
|
|
34
|
+
b(
|
|
35
|
+
() => l.modelValue,
|
|
36
|
+
(e) => {
|
|
37
|
+
e == null && (r.value = !1);
|
|
38
|
+
}
|
|
39
|
+
), b(d, (e) => {
|
|
40
|
+
const n = Array.isArray(e) ? e.includes(v.value) : !!e;
|
|
41
|
+
r.value !== n && (r.value = n), o.value && o.value.checked !== n && (o.value.checked = n);
|
|
42
|
+
}), b(
|
|
43
|
+
() => l.indeterminate,
|
|
44
|
+
(e) => {
|
|
45
|
+
o.value && (o.value.indeterminate = e);
|
|
46
|
+
},
|
|
47
|
+
{ immediate: !0 }
|
|
48
|
+
);
|
|
49
|
+
function N(e) {
|
|
50
|
+
e.stopPropagation();
|
|
51
|
+
}
|
|
52
|
+
function w(e) {
|
|
53
|
+
const n = e.target.checked;
|
|
54
|
+
let c = n;
|
|
55
|
+
if (Array.isArray(d.value)) {
|
|
56
|
+
const k = new Set(d.value);
|
|
57
|
+
n ? k.add(v.value) : k.delete(v.value), c = Array.from(k);
|
|
58
|
+
}
|
|
59
|
+
r.value = n, f.value && Array.isArray(c) ? a == null || a.handleChange(c, e) : (x("update:modelValue", c), x("change", c, e), t == null || t.notifyChange(e)), J(() => {
|
|
60
|
+
o.value && o.value.checked !== u.value && (o.value.checked = u.value);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function E(e) {
|
|
64
|
+
t == null || t.notifyBlur(e);
|
|
65
|
+
}
|
|
66
|
+
function I(e) {
|
|
67
|
+
t == null || t.notifyFocus(e);
|
|
68
|
+
}
|
|
69
|
+
function $() {
|
|
70
|
+
var e;
|
|
71
|
+
(e = o.value) == null || e.focus();
|
|
72
|
+
}
|
|
73
|
+
function z() {
|
|
74
|
+
var e;
|
|
75
|
+
(e = o.value) == null || e.blur();
|
|
76
|
+
}
|
|
77
|
+
F({
|
|
78
|
+
focus: $,
|
|
79
|
+
blur: z
|
|
80
|
+
});
|
|
81
|
+
const D = V({
|
|
82
|
+
name: "XCheckboxSlotRenderer",
|
|
83
|
+
props: {
|
|
84
|
+
render: {
|
|
85
|
+
type: Function,
|
|
86
|
+
required: !0
|
|
87
|
+
},
|
|
88
|
+
checked: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
required: !0
|
|
91
|
+
},
|
|
92
|
+
disabled: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
required: !0
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
setup(e) {
|
|
98
|
+
return () => {
|
|
99
|
+
var n;
|
|
100
|
+
return (n = e.render) == null ? void 0 : n.call(e, { checked: e.checked, disabled: e.disabled });
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return (e, n) => {
|
|
105
|
+
var c;
|
|
106
|
+
return s(), y("label", {
|
|
107
|
+
class: T(q.value),
|
|
108
|
+
"aria-disabled": m.value
|
|
109
|
+
}, [
|
|
110
|
+
g("input", {
|
|
111
|
+
ref_key: "inputRef",
|
|
112
|
+
ref: o,
|
|
113
|
+
id: f.value || (c = h(t)) == null ? void 0 : c.id,
|
|
114
|
+
class: "x-checkbox__input x-checkbox-target",
|
|
115
|
+
type: "checkbox",
|
|
116
|
+
checked: u.value,
|
|
117
|
+
value: v.value,
|
|
118
|
+
disabled: m.value,
|
|
119
|
+
"aria-checked": j.value,
|
|
120
|
+
onClick: N,
|
|
121
|
+
onChange: w,
|
|
122
|
+
onFocus: I,
|
|
123
|
+
onBlur: E
|
|
124
|
+
}, null, 40, U),
|
|
125
|
+
B.value ? (s(), p(h(D), {
|
|
126
|
+
key: 0,
|
|
127
|
+
render: B.value,
|
|
128
|
+
checked: u.value,
|
|
129
|
+
disabled: m.value
|
|
130
|
+
}, null, 8, ["render", "checked", "disabled"])) : (s(), y("span", W, [
|
|
131
|
+
g("span", Y, [
|
|
132
|
+
_.indeterminate ? (s(), p(h(S), {
|
|
133
|
+
key: 0,
|
|
134
|
+
name: "checkbox-indeterminate",
|
|
135
|
+
class: "x-checkbox__icon",
|
|
136
|
+
"aria-hidden": "true"
|
|
137
|
+
})) : u.value ? (s(), p(h(S), {
|
|
138
|
+
key: 1,
|
|
139
|
+
name: "dui",
|
|
140
|
+
class: "x-checkbox__icon",
|
|
141
|
+
"aria-hidden": "true"
|
|
142
|
+
})) : C("", !0)
|
|
143
|
+
])
|
|
144
|
+
])),
|
|
145
|
+
e.$slots.default ? (s(), y("span", Z, [
|
|
146
|
+
H(e.$slots, "default")
|
|
147
|
+
])) : C("", !0)
|
|
148
|
+
], 10, Q);
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
export {
|
|
153
|
+
le as default
|
|
154
|
+
};
|