@varlet/ui 3.17.1 → 3.18.0-alpha.1781192892883
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.
- package/es/action-sheet/style/index.mjs +1 -1
- package/es/app-bar/AppBar.mjs +2 -0
- package/es/app-bar/appBar.css +1 -1
- package/es/app-bar/props.mjs +8 -0
- package/es/badge/badge.css +1 -1
- package/es/bottom-navigation-item/BottomNavigationItem.mjs +1 -1
- package/es/bottom-navigation-item/bottomNavigationItem.css +1 -1
- package/es/button/Button.mjs +13 -6
- package/es/button/button.css +1 -1
- package/es/button/props.mjs +2 -0
- package/es/collapse-transition/useCollapseTransition.mjs +27 -8
- package/es/data-table/DataTable.mjs +655 -0
- package/es/data-table/DataTableBodyCell.mjs +210 -0
- package/es/data-table/DataTableHeaderCell.mjs +237 -0
- package/es/data-table/DataTableSfc.css +0 -0
- package/es/data-table/dataTable.css +1 -0
- package/es/data-table/index.mjs +12 -0
- package/es/data-table/props.mjs +94 -0
- package/es/data-table/span.mjs +29 -0
- package/es/data-table/style/index.mjs +17 -0
- package/es/data-table/useBodyRows.mjs +141 -0
- package/es/data-table/useColumnSizes.mjs +175 -0
- package/es/data-table/useColumnsFixedOffsets.mjs +90 -0
- package/es/data-table/useContainerScroll.mjs +35 -0
- package/es/data-table/useExpandRow.mjs +46 -0
- package/es/data-table/useFootRows.mjs +49 -0
- package/es/data-table/useHeaderRows.mjs +113 -0
- package/es/data-table/usePagination.mjs +101 -0
- package/es/data-table/useSelectionColumn.mjs +242 -0
- package/es/data-table/useSorter.mjs +70 -0
- package/es/data-table/useTreeExpand.mjs +69 -0
- package/es/icon/icon.css +1 -1
- package/es/index.bundle.mjs +25 -1
- package/es/index.mjs +21 -1
- package/es/locale/en-US.mjs +3 -1
- package/es/locale/fa-IR.mjs +3 -1
- package/es/locale/ja-JP.mjs +3 -1
- package/es/locale/zh-CN.mjs +3 -1
- package/es/locale/zh-TW.mjs +3 -1
- package/es/menu/Menu.mjs +1 -0
- package/es/menu/menu.css +1 -1
- package/es/menu-select/MenuSelect.mjs +1 -1
- package/es/menu-select/menuSelect.css +1 -1
- package/es/otp-input/OtpInput.mjs +39 -12
- package/es/pagination/pagination.css +1 -1
- package/es/rail-navigation/RailNavigation.mjs +87 -0
- package/es/rail-navigation/RailNavigationSfc.css +0 -0
- package/es/rail-navigation/index.mjs +12 -0
- package/es/rail-navigation/props.mjs +21 -0
- package/es/rail-navigation/provide.mjs +12 -0
- package/es/rail-navigation/railNavigation.css +1 -0
- package/es/rail-navigation/style/index.mjs +3 -0
- package/es/rail-navigation-item/RailNavigationItem.mjs +177 -0
- package/es/rail-navigation-item/RailNavigationItemSfc.css +0 -0
- package/es/rail-navigation-item/index.mjs +12 -0
- package/es/rail-navigation-item/props.mjs +19 -0
- package/es/rail-navigation-item/provide.mjs +17 -0
- package/es/rail-navigation-item/railNavigationItem.css +1 -0
- package/es/rail-navigation-item/style/index.mjs +6 -0
- package/es/select/Select.mjs +1 -1
- package/es/select/select.css +1 -1
- package/es/snackbar/style/index.mjs +1 -1
- package/es/style.mjs +4 -0
- package/es/styles/common.css +1 -1
- package/es/table/Table.mjs +22 -9
- package/es/table/props.mjs +3 -1
- package/es/table/table.css +1 -1
- package/es/themes/dark/appBar.mjs +3 -0
- package/es/themes/dark/bottomNavigationItem.mjs +1 -0
- package/es/themes/dark/button.mjs +3 -0
- package/es/themes/dark/dataTable.mjs +32 -0
- package/es/themes/dark/index.mjs +6 -2
- package/es/themes/dark/railNavigation.mjs +12 -0
- package/es/themes/dark/railNavigationItem.mjs +18 -0
- package/es/themes/dark/table.mjs +7 -3
- package/es/themes/dark/treeMenu.mjs +32 -0
- package/es/themes/md3-dark/appBar.mjs +3 -0
- package/es/themes/md3-dark/bottomNavigationItem.mjs +1 -0
- package/es/themes/md3-dark/button.mjs +3 -0
- package/es/themes/md3-dark/dataTable.mjs +32 -0
- package/es/themes/md3-dark/index.mjs +6 -2
- package/es/themes/md3-dark/railNavigation.mjs +12 -0
- package/es/themes/md3-dark/railNavigationItem.mjs +18 -0
- package/es/themes/md3-dark/table.mjs +7 -3
- package/es/themes/md3-dark/treeMenu.mjs +32 -0
- package/es/themes/md3-light/appBar.mjs +3 -0
- package/es/themes/md3-light/bottomNavigationItem.mjs +1 -0
- package/es/themes/md3-light/button.mjs +3 -0
- package/es/themes/md3-light/dataTable.mjs +32 -0
- package/es/themes/md3-light/index.mjs +6 -2
- package/es/themes/md3-light/pagination.mjs +1 -1
- package/es/themes/md3-light/railNavigation.mjs +12 -0
- package/es/themes/md3-light/railNavigationItem.mjs +18 -0
- package/es/themes/md3-light/table.mjs +7 -3
- package/es/themes/md3-light/treeMenu.mjs +32 -0
- package/es/tree-menu/TreeMenu.mjs +223 -0
- package/es/tree-menu/TreeMenuOption.mjs +206 -0
- package/es/tree-menu/TreeMenuSfc.css +0 -0
- package/es/tree-menu/index.mjs +12 -0
- package/es/tree-menu/props.mjs +40 -0
- package/es/tree-menu/style/index.mjs +6 -0
- package/es/tree-menu/treeMenu.css +1 -0
- package/es/varlet.css +1 -1
- package/es/varlet.esm.js +11274 -8961
- package/highlight/web-types.en-US.json +414 -1
- package/highlight/web-types.zh-CN.json +148 -1
- package/lib/varlet.cjs.js +10850 -8024
- package/lib/varlet.css +1 -1
- package/package.json +7 -7
- package/types/appBar.d.ts +6 -0
- package/types/button.d.ts +2 -0
- package/types/buttonGroup.d.ts +1 -1
- package/types/dataTable.d.ts +173 -0
- package/types/index.d.ts +8 -0
- package/types/railNavigation.d.ts +27 -0
- package/types/railNavigationItem.d.ts +38 -0
- package/types/styleVars.d.ts +86 -0
- package/types/table.d.ts +2 -0
- package/types/treeMenu.d.ts +80 -0
- package/umd/varlet.js +7 -7
|
@@ -0,0 +1,655 @@
|
|
|
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.minWidth = hasResolvedColumnWidth.value ? `max(${width}, ${toSizeUnit(totalResolvedColumnWidth.value)})` : width;
|
|
428
|
+
return style;
|
|
429
|
+
}
|
|
430
|
+
if (hasResolvedColumnWidth.value) {
|
|
431
|
+
style.minWidth = toSizeUnit(totalResolvedColumnWidth.value);
|
|
432
|
+
}
|
|
433
|
+
return style;
|
|
434
|
+
});
|
|
435
|
+
const { getFixedStyle, isFirstRightFixedColumn, isLastLeftFixedColumn } = useColumnsFixedOffsets({
|
|
436
|
+
columns: () => columns.value,
|
|
437
|
+
resolvedColumnWidths: () => resolvedColumnWidths.value
|
|
438
|
+
});
|
|
439
|
+
const { getColumnSorterOrder, isColumnSortable, toggleColumnSorter } = useSorter({
|
|
440
|
+
sorters: () => props2.sorters,
|
|
441
|
+
sortMode: () => props2.sortMode,
|
|
442
|
+
onUpdateSorters: () => props2["onUpdate:sorters"]
|
|
443
|
+
});
|
|
444
|
+
const { paginationProps, paginationTotal, showPagination, normalizedPage, pagedData } = usePagination({
|
|
445
|
+
pagination: () => props2.pagination,
|
|
446
|
+
remote: () => props2.remote,
|
|
447
|
+
loading: () => props2.loading,
|
|
448
|
+
page: () => page.value,
|
|
449
|
+
pageSize: () => pageSize.value,
|
|
450
|
+
total: () => props2.total,
|
|
451
|
+
data: () => props2.data,
|
|
452
|
+
onUpdatePage: () => (nextPage) => {
|
|
453
|
+
page.value = nextPage;
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
const firstTreeColumnIndex = computed(
|
|
457
|
+
() => columns.value.findIndex((column) => !isSelectionColumn(column) && !isExpandColumn(column))
|
|
458
|
+
);
|
|
459
|
+
const { expandedRowKeySet, isRowExpandable, toggleRowExpanded, renderExpandedRow } = useExpandRow({
|
|
460
|
+
columns: () => columns.value,
|
|
461
|
+
expandedRowKeys,
|
|
462
|
+
isExpandColumn
|
|
463
|
+
});
|
|
464
|
+
const { allFlatRows, treeRowMeta, bodyRows } = useBodyRows({
|
|
465
|
+
collapsedTreeRowKeys,
|
|
466
|
+
expandedRowKeySet,
|
|
467
|
+
firstTreeColumnIndex,
|
|
468
|
+
getRowKey,
|
|
469
|
+
getTreeChildren,
|
|
470
|
+
columns: () => columns.value,
|
|
471
|
+
sourceRows: () => pagedData.value,
|
|
472
|
+
tree: () => props2.tree
|
|
473
|
+
});
|
|
474
|
+
const { footRows } = useFootRows({
|
|
475
|
+
columns: () => columns.value,
|
|
476
|
+
sourceRows: () => pagedData.value,
|
|
477
|
+
summary: () => props2.summary
|
|
478
|
+
});
|
|
479
|
+
const { container, scrollLeft, maxScrollDistance, handleContainerScroll } = useContainerScroll([
|
|
480
|
+
columns,
|
|
481
|
+
bodyRows,
|
|
482
|
+
footRows,
|
|
483
|
+
totalResolvedColumnWidth,
|
|
484
|
+
() => props2.scrollX
|
|
485
|
+
]);
|
|
486
|
+
const {
|
|
487
|
+
currentSelectableRows,
|
|
488
|
+
allCurrentRowsSelected,
|
|
489
|
+
someCurrentRowsSelected,
|
|
490
|
+
isMultipleSelectionColumn,
|
|
491
|
+
isSelectionColumnSelectable,
|
|
492
|
+
isRowSelectable,
|
|
493
|
+
isRowKeySelected,
|
|
494
|
+
isRowKeyIndeterminate,
|
|
495
|
+
toggleRowSelection,
|
|
496
|
+
toggleCurrentSelectableRows
|
|
497
|
+
} = useSelectionColumn({
|
|
498
|
+
checkedRowKeys,
|
|
499
|
+
isSelectionColumn,
|
|
500
|
+
getTreeChildren,
|
|
501
|
+
columns: () => columns.value,
|
|
502
|
+
tree: () => props2.tree,
|
|
503
|
+
cascade: () => props2.cascade,
|
|
504
|
+
pagedData: () => pagedData.value,
|
|
505
|
+
allFlatRows: () => allFlatRows.value,
|
|
506
|
+
treeRowMeta: () => treeRowMeta.value
|
|
507
|
+
});
|
|
508
|
+
function getRowKey(row, rowIndex) {
|
|
509
|
+
var _a;
|
|
510
|
+
if (isFunction(props2.rowKey)) {
|
|
511
|
+
return props2.rowKey({ row, rowIndex });
|
|
512
|
+
}
|
|
513
|
+
return (_a = row[props2.rowKey]) != null ? _a : rowIndex;
|
|
514
|
+
}
|
|
515
|
+
function getTreeChildren(row) {
|
|
516
|
+
const children = row[props2.childrenKey];
|
|
517
|
+
return isArray(children) ? children : [];
|
|
518
|
+
}
|
|
519
|
+
function isSelectionColumn(column) {
|
|
520
|
+
return column.type === "selection";
|
|
521
|
+
}
|
|
522
|
+
function isExpandColumn(column) {
|
|
523
|
+
return column.type === "expand";
|
|
524
|
+
}
|
|
525
|
+
function renderCell(bodyRow, column) {
|
|
526
|
+
if (isSelectionColumn(column) || isExpandColumn(column)) {
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
if (column.render) {
|
|
530
|
+
return column.render({
|
|
531
|
+
row: bodyRow.row,
|
|
532
|
+
rowIndex: bodyRow.rowIndex
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
return bodyRow.row[column.key];
|
|
536
|
+
}
|
|
537
|
+
function getRowProps(bodyRow) {
|
|
538
|
+
if (!props2.rowProps) {
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
return callOrReturn(props2.rowProps, {
|
|
542
|
+
row: bodyRow.row,
|
|
543
|
+
rowIndex: bodyRow.rowIndex
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
function getRowClass(bodyRow) {
|
|
547
|
+
if (!props2.rowClass) {
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
return callOrReturn(props2.rowClass, {
|
|
551
|
+
row: bodyRow.row,
|
|
552
|
+
rowIndex: bodyRow.rowIndex
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
function getCellProps(bodyRow, column) {
|
|
556
|
+
if (!column.cellProps) {
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
return callOrReturn(column.cellProps, {
|
|
560
|
+
row: bodyRow.row,
|
|
561
|
+
rowIndex: bodyRow.rowIndex
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
function getAlign(align) {
|
|
565
|
+
return align != null ? align : "left";
|
|
566
|
+
}
|
|
567
|
+
function isLastHeaderColumn(columnIndex) {
|
|
568
|
+
return columnIndex === columns.value.length - 1;
|
|
569
|
+
}
|
|
570
|
+
function shouldRenderLeftFixedShadow(columnIndex) {
|
|
571
|
+
return scrollLeft.value > 1 && isLastLeftFixedColumn(columnIndex);
|
|
572
|
+
}
|
|
573
|
+
function shouldRenderRightFixedShadow(columnIndex) {
|
|
574
|
+
return scrollLeft.value < maxScrollDistance.value - 1 && isFirstRightFixedColumn(columnIndex);
|
|
575
|
+
}
|
|
576
|
+
function getHeaderCellStyle(cell) {
|
|
577
|
+
var _a;
|
|
578
|
+
return __spreadProps(__spreadValues({
|
|
579
|
+
textAlign: getAlign((_a = cell.column.titleAlign) != null ? _a : cell.column.align)
|
|
580
|
+
}, getFixedStyle(cell.fixed, cell.startLeafColumnIndex)), {
|
|
581
|
+
zIndex: cell.fixed ? 3 : 2
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
function getBodyCellStyle(cell) {
|
|
585
|
+
return __spreadProps(__spreadValues({
|
|
586
|
+
textAlign: getAlign(cell.column.align)
|
|
587
|
+
}, getFixedStyle(cell.column.fixed, cell.columnIndex)), {
|
|
588
|
+
zIndex: cell.column.fixed ? 1 : void 0
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
function handlePaginationChange(nextPage, nextPageSize) {
|
|
592
|
+
page.value = nextPage;
|
|
593
|
+
pageSize.value = nextPageSize;
|
|
594
|
+
}
|
|
595
|
+
return {
|
|
596
|
+
pt,
|
|
597
|
+
t,
|
|
598
|
+
container,
|
|
599
|
+
expandedRowKeys,
|
|
600
|
+
containerStyle,
|
|
601
|
+
paginationProps,
|
|
602
|
+
paginationTotal,
|
|
603
|
+
showPagination,
|
|
604
|
+
normalizedPage,
|
|
605
|
+
pageSize,
|
|
606
|
+
tableStyle,
|
|
607
|
+
columns,
|
|
608
|
+
currentSelectableRows,
|
|
609
|
+
allCurrentRowsSelected,
|
|
610
|
+
someCurrentRowsSelected,
|
|
611
|
+
headerRows,
|
|
612
|
+
bodyRows,
|
|
613
|
+
footRows,
|
|
614
|
+
isColumnResizable,
|
|
615
|
+
getRowProps,
|
|
616
|
+
getRowClass,
|
|
617
|
+
getCellProps,
|
|
618
|
+
isSelectionColumn,
|
|
619
|
+
isExpandColumn,
|
|
620
|
+
isColumnSortable,
|
|
621
|
+
isMultipleSelectionColumn,
|
|
622
|
+
isSelectionColumnSelectable,
|
|
623
|
+
getColumnSorterOrder,
|
|
624
|
+
isRowExpandable,
|
|
625
|
+
isRowKeyIndeterminate,
|
|
626
|
+
isRowKeySelected,
|
|
627
|
+
isRowSelectable,
|
|
628
|
+
shouldRenderLeftFixedShadow,
|
|
629
|
+
shouldRenderRightFixedShadow,
|
|
630
|
+
toggleColumnSorter,
|
|
631
|
+
toggleCurrentSelectableRows,
|
|
632
|
+
toggleRowExpanded,
|
|
633
|
+
toggleTreeRowExpanded,
|
|
634
|
+
toggleRowSelection,
|
|
635
|
+
renderCell,
|
|
636
|
+
renderExpandedRow,
|
|
637
|
+
getColStyle,
|
|
638
|
+
getHeaderCellStyle,
|
|
639
|
+
getBodyCellStyle,
|
|
640
|
+
handlePaginationChange,
|
|
641
|
+
handleContainerScroll,
|
|
642
|
+
isLastHeaderColumn,
|
|
643
|
+
startColumnResize,
|
|
644
|
+
n,
|
|
645
|
+
classes,
|
|
646
|
+
formatElevation,
|
|
647
|
+
toSizeUnit
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
__sfc__.render = __render__;
|
|
652
|
+
var stdin_default = __sfc__;
|
|
653
|
+
export {
|
|
654
|
+
stdin_default as default
|
|
655
|
+
};
|