x-next 1.19.3 → 1.19.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/AI_USAGE/catalog.md +1 -1
  2. package/AI_USAGE/components/alert-api.md +1 -1
  3. package/AI_USAGE/components/alert.md +1 -1
  4. package/AI_USAGE/components/bar-chart-api.md +1 -1
  5. package/AI_USAGE/components/bar-chart.md +1 -1
  6. package/AI_USAGE/components/boxicons.md +1 -1
  7. package/AI_USAGE/components/button-api.md +1 -1
  8. package/AI_USAGE/components/button.md +1 -1
  9. package/AI_USAGE/components/charts.md +1 -1
  10. package/AI_USAGE/components/checkbox-api.md +1 -1
  11. package/AI_USAGE/components/checkbox.md +1 -1
  12. package/AI_USAGE/components/color-picker-api.md +1 -1
  13. package/AI_USAGE/components/color-picker.md +1 -1
  14. package/AI_USAGE/components/config-provider-api.md +1 -1
  15. package/AI_USAGE/components/config-provider.md +1 -1
  16. package/AI_USAGE/components/date-picker-api.md +1 -1
  17. package/AI_USAGE/components/date-picker.md +1 -1
  18. package/AI_USAGE/components/dialog-api.md +1 -1
  19. package/AI_USAGE/components/dialog.md +36 -1
  20. package/AI_USAGE/components/draggable-api.md +1 -1
  21. package/AI_USAGE/components/draggable.md +1 -1
  22. package/AI_USAGE/components/drawer-api.md +1 -1
  23. package/AI_USAGE/components/drawer.md +1 -1
  24. package/AI_USAGE/components/dropdown-api.md +1 -1
  25. package/AI_USAGE/components/dropdown.md +1 -1
  26. package/AI_USAGE/components/empty-api.md +1 -1
  27. package/AI_USAGE/components/empty.md +1 -1
  28. package/AI_USAGE/components/finicon.md +1 -1
  29. package/AI_USAGE/components/form-api.md +1 -1
  30. package/AI_USAGE/components/form.md +1 -1
  31. package/AI_USAGE/components/grid-api.md +1 -1
  32. package/AI_USAGE/components/grid.md +1 -1
  33. package/AI_USAGE/components/heatmap-api.md +1 -1
  34. package/AI_USAGE/components/heatmap.md +1 -1
  35. package/AI_USAGE/components/icon-api.md +1 -1
  36. package/AI_USAGE/components/icon.md +1 -1
  37. package/AI_USAGE/components/image-api.md +1 -1
  38. package/AI_USAGE/components/image.md +1 -1
  39. package/AI_USAGE/components/input-api.md +1 -1
  40. package/AI_USAGE/components/input-number-api.md +1 -1
  41. package/AI_USAGE/components/input-number.md +1 -1
  42. package/AI_USAGE/components/input-tag-api.md +1 -1
  43. package/AI_USAGE/components/input-tag.md +3 -1
  44. package/AI_USAGE/components/input.md +1 -1
  45. package/AI_USAGE/components/layout-api.md +1 -1
  46. package/AI_USAGE/components/layout.md +1 -1
  47. package/AI_USAGE/components/line-chart-api.md +1 -1
  48. package/AI_USAGE/components/line-chart.md +1 -1
  49. package/AI_USAGE/components/link-api.md +1 -1
  50. package/AI_USAGE/components/link.md +1 -1
  51. package/AI_USAGE/components/menu-api.md +1 -1
  52. package/AI_USAGE/components/menu.md +1 -1
  53. package/AI_USAGE/components/message-api.md +1 -1
  54. package/AI_USAGE/components/message-box-api.md +1 -1
  55. package/AI_USAGE/components/message-box.md +5 -1
  56. package/AI_USAGE/components/message.md +3 -1
  57. package/AI_USAGE/components/network-api.md +1 -1
  58. package/AI_USAGE/components/network.md +1 -1
  59. package/AI_USAGE/components/notification-api.md +1 -1
  60. package/AI_USAGE/components/notification.md +3 -1
  61. package/AI_USAGE/components/pagination-api.md +1 -1
  62. package/AI_USAGE/components/pagination.md +1 -1
  63. package/AI_USAGE/components/pie-chart-api.md +1 -1
  64. package/AI_USAGE/components/pie-chart.md +1 -1
  65. package/AI_USAGE/components/popconfirm-api.md +1 -1
  66. package/AI_USAGE/components/popconfirm.md +1 -1
  67. package/AI_USAGE/components/popover-api.md +1 -1
  68. package/AI_USAGE/components/popover.md +1 -1
  69. package/AI_USAGE/components/popup-api.md +1 -1
  70. package/AI_USAGE/components/popup.md +1 -1
  71. package/AI_USAGE/components/progress-api.md +1 -1
  72. package/AI_USAGE/components/progress.md +1 -1
  73. package/AI_USAGE/components/radio-api.md +1 -1
  74. package/AI_USAGE/components/radio.md +1 -1
  75. package/AI_USAGE/components/rate-api.md +1 -1
  76. package/AI_USAGE/components/rate.md +1 -1
  77. package/AI_USAGE/components/resize-box-api.md +1 -1
  78. package/AI_USAGE/components/resize-box.md +1 -1
  79. package/AI_USAGE/components/scrollbar-api.md +1 -1
  80. package/AI_USAGE/components/scrollbar.md +1 -1
  81. package/AI_USAGE/components/select-api.md +1 -1
  82. package/AI_USAGE/components/select.md +1 -1
  83. package/AI_USAGE/components/skeleton-api.md +1 -1
  84. package/AI_USAGE/components/skeleton.md +1 -1
  85. package/AI_USAGE/components/slider-api.md +1 -1
  86. package/AI_USAGE/components/slider.md +1 -1
  87. package/AI_USAGE/components/space-api.md +1 -1
  88. package/AI_USAGE/components/space.md +1 -1
  89. package/AI_USAGE/components/spin-api.md +2 -2
  90. package/AI_USAGE/components/spin.md +133 -25
  91. package/AI_USAGE/components/steps-api.md +1 -1
  92. package/AI_USAGE/components/steps.md +1 -1
  93. package/AI_USAGE/components/switch-api.md +1 -1
  94. package/AI_USAGE/components/switch.md +1 -1
  95. package/AI_USAGE/components/table-api.md +1 -1
  96. package/AI_USAGE/components/table.md +1 -1
  97. package/AI_USAGE/components/tabs-api.md +1 -1
  98. package/AI_USAGE/components/tabs.md +1 -1
  99. package/AI_USAGE/components/tag-api.md +1 -1
  100. package/AI_USAGE/components/tag.md +1 -1
  101. package/AI_USAGE/components/textarea-api.md +1 -1
  102. package/AI_USAGE/components/textarea.md +1 -1
  103. package/AI_USAGE/components/time-picker-api.md +1 -1
  104. package/AI_USAGE/components/time-picker.md +1 -1
  105. package/AI_USAGE/components/time-range-selector-api.md +1 -1
  106. package/AI_USAGE/components/time-range-selector.md +1 -1
  107. package/AI_USAGE/components/timeline-api.md +1 -1
  108. package/AI_USAGE/components/timeline.md +1 -1
  109. package/AI_USAGE/components/tooltip-api.md +1 -1
  110. package/AI_USAGE/components/tooltip.md +1 -1
  111. package/AI_USAGE/components/transfer-api.md +1 -1
  112. package/AI_USAGE/components/transfer.md +1 -1
  113. package/AI_USAGE/components/tree-select-api.md +1 -1
  114. package/AI_USAGE/components/tree-select.md +1 -1
  115. package/AI_USAGE/components/trend-chart-api.md +1 -1
  116. package/AI_USAGE/components/trend-chart.md +1 -1
  117. package/AI_USAGE/components/trigger-api.md +1 -1
  118. package/AI_USAGE/components/trigger.md +1 -1
  119. package/AI_USAGE/components/upload-api.md +1 -1
  120. package/AI_USAGE/components/upload.md +1 -1
  121. package/AI_USAGE/components/virtual-list-api.md +1 -1
  122. package/AI_USAGE/components/virtual-list.md +1 -1
  123. package/AI_USAGE/components/watermark-api.md +1 -1
  124. package/AI_USAGE/components/watermark.md +1 -1
  125. package/AI_USAGE/core.md +1 -1
  126. package/AI_USAGE/index.md +1 -1
  127. package/AI_USAGE/recipes/form-on-demand.md +1 -1
  128. package/AI_USAGE.md +178 -25
  129. package/CHANGELOG.md +16 -0
  130. package/dist/es/components/dialog/Dialog.js +8 -8
  131. package/dist/es/components/spin/Spin.js +80 -72
  132. package/dist/es/style.css +1 -1
  133. package/dist/index.cjs +3 -3
  134. package/dist/index.umd.js +3 -3
  135. package/dist/style/base.css +1 -1
  136. package/dist/style/dialog.css +1 -1
  137. package/dist/style/message-box.css +1 -1
  138. package/dist/style/notification.css +1 -1
  139. package/dist/style/spin.css +1 -1
  140. package/dist/style.css +1 -1
  141. package/package.json +4 -2
