@elementplus-kit/uikit 1.7.0 → 1.9.0
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/components/button/index.ts +2 -4
- package/components/button/src/index.ts +58 -53
- package/components/button/src/type.ts +15 -0
- package/components/dialog/index.ts +2 -6
- package/components/dialog/src/index.ts +3 -3
- package/components/dialog/src/type.ts +1 -0
- package/components/dictLabel/src/type.ts +1 -0
- package/components/drawer/index.ts +2 -4
- package/components/drawer/src/index.ts +3 -3
- package/components/drawer/src/type.ts +1 -0
- package/components/form/index.ts +2 -4
- package/components/form/src/FormItem.ts +24 -16
- package/components/form/src/index.ts +4 -4
- package/components/form/src/type.ts +68 -0
- package/components/importText/index.ts +2 -0
- package/components/importText/src/index.ts +1 -0
- package/components/importText/src/type.ts +3 -0
- package/components/index.ts +1 -39
- package/components/pagination/index.ts +2 -4
- package/components/pagination/src/index.ts +4 -4
- package/components/pagination/src/type.ts +1 -0
- package/components/search/index.ts +2 -4
- package/components/search/src/index.tsx +47 -35
- package/components/search/src/type.ts +2 -0
- package/components/table/index.ts +2 -4
- package/components/table/src/index.ts +5 -4
- package/components/table/src/type.ts +19 -0
- package/dist/index.css +1 -0
- package/dist/index.mjs +1079 -0
- package/dist/index.umd.js +1 -0
- package/package.json +1 -1
- package/build.log +0 -0
- package/components/form/src/types.ts +0 -39
- package/components/table/src/index2.ts +0 -219
- package/components/table/src/index3.ts +0 -233
- package/components/table/src/tableaa.ts +0 -71
|
@@ -1,27 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ref,
|
|
3
|
+
defineComponent,
|
|
4
|
+
onMounted,
|
|
5
|
+
onUnmounted,
|
|
6
|
+
type PropType,
|
|
7
|
+
type ExtractPropTypes,
|
|
8
|
+
} from "vue";
|
|
2
9
|
|
|
3
10
|
import { CForm, CDrawer } from "@elementplus-kit/uikit";
|
|
4
11
|
import { ArrowUpBold } from "@element-plus/icons-vue";
|
|
5
12
|
import "../style/index.scss";
|
|
6
13
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
default: () => [],
|
|
16
|
-
},
|
|
17
|
-
isDrawer: {
|
|
18
|
-
type: Boolean,
|
|
19
|
-
default: false,
|
|
20
|
-
},
|
|
14
|
+
import { FormOptions } from "../../form/src/type.ts";
|
|
15
|
+
|
|
16
|
+
export type SearchAttrs = ExtractPropTypes<typeof searchAttrs>;
|
|
17
|
+
|
|
18
|
+
const searchAttrs = {
|
|
19
|
+
modelValue: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: {},
|
|
21
22
|
},
|
|
23
|
+
formOptions: {
|
|
24
|
+
type: Array as PropType<FormOptions>,
|
|
25
|
+
default: () => [],
|
|
26
|
+
},
|
|
27
|
+
isDrawer: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false,
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
export default defineComponent({
|
|
33
|
+
props: searchAttrs,
|
|
22
34
|
emits: ["update:modelValue", "search", "reset", "close"],
|
|
23
35
|
|
|
24
|
-
setup(props, { emit, slots, attrs, expose }) {
|
|
36
|
+
setup(props: SearchAttrs, { emit, slots, attrs, expose }) {
|
|
25
37
|
// 自己的 slot
|
|
26
38
|
const slotsList = ["btn-left", "btn-right"];
|
|
27
39
|
// 解析 attrs 中的事件
|
|
@@ -207,8 +219,9 @@ export default defineComponent({
|
|
|
207
219
|
{slots["arrow-left"]?.()}
|
|
208
220
|
{showCount.value < props.formOptions?.length && (
|
|
209
221
|
<div
|
|
210
|
-
className={`c-search-simple-icon ${
|
|
211
|
-
|
|
222
|
+
className={`c-search-simple-icon ${
|
|
223
|
+
showSearchForm.value ? "icon-rotate" : ""
|
|
224
|
+
}`}
|
|
212
225
|
onClick={handleShow}
|
|
213
226
|
>
|
|
214
227
|
<el-icon className="el-icon c-search-icon">
|
|
@@ -216,21 +229,20 @@ export default defineComponent({
|
|
|
216
229
|
</el-icon>
|
|
217
230
|
</div>
|
|
218
231
|
)}
|
|
219
|
-
{slots["search-btn"]
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
232
|
+
{slots["search-btn"] ? (
|
|
233
|
+
slots["search-btn"]()
|
|
234
|
+
) : (
|
|
235
|
+
<>
|
|
236
|
+
{slots["btn-left"]?.()}
|
|
237
|
+
<el-button type="primary" onClick={handleSearch}>
|
|
238
|
+
搜索
|
|
239
|
+
</el-button>
|
|
240
|
+
<el-button type="primary" onClick={handleReset}>
|
|
241
|
+
重置
|
|
242
|
+
</el-button>
|
|
243
|
+
{slots["btn-right"]?.()}
|
|
244
|
+
</>
|
|
245
|
+
)}
|
|
234
246
|
</div>
|
|
235
247
|
</div>
|
|
236
248
|
|
|
@@ -246,7 +258,7 @@ export default defineComponent({
|
|
|
246
258
|
inline
|
|
247
259
|
model={props.modelValue}
|
|
248
260
|
formOptions={props.formOptions.filter(
|
|
249
|
-
(item, index) => index >= showCount.value
|
|
261
|
+
(item, index) => index >= showCount.value,
|
|
250
262
|
)}
|
|
251
263
|
ref="formRef"
|
|
252
264
|
>
|
|
@@ -271,7 +283,7 @@ export default defineComponent({
|
|
|
271
283
|
col={12}
|
|
272
284
|
model={props.modelValue}
|
|
273
285
|
formOptions={props.formOptions.filter(
|
|
274
|
-
(item, index) => index >= showCount.value
|
|
286
|
+
(item, index) => index >= showCount.value,
|
|
275
287
|
)}
|
|
276
288
|
ref="formRef"
|
|
277
289
|
>
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
indexColumn,
|
|
15
15
|
} from "./constants.ts";
|
|
16
16
|
import { isArray, isObject, isFunction } from "lodash-es";
|
|
17
|
-
const
|
|
17
|
+
const tableAttrs = {
|
|
18
18
|
module: {
|
|
19
19
|
type: Object,
|
|
20
20
|
default: () => {},
|
|
@@ -49,14 +49,15 @@ const propsAttrs = {
|
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
// 类型处理
|
|
53
|
+
export type TableAttrs = ExtractPropTypes<typeof tableAttrs>;
|
|
53
54
|
|
|
54
55
|
export default defineComponent({
|
|
55
|
-
props:
|
|
56
|
+
props: tableAttrs,
|
|
56
57
|
// emits: eventList,
|
|
57
58
|
|
|
58
59
|
// attrs, emit会继承, slots需要设置
|
|
59
|
-
setup(props:
|
|
60
|
+
setup(props: TableAttrs, { attrs, emit, slots, expose }) {
|
|
60
61
|
// 暴露elTable组件上的方法
|
|
61
62
|
const vm = getCurrentInstance(); // 获取虚拟DOM实例
|
|
62
63
|
const cTableFnRef = (el) => {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ExtractPropTypes } from "vue";
|
|
2
|
+
import type { TableColumnCtx } from "element-plus";
|
|
3
|
+
import elTableDefaults from "element-plus/es/components/table/src/table/defaults";
|
|
4
|
+
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never; // 展开类型工具
|
|
5
|
+
|
|
6
|
+
import { type TableAttrs } from "./index.ts";
|
|
7
|
+
|
|
8
|
+
// 表格属性
|
|
9
|
+
type ElTableProps = ExtractPropTypes<typeof elTableDefaults>;
|
|
10
|
+
export type TableProps = Expand<Partial<TableAttrs>> &
|
|
11
|
+
Expand<Partial<ElTableProps>>;
|
|
12
|
+
|
|
13
|
+
// 表格项属性
|
|
14
|
+
export type TableColumnProps = {
|
|
15
|
+
vIf?: (params: any) => boolean;
|
|
16
|
+
render?: (scope: any) => any;
|
|
17
|
+
options?: Array<{ label: string; value: any }>;
|
|
18
|
+
children?: Array<TableColumnProps>;
|
|
19
|
+
} & Expand<Partial<TableColumnCtx>>;
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.c-form.el-form--inline .el-select{--el-select-width: 220px}.search-btn{margin-right:20px;margin-left:auto}.c-search{position:relative;height:50px}.c-search .c-search-simple{display:flex;justify-content:space-between}.c-search .c-search-simple-form{flex:1;overflow:auto;scrollbar-width:none}.c-search .c-simple-form-container{display:inline-block}.c-search .c-simple-form-container>.c-form{white-space:nowrap}.c-search .c-search-simple-btn{display:flex;margin-left:auto}.c-search .c-search-simple-icon{display:flex;justify-content:center;align-items:center;cursor:pointer;height:32px;width:32px;margin-right:10px;border-radius:4px;background-color:#409eff;transition:all .2s}.c-search .c-search-simple-icon:hover{background-color:#79bbff}.c-search .c-search-simple-icon:active{background-color:#337ecc}.c-search .c-search-icon{color:#fff;transition:all .2s}.c-search .icon-rotate{background-color:#337ecc}.c-search .icon-rotate .c-search-icon{transform:rotate(180deg)}.c-search .c-search-form{width:100%;position:absolute;top:50px;left:0;overflow:hidden;z-index:10;background-color:#fff}.search-form-transition-enter-active,.search-form-transition-leave-active{transition:all .3s ease;overflow:hidden;max-height:500px}.search-form-transition-enter-from,.search-form-transition-leave-to{max-height:0;opacity:0;padding-top:0;padding-bottom:0}.el-button+.el-dropdown{margin-left:10px}
|