xv-webcomponents 2.0.0-beta.2 → 2.0.0-beta.28
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/README.md +3 -2
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +3 -4
- package/dist/angular/proxies.d.ts +60 -34
- package/dist/angular/proxies.js +51 -67
- package/dist/angular/web-components.module.d.ts +1 -1
- package/dist/angular/web-components.module.js +10 -13
- package/dist/cjs/{index-Cfa6bBQW.js → index-DaTpiyaU.js} +1 -1
- package/dist/cjs/{index-Cixkr3sz.js → index-Dwhgrew8.js} +15 -10
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{xv-accordion-v2_50.cjs.entry.js → xv-accordion-v2_49.cjs.entry.js} +1529 -147
- package/dist/cjs/xv-header-next.cjs.entry.js +2 -2
- package/dist/cjs/xv-mega-menu-next.cjs.entry.js +2 -2
- package/dist/cjs/xv-webcomponents.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -2
- package/dist/collection/components/xv-overflow-menu/xv-overflow-menu.js +9 -8
- package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.css +129 -61
- package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js +277 -78
- package/dist/collection/components/xv-table/xv-table-row/xv-table-row.css +138 -24
- package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js +334 -168
- package/dist/collection/components/xv-table/xv-table.css +240 -99
- package/dist/collection/components/xv-table/xv-table.js +2056 -63
- package/dist/collection/components/xv-table/xv-table.model.js +10 -0
- package/dist/collection/components/xv-table/xv-table.utils.js +243 -0
- package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js +1 -1
- package/dist/collection/components/xv-tag/xv-tag.js +1 -1
- package/dist/collection/components/xv-tag-combobox/xv-tag-combobox.js +2 -2
- package/dist/collection/components/xv-text-input/xv-text-input.js +2 -2
- package/dist/collection/components/xv-textarea/xv-textarea.js +2 -2
- package/dist/collection/components/xv-tile/xv-tile.js +2 -2
- package/dist/collection/components/xv-toggle/xv-toggle.js +1 -1
- package/dist/collection/components/xv-toggle-tip/xv-toggle-tip.js +1 -1
- package/dist/collection/components/xv-tooltip/xv-tooltip.js +2 -2
- package/dist/collection/utils/table-layout.js +130 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-B0kwaJ8n.js +1 -0
- package/dist/components/{p-CbVZCn2p.js → p-BEoh0dZI.js} +1 -1
- package/dist/components/{p-ZYJfCCwX.js → p-BaZ-srfu.js} +1 -1
- package/dist/components/{p-DyGMZIub.js → p-Bej2l-wN.js} +1 -1
- package/dist/components/{p-Ddx5DwV5.js → p-BfhvpeQh.js} +1 -1
- package/dist/components/{p-kQVUwJXZ.js → p-CSYnNMKb.js} +1 -1
- package/dist/components/{p-BNP2Lw34.js → p-CspyoLL9.js} +1 -1
- package/dist/components/p-CvgDDcjp.js +1 -0
- package/dist/components/{p-COoj5JkZ.js → p-D4FwGeDJ.js} +1 -1
- package/dist/components/p-DCvH_Br_.js +1 -0
- package/dist/components/{p-CEjlxnKY.js → p-DFe9Mtw_.js} +1 -1
- package/dist/components/{p-BRZwUlfE.js → p-DFtMwE-h.js} +1 -1
- package/dist/components/p-DIvi4fI3.js +1 -0
- package/dist/components/{p-DTwz9Fsh.js → p-DNRISLNf.js} +1 -1
- package/dist/components/p-DPnvoOYj.js +1 -0
- package/dist/components/{p-Dzz9jxLm.js → p-Dwbe941A.js} +1 -1
- package/dist/components/{p-CMAJWZsP.js → p-JClekcEh.js} +1 -1
- package/dist/components/{p-DtUNYh73.js → p-NoM9oIJn.js} +1 -1
- package/dist/components/{p-DlLBjhuH.js → p-XEk4dHG3.js} +1 -1
- package/dist/components/p-i7_81si-.js +1 -0
- package/dist/components/{p-BRYrLHiz.js → p-i82EFiq6.js} +1 -1
- package/dist/components/{p-BXB4D7j4.js → p-jD7nSJaM.js} +1 -1
- package/dist/components/xv-accordion-v2-item.js +1 -1
- package/dist/components/xv-accordion-v2.js +1 -1
- package/dist/components/xv-breadcrumbs-v2.js +1 -1
- package/dist/components/xv-button-group-v2.js +1 -1
- package/dist/components/xv-button-v2.js +1 -1
- package/dist/components/xv-card-v2.js +1 -1
- package/dist/components/xv-checkbox-v2.js +1 -1
- package/dist/components/xv-content-switcher-item-v2.js +1 -1
- package/dist/components/xv-content-switcher-v2.js +1 -1
- package/dist/components/xv-data-table-cell.js +1 -1
- package/dist/components/xv-data-table-collapse.js +1 -1
- package/dist/components/xv-data-table-row.js +1 -1
- package/dist/components/xv-data-table.js +2 -2
- package/dist/components/xv-date-picker.js +1 -1
- package/dist/components/xv-datepicker.js +1 -1
- package/dist/components/xv-dropdown-v2-item.js +1 -1
- package/dist/components/xv-dropdown-v2.js +1 -1
- package/dist/components/xv-file-uploader.js +1 -1
- package/dist/components/xv-footer.js +1 -1
- package/dist/components/xv-geo-map-v2.js +1 -1
- package/dist/components/xv-header-next.js +1 -1
- package/dist/components/xv-header.js +1 -1
- package/dist/components/xv-image-viewer.js +1 -1
- package/dist/components/xv-link-v2.js +1 -1
- package/dist/components/xv-loader-v2.js +1 -1
- package/dist/components/xv-login-modal.js +1 -1
- package/dist/components/xv-mega-menu-next.js +1 -1
- package/dist/components/xv-mega-menu.js +1 -1
- package/dist/components/xv-modal-v2.js +1 -1
- package/dist/components/xv-notification-v2.js +1 -1
- package/dist/components/xv-number-input-v2.js +1 -1
- package/dist/components/xv-overflow-menu-v2-item.js +1 -1
- package/dist/components/xv-overflow-menu-v2.js +1 -1
- package/dist/components/xv-pagination.js +1 -1
- package/dist/components/xv-progress-indicator-v2-item.js +1 -1
- package/dist/components/xv-progress-indicator-v2.js +1 -1
- package/dist/components/xv-radio-v2.js +1 -1
- package/dist/components/xv-slider-v2.js +1 -1
- package/dist/components/xv-tab-v2.js +1 -1
- package/dist/components/{xv-table-v2-row.d.ts → xv-table-cell.d.ts} +4 -4
- package/dist/components/xv-table-cell.js +1 -0
- package/dist/components/{xv-table-v2-cell.d.ts → xv-table-row.d.ts} +4 -4
- package/dist/components/xv-table-row.js +1 -0
- package/dist/components/{xv-table-v2.d.ts → xv-table.d.ts} +4 -4
- package/dist/components/xv-table.js +1 -0
- package/dist/components/xv-tabs-v2.js +1 -1
- package/dist/components/xv-tag-combobox.js +1 -1
- package/dist/components/xv-tag-v2.js +1 -1
- package/dist/components/xv-text-input-v2.js +1 -1
- package/dist/components/xv-textarea.js +1 -1
- package/dist/components/xv-tile.js +1 -1
- package/dist/components/xv-toggle-tip.js +1 -1
- package/dist/components/xv-toggle.js +1 -1
- package/dist/components/xv-tooltip-v2.js +1 -1
- package/dist/custom-elements.json +1765 -294
- package/dist/docs.json +2749 -443
- package/dist/esm/{index-B6cY-_U1.js → index-ClusqSO5.js} +1 -1
- package/dist/esm/{index-Bu8SrOeR.js → index-DJC3-dS3.js} +15 -10
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{xv-accordion-v2_50.entry.js → xv-accordion-v2_49.entry.js} +1527 -144
- package/dist/esm/xv-header-next.entry.js +2 -2
- package/dist/esm/xv-mega-menu-next.entry.js +2 -2
- package/dist/esm/xv-webcomponents.js +4 -4
- package/dist/react/components.d.ts +3 -4
- package/dist/react/components.js +3 -4
- package/dist/react/{xv-table-v2-expand.d.ts → xv-table-cell.d.ts} +3 -3
- package/dist/react/xv-table-cell.js +14 -0
- package/dist/react/{xv-table-v2.d.ts → xv-table-row.d.ts} +3 -3
- package/dist/react/{xv-table-v2.js → xv-table-row.js} +5 -5
- package/dist/react/xv-table.d.ts +18 -0
- package/dist/react/xv-table.js +22 -0
- package/dist/types/components/xv-table/xv-table-cell/xv-table-cell.d.ts +43 -8
- package/dist/types/components/xv-table/xv-table-row/xv-table-row.d.ts +57 -18
- package/dist/types/components/xv-table/xv-table.d.ts +298 -9
- package/dist/types/components/xv-table/xv-table.model.d.ts +78 -0
- package/dist/types/components/xv-table/xv-table.utils.d.ts +47 -0
- package/dist/types/components.d.ts +899 -118
- package/dist/types/stencil-public-runtime.d.ts +61 -55
- package/dist/types/utils/table-layout.d.ts +7 -0
- package/dist/vscode-data.json +347 -56
- package/dist/xv-webcomponents/index.esm.js +1 -1
- package/dist/xv-webcomponents/{p-1ffb0b4f.entry.js → p-0c30d09f.entry.js} +1 -1
- package/dist/xv-webcomponents/{p-eb9d7750.entry.js → p-6b58979e.entry.js} +2 -2
- package/dist/xv-webcomponents/{p-Bu8SrOeR.js → p-DJC3-dS3.js} +2 -2
- package/dist/xv-webcomponents/{p-DB4KqDJz.js → p-DSFVdw3w.js} +1 -1
- package/dist/xv-webcomponents/{p-d4d26ff2.entry.js → p-c4173686.entry.js} +1 -1
- package/dist/xv-webcomponents/xv-webcomponents.esm.js +1 -1
- package/package.json +139 -139
- package/dist/collection/components/xv-table/_vars.js +0 -2
- package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.css +0 -58
- package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.js +0 -75
- package/dist/components/p-CHtssNO9.js +0 -1
- package/dist/components/p-CILNPUHH.js +0 -1
- package/dist/components/p-DVZ2BlIP.js +0 -1
- package/dist/components/p-bdaoJ1tx.js +0 -1
- package/dist/components/xv-table-v2-cell.js +0 -1
- package/dist/components/xv-table-v2-expand.d.ts +0 -11
- package/dist/components/xv-table-v2-expand.js +0 -1
- package/dist/components/xv-table-v2-row.js +0 -1
- package/dist/components/xv-table-v2.js +0 -1
- package/dist/react/xv-table-v2-cell.d.ts +0 -12
- package/dist/react/xv-table-v2-cell.js +0 -14
- package/dist/react/xv-table-v2-expand.js +0 -14
- package/dist/react/xv-table-v2-row.d.ts +0 -13
- package/dist/react/xv-table-v2-row.js +0 -17
- package/dist/types/components/xv-table/_vars.d.ts +0 -15
- package/dist/types/components/xv-table/xv-table-expand/xv-table-expand.d.ts +0 -8
|
@@ -1,15 +1,304 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
1
2
|
import { SIZE_VAR_STR } from '../../types/enum';
|
|
2
|
-
import {
|
|
3
|
+
import { XvTableColumn, XvTableExpandMode, XvTableExpandedDetail, XvTableLayout, XvTableMode, XvTablePage, XvTableRowClickDetail, XvTableRowOrder, XvTableSelectionDetail, XvTableSelectionMode, XvTableSort } from './xv-table.model';
|
|
4
|
+
/**
|
|
5
|
+
* A data table built on CSS grid with `subgrid` rows, so a row keeps its own box while its cells
|
|
6
|
+
* stay aligned to the table's columns and an expanded panel can span the full width.
|
|
7
|
+
*
|
|
8
|
+
* `columns` always describes the structure — widths, order, sorting, resizing, hiding and the
|
|
9
|
+
* stored layout all read from it. Rows come either from `rows` as data, or as slotted
|
|
10
|
+
* `xv-table-row` children when the cells hold arbitrary markup.
|
|
11
|
+
*
|
|
12
|
+
* @slot - Slotted `xv-table-row` children, used instead of the `rows` prop.
|
|
13
|
+
* @slot toolbar - Controls above the table. Slotted content spans the bar; `flex: 0 0 auto` opts out.
|
|
14
|
+
* @slot batch - Actions shown in the bar that replaces the toolbar while rows are selected.
|
|
15
|
+
* @slot footer - Rows rendered after the body, for subtotals.
|
|
16
|
+
* @slot empty - Shown instead of the body when there is nothing to render.
|
|
17
|
+
* @slot label - Replaces the `label` prop with markup.
|
|
18
|
+
* @slot description - Replaces the `description` prop with markup.
|
|
19
|
+
* @part heading - The title block.
|
|
20
|
+
* @part title - The title text.
|
|
21
|
+
* @part description - The description text.
|
|
22
|
+
* @part bar - The toolbar and batch bar wrapper.
|
|
23
|
+
* @part toolbar - The toolbar.
|
|
24
|
+
* @part batch - The batch actions bar.
|
|
25
|
+
* @part scroll - The horizontal scroll container.
|
|
26
|
+
* @part grid - The grid itself.
|
|
27
|
+
* @part head - The header row.
|
|
28
|
+
* @part header-cell - One header cell.
|
|
29
|
+
* @part body - The body wrapper.
|
|
30
|
+
* @part pagination - The pagination block.
|
|
31
|
+
* @part column-picker - The menu that hides and shows columns.
|
|
32
|
+
* @part empty - The empty state.
|
|
33
|
+
* @part loading - The loading overlay.
|
|
34
|
+
*/
|
|
3
35
|
export declare class XvTable {
|
|
4
36
|
el: HTMLElement;
|
|
37
|
+
/** Column definitions. Accepts its JSON string form so it is settable from plain markup. */
|
|
38
|
+
columns: string | XvTableColumn[];
|
|
39
|
+
/** Row data. Ignored when `xv-table-row` children are slotted. */
|
|
40
|
+
rows: string | any[];
|
|
41
|
+
/** Property of a row object that identifies it in selection and expansion payloads. */
|
|
42
|
+
rowKey: string;
|
|
43
|
+
/** Row height ladder. */
|
|
5
44
|
size: SIZE_VAR_STR;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
45
|
+
/** Stretches the table to the full width of its container. */
|
|
46
|
+
block: boolean;
|
|
47
|
+
/** Covers the body with a loading state. */
|
|
48
|
+
loading: boolean;
|
|
49
|
+
/** Placeholder rows drawn while `loading`. Zero draws a spinner instead. */
|
|
50
|
+
skeletonRows: number;
|
|
51
|
+
/** Highlights a row on pointer hover. */
|
|
52
|
+
hover: boolean;
|
|
53
|
+
/** Emits `rowClick` when a row is clicked outside an interactive element. */
|
|
54
|
+
rowClickable: boolean;
|
|
55
|
+
/** Title above the table. */
|
|
56
|
+
label: string;
|
|
57
|
+
/** Supporting text under the title. */
|
|
58
|
+
description: string;
|
|
59
|
+
/** Shown when there are no rows. */
|
|
60
|
+
emptyLabel: string;
|
|
61
|
+
/** Text of the batch bar counter. `{count}` is replaced with the number of selected rows. */
|
|
62
|
+
selectedLabel: string;
|
|
63
|
+
/** Tooltip on the column picker trigger. */
|
|
64
|
+
columnsLabel: string;
|
|
65
|
+
/** Text of the button that restores the declared column layout. */
|
|
66
|
+
resetLabel: string;
|
|
67
|
+
/** Accessible name of a row's expand toggle. */
|
|
68
|
+
expandLabel: string;
|
|
69
|
+
/** Accessible name of a row's drag grip. */
|
|
70
|
+
reorderLabel: string;
|
|
71
|
+
/**
|
|
72
|
+
* `none` makes headers inert whatever the column says; `client` sorts the `rows` prop itself;
|
|
73
|
+
* `server` offers the affordance and only emits `sortChange` for the consumer to reload.
|
|
74
|
+
*/
|
|
75
|
+
sortMode: XvTableMode;
|
|
76
|
+
/** Active sort, as `asc(field)` / `desc(field)` or an object. */
|
|
77
|
+
sortBy: string | XvTableSort;
|
|
78
|
+
/** `multiple` renders checkboxes, `single` renders radios. */
|
|
79
|
+
selection: XvTableSelectionMode;
|
|
80
|
+
/** Values of the selected rows. */
|
|
81
|
+
selected: string | unknown[];
|
|
82
|
+
/** Whether rows expand, and whether more than one may be open. */
|
|
83
|
+
expandMode: XvTableExpandMode;
|
|
84
|
+
/** Values of the expanded rows. */
|
|
85
|
+
expanded: string | unknown[];
|
|
86
|
+
/** `client` slices the `rows` prop; `server` only emits `pageChange`. */
|
|
87
|
+
paginationMode: XvTableMode;
|
|
88
|
+
/** Current page, 1-based. */
|
|
89
|
+
page: number;
|
|
90
|
+
/** Rows per page. */
|
|
91
|
+
pageSize: number;
|
|
92
|
+
/** Total row count, for `server` pagination. */
|
|
93
|
+
total: number;
|
|
94
|
+
/** Page size choices. Accepts a comma-separated attribute. */
|
|
95
|
+
pageSizeOptions: string | number[];
|
|
96
|
+
/**
|
|
97
|
+
* Allows dragging column edges. Off by default: no handle is rendered and nothing is bound
|
|
98
|
+
* until it is switched on. A column may switch itself off, never on.
|
|
99
|
+
*/
|
|
100
|
+
resizable: boolean;
|
|
101
|
+
/** Allows dragging column headers into a new order. Off by default, like `resizable`. */
|
|
102
|
+
reorderable: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Allows dragging rows into a new order. Off by default: nothing is bound and no handle is
|
|
105
|
+
* rendered until it is switched on.
|
|
106
|
+
*/
|
|
107
|
+
rowReorderable: boolean;
|
|
108
|
+
/** Whether the whole row drags, or only a grip in a leading control cell. */
|
|
109
|
+
rowReorderHandle: 'icon' | 'row';
|
|
110
|
+
/** Keeps the header visible while the body scrolls. */
|
|
111
|
+
stickyHeader: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Width below which the table scrolls instead of squeezing, at any viewport. Left unset, a table
|
|
114
|
+
* only stops squeezing below 1180px, where it scrolls at the width its columns declared.
|
|
115
|
+
*/
|
|
116
|
+
minWidth: number;
|
|
117
|
+
/** Persists the column layout under this key. Empty means the layout is not remembered. */
|
|
118
|
+
storageKey: string;
|
|
119
|
+
/** Scopes the stored layout to a user. */
|
|
120
|
+
storageOwner: string;
|
|
121
|
+
/** Controlled column layout. Overrides whatever is stored. */
|
|
122
|
+
layout: string | XvTableLayout;
|
|
123
|
+
/** Locale used for sorting and cell formatting. Falls back to the nearest `[lang]` ancestor. */
|
|
124
|
+
locale: string;
|
|
125
|
+
/** Emitted when a sortable header is activated. */
|
|
126
|
+
sortChange: EventEmitter<XvTableSort>;
|
|
127
|
+
/**
|
|
128
|
+
* Emitted when the set of selected rows changes. Named after the `selected` prop it reports:
|
|
129
|
+
* `selectionChange` is refused by Stencil as a native DOM event name.
|
|
130
|
+
*/
|
|
131
|
+
selectedChange: EventEmitter<XvTableSelectionDetail>;
|
|
132
|
+
/** Emitted when the set of expanded rows changes. */
|
|
133
|
+
expandedChange: EventEmitter<XvTableExpandedDetail>;
|
|
134
|
+
/** Emitted when the page or the page size changes. */
|
|
135
|
+
pageChange: EventEmitter<XvTablePage>;
|
|
136
|
+
/** Emitted after a column is resized, reordered, hidden or reset. */
|
|
137
|
+
layoutChange: EventEmitter<XvTableLayout>;
|
|
138
|
+
/** Emitted when a row is clicked, while `rowClickable` is set. */
|
|
139
|
+
rowClick: EventEmitter<XvTableRowClickDetail>;
|
|
140
|
+
/**
|
|
141
|
+
* Emitted when a row is dropped in a new position. The table does not move the row itself —
|
|
142
|
+
* reorder the data and it re-renders, which keeps the DOM and the data from drifting apart.
|
|
143
|
+
*/
|
|
144
|
+
rowOrderChange: EventEmitter<XvTableRowOrder>;
|
|
145
|
+
columnState: XvTableColumn[];
|
|
146
|
+
sortState: XvTableSort | null;
|
|
147
|
+
selectedValues: unknown[];
|
|
148
|
+
expandedValues: unknown[];
|
|
149
|
+
layoutPending: boolean;
|
|
150
|
+
columnDragging: boolean;
|
|
151
|
+
dragOverId: string;
|
|
152
|
+
dropRowIndex: number;
|
|
153
|
+
slottedRowCount: number;
|
|
154
|
+
derivedTracks: string[];
|
|
155
|
+
hasSlottedHeader: boolean;
|
|
156
|
+
hasSlottedHeading: boolean;
|
|
157
|
+
hasSlottedEmpty: boolean;
|
|
158
|
+
overflowing: boolean;
|
|
159
|
+
private declared;
|
|
160
|
+
private declaredSignature;
|
|
161
|
+
/** Whether the columns came from a slotted header rather than the `columns` prop. */
|
|
162
|
+
private fromMarkup;
|
|
163
|
+
private rowData;
|
|
164
|
+
private seededExpanded;
|
|
165
|
+
private collapsed;
|
|
166
|
+
private dragRowIndex;
|
|
167
|
+
private gridEl?;
|
|
168
|
+
private scrollEl?;
|
|
169
|
+
private rowObserver?;
|
|
170
|
+
private sizeObserver?;
|
|
171
|
+
private layoutToken;
|
|
172
|
+
private dragColumnId;
|
|
14
173
|
componentWillLoad(): void;
|
|
174
|
+
componentDidLoad(): void;
|
|
175
|
+
componentDidRender(): void;
|
|
176
|
+
disconnectedCallback(): void;
|
|
177
|
+
/**
|
|
178
|
+
* A declared width is a floor, so columns that cannot fit overflow rather than squeeze. The table
|
|
179
|
+
* scrolls them into reach instead of letting them hang outside the block they were given.
|
|
180
|
+
*/
|
|
181
|
+
private measureOverflow;
|
|
182
|
+
columnsChanged(): void;
|
|
183
|
+
layoutInputChanged(): void;
|
|
184
|
+
sortByChanged(): void;
|
|
185
|
+
selectedChanged(): void;
|
|
186
|
+
expandedChanged(): void;
|
|
187
|
+
rowsChanged(): void;
|
|
188
|
+
/** Selects every selectable row. */
|
|
189
|
+
selectAll(): Promise<void>;
|
|
190
|
+
/** Clears the selection. */
|
|
191
|
+
clearSelection(): Promise<void>;
|
|
192
|
+
/** Drops the stored layout and returns to the declared columns. */
|
|
193
|
+
resetLayout(): Promise<void>;
|
|
194
|
+
/** The layout as it would be stored: only the deviations from the declared columns. */
|
|
195
|
+
getLayout(): Promise<XvTableLayout>;
|
|
196
|
+
private restoreLayout;
|
|
197
|
+
private commitLayout;
|
|
198
|
+
private get localeTag();
|
|
199
|
+
private get visible();
|
|
200
|
+
private get hasSelection();
|
|
201
|
+
private get hasExpand();
|
|
202
|
+
private get template();
|
|
203
|
+
/** Grip, then the expand toggle, then selection — one track each, in render order. */
|
|
204
|
+
private get leadingTracks();
|
|
205
|
+
private get trailingTracks();
|
|
206
|
+
private get dataRows();
|
|
207
|
+
private get rowTotal();
|
|
208
|
+
private get isEmpty();
|
|
209
|
+
private columnBySortName;
|
|
210
|
+
private touchesStructure;
|
|
211
|
+
private isBodyRow;
|
|
212
|
+
/** Body rows only — these are the ones selection and expansion count. */
|
|
213
|
+
private slottedRows;
|
|
214
|
+
/** A page is counted in top-level rows: a group and its children travel together. */
|
|
215
|
+
private topRows;
|
|
216
|
+
/** Every slotted row, footer included: they all need the column tracks lined up. */
|
|
217
|
+
private slottedRowsAll;
|
|
218
|
+
/** Every row on screen, whichever mode produced it. */
|
|
219
|
+
private renderedRows;
|
|
220
|
+
private rowValues;
|
|
221
|
+
/** A disabled row is not selectable, so it stays out of every selection set. */
|
|
222
|
+
private isDisabled;
|
|
223
|
+
/** `parent` may arrive as an attribute or as a property, depending on the consumer. */
|
|
224
|
+
private parentOf;
|
|
225
|
+
private parentValues;
|
|
226
|
+
private childValuesOf;
|
|
227
|
+
/** One walk of the rows answers every parent/child question asked during a sync. */
|
|
228
|
+
private buildTree;
|
|
229
|
+
/**
|
|
230
|
+
* Child rows declare their parent by value. They stay siblings in the grid — that is what keeps
|
|
231
|
+
* them in the table's columns, rather than a nested table inside a panel.
|
|
232
|
+
*/
|
|
233
|
+
private syncRowTree;
|
|
234
|
+
/** Only rows this table hid are shown again, so a consumer's own `hidden` survives a sync. */
|
|
235
|
+
private showRow;
|
|
236
|
+
/** The rows of the current page, or null while the table is not the one paging. */
|
|
237
|
+
private pageWindow;
|
|
238
|
+
/** Cells are written in declared order; hiding and reordering only move them visually. */
|
|
239
|
+
private syncCells;
|
|
240
|
+
/** Structure writes @State, so it runs outside the render cycle: on load and on childList. */
|
|
241
|
+
private syncStructure;
|
|
242
|
+
/**
|
|
243
|
+
* A row may declare itself open in markup. Read once, before the table starts writing the
|
|
244
|
+
* attribute itself — after that there is no telling a declared value from a toggled one.
|
|
245
|
+
*/
|
|
246
|
+
private seedExpanded;
|
|
247
|
+
/** Pushing props onto children is safe during render; nothing here touches @State. */
|
|
248
|
+
private syncRows;
|
|
249
|
+
/** Sorting is offered only when a mode asks for it, so `none` and `server` cannot look alike. */
|
|
250
|
+
private isSortable;
|
|
251
|
+
/**
|
|
252
|
+
* A slotted header is the consumer's markup, so the table pushes the column state onto its cells
|
|
253
|
+
* rather than rendering a second header of its own.
|
|
254
|
+
*/
|
|
255
|
+
private syncHeaderCells;
|
|
256
|
+
/** Reads the column shape out of the markup when no `columns` prop was given. */
|
|
257
|
+
private syncDerivedTracks;
|
|
258
|
+
/**
|
|
259
|
+
* With no `columns` prop the header cells are the declaration: their attributes carry the id,
|
|
260
|
+
* width and switches, so a markup-only table still resizes, reorders and remembers its layout.
|
|
261
|
+
*/
|
|
262
|
+
private deriveColumns;
|
|
263
|
+
private toggleSort;
|
|
264
|
+
private resizeStart;
|
|
265
|
+
private resizeReset;
|
|
266
|
+
/** Every header cell on screen, whether the table rendered it or the consumer slotted it. */
|
|
267
|
+
private headerCells;
|
|
268
|
+
/** A header cell knows its column by id, or failing that by its position in the row. */
|
|
269
|
+
private columnOf;
|
|
270
|
+
private headerCellFrom;
|
|
271
|
+
private headPointerDown;
|
|
272
|
+
private headKeyDown;
|
|
273
|
+
private headDblClick;
|
|
274
|
+
private headDragStart;
|
|
275
|
+
private headDragOver;
|
|
276
|
+
private headDrop;
|
|
277
|
+
private dragStart;
|
|
278
|
+
private dragOver;
|
|
279
|
+
private drop;
|
|
280
|
+
private clearDragOver;
|
|
281
|
+
private dragEnd;
|
|
282
|
+
private setSelection;
|
|
283
|
+
private toggleRowSelection;
|
|
284
|
+
private toggleSelectAll;
|
|
285
|
+
private toggleExpanded;
|
|
286
|
+
private toggleColumn;
|
|
287
|
+
private bodyRows;
|
|
288
|
+
private rowFrom;
|
|
289
|
+
private rowDragStart;
|
|
290
|
+
private rowDragOver;
|
|
291
|
+
private rowDrop;
|
|
292
|
+
private rowDragEnd;
|
|
293
|
+
/** One listener for the whole body instead of a child event per row. */
|
|
294
|
+
private bodyChange;
|
|
295
|
+
private gridClick;
|
|
296
|
+
private bodyClick;
|
|
297
|
+
private paginationChanged;
|
|
298
|
+
/** The same row and cell components the consumer would write by hand. */
|
|
299
|
+
private renderHead;
|
|
300
|
+
private renderDataRow;
|
|
301
|
+
private renderSkeleton;
|
|
302
|
+
private renderColumnPicker;
|
|
303
|
+
render(): any;
|
|
15
304
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { SIZE_VAR_STR, XV_SORT_DIR } from '../../types/enum';
|
|
2
|
+
export type XvTableSize = SIZE_VAR_STR;
|
|
3
|
+
export type XvTableSelectionMode = 'none' | 'single' | 'multiple';
|
|
4
|
+
export type XvTableExpandMode = 'none' | 'single' | 'multiple';
|
|
5
|
+
export type XvTableMode = 'none' | 'client' | 'server';
|
|
6
|
+
export type XvCellAlign = 'start' | 'center' | 'end';
|
|
7
|
+
export type XvCellOverflow = 'ellipsis' | 'clamp' | 'wrap';
|
|
8
|
+
export type XvCellFormat = 'text' | 'number' | 'currency' | 'date' | 'period' | 'list';
|
|
9
|
+
export interface XvTableColumn {
|
|
10
|
+
id: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
sortable?: boolean;
|
|
13
|
+
sortName?: string;
|
|
14
|
+
align?: XvCellAlign;
|
|
15
|
+
/** Header alignment. Headers read left unless this says otherwise, whatever `align` does. */
|
|
16
|
+
headerAlign?: XvCellAlign;
|
|
17
|
+
overflow?: XvCellOverflow;
|
|
18
|
+
clampLines?: number;
|
|
19
|
+
/** A number is pixels. A CSS length — `25%`, `auto`, `12rem` — is written into the track as is. */
|
|
20
|
+
width?: number | string;
|
|
21
|
+
minWidth?: number;
|
|
22
|
+
maxWidth?: number;
|
|
23
|
+
resizable?: boolean;
|
|
24
|
+
reorderable?: boolean;
|
|
25
|
+
hideable?: boolean;
|
|
26
|
+
hidden?: boolean;
|
|
27
|
+
headerTooltip?: string;
|
|
28
|
+
value?: string | ((row: any) => unknown);
|
|
29
|
+
format?: XvCellFormat;
|
|
30
|
+
formatArg?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface XvTableLayout {
|
|
33
|
+
v: number;
|
|
34
|
+
order: string[];
|
|
35
|
+
widths: Record<string, number>;
|
|
36
|
+
hidden: Record<string, boolean>;
|
|
37
|
+
}
|
|
38
|
+
export interface XvTableLayoutRecord {
|
|
39
|
+
id: string;
|
|
40
|
+
owner: string;
|
|
41
|
+
storageKey: string;
|
|
42
|
+
layout: XvTableLayout;
|
|
43
|
+
updatedAt: number;
|
|
44
|
+
}
|
|
45
|
+
export interface XvTableSort {
|
|
46
|
+
name: string;
|
|
47
|
+
direction: XV_SORT_DIR;
|
|
48
|
+
}
|
|
49
|
+
export interface XvTableSelectionDetail {
|
|
50
|
+
values: unknown[];
|
|
51
|
+
all: boolean;
|
|
52
|
+
partial: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface XvTablePage {
|
|
55
|
+
page: number;
|
|
56
|
+
pageSize: number;
|
|
57
|
+
}
|
|
58
|
+
export interface XvTableExpandedDetail {
|
|
59
|
+
values: unknown[];
|
|
60
|
+
}
|
|
61
|
+
export interface XvTableRowOrder {
|
|
62
|
+
from: number;
|
|
63
|
+
to: number;
|
|
64
|
+
}
|
|
65
|
+
export interface XvTableRowClickDetail {
|
|
66
|
+
value: unknown;
|
|
67
|
+
index: number;
|
|
68
|
+
}
|
|
69
|
+
export declare const XV_TABLE_TAG = "xv-table";
|
|
70
|
+
export declare const XV_TABLE_ROW_TAG = "xv-table-row";
|
|
71
|
+
export declare const XV_TABLE_CELL_TAG = "xv-table-cell";
|
|
72
|
+
export declare const XV_TABLE_LAYOUT_VERSION = 1;
|
|
73
|
+
/** The floor a resize drag may not cross, when the column names no minWidth. */
|
|
74
|
+
export declare const XV_TABLE_MIN_COLUMN_WIDTH = 64;
|
|
75
|
+
/** Per visible column, the width below which the table scrolls instead of squeezing. */
|
|
76
|
+
export declare const XV_TABLE_SCROLL_COLUMN_WIDTH = 120;
|
|
77
|
+
export declare const XV_TABLE_CONTROL_WIDTH = 48;
|
|
78
|
+
export declare const XV_TABLE_DEFAULT_PAGE_SIZES: number[];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { XV_SORT_DIR } from '../../types/enum';
|
|
2
|
+
import { XvTableColumn, XvTableLayout, XvTableSort } from './xv-table.model';
|
|
3
|
+
/** Array and object props accept their JSON string form so they stay settable from plain markup. */
|
|
4
|
+
export declare const parseProp: <T>(value: string | T, fallback: T) => T;
|
|
5
|
+
export declare const parsePageSizes: (value: string | number[]) => number[];
|
|
6
|
+
export declare const parseSortBy: (value: string | XvTableSort) => XvTableSort | null;
|
|
7
|
+
/** The `asc(field)` shape ListStateService already speaks, so an Angular binding needs no adapter. */
|
|
8
|
+
export declare const formatSortBy: (sort: XvTableSort | null) => string;
|
|
9
|
+
export declare const nextSortDirection: (current: XV_SORT_DIR | null) => XV_SORT_DIR;
|
|
10
|
+
export declare const sortName: (column: XvTableColumn) => string;
|
|
11
|
+
export declare const cellValue: (row: any, column: XvTableColumn) => unknown;
|
|
12
|
+
/** Empty values sort last in both directions — a blank cell is not "smallest", it is missing. */
|
|
13
|
+
export declare const compareValues: (a: unknown, b: unknown, locale: string) => number;
|
|
14
|
+
export declare const sortRows: <T>(rows: T[], column: XvTableColumn | null, direction: XV_SORT_DIR, locale: string) => T[];
|
|
15
|
+
export declare const totalPages: (total: number, pageSize: number) => number;
|
|
16
|
+
export declare const clampPage: (page: number, pages: number) => number;
|
|
17
|
+
export declare const pageSlice: <T>(rows: T[], page: number, pageSize: number) => T[];
|
|
18
|
+
export declare const visibleColumns: (columns: XvTableColumn[]) => XvTableColumn[];
|
|
19
|
+
export declare const hideableColumns: (columns: XvTableColumn[]) => XvTableColumn[];
|
|
20
|
+
/** A column may narrow a table-level switch, never widen it. */
|
|
21
|
+
export declare const columnAllows: (column: XvTableColumn, table: boolean, key: "resizable" | "reorderable") => boolean;
|
|
22
|
+
export declare const clampWidth: (width: number, column: XvTableColumn) => number;
|
|
23
|
+
/**
|
|
24
|
+
* What the rigid parts of the table actually need. A pixel column needs its width; a percentage
|
|
25
|
+
* column squeezes by definition and asks for nothing; a column that named no width gets the
|
|
26
|
+
* scroll-width guess. Guessing for all of them made a table of narrow columns scroll for nothing.
|
|
27
|
+
*/
|
|
28
|
+
export declare const tableMinWidth: (columns: XvTableColumn[], minWidth?: number, controls?: number) => number;
|
|
29
|
+
/**
|
|
30
|
+
* The grid track list. Resize rewrites this one string on the host, which is a single DOM write
|
|
31
|
+
* per pointermove — a colgroup would need one per `<col>`. One track per control column: a grip
|
|
32
|
+
* and a checkbox are separate cells, so they need separate tracks.
|
|
33
|
+
*/
|
|
34
|
+
export declare const buildColumnTracks: (columns: XvTableColumn[], leading?: number[], trailing?: number[]) => string[];
|
|
35
|
+
export declare const buildColumnTemplate: (columns: XvTableColumn[], leading?: number[], trailing?: number[]) => string;
|
|
36
|
+
export declare const moveItem: <T>(items: T[], from: number, to: number) => T[];
|
|
37
|
+
/** Hidden columns keep their absolute slot while the visible ones move around them. */
|
|
38
|
+
export declare const mergeVisibleOrder: (columns: XvTableColumn[], ordered: XvTableColumn[]) => XvTableColumn[];
|
|
39
|
+
/**
|
|
40
|
+
* Only the deviations from the declared columns are stored. An untouched column follows the code,
|
|
41
|
+
* so a later default still reaches everyone who once dragged a column edge.
|
|
42
|
+
*/
|
|
43
|
+
export declare const diffLayout: (columns: XvTableColumn[], declared: XvTableColumn[]) => XvTableLayout;
|
|
44
|
+
export declare const isLayoutChanged: (layout: XvTableLayout | null) => boolean;
|
|
45
|
+
/** Merges onto clones, so a stored width never writes back into the page's declared preset. */
|
|
46
|
+
export declare const applyLayout: (declared: XvTableColumn[], layout: XvTableLayout | null) => XvTableColumn[];
|
|
47
|
+
export declare const formatCell: (value: unknown, column: XvTableColumn, locale: string) => string;
|