@elementplus-kit/uikit 1.4.0 → 1.6.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.
Files changed (66) hide show
  1. package/dist/index.css +1 -0
  2. package/dist/index.mjs +1079 -0
  3. package/dist/index.umd.js +1 -0
  4. package/package.json +14 -4
  5. package/aaaindex.ts +0 -55
  6. package/build.log +0 -0
  7. package/components/button/index.ts +0 -4
  8. package/components/button/src/constants.ts +0 -50
  9. package/components/button/src/index.ts +0 -264
  10. package/components/button/style/index.scss +0 -3
  11. package/components/config.ts +0 -4
  12. package/components/dialog/index.ts +0 -6
  13. package/components/dialog/src/constants.ts +0 -3
  14. package/components/dialog/src/index.ts +0 -54
  15. package/components/dialog/style/index.scss +0 -18
  16. package/components/dictLabel/index.ts +0 -4
  17. package/components/dictLabel/src/index.vue +0 -21
  18. package/components/drawer/index.ts +0 -4
  19. package/components/drawer/src/constants.ts +0 -3
  20. package/components/drawer/src/index.ts +0 -53
  21. package/components/drawer/style/index.scss +0 -18
  22. package/components/form/index.ts +0 -4
  23. package/components/form/src/FormItem.ts +0 -397
  24. package/components/form/src/constants.ts +0 -161
  25. package/components/form/src/index.ts +0 -207
  26. package/components/form/src/types.ts +0 -39
  27. package/components/form/src/utils.ts +0 -4
  28. package/components/form/style/index.scss +0 -5
  29. package/components/pagination/index.ts +0 -4
  30. package/components/pagination/src/constants.ts +0 -5
  31. package/components/pagination/src/index.ts +0 -50
  32. package/components/search/index.ts +0 -4
  33. package/components/search/src/index.tsx +0 -276
  34. package/components/search/style/index.scss +0 -101
  35. package/components/table/index.ts +0 -4
  36. package/components/table/src/TableColumn.ts +0 -116
  37. package/components/table/src/constants.ts +0 -42
  38. package/components/table/src/index.ts +0 -250
  39. package/components/table/src/index2.ts +0 -219
  40. package/components/table/src/index3.ts +0 -233
  41. package/components/table/src/tableDictLabel.vue +0 -21
  42. package/components/table/src/tableaa.ts +0 -71
  43. package/components/table/src/type.ts +0 -0
  44. package/components/table/type/index.scss +0 -0
  45. package/components/table2/index.ts +0 -4
  46. package/components/table2/src/config.ts +0 -5
  47. package/components/table2/src/index.ts +0 -12
  48. package/components/table2/src/render.ts +0 -136
  49. package/components/table2/src/types.ts +0 -39
  50. package/components/table2/style/index.scss +0 -0
  51. package/components//346/250/241/346/235/277/index.tsx +0 -57
  52. package/components//346/250/241/346/235/277/ttt.ts +0 -66
  53. package/components//346/250/241/346/235/277/ttt.vue +0 -18
  54. package/index.ts +0 -2
  55. package/vite.config.ts +0 -26
  56. package//345/205/266/344/273/226/core/dialog/elementPlus/dialogWarp.vue +0 -151
  57. package//345/205/266/344/273/226/core/dialog/index.ts +0 -10
  58. package//345/205/266/344/273/226/core/form/elementPlus/elementWarp.ts +0 -15
  59. package//345/205/266/344/273/226/core/form/elementPlus/elementWarp.vue +0 -16
  60. package//345/205/266/344/273/226/core/form/elementPlus/formRender.ts +0 -55
  61. package//345/205/266/344/273/226/core/form/index.ts +0 -10
  62. package//345/205/266/344/273/226/core/table/config.ts +0 -5
  63. package//345/205/266/344/273/226/core/table/render.ts +0 -91
  64. package//345/205/266/344/273/226/core/table/warp.ts +0 -11
  65. package//345/205/266/344/273/226/core/utils/fetch.ts +0 -58
  66. package//345/205/266/344/273/226/useMessage.ts +0 -95
