fan-components 1.0.8 → 1.0.10
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/LICENSE +21 -0
- package/README.en.md +141 -0
- package/README.md +141 -0
- package/dist/components/Dropdown/index.d.ts +4 -0
- package/dist/components/Dropdown/index.d.ts.map +1 -0
- package/dist/components/Dropdown/src/dropdown.d.ts +21 -0
- package/dist/components/Dropdown/src/dropdown.d.ts.map +1 -0
- package/dist/components/Dropdown/src/dropdown.vue.d.ts +110 -0
- package/dist/components/Dropdown/src/dropdown.vue.d.ts.map +1 -0
- package/dist/components/Form/index.d.ts +4 -0
- package/dist/components/Form/index.d.ts.map +1 -0
- package/dist/components/Form/src/Form.vue.d.ts +23 -0
- package/dist/components/Form/src/Form.vue.d.ts.map +1 -0
- package/dist/components/Form/src/FormItem.vue.d.ts +23 -0
- package/dist/components/Form/src/FormItem.vue.d.ts.map +1 -0
- package/dist/components/Form/src/form.d.ts +47 -0
- package/dist/components/Form/src/form.d.ts.map +1 -0
- package/dist/components/Input/index.d.ts +4 -0
- package/dist/components/Input/index.d.ts.map +1 -0
- package/dist/components/Input/src/Input.d.ts +25 -0
- package/dist/components/Input/src/Input.d.ts.map +1 -0
- package/dist/components/Input/src/Input.vue.d.ts +114 -0
- package/dist/components/Input/src/Input.vue.d.ts.map +1 -0
- package/dist/components/Message/index.d.ts +3 -0
- package/dist/components/Message/index.d.ts.map +1 -0
- package/dist/components/Message/src/message.d.ts +21 -0
- package/dist/components/Message/src/message.d.ts.map +1 -0
- package/dist/components/Message/src/message.vue.d.ts +93 -0
- package/dist/components/Message/src/message.vue.d.ts.map +1 -0
- package/dist/components/Message/src/methods.d.ts +24 -0
- package/dist/components/Message/src/methods.d.ts.map +1 -0
- package/dist/components/Select/index.d.ts +4 -0
- package/dist/components/Select/index.d.ts.map +1 -0
- package/dist/components/Select/src/select.d.ts +35 -0
- package/dist/components/Select/src/select.d.ts.map +1 -0
- package/dist/components/Select/src/select.vue.d.ts +105 -0
- package/dist/components/Select/src/select.vue.d.ts.map +1 -0
- package/dist/components/Switch/index.d.ts +4 -0
- package/dist/components/Switch/index.d.ts.map +1 -0
- package/dist/components/Switch/src/switch.d.ts +17 -0
- package/dist/components/Switch/src/switch.d.ts.map +1 -0
- package/dist/components/Switch/src/switch.vue.d.ts +90 -0
- package/dist/components/Switch/src/switch.vue.d.ts.map +1 -0
- package/dist/components/Tooltip/index.d.ts +4 -0
- package/dist/components/Tooltip/index.d.ts.map +1 -0
- package/dist/components/Tooltip/src/tooltip.d.ts +20 -0
- package/dist/components/Tooltip/src/tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/src/tooltip.vue.d.ts +91 -0
- package/dist/components/Tooltip/src/tooltip.vue.d.ts.map +1 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/types.d.ts +8 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/package.json +2 -2
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/rander-vnode.d.ts +8 -0
- package/dist/utils/rander-vnode.d.ts.map +1 -0
- package/dist/utils/use-click-outside.d.ts +5 -0
- package/dist/utils/use-click-outside.d.ts.map +1 -0
- package/dist/utils/use-event-listener.d.ts +4 -0
- package/dist/utils/use-event-listener.d.ts.map +1 -0
- package/dist/utils/use-zIndex.d.ts +8 -0
- package/dist/utils/use-zIndex.d.ts.map +1 -0
- package/dist/utils/with-install.d.ts +4 -0
- package/dist/utils/with-install.d.ts.map +1 -0
- package/package.json +10 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 helloFGQ
|
|
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.en.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Fan-Components
|
|
2
|
+
|
|
3
|
+
A Component Library Based on Vue 3
|
|
4
|
+
|
|
5
|
+
## Introduction
|
|
6
|
+
|
|
7
|
+
Fan-Components is a modern, lightweight Vue 3 component library managed using a Monorepo architecture. This library provides a rich set of UI components, including buttons, input fields, selectors, switches, message notifications, and other common components, suitable for various enterprise-level admin and backend application development.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Modern Architecture**: Developed based on Vue 3 and TypeScript, fully utilizing the Composition API
|
|
12
|
+
- **Monorepo Management**: Uses pnpm workspace to manage multi-package structure, clear and straightforward
|
|
13
|
+
- **On-Demand Loading**: Supports on-demand import, effectively reducing bundle size
|
|
14
|
+
- **Theme Customization**: Provides complete theme customization capabilities
|
|
15
|
+
- **TypeScript Support**: Complete type definitions, easy for development
|
|
16
|
+
|
|
17
|
+
## Component List
|
|
18
|
+
|
|
19
|
+
- **Button** - Button Component
|
|
20
|
+
- **Collapse** - Collapsible Panel
|
|
21
|
+
- **Dropdown** - Dropdown Menu
|
|
22
|
+
- **Form** - Form Component
|
|
23
|
+
- **Icon** - Icon Component
|
|
24
|
+
- **Input** - Input Field
|
|
25
|
+
- **Message** - Message Notification
|
|
26
|
+
- **Select** - Selector
|
|
27
|
+
- **Switch** - Switch
|
|
28
|
+
- **Tooltip** - Tooltip
|
|
29
|
+
|
|
30
|
+
## Project Structure
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
monorepo/
|
|
34
|
+
├── packages/
|
|
35
|
+
│ ├── components/ # Component Source Code
|
|
36
|
+
│ ├── theme-chalk/ # Theme Styles
|
|
37
|
+
│ └── utils/ # Utility Functions
|
|
38
|
+
├── examples/ # Example Code
|
|
39
|
+
├── document/ # Component Documentation
|
|
40
|
+
├── eslint.config.ts # ESLint Configuration
|
|
41
|
+
├── prettier.config.js # Prettier Configuration
|
|
42
|
+
├── tsconfig.json # TypeScript Configuration
|
|
43
|
+
├── pnpm-workspace.yaml # pnpm Workspace Configuration
|
|
44
|
+
└── rollup.config.js # Rollup Build Configuration
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
### Environment Requirements
|
|
50
|
+
|
|
51
|
+
- Node.js >= 22.14.0
|
|
52
|
+
- pnpm >= >=10.15.1
|
|
53
|
+
|
|
54
|
+
### Install Dependencies
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pnpm install
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Development & Debugging
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Start example project
|
|
64
|
+
pnpm run dev
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Code Style Check
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Code Formatting
|
|
71
|
+
pnpm run prettier
|
|
72
|
+
|
|
73
|
+
# ESLint Check
|
|
74
|
+
pnpm run lint
|
|
75
|
+
|
|
76
|
+
# Spell Check
|
|
77
|
+
pnpm run spellcheck
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Unit Testing
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Run Tests
|
|
84
|
+
pnpm run test
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Build & Packaging
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Build All Packages
|
|
91
|
+
pnpm run build
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Usage Examples
|
|
95
|
+
|
|
96
|
+
### Full Import
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import { createApp } from "vue";
|
|
100
|
+
import FanComponents from "fan-components";
|
|
101
|
+
import "fan-components/dist/theme-chalk/index.css";
|
|
102
|
+
import App from "./App.vue";
|
|
103
|
+
|
|
104
|
+
const app = createApp(App);
|
|
105
|
+
app.use(FanComponents);
|
|
106
|
+
app.mount("#app");
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### On-Demand Import
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { createApp } from "vue";
|
|
113
|
+
import { Button, Input } from "fan-components";
|
|
114
|
+
import "fan-components/dist/theme-chalk/index.css";
|
|
115
|
+
import App from "./App.vue";
|
|
116
|
+
|
|
117
|
+
const app = createApp(App);
|
|
118
|
+
app.use(Button);
|
|
119
|
+
app.use(Input);
|
|
120
|
+
app.mount("#app");
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Contributing Guide
|
|
124
|
+
|
|
125
|
+
This project uses the following tools to ensure code quality:
|
|
126
|
+
|
|
127
|
+
- **Prettier** - Code Formatting
|
|
128
|
+
- **ESLint** - Code Quality Check
|
|
129
|
+
- **Husky** - Git Hook Management
|
|
130
|
+
- **Lint-Staged** - Git Staging Area Code Check
|
|
131
|
+
- **Commitlint** - Git Commit Convention Check
|
|
132
|
+
|
|
133
|
+
Please ensure all checks pass before submitting code.
|
|
134
|
+
|
|
135
|
+
## Open Source License
|
|
136
|
+
|
|
137
|
+
This project is open sourced under the [MIT License](https://opensource.org/licenses/MIT).
|
|
138
|
+
|
|
139
|
+
## Contact Information
|
|
140
|
+
|
|
141
|
+
- Project Address: https://gitee.com/helloFGQ/monorepo
|
package/README.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Fan-Components
|
|
2
|
+
|
|
3
|
+
一个基于 Vue 3 的组件库
|
|
4
|
+
|
|
5
|
+
## 简介
|
|
6
|
+
|
|
7
|
+
Fan-Components 是一个现代化、轻量级的 Vue 3 组件库,采用 Monorepo 架构进行管理。该组件库提供了丰富的 UI 组件,包括按钮、输入框、选择器、开关、消息提示等常用组件,适用于各种企业级中后台应用开发。
|
|
8
|
+
|
|
9
|
+
## 特性
|
|
10
|
+
|
|
11
|
+
- **现代化架构**:基于 Vue 3 和 TypeScript 开发,充分利用 Composition API
|
|
12
|
+
- **Monorepo 管理**:使用 pnpm workspace 管理多包结构,清晰明了
|
|
13
|
+
- **按需加载**:支持按需引入,有效减小打包体积
|
|
14
|
+
- **主题定制**:提供完整的主题定制能力
|
|
15
|
+
- **TypeScript 支持**:完整的类型定义,易于开发
|
|
16
|
+
|
|
17
|
+
## 组件列表
|
|
18
|
+
|
|
19
|
+
- **Button** - 按钮组件
|
|
20
|
+
- **Collapse** - 折叠面板
|
|
21
|
+
- **Dropdown** - 下拉菜单
|
|
22
|
+
- **Form** - 表单组件
|
|
23
|
+
- **Icon** - 图标组件
|
|
24
|
+
- **Input** - 输入框
|
|
25
|
+
- **Message** - 消息提示
|
|
26
|
+
- **Select** - 选择器
|
|
27
|
+
- **Switch** - 开关
|
|
28
|
+
- **Tooltip** - 文字提示
|
|
29
|
+
|
|
30
|
+
## 项目结构
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
monorepo/
|
|
34
|
+
├── packages/
|
|
35
|
+
│ ├── components/ # 组件源码
|
|
36
|
+
│ ├── theme-chalk/ # 主题样式
|
|
37
|
+
│ └── utils/ # 工具函数
|
|
38
|
+
├── examples/ # 示例代码
|
|
39
|
+
├── document/ # 组件文档
|
|
40
|
+
├── eslint.config.ts # ESLint 配置
|
|
41
|
+
├── prettier.config.js # Prettier 配置
|
|
42
|
+
├── tsconfig.json # TypeScript 配置
|
|
43
|
+
├── pnpm-workspace.yaml # pnpm 工作区配置
|
|
44
|
+
└── rollup.config.js # Rollup 打包配置
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 快速开始
|
|
48
|
+
|
|
49
|
+
### 环境要求
|
|
50
|
+
|
|
51
|
+
- Node.js >= 22.14.0
|
|
52
|
+
- pnpm >= >=10.15.1
|
|
53
|
+
|
|
54
|
+
### 安装依赖
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pnpm install
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 开发调试
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# 启动示例项目
|
|
64
|
+
pnpm run dev
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 代码风格检查
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# 代码格式化
|
|
71
|
+
pnpm run prettier
|
|
72
|
+
|
|
73
|
+
# ESLint 检查
|
|
74
|
+
pnpm run lint
|
|
75
|
+
|
|
76
|
+
# 拼写检查
|
|
77
|
+
pnpm run spellcheck
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 单元测试
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# 运行测试
|
|
84
|
+
pnpm run test
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 打包构建
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# 构建所有包
|
|
91
|
+
pnpm run build
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 使用示例
|
|
95
|
+
|
|
96
|
+
### 完整引入
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import { createApp } from "vue";
|
|
100
|
+
import FanComponents from "fan-components";
|
|
101
|
+
import "fan-components/dist/theme-chalk/index.css";
|
|
102
|
+
import App from "./App.vue";
|
|
103
|
+
|
|
104
|
+
const app = createApp(App);
|
|
105
|
+
app.use(FanComponents);
|
|
106
|
+
app.mount("#app");
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 按需引入
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
import { createApp } from "vue";
|
|
113
|
+
import { Button, Input } from "fan-components";
|
|
114
|
+
import "fan-components/dist/theme-chalk/index.css";
|
|
115
|
+
import App from "./App.vue";
|
|
116
|
+
|
|
117
|
+
const app = createApp(App);
|
|
118
|
+
app.use(Button);
|
|
119
|
+
app.use(Input);
|
|
120
|
+
app.mount("#app");
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 贡献指南
|
|
124
|
+
|
|
125
|
+
该项目使用以下工具保证代码质量:
|
|
126
|
+
|
|
127
|
+
- **Prettier** - 代码格式化
|
|
128
|
+
- **ESLint** - 代码质量检查
|
|
129
|
+
- **Husky** - Git 钩子管理
|
|
130
|
+
- **Lint-Staged** - Git 暂存区代码检查
|
|
131
|
+
- **Commitlint** - Git 提交规范检查
|
|
132
|
+
|
|
133
|
+
提交代码前请确保通过所有检查。
|
|
134
|
+
|
|
135
|
+
## 开源协议
|
|
136
|
+
|
|
137
|
+
本项目基于 [MIT License](https://opensource.org/licenses/MIT) 开源。
|
|
138
|
+
|
|
139
|
+
## 联系方式
|
|
140
|
+
|
|
141
|
+
- 项目地址:https://gitee.com/helloFGQ/monorepo
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/components/Dropdown/index.ts"],"names":[],"mappings":"AAGA,cAAc,gBAAgB,CAAC;AAE/B,eAAO,MAAM,UAAU,KAAwB,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { VNode } from "vue";
|
|
2
|
+
import type { TooltipProps } from "../../Tooltip/src/tooltip";
|
|
3
|
+
export interface DropdownProps extends TooltipProps {
|
|
4
|
+
menuOptions: MenuOption[];
|
|
5
|
+
hideAfterClick?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface MenuOption {
|
|
8
|
+
label: string | VNode;
|
|
9
|
+
key: string | number;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
divided?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface DropdownEmits {
|
|
14
|
+
(e: "visible-change", value: boolean): void;
|
|
15
|
+
(e: "select", value: MenuOption): void;
|
|
16
|
+
}
|
|
17
|
+
export interface DropdownInstance {
|
|
18
|
+
show: () => void;
|
|
19
|
+
hide: () => void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../../packages/components/Dropdown/src/dropdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AACD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC;IACtB,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AACD,MAAM,WAAW,aAAa;IAC5B,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
menuOptions: {
|
|
3
|
+
type: ArrayConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
hideAfterClick: {
|
|
7
|
+
type: BooleanConstructor;
|
|
8
|
+
required: false;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
content: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
required: false;
|
|
14
|
+
};
|
|
15
|
+
trigger: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
required: false;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
placement: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
required: false;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
manual: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
required: false;
|
|
28
|
+
};
|
|
29
|
+
popperOptions: {
|
|
30
|
+
type: ObjectConstructor;
|
|
31
|
+
required: false;
|
|
32
|
+
};
|
|
33
|
+
transition: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
required: false;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
openDelay: {
|
|
39
|
+
type: NumberConstructor;
|
|
40
|
+
required: false;
|
|
41
|
+
default: number;
|
|
42
|
+
};
|
|
43
|
+
closeDelay: {
|
|
44
|
+
type: NumberConstructor;
|
|
45
|
+
required: false;
|
|
46
|
+
default: number;
|
|
47
|
+
};
|
|
48
|
+
}>, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("visible-change" | "select")[], "visible-change" | "select", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
51
|
+
menuOptions: {
|
|
52
|
+
type: ArrayConstructor;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
hideAfterClick: {
|
|
56
|
+
type: BooleanConstructor;
|
|
57
|
+
required: false;
|
|
58
|
+
default: boolean;
|
|
59
|
+
};
|
|
60
|
+
content: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
required: false;
|
|
63
|
+
};
|
|
64
|
+
trigger: {
|
|
65
|
+
type: StringConstructor;
|
|
66
|
+
required: false;
|
|
67
|
+
default: string;
|
|
68
|
+
};
|
|
69
|
+
placement: {
|
|
70
|
+
type: StringConstructor;
|
|
71
|
+
required: false;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
74
|
+
manual: {
|
|
75
|
+
type: BooleanConstructor;
|
|
76
|
+
required: false;
|
|
77
|
+
};
|
|
78
|
+
popperOptions: {
|
|
79
|
+
type: ObjectConstructor;
|
|
80
|
+
required: false;
|
|
81
|
+
};
|
|
82
|
+
transition: {
|
|
83
|
+
type: StringConstructor;
|
|
84
|
+
required: false;
|
|
85
|
+
default: string;
|
|
86
|
+
};
|
|
87
|
+
openDelay: {
|
|
88
|
+
type: NumberConstructor;
|
|
89
|
+
required: false;
|
|
90
|
+
default: number;
|
|
91
|
+
};
|
|
92
|
+
closeDelay: {
|
|
93
|
+
type: NumberConstructor;
|
|
94
|
+
required: false;
|
|
95
|
+
default: number;
|
|
96
|
+
};
|
|
97
|
+
}>> & Readonly<{
|
|
98
|
+
"onVisible-change"?: (...args: any[]) => any;
|
|
99
|
+
onSelect?: (...args: any[]) => any;
|
|
100
|
+
}>, {
|
|
101
|
+
hideAfterClick: boolean;
|
|
102
|
+
trigger: string;
|
|
103
|
+
placement: string;
|
|
104
|
+
manual: boolean;
|
|
105
|
+
transition: string;
|
|
106
|
+
openDelay: number;
|
|
107
|
+
closeDelay: number;
|
|
108
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
109
|
+
export default _default;
|
|
110
|
+
//# sourceMappingURL=dropdown.vue?vue&type=script&setup=true&lang.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.vue?vue&type=script&setup=true&lang.d.ts","sourceRoot":"","sources":["../../../../packages/components/Dropdown/src/dropdown.vue?vue&type=script&setup=true&lang.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA4Dc,GAAG,UAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA1C7B,wBAyFE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/components/Form/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,KAAkC,CAAC;AACtD,eAAO,MAAM,UAAU,4CAAW,CAAC;AACnC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
model: {
|
|
3
|
+
type: ObjectConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
rules: {
|
|
7
|
+
type: ObjectConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
}>, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
model: {
|
|
14
|
+
type: ObjectConstructor;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
rules: {
|
|
18
|
+
type: ObjectConstructor;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
export default _default;
|
|
23
|
+
//# sourceMappingURL=Form.vue?vue&type=script&setup=true&lang.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.vue?vue&type=script&setup=true&lang.d.ts","sourceRoot":"","sources":["../../../../packages/components/Form/src/Form.vue?vue&type=script&setup=true&lang.ts"],"names":[],"mappings":";;;;;;;;;WAsEc,GAAG,UAAS,GAAG;;;;;;;;;;;;AA5D7B,wBAmEE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
label: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
prop: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
required: false;
|
|
9
|
+
};
|
|
10
|
+
}>, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
label: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
prop: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
required: false;
|
|
20
|
+
};
|
|
21
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
export default _default;
|
|
23
|
+
//# sourceMappingURL=FormItem.vue?vue&type=script&setup=true&lang.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormItem.vue?vue&type=script&setup=true&lang.d.ts","sourceRoot":"","sources":["../../../../packages/components/Form/src/FormItem.vue?vue&type=script&setup=true&lang.ts"],"names":[],"mappings":";;;;;;;;;WAmIc,GAAG,UAAS,GAAG;;;;;;;;;;;;AAnH7B,wBA2IE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { InjectionKey } from "vue";
|
|
2
|
+
import type { RuleItem, ValidateError, ValidateFieldsError } from "async-validator";
|
|
3
|
+
export interface FormItemProps {
|
|
4
|
+
label: string;
|
|
5
|
+
prop?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FormItemRule extends RuleItem {
|
|
8
|
+
trigger?: string;
|
|
9
|
+
}
|
|
10
|
+
export type FormRules = Record<string, FormItemRule[]>;
|
|
11
|
+
export interface FormProps {
|
|
12
|
+
model: Record<string, any>;
|
|
13
|
+
rules: FormRules;
|
|
14
|
+
}
|
|
15
|
+
export interface FormContext extends FormProps {
|
|
16
|
+
addField: (field: FormItemContext) => void;
|
|
17
|
+
removeField: (field: FormItemContext) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface ValidateStatusProp {
|
|
20
|
+
state: "init" | "success" | "error";
|
|
21
|
+
errorMsg: string;
|
|
22
|
+
loading: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface FormItemContext {
|
|
25
|
+
prop: string;
|
|
26
|
+
validate: (trigger?: string) => Promise<any>;
|
|
27
|
+
resetField(): void;
|
|
28
|
+
clearValidate(): void;
|
|
29
|
+
}
|
|
30
|
+
export interface FormValidateFailure {
|
|
31
|
+
errors: ValidateError[] | null;
|
|
32
|
+
fields: ValidateFieldsError;
|
|
33
|
+
}
|
|
34
|
+
export interface FormInstance {
|
|
35
|
+
validate: () => Promise<any>;
|
|
36
|
+
resetFields: (props?: string[]) => void;
|
|
37
|
+
clearValidate: (props?: string[]) => void;
|
|
38
|
+
}
|
|
39
|
+
export interface FormItemInstance {
|
|
40
|
+
validateStatus: ValidateStatusProp;
|
|
41
|
+
validate: (trigger?: string) => Promise<any>;
|
|
42
|
+
resetField(): void;
|
|
43
|
+
clearValidate(): void;
|
|
44
|
+
}
|
|
45
|
+
export declare const formContextKey: InjectionKey<FormContext>;
|
|
46
|
+
export declare const formItemContextKey: InjectionKey<FormItemContext>;
|
|
47
|
+
//# sourceMappingURL=form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../packages/components/Form/src/form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACpF,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;AACvD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,WAAW,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;CAC/C;AACD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AACD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,UAAU,IAAI,IAAI,CAAC;IACnB,aAAa,IAAI,IAAI,CAAC;CACvB;AACD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AACD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7B,WAAW,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC,aAAa,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC3C;AACD,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,kBAAkB,CAAC;IACnC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,UAAU,IAAI,IAAI,CAAC;IACnB,aAAa,IAAI,IAAI,CAAC;CACvB;AACD,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAA4B,CAAC;AAClF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,eAAe,CAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/components/Input/index.ts"],"names":[],"mappings":"AAGA,cAAc,aAAa,CAAC;AAE5B,eAAO,MAAM,OAAO,KAAqB,CAAC;AAC1C,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface InputProps {
|
|
2
|
+
type?: string;
|
|
3
|
+
modelValue: string;
|
|
4
|
+
size?: "large" | "small";
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
clearable?: boolean;
|
|
7
|
+
showPassword?: boolean;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
autocomplete?: string;
|
|
11
|
+
autofocus?: boolean;
|
|
12
|
+
form?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface InputEmits {
|
|
15
|
+
(e: "update:modelValue", value: string): void;
|
|
16
|
+
(e: "input", value: string): void;
|
|
17
|
+
(e: "change", value: string): void;
|
|
18
|
+
(e: "focus", value: FocusEvent): void;
|
|
19
|
+
(e: "blur", value: FocusEvent): void;
|
|
20
|
+
(e: "clear"): void;
|
|
21
|
+
}
|
|
22
|
+
export interface InputInstance {
|
|
23
|
+
ref: HTMLInputElement | HTMLTextAreaElement;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../packages/components/Input/src/Input.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,UAAU;IACzB,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9C,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACtC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACrC,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,gBAAgB,GAAG,mBAAmB,CAAC;CAC7C"}
|