table.mjs 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
  2. import table_vue_vue_type_script_lang_default from "./table.vue_vue_type_script_lang.mjs";
  3. import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, normalizeClass, normalizeStyle, openBlock, renderSlot, resolveComponent, resolveDirective, toDisplayString, vShow, withCtx, withDirectives } from "vue";
  4. //#region ../../packages/components/table/src/table.vue
  5. const _hoisted_1 = ["data-prefix"];
  6. const _hoisted_2 = {
  7. ref: "hiddenColumns",
  8. class: "hidden-columns"
  9. };
  10. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  11. const _component_hColgroup = resolveComponent("hColgroup");
  12. const _component_table_header = resolveComponent("table-header");
  13. const _component_table_body = resolveComponent("table-body");
  14. const _component_table_footer = resolveComponent("table-footer");
  15. const _component_el_scrollbar = resolveComponent("el-scrollbar");
  16. const _directive_mousewheel = resolveDirective("mousewheel");
  17. return openBlock(), createElementBlock("div", {
  18. ref: "tableWrapper",
  19. class: normalizeClass([
  20. {
  21. [_ctx.ns.m("fit")]: _ctx.fit,
  22. [_ctx.ns.m("striped")]: _ctx.stripe,
  23. [_ctx.ns.m("border")]: _ctx.border || _ctx.isGroup,
  24. [_ctx.ns.m("hidden")]: _ctx.isHidden,
  25. [_ctx.ns.m("group")]: _ctx.isGroup,
  26. [_ctx.ns.m("fluid-height")]: _ctx.maxHeight,
  27. [_ctx.ns.m("scrollable-x")]: _ctx.layout.scrollX.value,
  28. [_ctx.ns.m("scrollable-y")]: _ctx.layout.scrollY.value,
  29. [_ctx.ns.m("enable-row-hover")]: !_ctx.store.states.isComplex.value,
  30. [_ctx.ns.m("enable-row-transition")]: (_ctx.store.states.data.value || []).length !== 0 && (_ctx.store.states.data.value || []).length < 100,
  31. "has-footer": _ctx.showSummary
  32. },
  33. _ctx.ns.m(_ctx.tableSize),
  34. _ctx.className,
  35. _ctx.ns.b(),
  36. _ctx.ns.m(`layout-${_ctx.tableLayout}`)
  37. ]),
  38. style: normalizeStyle(_ctx.style),
  39. "data-prefix": _ctx.ns.namespace.value,
  40. onMouseleave: _cache[1] || (_cache[1] = (...args) => _ctx.handleMouseLeave && _ctx.handleMouseLeave(...args))
  41. }, [createElementVNode("div", {
  42. ref: "tableInnerWrapper",
  43. class: normalizeClass(_ctx.ns.e("inner-wrapper"))
  44. }, [
  45. createElementVNode("div", _hoisted_2, [renderSlot(_ctx.$slots, "default")], 512),
  46. _ctx.showHeader && _ctx.tableLayout === "fixed" ? withDirectives((openBlock(), createElementBlock("div", {
  47. key: 0,
  48. ref: "headerWrapper",
  49. class: normalizeClass(_ctx.ns.e("header-wrapper"))
  50. }, [createElementVNode("table", {
  51. ref: "tableHeader",
  52. class: normalizeClass(_ctx.ns.e("header")),
  53. style: normalizeStyle(_ctx.tableBodyStyles),
  54. border: "0",
  55. cellpadding: "0",
  56. cellspacing: "0"
  57. }, [createVNode(_component_hColgroup, {
  58. columns: _ctx.store.states.columns.value,
  59. "table-layout": _ctx.tableLayout
  60. }, null, 8, ["columns", "table-layout"]), createVNode(_component_table_header, {
  61. ref: "tableHeaderRef",
  62. border: _ctx.border,
  63. "default-sort": _ctx.defaultSort,
  64. store: _ctx.store,
  65. "append-filter-panel-to": _ctx.appendFilterPanelTo,
  66. "allow-drag-last-column": _ctx.allowDragLastColumn,
  67. onSetDragVisible: _ctx.setDragVisible
  68. }, null, 8, [
  69. "border",
  70. "default-sort",
  71. "store",
  72. "append-filter-panel-to",
  73. "allow-drag-last-column",
  74. "onSetDragVisible"
  75. ])], 6)], 2)), [[_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]]) : createCommentVNode("v-if", true),
  76. createElementVNode("div", {
  77. ref: "bodyWrapper",
  78. class: normalizeClass(_ctx.ns.e("body-wrapper"))
  79. }, [createVNode(_component_el_scrollbar, {
  80. ref: "scrollBarRef",
  81. "view-style": _ctx.scrollbarViewStyle,
  82. "wrap-style": _ctx.scrollbarStyle,
  83. always: _ctx.scrollbarAlwaysOn,
  84. tabindex: _ctx.scrollbarTabindex,
  85. native: _ctx.nativeScrollbar,
  86. onScroll: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("scroll", $event))
  87. }, {
  88. default: withCtx(() => [
  89. createElementVNode("table", {
  90. ref: "tableBody",
  91. class: normalizeClass(_ctx.ns.e("body")),
  92. cellspacing: "0",
  93. cellpadding: "0",
  94. border: "0",
  95. style: normalizeStyle({
  96. width: _ctx.bodyWidth,
  97. tableLayout: _ctx.tableLayout
  98. })
  99. }, [
  100. createVNode(_component_hColgroup, {
  101. columns: _ctx.store.states.columns.value,
  102. "table-layout": _ctx.tableLayout
  103. }, null, 8, ["columns", "table-layout"]),
  104. _ctx.showHeader && _ctx.tableLayout === "auto" ? (openBlock(), createBlock(_component_table_header, {
  105. key: 0,
  106. ref: "tableHeaderRef",
  107. class: normalizeClass(_ctx.ns.e("body-header")),
  108. border: _ctx.border,
  109. "default-sort": _ctx.defaultSort,
  110. store: _ctx.store,
  111. "append-filter-panel-to": _ctx.appendFilterPanelTo,
  112. onSetDragVisible: _ctx.setDragVisible
  113. }, null, 8, [
  114. "class",
  115. "border",
  116. "default-sort",
  117. "store",
  118. "append-filter-panel-to",
  119. "onSetDragVisible"
  120. ])) : createCommentVNode("v-if", true),
  121. createVNode(_component_table_body, {
  122. context: _ctx.context,
  123. highlight: _ctx.highlightCurrentRow,
  124. "row-class-name": _ctx.rowClassName,
  125. "tooltip-effect": _ctx.computedTooltipEffect,
  126. "tooltip-options": _ctx.computedTooltipOptions,
  127. "row-style": _ctx.rowStyle,
  128. store: _ctx.store,
  129. stripe: _ctx.stripe
  130. }, null, 8, [
  131. "context",
  132. "highlight",
  133. "row-class-name",
  134. "tooltip-effect",
  135. "tooltip-options",
  136. "row-style",
  137. "store",
  138. "stripe"
  139. ]),
  140. _ctx.showSummary && _ctx.tableLayout === "auto" ? (openBlock(), createBlock(_component_table_footer, {
  141. key: 1,
  142. class: normalizeClass(_ctx.ns.e("body-footer")),
  143. border: _ctx.border,
  144. "default-sort": _ctx.defaultSort,
  145. store: _ctx.store,
  146. "sum-text": _ctx.computedSumText,
  147. "summary-method": _ctx.summaryMethod
  148. }, null, 8, [
  149. "class",
  150. "border",
  151. "default-sort",
  152. "store",
  153. "sum-text",
  154. "summary-method"
  155. ])) : createCommentVNode("v-if", true)
  156. ], 6),
  157. _ctx.isEmpty ? (openBlock(), createElementBlock("div", {
  158. key: 0,
  159. ref: "emptyBlock",
  160. style: normalizeStyle(_ctx.emptyBlockStyle),
  161. class: normalizeClass(_ctx.ns.e("empty-block"))
  162. }, [createElementVNode("span", { class: normalizeClass(_ctx.ns.e("empty-text")) }, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(_ctx.computedEmptyText), 1)])], 2)], 6)) : createCommentVNode("v-if", true),
  163. _ctx.$slots.append ? (openBlock(), createElementBlock("div", {
  164. key: 1,
  165. ref: "appendWrapper",
  166. class: normalizeClass(_ctx.ns.e("append-wrapper"))
  167. }, [renderSlot(_ctx.$slots, "append")], 2)) : createCommentVNode("v-if", true)
  168. ]),
  169. _: 3
  170. }, 8, [
  171. "view-style",
  172. "wrap-style",
  173. "always",
  174. "tabindex",
  175. "native"
  176. ])], 2),
  177. _ctx.showSummary && _ctx.tableLayout === "fixed" ? withDirectives((openBlock(), createElementBlock("div", {
  178. key: 1,
  179. ref: "footerWrapper",
  180. class: normalizeClass(_ctx.ns.e("footer-wrapper"))
  181. }, [createElementVNode("table", {
  182. class: normalizeClass(_ctx.ns.e("footer")),
  183. cellspacing: "0",
  184. cellpadding: "0",
  185. border: "0",
  186. style: normalizeStyle(_ctx.tableBodyStyles)
  187. }, [createVNode(_component_hColgroup, {
  188. columns: _ctx.store.states.columns.value,
  189. "table-layout": _ctx.tableLayout
  190. }, null, 8, ["columns", "table-layout"]), createVNode(_component_table_footer, {
  191. border: _ctx.border,
  192. "default-sort": _ctx.defaultSort,
  193. store: _ctx.store,
  194. "sum-text": _ctx.computedSumText,
  195. "summary-method": _ctx.summaryMethod
  196. }, null, 8, [
  197. "border",
  198. "default-sort",
  199. "store",
  200. "sum-text",
  201. "summary-method"
  202. ])], 6)], 2)), [[vShow, !_ctx.isEmpty], [_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]]) : createCommentVNode("v-if", true),
  203. _ctx.border || _ctx.isGroup ? (openBlock(), createElementBlock("div", {
  204. key: 2,
  205. class: normalizeClass(_ctx.ns.e("border-left-patch"))
  206. }, null, 2)) : createCommentVNode("v-if", true)
  207. ], 2), withDirectives(createElementVNode("div", {
  208. ref: "resizeProxy",
  209. class: normalizeClass(_ctx.ns.e("column-resize-proxy"))
  210. }, null, 2), [[vShow, _ctx.resizeProxyVisible]])], 46, _hoisted_1);
  211. }
  212. var table_default = /* @__PURE__ */ _plugin_vue_export_helper_default(table_vue_vue_type_script_lang_default, [["render", _sfc_render]]);
  213. //#endregion
  214. export { table_default as default };
  215. //# sourceMappingURL=table.mjs.map