@a2simcode/ui 0.0.1

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 ADDED
@@ -0,0 +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.
package/README.md ADDED
@@ -0,0 +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
+ 感谢所有为这个项目做出贡献的开发者!
@@ -0,0 +1,157 @@
1
+ declare const JButton: {
2
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
3
+ type: {
4
+ type: import('vue').PropType<"primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text">;
5
+ default: string;
6
+ };
7
+ size: {
8
+ type: import('vue').PropType<"default" | "large" | "small">;
9
+ default: string;
10
+ };
11
+ disabled: {
12
+ type: import('vue').PropType<boolean>;
13
+ default: boolean;
14
+ };
15
+ loading: {
16
+ type: import('vue').PropType<boolean>;
17
+ default: boolean;
18
+ };
19
+ ghost: {
20
+ type: import('vue').PropType<boolean>;
21
+ default: boolean;
22
+ };
23
+ round: {
24
+ type: import('vue').PropType<boolean>;
25
+ default: boolean;
26
+ };
27
+ circle: {
28
+ type: import('vue').PropType<boolean>;
29
+ default: boolean;
30
+ };
31
+ block: {
32
+ type: import('vue').PropType<boolean>;
33
+ default: boolean;
34
+ };
35
+ }>> & Readonly<{
36
+ onClick?: ((evt: MouseEvent) => any) | undefined;
37
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
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";
42
+ disabled: boolean;
43
+ loading: boolean;
44
+ ghost: boolean;
45
+ round: boolean;
46
+ circle: boolean;
47
+ block: boolean;
48
+ }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
49
+ P: {};
50
+ B: {};
51
+ D: {};
52
+ C: {};
53
+ M: {};
54
+ Defaults: {};
55
+ }, Readonly<import('vue').ExtractPropTypes<{
56
+ type: {
57
+ type: import('vue').PropType<"primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text">;
58
+ default: string;
59
+ };
60
+ size: {
61
+ type: import('vue').PropType<"default" | "large" | "small">;
62
+ default: string;
63
+ };
64
+ disabled: {
65
+ type: import('vue').PropType<boolean>;
66
+ default: boolean;
67
+ };
68
+ loading: {
69
+ type: import('vue').PropType<boolean>;
70
+ default: boolean;
71
+ };
72
+ ghost: {
73
+ type: import('vue').PropType<boolean>;
74
+ default: boolean;
75
+ };
76
+ round: {
77
+ type: import('vue').PropType<boolean>;
78
+ default: boolean;
79
+ };
80
+ circle: {
81
+ type: import('vue').PropType<boolean>;
82
+ default: boolean;
83
+ };
84
+ block: {
85
+ type: import('vue').PropType<boolean>;
86
+ default: boolean;
87
+ };
88
+ }>> & Readonly<{
89
+ onClick?: ((evt: MouseEvent) => any) | undefined;
90
+ }>, {}, {}, {}, {}, {
91
+ type: "primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text";
92
+ size: "large" | "default" | "small";
93
+ disabled: boolean;
94
+ loading: boolean;
95
+ ghost: boolean;
96
+ round: boolean;
97
+ circle: boolean;
98
+ block: boolean;
99
+ }>;
100
+ __isFragment?: never;
101
+ __isTeleport?: never;
102
+ __isSuspense?: never;
103
+ } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
104
+ type: {
105
+ type: import('vue').PropType<"primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text">;
106
+ default: string;
107
+ };
108
+ size: {
109
+ type: import('vue').PropType<"default" | "large" | "small">;
110
+ default: string;
111
+ };
112
+ disabled: {
113
+ type: import('vue').PropType<boolean>;
114
+ default: boolean;
115
+ };
116
+ loading: {
117
+ type: import('vue').PropType<boolean>;
118
+ default: boolean;
119
+ };
120
+ ghost: {
121
+ type: import('vue').PropType<boolean>;
122
+ default: boolean;
123
+ };
124
+ round: {
125
+ type: import('vue').PropType<boolean>;
126
+ default: boolean;
127
+ };
128
+ circle: {
129
+ type: import('vue').PropType<boolean>;
130
+ default: boolean;
131
+ };
132
+ block: {
133
+ type: import('vue').PropType<boolean>;
134
+ default: boolean;
135
+ };
136
+ }>> & Readonly<{
137
+ onClick?: ((evt: MouseEvent) => any) | undefined;
138
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
139
+ click: (evt: MouseEvent) => void;
140
+ }, string, {
141
+ type: "primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text";
142
+ size: "large" | "default" | "small";
143
+ disabled: boolean;
144
+ loading: boolean;
145
+ ghost: boolean;
146
+ round: boolean;
147
+ circle: boolean;
148
+ block: boolean;
149
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
150
+ $slots: {
151
+ icon?(_: {}): any;
152
+ default?(_: {}): any;
153
+ };
154
+ }) & {
155
+ install: (app: import('vue').App) => void;
156
+ };
157
+ export default JButton;
@@ -0,0 +1,78 @@
1
+ export interface ButtonProps {
2
+ /** 按钮类型 */
3
+ type?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'default' | 'dashed' | 'link' | 'text';
4
+ /** 按钮尺寸 */
5
+ size?: 'large' | 'default' | 'small';
6
+ /** 是否禁用 */
7
+ disabled?: boolean;
8
+ /** 是否加载中 */
9
+ loading?: boolean;
10
+ /** 是否幽灵按钮 */
11
+ ghost?: boolean;
12
+ /** 是否圆角 */
13
+ round?: boolean;
14
+ /** 是否圆形 */
15
+ circle?: boolean;
16
+ /** 是否通栏 */
17
+ block?: boolean;
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>, {
24
+ type: string;
25
+ size: string;
26
+ disabled: boolean;
27
+ loading: boolean;
28
+ ghost: boolean;
29
+ round: boolean;
30
+ circle: boolean;
31
+ block: boolean;
32
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
33
+ click: (evt: MouseEvent) => void;
34
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ButtonProps>, {
35
+ type: string;
36
+ size: string;
37
+ disabled: boolean;
38
+ loading: boolean;
39
+ ghost: boolean;
40
+ round: boolean;
41
+ circle: boolean;
42
+ block: boolean;
43
+ }>>> & Readonly<{
44
+ onClick?: ((evt: MouseEvent) => any) | undefined;
45
+ }>, {
46
+ type: "primary" | "success" | "warning" | "danger" | "info" | "default" | "dashed" | "link" | "text";
47
+ size: "large" | "default" | "small";
48
+ disabled: boolean;
49
+ loading: boolean;
50
+ ghost: boolean;
51
+ round: boolean;
52
+ circle: boolean;
53
+ block: boolean;
54
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
55
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
56
+ export default _default;
57
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
58
+ type __VLS_TypePropsToRuntimeProps<T> = {
59
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
60
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
61
+ } : {
62
+ type: import('vue').PropType<T[K]>;
63
+ required: true;
64
+ };
65
+ };
66
+ type __VLS_WithDefaults<P, D> = {
67
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
68
+ default: D[K];
69
+ }> : P[K];
70
+ };
71
+ type __VLS_Prettify<T> = {
72
+ [K in keyof T]: T[K];
73
+ } & {};
74
+ type __VLS_WithTemplateSlots<T, S> = T & {
75
+ new (): {
76
+ $slots: S;
77
+ };
78
+ };
@@ -0,0 +1,9 @@
1
+ import { App } from 'vue';
2
+ import { default as JButton } from './button';
3
+ import { default as JInput } from './input';
4
+
5
+ export { JButton, JInput };
6
+ declare const _default: {
7
+ install: (app: App) => void;
8
+ };
9
+ export default _default;
@@ -0,0 +1,137 @@
1
+ declare const JInput: {
2
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
3
+ type: {
4
+ type: import('vue').PropType<string>;
5
+ default: string;
6
+ };
7
+ size: {
8
+ type: import('vue').PropType<"default" | "large" | "small">;
9
+ default: string;
10
+ };
11
+ disabled: {
12
+ type: import('vue').PropType<boolean>;
13
+ default: boolean;
14
+ };
15
+ modelValue: {
16
+ type: import('vue').PropType<string | number>;
17
+ default: string;
18
+ };
19
+ placeholder: {
20
+ type: import('vue').PropType<string>;
21
+ default: string;
22
+ };
23
+ readonly: {
24
+ type: import('vue').PropType<boolean>;
25
+ default: boolean;
26
+ };
27
+ }>> & Readonly<{
28
+ onInput?: ((value: string) => any) | undefined;
29
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
30
+ onFocus?: ((evt: FocusEvent) => any) | undefined;
31
+ onBlur?: ((evt: FocusEvent) => any) | undefined;
32
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
33
+ input: (value: string) => void;
34
+ "update:modelValue": (value: string) => void;
35
+ focus: (evt: FocusEvent) => void;
36
+ blur: (evt: FocusEvent) => void;
37
+ }, import('vue').PublicProps, {
38
+ type: string;
39
+ size: "large" | "default" | "small";
40
+ disabled: boolean;
41
+ modelValue: string | number;
42
+ placeholder: string;
43
+ readonly: boolean;
44
+ }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
45
+ P: {};
46
+ B: {};
47
+ D: {};
48
+ C: {};
49
+ M: {};
50
+ Defaults: {};
51
+ }, Readonly<import('vue').ExtractPropTypes<{
52
+ type: {
53
+ type: import('vue').PropType<string>;
54
+ default: string;
55
+ };
56
+ size: {
57
+ type: import('vue').PropType<"default" | "large" | "small">;
58
+ default: string;
59
+ };
60
+ disabled: {
61
+ type: import('vue').PropType<boolean>;
62
+ default: boolean;
63
+ };
64
+ modelValue: {
65
+ type: import('vue').PropType<string | number>;
66
+ default: string;
67
+ };
68
+ placeholder: {
69
+ type: import('vue').PropType<string>;
70
+ default: string;
71
+ };
72
+ readonly: {
73
+ type: import('vue').PropType<boolean>;
74
+ default: boolean;
75
+ };
76
+ }>> & Readonly<{
77
+ onInput?: ((value: string) => any) | undefined;
78
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
79
+ onFocus?: ((evt: FocusEvent) => any) | undefined;
80
+ onBlur?: ((evt: FocusEvent) => any) | undefined;
81
+ }>, {}, {}, {}, {}, {
82
+ type: string;
83
+ size: "large" | "default" | "small";
84
+ disabled: boolean;
85
+ modelValue: string | number;
86
+ placeholder: string;
87
+ readonly: boolean;
88
+ }>;
89
+ __isFragment?: never;
90
+ __isTeleport?: never;
91
+ __isSuspense?: never;
92
+ } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
93
+ type: {
94
+ type: import('vue').PropType<string>;
95
+ default: string;
96
+ };
97
+ size: {
98
+ type: import('vue').PropType<"default" | "large" | "small">;
99
+ default: string;
100
+ };
101
+ disabled: {
102
+ type: import('vue').PropType<boolean>;
103
+ default: boolean;
104
+ };
105
+ modelValue: {
106
+ type: import('vue').PropType<string | number>;
107
+ default: string;
108
+ };
109
+ placeholder: {
110
+ type: import('vue').PropType<string>;
111
+ default: string;
112
+ };
113
+ readonly: {
114
+ type: import('vue').PropType<boolean>;
115
+ default: boolean;
116
+ };
117
+ }>> & Readonly<{
118
+ onInput?: ((value: string) => any) | undefined;
119
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
120
+ onFocus?: ((evt: FocusEvent) => any) | undefined;
121
+ onBlur?: ((evt: FocusEvent) => any) | undefined;
122
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
123
+ input: (value: string) => void;
124
+ "update:modelValue": (value: string) => void;
125
+ focus: (evt: FocusEvent) => void;
126
+ blur: (evt: FocusEvent) => void;
127
+ }, string, {
128
+ type: string;
129
+ size: "large" | "default" | "small";
130
+ disabled: boolean;
131
+ modelValue: string | number;
132
+ placeholder: string;
133
+ 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;
136
+ };
137
+ export default JInput;
@@ -0,0 +1,64 @@
1
+ export interface InputProps {
2
+ /** 绑定值 */
3
+ modelValue?: string | number;
4
+ /** 输入框类型 */
5
+ type?: string;
6
+ /** 输入框占位文本 */
7
+ placeholder?: string;
8
+ /** 是否禁用 */
9
+ disabled?: boolean;
10
+ /** 是否只读 */
11
+ readonly?: boolean;
12
+ /** 输入框尺寸 */
13
+ size?: 'large' | 'default' | 'small';
14
+ }
15
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputProps>, {
16
+ type: string;
17
+ placeholder: string;
18
+ disabled: boolean;
19
+ readonly: boolean;
20
+ size: string;
21
+ modelValue: string;
22
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
23
+ input: (value: string) => void;
24
+ "update:modelValue": (value: string) => void;
25
+ focus: (evt: FocusEvent) => void;
26
+ blur: (evt: FocusEvent) => void;
27
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<InputProps>, {
28
+ type: string;
29
+ placeholder: string;
30
+ disabled: boolean;
31
+ readonly: boolean;
32
+ size: string;
33
+ modelValue: string;
34
+ }>>> & Readonly<{
35
+ onInput?: ((value: string) => any) | undefined;
36
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
37
+ onFocus?: ((evt: FocusEvent) => any) | undefined;
38
+ onBlur?: ((evt: FocusEvent) => any) | undefined;
39
+ }>, {
40
+ type: string;
41
+ size: "large" | "default" | "small";
42
+ disabled: boolean;
43
+ modelValue: string | number;
44
+ placeholder: string;
45
+ readonly: boolean;
46
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
47
+ export default _default;
48
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
49
+ type __VLS_TypePropsToRuntimeProps<T> = {
50
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
51
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
52
+ } : {
53
+ type: import('vue').PropType<T[K]>;
54
+ required: true;
55
+ };
56
+ };
57
+ type __VLS_WithDefaults<P, D> = {
58
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
59
+ default: D[K];
60
+ }> : P[K];
61
+ };
62
+ type __VLS_Prettify<T> = {
63
+ [K in keyof T]: T[K];
64
+ } & {};
@@ -0,0 +1,109 @@
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"], _ = {
5
+ key: 0,
6
+ class: "j-button__loading-icon"
7
+ }, $ = {
8
+ key: 1,
9
+ class: "j-button__content"
10
+ }, C = /* @__PURE__ */ m({
11
+ name: "JButton",
12
+ __name: "button",
13
+ props: {
14
+ type: { default: "default" },
15
+ size: { default: "default" },
16
+ disabled: { type: Boolean, default: !1 },
17
+ loading: { type: Boolean, default: !1 },
18
+ ghost: { type: Boolean, default: !1 },
19
+ round: { type: Boolean, default: !1 },
20
+ circle: { type: Boolean, default: !1 },
21
+ block: { type: Boolean, default: !1 }
22
+ },
23
+ emits: ["click"],
24
+ setup(e, { emit: l }) {
25
+ const t = e, n = l, i = y(() => [
26
+ "j-button",
27
+ `j-button--${t.type}`,
28
+ `j-button--${t.size}`,
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
36
+ }
37
+ ]), s = (a) => {
38
+ t.disabled || t.loading || n("click", a);
39
+ };
40
+ return (a, r) => (u(), d("button", {
41
+ class: h(i.value),
42
+ disabled: e.disabled || e.loading,
43
+ onClick: s
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));
51
+ }
52
+ }), V = B(C), z = ["type", "placeholder", "disabled", "readonly", "value"], I = /* @__PURE__ */ m({
53
+ name: "JInput",
54
+ __name: "input",
55
+ props: {
56
+ modelValue: { default: "" },
57
+ type: { default: "text" },
58
+ placeholder: { default: "" },
59
+ disabled: { type: Boolean, default: !1 },
60
+ readonly: { type: Boolean, default: !1 },
61
+ size: { default: "default" }
62
+ },
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(() => [
66
+ "j-input",
67
+ `j-input--${t.size}`,
68
+ {
69
+ "is-disabled": t.disabled,
70
+ "is-focused": s.value
71
+ }
72
+ ]), r = (o) => {
73
+ const c = o.target.value;
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);
79
+ };
80
+ return (o, c) => (u(), d("div", {
81
+ class: h(a.value)
82
+ }, [
83
+ v("input", {
84
+ ref_key: "inputRef",
85
+ ref: i,
86
+ type: e.type,
87
+ placeholder: e.placeholder,
88
+ disabled: e.disabled,
89
+ readonly: e.readonly,
90
+ value: e.modelValue,
91
+ class: "j-input__inner",
92
+ onInput: r,
93
+ onFocus: k,
94
+ onBlur: g
95
+ }, null, 40, z)
96
+ ], 2));
97
+ }
98
+ }), J = B(I), E = [V, J], F = (e) => {
99
+ E.forEach((l) => {
100
+ e.component(l.name, l);
101
+ });
102
+ }, N = {
103
+ install: F
104
+ };
105
+ export {
106
+ V as JButton,
107
+ J as JInput,
108
+ N as default
109
+ };
@@ -0,0 +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"}})});
@@ -0,0 +1,5 @@
1
+ import { App, Component } from 'vue';
2
+
3
+ export declare const withInstall: <T extends Component>(component: T) => T & {
4
+ install: (app: App) => void;
5
+ };
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@a2simcode/ui",
3
+ "version": "0.0.1",
4
+ "description": "A Vue 3 UI Component Library",
5
+ "type": "module",
6
+ "main": "./dist/simcode-ui.umd.js",
7
+ "module": "./dist/simcode-ui.es.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/simcode-ui.es.js",
12
+ "require": "./dist/simcode-ui.umd.js",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "./dist/style.css": "./dist/style.css"
16
+ },
17
+ "files": [
18
+ "dist"
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
+ "keywords": [
33
+ "vue",
34
+ "vue3",
35
+ "component",
36
+ "ui",
37
+ "library"
38
+ ],
39
+ "author": "苏州极简搭信息技术有限公司",
40
+ "license": "UNLICENSED",
41
+ "peerDependencies": {
42
+ "vue": "^3.4.0"
43
+ },
44
+ "devDependencies": {
45
+ "@types/node": "^20.10.6",
46
+ "@typescript-eslint/eslint-plugin": "^6.16.0",
47
+ "@typescript-eslint/parser": "^6.16.0",
48
+ "@vitejs/plugin-vue": "^5.0.2",
49
+ "@vitest/ui": "^1.1.0",
50
+ "@vue/test-utils": "^2.4.3",
51
+ "eslint": "^8.56.0",
52
+ "eslint-config-prettier": "^9.1.0",
53
+ "eslint-plugin-vue": "^9.19.2",
54
+ "happy-dom": "^12.10.3",
55
+ "less": "^4.5.1",
56
+ "prettier": "^3.1.1",
57
+ "shiki": "^3.20.0",
58
+ "tsx": "^4.21.0",
59
+ "typescript": "^5.3.3",
60
+ "vite": "^5.0.10",
61
+ "vite-plugin-dts": "^3.7.0",
62
+ "vitepress": "^1.0.0-rc.35",
63
+ "vitest": "^1.1.0",
64
+ "vue": "^3.4.3",
65
+ "vue-docgen-api": "^4.79.2",
66
+ "vue-tsc": "^1.8.27"
67
+ },
68
+ "packageManager": "pnpm@8.0.0"
69
+ }