@tmagic/element-plus-adapter 1.8.0-beta.10 → 1.8.0-beta.12

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/dist/es/index.js CHANGED
@@ -166,7 +166,19 @@ var adapter = {
166
166
  },
167
167
  tag: {
168
168
  component: ElTag,
169
- props: (props) => props
169
+ props: (props) => {
170
+ if (props.type && ![
171
+ "primary",
172
+ "success",
173
+ "info",
174
+ "warning",
175
+ "danger"
176
+ ].includes(props.type)) return {
177
+ ...props,
178
+ type: "primary"
179
+ };
180
+ return props;
181
+ }
170
182
  },
171
183
  timePicker: {
172
184
  component: ElTimePicker,
@@ -286,7 +286,19 @@
286
286
  },
287
287
  tag: {
288
288
  component: element_plus.ElTag,
289
- props: (props) => props
289
+ props: (props) => {
290
+ if (props.type && ![
291
+ "primary",
292
+ "success",
293
+ "info",
294
+ "warning",
295
+ "danger"
296
+ ].includes(props.type)) return {
297
+ ...props,
298
+ type: "primary"
299
+ };
300
+ return props;
301
+ }
290
302
  },
291
303
  timePicker: {
292
304
  component: element_plus.ElTimePicker,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.8.0-beta.10",
2
+ "version": "1.8.0-beta.12",
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.38",
40
+ "vue": "^3.5.40",
41
41
  "typescript": "^6.0.3",
42
- "@tmagic/design": "1.8.0-beta.10"
42
+ "@tmagic/design": "1.8.0-beta.12"
43
43
  },
44
44
  "peerDependenciesMeta": {
45
45
  "typescript": {
package/src/index.ts CHANGED
@@ -296,7 +296,13 @@ const adapter: DesignPluginOptions = {
296
296
 
297
297
  tag: {
298
298
  component: ElTag as any,
299
- props: (props: TagProps) => props,
299
+ props: (props: TagProps) => {
300
+ const VALID_TAG_TYPES = ['primary', 'success', 'info', 'warning', 'danger'];
301
+ if (props.type && !VALID_TAG_TYPES.includes(props.type)) {
302
+ return { ...props, type: 'primary' };
303
+ }
304
+ return props;
305
+ },
300
306
  },
301
307
 
302
308
  timePicker: {