@uzum-tech/ui 1.1.3 → 1.1.4
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 +396 -255
- package/dist/index.prod.js +2 -2
- package/es/components.d.ts +1 -0
- package/es/components.js +1 -0
- package/es/config-provider/src/internal-interface.d.ts +2 -0
- package/es/flex/index.d.ts +3 -0
- package/es/flex/index.js +1 -0
- package/es/flex/src/Flex.d.ts +116 -0
- package/es/flex/src/Flex.js +80 -0
- package/es/flex/src/styles/rtl.cssr.d.ts +2 -0
- package/es/flex/src/styles/rtl.cssr.js +4 -0
- package/es/flex/src/type.d.ts +3 -0
- package/es/flex/src/type.js +1 -0
- package/es/flex/styles/_common.d.ts +6 -0
- package/es/flex/styles/_common.js +5 -0
- package/es/flex/styles/dark.d.ts +3 -0
- package/es/flex/styles/dark.js +8 -0
- package/es/flex/styles/index.d.ts +4 -0
- package/es/flex/styles/index.js +3 -0
- package/es/flex/styles/light.d.ts +10 -0
- package/es/flex/styles/light.js +9 -0
- package/es/flex/styles/rtl.d.ts +2 -0
- package/es/flex/styles/rtl.js +5 -0
- package/es/themes/dark.js +3 -1
- package/es/themes/light.js +3 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/components.js +1 -0
- package/lib/config-provider/src/internal-interface.d.ts +2 -0
- package/lib/flex/index.d.ts +3 -0
- package/lib/flex/index.js +9 -0
- package/lib/flex/src/Flex.d.ts +116 -0
- package/lib/flex/src/Flex.js +83 -0
- package/lib/flex/src/styles/rtl.cssr.d.ts +2 -0
- package/lib/flex/src/styles/rtl.cssr.js +9 -0
- package/lib/flex/src/type.d.ts +3 -0
- package/lib/flex/src/type.js +2 -0
- package/lib/flex/styles/_common.d.ts +6 -0
- package/lib/flex/styles/_common.js +7 -0
- package/lib/flex/styles/dark.d.ts +3 -0
- package/lib/flex/styles/dark.js +13 -0
- package/lib/flex/styles/index.d.ts +4 -0
- package/lib/flex/styles/index.js +12 -0
- package/lib/flex/styles/light.d.ts +10 -0
- package/lib/flex/styles/light.js +14 -0
- package/lib/flex/styles/rtl.d.ts +2 -0
- package/lib/flex/styles/rtl.js +11 -0
- package/lib/themes/dark.js +3 -1
- package/lib/themes/light.js +3 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/volar.d.ts +1 -0
- package/web-types.json +90 -1
package/es/components.d.ts
CHANGED
package/es/components.js
CHANGED
|
@@ -97,6 +97,7 @@ import type { RowTheme } from '../../legacy-grid/styles';
|
|
|
97
97
|
import type { Katex } from './katex';
|
|
98
98
|
import type { ToggleButtonTheme } from '../../toggle-button/styles';
|
|
99
99
|
import type { AccountOptionTheme } from '../../_internal/account-option/styles';
|
|
100
|
+
import type { FlexTheme } from '../../flex/styles';
|
|
100
101
|
export interface GlobalThemeWithoutCommon {
|
|
101
102
|
Alert?: AlertTheme;
|
|
102
103
|
Anchor?: AnchorTheme;
|
|
@@ -181,6 +182,7 @@ export interface GlobalThemeWithoutCommon {
|
|
|
181
182
|
Watermark?: WatermarkTheme;
|
|
182
183
|
Row?: RowTheme;
|
|
183
184
|
ToggleButton?: ToggleButtonTheme;
|
|
185
|
+
Flex?: FlexTheme;
|
|
184
186
|
InternalSelectMenu?: InternalSelectMenuTheme;
|
|
185
187
|
InternalSelection?: InternalSelectionTheme;
|
|
186
188
|
AccountOption?: AccountOptionTheme;
|
package/es/flex/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UFlex, flexProps } from './src/Flex';
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { ExtractPublicPropTypes } from '../../_utils';
|
|
3
|
+
export declare const flexProps: {
|
|
4
|
+
readonly align: PropType<import("csstype").Property.AlignItems>;
|
|
5
|
+
readonly justify: {
|
|
6
|
+
readonly type: PropType<import("csstype").Property.JustifyContent>;
|
|
7
|
+
readonly default: "start";
|
|
8
|
+
};
|
|
9
|
+
readonly inline: BooleanConstructor;
|
|
10
|
+
readonly vertical: BooleanConstructor;
|
|
11
|
+
readonly reverse: BooleanConstructor;
|
|
12
|
+
readonly size: {
|
|
13
|
+
readonly type: PropType<number | [number, number] | "small" | "medium" | "large">;
|
|
14
|
+
readonly default: "medium";
|
|
15
|
+
};
|
|
16
|
+
readonly wrap: {
|
|
17
|
+
readonly type: BooleanConstructor;
|
|
18
|
+
readonly default: true;
|
|
19
|
+
};
|
|
20
|
+
readonly theme: PropType<import("../../_mixins").Theme<"Flex", {
|
|
21
|
+
gapSmall: string;
|
|
22
|
+
gapMedium: string;
|
|
23
|
+
gapLarge: string;
|
|
24
|
+
}, any>>;
|
|
25
|
+
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Flex", {
|
|
26
|
+
gapSmall: string;
|
|
27
|
+
gapMedium: string;
|
|
28
|
+
gapLarge: string;
|
|
29
|
+
}, any>>>;
|
|
30
|
+
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Flex", {
|
|
31
|
+
gapSmall: string;
|
|
32
|
+
gapMedium: string;
|
|
33
|
+
gapLarge: string;
|
|
34
|
+
}, any>>>;
|
|
35
|
+
};
|
|
36
|
+
export type FlexProps = ExtractPublicPropTypes<typeof flexProps>;
|
|
37
|
+
declare const _default: import("vue").DefineComponent<{
|
|
38
|
+
readonly align: PropType<import("csstype").Property.AlignItems>;
|
|
39
|
+
readonly justify: {
|
|
40
|
+
readonly type: PropType<import("csstype").Property.JustifyContent>;
|
|
41
|
+
readonly default: "start";
|
|
42
|
+
};
|
|
43
|
+
readonly inline: BooleanConstructor;
|
|
44
|
+
readonly vertical: BooleanConstructor;
|
|
45
|
+
readonly reverse: BooleanConstructor;
|
|
46
|
+
readonly size: {
|
|
47
|
+
readonly type: PropType<number | [number, number] | "small" | "medium" | "large">;
|
|
48
|
+
readonly default: "medium";
|
|
49
|
+
};
|
|
50
|
+
readonly wrap: {
|
|
51
|
+
readonly type: BooleanConstructor;
|
|
52
|
+
readonly default: true;
|
|
53
|
+
};
|
|
54
|
+
readonly theme: PropType<import("../../_mixins").Theme<"Flex", {
|
|
55
|
+
gapSmall: string;
|
|
56
|
+
gapMedium: string;
|
|
57
|
+
gapLarge: string;
|
|
58
|
+
}, any>>;
|
|
59
|
+
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Flex", {
|
|
60
|
+
gapSmall: string;
|
|
61
|
+
gapMedium: string;
|
|
62
|
+
gapLarge: string;
|
|
63
|
+
}, any>>>;
|
|
64
|
+
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Flex", {
|
|
65
|
+
gapSmall: string;
|
|
66
|
+
gapMedium: string;
|
|
67
|
+
gapLarge: string;
|
|
68
|
+
}, any>>>;
|
|
69
|
+
}, {
|
|
70
|
+
rtlEnabled: import("vue").Ref<import("../../config-provider/src/internal-interface").RtlItem | undefined> | undefined;
|
|
71
|
+
mergedClsPrefix: import("vue").Ref<string>;
|
|
72
|
+
margin: import("vue").ComputedRef<{
|
|
73
|
+
horizontal: number;
|
|
74
|
+
vertical: number;
|
|
75
|
+
}>;
|
|
76
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
77
|
+
readonly align: PropType<import("csstype").Property.AlignItems>;
|
|
78
|
+
readonly justify: {
|
|
79
|
+
readonly type: PropType<import("csstype").Property.JustifyContent>;
|
|
80
|
+
readonly default: "start";
|
|
81
|
+
};
|
|
82
|
+
readonly inline: BooleanConstructor;
|
|
83
|
+
readonly vertical: BooleanConstructor;
|
|
84
|
+
readonly reverse: BooleanConstructor;
|
|
85
|
+
readonly size: {
|
|
86
|
+
readonly type: PropType<number | [number, number] | "small" | "medium" | "large">;
|
|
87
|
+
readonly default: "medium";
|
|
88
|
+
};
|
|
89
|
+
readonly wrap: {
|
|
90
|
+
readonly type: BooleanConstructor;
|
|
91
|
+
readonly default: true;
|
|
92
|
+
};
|
|
93
|
+
readonly theme: PropType<import("../../_mixins").Theme<"Flex", {
|
|
94
|
+
gapSmall: string;
|
|
95
|
+
gapMedium: string;
|
|
96
|
+
gapLarge: string;
|
|
97
|
+
}, any>>;
|
|
98
|
+
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Flex", {
|
|
99
|
+
gapSmall: string;
|
|
100
|
+
gapMedium: string;
|
|
101
|
+
gapLarge: string;
|
|
102
|
+
}, any>>>;
|
|
103
|
+
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Flex", {
|
|
104
|
+
gapSmall: string;
|
|
105
|
+
gapMedium: string;
|
|
106
|
+
gapLarge: string;
|
|
107
|
+
}, any>>>;
|
|
108
|
+
}>>, {
|
|
109
|
+
readonly inline: boolean;
|
|
110
|
+
readonly reverse: boolean;
|
|
111
|
+
readonly size: number | [number, number] | "small" | "medium" | "large";
|
|
112
|
+
readonly wrap: boolean;
|
|
113
|
+
readonly vertical: boolean;
|
|
114
|
+
readonly justify: import("csstype").Property.JustifyContent;
|
|
115
|
+
}, {}>;
|
|
116
|
+
export default _default;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { computed, defineComponent, h } from 'vue';
|
|
2
|
+
import { depx, getGap } from 'seemly';
|
|
3
|
+
import { useRtl } from '../../_mixins/use-rtl';
|
|
4
|
+
import { createKey, flatten, getSlot } from '../../_utils';
|
|
5
|
+
import { useConfig, useTheme } from '../../_mixins';
|
|
6
|
+
import { flexLight } from '../styles';
|
|
7
|
+
export const flexProps = Object.assign(Object.assign({}, useTheme.props), { align: String, justify: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: 'start'
|
|
10
|
+
}, inline: Boolean, vertical: Boolean, reverse: Boolean, size: {
|
|
11
|
+
type: [String, Number, Array],
|
|
12
|
+
default: 'medium'
|
|
13
|
+
}, wrap: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: true
|
|
16
|
+
} });
|
|
17
|
+
export default defineComponent({
|
|
18
|
+
name: 'Flex',
|
|
19
|
+
props: flexProps,
|
|
20
|
+
setup(props) {
|
|
21
|
+
const { mergedClsPrefixRef, mergedRtlRef } = useConfig(props);
|
|
22
|
+
const themeRef = useTheme('Flex', '-flex', undefined, flexLight, props, mergedClsPrefixRef);
|
|
23
|
+
const rtlEnabledRef = useRtl('Flex', mergedRtlRef, mergedClsPrefixRef);
|
|
24
|
+
return {
|
|
25
|
+
rtlEnabled: rtlEnabledRef,
|
|
26
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
27
|
+
margin: computed(() => {
|
|
28
|
+
const { size } = props;
|
|
29
|
+
if (Array.isArray(size)) {
|
|
30
|
+
return {
|
|
31
|
+
horizontal: size[0],
|
|
32
|
+
vertical: size[1]
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if (typeof size === 'number') {
|
|
36
|
+
return {
|
|
37
|
+
horizontal: size,
|
|
38
|
+
vertical: size
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const { self: { [createKey('gap', size)]: gap } } = themeRef.value;
|
|
42
|
+
const { row, col } = getGap(gap);
|
|
43
|
+
return {
|
|
44
|
+
horizontal: depx(col),
|
|
45
|
+
vertical: depx(row)
|
|
46
|
+
};
|
|
47
|
+
})
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
render() {
|
|
51
|
+
const { vertical, reverse, align, inline, justify, margin, wrap, mergedClsPrefix, rtlEnabled } = this;
|
|
52
|
+
const children = flatten(getSlot(this), false);
|
|
53
|
+
if (!children.length) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
return (h("div", { role: "none", class: [
|
|
57
|
+
`${mergedClsPrefix}-flex`,
|
|
58
|
+
rtlEnabled && `${mergedClsPrefix}-flex--rtl`
|
|
59
|
+
], style: {
|
|
60
|
+
display: inline ? 'inline-flex' : 'flex',
|
|
61
|
+
flexDirection: (() => {
|
|
62
|
+
if (vertical && !reverse) {
|
|
63
|
+
return 'column';
|
|
64
|
+
}
|
|
65
|
+
if (vertical && reverse) {
|
|
66
|
+
return 'column-reverse';
|
|
67
|
+
}
|
|
68
|
+
if (!vertical && reverse) {
|
|
69
|
+
return 'row-reverse';
|
|
70
|
+
}
|
|
71
|
+
else
|
|
72
|
+
return 'row';
|
|
73
|
+
})(),
|
|
74
|
+
justifyContent: justify,
|
|
75
|
+
flexWrap: !wrap || vertical ? 'nowrap' : 'wrap',
|
|
76
|
+
alignItems: align,
|
|
77
|
+
gap: `${margin.vertical}px ${margin.horizontal}px`
|
|
78
|
+
} }, children));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Theme } from '../../_mixins';
|
|
2
|
+
declare function self(): {
|
|
3
|
+
gapSmall: string;
|
|
4
|
+
gapMedium: string;
|
|
5
|
+
gapLarge: string;
|
|
6
|
+
};
|
|
7
|
+
export type FlexThemeVars = ReturnType<typeof self>;
|
|
8
|
+
declare const flexLight: Theme<'Flex', FlexThemeVars>;
|
|
9
|
+
export default flexLight;
|
|
10
|
+
export type FlexTheme = typeof flexLight;
|
package/es/themes/dark.js
CHANGED
|
@@ -83,6 +83,7 @@ import { uploadDark } from '../upload/styles';
|
|
|
83
83
|
import { watermarkDark } from '../watermark/styles';
|
|
84
84
|
import { toggleButtonDark } from '../toggle-button/styles';
|
|
85
85
|
import { accountOptionDark } from '../_internal/account-option/styles';
|
|
86
|
+
import { flexDark } from '../flex/styles';
|
|
86
87
|
export const darkTheme = {
|
|
87
88
|
name: 'dark',
|
|
88
89
|
common: commonDark,
|
|
@@ -169,5 +170,6 @@ export const darkTheme = {
|
|
|
169
170
|
Typography: typographyDark,
|
|
170
171
|
Upload: uploadDark,
|
|
171
172
|
Watermark: watermarkDark,
|
|
172
|
-
ToggleButton: toggleButtonDark
|
|
173
|
+
ToggleButton: toggleButtonDark,
|
|
174
|
+
Flex: flexDark
|
|
173
175
|
};
|
package/es/themes/light.js
CHANGED
|
@@ -85,6 +85,7 @@ import { uploadLight } from '../upload/styles';
|
|
|
85
85
|
import { watermarkLight } from '../watermark/styles';
|
|
86
86
|
import { toggleButtonLight } from '../toggle-button/styles';
|
|
87
87
|
import { accountOptionLight } from '../_internal/account-option/styles';
|
|
88
|
+
import { flexLight } from '../flex/styles';
|
|
88
89
|
export const lightTheme = {
|
|
89
90
|
name: 'light',
|
|
90
91
|
common: commonLight,
|
|
@@ -171,5 +172,6 @@ export const lightTheme = {
|
|
|
171
172
|
Typography: typographyLight,
|
|
172
173
|
Upload: uploadLight,
|
|
173
174
|
Watermark: watermarkLight,
|
|
174
|
-
ToggleButton: toggleButtonLight
|
|
175
|
+
ToggleButton: toggleButtonLight,
|
|
176
|
+
Flex: flexLight
|
|
175
177
|
};
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.1.
|
|
1
|
+
declare const _default: "1.1.4";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.1.
|
|
1
|
+
export default '1.1.4';
|
package/lib/components.d.ts
CHANGED
package/lib/components.js
CHANGED
|
@@ -97,6 +97,7 @@ import type { RowTheme } from '../../legacy-grid/styles';
|
|
|
97
97
|
import type { Katex } from './katex';
|
|
98
98
|
import type { ToggleButtonTheme } from '../../toggle-button/styles';
|
|
99
99
|
import type { AccountOptionTheme } from '../../_internal/account-option/styles';
|
|
100
|
+
import type { FlexTheme } from '../../flex/styles';
|
|
100
101
|
export interface GlobalThemeWithoutCommon {
|
|
101
102
|
Alert?: AlertTheme;
|
|
102
103
|
Anchor?: AnchorTheme;
|
|
@@ -181,6 +182,7 @@ export interface GlobalThemeWithoutCommon {
|
|
|
181
182
|
Watermark?: WatermarkTheme;
|
|
182
183
|
Row?: RowTheme;
|
|
183
184
|
ToggleButton?: ToggleButtonTheme;
|
|
185
|
+
Flex?: FlexTheme;
|
|
184
186
|
InternalSelectMenu?: InternalSelectMenuTheme;
|
|
185
187
|
InternalSelection?: InternalSelectionTheme;
|
|
186
188
|
AccountOption?: AccountOptionTheme;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.flexProps = exports.UFlex = void 0;
|
|
7
|
+
var Flex_1 = require("./src/Flex");
|
|
8
|
+
Object.defineProperty(exports, "UFlex", { enumerable: true, get: function () { return __importDefault(Flex_1).default; } });
|
|
9
|
+
Object.defineProperty(exports, "flexProps", { enumerable: true, get: function () { return Flex_1.flexProps; } });
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { ExtractPublicPropTypes } from '../../_utils';
|
|
3
|
+
export declare const flexProps: {
|
|
4
|
+
readonly align: PropType<import("csstype").Property.AlignItems>;
|
|
5
|
+
readonly justify: {
|
|
6
|
+
readonly type: PropType<import("csstype").Property.JustifyContent>;
|
|
7
|
+
readonly default: "start";
|
|
8
|
+
};
|
|
9
|
+
readonly inline: BooleanConstructor;
|
|
10
|
+
readonly vertical: BooleanConstructor;
|
|
11
|
+
readonly reverse: BooleanConstructor;
|
|
12
|
+
readonly size: {
|
|
13
|
+
readonly type: PropType<number | [number, number] | "small" | "medium" | "large">;
|
|
14
|
+
readonly default: "medium";
|
|
15
|
+
};
|
|
16
|
+
readonly wrap: {
|
|
17
|
+
readonly type: BooleanConstructor;
|
|
18
|
+
readonly default: true;
|
|
19
|
+
};
|
|
20
|
+
readonly theme: PropType<import("../../_mixins").Theme<"Flex", {
|
|
21
|
+
gapSmall: string;
|
|
22
|
+
gapMedium: string;
|
|
23
|
+
gapLarge: string;
|
|
24
|
+
}, any>>;
|
|
25
|
+
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Flex", {
|
|
26
|
+
gapSmall: string;
|
|
27
|
+
gapMedium: string;
|
|
28
|
+
gapLarge: string;
|
|
29
|
+
}, any>>>;
|
|
30
|
+
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Flex", {
|
|
31
|
+
gapSmall: string;
|
|
32
|
+
gapMedium: string;
|
|
33
|
+
gapLarge: string;
|
|
34
|
+
}, any>>>;
|
|
35
|
+
};
|
|
36
|
+
export type FlexProps = ExtractPublicPropTypes<typeof flexProps>;
|
|
37
|
+
declare const _default: import("vue").DefineComponent<{
|
|
38
|
+
readonly align: PropType<import("csstype").Property.AlignItems>;
|
|
39
|
+
readonly justify: {
|
|
40
|
+
readonly type: PropType<import("csstype").Property.JustifyContent>;
|
|
41
|
+
readonly default: "start";
|
|
42
|
+
};
|
|
43
|
+
readonly inline: BooleanConstructor;
|
|
44
|
+
readonly vertical: BooleanConstructor;
|
|
45
|
+
readonly reverse: BooleanConstructor;
|
|
46
|
+
readonly size: {
|
|
47
|
+
readonly type: PropType<number | [number, number] | "small" | "medium" | "large">;
|
|
48
|
+
readonly default: "medium";
|
|
49
|
+
};
|
|
50
|
+
readonly wrap: {
|
|
51
|
+
readonly type: BooleanConstructor;
|
|
52
|
+
readonly default: true;
|
|
53
|
+
};
|
|
54
|
+
readonly theme: PropType<import("../../_mixins").Theme<"Flex", {
|
|
55
|
+
gapSmall: string;
|
|
56
|
+
gapMedium: string;
|
|
57
|
+
gapLarge: string;
|
|
58
|
+
}, any>>;
|
|
59
|
+
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Flex", {
|
|
60
|
+
gapSmall: string;
|
|
61
|
+
gapMedium: string;
|
|
62
|
+
gapLarge: string;
|
|
63
|
+
}, any>>>;
|
|
64
|
+
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Flex", {
|
|
65
|
+
gapSmall: string;
|
|
66
|
+
gapMedium: string;
|
|
67
|
+
gapLarge: string;
|
|
68
|
+
}, any>>>;
|
|
69
|
+
}, {
|
|
70
|
+
rtlEnabled: import("vue").Ref<import("../../config-provider/src/internal-interface").RtlItem | undefined> | undefined;
|
|
71
|
+
mergedClsPrefix: import("vue").Ref<string>;
|
|
72
|
+
margin: import("vue").ComputedRef<{
|
|
73
|
+
horizontal: number;
|
|
74
|
+
vertical: number;
|
|
75
|
+
}>;
|
|
76
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
77
|
+
readonly align: PropType<import("csstype").Property.AlignItems>;
|
|
78
|
+
readonly justify: {
|
|
79
|
+
readonly type: PropType<import("csstype").Property.JustifyContent>;
|
|
80
|
+
readonly default: "start";
|
|
81
|
+
};
|
|
82
|
+
readonly inline: BooleanConstructor;
|
|
83
|
+
readonly vertical: BooleanConstructor;
|
|
84
|
+
readonly reverse: BooleanConstructor;
|
|
85
|
+
readonly size: {
|
|
86
|
+
readonly type: PropType<number | [number, number] | "small" | "medium" | "large">;
|
|
87
|
+
readonly default: "medium";
|
|
88
|
+
};
|
|
89
|
+
readonly wrap: {
|
|
90
|
+
readonly type: BooleanConstructor;
|
|
91
|
+
readonly default: true;
|
|
92
|
+
};
|
|
93
|
+
readonly theme: PropType<import("../../_mixins").Theme<"Flex", {
|
|
94
|
+
gapSmall: string;
|
|
95
|
+
gapMedium: string;
|
|
96
|
+
gapLarge: string;
|
|
97
|
+
}, any>>;
|
|
98
|
+
readonly themeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Flex", {
|
|
99
|
+
gapSmall: string;
|
|
100
|
+
gapMedium: string;
|
|
101
|
+
gapLarge: string;
|
|
102
|
+
}, any>>>;
|
|
103
|
+
readonly builtinThemeOverrides: PropType<import("../../_mixins/use-theme").ExtractThemeOverrides<import("../../_mixins").Theme<"Flex", {
|
|
104
|
+
gapSmall: string;
|
|
105
|
+
gapMedium: string;
|
|
106
|
+
gapLarge: string;
|
|
107
|
+
}, any>>>;
|
|
108
|
+
}>>, {
|
|
109
|
+
readonly inline: boolean;
|
|
110
|
+
readonly reverse: boolean;
|
|
111
|
+
readonly size: number | [number, number] | "small" | "medium" | "large";
|
|
112
|
+
readonly wrap: boolean;
|
|
113
|
+
readonly vertical: boolean;
|
|
114
|
+
readonly justify: import("csstype").Property.JustifyContent;
|
|
115
|
+
}, {}>;
|
|
116
|
+
export default _default;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.flexProps = void 0;
|
|
4
|
+
const vue_1 = require("vue");
|
|
5
|
+
const seemly_1 = require("seemly");
|
|
6
|
+
const use_rtl_1 = require("../../_mixins/use-rtl");
|
|
7
|
+
const _utils_1 = require("../../_utils");
|
|
8
|
+
const _mixins_1 = require("../../_mixins");
|
|
9
|
+
const styles_1 = require("../styles");
|
|
10
|
+
exports.flexProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { align: String, justify: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: 'start'
|
|
13
|
+
}, inline: Boolean, vertical: Boolean, reverse: Boolean, size: {
|
|
14
|
+
type: [String, Number, Array],
|
|
15
|
+
default: 'medium'
|
|
16
|
+
}, wrap: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: true
|
|
19
|
+
} });
|
|
20
|
+
exports.default = (0, vue_1.defineComponent)({
|
|
21
|
+
name: 'Flex',
|
|
22
|
+
props: exports.flexProps,
|
|
23
|
+
setup(props) {
|
|
24
|
+
const { mergedClsPrefixRef, mergedRtlRef } = (0, _mixins_1.useConfig)(props);
|
|
25
|
+
const themeRef = (0, _mixins_1.useTheme)('Flex', '-flex', undefined, styles_1.flexLight, props, mergedClsPrefixRef);
|
|
26
|
+
const rtlEnabledRef = (0, use_rtl_1.useRtl)('Flex', mergedRtlRef, mergedClsPrefixRef);
|
|
27
|
+
return {
|
|
28
|
+
rtlEnabled: rtlEnabledRef,
|
|
29
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
30
|
+
margin: (0, vue_1.computed)(() => {
|
|
31
|
+
const { size } = props;
|
|
32
|
+
if (Array.isArray(size)) {
|
|
33
|
+
return {
|
|
34
|
+
horizontal: size[0],
|
|
35
|
+
vertical: size[1]
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (typeof size === 'number') {
|
|
39
|
+
return {
|
|
40
|
+
horizontal: size,
|
|
41
|
+
vertical: size
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const { self: { [(0, _utils_1.createKey)('gap', size)]: gap } } = themeRef.value;
|
|
45
|
+
const { row, col } = (0, seemly_1.getGap)(gap);
|
|
46
|
+
return {
|
|
47
|
+
horizontal: (0, seemly_1.depx)(col),
|
|
48
|
+
vertical: (0, seemly_1.depx)(row)
|
|
49
|
+
};
|
|
50
|
+
})
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
render() {
|
|
54
|
+
const { vertical, reverse, align, inline, justify, margin, wrap, mergedClsPrefix, rtlEnabled } = this;
|
|
55
|
+
const children = (0, _utils_1.flatten)((0, _utils_1.getSlot)(this), false);
|
|
56
|
+
if (!children.length) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return ((0, vue_1.h)("div", { role: "none", class: [
|
|
60
|
+
`${mergedClsPrefix}-flex`,
|
|
61
|
+
rtlEnabled && `${mergedClsPrefix}-flex--rtl`
|
|
62
|
+
], style: {
|
|
63
|
+
display: inline ? 'inline-flex' : 'flex',
|
|
64
|
+
flexDirection: (() => {
|
|
65
|
+
if (vertical && !reverse) {
|
|
66
|
+
return 'column';
|
|
67
|
+
}
|
|
68
|
+
if (vertical && reverse) {
|
|
69
|
+
return 'column-reverse';
|
|
70
|
+
}
|
|
71
|
+
if (!vertical && reverse) {
|
|
72
|
+
return 'row-reverse';
|
|
73
|
+
}
|
|
74
|
+
else
|
|
75
|
+
return 'row';
|
|
76
|
+
})(),
|
|
77
|
+
justifyContent: justify,
|
|
78
|
+
flexWrap: !wrap || vertical ? 'nowrap' : 'wrap',
|
|
79
|
+
alignItems: align,
|
|
80
|
+
gap: `${margin.vertical}px ${margin.horizontal}px`
|
|
81
|
+
} }, children));
|
|
82
|
+
}
|
|
83
|
+
});
|