fluekit 1.0.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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +63 -0
  3. package/dist/Align.d.ts +25 -0
  4. package/dist/AnimatedContainer.d.ts +41 -0
  5. package/dist/AnimatedOpacity.d.ts +25 -0
  6. package/dist/Border.d.ts +16 -0
  7. package/dist/BorderRadius.d.ts +12 -0
  8. package/dist/BoxConstraints.d.ts +9 -0
  9. package/dist/BoxDecoration.d.ts +89 -0
  10. package/dist/Center.d.ts +29 -0
  11. package/dist/Column.d.ts +18 -0
  12. package/dist/Container.d.ts +37 -0
  13. package/dist/EdgeInsets.d.ts +19 -0
  14. package/dist/Expanded.d.ts +26 -0
  15. package/dist/Fixed.d.ts +20 -0
  16. package/dist/FlexBox.d.ts +26 -0
  17. package/dist/FlexItem.d.ts +30 -0
  18. package/dist/FlexProps.d.ts +131 -0
  19. package/dist/GestureDetector.d.ts +20 -0
  20. package/dist/GridView.d.ts +42 -0
  21. package/dist/IgnorePointer.d.ts +50 -0
  22. package/dist/ListView.d.ts +40 -0
  23. package/dist/Opacity.d.ts +28 -0
  24. package/dist/Padding.d.ts +11 -0
  25. package/dist/Positioned.d.ts +19 -0
  26. package/dist/Row.d.ts +23 -0
  27. package/dist/SafeArea.d.ts +32 -0
  28. package/dist/ScrollView.d.ts +60 -0
  29. package/dist/Size.d.ts +9 -0
  30. package/dist/SizedBox.d.ts +21 -0
  31. package/dist/Stack.d.ts +32 -0
  32. package/dist/Sticky.d.ts +20 -0
  33. package/dist/Text.d.ts +41 -0
  34. package/dist/TextStyle.d.ts +121 -0
  35. package/dist/Transform.d.ts +38 -0
  36. package/dist/Wrap.d.ts +36 -0
  37. package/dist/__tests__/Container.spec.d.ts +1 -0
  38. package/dist/__tests__/normalizeSrc.spec.d.ts +1 -0
  39. package/dist/index.css +2 -0
  40. package/dist/index.d.ts +34 -0
  41. package/dist/index.js +1457 -0
  42. package/dist/px2vw.d.ts +3 -0
  43. package/dist/useChildren.d.ts +3 -0
  44. package/dist/useGesture.d.ts +37 -0
  45. package/dist/useOpacity.d.ts +4 -0
  46. package/dist/usePosition.d.ts +19 -0
  47. package/dist/useSafeAttrs.d.ts +3 -0
  48. package/dist/useStack.d.ts +2 -0
  49. package/dist/utils.d.ts +5 -0
  50. package/package.json +40 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Fitz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # FlueKit
