twcpt 0.0.12 → 0.0.14

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 CHANGED
@@ -1,218 +1,217 @@
1
- # TWCPT - Vue 3 + Element-plus 组件库
2
-
3
- TWCPT 是一个基于 Vue 3、TypeScript 和 Element-plus 构建的现代企业级组件库。
4
-
5
- ### 分支管理
6
-
7
- 1. **创建开发分支**: 开发新功能或修复问题时,应基于 `dev` 分支创建对应的功能分支。分支命名格式为 `feat/`、`fix/`、`refactor/`、`docs/`、`perf/` 或 `chore/` 前缀,后跟具体描述。
8
-
9
- 2. **提交代码审查**: 完成开发后,通过 Pull Request (PR) 或 Merge Request (MR) 提交至 `dev` 分支进行代码审查。提交后可保留自建分支,无需删除。
10
-
11
- 3. **版本发布流程**: 在 `dev` 分支完成构建后(执行 `npm run build-all`),需先执行 `npm login` 进行身份验证,随后执行 `npm run patch` 发布新版本。
12
-
13
- ## 项目特点
14
-
15
- - 基于 Element-plus 的现代化 UI 组件
16
- - 全面的 TypeScript 类型支持
17
- - 开箱即用的企业级业务组件
18
- - 内置国际化支持 (i18n)
19
- - 权限控制系统
20
- - 基于 Chart.js 的数据可视化
21
- - 高度可定制的主题配置
22
-
23
- ## 分支命名规范 (Branching Guidelines)
24
-
25
- 为了保持组件库开发的条理性以及 CI/CD 流程的自动化,本项目采用语义化分支命名规范。
26
-
27
- ### 1. 核心分支 (Core Branches)
28
-
29
- | 分支名 | 说明 |
30
- |:------|:-------------------------------|
31
- | `dev` | 开发分支。日常功能集成的基准分支,所有 PR 默认合并至此。 |
32
-
33
- ---
34
-
35
- ### 2. 短期协作分支 (Supporting Branches)
36
-
37
- 所有短期分支应遵循 `类别/描述` 的格式,使用小写字母并以中划线分隔。
38
-
39
- #### 功能开发 (Feature)
40
-
41
- 用于开发新组件或新特性。
42
-
43
- - 格式: `feat/description`
44
- - 示例: `git checkout -b feat/button-component`
45
-
46
- #### 缺陷修复 (Bugfix)
47
-
48
- 用于修复组件 Bug。
49
-
50
- - 格式: `fix/description`
51
- - 示例: `git checkout -b fix/select-dropdown-overflow`
52
-
53
- #### 代码重构 (Refactor)
54
-
55
- 不影响功能逻辑的代码结构调整。
56
-
57
- - 格式: `refactor/description`
58
- - 示例: `git checkout -b refactor/use-callback-optimization`
59
-
60
- #### 文档更新 (Docs)
61
-
62
- 仅涉及文档、注释、Storybook 示例的修改。
63
-
64
- - 格式: `docs/description`
65
- - 示例: `git checkout -b docs/add-api-tables`
66
-
67
- #### 性能优化 (Perf)
68
-
69
- 专门针对组件渲染性能或包体积的优化。
70
-
71
- - 格式: `perf/description`
72
- - 示例: `git checkout -b perf/reduce-bundle-size`
73
-
74
- #### 辅助任务 (Chore)
75
-
76
- 构建流程、依赖库更新、CI 配置等非业务逻辑修改。
77
-
78
- - 格式: `chore/description`
79
- - 示例: `git checkout -b chore/upgrade-react-18`
80
-
81
- ---
82
-
83
- ### 3. 工作流建议 (Workflow)
84
-
85
- 1. **同步主分支**: 开发前确保 `dev` 分支是最新的。
86
- 2. **创建分支**: 从 `dev` 拉取新分支。
87
- ```bash
88
- git checkout -b feat/your-feature-name
89
- ```
90
- 3. **提交代码**: 完成开发后提交 PR 到 `dev` 分支。
91
- 4. **代码审查**: 等待代码审查通过后合并。
92
-
93
- ## 安装使用
94
-
95
- ### 安装
96
-
97
- ```bash
98
- npm install twcpt
99
- #
100
- yarn add twcpt
101
- #
102
- pnpm add twcpt
103
- ```
104
-
105
- ### 基础使用
106
-
107
- ```typescript
108
- import { createApp } from 'vue'
109
- import { twcptInit } from 'twcpt'
110
- import 'twcpt/dist/index.css'
111
-
112
- const app = createApp(App)
113
-
114
- // 初始化 TWCPT
115
- twcptInit({
116
- app,
117
- defaultLanguage: 'zh-CN', // 可选:设置默认语言
118
- colors: {
119
- primary: '#FF5722', // 可选:自定义主题色
120
- blue: '#2196F3'
121
- }
122
- })
123
-
124
- app.mount('#app')
125
- ```
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
-
146
- ### 按需引入
147
-
148
- ```typescript
149
- import { JTWButton, JTWTable } from 'twcpt'
150
-
151
- export default {
152
- components: {
153
- JTWButton,
154
- JTWTable
155
- }
156
- }
157
- ```
158
-
159
- ## 组件列表
160
-
161
- - **j-tw series**: 基于 Element Plus 的封装组件
162
- - `JTWAutocomplete` - 自动完成输入框
163
- - `JTWButton` - 按钮组件
164
- - `JTWTable` - 表格组件
165
- - 更多组件开发中...
166
-
167
- - **j-ch series**: 图表组件
168
- - `JCHBar` - 柱状图
169
- - `JCHBarLine` - 混合图表
170
- - `JCHBubble` - 气泡图
171
- - 更多图表组件开发中...
172
-
173
- ## 开发指南
174
-
175
- ### 本地开发
176
-
177
- ```bash
178
- # 安装依赖
179
- npm install
180
-
181
- # 启动开发服务器
182
- npm run dev
183
-
184
- # 构建组件库
185
- npm run build
186
-
187
- # 发布到 npm
188
- npm run patch
189
- ```
190
-
191
- ### 项目结构
192
-
193
- ```
194
- src/
195
- ├── components/ # 组件源码
196
- │ ├── j-tw/ # Element Plus 封装组件
197
- ├── j-ch/ # 图表组件
198
- │ └── j-c/ # 基础组件
199
- ├── composables/ # 组合式函数
200
- ├── css/ # 样式文件
201
- └── types.ts # 类型定义
202
- ```
203
-
204
- ## 贡献指南
205
-
206
- 1. Fork 本仓库
207
- 2. 创建你的功能分支 (`git checkout -b feat/AmazingFeature`)
208
- 3. 提交你的修改 (`git commit -m 'Add some AmazingFeature'`)
209
- 4. 推送到分支 (`git push origin feat/AmazingFeature`)
210
- 5. 开启一个 Pull Request
211
-
212
- ## 许可证
213
-
214
- 本项目采用 MIT 许可证。详见 [LICENSE](LICENSE) 文件。
215
-
216
- ## 更新日志
217
-
1
+ # TWCPT - Vue 3 + Element-plus 组件库
2
+
3
+ TWCPT 是一个基于 Vue 3、TypeScript 和 Element-plus 构建的现代企业级组件库。
4
+
5
+ ### 分支管理
6
+
7
+ 1. **创建开发分支**: 开发新功能或修复问题时,应基于 `dev` 分支创建对应的功能分支。分支命名格式为 `feat/`、`fix/`、`refactor/`、`docs/`、`perf/` 或 `chore/` 前缀,后跟具体描述。
8
+
9
+ 2. **提交代码审查**: 完成开发后,通过 Pull Request (PR) 或 Merge Request (MR) 提交至 `dev` 分支进行代码审查。提交后可保留自建分支,无需删除。
10
+
11
+ 3. **版本发布流程**: 在 `dev` 分支完成构建后(执行 `npm run build-all`),需先执行 `npm login` 进行身份验证,随后执行 `npm run patch` 发布新版本。
12
+
13
+ ## 项目特点
14
+
15
+ - 基于 Element-plus 的现代化 UI 组件
16
+ - 全面的 TypeScript 类型支持
17
+ - 开箱即用的企业级业务组件
18
+ - 内置国际化支持 (i18n)
19
+ - 权限控制系统
20
+ - 高度可定制的主题配置
21
+
22
+ ## 分支命名规范 (Branching Guidelines)
23
+
24
+ 为了保持组件库开发的条理性以及 CI/CD 流程的自动化,本项目采用语义化分支命名规范。
25
+
26
+ ### 1. 核心分支 (Core Branches)
27
+
28
+ | 分支名 | 说明 |
29
+ |:------|:-------------------------------|
30
+ | `dev` | 开发分支。日常功能集成的基准分支,所有 PR 默认合并至此。 |
31
+
32
+ ---
33
+
34
+ ### 2. 短期协作分支 (Supporting Branches)
35
+
36
+ 所有短期分支应遵循 `类别/描述` 的格式,使用小写字母并以中划线分隔。
37
+
38
+ #### 功能开发 (Feature)
39
+
40
+ 用于开发新组件或新特性。
41
+
42
+ - 格式: `feat/description`
43
+ - 示例: `git checkout -b feat/button-component`
44
+
45
+ #### 缺陷修复 (Bugfix)
46
+
47
+ 用于修复组件 Bug。
48
+
49
+ - 格式: `fix/description`
50
+ - 示例: `git checkout -b fix/select-dropdown-overflow`
51
+
52
+ #### 代码重构 (Refactor)
53
+
54
+ 不影响功能逻辑的代码结构调整。
55
+
56
+ - 格式: `refactor/description`
57
+ - 示例: `git checkout -b refactor/use-callback-optimization`
58
+
59
+ #### 文档更新 (Docs)
60
+
61
+ 仅涉及文档、注释、Storybook 示例的修改。
62
+
63
+ - 格式: `docs/description`
64
+ - 示例: `git checkout -b docs/add-api-tables`
65
+
66
+ #### 性能优化 (Perf)
67
+
68
+ 专门针对组件渲染性能或包体积的优化。
69
+
70
+ - 格式: `perf/description`
71
+ - 示例: `git checkout -b perf/reduce-bundle-size`
72
+
73
+ #### 辅助任务 (Chore)
74
+
75
+ 构建流程、依赖库更新、CI 配置等非业务逻辑修改。
76
+
77
+ - 格式: `chore/description`
78
+ - 示例: `git checkout -b chore/upgrade-react-18`
79
+
80
+ ---
81
+
82
+ ### 3. 工作流建议 (Workflow)
83
+
84
+ 1. **同步主分支**: 开发前确保 `dev` 分支是最新的。
85
+ 2. **创建分支**: `dev` 拉取新分支。
86
+ ```bash
87
+ git checkout -b feat/your-feature-name
88
+ ```
89
+ 3. **提交代码**: 完成开发后提交 PR 到 `dev` 分支。
90
+ 4. **代码审查**: 等待代码审查通过后合并。
91
+
92
+ ## 安装使用
93
+
94
+ ### 安装
95
+
96
+ ```bash
97
+ npm install twcpt
98
+ #
99
+ yarn add twcpt
100
+ #
101
+ pnpm add twcpt
102
+ ```
103
+
104
+ ### 基础使用
105
+
106
+ ```typescript
107
+ import { createApp } from 'vue'
108
+ import { twcptInit } from 'twcpt'
109
+ import 'twcpt/dist/index.css'
110
+
111
+ const app = createApp(App)
112
+
113
+ // 初始化 TWCPT
114
+ twcptInit({
115
+ app,
116
+ defaultLanguage: 'zh-CN', // 可选:设置默认语言
117
+ colors: {
118
+ primary: '#FF5722', // 可选:自定义主题色
119
+ blue: '#2196F3'
120
+ }
121
+ })
122
+
123
+ app.mount('#app')
124
+ ```
125
+
126
+ ### 样式隔离
127
+
128
+ 为了避免 TWCPT 的颜色配置影响外部项目,所有 TWCPT 组件必须包裹在 `.twcpt-container` 容器内:
129
+
130
+ ```vue
131
+ <template>
132
+ <div class="twcpt-container">
133
+ <!-- TWCPT 组件只在此容器内生效 -->
134
+ <JTWButton type="primary">按钮</JTWButton>
135
+ <JTWTable :data="tableData" />
136
+ </div>
137
+ </template>
138
+ ```
139
+
140
+ **重要说明:**
141
+ - `.twcpt-container` 确保 TWCPT 的颜色变量不会影响外部项目
142
+ - 如果 A 项目引用了 B 组件(TWCPT),两者的颜色配置互不影响
143
+ - 每个使用 TWCPT 的区域都需要包裹 `.twcpt-container`
144
+
145
+ ### 按需引入
146
+
147
+ ```typescript
148
+ import { JTWButton, JTWTable } from 'twcpt'
149
+
150
+ export default {
151
+ components: {
152
+ JTWButton,
153
+ JTWTable
154
+ }
155
+ }
156
+ ```
157
+
158
+ ## 组件列表
159
+
160
+ - **j-tw series**: 基于 Element Plus 的封装组件
161
+ - `JTWAutocomplete` - 自动完成输入框
162
+ - `JTWButton` - 按钮组件
163
+ - `JTWTable` - 表格组件
164
+ - 更多组件开发中...
165
+
166
+ - **j-ch series**: 图表组件
167
+ - `JCHBar` - 柱状图
168
+ - `JCHBarLine` - 混合图表
169
+ - `JCHBubble` - 气泡图
170
+ - 更多图表组件开发中...
171
+
172
+ ## 开发指南
173
+
174
+ ### 本地开发
175
+
176
+ ```bash
177
+ # 安装依赖
178
+ npm install
179
+
180
+ # 启动开发服务器
181
+ npm run dev
182
+
183
+ # 构建组件库
184
+ npm run build
185
+
186
+ # 发布到 npm
187
+ npm run patch
188
+ ```
189
+
190
+ ### 项目结构
191
+
192
+ ```
193
+ src/
194
+ ├── components/ # 组件源码
195
+ ├── j-tw/ # Element Plus 封装组件
196
+ │ ├── j-ch/ # 图表组件
197
+ └── j-c/ # 基础组件
198
+ ├── composables/ # 组合式函数
199
+ ├── css/ # 样式文件
200
+ └── types.ts # 类型定义
201
+ ```
202
+
203
+ ## 贡献指南
204
+
205
+ 1. Fork 本仓库
206
+ 2. 创建你的功能分支 (`git checkout -b feat/AmazingFeature`)
207
+ 3. 提交你的修改 (`git commit -m 'Add some AmazingFeature'`)
208
+ 4. 推送到分支 (`git push origin feat/AmazingFeature`)
209
+ 5. 开启一个 Pull Request
210
+
211
+ ## 许可证
212
+
213
+ 本项目采用 MIT 许可证。详见 [LICENSE](LICENSE) 文件。
214
+
215
+ ## 更新日志
216
+
218
217
  查看 [CHANGELOG.md](CHANGELOG.md) 了解版本更新详情。
