@varlet/ui 3.17.0 → 3.18.0-alpha.1781190469654

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 (121) hide show
  1. package/README.md +1 -1
  2. package/README.zh-CN.md +1 -1
  3. package/es/action-sheet/style/index.mjs +1 -1
  4. package/es/app-bar/AppBar.mjs +2 -0
  5. package/es/app-bar/appBar.css +1 -1
  6. package/es/app-bar/props.mjs +8 -0
  7. package/es/badge/badge.css +1 -1
  8. package/es/bottom-navigation-item/BottomNavigationItem.mjs +1 -1
  9. package/es/bottom-navigation-item/bottomNavigationItem.css +1 -1
  10. package/es/button/Button.mjs +13 -6
  11. package/es/button/button.css +1 -1
  12. package/es/button/props.mjs +2 -0
  13. package/es/collapse-transition/useCollapseTransition.mjs +27 -8
  14. package/es/data-table/DataTable.mjs +656 -0
  15. package/es/data-table/DataTableBodyCell.mjs +210 -0
  16. package/es/data-table/DataTableHeaderCell.mjs +237 -0
  17. package/es/data-table/DataTableSfc.css +0 -0
  18. package/es/data-table/dataTable.css +1 -0
  19. package/es/data-table/index.mjs +12 -0
  20. package/es/data-table/props.mjs +94 -0
  21. package/es/data-table/span.mjs +29 -0
  22. package/es/data-table/style/index.mjs +17 -0
  23. package/es/data-table/useBodyRows.mjs +141 -0
  24. package/es/data-table/useColumnSizes.mjs +175 -0
  25. package/es/data-table/useColumnsFixedOffsets.mjs +90 -0
  26. package/es/data-table/useContainerScroll.mjs +35 -0
  27. package/es/data-table/useExpandRow.mjs +46 -0
  28. package/es/data-table/useFootRows.mjs +49 -0
  29. package/es/data-table/useHeaderRows.mjs +113 -0
  30. package/es/data-table/usePagination.mjs +101 -0
  31. package/es/data-table/useSelectionColumn.mjs +242 -0
  32. package/es/data-table/useSorter.mjs +70 -0
  33. package/es/data-table/useTreeExpand.mjs +69 -0
  34. package/es/icon/icon.css +1 -1
  35. package/es/index.bundle.mjs +25 -1
  36. package/es/index.mjs +21 -1
  37. package/es/locale/en-US.mjs +3 -1
  38. package/es/locale/fa-IR.mjs +3 -1
  39. package/es/locale/ja-JP.mjs +3 -1
  40. package/es/locale/zh-CN.mjs +3 -1
  41. package/es/locale/zh-TW.mjs +3 -1
  42. package/es/menu/Menu.mjs +1 -0
  43. package/es/menu/menu.css +1 -1
  44. package/es/menu-select/MenuSelect.mjs +1 -1
  45. package/es/menu-select/menuSelect.css +1 -1
  46. package/es/otp-input/OtpInput.mjs +39 -12
  47. package/es/pagination/pagination.css +1 -1
  48. package/es/rail-navigation/RailNavigation.mjs +87 -0
  49. package/es/rail-navigation/RailNavigationSfc.css +0 -0
  50. package/es/rail-navigation/index.mjs +12 -0
  51. package/es/rail-navigation/props.mjs +21 -0
  52. package/es/rail-navigation/provide.mjs +12 -0
  53. package/es/rail-navigation/railNavigation.css +1 -0
  54. package/es/rail-navigation/style/index.mjs +3 -0
  55. package/es/rail-navigation-item/RailNavigationItem.mjs +177 -0
  56. package/es/rail-navigation-item/RailNavigationItemSfc.css +0 -0
  57. package/es/rail-navigation-item/index.mjs +12 -0
  58. package/es/rail-navigation-item/props.mjs +19 -0
  59. package/es/rail-navigation-item/provide.mjs +17 -0
  60. package/es/rail-navigation-item/railNavigationItem.css +1 -0
  61. package/es/rail-navigation-item/style/index.mjs +6 -0
  62. package/es/select/Select.mjs +1 -1
  63. package/es/select/select.css +1 -1
  64. package/es/style.mjs +4 -0
  65. package/es/styles/common.css +1 -1
  66. package/es/table/Table.mjs +22 -9
  67. package/es/table/props.mjs +3 -1
  68. package/es/table/table.css +1 -1
  69. package/es/themes/dark/appBar.mjs +3 -0
  70. package/es/themes/dark/bottomNavigationItem.mjs +1 -0
  71. package/es/themes/dark/button.mjs +3 -0
  72. package/es/themes/dark/dataTable.mjs +31 -0
  73. package/es/themes/dark/index.mjs +6 -2
  74. package/es/themes/dark/railNavigation.mjs +12 -0
  75. package/es/themes/dark/railNavigationItem.mjs +18 -0
  76. package/es/themes/dark/table.mjs +4 -1
  77. package/es/themes/dark/treeMenu.mjs +32 -0
  78. package/es/themes/md3-dark/appBar.mjs +3 -0
  79. package/es/themes/md3-dark/bottomNavigationItem.mjs +1 -0
  80. package/es/themes/md3-dark/button.mjs +3 -0
  81. package/es/themes/md3-dark/dataTable.mjs +31 -0
  82. package/es/themes/md3-dark/index.mjs +6 -2
  83. package/es/themes/md3-dark/railNavigation.mjs +12 -0
  84. package/es/themes/md3-dark/railNavigationItem.mjs +18 -0
  85. package/es/themes/md3-dark/table.mjs +4 -1
  86. package/es/themes/md3-dark/treeMenu.mjs +32 -0
  87. package/es/themes/md3-light/appBar.mjs +3 -0
  88. package/es/themes/md3-light/bottomNavigationItem.mjs +1 -0
  89. package/es/themes/md3-light/button.mjs +3 -0
  90. package/es/themes/md3-light/dataTable.mjs +31 -0
  91. package/es/themes/md3-light/index.mjs +6 -2
  92. package/es/themes/md3-light/pagination.mjs +1 -1
  93. package/es/themes/md3-light/railNavigation.mjs +12 -0
  94. package/es/themes/md3-light/railNavigationItem.mjs +18 -0
  95. package/es/themes/md3-light/table.mjs +4 -1
  96. package/es/themes/md3-light/treeMenu.mjs +32 -0
  97. package/es/tree-menu/TreeMenu.mjs +223 -0
  98. package/es/tree-menu/TreeMenuOption.mjs +206 -0
  99. package/es/tree-menu/TreeMenuSfc.css +0 -0
  100. package/es/tree-menu/index.mjs +12 -0
  101. package/es/tree-menu/props.mjs +40 -0
  102. package/es/tree-menu/style/index.mjs +6 -0
  103. package/es/tree-menu/treeMenu.css +1 -0
  104. package/es/varlet.css +1 -1
  105. package/es/varlet.esm.js +10532 -9190
  106. package/highlight/web-types.en-US.json +414 -1
  107. package/highlight/web-types.zh-CN.json +148 -1
  108. package/lib/varlet.cjs.js +10842 -9190
  109. package/lib/varlet.css +1 -1
  110. package/package.json +7 -7
  111. package/types/appBar.d.ts +6 -0
  112. package/types/button.d.ts +2 -0
  113. package/types/buttonGroup.d.ts +1 -1
  114. package/types/dataTable.d.ts +173 -0
  115. package/types/index.d.ts +8 -0
  116. package/types/railNavigation.d.ts +27 -0
  117. package/types/railNavigationItem.d.ts +38 -0
  118. package/types/styleVars.d.ts +84 -0
  119. package/types/table.d.ts +2 -0
  120. package/types/treeMenu.d.ts +80 -0
  121. package/umd/varlet.js +7 -7
