hys-ui 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/README.md +68 -59
- package/dist/components/HysAlert/HysAlert.vue.js +5 -54
- package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +146 -2
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +2 -2
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +285 -273
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +1 -1
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +102 -98
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +1 -1
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +273 -59
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +227 -60
- package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
- package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
- package/dist/components/HysCalendar/HysCalendar.vue.js +3 -3
- package/dist/components/HysCalendar/HysCalendar2.vue.js +237 -225
- package/dist/components/HysCascader/HysCascader.vue.js +2 -2
- package/dist/components/HysCascader/HysCascader2.vue.js +337 -324
- package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
- package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -217
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
- package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
- package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
- package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
- package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
- package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1008 -559
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +2 -0
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +539 -526
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +5 -3
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
- package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
- package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
- package/dist/components/HysFormItem/HysFormItem.vue.js +2 -2
- package/dist/components/HysFormItem/HysFormItem2.vue.js +171 -164
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +810 -795
- package/dist/components/HysMention/HysMention.vue.js +1 -1
- package/dist/components/HysMention/HysMention2.vue.js +1092 -142
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +491 -85
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
- package/dist/components/HysPopover/HysPopover.vue.js +5 -91
- package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
- package/dist/components/HysProgress/HysProgress.vue.js +2 -2
- package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
- package/dist/components/HysSearch/HysSearch.vue.js +5 -82
- package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +755 -590
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +192 -188
- package/dist/components/HysSlider/SliderTooltip.vue.js +2 -2
- package/dist/components/HysSlider/SliderTooltip2.vue.js +103 -89
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
- package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +1416 -1127
- package/dist/components/HysTagInput/HysTagInput.vue.js +5 -82
- package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
- package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
- package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
- package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
- package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
- package/dist/components/HysTour/HysTour.vue.js +291 -63
- package/dist/components/HysTour/HysTour3.vue.js +5 -0
- package/dist/components/HysTransfer/HysTransfer.vue.js +2 -2
- package/dist/components/HysTransfer/HysTransfer2.vue.js +237 -207
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +1 -1
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +320 -271
- package/dist/components/HysTree/HysTree.vue.js +2 -2
- package/dist/components/HysTree/HysTree2.vue.js +195 -184
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +4 -4
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +389 -377
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +459 -125
- package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
- package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
- package/dist/composables/buttonGroup.js +12 -0
- package/dist/composables/color.js +97 -0
- package/dist/composables/dataGrid.js +68 -0
- package/dist/composables/drawer.js +17 -0
- package/dist/composables/feedback.js +14 -0
- package/dist/composables/floatingPosition.js +18 -0
- package/dist/composables/mentionDocument.js +79 -0
- package/dist/composables/mentionEditor.js +58 -0
- package/dist/composables/menu.js +96 -0
- package/dist/composables/modal.js +14 -0
- package/dist/composables/overlayManager.js +48 -18
- package/dist/composables/progress.js +94 -0
- package/dist/composables/selectOptions.js +44 -38
- package/dist/composables/splitPaneSizes.js +58 -0
- package/dist/composables/table.js +128 -105
- package/dist/composables/tagInput.js +16 -0
- package/dist/composables/timeline.js +19 -0
- package/dist/composables/transfer.js +19 -17
- package/dist/composables/upload.js +55 -0
- package/dist/composables/uploadRequest.js +58 -0
- package/dist/composables/useAlert.js +124 -0
- package/dist/composables/useColorPicker.js +402 -0
- package/dist/composables/useContextMenu.js +514 -0
- package/dist/composables/useDataGridRemote.js +67 -0
- package/dist/composables/useDialog.js +86 -43
- package/dist/composables/useDrawerPush.js +33 -0
- package/dist/composables/useDrawerResize.js +221 -0
- package/dist/composables/useFloating.js +118 -80
- package/dist/composables/useHysModal.js +185 -0
- package/dist/composables/useMentionCaret.js +81 -0
- package/dist/composables/useMentionList.js +81 -0
- package/dist/composables/useMentionModel.js +90 -0
- package/dist/composables/useMentionOptions.js +421 -0
- package/dist/composables/useModal.js +295 -0
- package/dist/composables/useModalInteraction.js +394 -0
- package/dist/composables/usePopupSurface.js +458 -0
- package/dist/composables/useSplitPaneDrag.js +52 -0
- package/dist/composables/useSplitPaneStorage.js +38 -0
- package/dist/composables/useTable.js +344 -312
- package/dist/composables/useTableSticky.js +79 -0
- package/dist/composables/useTagInput.js +313 -0
- package/dist/composables/useTourLayout.js +129 -0
- package/dist/composables/useTransferMotion.js +185 -0
- package/dist/composables/useUpload.js +472 -0
- package/dist/composables/useUploadModel.js +65 -0
- package/dist/composables/useUploadRequests.js +266 -0
- package/dist/composables/useVirtualTableLayout.js +277 -0
- package/dist/composables/virtualTable.js +43 -0
- package/dist/config.js +11 -11
- package/dist/index.js +175 -153
- package/dist/internal/MultiSplitPane.vue.js +305 -0
- package/dist/internal/MultiSplitPane2.vue.js +4 -0
- package/dist/internal/PopupReference.js +39 -0
- package/dist/internal/PopupSurfacePanel.vue.js +7 -0
- package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
- package/dist/motion/PopupMotion.js +105 -0
- package/dist/motion/popup.js +10 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
- package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +61 -7
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +7 -7
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +6 -1
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +3 -3
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +54 -31
- package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
- package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +3 -2
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +7 -7
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
- package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
- package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
- package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
- package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +3 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
- package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +2 -1
- package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -39
- package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
- package/dist/types/components/HysRating/HysRating.vue.d.ts +1 -1
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +45 -7
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +19 -5
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +5 -4
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +3 -1
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
- package/dist/types/components/HysTable/HysTable.vue.d.ts +1742 -5
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +2 -2
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +47 -25
- package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
- package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -8
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +2 -2
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +5 -3
- package/dist/types/components/HysTree/HysTree.vue.d.ts +2 -2
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
- package/dist/types/composables/autocomplete.d.ts +3 -0
- package/dist/types/composables/avatar.d.ts +3 -0
- package/dist/types/composables/buttonGroup.d.ts +9 -0
- package/dist/types/composables/cascader.d.ts +3 -0
- package/dist/types/composables/color.d.ts +97 -0
- package/dist/types/composables/dataGrid.d.ts +100 -0
- package/dist/types/composables/datePicker.d.ts +3 -0
- package/dist/types/composables/drawer.d.ts +102 -0
- package/dist/types/composables/feedback.d.ts +98 -0
- package/dist/types/composables/floatingPosition.d.ts +14 -0
- package/dist/types/composables/formContext.d.ts +2 -0
- package/dist/types/composables/mention.d.ts +284 -0
- package/dist/types/composables/mentionDocument.d.ts +15 -0
- package/dist/types/composables/mentionEditor.d.ts +7 -0
- package/dist/types/composables/menu.d.ts +183 -0
- package/dist/types/composables/modal.d.ts +185 -0
- package/dist/types/composables/overlayManager.d.ts +7 -3
- package/dist/types/composables/popupSurface.d.ts +83 -0
- package/dist/types/composables/progress.d.ts +92 -0
- package/dist/types/composables/selectOptions.d.ts +7 -0
- package/dist/types/composables/splitPaneSizes.d.ts +11 -0
- package/dist/types/composables/table.d.ts +119 -6
- package/dist/types/composables/tagInput.d.ts +96 -0
- package/dist/types/composables/timeline.d.ts +82 -0
- package/dist/types/composables/tour.d.ts +68 -0
- package/dist/types/composables/transfer.d.ts +7 -0
- package/dist/types/composables/tree.d.ts +3 -0
- package/dist/types/composables/treeSelect.d.ts +3 -0
- package/dist/types/composables/upload.d.ts +202 -0
- package/dist/types/composables/uploadRequest.d.ts +3 -0
- package/dist/types/composables/useAlert.d.ts +21 -0
- package/dist/types/composables/useCascader.d.ts +1 -1
- package/dist/types/composables/useColorPicker.d.ts +101 -0
- package/dist/types/composables/useContextMenu.d.ts +81 -0
- package/dist/types/composables/useDataGridRemote.d.ts +15 -0
- package/dist/types/composables/useDialog.d.ts +16 -3
- package/dist/types/composables/useDrawerPush.d.ts +6 -0
- package/dist/types/composables/useDrawerResize.d.ts +27 -0
- package/dist/types/composables/useFloating.d.ts +22 -3
- package/dist/types/composables/useHysModal.d.ts +44 -0
- package/dist/types/composables/useMentionCaret.d.ts +6 -0
- package/dist/types/composables/useMentionList.d.ts +23 -0
- package/dist/types/composables/useMentionModel.d.ts +14 -0
- package/dist/types/composables/useMentionOptions.d.ts +26 -0
- package/dist/types/composables/useModal.d.ts +62 -0
- package/dist/types/composables/useModalInteraction.d.ts +27 -0
- package/dist/types/composables/usePopupSurface.d.ts +3341 -0
- package/dist/types/composables/useSplitPaneDrag.d.ts +14 -0
- package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
- package/dist/types/composables/useTable.d.ts +7 -3
- package/dist/types/composables/useTableSticky.d.ts +22 -0
- package/dist/types/composables/useTagInput.d.ts +66 -0
- package/dist/types/composables/useTourLayout.d.ts +33 -0
- package/dist/types/composables/useTransferMotion.d.ts +36 -0
- package/dist/types/composables/useUpload.d.ts +94 -0
- package/dist/types/composables/useUploadModel.d.ts +14 -0
- package/dist/types/composables/useUploadRequests.d.ts +38 -0
- package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
- package/dist/types/composables/virtualTable.d.ts +126 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/index.d.ts +53 -3
- package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
- package/dist/types/internal/PopupReference.d.ts +18 -0
- package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
- package/dist/types/motion/PopupMotion.d.ts +59 -0
- package/dist/types/motion/popup.d.ts +12 -0
- package/package.json +3 -2
- package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
- package/dist/components/HysTour/HysTour2.vue.js +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
- 示例站点为新增能力补充交互示例,API 参考补全参数、事件、插槽和实例方法的具体说明。
|
|
6
|
+
|
|
7
|
+
- Button 增加石板灰、钴蓝、靛蓝、紫罗兰、湖青、青绿、翡翠绿、青柠、琥珀、柑橘、朱红、玫红十二种内置配色,支持深浅色和原有文字、链接及朴素样式。悬停只变更视觉样式,按钮位置保持稳定。
|
|
8
|
+
|
|
9
|
+
- Button 支持可取消的异步操作、延迟加载、按下状态、自定义根标签与键盘激活、两字中文间距、危险色与透明描边组合及文字底色。新增 ButtonGroup 统一按钮的方向、尺寸和状态。
|
|
10
|
+
- Search 增加独立搜索按钮、确认提交模式、非受控初值、清空策略及原生输入属性。
|
|
11
|
+
- Select 支持值与标签模型、远程标签回显、首选高亮值和动态清空值。多选批量事件使用同一模型格式。
|
|
12
|
+
|
|
13
|
+
- Tour 支持定位到元素、选择器和目标函数,增加跟随滚动的高亮遮罩、目标点击策略、非模态引导、逐步外观、自定义内容与导航、挂载与层级配置。
|
|
14
|
+
- SplitPane 增加两侧独立的像素或百分比约束、折叠和恢复、延迟拖动提交、拖动预览事件及非受控比例。
|
|
15
|
+
- SplitPane 支持按标识管理任意数量的面板、按分隔条调整相邻尺寸、受控尺寸集合和面板插槽。未设置尺寸的面板自动分配可用空间。
|
|
16
|
+
- SplitPane 更新细线、抓手和方向箭头,增加可配置分隔条尺寸、键盘折叠、双击操作、非受控布局记忆和按标识调整面板尺寸。
|
|
17
|
+
|
|
18
|
+
- Mention 支持独立触发规则、模糊和拼音搜索、多源分页与缓存、推荐和最近记录、分组虚拟候选、富文本实体、程序化编辑、序列化、撤销重做、权限校验、表单及浮层定制。
|
|
19
|
+
- AnimatedNumber 支持精确十进制字符串、统计标题与前后缀、自定义数值格式和截止时间倒计时。
|
|
20
|
+
- Table 增加外部容器粘性表头和同步滚动条、列级受控排序和筛选、自定义表格结构与表头合并。支持下一次排序提示、自定义批量选择和统一单元格文本转换。
|
|
21
|
+
- Table 支持分页布局、默认分页值、自定义分页器与服务端总页数,以及固定汇总、当前页汇总和自定义汇总行。新增横向最小宽度、列标题渲染和溢出提示样式配置。
|
|
22
|
+
- Pagination 支持非受控初始值、总页数、单页隐藏、控件布局和尺寸,以及总数、按钮内容和跳转插槽。受控模式按已生效的页大小调整页码。
|
|
23
|
+
|
|
24
|
+
## 0.3.0
|
|
25
|
+
|
|
26
|
+
- DataGrid 支持受控查询、远程加载取消与重试、单选和多选、选择保留、自定义列字段与汇总,以及按行键滚动定位。树形行事件返回原始记录,列宽拖动按帧预览并在释放时保存,支持键盘调整和取消。TypeScript 模板引用可使用 `HysDataGridInstance`。
|
|
27
|
+
|
|
28
|
+
- VirtualTable 增加双向虚拟化、左右固定列与顶部固定行、容器测量、稳定排序、受控选择、键盘与实例定位、滚动追加、缓存恢复及自定义加载状态。滚动按帧合并,追加保留当前位置;保留原有表体高度和插槽约定。
|
|
29
|
+
|
|
30
|
+
- TagInput 补充非受控初值、分隔符与批量粘贴、可取消异步检查、受控拒绝处理、清空、标签外观与折叠虚拟列表、拖拽/键盘排序、表单与实例方法;ColorPicker 补充透明度、颜色格式与预设、预览确认、内嵌与受控浮层、自定义内容及表单集成,连续拖动缓存几何并按帧更新,释放时集中校验。保留原有默认行为并增加独立示例。
|
|
31
|
+
|
|
32
|
+
- Alert 补充外观、横幅、操作区、受控关闭、异步检查与退出完成事件;Empty 补充内置图形、图片回退及独立内容区;Timeline 补充双侧和交替布局、标签、节点、加载、字段映射与稳定排序。保留原有接口,完善缓存、动效及辅助技术处理,新增独立场景。
|
|
33
|
+
- Transfer 双击移动时阻止第二次按下产生文字选区,保留复选框、交互内容与快捷多选。
|
|
34
|
+
|
|
35
|
+
- Progress 增加仪表盘与缺口配置、函数/阈值/渐变颜色、已确认进度叠加、分段与精确部分段、尺寸和端点、文字与状态图标、条纹/进行中/不定进度、动效与辅助技术配置;保留原有 value 和默认显示,完善边界及缓存处理并新增独立示例。
|
|
36
|
+
|
|
37
|
+
- Upload 补充受控/初始文件列表、真实 multipart 与自定义请求、自动/手动提交、并发队列、按帧进度、取消和重试、异步验证及内容转换、移除检查、文本/图片/卡片列表、预览/下载、目录与粘贴、插槽和表单集成;保留原有本地选择模式与事件,完善缓存任务和本地 URL 清理,新增独立场景。
|
|
38
|
+
|
|
39
|
+
- Tooltip 与 Popover 补充受控/非受控显示、多种及组合触发、延迟与自动关闭、可移入内容、十二种定位、箭头与外观、独立参考元素、自定义挂载、内容保留及生命周期、键盘导航和实例操作;统一浮层清理并补充独立场景。
|
|
40
|
+
- 修复 Drawer 关闭拦截函数的运行时属性识别,保留回调类型兼容性。
|
|
41
|
+
|
|
42
|
+
- Drawer 补充受控及非受控显示、异步操作与关闭拦截、生命周期和内容挂载策略、独立滚动与分区布局、容器内展示、嵌套推移、全屏及透明度配置、方向动效、焦点管理与实例方法;新增按帧合并的四向边缘缩放、键盘调整、受控尺寸与取消回退,保留旧 close 事件用法。
|
|
43
|
+
|
|
44
|
+
- ContextMenu 补充多种触发方式、多级子菜单、分组与分隔线、复选/单选与普通项选中、受控状态、业务字段映射、模板、滚动边界和键盘/实例操作;Breadcrumb 增加图标、同级菜单、深层折叠、尺寸与文字截断及宿主路由适配,保留既有事件和默认行为。
|
|
45
|
+
|
|
46
|
+
- Transfer 支持 Ctrl/Cmd 逐项切换、Shift 鼠标/键盘范围选择,并补充默认关闭的 moveOnDoubleClick 双击移动参数与独立示例。
|
|
47
|
+
|
|
48
|
+
- Transfer 新增从源列表飞入目标列表的移动动效、落地高亮与效果/时长配置;覆盖按钮、拖拽和实例方法,限制可见代表项目数量,并清理连续移动、滚动和页面离开时的动画。
|
|
49
|
+
|
|
50
|
+
- Select 多选新增紧凑的全选/全不选工具栏、批量范围与文字配置、实例操作和批量事件;保留禁用值,遵守选择上限,支持筛选、远程结果、虚拟列表及键盘操作;多选默认折叠超过 3 个的标签,可显式设置 maxTagCount。
|
|
51
|
+
|
|
52
|
+
- 穿梭框拖拽目标去掉叠加的内阴影描边,保留单层高亮边框与背景反馈,避免滚动区域出现双重边线。
|
|
53
|
+
|
|
54
|
+
- 为选择、日期、补全、提及、颜色、提示、菜单及数据组件内的浮层统一增加可配置展开/收起动效与时长;补充交互示例,处理退出禁用、快速重开、减少动态效果、边缘定位和页面缓存清理。
|
|
55
|
+
|
|
56
|
+
- 修复 Chrome 中鼠标位于自适应高度表格时,纵向滚轮无法传给 Modal 等外层滚动容器的问题;保留表格横向滚动约束。
|
|
57
|
+
|
|
58
|
+
- Modal 拖拽采用按帧更新合成层位置,缓存手势边界并在结束后同步状态;默认柔和缩放,支持全屏/还原过渡及弹窗背景、遮罩的独立透明度,增加宽度预设与标题/底部分区尺寸,并优化缩放手柄及轻量拖动反馈。
|
|
59
|
+
|
|
60
|
+
- Modal 补充内置操作区、异步确认与取消、关闭拦截、失败重试、调用式服务、拖拽与尺寸调整、全屏切换、长内容滚动、快捷确认、挂载策略与焦点配置;统一嵌套层级、滚动锁定及子浮层清理,保留原有插槽和显示接口。
|
|
61
|
+
|
|
3
62
|
## 0.2.0
|
|
4
63
|
|
|
5
64
|
- Table 补充布局与表头行样式、多字段排序、选择单元格定制、筛选浮层控制与连续应用、展开图标及操作列配置、手动更新子行和独立视口行定位;保留现有参数、事件与默认行为。
|
package/README.md
CHANGED
|
@@ -1,96 +1,105 @@
|
|
|
1
1
|
# HYS UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
HYS UI 是面向管理后台和业务应用的 Vue 3 组件库。用它搭建筛选表单、数据列表和项目排期界面。组件支持按需导入、TypeScript 类型提示和主题定制。
|
|
4
4
|
|
|
5
|
-
[在线文档与交互示例](https://lampo1024.github.io/hys-ui/)
|
|
5
|
+
[在线文档与交互示例](https://lampo1024.github.io/hys-ui/) · [npm](https://www.npmjs.com/package/hys-ui) · [更新记录](https://github.com/lampo1024/hys-ui/blob/main/packages/ui/CHANGELOG.md)
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 按场景找组件
|
|
8
|
+
|
|
9
|
+
每个组件的文档都可以直接试用。展开示例即可复制 Vue 源码,属性、事件和插槽见该页的 API 参考。
|
|
10
|
+
|
|
11
|
+
| 场景 | 可以做什么 | 在线示例 |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| 表单与输入 | 配置字段联动、异步校验、远程搜索和多选。 | [表单](https://lampo1024.github.io/hys-ui/components/hys-form/) · [下拉选择](https://lampo1024.github.io/hys-ui/components/hys-select/) · [自动补全](https://lampo1024.github.io/hys-ui/components/hys-autocomplete/) |
|
|
14
|
+
| 层级与批量选择 | 按层级挑选分类,在两侧列表之间批量移动成员。 | [树形选择](https://lampo1024.github.io/hys-ui/components/hys-tree-select/) · [穿梭框](https://lampo1024.github.io/hys-ui/components/hys-transfer/) |
|
|
15
|
+
| 日期与排期 | 按日期或周筛选,拖动甘特任务、连接前置依赖、查看排期冲突。 | [日期选择](https://lampo1024.github.io/hys-ui/components/hys-date-picker/) · [日期范围](https://lampo1024.github.io/hys-ui/components/hys-date-range-picker/) · [甘特图](https://lampo1024.github.io/hys-ui/components/hys-gantt/) |
|
|
16
|
+
| 弹层与反馈 | 在对话框中编辑长表单,用抽屉查看详情,用轻提示反馈操作结果。 | [对话框](https://lampo1024.github.io/hys-ui/components/hys-modal/) · [抽屉](https://lampo1024.github.io/hys-ui/components/hys-drawer/) · [轻提示](https://lampo1024.github.io/hys-ui/components/hys-toast/) |
|
|
17
|
+
| 文件与进度 | 选择文件、控制上传队列,显示进度、失败和重试状态。 | [文件上传](https://lampo1024.github.io/hys-ui/components/hys-upload/) · [进度条](https://lampo1024.github.io/hys-ui/components/hys-progress/) |
|
|
18
|
+
|
|
19
|
+
### 三种表格怎么选
|
|
20
|
+
|
|
21
|
+
- **`HysTable`** 适合常规列表和树形数据。支持固定列、展开行、合并单元格、表尾汇总和分页。[表格示例](https://lampo1024.github.io/hys-ui/components/hys-table/)
|
|
22
|
+
- **`HysDataGrid`** 适合让用户自行筛选和整理数据。支持按列搜索、拖拽调整列顺序、列显隐、分组、CSV 导出和服务端查询。[高级表格示例](https://lampo1024.github.io/hys-ui/components/hys-data-grid/)
|
|
23
|
+
- **`HysVirtualTable`** 适合需要连续滚动的大数据列表。按视口渲染行,也可开启列虚拟化。支持固定行列和滚动加载。[虚拟表格示例](https://lampo1024.github.io/hys-ui/components/hys-virtual-table/)
|
|
24
|
+
|
|
25
|
+
例如,任务管理页可以用日期范围和多选下拉框筛选任务,用高级表格展示结果,用对话框编辑记录。需要调整计划时,可以在甘特图里拖动任务、查看前置依赖和撤销排期修改。
|
|
26
|
+
|
|
27
|
+
## 快速开始
|
|
28
|
+
|
|
29
|
+
适用于 Vue 3.5+ 浏览器应用。通过 ESM 命名导入使用组件,无需全局注册或安装 Vue Router。
|
|
8
30
|
|
|
9
31
|
```bash
|
|
10
32
|
npm install hys-ui
|
|
11
33
|
```
|
|
12
34
|
|
|
35
|
+
把下面的任务状态选择示例放到任意 Vue 页面即可运行。项目中可以把 `hys-ui/style.css` 移到应用入口统一导入。
|
|
36
|
+
|
|
13
37
|
```vue
|
|
14
38
|
<script setup lang="ts">
|
|
15
|
-
import {
|
|
39
|
+
import { ref } from 'vue'
|
|
40
|
+
import { HysSelect } from 'hys-ui'
|
|
16
41
|
import 'hys-ui/style.css'
|
|
42
|
+
|
|
43
|
+
const status = ref('all')
|
|
44
|
+
const options = [
|
|
45
|
+
{ label: '全部状态', value: 'all' },
|
|
46
|
+
{ label: '待办', value: 'todo' },
|
|
47
|
+
{ label: '进行中', value: 'in-progress' },
|
|
48
|
+
{ label: '已完成', value: 'done' },
|
|
49
|
+
]
|
|
17
50
|
</script>
|
|
18
51
|
|
|
19
52
|
<template>
|
|
20
|
-
<
|
|
53
|
+
<HysSelect v-model="status" :options="options" aria-label="任务状态" />
|
|
54
|
+
<p>当前状态值:{{ status }}</p>
|
|
21
55
|
</template>
|
|
22
56
|
```
|
|
23
57
|
|
|
24
|
-
|
|
58
|
+
## 用轻提示反馈操作结果
|
|
25
59
|
|
|
26
|
-
|
|
60
|
+
在组件的 `<script setup>` 里调用 `useHysToast()`,即可在保存、上传等操作后显示提示。下面用定时器模拟上传,完成后更新同一条消息。
|
|
27
61
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
```ts
|
|
62
|
+
```vue
|
|
63
|
+
<script setup lang="ts">
|
|
31
64
|
import { ref } from 'vue'
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
const theme = ref<HysTheme>('blue')
|
|
35
|
-
provideHysConfig({ theme, motion: 'subtle' })
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
主题支持 `blue / dark / green / purple / orange / forest`,动效支持 `full / subtle / off`,系统减少动态效果设置优先。组件库不会写入浏览器存储或修改全局页面主题。
|
|
39
|
-
|
|
40
|
-
可以使用 `--hys-ui-primary`、`--hys-ui-surface`、`--hys-ui-text`、`--hys-ui-border`、`--hys-ui-font-family` 等公开变量覆盖组件外观。组件类名与变量采用独立前缀,没有 body/html 全局重置。
|
|
65
|
+
import { HysButton, useHysToast } from 'hys-ui'
|
|
66
|
+
import 'hys-ui/style.css'
|
|
41
67
|
|
|
42
|
-
|
|
68
|
+
const toast = useHysToast()
|
|
69
|
+
const uploading = ref(false)
|
|
43
70
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
```
|
|
71
|
+
async function simulateUpload() {
|
|
72
|
+
uploading.value = true
|
|
73
|
+
const message = toast.loading('正在上传…')
|
|
48
74
|
|
|
49
|
-
|
|
75
|
+
await new Promise(resolve => setTimeout(resolve, 700))
|
|
50
76
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
77
|
+
message.update({ type: 'success', message: '上传完成', duration: 2000 })
|
|
78
|
+
uploading.value = false
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
55
81
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
npm test
|
|
60
|
-
npm run check:contracts
|
|
61
|
-
npm run check:release
|
|
82
|
+
<template>
|
|
83
|
+
<HysButton :loading="uploading" @click="simulateUpload">模拟上传</HysButton>
|
|
84
|
+
</template>
|
|
62
85
|
```
|
|
63
86
|
|
|
64
|
-
|
|
87
|
+
轻提示默认在顶部居中。可设置显示位置、停留时长和队列上限,也可以合并重复消息。[轻提示 API 与示例](https://lampo1024.github.io/hys-ui/components/hys-toast/)
|
|
65
88
|
|
|
66
|
-
##
|
|
89
|
+
## 主题与动效
|
|
67
90
|
|
|
68
|
-
|
|
91
|
+
在根组件的 `<script setup>` 中调用 `provideHysConfig`,下级组件及其浮层会继承配置。主题支持响应式切换。
|
|
69
92
|
|
|
70
93
|
```ts
|
|
71
|
-
import {
|
|
72
|
-
|
|
73
|
-
// 在组件 setup 中使用
|
|
74
|
-
const toast = useHysToast({ maxCount: 5 })
|
|
75
|
-
toast.success('保存成功')
|
|
76
|
-
const task = toast.loading('正在上传…')
|
|
77
|
-
task.update({ type: 'success', message: '上传完成', duration: 2000 })
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## 发布
|
|
81
|
-
|
|
82
|
-
根工作区和文档应用为私有,npm 包名为 `hys-ui`,版本 `0.2.0`,MIT 公开发布。
|
|
94
|
+
import { ref } from 'vue'
|
|
95
|
+
import { provideHysConfig, type HysTheme } from 'hys-ui'
|
|
83
96
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
npm login --registry=https://registry.npmjs.org/
|
|
87
|
-
npm run release:ui
|
|
97
|
+
const theme = ref<HysTheme>('blue')
|
|
98
|
+
provideHysConfig({ theme, motion: 'subtle' })
|
|
88
99
|
```
|
|
89
100
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
后续版本按语义化版本发布,并更新 CHANGELOG。暂不承诺 SSR/Nuxt 支持。
|
|
101
|
+
内置主题有 `blue`、`dark`、`green`、`purple`、`orange` 和 `forest`。可用 `--hys-ui-primary`、`--hys-ui-surface` 等 CSS 变量调整外观。动效可设为 `full`、`subtle` 或 `off`,并遵循系统的减少动态效果设置。支持浮层动效的组件还可以单独设置 `popup-transition` 和 `popup-transition-duration`。
|
|
93
102
|
|
|
94
|
-
##
|
|
103
|
+
## 源码与问题反馈
|
|
95
104
|
|
|
96
|
-
[MIT](LICENSE)
|
|
105
|
+
[GitHub 仓库](https://github.com/lampo1024/hys-ui) · [提交问题](https://github.com/lampo1024/hys-ui/issues) · [MIT 许可证](https://github.com/lampo1024/hys-ui/blob/main/LICENSE)
|
|
@@ -1,56 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
__name: "HysAlert",
|
|
6
|
-
props: {
|
|
7
|
-
tone: { default: "info" },
|
|
8
|
-
title: {},
|
|
9
|
-
description: {},
|
|
10
|
-
closable: { type: Boolean },
|
|
11
|
-
showIcon: { type: Boolean },
|
|
12
|
-
center: { type: Boolean },
|
|
13
|
-
visible: { type: Boolean, default: void 0 }
|
|
14
|
-
},
|
|
15
|
-
emits: ["close", "update:visible"],
|
|
16
|
-
setup(e, { emit: y }) {
|
|
17
|
-
const f = V(), r = e, a = y, n = k(!0), v = C(() => r.visible ?? n.value);
|
|
18
|
-
g(() => r.title, () => n.value = !0);
|
|
19
|
-
function h() {
|
|
20
|
-
n.value = !1, a("update:visible", !1), a("close");
|
|
21
|
-
}
|
|
22
|
-
return (i, H) => v.value ? (o(), s("div", B({ key: 0 }, t(f), {
|
|
23
|
-
class: ["hys-ui-ex-alert", "hys-ui-ex-" + e.tone],
|
|
24
|
-
role: e.tone === "danger" ? "alert" : "status",
|
|
25
|
-
style: { justifyContent: e.center ? "center" : void 0 }
|
|
26
|
-
}), [
|
|
27
|
-
e.showIcon ? (o(), w(A(e.tone === "success" ? t(I) : e.tone === "warning" ? t($) : e.tone === "danger" ? t(p) : t(x)), {
|
|
28
|
-
key: 0,
|
|
29
|
-
size: 18
|
|
30
|
-
})) : l("", !0),
|
|
31
|
-
c("div", null, [
|
|
32
|
-
e.title || i.$slots.title ? (o(), s("strong", E, [
|
|
33
|
-
u(i.$slots, "title", {}, () => [
|
|
34
|
-
d(m(e.title), 1)
|
|
35
|
-
])
|
|
36
|
-
])) : l("", !0),
|
|
37
|
-
c("div", null, [
|
|
38
|
-
u(i.$slots, "default", {}, () => [
|
|
39
|
-
d(m(e.description), 1)
|
|
40
|
-
])
|
|
41
|
-
])
|
|
42
|
-
]),
|
|
43
|
-
e.closable ? (o(), s("button", {
|
|
44
|
-
key: 1,
|
|
45
|
-
type: "button",
|
|
46
|
-
"aria-label": "关闭提示",
|
|
47
|
-
onClick: h
|
|
48
|
-
}, [
|
|
49
|
-
N(t(z), { size: 14 })
|
|
50
|
-
])) : l("", !0)
|
|
51
|
-
], 16, D)) : l("", !0);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
1
|
+
import o from "./HysAlert2.vue.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-aa88a78b"]]);
|
|
54
5
|
export {
|
|
55
|
-
|
|
6
|
+
p as default
|
|
56
7
|
};
|
|
@@ -1,4 +1,161 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as z, useSlots as T, useAttrs as V, computed as h, openBlock as l, createBlock as v, Transition as $, unref as a, withCtx as E, createElementBlock as o, mergeProps as x, renderSlot as s, normalizeProps as r, guardReactiveProps as n, resolveDynamicComponent as D, createCommentVNode as u, createElementVNode as I, createTextVNode as g, toDisplayString as m } from "vue";
|
|
2
|
+
import { Info as B, CircleAlert as N, TriangleAlert as P, CircleCheck as S, LoaderCircle as R, X as q } from "lucide-vue-next";
|
|
3
|
+
import { useAlert as H } from "../../composables/useAlert.js";
|
|
4
|
+
const X = ["data-effect", "role", "aria-label", "aria-live", "aria-atomic", "aria-busy"], j = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "hys-ui-alert-icon",
|
|
7
|
+
"aria-hidden": "true"
|
|
8
|
+
}, F = { class: "hys-ui-alert-content" }, G = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "hys-ui-alert-title"
|
|
11
|
+
}, J = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "hys-ui-alert-description"
|
|
14
|
+
}, K = {
|
|
15
|
+
key: 1,
|
|
16
|
+
class: "hys-ui-alert-action"
|
|
17
|
+
}, M = ["aria-label", "disabled"], O = { key: 0 }, Y = /* @__PURE__ */ z({
|
|
18
|
+
inheritAttrs: !1,
|
|
19
|
+
__name: "HysAlert",
|
|
20
|
+
props: {
|
|
21
|
+
tone: {},
|
|
22
|
+
title: {},
|
|
23
|
+
description: {},
|
|
24
|
+
closable: { type: Boolean },
|
|
25
|
+
showIcon: { type: Boolean, default: void 0 },
|
|
26
|
+
center: { type: Boolean },
|
|
27
|
+
visible: { type: Boolean, default: void 0 },
|
|
28
|
+
modelValue: { type: Boolean, default: void 0 },
|
|
29
|
+
defaultVisible: { type: Boolean, default: !0 },
|
|
30
|
+
effect: { default: "light" },
|
|
31
|
+
banner: { type: Boolean },
|
|
32
|
+
bordered: { type: Boolean, default: !0 },
|
|
33
|
+
size: { default: "md" },
|
|
34
|
+
closeText: {},
|
|
35
|
+
closeLabel: { default: "关闭提示" },
|
|
36
|
+
disabled: { type: Boolean },
|
|
37
|
+
beforeClose: {},
|
|
38
|
+
transition: { default: "fade" },
|
|
39
|
+
transitionDuration: { default: 180 },
|
|
40
|
+
appear: { type: Boolean },
|
|
41
|
+
ariaLabel: {},
|
|
42
|
+
ariaLive: {},
|
|
43
|
+
ariaAtomic: { type: Boolean, default: !0 }
|
|
44
|
+
},
|
|
45
|
+
emits: ["close", "update:visible", "update:modelValue", "visibleChange", "closeRequest", "closeError", "afterClose"],
|
|
46
|
+
setup(t, { expose: k, emit: L }) {
|
|
47
|
+
const b = t, C = L, c = T(), p = V(), e = H(b, (i, ...d) => C(i, ...d)), A = h(
|
|
48
|
+
() => ({
|
|
49
|
+
success: S,
|
|
50
|
+
warning: P,
|
|
51
|
+
danger: N,
|
|
52
|
+
info: B,
|
|
53
|
+
primary: B
|
|
54
|
+
})[e.tone.value]
|
|
55
|
+
), y = h(
|
|
56
|
+
() => !!(b.description || c.default || c.description)
|
|
57
|
+
), w = h(
|
|
58
|
+
() => ({
|
|
59
|
+
info: "var(--hys-ui-info,#3867f5)",
|
|
60
|
+
primary: "var(--hys-ui-primary,var(--hys-ui-theme-primary))",
|
|
61
|
+
success: "var(--hys-ui-success,#16a46e)",
|
|
62
|
+
warning: "var(--hys-ui-warning,#d9860c)",
|
|
63
|
+
danger: "var(--hys-ui-red,var(--hys-ui-theme-red,#ed4556))"
|
|
64
|
+
})[e.tone.value]
|
|
65
|
+
);
|
|
66
|
+
return k({
|
|
67
|
+
element: e.element,
|
|
68
|
+
visible: e.visible,
|
|
69
|
+
closing: e.closing,
|
|
70
|
+
close: () => e.close(),
|
|
71
|
+
show: e.show
|
|
72
|
+
}), (i, d) => (l(), v($, {
|
|
73
|
+
name: "hys-ui-alert-" + t.transition,
|
|
74
|
+
css: a(e).duration.value > 0,
|
|
75
|
+
duration: a(e).duration.value,
|
|
76
|
+
appear: t.appear,
|
|
77
|
+
onBeforeLeave: a(e).beforeLeave,
|
|
78
|
+
onAfterLeave: a(e).afterLeave,
|
|
79
|
+
onBeforeEnter: a(e).restore,
|
|
80
|
+
onLeaveCancelled: a(e).restore
|
|
81
|
+
}, {
|
|
82
|
+
default: E(() => [
|
|
83
|
+
a(e).visible.value ? (l(), o("div", x({
|
|
84
|
+
key: 0,
|
|
85
|
+
ref: (f) => a(e).element.value = f
|
|
86
|
+
}, { ...a(e).skin.value, ...a(p) }, {
|
|
87
|
+
class: ["hys-ui-ex-alert hys-ui-alert-panel", [
|
|
88
|
+
"hys-ui-ex-" + a(e).tone.value,
|
|
89
|
+
"hys-ui-alert-" + t.size,
|
|
90
|
+
{
|
|
91
|
+
"hys-ui-alert-banner": t.banner,
|
|
92
|
+
"hys-ui-alert-center": t.center,
|
|
93
|
+
"hys-ui-alert-bordered": t.bordered,
|
|
94
|
+
"hys-ui-alert-description": y.value
|
|
95
|
+
}
|
|
96
|
+
]],
|
|
97
|
+
"data-effect": t.effect,
|
|
98
|
+
style: {
|
|
99
|
+
"--hys-ui-alert-color": w.value,
|
|
100
|
+
"--hys-ui-alert-duration": a(e).duration.value + "ms"
|
|
101
|
+
},
|
|
102
|
+
role: a(p).role || (a(e).tone.value === "danger" ? "alert" : "status"),
|
|
103
|
+
"aria-label": t.ariaLabel,
|
|
104
|
+
"aria-live": t.ariaLive,
|
|
105
|
+
"aria-atomic": t.ariaAtomic,
|
|
106
|
+
"aria-busy": a(e).closing.value || void 0
|
|
107
|
+
}), [
|
|
108
|
+
t.showIcon ?? t.banner ? (l(), o("span", j, [
|
|
109
|
+
s(i.$slots, "icon", r(n(a(e).scope.value)), () => [
|
|
110
|
+
(l(), v(D(A.value), {
|
|
111
|
+
size: y.value ? 22 : 18
|
|
112
|
+
}, null, 8, ["size"]))
|
|
113
|
+
], !0)
|
|
114
|
+
])) : u("", !0),
|
|
115
|
+
I("div", F, [
|
|
116
|
+
t.title || c.title ? (l(), o("strong", G, [
|
|
117
|
+
s(i.$slots, "title", r(n(a(e).scope.value)), () => [
|
|
118
|
+
g(m(t.title), 1)
|
|
119
|
+
], !0)
|
|
120
|
+
])) : u("", !0),
|
|
121
|
+
y.value ? (l(), o("div", J, [
|
|
122
|
+
s(i.$slots, "default", r(n(a(e).scope.value)), () => [
|
|
123
|
+
s(i.$slots, "description", r(n(a(e).scope.value)), () => [
|
|
124
|
+
g(m(t.description), 1)
|
|
125
|
+
], !0)
|
|
126
|
+
], !0)
|
|
127
|
+
])) : u("", !0)
|
|
128
|
+
]),
|
|
129
|
+
c.action ? (l(), o("div", K, [
|
|
130
|
+
s(i.$slots, "action", r(n(a(e).scope.value)), void 0, !0)
|
|
131
|
+
])) : u("", !0),
|
|
132
|
+
t.closable ? (l(), o("button", {
|
|
133
|
+
key: 2,
|
|
134
|
+
type: "button",
|
|
135
|
+
class: "hys-ui-alert-close",
|
|
136
|
+
"aria-label": t.closeLabel,
|
|
137
|
+
disabled: t.disabled || a(e).closing.value,
|
|
138
|
+
onClick: d[0] || (d[0] = (f) => a(e).close("button", f))
|
|
139
|
+
}, [
|
|
140
|
+
a(e).closing.value ? (l(), v(a(R), {
|
|
141
|
+
key: 0,
|
|
142
|
+
class: "hys-ui-alert-spinner",
|
|
143
|
+
size: 16,
|
|
144
|
+
"aria-hidden": "true"
|
|
145
|
+
})) : s(i.$slots, "close-icon", r(n(a(e).scope.value)), () => [
|
|
146
|
+
t.closeText ? (l(), o("span", O, m(t.closeText), 1)) : (l(), v(a(q), {
|
|
147
|
+
key: 1,
|
|
148
|
+
size: 16,
|
|
149
|
+
"aria-hidden": "true"
|
|
150
|
+
}))
|
|
151
|
+
], !0, 1)
|
|
152
|
+
], 8, M)) : u("", !0)
|
|
153
|
+
], 16, X)) : u("", !0)
|
|
154
|
+
]),
|
|
155
|
+
_: 3
|
|
156
|
+
}, 8, ["name", "css", "duration", "appear", "onBeforeLeave", "onAfterLeave", "onBeforeEnter", "onLeaveCancelled"]));
|
|
157
|
+
}
|
|
158
|
+
});
|
|
2
159
|
export {
|
|
3
|
-
|
|
160
|
+
Y as default
|
|
4
161
|
};
|
|
@@ -1,43 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
__name: "HysAnimatedNumber",
|
|
6
|
-
props: {
|
|
7
|
-
value: {},
|
|
8
|
-
duration: { default: 650 },
|
|
9
|
-
decimals: { default: 0 }
|
|
10
|
-
},
|
|
11
|
-
setup(o) {
|
|
12
|
-
const l = H(), { effectiveMotion: u } = R(), t = o, n = b(Number.isFinite(t.value) ? t.value : 0);
|
|
13
|
-
let a = 0, r = !0;
|
|
14
|
-
function i(e) {
|
|
15
|
-
return Number.isFinite(e) ? e : 0;
|
|
16
|
-
}
|
|
17
|
-
function f(e) {
|
|
18
|
-
if (e = i(e), cancelAnimationFrame(a), u.value === "off" || !Number.isFinite(t.duration) || t.duration <= 0) {
|
|
19
|
-
n.value = e;
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
const s = n.value, v = performance.now(), h = Math.max(1, t.duration);
|
|
23
|
-
function m(p) {
|
|
24
|
-
const c = Math.min(1, (p - v) / h), F = 1 - Math.pow(1 - c, 3);
|
|
25
|
-
n.value = s + (e - s) * F, c < 1 && (a = requestAnimationFrame(m));
|
|
26
|
-
}
|
|
27
|
-
a = requestAnimationFrame(m);
|
|
28
|
-
}
|
|
29
|
-
return M(() => [t.value, t.duration, u.value], ([e]) => {
|
|
30
|
-
r ? f(e) : n.value = i(e);
|
|
31
|
-
}), x(() => {
|
|
32
|
-
r = !1, cancelAnimationFrame(a);
|
|
33
|
-
}), y(() => {
|
|
34
|
-
r = !0, n.value = i(t.value);
|
|
35
|
-
}), N(() => cancelAnimationFrame(a)), (e, d) => (w(), B("span", k(q(l), {
|
|
36
|
-
class: "hys-ui-motion-number",
|
|
37
|
-
"aria-label": String(i(o.value))
|
|
38
|
-
}), D(n.value.toFixed(Number.isFinite(o.decimals) ? Math.max(0, Math.min(5, Math.floor(o.decimals))) : 0)), 17, S));
|
|
39
|
-
}
|
|
40
|
-
});
|
|
1
|
+
import o from "./HysAnimatedNumber2.vue.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-11d35ec9"]]);
|
|
41
5
|
export {
|
|
42
|
-
|
|
6
|
+
a as default
|
|
43
7
|
};
|
|
@@ -1,4 +1,148 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as Z, useSlots as _, ref as G, watch as E, computed as c, onMounted as ee, onActivated as te, onDeactivated as ne, onBeforeUnmount as ae, openBlock as m, createElementBlock as v, mergeProps as ie, unref as b, renderSlot as x, createTextVNode as M, toDisplayString as N, createCommentVNode as V, createElementVNode as oe, normalizeStyle as re, normalizeProps as $, guardReactiveProps as C, createBlock as se, Fragment as ue } from "vue";
|
|
2
|
+
import { useHysRootAttrs as le } from "../../config.js";
|
|
3
|
+
import { useMotion as ce } from "../../motion/useMotion.js";
|
|
4
|
+
import { decimal as me, decimalText as I, decimalRound as de } from "../../composables/numberInput.js";
|
|
5
|
+
const fe = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "hys-ui-motion-number-title"
|
|
8
|
+
}, ve = ["role"], pe = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "hys-ui-motion-number-affix"
|
|
11
|
+
}, he = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "hys-ui-motion-number-affix"
|
|
14
|
+
}, xe = /* @__PURE__ */ Z({
|
|
15
|
+
__name: "HysAnimatedNumber",
|
|
16
|
+
props: {
|
|
17
|
+
value: { default: 0 },
|
|
18
|
+
duration: { default: 650 },
|
|
19
|
+
decimals: {},
|
|
20
|
+
precision: {},
|
|
21
|
+
groupSeparator: {},
|
|
22
|
+
decimalSeparator: { default: "." },
|
|
23
|
+
title: {},
|
|
24
|
+
prefix: {},
|
|
25
|
+
suffix: {},
|
|
26
|
+
valueStyle: { type: [Boolean, null, String, Object, Array] },
|
|
27
|
+
formatter: {},
|
|
28
|
+
deadline: {},
|
|
29
|
+
format: { default: "HH:mm:ss" }
|
|
30
|
+
},
|
|
31
|
+
emits: ["change", "finish"],
|
|
32
|
+
setup(r, { expose: L, emit: U }) {
|
|
33
|
+
const t = r, j = U, A = _(), X = le(), { effectiveMotion: P } = ce(), F = (e) => typeof e == "number" && !Number.isFinite(e) ? 0 : e, s = G(F(t.value));
|
|
34
|
+
let p = 0, d = !1;
|
|
35
|
+
function q() {
|
|
36
|
+
if (cancelAnimationFrame(p), !d) return;
|
|
37
|
+
const e = F(t.value), n = s.value, u = t.duration;
|
|
38
|
+
if (typeof e != "number" || typeof n != "number" || n === e || t.deadline !== void 0 || P.value === "off" || !Number.isFinite(u) || u <= 0) {
|
|
39
|
+
s.value = e;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const a = performance.now(), o = (l) => {
|
|
43
|
+
const R = Math.max(0, Math.min(1, (l - a) / u)), W = 1 - (1 - R) ** 3;
|
|
44
|
+
s.value = R === 1 ? e : n * (1 - W) + e * W, R < 1 && (p = requestAnimationFrame(o));
|
|
45
|
+
};
|
|
46
|
+
p = requestAnimationFrame(o);
|
|
47
|
+
}
|
|
48
|
+
E([() => t.value, () => t.duration, P], q);
|
|
49
|
+
const f = c(() => {
|
|
50
|
+
const e = t.deadline instanceof Date ? t.deadline.getTime() : t.deadline;
|
|
51
|
+
return e !== void 0 && Number.isFinite(e) ? e : void 0;
|
|
52
|
+
}), w = () => f.value === void 0 ? 0 : Math.max(
|
|
53
|
+
0,
|
|
54
|
+
Math.min(Number.MAX_SAFE_INTEGER, f.value - Date.now())
|
|
55
|
+
), i = G(w()), D = c(
|
|
56
|
+
() => t.format.match(/\[[^\]]*\]|SSS|DD?|HH?|mm?|ss?|[\s\S]/g) ?? []
|
|
57
|
+
), h = c(() => D.value.includes("SSS"));
|
|
58
|
+
let H, T, k;
|
|
59
|
+
function y() {
|
|
60
|
+
if (clearTimeout(H), !d || f.value === void 0) return;
|
|
61
|
+
const e = f.value;
|
|
62
|
+
if (i.value = w(), i.value !== k && (k = i.value, j("change", i.value)), i.value === 0) {
|
|
63
|
+
T !== e && (T = e, j("finish"));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const n = h.value ? 16 : 1e3;
|
|
67
|
+
H = setTimeout(
|
|
68
|
+
y,
|
|
69
|
+
h.value ? n : i.value % n || n
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
E(f, () => {
|
|
73
|
+
T = void 0, k = void 0, i.value = w(), q(), y();
|
|
74
|
+
}), E(h, y);
|
|
75
|
+
function z() {
|
|
76
|
+
d || (d = !0, s.value = F(t.value), y());
|
|
77
|
+
}
|
|
78
|
+
function O() {
|
|
79
|
+
d = !1, clearTimeout(H), cancelAnimationFrame(p);
|
|
80
|
+
}
|
|
81
|
+
ee(z), te(z), ne(O), ae(O);
|
|
82
|
+
const J = c(() => {
|
|
83
|
+
const e = t.precision ?? t.decimals;
|
|
84
|
+
return e === void 0 && typeof s.value == "string" ? void 0 : e !== void 0 && Number.isFinite(e) ? Math.max(0, Math.min(20, Math.floor(e))) : 0;
|
|
85
|
+
});
|
|
86
|
+
function K() {
|
|
87
|
+
const e = me(s.value);
|
|
88
|
+
if (!e) return String(s.value);
|
|
89
|
+
const n = J.value, u = n === void 0 ? I(e) : I(de(e, n), n), [a, o] = u.split("."), l = t.groupSeparator ? a.replace(/\B(?=(\d{3})+(?!\d))/g, () => t.groupSeparator) : a;
|
|
90
|
+
return o === void 0 ? l : l + t.decimalSeparator + o;
|
|
91
|
+
}
|
|
92
|
+
function Q() {
|
|
93
|
+
let e = h.value ? Math.floor(i.value) : Math.ceil(i.value / 1e3) * 1e3;
|
|
94
|
+
const n = { D: 864e5, H: 36e5, m: 6e4, s: 1e3, S: 1 }, u = /* @__PURE__ */ new Map();
|
|
95
|
+
for (const [a, o] of Object.entries(n))
|
|
96
|
+
D.value.some(
|
|
97
|
+
(l) => l[0] === a && /^(D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS)$/.test(l)
|
|
98
|
+
) && (u.set(a, Math.floor(e / o)), e %= o);
|
|
99
|
+
return D.value.map((a) => {
|
|
100
|
+
if (a.startsWith("[") && a.endsWith("]"))
|
|
101
|
+
return a.slice(1, -1);
|
|
102
|
+
const o = u.get(a[0]);
|
|
103
|
+
return o === void 0 ? a : String(o).padStart(a.length, "0");
|
|
104
|
+
}).join("");
|
|
105
|
+
}
|
|
106
|
+
const S = c(() => t.deadline !== void 0), B = c(
|
|
107
|
+
() => S.value ? Q() : K()
|
|
108
|
+
), g = c(() => ({
|
|
109
|
+
value: S.value ? i.value : s.value,
|
|
110
|
+
displayValue: B.value,
|
|
111
|
+
remaining: S.value ? i.value : void 0
|
|
112
|
+
})), Y = ({ value: e }) => e;
|
|
113
|
+
return L({ displayValue: B, remaining: i }), (e, n) => (m(), v("span", ie(b(X), { class: "hys-ui-motion-number" }), [
|
|
114
|
+
r.title || b(A).title ? (m(), v("span", fe, [
|
|
115
|
+
x(e.$slots, "title", {}, () => [
|
|
116
|
+
M(N(r.title), 1)
|
|
117
|
+
], !0)
|
|
118
|
+
])) : V("", !0),
|
|
119
|
+
oe("span", {
|
|
120
|
+
class: "hys-ui-motion-number-value",
|
|
121
|
+
style: re(r.valueStyle),
|
|
122
|
+
role: S.value ? "timer" : void 0
|
|
123
|
+
}, [
|
|
124
|
+
r.prefix || b(A).prefix ? (m(), v("span", pe, [
|
|
125
|
+
x(e.$slots, "prefix", $(C(g.value)), () => [
|
|
126
|
+
M(N(r.prefix), 1)
|
|
127
|
+
], !0)
|
|
128
|
+
])) : V("", !0),
|
|
129
|
+
x(e.$slots, "formatter", $(C(g.value)), () => [
|
|
130
|
+
r.formatter ? (m(), se(Y, {
|
|
131
|
+
key: 0,
|
|
132
|
+
value: r.formatter(g.value)
|
|
133
|
+
}, null, 8, ["value"])) : (m(), v(ue, { key: 1 }, [
|
|
134
|
+
M(N(B.value), 1)
|
|
135
|
+
], 64))
|
|
136
|
+
], !0),
|
|
137
|
+
r.suffix || b(A).suffix ? (m(), v("span", he, [
|
|
138
|
+
x(e.$slots, "suffix", $(C(g.value)), () => [
|
|
139
|
+
M(N(r.suffix), 1)
|
|
140
|
+
], !0)
|
|
141
|
+
])) : V("", !0)
|
|
142
|
+
], 12, ve)
|
|
143
|
+
], 16));
|
|
144
|
+
}
|
|
145
|
+
});
|
|
2
146
|
export {
|
|
3
|
-
|
|
147
|
+
xe as default
|
|
4
148
|
};
|