@veltra/desktop 1.15.0 → 1.15.1

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 (212) hide show
  1. package/dist/components/alert/alert.js +31 -28
  2. package/dist/components/alert/alert.js.map +1 -1
  3. package/dist/components/alert/style.d.ts +1 -1
  4. package/dist/components/alert/style.js +1 -0
  5. package/dist/components/alert/style2.css +5 -1
  6. package/dist/components/auto-complete/style2.css +1 -0
  7. package/dist/components/back-top/style2.css +11 -2
  8. package/dist/components/badge/badge.js +15 -15
  9. package/dist/components/badge/badge.js.map +1 -1
  10. package/dist/components/badge/style2.css +10 -1
  11. package/dist/components/batch-edit/batch-edit-form.js +108 -97
  12. package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
  13. package/dist/components/batch-edit/batch-edit.js +11 -5
  14. package/dist/components/batch-edit/batch-edit.js.map +1 -1
  15. package/dist/components/batch-edit/style2.css +25 -1
  16. package/dist/components/breadcrumb/style2.css +4 -1
  17. package/dist/components/button/style2.css +3 -2
  18. package/dist/components/carousel/carousel.js +5 -3
  19. package/dist/components/carousel/carousel.js.map +1 -1
  20. package/dist/components/carousel/style2.css +7 -1
  21. package/dist/components/carousel/use-carousel.js +16 -2
  22. package/dist/components/carousel/use-carousel.js.map +1 -1
  23. package/dist/components/cascade/style2.css +16 -0
  24. package/dist/components/check-tag/check-tag.js +11 -5
  25. package/dist/components/check-tag/check-tag.js.map +1 -1
  26. package/dist/components/check-tag/style2.css +10 -0
  27. package/dist/components/checkbox/checkbox-button.js +8 -3
  28. package/dist/components/checkbox/checkbox-button.js.map +1 -1
  29. package/dist/components/checkbox/checkbox.js +5 -9
  30. package/dist/components/checkbox/checkbox.js.map +1 -1
  31. package/dist/components/checkbox/style2.css +32 -2
  32. package/dist/components/chip/style2.css +4 -0
  33. package/dist/components/code-editor/code-editor.js +26 -3
  34. package/dist/components/code-editor/code-editor.js.map +1 -1
  35. package/dist/components/code-editor/style2.css +38 -3
  36. package/dist/components/collapse/collapse-item.js +4 -1
  37. package/dist/components/collapse/collapse-item.js.map +1 -1
  38. package/dist/components/collapse/collapse.js +1 -1
  39. package/dist/components/collapse/collapse.js.map +1 -1
  40. package/dist/components/collapse/style2.css +6 -3
  41. package/dist/components/condition-editor/style2.css +24 -6
  42. package/dist/components/contextmenu/contextmenu-sub.js +13 -7
  43. package/dist/components/contextmenu/contextmenu-sub.js.map +1 -1
  44. package/dist/components/contextmenu/style2.css +14 -1
  45. package/dist/components/date-panel/style2.css +9 -1
  46. package/dist/components/dialog/style2.css +5 -1
  47. package/dist/components/dialog/use-maximum.js +6 -0
  48. package/dist/components/dialog/use-maximum.js.map +1 -1
  49. package/dist/components/drawer/style2.css +4 -0
  50. package/dist/components/dual-nav/style2.css +5 -2
  51. package/dist/components/expression-editor/style2.css +17 -5
  52. package/dist/components/file-viewer/style2.css +8 -2
  53. package/dist/components/float-button/float-button.js +1 -1
  54. package/dist/components/float-button/float-button.js.map +1 -1
  55. package/dist/components/float-button/style2.css +2 -3
  56. package/dist/components/form-item/style2.css +13 -1
  57. package/dist/components/grid-input/style2.css +15 -3
  58. package/dist/components/group-nav/style2.css +16 -7
  59. package/dist/components/icon/style2.css +1 -1
  60. package/dist/components/image-cropper/style2.css +4 -1
  61. package/dist/components/image-previewer/image-previewer.js +14 -2
  62. package/dist/components/image-previewer/image-previewer.js.map +1 -1
  63. package/dist/components/image-previewer/style.d.ts +1 -1
  64. package/dist/components/image-previewer/style.js +1 -0
  65. package/dist/components/image-previewer/style2.css +9 -14
  66. package/dist/components/input/input.js.map +1 -1
  67. package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js +4 -4
  68. package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js.map +1 -1
  69. package/dist/components/input/style2.css +13 -1
  70. package/dist/components/kanban/kanban-column.js +1 -0
  71. package/dist/components/kanban/kanban-column.js.map +1 -1
  72. package/dist/components/kanban/style2.css +6 -2
  73. package/dist/components/layout/layout-resizer.js +8 -1
  74. package/dist/components/layout/layout-resizer.js.map +1 -1
  75. package/dist/components/layout/layout.js +11 -1
  76. package/dist/components/layout/layout.js.map +1 -1
  77. package/dist/components/layout/style2.css +22 -0
  78. package/dist/components/loading/style2.css +26 -7
  79. package/dist/components/message/style2.css +18 -2
  80. package/dist/components/message-confirm/style2.css +11 -0
  81. package/dist/components/multi-select/multi-select.js +21 -18
  82. package/dist/components/multi-select/multi-select.js.map +1 -1
  83. package/dist/components/multi-select/style2.css +13 -0
  84. package/dist/components/nav/nav-sub.js +8 -2
  85. package/dist/components/nav/nav-sub.js.map +1 -1
  86. package/dist/components/nav/style2.css +50 -26
  87. package/dist/components/notification/style2.css +21 -0
  88. package/dist/components/number-input/style2.css +5 -2
  89. package/dist/components/paginator/style2.css +1 -0
  90. package/dist/components/password-input/style2.css +10 -1
  91. package/dist/components/pop-confirm/pop-confirm.js +1 -1
  92. package/dist/components/pop-confirm/pop-confirm.js.map +1 -1
  93. package/dist/components/progress/style2.css +2 -2
  94. package/dist/components/progress-nodes/style2.css +3 -3
  95. package/dist/components/radio/radio.js +1 -4
  96. package/dist/components/radio/radio.js.map +1 -1
  97. package/dist/components/radio/style2.css +11 -1
  98. package/dist/components/rate/style2.css +7 -0
  99. package/dist/components/rich-text-editor/style2.css +6 -3
  100. package/dist/components/scroll/style2.css +2 -2
  101. package/dist/components/segment/segment.js +5 -1
  102. package/dist/components/segment/segment.js.map +1 -1
  103. package/dist/components/segment/style2.css +6 -0
  104. package/dist/components/select/select.js +5 -1
  105. package/dist/components/select/select.js.map +1 -1
  106. package/dist/components/select/style2.css +11 -1
  107. package/dist/components/steps/style2.css +21 -2
  108. package/dist/components/switch/style2.css +10 -2
  109. package/dist/components/table/style2.css +20 -7
  110. package/dist/components/tabs/style2.css +9 -3
  111. package/dist/components/tag/style2.css +16 -7
  112. package/dist/components/textarea/style2.css +9 -1
  113. package/dist/components/theme/style2.css +38 -29
  114. package/dist/components/time-picker/style2.css +4 -1
  115. package/dist/components/tip/style2.css +11 -0
  116. package/dist/components/transfer/style2.css +21 -1
  117. package/dist/components/transfer/transfer-list.js +20 -17
  118. package/dist/components/transfer/transfer-list.js.map +1 -1
  119. package/dist/components/tree/style2.css +5 -2
  120. package/package.json +1 -1
  121. package/src/components/alert/alert.vue +18 -16
  122. package/src/components/alert/style.scss +9 -1
  123. package/src/components/alert/style.ts +1 -0
  124. package/src/components/auto-complete/style.scss +3 -0
  125. package/src/components/back-top/style.scss +17 -3
  126. package/src/components/badge/badge.vue +6 -7
  127. package/src/components/badge/style.scss +20 -1
  128. package/src/components/batch-edit/__test__/batch-edit.test.ts +10 -0
  129. package/src/components/batch-edit/batch-edit-form.vue +95 -83
  130. package/src/components/batch-edit/batch-edit.vue +18 -3
  131. package/src/components/batch-edit/style.scss +39 -3
  132. package/src/components/breadcrumb/style.scss +5 -1
  133. package/src/components/button/style.scss +4 -2
  134. package/src/components/carousel/carousel.vue +8 -2
  135. package/src/components/carousel/style.scss +10 -1
  136. package/src/components/carousel/use-carousel.ts +17 -2
  137. package/src/components/cascade/style.scss +27 -0
  138. package/src/components/check-tag/check-tag.vue +13 -3
  139. package/src/components/check-tag/style.scss +21 -0
  140. package/src/components/checkbox/checkbox-button.vue +11 -1
  141. package/src/components/checkbox/checkbox.vue +6 -2
  142. package/src/components/checkbox/style.scss +51 -2
  143. package/src/components/chip/style.scss +11 -0
  144. package/src/components/code-editor/code-editor.vue +24 -3
  145. package/src/components/code-editor/style.scss +54 -4
  146. package/src/components/collapse/collapse-item.vue +10 -1
  147. package/src/components/collapse/collapse.vue +3 -1
  148. package/src/components/collapse/style.scss +10 -7
  149. package/src/components/condition-editor/style.scss +39 -12
  150. package/src/components/contextmenu/contextmenu-sub.vue +9 -7
  151. package/src/components/contextmenu/style.scss +17 -1
  152. package/src/components/date-panel/style.scss +22 -1
  153. package/src/components/dialog/style.scss +6 -1
  154. package/src/components/dialog/use-maximum.ts +8 -0
  155. package/src/components/drawer/style.scss +5 -0
  156. package/src/components/dual-nav/style.scss +9 -4
  157. package/src/components/expression-editor/style.scss +27 -9
  158. package/src/components/file-viewer/style.scss +12 -2
  159. package/src/components/float-button/float-button.vue +1 -1
  160. package/src/components/float-button/style.scss +4 -3
  161. package/src/components/form-item/style.scss +16 -2
  162. package/src/components/grid-input/style.scss +6 -1
  163. package/src/components/group-nav/style.scss +30 -13
  164. package/src/components/icon/style.scss +2 -1
  165. package/src/components/image-cropper/style.scss +6 -1
  166. package/src/components/image-previewer/image-previewer.vue +20 -2
  167. package/src/components/image-previewer/style.scss +17 -14
  168. package/src/components/image-previewer/style.ts +1 -0
  169. package/src/components/input/input.vue +2 -8
  170. package/src/components/input/style.scss +19 -1
  171. package/src/components/kanban/kanban-column.vue +2 -0
  172. package/src/components/kanban/style.scss +11 -2
  173. package/src/components/layout/__test__/layout.test.ts +135 -0
  174. package/src/components/layout/layout-resizer.vue +8 -1
  175. package/src/components/layout/layout.vue +17 -1
  176. package/src/components/layout/style.scss +31 -6
  177. package/src/components/loading/style.scss +39 -8
  178. package/src/components/message/style.scss +20 -2
  179. package/src/components/message-confirm/style.scss +13 -0
  180. package/src/components/multi-select/multi-select.vue +13 -10
  181. package/src/components/multi-select/style.scss +14 -0
  182. package/src/components/multi-tree-select/__test__/multi-tree-select.test.ts +4 -2
  183. package/src/components/nav/nav-sub.vue +10 -2
  184. package/src/components/nav/style.scss +37 -13
  185. package/src/components/notification/style.scss +13 -0
  186. package/src/components/number-input/style.scss +8 -2
  187. package/src/components/paginator/style.scss +3 -0
  188. package/src/components/password-input/style.scss +15 -1
  189. package/src/components/pop-confirm/pop-confirm.vue +1 -1
  190. package/src/components/progress/style.scss +3 -3
  191. package/src/components/progress-nodes/style.scss +5 -5
  192. package/src/components/radio/radio.vue +1 -1
  193. package/src/components/radio/style.scss +19 -1
  194. package/src/components/rate/style.scss +9 -0
  195. package/src/components/rich-text-editor/style.scss +11 -6
  196. package/src/components/scroll/style.scss +3 -3
  197. package/src/components/segment/segment.vue +13 -1
  198. package/src/components/segment/style.scss +13 -3
  199. package/src/components/select/select.vue +1 -1
  200. package/src/components/select/style.scss +22 -1
  201. package/src/components/steps/style.scss +27 -5
  202. package/src/components/switch/style.scss +13 -2
  203. package/src/components/table/style.scss +44 -20
  204. package/src/components/tabs/style.scss +16 -3
  205. package/src/components/tag/style.scss +18 -1
  206. package/src/components/textarea/style.scss +15 -2
  207. package/src/components/theme/style.scss +62 -40
  208. package/src/components/time-picker/style.scss +9 -1
  209. package/src/components/tip/style.scss +13 -0
  210. package/src/components/transfer/style.scss +31 -1
  211. package/src/components/transfer/transfer-list.vue +18 -15
  212. package/src/components/tree/style.scss +8 -3
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","names":["$attrs","$slots","_unref","_openBlock","_createBlock","UDropdown","_mergeProps","_withCtx","_createVNode","UInput","_createSlots","UIcon","_normalizeClass","_withModifiers","_renderSlot","_createCommentVNode","_createElementBlock","ULoading","UScroll","_Fragment","_renderList","_normalizeStyle","_createTextVNode","_toDisplayString","UEmpty"],"sources":["../../../src/components/select/select.vue"],"sourcesContent":["<template>\n <u-dropdown\n v-if=\"!readonly\"\n v-bind=\"$attrs\"\n trigger=\"click\"\n :class=\"[cls.b, bem.is('disabled', disabled)]\"\n ref=\"dropdownRef\"\n v-model:visible=\"dropdownVisible\"\n :content-class=\"[cls.e('panel'), cls.em('panel', size), contentClass]\"\n :content-style=\"contentStyle\"\n :disabled=\"disabled\"\n :min-width=\"minWidth\"\n :width=\"width\"\n @keydown=\"handleKeydown\"\n @mouseenter=\"hovered = true\"\n @mouseleave=\"hovered = false\"\n >\n <!-- 触发 -->\n <template #trigger>\n <u-input\n ref=\"inputRef\"\n :size=\"size\"\n :disabled=\"disabled\"\n :placeholder=\"inputPlaceholder\"\n :clearable=\"false\"\n :model-value=\"inputValue\"\n @update:model-value=\"handleQueryInput\"\n @keydown=\"handleKeydown\"\n :native-readonly=\"!filterable || !querying\"\n @click.capture=\"handleTriggerClickCapture\"\n >\n <template #prefix v-if=\"$slots.prefix\">\n <slot name=\"prefix\" />\n </template>\n\n <template #suffix>\n <u-icon\n v-if=\"showClear\"\n :class=\"cls.e('clear')\"\n title=\"清除\"\n key=\"clear\"\n @click.stop=\"handleClear\"\n >\n <Close />\n </u-icon>\n <u-icon v-else :class=\"cls.e('arrow')\" key=\"arrow\">\n <ArrowDown />\n </u-icon>\n </template>\n </u-input>\n </template>\n\n <!-- 下拉内容 -->\n <template #content>\n <!--\n 单选列表。虚拟化启用时,内容容器 height 由 useVirtualizer 命令式写入;\n 此处 content-style 仅承担 grid 相关样式,避免 height 变化触发模板重渲染。\n -->\n <div v-if=\"loading\" :class=\"cls.e('loading')\">\n <ULoading type=\"dual-ring\" />\n </div>\n <u-scroll\n v-else-if=\"options.length\"\n tag=\"ul\"\n :class=\"cls.e('options')\"\n ref=\"scrollRef\"\n :content-class=\"[\n cls.e('options-wrap'),\n bem.is('virtual', virtualEnabled),\n bem.is('grid', !!grid)\n ]\"\n :content-style=\"{\n gridTemplateColumns: grid ? `repeat(${grid.cols}, minmax(0px, 1fr))` : undefined,\n gridGap: grid ? withUnit(grid.gap, 'px') : undefined\n }\"\n >\n <template v-if=\"virtualEnabled\">\n <!-- @vue-ignore -->\n <li\n v-for=\"{ option, index, val, label, key, offset } of virtualOptions\"\n :class=\"[optionClass, bem.is('selected', index === currentIndex)]\"\n @click=\"handleSelect(option, index)\"\n :key=\"key\"\n :style=\"{ transform: `translateY(${offset}px)` }\"\n :data-index=\"index\"\n :ref=\"(el) => measureElement(index, el as Element | null)\"\n >\n <slot v-bind=\"{ option, index }\">\n {{ label }}\n </slot>\n </li>\n </template>\n\n <template v-else>\n <li\n v-for=\"(option, index) of options\"\n :class=\"[optionClass, bem.is('selected', index === currentIndex)]\"\n @click=\"handleSelect(option, index)\"\n :data-index=\"index\"\n :title=\"renderOptionLabel(option)\"\n :key=\"o(option).get(valueKey)\"\n >\n <slot v-bind=\"{ option, index }\">\n {{ renderOptionLabel(option) }}\n </slot>\n </li>\n </template>\n </u-scroll>\n\n <div v-else :class=\"cls.e('empty')\">\n <UEmpty />\n </div>\n </template>\n </u-dropdown>\n\n <template v-else>\n {{ displayedValue || FORM_EMPTY_CONTENT }}\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { o } from '@cat-kit/core'\nimport { useFormFallbackProps, useUserAction, useVirtualizer } from '@veltra/compositions'\nimport { ArrowDown, Close } from '@veltra/icons/normal'\nimport {\n bem,\n fieldKey,\n FORM_EMPTY_CONTENT,\n renderLabelTemplate,\n scrollIntoContainerView,\n withUnit\n} from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { computed, nextTick, shallowRef, useTemplateRef, watch } from 'vue'\n\nimport type {\n SelectEmits,\n SelectProps,\n _SelectExposed,\n DropdownExposed,\n InputExposed,\n ScrollExposed\n} from '../../types'\nimport { UDropdown } from '../dropdown'\nimport { UEmpty } from '../empty'\nimport { UIcon } from '../icon'\nimport { UInput } from '../input'\nimport { ULoading } from '../loading'\nimport { UScroll } from '../scroll'\nimport { useKeyboard } from './use-keyboard'\nimport { useOptions } from './use-options'\n\ndefineOptions({ name: 'USelect', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<SelectProps>(), {\n valueKey: 'value',\n placeholder: '请选择',\n clearable: true,\n disabled: undefined,\n readonly: undefined\n})\n\nconst emit = defineEmits<SelectEmits>()\n\ndefineSlots<{\n /** 前缀插槽 */\n prefix?: () => any\n /** 默认插槽 */\n default?: (scope: { option: Record<string, any>; index: number }) => any\n}>()\n\nconst cls = bem('select')\n\nconst labelKey = computed(() => fieldKey(props.labelKey, 'label'))\nconst valueKey = computed(() => fieldKey(props.valueKey, 'value'))\n\n/** 选项展示文案:labelTemplate 渲染结果优先,未配置模板或引用字段缺失时回退 labelKey 取值 */\nfunction renderOptionLabel(option: Record<string, any> | undefined) {\n if (!option) return undefined\n return renderLabelTemplate(props.labelTemplate, option) ?? o(option).get(labelKey.value)\n}\n\n/** update:text 回发文案:显式配置 labelKey 时取原始取值;未配置时模板渲染结果即标签,与展示文案一致 */\nfunction optionEmitText(option: Record<string, any>) {\n return props.labelKey === undefined ? renderOptionLabel(option) : o(option).get(labelKey.value)\n}\n\nconst optionClass = cls.e('option')\n\nconst { formProps } = injectFormContext()\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props], {\n size: 'default',\n disabled: false,\n readonly: false\n})\n\nconst currentIndex = shallowRef(-1)\n/** 内部展示文案,仅由选项推导(未命中时展示 text 兜底);经 update:text 通知父级 */\nconst label = shallowRef<string>()\nconst selected = shallowRef<Record<string, any>>()\n\nconst displayedValue = computed(() => {\n if (label.value) return label.value\n\n if (selected.value) return renderOptionLabel(selected.value)\n // 未命中选项:优先展示 text 兜底文案,避免露出不可读的编码\n return props.text ?? String(props.modelValue ?? '')\n})\n\nconst dropdownRef = shallowRef<DropdownExposed>()\nconst scrollRef = shallowRef<ScrollExposed>()\nconst inputRef = useTemplateRef<InputExposed>('inputRef')\n\nconst filterable = computed(() => {\n return props.filterable || typeof props.options === 'function'\n})\n\nconst {\n queryString,\n loading,\n options,\n allOptions,\n temOptionsToCreatedOptions,\n clearCreatedOptions\n} = useOptions({ props })\n\nconst dropdownVisible = shallowRef(false)\n\n/** 选中临时选项后待转正标记:面板关闭后再落定,避免关闭动画期间列表恢复全量导致面板变长 */\nlet pendingTempPromote = false\n\n/**\n * 是否处于查询态:决定触发输入框显示查询串还是选中标签。\n * 与面板可见状态解耦 —— 选择后立即退出查询态,\n * 不等面板关闭动画结束(否则显示值会延迟一个动画时长才恢复)。\n */\nconst querying = shallowRef(false)\n\n/** 触发输入框的值:查询态下承载查询串,否则展示选中标签 */\nconst inputValue = computed(() => {\n if (filterable.value && querying.value) return queryString.value\n return displayedValue.value\n})\n\n/** 查询态下已选标签降级为占位提示 */\nconst inputPlaceholder = computed(() => {\n if (filterable.value && querying.value && displayedValue.value) {\n return displayedValue.value\n }\n return props.placeholder\n})\n\nfunction handleQueryInput(value: string) {\n if (!filterable.value) return\n queryString.value = value\n}\n\nconst hovered = shallowRef(false)\n\n/** 悬停且存在选中值时展示清除按钮(替代下拉箭头) */\nconst showClear = computed(() => {\n return props.clearable && !disabled.value && hovered.value && !!displayedValue.value\n})\n\n/**\n * 点击输入框时在 capture 阶段完成开合。\n * 过滤模式只打开、不关闭,避免打断输入;非过滤模式切换开合。\n * 箭头和留白仍交给 dropdown 的 click。\n */\nfunction handleTriggerClickCapture(e: MouseEvent) {\n if (disabled.value) return\n if (!(e.target instanceof HTMLInputElement)) return\n\n // capture 与 dropdown 的 bubble click 会在同一毫秒内先后绑定。\n // Vue 会丢掉后绑定的那个,非过滤模式下面板就打不开。开合放在先执行的 capture 里。\n e.stopPropagation()\n if (filterable.value) {\n if (!dropdownVisible.value) dropdownRef.value?.open()\n return\n }\n if (dropdownVisible.value) dropdownRef.value?.close()\n else dropdownRef.value?.open()\n}\n\nconst { userAction, isUserActive } = useUserAction()\n\n/** 更新内部文案;值变化时 emit update:text(readonly 纯展示,不通知父级)。next:展示文案(模板渲染结果);text:回发文案(见 optionEmitText),缺省同 next */\nfunction setLabel(next?: string, text: string | undefined = next) {\n if (label.value === next) return\n label.value = next\n if (!readonly.value) emit('update:text', text)\n}\n\n/** 按 modelValue 与完整选项列表同步高亮索引、选中项与显示标签(外部回显用,O(n)) */\nfunction syncSelected(modelValue: any, sourceOptions: Record<string, any>[] | undefined) {\n // 查询输入期间高亮第一项(创建模式下通常是临时项,便于回车创建)\n if (queryString.value) {\n currentIndex.value = options.value.length ? 0 : -1\n return\n }\n\n if (!sourceOptions?.length) return\n\n if (modelValue !== undefined && modelValue !== null && modelValue !== '') {\n currentIndex.value = sourceOptions.findIndex(\n (option) => o(option).get(valueKey.value) === modelValue\n )\n selected.value = currentIndex.value >= 0 ? sourceOptions[currentIndex.value] : undefined\n if (selected.value) {\n setLabel(renderOptionLabel(selected.value), optionEmitText(selected.value))\n } else if (props.text) {\n // 未命中但有 text 兜底:文案以父级为准,不回发\n label.value = undefined\n } else {\n // 未命中且无兜底:如实通知父级当前没有可展示文案\n setLabel(undefined)\n }\n } else {\n currentIndex.value = -1\n selected.value = undefined\n setLabel(undefined)\n }\n}\n\n// 回显:以 allOptions 匹配,避免过滤列表缺项时清掉已选文案;用户动作期内跳过\nwatch(\n [() => props.modelValue, allOptions],\n ([modelValue]) => {\n if (isUserActive()) return\n syncSelected(modelValue, allOptions.value)\n },\n { immediate: true }\n)\n\n// 过滤时单独同步高亮(allOptions 不变,不会触发上方回显 watch)\nwatch([queryString, options], () => {\n if (!queryString.value) return\n currentIndex.value = options.value.length ? 0 : -1\n})\n\nconst baseVirtualEnabled = computed(() => options.value.length > 80)\nconst virtualEnabled = computed(() => baseVirtualEnabled.value && !props.grid)\n\nconst { virtualizer, items } = useVirtualizer({\n count: computed(() => options.value.length),\n scrollEl: () => scrollRef.value?.containerRef ?? null,\n contentEl: () => (virtualEnabled.value ? (scrollRef.value?.contentRef ?? null) : null),\n gap: 4,\n estimateSize: () => 40\n})\n\nconst virtualOptions = computed(() => {\n const _options = options.value\n return items.value.map((item) => {\n const option = _options[item.index]!\n return {\n option,\n index: item.index,\n label: renderOptionLabel(option),\n val: o(option).get(valueKey.value),\n key: item.index,\n offset: item.start\n }\n })\n})\n\nconst measureElement: (index: number, el: Element | null) => void = (index, el) =>\n virtualizer.measureElement(index, el)\n\nfunction scrollTo(index: number): void {\n virtualizer.scrollToIndex(index, { align: 'center' })\n}\n\nwatch([scrollRef, virtualEnabled], ([scroll, virtualEnabled]) => {\n if (!scroll || !props.modelValue) return\n\n if (virtualEnabled) {\n const index = options.value.findIndex((option) => option === selected.value)\n index !== -1 && dropdownVisible.value && nextTick(() => scrollTo(index))\n } else {\n const selectedEl = scroll?.contentRef?.getElementsByClassName('is-selected')[0]\n if (selectedEl) {\n scrollIntoContainerView(selectedEl as HTMLElement, scroll.containerRef ?? null)\n }\n }\n})\n\n/** 落定待转正的临时选项(面板 DOM 已卸载,列表恢复全量用户不可见) */\nfunction promotePendingTemp() {\n if (!pendingTempPromote) return\n pendingTempPromote = false\n temOptionsToCreatedOptions()\n}\n\nwatch(dropdownVisible, (visible) => {\n if (visible) {\n // 关闭动画期间被重新打开时补一次转正,保证已选临时项落到完整列表\n promotePendingTemp()\n // 面板展开后进入查询态并聚焦输入框,可以立即输入查询\n if (filterable.value) {\n queryString.value = ''\n querying.value = true\n nextTick(() => inputRef.value?.el?.focus())\n }\n } else {\n // 面板完全关闭(动画结束、DOM 卸载)后才清空查询串并转正,关闭动画期间列表保持过滤态\n querying.value = false\n queryString.value = ''\n promotePendingTemp()\n }\n})\n\n/** 单选:用户动作内 O(1) 写入值与文案,跳过 modelValue 回显的 O(n) 查找 */\nconst handleSelect = userAction((option: Record<string, any>, _index: number) => {\n const value = option?.[valueKey.value]\n selected.value = option\n\n emit('update:modelValue', value)\n setLabel(renderOptionLabel(option), optionEmitText(option))\n emit('change', option)\n if (option.__isTemp) {\n // 转正延迟到面板关闭后:动画期间保持过滤列表,避免列表瞬间恢复全量导致面板变长闪烁\n pendingTempPromote = true\n }\n // 立即退出查询态,输入框同步恢复显示选中标签;查询串保留至面板关闭,避免关闭动画期间列表恢复全量\n querying.value = false\n // 按当前列表定位高亮(临时项尚未转正,仍在过滤列表中,通常为 0)\n currentIndex.value = options.value.findIndex((item) => o(item).get(valueKey.value) === value)\n if (currentIndex.value >= 0) {\n selected.value = options.value[currentIndex.value]\n }\n dropdownRef.value?.close()\n})\n\n/** 清除选项 */\nconst handleClear = userAction(() => {\n selected.value = undefined\n currentIndex.value = -1\n setLabel(undefined)\n clearCreatedOptions()\n emit('update:modelValue', undefined)\n emit('change', undefined)\n})\n\nfunction getCurrentEl() {\n return scrollRef.value?.contentRef?.querySelector('li.is-selected') as HTMLElement | undefined\n}\n\nconst { handleKeydown } = useKeyboard({\n options,\n currentIndex,\n selectOption: handleSelect,\n getCurrentEl\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0JA,MAAM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AAM,CAAA,CAAE,IAAI,SAAA,KAAQ;M,IAE5BY,WAEO,KAAA,QAAA,WAFPR,WAEO,EAAA,SAAA,KAAA,GAAA;OAFS;OAAQ;MAAK,CAAA,SAEtB,CADFgB,gBAAAC,gBAAA,kBAAkB,MAAM,CAAA,GAAA,CAAA,C;;;;;;;I,OAMnCpB,UAAA,GAAAa,mBAEM,OAAA;;KAFO,OAAKJ,eAAEV,MAAA,GAAA,CAAG,CAAC,EAAC,OAAA,CAAA;I,IACvBM,YAAUN,MAAAsB,WAAA,CAAA,C;;;;;;;;;;;G,OAKhBrB,UAAA,GAAAa,mBAEWG,UAAA,EAAA,KAAA,EAAA,GAAA,CADNG,gBAAAC,gBAAA,eAAA,SAAkBrB,MAAA,kBAAA,CAAkB,GAAA,CAAA,C"}
1
+ {"version":3,"file":"select.js","names":["$attrs","$slots","_unref","_openBlock","_createBlock","UDropdown","_mergeProps","_withCtx","_createVNode","UInput","_createSlots","UIcon","_normalizeClass","_withModifiers","_renderSlot","_createCommentVNode","_createElementBlock","ULoading","UScroll","_Fragment","_renderList","_normalizeStyle","_createTextVNode","_toDisplayString","UEmpty"],"sources":["../../../src/components/select/select.vue"],"sourcesContent":["<template>\n <u-dropdown\n v-if=\"!readonly\"\n v-bind=\"$attrs\"\n trigger=\"click\"\n :class=\"[cls.b, bem.is('disabled', disabled), bem.is('focus', dropdownVisible)]\"\n ref=\"dropdownRef\"\n v-model:visible=\"dropdownVisible\"\n :content-class=\"[cls.e('panel'), cls.em('panel', size), contentClass]\"\n :content-style=\"contentStyle\"\n :disabled=\"disabled\"\n :min-width=\"minWidth\"\n :width=\"width\"\n @keydown=\"handleKeydown\"\n @mouseenter=\"hovered = true\"\n @mouseleave=\"hovered = false\"\n >\n <!-- 触发 -->\n <template #trigger>\n <u-input\n ref=\"inputRef\"\n :size=\"size\"\n :disabled=\"disabled\"\n :placeholder=\"inputPlaceholder\"\n :clearable=\"false\"\n :model-value=\"inputValue\"\n @update:model-value=\"handleQueryInput\"\n @keydown=\"handleKeydown\"\n :native-readonly=\"!filterable || !querying\"\n @click.capture=\"handleTriggerClickCapture\"\n >\n <template #prefix v-if=\"$slots.prefix\">\n <slot name=\"prefix\" />\n </template>\n\n <template #suffix>\n <u-icon\n v-if=\"showClear\"\n :class=\"cls.e('clear')\"\n title=\"清除\"\n key=\"clear\"\n @click.stop=\"handleClear\"\n >\n <Close />\n </u-icon>\n <u-icon v-else :class=\"cls.e('arrow')\" key=\"arrow\">\n <ArrowDown />\n </u-icon>\n </template>\n </u-input>\n </template>\n\n <!-- 下拉内容 -->\n <template #content>\n <!--\n 单选列表。虚拟化启用时,内容容器 height 由 useVirtualizer 命令式写入;\n 此处 content-style 仅承担 grid 相关样式,避免 height 变化触发模板重渲染。\n -->\n <div v-if=\"loading\" :class=\"cls.e('loading')\">\n <ULoading type=\"dual-ring\" />\n </div>\n <u-scroll\n v-else-if=\"options.length\"\n tag=\"ul\"\n :class=\"cls.e('options')\"\n ref=\"scrollRef\"\n :content-class=\"[\n cls.e('options-wrap'),\n bem.is('virtual', virtualEnabled),\n bem.is('grid', !!grid)\n ]\"\n :content-style=\"{\n gridTemplateColumns: grid ? `repeat(${grid.cols}, minmax(0px, 1fr))` : undefined,\n gridGap: grid ? withUnit(grid.gap, 'px') : undefined\n }\"\n >\n <template v-if=\"virtualEnabled\">\n <!-- @vue-ignore -->\n <li\n v-for=\"{ option, index, val, label, key, offset } of virtualOptions\"\n :class=\"[optionClass, bem.is('selected', index === currentIndex)]\"\n @click=\"handleSelect(option, index)\"\n :key=\"key\"\n :style=\"{ transform: `translateY(${offset}px)` }\"\n :data-index=\"index\"\n :ref=\"(el) => measureElement(index, el as Element | null)\"\n >\n <slot v-bind=\"{ option, index }\">\n {{ label }}\n </slot>\n </li>\n </template>\n\n <template v-else>\n <li\n v-for=\"(option, index) of options\"\n :class=\"[optionClass, bem.is('selected', index === currentIndex)]\"\n @click=\"handleSelect(option, index)\"\n :data-index=\"index\"\n :title=\"renderOptionLabel(option)\"\n :key=\"o(option).get(valueKey)\"\n >\n <slot v-bind=\"{ option, index }\">\n {{ renderOptionLabel(option) }}\n </slot>\n </li>\n </template>\n </u-scroll>\n\n <div v-else :class=\"cls.e('empty')\">\n <UEmpty />\n </div>\n </template>\n </u-dropdown>\n\n <template v-else>\n {{ displayedValue || FORM_EMPTY_CONTENT }}\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { o } from '@cat-kit/core'\nimport { useFormFallbackProps, useUserAction, useVirtualizer } from '@veltra/compositions'\nimport { ArrowDown, Close } from '@veltra/icons/normal'\nimport {\n bem,\n fieldKey,\n FORM_EMPTY_CONTENT,\n renderLabelTemplate,\n scrollIntoContainerView,\n withUnit\n} from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { computed, nextTick, shallowRef, useTemplateRef, watch } from 'vue'\n\nimport type {\n SelectEmits,\n SelectProps,\n _SelectExposed,\n DropdownExposed,\n InputExposed,\n ScrollExposed\n} from '../../types'\nimport { UDropdown } from '../dropdown'\nimport { UEmpty } from '../empty'\nimport { UIcon } from '../icon'\nimport { UInput } from '../input'\nimport { ULoading } from '../loading'\nimport { UScroll } from '../scroll'\nimport { useKeyboard } from './use-keyboard'\nimport { useOptions } from './use-options'\n\ndefineOptions({ name: 'USelect', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<SelectProps>(), {\n valueKey: 'value',\n placeholder: '请选择',\n clearable: true,\n disabled: undefined,\n readonly: undefined\n})\n\nconst emit = defineEmits<SelectEmits>()\n\ndefineSlots<{\n /** 前缀插槽 */\n prefix?: () => any\n /** 默认插槽 */\n default?: (scope: { option: Record<string, any>; index: number }) => any\n}>()\n\nconst cls = bem('select')\n\nconst labelKey = computed(() => fieldKey(props.labelKey, 'label'))\nconst valueKey = computed(() => fieldKey(props.valueKey, 'value'))\n\n/** 选项展示文案:labelTemplate 渲染结果优先,未配置模板或引用字段缺失时回退 labelKey 取值 */\nfunction renderOptionLabel(option: Record<string, any> | undefined) {\n if (!option) return undefined\n return renderLabelTemplate(props.labelTemplate, option) ?? o(option).get(labelKey.value)\n}\n\n/** update:text 回发文案:显式配置 labelKey 时取原始取值;未配置时模板渲染结果即标签,与展示文案一致 */\nfunction optionEmitText(option: Record<string, any>) {\n return props.labelKey === undefined ? renderOptionLabel(option) : o(option).get(labelKey.value)\n}\n\nconst optionClass = cls.e('option')\n\nconst { formProps } = injectFormContext()\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props], {\n size: 'default',\n disabled: false,\n readonly: false\n})\n\nconst currentIndex = shallowRef(-1)\n/** 内部展示文案,仅由选项推导(未命中时展示 text 兜底);经 update:text 通知父级 */\nconst label = shallowRef<string>()\nconst selected = shallowRef<Record<string, any>>()\n\nconst displayedValue = computed(() => {\n if (label.value) return label.value\n\n if (selected.value) return renderOptionLabel(selected.value)\n // 未命中选项:优先展示 text 兜底文案,避免露出不可读的编码\n return props.text ?? String(props.modelValue ?? '')\n})\n\nconst dropdownRef = shallowRef<DropdownExposed>()\nconst scrollRef = shallowRef<ScrollExposed>()\nconst inputRef = useTemplateRef<InputExposed>('inputRef')\n\nconst filterable = computed(() => {\n return props.filterable || typeof props.options === 'function'\n})\n\nconst {\n queryString,\n loading,\n options,\n allOptions,\n temOptionsToCreatedOptions,\n clearCreatedOptions\n} = useOptions({ props })\n\nconst dropdownVisible = shallowRef(false)\n\n/** 选中临时选项后待转正标记:面板关闭后再落定,避免关闭动画期间列表恢复全量导致面板变长 */\nlet pendingTempPromote = false\n\n/**\n * 是否处于查询态:决定触发输入框显示查询串还是选中标签。\n * 与面板可见状态解耦 —— 选择后立即退出查询态,\n * 不等面板关闭动画结束(否则显示值会延迟一个动画时长才恢复)。\n */\nconst querying = shallowRef(false)\n\n/** 触发输入框的值:查询态下承载查询串,否则展示选中标签 */\nconst inputValue = computed(() => {\n if (filterable.value && querying.value) return queryString.value\n return displayedValue.value\n})\n\n/** 查询态下已选标签降级为占位提示 */\nconst inputPlaceholder = computed(() => {\n if (filterable.value && querying.value && displayedValue.value) {\n return displayedValue.value\n }\n return props.placeholder\n})\n\nfunction handleQueryInput(value: string) {\n if (!filterable.value) return\n queryString.value = value\n}\n\nconst hovered = shallowRef(false)\n\n/** 悬停且存在选中值时展示清除按钮(替代下拉箭头) */\nconst showClear = computed(() => {\n return props.clearable && !disabled.value && hovered.value && !!displayedValue.value\n})\n\n/**\n * 点击输入框时在 capture 阶段完成开合。\n * 过滤模式只打开、不关闭,避免打断输入;非过滤模式切换开合。\n * 箭头和留白仍交给 dropdown 的 click。\n */\nfunction handleTriggerClickCapture(e: MouseEvent) {\n if (disabled.value) return\n if (!(e.target instanceof HTMLInputElement)) return\n\n // capture 与 dropdown 的 bubble click 会在同一毫秒内先后绑定。\n // Vue 会丢掉后绑定的那个,非过滤模式下面板就打不开。开合放在先执行的 capture 里。\n e.stopPropagation()\n if (filterable.value) {\n if (!dropdownVisible.value) dropdownRef.value?.open()\n return\n }\n if (dropdownVisible.value) dropdownRef.value?.close()\n else dropdownRef.value?.open()\n}\n\nconst { userAction, isUserActive } = useUserAction()\n\n/** 更新内部文案;值变化时 emit update:text(readonly 纯展示,不通知父级)。next:展示文案(模板渲染结果);text:回发文案(见 optionEmitText),缺省同 next */\nfunction setLabel(next?: string, text: string | undefined = next) {\n if (label.value === next) return\n label.value = next\n if (!readonly.value) emit('update:text', text)\n}\n\n/** 按 modelValue 与完整选项列表同步高亮索引、选中项与显示标签(外部回显用,O(n)) */\nfunction syncSelected(modelValue: any, sourceOptions: Record<string, any>[] | undefined) {\n // 查询输入期间高亮第一项(创建模式下通常是临时项,便于回车创建)\n if (queryString.value) {\n currentIndex.value = options.value.length ? 0 : -1\n return\n }\n\n if (!sourceOptions?.length) return\n\n if (modelValue !== undefined && modelValue !== null && modelValue !== '') {\n currentIndex.value = sourceOptions.findIndex(\n (option) => o(option).get(valueKey.value) === modelValue\n )\n selected.value = currentIndex.value >= 0 ? sourceOptions[currentIndex.value] : undefined\n if (selected.value) {\n setLabel(renderOptionLabel(selected.value), optionEmitText(selected.value))\n } else if (props.text) {\n // 未命中但有 text 兜底:文案以父级为准,不回发\n label.value = undefined\n } else {\n // 未命中且无兜底:如实通知父级当前没有可展示文案\n setLabel(undefined)\n }\n } else {\n currentIndex.value = -1\n selected.value = undefined\n setLabel(undefined)\n }\n}\n\n// 回显:以 allOptions 匹配,避免过滤列表缺项时清掉已选文案;用户动作期内跳过\nwatch(\n [() => props.modelValue, allOptions],\n ([modelValue]) => {\n if (isUserActive()) return\n syncSelected(modelValue, allOptions.value)\n },\n { immediate: true }\n)\n\n// 过滤时单独同步高亮(allOptions 不变,不会触发上方回显 watch)\nwatch([queryString, options], () => {\n if (!queryString.value) return\n currentIndex.value = options.value.length ? 0 : -1\n})\n\nconst baseVirtualEnabled = computed(() => options.value.length > 80)\nconst virtualEnabled = computed(() => baseVirtualEnabled.value && !props.grid)\n\nconst { virtualizer, items } = useVirtualizer({\n count: computed(() => options.value.length),\n scrollEl: () => scrollRef.value?.containerRef ?? null,\n contentEl: () => (virtualEnabled.value ? (scrollRef.value?.contentRef ?? null) : null),\n gap: 4,\n estimateSize: () => 40\n})\n\nconst virtualOptions = computed(() => {\n const _options = options.value\n return items.value.map((item) => {\n const option = _options[item.index]!\n return {\n option,\n index: item.index,\n label: renderOptionLabel(option),\n val: o(option).get(valueKey.value),\n key: item.index,\n offset: item.start\n }\n })\n})\n\nconst measureElement: (index: number, el: Element | null) => void = (index, el) =>\n virtualizer.measureElement(index, el)\n\nfunction scrollTo(index: number): void {\n virtualizer.scrollToIndex(index, { align: 'center' })\n}\n\nwatch([scrollRef, virtualEnabled], ([scroll, virtualEnabled]) => {\n if (!scroll || !props.modelValue) return\n\n if (virtualEnabled) {\n const index = options.value.findIndex((option) => option === selected.value)\n index !== -1 && dropdownVisible.value && nextTick(() => scrollTo(index))\n } else {\n const selectedEl = scroll?.contentRef?.getElementsByClassName('is-selected')[0]\n if (selectedEl) {\n scrollIntoContainerView(selectedEl as HTMLElement, scroll.containerRef ?? null)\n }\n }\n})\n\n/** 落定待转正的临时选项(面板 DOM 已卸载,列表恢复全量用户不可见) */\nfunction promotePendingTemp() {\n if (!pendingTempPromote) return\n pendingTempPromote = false\n temOptionsToCreatedOptions()\n}\n\nwatch(dropdownVisible, (visible) => {\n if (visible) {\n // 关闭动画期间被重新打开时补一次转正,保证已选临时项落到完整列表\n promotePendingTemp()\n // 面板展开后进入查询态并聚焦输入框,可以立即输入查询\n if (filterable.value) {\n queryString.value = ''\n querying.value = true\n nextTick(() => inputRef.value?.el?.focus())\n }\n } else {\n // 面板完全关闭(动画结束、DOM 卸载)后才清空查询串并转正,关闭动画期间列表保持过滤态\n querying.value = false\n queryString.value = ''\n promotePendingTemp()\n }\n})\n\n/** 单选:用户动作内 O(1) 写入值与文案,跳过 modelValue 回显的 O(n) 查找 */\nconst handleSelect = userAction((option: Record<string, any>, _index: number) => {\n const value = option?.[valueKey.value]\n selected.value = option\n\n emit('update:modelValue', value)\n setLabel(renderOptionLabel(option), optionEmitText(option))\n emit('change', option)\n if (option.__isTemp) {\n // 转正延迟到面板关闭后:动画期间保持过滤列表,避免列表瞬间恢复全量导致面板变长闪烁\n pendingTempPromote = true\n }\n // 立即退出查询态,输入框同步恢复显示选中标签;查询串保留至面板关闭,避免关闭动画期间列表恢复全量\n querying.value = false\n // 按当前列表定位高亮(临时项尚未转正,仍在过滤列表中,通常为 0)\n currentIndex.value = options.value.findIndex((item) => o(item).get(valueKey.value) === value)\n if (currentIndex.value >= 0) {\n selected.value = options.value[currentIndex.value]\n }\n dropdownRef.value?.close()\n})\n\n/** 清除选项 */\nconst handleClear = userAction(() => {\n selected.value = undefined\n currentIndex.value = -1\n setLabel(undefined)\n clearCreatedOptions()\n emit('update:modelValue', undefined)\n emit('change', undefined)\n})\n\nfunction getCurrentEl() {\n return scrollRef.value?.contentRef?.querySelector('li.is-selected') as HTMLElement | undefined\n}\n\nconst { handleKeydown } = useKeyboard({\n options,\n currentIndex,\n selectOption: handleSelect,\n getCurrentEl\n})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U,aAAA,KAAY,CAAA,CAAA;OAC9D,UAAK,WAAEA,MAAA,YAAA,CAAY,CAAC,QAAQ,KAAK;OACjC,cAAY;OACZ,OAAO,kBAAkB,MAAM;OAC/B,KAAKA,MAAA,CAAA,CAAC,CAAC,MAAM,CAAA,CAAE,IAAI,SAAA,KAAQ;M,IAE5BY,WAEO,KAAA,QAAA,WAFPR,WAEO,EAAA,SAAA,KAAA,GAAA;OAFS;OAAQ;MAAK,CAAA,SAEtB,CADFgB,gBAAAC,gBAAA,kBAAkB,MAAM,CAAA,GAAA,CAAA,C;;;;;;;I,OAMnCpB,UAAA,GAAAa,mBAEM,OAAA;;KAFO,OAAKJ,eAAEV,MAAA,GAAA,CAAG,CAAC,EAAC,OAAA,CAAA;I,IACvBM,YAAUN,MAAAsB,WAAA,CAAA,C;;;;;;;;;;;G,OAKhBrB,UAAA,GAAAa,mBAEWG,UAAA,EAAA,KAAA,EAAA,GAAA,CADNG,gBAAAC,gBAAA,eAAA,SAAkBrB,MAAA,kBAAA,CAAkB,GAAA,CAAA,C"}
@@ -24,6 +24,12 @@
24
24
  .u-select.is-disabled .u-select__arrow {
25
25
  color: var(--u-text-color-disabled);
26
26
  }
27
+ .u-select__arrow {
28
+ transition: transform var(--u-transition-normal) var(--u-transition-ease-out);
29
+ }
30
+ .u-select.is-focus .u-select__arrow {
31
+ transform: rotate(180deg);
32
+ }
27
33
  .u-select__clear {
28
34
  cursor: pointer;
29
35
  }
@@ -42,6 +48,7 @@
42
48
  position: absolute;
43
49
  top: 0;
44
50
  left: 0;
51
+ transition-property: background-color, color;
45
52
  }
