@a2simcode/ui 0.0.1 → 0.0.3

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 CHANGED
@@ -1,53 +1,53 @@
1
- 专有软件许可协议
2
-
3
- 版权所有 © 2024 苏州极简搭信息技术有限公司。保留所有权利。
4
-
5
- 本软件及其相关文档("软件")为专有软件,受版权法和国际条约保护。
6
-
7
- 许可限制:
8
-
9
- 1. 本软件仅授权给获得明确书面许可的用户使用。
10
-
11
- 2. 未经版权所有者事先书面同意,您不得:
12
- - 复制、修改、改编或翻译本软件
13
- - 对本软件进行反向工程、反编译或反汇编
14
- - 出租、出借、分发、转让或再许可本软件
15
- - 删除或修改本软件中的任何版权声明或其他所有权标记
16
-
17
- 3. 本软件按"现状"提供,不提供任何明示或暗示的保证,包括但不限于适销性、特定用途适用性和非侵权性的保证。
18
-
19
- 4. 在任何情况下,版权所有者均不对因使用或无法使用本软件而产生的任何索赔、损害或其他责任负责。
20
-
21
- 5. 本许可协议受中华人民共和国法律管辖。
22
-
23
- 如需获得使用许可,请联系版权所有者。
24
-
25
- ---
26
-
27
- PROPRIETARY SOFTWARE LICENSE
28
-
29
- Copyright © 2024 Suzhou Jijian-da Information Technology Co., Ltd. All rights reserved.
30
-
31
- This software and associated documentation files (the "Software") is proprietary
32
- software protected by copyright laws and international treaties.
33
-
34
- License Restrictions:
35
-
36
- 1. This Software is licensed only to users who have obtained explicit written permission.
37
-
38
- 2. Without prior written consent from the copyright holder, you may not:
39
- - Copy, modify, adapt, or translate the Software
40
- - Reverse engineer, decompile, or disassemble the Software
41
- - Rent, lease, distribute, transfer, or sublicense the Software
42
- - Remove or modify any copyright notices or other proprietary markings in the Software
43
-
44
- 3. The Software is provided "as is" without warranty of any kind, express or implied,
45
- including but not limited to warranties of merchantability, fitness for a particular
46
- purpose, and non-infringement.
47
-
48
- 4. In no event shall the copyright holder be liable for any claims, damages, or other
49
- liability arising from the use or inability to use the Software.
50
-
51
- 5. This license agreement is governed by the laws of the People's Republic of China.
52
-
53
- For licensing inquiries, please contact the copyright holder.
1
+ 专有软件许可协议
2
+
3
+ 版权所有 © 2024 苏州极简搭信息技术有限公司。保留所有权利。
4
+
5
+ 本软件及其相关文档("软件")为专有软件,受版权法和国际条约保护。
6
+
7
+ 许可限制:
8
+
9
+ 1. 本软件仅授权给获得明确书面许可的用户使用。
10
+
11
+ 2. 未经版权所有者事先书面同意,您不得:
12
+ - 复制、修改、改编或翻译本软件
13
+ - 对本软件进行反向工程、反编译或反汇编
14
+ - 出租、出借、分发、转让或再许可本软件
15
+ - 删除或修改本软件中的任何版权声明或其他所有权标记
16
+
17
+ 3. 本软件按"现状"提供,不提供任何明示或暗示的保证,包括但不限于适销性、特定用途适用性和非侵权性的保证。
18
+
19
+ 4. 在任何情况下,版权所有者均不对因使用或无法使用本软件而产生的任何索赔、损害或其他责任负责。
20
+
21
+ 5. 本许可协议受中华人民共和国法律管辖。
22
+
23
+ 如需获得使用许可,请联系版权所有者。
24
+
25
+ ---
26
+
27
+ PROPRIETARY SOFTWARE LICENSE
28
+
29
+ Copyright © 2024 Suzhou Jijian-da Information Technology Co., Ltd. All rights reserved.
30
+
31
+ This software and associated documentation files (the "Software") is proprietary
32
+ software protected by copyright laws and international treaties.
33
+
34
+ License Restrictions:
35
+
36
+ 1. This Software is licensed only to users who have obtained explicit written permission.
37
+
38
+ 2. Without prior written consent from the copyright holder, you may not:
39
+ - Copy, modify, adapt, or translate the Software
40
+ - Reverse engineer, decompile, or disassemble the Software
41
+ - Rent, lease, distribute, transfer, or sublicense the Software
42
+ - Remove or modify any copyright notices or other proprietary markings in the Software
43
+
44
+ 3. The Software is provided "as is" without warranty of any kind, express or implied,
45
+ including but not limited to warranties of merchantability, fitness for a particular
46
+ purpose, and non-infringement.
47
+
48
+ 4. In no event shall the copyright holder be liable for any claims, damages, or other
49
+ liability arising from the use or inability to use the Software.
50
+
51
+ 5. This license agreement is governed by the laws of the People's Republic of China.
52
+
53
+ For licensing inquiries, please contact the copyright holder.
package/README.md CHANGED
@@ -1,129 +1,129 @@
1
- # SimCode UI
2
-
3
- <div align="center">
4
- <h1>SimCode UI</h1>
5
- <p>基于 Vue 3 + TypeScript 的现代化 UI 组件库</p>
6
- </div>
7
-
8
- ## ✨ 特性
9
-
10
- - 🚀 **现代化技术栈**: 基于 Vue 3 + TypeScript + Vite
11
- - 📦 **开箱即用**: 提供完善的类型定义和文档
12
- - 🎨 **精美设计**: 现代化的设计风格
13
- - 🔧 **易于定制**: 支持主题定制
14
- - ⚡️ **按需加载**: 支持 Tree Shaking
15
- - 🧪 **完善测试**: 单元测试覆盖
16
-
17
- ## 📦 安装
18
-
19
- 使用 pnpm:
20
-
21
- ```bash
22
- pnpm add @a2simcode/ui
23
- ```
24
-
25
- 使用 npm:
26
-
27
- ```bash
28
- npm install @a2simcode/ui
29
- ```
30
-
31
- 使用 yarn:
32
-
33
- ```bash
34
- yarn add @a2simcode/ui
35
- ```
36
-
37
- ## 🔨 快速开始
38
-
39
- ### 完整引入
40
-
41
- ```typescript
42
- import { createApp } from 'vue'
43
- import App from './App.vue'
44
- import SimCodeUI from '@a2simcode/ui'
45
- import '@a2simcode/ui/dist/style.css'
46
-
47
- const app = createApp(App)
48
- app.use(SimCodeUI)
49
- app.mount('#app')
50
- ```
51
-
52
- ### 按需引入
53
-
54
- ```vue
55
- <template>
56
- <j-button type="primary">按钮</j-button>
57
- </template>
58
-
59
- <script setup lang="ts">
60
- import { JButton } from '@a2simcode/ui'
61
- import '@a2simcode/ui/dist/style.css'
62
- </script>
63
- ```
64
-
65
- ## 🎯 组件列表
66
-
67
- - ✅ Button 按钮
68
- - ✅ Input 输入框
69
- - 🚧 更多组件开发中...
70
-
71
- ## 💻 本地开发
72
-
73
- ```bash
74
- # 进入项目目录
75
- cd simcode-ui
76
-
77
- # 安装依赖
78
- pnpm install
79
-
80
- # 启动开发服务器
81
- pnpm dev
82
-
83
- # 构建组件库
84
- pnpm build
85
-
86
- # 运行测试
87
- pnpm test
88
-
89
- # 启动文档站点
90
- pnpm docs:dev
91
- ```
92
-
93
- ## 📁 项目结构
94
-
95
- ```
96
- simcode-ui/
97
- ├── packages/ # 组件源码
98
- │ ├── components/ # 组件
99
- │ │ ├── button/ # 按钮组件
100
- │ │ ├── input/ # 输入框组件
101
- │ │ └── index.ts # 组件入口
102
- │ └── theme/ # 主题样式
103
- │ └── src/ # 样式源码 (Less)
104
- ├── examples/ # 组件预览
105
- │ ├── App.vue # 预览应用
106
- │ └── main.ts # 入口文件
107
- ├── docs/ # 文档
108
- │ ├── .vitepress/ # VitePress 配置
109
- │ ├── guide/ # 指南
110
- │ └── components/ # 组件文档
111
- ├── __tests__/ # 测试文件
112
- ├── vite.config.ts # Vite 配置
113
- ├── vitest.config.ts # Vitest 配置
114
- └── package.json # 项目配置
115
- ```
116
-
117
- ## 🤝 贡献
118
-
119
- 欢迎提交 Issue 和 Pull Request!
120
-
121
- ## 📄 版权声明
122
-
123
- Copyright © 2024 苏州极简搭信息技术有限公司. All rights reserved.
124
-
125
- 本软件及其相关文档为专有软件,受版权法保护。未经版权所有者明确书面许可,不得以任何形式或方式(电子、机械、复印、录制或其他方式)复制、分发、传播或使用本软件的任何部分。
126
-
127
- ## 🙏 致谢
128
-
129
- 感谢所有为这个项目做出贡献的开发者!
1
+ # SimCode UI
2
+
3
+ <div align="center">
4
+ <h1>SimCode UI</h1>
5
+ <p>基于 Vue 3 + TypeScript 的现代化 UI 组件库</p>
6
+ </div>
7
+
8
+ ## ✨ 特性
9
+
10
+ - 🚀 **现代化技术栈**: 基于 Vue 3 + TypeScript + Vite
11
+ - 📦 **开箱即用**: 提供完善的类型定义和文档
12
+ - 🎨 **精美设计**: 现代化的设计风格
13
+ - 🔧 **易于定制**: 支持主题定制
14
+ - ⚡️ **按需加载**: 支持 Tree Shaking
15
+ - 🧪 **完善测试**: 单元测试覆盖
16
+
17
+ ## 📦 安装
18
+
19
+ 使用 pnpm:
20
+
21
+ ```bash
22
+ pnpm add @a2simcode/ui
23
+ ```
24
+
25
+ 使用 npm:
26
+
27
+ ```bash
28
+ npm install @a2simcode/ui
29
+ ```
30
+
31
+ 使用 yarn:
32
+
33
+ ```bash
34
+ yarn add @a2simcode/ui
35
+ ```
36
+
37
+ ## 🔨 快速开始
38
+
39
+ ### 完整引入
40
+
41
+ ```typescript
42
+ import { createApp } from 'vue'
43
+ import App from './App.vue'
44
+ import SimCodeUI from '@a2simcode/ui'
45
+ import '@a2simcode/ui/dist/style.css'
46
+
47
+ const app = createApp(App)
48
+ app.use(SimCodeUI)
49
+ app.mount('#app')
50
+ ```
51
+
52
+ ### 按需引入
53
+
54
+ ```vue
55
+ <template>
56
+ <j-button type="primary">按钮</j-button>
57
+ </template>
58
+
59
+ <script setup lang="ts">
60
+ import { JButton } from '@a2simcode/ui'
61
+ import '@a2simcode/ui/dist/style.css'
62
+ </script>
63
+ ```
64
+
65
+ ## 🎯 组件列表
66
+
67
+ - ✅ Button 按钮
68
+ - ✅ Input 输入框
69
+ - 🚧 更多组件开发中...
70
+
71
+ ## 💻 本地开发
72
+
73
+ ```bash
74
+ # 进入项目目录
75
+ cd simcode-ui
76
+
77
+ # 安装依赖
78
+ pnpm install
79
+
80
+ # 启动开发服务器
81
+ pnpm dev
82
+
83
+ # 构建组件库
84
+ pnpm build
85
+
86
+ # 运行测试
87
+ pnpm test
88
+
89
+ # 启动文档站点
90
+ pnpm docs:dev
91
+ ```
92
+
93
+ ## 📁 项目结构
94
+
95
+ ```
96
+ simcode-ui/
97
+ ├── packages/ # 组件源码
98
+ │ ├── components/ # 组件
99
+ │ │ ├── button/ # 按钮组件
100
+ │ │ ├── input/ # 输入框组件
101
+ │ │ └── index.ts # 组件入口
102
+ │ └── theme/ # 主题样式
103
+ │ └── src/ # 样式源码 (Less)
104
+ ├── examples/ # 组件预览
105
+ │ ├── App.vue # 预览应用
106
+ │ └── main.ts # 入口文件
107
+ ├── docs/ # 文档
108
+ │ ├── .vitepress/ # VitePress 配置
109
+ │ ├── guide/ # 指南
110
+ │ └── components/ # 组件文档
111
+ ├── __tests__/ # 测试文件
112
+ ├── vite.config.ts # Vite 配置
113
+ ├── vitest.config.ts # Vitest 配置
114
+ └── package.json # 项目配置
115
+ ```
116
+
117
+ ## 🤝 贡献
118
+
119
+ 欢迎提交 Issue 和 Pull Request!
120
+
121
+ ## 📄 版权声明
122
+
123
+ Copyright © 2024 苏州极简搭信息技术有限公司. All rights reserved.
124
+
125
+ 本软件及其相关文档为专有软件,受版权法保护。未经版权所有者明确书面许可,不得以任何形式或方式(电子、机械、复印、录制或其他方式)复制、分发、传播或使用本软件的任何部分。
126
+
127
+ ## 🙏 致谢
128
+
129
+ 感谢所有为这个项目做出贡献的开发者!
@@ -1,95 +1,130 @@
1
1
  declare const JButton: {
2
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
2
+ new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
3
3
  type: {
4
- type: import('vue').PropType<"primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text">;
4
+ type: import("vue").PropType<"default" | "primary" | "success" | "warning" | "danger" | "info" | "dashed" | "link" | "text">;
5
5
  default: string;
6
6
  };
7
7
  size: {
8
- type: import('vue').PropType<"default" | "large" | "small">;
8
+ type: import("vue").PropType<"default" | "large" | "small">;
9
9
  default: string;
10
10
  };
11
11
  disabled: {
12
- type: import('vue').PropType<boolean>;
12
+ type: import("vue").PropType<boolean>;
13
13
  default: boolean;
14
14
  };
15
15
  loading: {
16
- type: import('vue').PropType<boolean>;
16
+ type: import("vue").PropType<boolean>;
17
17
  default: boolean;
18
18
  };
19
19
  ghost: {
20
- type: import('vue').PropType<boolean>;
20
+ type: import("vue").PropType<boolean>;
21
21
  default: boolean;
22
22
  };
23
23
  round: {
24
- type: import('vue').PropType<boolean>;
24
+ type: import("vue").PropType<boolean>;
25
25
  default: boolean;
26
26
  };
27
27
  circle: {
28
- type: import('vue').PropType<boolean>;
28
+ type: import("vue").PropType<boolean>;
29
29
  default: boolean;
30
30
  };
31
31
  block: {
32
- type: import('vue').PropType<boolean>;
32
+ type: import("vue").PropType<boolean>;
33
33
  default: boolean;
34
34
  };
35
- }>> & Readonly<{
35
+ }>> & {
36
36
  onClick?: ((evt: MouseEvent) => any) | undefined;
37
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
37
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
38
38
  click: (evt: MouseEvent) => void;
39
- }, import('vue').PublicProps, {
40
- type: "primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text";
41
- size: "large" | "default" | "small";
39
+ }, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
40
+ type: {
41
+ type: import("vue").PropType<"default" | "primary" | "success" | "warning" | "danger" | "info" | "dashed" | "link" | "text">;
42
+ default: string;
43
+ };
44
+ size: {
45
+ type: import("vue").PropType<"default" | "large" | "small">;
46
+ default: string;
47
+ };
48
+ disabled: {
49
+ type: import("vue").PropType<boolean>;
50
+ default: boolean;
51
+ };
52
+ loading: {
53
+ type: import("vue").PropType<boolean>;
54
+ default: boolean;
55
+ };
56
+ ghost: {
57
+ type: import("vue").PropType<boolean>;
58
+ default: boolean;
59
+ };
60
+ round: {
61
+ type: import("vue").PropType<boolean>;
62
+ default: boolean;
63
+ };
64
+ circle: {
65
+ type: import("vue").PropType<boolean>;
66
+ default: boolean;
67
+ };
68
+ block: {
69
+ type: import("vue").PropType<boolean>;
70
+ default: boolean;
71
+ };
72
+ }>> & {
73
+ onClick?: ((evt: MouseEvent) => any) | undefined;
74
+ }, {
75
+ type: "default" | "primary" | "success" | "warning" | "danger" | "info" | "dashed" | "link" | "text";
76
+ size: "default" | "large" | "small";
42
77
  disabled: boolean;
43
78
  loading: boolean;
44
79
  ghost: boolean;
45
80
  round: boolean;
46
81
  circle: boolean;
47
82
  block: boolean;
48
- }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
83
+ }, true, {}, {}, {
49
84
  P: {};
50
85
  B: {};
51
86
  D: {};
52
87
  C: {};
53
88
  M: {};
54
89
  Defaults: {};
55
- }, Readonly<import('vue').ExtractPropTypes<{
90
+ }, Readonly<import("vue").ExtractPropTypes<{
56
91
  type: {
57
- type: import('vue').PropType<"primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text">;
92
+ type: import("vue").PropType<"default" | "primary" | "success" | "warning" | "danger" | "info" | "dashed" | "link" | "text">;
58
93
  default: string;
59
94
  };
60
95
  size: {
61
- type: import('vue').PropType<"default" | "large" | "small">;
96
+ type: import("vue").PropType<"default" | "large" | "small">;
62
97
  default: string;
63
98
  };
64
99
  disabled: {
65
- type: import('vue').PropType<boolean>;
100
+ type: import("vue").PropType<boolean>;
66
101
  default: boolean;
67
102
  };
68
103
  loading: {
69
- type: import('vue').PropType<boolean>;
104
+ type: import("vue").PropType<boolean>;
70
105
  default: boolean;
71
106
  };
72
107
  ghost: {
73
- type: import('vue').PropType<boolean>;
108
+ type: import("vue").PropType<boolean>;
74
109
  default: boolean;
75
110
  };
76
111
  round: {
77
- type: import('vue').PropType<boolean>;
112
+ type: import("vue").PropType<boolean>;
78
113
  default: boolean;
79
114
  };
80
115
  circle: {
81
- type: import('vue').PropType<boolean>;
116
+ type: import("vue").PropType<boolean>;
82
117
  default: boolean;
83
118
  };
84
119
  block: {
85
- type: import('vue').PropType<boolean>;
120
+ type: import("vue").PropType<boolean>;
86
121
  default: boolean;
87
122
  };
88
- }>> & Readonly<{
123
+ }>> & {
89
124
  onClick?: ((evt: MouseEvent) => any) | undefined;
90
- }>, {}, {}, {}, {}, {
91
- type: "primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text";
92
- size: "large" | "default" | "small";
125
+ }, {}, {}, {}, {}, {
126
+ type: "default" | "primary" | "success" | "warning" | "danger" | "info" | "dashed" | "link" | "text";
127
+ size: "default" | "large" | "small";
93
128
  disabled: boolean;
94
129
  loading: boolean;
95
130
  ghost: boolean;
@@ -97,61 +132,61 @@ declare const JButton: {
97
132
  circle: boolean;
98
133
  block: boolean;
99
134
  }>;
100
- __isFragment?: never;
101
- __isTeleport?: never;
102
- __isSuspense?: never;
103
- } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
135
+ __isFragment?: undefined;
136
+ __isTeleport?: undefined;
137
+ __isSuspense?: undefined;
138
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
104
139
  type: {
105
- type: import('vue').PropType<"primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text">;
140
+ type: import("vue").PropType<"default" | "primary" | "success" | "warning" | "danger" | "info" | "dashed" | "link" | "text">;
106
141
  default: string;
107
142
  };
