@react-spectrum/table 3.14.1 → 3.15.1
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 +1 -1
- package/dist/DragPreview.mjs +1 -1
- package/dist/DragPreview.module.js +1 -1
- package/dist/InsertionIndicator.main.js +4 -3
- package/dist/InsertionIndicator.main.js.map +1 -1
- package/dist/InsertionIndicator.mjs +4 -3
- package/dist/InsertionIndicator.module.js +4 -3
- package/dist/InsertionIndicator.module.js.map +1 -1
- package/dist/Resizer.main.js +7 -7
- package/dist/Resizer.main.js.map +1 -1
- package/dist/Resizer.mjs +8 -8
- package/dist/Resizer.module.js +8 -8
- package/dist/Resizer.module.js.map +1 -1
- package/dist/RootDropIndicator.main.js +1 -1
- package/dist/RootDropIndicator.main.js.map +1 -1
- package/dist/RootDropIndicator.mjs +1 -1
- package/dist/RootDropIndicator.module.js +1 -1
- package/dist/RootDropIndicator.module.js.map +1 -1
- package/dist/TableView.main.js +2 -3
- package/dist/TableView.main.js.map +1 -1
- package/dist/TableView.mjs +2 -3
- package/dist/TableView.module.js +2 -3
- package/dist/TableView.module.js.map +1 -1
- package/dist/TableViewBase.main.js +81 -81
- package/dist/TableViewBase.main.js.map +1 -1
- package/dist/TableViewBase.mjs +81 -81
- package/dist/TableViewBase.module.js +81 -81
- package/dist/TableViewBase.module.js.map +1 -1
- package/dist/TableViewLayout.main.js +7 -5
- package/dist/TableViewLayout.main.js.map +1 -1
- package/dist/TableViewLayout.mjs +7 -5
- package/dist/TableViewLayout.module.js +7 -5
- package/dist/TableViewLayout.module.js.map +1 -1
- package/dist/TableViewWrapper.main.js +4 -5
- package/dist/TableViewWrapper.main.js.map +1 -1
- package/dist/TableViewWrapper.mjs +4 -5
- package/dist/TableViewWrapper.module.js +4 -5
- package/dist/TableViewWrapper.module.js.map +1 -1
- package/dist/TreeGridTableView.main.js +2 -3
- package/dist/TreeGridTableView.main.js.map +1 -1
- package/dist/TreeGridTableView.mjs +2 -3
- package/dist/TreeGridTableView.module.js +2 -3
- package/dist/TreeGridTableView.module.js.map +1 -1
- package/dist/table_vars_css.main.js.map +1 -1
- package/dist/table_vars_css.module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/{vars.bd693cb4.css → vars.27f08d5f.css} +2 -2
- package/dist/{vars.bd693cb4.css.map → vars.27f08d5f.css.map} +1 -1
- package/package.json +29 -29
- package/src/InsertionIndicator.tsx +5 -5
- package/src/Resizer.tsx +11 -13
- package/src/RootDropIndicator.tsx +4 -4
- package/src/TableView.tsx +2 -5
- package/src/TableViewBase.tsx +136 -126
- package/src/TableViewLayout.ts +11 -5
- package/src/TableViewWrapper.tsx +6 -9
- package/src/TreeGridTableView.tsx +2 -5
package/dist/DragPreview.main.js
CHANGED
package/dist/DragPreview.mjs
CHANGED
|
@@ -31,9 +31,10 @@ $parcel$export(module.exports, "InsertionIndicator", () => $c44674ca7612e997$exp
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
function $c44674ca7612e997$export$2c0bab5914a9d088(props) {
|
|
34
|
+
var _rowProps_style, _rowProps_style1, _rowProps_style2;
|
|
34
35
|
let { dropState: dropState, dragAndDropHooks: dragAndDropHooks } = (0, $e39c6de4eb69450d$exports.useTableContext)();
|
|
35
36
|
const { target: target, rowProps: rowProps } = props;
|
|
36
|
-
let ref = (0, $k3Oqb$react.useRef)(
|
|
37
|
+
let ref = (0, $k3Oqb$react.useRef)(null);
|
|
37
38
|
let { dropIndicatorProps: dropIndicatorProps } = dragAndDropHooks.useDropIndicator(props, dropState, ref);
|
|
38
39
|
let { visuallyHiddenProps: visuallyHiddenProps } = (0, $k3Oqb$reactariavisuallyhidden.useVisuallyHidden)();
|
|
39
40
|
let isDropTarget = dropState.isDropTarget(target);
|
|
@@ -41,8 +42,8 @@ function $c44674ca7612e997$export$2c0bab5914a9d088(props) {
|
|
|
41
42
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($k3Oqb$react))).createElement("div", {
|
|
42
43
|
style: {
|
|
43
44
|
position: 'absolute',
|
|
44
|
-
top: rowProps.style.top + (target.dropPosition === 'after' ? rowProps.style.height : 0),
|
|
45
|
-
width: rowProps.style.width
|
|
45
|
+
top: typeof ((_rowProps_style = rowProps.style) === null || _rowProps_style === void 0 ? void 0 : _rowProps_style.top) === 'number' && typeof ((_rowProps_style1 = rowProps.style) === null || _rowProps_style1 === void 0 ? void 0 : _rowProps_style1.height) === 'number' ? rowProps.style.top + (target.dropPosition === 'after' ? rowProps.style.height : 0) : 0,
|
|
46
|
+
width: (_rowProps_style2 = rowProps.style) === null || _rowProps_style2 === void 0 ? void 0 : _rowProps_style2.width
|
|
46
47
|
},
|
|
47
48
|
role: "row",
|
|
48
49
|
"aria-hidden": dropIndicatorProps['aria-hidden']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAcM,SAAS,0CAAmB,KAA8B;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAcM,SAAS,0CAAmB,KAA8B;QAkB7C,iBAA2C,kBAChD;IAlBb,IAAI,aAAC,SAAS,oBAAE,gBAAgB,EAAC,GAAG,CAAA,GAAA,yCAAc;IAClD,MAAM,UAAC,MAAM,YAAE,QAAQ,EAAC,GAAG;IAE3B,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAyB;IACxC,IAAI,sBAAC,kBAAkB,EAAC,GAAG,iBAAkB,gBAAgB,CAAE,OAAO,WAAY;IAClF,IAAI,uBAAC,mBAAmB,EAAC,GAAG,CAAA,GAAA,gDAAgB;IAE5C,IAAI,eAAe,UAAW,YAAY,CAAC;IAE3C,IAAI,CAAC,gBAAgB,kBAAkB,CAAC,cAAc,EACpD,OAAO;IAGT,qBACE,0DAAC;QACC,OAAO;YACL,UAAU;YACV,KAAK,SAAO,kBAAA,SAAS,KAAK,cAAd,sCAAA,gBAAgB,GAAG,MAAK,YAAY,SAAO,mBAAA,SAAS,KAAK,cAAd,uCAAA,iBAAgB,MAAM,MAAK,WAAW,SAAS,KAAK,CAAC,GAAG,GAAI,CAAA,OAAO,YAAY,KAAK,UAAU,SAAS,KAAK,CAAC,MAAM,GAAG,CAAA,IAAK;YAClL,KAAK,GAAE,mBAAA,SAAS,KAAK,cAAd,uCAAA,iBAAgB,KAAK;QAC9B;QACA,MAAK;QACL,eAAa,kBAAkB,CAAC,cAAc;qBAC9C,0DAAC;QACC,MAAK;QACL,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,2CACA;YACE,uDAAuD;QACzD;qBAEJ,0DAAC;QAAK,GAAG,mBAAmB;QAAE,MAAK;QAAU,GAAG,kBAAkB;QAAE,KAAK;;AAIjF","sources":["packages/@react-spectrum/table/src/InsertionIndicator.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 {classNames} from '@react-spectrum/utils';\nimport {FocusableElement, ItemDropTarget} from '@react-types/shared';\nimport React, {DOMAttributes, HTMLAttributes, useRef} from 'react';\nimport styles from './table.css';\nimport {useTableContext} from './TableViewBase';\nimport {useVisuallyHidden} from '@react-aria/visually-hidden';\n\ninterface InsertionIndicatorProps {\n target: ItemDropTarget,\n rowProps: HTMLAttributes<HTMLElement> & DOMAttributes<FocusableElement>\n}\n\nexport function InsertionIndicator(props: InsertionIndicatorProps) {\n let {dropState, dragAndDropHooks} = useTableContext();\n const {target, rowProps} = props;\n\n let ref = useRef<HTMLDivElement | null>(null);\n let {dropIndicatorProps} = dragAndDropHooks!.useDropIndicator!(props, dropState!, ref);\n let {visuallyHiddenProps} = useVisuallyHidden();\n\n let isDropTarget = dropState!.isDropTarget(target);\n\n if (!isDropTarget && dropIndicatorProps['aria-hidden']) {\n return null;\n }\n\n return (\n <div\n style={{\n position: 'absolute',\n top: typeof rowProps.style?.top === 'number' && typeof rowProps.style?.height === 'number' ? rowProps.style.top + (target.dropPosition === 'after' ? rowProps.style.height : 0) : 0,\n width: rowProps.style?.width\n }}\n role=\"row\"\n aria-hidden={dropIndicatorProps['aria-hidden']}>\n <div\n role=\"gridcell\"\n className={\n classNames(\n styles,\n 'react-spectrum-Table-InsertionIndicator',\n {\n 'react-spectrum-Table-InsertionIndicator--dropTarget': isDropTarget\n }\n )}>\n <div {...visuallyHiddenProps} role=\"button\" {...dropIndicatorProps} ref={ref} />\n </div>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"InsertionIndicator.main.js.map"}
|
|
@@ -25,9 +25,10 @@ function $parcel$interopDefault(a) {
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
function $7ee9a922ee4e8032$export$2c0bab5914a9d088(props) {
|
|
28
|
+
var _rowProps_style, _rowProps_style1, _rowProps_style2;
|
|
28
29
|
let { dropState: dropState, dragAndDropHooks: dragAndDropHooks } = (0, $bd013581c0a4b065$export$3cb274deb6c2d854)();
|
|
29
30
|
const { target: target, rowProps: rowProps } = props;
|
|
30
|
-
let ref = (0, $khOO8$useRef)(
|
|
31
|
+
let ref = (0, $khOO8$useRef)(null);
|
|
31
32
|
let { dropIndicatorProps: dropIndicatorProps } = dragAndDropHooks.useDropIndicator(props, dropState, ref);
|
|
32
33
|
let { visuallyHiddenProps: visuallyHiddenProps } = (0, $khOO8$useVisuallyHidden)();
|
|
33
34
|
let isDropTarget = dropState.isDropTarget(target);
|
|
@@ -35,8 +36,8 @@ function $7ee9a922ee4e8032$export$2c0bab5914a9d088(props) {
|
|
|
35
36
|
return /*#__PURE__*/ (0, $khOO8$react).createElement("div", {
|
|
36
37
|
style: {
|
|
37
38
|
position: 'absolute',
|
|
38
|
-
top: rowProps.style.top + (target.dropPosition === 'after' ? rowProps.style.height : 0),
|
|
39
|
-
width: rowProps.style.width
|
|
39
|
+
top: typeof ((_rowProps_style = rowProps.style) === null || _rowProps_style === void 0 ? void 0 : _rowProps_style.top) === 'number' && typeof ((_rowProps_style1 = rowProps.style) === null || _rowProps_style1 === void 0 ? void 0 : _rowProps_style1.height) === 'number' ? rowProps.style.top + (target.dropPosition === 'after' ? rowProps.style.height : 0) : 0,
|
|
40
|
+
width: (_rowProps_style2 = rowProps.style) === null || _rowProps_style2 === void 0 ? void 0 : _rowProps_style2.width
|
|
40
41
|
},
|
|
41
42
|
role: "row",
|
|
42
43
|
"aria-hidden": dropIndicatorProps['aria-hidden']
|
|
@@ -25,9 +25,10 @@ function $parcel$interopDefault(a) {
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
function $7ee9a922ee4e8032$export$2c0bab5914a9d088(props) {
|
|
28
|
+
var _rowProps_style, _rowProps_style1, _rowProps_style2;
|
|
28
29
|
let { dropState: dropState, dragAndDropHooks: dragAndDropHooks } = (0, $bd013581c0a4b065$export$3cb274deb6c2d854)();
|
|
29
30
|
const { target: target, rowProps: rowProps } = props;
|
|
30
|
-
let ref = (0, $khOO8$useRef)(
|
|
31
|
+
let ref = (0, $khOO8$useRef)(null);
|
|
31
32
|
let { dropIndicatorProps: dropIndicatorProps } = dragAndDropHooks.useDropIndicator(props, dropState, ref);
|
|
32
33
|
let { visuallyHiddenProps: visuallyHiddenProps } = (0, $khOO8$useVisuallyHidden)();
|
|
33
34
|
let isDropTarget = dropState.isDropTarget(target);
|
|
@@ -35,8 +36,8 @@ function $7ee9a922ee4e8032$export$2c0bab5914a9d088(props) {
|
|
|
35
36
|
return /*#__PURE__*/ (0, $khOO8$react).createElement("div", {
|
|
36
37
|
style: {
|
|
37
38
|
position: 'absolute',
|
|
38
|
-
top: rowProps.style.top + (target.dropPosition === 'after' ? rowProps.style.height : 0),
|
|
39
|
-
width: rowProps.style.width
|
|
39
|
+
top: typeof ((_rowProps_style = rowProps.style) === null || _rowProps_style === void 0 ? void 0 : _rowProps_style.top) === 'number' && typeof ((_rowProps_style1 = rowProps.style) === null || _rowProps_style1 === void 0 ? void 0 : _rowProps_style1.height) === 'number' ? rowProps.style.top + (target.dropPosition === 'after' ? rowProps.style.height : 0) : 0,
|
|
40
|
+
width: (_rowProps_style2 = rowProps.style) === null || _rowProps_style2 === void 0 ? void 0 : _rowProps_style2.width
|
|
40
41
|
},
|
|
41
42
|
role: "row",
|
|
42
43
|
"aria-hidden": dropIndicatorProps['aria-hidden']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAcM,SAAS,0CAAmB,KAA8B;
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAcM,SAAS,0CAAmB,KAA8B;QAkB7C,iBAA2C,kBAChD;IAlBb,IAAI,aAAC,SAAS,oBAAE,gBAAgB,EAAC,GAAG,CAAA,GAAA,yCAAc;IAClD,MAAM,UAAC,MAAM,YAAE,QAAQ,EAAC,GAAG;IAE3B,IAAI,MAAM,CAAA,GAAA,aAAK,EAAyB;IACxC,IAAI,sBAAC,kBAAkB,EAAC,GAAG,iBAAkB,gBAAgB,CAAE,OAAO,WAAY;IAClF,IAAI,uBAAC,mBAAmB,EAAC,GAAG,CAAA,GAAA,wBAAgB;IAE5C,IAAI,eAAe,UAAW,YAAY,CAAC;IAE3C,IAAI,CAAC,gBAAgB,kBAAkB,CAAC,cAAc,EACpD,OAAO;IAGT,qBACE,gCAAC;QACC,OAAO;YACL,UAAU;YACV,KAAK,SAAO,kBAAA,SAAS,KAAK,cAAd,sCAAA,gBAAgB,GAAG,MAAK,YAAY,SAAO,mBAAA,SAAS,KAAK,cAAd,uCAAA,iBAAgB,MAAM,MAAK,WAAW,SAAS,KAAK,CAAC,GAAG,GAAI,CAAA,OAAO,YAAY,KAAK,UAAU,SAAS,KAAK,CAAC,MAAM,GAAG,CAAA,IAAK;YAClL,KAAK,GAAE,mBAAA,SAAS,KAAK,cAAd,uCAAA,iBAAgB,KAAK;QAC9B;QACA,MAAK;QACL,eAAa,kBAAkB,CAAC,cAAc;qBAC9C,gCAAC;QACC,MAAK;QACL,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,kDAAK,GACL,2CACA;YACE,uDAAuD;QACzD;qBAEJ,gCAAC;QAAK,GAAG,mBAAmB;QAAE,MAAK;QAAU,GAAG,kBAAkB;QAAE,KAAK;;AAIjF","sources":["packages/@react-spectrum/table/src/InsertionIndicator.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 {classNames} from '@react-spectrum/utils';\nimport {FocusableElement, ItemDropTarget} from '@react-types/shared';\nimport React, {DOMAttributes, HTMLAttributes, useRef} from 'react';\nimport styles from './table.css';\nimport {useTableContext} from './TableViewBase';\nimport {useVisuallyHidden} from '@react-aria/visually-hidden';\n\ninterface InsertionIndicatorProps {\n target: ItemDropTarget,\n rowProps: HTMLAttributes<HTMLElement> & DOMAttributes<FocusableElement>\n}\n\nexport function InsertionIndicator(props: InsertionIndicatorProps) {\n let {dropState, dragAndDropHooks} = useTableContext();\n const {target, rowProps} = props;\n\n let ref = useRef<HTMLDivElement | null>(null);\n let {dropIndicatorProps} = dragAndDropHooks!.useDropIndicator!(props, dropState!, ref);\n let {visuallyHiddenProps} = useVisuallyHidden();\n\n let isDropTarget = dropState!.isDropTarget(target);\n\n if (!isDropTarget && dropIndicatorProps['aria-hidden']) {\n return null;\n }\n\n return (\n <div\n style={{\n position: 'absolute',\n top: typeof rowProps.style?.top === 'number' && typeof rowProps.style?.height === 'number' ? rowProps.style.top + (target.dropPosition === 'after' ? rowProps.style.height : 0) : 0,\n width: rowProps.style?.width\n }}\n role=\"row\"\n aria-hidden={dropIndicatorProps['aria-hidden']}>\n <div\n role=\"gridcell\"\n className={\n classNames(\n styles,\n 'react-spectrum-Table-InsertionIndicator',\n {\n 'react-spectrum-Table-InsertionIndicator--dropTarget': isDropTarget\n }\n )}>\n <div {...visuallyHiddenProps} role=\"button\" {...dropIndicatorProps} ref={ref} />\n </div>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"InsertionIndicator.module.js.map"}
|
package/dist/Resizer.main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var $1a3d6ad53eb75d54$exports = require("./intlStrings.main.js");
|
|
2
|
-
require("./vars.
|
|
2
|
+
require("./vars.27f08d5f.css");
|
|
3
3
|
var $982885d0a34882ea$exports = require("./table_vars_css.main.js");
|
|
4
4
|
var $e39c6de4eb69450d$exports = require("./TableViewBase.main.js");
|
|
5
5
|
var $hxFQC$reactspectrumutils = require("@react-spectrum/utils");
|
|
@@ -22,7 +22,7 @@ function $parcel$export(e, n, v, s) {
|
|
|
22
22
|
|
|
23
23
|
$parcel$export(module.exports, "ResizeStateContext", () => $2877766f94c67a67$export$b517d84d4ad20b24);
|
|
24
24
|
$parcel$export(module.exports, "Resizer", () => $2877766f94c67a67$export$48a76196cafe3b93);
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
var $1ed2399e74febaae$exports = {};
|
|
27
27
|
$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";
|
|
28
28
|
|
|
@@ -58,8 +58,9 @@ const $2877766f94c67a67$var$CURSORS = {
|
|
|
58
58
|
e: $2877766f94c67a67$var$getCursor((0, (/*@__PURE__*/$parcel$interopDefault($1ed2399e74febaae$exports))), 'e-resize')
|
|
59
59
|
};
|
|
60
60
|
const $2877766f94c67a67$export$b517d84d4ad20b24 = /*#__PURE__*/ (0, $hxFQC$react.createContext)(null);
|
|
61
|
-
|
|
61
|
+
const $2877766f94c67a67$export$48a76196cafe3b93 = /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$react))).forwardRef(function Resizer(props, ref) {
|
|
62
62
|
let { column: column, showResizer: showResizer } = props;
|
|
63
|
+
let objectRef = (0, $hxFQC$reactariautils.useObjectRef)(ref);
|
|
63
64
|
let { isEmpty: isEmpty, onFocusedResizer: onFocusedResizer } = (0, $e39c6de4eb69450d$exports.useTableContext)();
|
|
64
65
|
let layout = (0, $hxFQC$react.useContext)($2877766f94c67a67$export$b517d84d4ad20b24);
|
|
65
66
|
// Virtualizer re-renders, but these components are all cached
|
|
@@ -94,7 +95,7 @@ function $2877766f94c67a67$var$Resizer(props, ref) {
|
|
|
94
95
|
let { inputProps: inputProps, resizerProps: resizerProps } = (0, $hxFQC$reactariatable.useTableColumnResize)((0, $hxFQC$reactariautils.mergeProps)(props, {
|
|
95
96
|
'aria-label': stringFormatter.format('columnResizer'),
|
|
96
97
|
isDisabled: isEmpty
|
|
97
|
-
}), layout,
|
|
98
|
+
}), layout, objectRef);
|
|
98
99
|
let isEResizable = layout.getColumnMinWidth(column.key) >= layout.getColumnWidth(column.key);
|
|
99
100
|
let isWResizable = layout.getColumnMaxWidth(column.key) <= layout.getColumnWidth(column.key);
|
|
100
101
|
let isResizing = layout.resizingColumn === column.key;
|
|
@@ -117,7 +118,7 @@ function $2877766f94c67a67$var$Resizer(props, ref) {
|
|
|
117
118
|
style: style,
|
|
118
119
|
className: (0, $hxFQC$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), 'spectrum-Table-columnResizer')
|
|
119
120
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$react))).createElement("input", {
|
|
120
|
-
ref:
|
|
121
|
+
ref: objectRef,
|
|
121
122
|
...(0, $hxFQC$reactariautils.mergeProps)(inputProps, {
|
|
122
123
|
onFocus: onFocusedResizer
|
|
123
124
|
})
|
|
@@ -137,14 +138,13 @@ function $2877766f94c67a67$var$Resizer(props, ref) {
|
|
|
137
138
|
cursor: cursor
|
|
138
139
|
}
|
|
139
140
|
})));
|
|
140
|
-
}
|
|
141
|
+
});
|
|
141
142
|
function $2877766f94c67a67$var$CursorOverlay(props) {
|
|
142
143
|
let { show: show, children: children } = props;
|
|
143
144
|
let { getContainer: getContainer } = (0, $hxFQC$reactariaoverlays.useUNSTABLE_PortalContext)();
|
|
144
145
|
var _getContainer;
|
|
145
146
|
return show ? /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$reactdom))).createPortal(children, (_getContainer = getContainer === null || getContainer === void 0 ? void 0 : getContainer()) !== null && _getContainer !== void 0 ? _getContainer : document.body) : null;
|
|
146
147
|
}
|
|
147
|
-
const $2877766f94c67a67$export$48a76196cafe3b93 = /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$react))).forwardRef($2877766f94c67a67$var$Resizer);
|
|
148
148
|
|
|
149
149
|
|
|
150
150
|
//# sourceMappingURL=Resizer.main.js.map
|
package/dist/Resizer.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;ACAA,4BAAiB;;;;ACAjB,4BAAiB;;;;;;;;;;;;;;ACAjB,4BAAiB;;;AHsBjB,SAAS,gCAAU,GAAW,EAAE,QAAgB;IAC9C,kGAAkG;IAClG,uGAAuG;IACvG,kFAAkF;IAClF,IAAI,CAAA,GAAA,8BAAO,KACT,OAAO,CAAC,kCAAkC,EAAE,mBAAmB,KAAK,+BAA+B,EAAE,mBAAmB,IAAI,OAAO,CAAC,0BAA0B,2BAA2B,YAAY,EAAE,UAAU;SAEjN,OAAO,CAAC,wBAAwB,EAAE,mBAAmB,KAAK,QAAQ,EAAE,UAAU;AAElF;AAWA,MAAM,gCAAU;IACd,IAAI,gCAAU,CAAA,GAAA,gEAAO,GAAG;IACxB,GAAG,gCAAU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BAAC,YAAY,EAAC,GAAG,CAAA,GAAA,kDAAwB;QACC;IAA9C,OAAO,qBAAO,CAAA,GAAA,yCAAO,EAAE,YAAY,CAAC,UAAU,CAAA,gBAAA,yBAAA,mCAAA,4BAAA,2BAAA,gBAAoB,SAAS,IAAI,IAAI;AACrF","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":[" \nimport {classNames} from '@react-spectrum/utils';\nimport {ColumnSize} from '@react-types/table';\nimport eCursor from 'bundle-text:./cursors/Cur_MoveToRight_9_9.svg';\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, useObjectRef} from '@react-aria/utils';\nimport {Key, RefObject} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, useContext, useEffect, useState} from 'react';\nimport ReactDOM from 'react-dom';\nimport styles from '@adobe/spectrum-css-temp/components/table/vars.css';\nimport {TableColumnResizeState} from '@react-stately/table';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useTableColumnResize} from '@react-aria/table';\nimport {useTableContext, useVirtualizerContext} from './TableViewBase';\nimport {useUNSTABLE_PortalContext} from '@react-aria/overlays';\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 | null>,\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\nexport const ResizeStateContext = createContext<TableColumnResizeState<unknown> | null>(null);\n\nexport const Resizer = React.forwardRef(function Resizer<T>(props: ResizerProps<T>, ref: ForwardedRef<HTMLInputElement | null>) {\n let {column, showResizer} = props;\n let objectRef = useObjectRef(ref);\n let {isEmpty, onFocusedResizer} = useTableContext();\n let layout = useContext(ResizeStateContext)!;\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, objectRef);\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={objectRef}\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 let {getContainer} = useUNSTABLE_PortalContext();\n return show ? ReactDOM.createPortal(children, getContainer?.() ?? document.body) : null;\n}\n","module.exports = \"fd8e59d99cf6255b\";","module.exports = \"c65a0be4a6d17c91\";","module.exports = \"d9395620b1a0eaaa\";"],"names":[],"version":3,"file":"Resizer.main.js.map"}
|
package/dist/Resizer.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import $dIfdp$intlStringsmodulejs from "./intlStrings.mjs";
|
|
2
|
-
import "./vars.
|
|
2
|
+
import "./vars.27f08d5f.css";
|
|
3
3
|
import $dIfdp$table_vars_cssmodulejs from "./table_vars_css.mjs";
|
|
4
4
|
import {useTableContext as $bd013581c0a4b065$export$3cb274deb6c2d854, useVirtualizerContext as $bd013581c0a4b065$export$3f8f74b6bfd2c5df} from "./TableViewBase.mjs";
|
|
5
5
|
import {classNames as $dIfdp$classNames} from "@react-spectrum/utils";
|
|
6
6
|
import {FocusRing as $dIfdp$FocusRing} from "@react-aria/focus";
|
|
7
|
-
import {isWebKit as $dIfdp$isWebKit, mergeProps as $dIfdp$mergeProps} from "@react-aria/utils";
|
|
7
|
+
import {isWebKit as $dIfdp$isWebKit, useObjectRef as $dIfdp$useObjectRef, mergeProps as $dIfdp$mergeProps} from "@react-aria/utils";
|
|
8
8
|
import $dIfdp$react, {createContext as $dIfdp$createContext, useContext as $dIfdp$useContext, useState as $dIfdp$useState, useEffect as $dIfdp$useEffect} from "react";
|
|
9
9
|
import $dIfdp$reactdom from "react-dom";
|
|
10
10
|
import {useLocalizedStringFormatter as $dIfdp$useLocalizedStringFormatter, useLocale as $dIfdp$useLocale} from "@react-aria/i18n";
|
|
@@ -15,7 +15,7 @@ import {useUNSTABLE_PortalContext as $dIfdp$useUNSTABLE_PortalContext} from "@re
|
|
|
15
15
|
function $parcel$interopDefault(a) {
|
|
16
16
|
return a && a.__esModule ? a.default : a;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
var $2fc56f9fdd93be52$exports = {};
|
|
20
20
|
$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";
|
|
21
21
|
|
|
@@ -51,8 +51,9 @@ const $fc695d2eafc2b351$var$CURSORS = {
|
|
|
51
51
|
e: $fc695d2eafc2b351$var$getCursor((0, (/*@__PURE__*/$parcel$interopDefault($2fc56f9fdd93be52$exports))), 'e-resize')
|
|
52
52
|
};
|
|
53
53
|
const $fc695d2eafc2b351$export$b517d84d4ad20b24 = /*#__PURE__*/ (0, $dIfdp$createContext)(null);
|
|
54
|
-
|
|
54
|
+
const $fc695d2eafc2b351$export$48a76196cafe3b93 = /*#__PURE__*/ (0, $dIfdp$react).forwardRef(function Resizer(props, ref) {
|
|
55
55
|
let { column: column, showResizer: showResizer } = props;
|
|
56
|
+
let objectRef = (0, $dIfdp$useObjectRef)(ref);
|
|
56
57
|
let { isEmpty: isEmpty, onFocusedResizer: onFocusedResizer } = (0, $bd013581c0a4b065$export$3cb274deb6c2d854)();
|
|
57
58
|
let layout = (0, $dIfdp$useContext)($fc695d2eafc2b351$export$b517d84d4ad20b24);
|
|
58
59
|
// Virtualizer re-renders, but these components are all cached
|
|
@@ -87,7 +88,7 @@ function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
|
87
88
|
let { inputProps: inputProps, resizerProps: resizerProps } = (0, $dIfdp$useTableColumnResize)((0, $dIfdp$mergeProps)(props, {
|
|
88
89
|
'aria-label': stringFormatter.format('columnResizer'),
|
|
89
90
|
isDisabled: isEmpty
|
|
90
|
-
}), layout,
|
|
91
|
+
}), layout, objectRef);
|
|
91
92
|
let isEResizable = layout.getColumnMinWidth(column.key) >= layout.getColumnWidth(column.key);
|
|
92
93
|
let isWResizable = layout.getColumnMaxWidth(column.key) <= layout.getColumnWidth(column.key);
|
|
93
94
|
let isResizing = layout.resizingColumn === column.key;
|
|
@@ -110,7 +111,7 @@ function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
|
110
111
|
style: style,
|
|
111
112
|
className: (0, $dIfdp$classNames)((0, ($parcel$interopDefault($dIfdp$table_vars_cssmodulejs))), 'spectrum-Table-columnResizer')
|
|
112
113
|
}, /*#__PURE__*/ (0, $dIfdp$react).createElement("input", {
|
|
113
|
-
ref:
|
|
114
|
+
ref: objectRef,
|
|
114
115
|
...(0, $dIfdp$mergeProps)(inputProps, {
|
|
115
116
|
onFocus: onFocusedResizer
|
|
116
117
|
})
|
|
@@ -130,14 +131,13 @@ function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
|
130
131
|
cursor: cursor
|
|
131
132
|
}
|
|
132
133
|
})));
|
|
133
|
-
}
|
|
134
|
+
});
|
|
134
135
|
function $fc695d2eafc2b351$var$CursorOverlay(props) {
|
|
135
136
|
let { show: show, children: children } = props;
|
|
136
137
|
let { getContainer: getContainer } = (0, $dIfdp$useUNSTABLE_PortalContext)();
|
|
137
138
|
var _getContainer;
|
|
138
139
|
return show ? /*#__PURE__*/ (0, $dIfdp$reactdom).createPortal(children, (_getContainer = getContainer === null || getContainer === void 0 ? void 0 : getContainer()) !== null && _getContainer !== void 0 ? _getContainer : document.body) : null;
|
|
139
140
|
}
|
|
140
|
-
const $fc695d2eafc2b351$export$48a76196cafe3b93 = /*#__PURE__*/ (0, $dIfdp$react).forwardRef($fc695d2eafc2b351$var$Resizer);
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
export {$fc695d2eafc2b351$export$b517d84d4ad20b24 as ResizeStateContext, $fc695d2eafc2b351$export$48a76196cafe3b93 as Resizer};
|
package/dist/Resizer.module.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import $dIfdp$intlStringsmodulejs from "./intlStrings.module.js";
|
|
2
|
-
import "./vars.
|
|
2
|
+
import "./vars.27f08d5f.css";
|
|
3
3
|
import $dIfdp$table_vars_cssmodulejs from "./table_vars_css.module.js";
|
|
4
4
|
import {useTableContext as $bd013581c0a4b065$export$3cb274deb6c2d854, useVirtualizerContext as $bd013581c0a4b065$export$3f8f74b6bfd2c5df} from "./TableViewBase.module.js";
|
|
5
5
|
import {classNames as $dIfdp$classNames} from "@react-spectrum/utils";
|
|
6
6
|
import {FocusRing as $dIfdp$FocusRing} from "@react-aria/focus";
|
|
7
|
-
import {isWebKit as $dIfdp$isWebKit, mergeProps as $dIfdp$mergeProps} from "@react-aria/utils";
|
|
7
|
+
import {isWebKit as $dIfdp$isWebKit, useObjectRef as $dIfdp$useObjectRef, mergeProps as $dIfdp$mergeProps} from "@react-aria/utils";
|
|
8
8
|
import $dIfdp$react, {createContext as $dIfdp$createContext, useContext as $dIfdp$useContext, useState as $dIfdp$useState, useEffect as $dIfdp$useEffect} from "react";
|
|
9
9
|
import $dIfdp$reactdom from "react-dom";
|
|
10
10
|
import {useLocalizedStringFormatter as $dIfdp$useLocalizedStringFormatter, useLocale as $dIfdp$useLocale} from "@react-aria/i18n";
|
|
@@ -15,7 +15,7 @@ import {useUNSTABLE_PortalContext as $dIfdp$useUNSTABLE_PortalContext} from "@re
|
|
|
15
15
|
function $parcel$interopDefault(a) {
|
|
16
16
|
return a && a.__esModule ? a.default : a;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
var $2fc56f9fdd93be52$exports = {};
|
|
20
20
|
$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";
|
|
21
21
|
|
|
@@ -51,8 +51,9 @@ const $fc695d2eafc2b351$var$CURSORS = {
|
|
|
51
51
|
e: $fc695d2eafc2b351$var$getCursor((0, (/*@__PURE__*/$parcel$interopDefault($2fc56f9fdd93be52$exports))), 'e-resize')
|
|
52
52
|
};
|
|
53
53
|
const $fc695d2eafc2b351$export$b517d84d4ad20b24 = /*#__PURE__*/ (0, $dIfdp$createContext)(null);
|
|
54
|
-
|
|
54
|
+
const $fc695d2eafc2b351$export$48a76196cafe3b93 = /*#__PURE__*/ (0, $dIfdp$react).forwardRef(function Resizer(props, ref) {
|
|
55
55
|
let { column: column, showResizer: showResizer } = props;
|
|
56
|
+
let objectRef = (0, $dIfdp$useObjectRef)(ref);
|
|
56
57
|
let { isEmpty: isEmpty, onFocusedResizer: onFocusedResizer } = (0, $bd013581c0a4b065$export$3cb274deb6c2d854)();
|
|
57
58
|
let layout = (0, $dIfdp$useContext)($fc695d2eafc2b351$export$b517d84d4ad20b24);
|
|
58
59
|
// Virtualizer re-renders, but these components are all cached
|
|
@@ -87,7 +88,7 @@ function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
|
87
88
|
let { inputProps: inputProps, resizerProps: resizerProps } = (0, $dIfdp$useTableColumnResize)((0, $dIfdp$mergeProps)(props, {
|
|
88
89
|
'aria-label': stringFormatter.format('columnResizer'),
|
|
89
90
|
isDisabled: isEmpty
|
|
90
|
-
}), layout,
|
|
91
|
+
}), layout, objectRef);
|
|
91
92
|
let isEResizable = layout.getColumnMinWidth(column.key) >= layout.getColumnWidth(column.key);
|
|
92
93
|
let isWResizable = layout.getColumnMaxWidth(column.key) <= layout.getColumnWidth(column.key);
|
|
93
94
|
let isResizing = layout.resizingColumn === column.key;
|
|
@@ -110,7 +111,7 @@ function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
|
110
111
|
style: style,
|
|
111
112
|
className: (0, $dIfdp$classNames)((0, ($parcel$interopDefault($dIfdp$table_vars_cssmodulejs))), 'spectrum-Table-columnResizer')
|
|
112
113
|
}, /*#__PURE__*/ (0, $dIfdp$react).createElement("input", {
|
|
113
|
-
ref:
|
|
114
|
+
ref: objectRef,
|
|
114
115
|
...(0, $dIfdp$mergeProps)(inputProps, {
|
|
115
116
|
onFocus: onFocusedResizer
|
|
116
117
|
})
|
|
@@ -130,14 +131,13 @@ function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
|
130
131
|
cursor: cursor
|
|
131
132
|
}
|
|
132
133
|
})));
|
|
133
|
-
}
|
|
134
|
+
});
|
|
134
135
|
function $fc695d2eafc2b351$var$CursorOverlay(props) {
|
|
135
136
|
let { show: show, children: children } = props;
|
|
136
137
|
let { getContainer: getContainer } = (0, $dIfdp$useUNSTABLE_PortalContext)();
|
|
137
138
|
var _getContainer;
|
|
138
139
|
return show ? /*#__PURE__*/ (0, $dIfdp$reactdom).createPortal(children, (_getContainer = getContainer === null || getContainer === void 0 ? void 0 : getContainer()) !== null && _getContainer !== void 0 ? _getContainer : document.body) : null;
|
|
139
140
|
}
|
|
140
|
-
const $fc695d2eafc2b351$export$48a76196cafe3b93 = /*#__PURE__*/ (0, $dIfdp$react).forwardRef($fc695d2eafc2b351$var$Resizer);
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
export {$fc695d2eafc2b351$export$b517d84d4ad20b24 as ResizeStateContext, $fc695d2eafc2b351$export$48a76196cafe3b93 as Resizer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;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AAS,EAAE,CAAA,GAAA,uDAAK,GAAG;qBAC9B,gCAAC;QACC,KAAK;QACJ,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY;YAAC,SAAS;QAAgB,EAAE;wBAI7D,gCAAC;QACC,eAAA;QACA,MAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;sBAChC,gCAAC;QAAc,MAAM,cAAc;qBACjC,gCAAC;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,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,gCAAwB;QACC;IAA9C,OAAO,qBAAO,CAAA,GAAA,eAAO,EAAE,YAAY,CAAC,UAAU,CAAA,gBAAA,yBAAA,mCAAA,4BAAA,2BAAA,gBAAoB,SAAS,IAAI,IAAI;AACrF","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":[" \nimport {classNames} from '@react-spectrum/utils';\nimport {ColumnSize} from '@react-types/table';\nimport eCursor from 'bundle-text:./cursors/Cur_MoveToRight_9_9.svg';\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, useObjectRef} from '@react-aria/utils';\nimport {Key, RefObject} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, useContext, useEffect, useState} from 'react';\nimport ReactDOM from 'react-dom';\nimport styles from '@adobe/spectrum-css-temp/components/table/vars.css';\nimport {TableColumnResizeState} from '@react-stately/table';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useTableColumnResize} from '@react-aria/table';\nimport {useTableContext, useVirtualizerContext} from './TableViewBase';\nimport {useUNSTABLE_PortalContext} from '@react-aria/overlays';\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 | null>,\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\nexport const ResizeStateContext = createContext<TableColumnResizeState<unknown> | null>(null);\n\nexport const Resizer = React.forwardRef(function Resizer<T>(props: ResizerProps<T>, ref: ForwardedRef<HTMLInputElement | null>) {\n let {column, showResizer} = props;\n let objectRef = useObjectRef(ref);\n let {isEmpty, onFocusedResizer} = useTableContext();\n let layout = useContext(ResizeStateContext)!;\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, objectRef);\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={objectRef}\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 let {getContainer} = useUNSTABLE_PortalContext();\n return show ? ReactDOM.createPortal(children, getContainer?.() ?? document.body) : null;\n}\n","module.exports = \"fb5e0424109df74c\";","module.exports = \"b243267b2524b67c\";","module.exports = \"1fd435371c71f5bc\";"],"names":[],"version":3,"file":"Resizer.module.js.map"}
|
|
@@ -27,7 +27,7 @@ $parcel$export(module.exports, "RootDropIndicator", () => $4a98adf416b1ae5d$expo
|
|
|
27
27
|
|
|
28
28
|
function $4a98adf416b1ae5d$export$d30a7814cfd4033e() {
|
|
29
29
|
let { dropState: dropState, dragAndDropHooks: dragAndDropHooks, state: state } = (0, $e39c6de4eb69450d$exports.useTableContext)();
|
|
30
|
-
let ref = (0, $ijPMf$react.useRef)(
|
|
30
|
+
let ref = (0, $ijPMf$react.useRef)(null);
|
|
31
31
|
let { dropIndicatorProps: dropIndicatorProps } = dragAndDropHooks.useDropIndicator({
|
|
32
32
|
target: {
|
|
33
33
|
type: 'root'
|
|
@@ -1 +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,
|
|
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,EAAyB;IACxC,IAAI,sBAAC,kBAAkB,EAAC,GAAG,iBAAkB,gBAAgB,CAAE;QAC7D,QAAQ;YAAC,MAAM;QAAM;IACvB,GAAG,WAAY;IACf,IAAI,eAAe,UAAW,YAAY,CAAC;QAAC,MAAM;IAAM;IACxD,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<HTMLDivElement | null>(null);\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"}
|
|
@@ -17,7 +17,7 @@ import {useVisuallyHidden as $6tvhl$useVisuallyHidden} from "@react-aria/visuall
|
|
|
17
17
|
|
|
18
18
|
function $4e6fc36ba71ba405$export$d30a7814cfd4033e() {
|
|
19
19
|
let { dropState: dropState, dragAndDropHooks: dragAndDropHooks, state: state } = (0, $bd013581c0a4b065$export$3cb274deb6c2d854)();
|
|
20
|
-
let ref = (0, $6tvhl$useRef)(
|
|
20
|
+
let ref = (0, $6tvhl$useRef)(null);
|
|
21
21
|
let { dropIndicatorProps: dropIndicatorProps } = dragAndDropHooks.useDropIndicator({
|
|
22
22
|
target: {
|
|
23
23
|
type: 'root'
|
|
@@ -17,7 +17,7 @@ import {useVisuallyHidden as $6tvhl$useVisuallyHidden} from "@react-aria/visuall
|
|
|
17
17
|
|
|
18
18
|
function $4e6fc36ba71ba405$export$d30a7814cfd4033e() {
|
|
19
19
|
let { dropState: dropState, dragAndDropHooks: dragAndDropHooks, state: state } = (0, $bd013581c0a4b065$export$3cb274deb6c2d854)();
|
|
20
|
-
let ref = (0, $6tvhl$useRef)(
|
|
20
|
+
let ref = (0, $6tvhl$useRef)(null);
|
|
21
21
|
let { dropIndicatorProps: dropIndicatorProps } = dragAndDropHooks.useDropIndicator({
|
|
22
22
|
target: {
|
|
23
23
|
type: 'root'
|
|
@@ -1 +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,aAAK,
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAMM,SAAS;IACd,IAAI,aAAC,SAAS,oBAAE,gBAAgB,SAAE,KAAK,EAAC,GAAG,CAAA,GAAA,yCAAc;IACzD,IAAI,MAAM,CAAA,GAAA,aAAK,EAAyB;IACxC,IAAI,sBAAC,kBAAkB,EAAC,GAAG,iBAAkB,gBAAgB,CAAE;QAC7D,QAAQ;YAAC,MAAM;QAAM;IACvB,GAAG,WAAY;IACf,IAAI,eAAe,UAAW,YAAY,CAAC;QAAC,MAAM;IAAM;IACxD,IAAI,uBAAC,mBAAmB,EAAC,GAAG,CAAA,GAAA,wBAAgB;IAE5C,IAAI,CAAC,gBAAgB,kBAAkB,CAAC,cAAc,EACpD,OAAO;IAGT,qBACE,gCAAC;QAAI,MAAK;QAAM,eAAa,kBAAkB,CAAC,cAAc;qBAC5D,gCAAC;QACC,MAAK;QACL,iBAAc;QACd,gBAAc,MAAM,UAAU,CAAC,OAAO,CAAC,MAAM;qBAC7C,gCAAC;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<HTMLDivElement | null>(null);\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.module.js.map"}
|
package/dist/TableView.main.js
CHANGED
|
@@ -25,7 +25,7 @@ $parcel$export(module.exports, "TableView", () => $be8a9c035a82f788$export$b3c27
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
const $be8a9c035a82f788$export$b3c27e869d856b7 = /*#__PURE__*/ (0, ($parcel$interopDefault($3lcIF$react))).forwardRef(function TableView(props, ref) {
|
|
29
29
|
let { selectionStyle: selectionStyle, dragAndDropHooks: dragAndDropHooks } = props;
|
|
30
30
|
let [showSelectionCheckboxes, setShowSelectionCheckboxes] = (0, $3lcIF$react.useState)(selectionStyle !== 'highlight');
|
|
31
31
|
let isTableDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
|
|
@@ -43,8 +43,7 @@ function $be8a9c035a82f788$var$TableView(props, ref) {
|
|
|
43
43
|
state: state,
|
|
44
44
|
ref: ref
|
|
45
45
|
});
|
|
46
|
-
}
|
|
47
|
-
const $be8a9c035a82f788$export$b3c27e869d856b7 = /*#__PURE__*/ (0, ($parcel$interopDefault($3lcIF$react))).forwardRef($be8a9c035a82f788$var$TableView);
|
|
46
|
+
});
|
|
48
47
|
|
|
49
48
|
|
|
50
49
|
//# sourceMappingURL=TableView.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAUM,MAAM,yDAAY,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,UAA4B,KAAoB,EAAE,GAA2B;IAC9H,IAAI,kBACF,cAAc,oBACd,gBAAgB,EACjB,GAAG;IACJ,IAAI,CAAC,yBAAyB,2BAA2B,GAAG,CAAA,GAAA,qBAAO,EAAE,mBAAmB;IACxF,IAAI,mBAAmB,CAAC,EAAC,6BAAA,uCAAA,iBAAkB,2BAA2B;IACtE,IAAI,QAAQ,CAAA,GAAA,sCAAY,EAAE;QACxB,GAAG,KAAK;iCACR;QACA,iBAAiB;QACjB,mBAAmB,MAAM,cAAc,KAAK,cAAc,YAAY;IACxE;IAEA,+HAA+H;IAC/H,IAAI,uBAAuB,MAAM,gBAAgB,CAAC,iBAAiB,KAAK;IACxE,IAAI,yBAAyB,yBAC3B,2BAA2B;IAG7B,qBACE,0DAAC,CAAA,GAAA,uCAAY;QAAG,GAAG,KAAK;QAAE,OAAO;QAAO,KAAK;;AAEjD","sources":["packages/@react-spectrum/table/src/TableView.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 {DOMRef} from '@react-types/shared';\nimport React, {ReactElement, useState} from 'react';\nimport {SpectrumTableProps} from './TableViewWrapper';\nimport {TableViewBase} from './TableViewBase';\nimport {useTableState} from '@react-stately/table';\n\ninterface TableProps<T> extends Omit<SpectrumTableProps<T>, 'UNSTABLE_allowsExpandableRows'> {}\n\nexport const TableView = React.forwardRef(function TableView<T extends object>(props: TableProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {\n selectionStyle,\n dragAndDropHooks\n } = props;\n let [showSelectionCheckboxes, setShowSelectionCheckboxes] = useState(selectionStyle !== 'highlight');\n let isTableDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let state = useTableState({\n ...props,\n showSelectionCheckboxes,\n showDragButtons: isTableDraggable,\n selectionBehavior: props.selectionStyle === 'highlight' ? 'replace' : 'toggle'\n });\n\n // If the selection behavior changes in state, we need to update showSelectionCheckboxes here due to the circular dependency...\n let shouldShowCheckboxes = state.selectionManager.selectionBehavior !== 'replace';\n if (shouldShowCheckboxes !== showSelectionCheckboxes) {\n setShowSelectionCheckboxes(shouldShowCheckboxes);\n }\n\n return (\n <TableViewBase {...props} state={state} ref={ref} />\n );\n}) as <T>(props: TableProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"TableView.main.js.map"}
|
package/dist/TableView.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import {useTableState as $9W9sm$useTableState} from "@react-stately/table";
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
const $d14697b14e638114$export$b3c27e869d856b7 = /*#__PURE__*/ (0, $9W9sm$react).forwardRef(function TableView(props, ref) {
|
|
19
19
|
let { selectionStyle: selectionStyle, dragAndDropHooks: dragAndDropHooks } = props;
|
|
20
20
|
let [showSelectionCheckboxes, setShowSelectionCheckboxes] = (0, $9W9sm$useState)(selectionStyle !== 'highlight');
|
|
21
21
|
let isTableDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
|
|
@@ -33,8 +33,7 @@ function $d14697b14e638114$var$TableView(props, ref) {
|
|
|
33
33
|
state: state,
|
|
34
34
|
ref: ref
|
|
35
35
|
});
|
|
36
|
-
}
|
|
37
|
-
const $d14697b14e638114$export$b3c27e869d856b7 = /*#__PURE__*/ (0, $9W9sm$react).forwardRef($d14697b14e638114$var$TableView);
|
|
36
|
+
});
|
|
38
37
|
|
|
39
38
|
|
|
40
39
|
export {$d14697b14e638114$export$b3c27e869d856b7 as TableView};
|
package/dist/TableView.module.js
CHANGED
|
@@ -15,7 +15,7 @@ import {useTableState as $9W9sm$useTableState} from "@react-stately/table";
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
const $d14697b14e638114$export$b3c27e869d856b7 = /*#__PURE__*/ (0, $9W9sm$react).forwardRef(function TableView(props, ref) {
|
|
19
19
|
let { selectionStyle: selectionStyle, dragAndDropHooks: dragAndDropHooks } = props;
|
|
20
20
|
let [showSelectionCheckboxes, setShowSelectionCheckboxes] = (0, $9W9sm$useState)(selectionStyle !== 'highlight');
|
|
21
21
|
let isTableDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
|
|
@@ -33,8 +33,7 @@ function $d14697b14e638114$var$TableView(props, ref) {
|
|
|
33
33
|
state: state,
|
|
34
34
|
ref: ref
|
|
35
35
|
});
|
|
36
|
-
}
|
|
37
|
-
const $d14697b14e638114$export$b3c27e869d856b7 = /*#__PURE__*/ (0, $9W9sm$react).forwardRef($d14697b14e638114$var$TableView);
|
|
36
|
+
});
|
|
38
37
|
|
|
39
38
|
|
|
40
39
|
export {$d14697b14e638114$export$b3c27e869d856b7 as TableView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAUM,MAAM,yDAAY,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,UAA4B,KAAoB,EAAE,GAA2B;IAC9H,IAAI,kBACF,cAAc,oBACd,gBAAgB,EACjB,GAAG;IACJ,IAAI,CAAC,yBAAyB,2BAA2B,GAAG,CAAA,GAAA,eAAO,EAAE,mBAAmB;IACxF,IAAI,mBAAmB,CAAC,EAAC,6BAAA,uCAAA,iBAAkB,2BAA2B;IACtE,IAAI,QAAQ,CAAA,GAAA,oBAAY,EAAE;QACxB,GAAG,KAAK;iCACR;QACA,iBAAiB;QACjB,mBAAmB,MAAM,cAAc,KAAK,cAAc,YAAY;IACxE;IAEA,+HAA+H;IAC/H,IAAI,uBAAuB,MAAM,gBAAgB,CAAC,iBAAiB,KAAK;IACxE,IAAI,yBAAyB,yBAC3B,2BAA2B;IAG7B,qBACE,gCAAC,CAAA,GAAA,yCAAY;QAAG,GAAG,KAAK;QAAE,OAAO;QAAO,KAAK;;AAEjD","sources":["packages/@react-spectrum/table/src/TableView.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 {DOMRef} from '@react-types/shared';\nimport React, {ReactElement, useState} from 'react';\nimport {SpectrumTableProps} from './TableViewWrapper';\nimport {TableViewBase} from './TableViewBase';\nimport {useTableState} from '@react-stately/table';\n\ninterface TableProps<T> extends Omit<SpectrumTableProps<T>, 'UNSTABLE_allowsExpandableRows'> {}\n\nexport const TableView = React.forwardRef(function TableView<T extends object>(props: TableProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {\n selectionStyle,\n dragAndDropHooks\n } = props;\n let [showSelectionCheckboxes, setShowSelectionCheckboxes] = useState(selectionStyle !== 'highlight');\n let isTableDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let state = useTableState({\n ...props,\n showSelectionCheckboxes,\n showDragButtons: isTableDraggable,\n selectionBehavior: props.selectionStyle === 'highlight' ? 'replace' : 'toggle'\n });\n\n // If the selection behavior changes in state, we need to update showSelectionCheckboxes here due to the circular dependency...\n let shouldShowCheckboxes = state.selectionManager.selectionBehavior !== 'replace';\n if (shouldShowCheckboxes !== showSelectionCheckboxes) {\n setShowSelectionCheckboxes(shouldShowCheckboxes);\n }\n\n return (\n <TableViewBase {...props} state={state} ref={ref} />\n );\n}) as <T>(props: TableProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"TableView.module.js.map"}
|