@@ -209,10 +230,13 @@ export const DropdownPanel = React.memo(
}
const headerProps = mergeProps(
- {
- className: cx('header')
- },
- getPTOptions('header')
+ [
+ {
+ className: cx('header')
+ },
+ getPTOptions('header')
+ ],
+ { useTailwind: context.useTailwind }
);
return
;
@@ -236,13 +260,16 @@ export const DropdownPanel = React.memo(
const emptyMessage = props.hasFilter ? props.emptyFilterMessage : props.emptyMessage;
const content = isEmptyFilter ? createEmptyMessage(emptyMessage) : options.children;
const listProps = mergeProps(
- {
- ref: options.contentRef,
- style: options.style,
- className: classNames(options.className, cx('list', { virtualScrollerProps: props.virtualScrollerOptions })),
- role: 'listbox'
- },
- getPTOptions('list')
+ [
+ {
+ ref: options.contentRef,
+ style: options.style,
+ className: classNames(options.className, cx('list', { virtualScrollerProps: props.virtualScrollerOptions })),
+ role: 'listbox'
+ },
+ getPTOptions('list')
+ ],
+ { useTailwind: context.useTailwind }
);
return
;
@@ -254,19 +281,25 @@ export const DropdownPanel = React.memo(
} else {
const items = createItems();
const wrapperProps = mergeProps(
- {
- className: cx('wrapper'),
- style: sx('wrapper')
- },
- getPTOptions('wrapper')
+ [
+ {
+ className: cx('wrapper'),
+ style: sx('wrapper')
+ },
+ getPTOptions('wrapper')
+ ],
+ { useTailwind: context.useTailwind }
);
const listProps = mergeProps(
- {
- className: cx('list'),
- role: 'listbox'
- },
- getPTOptions('list')
+ [
+ {
+ className: cx('list'),
+ role: 'listbox'
+ },
+ getPTOptions('list')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -282,27 +315,33 @@ export const DropdownPanel = React.memo(
const content = createContent();
const footer = createFooter();
const panelProps = mergeProps(
- {
- className: classNames(props.panelClassName, cx('panel', { context })),
- style: sx('panel'),
- onClick: props.onClick
- },
- getPTOptions('panel')
+ [
+ {
+ className: classNames(props.panelClassName, cx('panel', { context })),
+ style: sx('panel'),
+ onClick: props.onClick
+ },
+ getPTOptions('panel')
+ ],
+ { useTailwind: context.useTailwind }
);
const transitionProps = mergeProps(
- {
- classNames: cx('transition'),
- in: props.in,
- timeout: { enter: 120, exit: 100 },
- options: props.transitionOptions,
- unmountOnExit: true,
- onEnter: onEnter,
- onEntered: onEntered,
- onExit: props.onExit,
- onExited: props.onExited
- },
- getPTOptions('transition')
+ [
+ {
+ classNames: cx('transition'),
+ in: props.in,
+ timeout: { enter: 120, exit: 100 },
+ options: props.transitionOptions,
+ unmountOnExit: true,
+ onEnter: onEnter,
+ onEntered: onEntered,
+ onExit: props.onExit,
+ onExited: props.onExited
+ },
+ getPTOptions('transition')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/editor/Editor.js b/components/lib/editor/Editor.js
index bbb70db7f2..ee99703fe7 100644
--- a/components/lib/editor/Editor.js
+++ b/components/lib/editor/Editor.js
@@ -148,11 +148,14 @@ export const Editor = React.memo(
const createToolbarHeader = () => {
const toolbarProps = mergeProps(
- {
- ref: toolbarRef,
- className: cx('toolbar')
- },
- ptm('toolbar')
+ [
+ {
+ ref: toolbarRef,
+ className: cx('toolbar')
+ },
+ ptm('toolbar')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.showHeader === false) {
@@ -160,9 +163,9 @@ export const Editor = React.memo(
} else if (props.headerTemplate) {
return
;
} else {
- const getMergeProps = (params, key) => mergeProps(params && { ...params }, ptm(key));
+ const getMergeProps = (params, key) => mergeProps([params && { ...params }, ptm(key)], { useTailwind: context.useTailwind });
- const formatsProps = mergeProps({ className: 'ql-formats' }, ptm('formats'));
+ const formatsProps = mergeProps([{ className: 'ql-formats' }, ptm('formats')], { useTailwind: context.useTailwind });
return (
@@ -212,20 +215,26 @@ export const Editor = React.memo(
const header = createToolbarHeader();
const contentProps = mergeProps(
- {
- ref: contentRef,
- className: cx('content'),
- style: props.style
- },
- ptm('content')
+ [
+ {
+ ref: contentRef,
+ className: cx('content'),
+ style: props.style
+ },
+ ptm('content')
+ ],
+ { useTailwind: context.useTailwind }
);
const content =
;
const rootProps = mergeProps(
- {
- className: classNames(props.className, cx('root'))
- },
- EditorBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ className: classNames(props.className, cx('root'))
+ },
+ EditorBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/fieldset/Fieldset.js b/components/lib/fieldset/Fieldset.js
index f41a5251a1..1dd433c415 100644
--- a/components/lib/fieldset/Fieldset.js
+++ b/components/lib/fieldset/Fieldset.js
@@ -69,33 +69,42 @@ export const Fieldset = React.forwardRef((inProps, ref) => {
const createContent = () => {
const contentProps = mergeProps(
- {
- className: cx('content')
- },
- ptm('content')
+ [
+ {
+ className: cx('content')
+ },
+ ptm('content')
+ ],
+ { useTailwind: context.useTailwind }
);
const toggleableProps = mergeProps(
- {
- ref: contentRef,
- id: contentId,
- 'aria-hidden': collapsed,
- role: 'region',
- 'aria-labelledby': headerId,
- className: cx('toggleableContent')
- },
- ptm('toggleableContent')
+ [
+ {
+ ref: contentRef,
+ id: contentId,
+ 'aria-hidden': collapsed,
+ role: 'region',
+ 'aria-labelledby': headerId,
+ className: cx('toggleableContent')
+ },
+ ptm('toggleableContent')
+ ],
+ { useTailwind: context.useTailwind }
);
const transitionProps = mergeProps(
- {
- classNames: cx('transition'),
- timeout: { enter: 1000, exit: 450 },
- in: !collapsed,
- unmountOnExit: true,
- options: props.transitionOptions
- },
- ptm('transition')
+ [
+ {
+ classNames: cx('transition'),
+ timeout: { enter: 1000, exit: 450 },
+ in: !collapsed,
+ unmountOnExit: true,
+ options: props.transitionOptions
+ },
+ ptm('transition')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -110,10 +119,13 @@ export const Fieldset = React.forwardRef((inProps, ref) => {
const createToggleIcon = () => {
if (props.toggleable) {
const togglerIconProps = mergeProps(
- {
- className: cx('togglericon')
- },
- ptm('togglericon')
+ [
+ {
+ className: cx('togglericon')
+ },
+ ptm('togglericon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = collapsed ? props.expandIcon ||
: props.collapseIcon ||
;
@@ -127,21 +139,27 @@ export const Fieldset = React.forwardRef((inProps, ref) => {
const createLegendContent = () => {
const legendTextProps = mergeProps(
- {
- className: cx('legendTitle')
- },
- ptm('legendTitle')
+ [
+ {
+ className: cx('legendTitle')
+ },
+ ptm('legendTitle')
+ ],
+ { useTailwind: context.useTailwind }
);
const togglerProps = mergeProps(
- {
- id: headerId,
- 'aria-expanded': !collapsed,
- 'aria-controls': contentId,
- href: '#' + contentId,
- tabIndex: props.toggleable ? null : -1
- },
- ptm('toggler')
+ [
+ {
+ id: headerId,
+ 'aria-expanded': !collapsed,
+ 'aria-controls': contentId,
+ href: '#' + contentId,
+ tabIndex: props.toggleable ? null : -1
+ },
+ ptm('toggler')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.toggleable) {
@@ -165,12 +183,15 @@ export const Fieldset = React.forwardRef((inProps, ref) => {
const createLegend = () => {
const legendProps = mergeProps(
- {
- className: cx('legend'),
- onClick: toggle
- },
+ [
+ {
+ className: cx('legend'),
+ onClick: toggle
+ },
- ptm('legend')
+ ptm('legend')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.legend != null || props.toggleable) {
@@ -187,15 +208,18 @@ export const Fieldset = React.forwardRef((inProps, ref) => {
}));
const rootProps = mergeProps(
- {
- id: idState,
- ref: elementRef,
- style: props.style,
- className: classNames(props.className, cx('root')),
- onClick: props.onClick
- },
- FieldsetBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ id: idState,
+ ref: elementRef,
+ style: props.style,
+ className: classNames(props.className, cx('root')),
+ onClick: props.onClick
+ },
+ FieldsetBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
const legend = createLegend();
diff --git a/components/lib/fileupload/FileUpload.js b/components/lib/fileupload/FileUpload.js
index 57bc7447e1..5b5ff87aaa 100644
--- a/components/lib/fileupload/FileUpload.js
+++ b/components/lib/fileupload/FileUpload.js
@@ -366,45 +366,57 @@ export const FileUpload = React.memo(
const createChooseButton = () => {
const { className, style, icon: _icon, iconOnly } = props.chooseOptions;
const chooseButtonLabelProps = mergeProps(
- {
- className: cx('chooseButtonLabel')
- },
- ptm('chooseButtonLabel')
+ [
+ {
+ className: cx('chooseButtonLabel')
+ },
+ ptm('chooseButtonLabel')
+ ],
+ { useTailwind: context.useTailwind }
);
const label = iconOnly ?
:
{chooseButtonLabel} ;
const inputProps = mergeProps(
- {
- ref: fileInputRef,
- type: 'file',
- onChange: (e) => onFileSelect(e),
- multiple: props.multiple,
- accept: props.accept,
- disabled: chooseDisabled
- },
- ptm('input')
+ [
+ {
+ ref: fileInputRef,
+ type: 'file',
+ onChange: (e) => onFileSelect(e),
+ multiple: props.multiple,
+ accept: props.accept,
+ disabled: chooseDisabled
+ },
+ ptm('input')
+ ],
+ { useTailwind: context.useTailwind }
);
const input =
;
const chooseIconProps = mergeProps(
- {
- className: cx('chooseIcon', { iconOnly })
- },
- ptm('chooseIcon')
+ [
+ {
+ className: cx('chooseIcon', { iconOnly })
+ },
+ ptm('chooseIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = _icon ||
;
const chooseIcon = IconUtils.getJSXIcon(icon, { ...chooseIconProps }, { props });
const chooseButtonProps = mergeProps(
- {
- className: classNames(className, cx('chooseButton', { iconOnly, disabled, className, focusedState })),
- style,
- onClick: choose,
- onKeyDown: (e) => onKeyDown(e),
- onFocus,
- onBlur,
- tabIndex: 0,
- 'data-p-disabled': disabled,
- 'data-p-focus': focusedState
- },
- ptm('chooseButton')
+ [
+ {
+ className: classNames(className, cx('chooseButton', { iconOnly, disabled, className, focusedState })),
+ style,
+ onClick: choose,
+ onKeyDown: (e) => onKeyDown(e),
+ onFocus,
+ onBlur,
+ tabIndex: 0,
+ 'data-p-disabled': disabled,
+ 'data-p-focus': focusedState
+ },
+ ptm('chooseButton')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -425,24 +437,30 @@ export const FileUpload = React.memo(
const createFile = (file, index, badgeOptions) => {
const key = file.name + file.type + file.size;
const thumbnailProps = mergeProps(
- {
- role: 'presentation',
- className: cx('thumbnail'),
- src: file.objectURL,
- width: props.previewWidth
- },
- ptm('thumbnail')
+ [
+ {
+ role: 'presentation',
+ className: cx('thumbnail'),
+ src: file.objectURL,
+ width: props.previewWidth
+ },
+ ptm('thumbnail')
+ ],
+ { useTailwind: context.useTailwind }
);
const preview = isImage(file) ?
: null;
- const detailsProps = mergeProps(ptm('details'));
- const fileSizeProps = mergeProps(ptm('fileSize'));
+ const detailsProps = mergeProps([ptm('details')], { useTailwind: context.useTailwind });
+ const fileSizeProps = mergeProps([ptm('fileSize')], { useTailwind: context.useTailwind });
const fileNameProps = mergeProps(
- {
- className: cx('fileName')
- },
- ptm('fileName')
+ [
+ {
+ className: cx('fileName')
+ },
+ ptm('fileName')
+ ],
+ { useTailwind: context.useTailwind }
);
- const actionsProps = mergeProps(ptm('actions'));
+ const actionsProps = mergeProps([ptm('actions')], { useTailwind: context.useTailwind });
const fileName =
{file.name}
;
const size =
{formatSize(file.size)}
;
@@ -493,11 +511,14 @@ export const FileUpload = React.memo(
}
const fileProps = mergeProps(
- {
- key,
- className: cx('file')
- },
- ptm('file')
+ [
+ {
+ key,
+ className: cx('file')
+ },
+ ptm('file')
+ ],
+ { useTailwind: context.useTailwind }
);
return
{content}
;
@@ -546,17 +567,23 @@ export const FileUpload = React.memo(
const uploadLabel = !uploadOptions.iconOnly ? uploadButtonLabel : '';
const cancelLabel = !cancelOptions.iconOnly ? cancelButtonLabel : '';
const uploadIconProps = mergeProps(
- {
- className: cx('uploadIcon', { iconOnly: uploadOptions.iconOnly })
- },
- ptm('uploadIcon')
+ [
+ {
+ className: cx('uploadIcon', { iconOnly: uploadOptions.iconOnly })
+ },
+ ptm('uploadIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const uploadIcon = IconUtils.getJSXIcon(uploadOptions.icon ||
, { ...uploadIconProps }, { props });
const cancelIconProps = mergeProps(
- {
- className: cx('cancelIcon', { iconOnly: cancelOptions.iconOnly })
- },
- ptm('cancelIcon')
+ [
+ {
+ className: cx('cancelIcon', { iconOnly: cancelOptions.iconOnly })
+ },
+ ptm('cancelIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const cancelIcon = IconUtils.getJSXIcon(cancelOptions.icon ||
, { ...cancelIconProps }, { props });
@@ -598,11 +625,14 @@ export const FileUpload = React.memo(
}
const buttonbarProps = mergeProps(
- {
- className: classNames(props.headerClassName, cx('buttonbar')),
- style: props.headerStyle
- },
- ptm('buttonbar')
+ [
+ {
+ className: classNames(props.headerClassName, cx('buttonbar')),
+ style: props.headerStyle
+ },
+ ptm('buttonbar')
+ ],
+ { useTailwind: context.useTailwind }
);
let header = (
@@ -627,27 +657,33 @@ export const FileUpload = React.memo(
}
const rootProps = mergeProps(
- {
- id: props.id,
- className: cx('root'),
- style: props.style
- },
- FileUploadBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ id: props.id,
+ className: cx('root'),
+ style: props.style
+ },
+ FileUploadBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
const contentProps = mergeProps(
- {
- ref: contentRef,
- className: classNames(props.contentClassName, cx('content')),
- style: props.contentStyle,
- onDragEnter: (e) => onDragEnter(e),
- onDragOver: (e) => onDragOver(e),
- onDragLeave: (e) => onDragLeave(e),
- onDrop: (e) => onDrop(e),
- 'data-p-highlight': false
- },
- ptm('content')
+ [
+ {
+ ref: contentRef,
+ className: classNames(props.contentClassName, cx('content')),
+ style: props.contentStyle,
+ onDragEnter: (e) => onDragEnter(e),
+ onDragOver: (e) => onDragOver(e),
+ onDragLeave: (e) => onDragLeave(e),
+ onDrop: (e) => onDrop(e),
+ 'data-p-highlight': false
+ },
+ ptm('content')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -667,54 +703,69 @@ export const FileUpload = React.memo(
const createBasic = () => {
const chooseOptions = props.chooseOptions;
const labelProps = mergeProps(
- {
- className: cx('label')
- },
- ptm('label')
+ [
+ {
+ className: cx('label')
+ },
+ ptm('label')
+ ],
+ { useTailwind: context.useTailwind }
);
const chooseLabel = chooseOptions.iconOnly ?
:
{chooseButtonLabel} ;
const label = props.auto ? chooseLabel :
{hasFiles ? filesState[0].name : chooseLabel} ;
const chooseIconProps = mergeProps(
- {
- className: cx('chooseIcon', { iconOnly: chooseOptions.iconOnly })
- },
- ptm('chooseIcon')
+ [
+ {
+ className: cx('chooseIcon', { iconOnly: chooseOptions.iconOnly })
+ },
+ ptm('chooseIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = chooseOptions.icon ? chooseOptions.icon : !chooseOptions.icon && (!hasFiles || props.auto) ?
: !chooseOptions.icon && hasFiles && !props.auto &&
;
const chooseIcon = IconUtils.getJSXIcon(icon, { ...chooseIconProps }, { props, hasFiles });
const inputProps = mergeProps(
- {
- ref: fileInputRef,
- type: 'file',
- onChange: (e) => onFileSelect(e),
- multiple: props.multiple,
- accept: props.accept,
- disabled: disabled
- },
- ptm('input')
+ [
+ {
+ ref: fileInputRef,
+ type: 'file',
+ onChange: (e) => onFileSelect(e),
+ multiple: props.multiple,
+ accept: props.accept,
+ disabled: disabled
+ },
+ ptm('input')
+ ],
+ { useTailwind: context.useTailwind }
);
const input = !hasFiles &&
;
const rootProps = mergeProps(
- {
- className: classNames(props.className, cx('root')),
- style: props.style
- },
- FileUploadBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ className: classNames(props.className, cx('root')),
+ style: props.style
+ },
+ FileUploadBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
const basicButtonProps = mergeProps(
- {
- className: classNames(chooseOptions.className, cx('basicButton', { hasFiles, disabled, focusedState })),
- style: chooseOptions.style,
- tabIndex: 0,
- onClick: onSimpleUploaderClick,
- onKeyDown: (e) => onKeyDown(e),
- onFocus,
- onBlur
- },
- FileUploadBase.getOtherProps(props),
- ptm('basicButton')
+ [
+ {
+ className: classNames(chooseOptions.className, cx('basicButton', { hasFiles, disabled, focusedState })),
+ style: chooseOptions.style,
+ tabIndex: 0,
+ onClick: onSimpleUploaderClick,
+ onKeyDown: (e) => onKeyDown(e),
+ onFocus,
+ onBlur
+ },
+ FileUploadBase.getOtherProps(props),
+ ptm('basicButton')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/galleria/Galleria.js b/components/lib/galleria/Galleria.js
index ca73fb5cda..0d9e9619d6 100644
--- a/components/lib/galleria/Galleria.js
+++ b/components/lib/galleria/Galleria.js
@@ -143,10 +143,13 @@ export const Galleria = React.memo(
const createHeader = () => {
const headerProps = mergeProps(
- {
- className: cx('header')
- },
- ptm('header')
+ [
+ {
+ className: cx('header')
+ },
+ ptm('header')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.header) {
@@ -158,10 +161,13 @@ export const Galleria = React.memo(
const createFooter = () => {
const footerProps = mergeProps(
- {
- className: cx('footer')
- },
- ptm('footer')
+ [
+ {
+ className: cx('footer')
+ },
+ ptm('footer')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.footer) {
@@ -176,23 +182,29 @@ export const Galleria = React.memo(
const indicatorPosClassName = props.showIndicators && getPositionClassName('p-galleria-indicators', props.indicatorsPosition);
const closeIconProps = mergeProps(
- {
- className: cx('closeIcon'),
- 'aria-hidden': true
- },
- ptm('closeIcon')
+ [
+ {
+ className: cx('closeIcon'),
+ 'aria-hidden': true
+ },
+ ptm('closeIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.closeIcon ||
;
const closeIcon = IconUtils.getJSXIcon(icon, { ...closeIconProps }, { props });
const closeButtonProps = mergeProps(
- {
- type: 'button',
- className: cx('closeButton'),
- 'aria-label': localeOption('close'),
- onClick: hide
- },
- ptm('closeButton')
+ [
+ {
+ type: 'button',
+ className: cx('closeButton'),
+ 'aria-label': localeOption('close'),
+ onClick: hide
+ },
+ ptm('closeButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const closeButton = props.fullScreen && (
@@ -206,21 +218,27 @@ export const Galleria = React.memo(
const footer = createFooter();
const rootProps = mergeProps(
- {
- ref: elementRef,
- id: props.id,
- className: classNames(props.className, cx('root', { context, thumbnailsPosClassName, indicatorPosClassName })),
- style: props.style
- },
- GalleriaBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ ref: elementRef,
+ id: props.id,
+ className: classNames(props.className, cx('root', { context, thumbnailsPosClassName, indicatorPosClassName })),
+ style: props.style
+ },
+ GalleriaBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
const contentProps = mergeProps(
- {
- className: cx('content')
- },
- ptm('content')
+ [
+ {
+ className: cx('content')
+ },
+ ptm('content')
+ ],
+ { useTailwind: context.useTailwind }
);
const element = (
@@ -288,26 +306,32 @@ export const Galleria = React.memo(
if (props.fullScreen) {
const maskProps = mergeProps(
- {
- className: cx('mask', { visibleState })
- },
- ptm('mask')
+ [
+ {
+ className: cx('mask', { visibleState })
+ },
+ ptm('mask')
+ ],
+ { useTailwind: context.useTailwind }
);
const transitionProps = mergeProps(
- {
- classNames: cx('transition'),
- in: visibleState,
- timeout: { enter: 150, exit: 150 },
- options: props.transitionOptions,
- unmountOnExit: true,
- onEnter,
- onEntering,
- onEntered,
- onExit,
- onExited
- },
- ptm('transition')
+ [
+ {
+ classNames: cx('transition'),
+ in: visibleState,
+ timeout: { enter: 150, exit: 150 },
+ options: props.transitionOptions,
+ unmountOnExit: true,
+ onEnter,
+ onEntering,
+ onEntered,
+ onExit,
+ onExited
+ },
+ ptm('transition')
+ ],
+ { useTailwind: context.useTailwind }
);
const galleriaWrapper = (
diff --git a/components/lib/galleria/GalleriaItem.js b/components/lib/galleria/GalleriaItem.js
index 20e1b5b271..cd366408e7 100644
--- a/components/lib/galleria/GalleriaItem.js
+++ b/components/lib/galleria/GalleriaItem.js
@@ -3,10 +3,12 @@ import { useMountEffect } from '../hooks/Hooks';
import { ChevronLeftIcon } from '../icons/chevronleft';
import { ChevronRightIcon } from '../icons/chevronright';
import { Ripple } from '../ripple/Ripple';
+import { PrimeReactContext } from '../api/Api';
import { IconUtils, classNames, mergeProps } from '../utils/Utils';
export const GalleriaItem = React.memo(
React.forwardRef((props, ref) => {
+ const context = React.useContext(PrimeReactContext);
const { ptm, cx } = props;
const getPTOptions = (key, options) => {
@@ -94,23 +96,29 @@ export const GalleriaItem = React.memo(
const isDisabled = !props.circular && props.activeItemIndex === 0;
const previousItemIconProps = mergeProps(
- {
- className: cx('previousItemIcon')
- },
- getPTOptions('previousItemIcon')
+ [
+ {
+ className: cx('previousItemIcon')
+ },
+ getPTOptions('previousItemIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.itemPrevIcon ||
;
const itemPrevIcon = IconUtils.getJSXIcon(icon, { ...previousItemIconProps }, { props });
const previousItemButtonProps = mergeProps(
- {
- type: 'button',
- className: cx('previousItemButton', { isDisabled }),
- onClick: navBackward,
- disabled: isDisabled,
- 'data-p-disabled': isDisabled
- },
- getPTOptions('previousItemButton')
+ [
+ {
+ type: 'button',
+ className: cx('previousItemButton', { isDisabled }),
+ onClick: navBackward,
+ disabled: isDisabled,
+ 'data-p-disabled': isDisabled
+ },
+ getPTOptions('previousItemButton')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -129,23 +137,29 @@ export const GalleriaItem = React.memo(
const isDisabled = !props.circular && props.activeItemIndex === props.value.length - 1;
const nextItemIconProps = mergeProps(
- {
- className: cx('nextItemIcon')
- },
- getPTOptions('nextItemIcon')
+ [
+ {
+ className: cx('nextItemIcon')
+ },
+ getPTOptions('nextItemIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.itemNextIcon ||
;
const itemNextIcon = IconUtils.getJSXIcon(icon, { ...nextItemIconProps }, { props });
const nextItemButtonProps = mergeProps(
- {
- type: 'button',
- className: cx('nextItemButton', { isDisabled }),
- onClick: navForward,
- disabled: isDisabled,
- 'data-p-disabled': isDisabled
- },
- getPTOptions('nextItemButton')
+ [
+ {
+ type: 'button',
+ className: cx('nextItemButton', { isDisabled }),
+ onClick: navForward,
+ disabled: isDisabled,
+ 'data-p-disabled': isDisabled
+ },
+ getPTOptions('nextItemButton')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -161,10 +175,13 @@ export const GalleriaItem = React.memo(
const createCaption = () => {
const captionProps = mergeProps(
- {
- className: cx('caption')
- },
- getPTOptions('caption')
+ [
+ {
+ className: cx('caption')
+ },
+ getPTOptions('caption')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.caption) {
@@ -182,16 +199,19 @@ export const GalleriaItem = React.memo(
let indicator = props.indicator && props.indicator(index);
const indicatorProps = mergeProps(
- {
- className: cx('indicator', { isActive }),
- key: key,
- tabIndex: 0,
- onClick: () => onIndicatorClick(index),
- onMouseEnter: () => onIndicatorMouseEnter(index),
- onKeyDown: (e) => onIndicatorKeyDown(e, index),
- 'data-p-highlight': isActive
- },
- getPTOptions('indicator')
+ [
+ {
+ className: cx('indicator', { isActive }),
+ key: key,
+ tabIndex: 0,
+ onClick: () => onIndicatorClick(index),
+ onMouseEnter: () => onIndicatorMouseEnter(index),
+ onKeyDown: (e) => onIndicatorKeyDown(e, index),
+ 'data-p-highlight': isActive
+ },
+ getPTOptions('indicator')
+ ],
+ { useTailwind: context.useTailwind }
);
if (!indicator) {
@@ -209,10 +229,13 @@ export const GalleriaItem = React.memo(
if (props.showIndicators) {
let indicators = [];
const indicatorsProps = mergeProps(
- {
- className: classNames(props.indicatorsContentClassName, cx('indicators'))
- },
- getPTOptions('indicators')
+ [
+ {
+ className: classNames(props.indicatorsContentClassName, cx('indicators'))
+ },
+ getPTOptions('indicators')
+ ],
+ { useTailwind: context.useTailwind }
);
for (let i = 0; i < props.value.length; i++) {
@@ -232,25 +255,34 @@ export const GalleriaItem = React.memo(
const indicators = createIndicators();
const itemWrapperProps = mergeProps(
- {
- ref: ref,
- className: cx('itemWrapper')
- },
- getPTOptions('itemWrapper')
+ [
+ {
+ ref: ref,
+ className: cx('itemWrapper')
+ },
+ getPTOptions('itemWrapper')
+ ],
+ { useTailwind: context.useTailwind }
);
const itemContainerProps = mergeProps(
- {
- className: cx('itemContainer')
- },
- getPTOptions('itemContainer')
+ [
+ {
+ className: cx('itemContainer')
+ },
+ getPTOptions('itemContainer')
+ ],
+ { useTailwind: context.useTailwind }
);
const itemProps = mergeProps(
- {
- className: cx('item')
- },
- getPTOptions('item')
+ [
+ {
+ className: cx('item')
+ },
+ getPTOptions('item')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/galleria/GalleriaThumbnails.js b/components/lib/galleria/GalleriaThumbnails.js
index 99ac811180..f6dbfdb9b2 100644
--- a/components/lib/galleria/GalleriaThumbnails.js
+++ b/components/lib/galleria/GalleriaThumbnails.js
@@ -10,6 +10,7 @@ import { DomHandler, IconUtils, ObjectUtils, UniqueComponentId, classNames, merg
const GalleriaThumbnailItem = React.memo((props) => {
const { ptm, cx } = props;
+ const context = React.useContext(PrimeReactContext);
const getPTOptions = (key, options) => {
return ptm(key, {
@@ -38,24 +39,30 @@ const GalleriaThumbnailItem = React.memo((props) => {
const content = props.template && props.template(props.item);
const thumbnailItemProps = mergeProps(
- {
- className: classNames(props.className, cx('thumbnailItem', { subProps: props })),
- 'data-p-galleria-thumbnail-item-current': props.current,
- 'data-p-galleria-thumbnail-item-active': props.active,
- 'data-p-galleria-thumbnail-item-start': props.start,
- 'data-p-galleria-thumbnail-item-end': props.end
- },
- getPTOptions('thumbnailItem')
+ [
+ {
+ className: classNames(props.className, cx('thumbnailItem', { subProps: props })),
+ 'data-p-galleria-thumbnail-item-current': props.current,
+ 'data-p-galleria-thumbnail-item-active': props.active,
+ 'data-p-galleria-thumbnail-item-start': props.start,
+ 'data-p-galleria-thumbnail-item-end': props.end
+ },
+ getPTOptions('thumbnailItem')
+ ],
+ { useTailwind: context.useTailwind }
);
const thumbnailItemContentProps = mergeProps(
- {
- className: cx('thumbnailItemContent'),
- tabIndex: tabIndex,
- onClick: onItemClick,
- onKeyDown: onItemKeyDown
- },
- getPTOptions('thumbnailItemContent')
+ [
+ {
+ className: cx('thumbnailItemContent'),
+ tabIndex: tabIndex,
+ onClick: onItemClick,
+ onKeyDown: onItemKeyDown
+ },
+ getPTOptions('thumbnailItemContent')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -365,21 +372,27 @@ export const GalleriaThumbnails = React.memo(
let isDisabled = (!props.circular && props.activeItemIndex === 0) || props.value.length <= numVisibleState;
const previousThumbnailIconProps = mergeProps(
- {
- className: cx('previousThumbnailIcon')
- },
- getPTOptions('previousThumbnailIcon')
+ [
+ {
+ className: cx('previousThumbnailIcon')
+ },
+ getPTOptions('previousThumbnailIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.isVertical ? props.prevThumbnailIcon ||
: props.prevThumbnailIcon ||
;
const prevThumbnailIcon = IconUtils.getJSXIcon(icon, { ...previousThumbnailIconProps }, { props });
const previousThumbnailButtonProps = mergeProps(
- {
- className: cx('previousThumbnailButton', { isDisabled }),
- onClick: navBackward,
- disabled: isDisabled,
- 'data-p-disabled': isDisabled
- },
- getPTOptions('previousThumbnailButton')
+ [
+ {
+ className: cx('previousThumbnailButton', { isDisabled }),
+ onClick: navBackward,
+ disabled: isDisabled,
+ 'data-p-disabled': isDisabled
+ },
+ getPTOptions('previousThumbnailButton')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -398,22 +411,28 @@ export const GalleriaThumbnails = React.memo(
const isDisabled = (!props.circular && props.activeItemIndex === props.value.length - 1) || props.value.length <= numVisibleState;
const nextThumbnailIconProps = mergeProps(
- {
- className: cx('nextThumbnailIcon')
- },
- getPTOptions('nextThumbnailIcon')
+ [
+ {
+ className: cx('nextThumbnailIcon')
+ },
+ getPTOptions('nextThumbnailIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.isVertical ? props.nextThumbnailIcon ||
: props.nextThumbnailIcon ||
;
const nextThumbnailIcon = IconUtils.getJSXIcon(icon, { ...nextThumbnailIconProps }, { props });
const nextThumbnailButtonProps = mergeProps(
- {
- className: cx('nextThumbnailButton', { isDisabled }),
- onClick: navForward,
- disabled: isDisabled,
- 'data-p-disabled': isDisabled
- },
- getPTOptions('nextThumbnailButton')
+ [
+ {
+ className: cx('nextThumbnailButton', { isDisabled }),
+ onClick: navForward,
+ disabled: isDisabled,
+ 'data-p-disabled': isDisabled
+ },
+ getPTOptions('nextThumbnailButton')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -434,30 +453,39 @@ export const GalleriaThumbnails = React.memo(
const forwardNavigator = createForwardNavigator();
const thumbnailContainerProps = mergeProps(
- {
- className: cx('thumbnailContainer')
- },
- getPTOptions('thumbnailContainer')
+ [
+ {
+ className: cx('thumbnailContainer')
+ },
+ getPTOptions('thumbnailContainer')
+ ],
+ { useTailwind: context.useTailwind }
);
const thumbnailItemsContainerProps = mergeProps(
- {
- className: cx('thumbnailItemsContainer'),
- style: sx('thumbnailItemsContainer', { height })
- },
- getPTOptions('thumbnailItemsContainer')
+ [
+ {
+ className: cx('thumbnailItemsContainer'),
+ style: sx('thumbnailItemsContainer', { height })
+ },
+ getPTOptions('thumbnailItemsContainer')
+ ],
+ { useTailwind: context.useTailwind }
);
const thumbnailItemsProps = mergeProps(
- {
- ref: itemsContainerRef,
- className: cx('thumbnailItems'),
- onTransitionEnd: onTransitionEnd,
- onTouchStart: onTouchStart,
- onTouchMove: onTouchMove,
- onTouchEnd: onTouchEnd
- },
- getPTOptions('thumbnailItems')
+ [
+ {
+ ref: itemsContainerRef,
+ className: cx('thumbnailItems'),
+ onTransitionEnd: onTransitionEnd,
+ onTouchStart: onTouchStart,
+ onTouchMove: onTouchMove,
+ onTouchEnd: onTouchEnd
+ },
+ getPTOptions('thumbnailItems')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -474,10 +502,13 @@ export const GalleriaThumbnails = React.memo(
const content = createContent();
const thumbnailWrapperProps = mergeProps(
- {
- className: cx('thumbnailWrapper')
- },
- getPTOptions('thumbnailWrapper')
+ [
+ {
+ className: cx('thumbnailWrapper')
+ },
+ getPTOptions('thumbnailWrapper')
+ ],
+ { useTailwind: context.useTailwind }
);
return
{content}
;
diff --git a/components/lib/image/Image.js b/components/lib/image/Image.js
index 0fd0fc9fa4..3169a137b2 100644
--- a/components/lib/image/Image.js
+++ b/components/lib/image/Image.js
@@ -125,11 +125,14 @@ export const Image = React.memo(
const createPreview = () => {
const buttonProps = mergeProps(
- {
- className: cx('button'),
- onClick: show
- },
- ptm('button')
+ [
+ {
+ className: cx('button'),
+ onClick: show
+ },
+ ptm('button')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.preview) {
@@ -143,12 +146,12 @@ export const Image = React.memo(
const { downloadable, alt, crossOrigin, referrerPolicy, useMap, loading } = props;
const zoomOutDisabled = scaleState <= 0.5;
const zoomInDisabled = scaleState >= 1.5;
- const downloadIconProps = mergeProps(ptm('downloadIcon'));
- const rotateRightIconProps = mergeProps(ptm('rotateRightIcon'));
- const rotateLeftIconProps = mergeProps(ptm('rotateLeftIcon'));
- const zoomOutIconProps = mergeProps(ptm('zoomOutIcon'));
- const zoomInIconProps = mergeProps(ptm('zoomInIcon'));
- const closeIconProps = mergeProps(ptm('closeIcon'));
+ const downloadIconProps = mergeProps([ptm('downloadIcon')], { useTailwind: context.useTailwind });
+ const rotateRightIconProps = mergeProps([ptm('rotateRightIcon')], { useTailwind: context.useTailwind });
+ const rotateLeftIconProps = mergeProps([ptm('rotateLeftIcon')], { useTailwind: context.useTailwind });
+ const zoomOutIconProps = mergeProps([ptm('zoomOutIcon')], { useTailwind: context.useTailwind });
+ const zoomInIconProps = mergeProps([ptm('zoomInIcon')], { useTailwind: context.useTailwind });
+ const closeIconProps = mergeProps([ptm('closeIcon')], { useTailwind: context.useTailwind });
const downloadIcon = IconUtils.getJSXIcon(props.downloadIcon ||
, { ...downloadIconProps }, { props });
const rotateRightIcon = IconUtils.getJSXIcon(props.rotateRightIcon ||
, { ...rotateRightIconProps }, { props });
const rotateLeftIcon = IconUtils.getJSXIcon(props.rotateLeftIcon ||
, { ...rotateLeftIconProps }, { props });
@@ -157,112 +160,145 @@ export const Image = React.memo(
const closeIcon = IconUtils.getJSXIcon(props.closeIcon ||
, { ...closeIconProps }, { props });
const maskProps = mergeProps(
- {
- ref: maskRef,
- className: cx('mask'),
- onPointerUp: hide
- },
- ptm('mask')
+ [
+ {
+ ref: maskRef,
+ className: cx('mask'),
+ onPointerUp: hide
+ },
+ ptm('mask')
+ ],
+ { useTailwind: context.useTailwind }
);
const toolbarProps = mergeProps(
- {
- className: cx('toolbar')
- },
- ptm('toolbar')
+ [
+ {
+ className: cx('toolbar')
+ },
+ ptm('toolbar')
+ ],
+ { useTailwind: context.useTailwind }
);
const downloadButtonProps = mergeProps(
- {
- className: cx('downloadButton'),
- onPointerUp: onDownload,
- type: 'button'
- },
- ptm('downloadButton')
+ [
+ {
+ className: cx('downloadButton'),
+ onPointerUp: onDownload,
+ type: 'button'
+ },
+ ptm('downloadButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const rotateRightButtonProps = mergeProps(
- {
- className: cx('rotateRightButton'),
- onPointerUp: rotateRight,
- type: 'button'
- },
- ptm('rotateRightButton')
+ [
+ {
+ className: cx('rotateRightButton'),
+ onPointerUp: rotateRight,
+ type: 'button'
+ },
+ ptm('rotateRightButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const rotateLeftButtonProps = mergeProps(
- {
- className: cx('rotateLeftButton'),
- onPointerUp: rotateLeft,
- type: 'button'
- },
- ptm('rotateLeftButton')
+ [
+ {
+ className: cx('rotateLeftButton'),
+ onPointerUp: rotateLeft,
+ type: 'button'
+ },
+ ptm('rotateLeftButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const zoomOutButtonProps = mergeProps(
- {
- className: classNames(cx('zoomOutButton'), { 'p-disabled': zoomOutDisabled }),
- style: { pointerEvents: 'auto' },
- onPointerUp: zoomOut,
- type: 'button',
- disabled: zoomOutDisabled
- },
- ptm('zoomOutButton')
+ [
+ {
+ className: classNames(cx('zoomOutButton'), { 'p-disabled': zoomOutDisabled }),
+ style: { pointerEvents: 'auto' },
+ onPointerUp: zoomOut,
+ type: 'button',
+ disabled: zoomOutDisabled
+ },
+ ptm('zoomOutButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const zoomInButtonProps = mergeProps(
- {
- className: classNames(cx('zoomInButton'), { 'p-disabled': zoomInDisabled }),
- style: { pointerEvents: 'auto' },
- onPointerUp: zoomIn,
- type: 'button',
- disabled: zoomInDisabled
- },
- ptm('zoomInButton')
+ [
+ {
+ className: classNames(cx('zoomInButton'), { 'p-disabled': zoomInDisabled }),
+ style: { pointerEvents: 'auto' },
+ onPointerUp: zoomIn,
+ type: 'button',
+ disabled: zoomInDisabled
+ },
+ ptm('zoomInButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const closeButtonProps = mergeProps(
- {
- className: cx('closeButton'),
- type: 'button',
- 'aria-label': localeOption('close')
- },
- ptm('closeButton')
+ [
+ {
+ className: cx('closeButton'),
+ type: 'button',
+ 'aria-label': localeOption('close')
+ },
+ ptm('closeButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const previewProps = mergeProps(
- {
- src: props.zoomSrc || props.src,
- className: cx('preview'),
- style: sx('preview', { rotateState, scaleState }),
- onPointerUp: onPreviewImageClick,
- crossOrigin: crossOrigin,
- referrerPolicy: referrerPolicy,
- useMap: useMap,
- loading: loading
- },
- ptm('preview')
+ [
+ {
+ src: props.zoomSrc || props.src,
+ className: cx('preview'),
+ style: sx('preview', { rotateState, scaleState }),
+ onPointerUp: onPreviewImageClick,
+ crossOrigin: crossOrigin,
+ referrerPolicy: referrerPolicy,
+ useMap: useMap,
+ loading: loading
+ },
+ ptm('preview')
+ ],
+ { useTailwind: context.useTailwind }
);
const previewContainerProps = mergeProps(
- {
- ref: previewRef
- },
- ptm('previewContainer')
+ [
+ {
+ ref: previewRef
+ },
+ ptm('previewContainer')
+ ],
+ { useTailwind: context.useTailwind }
);
const transitionProps = mergeProps(
- {
- classNames: cx('transition'),
- in: previewVisibleState,
- timeout: { enter: 150, exit: 150 },
- unmountOnExit: true,
- onEntering: onEntering,
- onEntered: onEntered,
- onExit: onExit,
- onExiting: onExiting,
- onExited: onExited
- },
- ptm('transition')
+ [
+ {
+ classNames: cx('transition'),
+ in: previewVisibleState,
+ timeout: { enter: 150, exit: 150 },
+ unmountOnExit: true,
+ onEntering: onEntering,
+ onEntered: onEntered,
+ onExit: onExit,
+ onExiting: onExiting,
+ onExited: onExited
+ },
+ ptm('transition')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -295,40 +331,49 @@ export const Image = React.memo(
const { src, alt, width, height, crossOrigin, referrerPolicy, useMap, loading } = props;
const element = createElement();
const iconProp = mergeProps(
- {
- className: cx('icon')
- },
- ptm('icon')
+ [
+ {
+ className: cx('icon')
+ },
+ ptm('icon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.indicatorIcon ||
;
const indicatorIcon = IconUtils.getJSXIcon(icon, { ...iconProp }, { props });
const content = props.template ? ObjectUtils.getJSXElement(props.template, props) : indicatorIcon;
const preview = createPreview();
const imageProp = mergeProps(
- {
- ref: imageRef,
- src: src,
- className: props.imageClassName,
- width: width,
- height: height,
- crossOrigin: crossOrigin,
- referrerPolicy: referrerPolicy,
- useMap: useMap,
- loading: loading,
- style: props.imageStyle,
- onError: props.onError
- },
- ptm('image')
+ [
+ {
+ ref: imageRef,
+ src: src,
+ className: props.imageClassName,
+ width: width,
+ height: height,
+ crossOrigin: crossOrigin,
+ referrerPolicy: referrerPolicy,
+ useMap: useMap,
+ loading: loading,
+ style: props.imageStyle,
+ onError: props.onError
+ },
+ ptm('image')
+ ],
+ { useTailwind: context.useTailwind }
);
const image = props.src &&
;
const rootProps = mergeProps(
- {
- ref: elementRef,
- className: cx('root')
- },
- ImageBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ ref: elementRef,
+ className: cx('root')
+ },
+ ImageBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/inplace/Inplace.js b/components/lib/inplace/Inplace.js
index 0fe743bae9..482cc09ed6 100644
--- a/components/lib/inplace/Inplace.js
+++ b/components/lib/inplace/Inplace.js
@@ -65,14 +65,17 @@ export const Inplace = React.forwardRef((inProps, ref) => {
const createDisplay = (content) => {
const displayProps = mergeProps(
- {
- onClick: open,
- className: cx('display'),
- onKeyDown: onDisplayKeyDown,
- tabIndex: props.tabIndex,
- 'aria-label': props.ariaLabel
- },
- ptm('display')
+ [
+ {
+ onClick: open,
+ className: cx('display'),
+ onKeyDown: onDisplayKeyDown,
+ tabIndex: props.tabIndex,
+ 'aria-label': props.ariaLabel
+ },
+ ptm('display')
+ ],
+ { useTailwind: context.useTailwind }
);
return
{content}
;
@@ -84,17 +87,22 @@ export const Inplace = React.forwardRef((inProps, ref) => {
const ariaLabel = localeOption('close');
if (props.closable) {
- const closeButtonProps = mergeProps({
- className: cx('closeButton'),
- icon: closeIcon,
- type: 'button',
- onClick: close,
- 'aria-label': ariaLabel,
- pt: ptm('closeButton'),
- __parentMetadata: {
- parent: metaData
- }
- });
+ const closeButtonProps = mergeProps(
+ [
+ {
+ className: cx('closeButton'),
+ icon: closeIcon,
+ type: 'button',
+ onClick: close,
+ 'aria-label': ariaLabel,
+ pt: ptm('closeButton'),
+ __parentMetadata: {
+ parent: metaData
+ }
+ }
+ ],
+ { useTailwind: context.useTailwind }
+ );
return
;
}
@@ -106,10 +114,13 @@ export const Inplace = React.forwardRef((inProps, ref) => {
const closeButton = createCloseButton();
const contentProps = mergeProps(
- {
- className: cx('content')
- },
- ptm('content')
+ [
+ {
+ className: cx('content')
+ },
+ ptm('content')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -140,12 +151,15 @@ export const Inplace = React.forwardRef((inProps, ref) => {
const children = createChildren();
const rootProps = mergeProps(
- {
- ref: elementRef,
- className: classNames(props.className, cx('root'))
- },
- InplaceBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ ref: elementRef,
+ className: classNames(props.className, cx('root'))
+ },
+ InplaceBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return
{children}
;
diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js
index 941c25fa83..89863fa64c 100644
--- a/components/lib/inputnumber/InputNumber.js
+++ b/components/lib/inputnumber/InputNumber.js
@@ -1072,26 +1072,32 @@ export const InputNumber = React.memo(
const createUpButton = () => {
const incrementIconProps = mergeProps(
- {
- className: cx('incrementIcon')
- },
- ptm('incrementIcon')
+ [
+ {
+ className: cx('incrementIcon')
+ },
+ ptm('incrementIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.incrementButtonIcon ||
;
const upButton = IconUtils.getJSXIcon(icon, { ...incrementIconProps }, { props });
const incrementButtonProps = mergeProps(
- {
- type: 'button',
- className: classNames(props.incrementButtonClassName, cx('incrementButton')),
- onPointerLeave: onUpButtonMouseLeave,
- onPointerDown: (e) => onUpButtonMouseDown(e),
- onPointerUp: onUpButtonMouseUp,
- onKeyDown: (e) => onUpButtonKeyDown(e),
- onKeyUp: onUpButtonKeyUp,
- disabled: props.disabled,
- tabIndex: -1
- },
- ptm('incrementButton')
+ [
+ {
+ type: 'button',
+ className: classNames(props.incrementButtonClassName, cx('incrementButton')),
+ onPointerLeave: onUpButtonMouseLeave,
+ onPointerDown: (e) => onUpButtonMouseDown(e),
+ onPointerUp: onUpButtonMouseUp,
+ onKeyDown: (e) => onUpButtonKeyDown(e),
+ onKeyUp: onUpButtonKeyUp,
+ disabled: props.disabled,
+ tabIndex: -1
+ },
+ ptm('incrementButton')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -1104,26 +1110,32 @@ export const InputNumber = React.memo(
const createDownButton = () => {
const decrementIconProps = mergeProps(
- {
- className: cx('decrementIcon')
- },
- ptm('decrementIcon')
+ [
+ {
+ className: cx('decrementIcon')
+ },
+ ptm('decrementIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.decrementButtonIcon ||
;
const downButton = IconUtils.getJSXIcon(icon, { ...decrementIconProps }, { props });
const decrementButtonProps = mergeProps(
- {
- type: 'button',
- className: classNames(props.decrementButtonClassName, cx('decrementButton')),
- onPointerLeave: onDownButtonMouseLeave,
- onPointerDown: (e) => onDownButtonMouseDown(e),
- onPointerUp: onDownButtonMouseUp,
- onKeyDown: (e) => onDownButtonKeyDown(e),
- onKeyUp: onDownButtonKeyUp,
- disabled: props.disabled,
- tabIndex: -1
- },
- ptm('decrementButton')
+ [
+ {
+ type: 'button',
+ className: classNames(props.decrementButtonClassName, cx('decrementButton')),
+ onPointerLeave: onDownButtonMouseLeave,
+ onPointerDown: (e) => onDownButtonMouseDown(e),
+ onPointerUp: onDownButtonMouseUp,
+ onKeyDown: (e) => onDownButtonKeyDown(e),
+ onKeyUp: onDownButtonKeyUp,
+ disabled: props.disabled,
+ tabIndex: -1
+ },
+ ptm('decrementButton')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -1138,10 +1150,13 @@ export const InputNumber = React.memo(
const upButton = props.showButtons && createUpButton();
const downButton = props.showButtons && createDownButton();
const buttonGroupProps = mergeProps(
- {
- className: cx('buttonGroup')
- },
- ptm('buttonGroup')
+ [
+ {
+ className: cx('buttonGroup')
+ },
+ ptm('buttonGroup')
+ ],
+ { useTailwind: context.useTailwind }
);
if (stacked) {
@@ -1168,13 +1183,16 @@ export const InputNumber = React.memo(
const inputElement = createInputElement();
const buttonGroup = createButtonGroup();
const rootProps = mergeProps(
- {
- id: props.id,
- className: classNames(props.className, cx('root', { focusedState, stacked, horizontal, vertical })),
- style: props.style
- },
- otherProps,
- ptm('root')
+ [
+ {
+ id: props.id,
+ className: classNames(props.className, cx('root', { focusedState, stacked, horizontal, vertical })),
+ style: props.style
+ },
+ otherProps,
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/inputswitch/InputSwitch.js b/components/lib/inputswitch/InputSwitch.js
index 85cc44a969..1b6c493438 100644
--- a/components/lib/inputswitch/InputSwitch.js
+++ b/components/lib/inputswitch/InputSwitch.js
@@ -88,45 +88,57 @@ export const InputSwitch = React.memo(
const ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
const rootProps = mergeProps(
- {
- className: classNames(props.className, cx('root', { focusedState, checked })),
- style: props.style,
- onClick,
- role: 'checkbox',
- 'aria-checked': checked
- },
- ptm('root')
+ [
+ {
+ className: classNames(props.className, cx('root', { focusedState, checked })),
+ style: props.style,
+ onClick,
+ role: 'checkbox',
+ 'aria-checked': checked
+ },
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
const hiddenInputWrapperProps = mergeProps(
- {
- className: 'p-hidden-accessible'
- },
- ptm('hiddenInputWrapper')
+ [
+ {
+ className: 'p-hidden-accessible'
+ },
+ ptm('hiddenInputWrapper')
+ ],
+ { useTailwind: context.useTailwind }
);
const hiddenInputProps = mergeProps(
- {
- type: 'checkbox',
- id: props.inputId,
- name: props.name,
- checked: checked,
- onChange: toggle,
- onFocus: onFocus,
- onBlur: onBlur,
- disabled: props.disabled,
- role: 'switch',
- tabIndex: props.tabIndex,
- 'aria-checked': checked,
- ...ariaProps
- },
- ptm('hiddenInput')
+ [
+ {
+ type: 'checkbox',
+ id: props.inputId,
+ name: props.name,
+ checked: checked,
+ onChange: toggle,
+ onFocus: onFocus,
+ onBlur: onBlur,
+ disabled: props.disabled,
+ role: 'switch',
+ tabIndex: props.tabIndex,
+ 'aria-checked': checked,
+ ...ariaProps
+ },
+ ptm('hiddenInput')
+ ],
+ { useTailwind: context.useTailwind }
);
const sliderProps = mergeProps(
- {
- className: cx('slider')
- },
- ptm('slider')
+ [
+ {
+ className: cx('slider')
+ },
+ ptm('slider')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/inputtext/InputText.js b/components/lib/inputtext/InputText.js
index f571759ba6..fb9b7bae27 100644
--- a/components/lib/inputtext/InputText.js
+++ b/components/lib/inputtext/InputText.js
@@ -68,15 +68,18 @@ export const InputText = React.memo(
const hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
const rootProps = mergeProps(
- {
- className: cx('root', { isFilled }),
- onBeforeInput: onBeforeInput,
- onInput: onInput,
- onKeyDown: onKeyDown,
- onPaste: onPaste
- },
- InputTextBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ className: cx('root', { isFilled }),
+ onBeforeInput: onBeforeInput,
+ onInput: onInput,
+ onKeyDown: onKeyDown,
+ onPaste: onPaste
+ },
+ InputTextBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/inputtextarea/InputTextarea.js b/components/lib/inputtextarea/InputTextarea.js
index ae45442177..39723dd0f8 100644
--- a/components/lib/inputtextarea/InputTextarea.js
+++ b/components/lib/inputtextarea/InputTextarea.js
@@ -123,19 +123,22 @@ export const InputTextarea = React.memo(
const hasTooltip = ObjectUtils.isNotEmpty(props.tooltip);
const rootProps = mergeProps(
- {
- ref: elementRef,
- className: cx('root', { isFilled }),
- onFocus: onFocus,
- onBlur: onBlur,
- onKeyUp: onKeyUp,
- onKeyDown: onKeyDown,
- onBeforeInput: onBeforeInput,
- onInput: onInput,
- onPaste: onPaste
- },
- InputTextareaBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ ref: elementRef,
+ className: cx('root', { isFilled }),
+ onFocus: onFocus,
+ onBlur: onBlur,
+ onKeyUp: onKeyUp,
+ onKeyDown: onKeyDown,
+ onBeforeInput: onBeforeInput,
+ onInput: onInput,
+ onPaste: onPaste
+ },
+ InputTextareaBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/knob/Knob.js b/components/lib/knob/Knob.js
index 25b35cbc45..acc2679c56 100644
--- a/components/lib/knob/Knob.js
+++ b/components/lib/knob/Knob.js
@@ -160,61 +160,76 @@ export const Knob = React.memo(
}));
const labelProps = mergeProps(
- {
- x: 50,
- y: 57,
- textAnchor: 'middle',
- fill: props.textColor,
- className: cx('label'),
- name: props.name
- },
- ptm('label')
+ [
+ {
+ x: 50,
+ y: 57,
+ textAnchor: 'middle',
+ fill: props.textColor,
+ className: cx('label'),
+ name: props.name
+ },
+ ptm('label')
+ ],
+ { useTailwind: context.useTailwind }
);
const text = props.showValue &&
{valueToDisplay()} ;
const rootProps = mergeProps(
- {
- ref: elementRef,
- id: props.id,
- className: cx('root'),
- style: props.style
- },
- ptm('root')
+ [
+ {
+ ref: elementRef,
+ id: props.id,
+ className: cx('root'),
+ style: props.style
+ },
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
const svgProps = mergeProps(
- {
- viewBox: '0 0 100 100',
- width: props.size,
- height: props.size,
- onClick: (e) => onClick(e),
- onMouseDown: (e) => onMouseDown(e),
- onMouseUp: (e) => onMouseUp(e),
- onTouchStart: (e) => onTouchStart(e),
- onTouchEnd: (e) => onTouchEnd(e)
- },
- ptm('svg')
+ [
+ {
+ viewBox: '0 0 100 100',
+ width: props.size,
+ height: props.size,
+ onClick: (e) => onClick(e),
+ onMouseDown: (e) => onMouseDown(e),
+ onMouseUp: (e) => onMouseUp(e),
+ onTouchStart: (e) => onTouchStart(e),
+ onTouchEnd: (e) => onTouchEnd(e)
+ },
+ ptm('svg')
+ ],
+ { useTailwind: context.useTailwind }
);
const rangeProps = mergeProps(
- {
- d: rangePath,
- strokeWidth: props.strokeWidth,
- stroke: props.rangeColor,
- className: cx('range')
- },
- ptm('range')
+ [
+ {
+ d: rangePath,
+ strokeWidth: props.strokeWidth,
+ stroke: props.rangeColor,
+ className: cx('range')
+ },
+ ptm('range')
+ ],
+ { useTailwind: context.useTailwind }
);
const valueProps = mergeProps(
- {
- d: valuePath,
- strokeWidth: props.strokeWidth,
- stroke: props.valueColor,
- className: cx('value')
- },
- ptm('value')
+ [
+ {
+ d: valuePath,
+ strokeWidth: props.strokeWidth,
+ stroke: props.valueColor,
+ className: cx('value')
+ },
+ ptm('value')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/listbox/ListBox.js b/components/lib/listbox/ListBox.js
index 4e658c9d1e..d467260721 100644
--- a/components/lib/listbox/ListBox.js
+++ b/components/lib/listbox/ListBox.js
@@ -344,12 +344,15 @@ export const ListBox = React.memo(
const key = index + '_' + getOptionGroupRenderKey(option);
const itemGroupProps = mergeProps(
- {
- className: ptCallbacks.cx('itemGroup'),
- style: ptCallbacks.sx('itemGroup', { scrollerOptions }),
- role: 'group'
- },
- ptCallbacks.ptm('itemGroup')
+ [
+ {
+ className: ptCallbacks.cx('itemGroup'),
+ style: ptCallbacks.sx('itemGroup', { scrollerOptions }),
+ role: 'group'
+ },
+ ptCallbacks.ptm('itemGroup')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -396,10 +399,13 @@ export const ListBox = React.memo(
const createEmptyMessage = (emptyMessage, isFilter) => {
const emptyMessageProps = mergeProps(
- {
- className: ptCallbacks.cx('emptyMessage')
- },
- ptCallbacks.ptm('emptyMessage')
+ [
+ {
+ className: ptCallbacks.cx('emptyMessage')
+ },
+ ptCallbacks.ptm('emptyMessage')
+ ],
+ { useTailwind: context.useTailwind }
);
const message = ObjectUtils.getJSXElement(emptyMessage, props) || localeOption(isFilter ? 'emptyFilterMessage' : 'emptyMessage');
@@ -417,15 +423,18 @@ export const ListBox = React.memo(
itemTemplate: (item, options) => item && createItem(item, options.index, options),
contentTemplate: (options) => {
const listProps = mergeProps(
- {
- ref: options.contentRef,
- style: ptCallbacks.sx('list', { options }),
- className: ptCallbacks.cx('list', { options }),
- role: 'listbox',
- 'aria-multiselectable': props.multiple,
- ...ariaProps
- },
- ptCallbacks.ptm('list')
+ [
+ {
+ ref: options.contentRef,
+ style: ptCallbacks.sx('list', { options }),
+ className: ptCallbacks.cx('list', { options }),
+ role: 'listbox',
+ 'aria-multiselectable': props.multiple,
+ ...ariaProps
+ },
+ ptCallbacks.ptm('list')
+ ],
+ { useTailwind: context.useTailwind }
);
return
;
@@ -438,13 +447,16 @@ export const ListBox = React.memo(
const items = createItems();
const listProps = mergeProps(
- {
- className: ptCallbacks.cx('list'),
- role: 'listbox',
- 'aria-multiselectable': props.multiple,
- ...ariaProps
- },
- ptCallbacks.ptm('list')
+ [
+ {
+ className: ptCallbacks.cx('list'),
+ role: 'listbox',
+ 'aria-multiselectable': props.multiple,
+ ...ariaProps
+ },
+ ptCallbacks.ptm('list')
+ ],
+ { useTailwind: context.useTailwind }
);
return
;
@@ -460,22 +472,28 @@ export const ListBox = React.memo(
const header = createHeader();
const wrapperProps = mergeProps(
- {
- className: ptCallbacks.cx('wrapper'),
- style: props.listStyle
- },
- ptCallbacks.ptm('wrapper')
+ [
+ {
+ className: ptCallbacks.cx('wrapper'),
+ style: props.listStyle
+ },
+ ptCallbacks.ptm('wrapper')
+ ],
+ { useTailwind: context.useTailwind }
);
const rootProps = mergeProps(
- {
- ref: elementRef,
- id: props.id,
- className: ptCallbacks.cx('root'),
- style: props.style
- },
- ListBoxBase.getOtherProps(props),
- ptCallbacks.ptm('root')
+ [
+ {
+ ref: elementRef,
+ id: props.id,
+ className: ptCallbacks.cx('root'),
+ style: props.style
+ },
+ ListBoxBase.getOtherProps(props),
+ ptCallbacks.ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/listbox/ListBoxHeader.js b/components/lib/listbox/ListBoxHeader.js
index e36b8e7b90..df785ba03a 100644
--- a/components/lib/listbox/ListBoxHeader.js
+++ b/components/lib/listbox/ListBoxHeader.js
@@ -1,12 +1,14 @@
import * as React from 'react';
import { SearchIcon } from '../icons/search';
import { InputText } from '../inputtext/InputText';
+import { PrimeReactContext } from '../api/Api';
import { IconUtils, ObjectUtils, mergeProps } from '../utils/Utils';
export const ListBoxHeader = React.memo((props) => {
const {
ptCallbacks: { ptm, cx }
} = props;
+ const context = React.useContext(PrimeReactContext);
const getPTOptions = (key, options) => {
return ptm(key, {
@@ -31,27 +33,36 @@ export const ListBoxHeader = React.memo((props) => {
const createHeader = () => {
const filterIconProps = mergeProps(
- {
- className: cx('filterIcon')
- },
- getPTOptions('filterIcon')
+ [
+ {
+ className: cx('filterIcon')
+ },
+ getPTOptions('filterIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.filterIcon ||
;
const filterIcon = IconUtils.getJSXIcon(icon, { ...filterIconProps }, { props });
const headerProps = mergeProps(
- {
- className: cx('header')
- },
- getPTOptions('header')
+ [
+ {
+ className: cx('header')
+ },
+ getPTOptions('header')
+ ],
+ { useTailwind: context.useTailwind }
);
const filterContainerProps = mergeProps(
- {
- className: cx('filterContainer')
- },
- getPTOptions('filterContainer')
+ [
+ {
+ className: cx('filterContainer')
+ },
+ getPTOptions('filterContainer')
+ ],
+ { useTailwind: context.useTailwind }
);
let content = (
diff --git a/components/lib/listbox/ListBoxItem.js b/components/lib/listbox/ListBoxItem.js
index da2f667340..9fe4087c46 100644
--- a/components/lib/listbox/ListBoxItem.js
+++ b/components/lib/listbox/ListBoxItem.js
@@ -1,11 +1,13 @@
import * as React from 'react';
import { Ripple } from '../ripple/Ripple';
+import { PrimeReactContext } from '../api/Api';
import { DomHandler, mergeProps, ObjectUtils } from '../utils/Utils';
export const ListBoxItem = React.memo((props) => {
const {
ptCallbacks: { ptm, cx }
} = props;
+ const context = React.useContext(PrimeReactContext);
const getPTOptions = (key) => {
return ptm(key, {
@@ -85,20 +87,23 @@ export const ListBoxItem = React.memo((props) => {
const content = props.template ? ObjectUtils.getJSXElement(props.template, props.option) : props.label;
const itemProps = mergeProps(
- {
- className: cx('item', { props }),
- style: props.style,
- onClick: onClick,
- onTouchEnd: onTouchEnd,
- onKeyDown: onKeyDown,
- tabIndex: '-1',
- 'aria-label': props.label,
- key: props.label,
- role: 'option',
- 'aria-selected': props.selected,
- 'aria-disabled': props.disabled
- },
- getPTOptions('item')
+ [
+ {
+ className: cx('item', { props }),
+ style: props.style,
+ onClick: onClick,
+ onTouchEnd: onTouchEnd,
+ onKeyDown: onKeyDown,
+ tabIndex: '-1',
+ 'aria-label': props.label,
+ key: props.label,
+ role: 'option',
+ 'aria-selected': props.selected,
+ 'aria-disabled': props.disabled
+ },
+ getPTOptions('item')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/megamenu/MegaMenu.js b/components/lib/megamenu/MegaMenu.js
index 000c1a867c..31368f0492 100644
--- a/components/lib/megamenu/MegaMenu.js
+++ b/components/lib/megamenu/MegaMenu.js
@@ -241,13 +241,16 @@ export const MegaMenu = React.memo(
const key = idState + '_separator__' + index;
const separatorProps = mergeProps(
- {
- id: key,
- key,
- className: cx('separator'),
- role: 'separator'
- },
- ptm('separator')
+ [
+ {
+ id: key,
+ key,
+ className: cx('separator'),
+ role: 'separator'
+ },
+ ptm('separator')
+ ],
+ { useTailwind: context.useTailwind }
);
return
;
@@ -256,10 +259,13 @@ export const MegaMenu = React.memo(
const createSubmenuIcon = (item) => {
if (item.items) {
const submenuIconProps = mergeProps(
- {
- className: cx('submenuIcon')
- },
- ptm('submenuIcon')
+ [
+ {
+ className: cx('submenuIcon')
+ },
+ ptm('submenuIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = vertical ? props.submenuIcon ||
: props.submenuIcon ||
;
@@ -282,42 +288,54 @@ export const MegaMenu = React.memo(
const key = item.id || idState + '_' + index;
const linkClassName = classNames('p-menuitem-link', { 'p-disabled': item.disabled });
const iconProps = mergeProps(
- {
- className: classNames(item.icon, cx('icon'))
- },
- ptm('icon')
+ [
+ {
+ className: classNames(item.icon, cx('icon'))
+ },
+ ptm('icon')
+ ],
+ { useTailwind: context.useTailwind }
);
const labelProps = mergeProps(
- {
- className: cx('label')
- },
- ptm('label')
+ [
+ {
+ className: cx('label')
+ },
+ ptm('label')
+ ],
+ { useTailwind: context.useTailwind }
);
const iconClassName = classNames(item.icon, 'p-menuitem-icon');
const icon = IconUtils.getJSXIcon(item.icon, { ...iconProps }, { props });
const label = item.label &&
{item.label} ;
const actionProps = mergeProps(
- {
- href: item.url || '#',
- className: cx('action', { item }),
- target: item.target,
- onClick: (event) => onLeafClick(event, item),
- role: 'menuitem',
- 'aria-disabled': item.disabled
- },
- getPTOptions(item, 'action', index)
+ [
+ {
+ href: item.url || '#',
+ className: cx('action', { item }),
+ target: item.target,
+ onClick: (event) => onLeafClick(event, item),
+ role: 'menuitem',
+ 'aria-disabled': item.disabled
+ },
+ getPTOptions(item, 'action', index)
+ ],
+ { useTailwind: context.useTailwind }
);
const submenuItemProps = mergeProps(
- {
- key,
- id: key,
- className: classNames(item.className, cx('submenuItem')),
- style: item.style,
- role: 'none'
- },
- getPTOptions(item, 'submenuItem', index)
+ [
+ {
+ key,
+ id: key,
+ className: classNames(item.className, cx('submenuItem')),
+ style: item.style,
+ role: 'none'
+ },
+ getPTOptions(item, 'submenuItem', index)
+ ],
+ { useTailwind: context.useTailwind }
);
let content = (
@@ -354,15 +372,18 @@ export const MegaMenu = React.memo(
const key = submenu.id || idState + '_sub_' + index;
const submenuHeaderProps = mergeProps(
- {
- id: key,
- key,
- className: classNames(submenu.className, cx('submenuHeader', { submenu })),
- style: submenu.style,
- role: 'presentation',
- 'data-p-disabled': submenu.disabled
- },
- ptm('submenuHeader')
+ [
+ {
+ id: key,
+ key,
+ className: classNames(submenu.className, cx('submenuHeader', { submenu })),
+ style: submenu.style,
+ role: 'presentation',
+ 'data-p-disabled': submenu.disabled
+ },
+ ptm('submenuHeader')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -382,20 +403,26 @@ export const MegaMenu = React.memo(
const submenus = createSubmenus(column);
const columnProps = mergeProps(
- {
- key: key,
- className: cx('column', { category })
- },
- ptm('column')
+ [
+ {
+ key: key,
+ className: cx('column', { category })
+ },
+ ptm('column')
+ ],
+ { useTailwind: context.useTailwind }
);
const submenuProps = mergeProps(
- {
- className: cx('submenu'),
- style: { display: activeItemState === category ? 'block' : 'none' },
- role: 'menu'
- },
- ptm('submenu')
+ [
+ {
+ className: cx('submenu'),
+ style: { display: activeItemState === category ? 'block' : 'none' },
+ role: 'menu'
+ },
+ ptm('submenu')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -420,17 +447,23 @@ export const MegaMenu = React.memo(
const columns = createColumns(category);
const panelProps = mergeProps(
- {
- className: cx('panel')
- },
- ptm('panel')
+ [
+ {
+ className: cx('panel')
+ },
+ ptm('panel')
+ ],
+ { useTailwind: context.useTailwind }
);
const gridProps = mergeProps(
- {
- className: cx('grid')
- },
- ptm('grid')
+ [
+ {
+ className: cx('grid')
+ },
+ ptm('grid')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -554,18 +587,24 @@ export const MegaMenu = React.memo(
const createCategory = (category, index) => {
const iconProps = mergeProps(
- {
- className: cx('icon')
- },
- getPTOptions(category, 'icon', index)
+ [
+ {
+ className: cx('icon')
+ },
+ getPTOptions(category, 'icon', index)
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = IconUtils.getJSXIcon(category.icon, { ...iconProps }, { props });
const labelProps = mergeProps(
- {
- className: cx('label')
- },
- getPTOptions(category, 'label', index)
+ [
+ {
+ className: cx('label')
+ },
+ getPTOptions(category, 'label', index)
+ ],
+ { useTailwind: context.useTailwind }
);
const label = category.label &&
{category.label} ;
const itemContent = category.template ? ObjectUtils.getJSXElement(category.template, category) : null;
@@ -573,31 +612,37 @@ export const MegaMenu = React.memo(
const panel = createCategoryPanel(category);
const headerActionProps = mergeProps(
- {
- href: category.url || '#',
- className: cx('headerAction', { category }),
- target: category.target,
- onClick: (e) => onCategoryClick(e, category),
- onKeyDown: (e) => onCategoryKeyDown(e, category),
- role: 'menuitem',
- 'aria-haspopup': category.items != null,
- 'data-p-disabled': category.disabled
- },
- getPTOptions(category, 'headerAction', index)
+ [
+ {
+ href: category.url || '#',
+ className: cx('headerAction', { category }),
+ target: category.target,
+ onClick: (e) => onCategoryClick(e, category),
+ onKeyDown: (e) => onCategoryKeyDown(e, category),
+ role: 'menuitem',
+ 'aria-haspopup': category.items != null,
+ 'data-p-disabled': category.disabled
+ },
+ getPTOptions(category, 'headerAction', index)
+ ],
+ { useTailwind: context.useTailwind }
);
const key = category.id || idState + '_cat_' + index;
const menuItemProps = mergeProps(
- {
- key,
- id: key,
- className: classNames(category.className, cx('menuitem', { category, activeItemState })),
- style: category.style,
- onMouseEnter: (e) => onCategoryMouseEnter(e, category),
- role: 'none',
- 'data-p-disabled': category.disabled || false
- },
- getPTOptions(category, 'menuitem', index)
+ [
+ {
+ key,
+ id: key,
+ className: classNames(category.className, cx('menuitem', { category, activeItemState })),
+ style: category.style,
+ onMouseEnter: (e) => onCategoryMouseEnter(e, category),
+ role: 'none',
+ 'data-p-disabled': category.disabled || false
+ },
+ getPTOptions(category, 'menuitem', index)
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -616,11 +661,14 @@ export const MegaMenu = React.memo(
const createMenu = () => {
const menuProps = mergeProps(
- {
- className: cx('menu'),
- role: 'menubar'
- },
- ptm('menu')
+ [
+ {
+ className: cx('menu'),
+ role: 'menubar'
+ },
+ ptm('menu')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.model) {
@@ -638,10 +686,13 @@ export const MegaMenu = React.memo(
const createStartContent = () => {
const startProps = mergeProps(
- {
- className: cx('start')
- },
- ptm('start')
+ [
+ {
+ className: cx('start')
+ },
+ ptm('start')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.start) {
@@ -655,10 +706,13 @@ export const MegaMenu = React.memo(
const createEndContent = () => {
const endProps = mergeProps(
- {
- className: cx('end')
- },
- ptm('end')
+ [
+ {
+ className: cx('end')
+ },
+ ptm('end')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.end) {
@@ -676,17 +730,20 @@ export const MegaMenu = React.memo(
}
const menuButtonProps = mergeProps(
- {
- className: cx('menuButton'),
- href: '#',
- role: 'button',
- tabIndex: 0,
- onClick: (e) => toggle(e)
- },
- ptm('menuButton')
+ [
+ {
+ className: cx('menuButton'),
+ href: '#',
+ role: 'button',
+ tabIndex: 0,
+ onClick: (e) => toggle(e)
+ },
+ ptm('menuButton')
+ ],
+ { useTailwind: context.useTailwind }
);
- const menuButtonIconProps = mergeProps(ptm('menuButtonIcon'));
+ const menuButtonIconProps = mergeProps([ptm('menuButtonIcon')], { useTailwind: context.useTailwind });
const icon = props.menuIcon ||
;
const menuIcon = IconUtils.getJSXIcon(icon, { ...menuButtonIconProps }, { props });
@@ -702,12 +759,15 @@ export const MegaMenu = React.memo(
};
const rootProps = mergeProps(
- {
- className: classNames(props.className, cx('root', { mobileActiveState })),
- style: props.style
- },
- MegaMenuBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ className: classNames(props.className, cx('root', { mobileActiveState })),
+ style: props.style
+ },
+ MegaMenuBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
const menu = createMenu();
diff --git a/components/lib/mention/Mention.js b/components/lib/mention/Mention.js
index 3fb21179ee..f9cd52bf63 100644
--- a/components/lib/mention/Mention.js
+++ b/components/lib/mention/Mention.js
@@ -375,12 +375,15 @@ export const Mention = React.memo(
const content = props.itemTemplate ? ObjectUtils.getJSXElement(props.itemTemplate, suggestion, { trigger: triggerState ? triggerState.key : '', index }) : formatValue(suggestion);
const itemProps = mergeProps(
- {
- key: key,
- className: cx('item'),
- onClick: (e) => onItemClick(e, suggestion)
- },
- getPTOptions(suggestion, 'item')
+ [
+ {
+ key: key,
+ className: cx('item'),
+ onClick: (e) => onItemClick(e, suggestion)
+ },
+ getPTOptions(suggestion, 'item')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -393,11 +396,14 @@ export const Mention = React.memo(
const createList = () => {
const itemsProps = mergeProps(
- {
- ref: listRef,
- className: cx('items')
- },
- ptm('items')
+ [
+ {
+ ref: listRef,
+ className: cx('items')
+ },
+ ptm('items')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.suggestions) {
@@ -415,32 +421,38 @@ export const Mention = React.memo(
const list = createList();
const panelProps = mergeProps(
- {
- ref: overlayRef,
- className: cx('panel'),
- style: {
- maxHeight: props.scrollHeight,
- ...props.panelStyle
+ [
+ {
+ ref: overlayRef,
+ className: cx('panel'),
+ style: {
+ maxHeight: props.scrollHeight,
+ ...props.panelStyle
+ },
+ onClick: onPanelClick
},
- onClick: onPanelClick
- },
- ptm('panel')
+ ptm('panel')
+ ],
+ { useTailwind: context.useTailwind }
);
const transitionProps = mergeProps(
- {
- classNames: cx('transition'),
- in: overlayVisibleState,
- timeout: { enter: 120, exit: 100 },
- options: props.transitionOptions,
- unmountOnExit: true,
- onEnter: onOverlayEnter,
- onEntering: onOverlayEntering,
- onEntered: onOverlayEntered,
- onExit: onOverlayExit,
- onExited: onOverlayExited
- },
- ptm('transition')
+ [
+ {
+ classNames: cx('transition'),
+ in: overlayVisibleState,
+ timeout: { enter: 120, exit: 100 },
+ options: props.transitionOptions,
+ unmountOnExit: true,
+ onEnter: onOverlayEnter,
+ onEntering: onOverlayEntering,
+ onEntered: onOverlayEntered,
+ onExit: onOverlayExit,
+ onExited: onOverlayExited
+ },
+ ptm('transition')
+ ],
+ { useTailwind: context.useTailwind }
);
const panel = (
@@ -460,34 +472,40 @@ export const Mention = React.memo(
const panel = createPanel();
const inputMentionProps = mergeProps(
- {
- ref: inputRef,
- id: props.inputId,
- className: cx('input'),
- style: props.inputStyle,
- ...inputProps,
- onFocus: onFocus,
- onBlur: onBlur,
- onKeyDown: onKeyDown,
- onInput: onInput,
- onKeyUp: onKeyUp,
- onChange: onChange,
- __parentMetadata: {
- parent: metaData
- }
- },
- ptm('input')
+ [
+ {
+ ref: inputRef,
+ id: props.inputId,
+ className: cx('input'),
+ style: props.inputStyle,
+ ...inputProps,
+ onFocus: onFocus,
+ onBlur: onBlur,
+ onKeyDown: onKeyDown,
+ onInput: onInput,
+ onKeyUp: onKeyUp,
+ onChange: onChange,
+ __parentMetadata: {
+ parent: metaData
+ }
+ },
+ ptm('input')
+ ],
+ { useTailwind: context.useTailwind }
);
const rootProps = mergeProps(
- {
- ref: elementRef,
- id: props.id,
- className: cx('root', { focusedState, isFilled }),
- style: props.style
- },
- MentionBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ ref: elementRef,
+ id: props.id,
+ className: cx('root', { focusedState, isFilled }),
+ style: props.style
+ },
+ MentionBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/menu/Menu.js b/components/lib/menu/Menu.js
index 8a81d6d5e4..5709832e4d 100644
--- a/components/lib/menu/Menu.js
+++ b/components/lib/menu/Menu.js
@@ -169,15 +169,18 @@ export const Menu = React.memo(
const key = idState + '_sub_' + index;
const items = submenu.items.map(createMenuItem);
const submenuHeaderProps = mergeProps(
- {
- id: key,
- key,
- role: 'presentation',
- className: classNames(submenu.className, cx('submenuHeader', { submenu })),
- style: sx('submenuHeader', { submenu }),
- 'data-p-disabled': submenu.disabled
- },
- ptm('submenuHeader')
+ [
+ {
+ id: key,
+ key,
+ role: 'presentation',
+ className: classNames(submenu.className, cx('submenuHeader', { submenu })),
+ style: sx('submenuHeader', { submenu }),
+ 'data-p-disabled': submenu.disabled
+ },
+ ptm('submenuHeader')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -191,13 +194,16 @@ export const Menu = React.memo(
const createSeparator = (index) => {
const key = idState + '_separator_' + index;
const separatorProps = mergeProps(
- {
- id: key,
- key,
- className: cx('separator'),
- role: 'separator'
- },
- ptm('separator')
+ [
+ {
+ id: key,
+ key,
+ className: cx('separator'),
+ role: 'separator'
+ },
+ ptm('separator')
+ ],
+ { useTailwind: context.useTailwind }
);
return
;
@@ -211,34 +217,43 @@ export const Menu = React.memo(
const linkClassName = classNames('p-menuitem-link', { 'p-disabled': item.disabled });
const iconClassName = classNames('p-menuitem-icon', item.icon);
const iconProps = mergeProps(
- {
- className: cx('icon')
- },
- ptm('icon')
+ [
+ {
+ className: cx('icon')
+ },
+ ptm('icon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = IconUtils.getJSXIcon(item.icon, { ...iconProps }, { props });
const labelProps = mergeProps(
- {
- className: cx('label')
- },
- ptm('label')
+ [
+ {
+ className: cx('label')
+ },
+ ptm('label')
+ ],
+ { useTailwind: context.useTailwind }
);
const label = item.label &&
{item.label} ;
const tabIndex = item.disabled ? null : 0;
const key = item.id || idState + '_' + index;
const actionProps = mergeProps(
- {
- href: item.url || '#',
- className: cx('action', { item }),
- role: 'menuitem',
- target: item.target,
- onClick: (event) => onItemClick(event, item),
- onKeyDown: (event) => onItemKeyDown(event, item),
- tabIndex: tabIndex,
- 'aria-disabled': item.disabled,
- 'data-p-disabled': item.disabled
- },
- ptm('action')
+ [
+ {
+ href: item.url || '#',
+ className: cx('action', { item }),
+ role: 'menuitem',
+ target: item.target,
+ onClick: (event) => onItemClick(event, item),
+ onKeyDown: (event) => onItemKeyDown(event, item),
+ tabIndex: tabIndex,
+ 'aria-disabled': item.disabled,
+ 'data-p-disabled': item.disabled
+ },
+ ptm('action')
+ ],
+ { useTailwind: context.useTailwind }
);
let content = (
@@ -264,15 +279,18 @@ export const Menu = React.memo(
}
const menuitemProps = mergeProps(
- {
- id: key,
- key,
- className: classNames(item.className, cx('menuitem')),
- style: sx('menuitem', { item }),
- role: 'none',
- 'data-p-disabled': item.disabled || false
- },
- ptm('menuitem')
+ [
+ {
+ id: key,
+ key,
+ className: classNames(item.className, cx('menuitem')),
+ style: sx('menuitem', { item }),
+ role: 'none',
+ 'data-p-disabled': item.disabled || false
+ },
+ ptm('menuitem')
+ ],
+ { useTailwind: context.useTailwind }
);
return
{content} ;
@@ -290,36 +308,45 @@ export const Menu = React.memo(
if (props.model) {
const menuitems = createMenu();
const rootProps = mergeProps(
- {
- className: classNames(props.className, cx('root', { context })),
- style: props.style,
- onClick: (e) => onPanelClick(e)
- },
- MenuBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ className: classNames(props.className, cx('root', { context })),
+ style: props.style,
+ onClick: (e) => onPanelClick(e)
+ },
+ MenuBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
const menuProps = mergeProps(
- {
- className: cx('menu'),
- role: 'menu'
- },
- ptm('menu')
+ [
+ {
+ className: cx('menu'),
+ role: 'menu'
+ },
+ ptm('menu')
+ ],
+ { useTailwind: context.useTailwind }
);
const transitionProps = mergeProps(
- {
- classNames: cx('transition'),
- in: visibleState,
- timeout: { enter: 120, exit: 100 },
- options: props.transitionOptions,
- unmountOnExit: true,
- onEnter,
- onEntered,
- onExit,
- onExited
- },
- ptm('transition')
+ [
+ {
+ classNames: cx('transition'),
+ in: visibleState,
+ timeout: { enter: 120, exit: 100 },
+ options: props.transitionOptions,
+ unmountOnExit: true,
+ onEnter,
+ onEntered,
+ onExit,
+ onExited
+ },
+ ptm('transition')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/menubar/Menubar.js b/components/lib/menubar/Menubar.js
index 454a104600..4707c36abf 100644
--- a/components/lib/menubar/Menubar.js
+++ b/components/lib/menubar/Menubar.js
@@ -82,10 +82,13 @@ export const Menubar = React.memo(
if (props.start) {
const start = ObjectUtils.getJSXElement(props.start, props);
const startProps = mergeProps(
- {
- className: cx('start')
- },
- ptm('start')
+ [
+ {
+ className: cx('start')
+ },
+ ptm('start')
+ ],
+ { useTailwind: context.useTailwind }
);
return
{start}
;
@@ -98,10 +101,13 @@ export const Menubar = React.memo(
if (props.end) {
const end = ObjectUtils.getJSXElement(props.end, props);
const endProps = mergeProps(
- {
- className: cx('end')
- },
- ptm('end')
+ [
+ {
+ className: cx('end')
+ },
+ ptm('end')
+ ],
+ { useTailwind: context.useTailwind }
);
return
{end}
;
@@ -116,17 +122,20 @@ export const Menubar = React.memo(
}
const buttonProps = mergeProps(
- {
- ref: menuButtonRef,
- href: '#',
- role: 'button',
- tabIndex: 0,
- className: cx('button'),
- onClick: (e) => toggle(e)
- },
- ptm('button')
+ [
+ {
+ ref: menuButtonRef,
+ href: '#',
+ role: 'button',
+ tabIndex: 0,
+ className: cx('button'),
+ onClick: (e) => toggle(e)
+ },
+ ptm('button')
+ ],
+ { useTailwind: context.useTailwind }
);
- const popupIconProps = mergeProps(ptm('popupIcon'));
+ const popupIconProps = mergeProps([ptm('popupIcon')], { useTailwind: context.useTailwind });
const icon = props.menuIcon ||
;
const menuIcon = IconUtils.getJSXIcon(icon, { ...popupIconProps }, { props });
@@ -142,13 +151,16 @@ export const Menubar = React.memo(
const menuButton = createMenuButton();
const submenu =
;
const rootProps = mergeProps(
- {
- id: props.id,
- className: classNames(props.className, cx('root', { mobileActiveState })),
- style: props.style
- },
- MenubarBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ id: props.id,
+ className: classNames(props.className, cx('root', { mobileActiveState })),
+ style: props.style
+ },
+ MenubarBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/menubar/MenubarSub.js b/components/lib/menubar/MenubarSub.js
index 981b9456b8..6e90c799e4 100644
--- a/components/lib/menubar/MenubarSub.js
+++ b/components/lib/menubar/MenubarSub.js
@@ -3,10 +3,12 @@ import { useEventListener, useMountEffect, useUpdateEffect } from '../hooks/Hook
import { AngleDownIcon } from '../icons/angledown';
import { AngleRightIcon } from '../icons/angleright';
import { Ripple } from '../ripple/Ripple';
+import { PrimeReactContext } from '../api/Api';
import { DomHandler, IconUtils, ObjectUtils, classNames, mergeProps } from '../utils/Utils';
export const MenubarSub = React.memo(
React.forwardRef((props, ref) => {
+ const context = React.useContext(PrimeReactContext);
const [activeItemState, setActiveItemState] = React.useState(null);
const { ptm, cx } = props;
@@ -178,13 +180,16 @@ export const MenubarSub = React.memo(
const createSeparator = (index) => {
const key = props.id + '_separator_' + index;
const separatorProps = mergeProps(
- {
- id: key,
- key,
- className: cx('separator'),
- role: 'separator'
- },
- ptm('separator', { hostName: props.hostName })
+ [
+ {
+ id: key,
+ key,
+ className: cx('separator'),
+ role: 'separator'
+ },
+ ptm('separator', { hostName: props.hostName })
+ ],
+ { useTailwind: context.useTailwind }
);
return
;
@@ -221,25 +226,34 @@ export const MenubarSub = React.memo(
const linkClassName = classNames('p-menuitem-link', { 'p-disabled': item.disabled });
const iconClassName = classNames('p-menuitem-icon', item.icon);
const iconProps = mergeProps(
- {
- className: cx('icon')
- },
- getPTOptions(item, 'icon')
+ [
+ {
+ className: cx('icon')
+ },
+ getPTOptions(item, 'icon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = IconUtils.getJSXIcon(item.icon, { ...iconProps }, { props: props.menuProps });
const labelProps = mergeProps(
- {
- className: cx('label')
- },
- getPTOptions(item, 'label')
+ [
+ {
+ className: cx('label')
+ },
+ getPTOptions(item, 'label')
+ ],
+ { useTailwind: context.useTailwind }
);
const label = item.label &&
{item.label} ;
const submenuIconClassName = 'p-submenu-icon';
const submenuIconProps = mergeProps(
- {
- className: cx('submenuIcon')
- },
- getPTOptions(item, 'submenuIcon')
+ [
+ {
+ className: cx('submenuIcon')
+ },
+ getPTOptions(item, 'submenuIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const submenuIcon =
item.items &&
@@ -250,16 +264,19 @@ export const MenubarSub = React.memo(
);
const submenu = createSubmenu(item, index);
const actionProps = mergeProps(
- {
- href: item.url || '#',
- role: 'menuitem',
- className: cx('action', { item }),
- target: item.target,
- 'aria-haspopup': item.items != null,
- onClick: (event) => onItemClick(event, item),
- onKeyDown: (event) => onItemKeyDown(event, item)
- },
- getPTOptions(item, 'action')
+ [
+ {
+ href: item.url || '#',
+ role: 'menuitem',
+ className: cx('action', { item }),
+ target: item.target,
+ 'aria-haspopup': item.items != null,
+ onClick: (event) => onItemClick(event, item),
+ onKeyDown: (event) => onItemKeyDown(event, item)
+ },
+ getPTOptions(item, 'action')
+ ],
+ { useTailwind: context.useTailwind }
);
let content = (
@@ -287,15 +304,18 @@ export const MenubarSub = React.memo(
}
const menuitemProps = mergeProps(
- {
- id: key,
- key,
- role: 'none',
- className: classNames(item.className, cx('menuitem', { item, activeItemState })),
- onMouseEnter: (event) => onItemMouseEnter(event, item),
- 'data-p-disabled': item.disabled || false
- },
- getPTOptions(item, 'menuitem')
+ [
+ {
+ id: key,
+ key,
+ role: 'none',
+ className: classNames(item.className, cx('menuitem', { item, activeItemState })),
+ onMouseEnter: (event) => onItemMouseEnter(event, item),
+ 'data-p-disabled': item.disabled || false
+ },
+ getPTOptions(item, 'menuitem')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -318,13 +338,16 @@ export const MenubarSub = React.memo(
const ptKey = props.root ? 'menu' : 'submenu';
const submenu = createMenu();
const menuProps = mergeProps(
- {
- ref,
- className: cx(ptKey),
- style: !props.root && { display: props.parentActive ? 'block' : 'none' },
- role
- },
- ptm(ptKey)
+ [
+ {
+ ref,
+ className: cx(ptKey),
+ style: !props.root && { display: props.parentActive ? 'block' : 'none' },
+ role
+ },
+ ptm(ptKey)
+ ],
+ { useTailwind: context.useTailwind }
);
return
;
diff --git a/components/lib/message/Message.js b/components/lib/message/Message.js
index 6830974abd..aa74ccb561 100644
--- a/components/lib/message/Message.js
+++ b/components/lib/message/Message.js
@@ -29,10 +29,13 @@ export const Message = React.memo(
const text = ObjectUtils.getJSXElement(props.text, props);
const iconProps = mergeProps(
- {
- className: cx('icon')
- },
- ptm('icon')
+ [
+ {
+ className: cx('icon')
+ },
+ ptm('icon')
+ ],
+ { useTailwind: context.useTailwind }
);
let icon = props.icon;
@@ -59,10 +62,13 @@ export const Message = React.memo(
const messageIcon = IconUtils.getJSXIcon(icon, { ...iconProps }, { props });
const textProps = mergeProps(
- {
- className: cx('text')
- },
- ptm('text')
+ [
+ {
+ className: cx('text')
+ },
+ ptm('text')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -81,14 +87,17 @@ export const Message = React.memo(
const content = createContent();
const rootProps = mergeProps(
- {
- className: classNames(props.className, cx('root')),
- style: props.style,
- role: 'alert',
- 'aria-live': 'polite'
- },
- MessageBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ className: classNames(props.className, cx('root')),
+ style: props.style,
+ role: 'alert',
+ 'aria-live': 'polite'
+ },
+ MessageBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/messages/Messages.js b/components/lib/messages/Messages.js
index 41e4874357..0408810788 100644
--- a/components/lib/messages/Messages.js
+++ b/components/lib/messages/Messages.js
@@ -92,23 +92,29 @@ export const Messages = React.memo(
}));
const rootProps = mergeProps(
- {
- id: props.id,
- className: props.className,
- style: props.style
- },
- MessagesBase.getOtherProps(props),
- ptCallbacks.ptm('root')
+ [
+ {
+ id: props.id,
+ className: props.className,
+ style: props.style
+ },
+ MessagesBase.getOtherProps(props),
+ ptCallbacks.ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
const transitionProps = mergeProps(
- {
- classNames: ptCallbacks.cx('transition'),
- unmountOnExit: true,
- timeout: { enter: 300, exit: 300 },
- options: props.transitionOptions
- },
- ptCallbacks.ptm('transition')
+ [
+ {
+ classNames: ptCallbacks.cx('transition'),
+ unmountOnExit: true,
+ timeout: { enter: 300, exit: 300 },
+ options: props.transitionOptions
+ },
+ ptCallbacks.ptm('transition')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/messages/UIMessage.js b/components/lib/messages/UIMessage.js
index 9c58d3b004..4ac86996ba 100644
--- a/components/lib/messages/UIMessage.js
+++ b/components/lib/messages/UIMessage.js
@@ -7,10 +7,12 @@ import { InfoCircleIcon } from '../icons/infocircle';
import { TimesIcon } from '../icons/times';
import { TimesCircleIcon } from '../icons/timescircle';
import { Ripple } from '../ripple/Ripple';
+import { PrimeReactContext } from '../api/Api';
import { classNames, IconUtils, mergeProps } from '../utils/Utils';
export const UIMessage = React.memo(
React.forwardRef((props, ref) => {
+ const context = React.useContext(PrimeReactContext);
const {
message: messageInfo,
metaData: parentMetaData,
@@ -54,26 +56,32 @@ export const UIMessage = React.memo(
const ariaLabel = localeOption('close');
const buttonIconProps = mergeProps(
- {
- className: cx('uimessage.buttonicon'),
- 'aria-hidden': true
- },
- getPTOptions('buttonicon', parentParams),
- ptmo(pt, 'buttonicon', { ...params, hostName: props.hostName })
+ [
+ {
+ className: cx('uimessage.buttonicon'),
+ 'aria-hidden': true
+ },
+ getPTOptions('buttonicon', parentParams),
+ ptmo(pt, 'buttonicon', { ...params, hostName: props.hostName })
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = _closeIcon ||
;
const closeIcon = IconUtils.getJSXIcon(icon, { ...buttonIconProps }, { props });
const buttonProps = mergeProps(
- {
- type: 'button',
- className: cx('uimessage.button'),
- 'aria-label': ariaLabel,
- onClick: onClose
- },
- getPTOptions('button', parentParams),
- ptmo(pt, 'button', { ...params, hostName: props.hostName })
+ [
+ {
+ type: 'button',
+ className: cx('uimessage.button'),
+ 'aria-label': ariaLabel,
+ onClick: onClose
+ },
+ getPTOptions('button', parentParams),
+ ptmo(pt, 'button', { ...params, hostName: props.hostName })
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -90,11 +98,14 @@ export const UIMessage = React.memo(
const createMessage = () => {
if (props.message) {
const iconProps = mergeProps(
- {
- className: cx('uimessage.icon')
- },
- getPTOptions('icon', parentParams),
- ptmo(pt, 'icon', { ...params, hostName: props.hostName })
+ [
+ {
+ className: cx('uimessage.icon')
+ },
+ getPTOptions('icon', parentParams),
+ ptmo(pt, 'icon', { ...params, hostName: props.hostName })
+ ],
+ { useTailwind: context.useTailwind }
);
let icon = _icon;
@@ -121,19 +132,25 @@ export const UIMessage = React.memo(
const iconContent = IconUtils.getJSXIcon(icon, { ...iconProps }, { props });
const summaryProps = mergeProps(
- {
- className: cx('uimessage.summary')
- },
- getPTOptions('summary', parentParams),
- ptmo(pt, 'summary', { ...params, hostName: props.hostName })
+ [
+ {
+ className: cx('uimessage.summary')
+ },
+ getPTOptions('summary', parentParams),
+ ptmo(pt, 'summary', { ...params, hostName: props.hostName })
+ ],
+ { useTailwind: context.useTailwind }
);
const detailProps = mergeProps(
- {
- className: cx('uimessage.detail')
- },
- getPTOptions('detail', parentParams),
- ptmo(pt, 'detail', { ...params, hostName: props.hostName })
+ [
+ {
+ className: cx('uimessage.detail')
+ },
+ getPTOptions('detail', parentParams),
+ ptmo(pt, 'detail', { ...params, hostName: props.hostName })
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -154,23 +171,29 @@ export const UIMessage = React.memo(
const message = createMessage();
const wrapperProps = mergeProps(
- {
- className: classNames(_contentClassName, cx('uimessage.wrapper')),
- style: contentStyle
- },
- getPTOptions('wrapper', parentParams),
- ptmo(pt, 'wrapper', { ...params, hostName: props.hostName })
+ [
+ {
+ className: classNames(_contentClassName, cx('uimessage.wrapper')),
+ style: contentStyle
+ },
+ getPTOptions('wrapper', parentParams),
+ ptmo(pt, 'wrapper', { ...params, hostName: props.hostName })
+ ],
+ { useTailwind: context.useTailwind }
);
const rootProps = mergeProps(
- {
- ref,
- className: classNames(_className, cx('uimessage.root', { severity })),
- style,
- onClick
- },
- getPTOptions('root', parentParams),
- ptmo(pt, 'root', { ...params, hostName: props.hostName })
+ [
+ {
+ ref,
+ className: classNames(_className, cx('uimessage.root', { severity })),
+ style,
+ onClick
+ },
+ getPTOptions('root', parentParams),
+ ptmo(pt, 'root', { ...params, hostName: props.hostName })
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/multiselect/MultiSelect.js b/components/lib/multiselect/MultiSelect.js
index ee8135e809..7fc488270f 100644
--- a/components/lib/multiselect/MultiSelect.js
+++ b/components/lib/multiselect/MultiSelect.js
@@ -534,28 +534,37 @@ export const MultiSelect = React.memo(
return value.map((val, i) => {
const label = getLabelByValue(val);
const iconProps = mergeProps(
- {
- key: i,
- className: cx('removeTokenIcon'),
- onClick: (e) => removeChip(e, val)
- },
- ptm('removeTokenIcon')
+ [
+ {
+ key: i,
+ className: cx('removeTokenIcon'),
+ onClick: (e) => removeChip(e, val)
+ },
+ ptm('removeTokenIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = !props.disabled && (props.removeIcon ? IconUtils.getJSXIcon(props.removeIcon, { ...iconProps }, { props }) :
);
const tokenProps = mergeProps(
- {
- className: cx('token')
- },
- ptm('token')
+ [
+ {
+ className: cx('token')
+ },
+ ptm('token')
+ ],
+ { useTailwind: context.useTailwind }
);
const tokenLabelProps = mergeProps(
- {
- key: label + i,
- className: cx('tokenLabel')
- },
- ptm('tokenLabel')
+ [
+ {
+ key: label + i,
+ className: cx('tokenLabel')
+ },
+ ptm('tokenLabel')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -628,11 +637,14 @@ export const MultiSelect = React.memo(
const createClearIcon = () => {
const clearIconProps = mergeProps(
- {
- className: cx('clearIcon'),
- onClick: (e) => updateModel(e, [], [])
- },
- ptm('clearIcon')
+ [
+ {
+ className: cx('clearIcon'),
+ onClick: (e) => updateModel(e, [], [])
+ },
+ ptm('clearIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.clearIcon ||
;
@@ -649,18 +661,24 @@ export const MultiSelect = React.memo(
const content = getLabelContent();
const labelContainerProps = mergeProps(
- {
- ref: labelRef,
- className: cx('labelContainer')
- },
- ptm('labelContainer')
+ [
+ {
+ ref: labelRef,
+ className: cx('labelContainer')
+ },
+ ptm('labelContainer')
+ ],
+ { useTailwind: context.useTailwind }
);
const labelProps = mergeProps(
- {
- className: cx('label', { empty })
- },
- ptm('label')
+ [
+ {
+ className: cx('label', { empty })
+ },
+ ptm('label')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -677,17 +695,23 @@ export const MultiSelect = React.memo(
const ariaProps = ObjectUtils.reduceKeys(otherProps, DomHandler.ARIA_PROPS);
const triggerIconProps = mergeProps(
- {
- className: cx('triggerIcon')
- },
- ptm('triggerIcon')
+ [
+ {
+ className: cx('triggerIcon')
+ },
+ ptm('triggerIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const triggerProps = mergeProps(
- {
- className: cx('trigger')
- },
- ptm('trigger')
+ [
+ {
+ className: cx('trigger')
+ },
+ ptm('trigger')
+ ],
+ { useTailwind: context.useTailwind }
);
const dropdownIcon =
{props.dropdownIcon ? IconUtils.getJSXIcon(props.dropdownIcon, { ...triggerIconProps }, { props }) : }
;
@@ -695,41 +719,50 @@ export const MultiSelect = React.memo(
const clearIcon = !props.inline && createClearIcon();
const rootProps = mergeProps(
- {
- ref: elementRef,
- id: props.id,
- style: { ...props.style, ...sx('root') },
- className: classNames(props.className, cx('root', { focusedState, overlayVisibleState })),
- ...otherProps,
- onClick: onClick
- },
- MultiSelectBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ ref: elementRef,
+ id: props.id,
+ style: { ...props.style, ...sx('root') },
+ className: classNames(props.className, cx('root', { focusedState, overlayVisibleState })),
+ ...otherProps,
+ onClick: onClick
+ },
+ MultiSelectBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
const hiddenInputWrapperProps = mergeProps(
- {
- className: 'p-hidden-accessible'
- },
- ptm('hiddenInputWrapper')
+ [
+ {
+ className: 'p-hidden-accessible'
+ },
+ ptm('hiddenInputWrapper')
+ ],
+ { useTailwind: context.useTailwind }
);
const inputProps = mergeProps(
- {
- ref: inputRef,
- id: props.inputId,
- name: props.name,
- type: 'text',
- onFocus: onFocus,
- onBlur: onBlur,
- onKeyDown: onKeyDown,
- role: 'listbox',
- 'aria-expanded': overlayVisibleState,
- disabled: props.disabled,
- tabIndex: props.tabIndex,
- ...ariaProps
- },
- ptm('input')
+ [
+ {
+ ref: inputRef,
+ id: props.inputId,
+ name: props.name,
+ type: 'text',
+ onFocus: onFocus,
+ onBlur: onBlur,
+ onKeyDown: onKeyDown,
+ role: 'listbox',
+ 'aria-expanded': overlayVisibleState,
+ disabled: props.disabled,
+ tabIndex: props.tabIndex,
+ ...ariaProps
+ },
+ ptm('input')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/multiselect/MultiSelectHeader.js b/components/lib/multiselect/MultiSelectHeader.js
index 3921b27679..cbd8b533ba 100644
--- a/components/lib/multiselect/MultiSelectHeader.js
+++ b/components/lib/multiselect/MultiSelectHeader.js
@@ -6,10 +6,12 @@ import { SearchIcon } from '../icons/search';
import { TimesIcon } from '../icons/times';
import { InputText } from '../inputtext/InputText';
import { Ripple } from '../ripple/Ripple';
+import { PrimeReactContext } from '../api/Api';
import { IconUtils, ObjectUtils, UniqueComponentId, mergeProps } from '../utils/Utils';
export const MultiSelectHeader = React.memo((props) => {
const { ptm, cx, isUnstyled } = props;
+ const context = React.useContext(PrimeReactContext);
const filterOptions = {
filter: (e) => onFilter(e),
reset: () => props.resetFilter()
@@ -45,10 +47,13 @@ export const MultiSelectHeader = React.memo((props) => {
const createFilterElement = () => {
const filterIconProps = mergeProps(
- {
- className: cx('filterIcon')
- },
- getPTOptions('filterIcon')
+ [
+ {
+ className: cx('filterIcon')
+ },
+ getPTOptions('filterIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.filterIcon ||
;
@@ -56,10 +61,13 @@ export const MultiSelectHeader = React.memo((props) => {
if (props.filter) {
const filterContainerProps = mergeProps(
- {
- className: cx('filterContainer')
- },
- getPTOptions('filterContainer')
+ [
+ {
+ className: cx('filterContainer')
+ },
+ getPTOptions('filterContainer')
+ ],
+ { useTailwind: context.useTailwind }
);
let content = (
@@ -102,18 +110,24 @@ export const MultiSelectHeader = React.memo((props) => {
const selectAllId = props.id ? props.id + '_selectall' : UniqueComponentId();
const headerSelectAllLabelProps = mergeProps(
- {
- htmlFor: selectAllId,
- className: cx('headerSelectAllLabel')
- },
- getPTOptions('headerSelectAllLabel')
+ [
+ {
+ htmlFor: selectAllId,
+ className: cx('headerSelectAllLabel')
+ },
+ getPTOptions('headerSelectAllLabel')
+ ],
+ { useTailwind: context.useTailwind }
);
const headerCheckboxIconProps = mergeProps(
- {
- className: cx('headerCheckboxIcon')
- },
- getPTOptions('headerCheckboxIcon')
+ [
+ {
+ className: cx('headerCheckboxIcon')
+ },
+ getPTOptions('headerCheckboxIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const checkedIcon = props.itemCheckboxIcon ||
;
@@ -127,30 +141,39 @@ export const MultiSelectHeader = React.memo((props) => {
);
const iconProps = mergeProps(
- {
- className: cx('closeIcon'),
- 'aria-hidden': true
- },
- getPTOptions('closeIcon')
+ [
+ {
+ className: cx('closeIcon'),
+ 'aria-hidden': true
+ },
+ getPTOptions('closeIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.closeIcon ||
;
const closeIcon = IconUtils.getJSXIcon(icon, { ...iconProps }, { props });
const headerProps = mergeProps(
- {
- className: cx('header')
- },
- getPTOptions('header')
+ [
+ {
+ className: cx('header')
+ },
+ getPTOptions('header')
+ ],
+ { useTailwind: context.useTailwind }
);
const closeButtonProps = mergeProps(
- {
- type: 'button',
- className: cx('closeButton'),
- 'aria-label': localeOption('close'),
- onClick: props.onClose
- },
- getPTOptions('closeButton')
+ [
+ {
+ type: 'button',
+ className: cx('closeButton'),
+ 'aria-label': localeOption('close'),
+ onClick: props.onClose
+ },
+ getPTOptions('closeButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const closeElement = (
diff --git a/components/lib/multiselect/MultiSelectItem.js b/components/lib/multiselect/MultiSelectItem.js
index 44222435e1..0329e3ca41 100644
--- a/components/lib/multiselect/MultiSelectItem.js
+++ b/components/lib/multiselect/MultiSelectItem.js
@@ -1,10 +1,12 @@
import * as React from 'react';
import { CheckIcon } from '../icons/check';
import { Ripple } from '../ripple/Ripple';
+import { PrimeReactContext } from '../api/Api';
import { IconUtils, ObjectUtils, classNames, mergeProps } from '../utils/Utils';
export const MultiSelectItem = React.memo((props) => {
const { ptm, cx } = props;
+ const context = React.useContext(PrimeReactContext);
const getPTOptions = (key) => {
return ptm(key, {
@@ -36,10 +38,13 @@ export const MultiSelectItem = React.memo((props) => {
};
const checkboxIconProps = mergeProps(
- {
- className: cx('checkboxIcon')
- },
- getPTOptions('checkboxIcon')
+ [
+ {
+ className: cx('checkboxIcon')
+ },
+ getPTOptions('checkboxIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.checkboxIcon ||
;
@@ -49,33 +54,42 @@ export const MultiSelectItem = React.memo((props) => {
const tabIndex = props.disabled ? null : props.tabIndex || 0;
const checkboxContainerProps = mergeProps(
- {
- className: cx('checkboxContainer')
- },
- getPTOptions('checkboxContainer')
+ [
+ {
+ className: cx('checkboxContainer')
+ },
+ getPTOptions('checkboxContainer')
+ ],
+ { useTailwind: context.useTailwind }
);
const checkboxProps = mergeProps(
- {
- className: cx('checkbox', { itemProps: props }),
- 'data-p-highlight': props.selected
- },
- getPTOptions('checkbox')
+ [
+ {
+ className: cx('checkbox', { itemProps: props }),
+ 'data-p-highlight': props.selected
+ },
+ getPTOptions('checkbox')
+ ],
+ { useTailwind: context.useTailwind }
);
const itemProps = mergeProps(
- {
- className: classNames(props.className, props.option.className, cx('item', { itemProps: props })),
- style: props.style,
- onClick: onClick,
- tabIndex: tabIndex,
- onKeyDown: onKeyDown,
- role: 'option',
- 'aria-selected': props.selected,
- 'data-p-highlight': props.selected,
- 'data-p-disabled': props.disabled
- },
- getPTOptions('item')
+ [
+ {
+ className: classNames(props.className, props.option.className, cx('item', { itemProps: props })),
+ style: props.style,
+ onClick: onClick,
+ tabIndex: tabIndex,
+ onKeyDown: onKeyDown,
+ role: 'option',
+ 'aria-selected': props.selected,
+ 'data-p-highlight': props.selected,
+ 'data-p-disabled': props.disabled
+ },
+ getPTOptions('item')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/multiselect/MultiSelectPanel.js b/components/lib/multiselect/MultiSelectPanel.js
index 36275b17fa..67ac2818d3 100644
--- a/components/lib/multiselect/MultiSelectPanel.js
+++ b/components/lib/multiselect/MultiSelectPanel.js
@@ -128,10 +128,13 @@ export const MultiSelectPanel = React.memo(
const emptyFilterMessage = ObjectUtils.getJSXElement(props.emptyFilterMessage, props) || localeOption('emptyFilterMessage');
const emptyMessageProps = mergeProps(
- {
- className: cx('emptyMessage')
- },
- getPTOptions('emptyMessage')
+ [
+ {
+ className: cx('emptyMessage')
+ },
+ getPTOptions('emptyMessage')
+ ],
+ { useTailwind: context.useTailwind }
);
return
{emptyFilterMessage} ;
@@ -141,10 +144,13 @@ export const MultiSelectPanel = React.memo(
const emptyMessage = ObjectUtils.getJSXElement(props.emptyMessage, props) || localeOption('emptyMessage');
const emptyMessageProps = mergeProps(
- {
- className: cx('emptyMessage')
- },
- getPTOptions('emptyMessage')
+ [
+ {
+ className: cx('emptyMessage')
+ },
+ getPTOptions('emptyMessage')
+ ],
+ { useTailwind: context.useTailwind }
);
return
{emptyMessage} ;
@@ -158,11 +164,14 @@ export const MultiSelectPanel = React.memo(
const groupChildrenContent = createGroupChildren(option, style);
const key = index + '_' + props.getOptionGroupRenderKey(option);
const itemGroupProps = mergeProps(
- {
- className: cx('itemGroup'),
- style: sx('itemGroup', { scrollerOptions })
- },
- getPTOptions('itemGroup')
+ [
+ {
+ className: cx('itemGroup'),
+ style: sx('itemGroup', { scrollerOptions })
+ },
+ getPTOptions('itemGroup')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -223,14 +232,17 @@ export const MultiSelectPanel = React.memo(
const content = isEmptyFilter() ? createEmptyFilter() : options.children;
const listProps = mergeProps(
- {
- ref: options.contentRef,
- style: options.style,
- className: classNames(options.className, cx('list', { virtualScrollerProps: props.virtualScrollerOptions })),
- role: 'listbox',
- 'aria-multiselectable': true
- },
- getPTOptions('list')
+ [
+ {
+ ref: options.contentRef,
+ style: options.style,
+ className: classNames(options.className, cx('list', { virtualScrollerProps: props.virtualScrollerOptions })),
+ role: 'listbox',
+ 'aria-multiselectable': true
+ },
+ getPTOptions('list')
+ ],
+ { useTailwind: context.useTailwind }
);
return
;
@@ -243,20 +255,26 @@ export const MultiSelectPanel = React.memo(
const items = createItems();
const wrapperProps = mergeProps(
- {
- className: cx('wrapper'),
- style: { maxHeight: props.scrollHeight }
- },
- getPTOptions('wrapper')
+ [
+ {
+ className: cx('wrapper'),
+ style: { maxHeight: props.scrollHeight }
+ },
+ getPTOptions('wrapper')
+ ],
+ { useTailwind: context.useTailwind }
);
const listProps = mergeProps(
- {
- className: cx('list'),
- role: 'listbox',
- 'aria-multiselectable': true
- },
- getPTOptions('list')
+ [
+ {
+ className: cx('list'),
+ role: 'listbox',
+ 'aria-multiselectable': true
+ },
+ getPTOptions('list')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -274,12 +292,15 @@ export const MultiSelectPanel = React.memo(
const footer = createFooter();
const panelProps = mergeProps(
- {
- className: classNames(props.panelClassName, cx('panel', { panelProps: props, context, allowOptionSelect })),
- style: props.panelStyle,
- onClick: props.onClick
- },
- getPTOptions('panel')
+ [
+ {
+ className: classNames(props.panelClassName, cx('panel', { panelProps: props, context, allowOptionSelect })),
+ style: props.panelStyle,
+ onClick: props.onClick
+ },
+ getPTOptions('panel')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.inline) {
@@ -292,18 +313,21 @@ export const MultiSelectPanel = React.memo(
}
const transitionProps = mergeProps(
- {
- classNames: cx('transition'),
- in: props.in,
- timeout: { enter: 120, exit: 100 },
- options: props.transitionOptions,
- unmountOnExit: true,
- onEnter,
- onEntered,
- onExit: props.onExit,
- onExited: props.onExited
- },
- getPTOptions('transition')
+ [
+ {
+ classNames: cx('transition'),
+ in: props.in,
+ timeout: { enter: 120, exit: 100 },
+ options: props.transitionOptions,
+ unmountOnExit: true,
+ onEnter,
+ onEntered,
+ onExit: props.onExit,
+ onExited: props.onExited
+ },
+ getPTOptions('transition')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/multistatecheckbox/MultiStateCheckbox.js b/components/lib/multistatecheckbox/MultiStateCheckbox.js
index 37b107e258..ac6af44189 100644
--- a/components/lib/multistatecheckbox/MultiStateCheckbox.js
+++ b/components/lib/multistatecheckbox/MultiStateCheckbox.js
@@ -122,10 +122,13 @@ export const MultiStateCheckbox = React.memo(
[`${icon}`]: true
});
const iconProps = mergeProps(
- {
- className: cx('icon', { icon })
- },
- ptm('icon')
+ [
+ {
+ className: cx('icon', { icon })
+ },
+ ptm('icon')
+ ],
+ { useTailwind: context.useTailwind }
);
const content = IconUtils.getJSXIcon(icon, { ...iconProps }, { props });
@@ -154,38 +157,47 @@ export const MultiStateCheckbox = React.memo(
const ariaChecked = !!selectedOption ? 'true' : 'false';
const rootProps = mergeProps(
- {
- ref: elementRef,
- id: props.id,
- className: cx('root'),
- style: props.style,
- onClick: onClick
- },
- MultiStateCheckboxBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ ref: elementRef,
+ id: props.id,
+ className: cx('root'),
+ style: props.style,
+ onClick: onClick
+ },
+ MultiStateCheckboxBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
const checkboxProps = mergeProps(
- {
- className: cx('checkbox', { focusedState, selectedOption }),
- style: sx('checkbox', { selectedOption }),
- tabIndex: props.tabIndex,
- onFocus: onFocus,
- onBlur: onBlur,
- onKeyDown: onKeyDown,
- role: 'checkbox',
- 'aria-checked': ariaChecked,
- ...ariaProps
- },
- ptm('checkbox')
+ [
+ {
+ className: cx('checkbox', { focusedState, selectedOption }),
+ style: sx('checkbox', { selectedOption }),
+ tabIndex: props.tabIndex,
+ onFocus: onFocus,
+ onBlur: onBlur,
+ onKeyDown: onKeyDown,
+ role: 'checkbox',
+ 'aria-checked': ariaChecked,
+ ...ariaProps
+ },
+ ptm('checkbox')
+ ],
+ { useTailwind: context.useTailwind }
);
const srOnlyAriaProps = mergeProps(
- {
- className: 'p-sr-only p-hidden-accessible',
- 'aria-live': 'polite'
- },
- ptm('srOnlyAria')
+ [
+ {
+ className: 'p-sr-only p-hidden-accessible',
+ 'aria-live': 'polite'
+ },
+ ptm('srOnlyAria')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/orderlist/OrderList.js b/components/lib/orderlist/OrderList.js
index 77530d769d..eabaa1a8df 100644
--- a/components/lib/orderlist/OrderList.js
+++ b/components/lib/orderlist/OrderList.js
@@ -233,14 +233,17 @@ export const OrderList = React.memo(
const visibleList = getVisibleList();
const rootProps = mergeProps(
- {
- ref: elementRef,
- id: props.id,
- className: classNames(props.className, cx('root')),
- style: props.style
- },
- OrderListBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ ref: elementRef,
+ id: props.id,
+ className: classNames(props.className, cx('root')),
+ style: props.style
+ },
+ OrderListBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/orderlist/OrderListControls.js b/components/lib/orderlist/OrderListControls.js
index fa4b4cbb69..1c0a4eb2bd 100644
--- a/components/lib/orderlist/OrderListControls.js
+++ b/components/lib/orderlist/OrderListControls.js
@@ -5,9 +5,11 @@ import { AngleDoubleDownIcon } from '../icons/angledoubledown';
import { AngleDoubleUpIcon } from '../icons/angledoubleup';
import { AngleDownIcon } from '../icons/angledown';
import { AngleUpIcon } from '../icons/angleup';
+import { PrimeReactContext } from '../api/Api';
import { ObjectUtils, mergeProps } from '../utils/Utils';
export const OrderListControls = React.memo((props) => {
+ const context = React.useContext(PrimeReactContext);
const moveUpIcon = props.moveUpIcon ||
;
const moveTopIcon = props.moveTopIcon ||
;
const moveDownIcon = props.moveDownIcon ||
;
@@ -127,66 +129,81 @@ export const OrderListControls = React.memo((props) => {
};
const controlsProps = mergeProps(
- {
- className: cx('controls')
- },
- ptm('controls', { hostName: props.hostName })
+ [
+ {
+ className: cx('controls')
+ },
+ ptm('controls', { hostName: props.hostName })
+ ],
+ { useTailwind: context.useTailwind }
);
const moveUpButtonProps = mergeProps(
- {
- type: 'button',
- unstyled: unstyled,
- icon: moveUpIcon,
- onClick: moveUp,
- 'aria-label': ariaLabel('moveUp'),
- __parentMetadata: {
- parent: props.metaData
- }
- },
- ptm('moveUpButton')
+ [
+ {
+ type: 'button',
+ unstyled: unstyled,
+ icon: moveUpIcon,
+ onClick: moveUp,
+ 'aria-label': ariaLabel('moveUp'),
+ __parentMetadata: {
+ parent: props.metaData
+ }
+ },
+ ptm('moveUpButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const moveTopButtonProps = mergeProps(
- {
- type: 'button',
- unstyled: unstyled,
- icon: moveTopIcon,
- onClick: moveTop,
- 'aria-label': ariaLabel('moveTop'),
- __parentMetadata: {
- parent: props.metaData
- }
- },
- ptm('moveTopButton')
+ [
+ {
+ type: 'button',
+ unstyled: unstyled,
+ icon: moveTopIcon,
+ onClick: moveTop,
+ 'aria-label': ariaLabel('moveTop'),
+ __parentMetadata: {
+ parent: props.metaData
+ }
+ },
+ ptm('moveTopButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const moveDownButtonProps = mergeProps(
- {
- type: 'button',
- unstyled: unstyled,
- icon: moveDownIcon,
- onClick: moveDown,
- 'aria-label': ariaLabel('moveDown'),
- __parentMetadata: {
- parent: props.metaData
- }
- },
- ptm('moveDownButton')
+ [
+ {
+ type: 'button',
+ unstyled: unstyled,
+ icon: moveDownIcon,
+ onClick: moveDown,
+ 'aria-label': ariaLabel('moveDown'),
+ __parentMetadata: {
+ parent: props.metaData
+ }
+ },
+ ptm('moveDownButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const moveBottomButtonProps = mergeProps(
- {
- type: 'button',
- unstyled: unstyled,
- icon: moveBottomIcon,
- onClick: moveBottom,
- 'aria-label': ariaLabel('moveBottom'),
- __parentMetadata: {
- parent: props.metaData
- }
- },
- ptm('moveBottomButton')
+ [
+ {
+ type: 'button',
+ unstyled: unstyled,
+ icon: moveBottomIcon,
+ onClick: moveBottom,
+ 'aria-label': ariaLabel('moveBottom'),
+ __parentMetadata: {
+ parent: props.metaData
+ }
+ },
+ ptm('moveBottomButton')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/orderlist/OrderListSubList.js b/components/lib/orderlist/OrderListSubList.js
index 4350d75a31..1e7f22edc8 100644
--- a/components/lib/orderlist/OrderListSubList.js
+++ b/components/lib/orderlist/OrderListSubList.js
@@ -1,10 +1,12 @@
import * as React from 'react';
import { SearchIcon } from '../icons/search';
import { Ripple } from '../ripple/Ripple';
+import { PrimeReactContext } from '../api/Api';
import { classNames, DomHandler, IconUtils, mergeProps, ObjectUtils } from '../utils/Utils';
export const OrderListSubList = React.memo((props) => {
const { ptm, cx } = props;
+ const context = React.useContext(PrimeReactContext);
const _ptm = (key, options) => {
return ptm(key, {
@@ -96,13 +98,16 @@ export const OrderListSubList = React.memo((props) => {
const createDropPoint = (index, key) => {
const droppointProps = mergeProps(
- {
- className: cx('droppoint'),
- onDragOver: (e) => onDragOver(e, index + 1),
- onDragLeave: onDragLeave,
- onDrop: onDrop
- },
- _ptm('droppoint')
+ [
+ {
+ className: cx('droppoint'),
+ onDragOver: (e) => onDragOver(e, index + 1),
+ onDragLeave: onDragLeave,
+ onDrop: onDrop
+ },
+ _ptm('droppoint')
+ ],
+ { useTailwind: context.useTailwind }
);
return
;
@@ -110,10 +115,13 @@ export const OrderListSubList = React.memo((props) => {
const createHeader = () => {
const headerProps = mergeProps(
- {
- className: cx('header')
- },
- _ptm('header')
+ [
+ {
+ className: cx('header')
+ },
+ _ptm('header')
+ ],
+ { useTailwind: context.useTailwind }
);
return props.header ?
{props.header}
: null;
@@ -127,19 +135,22 @@ export const OrderListSubList = React.memo((props) => {
if (props.dragdrop) {
const itemProps = mergeProps(
- {
- className: classNames(props.className, cx('item', { item, isSelected })),
- onClick: (e) => props.onItemClick({ originalEvent: e, value: item, index: i }),
- onKeyDown: (e) => props.onItemKeyDown({ originalEvent: e, value: item, index: i }),
- role: 'option',
- 'aria-selected': isSelected(item),
- draggable: 'true',
- onDragStart: (e) => onDragStart(e, i),
- onDragEnd: onDragEnd,
- tabIndex: props.tabIndex,
- 'data-p-highlight': isSelected(item)
- },
- getPTOptions(item, 'item')
+ [
+ {
+ className: classNames(props.className, cx('item', { item, isSelected })),
+ onClick: (e) => props.onItemClick({ originalEvent: e, value: item, index: i }),
+ onKeyDown: (e) => props.onItemKeyDown({ originalEvent: e, value: item, index: i }),
+ role: 'option',
+ 'aria-selected': isSelected(item),
+ draggable: 'true',
+ onDragStart: (e) => onDragStart(e, i),
+ onDragEnd: onDragEnd,
+ tabIndex: props.tabIndex,
+ 'data-p-highlight': isSelected(item)
+ },
+ getPTOptions(item, 'item')
+ ],
+ { useTailwind: context.useTailwind }
);
let items = [];
@@ -160,16 +171,19 @@ export const OrderListSubList = React.memo((props) => {
return items;
} else {
const itemProps = mergeProps(
- {
- role: 'option',
- tabIndex: props.tabIndex,
- className: classNames(props.className, cx('item', { item, isSelected })),
- onClick: (e) => props.onItemClick({ originalEvent: e, value: item, index: i }),
- onKeyDown: (e) => props.onItemKeyDown({ originalEvent: e, value: item, index: i }),
- 'aria-selected': isSelected(item),
- 'data-p-highlight': isSelected(item)
- },
- getPTOptions(item, 'item')
+ [
+ {
+ role: 'option',
+ tabIndex: props.tabIndex,
+ className: classNames(props.className, cx('item', { item, isSelected })),
+ onClick: (e) => props.onItemClick({ originalEvent: e, value: item, index: i }),
+ onKeyDown: (e) => props.onItemKeyDown({ originalEvent: e, value: item, index: i }),
+ 'aria-selected': isSelected(item),
+ 'data-p-highlight': isSelected(item)
+ },
+ getPTOptions(item, 'item')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -188,15 +202,18 @@ export const OrderListSubList = React.memo((props) => {
const createList = () => {
const items = createItems();
const listProps = mergeProps(
- {
- ref: listElementRef,
- className: cx('list'),
- style: props.listStyle,
- onDragOver: onListMouseMove,
- role: 'listbox',
- 'aria-multiselectable': true
- },
- _ptm('list')
+ [
+ {
+ ref: listElementRef,
+ className: cx('list'),
+ style: props.listStyle,
+ onDragOver: onListMouseMove,
+ role: 'listbox',
+ 'aria-multiselectable': true
+ },
+ _ptm('list')
+ ],
+ { useTailwind: context.useTailwind }
);
return
;
@@ -204,39 +221,51 @@ export const OrderListSubList = React.memo((props) => {
const createFilter = () => {
const searchIconProps = mergeProps(
- {
- className: cx('icon')
- },
- _ptm('icon')
+ [
+ {
+ className: cx('icon')
+ },
+ _ptm('icon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.filterIcon ||
;
const filterIcon = IconUtils.getJSXIcon(icon, { ...searchIconProps }, { props });
if (props.filter) {
const filterProps = mergeProps(
- {
- className: cx('filter')
- },
- _ptm('filter')
+ [
+ {
+ className: cx('filter')
+ },
+ _ptm('filter')
+ ],
+ { useTailwind: context.useTailwind }
);
const filterInputProps = mergeProps(
- {
- type: 'text',
- value: props.filterValue,
- onChange: props.onFilter,
- onKeyDown: onFilterInputKeyDown,
- placeholder: props.placeholder,
- className: cx('filterInput')
- },
- _ptm('filterInput')
+ [
+ {
+ type: 'text',
+ value: props.filterValue,
+ onChange: props.onFilter,
+ onKeyDown: onFilterInputKeyDown,
+ placeholder: props.placeholder,
+ className: cx('filterInput')
+ },
+ _ptm('filterInput')
+ ],
+ { useTailwind: context.useTailwind }
);
const filterIconProps = mergeProps(
- {
- className: cx('filterIcon')
- },
- _ptm('filterIcon')
+ [
+ {
+ className: cx('filterIcon')
+ },
+ _ptm('filterIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
let content = (
@@ -264,10 +293,13 @@ export const OrderListSubList = React.memo((props) => {
}
const filterContainerProps = mergeProps(
- {
- className: cx('filterContainer')
- },
- _ptm('filterContainer')
+ [
+ {
+ className: cx('filterContainer')
+ },
+ _ptm('filterContainer')
+ ],
+ { useTailwind: context.useTailwind }
);
return
{content}
;
@@ -281,10 +313,13 @@ export const OrderListSubList = React.memo((props) => {
const list = createList();
const containerProps = mergeProps(
- {
- className: cx('container')
- },
- _ptm('container')
+ [
+ {
+ className: cx('container')
+ },
+ _ptm('container')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/organizationchart/OrganizationChart.js b/components/lib/organizationchart/OrganizationChart.js
index 1489bf2eb6..2706dd9ada 100644
--- a/components/lib/organizationchart/OrganizationChart.js
+++ b/components/lib/organizationchart/OrganizationChart.js
@@ -75,14 +75,17 @@ export const OrganizationChart = React.memo(
}));
const rootProps = mergeProps(
- {
- id: props.id,
- ref: elementRef,
- style: props.style,
- className: classNames(props.className, cx('root'))
- },
- OrganizationChartBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ id: props.id,
+ ref: elementRef,
+ style: props.style,
+ className: classNames(props.className, cx('root'))
+ },
+ OrganizationChartBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/organizationchart/OrganizationChartNode.js b/components/lib/organizationchart/OrganizationChartNode.js
index 823011e7a0..bfdf75eb8b 100644
--- a/components/lib/organizationchart/OrganizationChartNode.js
+++ b/components/lib/organizationchart/OrganizationChartNode.js
@@ -1,6 +1,7 @@
import * as React from 'react';
import { ChevronDownIcon } from '../icons/chevrondown';
import { ChevronUpIcon } from '../icons/chevronup';
+import { PrimeReactContext } from '../api/Api';
import { IconUtils, ObjectUtils, mergeProps } from '../utils/Utils';
export const OrganizationChartNode = React.memo((props) => {
@@ -11,6 +12,7 @@ export const OrganizationChartNode = React.memo((props) => {
const selected = props.isSelected(node);
const visibility = !leaf && expandedState ? 'inherit' : 'hidden';
const { ptm, cx, sx } = props;
+ const context = React.useContext(PrimeReactContext);
const _ptm = (key, options) => {
return ptm(key, {
@@ -49,17 +51,23 @@ export const OrganizationChartNode = React.memo((props) => {
const createChildNodes = () => {
const nodesProps = mergeProps(
- {
- className: cx('nodes'),
- style: { visibility }
- },
- _ptm('nodes')
+ [
+ {
+ className: cx('nodes'),
+ style: { visibility }
+ },
+ _ptm('nodes')
+ ],
+ { useTailwind: context.useTailwind }
);
const nodeCellProps = mergeProps(
- {
- colSpan: '2'
- },
- _ptm('nodeCell')
+ [
+ {
+ colSpan: '2'
+ },
+ _ptm('nodeCell')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -89,23 +97,32 @@ export const OrganizationChartNode = React.memo((props) => {
const createLinesMiddle = () => {
const nodeChildLength = node.children && node.children.length;
const linesProps = mergeProps(
- {
- className: cx('lines'),
- style: { visibility }
- },
- _ptm('lines')
+ [
+ {
+ className: cx('lines'),
+ style: { visibility }
+ },
+ _ptm('lines')
+ ],
+ { useTailwind: context.useTailwind }
);
const lineCellProps = mergeProps(
- {
- colSpan: colspan
- },
- _ptm('lineCell')
+ [
+ {
+ colSpan: colspan
+ },
+ _ptm('lineCell')
+ ],
+ { useTailwind: context.useTailwind }
);
const lineDownProps = mergeProps(
- {
- className: cx('lineDown')
- },
- _ptm('lineDown')
+ [
+ {
+ className: cx('lineDown')
+ },
+ _ptm('lineDown')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -119,16 +136,22 @@ export const OrganizationChartNode = React.memo((props) => {
node.children.length > 1 &&
node.children.map((_, index) => {
const lineLeftProps = mergeProps(
- {
- className: cx('lineLeft', { index })
- },
- getNodePTOptions(index !== 0, 'lineLeft')
+ [
+ {
+ className: cx('lineLeft', { index })
+ },
+ getNodePTOptions(index !== 0, 'lineLeft')
+ ],
+ { useTailwind: context.useTailwind }
);
const lineRightProps = mergeProps(
- {
- className: cx('lineRight', { index, nodeChildLength })
- },
- getNodePTOptions(index !== nodeChildLength - 1, 'lineRight')
+ [
+ {
+ className: cx('lineRight', { index, nodeChildLength })
+ },
+ getNodePTOptions(index !== nodeChildLength - 1, 'lineRight')
+ ],
+ { useTailwind: context.useTailwind }
);
return [
@@ -146,25 +169,34 @@ export const OrganizationChartNode = React.memo((props) => {
const createLinesDown = () => {
const linesProps = mergeProps(
- {
- className: cx('lines'),
- style: { visibility }
- },
- _ptm('lines')
+ [
+ {
+ className: cx('lines'),
+ style: { visibility }
+ },
+ _ptm('lines')
+ ],
+ { useTailwind: context.useTailwind }
);
const lineCellProps = mergeProps(
- {
- colSpan: colspan
- },
- _ptm('lineCell')
+ [
+ {
+ colSpan: colspan
+ },
+ _ptm('lineCell')
+ ],
+ { useTailwind: context.useTailwind }
);
const lineDownProps = mergeProps(
- {
- className: cx('lineDown')
- },
- _ptm('lineDown')
+ [
+ {
+ className: cx('lineDown')
+ },
+ _ptm('lineDown')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -179,10 +211,13 @@ export const OrganizationChartNode = React.memo((props) => {
const createToggler = () => {
if (!leaf) {
const nodeTogglerIconProps = mergeProps(
- {
- className: cx('nodeTogglerIcon')
- },
- _ptm('nodeTogglerIcon')
+ [
+ {
+ className: cx('nodeTogglerIcon')
+ },
+ _ptm('nodeTogglerIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
let icon;
@@ -196,12 +231,15 @@ export const OrganizationChartNode = React.memo((props) => {
const togglerIcon = IconUtils.getJSXIcon(icon, { ...nodeTogglerIconProps }, { props });
const nodeTogglerProps = mergeProps(
- {
- className: cx('nodeToggler'),
- onClick: (e) => toggleNode(e, node),
- href: '#'
- },
- getPTOptions('nodeToggler')
+ [
+ {
+ className: cx('nodeToggler'),
+ onClick: (e) => toggleNode(e, node),
+ href: '#'
+ },
+ getPTOptions('nodeToggler')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
@@ -227,22 +265,28 @@ export const OrganizationChartNode = React.memo((props) => {
const toggler = createToggler();
const cellProps = mergeProps(
- {
- colSpan: colspan
- },
- _ptm('cell')
+ [
+ {
+ colSpan: colspan
+ },
+ _ptm('cell')
+ ],
+ { useTailwind: context.useTailwind }
);
const nodeProps = mergeProps(
- {
- className: cx('node', { selected, node, nodeProps: props }),
- style: node.style,
- onClick: (e) => onNodeClick(e, node)
- },
- getPTOptions('node')
+ [
+ {
+ className: cx('node', { selected, node, nodeProps: props }),
+ style: node.style,
+ onClick: (e) => onNodeClick(e, node)
+ },
+ getPTOptions('node')
+ ],
+ { useTailwind: context.useTailwind }
);
- const rowProps = mergeProps(_ptm('row'));
+ const rowProps = mergeProps([_ptm('row')], { useTailwind: context.useTailwind });
return (
@@ -262,10 +306,13 @@ export const OrganizationChartNode = React.memo((props) => {
const childNodes = createChildNodes();
const tableProps = mergeProps(
- {
- className: cx('table')
- },
- _ptm('table')
+ [
+ {
+ className: cx('table')
+ },
+ _ptm('table')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/overlaypanel/OverlayPanel.js b/components/lib/overlaypanel/OverlayPanel.js
index 7cd7756f4a..159b3cba55 100644
--- a/components/lib/overlaypanel/OverlayPanel.js
+++ b/components/lib/overlaypanel/OverlayPanel.js
@@ -221,23 +221,29 @@ export const OverlayPanel = React.forwardRef((inProps, ref) => {
const createCloseIcon = () => {
const closeIconProps = mergeProps(
- {
- className: cx('closeIcon'),
- 'aria-hidden': true
- },
- ptm('closeIcon')
+ [
+ {
+ className: cx('closeIcon'),
+ 'aria-hidden': true
+ },
+ ptm('closeIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.closeIcon || ;
const closeIcon = IconUtils.getJSXIcon(icon, { ...closeIconProps }, { props });
const ariaLabel = props.ariaCloseLabel || localeOption('close');
const closeButtonProps = mergeProps(
- {
- type: 'button',
- className: cx('closeButton'),
- onClick: (e) => onCloseClick(e),
- 'aria-label': ariaLabel
- },
- ptm('closeButton')
+ [
+ {
+ type: 'button',
+ className: cx('closeButton'),
+ onClick: (e) => onCloseClick(e),
+ 'aria-label': ariaLabel
+ },
+ ptm('closeButton')
+ ],
+ { useTailwind: context.useTailwind }
);
if (props.showCloseIcon) {
@@ -255,39 +261,48 @@ export const OverlayPanel = React.forwardRef((inProps, ref) => {
const createElement = () => {
const closeIcon = createCloseIcon();
const rootProps = mergeProps(
- {
- id: props.id,
- className: cx('root', { context }),
- style: props.style,
- onClick: (e) => onPanelClick(e)
- },
- OverlayPanelBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ id: props.id,
+ className: cx('root', { context }),
+ style: props.style,
+ onClick: (e) => onPanelClick(e)
+ },
+ OverlayPanelBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
const contentProps = mergeProps(
- {
- className: cx('content'),
- onClick: (e) => onContentClick(e),
- onMouseDown: onContentClick
- },
- OverlayPanelBase.getOtherProps(props),
- ptm('content')
+ [
+ {
+ className: cx('content'),
+ onClick: (e) => onContentClick(e),
+ onMouseDown: onContentClick
+ },
+ OverlayPanelBase.getOtherProps(props),
+ ptm('content')
+ ],
+ { useTailwind: context.useTailwind }
);
const transitionProps = mergeProps(
- {
- classNames: cx('transition'),
- in: visibleState,
- timeout: { enter: 120, exit: 100 },
- options: props.transitionOptions,
- unmountOnExit: true,
- onEnter: onEnter,
- onEntered: onEntered,
- onExit: onExit,
- onExited: onExited
- },
- ptm('transition')
+ [
+ {
+ classNames: cx('transition'),
+ in: visibleState,
+ timeout: { enter: 120, exit: 100 },
+ options: props.transitionOptions,
+ unmountOnExit: true,
+ onEnter: onEnter,
+ onEntered: onEntered,
+ onExit: onExit,
+ onExited: onExited
+ },
+ ptm('transition')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/paginator/CurrentPageReport.js b/components/lib/paginator/CurrentPageReport.js
index 798ccb4856..147d97a52e 100644
--- a/components/lib/paginator/CurrentPageReport.js
+++ b/components/lib/paginator/CurrentPageReport.js
@@ -25,10 +25,13 @@ export const CurrentPageReport = React.memo((inProps) => {
.replace('{totalRecords}', report.totalRecords);
const currentProps = mergeProps(
- {
- className: 'p-paginator-current'
- },
- props.ptm('current', { hostName: props.hostName })
+ [
+ {
+ className: 'p-paginator-current'
+ },
+ props.ptm('current', { hostName: props.hostName })
+ ],
+ { useTailwind: context.useTailwind }
);
const element = {text} ;
diff --git a/components/lib/paginator/FirstPageLink.js b/components/lib/paginator/FirstPageLink.js
index 3c6df867a8..0e15e785dc 100644
--- a/components/lib/paginator/FirstPageLink.js
+++ b/components/lib/paginator/FirstPageLink.js
@@ -23,22 +23,28 @@ export const FirstPageLink = React.memo((inProps) => {
const className = classNames('p-paginator-first p-paginator-element p-link', { 'p-disabled': props.disabled });
const iconClassName = 'p-paginator-icon';
const firstPageIconProps = mergeProps(
- {
- className: cx('firstPageIcon')
- },
- getPTOptions('firstPageIcon')
+ [
+ {
+ className: cx('firstPageIcon')
+ },
+ getPTOptions('firstPageIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.firstPageLinkIcon || ;
const firstPageLinkIcon = IconUtils.getJSXIcon(icon, { ...firstPageIconProps }, { props });
const firstPageButtonProps = mergeProps(
- {
- type: 'button',
- className: cx('firstPageButton', { disabled: props.disabled }),
- onClick: props.onClick,
- disabled: props.disabled,
- 'aria-label': ariaLabel('firstPageLabel')
- },
- getPTOptions('firstPageButton')
+ [
+ {
+ type: 'button',
+ className: cx('firstPageButton', { disabled: props.disabled }),
+ onClick: props.onClick,
+ disabled: props.disabled,
+ 'aria-label': ariaLabel('firstPageLabel')
+ },
+ getPTOptions('firstPageButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const element = (
diff --git a/components/lib/paginator/LastPageLink.js b/components/lib/paginator/LastPageLink.js
index 8300f95967..e70d0d4807 100644
--- a/components/lib/paginator/LastPageLink.js
+++ b/components/lib/paginator/LastPageLink.js
@@ -1,10 +1,9 @@
import * as React from 'react';
-import { ariaLabel } from '../api/Api';
+import { ariaLabel, PrimeReactContext } from '../api/Api';
import { AngleDoubleRightIcon } from '../icons/angledoubleright';
import { Ripple } from '../ripple/Ripple';
import { classNames, IconUtils, mergeProps, ObjectUtils } from '../utils/Utils';
import { LastPageLinkBase } from './PaginatorBase';
-import { PrimeReactContext } from '../api/Api';
export const LastPageLink = React.memo((inProps) => {
const context = React.useContext(PrimeReactContext);
@@ -23,22 +22,28 @@ export const LastPageLink = React.memo((inProps) => {
const className = classNames('p-paginator-last p-paginator-element p-link', { 'p-disabled': props.disabled });
const iconClassName = 'p-paginator-icon';
const lastPageIconProps = mergeProps(
- {
- className: cx('lastPageIcon')
- },
- getPTOptions('lastPageIcon')
+ [
+ {
+ className: cx('lastPageIcon')
+ },
+ getPTOptions('lastPageIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.lastPageLinkIcon || ;
const lastPageLinkIcon = IconUtils.getJSXIcon(icon, { ...lastPageIconProps }, { props });
const lastPageButtonProps = mergeProps(
- {
- type: 'button',
- className: cx('lastPageButton', { disabled: props.disabled }),
- onClick: props.onClick,
- disabled: props.disabled,
- 'aria-label': ariaLabel('lastPageLabel')
- },
- getPTOptions('lastPageButton')
+ [
+ {
+ type: 'button',
+ className: cx('lastPageButton', { disabled: props.disabled }),
+ onClick: props.onClick,
+ disabled: props.disabled,
+ 'aria-label': ariaLabel('lastPageLabel')
+ },
+ getPTOptions('lastPageButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const element = (
diff --git a/components/lib/paginator/NextPageLink.js b/components/lib/paginator/NextPageLink.js
index 1caaeeb4f2..c4eafdf97e 100644
--- a/components/lib/paginator/NextPageLink.js
+++ b/components/lib/paginator/NextPageLink.js
@@ -24,23 +24,29 @@ export const NextPageLink = React.memo((inProps) => {
const iconClassName = 'p-paginator-icon';
const nextPageIconProps = mergeProps(
- {
- className: cx('nextPageIcon')
- },
- getPTOptions('nextPageIcon')
+ [
+ {
+ className: cx('nextPageIcon')
+ },
+ getPTOptions('nextPageIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.nextPageLinkIcon || ;
const nextPageLinkIcon = IconUtils.getJSXIcon(icon, { ...nextPageIconProps }, { props });
const nextPageButtonProps = mergeProps(
- {
- type: 'button',
- className: cx('nextPageButton', { disabled: props.disabled }),
- onClick: props.onClick,
- disabled: props.disabled,
- 'aria-label': ariaLabel('nextPageLabel')
- },
- getPTOptions('nextPageButton')
+ [
+ {
+ type: 'button',
+ className: cx('nextPageButton', { disabled: props.disabled }),
+ onClick: props.onClick,
+ disabled: props.disabled,
+ 'aria-label': ariaLabel('nextPageLabel')
+ },
+ getPTOptions('nextPageButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const element = (
diff --git a/components/lib/paginator/PageLinks.js b/components/lib/paginator/PageLinks.js
index ace7a3b7f0..5669d89b04 100644
--- a/components/lib/paginator/PageLinks.js
+++ b/components/lib/paginator/PageLinks.js
@@ -43,14 +43,17 @@ export const PageLinks = React.memo((inProps) => {
});
const pageButtonProps = mergeProps(
- {
- type: 'button',
- onClick: (e) => onPageLinkClick(e, pageLink),
- className: cx('pageButton', { pageLink, startPageInView, endPageInView, page: props.page }),
- disabled: props.disabled,
- 'aria-label': ariaLabel('pageLabel', { page: pageLink })
- },
- getPTOptions(pageLink, 'pageButton')
+ [
+ {
+ type: 'button',
+ onClick: (e) => onPageLinkClick(e, pageLink),
+ className: cx('pageButton', { pageLink, startPageInView, endPageInView, page: props.page }),
+ disabled: props.disabled,
+ 'aria-label': ariaLabel('pageLabel', { page: pageLink })
+ },
+ getPTOptions(pageLink, 'pageButton')
+ ],
+ { useTailwind: context.useTailwind }
);
let element = (
@@ -83,10 +86,13 @@ export const PageLinks = React.memo((inProps) => {
}
const pagesProps = mergeProps(
- {
- className: cx('pages')
- },
- ptm('pages', { hostName: props.hostName })
+ [
+ {
+ className: cx('pages')
+ },
+ ptm('pages', { hostName: props.hostName })
+ ],
+ { useTailwind: context.useTailwind }
);
return {elements} ;
diff --git a/components/lib/paginator/Paginator.js b/components/lib/paginator/Paginator.js
index 947a3ed709..49ae75a11d 100644
--- a/components/lib/paginator/Paginator.js
+++ b/components/lib/paginator/Paginator.js
@@ -16,6 +16,7 @@ import { RowsPerPageDropdown } from './RowsPerPageDropdown';
export const Paginator = React.memo(
React.forwardRef((inProps, ref) => {
const context = React.useContext(PrimeReactContext);
+
const props = PaginatorBase.getProps(inProps, context);
const metaData = {
props,
@@ -225,27 +226,36 @@ export const Paginator = React.memo(
const elements = createElements();
const leftProps = mergeProps(
- {
- className: cx('left')
- },
- ptm('left')
+ [
+ {
+ className: cx('left')
+ },
+ ptm('left')
+ ],
+ { useTailwind: context.useTailwind }
);
const leftElement = leftContent && {leftContent}
;
const endProps = mergeProps(
- {
- className: cx('end')
- },
- ptm('end')
+ [
+ {
+ className: cx('end')
+ },
+ ptm('end')
+ ],
+ { useTailwind: context.useTailwind }
);
const rightElement = rightContent && {rightContent}
;
const rootProps = mergeProps(
- {
- ref: elementRef,
- className: classNames(props.className, cx('root')),
- style: props.style
- },
- PaginatorBase.getOtherProps(props),
- ptm('root')
+ [
+ {
+ ref: elementRef,
+ className: classNames(props.className, cx('root')),
+ style: props.style
+ },
+ PaginatorBase.getOtherProps(props),
+ ptm('root')
+ ],
+ { useTailwind: context.useTailwind }
);
return (
diff --git a/components/lib/paginator/PrevPageLink.js b/components/lib/paginator/PrevPageLink.js
index d883c84093..3b75e19d4f 100644
--- a/components/lib/paginator/PrevPageLink.js
+++ b/components/lib/paginator/PrevPageLink.js
@@ -1,10 +1,9 @@
import * as React from 'react';
-import { ariaLabel } from '../api/Api';
+import { ariaLabel, PrimeReactContext } from '../api/Api';
import { AngleLeftIcon } from '../icons/angleleft';
import { Ripple } from '../ripple/Ripple';
import { classNames, IconUtils, mergeProps, ObjectUtils } from '../utils/Utils';
import { PrevPageLinkBase } from './PaginatorBase';
-import { PrimeReactContext } from '../api/Api';
export const PrevPageLink = React.memo((inProps) => {
const context = React.useContext(PrimeReactContext);
@@ -23,23 +22,29 @@ export const PrevPageLink = React.memo((inProps) => {
const className = classNames('p-paginator-prev p-paginator-element p-link', { 'p-disabled': props.disabled });
const iconClassName = 'p-paginator-icon';
const prevPageIconProps = mergeProps(
- {
- className: cx('prevPageIcon')
- },
- getPTOptions('prevPageIcon')
+ [
+ {
+ className: cx('prevPageIcon')
+ },
+ getPTOptions('prevPageIcon')
+ ],
+ { useTailwind: context.useTailwind }
);
const icon = props.prevPageLinkIcon || ;
const prevPageLinkIcon = IconUtils.getJSXIcon(icon, { ...prevPageIconProps }, { props });
const prevPageButtonProps = mergeProps(
- {
- type: 'button',
- className: cx('prevPageButton', { disabled: props.disabled }),
- onClick: props.onClick,
- disabled: props.disabled,
- 'aria-label': ariaLabel('previousPageLabel')
- },
- getPTOptions('prevPageButton')
+ [
+ {
+ type: 'button',
+ className: cx('prevPageButton', { disabled: props.disabled }),
+ onClick: props.onClick,
+ disabled: props.disabled,
+ 'aria-label': ariaLabel('previousPageLabel')
+ },
+ getPTOptions('prevPageButton')
+ ],
+ { useTailwind: context.useTailwind }
);
const element = (
diff --git a/components/lib/panel/Panel.js b/components/lib/panel/Panel.js
index 3d204e013d..ad509731ab 100644
--- a/components/lib/panel/Panel.js
+++ b/components/lib/panel/Panel.js
@@ -84,17 +84,20 @@ export const Panel = React.forwardRef((inProps, ref) => {
if (props.toggleable) {
const buttonId = idState + '_label';
const togglerProps = mergeProps(
- {
- className: cx('toggler'),
- onClick: toggle,
- id: buttonId,
- 'aria-controls': contentId,
- 'aria-expanded': !collapsed,
- role: 'tab'
- },
- ptm('toggler')
+ [
+ {
+ className: cx('toggler'),
+ onClick: toggle,
+ id: buttonId,
+ 'aria-controls': contentId,
+ 'aria-expanded': !collapsed,
+ role: 'tab'
+ },
+ ptm('toggler')
+ ],
+ { useTailwind: context.useTailwind }
);
- const togglerIconProps = mergeProps(ptm('togglericon'));
+ const togglerIconProps = mergeProps([ptm('togglericon')], { useTailwind: context.useTailwind });
const icon = collapsed ? props.expandIcon || : props.collapseIcon || ;
const toggleIcon = IconUtils.getJSXIcon(icon, togglerIconProps, { props, collapsed });
@@ -116,19 +119,25 @@ export const Panel = React.forwardRef((inProps, ref) => {
const togglerElement = createToggleIcon();
const titleProps = mergeProps(
- {
- id: headerId,
- className: cx('title')
- },
- ptm('title')
+ [
+ {
+ id: headerId,
+ className: cx('title')
+ },
+ ptm('title')
+ ],
+ { useTailwind: context.useTailwind }
);
const titleElement = {header} ;
const iconsProps = mergeProps(
- {
- className: cx('icons')
- },
- ptm('icons')
+ [
+ {
+ className: cx('icons')
+ },
+ ptm('icons')
+ ],
+ { useTailwind: context.useTailwind }
);
const iconsElement = (