hy-dispatch-ui-v3 0.1.6 → 0.2.0

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.
Files changed (160) hide show
  1. package/README.md +47 -0
  2. package/dist/tailwind.css +349 -4
  3. package/es/components/appAudioPlayer/appAudioPlayer.vue.mjs +462 -0
  4. package/es/components/appAudioPlayer/index.mjs +6 -0
  5. package/es/components/appAudioPlayer/js/index.mjs +327 -0
  6. package/es/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
  7. package/es/components/appButton/style/appButton.scss +0 -1
  8. package/es/components/appConfigProvider/appConfigProvider.vue.mjs +22 -1
  9. package/es/components/appCutter/appCutter.vue.mjs +202 -129
  10. package/es/components/appDatePicker/appDatePicker.vue.mjs +1 -1
  11. package/es/components/appForm/appForm.vue.mjs +132 -209
  12. package/es/components/appForm/cpns/appFormItem.vue.mjs +312 -0
  13. package/es/components/appForm/cpns/arrayItem.vue.mjs +305 -0
  14. package/es/components/appForm/cpns/extraItem.vue.mjs +140 -0
  15. package/es/components/appForm/js/index.mjs +46 -24
  16. package/es/components/appForm/js/useAppForm.mjs +30 -6
  17. package/es/components/appForm/style/appForm.scss +53 -0
  18. package/es/components/appIcon/appIcon.vue.mjs +2 -1
  19. package/es/components/appIconBox/style/appIconBox.scss +0 -1
  20. package/es/components/appInput/appInput.vue.mjs +99 -0
  21. package/es/components/appInput/index.mjs +6 -0
  22. package/es/components/appMenu/appMenu.vue.mjs +129 -0
  23. package/es/components/appMenu/index.mjs +6 -0
  24. package/es/components/appMenu/style/appMenu.scss +145 -0
  25. package/es/components/appOrgCascader/appOrgCascader.vue.mjs +14 -10
  26. package/es/components/appSearch/appSearch.vue.mjs +55 -211
  27. package/es/components/appSearch/cpns/appSearchItem.vue.mjs +238 -0
  28. package/es/components/appSearch/js/index.mjs +20 -8
  29. package/es/components/appSearch/js/useAppSearch.mjs +10 -5
  30. package/es/components/appSearch/style/appSearch.scss +10 -0
  31. package/es/components/appTable/appTable.vue.mjs +312 -158
  32. package/es/components/appTable/cpns/columnSelect.vue.mjs +151 -156
  33. package/es/components/appTable/cpns/columnSelectItem.vue2.mjs +104 -110
  34. package/es/components/appTable/cpns/headerItem.vue.mjs +98 -0
  35. package/es/components/appTable/cpns/virtualTable.vue.mjs +560 -0
  36. package/es/components/appTable/js/index.mjs +46 -20
  37. package/es/components/appTable/js/search.mjs +1 -2
  38. package/es/components/appTable/js/useAppTable.mjs +58 -14
  39. package/es/components/appTable/style/appTable.scss +16 -0
  40. package/es/components/appTooltip/appTooltip.vue.mjs +24 -13
  41. package/es/components/appTree/appTree.vue.mjs +304 -0
  42. package/es/components/appTree/index.mjs +6 -0
  43. package/es/components/appTree/js/index.mjs +531 -0
  44. package/es/components/appUserAvatar/appUserAvatar.vue.mjs +9 -8
  45. package/es/components/appUserAvatar/style/appUserAvatar.scss +0 -1
  46. package/es/components/appVideoPlayer/appVideoPlayer.vue.mjs +647 -0
  47. package/es/components/appVideoPlayer/cpns/mediaLoading.vue.mjs +35 -0
  48. package/es/components/appVideoPlayer/index.mjs +6 -0
  49. package/es/components/appVideoPlayer/js/index.mjs +426 -0
  50. package/es/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
  51. package/es/components/appVideoPlayer/style/mediaLoading.scss +62 -0
  52. package/es/components/index.mjs +5 -0
  53. package/es/hooks/index.mjs +3 -0
  54. package/es/hooks/useApi.mjs +4 -4
  55. package/es/hooks/useAudioPlayerConfig.mjs +12 -0
  56. package/es/hooks/useGlobalConfig.mjs +18 -7
  57. package/es/hooks/useLocale.mjs +3 -11
  58. package/es/hooks/useMixins.mjs +1 -1
  59. package/es/hooks/usePermissionMap.mjs +12 -0
  60. package/es/hooks/useUserAvatarMap.mjs +2 -3
  61. package/es/hooks/useVideoPlayerConfig.mjs +12 -0
  62. package/es/index.mjs +14 -4
  63. package/es/locale/en.mjs +52 -3
  64. package/es/locale/zh_CN.mjs +48 -3
  65. package/es/make-installer.mjs +2 -0
  66. package/es/static/hy-svg-icons.js +462 -0
  67. package/es/static/protocolcheck.js +247 -0
  68. package/es/style/element/element.scss +9 -0
  69. package/es/style/element/index.scss +6 -3
  70. package/es/style/index.scss +11 -0
  71. package/es/style/theme.scss +73 -0
  72. package/es/utils/date.mjs +25 -1
  73. package/es/utils/file.mjs +5 -4
  74. package/es/utils/form.mjs +52 -0
  75. package/es/utils/handler.mjs +22 -2
  76. package/es/utils/index.mjs +6 -4
  77. package/es/utils/is.mjs +23 -2
  78. package/es/utils/loadScript.mjs +33 -0
  79. package/es/version.mjs +1 -1
  80. package/lib/components/appAudioPlayer/appAudioPlayer.vue.js +466 -0
  81. package/lib/components/appAudioPlayer/index.js +11 -0
  82. package/lib/components/appAudioPlayer/js/index.js +329 -0
  83. package/lib/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
  84. package/lib/components/appButton/style/appButton.scss +0 -1
  85. package/lib/components/appConfigProvider/appConfigProvider.vue.js +22 -1
  86. package/lib/components/appCutter/appCutter.vue.js +201 -128
  87. package/lib/components/appDatePicker/appDatePicker.vue.js +1 -1
  88. package/lib/components/appForm/appForm.vue.js +129 -206
  89. package/lib/components/appForm/cpns/appFormItem.vue.js +316 -0
  90. package/lib/components/appForm/cpns/arrayItem.vue.js +309 -0
  91. package/lib/components/appForm/cpns/extraItem.vue.js +144 -0
  92. package/lib/components/appForm/js/index.js +48 -23
  93. package/lib/components/appForm/js/useAppForm.js +30 -6
  94. package/lib/components/appForm/style/appForm.scss +53 -0
  95. package/lib/components/appIcon/appIcon.vue.js +2 -1
  96. package/lib/components/appIconBox/style/appIconBox.scss +0 -1
  97. package/lib/components/appInput/appInput.vue.js +103 -0
  98. package/lib/components/appInput/index.js +11 -0
  99. package/lib/components/appMenu/appMenu.vue.js +133 -0
  100. package/lib/components/appMenu/index.js +11 -0
  101. package/lib/components/appMenu/style/appMenu.scss +145 -0
  102. package/lib/components/appOrgCascader/appOrgCascader.vue.js +14 -10
  103. package/lib/components/appSearch/appSearch.vue.js +51 -207
  104. package/lib/components/appSearch/cpns/appSearchItem.vue.js +242 -0
  105. package/lib/components/appSearch/js/index.js +20 -7
  106. package/lib/components/appSearch/js/useAppSearch.js +10 -5
  107. package/lib/components/appSearch/style/appSearch.scss +10 -0
  108. package/lib/components/appTable/appTable.vue.js +319 -165
  109. package/lib/components/appTable/cpns/columnSelect.vue.js +151 -156
  110. package/lib/components/appTable/cpns/columnSelectItem.vue2.js +105 -111
  111. package/lib/components/appTable/cpns/headerItem.vue.js +102 -0
  112. package/lib/components/appTable/cpns/virtualTable.vue.js +564 -0
  113. package/lib/components/appTable/js/index.js +47 -19
  114. package/lib/components/appTable/js/search.js +1 -2
  115. package/lib/components/appTable/js/useAppTable.js +57 -13
  116. package/lib/components/appTable/style/appTable.scss +16 -0
  117. package/lib/components/appTooltip/appTooltip.vue.js +23 -12
  118. package/lib/components/appTree/appTree.vue.js +308 -0
  119. package/lib/components/appTree/index.js +11 -0
  120. package/lib/components/appTree/js/index.js +533 -0
  121. package/lib/components/appUserAvatar/appUserAvatar.vue.js +9 -8
  122. package/lib/components/appUserAvatar/style/appUserAvatar.scss +0 -1
  123. package/lib/components/appVideoPlayer/appVideoPlayer.vue.js +651 -0
  124. package/lib/components/appVideoPlayer/cpns/mediaLoading.vue.js +39 -0
  125. package/lib/components/appVideoPlayer/index.js +11 -0
  126. package/lib/components/appVideoPlayer/js/index.js +429 -0
  127. package/lib/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
  128. package/lib/components/appVideoPlayer/style/mediaLoading.scss +62 -0
  129. package/lib/components/index.js +42 -32
  130. package/lib/hooks/index.js +9 -0
  131. package/lib/hooks/useApi.js +4 -4
  132. package/lib/hooks/useAudioPlayerConfig.js +15 -0
  133. package/lib/hooks/useGlobalConfig.js +18 -7
  134. package/lib/hooks/useLocale.js +3 -11
  135. package/lib/hooks/useMixins.js +1 -1
  136. package/lib/hooks/usePermissionMap.js +15 -0
  137. package/lib/hooks/useUserAvatarMap.js +1 -2
  138. package/lib/hooks/useVideoPlayerConfig.js +15 -0
  139. package/lib/index.js +62 -33
  140. package/lib/locale/en.js +52 -3
  141. package/lib/locale/zh_CN.js +48 -3
  142. package/lib/make-installer.js +2 -0
  143. package/lib/static/hy-svg-icons.js +459 -8
  144. package/lib/static/protocolcheck.js +249 -0
  145. package/lib/style/element/element.scss +9 -0
  146. package/lib/style/element/index.scss +6 -3
  147. package/lib/style/index.scss +11 -0
  148. package/lib/style/theme.scss +73 -0
  149. package/lib/utils/date.js +25 -0
  150. package/lib/utils/file.js +4 -4
  151. package/lib/utils/form.js +57 -0
  152. package/lib/utils/handler.js +22 -1
  153. package/lib/utils/index.js +11 -1
  154. package/lib/utils/is.js +23 -1
  155. package/lib/utils/loadScript.js +37 -0
  156. package/lib/version.js +1 -1
  157. package/package.json +12 -10
  158. package/es/config/index.mjs +0 -1
  159. package/es/static/hy-svg-icons.mjs +0 -11
  160. package/lib/config/index.js +0 -2
