@react-spectrum/table 3.12.9-nightly.4555 → 3.12.9-nightly.4558
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/DragPreview.main.js +54 -0
- package/dist/DragPreview.main.js.map +1 -0
- package/dist/DragPreview.mjs +49 -0
- package/dist/DragPreview.module.js +49 -0
- package/dist/DragPreview.module.js.map +1 -0
- package/dist/InsertionIndicator.main.js +63 -0
- package/dist/InsertionIndicator.main.js.map +1 -0
- package/dist/InsertionIndicator.mjs +58 -0
- package/dist/InsertionIndicator.module.js +58 -0
- package/dist/InsertionIndicator.module.js.map +1 -0
- package/dist/Nubbin.main.js +62 -0
- package/dist/Nubbin.main.js.map +1 -0
- package/dist/Nubbin.mjs +53 -0
- package/dist/Nubbin.module.js +53 -0
- package/dist/Nubbin.module.js.map +1 -0
- package/dist/Resizer.main.js +143 -0
- package/dist/Resizer.main.js.map +1 -0
- package/dist/Resizer.mjs +138 -0
- package/dist/Resizer.module.js +138 -0
- package/dist/Resizer.module.js.map +1 -0
- package/dist/RootDropIndicator.main.js +57 -0
- package/dist/RootDropIndicator.main.js.map +1 -0
- package/dist/RootDropIndicator.mjs +48 -0
- package/dist/RootDropIndicator.module.js +48 -0
- package/dist/RootDropIndicator.module.js.map +1 -0
- package/dist/TableView.main.js +50 -0
- package/dist/TableView.main.js.map +1 -0
- package/dist/TableView.mjs +41 -0
- package/dist/TableView.module.js +41 -0
- package/dist/TableView.module.js.map +1 -0
- package/dist/TableViewBase.main.js +1193 -0
- package/dist/TableViewBase.main.js.map +1 -0
- package/dist/TableViewBase.mjs +1186 -0
- package/dist/TableViewBase.module.js +1186 -0
- package/dist/TableViewBase.module.js.map +1 -0
- package/dist/TableViewWrapper.main.js +46 -0
- package/dist/TableViewWrapper.main.js.map +1 -0
- package/dist/TableViewWrapper.mjs +37 -0
- package/dist/TableViewWrapper.module.js +37 -0
- package/dist/TableViewWrapper.module.js.map +1 -0
- package/dist/TreeGridTableView.main.js +50 -0
- package/dist/TreeGridTableView.main.js.map +1 -0
- package/dist/TreeGridTableView.mjs +41 -0
- package/dist/TreeGridTableView.module.js +41 -0
- package/dist/TreeGridTableView.module.js.map +1 -0
- package/dist/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/import.mjs +2 -1930
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/main.js +2 -1926
- package/dist/main.js.map +1 -1
- package/dist/module.js +2 -1930
- package/dist/module.js.map +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/table.b13eee90.css +220 -0
- package/dist/table.b13eee90.css.map +1 -0
- package/dist/table_css.main.js +74 -0
- package/dist/table_css.main.js.map +1 -0
- package/dist/table_css.mjs +76 -0
- package/dist/table_css.module.js +76 -0
- package/dist/table_css.module.js.map +1 -0
- package/dist/table_vars_css.main.js +197 -0
- package/dist/table_vars_css.main.js.map +1 -0
- package/dist/table_vars_css.mjs +199 -0
- package/dist/table_vars_css.module.js +199 -0
- package/dist/table_vars_css.module.js.map +1 -0
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/{main.css → vars.42570ef3.css} +1 -221
- package/dist/vars.42570ef3.css.map +1 -0
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +28 -28
- package/dist/main.css.map +0 -1
- package/dist/module.css +0 -1208
- package/dist/module.css.map +0 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
var $1a3d6ad53eb75d54$exports = require("./intlStrings.main.js");
|
|
2
|
+
require("./vars.42570ef3.css");
|
|
3
|
+
var $982885d0a34882ea$exports = require("./table_vars_css.main.js");
|
|
4
|
+
var $e39c6de4eb69450d$exports = require("./TableViewBase.main.js");
|
|
5
|
+
var $hxFQC$reactspectrumutils = require("@react-spectrum/utils");
|
|
6
|
+
var $hxFQC$reactariafocus = require("@react-aria/focus");
|
|
7
|
+
var $hxFQC$reactariautils = require("@react-aria/utils");
|
|
8
|
+
var $hxFQC$react = require("react");
|
|
9
|
+
var $hxFQC$reactdom = require("react-dom");
|
|
10
|
+
var $hxFQC$reactariai18n = require("@react-aria/i18n");
|
|
11
|
+
var $hxFQC$reactariatable = require("@react-aria/table");
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
function $parcel$interopDefault(a) {
|
|
15
|
+
return a && a.__esModule ? a.default : a;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function $parcel$export(e, n, v, s) {
|
|
19
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
$parcel$export(module.exports, "Resizer", () => $2877766f94c67a67$export$48a76196cafe3b93);
|
|
23
|
+
/* eslint-disable jsx-a11y/role-supports-aria-props */
|
|
24
|
+
var $1ed2399e74febaae$exports = {};
|
|
25
|
+
$1ed2399e74febaae$exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"-1 0 31 32\">\n <filter id=\"shadow\">\n <feDropShadow dx=\"0\" dy=\"0.5\" stdDeviation=\"1.2\" flood-opacity=\"0.7\"></feDropShadow>\n </filter>\n <g filter=\"url('#shadow')\" transform=\"translate(.5 0)\">\n <path d=\"M9.5,2c.27614,0,.5,.22388,.5,.5v6.5h3v-1.74951c0-.14893,.12215-.25049,.2513-.25049,.05457,0,.1104,.01819,.15875,.05847l2.58995,2.44153-2.58995,2.44153c-.04837,.04028-.10419,.05847-.15875,.05847-.12914,0-.2513-.10156-.2513-.25049v-1.74951h-3v6.5c0,.27612-.22386,.5-.5,.5h-1c-.27614,0-.5-.22388-.5-.5V2.5c0-.27612,.22386-.5,.5-.5h1Zm0-1h-1c-.82843,0-1.5,.67157-1.5,1.5v14c0,.82843,.67157,1.5,1.5,1.5h1c.82843,0,1.5-.67157,1.5-1.5v-5.5h1v.67757c0,.40416,.1632,.80501,.48197,1.05347,.49639,.3869,1.14001,.33571,1.56838-.02144l.02344-.01953,.0222-.02087,2.97589-2.80537c.20937-.19737,.20937-.53028,0-.72765l-2.97589-2.80537-.0222-.02087-.02345-.01965c-.22456-.18713-.5083-.29028-.79895-.29028-.3208,0-.62624,.12134-.86003,.34167-.24872,.23438-.39136,.56567-.39136,.90881v.74951h-1V2.5c0-.82843-.67157-1.5-1.5-1.5Z\" fill=\"#fff\"></path>\n <path d=\"M10,16.5v-6.5h3v1.74952c0,.21196,.24721,.32775,.41005,.19206l2.58995-2.44158-2.58995-2.44158c-.16283-.13569-.41005-.0199-.41005,.19206v1.74952h-3V2.5c0-.27614-.22386-.5-.5-.5h-1c-.27614,0-.5,.22386-.5,.5v14c0,.27614,.22386,.5,.5,.5h1c.27614,0,.5-.22386,.5-.5Z\"></path>\n </g>\n</svg>\n";
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
var $3f4aefa9145f889b$exports = {};
|
|
29
|
+
$3f4aefa9145f889b$exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"-1 0 31 32\">\n <filter id=\"shadow\">\n <feDropShadow dx=\"0\" dy=\"0.5\" stdDeviation=\"1.2\" flood-opacity=\"0.7\"></feDropShadow>\n </filter>\n <g filter=\"url('#shadow')\" transform=\"translate(.5 0)\">\n <path fill=\"#fff\" d=\"M9.5,2a.5.5,0,0,1,.5.5V9h3V7.2505A.25014.25014,0,0,1,13.24978,7h.00152a.246.246,0,0,1,.15875.05847L16,9.5l-2.58995,2.44153A.24611.24611,0,0,1,13.2513,12,.25016.25016,0,0,1,13,11.751V10H10v6.5a.5.5,0,0,1-.5.5h-1a.5.5,0,0,1-.5-.5V10H5v1.7495A.25014.25014,0,0,1,4.75022,12H4.7487A.246.246,0,0,1,4.59,11.94153L2,9.5,4.59,7.05847A.246.246,0,0,1,4.7487,7,.25016.25016,0,0,1,5,7.249V9H8V2.5A.5.5,0,0,1,8.5,2Zm0-1h-1A1.5,1.5,0,0,0,7,2.5V8H6V7.32389a1.33,1.33,0,0,0-.4816-1.05444,1.23962,1.23962,0,0,0-1.56876.021l-.02344.01953-.0222.02088L.92812,9.13618A.5.5,0,0,0,.90726,9.843l.02086.02085L3.904,12.66919l.02221.02088.02345.01965a1.23986,1.23986,0,0,0,1.56836.02116A1.3294,1.3294,0,0,0,6,11.6765V11H7v5.5A1.5,1.5,0,0,0,8.5,18h1A1.5,1.5,0,0,0,11,16.5V11h1v.67757a1.32792,1.32792,0,0,0,.482,1.05347,1.24,1.24,0,0,0,1.56839-.02144l.02343-.01953.02221-.02088,2.97588-2.80537a.5.5,0,0,0,.02086-.70679l-.02086-.02085L14.096,6.33081l-.02221-.02087-.02345-.01965A1.24978,1.24978,0,0,0,12,7.2505V8H11V2.5A1.5,1.5,0,0,0,9.5,1Z\"></path>\n <path d=\"M10,16.5V10h3v1.7495a.25.25,0,0,0,.41.19206L16,9.5,13.41,7.05842A.25.25,0,0,0,13,7.2505V9H10V2.5A.5.5,0,0,0,9.5,2h-1a.5.5,0,0,0-.5.5V9H5V7.2505a.25.25,0,0,0-.41-.19206L2,9.5l2.59,2.44158A.25.25,0,0,0,5,11.7495V10H8v6.5a.5.5,0,0,0,.5.5h1A.5.5,0,0,0,10,16.5Z\"></path>\n </g>\n</svg>\n";
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
var $955f540cbcd8d857$exports = {};
|
|
42
|
+
$955f540cbcd8d857$exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"-1 0 31 32\">\n <filter id=\"shadow\">\n <feDropShadow dx=\"0\" dy=\"0.5\" stdDeviation=\"1.2\" flood-opacity=\"0.7\"></feDropShadow>\n </filter>\n <g filter=\"url('#shadow')\" transform=\"translate(.5 0)\">\n <path d=\"M9.5,2c.27614,0,.5,.22388,.5,.5v14c0,.27612-.22386,.5-.5,.5h-1c-.27614,0-.5-.22388-.5-.5v-6.5h-3v1.74951c0,.14893-.12215,.25049-.2513,.25049-.05457,0-.1104-.01819-.15875-.05847l-2.58995-2.44153,2.58995-2.44153c.04837-.04028,.10419-.05847,.15875-.05847,.12914,0,.2513,.10156,.2513,.25049v1.74951h3V2.5c0-.27612,.22386-.5,.5-.5h1Zm0-1h-1c-.82843,0-1.5,.67157-1.5,1.5v5.5h-1v-.67611c0-.40436-.1629-.80555-.48159-1.05444-.4961-.38744-1.14015-.33635-1.56876,.02095l-.02344,.01953-.0222,.02087L.92811,9.13618c-.20937,.19737-.20937,.53028,0,.72765l2.97589,2.80537,.0222,.02087,.02345,.01965c.42839,.35694,1.07208,.40833,1.56837,.02116,.31886-.24875,.48198-.64994,.48198-1.05435v-.67652s.99999,0,.99999,0v5.5c0,.82843,.67157,1.5,1.5,1.5h1c.82843,0,1.5-.67157,1.5-1.5V2.5c0-.82843-.67157-1.5-1.5-1.5Z\" fill=\"#fff\"></path>\n <path d=\"M10,16.5V2.5c0-.27614-.22386-.5-.5-.5h-1c-.27614,0-.5,.22386-.5,.5v6.5h-3v-1.74952c0-.21196-.24721-.32775-.41005-.19206l-2.58995,2.44158,2.58995,2.44158c.16283,.13569,.41005,.0199,.41005-.19206v-1.74952h3v6.5c0,.27614,.22386,.5,.5,.5h1c.27614,0,.5-.22386,.5-.5Z\"></path>\n </g>\n</svg>\n";
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
function $2877766f94c67a67$var$getCursor(svg, fallback) {
|
|
46
|
+
// WebKit renders SVG cursors blurry on 2x screens: https://bugs.webkit.org/show_bug.cgi?id=160657
|
|
47
|
+
// To work around this, we generate two SVGs at different sizes and use image-set to pick between them.
|
|
48
|
+
// Only do this in WebKit to avoid Firefox rendering the cursor at twice the size.
|
|
49
|
+
if ((0, $hxFQC$reactariautils.isWebKit)()) return `image-set(url("data:image/svg+xml,${encodeURIComponent(svg)}") 1x, url("data:image/svg+xml,${encodeURIComponent(svg.replace('width="32" height="32"', 'width="64" height="64"'))}") 2x) 8 8, ${fallback}`;
|
|
50
|
+
else return `url("data:image/svg+xml,${encodeURIComponent(svg)}") 8 8, ${fallback}`;
|
|
51
|
+
}
|
|
52
|
+
const $2877766f94c67a67$var$CURSORS = {
|
|
53
|
+
ew: $2877766f94c67a67$var$getCursor((0, (/*@__PURE__*/$parcel$interopDefault($3f4aefa9145f889b$exports))), "ew-resize"),
|
|
54
|
+
w: $2877766f94c67a67$var$getCursor((0, (/*@__PURE__*/$parcel$interopDefault($955f540cbcd8d857$exports))), "w-resize"),
|
|
55
|
+
e: $2877766f94c67a67$var$getCursor((0, (/*@__PURE__*/$parcel$interopDefault($1ed2399e74febaae$exports))), "e-resize")
|
|
56
|
+
};
|
|
57
|
+
function $2877766f94c67a67$var$Resizer(props, ref) {
|
|
58
|
+
let { column: column, showResizer: showResizer } = props;
|
|
59
|
+
let { isEmpty: isEmpty, layout: layout, onFocusedResizer: onFocusedResizer } = (0, $e39c6de4eb69450d$exports.useTableContext)();
|
|
60
|
+
// Virtualizer re-renders, but these components are all cached
|
|
61
|
+
// in order to get around that and cause a rerender here, we use context
|
|
62
|
+
// but we don't actually need any value, they are available on the layout object
|
|
63
|
+
(0, $e39c6de4eb69450d$exports.useVirtualizerContext)();
|
|
64
|
+
let stringFormatter = (0, $hxFQC$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($1a3d6ad53eb75d54$exports))), "@react-spectrum/table");
|
|
65
|
+
let { direction: direction } = (0, $hxFQC$reactariai18n.useLocale)();
|
|
66
|
+
let [isPointerDown, setIsPointerDown] = (0, $hxFQC$react.useState)(false);
|
|
67
|
+
(0, $hxFQC$react.useEffect)(()=>{
|
|
68
|
+
let setDown = (e)=>{
|
|
69
|
+
if (e.pointerType === "mouse") setIsPointerDown(true);
|
|
70
|
+
};
|
|
71
|
+
let setUp = (e)=>{
|
|
72
|
+
if (e.pointerType === "mouse") setIsPointerDown(false);
|
|
73
|
+
};
|
|
74
|
+
document.addEventListener("pointerdown", setDown, {
|
|
75
|
+
capture: true
|
|
76
|
+
});
|
|
77
|
+
document.addEventListener("pointerup", setUp, {
|
|
78
|
+
capture: true
|
|
79
|
+
});
|
|
80
|
+
return ()=>{
|
|
81
|
+
document.removeEventListener("pointerdown", setDown, {
|
|
82
|
+
capture: true
|
|
83
|
+
});
|
|
84
|
+
document.removeEventListener("pointerup", setUp, {
|
|
85
|
+
capture: true
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
}, []);
|
|
89
|
+
let { inputProps: inputProps, resizerProps: resizerProps } = (0, $hxFQC$reactariatable.useTableColumnResize)((0, $hxFQC$reactariautils.mergeProps)(props, {
|
|
90
|
+
"aria-label": stringFormatter.format("columnResizer"),
|
|
91
|
+
isDisabled: isEmpty
|
|
92
|
+
}), layout, ref);
|
|
93
|
+
let isEResizable = layout.getColumnMinWidth(column.key) >= layout.getColumnWidth(column.key);
|
|
94
|
+
let isWResizable = layout.getColumnMaxWidth(column.key) <= layout.getColumnWidth(column.key);
|
|
95
|
+
let isResizing = layout.resizingColumn === column.key;
|
|
96
|
+
let cursor = "";
|
|
97
|
+
if (isEResizable) cursor = direction === "rtl" ? $2877766f94c67a67$var$CURSORS.w : $2877766f94c67a67$var$CURSORS.e;
|
|
98
|
+
else if (isWResizable) cursor = direction === "rtl" ? $2877766f94c67a67$var$CURSORS.e : $2877766f94c67a67$var$CURSORS.w;
|
|
99
|
+
else cursor = $2877766f94c67a67$var$CURSORS.ew;
|
|
100
|
+
let style = {
|
|
101
|
+
...resizerProps.style,
|
|
102
|
+
height: "100%",
|
|
103
|
+
display: showResizer ? undefined : "none",
|
|
104
|
+
cursor: cursor
|
|
105
|
+
};
|
|
106
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$react))).createElement((0, ($parcel$interopDefault($hxFQC$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$react))).createElement((0, $hxFQC$reactariafocus.FocusRing), {
|
|
107
|
+
within: true,
|
|
108
|
+
focusRingClass: (0, $hxFQC$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "focus-ring")
|
|
109
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$react))).createElement("div", {
|
|
110
|
+
...resizerProps,
|
|
111
|
+
role: "presentation",
|
|
112
|
+
style: style,
|
|
113
|
+
className: (0, $hxFQC$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-columnResizer")
|
|
114
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$react))).createElement("input", {
|
|
115
|
+
ref: ref,
|
|
116
|
+
...(0, $hxFQC$reactariautils.mergeProps)(inputProps, {
|
|
117
|
+
onFocus: onFocusedResizer
|
|
118
|
+
})
|
|
119
|
+
}))), /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$react))).createElement("div", {
|
|
120
|
+
"aria-hidden": true,
|
|
121
|
+
role: "presentation",
|
|
122
|
+
className: (0, $hxFQC$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-columnResizerPlaceholder")
|
|
123
|
+
}), /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$react))).createElement($2877766f94c67a67$var$CursorOverlay, {
|
|
124
|
+
show: isResizing && isPointerDown
|
|
125
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$react))).createElement("div", {
|
|
126
|
+
style: {
|
|
127
|
+
position: "fixed",
|
|
128
|
+
top: 0,
|
|
129
|
+
left: 0,
|
|
130
|
+
bottom: 0,
|
|
131
|
+
right: 0,
|
|
132
|
+
cursor: cursor
|
|
133
|
+
}
|
|
134
|
+
})));
|
|
135
|
+
}
|
|
136
|
+
function $2877766f94c67a67$var$CursorOverlay(props) {
|
|
137
|
+
let { show: show, children: children } = props;
|
|
138
|
+
return show ? /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$reactdom))).createPortal(children, document.body) : null;
|
|
139
|
+
}
|
|
140
|
+
const $2877766f94c67a67$export$48a76196cafe3b93 = /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$react))).forwardRef($2877766f94c67a67$var$Resizer);
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
//# sourceMappingURL=Resizer.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAoD;;ACApD,4BAAiB;;;;ACAjB,4BAAiB;;;;;;;;;;;;;ACAjB,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AAK,GAAG;sBAChC,0DAAC;QAAc,MAAM,cAAc;qBACjC,0DAAC;QAAI,OAAO;YAAC,UAAU;YAAS,KAAK;YAAG,MAAM;YAAG,QAAQ;YAAG,OAAO;oBAAG;QAAM;;AAIpF;AAEA,SAAS,oCAAc,KAAK;IAC1B,IAAI,QAAC,IAAI,YAAE,QAAQ,EAAC,GAAG;IACvB,OAAO,qBAAO,CAAA,GAAA,yCAAO,EAAE,YAAY,CAAC,UAAU,SAAS,IAAI,IAAI;AACjE;AAEA,MAAM,0DAAW,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/table/src/Resizer.tsx","node_modules/@parcel/runtime-js/lib/bundles/runtime-041bd783ad0660b4.js","node_modules/@parcel/runtime-js/lib/bundles/runtime-8e8d37d2cf10eebe.js","node_modules/@parcel/runtime-js/lib/bundles/runtime-cba9561fd7f119d5.js"],"sourcesContent":["/* eslint-disable jsx-a11y/role-supports-aria-props */\nimport {classNames} from '@react-spectrum/utils';\nimport {ColumnSize} from '@react-types/table';\n// @ts-ignore\nimport eCursor from 'bundle-text:./cursors/Cur_MoveToRight_9_9.svg';\n// @ts-ignore\nimport ewCursor from 'bundle-text:./cursors/Cur_MoveHorizontal_9_9.svg';\nimport {FocusRing} from '@react-aria/focus';\nimport {GridNode} from '@react-types/grid';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {isWebKit, mergeProps} from '@react-aria/utils';\nimport {Key} from '@react-types/shared';\nimport React, {RefObject, useEffect, useState} from 'react';\nimport ReactDOM from 'react-dom';\nimport styles from '@adobe/spectrum-css-temp/components/table/vars.css';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useTableColumnResize} from '@react-aria/table';\nimport {useTableContext, useVirtualizerContext} from './TableViewBase';\n// @ts-ignore\nimport wCursor from 'bundle-text:./cursors/Cur_MoveToLeft_9_9.svg';\n\nfunction getCursor(svg: string, fallback: string) {\n // WebKit renders SVG cursors blurry on 2x screens: https://bugs.webkit.org/show_bug.cgi?id=160657\n // To work around this, we generate two SVGs at different sizes and use image-set to pick between them.\n // Only do this in WebKit to avoid Firefox rendering the cursor at twice the size.\n if (isWebKit()) {\n return `image-set(url(\"data:image/svg+xml,${encodeURIComponent(svg)}\") 1x, url(\"data:image/svg+xml,${encodeURIComponent(svg.replace('width=\"32\" height=\"32\"', 'width=\"64\" height=\"64\"'))}\") 2x) 8 8, ${fallback}`;\n } else {\n return `url(\"data:image/svg+xml,${encodeURIComponent(svg)}\") 8 8, ${fallback}`;\n }\n}\n\ninterface ResizerProps<T> {\n column: GridNode<T>,\n showResizer: boolean,\n triggerRef: RefObject<HTMLDivElement>,\n onResizeStart: (widths: Map<Key, ColumnSize>) => void,\n onResize: (widths: Map<Key, ColumnSize>) => void,\n onResizeEnd: (widths: Map<Key, ColumnSize>) => void\n}\n\nconst CURSORS = {\n ew: getCursor(ewCursor, 'ew-resize'),\n w: getCursor(wCursor, 'w-resize'),\n e: getCursor(eCursor, 'e-resize')\n};\n\nfunction Resizer<T>(props: ResizerProps<T>, ref: RefObject<HTMLInputElement>) {\n let {column, showResizer} = props;\n let {isEmpty, layout, onFocusedResizer} = useTableContext();\n // Virtualizer re-renders, but these components are all cached\n // in order to get around that and cause a rerender here, we use context\n // but we don't actually need any value, they are available on the layout object\n useVirtualizerContext();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/table');\n let {direction} = useLocale();\n\n let [isPointerDown, setIsPointerDown] = useState(false);\n useEffect(() => {\n let setDown = (e) => {\n if (e.pointerType === 'mouse') {\n setIsPointerDown(true);\n }\n };\n let setUp = (e) => {\n if (e.pointerType === 'mouse') {\n setIsPointerDown(false);\n }\n };\n document.addEventListener('pointerdown', setDown, {capture: true});\n document.addEventListener('pointerup', setUp, {capture: true});\n return () => {\n document.removeEventListener('pointerdown', setDown, {capture: true});\n document.removeEventListener('pointerup', setUp, {capture: true});\n };\n }, []);\n\n let {inputProps, resizerProps} = useTableColumnResize<unknown>(\n mergeProps(props, {\n 'aria-label': stringFormatter.format('columnResizer'),\n isDisabled: isEmpty\n }), layout, ref);\n\n let isEResizable = layout.getColumnMinWidth(column.key) >= layout.getColumnWidth(column.key);\n let isWResizable = layout.getColumnMaxWidth(column.key) <= layout.getColumnWidth(column.key);\n let isResizing = layout.resizingColumn === column.key;\n let cursor = '';\n if (isEResizable) {\n cursor = direction === 'rtl' ? CURSORS.w : CURSORS.e;\n } else if (isWResizable) {\n cursor = direction === 'rtl' ? CURSORS.e : CURSORS.w;\n } else {\n cursor = CURSORS.ew;\n }\n\n let style = {\n ...resizerProps.style,\n height: '100%',\n display: showResizer ? undefined : 'none',\n cursor\n };\n\n return (\n <>\n <FocusRing within focusRingClass={classNames(styles, 'focus-ring')}>\n <div\n {...resizerProps}\n role=\"presentation\"\n style={style}\n className={classNames(styles, 'spectrum-Table-columnResizer')}>\n <input\n ref={ref}\n {...mergeProps(inputProps, {onFocus: onFocusedResizer})} />\n </div>\n </FocusRing>\n {/* Placeholder so that the title doesn't intersect with space reserved by the resizer when it appears. */}\n <div\n aria-hidden\n role=\"presentation\"\n className={classNames(styles, 'spectrum-Table-columnResizerPlaceholder')} />\n <CursorOverlay show={isResizing && isPointerDown}>\n <div style={{position: 'fixed', top: 0, left: 0, bottom: 0, right: 0, cursor}} />\n </CursorOverlay>\n </>\n );\n}\n\nfunction CursorOverlay(props) {\n let {show, children} = props;\n return show ? ReactDOM.createPortal(children, document.body) : null;\n}\n\nconst _Resizer = React.forwardRef(Resizer);\nexport {_Resizer as Resizer};\n","module.exports = \"fd8e59d99cf6255b\";","module.exports = \"c65a0be4a6d17c91\";","module.exports = \"d9395620b1a0eaaa\";"],"names":[],"version":3,"file":"Resizer.main.js.map"}
|
package/dist/Resizer.mjs
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import $dIfdp$intlStringsmodulejs from "./intlStrings.mjs";
|
|
2
|
+
import "./vars.42570ef3.css";
|
|
3
|
+
import $dIfdp$table_vars_cssmodulejs from "./table_vars_css.mjs";
|
|
4
|
+
import {useTableContext as $bd013581c0a4b065$export$3cb274deb6c2d854, useVirtualizerContext as $bd013581c0a4b065$export$3f8f74b6bfd2c5df} from "./TableViewBase.mjs";
|
|
5
|
+
import {classNames as $dIfdp$classNames} from "@react-spectrum/utils";
|
|
6
|
+
import {FocusRing as $dIfdp$FocusRing} from "@react-aria/focus";
|
|
7
|
+
import {isWebKit as $dIfdp$isWebKit, mergeProps as $dIfdp$mergeProps} from "@react-aria/utils";
|
|
8
|
+
import $dIfdp$react, {useState as $dIfdp$useState, useEffect as $dIfdp$useEffect} from "react";
|
|
9
|
+
import $dIfdp$reactdom from "react-dom";
|
|
10
|
+
import {useLocalizedStringFormatter as $dIfdp$useLocalizedStringFormatter, useLocale as $dIfdp$useLocale} from "@react-aria/i18n";
|
|
11
|
+
import {useTableColumnResize as $dIfdp$useTableColumnResize} from "@react-aria/table";
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
function $parcel$interopDefault(a) {
|
|
15
|
+
return a && a.__esModule ? a.default : a;
|
|
16
|
+
}
|
|
17
|
+
/* eslint-disable jsx-a11y/role-supports-aria-props */
|
|
18
|
+
var $2fc56f9fdd93be52$exports = {};
|
|
19
|
+
$2fc56f9fdd93be52$exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"-1 0 31 32\">\n <filter id=\"shadow\">\n <feDropShadow dx=\"0\" dy=\"0.5\" stdDeviation=\"1.2\" flood-opacity=\"0.7\"></feDropShadow>\n </filter>\n <g filter=\"url('#shadow')\" transform=\"translate(.5 0)\">\n <path d=\"M9.5,2c.27614,0,.5,.22388,.5,.5v6.5h3v-1.74951c0-.14893,.12215-.25049,.2513-.25049,.05457,0,.1104,.01819,.15875,.05847l2.58995,2.44153-2.58995,2.44153c-.04837,.04028-.10419,.05847-.15875,.05847-.12914,0-.2513-.10156-.2513-.25049v-1.74951h-3v6.5c0,.27612-.22386,.5-.5,.5h-1c-.27614,0-.5-.22388-.5-.5V2.5c0-.27612,.22386-.5,.5-.5h1Zm0-1h-1c-.82843,0-1.5,.67157-1.5,1.5v14c0,.82843,.67157,1.5,1.5,1.5h1c.82843,0,1.5-.67157,1.5-1.5v-5.5h1v.67757c0,.40416,.1632,.80501,.48197,1.05347,.49639,.3869,1.14001,.33571,1.56838-.02144l.02344-.01953,.0222-.02087,2.97589-2.80537c.20937-.19737,.20937-.53028,0-.72765l-2.97589-2.80537-.0222-.02087-.02345-.01965c-.22456-.18713-.5083-.29028-.79895-.29028-.3208,0-.62624,.12134-.86003,.34167-.24872,.23438-.39136,.56567-.39136,.90881v.74951h-1V2.5c0-.82843-.67157-1.5-1.5-1.5Z\" fill=\"#fff\"></path>\n <path d=\"M10,16.5v-6.5h3v1.74952c0,.21196,.24721,.32775,.41005,.19206l2.58995-2.44158-2.58995-2.44158c-.16283-.13569-.41005-.0199-.41005,.19206v1.74952h-3V2.5c0-.27614-.22386-.5-.5-.5h-1c-.27614,0-.5,.22386-.5,.5v14c0,.27614,.22386,.5,.5,.5h1c.27614,0,.5-.22386,.5-.5Z\"></path>\n </g>\n</svg>\n";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
var $ff1f3562a1be2216$exports = {};
|
|
23
|
+
$ff1f3562a1be2216$exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"-1 0 31 32\">\n <filter id=\"shadow\">\n <feDropShadow dx=\"0\" dy=\"0.5\" stdDeviation=\"1.2\" flood-opacity=\"0.7\"></feDropShadow>\n </filter>\n <g filter=\"url('#shadow')\" transform=\"translate(.5 0)\">\n <path fill=\"#fff\" d=\"M9.5,2a.5.5,0,0,1,.5.5V9h3V7.2505A.25014.25014,0,0,1,13.24978,7h.00152a.246.246,0,0,1,.15875.05847L16,9.5l-2.58995,2.44153A.24611.24611,0,0,1,13.2513,12,.25016.25016,0,0,1,13,11.751V10H10v6.5a.5.5,0,0,1-.5.5h-1a.5.5,0,0,1-.5-.5V10H5v1.7495A.25014.25014,0,0,1,4.75022,12H4.7487A.246.246,0,0,1,4.59,11.94153L2,9.5,4.59,7.05847A.246.246,0,0,1,4.7487,7,.25016.25016,0,0,1,5,7.249V9H8V2.5A.5.5,0,0,1,8.5,2Zm0-1h-1A1.5,1.5,0,0,0,7,2.5V8H6V7.32389a1.33,1.33,0,0,0-.4816-1.05444,1.23962,1.23962,0,0,0-1.56876.021l-.02344.01953-.0222.02088L.92812,9.13618A.5.5,0,0,0,.90726,9.843l.02086.02085L3.904,12.66919l.02221.02088.02345.01965a1.23986,1.23986,0,0,0,1.56836.02116A1.3294,1.3294,0,0,0,6,11.6765V11H7v5.5A1.5,1.5,0,0,0,8.5,18h1A1.5,1.5,0,0,0,11,16.5V11h1v.67757a1.32792,1.32792,0,0,0,.482,1.05347,1.24,1.24,0,0,0,1.56839-.02144l.02343-.01953.02221-.02088,2.97588-2.80537a.5.5,0,0,0,.02086-.70679l-.02086-.02085L14.096,6.33081l-.02221-.02087-.02345-.01965A1.24978,1.24978,0,0,0,12,7.2505V8H11V2.5A1.5,1.5,0,0,0,9.5,1Z\"></path>\n <path d=\"M10,16.5V10h3v1.7495a.25.25,0,0,0,.41.19206L16,9.5,13.41,7.05842A.25.25,0,0,0,13,7.2505V9H10V2.5A.5.5,0,0,0,9.5,2h-1a.5.5,0,0,0-.5.5V9H5V7.2505a.25.25,0,0,0-.41-.19206L2,9.5l2.59,2.44158A.25.25,0,0,0,5,11.7495V10H8v6.5a.5.5,0,0,0,.5.5h1A.5.5,0,0,0,10,16.5Z\"></path>\n </g>\n</svg>\n";
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
var $58407c2d4eb33511$exports = {};
|
|
36
|
+
$58407c2d4eb33511$exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"-1 0 31 32\">\n <filter id=\"shadow\">\n <feDropShadow dx=\"0\" dy=\"0.5\" stdDeviation=\"1.2\" flood-opacity=\"0.7\"></feDropShadow>\n </filter>\n <g filter=\"url('#shadow')\" transform=\"translate(.5 0)\">\n <path d=\"M9.5,2c.27614,0,.5,.22388,.5,.5v14c0,.27612-.22386,.5-.5,.5h-1c-.27614,0-.5-.22388-.5-.5v-6.5h-3v1.74951c0,.14893-.12215,.25049-.2513,.25049-.05457,0-.1104-.01819-.15875-.05847l-2.58995-2.44153,2.58995-2.44153c.04837-.04028,.10419-.05847,.15875-.05847,.12914,0,.2513,.10156,.2513,.25049v1.74951h3V2.5c0-.27612,.22386-.5,.5-.5h1Zm0-1h-1c-.82843,0-1.5,.67157-1.5,1.5v5.5h-1v-.67611c0-.40436-.1629-.80555-.48159-1.05444-.4961-.38744-1.14015-.33635-1.56876,.02095l-.02344,.01953-.0222,.02087L.92811,9.13618c-.20937,.19737-.20937,.53028,0,.72765l2.97589,2.80537,.0222,.02087,.02345,.01965c.42839,.35694,1.07208,.40833,1.56837,.02116,.31886-.24875,.48198-.64994,.48198-1.05435v-.67652s.99999,0,.99999,0v5.5c0,.82843,.67157,1.5,1.5,1.5h1c.82843,0,1.5-.67157,1.5-1.5V2.5c0-.82843-.67157-1.5-1.5-1.5Z\" fill=\"#fff\"></path>\n <path d=\"M10,16.5V2.5c0-.27614-.22386-.5-.5-.5h-1c-.27614,0-.5,.22386-.5,.5v6.5h-3v-1.74952c0-.21196-.24721-.32775-.41005-.19206l-2.58995,2.44158,2.58995,2.44158c.16283,.13569,.41005,.0199,.41005-.19206v-1.74952h3v6.5c0,.27614,.22386,.5,.5,.5h1c.27614,0,.5-.22386,.5-.5Z\"></path>\n </g>\n</svg>\n";
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
function $fc695d2eafc2b351$var$getCursor(svg, fallback) {
|
|
40
|
+
// WebKit renders SVG cursors blurry on 2x screens: https://bugs.webkit.org/show_bug.cgi?id=160657
|
|
41
|
+
// To work around this, we generate two SVGs at different sizes and use image-set to pick between them.
|
|
42
|
+
// Only do this in WebKit to avoid Firefox rendering the cursor at twice the size.
|
|
43
|
+
if ((0, $dIfdp$isWebKit)()) return `image-set(url("data:image/svg+xml,${encodeURIComponent(svg)}") 1x, url("data:image/svg+xml,${encodeURIComponent(svg.replace('width="32" height="32"', 'width="64" height="64"'))}") 2x) 8 8, ${fallback}`;
|
|
44
|
+
else return `url("data:image/svg+xml,${encodeURIComponent(svg)}") 8 8, ${fallback}`;
|
|
45
|
+
}
|
|
46
|
+
const $fc695d2eafc2b351$var$CURSORS = {
|
|
47
|
+
ew: $fc695d2eafc2b351$var$getCursor((0, (/*@__PURE__*/$parcel$interopDefault($ff1f3562a1be2216$exports))), "ew-resize"),
|
|
48
|
+
w: $fc695d2eafc2b351$var$getCursor((0, (/*@__PURE__*/$parcel$interopDefault($58407c2d4eb33511$exports))), "w-resize"),
|
|
49
|
+
e: $fc695d2eafc2b351$var$getCursor((0, (/*@__PURE__*/$parcel$interopDefault($2fc56f9fdd93be52$exports))), "e-resize")
|
|
50
|
+
};
|
|
51
|
+
function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
52
|
+
let { column: column, showResizer: showResizer } = props;
|
|
53
|
+
let { isEmpty: isEmpty, layout: layout, onFocusedResizer: onFocusedResizer } = (0, $bd013581c0a4b065$export$3cb274deb6c2d854)();
|
|
54
|
+
// Virtualizer re-renders, but these components are all cached
|
|
55
|
+
// in order to get around that and cause a rerender here, we use context
|
|
56
|
+
// but we don't actually need any value, they are available on the layout object
|
|
57
|
+
(0, $bd013581c0a4b065$export$3f8f74b6bfd2c5df)();
|
|
58
|
+
let stringFormatter = (0, $dIfdp$useLocalizedStringFormatter)((0, ($parcel$interopDefault($dIfdp$intlStringsmodulejs))), "@react-spectrum/table");
|
|
59
|
+
let { direction: direction } = (0, $dIfdp$useLocale)();
|
|
60
|
+
let [isPointerDown, setIsPointerDown] = (0, $dIfdp$useState)(false);
|
|
61
|
+
(0, $dIfdp$useEffect)(()=>{
|
|
62
|
+
let setDown = (e)=>{
|
|
63
|
+
if (e.pointerType === "mouse") setIsPointerDown(true);
|
|
64
|
+
};
|
|
65
|
+
let setUp = (e)=>{
|
|
66
|
+
if (e.pointerType === "mouse") setIsPointerDown(false);
|
|
67
|
+
};
|
|
68
|
+
document.addEventListener("pointerdown", setDown, {
|
|
69
|
+
capture: true
|
|
70
|
+
});
|
|
71
|
+
document.addEventListener("pointerup", setUp, {
|
|
72
|
+
capture: true
|
|
73
|
+
});
|
|
74
|
+
return ()=>{
|
|
75
|
+
document.removeEventListener("pointerdown", setDown, {
|
|
76
|
+
capture: true
|
|
77
|
+
});
|
|
78
|
+
document.removeEventListener("pointerup", setUp, {
|
|
79
|
+
capture: true
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
}, []);
|
|
83
|
+
let { inputProps: inputProps, resizerProps: resizerProps } = (0, $dIfdp$useTableColumnResize)((0, $dIfdp$mergeProps)(props, {
|
|
84
|
+
"aria-label": stringFormatter.format("columnResizer"),
|
|
85
|
+
isDisabled: isEmpty
|
|
86
|
+
}), layout, ref);
|
|
87
|
+
let isEResizable = layout.getColumnMinWidth(column.key) >= layout.getColumnWidth(column.key);
|
|
88
|
+
let isWResizable = layout.getColumnMaxWidth(column.key) <= layout.getColumnWidth(column.key);
|
|
89
|
+
let isResizing = layout.resizingColumn === column.key;
|
|
90
|
+
let cursor = "";
|
|
91
|
+
if (isEResizable) cursor = direction === "rtl" ? $fc695d2eafc2b351$var$CURSORS.w : $fc695d2eafc2b351$var$CURSORS.e;
|
|
92
|
+
else if (isWResizable) cursor = direction === "rtl" ? $fc695d2eafc2b351$var$CURSORS.e : $fc695d2eafc2b351$var$CURSORS.w;
|
|
93
|
+
else cursor = $fc695d2eafc2b351$var$CURSORS.ew;
|
|
94
|
+
let style = {
|
|
95
|
+
...resizerProps.style,
|
|
96
|
+
height: "100%",
|
|
97
|
+
display: showResizer ? undefined : "none",
|
|
98
|
+
cursor: cursor
|
|
99
|
+
};
|
|
100
|
+
return /*#__PURE__*/ (0, $dIfdp$react).createElement((0, $dIfdp$react).Fragment, null, /*#__PURE__*/ (0, $dIfdp$react).createElement((0, $dIfdp$FocusRing), {
|
|
101
|
+
within: true,
|
|
102
|
+
focusRingClass: (0, $dIfdp$classNames)((0, ($parcel$interopDefault($dIfdp$table_vars_cssmodulejs))), "focus-ring")
|
|
103
|
+
}, /*#__PURE__*/ (0, $dIfdp$react).createElement("div", {
|
|
104
|
+
...resizerProps,
|
|
105
|
+
role: "presentation",
|
|
106
|
+
style: style,
|
|
107
|
+
className: (0, $dIfdp$classNames)((0, ($parcel$interopDefault($dIfdp$table_vars_cssmodulejs))), "spectrum-Table-columnResizer")
|
|
108
|
+
}, /*#__PURE__*/ (0, $dIfdp$react).createElement("input", {
|
|
109
|
+
ref: ref,
|
|
110
|
+
...(0, $dIfdp$mergeProps)(inputProps, {
|
|
111
|
+
onFocus: onFocusedResizer
|
|
112
|
+
})
|
|
113
|
+
}))), /*#__PURE__*/ (0, $dIfdp$react).createElement("div", {
|
|
114
|
+
"aria-hidden": true,
|
|
115
|
+
role: "presentation",
|
|
116
|
+
className: (0, $dIfdp$classNames)((0, ($parcel$interopDefault($dIfdp$table_vars_cssmodulejs))), "spectrum-Table-columnResizerPlaceholder")
|
|
117
|
+
}), /*#__PURE__*/ (0, $dIfdp$react).createElement($fc695d2eafc2b351$var$CursorOverlay, {
|
|
118
|
+
show: isResizing && isPointerDown
|
|
119
|
+
}, /*#__PURE__*/ (0, $dIfdp$react).createElement("div", {
|
|
120
|
+
style: {
|
|
121
|
+
position: "fixed",
|
|
122
|
+
top: 0,
|
|
123
|
+
left: 0,
|
|
124
|
+
bottom: 0,
|
|
125
|
+
right: 0,
|
|
126
|
+
cursor: cursor
|
|
127
|
+
}
|
|
128
|
+
})));
|
|
129
|
+
}
|
|
130
|
+
function $fc695d2eafc2b351$var$CursorOverlay(props) {
|
|
131
|
+
let { show: show, children: children } = props;
|
|
132
|
+
return show ? /*#__PURE__*/ (0, $dIfdp$reactdom).createPortal(children, document.body) : null;
|
|
133
|
+
}
|
|
134
|
+
const $fc695d2eafc2b351$export$48a76196cafe3b93 = /*#__PURE__*/ (0, $dIfdp$react).forwardRef($fc695d2eafc2b351$var$Resizer);
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
export {$fc695d2eafc2b351$export$48a76196cafe3b93 as Resizer};
|
|
138
|
+
//# sourceMappingURL=Resizer.mjs.map
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import $dIfdp$intlStringsmodulejs from "./intlStrings.module.js";
|
|
2
|
+
import "./vars.42570ef3.css";
|
|
3
|
+
import $dIfdp$table_vars_cssmodulejs from "./table_vars_css.module.js";
|
|
4
|
+
import {useTableContext as $bd013581c0a4b065$export$3cb274deb6c2d854, useVirtualizerContext as $bd013581c0a4b065$export$3f8f74b6bfd2c5df} from "./TableViewBase.module.js";
|
|
5
|
+
import {classNames as $dIfdp$classNames} from "@react-spectrum/utils";
|
|
6
|
+
import {FocusRing as $dIfdp$FocusRing} from "@react-aria/focus";
|
|
7
|
+
import {isWebKit as $dIfdp$isWebKit, mergeProps as $dIfdp$mergeProps} from "@react-aria/utils";
|
|
8
|
+
import $dIfdp$react, {useState as $dIfdp$useState, useEffect as $dIfdp$useEffect} from "react";
|
|
9
|
+
import $dIfdp$reactdom from "react-dom";
|
|
10
|
+
import {useLocalizedStringFormatter as $dIfdp$useLocalizedStringFormatter, useLocale as $dIfdp$useLocale} from "@react-aria/i18n";
|
|
11
|
+
import {useTableColumnResize as $dIfdp$useTableColumnResize} from "@react-aria/table";
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
function $parcel$interopDefault(a) {
|
|
15
|
+
return a && a.__esModule ? a.default : a;
|
|
16
|
+
}
|
|
17
|
+
/* eslint-disable jsx-a11y/role-supports-aria-props */
|
|
18
|
+
var $2fc56f9fdd93be52$exports = {};
|
|
19
|
+
$2fc56f9fdd93be52$exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"-1 0 31 32\">\n <filter id=\"shadow\">\n <feDropShadow dx=\"0\" dy=\"0.5\" stdDeviation=\"1.2\" flood-opacity=\"0.7\"></feDropShadow>\n </filter>\n <g filter=\"url('#shadow')\" transform=\"translate(.5 0)\">\n <path d=\"M9.5,2c.27614,0,.5,.22388,.5,.5v6.5h3v-1.74951c0-.14893,.12215-.25049,.2513-.25049,.05457,0,.1104,.01819,.15875,.05847l2.58995,2.44153-2.58995,2.44153c-.04837,.04028-.10419,.05847-.15875,.05847-.12914,0-.2513-.10156-.2513-.25049v-1.74951h-3v6.5c0,.27612-.22386,.5-.5,.5h-1c-.27614,0-.5-.22388-.5-.5V2.5c0-.27612,.22386-.5,.5-.5h1Zm0-1h-1c-.82843,0-1.5,.67157-1.5,1.5v14c0,.82843,.67157,1.5,1.5,1.5h1c.82843,0,1.5-.67157,1.5-1.5v-5.5h1v.67757c0,.40416,.1632,.80501,.48197,1.05347,.49639,.3869,1.14001,.33571,1.56838-.02144l.02344-.01953,.0222-.02087,2.97589-2.80537c.20937-.19737,.20937-.53028,0-.72765l-2.97589-2.80537-.0222-.02087-.02345-.01965c-.22456-.18713-.5083-.29028-.79895-.29028-.3208,0-.62624,.12134-.86003,.34167-.24872,.23438-.39136,.56567-.39136,.90881v.74951h-1V2.5c0-.82843-.67157-1.5-1.5-1.5Z\" fill=\"#fff\"></path>\n <path d=\"M10,16.5v-6.5h3v1.74952c0,.21196,.24721,.32775,.41005,.19206l2.58995-2.44158-2.58995-2.44158c-.16283-.13569-.41005-.0199-.41005,.19206v1.74952h-3V2.5c0-.27614-.22386-.5-.5-.5h-1c-.27614,0-.5,.22386-.5,.5v14c0,.27614,.22386,.5,.5,.5h1c.27614,0,.5-.22386,.5-.5Z\"></path>\n </g>\n</svg>\n";
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
var $ff1f3562a1be2216$exports = {};
|
|
23
|
+
$ff1f3562a1be2216$exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"-1 0 31 32\">\n <filter id=\"shadow\">\n <feDropShadow dx=\"0\" dy=\"0.5\" stdDeviation=\"1.2\" flood-opacity=\"0.7\"></feDropShadow>\n </filter>\n <g filter=\"url('#shadow')\" transform=\"translate(.5 0)\">\n <path fill=\"#fff\" d=\"M9.5,2a.5.5,0,0,1,.5.5V9h3V7.2505A.25014.25014,0,0,1,13.24978,7h.00152a.246.246,0,0,1,.15875.05847L16,9.5l-2.58995,2.44153A.24611.24611,0,0,1,13.2513,12,.25016.25016,0,0,1,13,11.751V10H10v6.5a.5.5,0,0,1-.5.5h-1a.5.5,0,0,1-.5-.5V10H5v1.7495A.25014.25014,0,0,1,4.75022,12H4.7487A.246.246,0,0,1,4.59,11.94153L2,9.5,4.59,7.05847A.246.246,0,0,1,4.7487,7,.25016.25016,0,0,1,5,7.249V9H8V2.5A.5.5,0,0,1,8.5,2Zm0-1h-1A1.5,1.5,0,0,0,7,2.5V8H6V7.32389a1.33,1.33,0,0,0-.4816-1.05444,1.23962,1.23962,0,0,0-1.56876.021l-.02344.01953-.0222.02088L.92812,9.13618A.5.5,0,0,0,.90726,9.843l.02086.02085L3.904,12.66919l.02221.02088.02345.01965a1.23986,1.23986,0,0,0,1.56836.02116A1.3294,1.3294,0,0,0,6,11.6765V11H7v5.5A1.5,1.5,0,0,0,8.5,18h1A1.5,1.5,0,0,0,11,16.5V11h1v.67757a1.32792,1.32792,0,0,0,.482,1.05347,1.24,1.24,0,0,0,1.56839-.02144l.02343-.01953.02221-.02088,2.97588-2.80537a.5.5,0,0,0,.02086-.70679l-.02086-.02085L14.096,6.33081l-.02221-.02087-.02345-.01965A1.24978,1.24978,0,0,0,12,7.2505V8H11V2.5A1.5,1.5,0,0,0,9.5,1Z\"></path>\n <path d=\"M10,16.5V10h3v1.7495a.25.25,0,0,0,.41.19206L16,9.5,13.41,7.05842A.25.25,0,0,0,13,7.2505V9H10V2.5A.5.5,0,0,0,9.5,2h-1a.5.5,0,0,0-.5.5V9H5V7.2505a.25.25,0,0,0-.41-.19206L2,9.5l2.59,2.44158A.25.25,0,0,0,5,11.7495V10H8v6.5a.5.5,0,0,0,.5.5h1A.5.5,0,0,0,10,16.5Z\"></path>\n </g>\n</svg>\n";
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
var $58407c2d4eb33511$exports = {};
|
|
36
|
+
$58407c2d4eb33511$exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"-1 0 31 32\">\n <filter id=\"shadow\">\n <feDropShadow dx=\"0\" dy=\"0.5\" stdDeviation=\"1.2\" flood-opacity=\"0.7\"></feDropShadow>\n </filter>\n <g filter=\"url('#shadow')\" transform=\"translate(.5 0)\">\n <path d=\"M9.5,2c.27614,0,.5,.22388,.5,.5v14c0,.27612-.22386,.5-.5,.5h-1c-.27614,0-.5-.22388-.5-.5v-6.5h-3v1.74951c0,.14893-.12215,.25049-.2513,.25049-.05457,0-.1104-.01819-.15875-.05847l-2.58995-2.44153,2.58995-2.44153c.04837-.04028,.10419-.05847,.15875-.05847,.12914,0,.2513,.10156,.2513,.25049v1.74951h3V2.5c0-.27612,.22386-.5,.5-.5h1Zm0-1h-1c-.82843,0-1.5,.67157-1.5,1.5v5.5h-1v-.67611c0-.40436-.1629-.80555-.48159-1.05444-.4961-.38744-1.14015-.33635-1.56876,.02095l-.02344,.01953-.0222,.02087L.92811,9.13618c-.20937,.19737-.20937,.53028,0,.72765l2.97589,2.80537,.0222,.02087,.02345,.01965c.42839,.35694,1.07208,.40833,1.56837,.02116,.31886-.24875,.48198-.64994,.48198-1.05435v-.67652s.99999,0,.99999,0v5.5c0,.82843,.67157,1.5,1.5,1.5h1c.82843,0,1.5-.67157,1.5-1.5V2.5c0-.82843-.67157-1.5-1.5-1.5Z\" fill=\"#fff\"></path>\n <path d=\"M10,16.5V2.5c0-.27614-.22386-.5-.5-.5h-1c-.27614,0-.5,.22386-.5,.5v6.5h-3v-1.74952c0-.21196-.24721-.32775-.41005-.19206l-2.58995,2.44158,2.58995,2.44158c.16283,.13569,.41005,.0199,.41005-.19206v-1.74952h3v6.5c0,.27614,.22386,.5,.5,.5h1c.27614,0,.5-.22386,.5-.5Z\"></path>\n </g>\n</svg>\n";
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
function $fc695d2eafc2b351$var$getCursor(svg, fallback) {
|
|
40
|
+
// WebKit renders SVG cursors blurry on 2x screens: https://bugs.webkit.org/show_bug.cgi?id=160657
|
|
41
|
+
// To work around this, we generate two SVGs at different sizes and use image-set to pick between them.
|
|
42
|
+
// Only do this in WebKit to avoid Firefox rendering the cursor at twice the size.
|
|
43
|
+
if ((0, $dIfdp$isWebKit)()) return `image-set(url("data:image/svg+xml,${encodeURIComponent(svg)}") 1x, url("data:image/svg+xml,${encodeURIComponent(svg.replace('width="32" height="32"', 'width="64" height="64"'))}") 2x) 8 8, ${fallback}`;
|
|
44
|
+
else return `url("data:image/svg+xml,${encodeURIComponent(svg)}") 8 8, ${fallback}`;
|
|
45
|
+
}
|
|
46
|
+
const $fc695d2eafc2b351$var$CURSORS = {
|
|
47
|
+
ew: $fc695d2eafc2b351$var$getCursor((0, (/*@__PURE__*/$parcel$interopDefault($ff1f3562a1be2216$exports))), "ew-resize"),
|
|
48
|
+
w: $fc695d2eafc2b351$var$getCursor((0, (/*@__PURE__*/$parcel$interopDefault($58407c2d4eb33511$exports))), "w-resize"),
|
|
49
|
+
e: $fc695d2eafc2b351$var$getCursor((0, (/*@__PURE__*/$parcel$interopDefault($2fc56f9fdd93be52$exports))), "e-resize")
|
|
50
|
+
};
|
|
51
|
+
function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
52
|
+
let { column: column, showResizer: showResizer } = props;
|
|
53
|
+
let { isEmpty: isEmpty, layout: layout, onFocusedResizer: onFocusedResizer } = (0, $bd013581c0a4b065$export$3cb274deb6c2d854)();
|
|
54
|
+
// Virtualizer re-renders, but these components are all cached
|
|
55
|
+
// in order to get around that and cause a rerender here, we use context
|
|
56
|
+
// but we don't actually need any value, they are available on the layout object
|
|
57
|
+
(0, $bd013581c0a4b065$export$3f8f74b6bfd2c5df)();
|
|
58
|
+
let stringFormatter = (0, $dIfdp$useLocalizedStringFormatter)((0, ($parcel$interopDefault($dIfdp$intlStringsmodulejs))), "@react-spectrum/table");
|
|
59
|
+
let { direction: direction } = (0, $dIfdp$useLocale)();
|
|
60
|
+
let [isPointerDown, setIsPointerDown] = (0, $dIfdp$useState)(false);
|
|
61
|
+
(0, $dIfdp$useEffect)(()=>{
|
|
62
|
+
let setDown = (e)=>{
|
|
63
|
+
if (e.pointerType === "mouse") setIsPointerDown(true);
|
|
64
|
+
};
|
|
65
|
+
let setUp = (e)=>{
|
|
66
|
+
if (e.pointerType === "mouse") setIsPointerDown(false);
|
|
67
|
+
};
|
|
68
|
+
document.addEventListener("pointerdown", setDown, {
|
|
69
|
+
capture: true
|
|
70
|
+
});
|
|
71
|
+
document.addEventListener("pointerup", setUp, {
|
|
72
|
+
capture: true
|
|
73
|
+
});
|
|
74
|
+
return ()=>{
|
|
75
|
+
document.removeEventListener("pointerdown", setDown, {
|
|
76
|
+
capture: true
|
|
77
|
+
});
|
|
78
|
+
document.removeEventListener("pointerup", setUp, {
|
|
79
|
+
capture: true
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
}, []);
|
|
83
|
+
let { inputProps: inputProps, resizerProps: resizerProps } = (0, $dIfdp$useTableColumnResize)((0, $dIfdp$mergeProps)(props, {
|
|
84
|
+
"aria-label": stringFormatter.format("columnResizer"),
|
|
85
|
+
isDisabled: isEmpty
|
|
86
|
+
}), layout, ref);
|
|
87
|
+
let isEResizable = layout.getColumnMinWidth(column.key) >= layout.getColumnWidth(column.key);
|
|
88
|
+
let isWResizable = layout.getColumnMaxWidth(column.key) <= layout.getColumnWidth(column.key);
|
|
89
|
+
let isResizing = layout.resizingColumn === column.key;
|
|
90
|
+
let cursor = "";
|
|
91
|
+
if (isEResizable) cursor = direction === "rtl" ? $fc695d2eafc2b351$var$CURSORS.w : $fc695d2eafc2b351$var$CURSORS.e;
|
|
92
|
+
else if (isWResizable) cursor = direction === "rtl" ? $fc695d2eafc2b351$var$CURSORS.e : $fc695d2eafc2b351$var$CURSORS.w;
|
|
93
|
+
else cursor = $fc695d2eafc2b351$var$CURSORS.ew;
|
|
94
|
+
let style = {
|
|
95
|
+
...resizerProps.style,
|
|
96
|
+
height: "100%",
|
|
97
|
+
display: showResizer ? undefined : "none",
|
|
98
|
+
cursor: cursor
|
|
99
|
+
};
|
|
100
|
+
return /*#__PURE__*/ (0, $dIfdp$react).createElement((0, $dIfdp$react).Fragment, null, /*#__PURE__*/ (0, $dIfdp$react).createElement((0, $dIfdp$FocusRing), {
|
|
101
|
+
within: true,
|
|
102
|
+
focusRingClass: (0, $dIfdp$classNames)((0, ($parcel$interopDefault($dIfdp$table_vars_cssmodulejs))), "focus-ring")
|
|
103
|
+
}, /*#__PURE__*/ (0, $dIfdp$react).createElement("div", {
|
|
104
|
+
...resizerProps,
|
|
105
|
+
role: "presentation",
|
|
106
|
+
style: style,
|
|
107
|
+
className: (0, $dIfdp$classNames)((0, ($parcel$interopDefault($dIfdp$table_vars_cssmodulejs))), "spectrum-Table-columnResizer")
|
|
108
|
+
}, /*#__PURE__*/ (0, $dIfdp$react).createElement("input", {
|
|
109
|
+
ref: ref,
|
|
110
|
+
...(0, $dIfdp$mergeProps)(inputProps, {
|
|
111
|
+
onFocus: onFocusedResizer
|
|
112
|
+
})
|
|
113
|
+
}))), /*#__PURE__*/ (0, $dIfdp$react).createElement("div", {
|
|
114
|
+
"aria-hidden": true,
|
|
115
|
+
role: "presentation",
|
|
116
|
+
className: (0, $dIfdp$classNames)((0, ($parcel$interopDefault($dIfdp$table_vars_cssmodulejs))), "spectrum-Table-columnResizerPlaceholder")
|
|
117
|
+
}), /*#__PURE__*/ (0, $dIfdp$react).createElement($fc695d2eafc2b351$var$CursorOverlay, {
|
|
118
|
+
show: isResizing && isPointerDown
|
|
119
|
+
}, /*#__PURE__*/ (0, $dIfdp$react).createElement("div", {
|
|
120
|
+
style: {
|
|
121
|
+
position: "fixed",
|
|
122
|
+
top: 0,
|
|
123
|
+
left: 0,
|
|
124
|
+
bottom: 0,
|
|
125
|
+
right: 0,
|
|
126
|
+
cursor: cursor
|
|
127
|
+
}
|
|
128
|
+
})));
|
|
129
|
+
}
|
|
130
|
+
function $fc695d2eafc2b351$var$CursorOverlay(props) {
|
|
131
|
+
let { show: show, children: children } = props;
|
|
132
|
+
return show ? /*#__PURE__*/ (0, $dIfdp$reactdom).createPortal(children, document.body) : null;
|
|
133
|
+
}
|
|
134
|
+
const $fc695d2eafc2b351$export$48a76196cafe3b93 = /*#__PURE__*/ (0, $dIfdp$react).forwardRef($fc695d2eafc2b351$var$Resizer);
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
export {$fc695d2eafc2b351$export$48a76196cafe3b93 as Resizer};
|
|
138
|
+
//# sourceMappingURL=Resizer.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAoD;;ACApD,4BAAiB;;;;ACAjB,4BAAiB;;;;;;;;;;;;;ACAjB,4BAAiB;;;AHsBjB,SAAS,gCAAU,GAAW,EAAE,QAAgB;IAC9C,kGAAkG;IAClG,uGAAuG;IACvG,kFAAkF;IAClF,IAAI,CAA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AQ;YAAG,OAAO;oBAAG;QAAM;;AAIpF;AAEA,SAAS,oCAAc,KAAK;IAC1B,IAAI,QAAC,IAAI,YAAE,QAAQ,EAAC,GAAG;IACvB,OAAO,qBAAO,CAAA,GAAA,eAAO,EAAE,YAAY,CAAC,UAAU,SAAS,IAAI,IAAI;AACjE;AAEA,MAAM,0DAAW,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/table/src/Resizer.tsx","node_modules/@parcel/runtime-js/lib/bundles/runtime-a4d2d5b24236251c.js","node_modules/@parcel/runtime-js/lib/bundles/runtime-3b74b2254c084d90.js","node_modules/@parcel/runtime-js/lib/bundles/runtime-363f6d14626169ea.js"],"sourcesContent":["/* eslint-disable jsx-a11y/role-supports-aria-props */\nimport {classNames} from '@react-spectrum/utils';\nimport {ColumnSize} from '@react-types/table';\n// @ts-ignore\nimport eCursor from 'bundle-text:./cursors/Cur_MoveToRight_9_9.svg';\n// @ts-ignore\nimport ewCursor from 'bundle-text:./cursors/Cur_MoveHorizontal_9_9.svg';\nimport {FocusRing} from '@react-aria/focus';\nimport {GridNode} from '@react-types/grid';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {isWebKit, mergeProps} from '@react-aria/utils';\nimport {Key} from '@react-types/shared';\nimport React, {RefObject, useEffect, useState} from 'react';\nimport ReactDOM from 'react-dom';\nimport styles from '@adobe/spectrum-css-temp/components/table/vars.css';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useTableColumnResize} from '@react-aria/table';\nimport {useTableContext, useVirtualizerContext} from './TableViewBase';\n// @ts-ignore\nimport wCursor from 'bundle-text:./cursors/Cur_MoveToLeft_9_9.svg';\n\nfunction getCursor(svg: string, fallback: string) {\n // WebKit renders SVG cursors blurry on 2x screens: https://bugs.webkit.org/show_bug.cgi?id=160657\n // To work around this, we generate two SVGs at different sizes and use image-set to pick between them.\n // Only do this in WebKit to avoid Firefox rendering the cursor at twice the size.\n if (isWebKit()) {\n return `image-set(url(\"data:image/svg+xml,${encodeURIComponent(svg)}\") 1x, url(\"data:image/svg+xml,${encodeURIComponent(svg.replace('width=\"32\" height=\"32\"', 'width=\"64\" height=\"64\"'))}\") 2x) 8 8, ${fallback}`;\n } else {\n return `url(\"data:image/svg+xml,${encodeURIComponent(svg)}\") 8 8, ${fallback}`;\n }\n}\n\ninterface ResizerProps<T> {\n column: GridNode<T>,\n showResizer: boolean,\n triggerRef: RefObject<HTMLDivElement>,\n onResizeStart: (widths: Map<Key, ColumnSize>) => void,\n onResize: (widths: Map<Key, ColumnSize>) => void,\n onResizeEnd: (widths: Map<Key, ColumnSize>) => void\n}\n\nconst CURSORS = {\n ew: getCursor(ewCursor, 'ew-resize'),\n w: getCursor(wCursor, 'w-resize'),\n e: getCursor(eCursor, 'e-resize')\n};\n\nfunction Resizer<T>(props: ResizerProps<T>, ref: RefObject<HTMLInputElement>) {\n let {column, showResizer} = props;\n let {isEmpty, layout, onFocusedResizer} = useTableContext();\n // Virtualizer re-renders, but these components are all cached\n // in order to get around that and cause a rerender here, we use context\n // but we don't actually need any value, they are available on the layout object\n useVirtualizerContext();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/table');\n let {direction} = useLocale();\n\n let [isPointerDown, setIsPointerDown] = useState(false);\n useEffect(() => {\n let setDown = (e) => {\n if (e.pointerType === 'mouse') {\n setIsPointerDown(true);\n }\n };\n let setUp = (e) => {\n if (e.pointerType === 'mouse') {\n setIsPointerDown(false);\n }\n };\n document.addEventListener('pointerdown', setDown, {capture: true});\n document.addEventListener('pointerup', setUp, {capture: true});\n return () => {\n document.removeEventListener('pointerdown', setDown, {capture: true});\n document.removeEventListener('pointerup', setUp, {capture: true});\n };\n }, []);\n\n let {inputProps, resizerProps} = useTableColumnResize<unknown>(\n mergeProps(props, {\n 'aria-label': stringFormatter.format('columnResizer'),\n isDisabled: isEmpty\n }), layout, ref);\n\n let isEResizable = layout.getColumnMinWidth(column.key) >= layout.getColumnWidth(column.key);\n let isWResizable = layout.getColumnMaxWidth(column.key) <= layout.getColumnWidth(column.key);\n let isResizing = layout.resizingColumn === column.key;\n let cursor = '';\n if (isEResizable) {\n cursor = direction === 'rtl' ? CURSORS.w : CURSORS.e;\n } else if (isWResizable) {\n cursor = direction === 'rtl' ? CURSORS.e : CURSORS.w;\n } else {\n cursor = CURSORS.ew;\n }\n\n let style = {\n ...resizerProps.style,\n height: '100%',\n display: showResizer ? undefined : 'none',\n cursor\n };\n\n return (\n <>\n <FocusRing within focusRingClass={classNames(styles, 'focus-ring')}>\n <div\n {...resizerProps}\n role=\"presentation\"\n style={style}\n className={classNames(styles, 'spectrum-Table-columnResizer')}>\n <input\n ref={ref}\n {...mergeProps(inputProps, {onFocus: onFocusedResizer})} />\n </div>\n </FocusRing>\n {/* Placeholder so that the title doesn't intersect with space reserved by the resizer when it appears. */}\n <div\n aria-hidden\n role=\"presentation\"\n className={classNames(styles, 'spectrum-Table-columnResizerPlaceholder')} />\n <CursorOverlay show={isResizing && isPointerDown}>\n <div style={{position: 'fixed', top: 0, left: 0, bottom: 0, right: 0, cursor}} />\n </CursorOverlay>\n </>\n );\n}\n\nfunction CursorOverlay(props) {\n let {show, children} = props;\n return show ? ReactDOM.createPortal(children, document.body) : null;\n}\n\nconst _Resizer = React.forwardRef(Resizer);\nexport {_Resizer as Resizer};\n","module.exports = \"fb5e0424109df74c\";","module.exports = \"b243267b2524b67c\";","module.exports = \"1fd435371c71f5bc\";"],"names":[],"version":3,"file":"Resizer.module.js.map"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var $e39c6de4eb69450d$exports = require("./TableViewBase.main.js");
|
|
2
|
+
var $ijPMf$react = require("react");
|
|
3
|
+
var $ijPMf$reactariavisuallyhidden = require("@react-aria/visually-hidden");
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
function $parcel$interopDefault(a) {
|
|
7
|
+
return a && a.__esModule ? a.default : a;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function $parcel$export(e, n, v, s) {
|
|
11
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
$parcel$export(module.exports, "RootDropIndicator", () => $4a98adf416b1ae5d$export$d30a7814cfd4033e);
|
|
15
|
+
/*
|
|
16
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
17
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
19
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
22
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
23
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
24
|
+
* governing permissions and limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
function $4a98adf416b1ae5d$export$d30a7814cfd4033e() {
|
|
29
|
+
let { dropState: dropState, dragAndDropHooks: dragAndDropHooks, state: state } = (0, $e39c6de4eb69450d$exports.useTableContext)();
|
|
30
|
+
let ref = (0, $ijPMf$react.useRef)();
|
|
31
|
+
let { dropIndicatorProps: dropIndicatorProps } = dragAndDropHooks.useDropIndicator({
|
|
32
|
+
target: {
|
|
33
|
+
type: "root"
|
|
34
|
+
}
|
|
35
|
+
}, dropState, ref);
|
|
36
|
+
let isDropTarget = dropState.isDropTarget({
|
|
37
|
+
type: "root"
|
|
38
|
+
});
|
|
39
|
+
let { visuallyHiddenProps: visuallyHiddenProps } = (0, $ijPMf$reactariavisuallyhidden.useVisuallyHidden)();
|
|
40
|
+
if (!isDropTarget && dropIndicatorProps["aria-hidden"]) return null;
|
|
41
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($ijPMf$react))).createElement("div", {
|
|
42
|
+
role: "row",
|
|
43
|
+
"aria-hidden": dropIndicatorProps["aria-hidden"]
|
|
44
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($ijPMf$react))).createElement("div", {
|
|
45
|
+
role: "gridcell",
|
|
46
|
+
"aria-selected": "false",
|
|
47
|
+
"aria-colspan": state.collection.columns.length
|
|
48
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($ijPMf$react))).createElement("div", {
|
|
49
|
+
role: "button",
|
|
50
|
+
...visuallyHiddenProps,
|
|
51
|
+
...dropIndicatorProps,
|
|
52
|
+
ref: ref
|
|
53
|
+
})));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=RootDropIndicator.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAMM,SAAS;IACd,IAAI,aAAC,SAAS,oBAAE,gBAAgB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,yCAAc;IACzD,IAAI,MAAM,CAAA,GAAA,mBAAK;IACf,IAAI,sBAAC,kBAAkB,EAAC,GAAG,iBAAiB,gBAAgB,CAAC;QAC3D,QAAQ;YAAC,MAAM;QAAM;IACvB,GAAG,WAAW;IACd,IAAI,eAAe,UAAU,YAAY,CAAC;QAAC,MAAM;IAAM;IACvD,IAAI,uBAAC,mBAAmB,EAAC,GAAG,CAAA,GAAA,gDAAgB;IAE5C,IAAI,CAAC,gBAAgB,kBAAkB,CAAC,cAAc,EACpD,OAAO;IAGT,qBACE,0DAAC;QAAI,MAAK;QAAM,eAAa,kBAAkB,CAAC,cAAc;qBAC5D,0DAAC;QACC,MAAK;QACL,iBAAc;QACd,gBAAc,MAAM,UAAU,CAAC,OAAO,CAAC,MAAM;qBAC7C,0DAAC;QAAI,MAAK;QAAU,GAAG,mBAAmB;QAAG,GAAG,kBAAkB;QAAE,KAAK;;AAIjF","sources":["packages/@react-spectrum/table/src/RootDropIndicator.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 React, {useRef} from 'react';\nimport {useTableContext} from './TableViewBase';\nimport {useVisuallyHidden} from '@react-aria/visually-hidden';\n\nexport function RootDropIndicator() {\n let {dropState, dragAndDropHooks, state} = useTableContext();\n let ref = useRef();\n let {dropIndicatorProps} = dragAndDropHooks.useDropIndicator({\n target: {type: 'root'}\n }, dropState, ref);\n let isDropTarget = dropState.isDropTarget({type: 'root'});\n let {visuallyHiddenProps} = useVisuallyHidden();\n\n if (!isDropTarget && dropIndicatorProps['aria-hidden']) {\n return null;\n }\n\n return (\n <div role=\"row\" aria-hidden={dropIndicatorProps['aria-hidden']}>\n <div\n role=\"gridcell\"\n aria-selected=\"false\"\n aria-colspan={state.collection.columns.length}>\n <div role=\"button\" {...visuallyHiddenProps} {...dropIndicatorProps} ref={ref} />\n </div>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"RootDropIndicator.main.js.map"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {useTableContext as $bd013581c0a4b065$export$3cb274deb6c2d854} from "./TableViewBase.mjs";
|
|
2
|
+
import $6tvhl$react, {useRef as $6tvhl$useRef} from "react";
|
|
3
|
+
import {useVisuallyHidden as $6tvhl$useVisuallyHidden} from "@react-aria/visually-hidden";
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Copyright 2023 Adobe. All rights reserved.
|
|
7
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
* governing permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
function $4e6fc36ba71ba405$export$d30a7814cfd4033e() {
|
|
19
|
+
let { dropState: dropState, dragAndDropHooks: dragAndDropHooks, state: state } = (0, $bd013581c0a4b065$export$3cb274deb6c2d854)();
|
|
20
|
+
let ref = (0, $6tvhl$useRef)();
|
|
21
|
+
let { dropIndicatorProps: dropIndicatorProps } = dragAndDropHooks.useDropIndicator({
|
|
22
|
+
target: {
|
|
23
|
+
type: "root"
|
|
24
|
+
}
|
|
25
|
+
}, dropState, ref);
|
|
26
|
+
let isDropTarget = dropState.isDropTarget({
|
|
27
|
+
type: "root"
|
|
28
|
+
});
|
|
29
|
+
let { visuallyHiddenProps: visuallyHiddenProps } = (0, $6tvhl$useVisuallyHidden)();
|
|
30
|
+
if (!isDropTarget && dropIndicatorProps["aria-hidden"]) return null;
|
|
31
|
+
return /*#__PURE__*/ (0, $6tvhl$react).createElement("div", {
|
|
32
|
+
role: "row",
|
|
33
|
+
"aria-hidden": dropIndicatorProps["aria-hidden"]
|
|
34
|
+
}, /*#__PURE__*/ (0, $6tvhl$react).createElement("div", {
|
|
35
|
+
role: "gridcell",
|
|
36
|
+
"aria-selected": "false",
|
|
37
|
+
"aria-colspan": state.collection.columns.length
|
|
38
|
+
}, /*#__PURE__*/ (0, $6tvhl$react).createElement("div", {
|
|
39
|
+
role: "button",
|
|
40
|
+
...visuallyHiddenProps,
|
|
41
|
+
...dropIndicatorProps,
|
|
42
|
+
ref: ref
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export {$4e6fc36ba71ba405$export$d30a7814cfd4033e as RootDropIndicator};
|
|
48
|
+
//# sourceMappingURL=RootDropIndicator.mjs.map
|