108
143
  size: {
109
- type: import('vue').PropType<"default" | "large" | "small">;
144
+ type: import("vue").PropType<"default" | "large" | "small">;
110
145
  default: string;
111
146
  };
112
147
  disabled: {
113
- type: import('vue').PropType<boolean>;
148
+ type: import("vue").PropType<boolean>;
114
149
  default: boolean;
115
150
  };
116
151
  loading: {
117
- type: import('vue').PropType<boolean>;
152
+ type: import("vue").PropType<boolean>;
118
153
  default: boolean;
119
154
  };
120
155
  ghost: {
121
- type: import('vue').PropType<boolean>;
156
+ type: import("vue").PropType<boolean>;
122
157
  default: boolean;
123
158
  };
124
159
  round: {
125
- type: import('vue').PropType<boolean>;
160
+ type: import("vue").PropType<boolean>;
126
161
  default: boolean;
127
162
  };
128
163
  circle: {
129
- type: import('vue').PropType<boolean>;
164
+ type: import("vue").PropType<boolean>;
130
165
  default: boolean;
131
166
  };
132
167
  block: {
133
- type: import('vue').PropType<boolean>;
168
+ type: import("vue").PropType<boolean>;
134
169
  default: boolean;
135
170
  };
136
- }>> & Readonly<{
171
+ }>> & {
137
172
  onClick?: ((evt: MouseEvent) => any) | undefined;
138
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
173
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
139
174
  click: (evt: MouseEvent) => void;
140
175
  }, string, {
141
- type: "primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text";
142
- size: "large" | "default" | "small";
176
+ type: "default" | "primary" | "success" | "warning" | "danger" | "info" | "dashed" | "link" | "text";
177
+ size: "default" | "large" | "small";
143
178
  disabled: boolean;
144
179
  loading: boolean;
145
180
  ghost: boolean;
146
181
  round: boolean;
147
182
  circle: boolean;
148
183
  block: boolean;
149
- }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
184
+ }, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
150
185
  $slots: {
151
186
  icon?(_: {}): any;
152
187
  default?(_: {}): any;
153
188
  };
