twcpt 0.0.2 → 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/README.md +33 -4
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +1 -1
- package/dist/components/j-tw-btn/index.d.ts +43 -6
- package/dist/components/j-tw-btn/types.d.ts +19 -4
- package/dist/components/j-tw-date-picker/index.d.ts +1590 -0
- package/dist/components/j-tw-date-picker/types.d.ts +147 -0
- package/dist/components/j-tw-dropdown-btn/index.d.ts +3 -0
- package/dist/components/j-tw-dropdown-btn/types.d.ts +69 -0
- package/dist/components/j-tw-tree-select-btn/index.d.ts +1356 -0
- package/dist/components/j-tw-tree-select-btn/types.d.ts +99 -0
- package/dist/global.d.ts +30 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/twcpt-styles.css +1 -1
- package/dist/twcpt.cjs.js +8 -1
- package/dist/twcpt.es.js +2598 -1451
- package/dist/utils/init.d.ts +19 -0
- package/dist/utils/tool.d.ts +1 -1
- package/package.json +4 -2
- package/dist/charts.css +0 -1
- package/dist/utils/website-config.d.ts +0 -15
- /package/dist/{charts-CKv8I1ye.js → charts-BRqaKjiE.js} +0 -0
- /package/dist/{charts-DIdINgA4.cjs → charts-lTMiYKQB.cjs} +0 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
# TWCPT - Vue 3 + Element-plus 组件库
|
|
2
2
|
|
|
3
3
|
TWCPT 是一个基于 Vue 3、TypeScript 和 Element-plus 构建的现代企业级组件库。
|
|
4
4
|
|
|
@@ -102,18 +102,47 @@ yarn add twcpt
|
|
|
102
102
|
pnpm add twcpt
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
###
|
|
105
|
+
### 基础使用
|
|
106
106
|
|
|
107
107
|
```typescript
|
|
108
108
|
import { createApp } from 'vue'
|
|
109
|
-
import
|
|
109
|
+
import { twcptInit } from 'twcpt'
|
|
110
110
|
import 'twcpt/dist/index.css'
|
|
111
111
|
|
|
112
112
|
const app = createApp(App)
|
|
113
|
-
|
|
113
|
+
|
|
114
|
+
// 初始化 TWCPT
|
|
115
|
+
twcptInit({
|
|
116
|
+
app,
|
|
117
|
+
defaultLanguage: 'zh-CN', // 可选:设置默认语言
|
|
118
|
+
colors: {
|
|
119
|
+
primary: '#FF5722', // 可选:自定义主题色
|
|
120
|
+
blue: '#2196F3'
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
|
|
114
124
|
app.mount('#app')
|
|
115
125
|
```
|
|
116
126
|
|
|
127
|
+
### 样式隔离
|
|
128
|
+
|
|
129
|
+
为了避免 TWCPT 的颜色配置影响外部项目,所有 TWCPT 组件必须包裹在 `.twcpt-container` 容器内:
|
|
130
|
+
|
|
131
|
+
```vue
|
|
132
|
+
<template>
|
|
133
|
+
<div class="twcpt-container">
|
|
134
|
+
<!-- TWCPT 组件只在此容器内生效 -->
|
|
135
|
+
<JTWButton type="primary">按钮</JTWButton>
|
|
136
|
+
<JTWTable :data="tableData" />
|
|
137
|
+
</div>
|
|
138
|
+
</template>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**重要说明:**
|
|
142
|
+
- `.twcpt-container` 确保 TWCPT 的颜色变量不会影响外部项目
|
|
143
|
+
- 如果 A 项目引用了 B 组件(TWCPT),两者的颜色配置互不影响
|
|
144
|
+
- 每个使用 TWCPT 的区域都需要包裹 `.twcpt-container`
|
|
145
|
+
|
|
117
146
|
### 按需引入
|
|
118
147
|
|
|
119
148
|
```typescript
|
package/dist/charts.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./charts-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./charts-lTMiYKQB.cjs");exports.JChBar=e.index;exports.JChBarLine=e.index$1;exports.JChBubble=e.index$2;exports.JChLine=e.index$3;exports.JChPieDoughnut=e.index$4;exports.JChRadar=e.index$5;
|
package/dist/charts.es.js
CHANGED
|
@@ -8,14 +8,26 @@ import { Arrayable } from 'element-plus/es/utils/typescript.mjs';
|
|
|
8
8
|
declare const _default: DefineComponent<ExtractPropTypes<{
|
|
9
9
|
size: {
|
|
10
10
|
type: PropType<JTWBtnSizeType>;
|
|
11
|
-
default: "
|
|
11
|
+
default: "normal";
|
|
12
12
|
validator: (value: JTWBtnSizeType) => boolean;
|
|
13
13
|
};
|
|
14
14
|
type: {
|
|
15
15
|
type: PropType<JTWBtnTypeType>;
|
|
16
|
-
default: "
|
|
16
|
+
default: "button";
|
|
17
17
|
validator: (value: JTWBtnTypeType) => boolean;
|
|
18
18
|
};
|
|
19
|
+
color: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
outline: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
flat: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
19
31
|
label: {
|
|
20
32
|
type: StringConstructor;
|
|
21
33
|
default: string;
|
|
@@ -250,10 +262,20 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
250
262
|
'j-tw-btn--large': boolean;
|
|
251
263
|
'j-tw-btn--normal': boolean;
|
|
252
264
|
'j-tw-btn--small': boolean;
|
|
253
|
-
'j-tw-btn--
|
|
254
|
-
'j-tw-btn--
|
|
265
|
+
'j-tw-btn--button': boolean;
|
|
266
|
+
'j-tw-btn--outline': boolean;
|
|
267
|
+
'j-tw-btn--flat': boolean;
|
|
255
268
|
'j-tw-btn--text': boolean;
|
|
256
269
|
}>;
|
|
270
|
+
computedStyle: ComputedRef<{
|
|
271
|
+
'--j-btn-color': string;
|
|
272
|
+
'--j-btn-color-1': string;
|
|
273
|
+
'--j-btn-color-2': string;
|
|
274
|
+
'--j-btn-color-3': string;
|
|
275
|
+
'--j-btn-color-4': string;
|
|
276
|
+
'--j-btn-color-5': string;
|
|
277
|
+
'--j-btn-color-6': string;
|
|
278
|
+
}>;
|
|
257
279
|
mergedTooltipConfig: ComputedRef<{
|
|
258
280
|
placement: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
|
|
259
281
|
effect: "dark" | "light";
|
|
@@ -269,14 +291,26 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
269
291
|
}, string, PublicProps, Readonly< ExtractPropTypes<{
|
|
270
292
|
size: {
|
|
271
293
|
type: PropType<JTWBtnSizeType>;
|
|
272
|
-
default: "
|
|
294
|
+
default: "normal";
|
|
273
295
|
validator: (value: JTWBtnSizeType) => boolean;
|
|
274
296
|
};
|
|
275
297
|
type: {
|
|
276
298
|
type: PropType<JTWBtnTypeType>;
|
|
277
|
-
default: "
|
|
299
|
+
default: "button";
|
|
278
300
|
validator: (value: JTWBtnTypeType) => boolean;
|
|
279
301
|
};
|
|
302
|
+
color: {
|
|
303
|
+
type: StringConstructor;
|
|
304
|
+
default: string;
|
|
305
|
+
};
|
|
306
|
+
outline: {
|
|
307
|
+
type: BooleanConstructor;
|
|
308
|
+
default: boolean;
|
|
309
|
+
};
|
|
310
|
+
flat: {
|
|
311
|
+
type: BooleanConstructor;
|
|
312
|
+
default: boolean;
|
|
313
|
+
};
|
|
280
314
|
label: {
|
|
281
315
|
type: StringConstructor;
|
|
282
316
|
default: string;
|
|
@@ -297,9 +331,12 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
297
331
|
onClick?: ((_e: MouseEvent) => any) | undefined;
|
|
298
332
|
}>, {
|
|
299
333
|
type: JTWBtnTypeType;
|
|
334
|
+
flat: boolean;
|
|
300
335
|
label: string;
|
|
301
336
|
size: JTWBtnSizeType;
|
|
337
|
+
color: string;
|
|
302
338
|
loading: boolean;
|
|
339
|
+
outline: boolean;
|
|
303
340
|
tips: string | number;
|
|
304
341
|
tooltipConfig: JTWBtnTooltipConfig;
|
|
305
342
|
}, {}, {
|
|
@@ -7,8 +7,7 @@ export declare const JTWBtnSize: {
|
|
|
7
7
|
};
|
|
8
8
|
/** 按钮类型常量 */
|
|
9
9
|
export declare const JTWBtnType: {
|
|
10
|
-
readonly
|
|
11
|
-
readonly SECONDARY: "secondary";
|
|
10
|
+
readonly BUTTON: "button";
|
|
12
11
|
readonly TEXT: "text";
|
|
13
12
|
};
|
|
14
13
|
/** 按钮尺寸类型 */
|
|
@@ -44,10 +43,26 @@ export interface JTWBtnProps {
|
|
|
44
43
|
size?: JTWBtnSizeType;
|
|
45
44
|
/**
|
|
46
45
|
* 按钮类型
|
|
47
|
-
* @default '
|
|
48
|
-
* @values '
|
|
46
|
+
* @default 'button'
|
|
47
|
+
* @values 'button' | 'text'
|
|
49
48
|
*/
|
|
50
49
|
type?: JTWBtnTypeType;
|
|
50
|
+
/**
|
|
51
|
+
* 按钮颜色
|
|
52
|
+
* @default 'primary'
|
|
53
|
+
* @values 'primary' | 'green' | 'orange' | 'red' | 'cyan' | 'brown' | 'yellow' | 'blue' | 'purple' | 'lime' | 'magenta' | 'pink'
|
|
54
|
+
*/
|
|
55
|
+
color?: string;
|
|
56
|
+
/**
|
|
57
|
+
* 是否为 outline 样式
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
outline?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* 是否为 flat 样式(浅灰色背景,黑色文字)
|
|
63
|
+
* @default false
|
|
64
|
+
*/
|
|
65
|
+
flat?: boolean;
|
|
51
66
|
/**
|
|
52
67
|
* 按钮文本
|
|
53
68
|
* @default ''
|