@uzum-tech/ui 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +410 -149
- package/dist/index.prod.js +1 -1
- package/es/_internal/account-option/index.d.ts +1 -0
- package/es/_internal/account-option/index.js +1 -0
- package/es/_internal/account-option/src/AccountOption.d.ts +162 -0
- package/es/_internal/account-option/src/AccountOption.js +56 -0
- package/es/_internal/account-option/src/styles/index.cssr.d.ts +2 -0
- package/es/_internal/account-option/src/styles/index.cssr.js +40 -0
- package/es/_internal/account-option/styles/_common.d.ts +12 -0
- package/es/_internal/account-option/styles/_common.js +11 -0
- package/es/_internal/account-option/styles/dark.d.ts +2 -0
- package/es/_internal/account-option/styles/dark.js +7 -0
- package/es/_internal/account-option/styles/index.d.ts +3 -0
- package/es/_internal/account-option/styles/index.js +2 -0
- package/es/_internal/account-option/styles/light.d.ts +26 -0
- package/es/_internal/account-option/styles/light.js +11 -0
- package/es/_internal/index.d.ts +1 -0
- package/es/_internal/index.js +1 -0
- package/es/_internal/select-menu/src/SelectMenu.d.ts +3 -0
- package/es/_internal/select-menu/src/SelectMenu.js +2 -1
- package/es/_internal/select-menu/src/SelectOption.d.ts +1 -0
- package/es/_internal/select-menu/src/SelectOption.js +14 -8
- package/es/_internal/select-menu/src/interface.d.ts +1 -0
- package/es/_internal/select-menu/src/styles/index.cssr.js +4 -3
- package/es/_internal/selection/src/Selection.d.ts +35 -8
- package/es/_internal/selection/src/Selection.js +44 -25
- package/es/_internal/selection/src/styles/index.cssr.js +12 -3
- package/es/_internal/selection/styles/light.d.ts +4 -0
- package/es/_internal/selection/styles/light.js +2 -0
- package/es/badge/src/Badge.d.ts +71 -4
- package/es/badge/src/Badge.js +5 -4
- package/es/badge/src/styles/index.cssr.js +1 -1
- package/es/badge/styles/light.d.ts +7 -0
- package/es/badge/styles/light.js +9 -2
- package/es/button/src/Button.js +18 -10
- package/es/cascader/src/Cascader.d.ts +20 -0
- package/es/cascader/src/CascaderMenu.d.ts +2 -0
- package/es/cascader/src/CascaderOption.d.ts +2 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +2 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +2 -0
- package/es/cascader/styles/light.d.ts +2 -0
- package/es/config-provider/src/internal-interface.d.ts +2 -0
- package/es/data-table/src/DataTable.d.ts +16 -0
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +4 -0
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +6 -2
- package/es/data-table/src/TableParts/Body.d.ts +4 -0
- package/es/data-table/src/TableParts/Cell.d.ts +8 -0
- package/es/data-table/src/TableParts/Header.d.ts +4 -0
- package/es/data-table/src/interface.d.ts +6 -0
- package/es/data-table/styles/light.d.ts +2 -0
- package/es/list/src/List.d.ts +1 -1
- package/es/list/src/ListItem.d.ts +1 -1
- package/es/pagination/src/Pagination.d.ts +22 -0
- package/es/pagination/styles/light.d.ts +2 -0
- package/es/select/demos/enUS/flag.d.ts +2 -0
- package/es/select/demos/enUS/flag.js +25 -0
- package/es/select/src/Select.d.ts +35 -1
- package/es/select/src/Select.js +10 -5
- package/es/select/src/interface.d.ts +2 -0
- package/es/select/styles/light.d.ts +2 -0
- package/es/theme-editor/src/ThemeEditor.js +2 -2
- package/es/themes/dark.js +2 -0
- package/es/themes/light.js +2 -0
- package/es/tree-select/src/TreeSelect.d.ts +20 -0
- package/es/tree-select/styles/light.d.ts +2 -0
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/account-option/index.d.ts +1 -0
- package/lib/_internal/account-option/index.js +8 -0
- package/lib/_internal/account-option/src/AccountOption.d.ts +162 -0
- package/lib/_internal/account-option/src/AccountOption.js +61 -0
- package/lib/_internal/account-option/src/styles/index.cssr.d.ts +2 -0
- package/lib/_internal/account-option/src/styles/index.cssr.js +45 -0
- package/lib/_internal/account-option/styles/_common.d.ts +12 -0
- package/lib/_internal/account-option/styles/_common.js +13 -0
- package/lib/_internal/account-option/styles/dark.d.ts +2 -0
- package/lib/_internal/account-option/styles/dark.js +10 -0
- package/lib/_internal/account-option/styles/index.d.ts +3 -0
- package/lib/_internal/account-option/styles/index.js +7 -0
- package/lib/_internal/account-option/styles/light.d.ts +26 -0
- package/lib/_internal/account-option/styles/light.js +18 -0
- package/lib/_internal/index.d.ts +1 -0
- package/lib/_internal/index.js +3 -1
- package/lib/_internal/select-menu/src/SelectMenu.d.ts +3 -0
- package/lib/_internal/select-menu/src/SelectMenu.js +2 -1
- package/lib/_internal/select-menu/src/SelectOption.d.ts +1 -0
- package/lib/_internal/select-menu/src/SelectOption.js +14 -8
- package/lib/_internal/select-menu/src/interface.d.ts +1 -0
- package/lib/_internal/select-menu/src/styles/index.cssr.js +4 -3
- package/lib/_internal/selection/src/Selection.d.ts +35 -8
- package/lib/_internal/selection/src/Selection.js +43 -24
- package/lib/_internal/selection/src/styles/index.cssr.js +12 -3
- package/lib/_internal/selection/styles/light.d.ts +4 -0
- package/lib/_internal/selection/styles/light.js +2 -0
- package/lib/badge/src/Badge.d.ts +71 -4
- package/lib/badge/src/Badge.js +5 -4
- package/lib/badge/src/styles/index.cssr.js +1 -1
- package/lib/badge/styles/light.d.ts +7 -0
- package/lib/badge/styles/light.js +9 -2
- package/lib/button/src/Button.js +18 -10
- package/lib/cascader/src/Cascader.d.ts +20 -0
- package/lib/cascader/src/CascaderMenu.d.ts +2 -0
- package/lib/cascader/src/CascaderOption.d.ts +2 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +2 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +2 -0
- package/lib/cascader/styles/light.d.ts +2 -0
- package/lib/config-provider/src/internal-interface.d.ts +2 -0
- package/lib/data-table/src/DataTable.d.ts +16 -0
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +4 -0
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +6 -2
- package/lib/data-table/src/TableParts/Body.d.ts +4 -0
- package/lib/data-table/src/TableParts/Cell.d.ts +8 -0
- package/lib/data-table/src/TableParts/Header.d.ts +4 -0
- package/lib/data-table/src/interface.d.ts +6 -0
- package/lib/data-table/styles/light.d.ts +2 -0
- package/lib/list/src/List.d.ts +1 -1
- package/lib/list/src/ListItem.d.ts +1 -1
- package/lib/pagination/src/Pagination.d.ts +22 -0
- package/lib/pagination/styles/light.d.ts +2 -0
- package/lib/select/demos/enUS/flag.d.ts +2 -0
- package/lib/select/demos/enUS/flag.js +27 -0
- package/lib/select/src/Select.d.ts +35 -1
- package/lib/select/src/Select.js +10 -5
- package/lib/select/src/interface.d.ts +2 -0
- package/lib/select/styles/light.d.ts +2 -0
- package/lib/theme-editor/src/ThemeEditor.js +2 -2
- package/lib/themes/dark.js +2 -0
- package/lib/themes/light.js +2 -0
- package/lib/tree-select/src/TreeSelect.d.ts +20 -0
- package/lib/tree-select/styles/light.d.ts +2 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -2
- package/web-types.json +41 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './src/AccountOption';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './src/AccountOption';
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { type PropType, VNodeChild } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
icon: PropType<() => VNodeChild>;
|
|
4
|
+
avatar: PropType<() => VNodeChild>;
|
|
5
|
+
label: PropType<VNodeChild>;
|
|
6
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
7
|
+
theme: PropType<import("../../../_mixins").Theme<"AccountOption", {
|
|
8
|
+
height: string;
|
|
9
|
+
labelColor: string;
|
|
10
|
+
labelFontSize: string;
|
|
11
|
+
labelFontWeight: string;
|
|
12
|
+
labelLineHeight: string;
|
|
13
|
+
valueFontSize: string;
|
|
14
|
+
valueFontWeight: string;
|
|
15
|
+
valueLineHeight: string;
|
|
16
|
+
avatarColor: string;
|
|
17
|
+
avatarIconColor: string;
|
|
18
|
+
iconWidth: string;
|
|
19
|
+
iconHeight: string;
|
|
20
|
+
iconMargin: string;
|
|
21
|
+
iconSize: string;
|
|
22
|
+
labelMargin: string;
|
|
23
|
+
avatarWidth: string;
|
|
24
|
+
avatarHeight: string;
|
|
25
|
+
avatarRadius: string;
|
|
26
|
+
avatarSize: string;
|
|
27
|
+
}, any>>;
|
|
28
|
+
themeOverrides: PropType<import("../../../_mixins/use-theme").ExtractThemeOverrides<import("../../../_mixins").Theme<"AccountOption", {
|
|
29
|
+
height: string;
|
|
30
|
+
labelColor: string;
|
|
31
|
+
labelFontSize: string;
|
|
32
|
+
labelFontWeight: string;
|
|
33
|
+
labelLineHeight: string;
|
|
34
|
+
valueFontSize: string;
|
|
35
|
+
valueFontWeight: string;
|
|
36
|
+
valueLineHeight: string;
|
|
37
|
+
avatarColor: string;
|
|
38
|
+
avatarIconColor: string;
|
|
39
|
+
iconWidth: string;
|
|
40
|
+
iconHeight: string;
|
|
41
|
+
iconMargin: string;
|
|
42
|
+
iconSize: string;
|
|
43
|
+
labelMargin: string;
|
|
44
|
+
avatarWidth: string;
|
|
45
|
+
avatarHeight: string;
|
|
46
|
+
avatarRadius: string;
|
|
47
|
+
avatarSize: string;
|
|
48
|
+
}, any>>>;
|
|
49
|
+
builtinThemeOverrides: PropType<import("../../../_mixins/use-theme").ExtractThemeOverrides<import("../../../_mixins").Theme<"AccountOption", {
|
|
50
|
+
height: string;
|
|
51
|
+
labelColor: string;
|
|
52
|
+
labelFontSize: string;
|
|
53
|
+
labelFontWeight: string;
|
|
54
|
+
labelLineHeight: string;
|
|
55
|
+
valueFontSize: string;
|
|
56
|
+
valueFontWeight: string;
|
|
57
|
+
valueLineHeight: string;
|
|
58
|
+
avatarColor: string;
|
|
59
|
+
avatarIconColor: string;
|
|
60
|
+
iconWidth: string;
|
|
61
|
+
iconHeight: string;
|
|
62
|
+
iconMargin: string;
|
|
63
|
+
iconSize: string;
|
|
64
|
+
labelMargin: string;
|
|
65
|
+
avatarWidth: string;
|
|
66
|
+
avatarHeight: string;
|
|
67
|
+
avatarRadius: string;
|
|
68
|
+
avatarSize: string;
|
|
69
|
+
}, any>>>;
|
|
70
|
+
}, {
|
|
71
|
+
mergedClsPrefix: import("vue").Ref<string>;
|
|
72
|
+
cssVars: import("vue").ComputedRef<{
|
|
73
|
+
'--u-height': string;
|
|
74
|
+
'--u-icon-width': string;
|
|
75
|
+
'--u-icon-height': string;
|
|
76
|
+
'--u-icon-margin': string;
|
|
77
|
+
'--u-icon-size': string;
|
|
78
|
+
'--u-label-margin': string;
|
|
79
|
+
'--u-label-color': string;
|
|
80
|
+
'--u-label-font-size': string;
|
|
81
|
+
'--u-label-font-weight': string;
|
|
82
|
+
'--u-label-line-height': string;
|
|
83
|
+
'--u-value-font-size': string;
|
|
84
|
+
'--u-value-font-weight': string;
|
|
85
|
+
'--u-value-line-height': string;
|
|
86
|
+
'--u-avatar-width': string;
|
|
87
|
+
'--u-avatar-height': string;
|
|
88
|
+
'--u-avatar-radius': string;
|
|
89
|
+
'--u-avatar-color': string;
|
|
90
|
+
'--u-avatar-icon-color': string;
|
|
91
|
+
'--u-avatar-size': string;
|
|
92
|
+
}>;
|
|
93
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
94
|
+
icon: PropType<() => VNodeChild>;
|
|
95
|
+
avatar: PropType<() => VNodeChild>;
|
|
96
|
+
label: PropType<VNodeChild>;
|
|
97
|
+
value: (StringConstructor | NumberConstructor)[];
|
|
98
|
+
theme: PropType<import("../../../_mixins").Theme<"AccountOption", {
|
|
99
|
+
height: string;
|
|
100
|
+
labelColor: string;
|
|
101
|
+
labelFontSize: string;
|
|
102
|
+
labelFontWeight: string;
|
|
103
|
+
labelLineHeight: string;
|
|
104
|
+
valueFontSize: string;
|
|
105
|
+
valueFontWeight: string;
|
|
106
|
+
valueLineHeight: string;
|
|
107
|
+
avatarColor: string;
|
|
108
|
+
avatarIconColor: string;
|
|
109
|
+
iconWidth: string;
|
|
110
|
+
iconHeight: string;
|
|
111
|
+
iconMargin: string;
|
|
112
|
+
iconSize: string;
|
|
113
|
+
labelMargin: string;
|
|
114
|
+
avatarWidth: string;
|
|
115
|
+
avatarHeight: string;
|
|
116
|
+
avatarRadius: string;
|
|
117
|
+
avatarSize: string;
|
|
118
|
+
}, any>>;
|
|
119
|
+
themeOverrides: PropType<import("../../../_mixins/use-theme").ExtractThemeOverrides<import("../../../_mixins").Theme<"AccountOption", {
|
|
120
|
+
height: string;
|
|
121
|
+
labelColor: string;
|
|
122
|
+
labelFontSize: string;
|
|
123
|
+
labelFontWeight: string;
|
|
124
|
+
labelLineHeight: string;
|
|
125
|
+
valueFontSize: string;
|
|
126
|
+
valueFontWeight: string;
|
|
127
|
+
valueLineHeight: string;
|
|
128
|
+
avatarColor: string;
|
|
129
|
+
avatarIconColor: string;
|
|
130
|
+
iconWidth: string;
|
|
131
|
+
iconHeight: string;
|
|
132
|
+
iconMargin: string;
|
|
133
|
+
iconSize: string;
|
|
134
|
+
labelMargin: string;
|
|
135
|
+
avatarWidth: string;
|
|
136
|
+
avatarHeight: string;
|
|
137
|
+
avatarRadius: string;
|
|
138
|
+
avatarSize: string;
|
|
139
|
+
}, any>>>;
|
|
140
|
+
builtinThemeOverrides: PropType<import("../../../_mixins/use-theme").ExtractThemeOverrides<import("../../../_mixins").Theme<"AccountOption", {
|
|
141
|
+
height: string;
|
|
142
|
+
labelColor: string;
|
|
143
|
+
labelFontSize: string;
|
|
144
|
+
labelFontWeight: string;
|
|
145
|
+
labelLineHeight: string;
|
|
146
|
+
valueFontSize: string;
|
|
147
|
+
valueFontWeight: string;
|
|
148
|
+
valueLineHeight: string;
|
|
149
|
+
avatarColor: string;
|
|
150
|
+
avatarIconColor: string;
|
|
151
|
+
iconWidth: string;
|
|
152
|
+
iconHeight: string;
|
|
153
|
+
iconMargin: string;
|
|
154
|
+
iconSize: string;
|
|
155
|
+
labelMargin: string;
|
|
156
|
+
avatarWidth: string;
|
|
157
|
+
avatarHeight: string;
|
|
158
|
+
avatarRadius: string;
|
|
159
|
+
avatarSize: string;
|
|
160
|
+
}, any>>>;
|
|
161
|
+
}>>, {}, {}>;
|
|
162
|
+
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { h, defineComponent, computed } from 'vue';
|
|
2
|
+
import { useConfig, useTheme } from '../../../_mixins';
|
|
3
|
+
import { UBaseIcon } from '../../icon';
|
|
4
|
+
import style from './styles/index.cssr';
|
|
5
|
+
import { accountOptionLight } from '../styles';
|
|
6
|
+
export default defineComponent({
|
|
7
|
+
name: 'BaseClear',
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
props: Object.assign(Object.assign({}, useTheme.props), { icon: Function, avatar: Function, label: [String, Object], value: [String, Number] }),
|
|
10
|
+
setup(props) {
|
|
11
|
+
const { mergedClsPrefixRef } = useConfig(props);
|
|
12
|
+
const themeRef = useTheme('AccountOption', '-base-account-option', style, accountOptionLight, props, mergedClsPrefixRef);
|
|
13
|
+
const cssVarsRef = computed(() => {
|
|
14
|
+
const { self: { height, iconWidth, iconHeight, iconMargin, iconSize, labelMargin, labelColor, labelFontSize, labelFontWeight, labelLineHeight, valueFontSize, valueFontWeight, valueLineHeight, avatarWidth, avatarHeight, avatarRadius, avatarColor, avatarIconColor, avatarSize } } = themeRef.value;
|
|
15
|
+
return {
|
|
16
|
+
'--u-height': height,
|
|
17
|
+
'--u-icon-width': iconWidth,
|
|
18
|
+
'--u-icon-height': iconHeight,
|
|
19
|
+
'--u-icon-margin': iconMargin,
|
|
20
|
+
'--u-icon-size': iconSize,
|
|
21
|
+
'--u-label-margin': labelMargin,
|
|
22
|
+
'--u-label-color': labelColor,
|
|
23
|
+
'--u-label-font-size': labelFontSize,
|
|
24
|
+
'--u-label-font-weight': labelFontWeight,
|
|
25
|
+
'--u-label-line-height': labelLineHeight,
|
|
26
|
+
'--u-value-font-size': valueFontSize,
|
|
27
|
+
'--u-value-font-weight': valueFontWeight,
|
|
28
|
+
'--u-value-line-height': valueLineHeight,
|
|
29
|
+
'--u-avatar-width': avatarWidth,
|
|
30
|
+
'--u-avatar-height': avatarHeight,
|
|
31
|
+
'--u-avatar-radius': avatarRadius,
|
|
32
|
+
'--u-avatar-color': avatarColor,
|
|
33
|
+
'--u-avatar-icon-color': avatarIconColor,
|
|
34
|
+
'--u-avatar-size': avatarSize
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
39
|
+
cssVars: cssVarsRef
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
render() {
|
|
43
|
+
const { mergedClsPrefix, cssVars } = this;
|
|
44
|
+
const icon = this.avatar || this.icon ? (h("div", { class: `${mergedClsPrefix}-base-account-option__icon` }, h(UBaseIcon, { clsPrefix: mergedClsPrefix }, {
|
|
45
|
+
default: this.avatar || this.icon
|
|
46
|
+
}))) : null;
|
|
47
|
+
return (h("div", { class: [
|
|
48
|
+
`${mergedClsPrefix}-base-account-option`,
|
|
49
|
+
this.avatar && `${mergedClsPrefix}-base-account-option--avatar`
|
|
50
|
+
], style: cssVars },
|
|
51
|
+
icon,
|
|
52
|
+
h("div", { class: `${mergedClsPrefix}-base-account-option__wrap` },
|
|
53
|
+
h("div", { class: `${mergedClsPrefix}-base-account-option__label` }, this.label),
|
|
54
|
+
h("div", { class: `${mergedClsPrefix}-base-account-option__value` }, this.value))));
|
|
55
|
+
}
|
|
56
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { cB, cE, cM } from '../../../../_utils/cssr';
|
|
2
|
+
export default cB('base-account-option', `
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
position: relative;
|
|
6
|
+
height: var(--u-height);
|
|
7
|
+
`, [cE('icon', `
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
width: var(--u-icon-width);
|
|
13
|
+
height: var(--u-icon-height);
|
|
14
|
+
margin: var(--u-icon-margin);
|
|
15
|
+
font-size: var(--u-icon-size);
|
|
16
|
+
`), cE('wrap', `
|
|
17
|
+
width: 10px;
|
|
18
|
+
flex-grow: 1;
|
|
19
|
+
`), cE('label', `
|
|
20
|
+
margin: var(--u-label-margin);
|
|
21
|
+
color: var(--u-label-color);
|
|
22
|
+
font-size: var(--u-label-font-size);
|
|
23
|
+
font-weight: var(--u-label-font-weight);
|
|
24
|
+
line-height: var(--u-label-line-height);
|
|
25
|
+
text-overflow: ellipsis;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
`), cE('value', `
|
|
28
|
+
font-size: var(--u-value-font-size);
|
|
29
|
+
font-weight: var(--u-value-font-weight);
|
|
30
|
+
line-height: var(--u-value-line-height);
|
|
31
|
+
text-overflow: ellipsis;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
`), cM('avatar', [cE('icon', `
|
|
34
|
+
width: var(--u-avatar-width);
|
|
35
|
+
height: var(--u-avatar-height);
|
|
36
|
+
border-radius: var(--u-avatar-radius);
|
|
37
|
+
background: var(--u-avatar-color);
|
|
38
|
+
color: var(--u-avatar-icon-color);
|
|
39
|
+
font-size: var(--u-avatar-size);
|
|
40
|
+
`)])]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
iconWidth: string;
|
|
3
|
+
iconHeight: string;
|
|
4
|
+
iconMargin: string;
|
|
5
|
+
iconSize: string;
|
|
6
|
+
labelMargin: string;
|
|
7
|
+
avatarWidth: string;
|
|
8
|
+
avatarHeight: string;
|
|
9
|
+
avatarRadius: string;
|
|
10
|
+
avatarSize: string;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ThemeCommonVars } from '../../../_styles/common';
|
|
2
|
+
import { type Theme } from '../../../_mixins';
|
|
3
|
+
export declare const self: (vars: ThemeCommonVars) => {
|
|
4
|
+
height: string;
|
|
5
|
+
labelColor: string;
|
|
6
|
+
labelFontSize: string;
|
|
7
|
+
labelFontWeight: string;
|
|
8
|
+
labelLineHeight: string;
|
|
9
|
+
valueFontSize: string;
|
|
10
|
+
valueFontWeight: string;
|
|
11
|
+
valueLineHeight: string;
|
|
12
|
+
avatarColor: string;
|
|
13
|
+
avatarIconColor: string;
|
|
14
|
+
iconWidth: string;
|
|
15
|
+
iconHeight: string;
|
|
16
|
+
iconMargin: string;
|
|
17
|
+
iconSize: string;
|
|
18
|
+
labelMargin: string;
|
|
19
|
+
avatarWidth: string;
|
|
20
|
+
avatarHeight: string;
|
|
21
|
+
avatarRadius: string;
|
|
22
|
+
avatarSize: string;
|
|
23
|
+
};
|
|
24
|
+
export type AccountOptionThemeVars = ReturnType<typeof self>;
|
|
25
|
+
export declare const accountOptionLight: Theme<'AccountOption', AccountOptionThemeVars>;
|
|
26
|
+
export type AccountOptionTheme = typeof accountOptionLight;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { commonLight } from '../../../_styles/common';
|
|
2
|
+
import commonVars from './_common';
|
|
3
|
+
export const self = (vars) => {
|
|
4
|
+
const { heightHuge, fontBodyLarge, fontTitleMedium, lineHeightBodyLarge, lineHeightTitleMedium, fontWeight, fontWeightStrong, textSecondary, elementsPrimary, elementsSecondary } = vars;
|
|
5
|
+
return Object.assign(Object.assign({}, commonVars), { height: heightHuge, labelColor: textSecondary, labelFontSize: fontBodyLarge, labelFontWeight: fontWeight, labelLineHeight: lineHeightBodyLarge, valueFontSize: fontTitleMedium, valueFontWeight: fontWeightStrong, valueLineHeight: lineHeightTitleMedium, avatarColor: elementsPrimary, avatarIconColor: elementsSecondary });
|
|
6
|
+
};
|
|
7
|
+
export const accountOptionLight = {
|
|
8
|
+
name: 'AccountOption',
|
|
9
|
+
common: commonLight,
|
|
10
|
+
self
|
|
11
|
+
};
|
package/es/_internal/index.d.ts
CHANGED
|
@@ -22,3 +22,4 @@ export { checkboxGroupInjectionKey, checkboxBaseProps, useCheckbox } from './che
|
|
|
22
22
|
export type { CheckboxBaseProps, UseCheckbox, OnUpdateChecked, OnUpdateCheckedImpl, CheckboxInst } from './checkbox';
|
|
23
23
|
export { radioBaseProps, radioGroupInjectionKey, useRadio } from './radio';
|
|
24
24
|
export type { OnUpdateValue, OnUpdateValueImpl, RadioGroupInjection, UseRadio, RadioBaseProps } from './radio';
|
|
25
|
+
export { default as UBaseAccountOption } from './account-option';
|
package/es/_internal/index.js
CHANGED
|
@@ -15,3 +15,4 @@ export { default as UBaseSuffix } from './suffix';
|
|
|
15
15
|
export { UScrollbar, UxScrollbar } from './scrollbar';
|
|
16
16
|
export { checkboxGroupInjectionKey, checkboxBaseProps, useCheckbox } from './checkbox';
|
|
17
17
|
export { radioBaseProps, radioGroupInjectionKey, useRadio } from './radio';
|
|
18
|
+
export { default as UBaseAccountOption } from './account-option';
|
|
@@ -16,6 +16,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
16
16
|
required: true;
|
|
17
17
|
};
|
|
18
18
|
multiple: BooleanConstructor;
|
|
19
|
+
account: BooleanConstructor;
|
|
19
20
|
size: {
|
|
20
21
|
type: PropType<Size>;
|
|
21
22
|
default: string;
|
|
@@ -474,6 +475,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
474
475
|
required: true;
|
|
475
476
|
};
|
|
476
477
|
multiple: BooleanConstructor;
|
|
478
|
+
account: BooleanConstructor;
|
|
477
479
|
size: {
|
|
478
480
|
type: PropType<Size>;
|
|
479
481
|
default: string;
|
|
@@ -686,6 +688,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
686
688
|
loading: boolean;
|
|
687
689
|
inlineThemeDisabled: boolean;
|
|
688
690
|
scrollable: boolean;
|
|
691
|
+
account: boolean;
|
|
689
692
|
showCheckmark: boolean;
|
|
690
693
|
labelField: string;
|
|
691
694
|
autoPending: boolean;
|
|
@@ -25,7 +25,7 @@ export default defineComponent({
|
|
|
25
25
|
}, treeMate: {
|
|
26
26
|
type: Object,
|
|
27
27
|
required: true
|
|
28
|
-
}, multiple: Boolean, size: {
|
|
28
|
+
}, multiple: Boolean, account: Boolean, size: {
|
|
29
29
|
type: String,
|
|
30
30
|
default: 'medium'
|
|
31
31
|
}, value: {
|
|
@@ -246,6 +246,7 @@ export default defineComponent({
|
|
|
246
246
|
nodePropsRef: toRef(props, 'nodeProps'),
|
|
247
247
|
showCheckmarkRef: toRef(props, 'showCheckmark'),
|
|
248
248
|
multipleRef: toRef(props, 'multiple'),
|
|
249
|
+
accountRef: toRef(props, 'account'),
|
|
249
250
|
valueRef: toRef(props, 'value'),
|
|
250
251
|
renderLabelRef: toRef(props, 'renderLabel'),
|
|
251
252
|
renderOptionRef: toRef(props, 'renderOption'),
|
|
@@ -13,6 +13,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
};
|
|
14
14
|
}, {
|
|
15
15
|
multiple: Ref<boolean>;
|
|
16
|
+
account: Ref<boolean>;
|
|
16
17
|
isGrouped: import("vue").ComputedRef<boolean | null>;
|
|
17
18
|
showCheckmark: Ref<boolean>;
|
|
18
19
|
nodeProps: Ref<import("./interface").NodeProps | undefined>;
|
|
@@ -4,6 +4,7 @@ import { render, mergeEventHandlers } from '../../../_utils';
|
|
|
4
4
|
import { CheckmarkIcon } from '../../icons';
|
|
5
5
|
import { UBaseIcon } from '../../icon';
|
|
6
6
|
import { internalSelectionMenuInjectionKey } from './interface';
|
|
7
|
+
import { UBaseAccountOption } from '../..';
|
|
7
8
|
function renderCheckMark(show, clsPrefix) {
|
|
8
9
|
return (h(Transition, { name: "fade-in-scale-up-transition" }, {
|
|
9
10
|
default: () => show ? (h(UBaseIcon, { clsPrefix: clsPrefix, class: `${clsPrefix}-base-select-option__check` }, {
|
|
@@ -24,7 +25,7 @@ export default defineComponent({
|
|
|
24
25
|
}
|
|
25
26
|
},
|
|
26
27
|
setup(props) {
|
|
27
|
-
const { valueRef, pendingTmNodeRef, multipleRef, valueSetRef, renderLabelRef, renderOptionRef, labelFieldRef, valueFieldRef, showCheckmarkRef, nodePropsRef, handleOptionClick, handleOptionMouseEnter
|
|
28
|
+
const { valueRef, pendingTmNodeRef, multipleRef, accountRef, valueSetRef, renderLabelRef, renderOptionRef, labelFieldRef, valueFieldRef, showCheckmarkRef, nodePropsRef, handleOptionClick, handleOptionMouseEnter
|
|
28
29
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
29
30
|
} = inject(internalSelectionMenuInjectionKey);
|
|
30
31
|
const isPendingRef = useMemo(() => {
|
|
@@ -54,6 +55,7 @@ export default defineComponent({
|
|
|
54
55
|
}
|
|
55
56
|
return {
|
|
56
57
|
multiple: multipleRef,
|
|
58
|
+
account: accountRef,
|
|
57
59
|
isGrouped: useMemo(() => {
|
|
58
60
|
const { tmNode } = props;
|
|
59
61
|
const { parent } = tmNode;
|
|
@@ -85,14 +87,17 @@ export default defineComponent({
|
|
|
85
87
|
};
|
|
86
88
|
},
|
|
87
89
|
render() {
|
|
88
|
-
const { clsPrefix, tmNode: { rawNode }, isSelected, isPending, isGrouped, showCheckmark, nodeProps, renderOption, renderLabel, handleClick, handleMouseEnter, handleMouseMove } = this;
|
|
90
|
+
const { clsPrefix, tmNode: { rawNode }, isSelected, isPending, isGrouped, showCheckmark, nodeProps, renderOption, renderLabel, handleClick, handleMouseEnter, handleMouseMove, account } = this;
|
|
89
91
|
const checkmark = renderCheckMark(isSelected, clsPrefix);
|
|
90
|
-
const
|
|
91
|
-
?
|
|
92
|
-
: [
|
|
93
|
-
|
|
92
|
+
const label = renderLabel
|
|
93
|
+
? renderLabel(rawNode, isSelected)
|
|
94
|
+
: render(rawNode[this.labelField], rawNode, isSelected);
|
|
95
|
+
const children = account
|
|
96
|
+
? [
|
|
97
|
+
h(UBaseAccountOption, Object.assign({}, rawNode, { label: label })),
|
|
94
98
|
showCheckmark && checkmark
|
|
95
|
-
]
|
|
99
|
+
]
|
|
100
|
+
: [label, showCheckmark && checkmark];
|
|
96
101
|
const attrs = nodeProps === null || nodeProps === void 0 ? void 0 : nodeProps(rawNode);
|
|
97
102
|
const node = (h("div", Object.assign({}, attrs, { class: [
|
|
98
103
|
`${clsPrefix}-base-select-option`,
|
|
@@ -103,7 +108,8 @@ export default defineComponent({
|
|
|
103
108
|
[`${clsPrefix}-base-select-option--selected`]: isSelected,
|
|
104
109
|
[`${clsPrefix}-base-select-option--grouped`]: isGrouped,
|
|
105
110
|
[`${clsPrefix}-base-select-option--pending`]: isPending,
|
|
106
|
-
[`${clsPrefix}-base-select-option--show-checkmark`]: showCheckmark
|
|
111
|
+
[`${clsPrefix}-base-select-option--show-checkmark`]: showCheckmark,
|
|
112
|
+
[`${clsPrefix}-base-select-option--account`]: account
|
|
107
113
|
}
|
|
108
114
|
], style: [(attrs === null || attrs === void 0 ? void 0 : attrs.style) || '', rawNode.style || ''], onClick: mergeEventHandlers([handleClick, attrs === null || attrs === void 0 ? void 0 : attrs.onClick]), onMouseenter: mergeEventHandlers([
|
|
109
115
|
handleMouseEnter,
|
|
@@ -22,6 +22,7 @@ export interface InternalSelectMenuInjection {
|
|
|
22
22
|
valueSetRef: Ref<Set<number | string>>;
|
|
23
23
|
pendingTmNodeRef: Ref<TreeNode<SelectBaseOption> | null>;
|
|
24
24
|
multipleRef: Ref<boolean>;
|
|
25
|
+
accountRef: Ref<boolean>;
|
|
25
26
|
valueRef: Ref<string | number | Array<string | number> | null>;
|
|
26
27
|
renderLabelRef: Ref<RenderLabel | undefined>;
|
|
27
28
|
renderOptionRef: Ref<RenderOption | undefined>;
|
|
@@ -68,6 +68,7 @@ export default cB('base-select-menu', `
|
|
|
68
68
|
white-space: nowrap;
|
|
69
69
|
text-overflow: ellipsis;
|
|
70
70
|
overflow: hidden;
|
|
71
|
+
width: 100%;
|
|
71
72
|
`), cM('show-checkmark', `
|
|
72
73
|
padding-right: calc(var(--u-option-padding-right) + 20px);
|
|
73
74
|
`), c('&::before', `
|
|
@@ -91,9 +92,9 @@ export default cB('base-select-menu', `
|
|
|
91
92
|
padding-left: var(--u-option-padding-left);
|
|
92
93
|
`), cM('pending', [c('&::before', `
|
|
93
94
|
background-color: var(--u-option-color-pending);
|
|
94
|
-
`)]), cM('selected', `
|
|
95
|
+
`)]), cM('selected', [cNotM('account', `
|
|
95
96
|
color: var(--u-option-text-color-active);
|
|
96
|
-
|
|
97
|
+
`), c('&::before', `
|
|
97
98
|
background-color: var(--u-option-color-active);
|
|
98
99
|
`), cM('pending', [c('&::before', `
|
|
99
100
|
background-color: var(--u-option-color-active-pending);
|
|
@@ -104,7 +105,7 @@ export default cB('base-select-menu', `
|
|
|
104
105
|
`), cM('selected', `
|
|
105
106
|
opacity: var(--u-option-opacity-disabled);
|
|
106
107
|
`)]), cE('check', `
|
|
107
|
-
font-size:
|
|
108
|
+
font-size: 24px;
|
|
108
109
|
position: absolute;
|
|
109
110
|
right: calc(var(--u-option-padding-right) - 4px);
|
|
110
111
|
top: calc(50% - 7px);
|