@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.
- package/dist/components/alert/alert.js +31 -28
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert/style.d.ts +1 -1
- package/dist/components/alert/style.js +1 -0
- package/dist/components/alert/style2.css +5 -1
- package/dist/components/auto-complete/style2.css +1 -0
- package/dist/components/back-top/style2.css +11 -2
- package/dist/components/badge/badge.js +15 -15
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/badge/style2.css +10 -1
- package/dist/components/batch-edit/batch-edit-form.js +108 -97
- package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
- package/dist/components/batch-edit/batch-edit.js +11 -5
- package/dist/components/batch-edit/batch-edit.js.map +1 -1
- package/dist/components/batch-edit/style2.css +25 -1
- package/dist/components/breadcrumb/style2.css +4 -1
- package/dist/components/button/style2.css +3 -2
- package/dist/components/carousel/carousel.js +5 -3
- package/dist/components/carousel/carousel.js.map +1 -1
- package/dist/components/carousel/style2.css +7 -1
- package/dist/components/carousel/use-carousel.js +16 -2
- package/dist/components/carousel/use-carousel.js.map +1 -1
- package/dist/components/cascade/style2.css +16 -0
- package/dist/components/check-tag/check-tag.js +11 -5
- package/dist/components/check-tag/check-tag.js.map +1 -1
- package/dist/components/check-tag/style2.css +10 -0
- package/dist/components/checkbox/checkbox-button.js +8 -3
- package/dist/components/checkbox/checkbox-button.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +5 -9
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/checkbox/style2.css +32 -2
- package/dist/components/chip/style2.css +4 -0
- package/dist/components/code-editor/code-editor.js +26 -3
- package/dist/components/code-editor/code-editor.js.map +1 -1
- package/dist/components/code-editor/style2.css +38 -3
- package/dist/components/collapse/collapse-item.js +4 -1
- package/dist/components/collapse/collapse-item.js.map +1 -1
- package/dist/components/collapse/collapse.js +1 -1
- package/dist/components/collapse/collapse.js.map +1 -1
- package/dist/components/collapse/style2.css +6 -3
- package/dist/components/condition-editor/style2.css +24 -6
- package/dist/components/contextmenu/contextmenu-sub.js +13 -7
- package/dist/components/contextmenu/contextmenu-sub.js.map +1 -1
- package/dist/components/contextmenu/style2.css +14 -1
- package/dist/components/date-panel/style2.css +9 -1
- package/dist/components/dialog/style2.css +5 -1
- package/dist/components/dialog/use-maximum.js +6 -0
- package/dist/components/dialog/use-maximum.js.map +1 -1
- package/dist/components/drawer/style2.css +4 -0
- package/dist/components/dual-nav/style2.css +5 -2
- package/dist/components/expression-editor/style2.css +17 -5
- package/dist/components/file-viewer/style2.css +8 -2
- package/dist/components/float-button/float-button.js +1 -1
- package/dist/components/float-button/float-button.js.map +1 -1
- package/dist/components/float-button/style2.css +2 -3
- package/dist/components/form-item/style2.css +13 -1
- package/dist/components/grid-input/style2.css +15 -3
- package/dist/components/group-nav/style2.css +16 -7
- package/dist/components/icon/style2.css +1 -1
- package/dist/components/image-cropper/style2.css +4 -1
- package/dist/components/image-previewer/image-previewer.js +14 -2
- package/dist/components/image-previewer/image-previewer.js.map +1 -1
- package/dist/components/image-previewer/style.d.ts +1 -1
- package/dist/components/image-previewer/style.js +1 -0
- package/dist/components/image-previewer/style2.css +9 -14
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/input/style2.css +13 -1
- package/dist/components/kanban/kanban-column.js +1 -0
- package/dist/components/kanban/kanban-column.js.map +1 -1
- package/dist/components/kanban/style2.css +6 -2
- package/dist/components/layout/layout-resizer.js +8 -1
- package/dist/components/layout/layout-resizer.js.map +1 -1
- package/dist/components/layout/layout.js +11 -1
- package/dist/components/layout/layout.js.map +1 -1
- package/dist/components/layout/style2.css +22 -0
- package/dist/components/loading/style2.css +26 -7
- package/dist/components/message/style2.css +18 -2
- package/dist/components/message-confirm/style2.css +11 -0
- package/dist/components/multi-select/multi-select.js +21 -18
- package/dist/components/multi-select/multi-select.js.map +1 -1
- package/dist/components/multi-select/style2.css +13 -0
- package/dist/components/nav/nav-sub.js +8 -2
- package/dist/components/nav/nav-sub.js.map +1 -1
- package/dist/components/nav/style2.css +50 -26
- package/dist/components/notification/style2.css +21 -0
- package/dist/components/number-input/style2.css +5 -2
- package/dist/components/paginator/style2.css +1 -0
- package/dist/components/password-input/style2.css +10 -1
- package/dist/components/pop-confirm/pop-confirm.js +1 -1
- package/dist/components/pop-confirm/pop-confirm.js.map +1 -1
- package/dist/components/progress/style2.css +2 -2
- package/dist/components/progress-nodes/style2.css +3 -3
- package/dist/components/radio/radio.js +1 -4
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/radio/style2.css +11 -1
- package/dist/components/rate/style2.css +7 -0
- package/dist/components/rich-text-editor/style2.css +6 -3
- package/dist/components/scroll/style2.css +2 -2
- package/dist/components/segment/segment.js +5 -1
- package/dist/components/segment/segment.js.map +1 -1
- package/dist/components/segment/style2.css +6 -0
- package/dist/components/select/select.js +5 -1
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select/style2.css +11 -1
- package/dist/components/steps/style2.css +21 -2
- package/dist/components/switch/style2.css +10 -2
- package/dist/components/table/style2.css +20 -7
- package/dist/components/tabs/style2.css +9 -3
- package/dist/components/tag/style2.css +16 -7
- package/dist/components/textarea/style2.css +9 -1
- package/dist/components/theme/style2.css +38 -29
- package/dist/components/time-picker/style2.css +4 -1
- package/dist/components/tip/style2.css +11 -0
- package/dist/components/transfer/style2.css +21 -1
- package/dist/components/transfer/transfer-list.js +20 -17
- package/dist/components/transfer/transfer-list.js.map +1 -1
- package/dist/components/tree/style2.css +5 -2
- package/package.json +1 -1
- package/src/components/alert/alert.vue +18 -16
- package/src/components/alert/style.scss +9 -1
- package/src/components/alert/style.ts +1 -0
- package/src/components/auto-complete/style.scss +3 -0
- package/src/components/back-top/style.scss +17 -3
- package/src/components/badge/badge.vue +6 -7
- package/src/components/badge/style.scss +20 -1
- package/src/components/batch-edit/__test__/batch-edit.test.ts +10 -0
- package/src/components/batch-edit/batch-edit-form.vue +95 -83
- package/src/components/batch-edit/batch-edit.vue +18 -3
- package/src/components/batch-edit/style.scss +39 -3
- package/src/components/breadcrumb/style.scss +5 -1
- package/src/components/button/style.scss +4 -2
- package/src/components/carousel/carousel.vue +8 -2
- package/src/components/carousel/style.scss +10 -1
- package/src/components/carousel/use-carousel.ts +17 -2
- package/src/components/cascade/style.scss +27 -0
- package/src/components/check-tag/check-tag.vue +13 -3
- package/src/components/check-tag/style.scss +21 -0
- package/src/components/checkbox/checkbox-button.vue +11 -1
- package/src/components/checkbox/checkbox.vue +6 -2
- package/src/components/checkbox/style.scss +51 -2
- package/src/components/chip/style.scss +11 -0
- package/src/components/code-editor/code-editor.vue +24 -3
- package/src/components/code-editor/style.scss +54 -4
- package/src/components/collapse/collapse-item.vue +10 -1
- package/src/components/collapse/collapse.vue +3 -1
- package/src/components/collapse/style.scss +10 -7
- package/src/components/condition-editor/style.scss +39 -12
- package/src/components/contextmenu/contextmenu-sub.vue +9 -7
- package/src/components/contextmenu/style.scss +17 -1
- package/src/components/date-panel/style.scss +22 -1
- package/src/components/dialog/style.scss +6 -1
- package/src/components/dialog/use-maximum.ts +8 -0
- package/src/components/drawer/style.scss +5 -0
- package/src/components/dual-nav/style.scss +9 -4
- package/src/components/expression-editor/style.scss +27 -9
- package/src/components/file-viewer/style.scss +12 -2
- package/src/components/float-button/float-button.vue +1 -1
- package/src/components/float-button/style.scss +4 -3
- package/src/components/form-item/style.scss +16 -2
- package/src/components/grid-input/style.scss +6 -1
- package/src/components/group-nav/style.scss +30 -13
- package/src/components/icon/style.scss +2 -1
- package/src/components/image-cropper/style.scss +6 -1
- package/src/components/image-previewer/image-previewer.vue +20 -2
- package/src/components/image-previewer/style.scss +17 -14
- package/src/components/image-previewer/style.ts +1 -0
- package/src/components/input/input.vue +2 -8
- package/src/components/input/style.scss +19 -1
- package/src/components/kanban/kanban-column.vue +2 -0
- package/src/components/kanban/style.scss +11 -2
- package/src/components/layout/__test__/layout.test.ts +135 -0
- package/src/components/layout/layout-resizer.vue +8 -1
- package/src/components/layout/layout.vue +17 -1
- package/src/components/layout/style.scss +31 -6
- package/src/components/loading/style.scss +39 -8
- package/src/components/message/style.scss +20 -2
- package/src/components/message-confirm/style.scss +13 -0
- package/src/components/multi-select/multi-select.vue +13 -10
- package/src/components/multi-select/style.scss +14 -0
- package/src/components/multi-tree-select/__test__/multi-tree-select.test.ts +4 -2
- package/src/components/nav/nav-sub.vue +10 -2
- package/src/components/nav/style.scss +37 -13
- package/src/components/notification/style.scss +13 -0
- package/src/components/number-input/style.scss +8 -2
- package/src/components/paginator/style.scss +3 -0
- package/src/components/password-input/style.scss +15 -1
- package/src/components/pop-confirm/pop-confirm.vue +1 -1
- package/src/components/progress/style.scss +3 -3
- package/src/components/progress-nodes/style.scss +5 -5
- package/src/components/radio/radio.vue +1 -1
- package/src/components/radio/style.scss +19 -1
- package/src/components/rate/style.scss +9 -0
- package/src/components/rich-text-editor/style.scss +11 -6
- package/src/components/scroll/style.scss +3 -3
- package/src/components/segment/segment.vue +13 -1
- package/src/components/segment/style.scss +13 -3
- package/src/components/select/select.vue +1 -1
- package/src/components/select/style.scss +22 -1
- package/src/components/steps/style.scss +27 -5
- package/src/components/switch/style.scss +13 -2
- package/src/components/table/style.scss +44 -20
- package/src/components/tabs/style.scss +16 -3
- package/src/components/tag/style.scss +18 -1
- package/src/components/textarea/style.scss +15 -2
- package/src/components/theme/style.scss +62 -40
- package/src/components/time-picker/style.scss +9 -1
- package/src/components/tip/style.scss +13 -0
- package/src/components/transfer/style.scss +31 -1
- package/src/components/transfer/transfer-list.vue +18 -15
- package/src/components/tree/style.scss +8 -3
|
@@ -140,3 +140,14 @@
|
|
|
140
140
|
opacity: 0;
|
|
141
141
|
transform: scale(0.96);
|
|
142
142
|
}
|
|
143
|
+
|
|
144
|
+
@media (prefers-reduced-motion: reduce) {
|
|
145
|
+
.tip-enter-active,
|
|
146
|
+
.tip-leave-active {
|
|
147
|
+
transition-property: opacity;
|
|
148
|
+
}
|
|
149
|
+
.tip-enter-from,
|
|
150
|
+
.tip-leave-to {
|
|
151
|
+
transform: none;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -79,12 +79,13 @@
|
|
|
79
79
|
cursor: not-allowed;
|
|
80
80
|
}
|
|
81
81
|
.u-transfer-list__body {
|
|
82
|
-
flex:
|
|
82
|
+
flex: none;
|
|
83
83
|
height: 240px;
|
|
84
84
|
margin: 0;
|
|
85
85
|
padding: 0;
|
|
86
86
|
list-style: none;
|
|
87
87
|
overflow-y: auto;
|
|
88
|
+
position: relative;
|
|
88
89
|
}
|
|
89
90
|
.u-transfer-list__item {
|
|
90
91
|
cursor: pointer;
|
|
@@ -93,6 +94,10 @@
|
|
|
93
94
|
justify-content: flex-start;
|
|
94
95
|
align-items: center;
|
|
95
96
|
flex-wrap: nowrap;
|
|
97
|
+
transition: background-color var(--u-transition-fast) var(--u-transition-ease);
|
|
98
|
+
}
|
|
99
|
+
.u-transfer-list__item:not(.is-disabled):active {
|
|
100
|
+
background-color: var(--u-bg-color-hover);
|
|
96
101
|
}
|
|
97
102
|
.u-transfer-list__item:hover {
|
|
98
103
|
background-color: var(--u-bg-color-hover);
|
|
@@ -109,6 +114,21 @@
|
|
|
109
114
|
text-overflow: ellipsis;
|
|
110
115
|
white-space: nowrap;
|
|
111
116
|
}
|
|
117
|
+
.u-transfer-list .u-transfer-list-enter-active,
|
|
118
|
+
.u-transfer-list .u-transfer-list-leave-active {
|
|
119
|
+
transition: opacity var(--u-transition-fast) var(--u-transition-ease-out);
|
|
120
|
+
}
|
|
121
|
+
.u-transfer-list .u-transfer-list-enter-from,
|
|
122
|
+
.u-transfer-list .u-transfer-list-leave-to {
|
|
123
|
+
opacity: 0;
|
|
124
|
+
}
|
|
125
|
+
.u-transfer-list .u-transfer-list-leave-active {
|
|
126
|
+
position: absolute;
|
|
127
|
+
width: 100%;
|
|
128
|
+
}
|
|
129
|
+
.u-transfer-list .u-transfer-list-move {
|
|
130
|
+
transition: transform var(--u-transition-normal) var(--u-transition-ease);
|
|
131
|
+
}
|
|
112
132
|
.u-transfer-list__empty {
|
|
113
133
|
height: 240px;
|
|
114
134
|
display: flex;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _sfc_main$1 from "../empty/empty.js";
|
|
2
2
|
import _sfc_main$2 from "../checkbox/checkbox.js";
|
|
3
|
-
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, vModelText, withDirectives, withModifiers } from "vue";
|
|
3
|
+
import { Fragment, TransitionGroup, computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, toDisplayString, unref, vModelText, withCtx, withDirectives, withModifiers } from "vue";
|
|
4
4
|
import { bem } from "@veltra/utils";
|
|
5
5
|
//#region src/components/transfer/transfer-list.vue
|
|
6
6
|
const _hoisted_1 = ["placeholder", "disabled"];
|
|
@@ -72,22 +72,25 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
72
72
|
filtered.value.length ? (openBlock(), createElementBlock("ul", {
|
|
73
73
|
key: 1,
|
|
74
74
|
class: normalizeClass(unref(cls).e("body"))
|
|
75
|
-
}, [(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
75
|
+
}, [createCommentVNode(" 两栏间移动:离场/入场带方向位移,-move FLIP 让位;过滤增删同样受益 "), createVNode(TransitionGroup, { name: unref(cls).b }, {
|
|
76
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(filtered.value, (option) => {
|
|
77
|
+
return openBlock(), createElementBlock("li", {
|
|
78
|
+
key: option.key,
|
|
79
|
+
class: normalizeClass([unref(cls).e("item"), unref(bem).is("disabled", __props.disabled || option.disabled)]),
|
|
80
|
+
onClick: ($event) => handleItemClick(option)
|
|
81
|
+
}, [createVNode(unref(_sfc_main$2), {
|
|
82
|
+
"model-value": __props.checkedKeys.has(option.key),
|
|
83
|
+
disabled: __props.disabled || option.disabled,
|
|
84
|
+
"onUpdate:modelValue": ($event) => emit("check", option.key, $event),
|
|
85
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
|
|
86
|
+
}, null, 8, [
|
|
87
|
+
"model-value",
|
|
88
|
+
"disabled",
|
|
89
|
+
"onUpdate:modelValue"
|
|
90
|
+
]), createElementVNode("span", { class: normalizeClass(unref(cls).e("item-label")) }, toDisplayString(option.label), 3)], 10, _hoisted_2);
|
|
91
|
+
}), 128))]),
|
|
92
|
+
_: 1
|
|
93
|
+
}, 8, ["name"])], 2)) : (openBlock(), createElementBlock("div", {
|
|
91
94
|
key: 2,
|
|
92
95
|
class: normalizeClass(unref(cls).e("empty"))
|
|
93
96
|
}, [createVNode(unref(_sfc_main$1))], 2))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfer-list.js","names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_createElementVNode","_createVNode","UCheckbox","_toDisplayString","_withDirectives","_vModelText","_createCommentVNode","_Fragment","_renderList","_withModifiers","UEmpty"],"sources":["../../../src/components/transfer/transfer-list.vue"],"sourcesContent":["<template>\n <div :class=\"[cls.b, cls.m(size)]\">\n <div :class=\"cls.e('header')\">\n <u-checkbox\n :model-value=\"allChecked\"\n :indeterminate=\"indeterminate\"\n :disabled=\"disabled || !selectable.length\"\n @update:model-value=\"handleCheckAll\"\n />\n\n <span :class=\"cls.e('title')\">{{ title }}</span>\n\n <span :class=\"cls.e('count')\">{{ checkedCount }}/{{ options.length }}</span>\n </div>\n\n <div v-if=\"filterable\" :class=\"cls.e('filter')\">\n <input\n v-model=\"query\"\n :class=\"cls.e('filter-input')\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n />\n </div>\n\n <ul v-if=\"filtered.length\" :class=\"cls.e('body')\">\n <li\n
|
|
1
|
+
{"version":3,"file":"transfer-list.js","names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_createElementVNode","_createVNode","UCheckbox","_toDisplayString","_withDirectives","_vModelText","_createCommentVNode","_TransitionGroup","_withCtx","_Fragment","_renderList","_withModifiers","UEmpty"],"sources":["../../../src/components/transfer/transfer-list.vue"],"sourcesContent":["<template>\n <div :class=\"[cls.b, cls.m(size)]\">\n <div :class=\"cls.e('header')\">\n <u-checkbox\n :model-value=\"allChecked\"\n :indeterminate=\"indeterminate\"\n :disabled=\"disabled || !selectable.length\"\n @update:model-value=\"handleCheckAll\"\n />\n\n <span :class=\"cls.e('title')\">{{ title }}</span>\n\n <span :class=\"cls.e('count')\">{{ checkedCount }}/{{ options.length }}</span>\n </div>\n\n <div v-if=\"filterable\" :class=\"cls.e('filter')\">\n <input\n v-model=\"query\"\n :class=\"cls.e('filter-input')\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n />\n </div>\n\n <ul v-if=\"filtered.length\" :class=\"cls.e('body')\">\n <!-- 两栏间移动:离场/入场带方向位移,-move FLIP 让位;过滤增删同样受益 -->\n <TransitionGroup :name=\"cls.b\">\n <li\n v-for=\"option of filtered\"\n :key=\"option.key\"\n :class=\"[cls.e('item'), bem.is('disabled', disabled || option.disabled)]\"\n @click=\"handleItemClick(option)\"\n >\n <u-checkbox\n :model-value=\"checkedKeys.has(option.key)\"\n :disabled=\"disabled || option.disabled\"\n @update:model-value=\"emit('check', option.key, $event)\"\n @click.stop\n />\n\n <span :class=\"cls.e('item-label')\">{{ option.label }}</span>\n </li>\n </TransitionGroup>\n </ul>\n\n <div v-else :class=\"cls.e('empty')\">\n <u-empty />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport type { ComponentSize } from '@veltra/utils'\nimport { bem } from '@veltra/utils'\nimport { computed, ref } from 'vue'\n\nimport type { TransferOption } from '../../types'\nimport { UCheckbox } from '../checkbox'\nimport { UEmpty } from '../empty'\n\ndefineOptions({ name: 'UTransferList' })\n\nconst {\n title = '',\n options = [],\n checkedKeys,\n filterable = false,\n placeholder = '',\n disabled = false,\n size = 'default'\n} = defineProps<{\n /** 栏标题 */\n title?: string\n /** 本栏选项 */\n options?: TransferOption[]\n /** 两栏共用的勾选 key 集合 */\n checkedKeys: Set<string | number>\n /** 是否显示搜索框 */\n filterable?: boolean\n /** 搜索框占位符 */\n placeholder?: string\n /** 是否禁用整栏 */\n disabled?: boolean\n /** 组件尺寸 */\n size?: ComponentSize\n}>()\n\nconst emit = defineEmits<{\n (e: 'check', key: string | number, checked: boolean): void\n (e: 'check-all', keys: Array<string | number>, checked: boolean): void\n}>()\n\nconst cls = bem('transfer-list')\n\nconst query = ref('')\n\n/** 搜索只作用于本栏,按 label 匹配 */\nconst filtered = computed(() => options.filter((o) => o.label.includes(query.value)))\nconst selectable = computed(() => filtered.value.filter((o) => !o.disabled))\n\nconst allChecked = computed(\n () => selectable.value.length > 0 && selectable.value.every((o) => checkedKeys.has(o.key))\n)\n\nconst indeterminate = computed(() => {\n const count = selectable.value.filter((o) => checkedKeys.has(o.key)).length\n return count > 0 && !allChecked.value\n})\n\nconst checkedCount = computed(() => options.filter((o) => checkedKeys.has(o.key)).length)\n\nfunction handleCheckAll(checked: boolean) {\n const keys = checked\n ? selectable.value.map((o) => o.key)\n : filtered.value.filter((o) => checkedKeys.has(o.key)).map((o) => o.key)\n emit('check-all', keys, checked)\n}\n\nfunction handleItemClick(option: TransferOption) {\n if (disabled || option.disabled) return\n emit('check', option.key, !checkedKeys.has(option.key))\n}\n</script>\n"],"mappings":"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"}
|
|
@@ -119,11 +119,14 @@
|
|
|
119
119
|
height: 20px;
|
|
120
120
|
font-size: 20px;
|
|
121
121
|
border-radius: 50%;
|
|
122
|
-
transition: transform
|
|
122
|
+
transition: transform var(--u-transition-fast) var(--u-transition-ease), background-color var(--u-transition-fast) var(--u-transition-ease);
|
|
123
123
|
}
|
|
124
124
|
.u-tree__expand-icon:hover {
|
|
125
125
|
background-color: var(--u-bg-color-hover);
|
|
126
126
|
}
|
|
127
|
+
.u-tree__expand-icon:active {
|
|
128
|
+
background-color: var(--u-bg-color-middle);
|
|
129
|
+
}
|
|
127
130
|
.u-tree__leaf-icon {
|
|
128
131
|
flex-shrink: 0;
|
|
129
132
|
width: 20px;
|
|
@@ -138,7 +141,7 @@
|
|
|
138
141
|
overflow: hidden;
|
|
139
142
|
user-select: none;
|
|
140
143
|
word-break: break-word;
|
|
141
|
-
transition: background-color
|
|
144
|
+
transition: background-color var(--u-transition-fast) var(--u-transition-ease);
|
|
142
145
|
display: flex;
|
|
143
146
|
justify-content: flex-start;
|
|
144
147
|
align-items: center;
|
package/package.json
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<div
|
|
9
|
-
<
|
|
10
|
-
|
|
2
|
+
<transition name="fade">
|
|
3
|
+
<div v-if="visible" :class="className" role="alert">
|
|
4
|
+
<u-icon v-if="showIcon" :class="cls.e('icon')">
|
|
5
|
+
<component :is="typeIcons[type]" />
|
|
6
|
+
</u-icon>
|
|
7
|
+
|
|
8
|
+
<div :class="cls.e('content')">
|
|
9
|
+
<div v-if="$slots.title || title" :class="cls.e('title')">
|
|
10
|
+
<slot name="title">{{ title }}</slot>
|
|
11
|
+
</div>
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
<div v-if="$slots.default || description" :class="cls.e('description')">
|
|
14
|
+
<slot>{{ description }}</slot>
|
|
15
|
+
</div>
|
|
14
16
|
</div>
|
|
15
|
-
</div>
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
<u-icon v-if="closable" :class="cls.e('close')" @click.stop="handleClose">
|
|
19
|
+
<Close />
|
|
20
|
+
</u-icon>
|
|
21
|
+
</div>
|
|
22
|
+
</transition>
|
|
21
23
|
</template>
|
|
22
24
|
|
|
23
25
|
<script lang="ts" setup>
|
|
@@ -58,10 +58,18 @@ $line-ratio: 1.6;
|
|
|
58
58
|
cursor: pointer;
|
|
59
59
|
align-self: center;
|
|
60
60
|
opacity: 0.6;
|
|
61
|
-
transition:
|
|
61
|
+
transition:
|
|
62
|
+
opacity fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
63
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
62
64
|
|
|
63
65
|
&:hover {
|
|
64
66
|
opacity: 1;
|
|
65
67
|
}
|
|
68
|
+
|
|
69
|
+
// 点击即关闭,过渡来不及显示——按下瞬间缩到位
|
|
70
|
+
&:active {
|
|
71
|
+
transform: scale(0.9);
|
|
72
|
+
transition-duration: 0s;
|
|
73
|
+
}
|
|
66
74
|
}
|
|
67
75
|
}
|
|
@@ -30,6 +30,9 @@ $root-name: auto-complete;
|
|
|
30
30
|
margin: 2px 0;
|
|
31
31
|
user-select: none;
|
|
32
32
|
color: fn.use-var(text-color, main);
|
|
33
|
+
transition:
|
|
34
|
+
background-color fn.use-var(transition, fast) fn.use-var(transition, ease),
|
|
35
|
+
color fn.use-var(transition, fast) fn.use-var(transition, ease);
|
|
33
36
|
@include m.ellipsis;
|
|
34
37
|
|
|
35
38
|
&:hover {
|
|
@@ -19,13 +19,27 @@ $edge-offset: 10px;
|
|
|
19
19
|
&-enter-active,
|
|
20
20
|
&-leave-active {
|
|
21
21
|
transition:
|
|
22
|
-
opacity fn.use-var(transition,
|
|
23
|
-
transform fn.use-var(transition,
|
|
22
|
+
opacity fn.use-var(transition, fast) fn.use-var(transition, ease-out),
|
|
23
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
&-enter-from,
|
|
27
27
|
&-leave-to {
|
|
28
28
|
opacity: 0;
|
|
29
|
-
transform: scale(0.
|
|
29
|
+
transform: scale(0.9);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// 降级:只保留 opacity 淡入,不做 scale 位移
|
|
33
|
+
@media (prefers-reduced-motion: reduce) {
|
|
34
|
+
&-enter-active,
|
|
35
|
+
&-leave-active {
|
|
36
|
+
transition: opacity fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-enter-from,
|
|
40
|
+
&-leave-to {
|
|
41
|
+
opacity: 0;
|
|
42
|
+
transform: none;
|
|
43
|
+
}
|
|
30
44
|
}
|
|
31
45
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="cls.b">
|
|
3
3
|
<slot />
|
|
4
|
-
<
|
|
4
|
+
<Transition :name="transitionName">
|
|
5
|
+
<sup :class="classList" ref="supRef" v-if="!hidden">{{ badgeValue }}</sup>
|
|
6
|
+
</Transition>
|
|
5
7
|
</div>
|
|
6
8
|
</template>
|
|
7
9
|
|
|
@@ -15,6 +17,7 @@ import type { BadgeProps, ComponentSize } from '../../types'
|
|
|
15
17
|
defineOptions({ name: 'UBadge' })
|
|
16
18
|
|
|
17
19
|
const cls = bem('badge')
|
|
20
|
+
const transitionName = cls.create('fade').b
|
|
18
21
|
|
|
19
22
|
const props = withDefaults(defineProps<BadgeProps>(), { max: 99 })
|
|
20
23
|
|
|
@@ -41,12 +44,8 @@ const supRef = shallowRef<HTMLElement>()
|
|
|
41
44
|
|
|
42
45
|
const setPosition = () => {
|
|
43
46
|
if (supRef.value) {
|
|
44
|
-
|
|
45
|
-
setStyles(supRef.value, {
|
|
46
|
-
transform: `translate(-${width / 2}px, -${height / 2}px)`,
|
|
47
|
-
backgroundColor: props.color,
|
|
48
|
-
zIndex: zIndex()
|
|
49
|
-
})
|
|
47
|
+
// 角标位移(-50%,-50%)由 style.scss 常驻提供,此处仅注入运行时样式
|
|
48
|
+
setStyles(supRef.value, { backgroundColor: props.color, zIndex: zIndex() })
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
|
|
@@ -18,7 +18,10 @@ $root-name: badge;
|
|
|
18
18
|
align-items: center;
|
|
19
19
|
background: fn.use-var(color, danger);
|
|
20
20
|
border-radius: 18px;
|
|
21
|
-
color:
|
|
21
|
+
color: fn.use-var(text-color, white);
|
|
22
|
+
// 向左上角偏移半个自身(与原 JS 内联 translate(-50%,-50%) 等价),
|
|
23
|
+
// 常驻 CSS 化后过渡类的 scale 可与位移叠加
|
|
24
|
+
transform: translate(-50%, -50%);
|
|
22
25
|
|
|
23
26
|
@include m.is(dot) {
|
|
24
27
|
height: 8px;
|
|
@@ -48,3 +51,19 @@ $root-name: badge;
|
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
}
|
|
54
|
+
|
|
55
|
+
// 徽标出现/消失:从 scale(0.9) + 透明淡入/淡出,位移保持不变
|
|
56
|
+
@include m.b(#{$root-name}-fade) {
|
|
57
|
+
&-enter-active,
|
|
58
|
+
&-leave-active {
|
|
59
|
+
transition:
|
|
60
|
+
opacity fn.use-var(transition, fast) fn.use-var(transition, ease-out),
|
|
61
|
+
transform fn.use-var(transition, fast) fn.use-var(transition, ease-out);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&-enter-from,
|
|
65
|
+
&-leave-to {
|
|
66
|
+
opacity: 0;
|
|
67
|
+
transform: translate(-50%, -50%) scale(0.9);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -121,6 +121,14 @@ async function clickRow(host: HTMLElement, index: number) {
|
|
|
121
121
|
await nextTick()
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
/** 侧栏离场走 Transition:display 落为 none 要等离场帧结束(v-show 由过渡接管后不再瞬时隐藏) */
|
|
125
|
+
async function nextFrames(count: number) {
|
|
126
|
+
for (let i = 0; i < count; i++) {
|
|
127
|
+
await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()))
|
|
128
|
+
}
|
|
129
|
+
await nextTick()
|
|
130
|
+
}
|
|
131
|
+
|
|
124
132
|
async function clickEditRow(host: HTMLElement, index: number) {
|
|
125
133
|
const btn = queryEditButton(host, index)
|
|
126
134
|
expect(btn, `第 ${index} 行的编辑按钮应存在`).toBeTruthy()
|
|
@@ -167,6 +175,8 @@ describe('UBatchEdit quick-edit 切换编辑行', () => {
|
|
|
167
175
|
|
|
168
176
|
// 再次点击当前行:取消选中并关闭表单,model 恢复初始值
|
|
169
177
|
await clickRow(host, 0)
|
|
178
|
+
// 侧栏离场过渡结束后 display 才落为 none
|
|
179
|
+
await nextFrames(2)
|
|
170
180
|
expect(aside.style.display).toBe('none')
|
|
171
181
|
expect(model.label).toBe('')
|
|
172
182
|
|
|
@@ -1,93 +1,100 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- 面板模式:表单常驻挂载(快照只在挂载时对传入的 model 拍一次),仅用 v-show 控制显隐;
|
|
3
3
|
弹框模式:表单随弹框挂载 / 卸载,model 初始快照由 use-edit-state 维护 -->
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<h3 :class="cls.e('form-title-text')">{{ headerInfo.title }}</h3>
|
|
17
|
-
</div>
|
|
18
|
-
<u-button
|
|
19
|
-
:class="cls.e('form-close')"
|
|
20
|
-
:icon="Close"
|
|
21
|
-
text
|
|
22
|
-
circle
|
|
23
|
-
size="small"
|
|
24
|
-
title="关闭"
|
|
25
|
-
@click="handleClose"
|
|
26
|
-
/>
|
|
27
|
-
</header>
|
|
28
|
-
|
|
29
|
-
<u-scroll always :class="cls.e('form-body')">
|
|
30
|
-
<transition name="fade" appear mode="out-in">
|
|
31
|
-
<u-form
|
|
32
|
-
ref="formComponentRef"
|
|
33
|
-
:model="props.model"
|
|
34
|
-
:readonly="props.readonly"
|
|
35
|
-
:label-width="props.labelWidth"
|
|
36
|
-
@field:update="handleFieldUpdate"
|
|
37
|
-
>
|
|
38
|
-
<slot
|
|
39
|
-
v-bind="{
|
|
40
|
-
row: state.row,
|
|
41
|
-
parentRow: state.parentRow,
|
|
42
|
-
formActionType: state.formActionType,
|
|
43
|
-
depth: state.depth,
|
|
44
|
-
indexes: state.indexPath,
|
|
45
|
-
index: state.row?.index
|
|
46
|
-
}"
|
|
47
|
-
/>
|
|
48
|
-
</u-form>
|
|
49
|
-
</transition>
|
|
50
|
-
</u-scroll>
|
|
51
|
-
|
|
52
|
-
<footer :class="cls.e('form-footer')">
|
|
53
|
-
<span :class="cls.e('form-hint')">
|
|
54
|
-
<template v-if="props.readonly"> 只读模式 </template>
|
|
55
|
-
|
|
56
|
-
<span :class="{ [bem.is('concealed')]: !shortcutActive }">
|
|
57
|
-
<template
|
|
58
|
-
v-if="
|
|
59
|
-
props.formMode === 'panel' && !(state.formActionType === 'update' && props.quickEdit)
|
|
60
|
-
"
|
|
61
|
-
>
|
|
62
|
-
<u-kbd>Ctrl + S</u-kbd> 保存 ·
|
|
63
|
-
</template>
|
|
64
|
-
<u-kbd>Esc</u-kbd> 关闭
|
|
4
|
+
<!-- 侧栏进出过渡:入场从右轻移淡入、离场快速淡出;离场结束后通知父级释放表单列 -->
|
|
5
|
+
<Transition name="u-batch-edit-form" @after-leave="emit('after-leave')">
|
|
6
|
+
<aside
|
|
7
|
+
:class="[cls.e('form'), bem.is('dialog', props.formMode === 'dialog')]"
|
|
8
|
+
v-if="!!props.model"
|
|
9
|
+
v-show="state.formVisible"
|
|
10
|
+
>
|
|
11
|
+
<header :class="cls.e('form-header')">
|
|
12
|
+
<span :class="[cls.e('form-icon'), iconToneCls]">
|
|
13
|
+
<u-icon>
|
|
14
|
+
<component :is="headerInfo.icon" />
|
|
15
|
+
</u-icon>
|
|
65
16
|
</span>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<u-button size="small" text :loading="state.loading" @click="handleClose"> 取消 </u-button>
|
|
17
|
+
<div :class="cls.e('form-title')">
|
|
18
|
+
<h3 :class="cls.e('form-title-text')">{{ headerInfo.title }}</h3>
|
|
19
|
+
</div>
|
|
70
20
|
<u-button
|
|
71
|
-
|
|
21
|
+
:class="cls.e('form-close')"
|
|
22
|
+
:icon="Close"
|
|
23
|
+
text
|
|
24
|
+
circle
|
|
72
25
|
size="small"
|
|
73
|
-
title="
|
|
74
|
-
|
|
75
|
-
@click="handleSave(true)"
|
|
76
|
-
>
|
|
77
|
-
保存并继续
|
|
78
|
-
</u-button>
|
|
79
|
-
<u-button
|
|
80
|
-
v-if="showSaveBtn"
|
|
81
|
-
type="primary"
|
|
82
|
-
size="small"
|
|
83
|
-
title="保存"
|
|
84
|
-
:icon="Save"
|
|
85
|
-
:loading="state.loading"
|
|
86
|
-
@click="handleSave()"
|
|
26
|
+
title="关闭"
|
|
27
|
+
@click="handleClose"
|
|
87
28
|
/>
|
|
88
|
-
</
|
|
89
|
-
|
|
90
|
-
|
|
29
|
+
</header>
|
|
30
|
+
|
|
31
|
+
<u-scroll always :class="cls.e('form-body')">
|
|
32
|
+
<!-- 本地快速淡入(fast):替代全局 fade(250ms)+ out-in 的空窗 -->
|
|
33
|
+
<transition name="u-batch-edit-fade" appear>
|
|
34
|
+
<u-form
|
|
35
|
+
ref="formComponentRef"
|
|
36
|
+
:model="props.model"
|
|
37
|
+
:readonly="props.readonly"
|
|
38
|
+
:label-width="props.labelWidth"
|
|
39
|
+
@field:update="handleFieldUpdate"
|
|
40
|
+
>
|
|
41
|
+
<slot
|
|
42
|
+
v-bind="{
|
|
43
|
+
row: state.row,
|
|
44
|
+
parentRow: state.parentRow,
|
|
45
|
+
formActionType: state.formActionType,
|
|
46
|
+
depth: state.depth,
|
|
47
|
+
indexes: state.indexPath,
|
|
48
|
+
index: state.row?.index
|
|
49
|
+
}"
|
|
50
|
+
/>
|
|
51
|
+
</u-form>
|
|
52
|
+
</transition>
|
|
53
|
+
</u-scroll>
|
|
54
|
+
|
|
55
|
+
<footer :class="cls.e('form-footer')">
|
|
56
|
+
<span :class="cls.e('form-hint')">
|
|
57
|
+
<template v-if="props.readonly"> 只读模式 </template>
|
|
58
|
+
|
|
59
|
+
<span :class="{ [bem.is('concealed')]: !shortcutActive }">
|
|
60
|
+
<template
|
|
61
|
+
v-if="
|
|
62
|
+
props.formMode === 'panel' &&
|
|
63
|
+
!(state.formActionType === 'update' && props.quickEdit)
|
|
64
|
+
"
|
|
65
|
+
>
|
|
66
|
+
<u-kbd>Ctrl + S</u-kbd> 保存 ·
|
|
67
|
+
</template>
|
|
68
|
+
<u-kbd>Esc</u-kbd> 关闭
|
|
69
|
+
</span>
|
|
70
|
+
</span>
|
|
71
|
+
|
|
72
|
+
<div :class="cls.e('form-actions')">
|
|
73
|
+
<u-button size="small" text :loading="state.loading" @click="handleClose">
|
|
74
|
+
取消
|
|
75
|
+
</u-button>
|
|
76
|
+
<u-button
|
|
77
|
+
v-if="showSaveContinueBtn"
|
|
78
|
+
size="small"
|
|
79
|
+
title="保存并继续"
|
|
80
|
+
:loading="state.loading"
|
|
81
|
+
@click="handleSave(true)"
|
|
82
|
+
>
|
|
83
|
+
保存并继续
|
|
84
|
+
</u-button>
|
|
85
|
+
<u-button
|
|
86
|
+
v-if="showSaveBtn"
|
|
87
|
+
type="primary"
|
|
88
|
+
size="small"
|
|
89
|
+
title="保存"
|
|
90
|
+
:icon="Save"
|
|
91
|
+
:loading="state.loading"
|
|
92
|
+
@click="handleSave()"
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
</footer>
|
|
96
|
+
</aside>
|
|
97
|
+
</Transition>
|
|
91
98
|
</template>
|
|
92
99
|
|
|
93
100
|
<script lang="ts" setup>
|
|
@@ -108,6 +115,11 @@ import { useDialogEffect } from './use-dialog-effect'
|
|
|
108
115
|
|
|
109
116
|
defineOptions({ name: 'UBatchEditForm' })
|
|
110
117
|
|
|
118
|
+
const emit = defineEmits<{
|
|
119
|
+
/** 侧栏离场过渡结束(仅面板模式用于释放布局列) */
|
|
120
|
+
(e: 'after-leave'): void
|
|
121
|
+
}>()
|
|
122
|
+
|
|
111
123
|
const batchEditCtx = inject(BatchEditDIKey)!
|
|
112
124
|
|
|
113
125
|
const { cls, props, state, handleClose, handleSave, staticFeatures, dynamicFeatures, syncing } =
|
|
@@ -15,7 +15,12 @@
|
|
|
15
15
|
<BatchEditList :slots="slots" />
|
|
16
16
|
|
|
17
17
|
<!-- 编辑表单 -->
|
|
18
|
-
<BatchEditForm
|
|
18
|
+
<BatchEditForm
|
|
19
|
+
v-if="props.formMode === 'panel'"
|
|
20
|
+
ref="form"
|
|
21
|
+
v-slot="scoped"
|
|
22
|
+
@after-leave="formColumnActive = false"
|
|
23
|
+
>
|
|
19
24
|
<slot name="form" v-bind="scoped" />
|
|
20
25
|
</BatchEditForm>
|
|
21
26
|
</u-layout>
|
|
@@ -36,7 +41,7 @@
|
|
|
36
41
|
|
|
37
42
|
<script lang="ts" setup>
|
|
38
43
|
import { bem } from '@veltra/utils'
|
|
39
|
-
import { computed, provide, useTemplateRef } from 'vue'
|
|
44
|
+
import { computed, provide, shallowRef, useTemplateRef, watch } from 'vue'
|
|
40
45
|
|
|
41
46
|
import type { BatchEditEmits, BatchEditProps, BatchEditSlots, FormExposed } from '../../types'
|
|
42
47
|
import { UDialog } from '../dialog'
|
|
@@ -78,8 +83,18 @@ const { handleFocusIn, handleFocusOut, handleKeydown, focused } = useShortcutKey
|
|
|
78
83
|
state
|
|
79
84
|
})
|
|
80
85
|
|
|
86
|
+
/** 表单列占位:出现立即占位,收起待离场淡出结束(after-leave)再释放,避免淡出期间侧栏掉到第二行 */
|
|
87
|
+
const formColumnActive = shallowRef(false)
|
|
88
|
+
|
|
89
|
+
watch(
|
|
90
|
+
() => state.formVisible,
|
|
91
|
+
(visible) => {
|
|
92
|
+
if (visible) formColumnActive.value = true
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
|
|
81
96
|
const cols = computed(() => {
|
|
82
|
-
return props.formMode === 'panel' &&
|
|
97
|
+
return props.formMode === 'panel' && formColumnActive.value ? props.cols : undefined
|
|
83
98
|
})
|
|
84
99
|
|
|
85
100
|
provide(BatchEditDIKey, {
|