@@ -1,4 +0,0 @@
1
- import Table from "./src/index";
2
- export * from "./src/index";
3
- export { Table };
4
- export default Table;
@@ -1,116 +0,0 @@
1
- import {
2
- defineComponent,
3
- h,
4
- getCurrentInstance,
5
- type ExtractPropTypes,
6
- } from "vue";
7
- import { ElTableColumn } from "element-plus";
8
- import {
9
- defaultAttrs,
10
- tableSlots,
11
- tablecolumnSlots,
12
- selectionColumn,
13
- indexColumn,
14
- } from "./constants.ts";
15
- import { isArray, isObject } from "lodash-es";
16
- const propsAttrs = {
17
- module: {
18
- // 公共参数用于业务判断
19
- type: Object,
20
- default: () => {},
21
- },
22
- // isRadio: { // 是否为单选框
23
- // type: Boolean,
24
- // default: false,
25
- // },
26
- // isCheckbox: { // 是否为复选框
27
- // type: Boolean,
28
- // default: false,
29
- // },
30
- columnsItem: {
31
- // 列数据
32
- type: Array,
33
- default: () => [],
34
- },
35
- showSelection: {
36
- // 是否显示选择列
37
- type: Boolean,
38
- default: false,
39
- },
40
- showIndex: {
41
- // 是否显示索引列
42
- type: Boolean,
43
- default: false,
44
- },
45
- prop: {
46
- // 列数据prop
47
- type: String,
48
- default: undefined,
49
- },
50
- // 字典 暂不实现
51
- dictType: { type: String, default: undefined },
52
- // 字典选项
53
- options: { type: Array, default: () => [] },
54
- };
55
-
56
- export type PropsAttrs = ExtractPropTypes<typeof propsAttrs>;
57
-
58
- export default defineComponent({
59
- props: propsAttrs,
60
- // emits: eventList,
61
-
62
- // attrs, emit会继承, slots需要设置
63
- setup(props: PropsAttrs, { attrs, emit, slots, expose }) {
64
- const { tableSlots, events } = inject("tableContext");
65
-
66
- // 属性处理
67
- const getAttrs = () => {
68
- const obj = {
69
- ...defaultAttrs, // 设置默认值
70
- };
71
- return obj;
72
- };
73
- // 事件处理
74
- const getEvents = () => {
75
- const obj = {
76
- ...defaultAttrs, // 设置默认值
77
- };
78
- return obj;
79
- };
80
- // 插槽处理
81
- const getSlots = () => {
82
- // 处理插槽
83
- const obj = {};
84
- // column 自带插槽
85
- tablecolumnSlots.map((name) => {
86
- const slotName = `${prop}.${name}`;
87
- if (tableSlots[slotName]) {
88
- obj[name] = tableSlots[slotName];
89
- }
90
- });
91
- // column 列业务插槽
92
- if (tableSlots[prop]) {
93
- obj["default"] = tableSlots[prop];
94
- }
95
- return obj;
96
- };
97
-
98
- // 渲染表格列
99
- const renderTableColumn = () => {
100
- return h(
101
- ElTableColumn,
102
- {
103
- ...attrs,
104
- class: "c-table-column",
105
- },
106
- {
107
- // default: () => renderTableColumn(),
108
- // ...getSlots(),
109
- }
110
- );
111
- };
112
-
113
- // 返回渲染函数
114
- return () => renderTableColumn();
115
- },
116
- });
@@ -1,42 +0,0 @@
1
- export const defaultAttrs = {
2
- // destroyOnClose: true,
3
- };
4
- export const tableEvents = [
5
- "select",
6
- "select-all",
7
- "selection-change",
8
- "cell-mouse-enter",
9
- "cell-mouse-leave",
10
- "cell-click",
11
- "cell-dblclick",
12
- "cell-contextmenu",
13
- "row-click",
14
- "row-contextmenu",
15
- "row-dblclick",
16
- "header-click",
17
- "header-contextmenu",
18
- "sort-change",
19
- "filter-change",
20
- "current-change",
21
- "header-dragend",
22
- "expand-change",
23
- "scroll",
24
- ];
25
-
26
- export const tableSlots = ["default", "append", "empty"];
27
- export const tablecolumnSlots = ["default", "header", "filter-icon", "expand"];
28
-
29
- export const selectionColumn = {
30
- type: "selection",
31
- width: 50,
32
- align: "center",
33
- };
34
- export const indexColumn = {
35
- type: "index",
36
- width: 50,
37
- align: "center",
38
- };
39
- export const actionColumn = {
40
- prop: "action",
41
- align: "center",
42
- };
@@ -1,250 +0,0 @@
1
- import {
2
- defineComponent,
3
- h,
4
- getCurrentInstance,
5
- type ExtractPropTypes,
6
- } from "vue";
7
- import { ElTable, ElTableColumn } from "element-plus";
8
- import TableDictLabel from "./tableDictLabel.vue";
9
- import {
10
- defaultAttrs,
11
- tableSlots,
12
- tablecolumnSlots,
13
- selectionColumn,
14
- indexColumn,
15
- } from "./constants.ts";
16
- import { isArray, isObject, isFunction } from "lodash-es";
17
- const propsAttrs = {
18
- module: {
19
- type: Object,
20
- default: () => {},
21
- },
22
- params: {
23
- // 额外业务全局参数
24
- type: Object,
25
- default: () => {},
26
- },
27
- // isRadio: { // 是否为单选框
28
- // type: Boolean,
29
- // default: false,
30
- // },
31
- // isCheckbox: { // 是否为复选框
32
- // type: Boolean,
33
- // default: false,
34
- // },
35
- columns: {
36
- // 列数据
37
- type: Array,
38
- default: () => [],
39
- },
40
- showSelection: {
41
- // 是否显示选择列
42
- type: Boolean,
43
- default: false,
44
- },
45
- showIndex: {
46
- // 是否显示索引列
47
- type: Boolean,
48
- default: false,
49
- },
50
- };
51
-
52
- export type PropsAttrs = ExtractPropTypes<typeof propsAttrs>;
53
-
54
- export default defineComponent({
55
- props: propsAttrs,
56
- // emits: eventList,
57
-
58
- // attrs, emit会继承, slots需要设置
59
- setup(props: PropsAttrs, { attrs, emit, slots, expose }) {
60
- // 暴露elTable组件上的方法
61
- const vm = getCurrentInstance(); // 获取虚拟DOM实例
62
- const cTableFnRef = (el) => {
63
- if (!el) return;
64
- vm.exposed = el; // 设置暴露对象
65
- vm.exposeProxy = el; // 设置代理暴露对象
66
- };
67
-
68
- // 暴露方法
69
- // expose({
70
- // // tableRef,
71
- // });
72
-
73
- // // 属性处理
74
- // const getAttrs = () => {
75
- // const obj = {
76
- // ...defaultAttrs, // 设置默认值
77
- // };
78
- // return obj;
79
- // };
80
- // // 事件处理
81
- // const getEvents = () => {
82
- // const obj = {
83
- // ...defaultAttrs, // 设置默认值
84
- // };
85
- // return obj;
86
- // };
87
-
88
- // // 处理列数据-数组
89
- // const getArrayColumn = () => {
90
- // // 递归处理数据
91
- // const list = [];
92
-
93
- // const columnsRecursion = (columns, list) => {
94
- // columns?.map((item) => {
95
- // const { children, ...p } = item;
96
- // // 递归处理子列
97
- // if (isArray(item.children)) {
98
- // item.children = c(item.children, list);
99
- // }
100
- // list.push(p);
101
- // });
102
- // };
103
- // columnsRecursion(props.columns, list);
104
- // return list;
105
- // };
106
-
107
- // 渲染表格列
108
- const renderTableColumn = () => {
109
- const list = [];
110
- // 处理多选与序号列
111
- if (props.showSelection) {
112
- list.push(
113
- h(ElTableColumn, {
114
- type: "selection",
115
- width: 50,
116
- align: "center",
117
- })
118
- );
119
- }
120
- if (props.showIndex) {
121
- list.push(
122
- h(ElTableColumn, {
123
- label: "序号",
124
- type: "index",
125
- width: 60,
126
- align: "center",
127
- })
128
- );
129
- }
130
-
131
- // 列递归渲染
132
- const rColumn = (columns, list) => {
133
- columns.map((item) => {
134
- const { children, ...p } = item;
135
- // 处理 vIf true 显示 false 隐藏
136
- if (
137
- isFunction(item.vIf) &&
138
- item.vIf(props.params) !== undefined &&
139
- !item.vIf(props.params)
140
- ) {
141
- return;
142
- }
143
-
144
- // 处理多级表头
145
- const listSub = [];
146
- if (children?.length) {
147
- rColumn(children, listSub);
148
- }
149
-
150
- // 处理插槽
151
- const itemSlot = {};
152
- // column 自带插槽
153
- tablecolumnSlots.map((name) => {
154
- const slotName = `${item.prop}.${name}`;
155
- if (slots[slotName]) {
156
- itemSlot[name] = slots[slotName];
157
- }
158
- });
159
-
160
- // column 列插槽
161
- if (slots[item.prop]) {
162
- itemSlot["default"] = slots[item.prop];
163
- } else if (isFunction(item.render)) {
164
- // column render 渲染函数
165
- itemSlot["default"] = item.render;
166
- } else if (isArray(item.options)) {
167
- // column 字典数组
168
- itemSlot["default"] = (scope: any) =>
169
- h(TableDictLabel, {
170
- options: item.options,
171
- value: scope.row[item.prop],
172
- });
173
- }
174
-
175
- // 赋值 有插槽
176
- if (Object.keys(itemSlot).length) {
177
- const getColumnContent = () => {
178
- let content = undefined;
179
- if (listSub.length) {
180
- content = { ...itemSlot, default: () => listSub };
181
- } else {
182
- content = { ...itemSlot };
183
- }
184
- return content;
185
- };
186
- list.push(
187
- h(
188
- ElTableColumn,
189
- { ...p, class: "c-table-column" },
190
- getColumnContent()
191
- )
192
- );
193
- } else {
194
- const getColumnContent = () => {
195
- let content = undefined;
196
- if (listSub.length) {
197
- content = { default: () => listSub };
198
- }
199
- return content;
200
- };
201
- // 无插槽
202
- list.push(
203
- h(
204
- ElTableColumn,
205
- { ...p, class: "c-table-column" },
206
- getColumnContent()
207
- )
208
- );
209
- }
210
- });
211
- };
212
- rColumn(props.columns, list);
213
- return list;
214
- };
215
-
216
- // 插槽处理
217
- const getSlots = () => {
218
- const obj = {};
219
- tableSlots.map((name) => {
220
- if (slots[name]) {
221
- obj[name] = slots[name];
222
- }
223
- });
224
- return obj;
225
- };
226
- // 渲染表格组件
227
- const renderTable = () => {
228
- // getColumnList();
229
- // console.log("props", props);
230
- // console.log("attrs", attrs);
231
- // 先拼接好子数据不然会重复执行多次
232
- const columnList = renderTableColumn();
233
- return h(
234
- ElTable,
235
- {
236
- ref: cTableFnRef,
237
- ...attrs,
238
- class: "c-table",
239
- },
240
- {
241
- default: () => columnList,
242
- ...getSlots(),
243
- }
244
- );
245
- };
246
-
247
- // 返回渲染函数
248
- return () => renderTable();
249
- },
250
- });
@@ -1,219 +0,0 @@
1
- import {
2
- defineComponent,
3
- h,
4
- getCurrentInstance,
5
- computed,
6
- type ExtractPropTypes,
7
- } from "vue";
8
- import { ElTable, ElTableColumn } from "element-plus";
9
- import {
10
- defaultAttrs,
11
- tableSlots,
12
- tablecolumnSlots,
13
- selectionColumn,
14
- indexColumn,
15
- } from "./constants.ts";
16
- import { isArray, isObject } from "lodash-es";
17
- const propsAttrs = {
18
- module: {
19
- // 公共参数用于业务判断
20
- type: Object,
21
- default: () => {},
22
- },
23
- // isRadio: { // 是否为单选框
24
- // type: Boolean,
25
- // default: false,
26
- // },
27
- // isCheckbox: { // 是否为复选框
28
- // type: Boolean,
29
- // default: false,
30
- // },
31
- columns: {
32
- // 列数据
33
- type: Array,
34
- default: () => [],
35
- },
36
- showSelection: {
37
- // 是否显示选择列
38
- type: Boolean,
39
- default: false,
40
- },
41
- showIndex: {
42
- // 是否显示索引列
43
- type: Boolean,
44
- default: false,
45
- },
46
- };
47
-
48
- export type PropsAttrs = ExtractPropTypes<typeof propsAttrs>;
49
-
50
- export default defineComponent({
51
- props: propsAttrs,
52
- // emits: eventList,
53
-
54
- // attrs, emit会继承, slots需要设置
55
- setup(props: PropsAttrs, { attrs, emit, slots, expose }) {
56
- // 暴露elTable组件上的方法
57
- const vm = getCurrentInstance(); // 获取虚拟DOM实例
58
- const cTableFnRef = (el) => {
59
- if (!el) return;
60
- vm.exposed = el; // 设置暴露对象
61
- vm.exposeProxy = el; // 设置代理暴露对象
62
- };
63
-
64
- // 暴露方法
65
- expose({
66
- // tableRef,
67
- });
68
-
69
- // 属性处理
70
- const getAttrs = () => {
71
- const obj = {
72
- ...defaultAttrs, // 设置默认值
73
- };
74
- return obj;
75
- };
76
- // 事件处理
77
- const getEvents = () => {
78
- const obj = {
79
- ...defaultAttrs, // 设置默认值
80
- };
81
- return obj;
82
- };
83
-
84
- const columnsList = computed(() => {
85
- let list = [];
86
- list = getArrayColumn();
87
- // 处理多选与序号列
88
- if (props.showSelection) {
89
- list.push(
90
- h(ElTableColumn, {
91
- type: "selection",
92
- width: 55,
93
- })
94
- );
95
- }
96
- if (props.showIndex) {
97
- list.push(
98
- h(ElTableColumn, {
99
- label: "序号",
100
- type: "index",
101
- width: 55,
102
- })
103
- );
104
- }
105
- return list;
106
- });
107
-
108
- // 处理列数据-数组
109
- const getArrayColumn = () => {
110
- console.log("adsadsd");
111
- // 递归处理数据
112
- const list = [];
113
-
114
- const c = (columns, list) => {
115
- columns?.map((item) => {
116
- const { children, ...p } = item;
117
- // 递归处理子列
118
- if (isArray(item.children)) {
119
- item.children = c(item.children, list);
120
- }
121
- list.push(p);
122
- });
123
- };
124
- c(props.columns, list);
125
- console.log("🚀 ~ getArrayColumn ~ props.columns:", props.columns)
126
- console.log("🚀 ~ gggggggg:", list);
127
- return list;
128
- };
129
-
130
- // 渲染表格列
131
- const renderTableColumn = () => {
132
- const list = [];
133
-
134
- // 列递归渲染
135
- const rColumn = (columns, list) => {
136
- console.log("🚀 ~ rColumn ~ columns:", columns);
137
- columns?.map((item) => {
138
- const { children, ...p } = item;
139
-
140
- // 处理多级表头
141
- const listSub = [];
142
- if (children?.length) {
143
- rColumn(children, listSub);
144
- }
145
-
146
- // 处理插槽
147
- const itemSlot = {};
148
- // column 自带插槽
149
- tablecolumnSlots.map((name) => {
150
- const slotName = `${item.prop}.${name}`;
151
- if (slots[slotName]) {
152
- itemSlot[name] = slots[slotName];
153
- }
154
- });
155
-
156
- // column 列插槽
157
- if (slots[item.prop]) {
158
- itemSlot["default"] = slots[item.prop];
159
- }
160
-
161
- // 赋值
162
- if (Object.keys(itemSlot).length) {
163
- list.push(
164
- h(
165
- ElTableColumn,
166
- { ...p, class: "c-table-column" },
167
- listSub.length
168
- ? { ...itemSlot, default: () => listSub }
169
- : { ...itemSlot }
170
- )
171
- );
172
- } else {
173
- list.push(
174
- h(
175
- ElTableColumn,
176
- { ...p, class: "c-table-column" },
177
- listSub.length ? { default: () => listSub } : undefined
178
- )
179
- );
180
- }
181
- });
182
- };
183
- rColumn(columnsList.value, list);
184
- return list;
185
- };
186
-
187
- // 插槽处理
188
- const getSlots = () => {
189
- const obj = {};
190
- tableSlots.map((name) => {
191
- if (slots[name]) {
192
- obj[name] = slots[name];
193
- }
194
- });
195
- return obj;
196
- };
197
- // 渲染表格组件
198
- const renderTable = () => {
199
- // getColumnList();
200
- console.log("props", props);
201
- console.log("attrs", attrs);
202
- return h(
203
- ElTable,
204
- {
205
- ref: cTableFnRef,
206
- ...attrs,
207
- class: "c-table",
208
- },
209
- {
210
- default: () => renderTableColumn(),
211
- ...getSlots(),
212
- }
213
- );
214
- };
215
-
216
- // 返回渲染函数
217
- return () => renderTable();
218
- },
219
- });