154
189
  }) & {
155
- install: (app: import('vue').App) => void;
190
+ install: (app: import("vue").App<any>) => void;
156
191
  };
157
192
  export default JButton;
@@ -16,11 +16,7 @@ export interface ButtonProps {
16
16
  /** 是否通栏 */
17
17
  block?: boolean;
18
18
  }
19
- declare function __VLS_template(): {
20
- icon?(_: {}): any;
21
- default?(_: {}): any;
22
- };
23
- declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ButtonProps>, {
19
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ButtonProps>, {
24
20
  type: string;
25
21
  size: string;
26
22
  disabled: boolean;
@@ -29,9 +25,9 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
29
25
  round: boolean;
30
26
  circle: boolean;
31
27
  block: boolean;
32
- }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
28
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
29
  click: (evt: MouseEvent) => void;
34
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ButtonProps>, {
30
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ButtonProps>, {
35
31
  type: string;
36
32
  size: string;
37
33
  disabled: boolean;
@@ -40,19 +36,21 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
40
36
  round: boolean;
41
37
  circle: boolean;
42
38
  block: boolean;
43
- }>>> & Readonly<{
39
+ }>>> & {
44
40
  onClick?: ((evt: MouseEvent) => any) | undefined;
45
- }>, {
46
- type: "primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text";
47
- size: "large" | "default" | "small";
41
+ }, {
42
+ type: "default" | "primary" | "success" | "warning" | "danger" | "info" | "dashed" | "link" | "text";
43
+ size: "default" | "large" | "small";
48
44
  disabled: boolean;
49
45
  loading: boolean;
50
46
  ghost: boolean;
51
47
  round: boolean;
52
48
  circle: boolean;
53
49
  block: boolean;
54
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
55
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
50
+ }, {}>, {
51
+ icon?(_: {}): any;
52
+ default?(_: {}): any;
53
+ }>;
56
54
  export default _default;
57
55
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
58
56
  type __VLS_TypePropsToRuntimeProps<T> = {
package/dist/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { App } from 'vue';
2
- import { default as JButton } from './button';
3
- import { default as JInput } from './input';
4
-
1
+ import type { App } from 'vue';
2
+ import JButton from './button';
3
+ import JInput from './input';
5
4
  export { JButton, JInput };
6
5
  declare const _default: {
7
- install: (app: App) => void;
6
+ install: (app: App<any>) => void;
8
7
  };
9
8
  export default _default;
@@ -1,137 +1,167 @@
1
1
  declare const JInput: {
2
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
2
+ new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
3
3
  type: {
4
- type: import('vue').PropType<string>;
4
+ type: import("vue").PropType<string>;
5
5
  default: string;
6
6
  };
7
7
  size: {
8
- type: import('vue').PropType<"default" | "large" | "small">;
8
+ type: import("vue").PropType<"default" | "large" | "small">;
9
9
  default: string;
10
10
  };
11
11
  disabled: {
12
- type: import('vue').PropType<boolean>;
12
+ type: import("vue").PropType<boolean>;
13
13
  default: boolean;
14
14
  };
15
15
  modelValue: {
16
- type: import('vue').PropType<string | number>;
16
+ type: import("vue").PropType<string | number>;
17
17
  default: string;
18
18
  };
19
19
  placeholder: {
20
- type: import('vue').PropType<string>;
20
+ type: import("vue").PropType<string>;
21
21
  default: string;
22
22
  };
23
23
  readonly: {
24
- type: import('vue').PropType<boolean>;
24
+ type: import("vue").PropType<boolean>;
25
25
  default: boolean;
26
26
  };
27
- }>> & Readonly<{
28
- onInput?: ((value: string) => any) | undefined;
29
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
27
+ }>> & {
30
28
  onFocus?: ((evt: FocusEvent) => any) | undefined;
31
29
  onBlur?: ((evt: FocusEvent) => any) | undefined;
32
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
30
+ onInput?: ((value: string) => any) | undefined;
31
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
32
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
33
  input: (value: string) => void;
34
34
  "update:modelValue": (value: string) => void;
35
35
  focus: (evt: FocusEvent) => void;
36
36
  blur: (evt: FocusEvent) => void;
37
- }, import('vue').PublicProps, {
37
+ }, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
38
+ type: {
39
+ type: import("vue").PropType<string>;
40
+ default: string;
41
+ };
42
+ size: {
43
+ type: import("vue").PropType<"default" | "large" | "small">;
44
+ default: string;
45
+ };
46
+ disabled: {
47
+ type: import("vue").PropType<boolean>;
48
+ default: boolean;
49
+ };
50
+ modelValue: {
51
+ type: import("vue").PropType<string | number>;
52
+ default: string;
53
+ };
54
+ placeholder: {
55
+ type: import("vue").PropType<string>;
56
+ default: string;
57
+ };
58
+ readonly: {
59
+ type: import("vue").PropType<boolean>;
60
+ default: boolean;
61
+ };
62
+ }>> & {
63
+ onFocus?: ((evt: FocusEvent) => any) | undefined;
64
+ onBlur?: ((evt: FocusEvent) => any) | undefined;
65
+ onInput?: ((value: string) => any) | undefined;
66
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
67
+ }, {
38
68
  type: string;
39
- size: "large" | "default" | "small";
69
+ size: "default" | "large" | "small";
40
70
  disabled: boolean;
41
71
  modelValue: string | number;
42
72
  placeholder: string;
43
73
  readonly: boolean;
44
- }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
74
+ }, true, {}, {}, {
45
75
  P: {};
46
76
  B: {};
47
77
  D: {};
48
78
  C: {};
49
79
  M: {};
50
80
  Defaults: {};
51
- }, Readonly<import('vue').ExtractPropTypes<{
81
+ }, Readonly<import("vue").ExtractPropTypes<{
52
82
  type: {
53
- type: import('vue').PropType<string>;
83
+ type: import("vue").PropType<string>;
54
84
  default: string;
55
85
  };
56
86
  size: {
57
- type: import('vue').PropType<"default" | "large" | "small">;
87
+ type: import("vue").PropType<"default" | "large" | "small">;
58
88
  default: string;
59
89
  };
60
90
  disabled: {
61
- type: import('vue').PropType<boolean>;
91
+ type: import("vue").PropType<boolean>;
62
92
  default: boolean;
63
93
  };
64
94
  modelValue: {
65
- type: import('vue').PropType<string | number>;
95
+ type: import("vue").PropType<string | number>;
66
96
  default: string;
67
97
  };
68
98
  placeholder: {
69
- type: import('vue').PropType<string>;
99
+ type: import("vue").PropType<string>;
70
100
  default: string;
71
101
  };
72
102
  readonly: {
73
- type: import('vue').PropType<boolean>;
103
+ type: import("vue").PropType<boolean>;
74
104
  default: boolean;
75
105
  };
76
- }>> & Readonly<{
77
- onInput?: ((value: string) => any) | undefined;
78
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
106
+ }>> & {
79
107
  onFocus?: ((evt: FocusEvent) => any) | undefined;
80
108
  onBlur?: ((evt: FocusEvent) => any) | undefined;
81
- }>, {}, {}, {}, {}, {
109
+ onInput?: ((value: string) => any) | undefined;
110
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
111
+ }, {}, {}, {}, {}, {
82
112
  type: string;
83
- size: "large" | "default" | "small";
113
+ size: "default" | "large" | "small";
84
114
  disabled: boolean;
85
115
  modelValue: string | number;
86
116
  placeholder: string;
87
117
  readonly: boolean;
88
118
  }>;
89
- __isFragment?: never;
90
- __isTeleport?: never;
91
- __isSuspense?: never;
92
- } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
119
+ __isFragment?: undefined;
120
+ __isTeleport?: undefined;
121
+ __isSuspense?: undefined;
122
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
93
123
  type: {
94
- type: import('vue').PropType<string>;
124
+ type: import("vue").PropType<string>;
95
125
  default: string;
96
126
  };