46
53
  .u-select__options-wrap.is-grid {
47
54
  display: grid;
@@ -57,11 +64,14 @@
57
64
  width: 100%;
58
65
  box-sizing: border-box;
59
66
  color: var(--u-text-color-main);
60
- transition: background-color 0.15s ease, color 0.15s ease;
67
+ transition: background-color 0.15s ease, color 0.15s ease, transform var(--u-transition-fast) var(--u-transition-ease-out);
61
68
  overflow: hidden;
62
69
  text-overflow: ellipsis;
63
70
  white-space: nowrap;
64
71
  }
72
+ .u-select__option:not(.is-disabled):active {
73
+ transform: scale(0.98);
74
+ }
65
75
  .u-select__option:hover {
66
76
  background-color: var(--u-select-option-hover-bg, var(--u-bg-color-hover));
67
77
  color: var(--u-select-option-hover-color, var(--u-text-color-title));
@@ -65,8 +65,13 @@
65
65
  /** 步骤项 */
66
66
  }
67
67
  .u-steps__item {
68
+ cursor: pointer;
68
69
  font-weight: 600;
69
70
  color: var(--u-text-color-placeholder);
71
+ transition: color var(--u-transition-fast) var(--u-transition-ease), transform var(--u-transition-fast) var(--u-transition-ease-out);
72
+ }
73
+ .u-steps__item:active {
74
+ transform: scale(0.98);
70
75
  }
