Skip to content

Commit

Permalink
Port fixes3 (#5711)
Browse files Browse the repository at this point in the history
* Fix #5384: TreeTable support hidden columns

* fix:#5553:TreeTable: need to be converted to data- lookups instead of className lookups

* TreeTable

* Fix #5597: TreeTable body align

* Fix #5393: Tree propagate icons to leaf nodes

* Fix #5233: Cell editor ColumnEditorOptions param fix

* Fix #5398: Slider with min value rendered incorrectly

* Fix #5340: MutliSelect emptyMessage don't add to DOM

* Fix #4190: Chip aria fixes

* Fix #5414: p-disabled for svg icons

* Fix #5424: CascadeSelect use data instead of CSS selector

* Fix #5425: CascadeSelect fix for StrictMode

* Fix #5440: InputText only print className once
  • Loading branch information
melloware authored Jan 9, 2024
1 parent ec471c8 commit 8c95949
Show file tree
Hide file tree
Showing 35 changed files with 317 additions and 343 deletions.
8 changes: 8 additions & 0 deletions components/lib/blockui/__snapshots__/BlockUI.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports[`BlockUI block and unblock fullscreen events: blocked-event-fullscreen 1
>
<div>
<div
aria-busy="false"
class="p-blockui-container"
data-pc-name="blockui"
data-pc-section="root"
Expand All @@ -27,6 +28,7 @@ exports[`BlockUI block and unblock fullscreen events: unblocked-event-fullscreen
>
<div>
<div
aria-busy="false"
class="p-blockui-container"
data-pc-name="blockui"
data-pc-section="root"
Expand All @@ -43,6 +45,7 @@ exports[`BlockUI block and unblock fullscreen events: unblocked-event-fullscreen
exports[`BlockUI block and unblock panel events: blocked-event 1`] = `
<div>
<div
aria-busy="false"
class="p-blockui-container"
data-pc-name="blockui"
data-pc-section="root"
Expand Down Expand Up @@ -81,6 +84,7 @@ exports[`BlockUI block and unblock panel events: blocked-event 1`] = `
exports[`BlockUI block and unblock panel events: unblocked-event 1`] = `
<div>
<div
aria-busy="false"
class="p-blockui-container"
data-pc-name="blockui"
data-pc-section="root"
Expand Down Expand Up @@ -123,6 +127,7 @@ exports[`BlockUI block fullscreen 1`] = `
>
<div>
<div
aria-busy="true"
class="p-blockui-container"
data-pc-name="blockui"
data-pc-section="root"
Expand All @@ -143,6 +148,7 @@ exports[`BlockUI block panel 1`] = `
>
<div>
<div
aria-busy="true"
class="p-blockui-container"
data-pc-name="blockui"
data-pc-section="root"
Expand Down Expand Up @@ -186,6 +192,7 @@ exports[`BlockUI container style and className 1`] = `
>
<div>
<div
aria-busy="true"
class="p-blockui-container container-jest"
data-pc-name="blockui"
data-pc-section="root"
Expand Down Expand Up @@ -230,6 +237,7 @@ exports[`BlockUI unblock panel 1`] = `
>
<div>
<div
aria-busy="false"
class="p-blockui-container"
data-pc-name="blockui"
data-pc-section="root"
Expand Down
3 changes: 2 additions & 1 deletion components/lib/cascadeselect/CascadeSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const CascadeSelect = React.memo(
//down
case 40:
if (overlayVisibleState) {
DomHandler.findSingle(overlayRef.current, '.p-cascadeselect-item').children[0].focus();
DomHandler.findSingle(overlayRef.current, '[data-pc-section="item"]').children[0].focus();
} else if (event.altKey && props.options && props.options.length) {
show();
}
Expand Down Expand Up @@ -423,6 +423,7 @@ export const CascadeSelect = React.memo(
optionGroupIcon={props.optionGroupIcon}
optionLabel={props.optionLabel}
optionValue={props.optionValue}
parentActive={props.value != null}
level={0}
optionGroupLabel={props.optionGroupLabel}
optionGroupChildren={props.optionGroupChildren}
Expand Down
4 changes: 3 additions & 1 deletion components/lib/cascadeselect/CascadeSelectSub.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ export const CascadeSelectSub = React.memo((props) => {
});

useUpdateEffect(() => {
setActiveOptionState(null);
if (!props.parentActive) {
setActiveOptionState(null);
}
}, [props.parentActive]);

const createSubmenu = (option) => {
Expand Down
1 change: 1 addition & 0 deletions components/lib/chip/Chip.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const Chip = React.memo(
const removeIconProps = mergeProps(
{
key: 'removeIcon',
role: 'button',
tabIndex: 0,
className: cx('removeIcon'),
onClick: close,
Expand Down
48 changes: 47 additions & 1 deletion components/lib/chip/__snapshots__/Chip.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ exports[`Chip image and alt 1`] = `
exports[`Chip label 1`] = `
<div>
<div
aria-label="jest"
class="p-chip p-component"
data-pc-name="chip"
data-pc-section="root"
Expand All @@ -74,7 +75,50 @@ exports[`Chip label 1`] = `
</div>
`;

exports[`Chip when removable is true it returns with remove icon: after remove 1`] = `<div />`;
exports[`Chip when removable is true it returns with remove icon: after remove 1`] = `
<div>
<div
class="p-chip p-component"
data-pc-name="chip"
data-pc-section="root"
>
<svg
aria-hidden="true"
class="p-icon p-chip-remove-icon"
data-pc-section="removeicon"
fill="none"
height="14"
role="button"
tabindex="0"
viewBox="0 0 14 14"
width="14"
xmlns="http://www.w3.org/2000/svg"
>
<g
clip-path="url(#pr_icon_clip_1)"
>
<path
clip-rule="evenodd"
d="M7 14C5.61553 14 4.26215 13.5895 3.11101 12.8203C1.95987 12.0511 1.06266 10.9579 0.532846 9.67879C0.00303296 8.3997 -0.13559 6.99224 0.134506 5.63437C0.404603 4.2765 1.07129 3.02922 2.05026 2.05026C3.02922 1.07129 4.2765 0.404603 5.63437 0.134506C6.99224 -0.13559 8.3997 0.00303296 9.67879 0.532846C10.9579 1.06266 12.0511 1.95987 12.8203 3.11101C13.5895 4.26215 14 5.61553 14 7C14 8.85652 13.2625 10.637 11.9497 11.9497C10.637 13.2625 8.85652 14 7 14ZM7 1.16667C5.84628 1.16667 4.71846 1.50879 3.75918 2.14976C2.79989 2.79074 2.05222 3.70178 1.61071 4.76768C1.16919 5.83358 1.05367 7.00647 1.27876 8.13803C1.50384 9.26958 2.05941 10.309 2.87521 11.1248C3.69102 11.9406 4.73042 12.4962 5.86198 12.7212C6.99353 12.9463 8.16642 12.8308 9.23232 12.3893C10.2982 11.9478 11.2093 11.2001 11.8502 10.2408C12.4912 9.28154 12.8333 8.15373 12.8333 7C12.8333 5.45291 12.2188 3.96918 11.1248 2.87521C10.0308 1.78125 8.5471 1.16667 7 1.16667ZM4.66662 9.91668C4.58998 9.91704 4.51404 9.90209 4.44325 9.87271C4.37246 9.84333 4.30826 9.8001 4.2544 9.74557C4.14516 9.6362 4.0838 9.48793 4.0838 9.33335C4.0838 9.17876 4.14516 9.0305 4.2544 8.92113L6.17553 7L4.25443 5.07891C4.15139 4.96832 4.09529 4.82207 4.09796 4.67094C4.10063 4.51982 4.16185 4.37563 4.26872 4.26876C4.3756 4.16188 4.51979 4.10066 4.67091 4.09799C4.82204 4.09532 4.96829 4.15142 5.07887 4.25446L6.99997 6.17556L8.92106 4.25446C9.03164 4.15142 9.1779 4.09532 9.32903 4.09799C9.48015 4.10066 9.62434 4.16188 9.73121 4.26876C9.83809 4.37563 9.89931 4.51982 9.90198 4.67094C9.90464 4.82207 9.84855 4.96832 9.74551 5.07891L7.82441 7L9.74554 8.92113C9.85478 9.0305 9.91614 9.17876 9.91614 9.33335C9.91614 9.48793 9.85478 9.6362 9.74554 9.74557C9.69168 9.8001 9.62748 9.84333 9.55669 9.87271C9.4859 9.90209 9.40996 9.91704 9.33332 9.91668C9.25668 9.91704 9.18073 9.90209 9.10995 9.87271C9.03916 9.84333 8.97495 9.8001 8.9211 9.74557L6.99997 7.82444L5.07884 9.74557C5.02499 9.8001 4.96078 9.84333 4.88999 9.87271C4.81921 9.90209 4.74326 9.91704 4.66662 9.91668Z"
fill="currentColor"
fill-rule="evenodd"
/>
</g>
<defs>
<clippath
id="pr_icon_clip_1"
>
<rect
fill="white"
height="14"
width="14"
/>
</clippath>
</defs>
</svg>
</div>
</div>
`;

exports[`Chip when removable is true it returns with remove icon: before remove 1`] = `
<div>
Expand All @@ -89,6 +133,7 @@ exports[`Chip when removable is true it returns with remove icon: before remove
data-pc-section="removeicon"
fill="none"
height="14"
role="button"
tabindex="0"
viewBox="0 0 14 14"
width="14"
Expand Down Expand Up @@ -135,6 +180,7 @@ exports[`Chip when removable is true the chip is removed when ENTER is pressed:
data-pc-section="removeicon"
fill="none"
height="14"
role="button"
tabindex="0"
viewBox="0 0 14 14"
width="14"
Expand Down
3 changes: 2 additions & 1 deletion components/lib/chips/Chips.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ export const Chips = React.memo(
const iconProps = mergeProps(
{
className: cx('removeTokenIcon'),
onClick: (event) => removeItem(event, index)
onClick: (event) => removeItem(event, index),
'aria-hidden': 'true'
},
ptm('removeTokenIcon')
);
Expand Down
3 changes: 2 additions & 1 deletion components/lib/componentbase/ComponentBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ svg.p-icon {
pointer-events: auto;
}
svg.p-icon g {
svg.p-icon g,
.p-disabled svg.p-icon {
pointer-events: none;
}
Expand Down
2 changes: 2 additions & 0 deletions components/lib/datatable/BodyCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ export const BodyCell = React.memo((props) => {
} else {
event.preventDefault();
}

return newRowData;
});
};

Expand Down
3 changes: 2 additions & 1 deletion components/lib/datatable/datatable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,9 @@ interface DataTableBaseProps<TValue extends DataTableValueArray> extends Omit<Re
editingRows?: DataTableValueArray | DataTableEditingRows | undefined;
/**
* Text to display when there is no data.
* @defaultValue No results found
*/
emptyMessage?: React.ReactNode | ((frozen: boolean) => React.ReactNode);
emptyMessage?: string | React.ReactNode | ((frozen: boolean) => React.ReactNode) | undefined;
/**
* Makes row groups toggleable, default is false.
* @defaultValue false
Expand Down
9 changes: 9 additions & 0 deletions components/lib/divider/__snapshots__/Divider.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
exports[`Divider default 1`] = `
<div>
<div
aria-orientation="horizontal"
class="p-divider p-component p-divider-horizontal p-divider-solid p-divider-left"
data-pc-name="divider"
data-pc-section="root"
Expand All @@ -20,6 +21,7 @@ exports[`Divider default 1`] = `
exports[`Divider horizontal center 1`] = `
<div>
<div
aria-orientation="horizontal"
class="p-divider p-component p-divider-horizontal p-divider-solid p-divider-center"
data-pc-name="divider"
data-pc-section="root"
Expand All @@ -37,6 +39,7 @@ exports[`Divider horizontal center 1`] = `
exports[`Divider horizontal left 1`] = `
<div>
<div
aria-orientation="horizontal"
class="p-divider p-component p-divider-horizontal p-divider-solid p-divider-left"
data-pc-name="divider"
data-pc-section="root"
Expand All @@ -54,6 +57,7 @@ exports[`Divider horizontal left 1`] = `
exports[`Divider horizontal right 1`] = `
<div>
<div
aria-orientation="horizontal"
class="p-divider p-component p-divider-horizontal p-divider-solid p-divider-right"
data-pc-name="divider"
data-pc-section="root"
Expand All @@ -71,6 +75,7 @@ exports[`Divider horizontal right 1`] = `
exports[`Divider type dashed 1`] = `
<div>
<div
aria-orientation="horizontal"
class="p-divider p-component p-divider-horizontal p-divider-dashed p-divider-left"
data-pc-name="divider"
data-pc-section="root"
Expand All @@ -88,6 +93,7 @@ exports[`Divider type dashed 1`] = `
exports[`Divider type dotted 1`] = `
<div>
<div
aria-orientation="horizontal"
class="p-divider p-component p-divider-horizontal p-divider-dotted p-divider-left"
data-pc-name="divider"
data-pc-section="root"
Expand All @@ -105,6 +111,7 @@ exports[`Divider type dotted 1`] = `
exports[`Divider vertical bottom 1`] = `
<div>
<div
aria-orientation="vertical"
class="p-divider p-component p-divider-vertical p-divider-solid p-divider-bottom"
data-pc-name="divider"
data-pc-section="root"
Expand All @@ -122,6 +129,7 @@ exports[`Divider vertical bottom 1`] = `
exports[`Divider vertical center 1`] = `
<div>
<div
aria-orientation="vertical"
class="p-divider p-component p-divider-vertical p-divider-solid p-divider-center"
data-pc-name="divider"
data-pc-section="root"
Expand All @@ -139,6 +147,7 @@ exports[`Divider vertical center 1`] = `
exports[`Divider vertical top 1`] = `
<div>
<div
aria-orientation="vertical"
class="p-divider p-component p-divider-vertical p-divider-solid p-divider-top"
data-pc-name="divider"
data-pc-section="root"
Expand Down
Loading

0 comments on commit 8c95949

Please sign in to comment.