@tmagic/element-plus-adapter 1.8.0-manmanyu.22 → 1.8.0-manmanyu.25

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
@@ -173,7 +173,19 @@ var adapter = {
173
173
  },
174
174
  tag: {
175
175
  component: ElTag,
176
- props: (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
+ }
177
189
  },
178
190
  timePicker: {
179
191
  component: ElTimePicker,
@@ -293,7 +293,19 @@
293
293
  },
294
294
  tag: {
295
295
  component: element_plus.ElTag,
296
- props: (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
+ }
297
309
  },
298
310
  timePicker: {
299
311
  component: element_plus.ElTimePicker,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.8.0-manmanyu.22",
2
+ "version": "1.8.0-manmanyu.25",
3
3
  "name": "@tmagic/element-plus-adapter",
4
4
  "type": "module",
5
5
  "sideEffects": false,
@@ -39,7 +39,7 @@
39
39
  "element-plus": ">=2.9.0",
40
40
  "vue": "^3.5.38",
41
41
  "typescript": "^6.0.3",
42
- "@tmagic/design": "1.8.0-manmanyu.22"
42
+ "@tmagic/design": "1.8.0-manmanyu.25"
43
43
  },
44
44
  "peerDependenciesMeta": {
45
45
  "typescript": {
package/src/index.ts CHANGED
@@ -303,7 +303,13 @@ const adapter: DesignPluginOptions = {
303
303
 
304
304
  tag: {
305
305
  component: ElTag as any,
306
- props: (props: TagProps) => props,
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
+ },
307
313
  },
308
314
 
309
315
  timePicker: {