71
76
  .u-steps__node {
72
77
  position: relative;
@@ -117,11 +122,15 @@
117
122
  background-color: var(--u-bg-color-top);
118
123
  position: relative;
119
124
  z-index: 1;
120
- transition: opacity 0.3s ease;
125
+ transition: opacity 0.3s ease, color var(--u-transition-fast) var(--u-transition-ease), border-color var(--u-transition-fast) var(--u-transition-ease);
121
126
  }
122
127
  .u-steps .u-steps__item.is-current .u-steps__icon {
123
128
  animation: steps-icon-breathing 2s ease-in-out infinite;
124
- will-change: opacity;
129
+ }
130
+ @media (prefers-reduced-motion: reduce) {
131
+ .u-steps .u-steps__item.is-current .u-steps__icon {
132
+ animation: none;
133
+ }
125
134
  }
126
135
  .u-steps {
127
136
  /** 步骤项描述 */
@@ -144,6 +153,11 @@
144
153
  background-size: 10px 2px;
145
154
  animation: steps-link-flow-horizontal 1s linear infinite;
146
155
  }
156
+ @media (prefers-reduced-motion: reduce) {
157
+ .u-steps.is-horizontal .u-steps__item.is-current .u-steps__link {
158
+ animation: none;
159
+ }
160
+ }
147
161
  .u-steps.is-horizontal .u-steps__link {
148
162
  width: 100%;
149
163
  height: 2px;
@@ -177,6 +191,11 @@
177
191
  background-size: 2px 10px;
178
192
  animation: steps-link-flow-vertical 1s linear infinite;
179
193
  }
