@tmagic/element-plus-adapter 1.7.7 → 1.7.8-beta.2
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 +235 -164
- package/dist/es/Table.js +5 -0
- package/dist/es/Table.vue_vue_type_script_setup_true_lang.js +122 -0
- package/dist/es/index.js +191 -0
- package/dist/tmagic-element-plus-adapter.umd.cjs +310 -321
- package/package.json +5 -4
- package/types/index.d.ts +4 -3
- package/dist/tmagic-element-plus-adapter.js +0 -316
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.7.
|
|
2
|
+
"version": "1.7.8-beta.2",
|
|
3
3
|
"name": "@tmagic/element-plus-adapter",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
5
6
|
"main": "dist/tmagic-element-plus-adapter.umd.cjs",
|
|
6
|
-
"module": "dist/
|
|
7
|
+
"module": "dist/es/index.js",
|
|
7
8
|
"types": "types/index.d.ts",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
11
|
"types": "./types/index.d.ts",
|
|
11
|
-
"import": "./dist/
|
|
12
|
+
"import": "./dist/es/index.js",
|
|
12
13
|
"require": "./dist/tmagic-element-plus-adapter.umd.cjs"
|
|
13
14
|
},
|
|
14
15
|
"./*": "./*"
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"element-plus": ">=2.9.0",
|
|
39
40
|
"vue": "^3.5.24",
|
|
40
41
|
"typescript": "^5.9.3",
|
|
41
|
-
"@tmagic/design": "1.7.
|
|
42
|
+
"@tmagic/design": "1.7.8-beta.2"
|
|
42
43
|
},
|
|
43
44
|
"peerDependenciesMeta": {
|
|
44
45
|
"typescript": {
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { DesignPluginOptions } from
|
|
1
|
+
import { DesignPluginOptions } from "@tmagic/design";
|
|
2
2
|
|
|
3
|
+
//#region temp/packages/element-plus-adapter/src/index.d.ts
|
|
3
4
|
declare const adapter: DesignPluginOptions;
|
|
4
|
-
|
|
5
|
-
export { adapter as default };
|
|
5
|
+
//#endregion
|
|
6
|
+
export { adapter as default };
|
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
import { ElTable, ElTableColumn, ElLoading, ElPopconfirm, ElUpload, ElTooltip, ElTimePicker, ElTag, ElTabs, ElTabPane, ElSwitch, ElSteps, ElStep, ElSelect, ElScrollbar, ElRow, ElRadioGroup, ElRadioButton, ElRadio, ElPagination, ElOptionGroup, ElOption, ElInputNumber, ElInput, ElIcon, ElFormItem, ElForm, ElDropdownMenu, ElDropdownItem, ElDropdown, ElDrawer, ElDivider, ElDialog, ElDatePicker, ElColorPicker, ElCollapseItem, ElCollapse, ElCol, ElCheckboxGroup, ElCheckbox, ElCascader, ElCard, ElButton, ElBadge, ElAutocomplete, ElMessageBox, ElMessage, useZIndex } from 'element-plus';
|
|
2
|
-
import { defineComponent, useTemplateRef, createBlock, openBlock, unref, withCtx, createElementBlock, Fragment, renderList, mergeProps, createSlots, resolveDynamicComponent } from 'vue';
|
|
3
|
-
|
|
4
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
-
...{
|
|
6
|
-
name: "TElAdapterTable"
|
|
7
|
-
},
|
|
8
|
-
__name: "Table",
|
|
9
|
-
props: {
|
|
10
|
-
columns: {},
|
|
11
|
-
data: {},
|
|
12
|
-
border: { type: Boolean },
|
|
13
|
-
maxHeight: {},
|
|
14
|
-
defaultExpandAll: { type: Boolean },
|
|
15
|
-
showHeader: { type: Boolean },
|
|
16
|
-
rowKey: {},
|
|
17
|
-
treeProps: {},
|
|
18
|
-
emptyText: {},
|
|
19
|
-
tooltipEffect: {},
|
|
20
|
-
tooltipOptions: {},
|
|
21
|
-
showOverflowTooltip: { type: Boolean },
|
|
22
|
-
spanMethod: { type: Function }
|
|
23
|
-
},
|
|
24
|
-
emits: ["sort-change", "select", "select-all", "selection-change", "expand-change", "cell-click"],
|
|
25
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
26
|
-
const emit = __emit;
|
|
27
|
-
const tableRef = useTemplateRef("table");
|
|
28
|
-
const sortChange = (data) => {
|
|
29
|
-
emit("sort-change", data);
|
|
30
|
-
};
|
|
31
|
-
const selectHandler = (...args) => {
|
|
32
|
-
emit("select", ...args);
|
|
33
|
-
};
|
|
34
|
-
const selectAllHandler = (...args) => {
|
|
35
|
-
emit("select-all", ...args);
|
|
36
|
-
};
|
|
37
|
-
const selectionChangeHandler = (...args) => {
|
|
38
|
-
emit("selection-change", ...args);
|
|
39
|
-
};
|
|
40
|
-
const cellClickHandler = (...args) => {
|
|
41
|
-
emit("cell-click", ...args);
|
|
42
|
-
};
|
|
43
|
-
const expandChange = (...args) => {
|
|
44
|
-
emit("expand-change", ...args);
|
|
45
|
-
};
|
|
46
|
-
const toggleRowSelection = (row, selected) => {
|
|
47
|
-
tableRef.value?.toggleRowSelection(row, selected);
|
|
48
|
-
};
|
|
49
|
-
const toggleRowExpansion = (row, expanded) => {
|
|
50
|
-
tableRef.value?.toggleRowExpansion(row, expanded);
|
|
51
|
-
};
|
|
52
|
-
const clearSelection = () => {
|
|
53
|
-
tableRef.value?.clearSelection();
|
|
54
|
-
};
|
|
55
|
-
__expose({
|
|
56
|
-
getEl: () => tableRef.value?.$el,
|
|
57
|
-
getTableRef: () => tableRef.value,
|
|
58
|
-
clearSelection,
|
|
59
|
-
toggleRowSelection,
|
|
60
|
-
toggleRowExpansion
|
|
61
|
-
});
|
|
62
|
-
return (_ctx, _cache) => {
|
|
63
|
-
return openBlock(), createBlock(unref(ElTable), {
|
|
64
|
-
ref: "table",
|
|
65
|
-
data: __props.data,
|
|
66
|
-
border: __props.border,
|
|
67
|
-
"max-height": __props.maxHeight,
|
|
68
|
-
"default-expand-all": __props.defaultExpandAll,
|
|
69
|
-
"show-header": __props.showHeader,
|
|
70
|
-
"row-key": __props.rowKey,
|
|
71
|
-
"tree-props": __props.treeProps,
|
|
72
|
-
"empty-text": __props.emptyText,
|
|
73
|
-
"show-overflow-tooltip": __props.showOverflowTooltip,
|
|
74
|
-
"tooltip-effect": __props.tooltipEffect,
|
|
75
|
-
"tooltip-options": __props.tooltipOptions,
|
|
76
|
-
"span-method": __props.spanMethod,
|
|
77
|
-
onSortChange: sortChange,
|
|
78
|
-
onSelect: selectHandler,
|
|
79
|
-
onSelectAll: selectAllHandler,
|
|
80
|
-
onSelectionChange: selectionChangeHandler,
|
|
81
|
-
onCellClick: cellClickHandler,
|
|
82
|
-
onExpandChange: expandChange
|
|
83
|
-
}, {
|
|
84
|
-
default: withCtx(() => [
|
|
85
|
-
(openBlock(true), createElementBlock(
|
|
86
|
-
Fragment,
|
|
87
|
-
null,
|
|
88
|
-
renderList(__props.columns, (item, columnIndex) => {
|
|
89
|
-
return openBlock(), createBlock(
|
|
90
|
-
unref(ElTableColumn),
|
|
91
|
-
mergeProps({
|
|
92
|
-
key: columnIndex,
|
|
93
|
-
ref_for: true
|
|
94
|
-
}, item.props || {}),
|
|
95
|
-
createSlots({
|
|
96
|
-
_: 2
|
|
97
|
-
/* DYNAMIC */
|
|
98
|
-
}, [
|
|
99
|
-
item.title ? {
|
|
100
|
-
name: "header",
|
|
101
|
-
fn: withCtx((scope) => [
|
|
102
|
-
(openBlock(), createBlock(resolveDynamicComponent(item.title(scope))))
|
|
103
|
-
]),
|
|
104
|
-
key: "0"
|
|
105
|
-
} : void 0,
|
|
106
|
-
item.cell ? {
|
|
107
|
-
name: "default",
|
|
108
|
-
fn: withCtx((scope) => [
|
|
109
|
-
(openBlock(), createBlock(resolveDynamicComponent(item.cell(scope))))
|
|
110
|
-
]),
|
|
111
|
-
key: "1"
|
|
112
|
-
} : void 0
|
|
113
|
-
]),
|
|
114
|
-
1040
|
|
115
|
-
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
116
|
-
);
|
|
117
|
-
}),
|
|
118
|
-
128
|
|
119
|
-
/* KEYED_FRAGMENT */
|
|
120
|
-
))
|
|
121
|
-
]),
|
|
122
|
-
_: 1
|
|
123
|
-
/* STABLE */
|
|
124
|
-
}, 8, ["data", "border", "max-height", "default-expand-all", "show-header", "row-key", "tree-props", "empty-text", "show-overflow-tooltip", "tooltip-effect", "tooltip-options", "span-method"]);
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
const adapter = {
|
|
130
|
-
adapterType: "element-plus",
|
|
131
|
-
useZIndex,
|
|
132
|
-
message: ElMessage,
|
|
133
|
-
messageBox: ElMessageBox,
|
|
134
|
-
components: {
|
|
135
|
-
autocomplete: {
|
|
136
|
-
component: ElAutocomplete,
|
|
137
|
-
props: (props) => props
|
|
138
|
-
},
|
|
139
|
-
badge: {
|
|
140
|
-
component: ElBadge,
|
|
141
|
-
props: (props) => props
|
|
142
|
-
},
|
|
143
|
-
button: {
|
|
144
|
-
component: ElButton,
|
|
145
|
-
props: (props) => {
|
|
146
|
-
return {
|
|
147
|
-
...props,
|
|
148
|
-
type: props.type === "default" ? "" : props.type
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
card: {
|
|
153
|
-
component: ElCard,
|
|
154
|
-
props: (props) => props
|
|
155
|
-
},
|
|
156
|
-
cascader: {
|
|
157
|
-
component: ElCascader,
|
|
158
|
-
props: (props) => props
|
|
159
|
-
},
|
|
160
|
-
checkbox: {
|
|
161
|
-
component: ElCheckbox,
|
|
162
|
-
props: (props) => props
|
|
163
|
-
},
|
|
164
|
-
checkboxGroup: {
|
|
165
|
-
component: ElCheckboxGroup,
|
|
166
|
-
props: (props) => props
|
|
167
|
-
},
|
|
168
|
-
col: {
|
|
169
|
-
component: ElCol,
|
|
170
|
-
props: (props) => props
|
|
171
|
-
},
|
|
172
|
-
collapse: {
|
|
173
|
-
component: ElCollapse,
|
|
174
|
-
props: (props) => props
|
|
175
|
-
},
|
|
176
|
-
collapseItem: {
|
|
177
|
-
component: ElCollapseItem,
|
|
178
|
-
props: (props) => props
|
|
179
|
-
},
|
|
180
|
-
colorPicker: {
|
|
181
|
-
component: ElColorPicker,
|
|
182
|
-
props: (props) => props
|
|
183
|
-
},
|
|
184
|
-
datePicker: {
|
|
185
|
-
component: ElDatePicker,
|
|
186
|
-
props: (props) => props
|
|
187
|
-
},
|
|
188
|
-
dialog: {
|
|
189
|
-
component: ElDialog,
|
|
190
|
-
props: (props) => props
|
|
191
|
-
},
|
|
192
|
-
divider: {
|
|
193
|
-
component: ElDivider,
|
|
194
|
-
props: (props) => props
|
|
195
|
-
},
|
|
196
|
-
drawer: {
|
|
197
|
-
component: ElDrawer,
|
|
198
|
-
props: (props) => props
|
|
199
|
-
},
|
|
200
|
-
dropdown: {
|
|
201
|
-
component: ElDropdown,
|
|
202
|
-
props: (props) => props
|
|
203
|
-
},
|
|
204
|
-
dropdownItem: {
|
|
205
|
-
component: ElDropdownItem,
|
|
206
|
-
props: (props) => props
|
|
207
|
-
},
|
|
208
|
-
dropdownMenu: {
|
|
209
|
-
component: ElDropdownMenu,
|
|
210
|
-
props: () => ({})
|
|
211
|
-
},
|
|
212
|
-
form: {
|
|
213
|
-
component: ElForm,
|
|
214
|
-
props: (props) => props
|
|
215
|
-
},
|
|
216
|
-
formItem: {
|
|
217
|
-
component: ElFormItem,
|
|
218
|
-
props: (props) => props
|
|
219
|
-
},
|
|
220
|
-
icon: {
|
|
221
|
-
component: ElIcon,
|
|
222
|
-
props: (props) => props
|
|
223
|
-
},
|
|
224
|
-
input: {
|
|
225
|
-
component: ElInput,
|
|
226
|
-
props: (props) => props
|
|
227
|
-
},
|
|
228
|
-
inputNumber: {
|
|
229
|
-
component: ElInputNumber,
|
|
230
|
-
props: (props) => props
|
|
231
|
-
},
|
|
232
|
-
option: {
|
|
233
|
-
component: ElOption,
|
|
234
|
-
props: (props) => props
|
|
235
|
-
},
|
|
236
|
-
optionGroup: {
|
|
237
|
-
component: ElOptionGroup,
|
|
238
|
-
props: (props) => props
|
|
239
|
-
},
|
|
240
|
-
pagination: {
|
|
241
|
-
component: ElPagination,
|
|
242
|
-
props: (props) => props
|
|
243
|
-
},
|
|
244
|
-
radio: {
|
|
245
|
-
component: ElRadio,
|
|
246
|
-
props: (props) => props
|
|
247
|
-
},
|
|
248
|
-
radioButton: {
|
|
249
|
-
component: ElRadioButton,
|
|
250
|
-
props: (props) => props
|
|
251
|
-
},
|
|
252
|
-
radioGroup: {
|
|
253
|
-
component: ElRadioGroup,
|
|
254
|
-
props: (props) => props
|
|
255
|
-
},
|
|
256
|
-
row: {
|
|
257
|
-
component: ElRow,
|
|
258
|
-
props: () => ({})
|
|
259
|
-
},
|
|
260
|
-
scrollbar: {
|
|
261
|
-
component: ElScrollbar,
|
|
262
|
-
props: () => ({})
|
|
263
|
-
},
|
|
264
|
-
select: {
|
|
265
|
-
component: ElSelect,
|
|
266
|
-
props: (props) => props
|
|
267
|
-
},
|
|
268
|
-
step: {
|
|
269
|
-
component: ElStep,
|
|
270
|
-
props: (props) => props
|
|
271
|
-
},
|
|
272
|
-
steps: {
|
|
273
|
-
component: ElSteps,
|
|
274
|
-
props: (props) => props
|
|
275
|
-
},
|
|
276
|
-
switch: {
|
|
277
|
-
component: ElSwitch,
|
|
278
|
-
props: (props) => props
|
|
279
|
-
},
|
|
280
|
-
table: {
|
|
281
|
-
component: _sfc_main,
|
|
282
|
-
props: (props) => props
|
|
283
|
-
},
|
|
284
|
-
tabPane: {
|
|
285
|
-
component: ElTabPane,
|
|
286
|
-
props: (props) => props
|
|
287
|
-
},
|
|
288
|
-
tabs: {
|
|
289
|
-
component: ElTabs,
|
|
290
|
-
props: (props) => props
|
|
291
|
-
},
|
|
292
|
-
tag: {
|
|
293
|
-
component: ElTag,
|
|
294
|
-
props: (props) => props
|
|
295
|
-
},
|
|
296
|
-
timePicker: {
|
|
297
|
-
component: ElTimePicker,
|
|
298
|
-
props: (props) => props
|
|
299
|
-
},
|
|
300
|
-
tooltip: {
|
|
301
|
-
component: ElTooltip,
|
|
302
|
-
props: (props) => props
|
|
303
|
-
},
|
|
304
|
-
upload: {
|
|
305
|
-
component: ElUpload,
|
|
306
|
-
props: (props) => props
|
|
307
|
-
},
|
|
308
|
-
popconfirm: {
|
|
309
|
-
component: ElPopconfirm,
|
|
310
|
-
props: (props) => props
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
loading: ElLoading.directive
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
export { adapter as default };
|