diff --git a/package.json b/package.json index 137bbf60001..839351008d5 100644 --- a/package.json +++ b/package.json @@ -66,9 +66,11 @@ "@octokit/rest": "*", "@parcel/bundler-experimental": "^2.2.1", "@parcel/optimizer-css": "^2.2.1", + "@parcel/optimizer-data-url": "^2.2.1", "@parcel/packager-ts": "^2.2.1", "@parcel/resolver-glob": "^2.2.1", "@parcel/transformer-inline": "^2.2.1", + "@parcel/transformer-inline-string": "^2.2.1", "@parcel/transformer-svg-react": "^2.2.1", "@parcel/transformer-typescript-types": "^2.2.1", "@spectrum-css/component-builder": "^1.0.0", @@ -173,6 +175,8 @@ "resolutions": { "@babel/core": "7.12.10", "@babel/runtime": "7.12.5", + "@parcel/optimizer-data-url": "2.2.1", + "@parcel/transformer-inline-string": "2.2.1", "postcss-calc": "6.0.2", "jsdom": "16.7.0", "postcss-modules": "^3.2.2", diff --git a/packages/@adobe/spectrum-css-temp/components/table/cursors/Cur_MoveHorizontal_9_9.svg b/packages/@adobe/spectrum-css-temp/components/table/cursors/Cur_MoveHorizontal_9_9.svg new file mode 100644 index 00000000000..b7beacd3aa8 --- /dev/null +++ b/packages/@adobe/spectrum-css-temp/components/table/cursors/Cur_MoveHorizontal_9_9.svg @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/packages/@adobe/spectrum-css-temp/components/table/cursors/Cur_MoveToLeft_9_9.svg b/packages/@adobe/spectrum-css-temp/components/table/cursors/Cur_MoveToLeft_9_9.svg new file mode 100644 index 00000000000..2269dc0ed73 --- /dev/null +++ b/packages/@adobe/spectrum-css-temp/components/table/cursors/Cur_MoveToLeft_9_9.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/packages/@adobe/spectrum-css-temp/components/table/cursors/Cur_MoveToRight_9_9.svg b/packages/@adobe/spectrum-css-temp/components/table/cursors/Cur_MoveToRight_9_9.svg new file mode 100644 index 00000000000..c606236adaf --- /dev/null +++ b/packages/@adobe/spectrum-css-temp/components/table/cursors/Cur_MoveToRight_9_9.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/packages/@adobe/spectrum-css-temp/components/table/index.css b/packages/@adobe/spectrum-css-temp/components/table/index.css index f53b9ea4532..744c98d132f 100644 --- a/packages/@adobe/spectrum-css-temp/components/table/index.css +++ b/packages/@adobe/spectrum-css-temp/components/table/index.css @@ -32,7 +32,7 @@ governing permissions and limitations under the License. svg.spectrum-Table-sortedIcon { display: none; flex: 0 0 auto; - margin-inline-start: var(--spectrum-table-header-sort-icon-gap); + margin-inline-end: var(--spectrum-table-header-sort-icon-gap); min-inline-size: var(--spectrum-icon-arrow-down-small-width); vertical-align: middle; @@ -40,6 +40,15 @@ svg.spectrum-Table-sortedIcon { transition: transform var(--spectrum-global-animation-duration-100) ease-in-out; } +.spectrum-Table-menuChevron { + display: none; + flex: 0 0 auto; + margin-inline-start: var(--spectrum-table-header-sort-icon-gap); + min-inline-size: var(--spectrum-icon-chevron-down-medium-width); + + vertical-align: middle; +} + .spectrum-Table-headWrapper { border-left-width: 1px; border-left-style: solid; @@ -104,6 +113,12 @@ svg.spectrum-Table-sortedIcon { text-overflow: ellipsis; } } + .is-hovered, + &.focus-ring { + .spectrum-Table-menuChevron { + display: inline-block; + } + } } .spectrum-Table-columnResizer { @@ -282,6 +297,18 @@ svg.spectrum-Table-sortedIcon { } } } +.spectrum-Table-headCellButton { + display: flex; + align-items: center; +} + +.spectrum-Table-headerCellText { + flex: 0 1 auto; + min-width: 0; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} .spectrum-Table-headCell, .spectrum-Table-headCellButton { @@ -453,12 +480,15 @@ svg.spectrum-Table-sortedIcon { } } -.resize-ew * { - cursor: col-resize !important; +.resize-ew *, +.spectrum-Table-columnResizer--ewresize { + cursor: url('data-url:./cursors/Cur_MoveHorizontal_9_9.svg'), ew-resize !important; } -.resize-e * { - cursor: e-resize !important; +.resize-e *, +.spectrum-Table-columnResizer--eresize { + cursor: url('data-url:./cursors/Cur_MoveToRight_9_9.svg'), e-resize !important; } -.resize-w * { - cursor: w-resize !important; +.resize-w *, +.spectrum-Table-columnResizer--wresize { + cursor: url('data-url:./cursors/Cur_MoveToLeft_9_9.svg'), w-resize !important; } diff --git a/packages/@react-spectrum/table/src/Resizer.tsx b/packages/@react-spectrum/table/src/Resizer.tsx index 46e69d429ad..f3c08e6794c 100644 --- a/packages/@react-spectrum/table/src/Resizer.tsx +++ b/packages/@react-spectrum/table/src/Resizer.tsx @@ -58,13 +58,8 @@ function Resizer(props: ResizerProps, ref: RefObject) { display: showResizer ? undefined : 'none', touchAction: 'none' }; - if (columnState.getColumnMinWidth(column.key) >= columnState.getColumnWidth(column.key)) { - style.cursor = direction === 'rtl' ? 'w-resize' : 'e-resize'; - } else if (columnState.getColumnMaxWidth(column.key) <= columnState.getColumnWidth(column.key)) { - style.cursor = direction === 'rtl' ? 'e-resize' : 'w-resize'; - } else { - style.cursor = 'col-resize'; - } + let isEResizable = columnState.getColumnMinWidth(column.key) >= columnState.getColumnWidth(column.key); + let isWResizable = columnState.getColumnMaxWidth(column.key) <= columnState.getColumnWidth(column.key); return ( <> @@ -72,7 +67,15 @@ function Resizer(props: ResizerProps, ref: RefObject) {
+ {columnProps.allowsSorting && + + } {columnProps.hideHeader ? {column.rendered} :
{column.rendered}
} - {columnProps.allowsSorting && - - }
); @@ -586,8 +587,9 @@ let _TableColumnHeaderButton = (props, ref: FocusableRef) => { let {isEmpty} = useTableContext(); let domRef = useFocusableRef(ref); let {buttonProps} = useButton({...otherProps, elementType: 'div', isDisabled: isEmpty}, domRef); + let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: isEmpty}); return ( -
+
{props.children}
); @@ -607,9 +609,10 @@ function ResizableTableColumnHeader(props) { isVirtualized: true, hasMenu: true }, state, ref); + let {hoverProps, isHovered} = useHover({...props, isDisabled: isEmpty}); - const allProps = [columnHeaderProps, hoverProps, pressProps]; + const allProps = [columnHeaderProps, pressProps, hoverProps]; let columnProps = column.props as SpectrumColumnProps; @@ -697,12 +700,15 @@ function ResizableTableColumnHeader(props) { }> + {columnProps.allowsSorting && + + } {columnProps.hideHeader ? {column.rendered} : - column.rendered +
{column.rendered}
} - {columnProps.allowsSorting && - + { + columnProps.allowsResizing && columnState.currentlyResizingColumn === null && }
diff --git a/packages/dev/parcel-namer-docs/DocsNamer.js b/packages/dev/parcel-namer-docs/DocsNamer.js index 40e21430312..5f454223f2a 100644 --- a/packages/dev/parcel-namer-docs/DocsNamer.js +++ b/packages/dev/parcel-namer-docs/DocsNamer.js @@ -54,6 +54,9 @@ module.exports = new Namer({ let bundleGroup = bundleGraph.getBundleGroupsContainingBundle(bundle)[0]; let bundleGroupBundles = bundleGraph.getBundlesInBundleGroup(bundleGroup); let mainBundle = bundleGroupBundles.find(b => b.getEntryAssets().some(a => a.id === bundleGroup.entryAssetId)); + if (!mainBundle) { + return null; + } let entry = mainBundle.getEntryAssets().find(a => a.id === bundleGroup.entryAssetId).filePath; return path.basename(entry, path.extname(entry)) + '.' + bundle.hashReference + '.' + bundle.type; } else { diff --git a/yarn.lock b/yarn.lock index 79230d04bc1..2a5f0cd1f03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2810,6 +2810,16 @@ cssnano "^5.0.15" postcss "^8.4.5" +"@parcel/optimizer-data-url@2.2.1", "@parcel/optimizer-data-url@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@parcel/optimizer-data-url/-/optimizer-data-url-2.2.1.tgz#69e2bc7bb5164a82d9044a26758464a12c76e993" + integrity sha512-e1gbnGpc2wKGUmXEMXK8FfPGBjE1Ols3CQe06FUzq5dxocctcoEBdZas/cBew+b5LmuHqzTv4rYNWMqQnr7Izw== + dependencies: + "@parcel/plugin" "^2.2.1" + "@parcel/utils" "^2.2.1" + isbinaryfile "^4.0.2" + mime "^2.4.4" + "@parcel/optimizer-htmlnano@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@parcel/optimizer-htmlnano/-/optimizer-htmlnano-2.2.1.tgz#781267e8b72033abc500e16ca032d24d56d7f2ce" @@ -3089,6 +3099,13 @@ "@parcel/workers" "^2.2.1" nullthrows "^1.1.1" +"@parcel/transformer-inline-string@2.2.1", "@parcel/transformer-inline-string@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@parcel/transformer-inline-string/-/transformer-inline-string-2.2.1.tgz#a80a8a0221803b863e103340ea2e3b6546de14f3" + integrity sha512-yHhKmYEEyg3D5FfAz/yv+U4Ml6MPJvYfEgFowfeCTG2cJ9g7jVwsB66nAwOR1IP+MJh9ODmzf5OSjdR9MX6lYQ== + dependencies: + "@parcel/plugin" "^2.2.1" + "@parcel/transformer-inline@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@parcel/transformer-inline/-/transformer-inline-2.2.1.tgz#626cea8c83ae0b8ae9e4070f9aa9255ac1273f86" @@ -12625,6 +12642,11 @@ isbinaryfile@^4.0.1: resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.2.tgz#bfc45642da645681c610cca831022e30af426488" integrity sha512-C3FSxJdNrEr2F4z6uFtNzECDM5hXk+46fxaa+cwBe5/XrWSmzdG8DDgyjfX6/NRdBB21q2JXuRAzPCUs+fclnQ== +isbinaryfile@^4.0.2: + version "4.0.10" + resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.10.tgz#0c5b5e30c2557a2f06febd37b7322946aaee42b3" + integrity sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw== + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"