@tmagic/element-plus-adapter 1.8.4-beta.1 → 1.8.5

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/Table.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import Table_vue_vue_type_script_setup_true_lang_default from "./Table.vue_vue_type_script_setup_true_lang.js";
2
- //#region packages/element-plus-adapter/src/Table.vue
2
+ // packages/element-plus-adapter/src/Table.vue
3
3
  var Table_default = Table_vue_vue_type_script_setup_true_lang_default;
4
- //#endregion
5
4
  export { Table_default as default };
@@ -1,6 +1,6 @@
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
- //#region packages/element-plus-adapter/src/Table.vue?vue&type=script&setup=true&lang.ts
3
+ // packages/element-plus-adapter/src/Table.vue?vue&type=script&setup=true&lang.ts
4
4
  var Table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
5
5
  name: "TElAdapterTable",
6
6
  __name: "Table",
@@ -118,5 +118,4 @@ var Table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
118
118
  };
119
119
  }
120
120
  });
121
- //#endregion
122
121
  export { Table_vue_vue_type_script_setup_true_lang_default as default };
package/dist/es/index.js CHANGED
@@ -1,6 +1,27 @@
1
1
  import Table_default from "./Table.js";
2
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
- //#region packages/element-plus-adapter/src/index.ts
3
+ // packages/element-plus-adapter/src/index.ts
4
+ /**
5
+ * PopconfirmProps 的复合方位沿用 TDesign 命名(如 right-top),
6
+ * Element Plus 使用 popper.js 的 *-start / *-end 命名,未转换时这些取值会被 Popper 忽略。
7
+ */
8
+ var elementPlusPlacements = {
9
+ "top-left": "top-start",
10
+ "top-right": "top-end",
11
+ "bottom-left": "bottom-start",
12
+ "bottom-right": "bottom-end",
13
+ "left-top": "left-start",
14
+ "left-bottom": "left-end",
15
+ "right-top": "right-start",
16
+ "right-bottom": "right-end"
17
+ };
18
+ var popconfirmProps = (props) => {
19
+ const placement = props.placement ? elementPlusPlacements[props.placement] : void 0;
20
+ return placement ? {
21
+ ...props,
22
+ placement
23
+ } : props;
24
+ };
4
25
  var adapter = {
5
26
  adapterType: "element-plus",
6
27
  useZIndex,
@@ -201,10 +222,9 @@ var adapter = {
201
222
  },
202
223
  popconfirm: {
203
224
  component: ElPopconfirm,
204
- props: (props) => props
225
+ props: popconfirmProps
205
226
  }
206
227
  },
207
228
  loading: ElLoading.directive
208
229
  };
209
- //#endregion
210
230
  export { adapter as default };
@@ -1,8 +1,7 @@
1
1
  (function(global, factory) {
2
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
3
  })(this, function(element_plus, vue) {
4
- //#endregion
5
- //#region packages/element-plus-adapter/src/Table.vue
4
+ // packages/element-plus-adapter/src/Table.vue
6
5
  var Table_default = /* @__PURE__ */ (0, vue.defineComponent)({
7
6
  name: "TElAdapterTable",
8
7
  __name: "Table",
@@ -120,7 +119,28 @@
120
119
  };
121
120
  }
122
121
  });
123
- //#endregion
122
+ // packages/element-plus-adapter/src/index.ts
123
+ /**
124
+ * PopconfirmProps 的复合方位沿用 TDesign 命名(如 right-top),
125
+ * Element Plus 使用 popper.js 的 *-start / *-end 命名,未转换时这些取值会被 Popper 忽略。
126
+ */
127
+ var elementPlusPlacements = {
128
+ "top-left": "top-start",
129
+ "top-right": "top-end",
130
+ "bottom-left": "bottom-start",
131
+ "bottom-right": "bottom-end",
132
+ "left-top": "left-start",
133
+ "left-bottom": "left-end",
134
+ "right-top": "right-start",
135
+ "right-bottom": "right-end"
136
+ };
137
+ var popconfirmProps = (props) => {
138
+ const placement = props.placement ? elementPlusPlacements[props.placement] : void 0;
139
+ return placement ? {
140
+ ...props,
141
+ placement
142
+ } : props;
143
+ };
124
144
  return {
125
145
  adapterType: "element-plus",
126
146
  useZIndex: element_plus.useZIndex,
@@ -321,7 +341,7 @@
321
341
  },
322
342
  popconfirm: {
323
343
  component: element_plus.ElPopconfirm,
324
- props: (props) => props
344
+ props: popconfirmProps
325
345
  }
326
346
  },
327
347
  loading: element_plus.ElLoading.directive
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.8.4-beta.1",
2
+ "version": "1.8.5",
3
3
  "name": "@tmagic/element-plus-adapter",
4
4
  "type": "module",
5
5
  "sideEffects": false,
@@ -36,10 +36,10 @@
36
36
  "typescript"
37
37
  ],
38
38
  "peerDependencies": {
39
+ "@tmagic/design": "1.8.5",
39
40
  "element-plus": ">=2.9.0",
40
41
  "vue": "^3.5.44",
41
- "typescript": "^6.0.3",
42
- "@tmagic/design": "1.8.4-beta.1"
42
+ "typescript": "^6.0.3"
43
43
  },
44
44
  "peerDependenciesMeta": {
45
45
  "typescript": {
package/src/index.ts CHANGED
@@ -95,6 +95,26 @@ import type {
95
95
 
96
96
  import Table from './Table.vue';
97
97
 
98
+ /**
99
+ * PopconfirmProps 的复合方位沿用 TDesign 命名(如 right-top),
100
+ * Element Plus 使用 popper.js 的 *-start / *-end 命名,未转换时这些取值会被 Popper 忽略。
101
+ */
102
+ const elementPlusPlacements: Record<string, string> = {
103
+ 'top-left': 'top-start',
104
+ 'top-right': 'top-end',
105
+ 'bottom-left': 'bottom-start',
106
+ 'bottom-right': 'bottom-end',
107
+ 'left-top': 'left-start',
108
+ 'left-bottom': 'left-end',
109
+ 'right-top': 'right-start',
110
+ 'right-bottom': 'right-end',
111
+ };
112
+
113
+ const popconfirmProps = (props: PopconfirmProps): PopconfirmProps => {
114
+ const placement = props.placement ? elementPlusPlacements[props.placement] : undefined;
115
+ return placement ? { ...props, placement: placement as PopconfirmProps['placement'] } : props;
116
+ };
117
+
98
118
  const adapter: DesignPluginOptions = {
99
119
  adapterType: 'element-plus',
100
120
  useZIndex,
@@ -329,7 +349,7 @@ const adapter: DesignPluginOptions = {
329
349
 
330
350
  popconfirm: {
331
351
  component: ElPopconfirm as any,
332
- props: (props: PopconfirmProps) => props,
352
+ props: popconfirmProps,
333
353
  },
334
354
  },
335
355
  loading: ElLoading.directive,