2
+
3
+ **FlueKit** (Fluent Layouts for Vue) is a Vue 3 library that provides Flutter-like layout components for building complex UIs with ease. It brings the power and simplicity of Flutter's layout model to the web.
4
+
5
+ ## Features
6
+
7
+ - **Layout Primitives**: `Row`, `Column`, `Stack`, `Positioned`, `Expanded`, `SizedBox`, `Center`, `Align`
8
+ - **Container System**: `Container`, `AnimatedContainer`, `Padding`, `ConstrainedBox`
9
+ - **Scrolling**: `ListView`, `GridView`, `ScrollView` (SingleChildScrollView)
10
+ - **Styling**: `BoxDecoration`, `TextStyle`, `EdgeInsets`, `BorderRadius`
11
+ - **Interactions**: `GestureDetector`, `IgnorePointer`, `AbsorbPointer`
12
+ - **Animations**: `AnimatedContainer`, `AnimatedOpacity`
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install fluekit
18
+ # or
19
+ pnpm add fluekit
20
+ # or
21
+ yarn add fluekit
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ ```vue
27
+ <script setup>
28
+ import { Container, Center, Text, Column, SizedBox } from "fluekit";
29
+ </script>
30
+
31
+ <template>
32
+ <Center>
33
+ <Container
34
+ :width="300"
35
+ :height="200"
36
+ color="#2196F3"
37
+ :decoration="{
38
+ borderRadius: { all: 16 },
39
+ boxShadow: [{ color: 'black', blurRadius: 10, offset: { x: 0, y: 4 } }]
40
+ }"
41
+ alignment="center"
42
+ >
43
+ <Column mainAxisAlignment="center">
44
+ <Text :style="{ color: 'white', fontSize: 24, fontWeight: 'bold' }">
45
+ Hello FlueKit
46
+ </Text>
47
+ <SizedBox :height="10" />
48
+ <Text :style="{ color: 'white', fontSize: 16 }">
49
+ Flutter-like layouts for Vue 3
50
+ </Text>
51
+ </Column>
52
+ </Container>
53
+ </Center>
54
+ </template>
55
+ ```
56
+
57
+ ## Documentation
58
+
59
+ Visit the [documentation website](https://fitz.github.io/fluekit) for detailed guides and API references.
60
+
61
+ ## License
62
+
63
+ MIT
@@ -0,0 +1,25 @@
1
+ import { FlexAlignment } from './FlexProps';
2
+ interface Props {
3
+ alignment?: FlexAlignment;
4
+ widthFactor?: number;
5
+ heightFactor?: number;
6
+ }
7
+ declare function __VLS_template(): {
8
+ attrs: Partial<{}>;
9
+ slots: {
10
+ default?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: any;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
17
+ alignment: FlexAlignment;
18
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
20
+ export default _default;
21
+ type __VLS_WithTemplateSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1,41 @@
1
+ import { BoxConstraints } from './BoxConstraints';
2
+ import { BoxDecoration } from './BoxDecoration';
3
+ import { EdgeInsets } from './EdgeInsets';
4
+ import { FlexAlignment } from './FlexProps';
5
+ interface Props {
6
+ width?: number | string;
7
+ height?: number | string;
8
+ padding?: EdgeInsets;
9
+ margin?: EdgeInsets;
10
+ decoration?: BoxDecoration;
11
+ foregroundDecoration?: BoxDecoration;
12
+ color?: string;
13
+ alignment?: FlexAlignment | string;
14
+ clipBehavior?: "none" | "hardEdge" | "antiAlias" | string;
15
+ transform?: string;
16
+ transformAlignment?: FlexAlignment | string;
17
+ constraints?: BoxConstraints;
18
+ duration?: number;
19
+ curve?: string;
20
+ }
21
+ declare function __VLS_template(): {
22
+ attrs: Partial<{}>;
23
+ slots: {
24
+ default?(_: {}): any;
25
+ };
26
+ refs: {};
27
+ rootEl: any;
28
+ };
29
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
30
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
31
+ clipBehavior: "none" | "hardEdge" | "antiAlias" | string;
32
+ duration: number;
33
+ curve: string;
34
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
35
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
36
+ export default _default;
37
+ type __VLS_WithTemplateSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
@@ -0,0 +1,25 @@
1
+ interface Props {
2
+ opacity: number;
3
+ duration?: number;
4
+ curve?: string;
5
+ }
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: {
9
+ default?(_: {}): any;
10
+ };
11
+ refs: {};
12
+ rootEl: any;
13
+ };
14
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
16
+ duration: number;
17
+ curve: string;
18
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
20
+ export default _default;
21
+ type __VLS_WithTemplateSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1,16 @@
1
+ import { CSSProperties } from 'vue';
2
+ export type BorderStyleType = "none" | "solid" | "dashed" | "dotted" | "double";
3
+ export type BorderSide = {
4
+ width?: number | string;
5
+ color?: string;
6
+ style?: BorderStyleType;
7
+ };
8
+ export declare function Border(side: BorderSide): BorderSide;
9
+ export interface Borders extends BorderSide {
10
+ all?: BorderSide;
11
+ left?: BorderSide;
12
+ top?: BorderSide;
13
+ right?: BorderSide;
14
+ bottom?: BorderSide;
15
+ }
16
+ export declare function borderToStyle(border: Borders): CSSProperties;
@@ -0,0 +1,12 @@
1
+ import { CSSProperties } from 'vue';
2
+ export type BorderRadiusValue = number | string;
3
+ export type BorderRadiusType = BorderRadiusValue | {
4
+ topLeft?: BorderRadiusValue;
5
+ bottom?: BorderRadiusValue;
6
+ topRight?: BorderRadiusValue;
7
+ bottomLeft?: BorderRadiusValue;
8
+ bottomRight?: BorderRadiusValue;
9
+ all?: BorderRadiusValue;
10
+ };
11
+ export declare function BorderRadius(borderRadius: BorderRadiusType): BorderRadiusType;
12
+ export declare function borderRadiusToStyle(props?: BorderRadiusType): CSSProperties;
@@ -0,0 +1,9 @@
1
+ import { CSSProperties } from 'vue';
2
+ export interface BoxConstraints {
3
+ minWidth?: number;
4
+ maxWidth?: number;
5
+ minHeight?: number;
6
+ maxHeight?: number;
7
+ }
8
+ export declare function BoxConstraints(props?: BoxConstraints): BoxConstraints;
9
+ export declare function boxConstraintsToStyle(constraints?: BoxConstraints): CSSProperties;
@@ -0,0 +1,89 @@
1
+ import { BorderRadiusType } from './BorderRadius';
2
+ import { CSSProperties } from 'vue';
3
+ import { Borders } from './Border';
4
+ type Valueof<T> = T[keyof T];
5
+ export type BoxFit = Valueof<typeof BoxFit>;
6
+ export declare const BoxFit: {
7
+ readonly fitWidth: "fitWidth";
8
+ readonly fitHeight: "fitHeight";
9
+ readonly fill: "fill";
10
+ readonly contain: "contain";
11
+ readonly cover: "cover";
12
+ readonly none: "none";
13
+ readonly scaleDown: "scaleDown";
14
+ };
15
+ export type ImageRepeat = "repeat" | "repeat-x" | "repeat-y" | "no-repeat";
16
+ export type BorderRadiusValue = number | string;
17
+ export type BorderRadius = BorderRadiusType;
18
+ export type Overflow = "none" | "visible" | "hidden" | "scroll" | "auto";
19
+ export type BoxAlignment = keyof typeof BoxAlignment | string;
20
+ export declare const BoxAlignment: {
21
+ readonly center: "center";
22
+ readonly top: "top";
23
+ readonly bottom: "bottom";
24
+ readonly left: "left";
25
+ readonly right: "right";
26
+ readonly topLeft: "left top";
27
+ readonly topCenter: "center top";
28
+ readonly topRight: "right top";
29
+ readonly centerLeft: "left center";
30
+ readonly centerRight: "right center";
31
+ readonly bottomLeft: "left bottom";
32
+ readonly bottomCenter: "center bottom";
33
+ readonly bottomRight: "right bottom";
34
+ };
35
+ export declare function setBaseUrl(url: string): void;
36
+ export declare function normalizeSrc(src: string): string;
37
+ export type ImageProvider = string;
38
+ export declare const NetworkImage: (url: string) => string;
39
+ export declare const AssetImage: (url: string) => string;
40
+ export interface DecorationImage {
41
+ image: ImageProvider;
42
+ fit?: BoxFit;
43
+ alignment?: BoxAlignment;
44
+ repeat?: ImageRepeat;
45
+ blendMode?: string;
46
+ attachment?: string;
47
+ clip?: string;
48
+ origin?: string;
49
+ }
50
+ export declare function DecorationImage(props: DecorationImage): DecorationImage;
51
+ /**
52
+ * BoxDecoration接口定义
53
+ */
54
+ export type BoxDecoration = {
55
+ color?: string;
56
+ border?: Borders;
57
+ borderRadius?: BorderRadius;
58
+ boxShadow?: BoxShadow | BoxShadow[];
59
+ gradient?: string;
60
+ image?: DecorationImage;
61
+ overflow?: Overflow;
62
+ opacity?: number | string;
63
+ };
64
+ export interface BoxShadow {
65
+ color?: string;
66
+ offset?: {
67
+ x: number;
68
+ y: number;
69
+ };
70
+ blurRadius?: number;
71
+ spreadRadius?: number;
72
+ inset?: boolean;
73
+ }
74
+ export declare function decorationImageToStyle(di: DecorationImage): CSSProperties;
75
+ export declare function boxDecorationToStyle(decoration?: BoxDecoration): CSSProperties;
76
+ export declare function BoxDecoration(props?: BoxDecoration): BoxDecoration;
77
+ export declare function LinearGradient(direction: string, ...colors: string[]): string;
78
+ /**
79
+ * Clip
80
+ * 对应 Flutter 的 Clip
81
+ */
82
+ export declare const Clip: {
83
+ readonly none: "none";
84
+ readonly hardEdge: "hardEdge";
85
+ readonly antiAlias: "antiAlias";
86
+ readonly antiAliasWithSaveLayer: "antiAliasWithSaveLayer";
87
+ };
88
+ export type Clip = keyof typeof Clip;
89
+ export {};
@@ -0,0 +1,29 @@
1
+ interface Props {
2
+ /**
3
+ * 宽度因子
4
+ * 如果非 null,则将其宽度设置为子元素宽度乘以该因子。
5
+ */
6
+ widthFactor?: number;
7
+ /**
8
+ * 高度因子
9
+ * 如果非 null,则将其高度设置为子元素高度乘以该因子。
10
+ */
11
+ heightFactor?: number;
12
+ }
13
+ declare function __VLS_template(): {
14
+ attrs: Partial<{}>;
15
+ slots: {
16
+ default?(_: {}): any;
17
+ };
18
+ refs: {};
19
+ rootEl: any;
20
+ };
21
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
22
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
23
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
24
+ export default _default;
25
+ type __VLS_WithTemplateSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
@@ -0,0 +1,18 @@
1
+ import { FlexBoxProps } from './FlexProps';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ };
7
+ refs: {};
8
+ rootEl: any;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<FlexBoxProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FlexBoxProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
13
+ export default _default;
14
+ type __VLS_WithTemplateSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,37 @@
1
+ import { BoxConstraints } from './BoxConstraints';
2
+ import { BoxDecoration } from './BoxDecoration';
3
+ import { EdgeInsets } from './EdgeInsets';
4
+ import { FlexAlignment } from './FlexProps';
5
+ interface Props {
6
+ width?: number | string;
7
+ height?: number | string;
8
+ padding?: EdgeInsets;
9
+ margin?: EdgeInsets;
10
+ decoration?: BoxDecoration;
11
+ foregroundDecoration?: BoxDecoration;
12
+ color?: string;
13
+ alignment?: FlexAlignment | string;
14
+ clipBehavior?: "none" | "hardEdge" | "antiAlias" | string;
15
+ transform?: string;
16
+ transformAlignment?: FlexAlignment | string;
17
+ constraints?: BoxConstraints;
18
+ }
19
+ declare function __VLS_template(): {
20
+ attrs: Partial<{}>;
21
+ slots: {
22
+ default?(_: {}): any;
23
+ };
24
+ refs: {};
25
+ rootEl: any;
26
+ };
27
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
28
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
29
+ clipBehavior: "none" | "hardEdge" | "antiAlias" | string;
30
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
31
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
32
+ export default _default;
33
+ type __VLS_WithTemplateSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };
@@ -0,0 +1,19 @@
1
+ export interface EdgeInsets {
2
+ top?: number | string;
3
+ right?: number | string;
4
+ bottom?: number | string;
5
+ left?: number | string;
6
+ all?: number | string;
7
+ horizontal?: number | string;
8
+ vertical?: number | string;
9
+ }
10
+ export declare function EdgeInsets(edgeInsets: EdgeInsets): EdgeInsets;
11
+ export declare function edgeInsetsToStyle(type: "margin" | "padding", edgeInsets: EdgeInsets | undefined): {
12
+ [x: string]: string;
13
+ };
14
+ export declare const paddingToStyle: (value?: EdgeInsets) => {
15
+ [x: string]: string;
16
+ };
17
+ export declare const marginToStyle: (value?: EdgeInsets) => {
18
+ [x: string]: string;
19
+ };
@@ -0,0 +1,26 @@
1
+ interface Props {
2
+ flex?: number;
3
+ alignSelf?: "auto" | "start" | "end" | "center" | "stretch" | "baseline";
4
+ minSize?: number | string;
5
+ maxSize?: number | string;
6
+ }
7
+ declare function __VLS_template(): {
8
+ attrs: Partial<{}>;
9
+ slots: {
10
+ default?(_: {}): any;
11
+ };
12
+ refs: {};
13
+ rootEl: any;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
17
+ flex: number;
18
+ alignSelf: "auto" | "start" | "end" | "center" | "stretch" | "baseline";
19
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
21
+ export default _default;
22
+ type __VLS_WithTemplateSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
@@ -0,0 +1,20 @@
1
+ import { Props } from './usePosition';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ };
7
+ refs: {};
8
+ rootEl: any;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
12
+ zIndex: number | string;
13
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
15
+ export default _default;
16
+ type __VLS_WithTemplateSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,26 @@
1
+ import { CrossAxisAlignment, FlexBoxProps, MainAxisAlignment } from './FlexProps';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ default?(_: {}): any;
6
+ };
7
+ refs: {};
8
+ rootEl: any;
9
+ };
10
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
+ declare const __VLS_component: import('vue').DefineComponent<FlexBoxProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FlexBoxProps> & Readonly<{}>, {
12
+ wrap: boolean;
13
+ expanded: boolean;
14
+ direction: "row" | "column" | "row-reverse" | "column-reverse" | string;
15
+ mainAxisAlignment: MainAxisAlignment;
16
+ crossAxisAlignment: CrossAxisAlignment;
17
+ gap: number | string;
18
+ as: string;
19
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
21
+ export default _default;
22
+ type __VLS_WithTemplateSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
@@ -0,0 +1,30 @@
1
+ interface Props {
2
+ flex?: number;
3
+ expanded?: boolean;
4
+ flexible?: boolean;
5
+ alignSelf?: "auto" | "start" | "end" | "center" | "stretch" | "baseline";
6
+ minSize?: number | string;
7
+ maxSize?: number | string;
8
+ }
9
+ declare function __VLS_template(): {
10
+ attrs: Partial<{}>;
11
+ slots: {
12
+ default?(_: {}): any;
13
+ };
14
+ refs: {};
15
+ rootEl: any;
16
+ };
17
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
19
+ flex: number;
20
+ expanded: boolean;
21
+ flexible: boolean;
22
+ alignSelf: "auto" | "start" | "end" | "center" | "stretch" | "baseline";
23
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
24
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
25
+ export default _default;
26
+ type __VLS_WithTemplateSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
@@ -0,0 +1,131 @@
1
+ import { BoxConstraints } from './BoxConstraints';
2
+ export type FlexAlignment = keyof typeof FlexAlignment;
3
+ /**
4
+ * FlexAlignment 定义
5
+ * 对应 Flutter 的 Alignment 常量
6
+ * 用于 Container 等组件的 alignment 属性
7
+ */
8
+ export declare const FlexAlignment: {
9
+ readonly center: {
10
+ readonly justifyContent: "center";
11
+ readonly alignItems: "center";
12
+ };
13
+ readonly topLeft: {
14
+ readonly justifyContent: "flex-start";
15
+ readonly alignItems: "flex-start";
16
+ };
17
+ readonly topCenter: {
18
+ readonly justifyContent: "center";
19
+ readonly alignItems: "flex-start";
20
+ };
21
+ readonly topRight: {
22
+ readonly justifyContent: "flex-end";
23
+ readonly alignItems: "flex-start";
24
+ };
25
+ readonly centerLeft: {
26
+ readonly justifyContent: "flex-start";
27
+ readonly alignItems: "center";
28
+ };
29
+ readonly centerRight: {
30
+ readonly justifyContent: "flex-end";
31
+ readonly alignItems: "center";
32
+ };
33
+ readonly bottomLeft: {
34
+ readonly justifyContent: "flex-start";
35
+ readonly alignItems: "flex-end";
36
+ };
37
+ readonly bottomCenter: {
38
+ readonly justifyContent: "center";
39
+ readonly alignItems: "flex-end";
40
+ };
41
+ readonly bottomRight: {
42
+ readonly justifyContent: "flex-end";
43
+ readonly alignItems: "flex-end";
44
+ };
45
+ };
46
+ export declare function alignmentToStyle(alignment: FlexAlignment, direction?: "row" | "column"): {
47
+ readonly justifyContent: "center";
48
+ readonly alignItems: "center";
49
+ } | {
50
+ readonly justifyContent: "flex-start";
51
+ readonly alignItems: "flex-start";
52
+ } | {
53
+ readonly justifyContent: "center";
54
+ readonly alignItems: "flex-start";
55
+ } | {
56
+ readonly justifyContent: "flex-end";
57
+ readonly alignItems: "flex-start";
58
+ } | {
59
+ readonly justifyContent: "flex-start";
60
+ readonly alignItems: "center";
61
+ } | {
62
+ readonly justifyContent: "flex-end";
63
+ readonly alignItems: "center";
64
+ } | {
65
+ readonly justifyContent: "flex-start";
66
+ readonly alignItems: "flex-end";
67
+ } | {
68
+ readonly justifyContent: "center";
69
+ readonly alignItems: "flex-end";
70
+ } | {
71
+ readonly justifyContent: "flex-end";
72
+ readonly alignItems: "flex-end";
73
+ } | {
74
+ justifyContent?: undefined;
75
+ alignItems?: undefined;
76
+ } | {
77
+ justifyContent: "center" | "flex-start" | "flex-end";
78
+ alignItems: "center" | "flex-start" | "flex-end";
79
+ };
80
+ export declare function alignmentToOrigin(alignment: FlexAlignment): string | undefined;
81
+ type Valueof<T> = T[keyof T];
82
+ /**
83
+ * CrossAxisAlignment
84
+ * 对应 CSS alignItems
85
+ */
86
+ export declare const CrossAxisAlignment: {
87
+ readonly start: "start";
88
+ readonly end: "end";
89
+ readonly center: "center";
90
+ readonly stretch: "stretch";
91
+ readonly baseline: "baseline";
92
+ };
93
+ export type CrossAxisAlignment = Valueof<typeof CrossAxisAlignment> | string;
94
+ /**
95
+ * MainAxisAlignment
96
+ * 对应 CSS justifyContent
97
+ * 注意:这里的值对应的是简写,由 FlexBoxJustifyMap 转换为 CSS 值
98
+ */
99
+ export declare const MainAxisAlignment: {
100
+ readonly start: "start";
101
+ readonly end: "end";
102
+ readonly center: "center";
103
+ readonly spaceBetween: "space-between";
104
+ readonly spaceAround: "space-around";
105
+ readonly spaceEvenly: "space-evenly";
106
+ };
107
+ export type MainAxisAlignment = Valueof<typeof MainAxisAlignment> | string;
108
+ export type FlexBoxProps = {
109
+ direction?: "row" | "column" | "row-reverse" | "column-reverse" | string;
110
+ mainAxisAlignment?: MainAxisAlignment;
111
+ crossAxisAlignment?: CrossAxisAlignment;
112
+ wrap?: boolean;
113
+ gap?: number | string;
114
+ expanded?: boolean;
115
+ as?: string;
116
+ constraints?: BoxConstraints;
117
+ };
118
+ type Preset = Record<string, string>;
119
+ export declare const FlexBoxJustifyMap: Preset;
120
+ export declare const FlexBoxAlignMap: Preset;
121
+ /**
122
+ * StackFit
123
+ * 对应 Flutter 的 StackFit
124
+ */
125
+ export declare const StackFit: {
126
+ readonly loose: "loose";
127
+ readonly expand: "expand";
128
+ readonly passthrough: "passthrough";
129
+ };
130
+ export type StackFit = Valueof<typeof StackFit>;
131
+ export {};