@@ -0,0 +1,656 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { callOrReturn, isArray, isFunction } from "@varlet/shared";
21
+ import { useVModel } from "@varlet/use";
22
+ import { computed, defineComponent } from "vue";
23
+ import VarLoading from "../loading/index.mjs";
24
+ import { t } from "../locale/index.mjs";
25
+ import { injectLocaleProvider } from "../locale-provider/provide.mjs";
26
+ import VarPagination from "../pagination/index.mjs";
27
+ import { createNamespace, formatElevation, MaybeVNode } from "../utils/components.mjs";
28
+ import { toSizeUnit } from "../utils/elements.mjs";
29
+ import DataTableBodyCellComponent from "./DataTableBodyCell.mjs";
30
+ import DataTableHeaderCellComponent from "./DataTableHeaderCell.mjs";
31
+ import {
32
+ props
33
+ } from "./props.mjs";
34
+ import { useBodyRows } from "./useBodyRows.mjs";
35
+ import { useColumnsFixedOffsets } from "./useColumnsFixedOffsets.mjs";
36
+ import { useColumnSizes } from "./useColumnSizes.mjs";
37
+ import { useContainerScroll } from "./useContainerScroll.mjs";
38
+ import { useExpandRow } from "./useExpandRow.mjs";
39
+ import { useFootRows } from "./useFootRows.mjs";
40
+ import { useHeaderRows } from "./useHeaderRows.mjs";
41
+ import { usePagination } from "./usePagination.mjs";
42
+ import { useSelectionColumn } from "./useSelectionColumn.mjs";
43
+ import { useSorter } from "./useSorter.mjs";
44
+ import { useTreeExpand } from "./useTreeExpand.mjs";
45
+ const { name, n, classes } = createNamespace("data-table");
46
+ import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, normalizeClass as _normalizeClass, mergeProps as _mergeProps, createVNode as _createVNode, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createSlots as _createSlots } from "vue";
47
+ const _hoisted_1 = { key: 0 };
48
+ const _hoisted_2 = ["colspan"];
49
+ const _hoisted_3 = { key: 1 };
50
+ const _hoisted_4 = ["colspan", "rowspan"];
51
+ function __render__(_ctx, _cache) {
52
+ const _component_data_table_header_cell = _resolveComponent("data-table-header-cell");
53
+ const _component_data_table_body_cell = _resolveComponent("data-table-body-cell");
54
+ const _component_maybe_v_node = _resolveComponent("maybe-v-node");
55
+ const _component_var_pagination = _resolveComponent("var-pagination");
56
+ const _component_var_loading = _resolveComponent("var-loading");
57
+ return _openBlock(), _createElementBlock(
58
+ "div",
59
+ {
60
+ class: _normalizeClass(
61
+ _ctx.classes(
62
+ _ctx.n(),
63
+ [!_ctx.plain, _ctx.formatElevation(_ctx.elevation, 1)],
64
+ _ctx.n("$--box"),
65
+ [_ctx.surface === "low", _ctx.n("--surface-low")],
66
+ [_ctx.cellBordered, _ctx.n("--cell-bordered")],
67
+ [_ctx.plain, _ctx.n("--plain")],
68
+ [_ctx.showPagination, _ctx.n("--with-footer")],
69
+ _ctx.n(`--${_ctx.size}`)
70
+ )
71
+ )
72
+ },
73
+ [
74
+ _createVNode(_component_var_loading, { loading: _ctx.loading }, _createSlots({
75
+ default: _withCtx(() => [
76
+ _createElementVNode(
77
+ "div",
78
+ {
79
+ ref: "container",
80
+ class: _normalizeClass(_ctx.classes(_ctx.n("container"), _ctx.n("$--scrollbar"))),
81
+ style: _normalizeStyle(_ctx.containerStyle),
82
+ onScroll: _cache[0] || (_cache[0] = (...args) => _ctx.handleContainerScroll && _ctx.handleContainerScroll(...args))
83
+ },
84
+ [
85
+ _ctx.columns.length ? (_openBlock(), _createElementBlock(
86
+ "table",
87
+ {
88
+ key: 0,
89
+ class: _normalizeClass(_ctx.n("table")),
90
+ style: _normalizeStyle(_ctx.tableStyle)
91
+ },
92
+ [
93
+ _createElementVNode("colgroup", null, [
94
+ (_openBlock(true), _createElementBlock(
95
+ _Fragment,
96
+ null,
97
+ _renderList(_ctx.columns, (column, index) => {
98
+ var _a, _b;
99
+ return _openBlock(), _createElementBlock(
100
+ "col",
101
+ {
102
+ key: (_b = (_a = column.key) != null ? _a : column.type) != null ? _b : index,
103
+ style: _normalizeStyle(_ctx.getColStyle(column, index))
104
+ },
105
+ null,
106
+ 4
107
+ /* STYLE */
108
+ );
109
+ }),
110
+ 128
111
+ /* KEYED_FRAGMENT */
112
+ ))
113
+ ]),
114
+ _createElementVNode("thead", null, [
115
+ (_openBlock(true), _createElementBlock(
116
+ _Fragment,
117
+ null,
118
+ _renderList(_ctx.headerRows, (headerRow, rowIndex) => {
119
+ return _openBlock(), _createElementBlock(
120
+ "tr",
121
+ {
122
+ key: rowIndex,
123
+ class: _normalizeClass(_ctx.n("header-row"))
124
+ },
125
+ [
126
+ (_openBlock(true), _createElementBlock(
127
+ _Fragment,
128
+ null,
129
+ _renderList(headerRow, (headerCell) => {
130
+ return _openBlock(), _createBlock(_component_data_table_header_cell, {
131
+ key: headerCell.key,
132
+ "header-cell": headerCell,
133
+ style: _normalizeStyle(_ctx.getHeaderCellStyle(headerCell)),
134
+ "all-current-rows-selected": _ctx.allCurrentRowsSelected,
135
+ "some-current-rows-selected": _ctx.someCurrentRowsSelected,
136
+ "has-selectable-rows": !!_ctx.currentSelectableRows.length,
137
+ "is-selection-column": _ctx.isSelectionColumn,
138
+ "is-expand-column": _ctx.isExpandColumn,
139
+ "is-multiple-selection-column": _ctx.isMultipleSelectionColumn,
140
+ "is-selection-column-selectable": _ctx.isSelectionColumnSelectable,
141
+ "is-column-sortable": _ctx.isColumnSortable,
142
+ "get-column-sorter-order": _ctx.getColumnSorterOrder,
143
+ "is-column-resizable": _ctx.isColumnResizable,
144
+ "is-last-header-column": _ctx.isLastHeaderColumn,
145
+ "should-render-left-fixed-shadow": _ctx.shouldRenderLeftFixedShadow,
146
+ "should-render-right-fixed-shadow": _ctx.shouldRenderRightFixedShadow,
147
+ "toggle-column-sorter": _ctx.toggleColumnSorter,
148
+ "toggle-current-selectable-rows": _ctx.toggleCurrentSelectableRows,
149
+ "start-column-resize": _ctx.startColumnResize
150
+ }, null, 8, ["header-cell", "style", "all-current-rows-selected", "some-current-rows-selected", "has-selectable-rows", "is-selection-column", "is-expand-column", "is-multiple-selection-column", "is-selection-column-selectable", "is-column-sortable", "get-column-sorter-order", "is-column-resizable", "is-last-header-column", "should-render-left-fixed-shadow", "should-render-right-fixed-shadow", "toggle-column-sorter", "toggle-current-selectable-rows", "start-column-resize"]);
151
+ }),
152
+ 128
153
+ /* KEYED_FRAGMENT */
154
+ ))
155
+ ],
156
+ 2
157
+ /* CLASS */
158
+ );
159
+ }),
160
+ 128
161
+ /* KEYED_FRAGMENT */
162
+ ))
163
+ ]),
164
+ _ctx.bodyRows.length ? (_openBlock(), _createElementBlock("tbody", _hoisted_1, [
165
+ (_openBlock(true), _createElementBlock(
166
+ _Fragment,
167
+ null,
168
+ _renderList(_ctx.bodyRows, (bodyRow) => {
169
+ return _openBlock(), _createElementBlock(
170
+ _Fragment,
171
+ {
172
+ key: bodyRow.key
173
+ },
174
+ [
175
+ _createElementVNode(
176
+ "tr",
177
+ _mergeProps({
178
+ class: _ctx.classes(_ctx.n("row"), _ctx.getRowClass(bodyRow))
179
+ }, { ref_for: true }, _ctx.getRowProps(bodyRow)),
180
+ [
181
+ (_openBlock(true), _createElementBlock(
182
+ _Fragment,
183
+ null,
184
+ _renderList(bodyRow.cells, (cell) => {
185
+ return _openBlock(), _createBlock(_component_data_table_body_cell, {
186
+ key: cell.key,
187
+ "body-row": bodyRow,
188
+ cell,
189
+ style: _normalizeStyle(_ctx.getBodyCellStyle(cell)),
190
+ tree: _ctx.tree,
191
+ "is-selection-column": _ctx.isSelectionColumn,
192
+ "is-expand-column": _ctx.isExpandColumn,
193
+ "is-multiple-selection-column": _ctx.isMultipleSelectionColumn,
194
+ "is-selection-column-selectable": _ctx.isSelectionColumnSelectable,
195
+ "is-row-selectable": _ctx.isRowSelectable,
196
+ "is-row-key-selected": _ctx.isRowKeySelected,
197
+ "is-row-key-indeterminate": _ctx.isRowKeyIndeterminate,
198
+ "is-row-expandable": _ctx.isRowExpandable,
199
+ "should-render-left-fixed-shadow": _ctx.shouldRenderLeftFixedShadow,
200
+ "should-render-right-fixed-shadow": _ctx.shouldRenderRightFixedShadow,
201
+ "toggle-row-selection": _ctx.toggleRowSelection,
202
+ "toggle-row-expanded": _ctx.toggleRowExpanded,
203
+ "toggle-tree-row-expanded": _ctx.toggleTreeRowExpanded,
204
+ "render-cell": _ctx.renderCell,
205
+ "get-cell-props": _ctx.getCellProps
206
+ }, null, 8, ["body-row", "cell", "style", "tree", "is-selection-column", "is-expand-column", "is-multiple-selection-column", "is-selection-column-selectable", "is-row-selectable", "is-row-key-selected", "is-row-key-indeterminate", "is-row-expandable", "should-render-left-fixed-shadow", "should-render-right-fixed-shadow", "toggle-row-selection", "toggle-row-expanded", "toggle-tree-row-expanded", "render-cell", "get-cell-props"]);
207
+ }),
208
+ 128
209
+ /* KEYED_FRAGMENT */
210
+ ))
211
+ ],
212
+ 16
213
+ /* FULL_PROPS */
214
+ ),
215
+ bodyRow.expanded ? (_openBlock(), _createElementBlock(
216
+ "tr",
217
+ {
218
+ key: 0,
219
+ class: _normalizeClass(_ctx.n("expanded-row"))
220
+ },
221
+ [
222
+ _createElementVNode("td", {
223
+ class: _normalizeClass(_ctx.classes(_ctx.n("cell"), _ctx.n("body-cell"), _ctx.n("expanded-cell"))),
224
+ colspan: _ctx.columns.length
225
+ }, [
226
+ _createElementVNode(
227
+ "div",
228
+ {
229
+ class: _normalizeClass(_ctx.n("expanded-content"))
230
+ },
231
+ [
232
+ _createVNode(_component_maybe_v_node, {
233
+ is: _ctx.renderExpandedRow(bodyRow),
234
+ tag: "div"
235
+ }, null, 8, ["is"])
236
+ ],
237
+ 2
238
+ /* CLASS */
239
+ )
240
+ ], 10, _hoisted_2)
241
+ ],
242
+ 2
243
+ /* CLASS */
244
+ )) : _createCommentVNode("v-if", true)
245
+ ],
246
+ 64
247
+ /* STABLE_FRAGMENT */
248
+ );
249
+ }),
250
+ 128
251
+ /* KEYED_FRAGMENT */
252
+ ))
253
+ ])) : _createCommentVNode("v-if", true),
254
+ _ctx.footRows.length ? (_openBlock(), _createElementBlock("tfoot", _hoisted_3, [
255
+ (_openBlock(true), _createElementBlock(
256
+ _Fragment,
257
+ null,
258
+ _renderList(_ctx.footRows, (footRow, rowIndex) => {
259
+ return _openBlock(), _createElementBlock(
260
+ "tr",
261
+ {
262
+ key: rowIndex,
263
+ class: _normalizeClass(_ctx.n("summary-row"))
264
+ },
265
+ [
266
+ (_openBlock(true), _createElementBlock(
267
+ _Fragment,
268
+ null,
269
+ _renderList(footRow, (cell) => {
270
+ return _openBlock(), _createElementBlock("td", {
271
+ key: cell.key,
272
+ class: _normalizeClass(
273
+ _ctx.classes(
274
+ _ctx.n("cell"),
275
+ _ctx.n("summary-cell"),
276
+ [cell.column.fixed, _ctx.n("fixed-cell")],
277
+ [_ctx.shouldRenderLeftFixedShadow(cell.columnIndex), _ctx.n("fixed-cell--shadow-right")],
278
+ [_ctx.shouldRenderRightFixedShadow(cell.columnIndex), _ctx.n("fixed-cell--shadow-left")]
279
+ )
280
+ ),
281
+ style: _normalizeStyle(_ctx.getBodyCellStyle(cell)),
282
+ colspan: cell.colSpan,
283
+ rowspan: cell.rowSpan
284
+ }, [
285
+ _createVNode(_component_maybe_v_node, {
286
+ is: cell.value,
287
+ tag: "div"
288
+ }, null, 8, ["is"])
289
+ ], 14, _hoisted_4);
290
+ }),
291
+ 128
292
+ /* KEYED_FRAGMENT */
293
+ ))
294
+ ],
295
+ 2
296
+ /* CLASS */
297
+ );
298
+ }),
299
+ 128
300
+ /* KEYED_FRAGMENT */
301
+ ))
302
+ ])) : _createCommentVNode("v-if", true)
303
+ ],
304
+ 6
305
+ /* CLASS, STYLE */
306
+ )) : _createCommentVNode("v-if", true),
307
+ !_ctx.bodyRows.length ? (_openBlock(), _createElementBlock(
308
+ "div",
309
+ {
310
+ key: 1,
311
+ class: _normalizeClass(_ctx.n("empty"))
312
+ },
313
+ [
314
+ _renderSlot(_ctx.$slots, "empty", {}, () => [
315
+ _createTextVNode(
316
+ _toDisplayString((_ctx.pt ? _ctx.pt : _ctx.t)("dataTableEmptyText")),
317
+ 1
318
+ /* TEXT */
319
+ )
320
+ ])
321
+ ],
322
+ 2
323
+ /* CLASS */
324
+ )) : _createCommentVNode("v-if", true)
325
+ ],
326
+ 38
327
+ /* CLASS, STYLE, NEED_HYDRATION */
328
+ ),
329
+ _ctx.showPagination ? (_openBlock(), _createElementBlock(
330
+ "div",
331
+ {
332
+ key: 0,
333
+ class: _normalizeClass(_ctx.n("footer"))
334
+ },
335
+ [
336
+ _renderSlot(_ctx.$slots, "footer-prefix"),
337
+ _createVNode(_component_var_pagination, {
338
+ "var-data-table-cover": "",
339
+ current: _ctx.normalizedPage,
340
+ size: _ctx.pageSize,
341
+ total: _ctx.paginationTotal,
342
+ simple: _ctx.paginationProps.simple,
343
+ disabled: _ctx.paginationProps.disabled,
344
+ "show-size-changer": _ctx.paginationProps.showSizeChanger,
345
+ "show-quick-jumper": _ctx.paginationProps.showQuickJumper,
346
+ "max-pager-count": _ctx.paginationProps.maxPagerCount,
347
+ "size-option": _ctx.paginationProps.sizeOption,
348
+ "show-total": _ctx.paginationProps.showTotal,
349
+ onChange: _ctx.handlePaginationChange
350
+ }, null, 8, ["current", "size", "total", "simple", "disabled", "show-size-changer", "show-quick-jumper", "max-pager-count", "size-option", "show-total", "onChange"])
351
+ ],
352
+ 2
353
+ /* CLASS */
354
+ )) : _createCommentVNode("v-if", true)
355
+ ]),
356
+ _: 2
357
+ /* DYNAMIC */
358
+ }, [
359
+ _ctx.$slots["loading-description"] ? {
360
+ name: "description",
361
+ fn: _withCtx(() => [
362
+ _renderSlot(_ctx.$slots, "loading-description")
363
+ ]),
364
+ key: "0"
365
+ } : void 0
366
+ ]), 1032, ["loading"])
367
+ ],
368
+ 2
369
+ /* CLASS */
370
+ );
371
+ }
372
+ const __sfc__ = defineComponent({
373
+ name,
374
+ components: {
375
+ DataTableBodyCell: DataTableBodyCellComponent,
376
+ DataTableHeaderCell: DataTableHeaderCellComponent,
377
+ VarLoading,
378
+ VarPagination,
379
+ MaybeVNode
380
+ },
381
+ props,
382
+ setup(props2) {
383
+ const { t: pt } = injectLocaleProvider();
384
+ const checkedRowKeys = useVModel(props2, "checkedRowKeys");
385
+ const expandedRowKeys = useVModel(props2, "expandedRowKeys");
386
+ const expandedTreeRowKeys = useVModel(props2, "expandedTreeRowKeys");
387
+ const page = useVModel(props2, "page");
388
+ const pageSize = useVModel(props2, "pageSize");
389
+ const { collapsedTreeRowKeys, toggleTreeRowExpanded } = useTreeExpand({
390
+ tree: () => props2.tree,
391
+ data: () => props2.data,
392
+ expandedTreeRowKeys,
393
+ getRowKey,
394
+ getTreeChildren
395
+ });
396
+ const { normalizedColumns: columns, headerRows } = useHeaderRows({
397
+ columns: () => props2.columns
398
+ });
399
+ const {
400
+ hasResolvedColumnWidth,
401
+ resolvedColumnWidths,
402
+ totalResolvedColumnWidth,
403
+ getColStyle,
404
+ isColumnResizable,
405
+ startColumnResize
406
+ } = useColumnSizes({
407
+ columns: () => columns.value,
408
+ isSelectionColumn,
409
+ isExpandColumn
410
+ });
411
+ const containerStyle = computed(() => {
412
+ const style = {};
413
+ if (props2.maxHeight != null) {
414
+ style.maxHeight = toSizeUnit(props2.maxHeight);
415
+ style.overflow = "auto";
416
+ }
417
+ style.overflowX = "auto";
418
+ return style;
419
+ });
420
+ const tableStyle = computed(() => {
421
+ const style = {
422
+ width: "100%",
423
+ tableLayout: hasResolvedColumnWidth.value ? "fixed" : props2.tableLayout
424
+ };
425
+ if (props2.scrollX != null) {
426
+ const width = toSizeUnit(props2.scrollX);
427
+ style.width = width;
428
+ style.minWidth = width;
429
+ return style;
430
+ }
431
+ if (hasResolvedColumnWidth.value) {
432
+ style.minWidth = toSizeUnit(totalResolvedColumnWidth.value);
433
+ }
434
+ return style;
435
+ });
436
+ const { getFixedStyle, isFirstRightFixedColumn, isLastLeftFixedColumn } = useColumnsFixedOffsets({
437
+ columns: () => columns.value,
438
+ resolvedColumnWidths: () => resolvedColumnWidths.value
439
+ });
440
+ const { getColumnSorterOrder, isColumnSortable, toggleColumnSorter } = useSorter({
441
+ sorters: () => props2.sorters,
442
+ sortMode: () => props2.sortMode,
443
+ onUpdateSorters: () => props2["onUpdate:sorters"]
444
+ });
445
+ const { paginationProps, paginationTotal, showPagination, normalizedPage, pagedData } = usePagination({
446
+ pagination: () => props2.pagination,
447
+ remote: () => props2.remote,
448
+ loading: () => props2.loading,
449
+ page: () => page.value,
450
+ pageSize: () => pageSize.value,
451
+ total: () => props2.total,
452
+ data: () => props2.data,
453
+ onUpdatePage: () => (nextPage) => {
454
+ page.value = nextPage;
455
+ }
456
+ });
457
+ const firstTreeColumnIndex = computed(
458
+ () => columns.value.findIndex((column) => !isSelectionColumn(column) && !isExpandColumn(column))
459
+ );
460
+ const { expandedRowKeySet, isRowExpandable, toggleRowExpanded, renderExpandedRow } = useExpandRow({
461
+ columns: () => columns.value,
462
+ expandedRowKeys,
463
+ isExpandColumn
464
+ });
465
+ const { allFlatRows, treeRowMeta, bodyRows } = useBodyRows({
466
+ collapsedTreeRowKeys,
467
+ expandedRowKeySet,
468
+ firstTreeColumnIndex,
469
+ getRowKey,
470
+ getTreeChildren,
471
+ columns: () => columns.value,
472
+ sourceRows: () => pagedData.value,
473
+ tree: () => props2.tree
474
+ });
475
+ const { footRows } = useFootRows({
476
+ columns: () => columns.value,
477
+ sourceRows: () => pagedData.value,
478
+ summary: () => props2.summary
479
+ });
480
+ const { container, scrollLeft, maxScrollDistance, handleContainerScroll } = useContainerScroll([
481
+ columns,
482
+ bodyRows,
483
+ footRows,
484
+ totalResolvedColumnWidth,
485
+ () => props2.scrollX
486
+ ]);
487
+ const {
488
+ currentSelectableRows,
489
+ allCurrentRowsSelected,
490
+ someCurrentRowsSelected,
491
+ isMultipleSelectionColumn,
492
+ isSelectionColumnSelectable,
493
+ isRowSelectable,
494
+ isRowKeySelected,
495
+ isRowKeyIndeterminate,
496
+ toggleRowSelection,
497
+ toggleCurrentSelectableRows
498
+ } = useSelectionColumn({
499
+ checkedRowKeys,
500
+ isSelectionColumn,
501
+ getTreeChildren,
502
+ columns: () => columns.value,
503
+ tree: () => props2.tree,
504
+ cascade: () => props2.cascade,
505
+ pagedData: () => pagedData.value,
506
+ allFlatRows: () => allFlatRows.value,
507
+ treeRowMeta: () => treeRowMeta.value
508
+ });
509
+ function getRowKey(row, rowIndex) {
510
+ var _a;
511
+ if (isFunction(props2.rowKey)) {
512
+ return props2.rowKey({ row, rowIndex });
513
+ }
514
+ return (_a = row[props2.rowKey]) != null ? _a : rowIndex;
515
+ }
516
+ function getTreeChildren(row) {
517
+ const children = row[props2.childrenKey];
518
+ return isArray(children) ? children : [];
519
+ }
520
+ function isSelectionColumn(column) {
521
+ return column.type === "selection";
522
+ }
523
+ function isExpandColumn(column) {
524
+ return column.type === "expand";
525
+ }
526
+ function renderCell(bodyRow, column) {
527
+ if (isSelectionColumn(column) || isExpandColumn(column)) {
528
+ return;
529
+ }
530
+ if (column.render) {
531
+ return column.render({
532
+ row: bodyRow.row,
533
+ rowIndex: bodyRow.rowIndex
534
+ });
535
+ }
536
+ return bodyRow.row[column.key];
537
+ }
538
+ function getRowProps(bodyRow) {
539
+ if (!props2.rowProps) {
540
+ return;
541
+ }
542
+ return callOrReturn(props2.rowProps, {
543
+ row: bodyRow.row,
544
+ rowIndex: bodyRow.rowIndex
545
+ });
546
+ }
547
+ function getRowClass(bodyRow) {
548
+ if (!props2.rowClass) {
549
+ return;
550
+ }
551
+ return callOrReturn(props2.rowClass, {
552
+ row: bodyRow.row,
553
+ rowIndex: bodyRow.rowIndex
554
+ });
555
+ }
556
+ function getCellProps(bodyRow, column) {
557
+ if (!column.cellProps) {
558
+ return;
559
+ }
560
+ return callOrReturn(column.cellProps, {
561
+ row: bodyRow.row,
562
+ rowIndex: bodyRow.rowIndex
563
+ });
564
+ }
565
+ function getAlign(align) {
566
+ return align != null ? align : "left";
567
+ }
568
+ function isLastHeaderColumn(columnIndex) {
569
+ return columnIndex === columns.value.length - 1;
570
+ }
571
+ function shouldRenderLeftFixedShadow(columnIndex) {
572
+ return scrollLeft.value > 1 && isLastLeftFixedColumn(columnIndex);
573
+ }
574
+ function shouldRenderRightFixedShadow(columnIndex) {
575
+ return scrollLeft.value < maxScrollDistance.value - 1 && isFirstRightFixedColumn(columnIndex);
576
+ }
577
+ function getHeaderCellStyle(cell) {
578
+ var _a;
579
+ return __spreadProps(__spreadValues({
580
+ textAlign: getAlign((_a = cell.column.titleAlign) != null ? _a : cell.column.align)
581
+ }, getFixedStyle(cell.fixed, cell.startLeafColumnIndex)), {
582
+ zIndex: cell.fixed ? 3 : 2
583
+ });
584
+ }
585
+ function getBodyCellStyle(cell) {
586
+ return __spreadProps(__spreadValues({
587
+ textAlign: getAlign(cell.column.align)
588
+ }, getFixedStyle(cell.column.fixed, cell.columnIndex)), {
589
+ zIndex: cell.column.fixed ? 1 : void 0
590
+ });
591
+ }
592
+ function handlePaginationChange(nextPage, nextPageSize) {
593
+ page.value = nextPage;
594
+ pageSize.value = nextPageSize;
595
+ }
596
+ return {
597
+ pt,
598
+ t,
599
+ container,
600
+ expandedRowKeys,
601
+ containerStyle,
602
+ paginationProps,
603
+ paginationTotal,
604
+ showPagination,
605
+ normalizedPage,
606
+ pageSize,
607
+ tableStyle,
608
+ columns,
609
+ currentSelectableRows,
610
+ allCurrentRowsSelected,
611
+ someCurrentRowsSelected,
612
+ headerRows,
613
+ bodyRows,
614
+ footRows,
615
+ isColumnResizable,
616
+ getRowProps,
617
+ getRowClass,
618
+ getCellProps,
619
+ isSelectionColumn,
620
+ isExpandColumn,
621
+ isColumnSortable,
622
+ isMultipleSelectionColumn,
623
+ isSelectionColumnSelectable,
624
+ getColumnSorterOrder,
625
+ isRowExpandable,
626
+ isRowKeyIndeterminate,
627
+ isRowKeySelected,
628
+ isRowSelectable,
629
+ shouldRenderLeftFixedShadow,
630
+ shouldRenderRightFixedShadow,
631
+ toggleColumnSorter,
632
+ toggleCurrentSelectableRows,
633
+ toggleRowExpanded,
634
+ toggleTreeRowExpanded,
635
+ toggleRowSelection,
636
+ renderCell,
637
+ renderExpandedRow,
638
+ getColStyle,
639
+ getHeaderCellStyle,
640
+ getBodyCellStyle,
641
+ handlePaginationChange,
642
+ handleContainerScroll,
643
+ isLastHeaderColumn,
644
+ startColumnResize,
645
+ n,
646
+ classes,
647
+ formatElevation,
648
+ toSizeUnit
649
+ };
650
+ }
651
+ });
652
+ __sfc__.render = __render__;
653
+ var stdin_default = __sfc__;
654
+ export {
655
+ stdin_default as default
656
+ };