@react-spectrum/s2 3.0.0-nightly-93c26d8bd-241028 → 3.0.0-nightly-07431f4b1-241030
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/Accordion.cjs +1 -1
- package/dist/Accordion.cjs.map +1 -1
- package/dist/Accordion.css.map +1 -1
- package/dist/Accordion.mjs +2 -2
- package/dist/Accordion.mjs.map +1 -1
- package/dist/ActionButton.cjs +10 -32
- package/dist/ActionButton.cjs.map +1 -1
- package/dist/ActionButton.css +20 -60
- package/dist/ActionButton.css.map +1 -1
- package/dist/ActionButton.mjs +10 -32
- package/dist/ActionButton.mjs.map +1 -1
- package/dist/Avatar.cjs +2 -4
- package/dist/Avatar.cjs.map +1 -1
- package/dist/Avatar.css +4 -16
- package/dist/Avatar.css.map +1 -1
- package/dist/Avatar.mjs +2 -4
- package/dist/Avatar.mjs.map +1 -1
- package/dist/Badge.cjs +5 -16
- package/dist/Badge.cjs.map +1 -1
- package/dist/Badge.css +10 -30
- package/dist/Badge.css.map +1 -1
- package/dist/Badge.mjs +5 -16
- package/dist/Badge.mjs.map +1 -1
- package/dist/Breadcrumbs.cjs +12 -41
- package/dist/Breadcrumbs.cjs.map +1 -1
- package/dist/Breadcrumbs.css +38 -86
- package/dist/Breadcrumbs.css.map +1 -1
- package/dist/Breadcrumbs.mjs +12 -41
- package/dist/Breadcrumbs.mjs.map +1 -1
- package/dist/Button.cjs +19 -59
- package/dist/Button.cjs.map +1 -1
- package/dist/Button.css +37 -113
- package/dist/Button.css.map +1 -1
- package/dist/Button.mjs +19 -59
- package/dist/Button.mjs.map +1 -1
- package/dist/Card.cjs +27 -67
- package/dist/Card.cjs.map +1 -1
- package/dist/Card.css +42 -117
- package/dist/Card.css.map +1 -1
- package/dist/Card.mjs +27 -67
- package/dist/Card.mjs.map +1 -1
- package/dist/Checkbox.cjs +9 -27
- package/dist/Checkbox.cjs.map +1 -1
- package/dist/Checkbox.css +17 -49
- package/dist/Checkbox.css.map +1 -1
- package/dist/Checkbox.mjs +9 -27
- package/dist/Checkbox.mjs.map +1 -1
- package/dist/CheckboxGroup.cjs +5 -16
- package/dist/CheckboxGroup.cjs.map +1 -1
- package/dist/CheckboxGroup.css +10 -30
- package/dist/CheckboxGroup.css.map +1 -1
- package/dist/CheckboxGroup.mjs +5 -16
- package/dist/CheckboxGroup.mjs.map +1 -1
- package/dist/ClearButton.cjs +6 -17
- package/dist/ClearButton.cjs.map +1 -1
- package/dist/ClearButton.css +11 -35
- package/dist/ClearButton.css.map +1 -1
- package/dist/ClearButton.mjs +6 -17
- package/dist/ClearButton.mjs.map +1 -1
- package/dist/CloseButton.cjs +10 -32
- package/dist/CloseButton.cjs.map +1 -1
- package/dist/CloseButton.css +20 -64
- package/dist/CloseButton.css.map +1 -1
- package/dist/CloseButton.mjs +10 -32
- package/dist/CloseButton.mjs.map +1 -1
- package/dist/ColorArea.cjs +4 -16
- package/dist/ColorArea.cjs.map +1 -1
- package/dist/ColorArea.css +8 -28
- package/dist/ColorArea.css.map +1 -1
- package/dist/ColorArea.mjs +4 -16
- package/dist/ColorArea.mjs.map +1 -1
- package/dist/ColorField.cjs +5 -16
- package/dist/ColorField.cjs.map +1 -1
- package/dist/ColorField.css +10 -30
- package/dist/ColorField.css.map +1 -1
- package/dist/ColorField.mjs +5 -16
- package/dist/ColorField.mjs.map +1 -1
- package/dist/ColorHandle.cjs +5 -15
- package/dist/ColorHandle.cjs.map +1 -1
- package/dist/ColorHandle.css +10 -30
- package/dist/ColorHandle.css.map +1 -1
- package/dist/ColorHandle.mjs +5 -15
- package/dist/ColorHandle.mjs.map +1 -1
- package/dist/ColorSlider.cjs +6 -17
- package/dist/ColorSlider.cjs.map +1 -1
- package/dist/ColorSlider.css +34 -50
- package/dist/ColorSlider.css.map +1 -1
- package/dist/ColorSlider.mjs +6 -17
- package/dist/ColorSlider.mjs.map +1 -1
- package/dist/ColorSwatch.cjs +8 -26
- package/dist/ColorSwatch.cjs.map +1 -1
- package/dist/ColorSwatch.css +16 -52
- package/dist/ColorSwatch.css.map +1 -1
- package/dist/ColorSwatch.mjs +8 -26
- package/dist/ColorSwatch.mjs.map +1 -1
- package/dist/ColorSwatchPicker.cjs +6 -16
- package/dist/ColorSwatchPicker.cjs.map +1 -1
- package/dist/ColorSwatchPicker.css +8 -28
- package/dist/ColorSwatchPicker.css.map +1 -1
- package/dist/ColorSwatchPicker.mjs +6 -16
- package/dist/ColorSwatchPicker.mjs.map +1 -1
- package/dist/ComboBox.cjs +22 -71
- package/dist/ComboBox.cjs.map +1 -1
- package/dist/ComboBox.css +64 -152
- package/dist/ComboBox.css.map +1 -1
- package/dist/ComboBox.mjs +22 -71
- package/dist/ComboBox.mjs.map +1 -1
- package/dist/ContextualHelp.cjs +1 -1
- package/dist/ContextualHelp.css +2 -6
- package/dist/ContextualHelp.css.map +1 -1
- package/dist/ContextualHelp.mjs +1 -1
- package/dist/Dialog.cjs +2 -2
- package/dist/Dialog.css +2 -2
- package/dist/Dialog.mjs +2 -2
- package/dist/Disclosure.cjs +34 -68
- package/dist/Disclosure.cjs.map +1 -1
- package/dist/Disclosure.css +55 -91
- package/dist/Disclosure.css.map +1 -1
- package/dist/Disclosure.mjs +36 -70
- package/dist/Disclosure.mjs.map +1 -1
- package/dist/DropZone.cjs +2 -4
- package/dist/DropZone.cjs.map +1 -1
- package/dist/DropZone.css +4 -16
- package/dist/DropZone.css.map +1 -1
- package/dist/DropZone.mjs +2 -4
- package/dist/DropZone.mjs.map +1 -1
- package/dist/Field.cjs +16 -47
- package/dist/Field.cjs.map +1 -1
- package/dist/Field.css +31 -95
- package/dist/Field.css.map +1 -1
- package/dist/Field.mjs +16 -47
- package/dist/Field.mjs.map +1 -1
- package/dist/IllustratedMessage.cjs +6 -20
- package/dist/IllustratedMessage.cjs.map +1 -1
- package/dist/IllustratedMessage.css +10 -24
- package/dist/IllustratedMessage.css.map +1 -1
- package/dist/IllustratedMessage.mjs +6 -20
- package/dist/IllustratedMessage.mjs.map +1 -1
- package/dist/Image.cjs +2 -2
- package/dist/Image.css +2 -2
- package/dist/Image.mjs +2 -2
- package/dist/InlineAlert.cjs +2 -5
- package/dist/InlineAlert.cjs.map +1 -1
- package/dist/InlineAlert.css +11 -15
- package/dist/InlineAlert.css.map +1 -1
- package/dist/InlineAlert.mjs +2 -5
- package/dist/InlineAlert.mjs.map +1 -1
- package/dist/Menu.cjs +22 -67
- package/dist/Menu.cjs.map +1 -1
- package/dist/Menu.css +32 -96
- package/dist/Menu.css.map +1 -1
- package/dist/Menu.mjs +22 -67
- package/dist/Menu.mjs.map +1 -1
- package/dist/Meter.cjs +22 -68
- package/dist/Meter.cjs.map +1 -1
- package/dist/Meter.css +63 -139
- package/dist/Meter.css.map +1 -1
- package/dist/Meter.mjs +22 -68
- package/dist/Meter.mjs.map +1 -1
- package/dist/Modal.cjs +2 -2
- package/dist/Modal.css +2 -2
- package/dist/Modal.mjs +2 -2
- package/dist/NumberField.cjs +23 -71
- package/dist/NumberField.cjs.map +1 -1
- package/dist/NumberField.css +63 -146
- package/dist/NumberField.css.map +1 -1
- package/dist/NumberField.mjs +23 -71
- package/dist/NumberField.mjs.map +1 -1
- package/dist/Picker.cjs +23 -67
- package/dist/Picker.cjs.map +1 -1
- package/dist/Picker.css +50 -130
- package/dist/Picker.css.map +1 -1
- package/dist/Picker.mjs +23 -67
- package/dist/Picker.mjs.map +1 -1
- package/dist/ProgressBar.cjs +23 -69
- package/dist/ProgressBar.cjs.map +1 -1
- package/dist/ProgressBar.css +64 -140
- package/dist/ProgressBar.css.map +1 -1
- package/dist/ProgressBar.mjs +23 -69
- package/dist/ProgressBar.mjs.map +1 -1
- package/dist/ProgressCircle.cjs +6 -20
- package/dist/ProgressCircle.cjs.map +1 -1
- package/dist/ProgressCircle.css +12 -40
- package/dist/ProgressCircle.css.map +1 -1
- package/dist/ProgressCircle.mjs +6 -20
- package/dist/ProgressCircle.mjs.map +1 -1
- package/dist/Provider.css +7 -0
- package/dist/Provider.css.map +1 -1
- package/dist/Radio.cjs +8 -26
- package/dist/Radio.cjs.map +1 -1
- package/dist/Radio.css +16 -48
- package/dist/Radio.css.map +1 -1
- package/dist/Radio.mjs +8 -26
- package/dist/Radio.mjs.map +1 -1
- package/dist/RadioGroup.cjs +5 -16
- package/dist/RadioGroup.cjs.map +1 -1
- package/dist/RadioGroup.css +10 -30
- package/dist/RadioGroup.css.map +1 -1
- package/dist/RadioGroup.mjs +5 -16
- package/dist/RadioGroup.mjs.map +1 -1
- package/dist/SearchField.cjs +5 -16
- package/dist/SearchField.cjs.map +1 -1
- package/dist/SearchField.css +10 -30
- package/dist/SearchField.css.map +1 -1
- package/dist/SearchField.mjs +5 -16
- package/dist/SearchField.mjs.map +1 -1
- package/dist/SegmentedControl.cjs +8 -14
- package/dist/SegmentedControl.cjs.map +1 -1
- package/dist/SegmentedControl.css +9 -29
- package/dist/SegmentedControl.css.map +1 -1
- package/dist/SegmentedControl.mjs +8 -14
- package/dist/SegmentedControl.mjs.map +1 -1
- package/dist/Slider.cjs +63 -196
- package/dist/Slider.cjs.map +1 -1
- package/dist/Slider.css +61 -181
- package/dist/Slider.css.map +1 -1
- package/dist/Slider.mjs +63 -196
- package/dist/Slider.mjs.map +1 -1
- package/dist/StatusLight.cjs +9 -27
- package/dist/StatusLight.cjs.map +1 -1
- package/dist/StatusLight.css +17 -49
- package/dist/StatusLight.css.map +1 -1
- package/dist/StatusLight.mjs +9 -27
- package/dist/StatusLight.mjs.map +1 -1
- package/dist/Switch.cjs +6 -15
- package/dist/Switch.cjs.map +1 -1
- package/dist/Switch.css +10 -26
- package/dist/Switch.css.map +1 -1
- package/dist/Switch.mjs +6 -15
- package/dist/Switch.mjs.map +1 -1
- package/dist/TableView.cjs +42 -86
- package/dist/TableView.cjs.map +1 -1
- package/dist/TableView.css +65 -129
- package/dist/TableView.css.map +1 -1
- package/dist/TableView.mjs +42 -86
- package/dist/TableView.mjs.map +1 -1
- package/dist/Tabs.cjs +4 -15
- package/dist/Tabs.cjs.map +1 -1
- package/dist/Tabs.css +18 -34
- package/dist/Tabs.css.map +1 -1
- package/dist/Tabs.mjs +4 -15
- package/dist/Tabs.mjs.map +1 -1
- package/dist/TagGroup.cjs +14 -37
- package/dist/TagGroup.cjs.map +1 -1
- package/dist/TagGroup.css +23 -67
- package/dist/TagGroup.css.map +1 -1
- package/dist/TagGroup.mjs +14 -37
- package/dist/TagGroup.mjs.map +1 -1
- package/dist/TextField.cjs +11 -34
- package/dist/TextField.cjs.map +1 -1
- package/dist/TextField.css +22 -66
- package/dist/TextField.css.map +1 -1
- package/dist/TextField.mjs +11 -34
- package/dist/TextField.mjs.map +1 -1
- package/dist/Tooltip.cjs +2 -4
- package/dist/Tooltip.cjs.map +1 -1
- package/dist/Tooltip.css +4 -12
- package/dist/Tooltip.css.map +1 -1
- package/dist/Tooltip.mjs +2 -4
- package/dist/Tooltip.mjs.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +17 -17
- package/page.css +7 -0
- package/src/Accordion.tsx +1 -1
- package/src/Disclosure.tsx +13 -7
- package/src/page.macro.ts +11 -0
- package/style/dist/spectrum-theme.cjs +2 -8
- package/style/dist/spectrum-theme.cjs.map +1 -1
- package/style/dist/spectrum-theme.mjs +2 -8
- package/style/dist/spectrum-theme.mjs.map +1 -1
- package/style/dist/types.d.ts +1 -4
- package/style/dist/types.d.ts.map +1 -1
- package/style/spectrum-theme.ts +4 -4
package/dist/TableView.mjs
CHANGED
|
@@ -55,7 +55,7 @@ function $parcel$interopDefault(a) {
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
let $0fcd5fb617970a1d$var$InternalTableContext = /*#__PURE__*/ (0, $auVFN$createContext)({});
|
|
58
|
-
const $0fcd5fb617970a1d$var$tableWrapper = " . oa
|
|
58
|
+
const $0fcd5fb617970a1d$var$tableWrapper = " . oa qa _Zd __Fa __R-yksgrp";
|
|
59
59
|
const $0fcd5fb617970a1d$var$table = function anonymous(props, overrides) {
|
|
60
60
|
let rules = " .";
|
|
61
61
|
let matches = (overrides || '').match(/(?:^|\s)(?:y|z|A|B|_9|_8|h|_5|_4|__A|__c|__d|__a|__b|U|__Q|X|Z|V|W|l|q|r|k|o|p)[^\s]+/g) || [];
|
|
@@ -68,16 +68,10 @@ const $0fcd5fb617970a1d$var$table = function anonymous(props, overrides) {
|
|
|
68
68
|
if (/^\s*o/.test(p)) $o = true;
|
|
69
69
|
if (/^\s*q/.test(p)) $q = true;
|
|
70
70
|
}
|
|
71
|
-
if (!$l) rules += '
|
|
71
|
+
if (!$l) rules += ' lG';
|
|
72
72
|
rules += ' __Da';
|
|
73
|
-
if (!$o)
|
|
74
|
-
|
|
75
|
-
rules += ' oa';
|
|
76
|
-
}
|
|
77
|
-
if (!$q) {
|
|
78
|
-
rules += ' qba';
|
|
79
|
-
rules += ' qa';
|
|
80
|
-
}
|
|
73
|
+
if (!$o) rules += ' oa';
|
|
74
|
+
if (!$q) rules += ' qa';
|
|
81
75
|
rules += ' _c-bc1l9oh';
|
|
82
76
|
rules += ' _c-1uotwbwg';
|
|
83
77
|
rules += ' _c-eo0c6sf';
|
|
@@ -100,25 +94,13 @@ const $0fcd5fb617970a1d$var$table = function anonymous(props, overrides) {
|
|
|
100
94
|
else rules += ' _Nb';
|
|
101
95
|
rules += ' _Lb';
|
|
102
96
|
if (props.isQuiet) rules += ' _va';
|
|
103
|
-
else
|
|
104
|
-
rules += ' _vb-1aa9md1';
|
|
105
|
-
rules += ' _v-6njx2e';
|
|
106
|
-
}
|
|
97
|
+
else rules += ' _v-ve8p9e';
|
|
107
98
|
if (props.isQuiet) rules += ' _wa';
|
|
108
|
-
else
|
|
109
|
-
rules += ' _wb-1aa9md1';
|
|
110
|
-
rules += ' _w-6njx2e';
|
|
111
|
-
}
|
|
99
|
+
else rules += ' _w-ve8p9e';
|
|
112
100
|
if (props.isQuiet) rules += ' _xa';
|
|
113
|
-
else
|
|
114
|
-
rules += ' _xb-1aa9md1';
|
|
115
|
-
rules += ' _x-6njx2e';
|
|
116
|
-
}
|
|
101
|
+
else rules += ' _x-ve8p9e';
|
|
117
102
|
if (props.isQuiet) rules += ' _ya';
|
|
118
|
-
else
|
|
119
|
-
rules += ' _yb-1aa9md1';
|
|
120
|
-
rules += ' _y-6njx2e';
|
|
121
|
-
}
|
|
103
|
+
else rules += ' _y-ve8p9e';
|
|
122
104
|
rules += ' Mj';
|
|
123
105
|
if (props.isCheckboxSelection) rules += ' Kl';
|
|
124
106
|
return rules;
|
|
@@ -295,7 +277,7 @@ function $0fcd5fb617970a1d$var$TableView(props, ref) {
|
|
|
295
277
|
})
|
|
296
278
|
});
|
|
297
279
|
}
|
|
298
|
-
const $0fcd5fb617970a1d$var$centeredWrapper = " . _Zd _1c _2d
|
|
280
|
+
const $0fcd5fb617970a1d$var$centeredWrapper = " . _Zd _1c _2d lG kG";
|
|
299
281
|
function $0fcd5fb617970a1d$var$TableBody(props, ref) {
|
|
300
282
|
let { items: items, renderEmptyState: renderEmptyState, children: children } = props;
|
|
301
283
|
let domRef = (0, $auVFN$useDOMRef)(ref);
|
|
@@ -304,7 +286,7 @@ function $0fcd5fb617970a1d$var$TableBody(props, ref) {
|
|
|
304
286
|
let renderer = children;
|
|
305
287
|
let stringFormatter = (0, $auVFN$useLocalizedStringFormatter)((0, ($parcel$interopDefault($auVFN$intlStringsmjs))), '@react-spectrum/s2');
|
|
306
288
|
let loadMoreSpinner = /*#__PURE__*/ (0, $auVFN$jsx)((0, $auVFN$UNSTABLE_TableLoadingIndicator), {
|
|
307
|
-
className: " .
|
|
289
|
+
className: " . kG lG",
|
|
308
290
|
children: /*#__PURE__*/ (0, $auVFN$jsx)("div", {
|
|
309
291
|
className: $0fcd5fb617970a1d$var$centeredWrapper,
|
|
310
292
|
children: /*#__PURE__*/ (0, $auVFN$jsx)((0, $41ddd91dbbf0c389$export$c79b9d6b4cc92af7), {
|
|
@@ -346,7 +328,7 @@ function $0fcd5fb617970a1d$var$TableBody(props, ref) {
|
|
|
346
328
|
return /*#__PURE__*/ (0, $auVFN$jsx)((0, $auVFN$TableBody), {
|
|
347
329
|
// @ts-ignore
|
|
348
330
|
ref: domRef,
|
|
349
|
-
className: " .
|
|
331
|
+
className: " . kG",
|
|
350
332
|
...props,
|
|
351
333
|
renderEmptyState: emptyRender,
|
|
352
334
|
dependencies: [
|
|
@@ -366,10 +348,7 @@ const $0fcd5fb617970a1d$var$cellFocus = {
|
|
|
366
348
|
outlineOffset: -2,
|
|
367
349
|
outlineWidth: 2,
|
|
368
350
|
outlineColor: 'focus-ring',
|
|
369
|
-
borderRadius:
|
|
370
|
-
"default": "[0.375rem]",
|
|
371
|
-
touch: "[0.46875rem]"
|
|
372
|
-
}
|
|
351
|
+
borderRadius: "[calc(0.375rem * var(--s2-scale))]"
|
|
373
352
|
};
|
|
374
353
|
function $0fcd5fb617970a1d$var$CellFocusRing() {
|
|
375
354
|
return /*#__PURE__*/ (0, $auVFN$jsx)("div", {
|
|
@@ -382,14 +361,10 @@ function $0fcd5fb617970a1d$var$CellFocusRing() {
|
|
|
382
361
|
rules += ' _Nc';
|
|
383
362
|
rules += ' da_____z';
|
|
384
363
|
rules += ' dx';
|
|
385
|
-
rules += '
|
|
386
|
-
rules += '
|
|
387
|
-
rules += '
|
|
388
|
-
rules += '
|
|
389
|
-
rules += ' _xb-1aa9md1';
|
|
390
|
-
rules += ' _x-6njx2e';
|
|
391
|
-
rules += ' _yb-1aa9md1';
|
|
392
|
-
rules += ' _y-6njx2e';
|
|
364
|
+
rules += ' _v-ve8p9e';
|
|
365
|
+
rules += ' _w-ve8p9e';
|
|
366
|
+
rules += ' _x-ve8p9e';
|
|
367
|
+
rules += ' _y-ve8p9e';
|
|
393
368
|
rules += ' Ua';
|
|
394
369
|
rules += ' Xa';
|
|
395
370
|
rules += ' Za';
|
|
@@ -495,7 +470,7 @@ const $0fcd5fb617970a1d$export$816b5d811295e6bc = /*#__PURE__*/ (0, $auVFN$forwa
|
|
|
495
470
|
})
|
|
496
471
|
});
|
|
497
472
|
});
|
|
498
|
-
const $0fcd5fb617970a1d$var$columnContentWrapper = " . qa
|
|
473
|
+
const $0fcd5fb617970a1d$var$columnContentWrapper = " . qa _Zd _1c lG";
|
|
499
474
|
const $0fcd5fb617970a1d$var$sortIcon = function anonymous(props) {
|
|
500
475
|
let rules = " .";
|
|
501
476
|
rules += ' l-1wikn8b';
|
|
@@ -527,7 +502,7 @@ function $0fcd5fb617970a1d$var$ColumnContents(props) {
|
|
|
527
502
|
children: sortDirection != null && (sortDirection === 'ascending' ? /*#__PURE__*/ (0, $auVFN$jsx)((0, $415c33109ddcfc45$export$2e2bcd8739ae039), {}) : /*#__PURE__*/ (0, $auVFN$jsx)((0, $5a632e895c21f138$export$2e2bcd8739ae039), {}))
|
|
528
503
|
}),
|
|
529
504
|
/*#__PURE__*/ (0, $auVFN$jsx)("span", {
|
|
530
|
-
className: " . __vb __wb _ma _pb
|
|
505
|
+
className: " . __vb __wb _ma _pb lG",
|
|
531
506
|
children: children
|
|
532
507
|
})
|
|
533
508
|
]
|
|
@@ -541,16 +516,12 @@ const $0fcd5fb617970a1d$var$resizableMenuButtonWrapper = function anonymous(prop
|
|
|
541
516
|
rules += ' _Nc';
|
|
542
517
|
rules += ' da_____z';
|
|
543
518
|
rules += ' dx';
|
|
544
|
-
rules += '
|
|
545
|
-
rules += '
|
|
546
|
-
rules += '
|
|
547
|
-
rules += '
|
|
548
|
-
rules += ' _xb-1aa9md1';
|
|
549
|
-
rules += ' _x-6njx2e';
|
|
550
|
-
rules += ' _yb-1aa9md1';
|
|
551
|
-
rules += ' _y-6njx2e';
|
|
519
|
+
rules += ' _v-ve8p9e';
|
|
520
|
+
rules += ' _w-ve8p9e';
|
|
521
|
+
rules += ' _x-ve8p9e';
|
|
522
|
+
rules += ' _y-ve8p9e';
|
|
552
523
|
rules += ' an';
|
|
553
|
-
rules += '
|
|
524
|
+
rules += ' lG';
|
|
554
525
|
rules += ' Uc';
|
|
555
526
|
rules += ' _Zd';
|
|
556
527
|
rules += ' _1c';
|
|
@@ -593,13 +564,11 @@ const $0fcd5fb617970a1d$var$resizerHandleContainer = function anonymous(props) {
|
|
|
593
564
|
if (props.isHovered) rules += ' _Za';
|
|
594
565
|
else if (props.isResizing) rules += ' _Za';
|
|
595
566
|
else rules += ' _Zj';
|
|
596
|
-
rules += '
|
|
597
|
-
rules += '
|
|
598
|
-
rules += ' k4';
|
|
567
|
+
rules += ' le';
|
|
568
|
+
rules += ' kG';
|
|
599
569
|
rules += ' Ua';
|
|
600
570
|
rules += ' Xa';
|
|
601
|
-
rules += '
|
|
602
|
-
rules += ' W-2al4ab';
|
|
571
|
+
rules += ' W-460fe7';
|
|
603
572
|
if (props.resizableDirection === "both") rules += ' __HD';
|
|
604
573
|
else if (props.resizableDirection === "right") rules += ' __Hz';
|
|
605
574
|
else if (props.resizableDirection === "left") rules += ' __Hx';
|
|
@@ -616,23 +585,17 @@ const $0fcd5fb617970a1d$var$resizerHandle = function anonymous(props) {
|
|
|
616
585
|
else if (props.isFocusVisible) rules += ' b-14crvkh';
|
|
617
586
|
else if (props.isHovered) rules += ' bi';
|
|
618
587
|
else rules += ' ba';
|
|
619
|
-
if (props.isResizing) rules += '
|
|
620
|
-
else rules += '
|
|
621
|
-
if (props.isResizing)
|
|
622
|
-
|
|
623
|
-
rules += ' l-59f7mn';
|
|
624
|
-
} else {
|
|
625
|
-
rules += ' lb-1332gxq';
|
|
626
|
-
rules += ' l-cplj4k';
|
|
627
|
-
}
|
|
588
|
+
if (props.isResizing) rules += ' kM';
|
|
589
|
+
else rules += ' kG';
|
|
590
|
+
if (props.isResizing) rules += ' l-3zuu7v';
|
|
591
|
+
else rules += ' l-1jgpkkw';
|
|
628
592
|
rules += ' Ua';
|
|
629
|
-
rules += '
|
|
630
|
-
rules += ' V-6njx2e';
|
|
593
|
+
rules += ' V-ve8p9e';
|
|
631
594
|
return rules;
|
|
632
595
|
};
|
|
633
596
|
const $0fcd5fb617970a1d$var$columnHeaderText = " . __vb __wb _ma _pb q-1wikn8b _9-3t1x _8-3t1y hF";
|
|
634
597
|
const $0fcd5fb617970a1d$var$chevronIcon = " . R-3hn0u yG ybH q-1wikn8b _8-3t1x -rwx0fg_e-b";
|
|
635
|
-
const $0fcd5fb617970a1d$var$nubbin = " . Ua Xa V-
|
|
598
|
+
const $0fcd5fb617970a1d$var$nubbin = " . Ua Xa V-9ah6ot l-1wikn8b k-1wikn8b e-14crvkh ea_____X -rwx0fg_e-A -rwx0fg_e-a_____Y";
|
|
636
599
|
function $0fcd5fb617970a1d$var$ResizableColumnContents(props) {
|
|
637
600
|
let { allowsSorting: allowsSorting, sortDirection: sortDirection, sort: sort, startResize: startResize, children: children, isHovered: isHovered, align: align } = props;
|
|
638
601
|
let { setIsInResizeMode: setIsInResizeMode, isInResizeMode: isInResizeMode } = (0, $auVFN$useContext)($0fcd5fb617970a1d$var$InternalTableContext);
|
|
@@ -718,7 +681,7 @@ function $0fcd5fb617970a1d$var$ResizableColumnContents(props) {
|
|
|
718
681
|
/*#__PURE__*/ (0, $auVFN$jsx)((0, $13afb0ea5f0ed767$export$d9b273488cd8ce6f), {
|
|
719
682
|
onAction: onMenuSelect,
|
|
720
683
|
items: items,
|
|
721
|
-
styles: " .
|
|
684
|
+
styles: " . qt",
|
|
722
685
|
children: (item)=>/*#__PURE__*/ (0, $auVFN$jsx)((0, $13afb0ea5f0ed767$export$2ce376c2cc3355c8), {
|
|
723
686
|
children: item?.label
|
|
724
687
|
})
|
|
@@ -762,7 +725,7 @@ function $0fcd5fb617970a1d$var$ResizerIndicator({ isFocusVisible: isFocusVisible
|
|
|
762
725
|
})
|
|
763
726
|
});
|
|
764
727
|
}
|
|
765
|
-
const $0fcd5fb617970a1d$var$tableHeader = " .
|
|
728
|
+
const $0fcd5fb617970a1d$var$tableHeader = " . kG lG bf A-yj899n";
|
|
766
729
|
const $0fcd5fb617970a1d$var$selectAllCheckbox = " . yf";
|
|
767
730
|
const $0fcd5fb617970a1d$var$selectAllCheckboxColumn = function anonymous(props) {
|
|
768
731
|
let rules = " .";
|
|
@@ -770,7 +733,7 @@ const $0fcd5fb617970a1d$var$selectAllCheckboxColumn = function anonymous(props)
|
|
|
770
733
|
rules += ' Fa';
|
|
771
734
|
rules += ' Ca';
|
|
772
735
|
rules += ' Da';
|
|
773
|
-
rules += '
|
|
736
|
+
rules += ' kG';
|
|
774
737
|
rules += ' __na';
|
|
775
738
|
rules += ' _La';
|
|
776
739
|
rules += ' Uc';
|
|
@@ -884,8 +847,8 @@ const $0fcd5fb617970a1d$var$cell = function anonymous(props) {
|
|
|
884
847
|
rules += ' F-1dbqcch';
|
|
885
848
|
rules += ' o-375tou';
|
|
886
849
|
rules += ' __na';
|
|
887
|
-
rules += '
|
|
888
|
-
rules += '
|
|
850
|
+
rules += ' kG';
|
|
851
|
+
rules += ' lG';
|
|
889
852
|
if (props.size === "XL") {
|
|
890
853
|
rules += ' _dbj';
|
|
891
854
|
rules += ' _di';
|
|
@@ -904,16 +867,9 @@ const $0fcd5fb617970a1d$var$cell = function anonymous(props) {
|
|
|
904
867
|
}
|
|
905
868
|
rules += ' _1c';
|
|
906
869
|
rules += ' _Zd';
|
|
907
|
-
if (props.density === "spacious")
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
} else if (props.density === "compact") {
|
|
911
|
-
rules += ' -_375tou_o-br';
|
|
912
|
-
rules += ' -_375tou_o-q';
|
|
913
|
-
} else {
|
|
914
|
-
rules += ' -_375tou_o-bu';
|
|
915
|
-
rules += ' -_375tou_o-r';
|
|
916
|
-
}
|
|
870
|
+
if (props.density === "spacious") rules += ' -_375tou_o-n';
|
|
871
|
+
else if (props.density === "compact") rules += ' -_375tou_o-j';
|
|
872
|
+
else rules += ' -_375tou_o-l';
|
|
917
873
|
rules += ' -_375tp0_u-a';
|
|
918
874
|
rules += ' -_375tp1_v-b';
|
|
919
875
|
return rules;
|
|
@@ -932,7 +888,7 @@ const $0fcd5fb617970a1d$var$cellContent = function anonymous(props) {
|
|
|
932
888
|
if (props.align === "end") rules += ' _jc';
|
|
933
889
|
else if (props.align === "center") rules += ' _jb';
|
|
934
890
|
else if (props.align === "start") rules += ' _ja';
|
|
935
|
-
rules += '
|
|
891
|
+
rules += ' lG';
|
|
936
892
|
rules += ' __Fa';
|
|
937
893
|
if (props.isSticky) rules += ' Ea';
|
|
938
894
|
else rules += ' Ec';
|
|
@@ -1009,7 +965,7 @@ const $0fcd5fb617970a1d$var$rowBackgroundColor = {
|
|
|
1009
965
|
};
|
|
1010
966
|
const $0fcd5fb617970a1d$var$row = function anonymous(props) {
|
|
1011
967
|
let rules = " .";
|
|
1012
|
-
rules += '
|
|
968
|
+
rules += ' kG';
|
|
1013
969
|
rules += ' Uc';
|
|
1014
970
|
rules += ' __na';
|
|
1015
971
|
rules += ' b-19jpv4m';
|
package/dist/TableView.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AAwGD,IAAI,2DAAuB,CAAA,GAAA,oBAAY,EAA2H,CAAC;AAEnK,MAAM;AAQN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCN,uBAAuB;AACvB,MAAM,8CAAwB;IAC5B,QAAQ;IACR,OAAO;AACT;AAEA,MAAM,oCAAc;IAClB,SAAS;QACP,QAAQ;QACR,OAAO;IACT;IACA,SAAS;QACP,QAAQ;QACR,OAAO;IACT;IACA,UAAU;QACR,QAAQ;QACR,OAAO;IACT;AACF;AAEO,MAAM,kDAAyB,CAAA,GAAA,2BAAmB;IACvD,YAAY,OAAO,CAAE;QACnB,KAAK,CAAC;YAAC,GAAG,OAAO;YAAE,cAAc;QAAE;IACrC;IAEU,eAAe,IAAiB,EAAW;QACnD,OAAO,KAAK,KAAK,CAAC,QAAQ;IAC5B;IAEU,kBAAgC;QACxC,IAAI,CAAC,QAAQ,KAAK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WAAW;QACX,WAAW,+CAAyB,mDAAmD;IACzF;IACA,cAAc;QACZ,SAAS;IACX;AACF;AAEA,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDN,SAAS,0BAAsB,MAAC,EAAE,WAAE,OAAO,YAAE,QAAQ,EAAE,GAAG,YAAwB,EAAE,GAA2B;IAC7G,IAAI,qBAAC,iBAAiB,iBAAE,aAAa,EAAC,GAAG,CAAA,GAAA,sBAAc;IACvD,IAAI,qBAAqB,CAAA,GAAA,iBAAS,EAAE;IACpC,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,iBAAC,CAAA,GAAA,UAAK;QACJ,aAAa;QACb,KAAK;QACL,IAAI;QACJ,WAAW,CAAA,cAAe,0BAAI;gBAC5B,GAAG,WAAW;gBACd,GAAG,kBAAkB;YACvB,KAAM,CAAA,YAAY,cAAc,IAAI,UAA0O;QAC7Q,GAAG,UAAU;;YACb,kBAAkB,UAAU,sBAAsB,0BACjD,gBAAC;gBAAK,QAAQ;gBAAC,WAAW;0BACxB,cAAA,gBAAC,CAAA,GAAA,yCAAO;oBAAE,YAAY;oBAAC,MAAK;;;0BAGhC,gBAAC,CAAA,GAAA,iBAAS;gBAAE,OAAO;0BAChB;;;;AAIT;AAEA;;CAEC,GACD,IAAI,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB;AAGxD;;CAEC,GACD,MAAM,yDAAa,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/TableView.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {\n Button,\n CellRenderProps,\n Collection,\n ColumnRenderProps,\n ColumnResizer,\n ContextValue,\n Key,\n Provider,\n Cell as RACCell,\n CellProps as RACCellProps,\n CheckboxContext as RACCheckboxContext,\n Column as RACColumn,\n ColumnProps as RACColumnProps,\n Row as RACRow,\n RowProps as RACRowProps,\n Table as RACTable,\n TableBody as RACTableBody,\n TableBodyProps as RACTableBodyProps,\n TableHeader as RACTableHeader,\n TableHeaderProps as RACTableHeaderProps,\n TableProps as RACTableProps,\n ResizableTableContainer,\n RowRenderProps,\n TableBodyRenderProps,\n TableRenderProps,\n UNSTABLE_TableLayout,\n UNSTABLE_TableLoadingIndicator,\n UNSTABLE_Virtualizer,\n useSlottedContext,\n useTableOptions\n} from 'react-aria-components';\nimport {centerPadding, getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {Checkbox} from './Checkbox';\nimport Chevron from '../ui-icons/Chevron';\nimport {colorMix, fontRelative, lightDark, size, style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {ColumnSize} from '@react-types/table';\nimport {DOMRef, DOMRefValue, forwardRefType, LoadingState, Node} from '@react-types/shared';\nimport {GridNode} from '@react-types/grid';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {LayoutNode} from '@react-stately/layout';\nimport {Menu, MenuItem, MenuTrigger} from './Menu';\nimport {mergeStyles} from '../style/runtime';\nimport Nubbin from '../ui-icons/S2_MoveHorizontalTableWidget.svg';\nimport {ProgressCircle} from './ProgressCircle';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, ReactNode, useCallback, useContext, useMemo, useRef, useState} from 'react';\nimport {Rect} from '@react-stately/virtualizer';\nimport SortDownArrow from '../s2wf-icons/S2_Icon_SortDown_20_N.svg';\nimport SortUpArrow from '../s2wf-icons/S2_Icon_SortUp_20_N.svg';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLoadMore} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useScale} from './utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\nimport {VisuallyHidden} from 'react-aria';\n\ninterface S2TableProps {\n /** Whether the Table should be displayed with a quiet style. */\n isQuiet?: boolean,\n /**\n * Sets the amount of vertical padding within each cell.\n * @default 'regular'\n */\n density?: 'compact' | 'spacious' | 'regular',\n /**\n * Sets the overflow behavior for the cell contents.\n * @default 'truncate'\n */\n overflowMode?: 'wrap' | 'truncate',\n // TODO: will we contine with onAction or rename to onRowAction like it is in RAC?\n /** Handler that is called when a user performs an action on a row. */\n onAction?: (key: Key) => void,\n /**\n * Handler that is called when a user starts a column resize.\n */\n onResizeStart?: (widths: Map<Key, ColumnSize>) => void,\n /**\n * Handler that is called when a user performs a column resize.\n * Can be used with the width property on columns to put the column widths into\n * a controlled state.\n */\n onResize?: (widths: Map<Key, ColumnSize>) => void,\n /**\n * Handler that is called after a user performs a column resize.\n * Can be used to store the widths of columns for another future session.\n */\n onResizeEnd?: (widths: Map<Key, ColumnSize>) => void,\n /** The current loading state of the table. */\n loadingState?: LoadingState,\n /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */\n onLoadMore?: () => any\n}\n\n// TODO: Note that loadMore and loadingState are now on the Table instead of on the TableBody\nexport interface TableViewProps extends Omit<RACTableProps, 'style' | 'disabledBehavior' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks'>, UnsafeStyles, S2TableProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight\n}\n\nlet InternalTableContext = createContext<TableViewProps & {layout?: S2TableLayout<unknown>, setIsInResizeMode?:(val: boolean) => void, isInResizeMode?: boolean}>({});\n\nconst tableWrapper = style({\n minHeight: 0,\n minWidth: 0,\n display: 'flex',\n isolation: 'isolate',\n disableTapHighlight: true\n});\n\nconst table = style<TableRenderProps & S2TableProps & {isCheckboxSelection?: boolean}>({\n width: 'full',\n userSelect: 'none',\n minHeight: 0,\n minWidth: 0,\n fontFamily: 'sans',\n fontWeight: 'normal',\n overflow: 'auto',\n backgroundColor: {\n default: 'gray-25',\n isQuiet: 'transparent',\n forcedColors: 'Background'\n },\n outlineColor: {\n default: 'gray-300',\n isFocusVisible: 'focus-ring',\n forcedColors: 'ButtonBorder'\n },\n outlineWidth: {\n default: 1,\n isQuiet: 0,\n isFocusVisible: 2\n },\n outlineStyle: 'solid',\n borderRadius: {\n default: size(6),\n isQuiet: 'none'\n },\n // Multiple browser bugs from scrollIntoView and scrollPadding:\n // Bug: Table doesn't scroll items into view perfectly in Chrome\n // https://issues.chromium.org/issues/365913982\n // Bug: Table scrolls to the left when navigating up/down through the checkboxes when body is scrolled to the right.\n // https://issues.chromium.org/issues/40067778\n // https://bugs.webkit.org/show_bug.cgi?id=272799\n // Base reproduction: https://codepen.io/lfdanlu/pen/zYVVGPW\n scrollPaddingTop: 32,\n scrollPaddingStart: {\n isCheckboxSelection: 40\n }\n}, getAllowedOverrides({height: true}));\n\n// component-height-100\nconst DEFAULT_HEADER_HEIGHT = {\n medium: 32,\n large: 40\n};\n\nconst ROW_HEIGHTS = {\n compact: {\n medium: 32, // table-row-height-medium-compact (aka component-height-100)\n large: 40\n },\n regular: {\n medium: 40, // table-row-height-medium-regular\n large: 50\n },\n spacious: {\n medium: 48, // table-row-height-medium-spacious\n large: 60\n }\n};\n\nexport class S2TableLayout<T> extends UNSTABLE_TableLayout<T> {\n constructor(options) {\n super({...options, loaderHeight: 60});\n }\n\n protected isStickyColumn(node: GridNode<T>): boolean {\n return node.props.isSticky;\n }\n\n protected buildCollection(): LayoutNode[] {\n let [header, body] = super.buildCollection();\n let {children, layoutInfo} = body;\n // TableLayout's buildCollection always sets the body width to the max width between the header width, but\n // we want the body to be sticky and only as wide as the table so it is always in view if loading/empty\n if (children?.length === 0) {\n layoutInfo.rect.width = this.virtualizer.visibleRect.width - 80;\n }\n\n return [\n header,\n body\n ];\n }\n\n protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {\n let layoutNode = super.buildLoader(node, x, y);\n let {layoutInfo} = layoutNode;\n layoutInfo.allowOverflow = true;\n layoutInfo.rect.width = this.virtualizer.visibleRect.width;\n layoutInfo.isSticky = true;\n return layoutNode;\n }\n\n protected buildBody(y: number): LayoutNode {\n let layoutNode = super.buildBody(y);\n let {children, layoutInfo} = layoutNode;\n // Needs overflow for sticky loader\n layoutInfo.allowOverflow = true;\n // If loading or empty, we'll want the body to be sticky and centered\n if (children?.length === 0) {\n layoutInfo.rect = new Rect(40, 40, this.virtualizer.visibleRect.width - 80, this.virtualizer.visibleRect.height - 80);\n layoutInfo.isSticky = true;\n }\n\n return {...layoutNode, layoutInfo};\n }\n\n protected buildRow(node: GridNode<T>, x: number, y: number): LayoutNode {\n let layoutNode = super.buildRow(node, x, y);\n layoutNode.layoutInfo.allowOverflow = true;\n // Needs overflow for sticky selection/drag cells\n return layoutNode;\n }\n\n protected buildTableHeader(): LayoutNode {\n let layoutNode = super.buildTableHeader();\n // Needs overflow for sticky selection/drag column\n layoutNode.layoutInfo.allowOverflow = true;\n return layoutNode;\n }\n\n protected buildColumn(node: GridNode<T>, x: number, y: number): LayoutNode {\n let layoutNode = super.buildColumn(node, x, y);\n // Needs overflow for the resize handle\n layoutNode.layoutInfo.allowOverflow = true;\n return layoutNode;\n }\n}\n\nexport const TableContext = createContext<ContextValue<TableViewProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction TableView(props: TableViewProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TableContext);\n let {\n UNSAFE_style,\n UNSAFE_className,\n isQuiet = false,\n density = 'regular',\n overflowMode = 'truncate',\n styles,\n loadingState,\n onLoadMore,\n onResize: propsOnResize,\n onResizeStart: propsOnResizeStart,\n onResizeEnd: propsOnResizeEnd,\n onAction,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let scale = useScale();\n let layout = useMemo(() => {\n return new S2TableLayout({\n rowHeight: overflowMode === 'wrap'\n ? undefined\n : ROW_HEIGHTS[density][scale],\n estimatedRowHeight: overflowMode === 'wrap'\n ? ROW_HEIGHTS[density][scale]\n : undefined,\n // No need for estimated headingHeight since the headers aren't affected by overflow mode: wrap\n headingHeight: DEFAULT_HEADER_HEIGHT[scale]\n });\n }, [overflowMode, density, scale]);\n\n // Starts when the user selects resize from the menu, ends when resizing ends\n // used to control the visibility of the resizer Nubbin\n let [isInResizeMode, setIsInResizeMode] = useState(false);\n let onResizeStart = useCallback((widths) => {\n propsOnResizeStart?.(widths);\n }, [propsOnResizeStart]);\n let onResizeEnd = useCallback((widths) => {\n setIsInResizeMode(false);\n propsOnResizeEnd?.(widths);\n }, [propsOnResizeEnd, setIsInResizeMode]);\n\n let context = useMemo(() => ({\n isQuiet,\n density,\n overflowMode,\n loadingState,\n isInResizeMode,\n setIsInResizeMode\n }), [isQuiet, density, overflowMode, loadingState, isInResizeMode, setIsInResizeMode]);\n\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n let scrollRef = useRef(null);\n let memoedLoadMoreProps = useMemo(() => ({\n isLoading: isLoading,\n onLoadMore\n }), [isLoading, onLoadMore]);\n useLoadMore(memoedLoadMoreProps, scrollRef);\n let isCheckboxSelection = props.selectionMode === 'multiple' || props.selectionMode === 'single';\n\n return (\n <ResizableTableContainer\n // TODO: perhaps this ref should be attached to the RACTable but it expects a table type ref which isn't true in the virtualized case\n ref={domRef}\n onResize={propsOnResize}\n onResizeEnd={onResizeEnd}\n onResizeStart={onResizeStart}\n className={(UNSAFE_className || '') + mergeStyles(tableWrapper, styles)}\n style={UNSAFE_style}>\n <UNSTABLE_Virtualizer layout={layout}>\n <InternalTableContext.Provider value={context}>\n <RACTable\n ref={scrollRef}\n // Fix webkit bug where scrollbars appear above the checkboxes/other table elements\n style={{WebkitTransform: 'translateZ(0)'}}\n className={renderProps => table({\n ...renderProps,\n isCheckboxSelection,\n isQuiet\n })}\n selectionBehavior=\"toggle\"\n onRowAction={onAction}\n {...otherProps} />\n </InternalTableContext.Provider>\n </UNSTABLE_Virtualizer>\n </ResizableTableContainer>\n );\n}\n\nconst centeredWrapper = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 'full',\n height: 'full'\n});\n\nexport interface TableBodyProps<T> extends Omit<RACTableBodyProps<T>, 'style' | 'className' | 'dependencies'> {}\n\nfunction TableBody<T extends object>(props: TableBodyProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {items, renderEmptyState, children} = props;\n let domRef = useDOMRef(ref);\n let {loadingState} = useContext(InternalTableContext);\n let emptyRender;\n let renderer = children;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let loadMoreSpinner = (\n <UNSTABLE_TableLoadingIndicator className={style({height: 'full', width: 'full'})}>\n <div className={centeredWrapper}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('table.loadingMore')} />\n </div>\n </UNSTABLE_TableLoadingIndicator>\n );\n\n // If the user is rendering their rows in dynamic fashion, wrap their render function in Collection so we can inject\n // the loader. Otherwise it is a static renderer and thus we can simply add the table loader after\n // TODO: this assumes that the user isn't providing their children in some wrapper though and/or isn't doing a map of children\n // (though I guess they wouldn't provide items then so the check for this is still valid in the latter case)...\n if (typeof children === 'function' && items) {\n renderer = (\n <>\n <Collection items={items}>\n {children}\n </Collection>\n {loadingState === 'loadingMore' && loadMoreSpinner}\n </>\n );\n } else {\n renderer = (\n <>\n {children}\n {loadingState === 'loadingMore' && loadMoreSpinner}\n </>\n );\n }\n\n if (renderEmptyState != null && loadingState !== 'loading') {\n emptyRender = (props: TableBodyRenderProps) => (\n <div className={centeredWrapper}>\n {renderEmptyState(props)}\n </div>\n );\n } else if (loadingState === 'loading') {\n emptyRender = () => (\n <div className={centeredWrapper}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('table.loading')} />\n </div>\n );\n }\n\n return (\n <RACTableBody\n // @ts-ignore\n ref={domRef}\n className={style({height: 'full'})}\n {...props}\n renderEmptyState={emptyRender}\n dependencies={[loadingState]}>\n {renderer}\n </RACTableBody>\n );\n}\n\n/**\n * The body of a `<Table>`, containing the table rows.\n */\nlet _TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(TableBody);\nexport {_TableBody as TableBody};\n\nconst cellFocus = {\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineOffset: -2,\n outlineWidth: 2,\n outlineColor: 'focus-ring',\n borderRadius: size(6)\n} as const;\n\nfunction CellFocusRing() {\n return <div role=\"presentation\" className={style({...cellFocus, position: 'absolute', inset: 0})({isFocusVisible: true})} />;\n}\n\nconst columnStyles = style({\n height: '[inherit]',\n boxSizing: 'border-box',\n color: {\n default: 'neutral',\n forcedColors: 'ButtonText'\n },\n paddingX: {\n default: 16,\n isColumnResizable: 0\n },\n textAlign: {\n align: {\n start: 'start',\n center: 'center',\n end: 'end'\n }\n },\n outlineStyle: 'none',\n position: 'relative',\n fontSize: 'control',\n fontFamily: 'sans',\n fontWeight: 'bold',\n display: 'flex',\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n },\n borderTopWidth: {\n default: 0,\n isQuiet: 1\n },\n borderBottomWidth: 1,\n borderStartWidth: 0,\n borderEndWidth: {\n default: 0,\n isColumnResizable: 1\n },\n borderStyle: 'solid',\n forcedColorAdjust: 'none'\n});\n\nexport interface ColumnProps extends RACColumnProps {\n /** Whether the column should render a divider between it and the next column. */\n showDivider?: boolean,\n /** Whether the column allows resizing. */\n allowsResizing?: boolean,\n /**\n * The alignment of the column's contents relative to its allotted width.\n * @default 'start'\n */\n align?: 'start' | 'center' | 'end',\n /** The content to render as the column header. */\n children: ReactNode\n}\n\n/**\n * A column within a `<Table>`.\n */\nexport const Column = forwardRef(function Column(props: ColumnProps, ref: DOMRef<HTMLDivElement>) {\n let {isHeaderRowHovered} = useContext(InternalTableHeaderContext);\n let {isQuiet} = useContext(InternalTableContext);\n let {allowsResizing, children, align = 'start'} = props;\n let domRef = useDOMRef(ref);\n let isColumnResizable = allowsResizing;\n\n return (\n <RACColumn {...props} ref={domRef} style={{borderInlineEndColor: 'transparent'}} className={renderProps => columnStyles({...renderProps, isColumnResizable, align, isQuiet})}>\n {({allowsSorting, sortDirection, isFocusVisible, sort, startResize, isHovered}) => (\n <>\n {/* Note this is mainly for column's without a dropdown menu. If there is a dropdown menu, the button is styled to have a focus ring for simplicity\n (no need to juggle showing this focus ring if focus is on the menu button and not if it is on the resizer) */}\n {/* Separate absolutely positioned element because appyling the ring on the column directly via outline means the ring's required borderRadius will cause the bottom gray border to curve as well */}\n {isFocusVisible && <CellFocusRing />}\n {isColumnResizable ?\n (\n <ResizableColumnContents allowsSorting={allowsSorting} sortDirection={sortDirection} sort={sort} startResize={startResize} isHovered={isHeaderRowHovered || isHovered} align={align}>\n {children}\n </ResizableColumnContents>\n ) : (\n <ColumnContents allowsSorting={allowsSorting} sortDirection={sortDirection}>\n {children}\n </ColumnContents>\n )\n }\n </>\n )}\n </RACColumn>\n );\n});\n\nconst columnContentWrapper = style({\n minWidth: 0,\n display: 'flex',\n alignItems: 'center',\n width: 'full'\n});\n\nconst sortIcon = style({\n size: fontRelative(16),\n flexShrink: 0,\n marginEnd: {\n default: 8,\n isButton: 'text-to-visual'\n },\n verticalAlign: {\n default: 'bottom',\n isButton: 0\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\ninterface ColumnContentProps extends Pick<ColumnRenderProps, 'allowsSorting' | 'sortDirection'>, Pick<ColumnProps, 'children'> {}\n\nfunction ColumnContents(props: ColumnContentProps) {\n let {allowsSorting, sortDirection, children} = props;\n\n return (\n <div className={columnContentWrapper}>\n {allowsSorting && (\n <Provider\n values={[\n [IconContext, {\n styles: sortIcon({})\n }]\n ]}>\n {sortDirection != null && (\n sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />\n )}\n </Provider>\n )}\n <span className={style({truncate: true, width: 'full'})}>\n {children}\n </span>\n </div>\n );\n}\n\nconst resizableMenuButtonWrapper = style({\n ...cellFocus,\n color: 'gray-800', // body-color\n width: 'full',\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: {\n align: {\n default: 'start',\n center: 'center',\n end: 'end'\n }\n },\n // TODO: when align: end, the dropdown arrow is misaligned with the text, not sure how best to make the svg be flush with the end of the button other than modifying the\n // paddingEnd\n paddingX: 16,\n backgroundColor: 'transparent',\n borderStyle: 'none',\n fontSize: 'control',\n fontFamily: 'sans',\n fontWeight: 'bold'\n});\n\nconst resizerHandleContainer = style({\n display: {\n default: 'none',\n isResizing: 'block',\n isHovered: 'block'\n },\n width: 12,\n height: 'full',\n position: 'absolute',\n top: 0,\n insetEnd: size(-6),\n cursor: {\n default: 'none',\n resizableDirection: {\n 'left': 'e-resize',\n 'right': 'w-resize',\n 'both': 'ew-resize'\n }\n }\n});\n\nconst resizerHandle = style({\n backgroundColor: {\n default: 'transparent',\n isHovered: 'gray-300',\n isFocusVisible: lightDark('informative-900', 'informative-700'), // --spectrum-informative-background-color-default, can't use `informative` because that will use the focusVisible version\n isResizing: lightDark('informative-900', 'informative-700'),\n forcedColors: {\n default: 'Background',\n isHovered: 'ButtonBorder',\n isFocusVisible: 'Highlight',\n isResizing: 'Highlight'\n }\n },\n height: {\n default: 'full',\n isResizing: 'screen'\n },\n width: {\n default: size(1),\n isResizing: size(2)\n },\n position: 'absolute',\n insetStart: size(6)\n});\n\nconst columnHeaderText = style({\n truncate: true,\n // Make it so the text doesn't completely disappear when column is resized to smallest width + both sort and chevron icon is rendered\n minWidth: fontRelative(16),\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto'\n});\n\nconst chevronIcon = style({\n rotate: 90,\n marginStart: 'text-to-visual',\n minWidth: fontRelative(16),\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst nubbin = style({\n position: 'absolute',\n top: 0,\n insetStart: size(-1),\n size: fontRelative(16),\n fill: {\n default: lightDark('informative-900', 'informative-700'), // --spectrum-informative-background-color-default, can't use `informative` because that won't be the background color value\n forcedColors: 'Highlight'\n },\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'white',\n forcedColors: 'HighlightText'\n }\n }\n});\n\ninterface ResizableColumnContentProps extends Pick<ColumnRenderProps, 'allowsSorting' | 'sort' | 'sortDirection' | 'startResize' | 'isHovered'>, Pick<ColumnProps, 'align' | 'children'> {}\n\nfunction ResizableColumnContents(props: ResizableColumnContentProps) {\n let {allowsSorting, sortDirection, sort, startResize, children, isHovered, align} = props;\n let {setIsInResizeMode, isInResizeMode} = useContext(InternalTableContext);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n const onMenuSelect = (key) => {\n switch (key) {\n case 'sort-asc':\n sort('ascending');\n break;\n case 'sort-desc':\n sort('descending');\n break;\n case 'resize':\n setIsInResizeMode?.(true);\n startResize();\n break;\n }\n };\n\n let items = useMemo(() => {\n let options = [\n {\n label: stringFormatter.format('table.resizeColumn'),\n id: 'resize'\n }\n ];\n if (allowsSorting) {\n options = [\n {\n label: stringFormatter.format('table.sortAscending'),\n id: 'sort-asc'\n },\n {\n label: stringFormatter.format('table.sortDescending'),\n id: 'sort-desc'\n },\n ...options\n ];\n }\n return options;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [allowsSorting]);\n\n let buttonAlignment = 'start';\n let menuAlign = 'start' as 'start' | 'end';\n if (align === 'center') {\n buttonAlignment = 'center';\n } else if (align === 'end') {\n buttonAlignment = 'end';\n menuAlign = 'end';\n }\n\n return (\n <>\n <MenuTrigger align={menuAlign}>\n <Button className={(renderProps) => resizableMenuButtonWrapper({...renderProps, align: buttonAlignment})}>\n {allowsSorting && (\n <Provider\n values={[\n [IconContext, {\n styles: sortIcon({isButton: true})\n }]\n ]}>\n {sortDirection != null && (\n sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />\n )}\n </Provider>\n )}\n <div className={columnHeaderText}>\n {children}\n </div>\n <Chevron size=\"M\" className={chevronIcon} />\n </Button>\n <Menu onAction={onMenuSelect} items={items} styles={style({minWidth: 128})}>\n {(item) => <MenuItem>{item?.label}</MenuItem>}\n </Menu>\n </MenuTrigger>\n <div data-react-aria-prevent-focus=\"true\">\n <ColumnResizer data-react-aria-prevent-focus=\"true\" className={({resizableDirection, isResizing}) => resizerHandleContainer({resizableDirection, isResizing, isHovered: isInResizeMode || isHovered})}>\n {({isFocusVisible, isResizing}) => (\n <>\n <ResizerIndicator isInResizeMode={isInResizeMode} isFocusVisible={isFocusVisible} isHovered={isHovered} isResizing={isResizing} />\n {(isFocusVisible || isInResizeMode) && isResizing && <div className={nubbin}><Nubbin /></div>}\n </>\n )}\n </ColumnResizer>\n </div>\n </>\n );\n}\n\nfunction ResizerIndicator({isFocusVisible, isHovered, isResizing, isInResizeMode}) {\n return (\n <div className={resizerHandle({isFocusVisible, isHovered: isHovered || isInResizeMode, isResizing})} />\n );\n}\n\nconst tableHeader = style({\n height: 'full',\n width: 'full',\n backgroundColor: 'gray-75',\n // Attempt to prevent 1px area where you can see scrolled cell content between the table outline and the table header\n marginTop: '[-1px]'\n});\n\nconst selectAllCheckbox = style({\n marginStart: 16 // table-edge-to-content, same between mobile and desktop\n});\n\nconst selectAllCheckboxColumn = style({\n padding: 0,\n height: 'full',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n position: 'relative',\n alignContent: 'center',\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n },\n borderXWidth: 0,\n borderTopWidth: {\n default: 0,\n isQuiet: 1\n },\n borderBottomWidth: 1,\n borderStyle: 'solid',\n backgroundColor: 'gray-75'\n});\n\nlet InternalTableHeaderContext = createContext<{isHeaderRowHovered?: boolean}>({isHeaderRowHovered: false});\n\nexport interface TableHeaderProps<T> extends Omit<RACTableHeaderProps<T>, 'style' | 'className' | 'dependencies' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd'> {}\n\nfunction TableHeader<T extends object>({columns, children}: TableHeaderProps<T>, ref: DOMRef<HTMLDivElement>) {\n let scale = useScale();\n let {selectionBehavior, selectionMode} = useTableOptions();\n let {isQuiet} = useContext(InternalTableContext);\n let [isHeaderRowHovered, setHeaderRowHovered] = useState(false);\n let domRef = useDOMRef(ref);\n\n return (\n <InternalTableHeaderContext.Provider value={{isHeaderRowHovered}}>\n <RACTableHeader\n // @ts-ignore\n ref={domRef}\n onHoverChange={setHeaderRowHovered}\n className={tableHeader}>\n {/* Add extra columns for selection. */}\n {selectionBehavior === 'toggle' && (\n // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later\n // @ts-ignore\n <RACColumn isSticky width={scale === 'medium' ? 40 : 52} minWidth={scale === 'medium' ? 40 : 52} className={selectAllCheckboxColumn({isQuiet})}>\n {({isFocusVisible}) => (\n <>\n {selectionMode === 'single' &&\n <>\n {isFocusVisible && <CellFocusRing />}\n <VisuallyHiddenSelectAllLabel />\n </>\n }\n {selectionMode === 'multiple' &&\n <Checkbox isEmphasized styles={selectAllCheckbox} slot=\"selection\" />\n }\n </>\n )}\n </RACColumn>\n )}\n <Collection items={columns}>\n {children}\n </Collection>\n </RACTableHeader>\n </InternalTableHeaderContext.Provider>\n );\n}\n\n/**\n * A header within a `<Table>`, containing the table columns.\n */\nlet _TableHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(TableHeader);\nexport {_TableHeader as TableHeader};\n\nfunction VisuallyHiddenSelectAllLabel() {\n let checkboxProps = useSlottedContext(RACCheckboxContext, 'selection');\n\n return (\n <VisuallyHidden>{checkboxProps?.['aria-label']}</VisuallyHidden>\n );\n}\n\nconst commonCellStyles = {\n borderColor: 'transparent',\n borderBottomWidth: 1,\n borderTopWidth: 0,\n borderXWidth: 0,\n borderStyle: 'solid',\n position: 'relative',\n color: {\n default: 'gray-800',\n forcedColors: 'ButtonText'\n },\n outlineStyle: 'none',\n paddingX: 16 // table-edge-to-content\n} as const;\n\nconst cell = style<CellRenderProps & S2TableProps & {isDivider: boolean}>({\n ...commonCellStyles,\n color: 'neutral',\n paddingY: centerPadding(),\n minHeight: {\n default: 40,\n density: {\n compact: 32,\n spacious: 48\n }\n },\n boxSizing: 'border-box',\n height: 'full',\n width: 'full',\n fontSize: 'control',\n alignItems: 'center',\n display: 'flex',\n borderStyle: {\n default: 'none',\n isDivider: 'solid'\n },\n borderEndWidth: {\n default: 0,\n isDivider: 1\n },\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n }\n});\n\nconst stickyCell = {\n backgroundColor: 'gray-25'\n} as const;\n\nconst checkboxCellStyle = style({\n ...commonCellStyles,\n ...stickyCell,\n paddingStart: 16,\n alignContent: 'center',\n height: '[calc(100% - 1px)]',\n borderBottomWidth: 0,\n backgroundColor: '--rowBackgroundColor'\n});\n\nconst cellContent = style({\n truncate: true,\n whiteSpace: {\n default: 'nowrap',\n overflowMode: {\n wrap: 'normal'\n }\n },\n textAlign: {\n align: {\n start: 'start',\n center: 'center',\n end: 'end'\n }\n },\n width: 'full',\n isolation: 'isolate',\n padding: {\n default: 4,\n isSticky: 0\n },\n margin: {\n default: -4,\n isSticky: 0\n },\n backgroundColor: {\n default: 'transparent',\n isSticky: '--rowBackgroundColor'\n }\n});\n\nexport interface CellProps extends RACCellProps, Pick<ColumnProps, 'align' | 'showDivider'> {\n /** @private */\n isSticky?: boolean,\n /** The content to render as the cell children. */\n children: ReactNode\n}\n\n/**\n * A cell within a table row.\n */\nexport const Cell = forwardRef(function Cell(props: CellProps, ref: DOMRef<HTMLDivElement>) {\n let {children, isSticky, showDivider = false, align, textValue, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let tableVisualOptions = useContext(InternalTableContext);\n textValue ||= typeof children === 'string' ? children : undefined;\n\n return (\n <RACCell\n ref={domRef}\n // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later\n // @ts-ignore\n isSticky={isSticky}\n className={renderProps => cell({\n ...renderProps,\n ...tableVisualOptions,\n isDivider: showDivider\n })}\n textValue={textValue}\n {...otherProps}>\n {({isFocusVisible}) => (\n <>\n {isFocusVisible && <CellFocusRing />}\n <span className={cellContent({...tableVisualOptions, isSticky, align: align || 'start'})}>{children}</span>\n </>\n )}\n </RACCell>\n );\n});\n\n// Use color-mix instead of transparency so sticky cells work correctly.\nconst selectedBackground = lightDark(colorMix('gray-25', 'informative-900', 10), colorMix('gray-25', 'informative-700', 10));\nconst selectedActiveBackground = lightDark(colorMix('gray-25', 'informative-900', 15), colorMix('gray-25', 'informative-700', 15));\nconst rowBackgroundColor = {\n default: {\n default: 'gray-25',\n isQuiet: '--s2-container-bg'\n },\n isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color\n isHovered: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color\n isPressed: colorMix('gray-25', 'gray-900', 10), // table-row-hover-color\n isSelected: {\n default: selectedBackground, // table-selected-row-background-color, opacity /10\n isFocusVisibleWithin: selectedActiveBackground, // table-selected-row-background-color, opacity /15\n isHovered: selectedActiveBackground, // table-selected-row-background-color, opacity /15\n isPressed: selectedActiveBackground // table-selected-row-background-color, opacity /15\n },\n forcedColors: {\n default: 'Background'\n }\n} as const;\n\nconst row = style<RowRenderProps & S2TableProps>({\n height: 'full',\n position: 'relative',\n boxSizing: 'border-box',\n backgroundColor: '--rowBackgroundColor',\n '--rowBackgroundColor': {\n type: 'backgroundColor',\n value: rowBackgroundColor\n },\n '--rowFocusIndicatorColor': {\n type: 'outlineColor',\n value: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n }\n },\n // TODO: outline here is to emulate v3 forcedColors experience but runs into the same problem where the sticky column covers the outline\n // This doesn't quite work because it gets cut off by the checkbox cell background masking element, figure out another way. Could shrink the checkbox cell's content even more\n // and offset it by margin top but that messes up the checkbox centering a bit\n // outlineWidth: {\n // forcedColors: {\n // isFocusVisible: 2\n // }\n // },\n // outlineOffset: {\n // forcedColors: {\n // isFocusVisible: -1\n // }\n // },\n // outlineColor: {\n // forcedColors: {\n // isFocusVisible: 'ButtonBorder'\n // }\n // },\n // outlineStyle: {\n // default: 'none',\n // forcedColors: {\n // isFocusVisible: 'solid'\n // }\n // },\n outlineStyle: 'none',\n borderTopWidth: 0,\n borderBottomWidth: 1,\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n },\n forcedColorAdjust: 'none'\n});\n\nexport interface RowProps<T> extends Pick<RACRowProps<T>, 'id' | 'columns' | 'children' | 'textValue'> {}\n\nfunction Row<T extends object>({id, columns, children, ...otherProps}: RowProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {selectionBehavior, selectionMode} = useTableOptions();\n let tableVisualOptions = useContext(InternalTableContext);\n let domRef = useDOMRef(ref);\n\n return (\n <RACRow\n // @ts-ignore\n ref={domRef}\n id={id}\n className={renderProps => row({\n ...renderProps,\n ...tableVisualOptions\n }) + (renderProps.isFocusVisible && ' ' + raw('&:before { content: \"\"; display: inline-block; position: sticky; inset-inline-start: 0; width: 3px; height: 100%; margin-inline-end: -3px; margin-block-end: 1px; z-index: 3; background-color: var(--rowFocusIndicatorColor)'))}\n {...otherProps}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n <Cell isSticky className={checkboxCellStyle}>\n <Checkbox isEmphasized slot=\"selection\" />\n </Cell>\n )}\n <Collection items={columns}>\n {children}\n </Collection>\n </RACRow>\n );\n}\n\n/**\n * A row within a `<Table>`.\n */\nlet _Row = /*#__PURE__*/ (forwardRef as forwardRefType)(Row);\nexport {_Row as Row};\n\n/**\n * Tables are containers for displaying information. They allow users to quickly scan, sort, compare, and take action on large amounts of data.\n */\nconst _TableView = forwardRef(TableView);\nexport {_TableView as TableView};\n"],"names":[],"version":3,"file":"TableView.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AAwGD,IAAI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;oBAAE,YAAY;oBAAC,MAAK;;;0BAGhC,gBAAC,CAAA,GAAA,iBAAS;gBAAE,OAAO;0BAChB;;;;AAIT;AAEA;;CAEC,GACD,IAAI,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB;AAGxD;;CAEC,GACD,MAAM,yDAAa,CAAA,GAAA,iBAAS,EAAE","sources":["packages/@react-spectrum/s2/src/TableView.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 {\n Button,\n CellRenderProps,\n Collection,\n ColumnRenderProps,\n ColumnResizer,\n ContextValue,\n Key,\n Provider,\n Cell as RACCell,\n CellProps as RACCellProps,\n CheckboxContext as RACCheckboxContext,\n Column as RACColumn,\n ColumnProps as RACColumnProps,\n Row as RACRow,\n RowProps as RACRowProps,\n Table as RACTable,\n TableBody as RACTableBody,\n TableBodyProps as RACTableBodyProps,\n TableHeader as RACTableHeader,\n TableHeaderProps as RACTableHeaderProps,\n TableProps as RACTableProps,\n ResizableTableContainer,\n RowRenderProps,\n TableBodyRenderProps,\n TableRenderProps,\n UNSTABLE_TableLayout,\n UNSTABLE_TableLoadingIndicator,\n UNSTABLE_Virtualizer,\n useSlottedContext,\n useTableOptions\n} from 'react-aria-components';\nimport {centerPadding, getAllowedOverrides, StylesPropWithHeight, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {Checkbox} from './Checkbox';\nimport Chevron from '../ui-icons/Chevron';\nimport {colorMix, fontRelative, lightDark, size, style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {ColumnSize} from '@react-types/table';\nimport {DOMRef, DOMRefValue, forwardRefType, LoadingState, Node} from '@react-types/shared';\nimport {GridNode} from '@react-types/grid';\nimport {IconContext} from './Icon';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {LayoutNode} from '@react-stately/layout';\nimport {Menu, MenuItem, MenuTrigger} from './Menu';\nimport {mergeStyles} from '../style/runtime';\nimport Nubbin from '../ui-icons/S2_MoveHorizontalTableWidget.svg';\nimport {ProgressCircle} from './ProgressCircle';\nimport {raw} from '../style/style-macro' with {type: 'macro'};\nimport React, {createContext, forwardRef, ReactNode, useCallback, useContext, useMemo, useRef, useState} from 'react';\nimport {Rect} from '@react-stately/virtualizer';\nimport SortDownArrow from '../s2wf-icons/S2_Icon_SortDown_20_N.svg';\nimport SortUpArrow from '../s2wf-icons/S2_Icon_SortUp_20_N.svg';\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useLoadMore} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useScale} from './utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\nimport {VisuallyHidden} from 'react-aria';\n\ninterface S2TableProps {\n /** Whether the Table should be displayed with a quiet style. */\n isQuiet?: boolean,\n /**\n * Sets the amount of vertical padding within each cell.\n * @default 'regular'\n */\n density?: 'compact' | 'spacious' | 'regular',\n /**\n * Sets the overflow behavior for the cell contents.\n * @default 'truncate'\n */\n overflowMode?: 'wrap' | 'truncate',\n // TODO: will we contine with onAction or rename to onRowAction like it is in RAC?\n /** Handler that is called when a user performs an action on a row. */\n onAction?: (key: Key) => void,\n /**\n * Handler that is called when a user starts a column resize.\n */\n onResizeStart?: (widths: Map<Key, ColumnSize>) => void,\n /**\n * Handler that is called when a user performs a column resize.\n * Can be used with the width property on columns to put the column widths into\n * a controlled state.\n */\n onResize?: (widths: Map<Key, ColumnSize>) => void,\n /**\n * Handler that is called after a user performs a column resize.\n * Can be used to store the widths of columns for another future session.\n */\n onResizeEnd?: (widths: Map<Key, ColumnSize>) => void,\n /** The current loading state of the table. */\n loadingState?: LoadingState,\n /** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */\n onLoadMore?: () => any\n}\n\n// TODO: Note that loadMore and loadingState are now on the Table instead of on the TableBody\nexport interface TableViewProps extends Omit<RACTableProps, 'style' | 'disabledBehavior' | 'className' | 'onRowAction' | 'selectionBehavior' | 'onScroll' | 'onCellAction' | 'dragAndDropHooks'>, UnsafeStyles, S2TableProps {\n /** Spectrum-defined styles, returned by the `style()` macro. */\n styles?: StylesPropWithHeight\n}\n\nlet InternalTableContext = createContext<TableViewProps & {layout?: S2TableLayout<unknown>, setIsInResizeMode?:(val: boolean) => void, isInResizeMode?: boolean}>({});\n\nconst tableWrapper = style({\n minHeight: 0,\n minWidth: 0,\n display: 'flex',\n isolation: 'isolate',\n disableTapHighlight: true\n});\n\nconst table = style<TableRenderProps & S2TableProps & {isCheckboxSelection?: boolean}>({\n width: 'full',\n userSelect: 'none',\n minHeight: 0,\n minWidth: 0,\n fontFamily: 'sans',\n fontWeight: 'normal',\n overflow: 'auto',\n backgroundColor: {\n default: 'gray-25',\n isQuiet: 'transparent',\n forcedColors: 'Background'\n },\n outlineColor: {\n default: 'gray-300',\n isFocusVisible: 'focus-ring',\n forcedColors: 'ButtonBorder'\n },\n outlineWidth: {\n default: 1,\n isQuiet: 0,\n isFocusVisible: 2\n },\n outlineStyle: 'solid',\n borderRadius: {\n default: size(6),\n isQuiet: 'none'\n },\n // Multiple browser bugs from scrollIntoView and scrollPadding:\n // Bug: Table doesn't scroll items into view perfectly in Chrome\n // https://issues.chromium.org/issues/365913982\n // Bug: Table scrolls to the left when navigating up/down through the checkboxes when body is scrolled to the right.\n // https://issues.chromium.org/issues/40067778\n // https://bugs.webkit.org/show_bug.cgi?id=272799\n // Base reproduction: https://codepen.io/lfdanlu/pen/zYVVGPW\n scrollPaddingTop: 32,\n scrollPaddingStart: {\n isCheckboxSelection: 40\n }\n}, getAllowedOverrides({height: true}));\n\n// component-height-100\nconst DEFAULT_HEADER_HEIGHT = {\n medium: 32,\n large: 40\n};\n\nconst ROW_HEIGHTS = {\n compact: {\n medium: 32, // table-row-height-medium-compact (aka component-height-100)\n large: 40\n },\n regular: {\n medium: 40, // table-row-height-medium-regular\n large: 50\n },\n spacious: {\n medium: 48, // table-row-height-medium-spacious\n large: 60\n }\n};\n\nexport class S2TableLayout<T> extends UNSTABLE_TableLayout<T> {\n constructor(options) {\n super({...options, loaderHeight: 60});\n }\n\n protected isStickyColumn(node: GridNode<T>): boolean {\n return node.props.isSticky;\n }\n\n protected buildCollection(): LayoutNode[] {\n let [header, body] = super.buildCollection();\n let {children, layoutInfo} = body;\n // TableLayout's buildCollection always sets the body width to the max width between the header width, but\n // we want the body to be sticky and only as wide as the table so it is always in view if loading/empty\n if (children?.length === 0) {\n layoutInfo.rect.width = this.virtualizer.visibleRect.width - 80;\n }\n\n return [\n header,\n body\n ];\n }\n\n protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {\n let layoutNode = super.buildLoader(node, x, y);\n let {layoutInfo} = layoutNode;\n layoutInfo.allowOverflow = true;\n layoutInfo.rect.width = this.virtualizer.visibleRect.width;\n layoutInfo.isSticky = true;\n return layoutNode;\n }\n\n protected buildBody(y: number): LayoutNode {\n let layoutNode = super.buildBody(y);\n let {children, layoutInfo} = layoutNode;\n // Needs overflow for sticky loader\n layoutInfo.allowOverflow = true;\n // If loading or empty, we'll want the body to be sticky and centered\n if (children?.length === 0) {\n layoutInfo.rect = new Rect(40, 40, this.virtualizer.visibleRect.width - 80, this.virtualizer.visibleRect.height - 80);\n layoutInfo.isSticky = true;\n }\n\n return {...layoutNode, layoutInfo};\n }\n\n protected buildRow(node: GridNode<T>, x: number, y: number): LayoutNode {\n let layoutNode = super.buildRow(node, x, y);\n layoutNode.layoutInfo.allowOverflow = true;\n // Needs overflow for sticky selection/drag cells\n return layoutNode;\n }\n\n protected buildTableHeader(): LayoutNode {\n let layoutNode = super.buildTableHeader();\n // Needs overflow for sticky selection/drag column\n layoutNode.layoutInfo.allowOverflow = true;\n return layoutNode;\n }\n\n protected buildColumn(node: GridNode<T>, x: number, y: number): LayoutNode {\n let layoutNode = super.buildColumn(node, x, y);\n // Needs overflow for the resize handle\n layoutNode.layoutInfo.allowOverflow = true;\n return layoutNode;\n }\n}\n\nexport const TableContext = createContext<ContextValue<TableViewProps, DOMRefValue<HTMLDivElement>>>(null);\n\nfunction TableView(props: TableViewProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, TableContext);\n let {\n UNSAFE_style,\n UNSAFE_className,\n isQuiet = false,\n density = 'regular',\n overflowMode = 'truncate',\n styles,\n loadingState,\n onLoadMore,\n onResize: propsOnResize,\n onResizeStart: propsOnResizeStart,\n onResizeEnd: propsOnResizeEnd,\n onAction,\n ...otherProps\n } = props;\n\n let domRef = useDOMRef(ref);\n let scale = useScale();\n let layout = useMemo(() => {\n return new S2TableLayout({\n rowHeight: overflowMode === 'wrap'\n ? undefined\n : ROW_HEIGHTS[density][scale],\n estimatedRowHeight: overflowMode === 'wrap'\n ? ROW_HEIGHTS[density][scale]\n : undefined,\n // No need for estimated headingHeight since the headers aren't affected by overflow mode: wrap\n headingHeight: DEFAULT_HEADER_HEIGHT[scale]\n });\n }, [overflowMode, density, scale]);\n\n // Starts when the user selects resize from the menu, ends when resizing ends\n // used to control the visibility of the resizer Nubbin\n let [isInResizeMode, setIsInResizeMode] = useState(false);\n let onResizeStart = useCallback((widths) => {\n propsOnResizeStart?.(widths);\n }, [propsOnResizeStart]);\n let onResizeEnd = useCallback((widths) => {\n setIsInResizeMode(false);\n propsOnResizeEnd?.(widths);\n }, [propsOnResizeEnd, setIsInResizeMode]);\n\n let context = useMemo(() => ({\n isQuiet,\n density,\n overflowMode,\n loadingState,\n isInResizeMode,\n setIsInResizeMode\n }), [isQuiet, density, overflowMode, loadingState, isInResizeMode, setIsInResizeMode]);\n\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n let scrollRef = useRef(null);\n let memoedLoadMoreProps = useMemo(() => ({\n isLoading: isLoading,\n onLoadMore\n }), [isLoading, onLoadMore]);\n useLoadMore(memoedLoadMoreProps, scrollRef);\n let isCheckboxSelection = props.selectionMode === 'multiple' || props.selectionMode === 'single';\n\n return (\n <ResizableTableContainer\n // TODO: perhaps this ref should be attached to the RACTable but it expects a table type ref which isn't true in the virtualized case\n ref={domRef}\n onResize={propsOnResize}\n onResizeEnd={onResizeEnd}\n onResizeStart={onResizeStart}\n className={(UNSAFE_className || '') + mergeStyles(tableWrapper, styles)}\n style={UNSAFE_style}>\n <UNSTABLE_Virtualizer layout={layout}>\n <InternalTableContext.Provider value={context}>\n <RACTable\n ref={scrollRef}\n // Fix webkit bug where scrollbars appear above the checkboxes/other table elements\n style={{WebkitTransform: 'translateZ(0)'}}\n className={renderProps => table({\n ...renderProps,\n isCheckboxSelection,\n isQuiet\n })}\n selectionBehavior=\"toggle\"\n onRowAction={onAction}\n {...otherProps} />\n </InternalTableContext.Provider>\n </UNSTABLE_Virtualizer>\n </ResizableTableContainer>\n );\n}\n\nconst centeredWrapper = style({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 'full',\n height: 'full'\n});\n\nexport interface TableBodyProps<T> extends Omit<RACTableBodyProps<T>, 'style' | 'className' | 'dependencies'> {}\n\nfunction TableBody<T extends object>(props: TableBodyProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {items, renderEmptyState, children} = props;\n let domRef = useDOMRef(ref);\n let {loadingState} = useContext(InternalTableContext);\n let emptyRender;\n let renderer = children;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n let loadMoreSpinner = (\n <UNSTABLE_TableLoadingIndicator className={style({height: 'full', width: 'full'})}>\n <div className={centeredWrapper}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('table.loadingMore')} />\n </div>\n </UNSTABLE_TableLoadingIndicator>\n );\n\n // If the user is rendering their rows in dynamic fashion, wrap their render function in Collection so we can inject\n // the loader. Otherwise it is a static renderer and thus we can simply add the table loader after\n // TODO: this assumes that the user isn't providing their children in some wrapper though and/or isn't doing a map of children\n // (though I guess they wouldn't provide items then so the check for this is still valid in the latter case)...\n if (typeof children === 'function' && items) {\n renderer = (\n <>\n <Collection items={items}>\n {children}\n </Collection>\n {loadingState === 'loadingMore' && loadMoreSpinner}\n </>\n );\n } else {\n renderer = (\n <>\n {children}\n {loadingState === 'loadingMore' && loadMoreSpinner}\n </>\n );\n }\n\n if (renderEmptyState != null && loadingState !== 'loading') {\n emptyRender = (props: TableBodyRenderProps) => (\n <div className={centeredWrapper}>\n {renderEmptyState(props)}\n </div>\n );\n } else if (loadingState === 'loading') {\n emptyRender = () => (\n <div className={centeredWrapper}>\n <ProgressCircle\n isIndeterminate\n aria-label={stringFormatter.format('table.loading')} />\n </div>\n );\n }\n\n return (\n <RACTableBody\n // @ts-ignore\n ref={domRef}\n className={style({height: 'full'})}\n {...props}\n renderEmptyState={emptyRender}\n dependencies={[loadingState]}>\n {renderer}\n </RACTableBody>\n );\n}\n\n/**\n * The body of a `<Table>`, containing the table rows.\n */\nlet _TableBody = /*#__PURE__*/ (forwardRef as forwardRefType)(TableBody);\nexport {_TableBody as TableBody};\n\nconst cellFocus = {\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineOffset: -2,\n outlineWidth: 2,\n outlineColor: 'focus-ring',\n borderRadius: size(6)\n} as const;\n\nfunction CellFocusRing() {\n return <div role=\"presentation\" className={style({...cellFocus, position: 'absolute', inset: 0})({isFocusVisible: true})} />;\n}\n\nconst columnStyles = style({\n height: '[inherit]',\n boxSizing: 'border-box',\n color: {\n default: 'neutral',\n forcedColors: 'ButtonText'\n },\n paddingX: {\n default: 16,\n isColumnResizable: 0\n },\n textAlign: {\n align: {\n start: 'start',\n center: 'center',\n end: 'end'\n }\n },\n outlineStyle: 'none',\n position: 'relative',\n fontSize: 'control',\n fontFamily: 'sans',\n fontWeight: 'bold',\n display: 'flex',\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n },\n borderTopWidth: {\n default: 0,\n isQuiet: 1\n },\n borderBottomWidth: 1,\n borderStartWidth: 0,\n borderEndWidth: {\n default: 0,\n isColumnResizable: 1\n },\n borderStyle: 'solid',\n forcedColorAdjust: 'none'\n});\n\nexport interface ColumnProps extends RACColumnProps {\n /** Whether the column should render a divider between it and the next column. */\n showDivider?: boolean,\n /** Whether the column allows resizing. */\n allowsResizing?: boolean,\n /**\n * The alignment of the column's contents relative to its allotted width.\n * @default 'start'\n */\n align?: 'start' | 'center' | 'end',\n /** The content to render as the column header. */\n children: ReactNode\n}\n\n/**\n * A column within a `<Table>`.\n */\nexport const Column = forwardRef(function Column(props: ColumnProps, ref: DOMRef<HTMLDivElement>) {\n let {isHeaderRowHovered} = useContext(InternalTableHeaderContext);\n let {isQuiet} = useContext(InternalTableContext);\n let {allowsResizing, children, align = 'start'} = props;\n let domRef = useDOMRef(ref);\n let isColumnResizable = allowsResizing;\n\n return (\n <RACColumn {...props} ref={domRef} style={{borderInlineEndColor: 'transparent'}} className={renderProps => columnStyles({...renderProps, isColumnResizable, align, isQuiet})}>\n {({allowsSorting, sortDirection, isFocusVisible, sort, startResize, isHovered}) => (\n <>\n {/* Note this is mainly for column's without a dropdown menu. If there is a dropdown menu, the button is styled to have a focus ring for simplicity\n (no need to juggle showing this focus ring if focus is on the menu button and not if it is on the resizer) */}\n {/* Separate absolutely positioned element because appyling the ring on the column directly via outline means the ring's required borderRadius will cause the bottom gray border to curve as well */}\n {isFocusVisible && <CellFocusRing />}\n {isColumnResizable ?\n (\n <ResizableColumnContents allowsSorting={allowsSorting} sortDirection={sortDirection} sort={sort} startResize={startResize} isHovered={isHeaderRowHovered || isHovered} align={align}>\n {children}\n </ResizableColumnContents>\n ) : (\n <ColumnContents allowsSorting={allowsSorting} sortDirection={sortDirection}>\n {children}\n </ColumnContents>\n )\n }\n </>\n )}\n </RACColumn>\n );\n});\n\nconst columnContentWrapper = style({\n minWidth: 0,\n display: 'flex',\n alignItems: 'center',\n width: 'full'\n});\n\nconst sortIcon = style({\n size: fontRelative(16),\n flexShrink: 0,\n marginEnd: {\n default: 8,\n isButton: 'text-to-visual'\n },\n verticalAlign: {\n default: 'bottom',\n isButton: 0\n },\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\ninterface ColumnContentProps extends Pick<ColumnRenderProps, 'allowsSorting' | 'sortDirection'>, Pick<ColumnProps, 'children'> {}\n\nfunction ColumnContents(props: ColumnContentProps) {\n let {allowsSorting, sortDirection, children} = props;\n\n return (\n <div className={columnContentWrapper}>\n {allowsSorting && (\n <Provider\n values={[\n [IconContext, {\n styles: sortIcon({})\n }]\n ]}>\n {sortDirection != null && (\n sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />\n )}\n </Provider>\n )}\n <span className={style({truncate: true, width: 'full'})}>\n {children}\n </span>\n </div>\n );\n}\n\nconst resizableMenuButtonWrapper = style({\n ...cellFocus,\n color: 'gray-800', // body-color\n width: 'full',\n position: 'relative',\n display: 'flex',\n alignItems: 'center',\n justifyContent: {\n align: {\n default: 'start',\n center: 'center',\n end: 'end'\n }\n },\n // TODO: when align: end, the dropdown arrow is misaligned with the text, not sure how best to make the svg be flush with the end of the button other than modifying the\n // paddingEnd\n paddingX: 16,\n backgroundColor: 'transparent',\n borderStyle: 'none',\n fontSize: 'control',\n fontFamily: 'sans',\n fontWeight: 'bold'\n});\n\nconst resizerHandleContainer = style({\n display: {\n default: 'none',\n isResizing: 'block',\n isHovered: 'block'\n },\n width: 12,\n height: 'full',\n position: 'absolute',\n top: 0,\n insetEnd: size(-6),\n cursor: {\n default: 'none',\n resizableDirection: {\n 'left': 'e-resize',\n 'right': 'w-resize',\n 'both': 'ew-resize'\n }\n }\n});\n\nconst resizerHandle = style({\n backgroundColor: {\n default: 'transparent',\n isHovered: 'gray-300',\n isFocusVisible: lightDark('informative-900', 'informative-700'), // --spectrum-informative-background-color-default, can't use `informative` because that will use the focusVisible version\n isResizing: lightDark('informative-900', 'informative-700'),\n forcedColors: {\n default: 'Background',\n isHovered: 'ButtonBorder',\n isFocusVisible: 'Highlight',\n isResizing: 'Highlight'\n }\n },\n height: {\n default: 'full',\n isResizing: 'screen'\n },\n width: {\n default: size(1),\n isResizing: size(2)\n },\n position: 'absolute',\n insetStart: size(6)\n});\n\nconst columnHeaderText = style({\n truncate: true,\n // Make it so the text doesn't completely disappear when column is resized to smallest width + both sort and chevron icon is rendered\n minWidth: fontRelative(16),\n flexGrow: 0,\n flexShrink: 1,\n flexBasis: 'auto'\n});\n\nconst chevronIcon = style({\n rotate: 90,\n marginStart: 'text-to-visual',\n minWidth: fontRelative(16),\n flexShrink: 0,\n '--iconPrimary': {\n type: 'fill',\n value: 'currentColor'\n }\n});\n\nconst nubbin = style({\n position: 'absolute',\n top: 0,\n insetStart: size(-1),\n size: fontRelative(16),\n fill: {\n default: lightDark('informative-900', 'informative-700'), // --spectrum-informative-background-color-default, can't use `informative` because that won't be the background color value\n forcedColors: 'Highlight'\n },\n '--iconPrimary': {\n type: 'fill',\n value: {\n default: 'white',\n forcedColors: 'HighlightText'\n }\n }\n});\n\ninterface ResizableColumnContentProps extends Pick<ColumnRenderProps, 'allowsSorting' | 'sort' | 'sortDirection' | 'startResize' | 'isHovered'>, Pick<ColumnProps, 'align' | 'children'> {}\n\nfunction ResizableColumnContents(props: ResizableColumnContentProps) {\n let {allowsSorting, sortDirection, sort, startResize, children, isHovered, align} = props;\n let {setIsInResizeMode, isInResizeMode} = useContext(InternalTableContext);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2');\n const onMenuSelect = (key) => {\n switch (key) {\n case 'sort-asc':\n sort('ascending');\n break;\n case 'sort-desc':\n sort('descending');\n break;\n case 'resize':\n setIsInResizeMode?.(true);\n startResize();\n break;\n }\n };\n\n let items = useMemo(() => {\n let options = [\n {\n label: stringFormatter.format('table.resizeColumn'),\n id: 'resize'\n }\n ];\n if (allowsSorting) {\n options = [\n {\n label: stringFormatter.format('table.sortAscending'),\n id: 'sort-asc'\n },\n {\n label: stringFormatter.format('table.sortDescending'),\n id: 'sort-desc'\n },\n ...options\n ];\n }\n return options;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [allowsSorting]);\n\n let buttonAlignment = 'start';\n let menuAlign = 'start' as 'start' | 'end';\n if (align === 'center') {\n buttonAlignment = 'center';\n } else if (align === 'end') {\n buttonAlignment = 'end';\n menuAlign = 'end';\n }\n\n return (\n <>\n <MenuTrigger align={menuAlign}>\n <Button className={(renderProps) => resizableMenuButtonWrapper({...renderProps, align: buttonAlignment})}>\n {allowsSorting && (\n <Provider\n values={[\n [IconContext, {\n styles: sortIcon({isButton: true})\n }]\n ]}>\n {sortDirection != null && (\n sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />\n )}\n </Provider>\n )}\n <div className={columnHeaderText}>\n {children}\n </div>\n <Chevron size=\"M\" className={chevronIcon} />\n </Button>\n <Menu onAction={onMenuSelect} items={items} styles={style({minWidth: 128})}>\n {(item) => <MenuItem>{item?.label}</MenuItem>}\n </Menu>\n </MenuTrigger>\n <div data-react-aria-prevent-focus=\"true\">\n <ColumnResizer data-react-aria-prevent-focus=\"true\" className={({resizableDirection, isResizing}) => resizerHandleContainer({resizableDirection, isResizing, isHovered: isInResizeMode || isHovered})}>\n {({isFocusVisible, isResizing}) => (\n <>\n <ResizerIndicator isInResizeMode={isInResizeMode} isFocusVisible={isFocusVisible} isHovered={isHovered} isResizing={isResizing} />\n {(isFocusVisible || isInResizeMode) && isResizing && <div className={nubbin}><Nubbin /></div>}\n </>\n )}\n </ColumnResizer>\n </div>\n </>\n );\n}\n\nfunction ResizerIndicator({isFocusVisible, isHovered, isResizing, isInResizeMode}) {\n return (\n <div className={resizerHandle({isFocusVisible, isHovered: isHovered || isInResizeMode, isResizing})} />\n );\n}\n\nconst tableHeader = style({\n height: 'full',\n width: 'full',\n backgroundColor: 'gray-75',\n // Attempt to prevent 1px area where you can see scrolled cell content between the table outline and the table header\n marginTop: '[-1px]'\n});\n\nconst selectAllCheckbox = style({\n marginStart: 16 // table-edge-to-content, same between mobile and desktop\n});\n\nconst selectAllCheckboxColumn = style({\n padding: 0,\n height: 'full',\n boxSizing: 'border-box',\n outlineStyle: 'none',\n position: 'relative',\n alignContent: 'center',\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n },\n borderXWidth: 0,\n borderTopWidth: {\n default: 0,\n isQuiet: 1\n },\n borderBottomWidth: 1,\n borderStyle: 'solid',\n backgroundColor: 'gray-75'\n});\n\nlet InternalTableHeaderContext = createContext<{isHeaderRowHovered?: boolean}>({isHeaderRowHovered: false});\n\nexport interface TableHeaderProps<T> extends Omit<RACTableHeaderProps<T>, 'style' | 'className' | 'dependencies' | 'onHoverChange' | 'onHoverStart' | 'onHoverEnd'> {}\n\nfunction TableHeader<T extends object>({columns, children}: TableHeaderProps<T>, ref: DOMRef<HTMLDivElement>) {\n let scale = useScale();\n let {selectionBehavior, selectionMode} = useTableOptions();\n let {isQuiet} = useContext(InternalTableContext);\n let [isHeaderRowHovered, setHeaderRowHovered] = useState(false);\n let domRef = useDOMRef(ref);\n\n return (\n <InternalTableHeaderContext.Provider value={{isHeaderRowHovered}}>\n <RACTableHeader\n // @ts-ignore\n ref={domRef}\n onHoverChange={setHeaderRowHovered}\n className={tableHeader}>\n {/* Add extra columns for selection. */}\n {selectionBehavior === 'toggle' && (\n // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later\n // @ts-ignore\n <RACColumn isSticky width={scale === 'medium' ? 40 : 52} minWidth={scale === 'medium' ? 40 : 52} className={selectAllCheckboxColumn({isQuiet})}>\n {({isFocusVisible}) => (\n <>\n {selectionMode === 'single' &&\n <>\n {isFocusVisible && <CellFocusRing />}\n <VisuallyHiddenSelectAllLabel />\n </>\n }\n {selectionMode === 'multiple' &&\n <Checkbox isEmphasized styles={selectAllCheckbox} slot=\"selection\" />\n }\n </>\n )}\n </RACColumn>\n )}\n <Collection items={columns}>\n {children}\n </Collection>\n </RACTableHeader>\n </InternalTableHeaderContext.Provider>\n );\n}\n\n/**\n * A header within a `<Table>`, containing the table columns.\n */\nlet _TableHeader = /*#__PURE__*/ (forwardRef as forwardRefType)(TableHeader);\nexport {_TableHeader as TableHeader};\n\nfunction VisuallyHiddenSelectAllLabel() {\n let checkboxProps = useSlottedContext(RACCheckboxContext, 'selection');\n\n return (\n <VisuallyHidden>{checkboxProps?.['aria-label']}</VisuallyHidden>\n );\n}\n\nconst commonCellStyles = {\n borderColor: 'transparent',\n borderBottomWidth: 1,\n borderTopWidth: 0,\n borderXWidth: 0,\n borderStyle: 'solid',\n position: 'relative',\n color: {\n default: 'gray-800',\n forcedColors: 'ButtonText'\n },\n outlineStyle: 'none',\n paddingX: 16 // table-edge-to-content\n} as const;\n\nconst cell = style<CellRenderProps & S2TableProps & {isDivider: boolean}>({\n ...commonCellStyles,\n color: 'neutral',\n paddingY: centerPadding(),\n minHeight: {\n default: 40,\n density: {\n compact: 32,\n spacious: 48\n }\n },\n boxSizing: 'border-box',\n height: 'full',\n width: 'full',\n fontSize: 'control',\n alignItems: 'center',\n display: 'flex',\n borderStyle: {\n default: 'none',\n isDivider: 'solid'\n },\n borderEndWidth: {\n default: 0,\n isDivider: 1\n },\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n }\n});\n\nconst stickyCell = {\n backgroundColor: 'gray-25'\n} as const;\n\nconst checkboxCellStyle = style({\n ...commonCellStyles,\n ...stickyCell,\n paddingStart: 16,\n alignContent: 'center',\n height: '[calc(100% - 1px)]',\n borderBottomWidth: 0,\n backgroundColor: '--rowBackgroundColor'\n});\n\nconst cellContent = style({\n truncate: true,\n whiteSpace: {\n default: 'nowrap',\n overflowMode: {\n wrap: 'normal'\n }\n },\n textAlign: {\n align: {\n start: 'start',\n center: 'center',\n end: 'end'\n }\n },\n width: 'full',\n isolation: 'isolate',\n padding: {\n default: 4,\n isSticky: 0\n },\n margin: {\n default: -4,\n isSticky: 0\n },\n backgroundColor: {\n default: 'transparent',\n isSticky: '--rowBackgroundColor'\n }\n});\n\nexport interface CellProps extends RACCellProps, Pick<ColumnProps, 'align' | 'showDivider'> {\n /** @private */\n isSticky?: boolean,\n /** The content to render as the cell children. */\n children: ReactNode\n}\n\n/**\n * A cell within a table row.\n */\nexport const Cell = forwardRef(function Cell(props: CellProps, ref: DOMRef<HTMLDivElement>) {\n let {children, isSticky, showDivider = false, align, textValue, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let tableVisualOptions = useContext(InternalTableContext);\n textValue ||= typeof children === 'string' ? children : undefined;\n\n return (\n <RACCell\n ref={domRef}\n // Also isSticky prop is applied just for the layout, will decide what the RAC api should be later\n // @ts-ignore\n isSticky={isSticky}\n className={renderProps => cell({\n ...renderProps,\n ...tableVisualOptions,\n isDivider: showDivider\n })}\n textValue={textValue}\n {...otherProps}>\n {({isFocusVisible}) => (\n <>\n {isFocusVisible && <CellFocusRing />}\n <span className={cellContent({...tableVisualOptions, isSticky, align: align || 'start'})}>{children}</span>\n </>\n )}\n </RACCell>\n );\n});\n\n// Use color-mix instead of transparency so sticky cells work correctly.\nconst selectedBackground = lightDark(colorMix('gray-25', 'informative-900', 10), colorMix('gray-25', 'informative-700', 10));\nconst selectedActiveBackground = lightDark(colorMix('gray-25', 'informative-900', 15), colorMix('gray-25', 'informative-700', 15));\nconst rowBackgroundColor = {\n default: {\n default: 'gray-25',\n isQuiet: '--s2-container-bg'\n },\n isFocusVisibleWithin: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color\n isHovered: colorMix('gray-25', 'gray-900', 7), // table-row-hover-color\n isPressed: colorMix('gray-25', 'gray-900', 10), // table-row-hover-color\n isSelected: {\n default: selectedBackground, // table-selected-row-background-color, opacity /10\n isFocusVisibleWithin: selectedActiveBackground, // table-selected-row-background-color, opacity /15\n isHovered: selectedActiveBackground, // table-selected-row-background-color, opacity /15\n isPressed: selectedActiveBackground // table-selected-row-background-color, opacity /15\n },\n forcedColors: {\n default: 'Background'\n }\n} as const;\n\nconst row = style<RowRenderProps & S2TableProps>({\n height: 'full',\n position: 'relative',\n boxSizing: 'border-box',\n backgroundColor: '--rowBackgroundColor',\n '--rowBackgroundColor': {\n type: 'backgroundColor',\n value: rowBackgroundColor\n },\n '--rowFocusIndicatorColor': {\n type: 'outlineColor',\n value: {\n default: 'focus-ring',\n forcedColors: 'Highlight'\n }\n },\n // TODO: outline here is to emulate v3 forcedColors experience but runs into the same problem where the sticky column covers the outline\n // This doesn't quite work because it gets cut off by the checkbox cell background masking element, figure out another way. Could shrink the checkbox cell's content even more\n // and offset it by margin top but that messes up the checkbox centering a bit\n // outlineWidth: {\n // forcedColors: {\n // isFocusVisible: 2\n // }\n // },\n // outlineOffset: {\n // forcedColors: {\n // isFocusVisible: -1\n // }\n // },\n // outlineColor: {\n // forcedColors: {\n // isFocusVisible: 'ButtonBorder'\n // }\n // },\n // outlineStyle: {\n // default: 'none',\n // forcedColors: {\n // isFocusVisible: 'solid'\n // }\n // },\n outlineStyle: 'none',\n borderTopWidth: 0,\n borderBottomWidth: 1,\n borderStartWidth: 0,\n borderEndWidth: 0,\n borderStyle: 'solid',\n borderColor: {\n default: 'gray-300',\n forcedColors: 'ButtonBorder'\n },\n forcedColorAdjust: 'none'\n});\n\nexport interface RowProps<T> extends Pick<RACRowProps<T>, 'id' | 'columns' | 'children' | 'textValue'> {}\n\nfunction Row<T extends object>({id, columns, children, ...otherProps}: RowProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {selectionBehavior, selectionMode} = useTableOptions();\n let tableVisualOptions = useContext(InternalTableContext);\n let domRef = useDOMRef(ref);\n\n return (\n <RACRow\n // @ts-ignore\n ref={domRef}\n id={id}\n className={renderProps => row({\n ...renderProps,\n ...tableVisualOptions\n }) + (renderProps.isFocusVisible && ' ' + raw('&:before { content: \"\"; display: inline-block; position: sticky; inset-inline-start: 0; width: 3px; height: 100%; margin-inline-end: -3px; margin-block-end: 1px; z-index: 3; background-color: var(--rowFocusIndicatorColor)'))}\n {...otherProps}>\n {selectionMode !== 'none' && selectionBehavior === 'toggle' && (\n <Cell isSticky className={checkboxCellStyle}>\n <Checkbox isEmphasized slot=\"selection\" />\n </Cell>\n )}\n <Collection items={columns}>\n {children}\n </Collection>\n </RACRow>\n );\n}\n\n/**\n * A row within a `<Table>`.\n */\nlet _Row = /*#__PURE__*/ (forwardRef as forwardRefType)(Row);\nexport {_Row as Row};\n\n/**\n * Tables are containers for displaying information. They allow users to quickly scan, sort, compare, and take action on large amounts of data.\n */\nconst _TableView = forwardRef(TableView);\nexport {_TableView as TableView};\n"],"names":[],"version":3,"file":"TableView.mjs.map"}
|
package/dist/Tabs.cjs
CHANGED
|
@@ -61,14 +61,8 @@ const $b27519d6a701105b$var$tabPanel = function anonymous(props, overrides) {
|
|
|
61
61
|
rules += ' an';
|
|
62
62
|
if (!$_9) rules += ' _9-3t1y';
|
|
63
63
|
if (!$h) rules += ' h-3hmsa';
|
|
64
|
-
if (!$o)
|
|
65
|
-
|
|
66
|
-
rules += ' oa';
|
|
67
|
-
}
|
|
68
|
-
if (!$q) {
|
|
69
|
-
rules += ' qba';
|
|
70
|
-
rules += ' qa';
|
|
71
|
-
}
|
|
64
|
+
if (!$o) rules += ' oa';
|
|
65
|
+
if (!$q) rules += ' qa';
|
|
72
66
|
return rules;
|
|
73
67
|
};
|
|
74
68
|
function $b27519d6a701105b$export$3d96ec278d3efce4(props) {
|
|
@@ -120,13 +114,8 @@ const $b27519d6a701105b$var$tab = function anonymous(props, overrides) {
|
|
|
120
114
|
rules += ' iG';
|
|
121
115
|
rules += ' jbH';
|
|
122
116
|
rules += ' jG';
|
|
123
|
-
if (props.density === "regular")
|
|
124
|
-
|
|
125
|
-
rules += ' kx';
|
|
126
|
-
} else if (props.density === "compact") {
|
|
127
|
-
rules += ' kbr';
|
|
128
|
-
rules += ' kq';
|
|
129
|
-
}
|
|
117
|
+
if (props.density === "regular") rules += ' kn';
|
|
118
|
+
else if (props.density === "compact") rules += ' kj';
|
|
130
119
|
rules += ' _1c';
|
|
131
120
|
if (!$U) rules += ' Uc';
|
|
132
121
|
rules += ' __Hb';
|