194
+ @media (prefers-reduced-motion: reduce) {
195
+ .u-steps.is-vertical .u-steps__item.is-current .u-steps__link {
196
+ animation: none;
197
+ }
198
+ }
180
199
  .u-steps.is-vertical .u-steps__link {
181
200
  height: 100%;
182
201
  width: 2px;
@@ -45,6 +45,9 @@
45
45
  .u-switch:not(.is-disabled):not(.is-readonly):hover.is-checked .u-switch__button {
46
46
  background-color: var(--u-color-primary-dark-1);
47
47
  }
48
+ .u-switch:not(.is-disabled):not(.is-readonly):active .u-switch__button {
49
+ transform: scale(0.98);
50
+ }
48
51
  .u-switch:not(.is-disabled):not(.is-readonly) .u-switch__native:focus-visible ~ .u-switch__button {
49
52
  box-shadow: var(--u-focus-ring);
50
53
  }
@@ -86,7 +89,7 @@
86
89
  border-radius: 100px;
87
90
  background-color: var(--u-bg-color-bottom);
88
91
  border: 1px solid var(--u-border-muted-color);
89
- transition: background-color var(--u-transition-fast) var(--u-transition-ease), border-color var(--u-transition-fast) var(--u-transition-ease), box-shadow var(--u-transition-fast) var(--u-transition-ease);
92
+ transition: background-color var(--u-transition-fast) var(--u-transition-ease), border-color var(--u-transition-fast) var(--u-transition-ease), box-shadow var(--u-transition-fast) var(--u-transition-ease), transform var(--u-transition-fast) var(--u-transition-ease-out);
90
93
  padding: 2px;
91
94
  flex-shrink: 0;
92
95
  }