@@ -0,0 +1,189 @@
1
+ import { PropType, DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, CSSProperties, Component, ComponentProvideOptions, VNode, RendererNode, RendererElement } from 'vue';
2
+ import { SFCWithInstall, EpPropFinalized, EpPropMergeType } from 'element-plus/es/utils/index.mjs';
3
+ declare const _default: DefineComponent<ExtractPropTypes<{
4
+ page: {
5
+ type: NumberConstructor;
6
+ required: true;
7
+ };
8
+ pageSize: {
9
+ type: NumberConstructor;
10
+ required: true;
11
+ };
12
+ total: {
13
+ type: NumberConstructor;
14
+ required: true;
15
+ };
16
+ pageSizes: {
17
+ type: PropType<number[]>;
18
+ default: () => number[];
19
+ };
20
+ layout: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
24
+ pagerCount: {
25
+ type: NumberConstructor;
26
+ default: number;
27
+ };
28
+ background: {
29
+ type: BooleanConstructor;
30
+ default: boolean;
31
+ };
32
+ disabled: {
33
+ type: BooleanConstructor;
34
+ default: boolean;
35
+ };
36
+ }>, {
37
+ handleSizeChange: (size: number) => void;
38
+ handleCurrentChange: (page: number) => void;
39
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
40
+ sizeChange: (_size: number) => true;
41
+ currentChange: (_page: number) => true;
42
+ 'update:page': (_page: number) => true;
43
+ 'update:pageSize': (_pageSize: number) => true;
44
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
45
+ page: {
46
+ type: NumberConstructor;
47
+ required: true;
48
+ };
49
+ pageSize: {
50
+ type: NumberConstructor;
51
+ required: true;
52
+ };
53
+ total: {
54
+ type: NumberConstructor;
55
+ required: true;
56
+ };
57
+ pageSizes: {
58
+ type: PropType<number[]>;
59
+ default: () => number[];
60
+ };
61
+ layout: {
62
+ type: StringConstructor;
63
+ default: string;
64
+ };
65
+ pagerCount: {
66
+ type: NumberConstructor;
67
+ default: number;
68
+ };
69
+ background: {
70
+ type: BooleanConstructor;
71
+ default: boolean;
72
+ };
73
+ disabled: {
74
+ type: BooleanConstructor;
75
+ default: boolean;
76
+ };
77
+ }>> & Readonly<{
78
+ onSizeChange?: ((_size: number) => any) | undefined;
79
+ onCurrentChange?: ((_page: number) => any) | undefined;
80
+ "onUpdate:page"?: ((_page: number) => any) | undefined;
81
+ "onUpdate:pageSize"?: ((_pageSize: number) => any) | undefined;
82
+ }>, {
83
+ disabled: boolean;
84
+ pagerCount: number;
85
+ layout: string;
86
+ pageSizes: number[];
87
+ background: boolean;
88
+ }, {}, {
89
+ ElPagination: SFCWithInstall<DefineComponent<ExtractPropTypes<{
90
+ readonly pageSize: NumberConstructor;
91
+ readonly defaultPageSize: NumberConstructor;
92
+ readonly total: NumberConstructor;
93
+ readonly pageCount: NumberConstructor;
94
+ readonly pagerCount: EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
95
+ readonly currentPage: NumberConstructor;
96
+ readonly defaultCurrentPage: NumberConstructor;
97
+ readonly layout: EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
98
+ readonly pageSizes: EpPropFinalized<(new (...args: any[]) => number[]) | (() => number[]) | (((new (...args: any[]) => number[]) | (() => number[])) | null)[], unknown, unknown, () => [10, 20, 30, 40, 50, 100], boolean>;
99
+ readonly popperClass: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
100
+ readonly popperStyle: {
101
+ readonly type: PropType< EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
102
+ readonly required: false;
103
+ readonly validator: ((val: unknown) => boolean) | undefined;
104
+ __epPropKey: true;
105
+ };
106
+ readonly prevText: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
107
+ readonly prevIcon: EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => DefineComponent<{}, void, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, boolean>;
108
+ readonly nextText: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
109
+ readonly nextIcon: EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => DefineComponent<{}, void, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, boolean>;
110
+ readonly teleported: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
111
+ readonly small: BooleanConstructor;
112
+ readonly size: {
113
+ readonly type: PropType< EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", never>>;
114
+ readonly required: false;
115
+ readonly validator: ((val: unknown) => boolean) | undefined;
116
+ __epPropKey: true;
117
+ };
118
+ readonly background: BooleanConstructor;
119
+ readonly disabled: BooleanConstructor;
120
+ readonly hideOnSinglePage: BooleanConstructor;
121
+ readonly appendSizeTo: StringConstructor;
122
+ }>, () => VNode<RendererNode, RendererElement, {
123
+ [key: string]: any;
124
+ }> | null, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
125
+ 'update:current-page': (val: number) => boolean;
126
+ 'update:page-size': (val: number) => boolean;
127
+ 'size-change': (val: number) => boolean;
128
+ change: (currentPage: number, pageSize: number) => boolean;
129
+ 'current-change': (val: number) => boolean;
130
+ 'prev-click': (val: number) => boolean;
131
+ 'next-click': (val: number) => boolean;
132
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
133
+ readonly pageSize: NumberConstructor;
134
+ readonly defaultPageSize: NumberConstructor;
135
+ readonly total: NumberConstructor;
136
+ readonly pageCount: NumberConstructor;
137
+ readonly pagerCount: EpPropFinalized<NumberConstructor, unknown, unknown, 7, boolean>;
138
+ readonly currentPage: NumberConstructor;
139
+ readonly defaultCurrentPage: NumberConstructor;
140
+ readonly layout: EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
141
+ readonly pageSizes: EpPropFinalized<(new (...args: any[]) => number[]) | (() => number[]) | (((new (...args: any[]) => number[]) | (() => number[])) | null)[], unknown, unknown, () => [10, 20, 30, 40, 50, 100], boolean>;
142
+ readonly popperClass: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
143
+ readonly popperStyle: {
144
+ readonly type: PropType< EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
145
+ readonly required: false;
146
+ readonly validator: ((val: unknown) => boolean) | undefined;
147
+ __epPropKey: true;
148
+ };
149
+ readonly prevText: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
150
+ readonly prevIcon: EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => DefineComponent<{}, void, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, boolean>;
151
+ readonly nextText: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
152
+ readonly nextIcon: EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => DefineComponent<{}, void, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>, boolean>;
153
+ readonly teleported: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
154
+ readonly small: BooleanConstructor;
155
+ readonly size: {
156
+ readonly type: PropType< EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", never>>;
157
+ readonly required: false;
158
+ readonly validator: ((val: unknown) => boolean) | undefined;
159
+ __epPropKey: true;
160
+ };
161
+ readonly background: BooleanConstructor;
162
+ readonly disabled: BooleanConstructor;
163
+ readonly hideOnSinglePage: BooleanConstructor;
164
+ readonly appendSizeTo: StringConstructor;
165
+ }>> & Readonly<{
166
+ onChange?: ((currentPage: number, pageSize: number) => any) | undefined;
167
+ "onUpdate:current-page"?: ((val: number) => any) | undefined;
168
+ "onUpdate:page-size"?: ((val: number) => any) | undefined;
169
+ "onSize-change"?: ((val: number) => any) | undefined;
170
+ "onCurrent-change"?: ((val: number) => any) | undefined;
171
+ "onPrev-click"?: ((val: number) => any) | undefined;
172
+ "onNext-click"?: ((val: number) => any) | undefined;
173
+ }>, {
174
+ readonly disabled: boolean;
175
+ readonly popperClass: string;
176
+ readonly teleported: EpPropMergeType<BooleanConstructor, unknown, unknown>;
177
+ readonly background: boolean;
178
+ readonly layout: string;
179
+ readonly small: boolean;
180
+ readonly pagerCount: number;
181
+ readonly pageSizes: number[];
182
+ readonly prevText: string;
183
+ readonly prevIcon: EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown>;
184
+ readonly nextText: string;
185
+ readonly nextIcon: EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown>;
186
+ readonly hideOnSinglePage: boolean;
187
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>>;
188
+ }, {}, string, ComponentProvideOptions, true, {}, any>;
189
+ export default _default;
@@ -0,0 +1,40 @@
1
+ import { DefineComponent } from 'vue';
2
+ /** 分页配置 */
3
+ export interface JTWPaginationProps {
4
+ /** 当前页,从 1 开始 */
5
+ page: number;
6
+ /** 每页条数 */
7
+ pageSize: number;
8
+ /** 总条数 */
9
+ total: number;
10
+ /** 可选每页条数 */
11
+ pageSizes?: number[];
12
+ /** 分页布局 */
13
+ layout?: string;
14
+ /** 每页显示的页码按钮数量 */
15
+ pagerCount?: number;
16
+ /** 是否显示背景色 */
17
+ background?: boolean;
18
+ /** 是否禁用 */
19
+ disabled?: boolean;
20
+ }
21
+ /** JTWPagination Emits 接口 */
22
+ export interface JTWPaginationEmits {
23
+ (e: 'sizeChange', size: number): void;
24
+ (e: 'currentChange', page: number): void;
25
+ (e: 'update:page', page: number): void;
26
+ (e: 'update:pageSize', pageSize: number): void;
27
+ }
28
+ /** JTWPagination 组件类型定义 */
29
+ export type JTWPaginationComponent = DefineComponent<JTWPaginationProps, {}, {}, {}, {}, {}, {}, any>;
30
+ /** JTWPagination 实例类型 */
31
+ export type JTWPaginationInstance = InstanceType<JTWPaginationComponent>;
32
+ /** JTWPagination 模板 Props(用于全局类型声明) */
33
+ export interface JTWPaginationTemplateProps extends JTWPaginationProps {
34
+ onSizeChange?: (size: number) => void;
35
+ onCurrentChange?: (page: number) => void;
36
+ 'onUpdate:page'?: (page: number) => void;
37
+ 'onUpdate:pageSize'?: (pageSize: number) => void;
38
+ class?: string | Record<string, boolean> | Array<string | Record<string, boolean>>;
39
+ style?: string | Record<string, string>;
40
+ }