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
@@ -27,7 +27,7 @@ function tableColumnsEditableleHandler(columns, columnsEditablele, searchArr) {
27
27
  searchLabelSet.add(column.label);
28
28
  }
29
29
  }
30
- if ((searchArr == null ? void 0 : searchArr.length) > 0) {
30
+ if (searchArr?.length > 0) {
31
31
  searchArr.forEach((item) => {
32
32
  searchLabelSet.add(item.label);
33
33
  });
@@ -99,9 +99,11 @@ function operatorFilterHandler(column, scope, type = "all") {
99
99
  if (type === "all" || operator.length <= 1 && type === "default") {
100
100
  return operator;
101
101
  }
102
- const btnWidth = 28;
102
+ const btnWidth = 40;
103
103
  const gapWidth = 12;
104
- const operatorCount = Math.floor((width - 12 * 2) / (btnWidth + gapWidth));
104
+ const operatorCount = Math.floor(
105
+ (width - 12 * 2 - btnWidth) / (btnWidth + gapWidth) + 1
106
+ );
105
107
  if (operatorCount === operator.length) {
106
108
  return type === "default" ? operator : [];
107
109
  }
@@ -114,7 +116,22 @@ function operatorFilterHandler(column, scope, type = "all") {
114
116
  function operatorClickHandler(command, column, scope, type = "all") {
115
117
  const operator = operatorFilterHandler(column, scope, type);
116
118
  const target = operator[command];
117
- (target == null ? void 0 : target.handler) && target.handler(scope);
119
+ target?.handler && target.handler(scope);
120
+ }
121
+ function renderHeaderHandler(column, scope) {
122
+ if (!column) return;
123
+ if (isFunction(column.renderHeader)) {
124
+ return column.renderHeader({ ...scope, column });
125
+ }
126
+ return column.label;
127
+ }
128
+ function renderContentHandler(column, scope) {
129
+ const { row } = scope || {};
130
+ if (!column || !row) return;
131
+ if (isFunction(column.renderContent)) {
132
+ return column.renderContent({ ...scope, column });
133
+ }
134
+ return row[column.prop];
118
135
  }
119
136
  const useAppTableWrapper = (hy) => {
120
137
  const {
@@ -145,8 +162,7 @@ const useAppTableWrapper = (hy) => {
145
162
  sessionStorage.setItem(CACHE_COLUMNS_KEY, JSON.stringify(value));
146
163
  }
147
164
  function doLayout() {
148
- var _a;
149
- (_a = tableRef.value) == null ? void 0 : _a.doLayout();
165
+ tableRef.value?.doLayout && tableRef.value?.doLayout();
150
166
  }
151
167
  let loadingInstance, loadingTimer;
152
168
  function showAppTableLoading() {
@@ -167,7 +183,7 @@ const useAppTableWrapper = (hy) => {
167
183
  }
168
184
  function closeAppTableLoading() {
169
185
  loadingTimer && clearTimeout(loadingTimer);
170
- loadingInstance == null ? void 0 : loadingInstance.close();
186
+ loadingInstance?.close();
171
187
  loadingInstance = null;
172
188
  }
173
189
  const tableTriggerPosition = ref({
@@ -182,7 +198,6 @@ const useAppTableWrapper = (hy) => {
182
198
  getBoundingClientRect: () => tableTriggerPosition.value
183
199
  });
184
200
  function onTableRowContextmenuHandler(row, _, event) {
185
- var _a, _b;
186
201
  if (props.onRowContextmenu) {
187
202
  props.onRowContextmenu(row, _, event);
188
203
  return;
@@ -193,18 +208,18 @@ const useAppTableWrapper = (hy) => {
193
208
  y: clientY
194
209
  });
195
210
  const column = tableColumns.value.find(
196
- (column2) => column2.prop === "operator"
211
+ (column2) => column2.type === "operator"
197
212
  );
198
213
  const operator = operatorFilterHandler(column, { row });
199
- if (!(operator == null ? void 0 : operator.length)) return;
214
+ if (!operator?.length) return;
200
215
  tableTriggerRef.value.column = column;
201
216
  tableTriggerRef.value.scope = { row };
202
217
  event.preventDefault();
203
- (_a = tableDropdownRef.value) == null ? void 0 : _a.handleOpen();
218
+ tableDropdownRef.value?.handleOpen();
204
219
  if (isArray(operatorDropdownRef.value)) {
205
220
  operatorDropdownRef.value.forEach((item) => item.handleClose());
206
221
  } else {
207
- (_b = operatorDropdownRef.value) == null ? void 0 : _b.handleClose();
222
+ operatorDropdownRef.value?.handleClose();
208
223
  }
209
224
  }
210
225
  const selectedList = ref([]);
@@ -214,11 +229,12 @@ const useAppTableWrapper = (hy) => {
214
229
  return map;
215
230
  }, /* @__PURE__ */ new Map());
216
231
  });
232
+ const selectionColumn = computed(() => {
233
+ return tableColumns.value.find((item) => item.type === "selection");
234
+ });
217
235
  function isSelectable(row) {
218
- const column = tableColumns.value.find((column2) => {
219
- return column2.type === "selection";
220
- });
221
- if (!isFunction(column == null ? void 0 : column.selectable)) return true;
236
+ const column = selectionColumn.value;
237
+ if (!isFunction(column?.selectable)) return true;
222
238
  return column.selectable(row);
223
239
  }
224
240
  function getSelectedIndex(row) {
@@ -226,8 +242,7 @@ const useAppTableWrapper = (hy) => {
226
242
  return isNumber(index) ? index : -1;
227
243
  }
228
244
  function clearSelection() {
229
- var _a;
230
- (_a = tableRef.value) == null ? void 0 : _a.clearSelection();
245
+ tableRef.value?.clearSelection();
231
246
  }
232
247
  function getSelectedList() {
233
248
  return selectedList.value;
@@ -282,6 +297,13 @@ const useAppTableWrapper = (hy) => {
282
297
  }
283
298
  return className.filter(Boolean).join(" ");
284
299
  }
300
+ const isSearchFocus = ref(false);
301
+ function onSearchInputHandler() {
302
+ isSearchFocus.value = true;
303
+ }
304
+ function onSearchBlurHandler() {
305
+ isSearchFocus.value = false;
306
+ }
285
307
  watchEffect(() => {
286
308
  const { columnsList, columnsEditablele, searchText } = tableColumnHandler(
287
309
  props.tableColumns,
@@ -313,8 +335,12 @@ const useAppTableWrapper = (hy) => {
313
335
  onTableSelectHandler,
314
336
  onTableRowContextmenuHandler,
315
337
  onTableRowClickHandler,
316
- onTableColumnsSelectHandler
338
+ onTableColumnsSelectHandler,
339
+ // 搜索选中
340
+ isSearchFocus,
341
+ onSearchInputHandler,
342
+ onSearchBlurHandler
317
343
  };
318
344
  };
319
345
 
320
- export { operatorClickHandler, operatorDisableTextdHandler, operatorDisabledHandler, operatorFilterHandler, tableColumnHandler, tableColumnShowHandler, useAppTableWrapper };
346
+ export { operatorClickHandler, operatorDisableTextdHandler, operatorDisabledHandler, operatorFilterHandler, renderContentHandler, renderHeaderHandler, tableColumnHandler, tableColumnShowHandler, useAppTableWrapper };
@@ -45,8 +45,7 @@ function useAppTableSearch(hy) {
45
45
  }
46
46
  });
47
47
  function successFun(res) {
48
- var _a;
49
- if (!((_a = res.data.content) == null ? void 0 : _a.length) && props.filterModel.page !== 1) {
48
+ if (!res.data.content?.length && props.filterModel.page !== 1) {
50
49
  getData(1);
51
50
  return;
52
51
  }
@@ -1,9 +1,10 @@
1
1
  import { toRef } from 'vue';
2
2
  import { useAppSearch } from '../../appSearch/js/useAppSearch.mjs';
3
- import { isEmpty, isBoolean } from '../../../utils/is.mjs';
3
+ import { isEmpty, isBoolean, isString, isObject } from '../../../utils/is.mjs';
4
4
  import { useLocale } from '../../../hooks/useLocale.mjs';
5
5
 
6
6
  function getColumnDefaultConfig(column) {
7
+ const { t } = useLocale();
7
8
  switch (column.type) {
8
9
  case "selection":
9
10
  return {
@@ -11,27 +12,40 @@ function getColumnDefaultConfig(column) {
11
12
  reserveSelection: true
12
13
  };
13
14
  case "index":
15
+ return {
16
+ props: `${column.type}_prop`,
17
+ label: t("table.index")
18
+ };
14
19
  case "expand":
15
20
  return {
16
21
  prop: `${column.type}_prop`
17
22
  };
23
+ case "operator":
24
+ return {
25
+ label: t("table.operator"),
26
+ prop: `operator_prop`
27
+ };
18
28
  default:
19
29
  return {};
20
30
  }
21
31
  }
22
32
  function getColumnDefaultWidth(column) {
23
33
  if (column.width) return column.width;
34
+ if (column.type === "expand" && column.expandType === "expand") return 40;
35
+ if (column.type === "selection") return 40;
24
36
  if (column.type === "index") return 80;
25
- if (column.prop === "operator") return 132;
37
+ if (column.type === "operator") return 172;
26
38
  return;
27
39
  }
28
- function getColumnDefaultLabel(column) {
29
- const { t } = useLocale();
30
- if (column.label) return column.label;
31
- if (column.type === "index") return t("table.index");
32
- return;
40
+ function generateColumnItem(column) {
41
+ return {
42
+ ...column,
43
+ key: column.prop,
44
+ dataKey: column.prop,
45
+ title: column.label
46
+ };
33
47
  }
34
- function getColumnsEditable(column, index) {
48
+ function getColumnEditable(column, index) {
35
49
  const { editable, type, prop } = column;
36
50
  if (isBoolean(editable)) {
37
51
  return {
@@ -47,29 +61,55 @@ function getColumnsEditable(column, index) {
47
61
  index,
48
62
  lock: false,
49
63
  edit: !type || type === "default",
50
- checked: !type || type !== "default" || prop === "operator",
64
+ checked: !type || type !== "default" || type === "operator",
51
65
  desc: void 0,
52
66
  examples: [],
53
67
  ...editable || {}
54
68
  };
55
69
  }
70
+ function getColumnSort(column) {
71
+ const sort = {
72
+ prop: column.prop,
73
+ show: false,
74
+ default: ""
75
+ };
76
+ if (isBoolean(column.sort)) {
77
+ sort.prop = column.prop;
78
+ sort.show = true;
79
+ } else if (isString(column.sort)) {
80
+ sort.prop = column.sort;
81
+ sort.show = true;
82
+ } else if (isObject(column.sort)) {
83
+ const { prop, show } = column.sort;
84
+ sort.prop = isString(prop) ? prop : sort.prop;
85
+ sort.show = true;
86
+ sort.default = ["desc", "asc"].includes(column.sort.default) ? column.sort.default : sort.default;
87
+ }
88
+ return sort;
89
+ }
56
90
  const useAppTable = (config = {}) => {
57
91
  const { columns, filterModel, filterColumns } = config || {};
58
92
  const tableColumns = [];
93
+ let defaultSortInfo = null;
59
94
  try {
60
- for (let i = 0; i < (columns == null ? void 0 : columns.length); i++) {
95
+ for (let i = 0; i < columns?.length; i++) {
61
96
  const column = columns[i];
62
97
  if (isEmpty(column.prop) && column.type === "default") {
63
98
  throw Error("\u3010column.prop\u3011\u4E0D\u80FD\u4E3A\u7A7A");
64
99
  }
65
- tableColumns.push({
100
+ const sort = getColumnSort(column);
101
+ if (!defaultSortInfo && sort.default) {
102
+ defaultSortInfo = sort;
103
+ }
104
+ const target = {
66
105
  ...getColumnDefaultConfig(column),
67
106
  ...column,
68
107
  type: column.type || "default",
69
108
  width: getColumnDefaultWidth(column),
70
- label: getColumnDefaultLabel(column),
71
- editable: getColumnsEditable(column, i)
72
- });
109
+ sort,
110
+ editable: getColumnEditable(column, i)
111
+ };
112
+ tableColumns.push(generateColumnItem(target));
73
113
  }
74
114
  } catch (err) {
75
115
  console.error(err);
@@ -80,6 +120,10 @@ const useAppTable = (config = {}) => {
80
120
  // 当前分页数
81
121
  size: 15,
82
122
  // 每页数量
123
+ sortBy: defaultSortInfo?.prop,
124
+ // 排序字段
125
+ orderSort: defaultSortInfo?.default,
126
+ // 排序方式
83
127
  ...filterModel
84
128
  });
85
129
  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
  }
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, computed, openBlock, createBlock, unref, mergeProps, createSlots, withCtx, createElementVNode, normalizeClass, renderSlot, createTextVNode, toDisplayString } from 'vue';
1
+ import { ref, computed, openBlock, createBlock, unref, mergeProps, createSlots, withCtx, renderSlot, createTextVNode, toDisplayString, createElementBlock, normalizeClass, defineComponent } from 'vue';
2
2
  import { ElTooltip } from 'element-plus';
3
3
  import { isOverflowing, isNumber } from '../../utils/is.mjs';
4
4
 
@@ -14,13 +14,15 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
14
14
  default: false
15
15
  },
16
16
  disabled: {
17
- type: Boolean
17
+ type: Boolean,
18
+ default: false
18
19
  },
19
20
  class: {
20
21
  type: String
21
22
  },
22
23
  overLine: {
23
- type: [String, Number]
24
+ type: Number,
25
+ default: 1
24
26
  },
25
27
  content: {
26
28
  type: String
@@ -28,7 +30,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
28
30
  },
29
31
  setup(__props) {
30
32
  const props = __props;
31
- const isDisabled = ref(props.disabled);
33
+ const isShow = ref(false);
34
+ const isDisabled = computed(() => {
35
+ if (props.disabled || props.isAlways) {
36
+ return props.disabled;
37
+ }
38
+ return isShow.value;
39
+ });
32
40
  const appClass = computed(() => {
33
41
  const classList = [props.class, "break-all"];
34
42
  const overLine = props.overLine;
@@ -38,11 +46,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
38
46
  return classList.filter(Boolean);
39
47
  });
40
48
  function onMouseenterHandler(e) {
41
- if (props.disabled || props.isAlways) {
42
- isDisabled.value = props.disabled;
43
- return;
44
- }
45
- isDisabled.value = !isOverflowing(e.target);
49
+ isShow.value = !isOverflowing(e.target);
46
50
  }
47
51
  return (_ctx, _cache) => {
48
52
  return openBlock(), createBlock(unref(ElTooltip), mergeProps({
@@ -53,12 +57,19 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
53
57
  "popper-class": "max-w-[300px]"
54
58
  }, _ctx.$attrs, {
55
59
  disabled: isDisabled.value,
56
- content: __props.content
60
+ content: _ctx.$slots.content ? void 0 : __props.content
57
61
  }), createSlots({
58
62
  default: withCtx(() => [
59
- createElementVNode(
63
+ __props.isAlways ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
64
+ createTextVNode(
65
+ toDisplayString(__props.content),
66
+ 1
67
+ /* TEXT */
68
+ )
69
+ ]) : (openBlock(), createElementBlock(
60
70
  "span",
61
71
  {
72
+ key: 1,
62
73
  class: normalizeClass(appClass.value),
63
74
  onMouseenter: onMouseenterHandler
64
75
  },
@@ -73,12 +84,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
73
84
  ],
74
85
  34
75
86
  /* CLASS, NEED_HYDRATION */
76
- )
87
+ ))
77
88
  ]),
78
89
  _: 2
79
90
  /* DYNAMIC */
80
91
  }, [
81
- !_ctx.$slots.content ? {
92
+ _ctx.$slots.content ? {
82
93
  name: "content",
83
94
  fn: withCtx(() => [
84
95
  renderSlot(_ctx.$slots, "content")