@@ -94,10 +97,15 @@
94
97
  display: block;
95
98
  background-color: var(--u-bg-color-top);
96
99
  border-radius: 50%;
97
- box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
100
+ box-shadow: var(--u-shadow-sm);
98
101
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
99
102
  pointer-events: none;
100
103
  }
104
+ @media (prefers-reduced-motion: reduce) {
105
+ .u-switch__thumb {
106
+ transition: none;
107
+ }
108
+ }
101
109
  .u-switch__text {
102
110
  font-weight: 500;
103
111
  }
@@ -88,7 +88,7 @@
88
88
  margin-right: var(--u-gap-small);
89
89
  }
90
90
  .u-table__expand-toggle > i, .u-table__expand-all > i {
91
- transition: transform 0.25s;
91
+ transition: transform var(--u-transition-normal) var(--u-transition-ease);
92
92
  }
93
93
  .u-table.is-all-expanded .u-table__expand-all > i {
94
94
  transform: rotate(90deg);
@@ -110,7 +110,7 @@
110
110
  .u-table__head {
111
111
  position: sticky;
112
112
  top: 0;
113
- z-index: 1;
113
+ z-index: 2;
114
114
  user-select: none;
115
115
  }
116
116
  .u-table__head .u-table__cell {
@@ -131,6 +131,10 @@
131
131
  right: 0px;
132
132
  top: 0;
133
133
  cursor: col-resize;
134
+ transition: background-color var(--u-transition-fast) var(--u-transition-ease);
135
+ }
136
+ .u-table__resize-handle:hover, .u-table__resize-handle:active {
137
+ background-color: var(--u-color-primary);
134
138
  }
135
139
  .u-table__resize-line {
136
140
  pointer-events: none;
@@ -141,9 +145,6 @@
141
145
  z-index: 1;
142
146
  background-color: var(--u-table-border-color);
143
147
  }
144
- .u-table__body {
145
- will-change: transform;
146
- }
147
148
  .u-table__body .u-table__row:last-child .u-table__cell {
148
149
  border-bottom: none;
149
150
  }
@@ -161,6 +162,7 @@
161
162
  position: sticky;
162
163
  left: 0;
163
164
  bottom: 0;
165
+ z-index: 2;
164
166
  }
