@react-spectrum/table 3.15.0 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DragPreview.main.js +1 -1
- package/dist/DragPreview.mjs +1 -1
- package/dist/DragPreview.module.js +1 -1
- package/dist/Resizer.main.js +3 -4
- package/dist/Resizer.main.js.map +1 -1
- package/dist/Resizer.mjs +3 -4
- package/dist/Resizer.module.js +3 -4
- package/dist/Resizer.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 +4 -4
- package/dist/TableViewBase.main.js.map +1 -1
- package/dist/TableViewBase.mjs +4 -4
- package/dist/TableViewBase.module.js +4 -4
- package/dist/TableViewBase.module.js.map +1 -1
- package/dist/TableViewLayout.main.js.map +1 -1
- 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/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 +27 -27
- package/src/Resizer.tsx +2 -5
- package/src/TableView.tsx +2 -5
- package/src/TableViewBase.tsx +3 -3
- package/src/TableViewWrapper.tsx +6 -9
- package/src/TreeGridTableView.tsx +2 -5
package/dist/DragPreview.main.js
CHANGED
package/dist/DragPreview.mjs
CHANGED
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");
|
|
@@ -58,7 +58,7 @@ 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
63
|
let objectRef = (0, $hxFQC$reactariautils.useObjectRef)(ref);
|
|
64
64
|
let { isEmpty: isEmpty, onFocusedResizer: onFocusedResizer } = (0, $e39c6de4eb69450d$exports.useTableContext)();
|
|
@@ -138,14 +138,13 @@ function $2877766f94c67a67$var$Resizer(props, ref) {
|
|
|
138
138
|
cursor: cursor
|
|
139
139
|
}
|
|
140
140
|
})));
|
|
141
|
-
}
|
|
141
|
+
});
|
|
142
142
|
function $2877766f94c67a67$var$CursorOverlay(props) {
|
|
143
143
|
let { show: show, children: children } = props;
|
|
144
144
|
let { getContainer: getContainer } = (0, $hxFQC$reactariaoverlays.useUNSTABLE_PortalContext)();
|
|
145
145
|
var _getContainer;
|
|
146
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;
|
|
147
147
|
}
|
|
148
|
-
const $2877766f94c67a67$export$48a76196cafe3b93 = /*#__PURE__*/ (0, ($parcel$interopDefault($hxFQC$react))).forwardRef($2877766f94c67a67$var$Resizer);
|
|
149
148
|
|
|
150
149
|
|
|
151
150
|
//# sourceMappingURL=Resizer.main.js.map
|
package/dist/Resizer.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,CAAA,GAAA,gEAAM,GAAG;IACtB,GAAG,gCAAU,CAAA,GAAA,gEAAM,GAAG;AACxB;AAEO,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAA0C;
|
|
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,m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Ac,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,IAAI,gBAAC,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,5 +1,5 @@
|
|
|
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";
|
|
@@ -51,7 +51,7 @@ 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
56
|
let objectRef = (0, $dIfdp$useObjectRef)(ref);
|
|
57
57
|
let { isEmpty: isEmpty, onFocusedResizer: onFocusedResizer } = (0, $bd013581c0a4b065$export$3cb274deb6c2d854)();
|
|
@@ -131,14 +131,13 @@ function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
|
131
131
|
cursor: cursor
|
|
132
132
|
}
|
|
133
133
|
})));
|
|
134
|
-
}
|
|
134
|
+
});
|
|
135
135
|
function $fc695d2eafc2b351$var$CursorOverlay(props) {
|
|
136
136
|
let { show: show, children: children } = props;
|
|
137
137
|
let { getContainer: getContainer } = (0, $dIfdp$useUNSTABLE_PortalContext)();
|
|
138
138
|
var _getContainer;
|
|
139
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;
|
|
140
140
|
}
|
|
141
|
-
const $fc695d2eafc2b351$export$48a76196cafe3b93 = /*#__PURE__*/ (0, $dIfdp$react).forwardRef($fc695d2eafc2b351$var$Resizer);
|
|
142
141
|
|
|
143
142
|
|
|
144
143
|
export {$fc695d2eafc2b351$export$b517d84d4ad20b24 as ResizeStateContext, $fc695d2eafc2b351$export$48a76196cafe3b93 as Resizer};
|
package/dist/Resizer.module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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";
|
|
@@ -51,7 +51,7 @@ 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
56
|
let objectRef = (0, $dIfdp$useObjectRef)(ref);
|
|
57
57
|
let { isEmpty: isEmpty, onFocusedResizer: onFocusedResizer } = (0, $bd013581c0a4b065$export$3cb274deb6c2d854)();
|
|
@@ -131,14 +131,13 @@ function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
|
131
131
|
cursor: cursor
|
|
132
132
|
}
|
|
133
133
|
})));
|
|
134
|
-
}
|
|
134
|
+
});
|
|
135
135
|
function $fc695d2eafc2b351$var$CursorOverlay(props) {
|
|
136
136
|
let { show: show, children: children } = props;
|
|
137
137
|
let { getContainer: getContainer } = (0, $dIfdp$useUNSTABLE_PortalContext)();
|
|
138
138
|
var _getContainer;
|
|
139
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;
|
|
140
140
|
}
|
|
141
|
-
const $fc695d2eafc2b351$export$48a76196cafe3b93 = /*#__PURE__*/ (0, $dIfdp$react).forwardRef($fc695d2eafc2b351$var$Resizer);
|
|
142
141
|
|
|
143
142
|
|
|
144
143
|
export {$fc695d2eafc2b351$export$b517d84d4ad20b24 as ResizeStateContext, $fc695d2eafc2b351$export$48a76196cafe3b93 as Resizer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;ACAA,4BAAiB;;;;ACAjB,4BAAiB;;;;;;;;;;;;;;ACAjB,4BAAiB;;;AHsBjB,SAAS,gCAAU,GAAW,EAAE,QAAgB;IAC9C,kGAAkG;IAClG,uGAAuG;IACvG,kFAAkF;IAClF,IAAI,CAAA,GAAA,eAAO,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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AAA,GAAA,gBAAQ;QAAE,QAAA;QAAO,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;qBACnD,gCAAC;QACE,GAAG,YAAY;QAChB,MAAK;QACL,OAAO;QACP,WAAW,CAAA,GAAA,iBAAS,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"}
|
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"}
|
|
@@ -4,7 +4,7 @@ var $18b3deb5c431fa13$exports = require("./Nubbin.main.js");
|
|
|
4
4
|
var $2877766f94c67a67$exports = require("./Resizer.main.js");
|
|
5
5
|
var $4a98adf416b1ae5d$exports = require("./RootDropIndicator.main.js");
|
|
6
6
|
var $f65d44d222cc509b$exports = require("./DragPreview.main.js");
|
|
7
|
-
require("./vars.
|
|
7
|
+
require("./vars.27f08d5f.css");
|
|
8
8
|
var $982885d0a34882ea$exports = require("./table_vars_css.main.js");
|
|
9
9
|
require("./table.11fc8462.css");
|
|
10
10
|
var $4afcd54cfd94dbb9$exports = require("./table_css.main.js");
|
|
@@ -275,7 +275,7 @@ function $e39c6de4eb69450d$var$TableViewBase(props, ref) {
|
|
|
275
275
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
|
|
276
276
|
role: "gridcell",
|
|
277
277
|
"aria-colindex": item.index + 1,
|
|
278
|
-
"aria-colspan": item.
|
|
278
|
+
"aria-colspan": item.colSpan != null && item.colSpan > 1 ? item.colSpan : undefined
|
|
279
279
|
});
|
|
280
280
|
case 'column':
|
|
281
281
|
if (item.props.isSelectionCell) return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableSelectAllCell, {
|
|
@@ -654,7 +654,7 @@ function $e39c6de4eb69450d$var$TableColumnHeader(props) {
|
|
|
654
654
|
'is-hovered': isHovered,
|
|
655
655
|
'spectrum-Table-cell--hideHeader': columnProps.hideHeader
|
|
656
656
|
}, (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), 'react-spectrum-Table-cell', {
|
|
657
|
-
'react-spectrum-Table-cell--alignCenter': columnProps.align === 'center' || column.
|
|
657
|
+
'react-spectrum-Table-cell--alignCenter': columnProps.align === 'center' || column.colSpan > 1,
|
|
658
658
|
'react-spectrum-Table-cell--alignEnd': columnProps.align === 'end'
|
|
659
659
|
}))
|
|
660
660
|
}, columnProps.allowsSorting && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, ($parcel$interopDefault($idLTj$spectrumiconsuiArrowDownSmall))), {
|
|
@@ -760,7 +760,7 @@ function $e39c6de4eb69450d$var$ResizableTableColumnHeader(props) {
|
|
|
760
760
|
let showResizer = !isEmpty && (headerRowHovered && (0, $idLTj$reactariainteractions.getInteractionModality)() !== 'keyboard' || resizingColumn != null);
|
|
761
761
|
let alignment = 'start';
|
|
762
762
|
let menuAlign = 'start';
|
|
763
|
-
if (columnProps.align === 'center' || column.
|
|
763
|
+
if (columnProps.align === 'center' || column.colSpan > 1) alignment = 'center';
|
|
764
764
|
else if (columnProps.align === 'end') {
|
|
765
765
|
alignment = 'end';
|
|
766
766
|
menuAlign = 'end';
|