package/AI_USAGE.md CHANGED
@@ -1,9 +1,9 @@
1
1
  <!-- Generated by pnpm generate:ai-usage. Edit script/ai-usage/content.md and script/ai-usage/. -->
2
2
  # x-next AI 使用手册
3
3
 
4
- 适用版本:**x-next@1.19.3**。Vue:`^3.5.0`;Node:`>=20.19.0`。
4
+ 适用版本:**x-next@1.19.5**。Vue:`^3.5.0`;Node:`>=20.19.0`。
5
5
 
6
- 来源指纹(AI 行为说明、docs 导入快照、映射、样式依赖、版本、公开类型和 API 参考):`f3b779a732be1a02a783baae450286760e6569d94ca305ef0c2bfcf13c6dc47e`。
6
+ 来源指纹(AI 行为说明、docs 导入快照、映射、样式依赖、版本、公开类型和 API 参考):`1b48d4f58ef2afb4eb4258a1b03525620e41dd50e96d33ab6bf9724f6524b3da`。
7
7
 
8
8
  覆盖 60 个组件族与 107 个公开组件/服务导出。优先通过 [本地按需索引](./AI_USAGE/index.md) 读取组件页和 API,不为查本包用法默认搜索网络。
9
9
 
@@ -537,6 +537,8 @@ function restore() { visible.value = true; feedback.value = '提示显示中'; }
537
537
 
