@react-stately/table 3.15.4 → 3.16.0
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/dist/import.mjs +6 -18
- package/dist/main.js +18 -30
- package/dist/main.js.map +1 -1
- package/dist/module.js +6 -18
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +9 -0
- package/package.json +17 -20
- package/src/index.ts +9 -16
- package/dist/Cell.main.js +0 -38
- package/dist/Cell.main.js.map +0 -1
- package/dist/Cell.mjs +0 -33
- package/dist/Cell.module.js +0 -33
- package/dist/Cell.module.js.map +0 -1
- package/dist/Column.main.js +0 -75
- package/dist/Column.main.js.map +0 -1
- package/dist/Column.mjs +0 -66
- package/dist/Column.module.js +0 -66
- package/dist/Column.module.js.map +0 -1
- package/dist/Row.main.js +0 -102
- package/dist/Row.main.js.map +0 -1
- package/dist/Row.mjs +0 -93
- package/dist/Row.module.js +0 -93
- package/dist/Row.module.js.map +0 -1
- package/dist/TableBody.main.js +0 -61
- package/dist/TableBody.main.js.map +0 -1
- package/dist/TableBody.mjs +0 -52
- package/dist/TableBody.module.js +0 -52
- package/dist/TableBody.module.js.map +0 -1
- package/dist/TableCollection.main.js +0 -308
- package/dist/TableCollection.main.js.map +0 -1
- package/dist/TableCollection.mjs +0 -302
- package/dist/TableCollection.module.js +0 -302
- package/dist/TableCollection.module.js.map +0 -1
- package/dist/TableColumnLayout.main.js +0 -113
- package/dist/TableColumnLayout.main.js.map +0 -1
- package/dist/TableColumnLayout.mjs +0 -108
- package/dist/TableColumnLayout.module.js +0 -108
- package/dist/TableColumnLayout.module.js.map +0 -1
- package/dist/TableHeader.main.js +0 -56
- package/dist/TableHeader.main.js.map +0 -1
- package/dist/TableHeader.mjs +0 -47
- package/dist/TableHeader.module.js +0 -47
- package/dist/TableHeader.module.js.map +0 -1
- package/dist/TableUtils.main.js +0 -182
- package/dist/TableUtils.main.js.map +0 -1
- package/dist/TableUtils.mjs +0 -175
- package/dist/TableUtils.module.js +0 -175
- package/dist/TableUtils.module.js.map +0 -1
- package/dist/types.d.ts +0 -194
- package/dist/types.d.ts.map +0 -1
- package/dist/useTableColumnResizeState.main.js +0 -109
- package/dist/useTableColumnResizeState.main.js.map +0 -1
- package/dist/useTableColumnResizeState.mjs +0 -104
- package/dist/useTableColumnResizeState.module.js +0 -104
- package/dist/useTableColumnResizeState.module.js.map +0 -1
- package/dist/useTableState.main.js +0 -86
- package/dist/useTableState.main.js.map +0 -1
- package/dist/useTableState.mjs +0 -80
- package/dist/useTableState.module.js +0 -80
- package/dist/useTableState.module.js.map +0 -1
- package/dist/useTreeGridState.main.js +0 -207
- package/dist/useTreeGridState.main.js.map +0 -1
- package/dist/useTreeGridState.mjs +0 -202
- package/dist/useTreeGridState.module.js +0 -202
- package/dist/useTreeGridState.module.js.map +0 -1
- package/src/Cell.ts +0 -40
- package/src/Column.ts +0 -83
- package/src/Row.ts +0 -121
- package/src/TableBody.ts +0 -61
- package/src/TableCollection.ts +0 -367
- package/src/TableColumnLayout.ts +0 -127
- package/src/TableHeader.ts +0 -59
- package/src/TableUtils.ts +0 -266
- package/src/useTableColumnResizeState.ts +0 -147
- package/src/useTableState.ts +0 -124
- package/src/useTreeGridState.ts +0 -278
package/dist/TableUtils.mjs
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2022 Adobe. All rights reserved.
|
|
3
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
* governing permissions and limitations under the License.
|
|
11
|
-
*/ function $6818b1c4fc67028d$export$1994a077b98ee0d5(width) {
|
|
12
|
-
return width != null && (!isNaN(width) || String(width).match(/^(\d+)(?=%$)/) !== null);
|
|
13
|
-
}
|
|
14
|
-
function $6818b1c4fc67028d$export$9078bad4c3934604(width) {
|
|
15
|
-
if (!width || typeof width === 'number') return 1;
|
|
16
|
-
let match = width.match(/^(.+)(?=fr$)/);
|
|
17
|
-
// if width is the incorrect format, just default it to a 1fr
|
|
18
|
-
if (!match) {
|
|
19
|
-
if (process.env.NODE_ENV !== 'production') console.warn(`width: ${width} is not a supported format, width should be a number (ex. 150), percentage (ex. '50%') or fr unit (ex. '2fr')`, 'defaulting to \'1fr\'');
|
|
20
|
-
return 1;
|
|
21
|
-
}
|
|
22
|
-
return parseFloat(match[0]);
|
|
23
|
-
}
|
|
24
|
-
function $6818b1c4fc67028d$export$7bbad27896f7ae9f(width, tableWidth) {
|
|
25
|
-
if (typeof width === 'string') {
|
|
26
|
-
let match = width.match(/^(\d+)(?=%$)/);
|
|
27
|
-
if (!match) throw new Error('Only percentages or numbers are supported for static column widths');
|
|
28
|
-
return tableWidth * (parseFloat(match[0]) / 100);
|
|
29
|
-
}
|
|
30
|
-
return width;
|
|
31
|
-
}
|
|
32
|
-
function $6818b1c4fc67028d$export$59185c62a7544aa0(maxWidth, tableWidth) {
|
|
33
|
-
return maxWidth != null ? $6818b1c4fc67028d$export$7bbad27896f7ae9f(maxWidth, tableWidth) : Number.MAX_SAFE_INTEGER;
|
|
34
|
-
}
|
|
35
|
-
function $6818b1c4fc67028d$export$f556054ce4358701(minWidth, tableWidth) {
|
|
36
|
-
return minWidth != null ? $6818b1c4fc67028d$export$7bbad27896f7ae9f(minWidth, tableWidth) : 0;
|
|
37
|
-
}
|
|
38
|
-
function $6818b1c4fc67028d$export$55d50dc687385491(availableWidth, columns, changedColumns, getDefaultWidth, getDefaultMinWidth) {
|
|
39
|
-
let hasNonFrozenItems = false;
|
|
40
|
-
let flexItems = columns.map((column, index)=>{
|
|
41
|
-
var _changedColumns_get, _column_width, _ref, _ref1;
|
|
42
|
-
let width = changedColumns.get(column.key) != null ? (_changedColumns_get = changedColumns.get(column.key)) !== null && _changedColumns_get !== void 0 ? _changedColumns_get : '1fr' : (_ref1 = (_ref = (_column_width = column.width) !== null && _column_width !== void 0 ? _column_width : column.defaultWidth) !== null && _ref !== void 0 ? _ref : getDefaultWidth === null || getDefaultWidth === void 0 ? void 0 : getDefaultWidth(index)) !== null && _ref1 !== void 0 ? _ref1 : '1fr';
|
|
43
|
-
let frozen = false;
|
|
44
|
-
let baseSize = 0;
|
|
45
|
-
let flex = 0;
|
|
46
|
-
let targetMainSize = 0;
|
|
47
|
-
if ($6818b1c4fc67028d$export$1994a077b98ee0d5(width)) {
|
|
48
|
-
baseSize = $6818b1c4fc67028d$export$7bbad27896f7ae9f(width, availableWidth);
|
|
49
|
-
frozen = true;
|
|
50
|
-
} else {
|
|
51
|
-
flex = $6818b1c4fc67028d$export$9078bad4c3934604(width);
|
|
52
|
-
if (flex <= 0) frozen = true;
|
|
53
|
-
}
|
|
54
|
-
var _column_minWidth, _ref2;
|
|
55
|
-
let min = $6818b1c4fc67028d$export$f556054ce4358701((_ref2 = (_column_minWidth = column.minWidth) !== null && _column_minWidth !== void 0 ? _column_minWidth : getDefaultMinWidth === null || getDefaultMinWidth === void 0 ? void 0 : getDefaultMinWidth(index)) !== null && _ref2 !== void 0 ? _ref2 : 0, availableWidth);
|
|
56
|
-
let max = $6818b1c4fc67028d$export$59185c62a7544aa0(column.maxWidth, availableWidth);
|
|
57
|
-
let hypotheticalMainSize = Math.max(min, Math.min(baseSize, max));
|
|
58
|
-
// 9.7.1
|
|
59
|
-
// We don't make use of flex basis, it's always 0, so we are always in 'grow' mode.
|
|
60
|
-
// 9.7.2
|
|
61
|
-
if (frozen) targetMainSize = hypotheticalMainSize;
|
|
62
|
-
else if (baseSize > hypotheticalMainSize) {
|
|
63
|
-
frozen = true;
|
|
64
|
-
targetMainSize = hypotheticalMainSize;
|
|
65
|
-
}
|
|
66
|
-
// 9.7.3
|
|
67
|
-
if (!frozen) hasNonFrozenItems = true;
|
|
68
|
-
return {
|
|
69
|
-
frozen: frozen,
|
|
70
|
-
baseSize: baseSize,
|
|
71
|
-
hypotheticalMainSize: hypotheticalMainSize,
|
|
72
|
-
min: min,
|
|
73
|
-
max: max,
|
|
74
|
-
flex: flex,
|
|
75
|
-
targetMainSize: targetMainSize,
|
|
76
|
-
violation: 0
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
// 9.7.4
|
|
80
|
-
// 9.7.4.a
|
|
81
|
-
while(hasNonFrozenItems){
|
|
82
|
-
// 9.7.4.b
|
|
83
|
-
/**
|
|
84
|
-
* Calculate the remaining free space as for initial free space,
|
|
85
|
-
* above (9.7.3). If the sum of the unfrozen flex items’ flex factors is
|
|
86
|
-
* less than one, multiply the initial free space by this sum (of flex factors).
|
|
87
|
-
* If the magnitude of this value is less than the magnitude of
|
|
88
|
-
* the remaining free space, use this as the remaining free space.
|
|
89
|
-
*/ let usedWidth = 0;
|
|
90
|
-
let flexFactors = 0;
|
|
91
|
-
flexItems.forEach((item)=>{
|
|
92
|
-
if (item.frozen) usedWidth += item.targetMainSize;
|
|
93
|
-
else {
|
|
94
|
-
usedWidth += item.baseSize;
|
|
95
|
-
flexFactors += item.flex;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
let remainingFreeSpace = availableWidth - usedWidth;
|
|
99
|
-
// we only support integer FR's, and because of hasNonFrozenItems, we know that flexFactors > 0
|
|
100
|
-
// so no need to check for flexFactors < 1
|
|
101
|
-
// 9.7.4.c
|
|
102
|
-
/**
|
|
103
|
-
* If the remaining free space is zero
|
|
104
|
-
* - Do nothing.
|
|
105
|
-
* Else // remember, we're always in grow mode
|
|
106
|
-
* - Find the ratio of the item’s flex grow factor to the
|
|
107
|
-
* sum of the flex grow factors of all unfrozen items on
|
|
108
|
-
* the line. Set the item’s target main size to its flex
|
|
109
|
-
* base size plus a fraction of the remaining free space
|
|
110
|
-
* proportional to the ratio.
|
|
111
|
-
*/ if (remainingFreeSpace > 0) flexItems.forEach((item)=>{
|
|
112
|
-
if (!item.frozen) {
|
|
113
|
-
let ratio = item.flex / flexFactors;
|
|
114
|
-
item.targetMainSize = item.baseSize + ratio * remainingFreeSpace;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
// 9.7.4.d
|
|
118
|
-
/**
|
|
119
|
-
* Fix min/max violations. Clamp each non-frozen item’s
|
|
120
|
-
* target main size by its used min and max main sizes
|
|
121
|
-
* and floor its content-box size at zero. If the item’s
|
|
122
|
-
* target main size was made smaller by this, it’s a max
|
|
123
|
-
* violation. If the item’s target main size was made
|
|
124
|
-
* larger by this, it’s a min violation.
|
|
125
|
-
*/ let totalViolation = 0;
|
|
126
|
-
flexItems.forEach((item)=>{
|
|
127
|
-
item.violation = 0;
|
|
128
|
-
if (!item.frozen) {
|
|
129
|
-
let { min: min, max: max, targetMainSize: targetMainSize } = item;
|
|
130
|
-
item.targetMainSize = Math.max(min, Math.min(targetMainSize, max));
|
|
131
|
-
item.violation = item.targetMainSize - targetMainSize;
|
|
132
|
-
totalViolation += item.violation;
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
// 9.7.4.e
|
|
136
|
-
/**
|
|
137
|
-
* Freeze over-flexed items. The total violation is the
|
|
138
|
-
* sum of the adjustments from the previous step
|
|
139
|
-
* ∑(clamped size - unclamped size). If the total violation is:
|
|
140
|
-
* Zero
|
|
141
|
-
* - Freeze all items.
|
|
142
|
-
*
|
|
143
|
-
* Positive
|
|
144
|
-
* - Freeze all the items with min violations.
|
|
145
|
-
*
|
|
146
|
-
* Negative
|
|
147
|
-
* - Freeze all the items with max violations.
|
|
148
|
-
*/ hasNonFrozenItems = false;
|
|
149
|
-
flexItems.forEach((item)=>{
|
|
150
|
-
if (totalViolation === 0 || Math.sign(totalViolation) === Math.sign(item.violation)) item.frozen = true;
|
|
151
|
-
else if (!item.frozen) hasNonFrozenItems = true;
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
return $6818b1c4fc67028d$var$cascadeRounding(flexItems);
|
|
155
|
-
}
|
|
156
|
-
function $6818b1c4fc67028d$var$cascadeRounding(flexItems) {
|
|
157
|
-
/*
|
|
158
|
-
Given an array of floats that sum to an integer, this rounds the floats
|
|
159
|
-
and returns an array of integers with the same sum.
|
|
160
|
-
*/ let fpTotal = 0;
|
|
161
|
-
let intTotal = 0;
|
|
162
|
-
let roundedArray = [];
|
|
163
|
-
flexItems.forEach(function(item) {
|
|
164
|
-
let float = item.targetMainSize;
|
|
165
|
-
let integer = Math.round(float + fpTotal) - intTotal;
|
|
166
|
-
fpTotal += float;
|
|
167
|
-
intTotal += integer;
|
|
168
|
-
roundedArray.push(integer);
|
|
169
|
-
});
|
|
170
|
-
return roundedArray;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
export {$6818b1c4fc67028d$export$1994a077b98ee0d5 as isStatic, $6818b1c4fc67028d$export$9078bad4c3934604 as parseFractionalUnit, $6818b1c4fc67028d$export$7bbad27896f7ae9f as parseStaticWidth, $6818b1c4fc67028d$export$59185c62a7544aa0 as getMaxWidth, $6818b1c4fc67028d$export$f556054ce4358701 as getMinWidth, $6818b1c4fc67028d$export$55d50dc687385491 as calculateColumnSizes};
|
|
175
|
-
//# sourceMappingURL=TableUtils.module.js.map
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2022 Adobe. All rights reserved.
|
|
3
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
*
|
|
7
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
-
* governing permissions and limitations under the License.
|
|
11
|
-
*/ function $6818b1c4fc67028d$export$1994a077b98ee0d5(width) {
|
|
12
|
-
return width != null && (!isNaN(width) || String(width).match(/^(\d+)(?=%$)/) !== null);
|
|
13
|
-
}
|
|
14
|
-
function $6818b1c4fc67028d$export$9078bad4c3934604(width) {
|
|
15
|
-
if (!width || typeof width === 'number') return 1;
|
|
16
|
-
let match = width.match(/^(.+)(?=fr$)/);
|
|
17
|
-
// if width is the incorrect format, just default it to a 1fr
|
|
18
|
-
if (!match) {
|
|
19
|
-
if (process.env.NODE_ENV !== 'production') console.warn(`width: ${width} is not a supported format, width should be a number (ex. 150), percentage (ex. '50%') or fr unit (ex. '2fr')`, 'defaulting to \'1fr\'');
|
|
20
|
-
return 1;
|
|
21
|
-
}
|
|
22
|
-
return parseFloat(match[0]);
|
|
23
|
-
}
|
|
24
|
-
function $6818b1c4fc67028d$export$7bbad27896f7ae9f(width, tableWidth) {
|
|
25
|
-
if (typeof width === 'string') {
|
|
26
|
-
let match = width.match(/^(\d+)(?=%$)/);
|
|
27
|
-
if (!match) throw new Error('Only percentages or numbers are supported for static column widths');
|
|
28
|
-
return tableWidth * (parseFloat(match[0]) / 100);
|
|
29
|
-
}
|
|
30
|
-
return width;
|
|
31
|
-
}
|
|
32
|
-
function $6818b1c4fc67028d$export$59185c62a7544aa0(maxWidth, tableWidth) {
|
|
33
|
-
return maxWidth != null ? $6818b1c4fc67028d$export$7bbad27896f7ae9f(maxWidth, tableWidth) : Number.MAX_SAFE_INTEGER;
|
|
34
|
-
}
|
|
35
|
-
function $6818b1c4fc67028d$export$f556054ce4358701(minWidth, tableWidth) {
|
|
36
|
-
return minWidth != null ? $6818b1c4fc67028d$export$7bbad27896f7ae9f(minWidth, tableWidth) : 0;
|
|
37
|
-
}
|
|
38
|
-
function $6818b1c4fc67028d$export$55d50dc687385491(availableWidth, columns, changedColumns, getDefaultWidth, getDefaultMinWidth) {
|
|
39
|
-
let hasNonFrozenItems = false;
|
|
40
|
-
let flexItems = columns.map((column, index)=>{
|
|
41
|
-
var _changedColumns_get, _column_width, _ref, _ref1;
|
|
42
|
-
let width = changedColumns.get(column.key) != null ? (_changedColumns_get = changedColumns.get(column.key)) !== null && _changedColumns_get !== void 0 ? _changedColumns_get : '1fr' : (_ref1 = (_ref = (_column_width = column.width) !== null && _column_width !== void 0 ? _column_width : column.defaultWidth) !== null && _ref !== void 0 ? _ref : getDefaultWidth === null || getDefaultWidth === void 0 ? void 0 : getDefaultWidth(index)) !== null && _ref1 !== void 0 ? _ref1 : '1fr';
|
|
43
|
-
let frozen = false;
|
|
44
|
-
let baseSize = 0;
|
|
45
|
-
let flex = 0;
|
|
46
|
-
let targetMainSize = 0;
|
|
47
|
-
if ($6818b1c4fc67028d$export$1994a077b98ee0d5(width)) {
|
|
48
|
-
baseSize = $6818b1c4fc67028d$export$7bbad27896f7ae9f(width, availableWidth);
|
|
49
|
-
frozen = true;
|
|
50
|
-
} else {
|
|
51
|
-
flex = $6818b1c4fc67028d$export$9078bad4c3934604(width);
|
|
52
|
-
if (flex <= 0) frozen = true;
|
|
53
|
-
}
|
|
54
|
-
var _column_minWidth, _ref2;
|
|
55
|
-
let min = $6818b1c4fc67028d$export$f556054ce4358701((_ref2 = (_column_minWidth = column.minWidth) !== null && _column_minWidth !== void 0 ? _column_minWidth : getDefaultMinWidth === null || getDefaultMinWidth === void 0 ? void 0 : getDefaultMinWidth(index)) !== null && _ref2 !== void 0 ? _ref2 : 0, availableWidth);
|
|
56
|
-
let max = $6818b1c4fc67028d$export$59185c62a7544aa0(column.maxWidth, availableWidth);
|
|
57
|
-
let hypotheticalMainSize = Math.max(min, Math.min(baseSize, max));
|
|
58
|
-
// 9.7.1
|
|
59
|
-
// We don't make use of flex basis, it's always 0, so we are always in 'grow' mode.
|
|
60
|
-
// 9.7.2
|
|
61
|
-
if (frozen) targetMainSize = hypotheticalMainSize;
|
|
62
|
-
else if (baseSize > hypotheticalMainSize) {
|
|
63
|
-
frozen = true;
|
|
64
|
-
targetMainSize = hypotheticalMainSize;
|
|
65
|
-
}
|
|
66
|
-
// 9.7.3
|
|
67
|
-
if (!frozen) hasNonFrozenItems = true;
|
|
68
|
-
return {
|
|
69
|
-
frozen: frozen,
|
|
70
|
-
baseSize: baseSize,
|
|
71
|
-
hypotheticalMainSize: hypotheticalMainSize,
|
|
72
|
-
min: min,
|
|
73
|
-
max: max,
|
|
74
|
-
flex: flex,
|
|
75
|
-
targetMainSize: targetMainSize,
|
|
76
|
-
violation: 0
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
// 9.7.4
|
|
80
|
-
// 9.7.4.a
|
|
81
|
-
while(hasNonFrozenItems){
|
|
82
|
-
// 9.7.4.b
|
|
83
|
-
/**
|
|
84
|
-
* Calculate the remaining free space as for initial free space,
|
|
85
|
-
* above (9.7.3). If the sum of the unfrozen flex items’ flex factors is
|
|
86
|
-
* less than one, multiply the initial free space by this sum (of flex factors).
|
|
87
|
-
* If the magnitude of this value is less than the magnitude of
|
|
88
|
-
* the remaining free space, use this as the remaining free space.
|
|
89
|
-
*/ let usedWidth = 0;
|
|
90
|
-
let flexFactors = 0;
|
|
91
|
-
flexItems.forEach((item)=>{
|
|
92
|
-
if (item.frozen) usedWidth += item.targetMainSize;
|
|
93
|
-
else {
|
|
94
|
-
usedWidth += item.baseSize;
|
|
95
|
-
flexFactors += item.flex;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
let remainingFreeSpace = availableWidth - usedWidth;
|
|
99
|
-
// we only support integer FR's, and because of hasNonFrozenItems, we know that flexFactors > 0
|
|
100
|
-
// so no need to check for flexFactors < 1
|
|
101
|
-
// 9.7.4.c
|
|
102
|
-
/**
|
|
103
|
-
* If the remaining free space is zero
|
|
104
|
-
* - Do nothing.
|
|
105
|
-
* Else // remember, we're always in grow mode
|
|
106
|
-
* - Find the ratio of the item’s flex grow factor to the
|
|
107
|
-
* sum of the flex grow factors of all unfrozen items on
|
|
108
|
-
* the line. Set the item’s target main size to its flex
|
|
109
|
-
* base size plus a fraction of the remaining free space
|
|
110
|
-
* proportional to the ratio.
|
|
111
|
-
*/ if (remainingFreeSpace > 0) flexItems.forEach((item)=>{
|
|
112
|
-
if (!item.frozen) {
|
|
113
|
-
let ratio = item.flex / flexFactors;
|
|
114
|
-
item.targetMainSize = item.baseSize + ratio * remainingFreeSpace;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
// 9.7.4.d
|
|
118
|
-
/**
|
|
119
|
-
* Fix min/max violations. Clamp each non-frozen item’s
|
|
120
|
-
* target main size by its used min and max main sizes
|
|
121
|
-
* and floor its content-box size at zero. If the item’s
|
|
122
|
-
* target main size was made smaller by this, it’s a max
|
|
123
|
-
* violation. If the item’s target main size was made
|
|
124
|
-
* larger by this, it’s a min violation.
|
|
125
|
-
*/ let totalViolation = 0;
|
|
126
|
-
flexItems.forEach((item)=>{
|
|
127
|
-
item.violation = 0;
|
|
128
|
-
if (!item.frozen) {
|
|
129
|
-
let { min: min, max: max, targetMainSize: targetMainSize } = item;
|
|
130
|
-
item.targetMainSize = Math.max(min, Math.min(targetMainSize, max));
|
|
131
|
-
item.violation = item.targetMainSize - targetMainSize;
|
|
132
|
-
totalViolation += item.violation;
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
// 9.7.4.e
|
|
136
|
-
/**
|
|
137
|
-
* Freeze over-flexed items. The total violation is the
|
|
138
|
-
* sum of the adjustments from the previous step
|
|
139
|
-
* ∑(clamped size - unclamped size). If the total violation is:
|
|
140
|
-
* Zero
|
|
141
|
-
* - Freeze all items.
|
|
142
|
-
*
|
|
143
|
-
* Positive
|
|
144
|
-
* - Freeze all the items with min violations.
|
|
145
|
-
*
|
|
146
|
-
* Negative
|
|
147
|
-
* - Freeze all the items with max violations.
|
|
148
|
-
*/ hasNonFrozenItems = false;
|
|
149
|
-
flexItems.forEach((item)=>{
|
|
150
|
-
if (totalViolation === 0 || Math.sign(totalViolation) === Math.sign(item.violation)) item.frozen = true;
|
|
151
|
-
else if (!item.frozen) hasNonFrozenItems = true;
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
return $6818b1c4fc67028d$var$cascadeRounding(flexItems);
|
|
155
|
-
}
|
|
156
|
-
function $6818b1c4fc67028d$var$cascadeRounding(flexItems) {
|
|
157
|
-
/*
|
|
158
|
-
Given an array of floats that sum to an integer, this rounds the floats
|
|
159
|
-
and returns an array of integers with the same sum.
|
|
160
|
-
*/ let fpTotal = 0;
|
|
161
|
-
let intTotal = 0;
|
|
162
|
-
let roundedArray = [];
|
|
163
|
-
flexItems.forEach(function(item) {
|
|
164
|
-
let float = item.targetMainSize;
|
|
165
|
-
let integer = Math.round(float + fpTotal) - intTotal;
|
|
166
|
-
fpTotal += float;
|
|
167
|
-
intTotal += integer;
|
|
168
|
-
roundedArray.push(integer);
|
|
169
|
-
});
|
|
170
|
-
return roundedArray;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
export {$6818b1c4fc67028d$export$1994a077b98ee0d5 as isStatic, $6818b1c4fc67028d$export$9078bad4c3934604 as parseFractionalUnit, $6818b1c4fc67028d$export$7bbad27896f7ae9f as parseStaticWidth, $6818b1c4fc67028d$export$59185c62a7544aa0 as getMaxWidth, $6818b1c4fc67028d$export$f556054ce4358701 as getMinWidth, $6818b1c4fc67028d$export$55d50dc687385491 as calculateColumnSizes};
|
|
175
|
-
//# sourceMappingURL=TableUtils.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAAA;;;;;;;;;;CAUC,GAMM,SAAS,0CAAS,KAAyB;IAChD,OAAO,SAAS,QAAS,CAAA,CAAC,MAAM,UAAoB,AAAC,OAAO,OAAQ,KAAK,CAAC,oBAAoB,IAAG;AACnG;AAEO,SAAS,0CAAoB,KAAyB;IAC3D,IAAI,CAAC,SAAS,OAAO,UAAU,UAC7B,OAAO;IAET,IAAI,QAAQ,MAAM,KAAK,CAAC;IACxB,6DAA6D;IAC7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,KAAK,MAAM,EAAE;gBAChB,IAAI,OAAC,GAAG,OAAE,GAAG,kBAAE,cAAc,EAAC,GAAG;gBACjC,KAAK,cAAc,GAAG,KAAK,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,gBAAgB;gBAE7D,KAAK,SAAS,GAAG,KAAK,cAAc,GAAG;gBACvC,kBAAkB,KAAK,SAAS;YAClC;QACF;QAEA,UAAU;QACV;;;;;;;;;;;;KAYC,GACD,oBAAoB;QACpB,UAAU,OAAO,CAAC,CAAA;YAChB,IAAI,mBAAmB,KAAK,KAAK,IAAI,CAAC,oBAAoB,KAAK,IAAI,CAAC,KAAK,SAAS,GAChF,KAAK,MAAM,GAAG;iBACT,IAAI,CAAC,KAAK,MAAM,EACrB,oBAAoB;QAExB;IACF;IAEA,OAAO,sCAAgB;AACzB;AAEA,SAAS,sCAAgB,SAAqB;IAC5C;;;EAGA,GAEA,IAAI,UAAU;IACd,IAAI,WAAW;IACf,IAAI,eAAyB,EAAE;IAC/B,UAAU,OAAO,CAAC,SAAU,IAAI;QAC9B,IAAI,QAAQ,KAAK,cAAc;QAC/B,IAAI,UAAU,KAAK,KAAK,CAAC,QAAQ,WAAW;QAC5C,WAAW;QACX,YAAY;QACZ,aAAa,IAAI,CAAC;IACpB;IAEA,OAAO;AACT","sources":["packages/@react-stately/table/src/TableUtils.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ColumnSize} from '@react-types/table';\nimport {Key} from '@react-types/shared';\n\n// numbers and percents are considered static. *fr units or a lack of units are considered dynamic.\nexport function isStatic(width?: ColumnSize | null): boolean {\n return width != null && (!isNaN(width as number) || (String(width)).match(/^(\\d+)(?=%$)/) !== null);\n}\n\nexport function parseFractionalUnit(width?: ColumnSize | null): number {\n if (!width || typeof width === 'number') {\n return 1;\n }\n let match = width.match(/^(.+)(?=fr$)/);\n // if width is the incorrect format, just default it to a 1fr\n if (!match) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`width: ${width} is not a supported format, width should be a number (ex. 150), percentage (ex. '50%') or fr unit (ex. '2fr')`,\n 'defaulting to \\'1fr\\'');\n }\n return 1;\n }\n return parseFloat(match[0]);\n}\n\nexport function parseStaticWidth(width: number | string, tableWidth: number): number {\n if (typeof width === 'string') {\n let match = width.match(/^(\\d+)(?=%$)/);\n if (!match) {\n throw new Error('Only percentages or numbers are supported for static column widths');\n }\n return tableWidth * (parseFloat(match[0]) / 100);\n }\n return width;\n}\n\n\nexport function getMaxWidth(maxWidth: number | string | null | undefined, tableWidth: number): number {\n return maxWidth != null\n ? parseStaticWidth(maxWidth, tableWidth)\n : Number.MAX_SAFE_INTEGER;\n}\n\n// cannot support FR units, we'd need to know everything else in the table to do that\nexport function getMinWidth(minWidth: number | string, tableWidth: number): number {\n return minWidth != null\n ? parseStaticWidth(minWidth, tableWidth)\n : 0;\n}\n\n\nexport interface IColumn {\n minWidth?: number | string,\n maxWidth?: number | string,\n width?: number | string,\n defaultWidth?: number | string,\n key: Key\n}\n\ninterface FlexItem {\n frozen: boolean,\n baseSize: number,\n hypotheticalMainSize: number,\n min: number,\n max: number,\n flex: number,\n targetMainSize: number,\n violation: number\n}\n\n/**\n * Implements the flex algorithm described in https://www.w3.org/TR/css-flexbox-1/#layout-algorithm\n * It makes a few constraint/assumptions:\n * 1. All basis values are 0 unless it is a static width, then the basis is the static width\n * 2. All flex grow and shrink values are equal to the FR specified on the column, grow and shrink for the same column are equal\n * 3. We only have one row\n * An example of the setup can be seen here https://jsfiddle.net/snowystinger/wv0ymjaf/61/ where I let the browser figure out the\n * flex of the columns.\n * Note: We differ in one key aspect, all of our column widths must be whole numbers, so we avoid browser\n * sub pixel rounding errors. To do this, we use a cascading rounding algorithm to ensure that the sum of the widths is maintained\n * while distributing the rounding remainder across the columns.\n *\n * As noted in the chrome source code, this algorithm is very accurate, but has the potential to be quadratic.\n * They have deemed this to be acceptable because the number of elements is usually small and the flex factors\n * are usually not high variance. I believe we can make the same assumptions. Particularly once resizing is\n * started, it will convert all columns to the left to static widths, so it will cut down on the number of FR columns.\n *\n * There are likely faster ways to do this, I've chosen to stick to the spec as closely as possible for readability, accuracy, and for the\n * note that this behaving quadratically is unlikely to be a problem.\n * @param availableWidth - The visible width of the table.\n * @param columns - The table defined columns.\n * @param changedColumns - Any columns we want to override, for example, during resizing.\n * @param getDefaultWidth - A function that returns the default width of a column by its index.\n * @param getDefaultMinWidth - A function that returns the default min width of a column by its index.\n */\nexport function calculateColumnSizes(availableWidth: number, columns: IColumn[], changedColumns: Map<Key, ColumnSize>, getDefaultWidth?: (index: number) => ColumnSize | null | undefined, getDefaultMinWidth?: (index: number) => ColumnSize | null | undefined): number[] {\n let hasNonFrozenItems = false;\n let flexItems: FlexItem[] = columns.map((column, index) => {\n let width: ColumnSize = (changedColumns.get(column.key) != null ? changedColumns.get(column.key) ?? '1fr' : column.width ?? column.defaultWidth ?? getDefaultWidth?.(index) ?? '1fr') as ColumnSize;\n let frozen = false;\n let baseSize = 0;\n let flex = 0;\n let targetMainSize = 0;\n if (isStatic(width)) {\n baseSize = parseStaticWidth(width, availableWidth);\n frozen = true;\n } else {\n flex = parseFractionalUnit(width);\n if (flex <= 0) {\n frozen = true;\n }\n }\n\n let min = getMinWidth(column.minWidth ?? getDefaultMinWidth?.(index) ?? 0, availableWidth);\n let max = getMaxWidth(column.maxWidth, availableWidth);\n let hypotheticalMainSize = Math.max(min, Math.min(baseSize, max));\n\n // 9.7.1\n // We don't make use of flex basis, it's always 0, so we are always in 'grow' mode.\n // 9.7.2\n if (frozen) {\n targetMainSize = hypotheticalMainSize;\n } else if (baseSize > hypotheticalMainSize) {\n frozen = true;\n targetMainSize = hypotheticalMainSize;\n }\n\n // 9.7.3\n if (!frozen) {\n hasNonFrozenItems = true;\n }\n return {\n frozen,\n baseSize,\n hypotheticalMainSize,\n min,\n max,\n flex,\n targetMainSize,\n violation: 0\n };\n });\n\n // 9.7.4\n // 9.7.4.a\n while (hasNonFrozenItems) {\n // 9.7.4.b\n /**\n * Calculate the remaining free space as for initial free space,\n * above (9.7.3). If the sum of the unfrozen flex items’ flex factors is\n * less than one, multiply the initial free space by this sum (of flex factors).\n * If the magnitude of this value is less than the magnitude of\n * the remaining free space, use this as the remaining free space.\n */\n let usedWidth = 0;\n let flexFactors = 0;\n flexItems.forEach(item => {\n if (item.frozen) {\n usedWidth += item.targetMainSize;\n } else {\n usedWidth += item.baseSize;\n flexFactors += item.flex;\n }\n });\n\n let remainingFreeSpace = availableWidth - usedWidth;\n // we only support integer FR's, and because of hasNonFrozenItems, we know that flexFactors > 0\n // so no need to check for flexFactors < 1\n // 9.7.4.c\n /**\n * If the remaining free space is zero\n * - Do nothing.\n * Else // remember, we're always in grow mode\n * - Find the ratio of the item’s flex grow factor to the\n * sum of the flex grow factors of all unfrozen items on\n * the line. Set the item’s target main size to its flex\n * base size plus a fraction of the remaining free space\n * proportional to the ratio.\n */\n if (remainingFreeSpace > 0) {\n flexItems.forEach((item) => {\n if (!item.frozen) {\n let ratio = item.flex / flexFactors;\n item.targetMainSize = item.baseSize + (ratio * remainingFreeSpace);\n }\n });\n }\n\n // 9.7.4.d\n /**\n * Fix min/max violations. Clamp each non-frozen item’s\n * target main size by its used min and max main sizes\n * and floor its content-box size at zero. If the item’s\n * target main size was made smaller by this, it’s a max\n * violation. If the item’s target main size was made\n * larger by this, it’s a min violation.\n */\n let totalViolation = 0;\n flexItems.forEach(item => {\n item.violation = 0;\n if (!item.frozen) {\n let {min, max, targetMainSize} = item;\n item.targetMainSize = Math.max(min, Math.min(targetMainSize, max));\n\n item.violation = item.targetMainSize - targetMainSize;\n totalViolation += item.violation;\n }\n });\n\n // 9.7.4.e\n /**\n * Freeze over-flexed items. The total violation is the\n * sum of the adjustments from the previous step\n * ∑(clamped size - unclamped size). If the total violation is:\n * Zero\n * - Freeze all items.\n *\n * Positive\n * - Freeze all the items with min violations.\n *\n * Negative\n * - Freeze all the items with max violations.\n */\n hasNonFrozenItems = false;\n flexItems.forEach(item => {\n if (totalViolation === 0 || Math.sign(totalViolation) === Math.sign(item.violation)) {\n item.frozen = true;\n } else if (!item.frozen) {\n hasNonFrozenItems = true;\n }\n });\n }\n\n return cascadeRounding(flexItems);\n}\n\nfunction cascadeRounding(flexItems: FlexItem[]): number[] {\n /*\n Given an array of floats that sum to an integer, this rounds the floats\n and returns an array of integers with the same sum.\n */\n\n let fpTotal = 0;\n let intTotal = 0;\n let roundedArray: number[] = [];\n flexItems.forEach(function (item) {\n let float = item.targetMainSize;\n let integer = Math.round(float + fpTotal) - intTotal;\n fpTotal += float;\n intTotal += integer;\n roundedArray.push(integer);\n });\n\n return roundedArray;\n}\n"],"names":[],"version":3,"file":"TableUtils.module.js.map"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { ColumnSize, TableCollection as _TableCollection1, TableBodyProps, TableHeaderProps, ColumnProps, RowProps, CellProps } from "@react-types/table";
|
|
2
|
-
import { GridNode } from "@react-types/grid";
|
|
3
|
-
import { Key, Node, SelectionMode, Sortable, SortDescriptor } from "@react-types/shared";
|
|
4
|
-
import { GridCollection, GridState } from "@react-stately/grid";
|
|
5
|
-
import { MultipleSelectionState, MultipleSelectionStateProps } from "@react-stately/selection";
|
|
6
|
-
import { ReactElement, JSX } from "react";
|
|
7
|
-
interface TableColumnLayoutOptions<T> {
|
|
8
|
-
getDefaultWidth?: (column: GridNode<T>) => ColumnSize | null | undefined;
|
|
9
|
-
getDefaultMinWidth?: (column: GridNode<T>) => ColumnSize | null | undefined;
|
|
10
|
-
}
|
|
11
|
-
export class TableColumnLayout<T> {
|
|
12
|
-
getDefaultWidth: (column: GridNode<T>) => ColumnSize | null | undefined;
|
|
13
|
-
getDefaultMinWidth: (column: GridNode<T>) => ColumnSize | null | undefined;
|
|
14
|
-
columnWidths: Map<Key, number>;
|
|
15
|
-
columnMinWidths: Map<Key, number>;
|
|
16
|
-
columnMaxWidths: Map<Key, number>;
|
|
17
|
-
constructor(options: TableColumnLayoutOptions<T>);
|
|
18
|
-
/** Takes an array of columns and splits it into 2 maps of columns with controlled and columns with uncontrolled widths. */
|
|
19
|
-
splitColumnsIntoControlledAndUncontrolled(columns: Array<GridNode<T>>): [Map<Key, GridNode<T>>, Map<Key, GridNode<T>>];
|
|
20
|
-
/** Takes uncontrolled and controlled widths and joins them into a single Map. */
|
|
21
|
-
recombineColumns(columns: Array<GridNode<T>>, uncontrolledWidths: Map<Key, ColumnSize>, uncontrolledColumns: Map<Key, GridNode<T>>, controlledColumns: Map<Key, GridNode<T>>): Map<Key, ColumnSize>;
|
|
22
|
-
/** Used to make an initial Map of the uncontrolled widths based on default widths. */
|
|
23
|
-
getInitialUncontrolledWidths(uncontrolledColumns: Map<Key, GridNode<T>>): Map<Key, ColumnSize>;
|
|
24
|
-
getColumnWidth(key: Key): number;
|
|
25
|
-
getColumnMinWidth(key: Key): number;
|
|
26
|
-
getColumnMaxWidth(key: Key): number;
|
|
27
|
-
resizeColumnWidth(collection: _TableCollection1<T>, uncontrolledWidths: Map<Key, ColumnSize>, col: Key, width: number): Map<Key, ColumnSize>;
|
|
28
|
-
buildColumnWidths(tableWidth: number, collection: _TableCollection1<T>, widths: Map<Key, ColumnSize>): Map<Key, number>;
|
|
29
|
-
}
|
|
30
|
-
interface GridCollectionOptions {
|
|
31
|
-
showSelectionCheckboxes?: boolean;
|
|
32
|
-
showDragButtons?: boolean;
|
|
33
|
-
}
|
|
34
|
-
/** @private */
|
|
35
|
-
export function buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[];
|
|
36
|
-
export class TableCollection<T> extends GridCollection<T> implements _TableCollection1<T> {
|
|
37
|
-
headerRows: GridNode<T>[];
|
|
38
|
-
columns: GridNode<T>[];
|
|
39
|
-
rowHeaderColumnKeys: Set<Key>;
|
|
40
|
-
body: GridNode<T>;
|
|
41
|
-
_size: number;
|
|
42
|
-
constructor(nodes: Iterable<GridNode<T>>, prev?: _TableCollection1<T> | null, opts?: GridCollectionOptions);
|
|
43
|
-
[Symbol.iterator](): IterableIterator<GridNode<T>>;
|
|
44
|
-
get size(): number;
|
|
45
|
-
getKeys(): IterableIterator<Key>;
|
|
46
|
-
getKeyBefore(key: Key): Key | null;
|
|
47
|
-
getKeyAfter(key: Key): Key | null;
|
|
48
|
-
getFirstKey(): Key | null;
|
|
49
|
-
getLastKey(): Key | null;
|
|
50
|
-
getItem(key: Key): GridNode<T> | null;
|
|
51
|
-
at(idx: number): GridNode<T> | null;
|
|
52
|
-
getChildren(key: Key): Iterable<GridNode<T>>;
|
|
53
|
-
getTextValue(key: Key): string;
|
|
54
|
-
}
|
|
55
|
-
export interface TableState<T> extends GridState<T, _TableCollection1<T>> {
|
|
56
|
-
/** A collection of rows and columns in the table. */
|
|
57
|
-
collection: _TableCollection1<T>;
|
|
58
|
-
/** Whether the row selection checkboxes should be displayed. */
|
|
59
|
-
showSelectionCheckboxes: boolean;
|
|
60
|
-
/** The current sorted column and direction. */
|
|
61
|
-
sortDescriptor: SortDescriptor | null;
|
|
62
|
-
/** Calls the provided onSortChange handler with the provided column key and sort direction. */
|
|
63
|
-
sort(columnKey: Key, direction?: 'ascending' | 'descending'): void;
|
|
64
|
-
/** Whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */
|
|
65
|
-
isKeyboardNavigationDisabled: boolean;
|
|
66
|
-
/** Set whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */
|
|
67
|
-
setKeyboardNavigationDisabled: (val: boolean) => void;
|
|
68
|
-
}
|
|
69
|
-
export interface CollectionBuilderContext<T> {
|
|
70
|
-
showSelectionCheckboxes: boolean;
|
|
71
|
-
showDragButtons: boolean;
|
|
72
|
-
selectionMode: SelectionMode;
|
|
73
|
-
columns: Node<T>[];
|
|
74
|
-
}
|
|
75
|
-
export interface TableStateProps<T> extends MultipleSelectionStateProps, Sortable {
|
|
76
|
-
/** The elements that make up the table. Includes the TableHeader, TableBody, Columns, and Rows. */
|
|
77
|
-
children?: [ReactElement<TableHeaderProps<T>>, ReactElement<TableBodyProps<T>>];
|
|
78
|
-
/** A list of row keys to disable. */
|
|
79
|
-
disabledKeys?: Iterable<Key>;
|
|
80
|
-
/** A pre-constructed collection to use instead of building one from items and children. */
|
|
81
|
-
collection?: _TableCollection1<T>;
|
|
82
|
-
/** Whether the row selection checkboxes should be displayed. */
|
|
83
|
-
showSelectionCheckboxes?: boolean;
|
|
84
|
-
/** Whether the row drag button should be displayed.
|
|
85
|
-
* @private
|
|
86
|
-
*/
|
|
87
|
-
showDragButtons?: boolean;
|
|
88
|
-
/** @private - do not use unless you know what you're doing. */
|
|
89
|
-
UNSAFE_selectionState?: MultipleSelectionState;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Provides state management for a table component. Handles building a collection
|
|
93
|
-
* of columns and rows from props. In addition, it tracks row selection and manages sort order changes.
|
|
94
|
-
*/
|
|
95
|
-
export function useTableState<T extends object>(props: TableStateProps<T>): TableState<T>;
|
|
96
|
-
/**
|
|
97
|
-
* Filters a collection using the provided filter function and returns a new TableState.
|
|
98
|
-
*/
|
|
99
|
-
export function UNSTABLE_useFilteredTableState<T extends object>(state: TableState<T>, filterFn: ((nodeValue: string, node: Node<T>) => boolean) | null | undefined): TableState<T>;
|
|
100
|
-
export interface TableColumnResizeStateProps<T> {
|
|
101
|
-
/**
|
|
102
|
-
* Current width of the table or table viewport that the columns
|
|
103
|
-
* should be calculated against.
|
|
104
|
-
*/
|
|
105
|
-
tableWidth: number;
|
|
106
|
-
/** A function that is called to find the default width for a given column. */
|
|
107
|
-
getDefaultWidth?: (node: GridNode<T>) => ColumnSize | null | undefined;
|
|
108
|
-
/** A function that is called to find the default minWidth for a given column. */
|
|
109
|
-
getDefaultMinWidth?: (node: GridNode<T>) => ColumnSize | null | undefined;
|
|
110
|
-
}
|
|
111
|
-
export interface TableColumnResizeState<T> {
|
|
112
|
-
/**
|
|
113
|
-
* Called to update the state that a resize event has occurred.
|
|
114
|
-
* Returns the new widths for all columns based on the resized column.
|
|
115
|
-
*/
|
|
116
|
-
updateResizedColumns: (key: Key, width: number) => Map<Key, ColumnSize>;
|
|
117
|
-
/** Callback for when onColumnResize has started. */
|
|
118
|
-
startResize: (key: Key) => void;
|
|
119
|
-
/** Callback for when onColumnResize has ended. */
|
|
120
|
-
endResize: () => void;
|
|
121
|
-
/** Gets the current width for the specified column. */
|
|
122
|
-
getColumnWidth: (key: Key) => number;
|
|
123
|
-
/** Gets the current minWidth for the specified column. */
|
|
124
|
-
getColumnMinWidth: (key: Key) => number;
|
|
125
|
-
/** Gets the current maxWidth for the specified column. */
|
|
126
|
-
getColumnMaxWidth: (key: Key) => number;
|
|
127
|
-
/** Key of the currently resizing column. */
|
|
128
|
-
resizingColumn: Key | null;
|
|
129
|
-
/** A reference to the table state. */
|
|
130
|
-
tableState: TableState<T>;
|
|
131
|
-
/** A map of the current column widths. */
|
|
132
|
-
columnWidths: Map<Key, number>;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Provides column width state management for a table component with column resizing support. Handles building
|
|
136
|
-
* a map of column widths calculated from the table's width and any provided column width information from the collection.
|
|
137
|
-
* In addition, it tracks the currently resizing column and provides callbacks for updating the widths upon resize operations.
|
|
138
|
-
* @param props - Props for the table.
|
|
139
|
-
* @param state - State for the table, as returned by `useTableState`.
|
|
140
|
-
*/
|
|
141
|
-
export function useTableColumnResizeState<T>(props: TableColumnResizeStateProps<T>, state: TableState<T>): TableColumnResizeState<T>;
|
|
142
|
-
export interface TreeGridState<T> extends TableState<T> {
|
|
143
|
-
/** A set of keys for items that are expanded. */
|
|
144
|
-
expandedKeys: 'all' | Set<Key>;
|
|
145
|
-
/** Toggles the expanded state for a row by its key. */
|
|
146
|
-
toggleKey(key: Key): void;
|
|
147
|
-
/** The key map containing nodes representing the collection's tree grid structure. */
|
|
148
|
-
keyMap: Map<Key, GridNode<T>>;
|
|
149
|
-
/** The number of leaf columns provided by the user. */
|
|
150
|
-
userColumnCount: number;
|
|
151
|
-
}
|
|
152
|
-
export interface TreeGridStateProps<T> extends Omit<TableStateProps<T>, 'collection'> {
|
|
153
|
-
/** The currently expanded keys in the collection (controlled). */
|
|
154
|
-
UNSTABLE_expandedKeys?: 'all' | Iterable<Key>;
|
|
155
|
-
/** The initial expanded keys in the collection (uncontrolled). */
|
|
156
|
-
UNSTABLE_defaultExpandedKeys?: 'all' | Iterable<Key>;
|
|
157
|
-
/** Handler that is called when items are expanded or collapsed. */
|
|
158
|
-
UNSTABLE_onExpandedChange?: (keys: Set<Key>) => any;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Provides state management for a tree grid component. Handles building a collection
|
|
162
|
-
* of columns and rows from props. In addition, it tracks and manages expanded rows, row selection, and sort order changes.
|
|
163
|
-
*/
|
|
164
|
-
export function UNSTABLE_useTreeGridState<T extends object>(props: TreeGridStateProps<T>): TreeGridState<T>;
|
|
165
|
-
/**
|
|
166
|
-
* A TableHeader is a container for the Column elements in a Table. Columns can be statically defined
|
|
167
|
-
* as children, or generated dynamically using a function based on the data passed to the `columns` prop.
|
|
168
|
-
*/
|
|
169
|
-
export let TableHeader: <T>(props: TableHeaderProps<T>) => JSX.Element;
|
|
170
|
-
/**
|
|
171
|
-
* A TableBody is a container for the Row elements of a Table. Rows can be statically defined
|
|
172
|
-
* as children, or generated dynamically using a function based on the data passed to the `items` prop.
|
|
173
|
-
*/
|
|
174
|
-
export let TableBody: <T>(props: TableBodyProps<T>) => JSX.Element;
|
|
175
|
-
/**
|
|
176
|
-
* A Column represents a field of each item within a Table. Columns may also contain nested
|
|
177
|
-
* Column elements to represent column groups. Nested columns can be statically defined as
|
|
178
|
-
* children, or dynamically generated using a function based on the `childColumns` prop.
|
|
179
|
-
*/
|
|
180
|
-
export let Column: <T>(props: ColumnProps<T>) => JSX.Element;
|
|
181
|
-
/**
|
|
182
|
-
* A Row represents a single item in a Table and contains Cell elements for each column.
|
|
183
|
-
* Cells can be statically defined as children, or generated dynamically using a function
|
|
184
|
-
* based on the columns defined in the TableHeader.
|
|
185
|
-
*/
|
|
186
|
-
export let Row: <T>(props: RowProps<T>) => JSX.Element;
|
|
187
|
-
/**
|
|
188
|
-
* A Cell represents the value of a single Column within a Table Row.
|
|
189
|
-
*/
|
|
190
|
-
export let Cell: (props: CellProps) => JSX.Element;
|
|
191
|
-
export type { TableHeaderProps, TableBodyProps, ColumnProps, RowProps, CellProps } from '@react-types/table';
|
|
192
|
-
export { Section } from '@react-stately/collections';
|
|
193
|
-
|
|
194
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;ACqBA,mCAA0C,CAAC;IACzC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IACzE,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAA;CAC5E;AAED,+BAA+B,CAAC;IAC9B,eAAe,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IACxE,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3E,YAAY,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAa;IAC3C,eAAe,EAAE,GAAG,CAAC,GAAG,EAAE,MAA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AAEH,OAAA,IAAI,aAA8B,CAAC,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC;ACHjF;;;GAGG;AAEH,OAAA,IAAI,WAA0B,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC;ACgB3E;;;;GAIG;AAEH,OAAA,IAAI,QAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC;ACgClE;;;;GAIG;AAEH,OAAA,IAAI,KAAc,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC;ACrFzD;;GAEG;AAEH,OAAA,IAAI,MAAgB,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,OAAO,CAAC;ACxBtD,YAAY,EAAC,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAU3G,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAC","sources":["packages/@react-stately/table/src/packages/@react-stately/table/src/TableUtils.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/TableColumnLayout.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/TableCollection.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/useTableState.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/useTableColumnResizeState.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/useTreeGridState.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/TableHeader.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/TableBody.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/Column.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/Row.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/Cell.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {TableColumnResizeState, TableColumnResizeStateProps} from './useTableColumnResizeState';\nexport type {TableState, CollectionBuilderContext, TableStateProps} from './useTableState';\nexport type {TableHeaderProps, TableBodyProps, ColumnProps, RowProps, CellProps} from '@react-types/table';\nexport type {TreeGridState, TreeGridStateProps} from './useTreeGridState';\n\nexport {useTableColumnResizeState} from './useTableColumnResizeState';\nexport {useTableState, UNSTABLE_useFilteredTableState} from './useTableState';\nexport {TableHeader} from './TableHeader';\nexport {TableBody} from './TableBody';\nexport {Column} from './Column';\nexport {Row} from './Row';\nexport {Cell} from './Cell';\nexport {Section} from '@react-stately/collections';\nexport {TableCollection, buildHeaderRows} from './TableCollection';\nexport {TableColumnLayout} from './TableColumnLayout';\nexport {UNSTABLE_useTreeGridState} from './useTreeGridState';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|