fantasia-ui 0.2.8 → 0.2.11
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/README.en.md +27 -11
- package/README.md +28 -12
- package/dist/components/index.d.ts +8 -0
- package/dist/components/modules/FButtonGroup.d.ts +24 -0
- package/dist/components/modules/FCollapse.d.ts +29 -0
- package/dist/components/modules/FCollapseItem.d.ts +23 -0
- package/dist/components/modules/FColorPicker.d.ts +22 -0
- package/dist/components/modules/FEmpty.d.ts +25 -0
- package/dist/components/modules/FInputNumber.d.ts +24 -0
- package/dist/components/modules/FScrollbar.d.ts +57 -0
- package/dist/components/modules/FSlider.d.ts +24 -0
- package/dist/fantasia-ui.css +1 -1
- package/dist/fantasia-ui.es.js +2048 -1136
- package/dist/fantasia-ui.umd.js +9 -9
- package/dist/global.d.ts +9 -1
- package/dist/index.d.ts +0 -1
- package/dist/types/components/index.d.ts +8 -0
- package/dist/types/components/modules/f-button-group.d.ts +11 -0
- package/dist/types/components/modules/f-collapse-item.d.ts +6 -0
- package/dist/types/components/modules/f-collapse.d.ts +4 -0
- package/dist/types/components/modules/f-color-picker.d.ts +7 -0
- package/dist/types/components/modules/f-empty.d.ts +9 -0
- package/dist/types/components/modules/f-input-number.d.ts +15 -0
- package/dist/types/components/modules/f-scrollbar.d.ts +16 -0
- package/dist/types/components/modules/f-slider.d.ts +14 -0
- package/dist/types/global.d.ts +9 -1
- package/dist/types/volar.d.ts +9 -1
- package/dist/volar.d.ts +9 -1
- package/package.json +3 -3
package/README.en.md
CHANGED
|
@@ -240,19 +240,35 @@ The component library supports theme customization via CSS variables:
|
|
|
240
240
|
|
|
241
241
|
Fantasia UI provides complete TypeScript type definitions:
|
|
242
242
|
|
|
243
|
+
```vue
|
|
244
|
+
<script setup lang="ts">
|
|
245
|
+
import { FButton } from 'fantasia-ui'
|
|
246
|
+
|
|
247
|
+
// TypeScript will automatically infer props types
|
|
248
|
+
// No need to manually import FButtonProps
|
|
249
|
+
</script>
|
|
250
|
+
|
|
251
|
+
<template>
|
|
252
|
+
<FButton variant="primary" size="large">
|
|
253
|
+
Button
|
|
254
|
+
</FButton>
|
|
255
|
+
</template>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### If you need component Props types
|
|
259
|
+
|
|
260
|
+
You can use TypeScript utility types to infer from components:
|
|
261
|
+
|
|
243
262
|
```typescript
|
|
244
|
-
import
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
// Use types
|
|
263
|
+
import { FButton } from 'fantasia-ui'
|
|
264
|
+
import type { ComponentProps } from 'vue'
|
|
265
|
+
|
|
266
|
+
// Infer props type from component
|
|
267
|
+
type FButtonProps = ComponentProps<typeof FButton>
|
|
268
|
+
|
|
252
269
|
const buttonProps: FButtonProps = {
|
|
253
|
-
|
|
254
|
-
size: 'large'
|
|
255
|
-
disabled: false
|
|
270
|
+
variant: 'primary',
|
|
271
|
+
size: 'large'
|
|
256
272
|
}
|
|
257
273
|
```
|
|
258
274
|
|
package/README.md
CHANGED
|
@@ -236,23 +236,39 @@ import { FRow, FCol, FSpace } from 'fantasia-ui'
|
|
|
236
236
|
}
|
|
237
237
|
```
|
|
238
238
|
|
|
239
|
-
##
|
|
239
|
+
## 📝 TypeScript 支持
|
|
240
240
|
|
|
241
241
|
Fantasia UI 提供完整的 TypeScript 类型定义:
|
|
242
242
|
|
|
243
|
+
```vue
|
|
244
|
+
<script setup lang="ts">
|
|
245
|
+
import { FButton } from 'fantasia-ui'
|
|
246
|
+
|
|
247
|
+
// TypeScript 会自动推断 props 类型
|
|
248
|
+
// 无需手动导入 FButtonProps
|
|
249
|
+
</script>
|
|
250
|
+
|
|
251
|
+
<template>
|
|
252
|
+
<FButton variant="primary" size="large">
|
|
253
|
+
按钮
|
|
254
|
+
</FButton>
|
|
255
|
+
</template>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### 如果需要组件 Props 类型
|
|
259
|
+
|
|
260
|
+
可以使用 TypeScript 工具类型从组件推断:
|
|
261
|
+
|
|
243
262
|
```typescript
|
|
244
|
-
import
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
// 使用类型
|
|
263
|
+
import { FButton } from 'fantasia-ui'
|
|
264
|
+
import type { ComponentProps } from 'vue'
|
|
265
|
+
|
|
266
|
+
// 从组件推断 props 类型
|
|
267
|
+
type FButtonProps = ComponentProps<typeof FButton>
|
|
268
|
+
|
|
252
269
|
const buttonProps: FButtonProps = {
|
|
253
|
-
|
|
254
|
-
size: 'large'
|
|
255
|
-
disabled: false
|
|
270
|
+
variant: 'primary',
|
|
271
|
+
size: 'large'
|
|
256
272
|
}
|
|
257
273
|
```
|
|
258
274
|
|
|
@@ -32,3 +32,11 @@ export { default as FEditor } from './modules/FEditor';
|
|
|
32
32
|
export { default as FTable } from './modules/FTable';
|
|
33
33
|
export { default as FDialog } from './modules/FDialog';
|
|
34
34
|
export { default as FUpload } from './modules/FUpload';
|
|
35
|
+
export { default as FButtonGroup } from './modules/FButtonGroup';
|
|
36
|
+
export { default as FCollapse } from './modules/FCollapse';
|
|
37
|
+
export { default as FCollapseItem } from './modules/FCollapseItem';
|
|
38
|
+
export { default as FColorPicker } from './modules/FColorPicker';
|
|
39
|
+
export { default as FEmpty } from './modules/FEmpty';
|
|
40
|
+
export { default as FSlider } from './modules/FSlider';
|
|
41
|
+
export { default as FScrollbar } from './modules/FScrollbar';
|
|
42
|
+
export { default as FInputNumber } from './modules/FInputNumber';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FButtonGroupProps } from '../../types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
attrs: Partial<{}>;
|
|
5
|
+
slots: {
|
|
6
|
+
default?(_: {}): any;
|
|
7
|
+
};
|
|
8
|
+
refs: {};
|
|
9
|
+
rootEl: HTMLDivElement;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: DefineComponent<FButtonGroupProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<FButtonGroupProps> & Readonly<{}>, {
|
|
13
|
+
vertical: boolean;
|
|
14
|
+
type: "default" | "primary" | "success" | "warning" | "danger";
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
size: "small" | "default" | "large";
|
|
17
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
18
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { FCollapseProps } from '../../types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
type __VLS_Props = FCollapseProps;
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
modelValue?: Array<string | number> | string | number;
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: HTMLDivElement;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
17
|
+
"update:modelValue": (value: string | number | (string | number)[]) => any;
|
|
18
|
+
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
+
"onUpdate:modelValue"?: (value: string | number | (string | number)[]) => any;
|
|
20
|
+
}>, {
|
|
21
|
+
accordion: boolean;
|
|
22
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
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,23 @@
|
|
|
1
|
+
import { FCollapseItemProps } from '../../types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
attrs: Partial<{}>;
|
|
5
|
+
slots: {
|
|
6
|
+
title?(_: {}): any;
|
|
7
|
+
default?(_: {}): any;
|
|
8
|
+
};
|
|
9
|
+
refs: {};
|
|
10
|
+
rootEl: HTMLDivElement;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
+
declare const __VLS_component: DefineComponent<FCollapseItemProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<FCollapseItemProps> & Readonly<{}>, {
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
title: string;
|
|
16
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
17
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FColorPickerProps } from '../../types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
type __VLS_Props = FColorPickerProps;
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
modelValue?: string;
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: string) => any;
|
|
9
|
+
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
11
|
+
}>, {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
size: "small" | "default" | "large";
|
|
14
|
+
showAlpha: boolean;
|
|
15
|
+
predefine: string[];
|
|
16
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
17
|
+
rootRef: HTMLDivElement;
|
|
18
|
+
panelRef: HTMLDivElement;
|
|
19
|
+
hueRef: HTMLDivElement;
|
|
20
|
+
alphaRef: HTMLDivElement;
|
|
21
|
+
}, HTMLDivElement>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FEmptyProps } from '../../types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
attrs: Partial<{}>;
|
|
5
|
+
slots: {
|
|
6
|
+
image?(_: {}): any;
|
|
7
|
+
description?(_: {}): any;
|
|
8
|
+
default?(_: {}): any;
|
|
9
|
+
};
|
|
10
|
+
refs: {};
|
|
11
|
+
rootEl: HTMLDivElement;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: DefineComponent<FEmptyProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<FEmptyProps> & Readonly<{}>, {
|
|
15
|
+
image: string;
|
|
16
|
+
description: string;
|
|
17
|
+
imageSize: number;
|
|
18
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
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,24 @@
|
|
|
1
|
+
import { FInputNumberProps } from '../../types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
type __VLS_Props = FInputNumberProps;
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
modelValue?: number | undefined;
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: number) => any;
|
|
9
|
+
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: (value: number) => any;
|
|
11
|
+
}>, {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
size: "small" | "default" | "large";
|
|
14
|
+
placeholder: string;
|
|
15
|
+
min: number;
|
|
16
|
+
max: number;
|
|
17
|
+
step: number;
|
|
18
|
+
precision: number;
|
|
19
|
+
controls: boolean;
|
|
20
|
+
controlsPosition: "right" | "both";
|
|
21
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
22
|
+
inputRef: HTMLInputElement;
|
|
23
|
+
}, HTMLDivElement>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { FScrollbarProps } from '../../types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
declare function update(): void;
|
|
4
|
+
declare function scrollTo(options: ScrollToOptions | number, yCoord?: number): void;
|
|
5
|
+
declare function setScrollTop(value: number): void;
|
|
6
|
+
declare function setScrollLeft(value: number): void;
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {
|
|
13
|
+
wrapRef: HTMLDivElement;
|
|
14
|
+
resizeRef: HTMLDivElement;
|
|
15
|
+
thumbYRef: HTMLDivElement;
|
|
16
|
+
thumbXRef: HTMLDivElement;
|
|
17
|
+
};
|
|
18
|
+
rootEl: HTMLDivElement;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
21
|
+
declare const __VLS_component: DefineComponent<FScrollbarProps, {
|
|
22
|
+
scrollTo: typeof scrollTo;
|
|
23
|
+
setScrollTop: typeof setScrollTop;
|
|
24
|
+
setScrollLeft: typeof setScrollLeft;
|
|
25
|
+
update: typeof update;
|
|
26
|
+
wrapRef: globalThis.Ref<HTMLElement, HTMLElement>;
|
|
27
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
28
|
+
scroll: (args_0: {
|
|
29
|
+
scrollTop: number;
|
|
30
|
+
scrollLeft: number;
|
|
31
|
+
}) => any;
|
|
32
|
+
}, string, PublicProps, Readonly<FScrollbarProps> & Readonly<{
|
|
33
|
+
onScroll?: (args_0: {
|
|
34
|
+
scrollTop: number;
|
|
35
|
+
scrollLeft: number;
|
|
36
|
+
}) => any;
|
|
37
|
+
}>, {
|
|
38
|
+
horizontal: boolean;
|
|
39
|
+
vertical: boolean;
|
|
40
|
+
always: boolean;
|
|
41
|
+
height: string;
|
|
42
|
+
maxHeight: string;
|
|
43
|
+
native: boolean;
|
|
44
|
+
minSize: number;
|
|
45
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
46
|
+
wrapRef: HTMLDivElement;
|
|
47
|
+
resizeRef: HTMLDivElement;
|
|
48
|
+
thumbYRef: HTMLDivElement;
|
|
49
|
+
thumbXRef: HTMLDivElement;
|
|
50
|
+
}, HTMLDivElement>;
|
|
51
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
52
|
+
export default _default;
|
|
53
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
54
|
+
new (): {
|
|
55
|
+
$slots: S;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FSliderProps } from '../../types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
type __VLS_Props = FSliderProps;
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
modelValue?: number | [number, number];
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: number | [number, number]) => any;
|
|
9
|
+
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: (value: number | [number, number]) => any;
|
|
11
|
+
}>, {
|
|
12
|
+
vertical: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
size: "small" | "default" | "large";
|
|
15
|
+
range: boolean;
|
|
16
|
+
min: number;
|
|
17
|
+
max: number;
|
|
18
|
+
step: number;
|
|
19
|
+
showTooltip: boolean;
|
|
20
|
+
marks: Record<number, string>;
|
|
21
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
22
|
+
trackRef: HTMLDivElement;
|
|
23
|
+
}, HTMLDivElement>;
|
|
24
|
+
export default _default;
|