538
538
  声明式组件默认 `center=false`、`top='100px'`,`top` 仅在非居中、非全屏时生效;命令式 `Dialog(options)` 保持默认居中,其服务默认 `top=0`。
539
539
 
540
+ 默认入场和离场只改变透明度,不缩放内容。`opened` / `closed` 在过渡完成后触发;系统减少动态效果会缩短过渡,但不改变 `modelValue`、业务关闭拦截或焦点恢复契约。
541
+
540
542
  `title`、默认正文、`footer` 是公开插槽,默认不生成业务按钮。`close(action, event?)` 的 action 为 `'cancel' | 'ok'`,`closed` 表示关闭动画结束;直接改模型不会调用业务取消逻辑。根入口服务 `Dialog(options)` 返回 `close()` / `update(options)` 句柄。
541
543
 
542
544
  声明式正文和命令式内容继承相同的默认排版:基础正文为 14px、400 字重、基础行高(约 22px)和主文字色。自定义内容可以显式设置自己的排版;辅助说明应单独使用次级文字色。默认标题保留单行省略,`title` 插槽可组合多行内容,关闭按钮随标题区域居中。
@@ -598,6 +600,8 @@ onBeforeUnmount(() => handle?.close());
598
600
 
599
601
  默认正文与 Dialog 使用相同的基础排版:14px、400 字重、约 22px 行高和主文字色。VNode / 渲染函数提供的内容继承正文样式,显式自定义样式优先;标题允许长文本换行。
600
602
 
603
+ 入场和离场使用仅透明度过渡;系统减少动态效果会缩短过渡,业务前置钩子和关闭回调保持原行为。
604
+
601
605
  返回 `close()` / `update(options)` 句柄,结果通过 `onOk(event)` / `onCancel(event)` 回调处理。`beforeOnOk` / `beforeOnCancel` 返回 `boolean | Promise<boolean>`,必须返回 `true` 才放行;异步业务放在前置钩子。它不是 Promise,没有 `confirm()`;`.warning(title, content)` 等返回的 `.ok()` / `.cancel()` 用于注册链式回调。
602
606
 
603
607
  ```vue
@@ -5774,6 +5778,39 @@ const visible = ref(false);
5774
5778
  </template>
5775
5779
  ```
5776
5780
 
5781
+ ### 打开关闭与事件
5782
+
5783
+ 对话框使用淡入淡出,内容在出现过程中保持原尺寸。`open` / `close` 表示打开和关闭请求,`opened` / `closed` 在对应过渡完成后触发;确认、取消和右上角关闭按钮都可在下面的记录中查看。系统开启“减少动态效果”时,会缩短过渡。
5784
+
5785
+ ```vue
5786
+ <script setup lang="ts">
5787
+ import 'x-next/style.css';
5788
+ import { Button, DialogComponent, Space } from 'x-next';
5789
+ import { ref } from 'vue';
5790
+
5791
+ const visible = ref(false);
5792
+ const events = ref<string[]>([]);
5793
+ const record = (event: string) => {
5794
+ events.value = event === 'open' ? ['open'] : [...events.value, event];
5795
+ };
5796
+ </script>
5797
+ <template>
5798
+ <Button type="primary" @click="visible = true">打开并观察过渡</Button>
5799
+ <DialogComponent v-model="visible" title="操作确认" width="420px"
5800
+ @open="record('open')" @opened="record('opened')"
5801
+ @close="(action) => record(`close:${action}`)" @closed="record('closed')">
5802
+ 确认后保存当前操作。
5803
+ <template #footer="{ cancel, ok }">
5804
+ <Space>
5805
+ <Button @click="cancel">取消</Button>
5806
+ <Button type="primary" @click="ok">确认</Button>
5807
+ </Space>
5808
+ </template>
5809
+ </DialogComponent>
5810
+ <p role="status">{{ events.join(' → ') || '等待打开' }}</p>
5811
+ </template>
5812
+ ```
5813
+
5777
5814
  ### 标题与自定义标题
5778
5815
 
5779
5816
  默认标题支持中英文混排,超长标题保持单行省略。使用 `title` 插槽可以组合标题和补充信息,关闭按钮随标题区域居中。
@@ -6126,6 +6163,8 @@ const nativeAttrs1 = { "aria-label": "单选组后的输入框" } satisfies Inpu
6126
6163
 
6127
6164
  用于轻量级即时反馈,通常由命令式方法触发。
6128
6165
 
6166
+ 系统开启“减少动态效果”时,提示会减少入场、退场及列表重排的动态效果,显示时长和关闭方式不变。
6167
+
6129
6168
 
6130
6169
  ### 基础用法
6131
6170
 