97
127
  size: {
98
- type: import('vue').PropType<"default" | "large" | "small">;
128
+ type: import("vue").PropType<"default" | "large" | "small">;
99
129
  default: string;
100
130
  };
101
131
  disabled: {
102
- type: import('vue').PropType<boolean>;
132
+ type: import("vue").PropType<boolean>;
103
133
  default: boolean;
104
134
  };
105
135
  modelValue: {
106
- type: import('vue').PropType<string | number>;
136
+ type: import("vue").PropType<string | number>;
107
137
  default: string;
108
138
  };
109
139
  placeholder: {
110
- type: import('vue').PropType<string>;
140
+ type: import("vue").PropType<string>;
111
141
  default: string;
112
142
  };
113
143
  readonly: {
114
- type: import('vue').PropType<boolean>;
144
+ type: import("vue").PropType<boolean>;
115
145
  default: boolean;
116
146
  };
117
- }>> & Readonly<{
118
- onInput?: ((value: string) => any) | undefined;
119
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
147
+ }>> & {
120
148
  onFocus?: ((evt: FocusEvent) => any) | undefined;
121
149
  onBlur?: ((evt: FocusEvent) => any) | undefined;
122
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
150
+ onInput?: ((value: string) => any) | undefined;
151
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
152
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
123
153
  input: (value: string) => void;
124
154
  "update:modelValue": (value: string) => void;
125
155
  focus: (evt: FocusEvent) => void;
126
156
  blur: (evt: FocusEvent) => void;
127
157
  }, string, {
128
158
  type: string;
129
- size: "large" | "default" | "small";
159
+ size: "default" | "large" | "small";
130
160
  disabled: boolean;
131
161
  modelValue: string | number;
132
162
  placeholder: string;
133
163
  readonly: boolean;
134
- }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
135
- install: (app: import('vue').App) => void;
164
+ }, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
165
+ install: (app: import("vue").App<any>) => void;
136
166
  };
