@tmagic/element-plus-adapter 1.8.0-beta.2 → 1.8.0-beta.21
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,7 +1,7 @@
|
|
|
1
1
|
import { ElTable, ElTableColumn } from "element-plus";
|
|
2
2
|
import { Fragment, createBlock, createElementBlock, createSlots, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent, unref, useTemplateRef, withCtx } from "vue";
|
|
3
3
|
//#region packages/element-plus-adapter/src/Table.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var Table_vue_vue_type_script_setup_true_lang_default =
|
|
4
|
+
var Table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
5
|
name: "TElAdapterTable",
|
|
6
6
|
__name: "Table",
|
|
7
7
|
props: {
|
package/dist/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Table_default from "./Table.js";
|
|
2
|
-
import { ElAutocomplete, ElBadge, ElButton, ElCard, ElCascader, ElCheckbox, ElCheckboxGroup, ElCol, ElCollapse, ElCollapseItem, ElColorPicker, ElDatePicker, ElDialog, ElDivider, ElDrawer, ElDropdown, ElDropdownItem, ElDropdownMenu, ElForm, ElFormItem, ElIcon, ElInput, ElInputNumber, ElLoading, ElMessage, ElMessageBox, ElOption, ElOptionGroup, ElPagination, ElPopconfirm, ElRadio, ElRadioButton, ElRadioGroup, ElRow, ElScrollbar, ElSelect, ElStep, ElSteps, ElSwitch, ElTabPane, ElTabs, ElTag, ElTimePicker, ElTooltip, ElUpload, useZIndex } from "element-plus";
|
|
2
|
+
import { ElAlert, ElAutocomplete, ElBadge, ElButton, ElCard, ElCascader, ElCheckbox, ElCheckboxGroup, ElCol, ElCollapse, ElCollapseItem, ElColorPicker, ElDatePicker, ElDialog, ElDivider, ElDrawer, ElDropdown, ElDropdownItem, ElDropdownMenu, ElForm, ElFormItem, ElIcon, ElInput, ElInputNumber, ElLoading, ElMessage, ElMessageBox, ElOption, ElOptionGroup, ElPagination, ElPopconfirm, ElRadio, ElRadioButton, ElRadioGroup, ElRow, ElScrollbar, ElSelect, ElStep, ElSteps, ElSwitch, ElTabPane, ElTabs, ElTag, ElTimePicker, ElTooltip, ElUpload, useZIndex } from "element-plus";
|
|
3
3
|
//#region packages/element-plus-adapter/src/index.ts
|
|
4
4
|
var adapter = {
|
|
5
5
|
adapterType: "element-plus",
|
|
@@ -11,6 +11,10 @@ var adapter = {
|
|
|
11
11
|
component: ElAutocomplete,
|
|
12
12
|
props: (props) => props
|
|
13
13
|
},
|
|
14
|
+
alert: {
|
|
15
|
+
component: ElAlert,
|
|
16
|
+
props: (props) => props
|
|
17
|
+
},
|
|
14
18
|
badge: {
|
|
15
19
|
component: ElBadge,
|
|
16
20
|
props: (props) => props
|
|
@@ -138,7 +142,10 @@ var adapter = {
|
|
|
138
142
|
},
|
|
139
143
|
select: {
|
|
140
144
|
component: ElSelect,
|
|
141
|
-
props: (props) =>
|
|
145
|
+
props: (props) => ({
|
|
146
|
+
remoteShowSuffix: true,
|
|
147
|
+
...props
|
|
148
|
+
})
|
|
142
149
|
},
|
|
143
150
|
step: {
|
|
144
151
|
component: ElStep,
|
|
@@ -166,7 +173,19 @@ var adapter = {
|
|
|
166
173
|
},
|
|
167
174
|
tag: {
|
|
168
175
|
component: ElTag,
|
|
169
|
-
props: (props) =>
|
|
176
|
+
props: (props) => {
|
|
177
|
+
if (props.type && ![
|
|
178
|
+
"primary",
|
|
179
|
+
"success",
|
|
180
|
+
"info",
|
|
181
|
+
"warning",
|
|
182
|
+
"danger"
|
|
183
|
+
].includes(props.type)) return {
|
|
184
|
+
...props,
|
|
185
|
+
type: "primary"
|
|
186
|
+
};
|
|
187
|
+
return props;
|
|
188
|
+
}
|
|
170
189
|
},
|
|
171
190
|
timePicker: {
|
|
172
191
|
component: ElTimePicker,
|
|
@@ -131,6 +131,10 @@
|
|
|
131
131
|
component: element_plus.ElAutocomplete,
|
|
132
132
|
props: (props) => props
|
|
133
133
|
},
|
|
134
|
+
alert: {
|
|
135
|
+
component: element_plus.ElAlert,
|
|
136
|
+
props: (props) => props
|
|
137
|
+
},
|
|
134
138
|
badge: {
|
|
135
139
|
component: element_plus.ElBadge,
|
|
136
140
|
props: (props) => props
|
|
@@ -258,7 +262,10 @@
|
|
|
258
262
|
},
|
|
259
263
|
select: {
|
|
260
264
|
component: element_plus.ElSelect,
|
|
261
|
-
props: (props) =>
|
|
265
|
+
props: (props) => ({
|
|
266
|
+
remoteShowSuffix: true,
|
|
267
|
+
...props
|
|
268
|
+
})
|
|
262
269
|
},
|
|
263
270
|
step: {
|
|
264
271
|
component: element_plus.ElStep,
|
|
@@ -286,7 +293,19 @@
|
|
|
286
293
|
},
|
|
287
294
|
tag: {
|
|
288
295
|
component: element_plus.ElTag,
|
|
289
|
-
props: (props) =>
|
|
296
|
+
props: (props) => {
|
|
297
|
+
if (props.type && ![
|
|
298
|
+
"primary",
|
|
299
|
+
"success",
|
|
300
|
+
"info",
|
|
301
|
+
"warning",
|
|
302
|
+
"danger"
|
|
303
|
+
].includes(props.type)) return {
|
|
304
|
+
...props,
|
|
305
|
+
type: "primary"
|
|
306
|
+
};
|
|
307
|
+
return props;
|
|
308
|
+
}
|
|
290
309
|
},
|
|
291
310
|
timePicker: {
|
|
292
311
|
component: element_plus.ElTimePicker,
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.8.0-beta.
|
|
2
|
+
"version": "1.8.0-beta.21",
|
|
3
3
|
"name": "@tmagic/element-plus-adapter",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
],
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"element-plus": ">=2.9.0",
|
|
40
|
-
"vue": "^3.5.
|
|
40
|
+
"vue": "^3.5.40",
|
|
41
41
|
"typescript": "^6.0.3",
|
|
42
|
-
"@tmagic/design": "1.8.0-beta.
|
|
42
|
+
"@tmagic/design": "1.8.0-beta.21"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"typescript": {
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ElAlert,
|
|
2
3
|
ElAutocomplete,
|
|
3
4
|
ElBadge,
|
|
4
5
|
ElButton,
|
|
@@ -48,6 +49,7 @@ import {
|
|
|
48
49
|
} from 'element-plus';
|
|
49
50
|
|
|
50
51
|
import type {
|
|
52
|
+
AlertProps,
|
|
51
53
|
AutocompleteProps,
|
|
52
54
|
BadgeProps,
|
|
53
55
|
ButtonProps,
|
|
@@ -104,6 +106,11 @@ const adapter: DesignPluginOptions = {
|
|
|
104
106
|
props: (props: AutocompleteProps) => props,
|
|
105
107
|
},
|
|
106
108
|
|
|
109
|
+
alert: {
|
|
110
|
+
component: ElAlert as any,
|
|
111
|
+
props: (props: AlertProps) => props,
|
|
112
|
+
},
|
|
113
|
+
|
|
107
114
|
badge: {
|
|
108
115
|
component: ElBadge as any,
|
|
109
116
|
props: (props: BadgeProps) => props,
|
|
@@ -261,7 +268,7 @@ const adapter: DesignPluginOptions = {
|
|
|
261
268
|
|
|
262
269
|
select: {
|
|
263
270
|
component: ElSelect as any,
|
|
264
|
-
props: (props: SelectProps) => props,
|
|
271
|
+
props: (props: SelectProps) => ({ remoteShowSuffix: true, ...props }),
|
|
265
272
|
},
|
|
266
273
|
|
|
267
274
|
step: {
|
|
@@ -296,7 +303,13 @@ const adapter: DesignPluginOptions = {
|
|
|
296
303
|
|
|
297
304
|
tag: {
|
|
298
305
|
component: ElTag as any,
|
|
299
|
-
props: (props: TagProps) =>
|
|
306
|
+
props: (props: TagProps) => {
|
|
307
|
+
const VALID_TAG_TYPES = ['primary', 'success', 'info', 'warning', 'danger'];
|
|
308
|
+
if (props.type && !VALID_TAG_TYPES.includes(props.type)) {
|
|
309
|
+
return { ...props, type: 'primary' };
|
|
310
|
+
}
|
|
311
|
+
return props;
|
|
312
|
+
},
|
|
300
313
|
},
|
|
301
314
|
|
|
302
315
|
timePicker: {
|