165
167
  .u-table__foot .u-table__cell {
166
168
  border-top: 1px solid var(--u-table-border-color);
@@ -173,6 +175,7 @@
173
175
  margin-bottom: -1px;
174
176
  position: relative;
175
177
  line-height: 1;
178
+ transition: background-color var(--u-transition-fast) var(--u-transition-ease);
176
179
  }
177
180
  .u-table__cell.is-left {
178
181
  text-align: left;
@@ -191,7 +194,7 @@
191
194
  position: sticky;
192
195
  z-index: 1;
193
196
  }
194
- .u-table__cell.is-fixed-left.is-last-fixed::after {
197
+ .u-table__cell.is-fixed-left::after {
195
198
  content: "";
196
199
  position: absolute;
197
200
  right: -10px;
@@ -200,8 +203,13 @@
200
203
  height: 100%;
201
204
  pointer-events: none;
202
205
  box-shadow: 10px 0 10px -10px var(--u-shadow-color) inset;
206
+ opacity: 0;
207
+ transition: opacity var(--u-transition-fast) var(--u-transition-ease);
203
208
  }
204
- .u-table__cell.is-fixed-right.is-first-fixed::before {
209
+ .u-table__cell.is-fixed-left.is-last-fixed::after {
210
+ opacity: 1;
211
+ }
212
+ .u-table__cell.is-fixed-right::before {
205
213
  content: "";
206
214
  position: absolute;
207
215
  left: -10px;
@@ -210,6 +218,11 @@
210
218
  height: 100%;
211
219
  pointer-events: none;
212
220
  box-shadow: -10px 0 10px -10px var(--u-shadow-color) inset;
221
+ opacity: 0;
222
+ transition: opacity var(--u-transition-fast) var(--u-transition-ease);
223
+ }
224
+ .u-table__cell.is-fixed-right.is-first-fixed::before {
225
+ opacity: 1;
213
226
  }
214
227
  .u-table__resizer {
215
228
  position: absolute;
@@ -103,7 +103,10 @@
103
103
  align-items: center;
104
104
  justify-content: center;
105
105
  gap: 0;
106
- transition: color 0.22s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
106
+ transition: color 0.22s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform var(--u-transition-fast) var(--u-transition-ease-out);
107
+ }
108
+ .u-tabs-bar__item:active:not(.is-disabled) {
109
+ transform: scale(0.97);
107
110
  }
108
111
  .u-tabs-bar__item:not(.is-active):not(.is-disabled):hover {
109
112
  color: var(--u-text-color-title);
@@ -180,13 +183,16 @@
180
183
  cursor: pointer;
181
184
  user-select: none;
182
185
  border-radius: calc(var(--u-radius-default) - 2px);
183
- transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
186
+ transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform var(--u-transition-fast) var(--u-transition-ease-out);
184
187
  }
185
188
  .u-tabs-bar__nav:hover:not(:disabled) {
186
189
  color: var(--u-text-color-title);
187
190
  background-color: var(--u-tabs-active-bg, var(--u-bg-color-top));
188
191
  box-shadow: var(--u-shadow-sm);
189
192
  }
193
+ .u-tabs-bar__nav:active:not(:disabled) {
194
+ transform: scale(0.95);
195
+ }
190
196
  .u-tabs-bar__nav:disabled {
191
197
  cursor: not-allowed;
192
198
  opacity: 0.4;
@@ -245,7 +251,7 @@
245
251
  border-radius: calc(var(--u-radius-default) - 2px);
246
252
  background-color: var(--u-tabs-active-bg, var(--u-bg-color-top));
247
253
  box-shadow: var(--u-shadow-sm);
248
- transition: transform 200ms cubic-bezier(0.77, 0, 0.175, 1);
254
+ transition: transform 200ms cubic-bezier(0.77, 0, 0.175, 1), width 200ms cubic-bezier(0.77, 0, 0.175, 1);
249
255
  }
250
256
  @media (prefers-reduced-motion: reduce) {
251
257
  .u-tabs-bar--horizontal .u-tabs-bar__indicator {
@@ -38,6 +38,15 @@
38
38
  cursor: pointer;
39
39
  flex-shrink: 0;
40
40
  border-radius: 50%;
41
+ border: 1px solid transparent;
42
+ transition: border-color var(--u-transition-fast) var(--u-transition-ease), background-color var(--u-transition-fast) var(--u-transition-ease), transform var(--u-transition-fast) var(--u-transition-ease-out);
43
+ }
44
+ .u-tag__icon-close:hover {
45
+ background-color: var(--u-text-color-title-a-8);
46
+ }
47
+ .u-tag__icon-close:active {
48
+ transform: scale(0.92);
49
+ transition-duration: 0s;
41
50
  }
42
51
  .u-tag--small {
43
52
  height: var(--u-tag-small);
@@ -88,7 +97,7 @@
88
97
  background-color: var(--u-tag-primary-dark-bg, var(--u-color-primary));
89
98
  }
90
99
  .u-tag--color-primary .u-tag__icon-close:hover {
91
- border: 1px solid var(--u-color-primary);
100
+ border-color: var(--u-color-primary);
92
101
  }
93
102
  .u-tag--color-success {
94
103
  color: var(--u-tag-success-color, var(--u-color-success));
@@ -100,7 +109,7 @@
100
109
  background-color: var(--u-tag-success-dark-bg, var(--u-color-success));
101
110
  }
102
111
  .u-tag--color-success .u-tag__icon-close:hover {
103
- border: 1px solid var(--u-color-success);
112
+ border-color: var(--u-color-success);
104
113
  }
105
114
  .u-tag--color-warning {
106
115
  color: var(--u-tag-warning-color, var(--u-color-warning));
@@ -112,7 +121,7 @@
112
121
  background-color: var(--u-tag-warning-dark-bg, var(--u-color-warning));
113
122
  }
114
123
  .u-tag--color-warning .u-tag__icon-close:hover {
115
- border: 1px solid var(--u-color-warning);
124
+ border-color: var(--u-color-warning);
116
125
  }
117
126
  .u-tag--color-danger {
118
127
  color: var(--u-tag-danger-color, var(--u-color-danger));
@@ -124,7 +133,7 @@
124
133
  background-color: var(--u-tag-danger-dark-bg, var(--u-color-danger));
125
134
  }
126
135
  .u-tag--color-danger .u-tag__icon-close:hover {
127
- border: 1px solid var(--u-color-danger);
136
+ border-color: var(--u-color-danger);
128
137
  }
129
138
  .u-tag--color-info {
130
139
  color: var(--u-tag-info-color, var(--u-color-info));
@@ -136,7 +145,7 @@
136
145
  background-color: var(--u-tag-info-dark-bg, var(--u-color-info));
137
146
  }
138
147
  .u-tag--color-info .u-tag__icon-close:hover {
139
- border: 1px solid var(--u-color-info);
148
+ border-color: var(--u-color-info);
140
149
  }
141
150
  .u-tag--color-disabled {
142
151
  color: var(--u-tag-disabled-color, var(--u-color-disabled));
@@ -148,7 +157,7 @@
148
157
  background-color: var(--u-tag-disabled-dark-bg, var(--u-color-disabled));
149
158
  }
150
159
  .u-tag--color-disabled .u-tag__icon-close:hover {
151
- border: 1px solid var(--u-color-disabled);
160
+ border-color: var(--u-color-disabled);
152
161
  }
153
162
  .u-tag--color-default {
154
163
  color: var(--u-tag-default-color, var(--u-color-default));
@@ -160,7 +169,7 @@
160
169
  background-color: var(--u-tag-default-dark-bg, var(--u-color-default));
161
170
  }
162
171
  .u-tag--color-default .u-tag__icon-close:hover {
163
- border: 1px solid var(--u-color-default);
172
+ border-color: var(--u-color-default);
164
173
  }
165
174
 
166
175
  @keyframes tag-zoom-in {
@@ -20,7 +20,7 @@
20
20
  width: 100%;
21
21
  border: var(--u-border-muted);
22
22
  box-shadow: var(--u-shadow-emboss);
23
- transition: border-color 0.25s ease, box-shadow 0.25s ease;
23
+ transition: border-color var(--u-transition-fast) var(--u-transition-ease), box-shadow var(--u-transition-fast) var(--u-transition-ease);
24
24
  overflow: hidden;
25
25
  vertical-align: middle;
26
26
  }
@@ -108,4 +108,12 @@
108
108
  cursor: pointer;
109
109
  color: var(--u-text-color-main);
110
110
  min-width: 20px;
111
+ transition: color var(--u-transition-fast) var(--u-transition-ease), transform var(--u-transition-fast) var(--u-transition-ease-out);
112
+ }
113
+ .u-textarea--clear:hover {
114
+ color: var(--u-color-primary);
115
+ }
116
+ .u-textarea--clear:active {
117
+ transform: translateY(-50%) scale(0.92);
118
+ transition-duration: 0s;
111
119
  }
@@ -24,8 +24,8 @@
24
24
  padding: 14px;
25
25
  border: var(--u-border);
26
26
  border-radius: var(--u-radius-large);
27
- background: radial-gradient(circle at top right, rgba(30, 136, 229, 0.14), transparent 36%), linear-gradient(180deg, var(--u-bg-color-top) 0%, var(--u-bg-color-middle) 100%);
28
- box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
27
+ background: radial-gradient(circle at top right, var(--u-color-primary-a-16), transparent 36%), linear-gradient(180deg, var(--u-bg-color-top) 0%, var(--u-bg-color-middle) 100%);
28
+ box-shadow: var(--u-shadow-lg), inset 0 1px 0 var(--u-text-color-white-a-70);
29
29
  backdrop-filter: var(--u-bg-filter);
30
30
  -webkit-backdrop-filter: var(--u-bg-filter);
31
31
  overflow: hidden;
@@ -53,7 +53,7 @@
53
53
  height: 24px;
54
54
  padding: 0 10px;
55
55
  border-radius: 999px;
56
- background: rgba(30, 136, 229, 0.08);
56
+ background: var(--u-color-primary-a-8);
57
57
  color: var(--u-color-primary);
58
58
  font-size: 12px;
59
59
  font-weight: 700;
@@ -86,17 +86,20 @@
86
86
  padding: 0 14px;
87
87
  border-radius: 999px;
88
88
  color: var(--u-text-color-second);
89
- background: rgba(148, 163, 184, 0.12);
90
- transition: background-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
89
+ background: var(--u-border-color-a-11);
90
+ transition: background-color var(--u-transition-normal) var(--u-transition-ease), color var(--u-transition-normal) var(--u-transition-ease), box-shadow var(--u-transition-normal) var(--u-transition-ease), transform var(--u-transition-normal) var(--u-transition-ease-out);
91
91
  }
92
92
  .u-theme__toggle:hover {
93
- background: rgba(148, 163, 184, 0.18);
93
+ background: var(--u-border-color-a-16);
94
94
  color: var(--u-text-color-title);
95
95
  }
96
+ .u-theme__toggle:active {
97
+ transform: translateY(0) scale(0.98);
98
+ }
96
99
  .u-theme__toggle.is-active {
97
- background: rgba(30, 136, 229, 0.12);
100
+ background: var(--u-color-primary-a-11);
98
101
  color: var(--u-color-primary);
99
- box-shadow: inset 0 0 0 1px rgba(30, 136, 229, 0.18);
102
+ box-shadow: inset 0 0 0 1px var(--u-color-primary-a-16);
100
103
  }
101
104
  .u-theme__nav {
102
105
  display: flex;
@@ -112,7 +115,7 @@
112
115
  }
113
116
  .u-theme__nav::-webkit-scrollbar-thumb {
114
117
  border-radius: 4px;
115
- background: rgba(148, 163, 184, 0.2);
118
+ background: var(--u-border-color-a-22);
116
119
  }
117
120
  .u-theme__nav-item {
118
121
  display: grid;
@@ -121,22 +124,25 @@
121
124
  text-align: left;
122
125
  border-radius: var(--u-radius-default);
123
126
  background: var(--u-bg-color-top);
124
- border: 1px solid rgba(148, 163, 184, 0.12);
125
- transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease, transform 0.22s ease;
127
+ border: 1px solid var(--u-border-color-a-11);
128
+ transition: background-color var(--u-transition-normal) var(--u-transition-ease), border-color var(--u-transition-normal) var(--u-transition-ease), box-shadow var(--u-transition-normal) var(--u-transition-ease), opacity var(--u-transition-normal) var(--u-transition-ease), transform var(--u-transition-normal) var(--u-transition-ease-out);
126
129
  }
127
130
  .u-theme__nav-item:hover {
128
131
  background: var(--u-bg-color-hover);
129
- border-color: rgba(30, 136, 229, 0.16);
132
+ border-color: var(--u-color-primary-a-16);
130
133
  }
131
134
  @media (hover: hover) and (pointer: fine) {
132
135
  .u-theme__nav-item:hover {
133
136
  transform: translateY(-1px);
134
137
  }
135
138
  }
139
+ .u-theme__nav-item:not(.is-disabled):active {
140
+ transform: translateY(0) scale(0.98);
141
+ }
136
142
  .u-theme__nav-item.is-active {
137
- background: linear-gradient(135deg, rgba(30, 136, 229, 0.14), var(--u-bg-color-top));
138
- border-color: rgba(30, 136, 229, 0.22);
139
- box-shadow: 0 8px 20px rgba(30, 136, 229, 0.12);
143
+ background: linear-gradient(135deg, var(--u-color-primary-a-16), var(--u-bg-color-top));
144
+ border-color: var(--u-color-primary-a-22);
145
+ box-shadow: 0 8px 20px var(--u-color-primary-a-11);
140
146
  }
141
147
  .u-theme__nav-item.is-disabled {
142
148
  opacity: 0.55;
@@ -156,7 +162,7 @@
156
162
  min-height: 0;
157
163
  border-radius: var(--u-radius-large);
158
164
  background: linear-gradient(180deg, var(--u-bg-color-top), var(--u-bg-color-middle));
159
- border: 1px solid rgba(148, 163, 184, 0.16);
165
+ border: 1px solid var(--u-border-color-a-16);
160
166
  display: flex;
161
167
  flex-direction: column;
162
168
  overflow: hidden;
@@ -167,7 +173,7 @@
167
173
  justify-content: space-between;
168
174
  gap: 12px;
169
175
  padding: 14px 14px 12px;
170
- border-bottom: 1px solid rgba(148, 163, 184, 0.1);
176
+ border-bottom: 1px solid var(--u-border-color-a-10);
171
177
  }
172
178
  .u-theme__panel-title {
173
179
  margin: 0;
@@ -184,7 +190,7 @@
184
190
  flex-shrink: 0;
185
191
  padding: 4px 10px;
186
192
  border-radius: 999px;
187
- background: rgba(30, 136, 229, 0.08);
193
+ background: var(--u-color-primary-a-8);
188
194
  color: var(--u-color-primary);
189
195
  font-size: var(--u-font-size-assist-default);
190
196
  font-weight: 700;
@@ -204,16 +210,16 @@
204
210
  padding: 12px;
205
211
  border-radius: var(--u-radius-default);
206
212
  background: var(--u-bg-color-top);
207
- border: 1px solid rgba(148, 163, 184, 0.14);
208
- transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
213
+ border: 1px solid var(--u-border-color-a-16);
214
+ transition: border-color var(--u-transition-normal) var(--u-transition-ease), box-shadow var(--u-transition-normal) var(--u-transition-ease), background-color var(--u-transition-normal) var(--u-transition-ease);
209
215
  }
210
216
  .u-theme__item:hover {
211
- border-color: rgba(30, 136, 229, 0.16);
212
- box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
217
+ border-color: var(--u-color-primary-a-16);
218
+ box-shadow: var(--u-shadow-sm);
213
219
  }
214
220
  .u-theme__item.is-changed {
215
- background: linear-gradient(135deg, rgba(30, 136, 229, 0.08), var(--u-bg-color-top));
216
- border-color: rgba(30, 136, 229, 0.18);
221
+ background: linear-gradient(135deg, var(--u-color-primary-a-8), var(--u-bg-color-top));
222
+ border-color: var(--u-color-primary-a-16);
217
223
  }
218
224
  .u-theme__item-head {
219
225
  display: flex;
@@ -255,7 +261,7 @@
255
261
  flex-shrink: 0;
256
262
  padding: 2px 8px;
257
263
  border-radius: 999px;
258
- background: rgba(30, 136, 229, 0.1);
264
+ background: var(--u-color-primary-a-10);
259
265
  color: var(--u-color-primary);
260
266
  font-size: 11px;
261
267
  font-weight: 700;
@@ -278,7 +284,7 @@
278
284
  }
279
285
  .u-theme__palette-custom .u-palette {
280
286
  flex-shrink: 0;
281
- box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
287
+ box-shadow: 0 0 0 1px var(--u-border-color-a-5);
282
288
  }
283
289
  .u-theme__palette-custom .u-input {
284
290
  flex: 1;
@@ -332,15 +338,18 @@
332
338
  padding: 0 12px;
333
339
  border-radius: var(--u-radius-default);
334
340
  background: var(--u-bg-color-top);
335
- border: 1px solid rgba(148, 163, 184, 0.16);
341
+ border: 1px solid var(--u-border-color-a-16);
336
342
  color: var(--u-text-color-main);
337
- transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
343
+ transition: background-color var(--u-transition-normal) var(--u-transition-ease), border-color var(--u-transition-normal) var(--u-transition-ease), color var(--u-transition-normal) var(--u-transition-ease), transform var(--u-transition-normal) var(--u-transition-ease-out);
338
344
  }
339
345
  .u-theme__preset:hover {
340
- border-color: rgba(30, 136, 229, 0.18);
346
+ border-color: var(--u-color-primary-a-16);
341
347
  color: var(--u-color-primary);
342
348
  background: var(--u-bg-color-hover);
343
349
  }
350
+ .u-theme__preset:active {
351
+ transform: translateY(0) scale(0.98);
352
+ }
344
353
  .u-theme__action-btn {
345
354
  min-width: 74px;
346
355
  }
@@ -91,7 +91,10 @@
91
91
  cursor: pointer;
92
92
  user-select: none;
93
93
  color: var(--u-text-color-main);
94
- transition: background-color var(--u-transition-fast) var(--u-transition-ease);
94
+ transition: background-color var(--u-transition-fast) var(--u-transition-ease), transform var(--u-transition-fast) var(--u-transition-ease-out);
95
+ }
96
+ .u-time-picker__item:not(.is-disabled):active {
97
+ transform: scale(0.97);
95
98
  }
96
99
  .u-time-picker__item:hover {
97
100
  background-color: var(--u-bg-color-hover);