Skip to content

Commit

Permalink
Merge branch 'master' into fix/issue-7234
Browse files Browse the repository at this point in the history
  • Loading branch information
KumJungMin authored Sep 25, 2024
2 parents 232417c + ff3b083 commit 41800fa
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 6 deletions.
6 changes: 6 additions & 0 deletions components/doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -32152,6 +32152,12 @@
"readonly": false,
"type": "InputTextProps"
},
{
"name": "parent",
"optional": false,
"readonly": false,
"type": "InputTextPassThroughMethodOptions"
},
{
"name": "context",
"optional": false,
Expand Down
3 changes: 3 additions & 0 deletions components/doc/password/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
1 change: 1 addition & 0 deletions components/lib/inputtext/inputtext.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export declare type InputTextPassThroughType<T> = PassThroughType<T, InputTextPa
*/
export interface InputTextPassThroughMethodOptions {
props: InputTextProps;
parent: InputTextPassThroughMethodOptions;
context: InputTextContext;
}

Expand Down
3 changes: 3 additions & 0 deletions components/lib/passthrough/tailwind/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,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
},
togglebutton: {
Expand Down
4 changes: 3 additions & 1 deletion components/lib/password/Password.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,9 @@ export const Password = React.memo(
input = (
<IconField className={cx('iconField')} pt={ptm('iconField')} __parentMetadata={{ parent: metaData }}>
{input}
<InputIcon>{icon}</InputIcon>
<InputIcon className={cx('inputIcon')} pt={ptm('inputIcon')} __parentMetadata={{ parent: metaData }}>
{icon}
</InputIcon>
</IconField>
);
}
Expand Down
12 changes: 10 additions & 2 deletions components/lib/scrollpanel/ScrollPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});
}
});
};
Expand Down
4 changes: 2 additions & 2 deletions components/lib/utils/DomHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/lib/utils/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 41800fa

Please sign in to comment.