@uzum-tech/ui 1.13.0 → 1.13.2
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 +128 -85
- package/dist/index.prod.js +2 -2
- package/es/collapse/index.d.ts +5 -4
- package/es/collapse/index.js +4 -2
- package/es/collapse/src/Collapse.d.ts +62 -123
- package/es/collapse/src/Collapse.js +7 -27
- package/es/collapse/src/CollapseItem.d.ts +8 -18
- package/es/collapse/src/CollapseItem.js +36 -24
- package/es/collapse/src/interface.d.ts +1 -10
- package/es/collapse/src/props/collapse.props.d.ts +100 -0
- package/es/collapse/src/props/collapse.props.js +29 -0
- package/es/collapse/src/props/collapseItem.props.d.ts +7 -0
- package/es/collapse/src/props/collapseItem.props.js +6 -0
- package/es/collapse/src/styles/index.cssr.js +6 -2
- package/es/collapse/src/types/collapse.types.d.ts +55 -0
- package/es/collapse/src/types/collapse.types.js +1 -0
- package/es/collapse/styles/light.d.ts +3 -0
- package/es/collapse/styles/light.js +5 -2
- package/es/dropdown/src/Dropdown.d.ts +1 -1
- package/es/icon-bar/index.d.ts +4 -4
- package/es/icon-bar/index.js +3 -2
- package/es/icon-bar/src/IconBar.d.ts +19 -69
- package/es/icon-bar/src/IconBar.js +6 -11
- package/es/icon-bar/src/IconBarItem.d.ts +81 -65
- package/es/icon-bar/src/IconBarItem.js +6 -5
- package/es/icon-bar/src/interface.d.ts +112 -0
- package/es/icon-bar/src/interface.js +17 -0
- package/es/popconfirm/src/Popconfirm.d.ts +1 -1
- package/es/popover/src/Popover.d.ts +1 -1
- package/es/qr-code/src/QrCode.d.ts +1 -1
- package/es/tooltip/src/Tooltip.d.ts +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/collapse/index.d.ts +5 -4
- package/lib/collapse/index.js +5 -3
- package/lib/collapse/src/Collapse.d.ts +62 -123
- package/lib/collapse/src/Collapse.js +8 -28
- package/lib/collapse/src/CollapseItem.d.ts +8 -18
- package/lib/collapse/src/CollapseItem.js +35 -24
- package/lib/collapse/src/interface.d.ts +1 -10
- package/lib/collapse/src/props/collapse.props.d.ts +100 -0
- package/lib/collapse/src/props/collapse.props.js +32 -0
- package/lib/collapse/src/props/collapseItem.props.d.ts +7 -0
- package/lib/collapse/src/props/collapseItem.props.js +9 -0
- package/lib/collapse/src/styles/index.cssr.js +6 -2
- package/lib/collapse/src/types/collapse.types.d.ts +55 -0
- package/lib/collapse/src/types/collapse.types.js +2 -0
- package/lib/collapse/styles/light.d.ts +3 -0
- package/lib/collapse/styles/light.js +5 -2
- package/lib/dropdown/src/Dropdown.d.ts +1 -1
- package/lib/icon-bar/index.d.ts +4 -4
- package/lib/icon-bar/index.js +4 -3
- package/lib/icon-bar/src/IconBar.d.ts +19 -69
- package/lib/icon-bar/src/IconBar.js +6 -12
- package/lib/icon-bar/src/IconBarItem.d.ts +81 -65
- package/lib/icon-bar/src/IconBarItem.js +6 -6
- package/lib/icon-bar/src/interface.d.ts +112 -0
- package/lib/icon-bar/src/interface.js +20 -0
- package/lib/popconfirm/src/Popconfirm.d.ts +1 -1
- package/lib/popover/src/Popover.d.ts +1 -1
- package/lib/qr-code/src/QrCode.d.ts +1 -1
- package/lib/tooltip/src/Tooltip.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/web-types.json +13 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useTheme } from '../../../_mixins';
|
|
2
|
+
import { warn } from '../../../_utils';
|
|
3
|
+
export const collapseProps = Object.assign(Object.assign({}, useTheme.props), { defaultExpandedNames: {
|
|
4
|
+
type: [Array, String],
|
|
5
|
+
default: null
|
|
6
|
+
}, expandedNames: [Array, String], arrowPlacement: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: 'right-edge'
|
|
9
|
+
}, accordion: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false
|
|
12
|
+
}, displayDirective: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'if'
|
|
15
|
+
}, triggerAreas: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => ['main', 'extra', 'arrow']
|
|
18
|
+
}, onItemHeaderClick: [Function, Array], 'onUpdate:expandedNames': [Function, Array], onUpdateExpandedNames: [Function, Array],
|
|
19
|
+
// deprecated
|
|
20
|
+
onExpandedNamesChange: {
|
|
21
|
+
type: [Function, Array],
|
|
22
|
+
validator: () => {
|
|
23
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
24
|
+
warn('collapse', '`on-expanded-names-change` is deprecated, please use `on-update:expanded-names` instead.');
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
},
|
|
28
|
+
default: undefined
|
|
29
|
+
} });
|
|
@@ -16,6 +16,9 @@ import { fadeInHeightExpandTransition } from '../../../_styles/transitions/fade-
|
|
|
16
16
|
// --u-border-radius
|
|
17
17
|
// --u-padding
|
|
18
18
|
// --u-box-sizing
|
|
19
|
+
// --u-icon-border
|
|
20
|
+
// --u-icon-border-radius
|
|
21
|
+
// --u-icon-background
|
|
19
22
|
export default cB('collapse', `
|
|
20
23
|
width: 100%;
|
|
21
24
|
background-color: var(--u-background-color);
|
|
@@ -44,8 +47,9 @@ export default cB('collapse', `
|
|
|
44
47
|
height: 28px;
|
|
45
48
|
justify-content: center;
|
|
46
49
|
align-items: center;
|
|
47
|
-
border
|
|
48
|
-
|
|
50
|
+
border: var(--u-icon-border);
|
|
51
|
+
border-radius: var(--u-icon-border-radius);
|
|
52
|
+
background: var(--u-icon-background);
|
|
49
53
|
`, [cB('base-icon', `
|
|
50
54
|
transform: scaleY(1) rotate(90deg);
|
|
51
55
|
transition:
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Ref, VNode } from 'vue';
|
|
2
|
+
import type { ExtractPublicPropTypes } from '../../../_utils';
|
|
3
|
+
import { collapseItemProps } from '../props/collapseItem.props';
|
|
4
|
+
import { collapseProps } from '../props/collapse.props';
|
|
5
|
+
export type CollapseTriggerArea = 'main' | 'extra' | 'arrow';
|
|
6
|
+
export type CollapseExpandedName = string | number;
|
|
7
|
+
export type CollapseExpandedNames = CollapseExpandedName | CollapseExpandedName[] | null;
|
|
8
|
+
export type OnUpdateExpandedNames = <T extends string[] & number[] & Array<string | number> & (string | number | null) & (string | null) & (number | null)>(value: T) => void;
|
|
9
|
+
export type OnUpdateExpandedNamesImpl = <T extends string[] | number[] | Array<string | number> | (string | number | null) | (string | null) | (number | null)>(value: T) => void;
|
|
10
|
+
export type OnItemHeaderClick = <T extends string & number & (string | number)>(info: HeaderClickInfo<T>) => void;
|
|
11
|
+
export type OnItemHeaderClickImpl = <T extends string | number | (string | number)>(info: HeaderClickInfo<T>) => void;
|
|
12
|
+
export interface HeaderClickInfo<T> {
|
|
13
|
+
name: T;
|
|
14
|
+
expanded: boolean;
|
|
15
|
+
event: MouseEvent;
|
|
16
|
+
}
|
|
17
|
+
export type ArrowPlacement = 'left' | 'right' | 'right-edge';
|
|
18
|
+
export interface CollapseArrowSlotProps {
|
|
19
|
+
collapsed: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface CollapseItemHeaderSlotProps {
|
|
22
|
+
collapsed: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface CollapseItemHeaderExtraSlotProps {
|
|
25
|
+
collapsed: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface CollapseItemArrowSlotProps {
|
|
28
|
+
collapsed: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface CollapseSlots {
|
|
31
|
+
default?: () => VNode[];
|
|
32
|
+
arrow?: (props: CollapseArrowSlotProps) => VNode[];
|
|
33
|
+
header?: (props: CollapseItemHeaderSlotProps) => VNode[];
|
|
34
|
+
'header-extra'?: (props: CollapseItemHeaderExtraSlotProps) => VNode[];
|
|
35
|
+
}
|
|
36
|
+
export interface CollapseItemSlots {
|
|
37
|
+
default?: () => VNode[];
|
|
38
|
+
header?: (props: CollapseItemHeaderSlotProps) => VNode[];
|
|
39
|
+
'header-extra'?: (props: CollapseItemHeaderExtraSlotProps) => VNode[];
|
|
40
|
+
arrow?: (props: CollapseItemArrowSlotProps) => VNode[];
|
|
41
|
+
}
|
|
42
|
+
export interface UCollapseInjectionProps {
|
|
43
|
+
triggerAreas: CollapseTriggerArea[];
|
|
44
|
+
displayDirective: 'if' | 'show';
|
|
45
|
+
arrowPlacement: ArrowPlacement;
|
|
46
|
+
}
|
|
47
|
+
export interface UCollapseInjection {
|
|
48
|
+
props: UCollapseInjectionProps;
|
|
49
|
+
expandedNamesRef: Ref<CollapseExpandedNames>;
|
|
50
|
+
mergedClsPrefixRef: Ref<string>;
|
|
51
|
+
slots: CollapseSlots;
|
|
52
|
+
toggleItem: (collapse: boolean, name: CollapseExpandedName, event: MouseEvent) => void;
|
|
53
|
+
}
|
|
54
|
+
export type CollapseProps = ExtractPublicPropTypes<typeof collapseProps>;
|
|
55
|
+
export type CollapseItemProps = ExtractPublicPropTypes<typeof collapseItemProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -18,6 +18,9 @@ export declare const self: (vars: ThemeCommonVars) => {
|
|
|
18
18
|
borderRadius: string;
|
|
19
19
|
padding: string;
|
|
20
20
|
boxSizing: string;
|
|
21
|
+
iconBorder: string;
|
|
22
|
+
iconBorderRadius: string;
|
|
23
|
+
iconBackground: string;
|
|
21
24
|
};
|
|
22
25
|
export type CollapseThemeVars = ReturnType<typeof self>;
|
|
23
26
|
declare const collapseLight: Theme<'Collapse', CollapseThemeVars>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { commonLight } from '../../_styles/common';
|
|
2
2
|
export const self = (vars) => {
|
|
3
|
-
const { fontWeight, fontBodyLarge, lineHeightBodyLarge, elementsQuaternary, textPrimary, textSecondary, fontBodyMedium, lineHeightBodyMedium, iconSmall, containerPrimary } = vars;
|
|
3
|
+
const { fontWeight, fontBodyLarge, lineHeightBodyLarge, elementsQuaternary, textPrimary, textSecondary, fontBodyMedium, lineHeightBodyMedium, iconSmall, containerPrimary, elementsTertiary } = vars;
|
|
4
4
|
return {
|
|
5
5
|
titleFontSize: fontBodyLarge,
|
|
6
6
|
titleLineHeight: lineHeightBodyLarge,
|
|
@@ -18,7 +18,10 @@ export const self = (vars) => {
|
|
|
18
18
|
backgroundColor: containerPrimary,
|
|
19
19
|
borderRadius: '20px',
|
|
20
20
|
padding: '24px',
|
|
21
|
-
boxSizing: 'border-box'
|
|
21
|
+
boxSizing: 'border-box',
|
|
22
|
+
iconBorder: 'none',
|
|
23
|
+
iconBorderRadius: '100px',
|
|
24
|
+
iconBackground: elementsTertiary
|
|
22
25
|
};
|
|
23
26
|
};
|
|
24
27
|
const collapseLight = {
|
|
@@ -1109,6 +1109,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1109
1109
|
readonly trigger: import("../../popover").PopoverTrigger;
|
|
1110
1110
|
readonly labelField: string;
|
|
1111
1111
|
readonly childrenField: string;
|
|
1112
|
+
readonly arrow: boolean | undefined;
|
|
1112
1113
|
readonly displayDirective: "show" | "if";
|
|
1113
1114
|
readonly defaultShow: boolean;
|
|
1114
1115
|
readonly animated: boolean;
|
|
@@ -1126,6 +1127,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1126
1127
|
readonly internalInheritedEventHandlers: import("../../popover/src/Popover").TriggerEventHandlers[];
|
|
1127
1128
|
readonly internalTrapFocus: boolean;
|
|
1128
1129
|
readonly internalExtraClass: string[];
|
|
1129
|
-
readonly arrow: boolean | undefined;
|
|
1130
1130
|
}, {}>;
|
|
1131
1131
|
export default _default;
|
package/es/icon-bar/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as UIconBar
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export type { IconBarItemProps } from './src/
|
|
1
|
+
export { default as UIconBar } from './src/IconBar';
|
|
2
|
+
export { default as UIconBarItem } from './src/IconBarItem';
|
|
3
|
+
export { iconBarProps, iconBarItemProps } from './src/interface';
|
|
4
|
+
export type { IconBarProps, IconBarItemProps } from './src/interface';
|
package/es/icon-bar/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { default as UIconBar
|
|
2
|
-
export { default as UIconBarItem
|
|
1
|
+
export { default as UIconBar } from './src/IconBar';
|
|
2
|
+
export { default as UIconBarItem } from './src/IconBarItem';
|
|
3
|
+
export { iconBarProps, iconBarItemProps } from './src/interface';
|
|
@@ -1,63 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IconBarItemProps } from './IconBarItem';
|
|
3
|
-
import { GridProps } from '../../grid';
|
|
4
|
-
export declare const iconBarProps: {
|
|
5
|
-
readonly items: {
|
|
6
|
-
readonly type: PropType<IconBarItemProps[]>;
|
|
7
|
-
readonly default: () => never[];
|
|
8
|
-
};
|
|
9
|
-
readonly cols: {
|
|
10
|
-
readonly type: NumberConstructor;
|
|
11
|
-
readonly default: 6;
|
|
12
|
-
};
|
|
13
|
-
readonly gridProps: {
|
|
14
|
-
readonly type: PropType<Partial<GridProps>>;
|
|
15
|
-
};
|
|
16
|
-
readonly itemSize: PropType<number | string>;
|
|
17
|
-
readonly theme: PropType<import("../../_mixins").Theme<"IconBar", {
|
|
18
|
-
itemSize: string;
|
|
19
|
-
color: string;
|
|
20
|
-
colorHover: string;
|
|
21
|
-
itemGap: string;
|
|
22
|
-
iconSize: string;
|
|
23
|
-
labelColor: string;
|
|
24
|
-
labelSizeHover: string;
|
|
25
|
-
labelColorHover: string;
|
|
26
|
-
boxShadow: string;
|
|
27
|
-
span: number;
|
|
28
|
-
cols: number;
|
|
29
|
-
}, any>>;
|
|
30
|
-
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
31
|
-
itemSize: string;
|
|
32
|
-
color: string;
|
|
33
|
-
colorHover: string;
|
|
34
|
-
itemGap: string;
|
|
35
|
-
iconSize: string;
|
|
36
|
-
labelColor: string;
|
|
37
|
-
labelSizeHover: string;
|
|
38
|
-
labelColorHover: string;
|
|
39
|
-
boxShadow: string;
|
|
40
|
-
span: number;
|
|
41
|
-
cols: number;
|
|
42
|
-
}, any>>>;
|
|
43
|
-
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
44
|
-
itemSize: string;
|
|
45
|
-
color: string;
|
|
46
|
-
colorHover: string;
|
|
47
|
-
itemGap: string;
|
|
48
|
-
iconSize: string;
|
|
49
|
-
labelColor: string;
|
|
50
|
-
labelSizeHover: string;
|
|
51
|
-
labelColorHover: string;
|
|
52
|
-
boxShadow: string;
|
|
53
|
-
span: number;
|
|
54
|
-
cols: number;
|
|
55
|
-
}, any>>>;
|
|
56
|
-
};
|
|
57
|
-
export type IconBarProps = ExtractPublicPropTypes<typeof iconBarProps>;
|
|
1
|
+
import { IconBarItemProps } from './interface';
|
|
58
2
|
declare const _default: import("vue").DefineComponent<{
|
|
59
3
|
readonly items: {
|
|
60
|
-
readonly type: PropType<IconBarItemProps[]>;
|
|
4
|
+
readonly type: import("vue").PropType<IconBarItemProps[]>;
|
|
61
5
|
readonly default: () => never[];
|
|
62
6
|
};
|
|
63
7
|
readonly cols: {
|
|
@@ -65,10 +9,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
65
9
|
readonly default: 6;
|
|
66
10
|
};
|
|
67
11
|
readonly gridProps: {
|
|
68
|
-
readonly type: PropType<Partial<GridProps>>;
|
|
12
|
+
readonly type: import("vue").PropType<Partial<import("../../grid").GridProps>>;
|
|
69
13
|
};
|
|
70
|
-
readonly
|
|
71
|
-
|
|
14
|
+
readonly typographyProps: {
|
|
15
|
+
readonly type: import("vue").PropType<Partial<import("../..").TextProps>>;
|
|
16
|
+
};
|
|
17
|
+
readonly itemSize: import("vue").PropType<number | string>;
|
|
18
|
+
readonly theme: import("vue").PropType<import("../../_mixins").Theme<"IconBar", {
|
|
72
19
|
itemSize: string;
|
|
73
20
|
color: string;
|
|
74
21
|
colorHover: string;
|
|
@@ -81,7 +28,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
81
28
|
span: number;
|
|
82
29
|
cols: number;
|
|
83
30
|
}, any>>;
|
|
84
|
-
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
31
|
+
readonly themeOverrides: import("vue").PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
85
32
|
itemSize: string;
|
|
86
33
|
color: string;
|
|
87
34
|
colorHover: string;
|
|
@@ -94,7 +41,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
94
41
|
span: number;
|
|
95
42
|
cols: number;
|
|
96
43
|
}, any>>>;
|
|
97
|
-
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
44
|
+
readonly builtinThemeOverrides: import("vue").PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
98
45
|
itemSize: string;
|
|
99
46
|
color: string;
|
|
100
47
|
colorHover: string;
|
|
@@ -118,7 +65,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
118
65
|
onRender: (() => void) | undefined;
|
|
119
66
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
120
67
|
readonly items: {
|
|
121
|
-
readonly type: PropType<IconBarItemProps[]>;
|
|
68
|
+
readonly type: import("vue").PropType<IconBarItemProps[]>;
|
|
122
69
|
readonly default: () => never[];
|
|
123
70
|
};
|
|
124
71
|
readonly cols: {
|
|
@@ -126,10 +73,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
126
73
|
readonly default: 6;
|
|
127
74
|
};
|
|
128
75
|
readonly gridProps: {
|
|
129
|
-
readonly type: PropType<Partial<GridProps>>;
|
|
76
|
+
readonly type: import("vue").PropType<Partial<import("../../grid").GridProps>>;
|
|
77
|
+
};
|
|
78
|
+
readonly typographyProps: {
|
|
79
|
+
readonly type: import("vue").PropType<Partial<import("../..").TextProps>>;
|
|
130
80
|
};
|
|
131
|
-
readonly itemSize: PropType<number | string>;
|
|
132
|
-
readonly theme: PropType<import("../../_mixins").Theme<"IconBar", {
|
|
81
|
+
readonly itemSize: import("vue").PropType<number | string>;
|
|
82
|
+
readonly theme: import("vue").PropType<import("../../_mixins").Theme<"IconBar", {
|
|
133
83
|
itemSize: string;
|
|
134
84
|
color: string;
|
|
135
85
|
colorHover: string;
|
|
@@ -142,7 +92,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
142
92
|
span: number;
|
|
143
93
|
cols: number;
|
|
144
94
|
}, any>>;
|
|
145
|
-
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
95
|
+
readonly themeOverrides: import("vue").PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
146
96
|
itemSize: string;
|
|
147
97
|
color: string;
|
|
148
98
|
colorHover: string;
|
|
@@ -155,7 +105,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
155
105
|
span: number;
|
|
156
106
|
cols: number;
|
|
157
107
|
}, any>>>;
|
|
158
|
-
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
108
|
+
readonly builtinThemeOverrides: import("vue").PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
159
109
|
itemSize: string;
|
|
160
110
|
color: string;
|
|
161
111
|
colorHover: string;
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import { computed, defineComponent, h } from 'vue';
|
|
1
|
+
import { computed, defineComponent, h, provide, toRef } from 'vue';
|
|
2
2
|
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
3
3
|
import { iconBarLight } from '../styles';
|
|
4
4
|
import style from './styles/index.cssr';
|
|
5
|
-
import IconBarItem from './IconBarItem';
|
|
6
5
|
import { UGrid, UGridItem } from '../../grid';
|
|
7
6
|
import { resolveSize } from '../../_utils';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
default: () => []
|
|
11
|
-
}, cols: {
|
|
12
|
-
type: Number,
|
|
13
|
-
default: 6
|
|
14
|
-
}, gridProps: {
|
|
15
|
-
type: Object
|
|
16
|
-
}, itemSize: [Number, String] });
|
|
7
|
+
import { iconBarInjectionKey, iconBarProps } from './interface';
|
|
8
|
+
import IconBarItem from './IconBarItem';
|
|
17
9
|
export default defineComponent({
|
|
18
10
|
name: 'IconBar',
|
|
19
11
|
props: iconBarProps,
|
|
20
12
|
setup(props, { slots }) {
|
|
21
13
|
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
14
|
+
provide(iconBarInjectionKey, {
|
|
15
|
+
typographyPropsRef: toRef(props, 'typographyProps')
|
|
16
|
+
});
|
|
22
17
|
const themeRef = useTheme('IconBar', '-icon-bar', style, iconBarLight, props, mergedClsPrefixRef);
|
|
23
18
|
const cssVarsRef = computed(() => {
|
|
24
19
|
const { self: { itemSize } } = themeRef.value;
|
|
@@ -1,63 +1,12 @@
|
|
|
1
|
-
import { ExtractPublicPropTypes, PropType, VNodeChild } from 'vue';
|
|
2
|
-
import { TextProps } from '../../typography';
|
|
3
|
-
export declare const iconBarItemProps: {
|
|
4
|
-
readonly label: StringConstructor;
|
|
5
|
-
readonly icon: PropType<() => VNodeChild>;
|
|
6
|
-
readonly iconSize: PropType<number | string>;
|
|
7
|
-
readonly span: PropType<number | string>;
|
|
8
|
-
readonly typographyProps: {
|
|
9
|
-
readonly type: PropType<Partial<TextProps>>;
|
|
10
|
-
};
|
|
11
|
-
readonly theme: PropType<import("../../_mixins").Theme<"IconBar", {
|
|
12
|
-
itemSize: string;
|
|
13
|
-
color: string;
|
|
14
|
-
colorHover: string;
|
|
15
|
-
itemGap: string;
|
|
16
|
-
iconSize: string;
|
|
17
|
-
labelColor: string;
|
|
18
|
-
labelSizeHover: string;
|
|
19
|
-
labelColorHover: string;
|
|
20
|
-
boxShadow: string;
|
|
21
|
-
span: number;
|
|
22
|
-
cols: number;
|
|
23
|
-
}, any>>;
|
|
24
|
-
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
25
|
-
itemSize: string;
|
|
26
|
-
color: string;
|
|
27
|
-
colorHover: string;
|
|
28
|
-
itemGap: string;
|
|
29
|
-
iconSize: string;
|
|
30
|
-
labelColor: string;
|
|
31
|
-
labelSizeHover: string;
|
|
32
|
-
labelColorHover: string;
|
|
33
|
-
boxShadow: string;
|
|
34
|
-
span: number;
|
|
35
|
-
cols: number;
|
|
36
|
-
}, any>>>;
|
|
37
|
-
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
38
|
-
itemSize: string;
|
|
39
|
-
color: string;
|
|
40
|
-
colorHover: string;
|
|
41
|
-
itemGap: string;
|
|
42
|
-
iconSize: string;
|
|
43
|
-
labelColor: string;
|
|
44
|
-
labelSizeHover: string;
|
|
45
|
-
labelColorHover: string;
|
|
46
|
-
boxShadow: string;
|
|
47
|
-
span: number;
|
|
48
|
-
cols: number;
|
|
49
|
-
}, any>>>;
|
|
50
|
-
};
|
|
51
|
-
export type IconBarItemProps = ExtractPublicPropTypes<typeof iconBarItemProps>;
|
|
52
1
|
declare const _default: import("vue").DefineComponent<{
|
|
53
2
|
readonly label: StringConstructor;
|
|
54
|
-
readonly icon: PropType<() => VNodeChild>;
|
|
55
|
-
readonly iconSize: PropType<number | string>;
|
|
56
|
-
readonly span: PropType<number | string>;
|
|
3
|
+
readonly icon: import("vue").PropType<() => import("vue").VNodeChild>;
|
|
4
|
+
readonly iconSize: import("vue").PropType<number | string>;
|
|
5
|
+
readonly span: import("vue").PropType<number | string>;
|
|
57
6
|
readonly typographyProps: {
|
|
58
|
-
readonly type: PropType<Partial<TextProps>>;
|
|
7
|
+
readonly type: import("vue").PropType<Partial<import("../../typography").TextProps>>;
|
|
59
8
|
};
|
|
60
|
-
readonly theme: PropType<import("../../_mixins").Theme<"IconBar", {
|
|
9
|
+
readonly theme: import("vue").PropType<import("../../_mixins").Theme<"IconBar", {
|
|
61
10
|
itemSize: string;
|
|
62
11
|
color: string;
|
|
63
12
|
colorHover: string;
|
|
@@ -70,7 +19,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
70
19
|
span: number;
|
|
71
20
|
cols: number;
|
|
72
21
|
}, any>>;
|
|
73
|
-
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
22
|
+
readonly themeOverrides: import("vue").PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
74
23
|
itemSize: string;
|
|
75
24
|
color: string;
|
|
76
25
|
colorHover: string;
|
|
@@ -83,7 +32,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
83
32
|
span: number;
|
|
84
33
|
cols: number;
|
|
85
34
|
}, any>>>;
|
|
86
|
-
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
35
|
+
readonly builtinThemeOverrides: import("vue").PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
87
36
|
itemSize: string;
|
|
88
37
|
color: string;
|
|
89
38
|
colorHover: string;
|
|
@@ -111,16 +60,83 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
111
60
|
'--u-icon-bar-item-span': string;
|
|
112
61
|
}> | undefined;
|
|
113
62
|
themeClass: import("vue").Ref<string> | undefined;
|
|
63
|
+
mergedTypographyProps: import("vue").ComputedRef<{
|
|
64
|
+
type?: "default" | "info" | "warning" | "error" | "success" | undefined;
|
|
65
|
+
theme?: import("../../_mixins").Theme<"Typography", {
|
|
66
|
+
margin: string;
|
|
67
|
+
aTextColor: string;
|
|
68
|
+
blockquoteTextColor: string;
|
|
69
|
+
blockquotePrefixColor: string;
|
|
70
|
+
codeBorderRadius: string;
|
|
71
|
+
fontSize: string;
|
|
72
|
+
lineHeight: string;
|
|
73
|
+
textColor: string;
|
|
74
|
+
textColorPrimary: string;
|
|
75
|
+
textColorInfo: string;
|
|
76
|
+
textColorSuccess: string;
|
|
77
|
+
textColorWarning: string;
|
|
78
|
+
textColorError: string;
|
|
79
|
+
codeTextColor: string;
|
|
80
|
+
codeColor: string;
|
|
81
|
+
codeBorder: string;
|
|
82
|
+
}, any> | undefined;
|
|
83
|
+
themeOverrides?: import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Typography", {
|
|
84
|
+
margin: string;
|
|
85
|
+
aTextColor: string;
|
|
86
|
+
blockquoteTextColor: string;
|
|
87
|
+
blockquotePrefixColor: string;
|
|
88
|
+
codeBorderRadius: string;
|
|
89
|
+
fontSize: string;
|
|
90
|
+
lineHeight: string;
|
|
91
|
+
textColor: string;
|
|
92
|
+
textColorPrimary: string;
|
|
93
|
+
textColorInfo: string;
|
|
94
|
+
textColorSuccess: string;
|
|
95
|
+
textColorWarning: string;
|
|
96
|
+
textColorError: string;
|
|
97
|
+
codeTextColor: string;
|
|
98
|
+
codeColor: string;
|
|
99
|
+
codeBorder: string;
|
|
100
|
+
}, any>> | undefined;
|
|
101
|
+
builtinThemeOverrides?: import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Typography", {
|
|
102
|
+
margin: string;
|
|
103
|
+
aTextColor: string;
|
|
104
|
+
blockquoteTextColor: string;
|
|
105
|
+
blockquotePrefixColor: string;
|
|
106
|
+
codeBorderRadius: string;
|
|
107
|
+
fontSize: string;
|
|
108
|
+
lineHeight: string;
|
|
109
|
+
textColor: string;
|
|
110
|
+
textColorPrimary: string;
|
|
111
|
+
textColorInfo: string;
|
|
112
|
+
textColorSuccess: string;
|
|
113
|
+
textColorWarning: string;
|
|
114
|
+
textColorError: string;
|
|
115
|
+
codeTextColor: string;
|
|
116
|
+
codeColor: string;
|
|
117
|
+
codeBorder: string;
|
|
118
|
+
}, any>> | undefined;
|
|
119
|
+
tag?: keyof HTMLElementTagNameMap | undefined;
|
|
120
|
+
color?: string | undefined;
|
|
121
|
+
strong?: boolean | undefined;
|
|
122
|
+
text?: string | undefined;
|
|
123
|
+
variant?: import("../../typography").TypographyVariant | undefined;
|
|
124
|
+
italic?: boolean | undefined;
|
|
125
|
+
variantOptions?: import("../../typography").TypographyVariantOptions | undefined;
|
|
126
|
+
variantWeightsOptions?: import("../../typography").TypographyVariantWeightsOptions | undefined;
|
|
127
|
+
underline?: boolean | undefined;
|
|
128
|
+
strikethrough?: boolean | undefined;
|
|
129
|
+
}>;
|
|
114
130
|
onRender: (() => void) | undefined;
|
|
115
131
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
116
132
|
readonly label: StringConstructor;
|
|
117
|
-
readonly icon: PropType<() => VNodeChild>;
|
|
118
|
-
readonly iconSize: PropType<number | string>;
|
|
119
|
-
readonly span: PropType<number | string>;
|
|
133
|
+
readonly icon: import("vue").PropType<() => import("vue").VNodeChild>;
|
|
134
|
+
readonly iconSize: import("vue").PropType<number | string>;
|
|
135
|
+
readonly span: import("vue").PropType<number | string>;
|
|
120
136
|
readonly typographyProps: {
|
|
121
|
-
readonly type: PropType<Partial<TextProps>>;
|
|
137
|
+
readonly type: import("vue").PropType<Partial<import("../../typography").TextProps>>;
|
|
122
138
|
};
|
|
123
|
-
readonly theme: PropType<import("../../_mixins").Theme<"IconBar", {
|
|
139
|
+
readonly theme: import("vue").PropType<import("../../_mixins").Theme<"IconBar", {
|
|
124
140
|
itemSize: string;
|
|
125
141
|
color: string;
|
|
126
142
|
colorHover: string;
|
|
@@ -133,7 +149,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
133
149
|
span: number;
|
|
134
150
|
cols: number;
|
|
135
151
|
}, any>>;
|
|
136
|
-
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
152
|
+
readonly themeOverrides: import("vue").PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
137
153
|
itemSize: string;
|
|
138
154
|
color: string;
|
|
139
155
|
colorHover: string;
|
|
@@ -146,7 +162,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
146
162
|
span: number;
|
|
147
163
|
cols: number;
|
|
148
164
|
}, any>>>;
|
|
149
|
-
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
165
|
+
readonly builtinThemeOverrides: import("vue").PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"IconBar", {
|
|
150
166
|
itemSize: string;
|
|
151
167
|
color: string;
|
|
152
168
|
colorHover: string;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { computed, defineComponent, h } from 'vue';
|
|
1
|
+
import { computed, defineComponent, h, inject } from 'vue';
|
|
2
2
|
import { useConfig, useTheme, useThemeClass } from '../../_mixins';
|
|
3
3
|
import { iconBarLight } from '../styles';
|
|
4
4
|
import style from './styles/index.cssr';
|
|
5
5
|
import { UText } from '../../typography';
|
|
6
6
|
import { resolveSize } from '../../_utils';
|
|
7
|
-
|
|
8
|
-
type: Object
|
|
9
|
-
} });
|
|
7
|
+
import { iconBarInjectionKey, iconBarItemProps } from './interface';
|
|
10
8
|
export default defineComponent({
|
|
11
9
|
name: 'IconBarItem',
|
|
12
10
|
props: iconBarItemProps,
|
|
13
11
|
setup(props) {
|
|
14
12
|
const { mergedClsPrefixRef, inlineThemeDisabled } = useConfig(props);
|
|
13
|
+
const iconBarInjection = inject(iconBarInjectionKey, null);
|
|
14
|
+
const mergedTypographyPropsRef = computed(() => (Object.assign(Object.assign({}, iconBarInjection === null || iconBarInjection === void 0 ? void 0 : iconBarInjection.typographyPropsRef.value), props.typographyProps)));
|
|
15
15
|
const themeRef = useTheme('IconBar', '-icon-bar-item', style, iconBarLight, props, mergedClsPrefixRef);
|
|
16
16
|
const cssVarsRef = computed(() => {
|
|
17
17
|
const { self: { iconSize, labelColor, labelSizeHover, labelColorHover, color, colorHover, boxShadow, itemGap, span }, common: { cubicBezierEaseInOut } } = themeRef.value;
|
|
@@ -35,6 +35,7 @@ export default defineComponent({
|
|
|
35
35
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
36
36
|
cssVars: inlineThemeDisabled ? undefined : cssVarsRef,
|
|
37
37
|
themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
|
|
38
|
+
mergedTypographyProps: mergedTypographyPropsRef,
|
|
38
39
|
onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
|
|
39
40
|
};
|
|
40
41
|
},
|
|
@@ -45,6 +46,6 @@ export default defineComponent({
|
|
|
45
46
|
return (h("div", { class: [`${mergedClsPrefix}-icon-bar-item-wrapper`, this.themeClass], style: this.cssVars },
|
|
46
47
|
h("div", { class: `${mergedClsPrefix}-icon-bar-item`, style: this.cssVars },
|
|
47
48
|
h("div", { class: `${mergedClsPrefix}-icon-bar-item__icon` }, ((_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a)) || ((_c = this.icon) === null || _c === void 0 ? void 0 : _c.call(this)))),
|
|
48
|
-
(this.$slots.label || this.label) && (h(UText, Object.assign({ class: `${mergedClsPrefix}-icon-bar-item-wrapper__label`, variant: "heading-s-bold" }, this.
|
|
49
|
+
(this.$slots.label || this.label) && (h(UText, Object.assign({ class: `${mergedClsPrefix}-icon-bar-item-wrapper__label`, variant: "heading-s-bold" }, this.mergedTypographyProps), ((_e = (_d = this.$slots).label) === null || _e === void 0 ? void 0 : _e.call(_d)) || this.label))));
|
|
49
50
|
}
|
|
50
51
|
});
|