@@ -6349,6 +6388,8 @@ const showContainerMessage = () => {
6349
6388
 
6350
6389
  用于确认、警告等阻塞式反馈。
6351
6390
 
6391
+ 消息框使用淡入淡出,标题、正文和按钮在出现过程中保持原尺寸;系统开启“减少动态效果”时会缩短过渡。
6392
+
6352
6393
 
6353
6394
  ### 基础用法
6354
6395
 
@@ -6644,6 +6685,8 @@ const openLocalMessageBox = () => {
6644
6685
 
6645
6686
  用于在页面角落展示较完整的通知内容,通常由命令式方法触发。
6646
6687
 
6688
+ 系统开启“减少动态效果”时,通知会减少入场、退场及列表重排的动态效果,自动关闭时长和业务回调不变。
6689
+
6647
6690
 
6648
6691
  ### 基础用法
6649
6692
 
@@ -14109,6 +14152,8 @@ const handleReset = () => {
14109
14152
 
14110
14153
  ### 基础用法
14111
14154
 
14155
+ 系统开启“减少动态效果”时,标签增删与重排会减少动态效果,输入、删除和受控值更新行为不变。
14156
+
14112
14157
  输入内容后按回车创建标签,点击标签上的关闭按钮删除,`allow-clear` 提供整组清空按钮。
14113
14158
 
14114
14159
  ```vue
@@ -16428,6 +16473,16 @@ const loading = ref(true);
16428
16473
  </div>
16429
16474
  </Spin>
16430
16475
  </template>
16476
+ <style scoped>
16477
+ .panel {
16478
+ box-sizing: border-box;
16479
+ width: min(100%, 360px);
16480
+ min-height: 120px;
16481
+ padding: 16px;
16482
+ border: 1px solid var(--x-color-border-default);
16483
+ border-radius: 6px;
16484
+ }
16485
+ </style>
16431
16486
  ```
16432
16487
 
16433
16488
  ### 点状动画
@@ -16447,6 +16502,8 @@ import { Spin } from 'x-next';
16447
16502
 
16448
16503
  ### 隐藏图标
16449
16504
 
16505
+ `hideIcon` 只隐藏图标,保留提示文字。容器模式的宽度由内容或外部布局决定;示例显式设置宽度,让提示文字有足够空间。
16506
+
16450
16507
  ```vue
16451
16508
  <script setup lang="ts">
16452
16509
  import 'x-next/style.css';
@@ -16455,24 +16512,26 @@ import { Spin } from 'x-next';
16455
16512
  </script>
16456
16513
  <template>
16457
16514
  <Spin hide-icon tip="正在连接服务" />
16458
- <Spin :loading="true" display="block" hide-icon tip="正在保存">
16459
- <div class="panel">表单内容</div>
16515
+ <Spin :loading="true" display="block" hide-icon tip="正在保存" style="width: min(100%, 240px)">
16516
+ <div style="min-height: 72px; padding: 16px">表单内容</div>
16460
16517
  </Spin>
16461
16518
  </template>
16462
16519
  ```
16463
16520
 
16464
16521
  ### 自定义内容
16465
16522
 
16523
+ `icon` / `element` 替换加载图形,`tip` 只替换提示文字,保留默认圆环。只显示自定义文字时可同时设置 `hide-icon`。
16524
+
16466
16525
  ```vue
16467
16526
  <script setup lang="ts">
16468
16527
  import 'x-next/style.css';
16469
- import { Spin } from 'x-next';
16528
+ import { Spin, Icon } from 'x-next';
16470
16529
 
16471
16530
  </script>
16472
16531
  <template>
16473
16532
  <Spin tip="自定义图标">
16474
16533
  <template #icon>
16475
- <span class="custom-icon">⌁</span>
16534
+ <Icon name="refresh-cw" :size="24" />
16476
16535
  </template>
16477
16536
  </Spin>
16478
16537
  <Spin tip="自定义元素">
@@ -16486,6 +16545,26 @@ import { Spin } from 'x-next';
16486
16545
  </template>
16487
16546
  </Spin>
16488
16547
  </template>
16548
+ <style scoped>
16549
+ .custom-loading {
16550
+ display: inline-block;
16551
+ box-sizing: border-box;
16552
+ width: 24px;
16553
+ height: 24px;
16554
+ border: 3px solid var(--x-color-border-default);
16555
+ border-top-color: var(--x-color-primary-text);
16556
+ border-radius: 50%;
16557
+ animation: custom-loading-rotate .8s linear infinite;
16558
+ }
16559
+
16560
+ @keyframes custom-loading-rotate {
16561
+ to { transform: rotate(360deg); }
16562
+ }
16563
+
16564
+ @media (prefers-reduced-motion: reduce) {
16565
+ .custom-loading { animation: none; }
16566
+ }
16567
+ </style>
16489
16568
  ```
16490
16569
 
16491
16570
  ### 文案扫光
@@ -16506,6 +16585,43 @@ import { Spin } from 'x-next';
16506
16585
  </template>
16507
16586
  ```
16508
16587
 
16588
+ ### 长文案与动态提示
16589
+
16590
+ 窄容器中的提示可以换行;加载图形与提示按整个容器的宽度居中。超过可用高度的提示在区域内滚动。自定义 `tip` 插槽优先于 `tip` prop,不参与扫光。
16591
+
16592
+ ```vue
16593
+ <script setup lang="ts">
16594
+ import 'x-next/style.css';
16595
+ import { Button, Spin } from 'x-next';
16596
+ import { ref } from 'vue';
16597
+ const customTip = ref(true);
16598
+ </script>
16599
+ <template>
16600
+ <Button @click="customTip = !customTip">
16601
+ {{ customTip ? '改用普通提示' : '改用自定义提示' }}
16602
+ </Button>
16603
+ <div class="row">
16604
+ <Spin :loading="true" display="block" hide-icon tip="正在保存" style="width: 98px">
16605
+ <div style="min-height: 72px">内容</div>
16606
+ </Spin>
16607
+ <Spin :loading="true" display="block" tip="正在同步较长的任务内容,请稍候" style="width: 160px">
16608
+ <div style="min-height: 120px">内容</div>
16609
+ </Spin>
16610
+ <Spin :loading="true" display="block" tip="正在同步较长的任务内容,请稍候。为了避免提示超出容器,过长文字会在区域内滚动。" style="width: 120px">
16611
+ <div style="height: 96px">内容</div>
16612
+ </Spin>
16613
+ <Spin tip="普通提示" tip-shimmer>
16614
+ <template v-if="customTip" #tip>
16615
+ <strong>请稍候,正在处理</strong>
16616
+ </template>
16617
+ </Spin>
16618
+ </div>
16619
+ </template>
16620
+ <style scoped>
16621
+ .row { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
16622
+ </style>
16623
+ ```
16624
+
16509
16625
  ### 延迟显示
16510
16626
 
16511
16627
  快速请求往往几十毫秒内就结束。直接切 `loading` 会让遮罩闪一下又消失,观感比不加加载态更差。`delay` 让加载态延后出现,这段时间内结束的请求不会有任何闪烁。
@@ -16516,33 +16632,70 @@ import { Spin } from 'x-next';
16516
16632
  <script setup lang="ts">
16517
16633
  import 'x-next/style.css';
16518
16634
  import { Button, Spin } from 'x-next';
16519
- import { ref } from 'vue';
16635
+ import { onBeforeUnmount, ref } from 'vue';
16520
16636
 
16521
- const loading = ref(false);
16637
+ const flashLoading = ref(false);
16638
+ const slowLoading = ref(false);
16639
+ let fastTimer: ReturnType<typeof setTimeout> | undefined;
16640
+ let slowTimer: ReturnType<typeof setTimeout> | undefined;
16522
16641
 
16523
- // 120ms 结束:早于 delay,遮罩不出现,不会闪
16524
- const runFast = () => {
16525
- loading.value = true;
16526
- window.setTimeout(() => {
16527
- loading.value = false;
16642
+ const triggerFast = () => {
16643
+ if (flashLoading.value) return;
16644
+ flashLoading.value = true;
16645
+ fastTimer = setTimeout(() => {
16646
+ flashLoading.value = false;
16528
16647
  }, 120);
16529
16648
  };
16530
16649
 
16531
- // 1.2s 结束:遮罩在 300ms 时出现
16532
- const runSlow = () => {
16533
- loading.value = true;
16534
- window.setTimeout(() => {
16535
- loading.value = false;
16650
+ const triggerSlow = () => {
16651
+ if (slowLoading.value) return;
16652
+ slowLoading.value = true;
16653
+ slowTimer = setTimeout(() => {
16654
+ slowLoading.value = false;
16536
16655
  }, 1200);
16537
16656
  };
16657
+
16658
+ onBeforeUnmount(() => {
16659
+ clearTimeout(fastTimer);
16660
+ clearTimeout(slowTimer);
16661
+ });
16538
16662
  </script>
16539
16663
  <template>
16540
- <Button @click="runFast">快请求(120ms 结束)</Button>
16541
- <Button @click="runSlow">慢请求(1.2s 结束)</Button>
16542
- <Spin :loading="loading" :delay="300" display="block" tip="加载中">
16543
- <div class="panel">内容区域</div>
16544
- </Spin>
16664
+ <div class="delay-demo">
16665
+ <div class="actions">
16666
+ <Button size="small" :disabled="flashLoading" @click="triggerFast">快请求(120ms 结束)</Button>
16667
+ <Button size="small" :disabled="slowLoading" @click="triggerSlow">慢请求(1.2s 结束)</Button>
16668
+ </div>
16669
+ <div class="delay-track">
16670
+ <Spin :loading="flashLoading" :delay="300" display="block" tip="加载中">
16671
+ <div class="panel">
16672
+ <strong>快速请求</strong>
16673
+ <p>请求早于 delay 结束,遮罩从不出现。</p>
16674
+ </div>
16675
+ </Spin>
16676
+ </div>
16677
+ <div class="delay-track">
16678
+ <Spin :loading="slowLoading" :delay="300" display="block" tip="加载中">
16679
+ <div class="panel">
16680
+ <strong>慢速请求</strong>
16681
+ <p>请求超过 delay,遮罩在 300ms 时出现。</p>
16682
+ </div>
16683
+ </Spin>
16684
+ </div>
16685
+ </div>
16545
16686
  </template>
16687
+ <style scoped>
16688
+ .delay-demo { display: grid; gap: 12px; }
16689
+ .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
16690
+ .delay-track { width: min(100%, 360px); }
16691
+ .panel {
16692
+ box-sizing: border-box;
16693
+ min-height: 120px;
16694
+ padding: 16px;
16695
+ border: 1px solid var(--x-color-border-default);
16696
+ border-radius: 6px;
16697
+ }
16698
+ </style>
16546
16699
  ```
16547
16700
 
16548
16701
  ### 交互说明
@@ -16552,7 +16705,7 @@ const runSlow = () => {
16552
16705
  - Spin 根节点默认带有加载语义;没有提示文本时会使用默认可访问名称。
16553
16706
  - `icon` 插槽会向第一个组件注入 `spin` 属性;若传入普通元素,可自行添加动画样式,或使用 `element` 插槽完全自定义。
16554
16707
  - 开启系统「减弱动态效果」后,图标旋转、点状动画与文案扫光都会停止;扫光会还原成纯色,避免光带停在文字上留下一块亮斑。
16555
- - 提示文字的行高由组件显式声明(`--x-line-height-base`),不继承宿主行高,因此在任意项目里高度一致。
16708
+ - 提示文字默认使用组件的行高(`--x-line-height-base`),避免被宿主的普通继承行高影响;使用方的显式样式或插槽内容仍可改变排版。
16556
16709
 
16557
16710
 
16558
16711
  ## Table 扩展场景
@@ -32014,7 +32167,7 @@ interface SelectContext {
32014
32167
  | default | 容器模式下的内容 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
32015
32168
  | icon | 自定义图标,会向第一个组件注入 spin 属性 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
32016
32169
  | element | 自定义加载元素 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
32017
- | tip | 自定义提示内容 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
32170
+ | tip | 自定义提示内容,优先于 tip prop;保留加载图形,可配合 hideIcon 只显示文字 | 文档列出的实际插槽;公开类型未细化,作用域见场景用法 |
32018
32171
 
32019
32172
  ### 实例方法
32020
32173
 
package/CHANGELOG.md CHANGED
@@ -4,6 +4,22 @@
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.19.5] - 2026-11-04
8
+
9
+ ### 修复
10
+
11
+ - 调整 MessageBox 关闭按钮边距、Notification 关闭按钮交互圆角,并缩小 Spin 图标与提示文字的间距。
12
+
13
+ ## [1.19.4] - 2026-11-04
14
+
15
+ ### 修复
16
+
17
+ - Spin 修复自定义提示对齐、窄容器提示被提前挤压、动态插槽切换及扫光优先级,补齐减少动态效果与旧浏览器键盘降级;同步完整示例和生产消费回归。
18
+ - 共享 loading 圆环描边由 5 调至 4,保持主题 / 状态颜色、图标尺寸与动画节奏。
19
+ - Dialog / MessageBox 改用淡入淡出,移除容器笼统过渡,避免小字号文字随祖先缩放产生跳动及过渡清理后继续动画。
20
+ - 补齐 Message、Notification、InputTag 专用动效的减少动态效果支持,保留正常模式的显示与交互。
21
+ - 新增保留真实动画的生产消费回归,覆盖生命周期、焦点、关闭重开和独立样式入口,并接入质量门禁。
22
+
7
23
  ## [1.19.3] - 2026-11-04
8
24
 
9
25
  ### 修复
@@ -14,7 +14,7 @@ import we from "../../icons/default/close.js";
14
14
  import { dialogProps as xe } from "./props.js";
15
15
  const ke = ["width", "minWidth", "height", "minHeight"];
16
16
  let Te = 0;
17
- const Me = /* @__PURE__ */ oe({
17
+ const ze = /* @__PURE__ */ oe({
18
18
  name: re("Dialog"),
19
19
  inheritAttrs: !1,
20
20
  props: xe,
@@ -44,9 +44,9 @@ const Me = /* @__PURE__ */ oe({
44
44
  }, f = s(() => {
45
45
  if (!(typeof document > "u"))
46
46
  return ye(e.renderTo) || document.body;
47
- }), b = C(), w = C(), z = s(() => e.disabled || !f.value), F = s(() => [I.value, {
47
+ }), b = C(), w = C(), F = s(() => e.disabled || !f.value), M = s(() => [I.value, {
48
48
  zIndex: U.value
49
- }, d.style]), M = s(() => {
49
+ }, d.style]), z = s(() => {
50
50
  const t = {};
51
51
  return e.fullscreen || (!e.center && e.top && (t.top = _(e.top)), ke.forEach((l) => {
52
52
  e[l] && (t[l] = _(e[l]));
@@ -104,13 +104,13 @@ const Me = /* @__PURE__ */ oe({
104
104
  n.value && (t ? K() : h());
105
105
  }), () => o(ne, {
106
106
  to: f.value,
107
- disabled: z.value
107
+ disabled: F.value
108
108
  }, {
109
109
  default: () => [G.value && ae(o("div", ie({
110
110
  ref: b,
111
111
  "data-theme": N.value,
112
112
  class: R(),
113
- style: F.value,
113
+ style: M.value,
114
114
  id: d.id
115
115
  }, j()), [o(L, {
116
116
  name: "x-fade-in-standard",
@@ -125,7 +125,7 @@ const Me = /* @__PURE__ */ oe({
125
125
  }],
126
126
  onClick: (t) => t.target === t.currentTarget && Z()
127
127
  }, [o(L, {
128
- name: "x-zoom-in",
128
+ name: "x-fade-in-standard",
129
129
  appear: !0,
130
130
  onAfterEnter: X,
131
131
  onAfterLeave: Q
@@ -135,7 +135,7 @@ const Me = /* @__PURE__ */ oe({
135
135
  class: [i.element("container"), {
136
136
  "is-fullscreen": e.fullscreen
137
137
  }],
138
- style: M.value,
138
+ style: z.value,
139
139
  role: "dialog",
140
140
  "aria-modal": e.mask ? "true" : void 0,
141
141
  "aria-label": e.title || a.title ? void 0 : d["aria-label"],
@@ -173,5 +173,5 @@ const Me = /* @__PURE__ */ oe({
173
173
  }
174
174
  });
175
175
  export {
176
- Me as default
176
+ ze as default
177
177
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as D, computed as s, ref as S, watch as x, onUnmounted as B, onMounted as R, onUpdated as U, createVNode as r, mergeProps as V, Fragment as T, cloneVNode as H } from "vue";
1
+ import { defineComponent as U, ref as v, onBeforeUpdate as w, watch as x, onUnmounted as E, computed as D, onMounted as H, onUpdated as R, createVNode as r, mergeProps as V, Fragment as T, cloneVNode as j } from "vue";
2
2
  import O from "../../icons/animation/animation-loading.js";
3
3
  import _ from "./dot-loading.js";
4
4
  import { getFirstComponent as q } from "../../_utils/vue-eco.js";
5
5
  import { getClassNameMixin as P } from "../../_utils/config.js";
6
6
  import { useLocale as $ } from "../../locale/index.js";
7
- const j = 'a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"])', Y = /* @__PURE__ */ D({
7
+ const G = ["a[href]", "area[href]", "button", "input", "select", "textarea", "summary", "iframe", "object", "embed", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', '[tabindex]:not([tabindex="-1"])'].join(","), Z = /* @__PURE__ */ U({
8
8
  name: "Spin",
9
9
  inheritAttrs: !1,
10
10
  props: {
@@ -82,118 +82,126 @@ const j = 'a[href], button, input, select, textarea, [tabindex]:not([tabindex="-
82
82
  * @en Custom tip
83
83
  * @slot tip
84
84
  */
85
- setup(e, {
85
+ setup(n, {
86
86
  attrs: k,
87
87
  slots: i
88
88
  }) {
89
89
  const a = P("spin"), {
90
90
  t: z
91
- } = $(), o = s(() => !!i.default), u = S(!1);
91
+ } = $(), u = v(!!i.default);
92
+ w(() => {
93
+ u.value = !!i.default;
94
+ });
95
+ const d = v(!1);
92
96
  let c;
93
- const v = () => {
97
+ const b = () => {
94
98
  c !== void 0 && (clearTimeout(c), c = void 0);
95
99
  };
96
- x(() => [e.loading, e.delay, o.value], ([t, n, d]) => {
97
- if (v(), !d) {
98
- u.value = !0;
100
+ x(() => [n.loading, n.delay, u.value], ([e, t, l], f) => {
101
+ if (b(), !l) {
102
+ d.value = !0;
99
103
  return;
100
104
  }
101
- if (!t) {
102
- u.value = !1;
105
+ if (!e) {
106
+ d.value = !1;
103
107
  return;
104
108
  }
105
- if (u.value || !n || !Number.isFinite(n) || n <= 0) {
106
- u.value = !0;
109
+ if (f != null && f[2] || (d.value = !1), d.value || !t || !Number.isFinite(t) || t <= 0) {
110
+ d.value = !0;
107
111
  return;
108
112
  }
109
113
  c = setTimeout(() => {
110
- u.value = !0, c = void 0;
111
- }, n);
114
+ d.value = !0, c = void 0;
115
+ }, t);
112
116
  }, {
113
- immediate: !0
114
- }), B(v);
115
- const l = s(() => e.loading && u.value), A = s(() => [a.block, e.display === "inline" ? a.modifier("inline") : a.modifier("block"), {
116
- [a.modifier("loading")]: l.value,
117
- [a.modifier("with-tip")]: e.tip && !i.default,
117
+ immediate: !0,
118
+ flush: "sync"
119
+ }), E(b);
120
+ const o = D(() => n.loading && d.value), A = (e) => [a.block, n.display === "inline" ? a.modifier("inline") : a.modifier("block"), {
121
+ [a.modifier("loading")]: o.value,
122
+ [a.modifier("with-tip")]: e && !u.value,
118
123
  /*
119
- * 扫光只作用于提示文字。tip 是 prop 时 with-tip 才成立;
124
+ * 扫光只作用于 prop 提示文字;
120
125
  * 自定义 tip 插槽的内容结构未知,不加扫光,避免破坏使用方自己的样式。
121
126
  */
122
- [a.modifier("tip-shimmer")]: e.tipShimmer && !!e.tip
123
- }]), C = () => {
127
+ [a.modifier("tip-shimmer")]: n.tipShimmer && !!n.tip && !i.tip
128
+ }], C = () => {
124
129
  if (i.icon) {
125
- const t = q(i.icon());
126
- if (t)
127
- return H(t, {
130
+ const e = q(i.icon());
131
+ if (e)
132
+ return j(e, {
128
133
  spin: !0
129
134
  });
130
135
  }
131
- return i.element ? i.element() : e.dot ? r(_, {
132
- size: e.size,
133
- type: e.dot === "color" ? "color" : "default"
136
+ return i.element ? i.element() : n.dot ? r(_, {
137
+ size: n.size,
138
+ type: n.dot === "color" ? "color" : "default"
134
139
  }, null) : r(O, {
135
- size: e.size
140
+ size: n.size
136
141
  }, null);
137
- }, p = () => {
138
- var d;
139
- const t = e.size ? {
140
- fontSize: `${e.size}px`
141
- } : void 0, n = !!(i.tip ?? e.tip);
142
- return r(T, null, [!e.hideIcon && r("div", {
142
+ }, y = () => {
143
+ var l;
144
+ const e = n.size ? {
145
+ fontSize: `${n.size}px`
146
+ } : void 0, t = !!(i.tip ?? n.tip);
147
+ return r(T, null, [!n.hideIcon && r("div", {
143
148
  class: a.element("icon"),
144
- style: t
145
- }, [C()]), n && r("div", {
149
+ style: e
150
+ }, [C()]), t && r("div", {
146
151
  class: a.element("tip")
147
- }, [((d = i.tip) == null ? void 0 : d.call(i)) ?? e.tip])]);
148
- }, m = typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, y = S(), f = /* @__PURE__ */ new Map(), b = () => {
149
- const t = y.value;
150
- t && t.querySelectorAll(j).forEach((n) => {
151
- f.has(n) || (f.set(n, n.getAttribute("tabindex")), n.setAttribute("tabindex", "-1"));
152
+ }, [((l = i.tip) == null ? void 0 : l.call(i)) ?? n.tip])]);
153
+ }, s = typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, h = v(), m = /* @__PURE__ */ new Map(), p = () => {
154
+ const e = h.value;
155
+ if (!e) return;
156
+ e.querySelectorAll(G).forEach((l) => {
157
+ m.has(l) || (m.set(l, l.getAttribute("tabindex")), l.setAttribute("tabindex", "-1"));
152
158
  });
153
- }, h = () => {
154
- f.forEach((t, n) => {
155
- t === null ? n.removeAttribute("tabindex") : n.setAttribute("tabindex", t);
156
- }), f.clear();
157
- }, g = (t) => {
158
- m || (t ? b() : h());
159
+ const t = document.activeElement;
160
+ t instanceof HTMLElement && e.contains(t) && t.blur();
161
+ }, g = () => {
162
+ m.forEach((e, t) => {
163
+ e === null ? t.removeAttribute("tabindex") : t.setAttribute("tabindex", e);
164
+ }), m.clear();
165
+ }, L = (e) => {
166
+ s || (e ? p() : g());
159
167
  };
160
- return x(l, g, {
168
+ return x([o, u], ([e, t]) => L(e && t), {
161
169
  flush: "post"
162
- }), R(() => g(l.value)), U(() => {
163
- !m && l.value && b();
164
- }), B(() => {
165
- m || h();
170
+ }), H(() => L(o.value)), R(() => {
171
+ !s && o.value && p();
172
+ }), E(() => {
173
+ s || g();
166
174
  }), () => {
167
- var L;
175
+ var S;
168
176
  const {
169
- class: t,
170
- style: n,
171
- role: d,
172
- "aria-live": E,
177
+ class: e,
178
+ style: t,
179
+ role: l,
180
+ "aria-live": f,
173
181
  "aria-busy": N,
174
182
  "aria-label": F,
175
183
  ...I
176
- } = k, M = !!(i.tip ?? e.tip), w = o.value ? l.value : !0;
184
+ } = k, B = !!(i.tip ?? n.tip), M = u.value ? o.value : !0;
177
185
  return r("div", V(I, {
178
- class: [A.value, t],
179
- style: n,
180
- role: d ?? (o.value ? void 0 : "status"),
181
- "aria-live": E ?? (o.value && !l.value ? void 0 : "polite"),
182
- "aria-busy": N ?? (o.value ? l.value : !0),
183
- "aria-label": F ?? (w && !M ? z("common.loading") : void 0)
184
- }), [o.value ? r(T, null, [r("div", {
185
- ref: y,
186
+ class: [A(B), e],
187
+ style: t,
188
+ role: l ?? (u.value ? void 0 : "status"),
189
+ "aria-live": f ?? (u.value && !o.value ? void 0 : "polite"),
190
+ "aria-busy": N ?? (u.value ? o.value : !0),
191
+ "aria-label": F ?? (M && !B ? z("common.loading") : void 0)
192
+ }), [u.value ? r(T, null, [r("div", {
193
+ ref: h,
186
194
  class: a.element("children"),
187
- "aria-hidden": l.value ? "true" : void 0,
188
- inert: l.value ? "" : void 0
189
- }, [(L = i.default) == null ? void 0 : L.call(i)]), l.value && r("div", {
195
+ "aria-hidden": o.value ? "true" : void 0,
196
+ inert: o.value ? "" : void 0
197
+ }, [(S = i.default) == null ? void 0 : S.call(i)]), o.value && r("div", {
190
198
  class: a.element("mask")
191
199
  }, [r("div", {
192
200
  class: a.element("mask--icon")
193
- }, [p()])])]) : p()]);
201
+ }, [y()])])]) : y()]);
194
202
  };
195
203
  }
196
204
  });
197
205
  export {
198
- Y as default
206
+ Z as default
199
207
  };