@veltra/desktop 1.0.11 → 1.0.13
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/action/action-group.vue.d.ts +1 -1
- package/dist/components/action/action-group.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/action/action.js +1 -1
- package/dist/components/action/action.vue.d.ts +3 -3
- package/dist/components/auto-complete/auto-complete.js +4 -4
- package/dist/components/auto-complete/auto-complete.vue.d.ts +1 -1
- package/dist/components/batch-edit/batch-edit-form.js +6 -6
- package/dist/components/batch-edit/batch-edit-list.js +8 -8
- package/dist/components/batch-edit/batch-edit.js +1 -1
- package/dist/components/batch-edit/batch-edit.vue.d.ts +2 -2
- package/dist/components/button/button.vue.d.ts +1 -1
- package/dist/components/cascade/cascade-panel-item.js +4 -4
- package/dist/components/cascade/cascade.js +5 -5
- package/dist/components/cascade/cascade.vue.d.ts +6 -6
- package/dist/components/cascade/use-select.js +1 -1
- package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
- package/dist/components/collapse/collapse-item.js +122 -0
- package/dist/components/collapse/collapse-item.js.map +1 -0
- package/dist/components/collapse/collapse-item.vue.d.ts +29 -0
- package/dist/components/collapse/collapse.js +114 -0
- package/dist/components/collapse/collapse.js.map +1 -0
- package/dist/components/collapse/collapse.vue.d.ts +29 -0
- package/dist/components/collapse/di.js +6 -0
- package/dist/components/collapse/di.js.map +1 -0
- package/dist/components/collapse/index.d.ts +2 -0
- package/dist/components/collapse/style.d.ts +1 -0
- package/dist/components/collapse/style.js +1 -0
- package/dist/components/collapse/style2.css +144 -0
- package/dist/components/context-menu/context-menu-item.js +1 -1
- package/dist/components/context-menu/context-menu.vue.d.ts +15 -0
- package/dist/components/context-menu/index.d.ts +1 -0
- package/dist/components/date-panel/date-panel.vue.d.ts +2 -2
- package/dist/components/date-picker/date-picker.js +1 -1
- package/dist/components/date-picker/date-picker.vue.d.ts +2 -2
- package/dist/components/date-range-picker/date-range-picker.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.vue.d.ts +2 -2
- package/dist/components/dialog/dialog.js +6 -6
- package/dist/components/expression-editor/components/variable-picker.js +10 -10
- package/dist/components/file-picker/file-picker.vue.d.ts +1 -1
- package/dist/components/file-viewer/file-viewer.js +10 -10
- package/dist/components/form/dynamic-form-model.js +1 -1
- package/dist/components/form/form-model.js +1 -1
- package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/form/use-node-interceptor.js +1 -1
- package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form-item/helper.js +1 -1
- package/dist/components/index.d.ts +89 -86
- package/dist/components/index.js +202 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/input/input.vue.d.ts +3 -3
- package/dist/components/menu/menu-sub-collapsed.js +6 -6
- package/dist/components/multi-select/multi-select.js +13 -13
- package/dist/components/multi-select/multi-select.vue.d.ts +3 -3
- package/dist/components/multi-tree-select/multi-tree-select.js +13 -13
- package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +6 -6
- package/dist/components/notification/notification.vue.d.ts +1 -1
- package/dist/components/number/number.js +1 -1
- package/dist/components/number-input/number-input.js +2 -2
- package/dist/components/number-input/number-input.vue.d.ts +1 -1
- package/dist/components/number-range-input/number-range-input.js +1 -1
- package/dist/components/number-range-input/number-range-input.vue.d.ts +2 -2
- package/dist/components/paginator/paginator.js +2 -2
- package/dist/components/palette/palette-color-switch.js +1 -1
- package/dist/components/password-input/password-input.js +1 -1
- package/dist/components/password-input/password-input.vue.d.ts +1 -1
- package/dist/components/pop-confirm/pop-confirm.js +5 -5
- package/dist/components/pop-confirm/pop-confirm.vue.d.ts +1 -1
- package/dist/components/progress/progress.js +1 -1
- package/dist/components/progress-nodes/progress-nodes.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.vue.d.ts +1 -1
- package/dist/components/scroll/scroll.js +1 -1
- package/dist/components/scroll/scroll.vue.d.ts +2 -2
- package/dist/components/select/select.js +11 -11
- package/dist/components/select/select.vue.d.ts +2 -2
- package/dist/components/steps/steps.js +1 -1
- package/dist/components/steps/steps.vue.d.ts +1 -1
- package/dist/components/table/table-body.js +1 -1
- package/dist/components/table/table-foot.js +1 -1
- package/dist/components/table/table.vue.d.ts +2 -2
- package/dist/components/table/use-columns.js +1 -1
- package/dist/components/table/use-rows.js +1 -1
- package/dist/components/table/use-table.js +1 -1
- package/dist/components/tabs/tabs-horizontal.vue.d.ts +4 -4
- package/dist/components/tabs/tabs-vertical.vue.d.ts +3 -3
- package/dist/components/tabs/tabs.vue.d.ts +4 -4
- package/dist/components/textarea/textarea.vue.d.ts +3 -3
- package/dist/components/theme/theme.js +7 -7
- package/dist/components/tip/tip.vue.d.ts +1 -1
- package/dist/components/tree/tree-node.js +3 -3
- package/dist/components/tree/tree.vue.d.ts +6 -6
- package/dist/components/tree-select/tree-select.js +5 -5
- package/dist/components/tree-select/tree-select.vue.d.ts +5 -5
- package/dist/components/watermark/watermark.js +1 -1
- package/dist/components/watermark/watermark.vue.d.ts +1 -1
- package/dist/index.d.ts +86 -82
- package/dist/index.js +85 -82
- package/dist/install.d.ts +8 -0
- package/dist/install.js +20 -0
- package/dist/install.js.map +1 -0
- package/dist/style.d.ts +1 -0
- package/dist/style.js +73 -0
- package/dist/types/calendar.d.ts +1 -1
- package/dist/types/cascade.d.ts +1 -1
- package/dist/types/collapse.d.ts +68 -0
- package/dist/types/date-panel.d.ts +1 -1
- package/dist/types/date-picker.d.ts +1 -1
- package/dist/types/date-range-picker.d.ts +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/table.d.ts +1 -1
- package/dist/types/tree.d.ts +1 -1
- package/package.json +25 -11
- package/src/components/collapse/collapse-item.vue +138 -0
- package/src/components/collapse/collapse.vue +122 -0
- package/src/components/collapse/di.ts +15 -0
- package/src/components/collapse/index.ts +2 -0
- package/src/components/collapse/style.scss +186 -0
- package/src/components/collapse/style.ts +1 -0
- package/src/components/context-menu/index.ts +2 -0
- package/src/components/index.ts +73 -71
- package/src/install.ts +27 -0
- package/src/style.ts +73 -0
- package/src/types/collapse.ts +78 -0
- package/src/types/index.ts +1 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="classList">
|
|
3
|
+
<div
|
|
4
|
+
:class="headerClassList"
|
|
5
|
+
role="button"
|
|
6
|
+
:aria-expanded="isActive"
|
|
7
|
+
:aria-disabled="disabled"
|
|
8
|
+
:tabindex="disabled ? -1 : 0"
|
|
9
|
+
@click="handleClick"
|
|
10
|
+
@keydown.enter.prevent="handleClick"
|
|
11
|
+
@keydown.space.prevent="handleClick"
|
|
12
|
+
>
|
|
13
|
+
<span v-if="showLeftIcon" :class="cls.e('icon')">
|
|
14
|
+
<slot name="icon" :is-active="isActive">
|
|
15
|
+
<UIcon><component :is="iconComponent" /></UIcon>
|
|
16
|
+
</slot>
|
|
17
|
+
</span>
|
|
18
|
+
|
|
19
|
+
<span :class="cls.e('title')">
|
|
20
|
+
<slot name="title">{{ title }}</slot>
|
|
21
|
+
</span>
|
|
22
|
+
|
|
23
|
+
<span v-if="showRightIcon" :class="cls.e('icon')">
|
|
24
|
+
<slot name="icon" :is-active="isActive">
|
|
25
|
+
<UIcon><component :is="iconComponent" /></UIcon>
|
|
26
|
+
</slot>
|
|
27
|
+
</span>
|
|
28
|
+
</div>
|
|
29
|
+
<div ref="wrapperEl" :class="cls.e('content-wrapper')" :aria-hidden="!isActive">
|
|
30
|
+
<div :class="cls.e('content')">
|
|
31
|
+
<slot />
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script lang="ts" setup>
|
|
38
|
+
import { ArrowRight } from '@veltra/icons/normal'
|
|
39
|
+
import { bem } from '@veltra/utils'
|
|
40
|
+
import { computed, inject, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
41
|
+
|
|
42
|
+
import type { CollapseItemProps } from '../../types'
|
|
43
|
+
import { UIcon } from '../icon'
|
|
44
|
+
import { CollapseDIKey } from './di'
|
|
45
|
+
|
|
46
|
+
defineOptions({
|
|
47
|
+
name: 'CollapseItem'
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
const props = defineProps<CollapseItemProps>()
|
|
51
|
+
|
|
52
|
+
const context = inject(CollapseDIKey)
|
|
53
|
+
|
|
54
|
+
const cls = context?.cls ?? bem('collapse')
|
|
55
|
+
|
|
56
|
+
const isActive = computed(() => !!context?.activeValues.value.includes(props.value))
|
|
57
|
+
|
|
58
|
+
const iconPosition = computed(() => context?.iconPosition.value ?? 'right')
|
|
59
|
+
|
|
60
|
+
const iconComponent = computed(() => context?.expandIcon.value ?? ArrowRight)
|
|
61
|
+
|
|
62
|
+
const showLeftIcon = computed(() => !props.hideIcon && iconPosition.value === 'left')
|
|
63
|
+
const showRightIcon = computed(() => !props.hideIcon && iconPosition.value === 'right')
|
|
64
|
+
|
|
65
|
+
const classList = computed(() => [
|
|
66
|
+
cls.e('item'),
|
|
67
|
+
bem.is('active', isActive.value),
|
|
68
|
+
bem.is('disabled', props.disabled)
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
const headerClassList = computed(() => [
|
|
72
|
+
cls.e('header'),
|
|
73
|
+
bem.is('disabled', props.disabled),
|
|
74
|
+
bem.is('active', isActive.value)
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
const handleClick = () => {
|
|
78
|
+
if (props.disabled) return
|
|
79
|
+
context?.toggle(props.value)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const wrapperEl = ref<HTMLElement>()
|
|
83
|
+
let cleanupTransition: (() => void) | null = null
|
|
84
|
+
|
|
85
|
+
const cancelTransition = () => {
|
|
86
|
+
cleanupTransition?.()
|
|
87
|
+
cleanupTransition = null
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// 用 height 数值过渡替代 grid-template-rows,避免每帧 grid 重排带来的卡顿。
|
|
91
|
+
const animateHeight = (active: boolean) => {
|
|
92
|
+
const el = wrapperEl.value
|
|
93
|
+
if (!el) return
|
|
94
|
+
|
|
95
|
+
cancelTransition()
|
|
96
|
+
|
|
97
|
+
const startHeight = el.offsetHeight
|
|
98
|
+
const endHeight = active ? el.scrollHeight : 0
|
|
99
|
+
|
|
100
|
+
if (startHeight === endHeight) {
|
|
101
|
+
el.style.height = active ? 'auto' : '0px'
|
|
102
|
+
return
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
el.style.height = `${startHeight}px`
|
|
106
|
+
// 强制 reflow,确保起始高度被采纳,避免 0 → auto 直接跳变。
|
|
107
|
+
void el.offsetHeight
|
|
108
|
+
el.style.height = `${endHeight}px`
|
|
109
|
+
|
|
110
|
+
const onEnd = (e: TransitionEvent) => {
|
|
111
|
+
if (e.target !== el || e.propertyName !== 'height') return
|
|
112
|
+
cleanup()
|
|
113
|
+
if (active) {
|
|
114
|
+
// 回归 auto,让后续内容动态变化时不被锁死高度。
|
|
115
|
+
el.style.height = 'auto'
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const cleanup = () => {
|
|
120
|
+
el.removeEventListener('transitionend', onEnd)
|
|
121
|
+
el.removeEventListener('transitioncancel', onEnd)
|
|
122
|
+
cleanupTransition = null
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
el.addEventListener('transitionend', onEnd)
|
|
126
|
+
el.addEventListener('transitioncancel', onEnd)
|
|
127
|
+
cleanupTransition = cleanup
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
onMounted(() => {
|
|
131
|
+
if (!wrapperEl.value) return
|
|
132
|
+
wrapperEl.value.style.height = isActive.value ? 'auto' : '0px'
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
watch(isActive, animateHeight)
|
|
136
|
+
|
|
137
|
+
onBeforeUnmount(cancelTransition)
|
|
138
|
+
</script>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="classList" role="region">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { useFormFallbackProps, useModel } from '@veltra/compositions'
|
|
9
|
+
import { bem } from '@veltra/utils'
|
|
10
|
+
import { computed, provide } from 'vue'
|
|
11
|
+
|
|
12
|
+
import type {
|
|
13
|
+
CollapseEmits,
|
|
14
|
+
CollapseModelValue,
|
|
15
|
+
CollapseProps,
|
|
16
|
+
CollapseValue,
|
|
17
|
+
_CollapseExposed
|
|
18
|
+
} from '../../types'
|
|
19
|
+
import { CollapseDIKey } from './di'
|
|
20
|
+
|
|
21
|
+
defineOptions({
|
|
22
|
+
name: 'Collapse'
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const props = withDefaults(defineProps<CollapseProps>(), {
|
|
26
|
+
accordion: false,
|
|
27
|
+
bordered: true,
|
|
28
|
+
iconPosition: 'right'
|
|
29
|
+
})
|
|
30
|
+
const emit = defineEmits<CollapseEmits>()
|
|
31
|
+
|
|
32
|
+
const cls = bem('collapse')
|
|
33
|
+
|
|
34
|
+
const { size } = useFormFallbackProps([props], { size: 'default' })
|
|
35
|
+
|
|
36
|
+
const iconPosition = computed(() => props.iconPosition ?? 'right')
|
|
37
|
+
const expandIcon = computed(() => props.expandIcon)
|
|
38
|
+
|
|
39
|
+
const classList = computed(() => [
|
|
40
|
+
cls.b,
|
|
41
|
+
cls.m(size.value),
|
|
42
|
+
cls.m(`icon-${iconPosition.value}`),
|
|
43
|
+
bem.is('bordered', props.bordered)
|
|
44
|
+
])
|
|
45
|
+
|
|
46
|
+
const modelValue = useModel<CollapseProps, 'modelValue'>({
|
|
47
|
+
props,
|
|
48
|
+
emit,
|
|
49
|
+
propName: 'modelValue'
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
const activeValues = computed<CollapseValue[]>(() => {
|
|
53
|
+
const v = modelValue.value
|
|
54
|
+
if (v === undefined || v === null) return []
|
|
55
|
+
return Array.isArray(v) ? v : [v]
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const update = (next: CollapseModelValue) => {
|
|
59
|
+
modelValue.value = next
|
|
60
|
+
emit('change', next)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const toggle = (value: CollapseValue) => {
|
|
64
|
+
if (props.accordion) {
|
|
65
|
+
update(activeValues.value[0] === value ? [] : value)
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const values = activeValues.value.slice()
|
|
70
|
+
const index = values.indexOf(value)
|
|
71
|
+
if (index > -1) values.splice(index, 1)
|
|
72
|
+
else values.push(value)
|
|
73
|
+
update(values)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const expand = (value: CollapseValue) => {
|
|
77
|
+
if (activeValues.value.includes(value)) return
|
|
78
|
+
if (props.accordion) {
|
|
79
|
+
update(value)
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
update([...activeValues.value, value])
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const collapse = (value: CollapseValue) => {
|
|
86
|
+
if (!activeValues.value.includes(value)) return
|
|
87
|
+
if (props.accordion) {
|
|
88
|
+
update([])
|
|
89
|
+
return
|
|
90
|
+
}
|
|
91
|
+
update(activeValues.value.filter((v) => v !== value))
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const expandAll = (values: CollapseValue[]) => {
|
|
95
|
+
if (props.accordion) {
|
|
96
|
+
update(values[0] ?? [])
|
|
97
|
+
return
|
|
98
|
+
}
|
|
99
|
+
update([...values])
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const collapseAll = () => {
|
|
103
|
+
update([])
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
provide(CollapseDIKey, {
|
|
107
|
+
cls,
|
|
108
|
+
size,
|
|
109
|
+
iconPosition,
|
|
110
|
+
expandIcon,
|
|
111
|
+
activeValues,
|
|
112
|
+
toggle
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
defineExpose<_CollapseExposed>({
|
|
116
|
+
toggle,
|
|
117
|
+
expand,
|
|
118
|
+
collapse,
|
|
119
|
+
expandAll,
|
|
120
|
+
collapseAll
|
|
121
|
+
})
|
|
122
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BEM, ComponentSize } from '@veltra/utils'
|
|
2
|
+
import type { Component, ComputedRef, InjectionKey } from 'vue'
|
|
3
|
+
|
|
4
|
+
import type { CollapseIconPosition, CollapseValue } from '../../types'
|
|
5
|
+
|
|
6
|
+
export interface CollapseContext {
|
|
7
|
+
cls: BEM<'collapse'>
|
|
8
|
+
size: ComputedRef<ComponentSize>
|
|
9
|
+
iconPosition: ComputedRef<CollapseIconPosition>
|
|
10
|
+
expandIcon: ComputedRef<Component | undefined>
|
|
11
|
+
activeValues: ComputedRef<CollapseValue[]>
|
|
12
|
+
toggle: (value: CollapseValue) => void
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const CollapseDIKey: InjectionKey<CollapseContext> = Symbol('Collapse')
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'pkg:@veltra/styles/mixins' as m;
|
|
3
|
+
@use 'pkg:@veltra/styles/vars';
|
|
4
|
+
@use 'pkg:@veltra/styles/functions' as fn;
|
|
5
|
+
|
|
6
|
+
$root-name: collapse;
|
|
7
|
+
|
|
8
|
+
// 与 tabs/menu 一致的 Material standard 缓动
|
|
9
|
+
$ease: cubic-bezier(0.4, 0, 0.2, 1);
|
|
10
|
+
$transition-fast: 0.18s $ease;
|
|
11
|
+
$transition-normal: 0.24s $ease;
|
|
12
|
+
|
|
13
|
+
// 各尺寸的水平 / 垂直内边距:决定 header 和 content 的呼吸感
|
|
14
|
+
// 节奏在配置项分组场景下既不过紧、也不过松
|
|
15
|
+
$header-padding-x: (
|
|
16
|
+
small: 12px,
|
|
17
|
+
default: 16px,
|
|
18
|
+
large: 20px
|
|
19
|
+
);
|
|
20
|
+
$header-padding-y: (
|
|
21
|
+
small: 10px,
|
|
22
|
+
default: 14px,
|
|
23
|
+
large: 18px
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
@include m.b($root-name) {
|
|
27
|
+
width: 100%;
|
|
28
|
+
font-size: fn.use-var(font-size-main, default);
|
|
29
|
+
color: fn.use-var(text-color, main);
|
|
30
|
+
|
|
31
|
+
// ===== Bordered(默认):整体一张卡片,项之间细线分隔 =====
|
|
32
|
+
// 面向"配置项分组"场景:清晰边界 + 克制反馈,不抢内部控件视觉
|
|
33
|
+
@include m.is(bordered) {
|
|
34
|
+
border: 1px solid fn.use-var(border, color);
|
|
35
|
+
border-radius: calc(fn.use-var(radius, large) + 2px);
|
|
36
|
+
background-color: fn.use-var(bg-color, top);
|
|
37
|
+
box-shadow:
|
|
38
|
+
0 1px 2px rgba(15, 23, 42, 0.04),
|
|
39
|
+
0 1px 3px rgba(15, 23, 42, 0.04);
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
|
|
42
|
+
@include m.e(item) {
|
|
43
|
+
&:not(:first-child) {
|
|
44
|
+
border-top: 1px solid color-mix(in srgb, #{fn.use-var(border, color)} 60%, transparent);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ===== Item 通用 =====
|
|
50
|
+
@include m.e(item) {
|
|
51
|
+
@include m.is(disabled) {
|
|
52
|
+
opacity: 0.55;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ===== Header =====
|
|
57
|
+
// 反馈策略:
|
|
58
|
+
// - hover:仅背景轻微变化("我可点击"信号)
|
|
59
|
+
// - active:仅 font-weight 加重 + 箭头旋转("我已展开"信号由内容显现承担)
|
|
60
|
+
// - 颜色不切换到 primary,避免在大量配置块同时展开时产生视觉嘈杂
|
|
61
|
+
@include m.e(header) {
|
|
62
|
+
position: relative;
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
gap: 10px;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
font-weight: 500;
|
|
68
|
+
letter-spacing: 0.01em;
|
|
69
|
+
color: fn.use-var(text-color, title);
|
|
70
|
+
user-select: none;
|
|
71
|
+
outline: none;
|
|
72
|
+
transition:
|
|
73
|
+
color $transition-fast,
|
|
74
|
+
background-color $transition-fast;
|
|
75
|
+
|
|
76
|
+
&:hover:not(.is-disabled) {
|
|
77
|
+
background-color: fn.use-var(bg-color, hover);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&:focus-visible {
|
|
81
|
+
box-shadow: inset 0 0 0 2px fn.use-var(color, primary);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@include m.is(disabled) {
|
|
85
|
+
cursor: not-allowed;
|
|
86
|
+
color: fn.use-var(text-color, placeholder);
|
|
87
|
+
|
|
88
|
+
&:hover {
|
|
89
|
+
background-color: transparent;
|
|
90
|
+
color: fn.use-var(text-color, placeholder);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@include m.is(active) {
|
|
95
|
+
font-weight: 600;
|
|
96
|
+
|
|
97
|
+
#{fn.bem($root-name, icon)} {
|
|
98
|
+
transform: rotate(90deg);
|
|
99
|
+
color: fn.use-var(text-color, second);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// ===== Title =====
|
|
105
|
+
@include m.e(title) {
|
|
106
|
+
flex: 1 1 auto;
|
|
107
|
+
min-width: 0;
|
|
108
|
+
line-height: 1.5;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ===== Icon =====
|
|
112
|
+
@include m.e(icon) {
|
|
113
|
+
display: inline-flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
flex: 0 0 auto;
|
|
117
|
+
color: fn.use-var(text-color, placeholder);
|
|
118
|
+
transition:
|
|
119
|
+
transform $transition-normal,
|
|
120
|
+
color $transition-fast;
|
|
121
|
+
will-change: transform;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// ===== Content wrapper =====
|
|
125
|
+
// 高度由 collapse-item.vue 的 JS 在 isActive 切换时驱动:
|
|
126
|
+
// 未挂载前 → CSS 兜底 height: 0
|
|
127
|
+
// 未激活 → 0px(带 transition)
|
|
128
|
+
// 激活中 → 0 → scrollHeight(CSS transition: height)
|
|
129
|
+
// 已激活 → auto(动画结束后回归,避免锁死内容动态变化)
|
|
130
|
+
// 比 grid-template-rows: 0fr ↔ 1fr 减少每帧 grid 布局重算,嵌套场景显著更流畅。
|
|
131
|
+
@include m.e(content-wrapper) {
|
|
132
|
+
overflow: hidden;
|
|
133
|
+
height: 0;
|
|
134
|
+
transition: height $transition-normal;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@include m.e(content) {
|
|
138
|
+
color: fn.use-var(text-color, main);
|
|
139
|
+
line-height: 1.7;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// ===== Sizes =====
|
|
143
|
+
// padding-bottom 始终生效;inactive 时由 wrapper height: 0 + overflow: hidden
|
|
144
|
+
// 自然裁切,scrollHeight 计算因此始终一致,避免动画首帧抖动。
|
|
145
|
+
@include m.size using ($size) {
|
|
146
|
+
font-size: fn.use-var(font-size-main, $size);
|
|
147
|
+
|
|
148
|
+
@include m.bem($root-name, header) {
|
|
149
|
+
padding: map.get($header-padding-y, $size) map.get($header-padding-x, $size);
|
|
150
|
+
font-size: fn.use-var(font-size-title, $size);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@include m.bem($root-name, content) {
|
|
154
|
+
font-size: fn.use-var(font-size-main, $size);
|
|
155
|
+
padding: 0 map.get($header-padding-x, $size) map.get($header-padding-y, $size);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// ===== Ghost(无边框):项级胶囊化,反馈完全由 item hover 承担 =====
|
|
160
|
+
// 嵌入卡片 / 对话框时使用,不引入额外的容器边界
|
|
161
|
+
&:not(.is-bordered) {
|
|
162
|
+
background-color: transparent;
|
|
163
|
+
|
|
164
|
+
#{fn.bem($root-name, item)} {
|
|
165
|
+
border-radius: calc(fn.use-var(radius, default) + 2px);
|
|
166
|
+
transition: background-color $transition-fast;
|
|
167
|
+
|
|
168
|
+
& + #{fn.bem($root-name, item)} {
|
|
169
|
+
margin-top: 4px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&:hover:not(.is-disabled) {
|
|
173
|
+
background-color: fn.use-var(bg-color, hover);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// ghost 下 header 自身不再单独 hover,由 item 整体承载
|
|
178
|
+
#{fn.bem($root-name, header)} {
|
|
179
|
+
border-radius: inherit;
|
|
180
|
+
|
|
181
|
+
&:hover:not(.is-disabled) {
|
|
182
|
+
background-color: transparent;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './style.scss'
|
package/src/components/index.ts
CHANGED
|
@@ -1,143 +1,145 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
|
|
3
|
-
export * from './auto-complete'
|
|
4
|
-
|
|
5
|
-
export * from './badge'
|
|
1
|
+
export * from './condition-editor'
|
|
6
2
|
|
|
7
|
-
export * from './
|
|
3
|
+
export * from './tabs'
|
|
8
4
|
|
|
9
|
-
export * from './
|
|
5
|
+
export * from './tree'
|
|
10
6
|
|
|
11
|
-
export * from './
|
|
7
|
+
export * from './tree-select'
|
|
12
8
|
|
|
13
|
-
export * from './
|
|
9
|
+
export * from './code-editor'
|
|
14
10
|
|
|
15
|
-
export * from './
|
|
11
|
+
export * from './dropdown'
|
|
16
12
|
|
|
17
|
-
export * from './
|
|
13
|
+
export * from './drawer'
|
|
18
14
|
|
|
19
|
-
export * from './
|
|
15
|
+
export * from './form'
|
|
20
16
|
|
|
21
|
-
export * from './
|
|
17
|
+
export * from './message-confirm'
|
|
22
18
|
|
|
23
|
-
export * from './
|
|
19
|
+
export * from './calendar'
|
|
24
20
|
|
|
25
|
-
export * from './
|
|
21
|
+
export * from './radio'
|
|
26
22
|
|
|
27
|
-
export * from './
|
|
23
|
+
export * from './card'
|
|
28
24
|
|
|
29
|
-
export * from './
|
|
25
|
+
export * from './date-range-picker'
|
|
30
26
|
|
|
31
|
-
export * from './
|
|
27
|
+
export * from './loading'
|
|
32
28
|
|
|
33
|
-
export * from './
|
|
29
|
+
export * from './scroll'
|
|
34
30
|
|
|
35
|
-
export * from './
|
|
31
|
+
export * from './progress-nodes'
|
|
36
32
|
|
|
37
|
-
export * from './
|
|
33
|
+
export * from './empty'
|
|
38
34
|
|
|
39
|
-
export * from './
|
|
35
|
+
export * from './auto-complete'
|
|
40
36
|
|
|
41
|
-
export * from './
|
|
37
|
+
export * from './progress'
|
|
42
38
|
|
|
43
|
-
export * from './
|
|
39
|
+
export * from './input'
|
|
44
40
|
|
|
45
|
-
export * from './
|
|
41
|
+
export * from './notification'
|
|
46
42
|
|
|
47
|
-
export * from './
|
|
43
|
+
export * from './layout'
|
|
48
44
|
|
|
49
|
-
export * from './
|
|
45
|
+
export * from './multi-select'
|
|
50
46
|
|
|
51
|
-
export * from './
|
|
47
|
+
export * from './checkbox'
|
|
52
48
|
|
|
53
|
-
export * from './
|
|
49
|
+
export * from './slider'
|
|
54
50
|
|
|
55
51
|
export * from './gantt-chart'
|
|
56
52
|
|
|
57
|
-
export * from './
|
|
58
|
-
|
|
59
|
-
export * from './grid'
|
|
53
|
+
export * from './message'
|
|
60
54
|
|
|
61
|
-
export * from './
|
|
55
|
+
export * from './file-picker'
|
|
62
56
|
|
|
63
|
-
export * from './
|
|
57
|
+
export * from './number-range-input'
|
|
64
58
|
|
|
65
|
-
export * from './input'
|
|
59
|
+
export * from './number-input'
|
|
66
60
|
|
|
67
|
-
export * from './
|
|
61
|
+
export * from './collapse'
|
|
68
62
|
|
|
69
|
-
export * from './
|
|
63
|
+
export * from './date-panel'
|
|
70
64
|
|
|
71
|
-
export * from './
|
|
65
|
+
export * from './table-editor'
|
|
72
66
|
|
|
73
|
-
export * from './
|
|
67
|
+
export * from './check-tag'
|
|
74
68
|
|
|
75
|
-
export * from './
|
|
69
|
+
export * from './context-menu'
|
|
76
70
|
|
|
77
|
-
export * from './
|
|
71
|
+
export * from './password-input'
|
|
78
72
|
|
|
79
|
-
export * from './
|
|
73
|
+
export * from './number'
|
|
80
74
|
|
|
81
|
-
export * from './
|
|
75
|
+
export * from './dialog'
|
|
82
76
|
|
|
83
77
|
export * from './node-render'
|
|
84
78
|
|
|
85
|
-
export * from './
|
|
79
|
+
export * from './expression-editor'
|
|
86
80
|
|
|
87
|
-
export * from './
|
|
81
|
+
export * from './watermark'
|
|
88
82
|
|
|
89
|
-
export * from './
|
|
83
|
+
export * from './batch-edit'
|
|
90
84
|
|
|
91
|
-
export * from './
|
|
85
|
+
export * from './action'
|
|
92
86
|
|
|
93
|
-
export * from './
|
|
87
|
+
export * from './tip'
|
|
94
88
|
|
|
95
|
-
export * from './
|
|
89
|
+
export * from './textarea'
|
|
96
90
|
|
|
97
|
-
export * from './
|
|
91
|
+
export * from './button'
|
|
98
92
|
|
|
99
|
-
export * from './
|
|
93
|
+
export * from './cascade'
|
|
100
94
|
|
|
101
|
-
export * from './
|
|
95
|
+
export * from './steps'
|
|
102
96
|
|
|
103
|
-
export * from './
|
|
97
|
+
export * from './date-picker'
|
|
104
98
|
|
|
105
|
-
export * from './
|
|
99
|
+
export * from './theme'
|
|
106
100
|
|
|
107
|
-
export * from './
|
|
101
|
+
export * from './table'
|
|
108
102
|
|
|
109
|
-
export * from './
|
|
103
|
+
export * from './multi-tree-select'
|
|
110
104
|
|
|
111
|
-
export * from './
|
|
105
|
+
export * from './group-input'
|
|
112
106
|
|
|
113
|
-
export * from './
|
|
107
|
+
export * from './list'
|
|
114
108
|
|
|
115
|
-
export * from './
|
|
109
|
+
export * from './rich-text-editor'
|
|
110
|
+
|
|
111
|
+
export * from './menu'
|
|
112
|
+
|
|
113
|
+
export * from './grid-input'
|
|
116
114
|
|
|
117
115
|
export * from './switch'
|
|
118
116
|
|
|
119
|
-
export * from './
|
|
117
|
+
export * from './form-item'
|
|
120
118
|
|
|
121
|
-
export * from './
|
|
119
|
+
export * from './radio-group'
|
|
122
120
|
|
|
123
|
-
export * from './
|
|
121
|
+
export * from './checkbox-group'
|
|
124
122
|
|
|
125
|
-
export * from './
|
|
123
|
+
export * from './file-viewer'
|
|
126
124
|
|
|
127
125
|
export * from './text'
|
|
128
126
|
|
|
129
|
-
export * from './
|
|
127
|
+
export * from './select'
|
|
130
128
|
|
|
131
|
-
export * from './
|
|
129
|
+
export * from './breadcrumb'
|
|
132
130
|
|
|
133
|
-
export * from './
|
|
131
|
+
export * from './icon'
|
|
134
132
|
|
|
135
|
-
export * from './
|
|
133
|
+
export * from './pop-confirm'
|
|
136
134
|
|
|
137
|
-
export * from './
|
|
135
|
+
export * from './paginator'
|
|
138
136
|
|
|
139
|
-
export * from './
|
|
137
|
+
export * from './tag'
|
|
140
138
|
|
|
141
|
-
export * from './
|
|
139
|
+
export * from './float-button'
|
|
142
140
|
|
|
143
|
-
export * from './
|
|
141
|
+
export * from './palette'
|
|
142
|
+
|
|
143
|
+
export * from './grid'
|
|
144
|
+
|
|
145
|
+
export * from './badge'
|