yc-pro-components 0.0.77 → 0.0.79

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 (107) hide show
  1. package/es/components/dialog-form/index.d.ts +1 -1
  2. package/es/components/dialog-form/src/index.vue.d.ts +1 -1
  3. package/es/components/display-item/index.d.ts +3 -3
  4. package/es/components/display-item/src/index.vue.d.ts +3 -3
  5. package/es/components/drawer-form/index.d.ts +22 -22
  6. package/es/components/drawer-form/src/index.vue.d.ts +8 -8
  7. package/es/components/form/index.d.ts +2 -2
  8. package/es/components/form/src/form-content.vue.d.ts +4 -4
  9. package/es/components/form/src/index.vue.d.ts +2 -2
  10. package/es/components/form-item/index.d.ts +11 -11
  11. package/es/components/form-item/src/index.vue.d.ts +3 -3
  12. package/es/components/page/index.d.ts +41 -41
  13. package/es/components/page/src/index.vue.d.ts +9 -9
  14. package/es/components/render/index.d.ts +3 -3
  15. package/es/components/render/src/index.vue.d.ts +1 -1
  16. package/es/components/search/index.d.ts +7 -7
  17. package/es/components/search/src/index.vue.d.ts +3 -3
  18. package/es/components/sidebar/index.d.ts +16 -16
  19. package/es/components/steps-form/index.d.ts +1 -1
  20. package/es/components/steps-form/src/index.vue.d.ts +1 -1
  21. package/es/components/table/src/index.vue2.mjs +20 -3
  22. package/es/components/table/src/table-action-bar.vue.d.ts +1 -1
  23. package/es/components/table/src/table-column.vue.d.ts +3 -3
  24. package/es/components/yc-count-to/index.d.ts +2 -2
  25. package/es/components/yc-count-to/src/normal/index.d.ts +2 -2
  26. package/es/components/yc-plus-page/src/index.vue.d.ts +31 -31
  27. package/es/components/yc-plus-tree/src/index.vue.d.ts +2 -2
  28. package/es/components/yc-select-v2/src/index.vue.d.ts +1 -1
  29. package/es/components/yc-status-dialog/src/index.vue.d.ts +1 -1
  30. package/es/hooks/index.d.ts +1 -0
  31. package/es/hooks/index.mjs +1 -0
  32. package/es/hooks/usePlusFormReset.d.ts +54 -54
  33. package/es/hooks/useTableScrollbarTooltip.d.ts +29 -0
  34. package/es/hooks/useTableScrollbarTooltip.mjs +122 -0
  35. package/es/index.css +11 -11
  36. package/es/index.mjs +1 -0
  37. package/es/version.d.ts +1 -1
  38. package/es/version.mjs +1 -1
  39. package/es/yc-components/version.d.ts +1 -1
  40. package/index.css +1 -1
  41. package/index.js +139 -4
  42. package/index.min.js +12 -12
  43. package/index.min.mjs +12 -12
  44. package/index.mjs +139 -4
  45. package/lib/components/dialog-form/index.d.ts +1 -1
  46. package/lib/components/dialog-form/src/index.vue.d.ts +1 -1
  47. package/lib/components/display-item/index.d.ts +3 -3
  48. package/lib/components/display-item/src/index.vue.d.ts +3 -3
  49. package/lib/components/drawer-form/index.d.ts +22 -22
  50. package/lib/components/drawer-form/src/index.vue.d.ts +8 -8
  51. package/lib/components/form/index.d.ts +2 -2
  52. package/lib/components/form/src/form-content.vue.d.ts +4 -4
  53. package/lib/components/form/src/index.vue.d.ts +2 -2
  54. package/lib/components/form-item/index.d.ts +11 -11
  55. package/lib/components/form-item/src/index.vue.d.ts +3 -3
  56. package/lib/components/page/index.d.ts +41 -41
  57. package/lib/components/page/src/index.vue.d.ts +9 -9
  58. package/lib/components/render/index.d.ts +3 -3
  59. package/lib/components/render/src/index.vue.d.ts +1 -1
  60. package/lib/components/search/index.d.ts +7 -7
  61. package/lib/components/search/src/index.vue.d.ts +3 -3
  62. package/lib/components/sidebar/index.d.ts +16 -16
  63. package/lib/components/steps-form/index.d.ts +1 -1
  64. package/lib/components/steps-form/src/index.vue.d.ts +1 -1
  65. package/lib/components/table/src/index.vue2.js +19 -2
  66. package/lib/components/table/src/table-action-bar.vue.d.ts +1 -1
  67. package/lib/components/table/src/table-column.vue.d.ts +3 -3
  68. package/lib/components/yc-count-to/index.d.ts +2 -2
  69. package/lib/components/yc-count-to/src/normal/index.d.ts +2 -2
  70. package/lib/components/yc-plus-page/src/index.vue.d.ts +31 -31
  71. package/lib/components/yc-plus-tree/src/index.vue.d.ts +2 -2
  72. package/lib/components/yc-select-v2/src/index.vue.d.ts +1 -1
  73. package/lib/components/yc-status-dialog/src/index.vue.d.ts +1 -1
  74. package/lib/hooks/index.d.ts +1 -0
  75. package/lib/hooks/index.js +2 -0
  76. package/lib/hooks/usePlusFormReset.d.ts +54 -54
  77. package/lib/hooks/useTableScrollbarTooltip.d.ts +29 -0
  78. package/lib/hooks/useTableScrollbarTooltip.js +124 -0
  79. package/lib/index.css +10 -10
  80. package/lib/index.js +1 -0
  81. package/lib/version.d.ts +1 -1
  82. package/lib/version.js +1 -1
  83. package/lib/yc-components/version.d.ts +1 -1
  84. package/locale/en.js +1 -1
  85. package/locale/en.min.js +1 -1
  86. package/locale/en.min.mjs +1 -1
  87. package/locale/en.mjs +1 -1
  88. package/locale/ja.js +1 -1
  89. package/locale/ja.min.js +1 -1
  90. package/locale/ja.min.mjs +1 -1
  91. package/locale/ja.mjs +1 -1
  92. package/locale/ko.js +1 -1
  93. package/locale/ko.min.js +1 -1
  94. package/locale/ko.min.mjs +1 -1
  95. package/locale/ko.mjs +1 -1
  96. package/locale/zh-cn.js +1 -1
  97. package/locale/zh-cn.min.js +1 -1
  98. package/locale/zh-cn.min.mjs +1 -1
  99. package/locale/zh-cn.mjs +1 -1
  100. package/locale/zh-tw.js +1 -1
  101. package/locale/zh-tw.min.js +1 -1
  102. package/locale/zh-tw.min.mjs +1 -1
  103. package/locale/zh-tw.mjs +1 -1
  104. package/package.json +1 -1
  105. package/theme-chalk/index.css +1 -1
  106. package/theme-chalk/plus-table.css +1 -1
  107. package/theme-chalk/src/table.scss +315 -301
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! yc-pro-components v0.0.77 */
1
+ /*! yc-pro-components v0.0.79 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('element-plus')) :
4
4
  typeof define === 'function' && define.amd ? define(['exports', 'vue', 'element-plus'], factory) :
@@ -8814,6 +8814,125 @@
8814
8814
  };
8815
8815
  }
8816
8816
 
8817
+ const DEFAULT_TOOLTIP = "\u5DE6\u53F3\u6EDA\u52A8\uFF1A\u6309\u4F4FShift\u952E\u6EDA\u52A8\u6ED1\u8F6E";
8818
+ const DEFAULT_HORIZONTAL_BAR_SELECTOR = ".el-scrollbar__bar.is-horizontal";
8819
+ const TOOLTIP_TARGET_CLASS = "plus-table__scrollbar-tooltip-target";
8820
+ function useTableScrollbarTooltip(tableRef, options = {}) {
8821
+ var _a, _b;
8822
+ const horizontalBarSelector = (_a = options.horizontalBarSelector) != null ? _a : DEFAULT_HORIZONTAL_BAR_SELECTOR;
8823
+ const triggerRef = vue.shallowRef(null);
8824
+ const tooltipContent = vue.ref((_b = options.content) != null ? _b : DEFAULT_TOOLTIP);
8825
+ const tooltipVisible = vue.ref(false);
8826
+ let observer = null;
8827
+ let currentTarget = null;
8828
+ let onEnter = null;
8829
+ let onLeave = null;
8830
+ const isEnabled = () => {
8831
+ const enabled = options.enabled;
8832
+ if (enabled === void 0) return true;
8833
+ if (typeof enabled === "boolean") return enabled;
8834
+ return enabled.value;
8835
+ };
8836
+ const cleanupListeners = () => {
8837
+ if (currentTarget && onEnter && onLeave) {
8838
+ currentTarget.removeEventListener("mouseenter", onEnter);
8839
+ currentTarget.removeEventListener("mouseleave", onLeave);
8840
+ currentTarget.classList.remove(TOOLTIP_TARGET_CLASS);
8841
+ }
8842
+ currentTarget = null;
8843
+ onEnter = null;
8844
+ onLeave = null;
8845
+ tooltipVisible.value = false;
8846
+ };
8847
+ const findHorizontalBar = (tableEl) => {
8848
+ const bodyWrapper = tableEl.querySelector(".el-table__body-wrapper");
8849
+ const barInBody = bodyWrapper == null ? void 0 : bodyWrapper.querySelector(horizontalBarSelector);
8850
+ if (barInBody) return barInBody;
8851
+ const bars = tableEl.querySelectorAll(horizontalBarSelector);
8852
+ if (!bars.length) return null;
8853
+ return bars[bars.length - 1];
8854
+ };
8855
+ const bindTarget = (bar) => {
8856
+ if (currentTarget === bar) return;
8857
+ cleanupListeners();
8858
+ currentTarget = bar;
8859
+ bar.classList.add(TOOLTIP_TARGET_CLASS);
8860
+ onEnter = () => {
8861
+ tooltipVisible.value = true;
8862
+ };
8863
+ onLeave = () => {
8864
+ tooltipVisible.value = false;
8865
+ };
8866
+ bar.addEventListener("mouseenter", onEnter);
8867
+ bar.addEventListener("mouseleave", onLeave);
8868
+ triggerRef.value = bar;
8869
+ };
8870
+ const refresh = () => {
8871
+ var _a2, _b2;
8872
+ tooltipContent.value = (_a2 = options.content) != null ? _a2 : DEFAULT_TOOLTIP;
8873
+ if (!isEnabled()) {
8874
+ cleanupListeners();
8875
+ triggerRef.value = null;
8876
+ return;
8877
+ }
8878
+ const tableEl = (_b2 = tableRef.value) == null ? void 0 : _b2.$el;
8879
+ if (!tableEl) {
8880
+ cleanupListeners();
8881
+ triggerRef.value = null;
8882
+ return;
8883
+ }
8884
+ const horizontalBar = findHorizontalBar(tableEl);
8885
+ if (!horizontalBar) {
8886
+ cleanupListeners();
8887
+ triggerRef.value = null;
8888
+ return;
8889
+ }
8890
+ bindTarget(horizontalBar);
8891
+ };
8892
+ const setupObserver = (tableEl) => {
8893
+ observer == null ? void 0 : observer.disconnect();
8894
+ observer = new MutationObserver(() => {
8895
+ refresh();
8896
+ });
8897
+ observer.observe(tableEl, {
8898
+ childList: true,
8899
+ subtree: true,
8900
+ attributes: true,
8901
+ attributeFilter: ["style", "class"]
8902
+ });
8903
+ };
8904
+ vue.watch(
8905
+ () => {
8906
+ var _a2;
8907
+ return (_a2 = tableRef.value) == null ? void 0 : _a2.$el;
8908
+ },
8909
+ (tableEl) => {
8910
+ observer == null ? void 0 : observer.disconnect();
8911
+ observer = null;
8912
+ if (!tableEl) {
8913
+ cleanupListeners();
8914
+ triggerRef.value = null;
8915
+ return;
8916
+ }
8917
+ vue.nextTick(refresh);
8918
+ setupObserver(tableEl);
8919
+ },
8920
+ { immediate: true, flush: "post" }
8921
+ );
8922
+ vue.onBeforeUnmount(() => {
8923
+ observer == null ? void 0 : observer.disconnect();
8924
+ observer = null;
8925
+ cleanupListeners();
8926
+ triggerRef.value = null;
8927
+ });
8928
+ return {
8929
+ triggerRef,
8930
+ tooltipContent,
8931
+ tooltipVisible,
8932
+ refresh
8933
+ };
8934
+ }
8935
+
8817
8936
  const _hoisted_1$v = { class: "plus-dialog-body" };
8818
8937
  var _sfc_main$O = /* @__PURE__ */ vue.defineComponent({
8819
8938
  ...{
@@ -19111,6 +19230,11 @@
19111
19230
  const columnsIsChange = vue.ref(false);
19112
19231
  const filterColumns = vue.ref([]);
19113
19232
  const tableInstance = vue.shallowRef(null);
19233
+ const {
19234
+ triggerRef: scrollbarTooltipTrigger,
19235
+ tooltipContent: scrollbarTooltipContent,
19236
+ tooltipVisible: scrollbarTooltipVisible
19237
+ } = useTableScrollbarTooltip(tableInstance);
19114
19238
  const tableWrapperInstance = vue.ref(null);
19115
19239
  const paginationInstance = vue.ref(null);
19116
19240
  const state = vue.reactive({
@@ -19481,13 +19605,24 @@
19481
19605
  }, 16, ["data", "height", "header-cell-style", "size", "row-key"])), [
19482
19606
  [vue.unref(elementPlus.vLoading), _ctx.loadingStatus]
19483
19607
  ]),
19608
+ vue.unref(scrollbarTooltipTrigger) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElTooltip), {
19609
+ key: 1,
19610
+ visible: vue.unref(scrollbarTooltipVisible),
19611
+ "onUpdate:visible": _cache[0] || (_cache[0] = ($event) => vue.isRef(scrollbarTooltipVisible) ? scrollbarTooltipVisible.value = $event : null),
19612
+ "virtual-triggering": "",
19613
+ "virtual-ref": vue.unref(scrollbarTooltipTrigger),
19614
+ content: vue.unref(scrollbarTooltipContent),
19615
+ placement: "top",
19616
+ "show-after": 0,
19617
+ "hide-after": 0
19618
+ }, null, 8, ["visible", "virtual-ref", "content"])) : vue.createCommentVNode("v-if", true),
19484
19619
  vue.createCommentVNode(" \u5206\u9875 "),
19485
19620
  _ctx.pagination ? (vue.openBlock(), vue.createBlock(vue.unref(PlusPagination), vue.mergeProps({
19486
- key: 1,
19621
+ key: 2,
19487
19622
  ref_key: "paginationInstance",
19488
19623
  ref: paginationInstance,
19489
19624
  modelValue: vue.unref(subPageInfo),
19490
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(subPageInfo) ? subPageInfo.value = $event : null)
19625
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(subPageInfo) ? subPageInfo.value = $event : null)
19491
19626
  }, _ctx.pagination, { onChange: handlePaginationChange }), vue.createSlots({
19492
19627
  _: 2
19493
19628
  /* DYNAMIC */
@@ -64532,7 +64667,7 @@
64532
64667
  });
64533
64668
  }
64534
64669
 
64535
- const version = "0.0.77";
64670
+ const version = "0.0.79";
64536
64671
 
64537
64672
  const install = installer.install;
64538
64673