@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,48 @@
|
|
|
1
|
+
import {useTableContext as $bd013581c0a4b065$export$3cb274deb6c2d854} from "./TableViewBase.module.js";
|
|
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.module.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,aAAK;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,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();\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"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var $e39c6de4eb69450d$exports = require("./TableViewBase.main.js");
|
|
2
|
+
var $3lcIF$react = require("react");
|
|
3
|
+
var $3lcIF$reactstatelytable = require("@react-stately/table");
|
|
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, "TableView", () => $be8a9c035a82f788$export$b3c27e869d856b7);
|
|
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 $be8a9c035a82f788$var$TableView(props, ref) {
|
|
29
|
+
let { selectionStyle: selectionStyle, dragAndDropHooks: dragAndDropHooks } = props;
|
|
30
|
+
let [showSelectionCheckboxes, setShowSelectionCheckboxes] = (0, $3lcIF$react.useState)(selectionStyle !== "highlight");
|
|
31
|
+
let isTableDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
|
|
32
|
+
let state = (0, $3lcIF$reactstatelytable.useTableState)({
|
|
33
|
+
...props,
|
|
34
|
+
showSelectionCheckboxes: showSelectionCheckboxes,
|
|
35
|
+
showDragButtons: isTableDraggable,
|
|
36
|
+
selectionBehavior: props.selectionStyle === "highlight" ? "replace" : "toggle"
|
|
37
|
+
});
|
|
38
|
+
// If the selection behavior changes in state, we need to update showSelectionCheckboxes here due to the circular dependency...
|
|
39
|
+
let shouldShowCheckboxes = state.selectionManager.selectionBehavior !== "replace";
|
|
40
|
+
if (shouldShowCheckboxes !== showSelectionCheckboxes) setShowSelectionCheckboxes(shouldShowCheckboxes);
|
|
41
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($3lcIF$react))).createElement((0, $e39c6de4eb69450d$exports.TableViewBase), {
|
|
42
|
+
...props,
|
|
43
|
+
state: state,
|
|
44
|
+
ref: ref
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const $be8a9c035a82f788$export$b3c27e869d856b7 = /*#__PURE__*/ (0, ($parcel$interopDefault($3lcIF$react))).forwardRef($be8a9c035a82f788$var$TableView);
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=TableView.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAUD,SAAS,gCAA4B,KAAoB,EAAE,GAA2B;IACpF,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;AAEA,MAAM,yDAAa,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","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\nfunction 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}\n\nconst _TableView = React.forwardRef(TableView) as <T>(props: TableProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_TableView as TableView};\n"],"names":[],"version":3,"file":"TableView.main.js.map"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {TableViewBase as $bd013581c0a4b065$export$517e02184d273d69} from "./TableViewBase.mjs";
|
|
2
|
+
import $9W9sm$react, {useState as $9W9sm$useState} from "react";
|
|
3
|
+
import {useTableState as $9W9sm$useTableState} from "@react-stately/table";
|
|
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 $d14697b14e638114$var$TableView(props, ref) {
|
|
19
|
+
let { selectionStyle: selectionStyle, dragAndDropHooks: dragAndDropHooks } = props;
|
|
20
|
+
let [showSelectionCheckboxes, setShowSelectionCheckboxes] = (0, $9W9sm$useState)(selectionStyle !== "highlight");
|
|
21
|
+
let isTableDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
|
|
22
|
+
let state = (0, $9W9sm$useTableState)({
|
|
23
|
+
...props,
|
|
24
|
+
showSelectionCheckboxes: showSelectionCheckboxes,
|
|
25
|
+
showDragButtons: isTableDraggable,
|
|
26
|
+
selectionBehavior: props.selectionStyle === "highlight" ? "replace" : "toggle"
|
|
27
|
+
});
|
|
28
|
+
// If the selection behavior changes in state, we need to update showSelectionCheckboxes here due to the circular dependency...
|
|
29
|
+
let shouldShowCheckboxes = state.selectionManager.selectionBehavior !== "replace";
|
|
30
|
+
if (shouldShowCheckboxes !== showSelectionCheckboxes) setShowSelectionCheckboxes(shouldShowCheckboxes);
|
|
31
|
+
return /*#__PURE__*/ (0, $9W9sm$react).createElement((0, $bd013581c0a4b065$export$517e02184d273d69), {
|
|
32
|
+
...props,
|
|
33
|
+
state: state,
|
|
34
|
+
ref: ref
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const $d14697b14e638114$export$b3c27e869d856b7 = /*#__PURE__*/ (0, $9W9sm$react).forwardRef($d14697b14e638114$var$TableView);
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
export {$d14697b14e638114$export$b3c27e869d856b7 as TableView};
|
|
41
|
+
//# sourceMappingURL=TableView.mjs.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {TableViewBase as $bd013581c0a4b065$export$517e02184d273d69} from "./TableViewBase.module.js";
|
|
2
|
+
import $9W9sm$react, {useState as $9W9sm$useState} from "react";
|
|
3
|
+
import {useTableState as $9W9sm$useTableState} from "@react-stately/table";
|
|
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 $d14697b14e638114$var$TableView(props, ref) {
|
|
19
|
+
let { selectionStyle: selectionStyle, dragAndDropHooks: dragAndDropHooks } = props;
|
|
20
|
+
let [showSelectionCheckboxes, setShowSelectionCheckboxes] = (0, $9W9sm$useState)(selectionStyle !== "highlight");
|
|
21
|
+
let isTableDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
|
|
22
|
+
let state = (0, $9W9sm$useTableState)({
|
|
23
|
+
...props,
|
|
24
|
+
showSelectionCheckboxes: showSelectionCheckboxes,
|
|
25
|
+
showDragButtons: isTableDraggable,
|
|
26
|
+
selectionBehavior: props.selectionStyle === "highlight" ? "replace" : "toggle"
|
|
27
|
+
});
|
|
28
|
+
// If the selection behavior changes in state, we need to update showSelectionCheckboxes here due to the circular dependency...
|
|
29
|
+
let shouldShowCheckboxes = state.selectionManager.selectionBehavior !== "replace";
|
|
30
|
+
if (shouldShowCheckboxes !== showSelectionCheckboxes) setShowSelectionCheckboxes(shouldShowCheckboxes);
|
|
31
|
+
return /*#__PURE__*/ (0, $9W9sm$react).createElement((0, $bd013581c0a4b065$export$517e02184d273d69), {
|
|
32
|
+
...props,
|
|
33
|
+
state: state,
|
|
34
|
+
ref: ref
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const $d14697b14e638114$export$b3c27e869d856b7 = /*#__PURE__*/ (0, $9W9sm$react).forwardRef($d14697b14e638114$var$TableView);
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
export {$d14697b14e638114$export$b3c27e869d856b7 as TableView};
|
|
41
|
+
//# sourceMappingURL=TableView.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAUD,SAAS,gCAA4B,KAAoB,EAAE,GAA2B;IACpF,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;AAEA,MAAM,yDAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","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\nfunction 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}\n\nconst _TableView = React.forwardRef(TableView) as <T>(props: TableProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_TableView as TableView};\n"],"names":[],"version":3,"file":"TableView.module.js.map"}
|