@@ -29,7 +29,7 @@ function tableColumnsEditableleHandler(columns, columnsEditablele, searchArr) {
29
29
  searchLabelSet.add(column.label);
30
30
  }
31
31
  }
32
- if ((searchArr == null ? void 0 : searchArr.length) > 0) {
32
+ if (searchArr?.length > 0) {
33
33
  searchArr.forEach((item) => {
34
34
  searchLabelSet.add(item.label);
35
35
  });
@@ -101,9 +101,11 @@ function operatorFilterHandler(column, scope, type = "all") {
101
101
  if (type === "all" || operator.length <= 1 && type === "default") {
102
102
  return operator;
103
103
  }
104
- const btnWidth = 28;
104
+ const btnWidth = 40;
105
105
  const gapWidth = 12;
106
- const operatorCount = Math.floor((width - 12 * 2) / (btnWidth + gapWidth));
106
+ const operatorCount = Math.floor(
107
+ (width - 12 * 2 - btnWidth) / (btnWidth + gapWidth) + 1
108
+ );
107
109
  if (operatorCount === operator.length) {
108
110
  return type === "default" ? operator : [];
109
111
  }
@@ -116,7 +118,22 @@ function operatorFilterHandler(column, scope, type = "all") {
116
118
  function operatorClickHandler(command, column, scope, type = "all") {
117
119
  const operator = operatorFilterHandler(column, scope, type);
118
120
  const target = operator[command];
119
- (target == null ? void 0 : target.handler) && target.handler(scope);
121
+ target?.handler && target.handler(scope);
122
+ }
123
+ function renderHeaderHandler(column, scope) {
124
+ if (!column) return;
125
+ if (is.isFunction(column.renderHeader)) {
126
+ return column.renderHeader({ ...scope, column });
127
+ }
128
+ return column.label;
129
+ }
130
+ function renderContentHandler(column, scope) {
131
+ const { row } = scope || {};
132
+ if (!column || !row) return;
133
+ if (is.isFunction(column.renderContent)) {
134
+ return column.renderContent({ ...scope, column });
135
+ }
136
+ return row[column.prop];
120
137
  }
121
138
  const useAppTableWrapper = (hy) => {
122
139
  const {
@@ -147,8 +164,7 @@ const useAppTableWrapper = (hy) => {
147
164
  sessionStorage.setItem(CACHE_COLUMNS_KEY, JSON.stringify(value));
148
165
  }
149
166
  function doLayout() {
150
- var _a;
151
- (_a = tableRef.value) == null ? void 0 : _a.doLayout();
167
+ tableRef.value?.doLayout && tableRef.value?.doLayout();
152
168
  }
153
169
  let loadingInstance, loadingTimer;
154
170
  function showAppTableLoading() {
@@ -169,7 +185,7 @@ const useAppTableWrapper = (hy) => {
169
185
  }
170
186
  function closeAppTableLoading() {
171
187
  loadingTimer && clearTimeout(loadingTimer);
172
- loadingInstance == null ? void 0 : loadingInstance.close();
188
+ loadingInstance?.close();
173
189
  loadingInstance = null;
174
190
  }
175
191
  const tableTriggerPosition = vue.ref({
@@ -184,7 +200,6 @@ const useAppTableWrapper = (hy) => {
184
200
  getBoundingClientRect: () => tableTriggerPosition.value
185
201
  });
186
202
  function onTableRowContextmenuHandler(row, _, event) {
187
- var _a, _b;
188
203
  if (props.onRowContextmenu) {
189
204
  props.onRowContextmenu(row, _, event);
190
205
  return;
@@ -195,18 +210,18 @@ const useAppTableWrapper = (hy) => {
195
210
  y: clientY
196
211
  });
197
212
  const column = tableColumns.value.find(
198
- (column2) => column2.prop === "operator"
213
+ (column2) => column2.type === "operator"
199
214
  );
200
215
  const operator = operatorFilterHandler(column, { row });
201
- if (!(operator == null ? void 0 : operator.length)) return;
216
+ if (!operator?.length) return;
202
217
  tableTriggerRef.value.column = column;
203
218
  tableTriggerRef.value.scope = { row };
204
219
  event.preventDefault();
205
- (_a = tableDropdownRef.value) == null ? void 0 : _a.handleOpen();
220
+ tableDropdownRef.value?.handleOpen();
206
221
  if (is.isArray(operatorDropdownRef.value)) {
207
222
  operatorDropdownRef.value.forEach((item) => item.handleClose());
208
223
  } else {
209
- (_b = operatorDropdownRef.value) == null ? void 0 : _b.handleClose();
224
+ operatorDropdownRef.value?.handleClose();
210
225
  }
211
226
  }
212
227
  const selectedList = vue.ref([]);
@@ -216,11 +231,12 @@ const useAppTableWrapper = (hy) => {
216
231
  return map;
217
232
  }, /* @__PURE__ */ new Map());
218
233
  });
234
+ const selectionColumn = vue.computed(() => {
235
+ return tableColumns.value.find((item) => item.type === "selection");
236
+ });
219
237
  function isSelectable(row) {
220
- const column = tableColumns.value.find((column2) => {
221
- return column2.type === "selection";
222
- });
223
- if (!is.isFunction(column == null ? void 0 : column.selectable)) return true;
238
+ const column = selectionColumn.value;
239
+ if (!is.isFunction(column?.selectable)) return true;
224
240
  return column.selectable(row);
225
241
  }
226
242
  function getSelectedIndex(row) {
@@ -228,8 +244,7 @@ const useAppTableWrapper = (hy) => {
228
244
  return is.isNumber(index) ? index : -1;
229
245
  }
230
246
  function clearSelection() {
231
- var _a;
232
- (_a = tableRef.value) == null ? void 0 : _a.clearSelection();
247
+ tableRef.value?.clearSelection();
233
248
  }
234
249
  function getSelectedList() {
235
250
  return selectedList.value;
@@ -284,6 +299,13 @@ const useAppTableWrapper = (hy) => {
284
299
  }
285
300
  return className.filter(Boolean).join(" ");
286
301
  }
302
+ const isSearchFocus = vue.ref(false);
303
+ function onSearchInputHandler() {
304
+ isSearchFocus.value = true;
305
+ }
306
+ function onSearchBlurHandler() {
307
+ isSearchFocus.value = false;
308
+ }
287
309
  vue.watchEffect(() => {
288
310
  const { columnsList, columnsEditablele, searchText } = tableColumnHandler(
289
311
  props.tableColumns,
@@ -315,7 +337,11 @@ const useAppTableWrapper = (hy) => {
315
337
  onTableSelectHandler,
316
338
  onTableRowContextmenuHandler,
317
339
  onTableRowClickHandler,
318
- onTableColumnsSelectHandler
340
+ onTableColumnsSelectHandler,
341
+ // 搜索选中
342
+ isSearchFocus,
343
+ onSearchInputHandler,
344
+ onSearchBlurHandler
319
345
  };
320
346
  };
321
347
 
@@ -323,6 +349,8 @@ exports.operatorClickHandler = operatorClickHandler;
323
349
  exports.operatorDisableTextdHandler = operatorDisableTextdHandler;
324
350
  exports.operatorDisabledHandler = operatorDisabledHandler;
325
351
  exports.operatorFilterHandler = operatorFilterHandler;
352
+ exports.renderContentHandler = renderContentHandler;
353
+ exports.renderHeaderHandler = renderHeaderHandler;
326
354
  exports.tableColumnHandler = tableColumnHandler;
327
355
  exports.tableColumnShowHandler = tableColumnShowHandler;
328
356
  exports.useAppTableWrapper = useAppTableWrapper;
@@ -47,8 +47,7 @@ function useAppTableSearch(hy) {
47
47
  }
48
48
  });
49
49
  function successFun(res) {
50
- var _a;
51
- if (!((_a = res.data.content) == null ? void 0 : _a.length) && props.filterModel.page !== 1) {
50
+ if (!res.data.content?.length && props.filterModel.page !== 1) {
52
51
  getData(1);
53
52
  return;
54
53
  }
@@ -6,6 +6,7 @@ var is = require('../../../utils/is.js');
6
6
  var useLocale = require('../../../hooks/useLocale.js');
7
7
 
8
8
  function getColumnDefaultConfig(column) {
9
+ const { t } = useLocale.useLocale();
9
10
  switch (column.type) {
10
11
  case "selection":
11
12
  return {
@@ -13,27 +14,40 @@ function getColumnDefaultConfig(column) {
13
14
  reserveSelection: true
14
15
  };
15
16
  case "index":
17
+ return {
18
+ props: `${column.type}_prop`,
19
+ label: t("table.index")
20
+ };
16
21
  case "expand":
17
22
  return {
18
23
  prop: `${column.type}_prop`
19
24
  };
25
+ case "operator":
26
+ return {
27
+ label: t("table.operator"),
28
+ prop: `operator_prop`
29
+ };
20
30
  default:
21
31
  return {};
22
32
  }
23
33
  }
24
34
  function getColumnDefaultWidth(column) {
25
35
  if (column.width) return column.width;
36
+ if (column.type === "expand" && column.expandType === "expand") return 40;
37
+ if (column.type === "selection") return 40;
26
38
  if (column.type === "index") return 80;
27
- if (column.prop === "operator") return 132;
39
+ if (column.type === "operator") return 172;
28
40
  return;
29
41
  }
30
- function getColumnDefaultLabel(column) {
31
- const { t } = useLocale.useLocale();
32
- if (column.label) return column.label;
33
- if (column.type === "index") return t("table.index");
34
- return;
42
+ function generateColumnItem(column) {
43
+ return {
44
+ ...column,
45
+ key: column.prop,
46
+ dataKey: column.prop,
47
+ title: column.label
48
+ };
35
49
  }
36
- function getColumnsEditable(column, index) {
50
+ function getColumnEditable(column, index) {
37
51
  const { editable, type, prop } = column;
38
52
  if (is.isBoolean(editable)) {
39
53
  return {
@@ -49,29 +63,55 @@ function getColumnsEditable(column, index) {
49
63
  index,
50
64
  lock: false,
51
65
  edit: !type || type === "default",
52
- checked: !type || type !== "default" || prop === "operator",
66
+ checked: !type || type !== "default" || type === "operator",
53
67
  desc: void 0,
54
68
  examples: [],
55
69
  ...editable || {}
56
70
  };
57
71
  }
72
+ function getColumnSort(column) {
73
+ const sort = {
74
+ prop: column.prop,
75
+ show: false,
76
+ default: ""
77
+ };
78
+ if (is.isBoolean(column.sort)) {
79
+ sort.prop = column.prop;
80
+ sort.show = true;
81
+ } else if (is.isString(column.sort)) {
82
+ sort.prop = column.sort;
83
+ sort.show = true;
84
+ } else if (is.isObject(column.sort)) {
85
+ const { prop, show } = column.sort;
86
+ sort.prop = is.isString(prop) ? prop : sort.prop;
87
+ sort.show = true;
88
+ sort.default = ["desc", "asc"].includes(column.sort.default) ? column.sort.default : sort.default;
89
+ }
90
+ return sort;
91
+ }
58
92
  const useAppTable = (config = {}) => {
59
93
  const { columns, filterModel, filterColumns } = config || {};
60
94
  const tableColumns = [];
95
+ let defaultSortInfo = null;
61
96
  try {
62
- for (let i = 0; i < (columns == null ? void 0 : columns.length); i++) {
97
+ for (let i = 0; i < columns?.length; i++) {
63
98
  const column = columns[i];
64
99
  if (is.isEmpty(column.prop) && column.type === "default") {
65
100
  throw Error("\u3010column.prop\u3011\u4E0D\u80FD\u4E3A\u7A7A");
66
101
  }
67
- tableColumns.push({
102
+ const sort = getColumnSort(column);
103
+ if (!defaultSortInfo && sort.default) {
104
+ defaultSortInfo = sort;
105
+ }
106
+ const target = {
68
107
  ...getColumnDefaultConfig(column),
69
108
  ...column,
70
109
  type: column.type || "default",
71
110
  width: getColumnDefaultWidth(column),
72
- label: getColumnDefaultLabel(column),
73
- editable: getColumnsEditable(column, i)
74
- });
111
+ sort,
112
+ editable: getColumnEditable(column, i)
113
+ };
114
+ tableColumns.push(generateColumnItem(target));
75
115
  }
76
116
  } catch (err) {
77
117
  console.error(err);
@@ -82,6 +122,10 @@ const useAppTable = (config = {}) => {
82
122
  // 当前分页数
83
123
  size: 15,
84
124
  // 每页数量
125
+ sortBy: defaultSortInfo?.prop,
126
+ // 排序字段
127
+ orderSort: defaultSortInfo?.default,
128
+ // 排序方式
85
129
  ...filterModel
86
130
  });
87
131
  return {
@@ -21,4 +21,20 @@
21
21
  }
22
22
  }
23
23
  }
24
+ .app-table-search {
25
+ width: 160px;
26
+ .hy-el-input__inner::placeholder {
27
+ font-size: 12px;
28
+ }
29
+ .hy-el-input__wrapper {
30
+ box-shadow: none;
31
+ }
32
+ .hy-el-input-group__append {
33
+ color: rgb(var(--hy-main));
34
+ background-color: rgba(var(--hy-background-2));
35
+ box-shadow: none;
36
+ padding: 4px;
37
+ min-height: 100%;
38
+ }
39
+ }
24
40
  }
@@ -18,13 +18,15 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
18
18
  default: false
19
19
  },
20
20
  disabled: {
21
- type: Boolean
21
+ type: Boolean,
22
+ default: false
22
23
  },
23
24
  class: {
24
25
  type: String
25
26
  },
26
27
  overLine: {
27
- type: [String, Number]
28
+ type: Number,
29
+ default: 1
28
30
  },
29
31
  content: {
30
32
  type: String
@@ -32,7 +34,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
32
34
  },
33
35
  setup(__props) {
34
36
  const props = __props;
35
- const isDisabled = vue.ref(props.disabled);
37
+ const isShow = vue.ref(false);
38
+ const isDisabled = vue.computed(() => {
39
+ if (props.disabled || props.isAlways) {
40
+ return props.disabled;
41
+ }
42
+ return isShow.value;
43
+ });
36
44
  const appClass = vue.computed(() => {
37
45
  const classList = [props.class, "break-all"];
38
46
  const overLine = props.overLine;
@@ -42,11 +50,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
42
50
  return classList.filter(Boolean);
43
51
  });
44
52
  function onMouseenterHandler(e) {
45
- if (props.disabled || props.isAlways) {
46
- isDisabled.value = props.disabled;
47
- return;
48
- }
49
- isDisabled.value = !is.isOverflowing(e.target);
53
+ isShow.value = !is.isOverflowing(e.target);
50
54
  }
51
55
  return (_ctx, _cache) => {
52
56
  return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElTooltip), vue.mergeProps({
@@ -57,12 +61,19 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
57
61
  "popper-class": "max-w-[300px]"
58
62
  }, _ctx.$attrs, {
59
63
  disabled: isDisabled.value,
60
- content: __props.content
64
+ content: _ctx.$slots.content ? void 0 : __props.content
61
65
  }), vue.createSlots({
62
66
  default: vue.withCtx(() => [
63
- vue.createElementVNode(
67
+ __props.isAlways ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
68
+ vue.createTextVNode(
69
+ vue.toDisplayString(__props.content),
70
+ 1
71
+ /* TEXT */
72
+ )
73
+ ]) : (vue.openBlock(), vue.createElementBlock(
64
74
  "span",
65
75
  {
76
+ key: 1,
66
77
  class: vue.normalizeClass(appClass.value),
67
78
  onMouseenter: onMouseenterHandler
68
79
  },
@@ -77,12 +88,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
77
88
  ],
78
89
  34
79
90
  /* CLASS, NEED_HYDRATION */
80
- )
91
+ ))
81
92
  ]),
82
93
  _: 2
83
94
  /* DYNAMIC */
84
95
  }, [
85
- !_ctx.$slots.content ? {
96
+ _ctx.$slots.content ? {
86
97
  name: "content",
87
98
  fn: vue.withCtx(() => [
88
99
  vue.renderSlot(_ctx.$slots, "content")