From 8c95949913f36f71c8188e6b4b785aa16c33d18c Mon Sep 17 00:00:00 2001 From: Melloware Date: Tue, 9 Jan 2024 12:01:59 -0500 Subject: [PATCH] Port fixes3 (#5711) * 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 --- .../__snapshots__/BlockUI.spec.js.snap | 8 + components/lib/cascadeselect/CascadeSelect.js | 3 +- .../lib/cascadeselect/CascadeSelectSub.js | 4 +- components/lib/chip/Chip.js | 1 + .../lib/chip/__snapshots__/Chip.spec.js.snap | 48 +++- components/lib/chips/Chips.js | 3 +- components/lib/componentbase/ComponentBase.js | 3 +- components/lib/datatable/BodyCell.js | 2 + components/lib/datatable/datatable.d.ts | 3 +- .../__snapshots__/Divider.spec.js.snap | 9 + .../__snapshots__/Fieldset.spec.js.snap | 213 +----------------- components/lib/inputtext/InputText.js | 4 +- components/lib/inputtext/InputText.spec.js | 12 + components/lib/inputtext/InputTextBase.js | 9 +- .../__snapshots__/InputText.spec.js.snap | 10 + .../__snapshots__/Message.spec.js.snap | 8 + components/lib/multiselect/MultiSelectBase.js | 1 + .../panel/__snapshots__/Panel.spec.js.snap | 20 +- components/lib/passthrough/tailwind/index.js | 20 +- .../__snapshots__/ProgressBar.spec.js.snap | 2 + .../ProgressSpinner.spec.js.snap | 8 +- .../__snapshots__/Skeleton.spec.js.snap | 9 + components/lib/slider/Slider.js | 2 +- .../__snapshots__/Splitter.spec.js.snap | 21 ++ components/lib/tree/Tree.js | 52 ++--- components/lib/tree/UITreeNode.js | 53 +++-- components/lib/treetable/TreeTable.js | 56 ++--- components/lib/treetable/TreeTableBase.js | 5 +- components/lib/treetable/TreeTableBody.js | 4 +- components/lib/treetable/TreeTableBodyCell.js | 3 +- components/lib/treetable/TreeTableHeader.js | 31 ++- components/lib/treetable/TreeTableRow.js | 4 + .../lib/treetable/TreeTableScrollableView.js | 2 +- components/lib/treetable/treetable.d.ts | 4 +- .../useAnimatedFeatures.js | 23 +- 35 files changed, 317 insertions(+), 343 deletions(-) diff --git a/components/lib/blockui/__snapshots__/BlockUI.spec.js.snap b/components/lib/blockui/__snapshots__/BlockUI.spec.js.snap index 872861fc93..cf60a1da34 100644 --- a/components/lib/blockui/__snapshots__/BlockUI.spec.js.snap +++ b/components/lib/blockui/__snapshots__/BlockUI.spec.js.snap @@ -7,6 +7,7 @@ exports[`BlockUI block and unblock fullscreen events: blocked-event-fullscreen 1 >
{ }); useUpdateEffect(() => { - setActiveOptionState(null); + if (!props.parentActive) { + setActiveOptionState(null); + } }, [props.parentActive]); const createSubmenu = (option) => { diff --git a/components/lib/chip/Chip.js b/components/lib/chip/Chip.js index e5d487a880..d7c0e935e6 100644 --- a/components/lib/chip/Chip.js +++ b/components/lib/chip/Chip.js @@ -37,6 +37,7 @@ export const Chip = React.memo( const removeIconProps = mergeProps( { key: 'removeIcon', + role: 'button', tabIndex: 0, className: cx('removeIcon'), onClick: close, diff --git a/components/lib/chip/__snapshots__/Chip.spec.js.snap b/components/lib/chip/__snapshots__/Chip.spec.js.snap index 663370bfab..b3f9745027 100644 --- a/components/lib/chip/__snapshots__/Chip.spec.js.snap +++ b/components/lib/chip/__snapshots__/Chip.spec.js.snap @@ -60,6 +60,7 @@ exports[`Chip image and alt 1`] = ` exports[`Chip label 1`] = `
`; -exports[`Chip when removable is true it returns with remove icon: after remove 1`] = `
`; +exports[`Chip when removable is true it returns with remove icon: after remove 1`] = ` +
+
+ +
+
+`; exports[`Chip when removable is true it returns with remove icon: before remove 1`] = `
@@ -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" @@ -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" diff --git a/components/lib/chips/Chips.js b/components/lib/chips/Chips.js index fe5d0690dd..5b8c8fd2bc 100644 --- a/components/lib/chips/Chips.js +++ b/components/lib/chips/Chips.js @@ -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') ); diff --git a/components/lib/componentbase/ComponentBase.js b/components/lib/componentbase/ComponentBase.js index 6af640ddd4..8960da8bcd 100644 --- a/components/lib/componentbase/ComponentBase.js +++ b/components/lib/componentbase/ComponentBase.js @@ -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; } diff --git a/components/lib/datatable/BodyCell.js b/components/lib/datatable/BodyCell.js index 9bcb81c38d..0b3f3ca351 100644 --- a/components/lib/datatable/BodyCell.js +++ b/components/lib/datatable/BodyCell.js @@ -186,6 +186,8 @@ export const BodyCell = React.memo((props) => { } else { event.preventDefault(); } + + return newRowData; }); }; diff --git a/components/lib/datatable/datatable.d.ts b/components/lib/datatable/datatable.d.ts index 762f8129ad..ffb149f1da 100644 --- a/components/lib/datatable/datatable.d.ts +++ b/components/lib/datatable/datatable.d.ts @@ -1082,8 +1082,9 @@ interface DataTableBaseProps extends Omit React.ReactNode); + emptyMessage?: string | React.ReactNode | ((frozen: boolean) => React.ReactNode) | undefined; /** * Makes row groups toggleable, default is false. * @defaultValue false diff --git a/components/lib/divider/__snapshots__/Divider.spec.js.snap b/components/lib/divider/__snapshots__/Divider.spec.js.snap index b7c655b792..f0191ed4ac 100644 --- a/components/lib/divider/__snapshots__/Divider.spec.js.snap +++ b/components/lib/divider/__snapshots__/Divider.spec.js.snap @@ -3,6 +3,7 @@ exports[`Divider default 1`] = `
`; -exports[`Fieldset when Fieldset is toggleable it must expand and collapse: expandable-closed 1`] = ` -
-
- - - - -
-
-`; - exports[`Fieldset when Fieldset is toggleable it must expand and collapse: expandable-open 1`] = `
-
- - - - - Expand/Collapse - - - -
-
-

- Lorem ipsum dolor sit amet -

-
-
-
-
-`; - -exports[`Fieldset when Fieldset is toggleable it will toggle when clicked: toggleable-closed 1`] = ` -
-
- - - - - Toggleable - - - -
-
-

- Lorem ipsum dolor sit amet -

-
-
-
-
-`; - exports[`Fieldset when Fieldset is toggleable it will toggle when clicked: toggleable-open 1`] = `
+ +
+`; + exports[`InputText when input is blank it should not have filled state 1`] = `