@tmagic/element-plus-adapter 1.7.7 → 1.7.8-beta.1

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