diff --git a/components/doc/common/apidoc/index.json b/components/doc/common/apidoc/index.json index 7ce3a96d63..d80d89d487 100644 --- a/components/doc/common/apidoc/index.json +++ b/components/doc/common/apidoc/index.json @@ -32152,6 +32152,12 @@ "readonly": false, "type": "InputTextProps" }, + { + "name": "parent", + "optional": false, + "readonly": false, + "type": "InputTextPassThroughMethodOptions" + }, { "name": "context", "optional": false, diff --git a/components/doc/password/theming/tailwinddoc.js b/components/doc/password/theming/tailwinddoc.js index 1ff18a5c48..4f1ad7b9e4 100644 --- a/components/doc/password/theming/tailwinddoc.js +++ b/components/doc/password/theming/tailwinddoc.js @@ -40,6 +40,9 @@ const Tailwind = { hideicon: { className: classNames('absolute top-1/2 -mt-2', 'right-3 text-gray-600 dark:text-white/70') }, + inputIcon: { + root: 'mt-0' + }, transition: TRANSITIONS.overlay } } diff --git a/components/lib/inputtext/inputtext.d.ts b/components/lib/inputtext/inputtext.d.ts index b7e07ad18d..c104c91168 100644 --- a/components/lib/inputtext/inputtext.d.ts +++ b/components/lib/inputtext/inputtext.d.ts @@ -22,6 +22,7 @@ export declare type InputTextPassThroughType = PassThroughType {input} - {icon} + + {icon} + ); } diff --git a/components/lib/scrollpanel/ScrollPanel.js b/components/lib/scrollpanel/ScrollPanel.js index 77118b573e..038b25df2a 100644 --- a/components/lib/scrollpanel/ScrollPanel.js +++ b/components/lib/scrollpanel/ScrollPanel.js @@ -70,14 +70,22 @@ export const ScrollPanel = React.forwardRef((inProps, ref) => { DomHandler.addClass(xBarRef.current, 'p-scrollpanel-hidden'); } else { DomHandler.removeClass(xBarRef.current, 'p-scrollpanel-hidden'); - xBarRef.current.style.cssText = 'width:' + Math.max(scrollXRatio.current * 100, 10) + '%; left:' + (contentRef.current.scrollLeft / totalWidth) * 100 + '%;bottom:' + bottom + 'px;'; + DomHandler.applyStyle(xBarRef.current, { + width: Math.max(scrollXRatio.current * 100, 10) + '%', + left: (contentRef.current.scrollLeft / totalWidth) * 100 + '%', + bottom: bottom + 'px' + }); } if (scrollYRatio.current >= 1) { DomHandler.addClass(yBarRef.current, 'p-scrollpanel-hidden'); } else { DomHandler.removeClass(yBarRef.current, 'p-scrollpanel-hidden'); - yBarRef.current.style.cssText = 'height:' + Math.max(scrollYRatio.current * 100, 10) + '%; top: calc(' + (contentRef.current.scrollTop / totalHeight) * 100 + '% - ' + xBarRef.current.clientHeight + 'px);right:' + right + 'px;'; + DomHandler.applyStyle(yBarRef.current, { + height: Math.max(scrollYRatio.current * 100, 10) + '%', + top: 'calc(' + (contentRef.current.scrollTop / totalHeight) * 100 + '% - ' + xBarRef.current.clientHeight + 'px)', + right: right + 'px' + }); } }); }; diff --git a/components/lib/utils/DomHandler.js b/components/lib/utils/DomHandler.js index cdbabce456..bcf1642b17 100644 --- a/components/lib/utils/DomHandler.js +++ b/components/lib/utils/DomHandler.js @@ -1055,9 +1055,9 @@ export default class DomHandler { static applyStyle(element, style) { if (typeof style === 'string') { - element.style.cssText = this.style; + element.style.cssText = style; } else { - for (let prop in this.style) { + for (let prop in style) { element.style[prop] = style[prop]; } } diff --git a/components/lib/utils/utils.d.ts b/components/lib/utils/utils.d.ts index 695b9b8f2d..f70e24d52f 100644 --- a/components/lib/utils/utils.d.ts +++ b/components/lib/utils/utils.d.ts @@ -87,7 +87,7 @@ export declare class DomHandler { static getCursorOffset(el: HTMLElement, prevText?: string, nextText?: string, currentText?: string): { top: any; left: any }; static invokeElementMethod(el: HTMLElement, methodName: string, arg: any): void; static isClickable(el: HTMLElement): boolean; - static applyStyle(el: HTMLElement, style: any): void; + static applyStyle(el: HTMLElement, style: React.CSSProperties | string): void; static exportCSV(csv: any, filename: string): void; static saveAs(file: { name: string; url: any }): boolean; static createInlineStyle(nonce?: string, styleContainer?: ShadowRoot | HTMLElement): HTMLStyleElement;