137
167
  export default JInput;
@@ -12,38 +12,38 @@ export interface InputProps {
12
12
  /** 输入框尺寸 */
13
13
  size?: 'large' | 'default' | 'small';
14
14
  }
15
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputProps>, {
15
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputProps>, {
16
16
  type: string;
17
17
  placeholder: string;
18
18
  disabled: boolean;
19
19
  readonly: boolean;
20
20
  size: string;
21
21
  modelValue: string;
22
- }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
22
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
23
  input: (value: string) => void;
24
24
  "update:modelValue": (value: string) => void;
25
25
  focus: (evt: FocusEvent) => void;
26
26
  blur: (evt: FocusEvent) => void;
27
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputProps>, {
27
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputProps>, {
28
28
  type: string;
29
29
  placeholder: string;
30
30
  disabled: boolean;
31
31
  readonly: boolean;
32
32
  size: string;
33
33
  modelValue: string;
34
- }>>> & Readonly<{
35
- onInput?: ((value: string) => any) | undefined;
36
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
34
+ }>>> & {
37
35
  onFocus?: ((evt: FocusEvent) => any) | undefined;
38
36
  onBlur?: ((evt: FocusEvent) => any) | undefined;
39
- }>, {
37
+ onInput?: ((value: string) => any) | undefined;
38
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
39
+ }, {
40
40
  type: string;
41
- size: "large" | "default" | "small";
41
+ size: "default" | "large" | "small";
42
42
  disabled: boolean;
43
43
  modelValue: string | number;
44
44
  placeholder: string;
45
45
  readonly: boolean;
46
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
46
+ }, {}>;
47
47
  export default _default;
48
48
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
49
49
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1,7 +1,7 @@
1
- import { defineComponent as m, computed as y, createElementBlock as d, openBlock as u, normalizeClass as h, createCommentVNode as f, renderSlot as p, ref as b, createElementVNode as v } from "vue";
2
- const B = (e) => (e.install = (l) => {
3
- l.component(e.name, e);
4
- }, e), j = ["disabled"], _ = {
1
+ import { defineComponent as m, computed as y, createElementBlock as d, openBlock as u, normalizeClass as h, createCommentVNode as p, renderSlot as f, ref as b, createElementVNode as g } from "vue";
2
+ const _ = (l) => (l.install = (a) => {
3
+ a.component(l.name, l);
4
+ }, l), v = ["disabled"], j = {
5
5
  key: 0,
6
6
  class: "j-button__loading-icon"
7
7
  }, $ = {
@@ -21,35 +21,35 @@ const B = (e) => (e.install = (l) => {
21
21
  block: { type: Boolean, default: !1 }
22
22
  },
23
23
  emits: ["click"],
24
- setup(e, { emit: l }) {
25
- const t = e, n = l, i = y(() => [
24
+ setup(l, { emit: a }) {
25
+ const e = l, n = a, i = y(() => [
26
26
  "j-button",
27
- `j-button--${t.type}`,
28
- `j-button--${t.size}`,
27
+ `j-button--${e.type}`,
28
+ `j-button--${e.size}`,
29
29
  {
30
- "is-disabled": t.disabled,
31
- "is-loading": t.loading,
32
- "is-ghost": t.ghost,
33
- "is-round": t.round,
34
- "is-circle": t.circle,
35
- "is-block": t.block
30
+ "is-disabled": e.disabled,
31
+ "is-loading": e.loading,
32
+ "is-ghost": e.ghost,
33
+ "is-round": e.round,
34
+ "is-circle": e.circle,
35
+ "is-block": e.block
36
36
  }
37
- ]), s = (a) => {
38
- t.disabled || t.loading || n("click", a);
37
+ ]), s = (o) => {
38
+ e.disabled || e.loading || n("click", o);
39
39
  };
40
- return (a, r) => (u(), d("button", {
40
+ return (o, r) => (u(), d("button", {
41
41
  class: h(i.value),
42
- disabled: e.disabled || e.loading,
42
+ disabled: o.disabled || o.loading,
43
43
  onClick: s
44
44
  }, [
45
- e.loading ? (u(), d("span", _)) : f("", !0),
46
- p(a.$slots, "icon"),
47
- a.$slots.default ? (u(), d("span", $, [
48
- p(a.$slots, "default")
49
- ])) : f("", !0)
50
- ], 10, j));
45
+ o.loading ? (u(), d("span", j)) : p("", !0),
46
+ f(o.$slots, "icon"),
47
+ o.$slots.default ? (u(), d("span", $, [
48
+ f(o.$slots, "default")
49
+ ])) : p("", !0)
50
+ ], 10, v));
51
51
  }
52
- }), V = B(C), z = ["type", "placeholder", "disabled", "readonly", "value"], I = /* @__PURE__ */ m({
52
+ }), V = _(C), z = ["type", "placeholder", "disabled", "readonly", "value"], I = /* @__PURE__ */ m({
53
53
  name: "JInput",
54
54
  __name: "input",
55
55
  props: {
@@ -61,49 +61,49 @@ const B = (e) => (e.install = (l) => {
61
61
  size: { default: "default" }
62
62
  },
63
63
  emits: ["update:modelValue", "input", "focus", "blur"],
64
- setup(e, { emit: l }) {
65
- const t = e, n = l, i = b(), s = b(!1), a = y(() => [
64
+ setup(l, { emit: a }) {
65
+ const e = l, n = a, i = b(), s = b(!1), o = y(() => [
66
66
  "j-input",
67
- `j-input--${t.size}`,
67
+ `j-input--${e.size}`,
68
68
  {
69
- "is-disabled": t.disabled,
69
+ "is-disabled": e.disabled,
70
70
  "is-focused": s.value
71
71
  }
72
- ]), r = (o) => {
73
- const c = o.target.value;
72
+ ]), r = (t) => {
73
+ const c = t.target.value;
74
74
  n("update:modelValue", c), n("input", c);
75
- }, k = (o) => {
76
- s.value = !0, n("focus", o);
77
- }, g = (o) => {
78
- s.value = !1, n("blur", o);
75
+ }, B = (t) => {
76
+ s.value = !0, n("focus", t);
77
+ }, k = (t) => {
78
+ s.value = !1, n("blur", t);
79
79
  };
80
- return (o, c) => (u(), d("div", {
81
- class: h(a.value)
80
+ return (t, c) => (u(), d("div", {
81
+ class: h(o.value)
82
82
  }, [
83
- v("input", {
83
+ g("input", {
84
84
  ref_key: "inputRef",
85
85
  ref: i,
86
- type: e.type,
87
- placeholder: e.placeholder,
88
- disabled: e.disabled,
89
- readonly: e.readonly,
90
- value: e.modelValue,
86
+ type: t.type,
87
+ placeholder: t.placeholder,
88
+ disabled: t.disabled,
89
+ readonly: t.readonly,
90
+ value: t.modelValue,
91
91
  class: "j-input__inner",
92
92
  onInput: r,
93
- onFocus: k,
94
- onBlur: g
93
+ onFocus: B,
94
+ onBlur: k
95
95
  }, null, 40, z)
96
96
  ], 2));
97
97
  }
98
- }), J = B(I), E = [V, J], F = (e) => {
99
- E.forEach((l) => {
100
- e.component(l.name, l);
98
+ }), J = _(I), E = [V, J], F = (l) => {
99
+ E.forEach((a) => {
100
+ l.component(a.name, a);
101
101
  });
102
- }, N = {
102
+ }, R = {
103
103
  install: F
104
104
  };
105
105
  export {
106
106
  V as JButton,
107
107
  J as JInput,
108
- N as default
108
+ R as default
109
109
  };
@@ -1 +1 @@
1
- (function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.SimCodeUI={},n.Vue))})(this,function(n,e){"use strict";const f=t=>(t.install=o=>{o.component(t.name,t)},t),b=["disabled"],y={key:0,class:"j-button__loading-icon"},h={key:1,class:"j-button__content"},r=f(e.defineComponent({name:"JButton",__name:"button",props:{type:{default:"default"},size:{default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},round:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){const l=t,s=o,c=e.computed(()=>["j-button",`j-button--${l.type}`,`j-button--${l.size}`,{"is-disabled":l.disabled,"is-loading":l.loading,"is-ghost":l.ghost,"is-round":l.round,"is-circle":l.circle,"is-block":l.block}]),i=a=>{l.disabled||l.loading||s("click",a)};return(a,m)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(c.value),disabled:t.disabled||t.loading,onClick:i},[t.loading?(e.openBlock(),e.createElementBlock("span",y)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"icon"),a.$slots.default?(e.openBlock(),e.createElementBlock("span",h,[e.renderSlot(a.$slots,"default")])):e.createCommentVNode("",!0)],10,b))}})),B=["type","placeholder","disabled","readonly","value"],p=f(e.defineComponent({name:"JInput",__name:"input",props:{modelValue:{default:""},type:{default:"text"},placeholder:{default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"}},emits:["update:modelValue","input","focus","blur"],setup(t,{emit:o}){const l=t,s=o,c=e.ref(),i=e.ref(!1),a=e.computed(()=>["j-input",`j-input--${l.size}`,{"is-disabled":l.disabled,"is-focused":i.value}]),m=d=>{const u=d.target.value;s("update:modelValue",u),s("input",u)},g=d=>{i.value=!0,s("focus",d)},C=d=>{i.value=!1,s("blur",d)};return(d,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("input",{ref_key:"inputRef",ref:c,type:t.type,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,value:t.modelValue,class:"j-input__inner",onInput:m,onFocus:g,onBlur:C},null,40,B)],2))}})),k=[r,p],_={install:t=>{k.forEach(o=>{t.component(o.name,o)})}};n.JButton=r,n.JInput=p,n.default=_,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.SimCodeUI={},s.Vue))})(this,function(s,e){"use strict";const r=n=>(n.install=a=>{a.component(n.name,n)},n),b=["disabled"],y={key:0,class:"j-button__loading-icon"},h={key:1,class:"j-button__content"},f=r(e.defineComponent({name:"JButton",__name:"button",props:{type:{default:"default"},size:{default:"default"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},round:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},block:{type:Boolean,default:!1}},emits:["click"],setup(n,{emit:a}){const t=n,d=a,u=e.computed(()=>["j-button",`j-button--${t.type}`,`j-button--${t.size}`,{"is-disabled":t.disabled,"is-loading":t.loading,"is-ghost":t.ghost,"is-round":t.round,"is-circle":t.circle,"is-block":t.block}]),i=o=>{t.disabled||t.loading||d("click",o)};return(o,m)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(u.value),disabled:o.disabled||o.loading,onClick:i},[o.loading?(e.openBlock(),e.createElementBlock("span",y)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"icon"),o.$slots.default?(e.openBlock(),e.createElementBlock("span",h,[e.renderSlot(o.$slots,"default")])):e.createCommentVNode("",!0)],10,b))}})),_=["type","placeholder","disabled","readonly","value"],p=r(e.defineComponent({name:"JInput",__name:"input",props:{modelValue:{default:""},type:{default:"text"},placeholder:{default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"default"}},emits:["update:modelValue","input","focus","blur"],setup(n,{emit:a}){const t=n,d=a,u=e.ref(),i=e.ref(!1),o=e.computed(()=>["j-input",`j-input--${t.size}`,{"is-disabled":t.disabled,"is-focused":i.value}]),m=l=>{const c=l.target.value;d("update:modelValue",c),d("input",c)},g=l=>{i.value=!0,d("focus",l)},C=l=>{i.value=!1,d("blur",l)};return(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(o.value)},[e.createElementVNode("input",{ref_key:"inputRef",ref:u,type:l.type,placeholder:l.placeholder,disabled:l.disabled,readonly:l.readonly,value:l.modelValue,class:"j-input__inner",onInput:m,onFocus:g,onBlur:C},null,40,_)],2))}})),B=[f,p],k={install:n=>{B.forEach(a=>{n.component(a.name,a)})}};s.JButton=f,s.JInput=p,s.default=k,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ :root{--j-color-primary: #409eff;--j-color-success: #67c23a;--j-color-warning: #e6a23c;--j-color-danger: #f56c6c;--j-color-info: #909399;--j-text-color-primary: #303133;--j-text-color-regular: #606266;--j-text-color-secondary: #909399;--j-text-color-placeholder: #c0c4cc;--j-border-color-base: #dcdfe6;--j-border-color-light: #e4e7ed;--j-border-color-lighter: #ebeef5;--j-border-color-extra-light: #f2f6fc;--j-bg-color: #ffffff;--j-bg-color-page: #f2f3f5;--j-bg-color-overlay: #ffffff;--j-border-radius-base: 4px;--j-border-radius-small: 2px;--j-border-radius-round: 20px;--j-border-radius-circle: 100%;--j-font-size-small: 13px;--j-font-size-extra-small: 12px;--j-box-shadow-base: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);--j-box-shadow-light: 0 2px 12px 0 rgba(0, 0, 0, .1)}.j-button{display:inline-flex;align-items:center;justify-content:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:var(--j-text-color-regular);text-align:center;box-sizing:border-box;outline:none;transition:.2s cubic-bezier(.645,.045,.355,1);font-weight:500;-webkit-user-select:none;user-select:none;vertical-align:middle;padding:8px 15px;font-size:var(--j-font-size-base, 14px);border-radius:var(--j-border-radius-base);border:1px solid var(--j-border-color-base);background-color:var(--j-bg-color);gap:8px}.j-button:hover,.j-button:focus{color:var(--j-color-primary);border-color:var(--j-color-primary);background-color:#ecf5ff}.j-button:active{opacity:.8}.j-button--primary{color:#fff;background-color:var(--j-color-primary);border-color:var(--j-color-primary)}.j-button--primary:hover,.j-button--primary:focus{background-color:#66b1ff;border-color:#66b1ff;color:#fff}.j-button--success{color:#fff;background-color:var(--j-color-success);border-color:var(--j-color-success)}.j-button--success:hover,.j-button--success:focus{background-color:#85ce61;border-color:#85ce61;color:#fff}.j-button--warning{color:#fff;background-color:var(--j-color-warning);border-color:var(--j-color-warning)}.j-button--warning:hover,.j-button--warning:focus{background-color:#ebb563;border-color:#ebb563;color:#fff}.j-button--danger{color:#fff;background-color:var(--j-color-danger);border-color:var(--j-color-danger)}.j-button--danger:hover,.j-button--danger:focus{background-color:#f78989;border-color:#f78989;color:#fff}.j-button--info{color:#fff;background-color:var(--j-color-info);border-color:var(--j-color-info)}.j-button--info:hover,.j-button--info:focus{background-color:#a6a9ad;border-color:#a6a9ad;color:#fff}.j-button--dashed{border-style:dashed}.j-button--link{border-color:transparent;background-color:transparent;color:var(--j-color-primary);padding-left:0;padding-right:0}.j-button--link:hover,.j-button--link:focus{background-color:transparent;color:#66b1ff}.j-button--text{border-color:transparent;background-color:transparent;color:var(--j-text-color-regular)}.j-button--text:hover,.j-button--text:focus{background-color:var(--j-bg-color-page)}.j-button--large{height:40px;padding:12px 19px;font-size:16px}.j-button--small{height:24px;padding:5px 11px;font-size:12px}.j-button.is-disabled{cursor:not-allowed;background-image:none;background-color:var(--j-bg-color-page);border-color:var(--j-border-color-light);color:var(--j-text-color-placeholder)}.j-button.is-disabled:hover,.j-button.is-disabled:focus{background-color:var(--j-bg-color-page);border-color:var(--j-border-color-light);color:var(--j-text-color-placeholder)}.j-button.is-loading{position:relative;pointer-events:none}.j-button.is-loading:before{pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:#ffffff59}.j-button.is-ghost{background-color:transparent;color:#fff}.j-button.is-ghost.j-button--default{color:var(--j-text-color-regular)}.j-button.is-ghost.j-button--default:hover,.j-button.is-ghost.j-button--primary{color:var(--j-color-primary)}.j-button.is-ghost.j-button--primary:hover{background-color:#409eff1a}.j-button.is-round{border-radius:var(--j-border-radius-round)}.j-button.is-circle{border-radius:var(--j-border-radius-circle);padding:8px;width:32px;min-width:32px}.j-button.is-circle.j-button--large{width:40px;min-width:40px}.j-button.is-circle.j-button--small{width:24px;min-width:24px}.j-button.is-block{display:flex;width:100%}.j-button__loading-icon{width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:j-rotate 1s linear infinite;margin-right:8px}.j-button__content{display:inline-flex;align-items:center}@keyframes j-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.j-input{position:relative;font-size:var(--j-font-size-base);display:inline-flex;width:100%;line-height:32px}.j-input__inner{width:100%;flex-grow:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;color:var(--j-text-color-regular);font-size:inherit;height:32px;line-height:32px;padding:0 11px;outline:none;border:1px solid var(--j-border-color-base);border-radius:var(--j-border-radius-base);transition:border-color .2s cubic-bezier(.645,.045,.355,1);background-color:var(--j-bg-color)}.j-input__inner::placeholder{color:var(--j-text-color-placeholder)}.j-input__inner:hover{border-color:var(--j-border-color-light)}.j-input__inner:focus{border-color:var(--j-color-primary)}.j-input--large{font-size:var(--j-font-size-medium);line-height:40px}.j-input--large .j-input__inner{height:40px;line-height:40px}.j-input--small{font-size:12px;line-height:24px}.j-input--small .j-input__inner{height:24px;line-height:24px}.j-input.is-disabled .j-input__inner{background-color:var(--j-bg-color-page);border-color:var(--j-border-color-light);color:var(--j-text-color-placeholder);cursor:not-allowed}.j-input.is-focused .j-input__inner{border-color:var(--j-color-primary)}*{box-sizing:border-box;margin:0;padding:0}
@@ -1,5 +1,4 @@
1
- import { App, Component } from 'vue';
2
-
1
+ import type { App, Component } from 'vue';
3
2
  export declare const withInstall: <T extends Component>(component: T) => T & {
4
3
  install: (app: App) => void;
5
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a2simcode/ui",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "A Vue 3 UI Component Library",
5
5
  "type": "module",
6
6
  "main": "./dist/simcode-ui.umd.js",
@@ -17,18 +17,6 @@
17
17
  "files": [
18
18
  "dist"
19
19
  ],
20
- "scripts": {
21
- "dev": "vite",
22
- "build": "vite build",
23
- "test": "vitest",
24
- "test:ui": "vitest --ui",
25
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
26
- "format": "prettier --write .",
27
- "gen:docs": "tsx scripts/gen-api-docs.ts",
28
- "docs:dev": "pnpm gen:docs && vitepress dev docs",
29
- "docs:build": "pnpm gen:docs && vitepress build docs",
30
- "docs:preview": "vitepress preview docs"
31
- },
32
20
  "keywords": [
33
21
  "vue",
34
22
  "vue3",
@@ -65,5 +53,17 @@
65
53
  "vue-docgen-api": "^4.79.2",
66
54
  "vue-tsc": "^1.8.27"
67
55
  },
68
- "packageManager": "pnpm@8.0.0"
69
- }
56
+ "packageManager": "pnpm@8.0.0",
57
+ "scripts": {
58
+ "dev": "vite",
59
+ "build": "vite build",
60
+ "test": "vitest",
61
+ "test:ui": "vitest --ui",
62
+ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
63
+ "format": "prettier --write .",
64
+ "gen:docs": "tsx scripts/gen-api-docs.ts",
65
+ "docs:dev": "pnpm gen:docs && vitepress dev docs",
66
+ "docs:build": "pnpm gen:docs && vitepress build docs",
67
+ "docs:preview": "vitepress preview docs"
68
+ }
69
+ }