primereact
Version:
PrimeReact is an open source UI library for React featuring a rich set of 90+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with Prime
977 lines (966 loc) • 181 kB
JavaScript
'use client';
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _arrayWithHoles(r) {
if (Array.isArray(r)) return r;
}
function _iterableToArrayLimit(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e,
n,
i,
u,
a = [],
f = !0,
o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
function _unsupportedIterableToArray(r, a) {
if (r) {
if ("string" == typeof r) return _arrayLikeToArray(r, a);
var t = {}.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
}
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _slicedToArray(r, e) {
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
}
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof(o);
}
function classNames() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (args) {
var classes = [];
for (var i = 0; i < args.length; i++) {
var className = args[i];
if (!className) {
continue;
}
var type = _typeof(className);
if (type === 'string' || type === 'number') {
classes.push(className);
} else if (type === 'object') {
var _classes = Array.isArray(className) ? className : Object.entries(className).map(function (_ref) {
var _ref2 = _slicedToArray(_ref, 2),
key = _ref2[0],
value = _ref2[1];
return value ? key : null;
});
classes = _classes.length ? classes.concat(_classes.filter(function (c) {
return !!c;
})) : classes;
}
}
return classes.join(' ').trim();
}
return undefined;
}
var TRANSITIONS = {
toggleable: {
timeout: 500,
classNames: {
enter: 'max-h-0',
enterActive: '!max-h-[1000px] overflow-hidden transition-[max-height] duration-500 ease-in',
exit: 'max-h-[1000px]',
exitActive: '!max-h-0 overflow-hidden transition-[max-height] duration-500 ease-out'
}
},
overlay: {
timeout: 150,
classNames: {
enter: 'opacity-0 scale-75',
enterActive: 'opacity-100 !scale-100 transition-transform transition-opacity duration-150 ease-in',
exit: 'opacity-100',
exitActive: '!opacity-0 transition-opacity duration-150 ease-linear'
}
}
};
var Tailwind = {
global: {
css: "\n *[data-pd-ripple=\"true\"]{\n overflow: hidden;\n position: relative;\n }\n span[data-p-ink-active=\"true\"]{\n animation: ripple 0.4s linear;\n }\n @keyframes ripple {\n 100% {\n opacity: 0;\n transform: scale(2.5);\n }\n }\n\n .progress-spinner-circle {\n stroke-dasharray: 89, 200;\n stroke-dashoffset: 0;\n animation: p-progress-spinner-dash 1.5s ease-in-out infinite, p-progress-spinner-color 6s ease-in-out infinite;\n stroke-linecap: round;\n }\n\n @keyframes p-progress-spinner-dash{\n 0% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n }\n\n 50% {\n stroke-dasharray: 89, 200;\n stroke-dashoffset: -35px;\n }\n 100% {\n stroke-dasharray: 89, 200;\n stroke-dashoffset: -124px;\n }\n }\n @keyframes p-progress-spinner-color {\n 100%, 0% {\n stroke: #ff5757;\n }\n 40% {\n stroke: #696cff;\n }\n 66% {\n stroke: #1ea97c;\n }\n 80%, 90% {\n stroke: #cc8925;\n }\n }\n\n .progressbar-value-animate::after {\n will-change: left, right;\n animation: p-progressbar-indeterminate-anim-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;\n }\n .progressbar-value-animate::before {\n will-change: left, right;\n animation: p-progressbar-indeterminate-anim 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n }\n @keyframes p-progressbar-indeterminate-anim {\n 0% {\n left: -35%;\n right: 100%;\n }\n 60% {\n left: 100%;\n right: -90%;\n }\n 100% {\n left: 100%;\n right: -90%;\n }\n }\n"
},
//PANELS
panel: {
header: function header(_ref) {
var props = _ref.props;
return {
className: classNames('flex items-center justify-between',
// flex and alignments
'border border-gray-300 bg-gray-100 text-gray-700 rounded-tl-lg rounded-tr-lg',
// borders and colors
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80',
// Dark mode
{
'p-5': !props.toggleable,
'py-3 px-5': props.toggleable
} // condition
)
};
},
title: 'leading-none font-bold',
toggler: {
className: classNames('inline-flex items-center justify-center overflow-hidden relative no-underline',
// alignments
'w-8 h-8 text-gray-600 border-0 bg-transparent rounded-full transition duration-200 ease-in-out',
// widths, borders, and transitions
'hover:text-gray-900 hover:border-transparent hover:bg-gray-200 dark:hover:text-white/80 dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]',
// hover
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)]' // focus
)
},
togglerIcon: 'inline-block',
content: {
className: classNames('p-5 border border-gray-300 bg-white text-gray-700 border-t-0 last:rounded-br-lg last:rounded-bl-lg', 'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80' // Dark mode
)
},
transition: TRANSITIONS.toggleable
},
accordion: {
root: 'mb-1',
accordiontab: {
root: 'mb-1',
header: function header(_ref2) {
var context = _ref2.context;
return {
className: classNames({
'select-none pointer-events-none cursor-default opacity-60': context.disabled
} // Condition
)
};
},
headerAction: function headerAction(_ref3) {
var context = _ref3.context;
return {
className: classNames('flex items-center cursor-pointer relative no-underline select-none',
// Alignments
'p-5 transition duration-200 ease-in-out rounded-t-md font-bold transition-shadow duration-200',
// Padding and transition
'border border-gray-300 bg-gray-100 text-gray-600',
// Borders and colors
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80 dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]',
// Dark mode
'hover:border-gray-300 hover:bg-gray-200 hover:text-gray-800',
// Hover
'focus:outline-none focus:outline-offset-0 focus:shadow-[inset_0_0_0_0.2rem_rgba(191,219,254,1)]',
// Focus
{
'rounded-br-md rounded-bl-md': !context.selected,
'rounded-br-0 rounded-bl-0 text-gray-800': context.selected
} // Condition
)
};
},
headerIcon: 'inline-block mr-2',
headerTitle: 'leading-none',
content: {
className: classNames('p-5 border border-gray-300 bg-white text-gray-700 border-t-0 rounded-tl-none rounded-tr-none rounded-br-lg rounded-bl-lg', 'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80' // Dark mode
)
},
transition: TRANSITIONS.toggleable
}
},
card: {
root: {
className: classNames('bg-white text-gray-700 shadow-md rounded-md',
// Background, text color, box shadow, and border radius.
'dark:bg-gray-900 dark:text-white ' //dark
)
},
body: 'p-5',
// Padding.
title: 'text-2xl font-bold mb-2',
// Font size, font weight, and margin bottom.
subTitle: {
className: classNames('font-normal mb-2 text-gray-600',
// Font weight, margin bottom, and text color.
'dark:text-white/60 ' //dark
)
},
content: 'py-5',
// Vertical padding.
footer: 'pt-5' // Top padding.
},
divider: {
root: function root(_ref4) {
var props = _ref4.props;
return {
className: classNames('flex relative',
// alignments.
{
'w-full my-5 mx-0 py-0 px-5 before:block before:left-0 before:absolute before:top-1/2 before:w-full before:border-t before:border-gray-300 before:dark:border-blue-900/40': props.layout == 'horizontal',
// Padding and borders for horizontal layout.
'min-h-full mx-4 md:mx-5 py-5 before:block before:min-h-full before:absolute before:left-1/2 before:top-0 before:transform before:-translate-x-1/2 before:border-l before:border-gray-300 before:dark:border-blue-900/40': props.layout == 'vertical' // Padding and borders for vertical layout.
}, {
'before:border-solid': props.type == 'solid',
'before:border-dotted': props.type == 'dotted',
'before:border-dashed': props.type == 'dashed'
} // Border type condition.
)
};
},
content: 'px-1 bg-white z-10 dark:bg-gray-900' // Padding and background color.
},
fieldset: {
root: {
className: classNames('border border-gray-300 bg-white text-gray-700 rounded-md block mx-2 my-0.5 pl-4 pr-5 inline-size-min',
// Borders, background, text color, spacing, and inline size.
'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80' //dark
)
},
legend: function legend(_ref5) {
var props = _ref5.props;
return {
className: classNames('border border-gray-300 text-gray-700 bg-gray-50 font-bold rounded-md', 'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80 ',
//dark
{
'p-0 transition-none hover:bg-gray-100 hover:border-gray-300 hover:text-gray-900 dark:hover:text-white/80 dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]': props.toggleable,
'p-5': !props.toggleable
})
};
},
toggler: function toggler(_ref6) {
var props = _ref6.props;
return {
className: classNames('flex items-center justify-center', {
'p-5 text-gray-700 rounded-md transition-none cursor-pointer overflow-hidden relative select-none hover:text-gray-900 focus:focus:shadow-[inset_0_0_0_0.2rem_rgba(191,219,254,1)] dark:text-white/80 dark:hover:text-white/80 dark:hover:bg-gray-800/60 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]': props.toggleable
})
};
},
togglerIcon: 'mr-2 inline-block',
// Margin and display style.
legendTitle: 'flex items-center justify-center leading-none',
// alignments, and leading style.
content: 'p-5',
// Padding.
transition: TRANSITIONS.toggleable
},
scrollpanel: {
wrapper: 'overflow-hidden relative float-left h-full w-full z-[1]',
content: 'box-border h-[calc(100%+18px)] overflow-scroll pr-[18px] pb-[18px] pl-0 pt-0 relative scrollbar-none w-[calc(100%+18px)] [&::-webkit-scrollbar]:hidden',
barX: {
className: classNames('relative bg-gray-100 invisible rounded cursor-pointer h-[9px] bottom-0 z-[2]', 'transition duration-[250ms] ease-linear')
},
barY: {
className: classNames('relative bg-gray-100 rounded cursor-pointer w-[9px] top-0 z-[2]', 'transition duration-[250ms] ease-linear')
}
},
tabview: {
navContainer: function navContainer(_ref7) {
var props = _ref7.props;
return {
className: classNames('relative',
// Relative positioning.
{
'overflow-hidden': props.scrollable
} // Overflow condition.
)
};
},
navContent: 'overflow-y-hidden overscroll-contain overscroll-auto scroll-smooth [&::-webkit-scrollbar]:hidden',
// Overflow and scrollbar styles.
previousButton: {
className: classNames('h-full flex items-center justify-center !absolute top-0 z-20', 'left-0', 'bg-white text-blue-500 w-12 shadow-md rounded-none', 'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80 )') // Flex and absolute positioning styles.
},
nextButton: {
className: classNames('h-full flex items-center justify-center !absolute top-0 z-20', 'right-0', 'bg-white text-blue-500 w-12 shadow-md rounded-none', 'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80 ') // Flex and absolute positioning styles.
},
nav: {
className: classNames('flex flex-1 list-none m-0 p-0', 'bg-transparent border border-gray-300 border-0 border-b-2', 'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80 ') // Flex, list, margin, padding, and border styles.
}
},
tabpanel: {
header: function header(_ref8) {
var props = _ref8.props;
return {
className: classNames('mr-0', {
'cursor-default pointer-events-none select-none user-select-none opacity-60': props === null || props === void 0 ? void 0 : props.disabled
}) // Margin and condition-based styles.
};
},
headerAction: function headerAction(_ref9) {
var parent = _ref9.parent,
context = _ref9.context;
return {
className: classNames('items-center cursor-pointer flex overflow-hidden relative select-none text-decoration-none user-select-none',
// Flex and overflow styles.
'border-b-2 p-5 font-bold rounded-t-md transition-shadow duration-200 m-0',
// Border, padding, font, and transition styles.
'transition-colors duration-200',
// Transition duration style.
'focus:outline-none focus:outline-offset-0 focus:shadow-[inset_0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]',
// Focus styles.
{
'border-gray-300 bg-white text-gray-700 hover:bg-white hover:border-gray-400 hover:text-gray-600 dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80 dark:hover:bg-gray-800/80': parent != null ? parent.state.activeIndex !== context.index : true,
// Condition-based hover styles.
'bg-white border-blue-500 text-blue-500 dark:bg-gray-900 dark:border-blue-300 dark:text-blue-300': parent != null ? parent.state.activeIndex === context.index : false // Condition-based active styles.
}),
style: {
marginBottom: '-2px'
} // Negative margin style.
};
},
headerTitle: {
className: classNames('leading-none whitespace-nowrap') // Leading and whitespace styles.
},
content: {
className: classNames('bg-white p-5 border-0 text-gray-700 rounded-bl-md rounded-br-md', 'dark:bg-gray-900 dark:border-blue-900/40 dark:text-white/80') // Background, padding, border, and text styles.
}
},
splitter: {
root: function root(_ref10) {
var props = _ref10.props,
state = _ref10.state;
return {
className: classNames('flex flex-nowrap bg-white dark:bg-gray-900 rounded-lg text-gray-700 dark:text-white/80', {
'border border-solid border-gray-300 dark:border-blue-900/40': !state.nested,
'flex-col': props.layout === 'vertical'
})
};
},
gutter: function gutter(_ref11) {
var props = _ref11.props;
return {
className: classNames('flex items-center justify-center shrink-0', 'transition-all duration-200 bg-gray-100 dark:bg-gray-800', {
'cursor-col-resize': props.layout == 'horizontal',
'cursor-row-resize': props.layout !== 'horizontal'
})
};
},
gutterHandler: function gutterHandler(_ref12) {
var props = _ref12.props;
return {
className: classNames('bg-gray-300 dark:bg-gray-600 transition-all duration-200', {
'h-7 w-[0.3rem]': props.layout == 'horizontal',
'w-7 h-[0.3rem]': props.layout == 'vertical'
})
};
}
},
dialog: {
root: function root(_ref13) {
var state = _ref13.state;
return {
className: classNames('rounded-lg shadow-lg border-0', 'max-h-[90%] transform scale-100', 'm-0 w-[50vw]', 'dark:border dark:border-blue-900/40', {
'transition-none transform-none !w-screen !h-screen !max-h-full !top-0 !left-0': state.maximized
})
};
},
header: {
className: classNames('flex items-center justify-between shrink-0', 'bg-white text-gray-800 border-t-0 rounded-tl-lg rounded-tr-lg p-6', 'dark:bg-gray-900 dark:text-white/80')
},
headerTitle: 'font-bold text-lg',
headerIcons: 'flex items-center',
closeButton: {
className: classNames('flex items-center justify-center overflow-hidden relative', 'w-8 h-8 text-gray-500 border-0 bg-transparent rounded-full transition duration-200 ease-in-out mr-2 last:mr-0', 'hover:text-gray-700 hover:border-transparent hover:bg-gray-200', 'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)]',
// focus
'dark:hover:text-white/80 dark:hover:border-transparent dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]')
},
closeButtonIcon: 'w-4 h-4 inline-block',
content: function content(_ref14) {
var props = _ref14.props,
state = _ref14.state;
return {
className: classNames('overflow-y-auto', 'bg-white text-gray-700 px-6 pb-8 pt-0', {
'rounded-bl-lg rounded-br-lg': !props.footer
}, 'dark:bg-gray-900 dark:text-white/80 ', {
grow: state.maximized
})
};
},
footer: {
className: classNames('flex gap-2 shrink-0 justify-end align-center', 'border-t-0 bg-white text-gray-700 px-6 pb-6 text-right rounded-b-lg', 'dark:bg-gray-900 dark:text-white/80')
},
mask: function mask(_ref15) {
var state = _ref15.state;
return {
className: classNames('transition duration-200', {
'bg-black/40': state.containerVisible
})
};
},
transition: function transition(_ref16) {
var props = _ref16.props;
return {
timeout: 200,
classNames: props.position === 'top' ? {
enter: 'opacity-0 scale-75 translate-x-0 -translate-y-full translate-z-0',
enterActive: '!opacity-100 !scale-100 !translate-y-0 transition-all duration-200 ease-out',
exit: 'opacity-100 scale-100 transition-all duration-200 ease-out',
exitActive: '!opacity-0 !scale-75 translate-x-0 -translate-y-full translate-z-0'
} : props.position === 'bottom' ? {
enter: 'opacity-0 scale-75 translate-y-full',
enterActive: '!opacity-100 !scale-100 !translate-y-0 transition-all duration-200 ease-out',
exit: 'opacity-100 scale-100 transition-all duration-200 ease-out',
exitActive: '!opacity-0 !scale-75 translate-x-0 translate-y-full translate-z-0'
} : props.position === 'left' || props.position === 'top-left' || props.position === 'bottom-left' ? {
enter: 'opacity-0 scale-75 -translate-x-full translate-y-0 translate-z-0',
enterActive: '!opacity-100 !scale-100 !translate-x-0 transition-all duration-200 ease-out',
exit: 'opacity-100 scale-100 transition-all duration-200 ease-out',
exitActive: '!opacity-0 !scale-75 -translate-x-full translate-y-0 translate-z-0'
} : props.position === 'right' || props.position === 'top-right' || props.position === 'bottom-right' ? {
enter: 'opacity-0 scale-75 translate-x-full translate-y-0 translate-z-0',
enterActive: '!opacity-100 !scale-100 !translate-x-0 transition-all duration-200 ease-out',
exit: 'opacity-100 scale-100 transition-all duration-200 ease-out',
exitActive: '!opacity-0 !scale-75 translate-x-full translate-y-0 translate-z-0'
} : {
enter: 'opacity-0 scale-75',
enterActive: '!opacity-100 !scale-100 transition-all duration-200 ease-out',
exit: 'opacity-100 scale-100 transition-all duration-200 ease-out',
exitActive: '!opacity-0 !scale-75'
}
};
}
},
confirmdialog: {
root: {
className: classNames('bg-white text-gray-700 border-0 rounded-md shadow-lg', 'z-40 transform origin-center', 'mt-3 absolute left-0 top-0', 'before:absolute before:w-0 before:-top-3 before:h-0 before:border-transparent before:border-solid before:ml-6 before:border-x-[0.75rem] before:border-b-[0.75rem] before:border-t-0 before:border-b-white dark:before:border-b-gray-900', 'dark:border dark:border-blue-900/40 dark:bg-gray-900 dark:text-white/80')
},
content: 'p-5 items-center flex',
icon: 'text-2xl',
message: 'ml-4',
footer: 'flex gap-2 justify-end align-center text-right px-5 py-5 pt-0',
transition: TRANSITIONS.overlay
},
confirmpopup: {
root: {
className: classNames('bg-white text-gray-700 border-0 rounded-md shadow-lg', 'z-40 transform origin-center', 'mt-3 absolute left-0 top-0', 'before:absolute before:w-0 before:-top-3 before:h-0 before:border-transparent before:border-solid before:ml-6 before:border-x-[0.75rem] before:border-b-[0.75rem] before:border-t-0 before:border-b-white dark:before:border-b-gray-900', 'dark:border dark:border-blue-900/40 dark:bg-gray-900 dark:text-white/80')
},
content: 'p-5 items-center flex',
icon: 'text-2xl',
message: 'ml-4',
footer: 'flex gap-2 justify-end align-center text-right px-5 py-5 pt-0',
transition: TRANSITIONS.overlay
},
overlaypanel: {
root: {
className: classNames('bg-white text-gray-700 border-0 rounded-md shadow-lg', 'z-40 transform origin-center', 'absolute left-0 top-0 mt-3', 'before:absolute before:w-0 before:-top-3 before:h-0 before:border-transparent before:border-solid before:ml-6 before:border-x-[0.75rem] before:border-b-[0.75rem] before:border-t-0 before:border-b-white dark:before:border-b-gray-900', 'dark:border dark:border-blue-900/40 dark:bg-gray-900 dark:text-white/80')
},
closeButton: 'flex items-center justify-center overflow-hidden absolute top-0 right-0 w-6 h-6',
content: 'p-5 items-center flex',
transition: TRANSITIONS.overlay
},
sidebar: {
root: function root(_ref17) {
var props = _ref17.props;
return {
className: classNames('flex flex-col pointer-events-auto relative transform relative', 'bg-white text-gray-700 border-0 shadow-lg', {
'!transition-none !transform-none !w-screen !h-screen !max-h-full !top-0 !left-0': props.fullScreen,
'h-full w-80': props.position == 'left' || props.position == 'right',
'h-40 w-full': props.position == 'top' || props.position == 'bottom'
}, 'dark:border dark:border-blue-900/40 dark:bg-gray-900 dark:text-white/80')
};
},
header: {
className: classNames('flex items-center justify-end', 'p-5')
},
closeButton: {
className: classNames('flex items-center justify-center overflow-hidden relative', 'w-8 h-8 text-gray-500 border-0 bg-transparent rounded-full transition duration-200 ease-in-out mr-2 last:mr-0', 'hover:text-gray-700 hover:border-transparent hover:bg-gray-200', 'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)]',
// focus
'dark:hover:text-white/80 dark:hover:text-white/80 dark:hover:border-transparent dark:hover:bg-gray-800/80 dark:focus:shadow-[inset_0_0_0_0.2rem_rgba(147,197,253,0.5)]')
},
closeButtonIcon: 'w-4 h-4 inline-block',
content: {
className: classNames('p-5 pt-0 h-full w-full', 'grow overflow-y-auto')
},
mask: {
className: classNames('flex pointer-events-auto', 'bg-black bg-opacity-40 transition duration-200 z-20 transition-colors')
},
transition: function transition(_ref18) {
var props = _ref18.props;
return {
timeout: 300,
classNames: props.fullScreen ? {
enter: 'opacity-0',
enterActive: '!opacity-100 transition-opacity duration-300 ease-in',
exit: 'opacity-100 transition-opacity duration-300 ease-in',
exitActive: '!opacity-0'
} : props.position === 'top' ? {
enter: 'translate-x-0 -translate-y-full translate-z-0',
enterActive: '!translate-y-0 transition-transform duration-300',
exit: 'translate-y-0 transition-transform duration-300',
exitActive: 'translate-x-0 !-translate-y-full translate-z-0'
} : props.position === 'bottom' ? {
enter: 'translate-x-0 translate-y-full translate-z-0',
enterActive: '!translate-y-0 transition-transform duration-300',
exit: 'translate-y-0 transition-transform duration-300',
exitActive: 'translate-x-0 !translate-y-full translate-z-0'
} : props.position === 'left' ? {
enter: '-translate-x-full translate-y-0 translate-z-0',
enterActive: '!translate-x-0 transition-transform duration-300',
exit: 'translate-x-0 transition-transform duration-300',
exitActive: '!-translate-x-full translate-y-0 translate-z-0'
} : props.position === 'right' ? {
enter: 'translate-x-full translate-y-0 translate-z-0',
enterActive: '!translate-x-0 transition-transform duration-300',
exit: 'translate-x-0 transition-transform duration-300',
exitActive: '!translate-x-full translate-y-0 translate-z-0'
} : undefined
};
}
},
toolbar: {
root: {
className: classNames('flex items-center justify-between flex-wrap', 'bg-gray-100 dark:bg-gray-800 border border-gray-300 dark:border-blue-900/40 p-5 rounded-md gap-2')
},
start: 'flex items-center',
center: 'flex items-center',
end: 'flex items-center'
},
tooltip: {
root: function root(_ref19) {
var context = _ref19.context;
return {
className: classNames('absolute shadow-md', {
'py-0 px-1': context.right || context.left || !context.right && !context.left && !context.top && !context.bottom,
'py-1 px-0': context.top || context.bottom
})
};
},
arrow: function arrow(_ref20) {
var context = _ref20.context;
return {
className: classNames('absolute w-0 h-0 border-transparent border-solid', {
'-mt-1 border-y-[0.25rem] border-r-[0.25rem] border-l-0 border-r-gray-600': context.right,
'-mt-1 border-y-[0.25rem] border-l-[0.25rem] border-r-0 border-l-gray-600': context.left,
'-ml-1 border-x-[0.25rem] border-t-[0.25rem] border-b-0 border-t-gray-600': context.top,
'-ml-1 border-x-[0.25rem] border-b-[0.25rem] border-t-0 border-b-gray-600': context.bottom
})
};
},
text: {
className: 'p-3 bg-gray-600 text-white rounded-md whitespace-pre-line break-words'
}
},
//UPLOAD
fileupload: {
input: 'hidden',
buttonbar: {
className: classNames('flex flex-wrap', 'bg-gray-50 dark:bg-gray-800 p-5 border border-solid border-gray-300 dark:border-blue-900/40 text-gray-700 dark:text-white/80 rounded-tr-lg rounded-tl-lg gap-2 border-b-0')
},
basicButton: {
className: classNames('text-white bg-blue-500 border border-blue-500 p-3 px-5 rounded-md text-base', 'overflow-hidden relative')
},
chooseButton: {
className: classNames('text-white bg-blue-500 border border-blue-500 p-3 px-5 rounded-md text-base', 'overflow-hidden relative')
},
chooseIcon: 'mr-2 inline-block',
chooseButtonLabel: 'flex-1 font-bold',
uploadButton: {
icon: 'mr-2'
},
cancelButton: {
icon: 'mr-2'
},
content: {
className: classNames('relative', 'bg-white dark:bg-gray-900 p-8 border border-gray-300 dark:border-blue-900/40 text-gray-700 dark:text-white/80 rounded-b-lg')
},
file: {
className: classNames('flex items-center flex-wrap', 'p-4 border border-gray-300 dark:border-blue-900/40 rounded gap-2 mb-2', 'last:mb-0')
},
thumbnail: 'shrink-0',
fileName: 'mb-2',
fileSize: 'mr-2',
uploadIcon: 'mr-2'
},
//Messages
messages: {
root: function root(_ref21) {
var state = _ref21.state,
index = _ref21.index;
return {
className: classNames('my-4 rounded-md', {
'bg-blue-100 border-solid border-0 border-l-4 border-blue-500 text-blue-700': state.messages[index] && state.messages[index].message.severity == 'info',
'bg-green-100 border-solid border-0 border-l-4 border-green-500 text-green-700': state.messages[index] && state.messages[index].message.severity == 'success',
'bg-orange-100 border-solid border-0 border-l-4 border-orange-500 text-orange-700': state.messages[index] && state.messages[index].message.severity == 'warn',
'bg-red-100 border-solid border-0 border-l-4 border-red-500 text-red-700': state.messages[index] && state.messages[index].message.severity == 'error'
})
};
},
wrapper: 'flex items-center py-5 px-7',
icon: {
className: classNames('w-6 h-6', 'text-lg mr-2')
},
text: 'text-base font-normal',
button: {
className: classNames('w-8 h-8 rounded-full bg-transparent transition duration-200 ease-in-out', 'ml-auto overflow-hidden relative', 'flex items-center justify-center', 'hover:bg-white/30')
},
transition: {
timeout: 300,
classNames: {
enter: 'max-h-0 opacity-0',
enterActive: '!max-h-40 !opacity-100 overflow-hidden transition-all duration-300',
exit: 'max-h-40 opacity-100',
exitActive: '!max-h-0 !opacity-0 !m-0 overflow-hidden transition-all duration-300 ease-in'
}
}
},
message: {
root: function root(_ref22) {
var props = _ref22.props;
return {
className: classNames('inline-flex items-center justify-center align-top', 'p-3 m-0 rounded-md', {
'bg-blue-100 border-0 text-blue-700': props.severity == 'info',
'bg-green-100 border-0 text-green-700': props.severity == 'success',
'bg-orange-100 border-0 text-orange-700': props.severity == 'warn',
'bg-red-100 border-0 text-red-700': props.severity == 'error'
})
};
},
icon: 'text-base mr-2'
},
toast: {
root: {
className: classNames('w-96', 'opacity-90')
},
message: function message(_ref23) {
var state = _ref23.state,
index = _ref23.index;
return {
className: classNames('my-4 rounded-md w-full', {
'bg-blue-100 border-solid border-0 border-l-4 border-blue-500 text-blue-700': state.messages[index] && state.messages[index].message.severity == 'info',
'bg-green-100 border-solid border-0 border-l-4 border-green-500 text-green-700': state.messages[index] && state.messages[index].message.severity == 'success',
'bg-orange-100 border-solid border-0 border-l-4 border-orange-500 text-orange-700': state.messages[index] && state.messages[index].message.severity == 'warn',
'bg-red-100 border-solid border-0 border-l-4 border-red-500 text-red-700': state.messages[index] && state.messages[index].message.severity == 'error'
})
};
},
content: 'flex items-center py-5 px-7',
icon: {
className: classNames('w-6 h-6', 'text-lg mr-2')
},
text: 'text-base font-normal flex flex-col flex-1 grow shrink ml-4',
summary: 'font-bold block',
detail: 'mt-1 block',
closeButton: {
className: classNames('w-8 h-8 rounded-full bg-transparent transition duration-200 ease-in-out', 'ml-auto overflow-hidden relative', 'flex items-center justify-center', 'hover:bg-white/30')
},
transition: {
timeout: {
enter: 300,
exit: 500
},
classNames: {
enter: 'opacity-0 max-h-0 translate-x-0 translate-y-2/4 translate-z-0',
enterActive: '!max-h-40 !opacity-90 !translate-y-0 transition-transform transition-opacity duration-300',
exit: 'max-h-40 opacity-90',
exitActive: '!max-h-0 !opacity-0 !mb-0 overflow-hidden transition-all duration-500 ease-in'
}
}
},
//BUTTONS
button: {
root: function root(_ref24) {
var props = _ref24.props,
context = _ref24.context;
return {
className: classNames('items-center cursor-pointer inline-flex overflow-hidden relative select-none text-center align-bottom', 'transition duration-200 ease-in-out', 'focus:outline-none focus:outline-offset-0', {
'text-white dark:text-gray-900 bg-blue-500 dark:bg-blue-400 border border-blue-500 dark:border-blue-400 hover:bg-blue-600 dark:hover:bg-blue-500 hover:border-blue-600 dark:hover:border-blue-500 focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(157,193,251,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(147,197,253,0.7),0_1px_2px_0_rgba(0,0,0,0)]': !props.link && props.severity === null && !props.text && !props.outlined && !props.plain,
'text-blue-600 bg-transparent border-transparent focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(157,193,251,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(147,197,253,0.7),0_1px_2px_0_rgba(0,0,0,0)]': props.link
}, {
'focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(176,185,198,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(203,213,225,0.7),0_1px_2px_0_rgba(0,0,0,0)]': props.severity === 'secondary',
'focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(136,234,172,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(134,239,172,0.7),0_1px_2px_0_rgba(0,0,0,0)]': props.severity === 'success',
'focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(157,193,251,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(147,197,253,0.7),0_1px_2px_0_rgba(0,0,0,0)]': props.severity === 'info',
'focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(250,207,133,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(252,211,77,0.7),0_1px_2px_0_rgba(0,0,0,0)]': props.severity === 'warning',
'focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(212,170,251,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(216,180,254,0.7),0_1px_2px_0_rgba(0,0,0,0)]': props.severity === 'help',
'focus:shadow-[0_0_0_2px_rgba(255,255,255,1),0_0_0_4px_rgba(247,162,162,1),0_1px_2px_0_rgba(0,0,0,1)] dark:focus:shadow-[0_0_0_2px_rgba(28,33,39,1),0_0_0_4px_rgba(252,165,165,0.7),0_1px_2px_0_rgba(0,0,0,0)]': props.severity === 'danger'
}, {
'text-white dark:text-gray-900 bg-gray-500 dark:bg-gray-400 border border-gray-500 dark:border-gray-400 hover:bg-gray-600 dark:hover:bg-gray-500 hover:border-gray-600 dark:hover:border-gray-500': props.severity === 'secondary' && !props.text && !props.outlined && !props.plain,
'text-white dark:text-gray-900 bg-green-500 dark:bg-green-400 border border-green-500 dark:border-green-400 hover:bg-green-600 dark:hover:bg-green-500 hover:border-green-600 dark:hover:border-green-500': props.severity === 'success' && !props.text && !props.outlined && !props.plain,
'text-white dark:text-gray-900 dark:bg-blue-400 bg-blue-500 dark:bg-blue-400 border border-blue-500 dark:border-blue-400 hover:bg-blue-600 hover:border-blue-600 dark:hover:bg-blue-500 dark:hover:border-blue-500': props.severity === 'info' && !props.text && !props.outlined && !props.plain,
'text-white dark:text-gray-900 bg-orange-500 dark:bg-orange-400 border border-orange-500 dark:border-orange-400 hover:bg-orange-600 dark:hover:bg-orange-500 hover:border-orange-600 dark:hover:border-orange-500': props.severity === 'warning' && !props.text && !props.outlined && !props.plain,
'text-white dark:text-gray-900 bg-purple-500 dark:bg-purple-400 border border-purple-500 dark:border-purple-400 hover:bg-purple-600 dark:hover:bg-purple-500 hover:border-purple-600 dark:hover:border-purple-500': props.severity === 'help' && !props.text && !props.outlined && !props.plain,
'text-white dark:text-gray-900 bg-red-500 dark:bg-red-400 border border-red-500 dark:border-red-400 hover:bg-red-600 dark:hover:bg-red-500 hover:border-red-600 dark:hover:border-red-500': props.severity === 'danger' && !props.text && !props.outlined && !props.plain
}, {
'shadow-lg': props.raised
}, {
'rounded-md': !props.rounded,
'rounded-full': props.rounded
}, {
'bg-transparent border-transparent': props.text && !props.plain,
'text-blue-500 dark:text-blue-400 hover:bg-blue-300/20': props.text && (props.severity === null || props.severity === 'info') && !props.plain,
'text-gray-500 dark:text-gray-400 hover:bg-gray-300/20': props.text && props.severity === 'secondary' && !props.plain,
'text-green-500 dark:text-green-400 hover:bg-green-300/20': props.text && props.severity === 'success' && !props.plain,
'text-orange-500 dark:text-orange-400 hover:bg-orange-300/20': props.text && props.severity === 'warning' && !props.plain,
'text-purple-500 dark:text-purple-400 hover:bg-purple-300/20': props.text && props.severity === 'help' && !props.plain,
'text-red-500 dark:text-red-400 hover:bg-red-300/20': props.text && props.severity === 'danger' && !props.plain
}, {
'shadow-lg': props.raised && props.text
}, {
'text-gray-500 hover:bg-gray-300/20': props.plain & props.text,
'text-gray-500 border border-gray-500 hover:bg-gray-300/20': props.plain & props.outlined,
'text-white bg-gray-500 border border-gray-500 hover:bg-gray-600 hover:border-gray-600': props.plain & !props.outlined & !props.text
}, {
'bg-transparent border': props.outlined && !props.plain,
'text-blue-500 dark:text-blue-400 border border-blue-500 dark:border-blue-400 hover:bg-blue-300/20': props.outlined && (props.severity === null || props.severity === 'info') && !props.plain,
'text-gray-500 dark:text-gray-400 border border-gray-500 dark:border-gray-400 hover:bg-gray-300/20': props.outlined && props.severity === 'secondary' && !props.plain,
'text-green-500 dark:text-green-400 border border-green-500 dark:border-green-400 hover:bg-green-300/20': props.outlined && props.severity === 'success' && !props.plain,
'text-orange-500 dark:text-orange-400 border border-orange-500 dark:border-orange-400 hover:bg-orange-300/20': props.outlined && props.severity === 'warning' && !props.plain,
'text-purple-500 dark:text-purple-400 border border-purple-500 dark:border-purple-400 hover:bg-purple-300/20': props.outlined && props.severity === 'help' && !props.plain,
'text-red-500 dark:text-red-400 border border-red-500 dark:border-red-400 hover:bg-red-300/20': props.outlined && props.severity === 'danger' && !props.plain
}, {
'px-4 py-3 text-base': props.size === null,
'text-xs py-2 px-3': props.size === 'small',
'text-xl py-3 px-4': props.size === 'large'
}, {
'flex-column': props.iconPos == 'top' || props.iconPos == 'bottom'
}, {
'opacity-60 pointer-events-none cursor-default': context === null || context === void 0 ? void 0 : context.disabled
})
};
},
label: function label(_ref25) {
var props = _ref25.props;
return {
className: classNames('flex-1', 'duration-200', 'font-bold', {
'hover:underline': props.link
}, {
'invisible w-0': props.label == null
})
};
},
icon: function icon(_ref26) {
var props = _ref26.props;
return {
className: classNames('mx-0', {
'mr-2': props.iconPos == 'left' && props.label != null,
'ml-2 order-1': props.iconPos == 'right' && props.label != null,
'mb-2': props.iconPos == 'top' && props.label != null,
'mt-2 order-2': props.iconPos == 'bottom' && props.label != null
})
};
},
loadingIcon: function loadingIcon(_ref27) {
var props = _ref27.props;
return {
className: classNames('mx-0', {
'mr-2': props.loading && props.iconPos == 'left' && props.label != null,
'ml-2 order-1': props.loading && props.iconPos == 'right' && props.label != null,
'mb-2': props.loading && props.iconPos == 'top' && props.label != null,
'mt-2 order-2': props.loading && props.iconPos == 'bottom' && props.label != null
})
};
},
badge: function badge(_ref28) {
var props = _ref28.props;
return {
className: classNames({
'ml-2 w-4 h-4 leading-none flex items-center justify-center': props.badge
})
};
}
},
speeddial: {
root: 'absolute flex',
button: {
root: function root(_ref29) {
var parent = _ref29.parent;
return {
className: classNames('w-16 !h-16 !rounded-full justify-center z-10', {
'rotate-45': parent.state.visible
})
};
},
label: {
className: 'hidden'
}
},
menu: 'm-0 p-0 list-none flex items-center justify-center transition delay-200 z-20',
menuitem: function menuitem(_ref30) {
var props = _ref30.props,
state = _ref30.state;
return {
className: classNames('transform transition-transform duration-200 ease-out transition-opacity duration-800', !state.visible ? 'opacity-0 scale-0' : 'opacity-1 scale-100', {
'my-1 first:mb-2': props.direction == 'up' && props.type == 'linear',
'my-1 first:mt-2': props.direction == 'down' && props.type == 'linear',
'mx-1 first:mr-2': props.direction == 'left' && props.type == 'linear',
'mx-1 first:ml-2': props.direction == 'right' && props.type == 'linear'
}, {
absolute: props.type !== 'linear'
})
};
},
action: {
className: classNames('flex items-center justify-center rounded-full relative overflow-hidden', 'w-12 h-12 bg-gray-700 hover:bg-gray-800 text-white')
},
mask: function mask(_ref31) {
var state = _ref31.state;
return {
className: classNames('absolute left-0 top-0 w-full h-full transition-opacity duration-250 ease-in-out bg-black/40 z-0', {
'opacity-0': !state.visible,
'pointer-events-none opacity-100 transition-opacity duration-400 ease-in-out': state.visible
})
};
}
},
splitbutton: {
root: function root(_ref32) {
var props = _ref32.props;
return {
className: classNames('inline-flex relative', 'rounded-md', {
'shadow-lg': props.raised
})
};
},
button: {
root: function root(_ref33) {
var parent = _ref33.parent;
return {
className: classNames('rounded-r-none border-r-0', {
'rounded-l-full': parent.props.rounded
})
};
},
icon: 'mr-2'
},
menu: {
className: classNames('outline-none', 'py-1 px-0 rounded-md list-none bg-white border-none shadow-lg')
},
menuList: 'm-0 p-0 border-none outline-none no-underline list-none',
menuButton: {
root: function root(_ref34) {
var parent = _ref34.parent;
return {
className: classNames('rounded-l-none', {
'rounded-r-full': parent.props.rounded
})
};
},
label: 'hidden'
},
anchor: 'cursor-pointer flex items-center relative overflow-hidden py-3 px-5 rounded-none transition select-none hover:text-gray-700 hover:bg-gray-200',
menuIcon: 'mr-2'
},
//FORMS
inputtext: {
root: function root(_ref35) {
var props = _ref35.props,
context = _ref35.context;
return {
className: classNames('m-0', 'font-sans text-gray-600 dark:text-white/80 bg-white dark:bg-gray-900 border transition-colors duration-200 appearance-none rounded-lg', {
'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]': !context.disabled,
'hover:border-blue-500': !props.invalid && !context.disabled,
'opacity-60 select-none pointer-events-none cursor-default': context.disabled,
'border-gray-300 dark:border-blue-900/40': !props.invalid,
'border-red-500 hover:border-red-500/80 focus:border-red-500': props.invalid && !context.disabled,
'border-red-500/50': props.invalid && context.disabled
}, {
'text-lg px-4 py-4': props.size === 'large',
'text-xs px-2 py-2': props.size === 'small',
'p-3 text-base': !props.size || typeof props.size === 'number'
}, {
'pl-8': context.iconPosition === 'left',
'pr-8': props.iconPosition === 'right'
})
};
}
},
inputnumber: {
root: 'w-full inline-flex',
input: {
root: function root(_ref36) {
var props = _ref36.props;
return {
className: classNames({
'rounded-tr-none rounded-br-none': props.showButtons && props.buttonLayout == 'stacked'
})
};
}
},
buttonGroup: function buttonGroup(_ref37) {
var props = _ref37.props;
return {
className: classNames({
'flex flex-col': props.showButtons && props.buttonLayout == 'stacked'
})
};
},
incrementButton: function incrementButton(_ref38) {
var props = _ref38.props;
return {
className: classNames('flex !items-center !justify-center', {
'rounded-br-none rounded-bl-none rounded-bl-none !p-0 flex-1 w-[3rem]': props.showButtons && props.buttonLayout == 'stacked'
})
};
},
decrementButton: function decrementButton(_ref39) {
var props = _ref39.props;
return {
className: classNames('flex !items-center !justify-center', {
'rounded-tr-none rounded-tl-none rounded-tl-none !p-0 flex-1 w-[3rem]': props.showButtons && props.buttonLayout == 'stacked'
})
};
}
},
knob: {
root: function root(_ref40) {
var props = _ref40.props;
return {
className: classNames('focus:outline-none focus:outline-offset-0 focus:shadow-0', {
'opacity-60 select-none pointer-events-none cursor-default': props.disabled
})
};
},
range: 'stroke-current transition duration-100 ease-in stroke-gray-200 dark:stroke-gray-700 fill-none',
value: 'animate-dash-frame stroke-blue-500 fill-none',
label: 'text-center text-xl'
},
inputswitch: {
root: function root(_ref41) {
var props = _ref41.props;
return {
className: classNames('inline-block relative', 'w-12 h-7', {
'opacity-60 select-none pointer-events-none cursor-default': props.disabled
})
};
},
input: {
className: classNames('absolute appearance-none top-0 left-0 size-full p-0 m-0 opacity-0 z-10 outline-none cursor-pointer')
},
slider: function slider(_ref42) {
var props = _ref42.props;
return {
className: classNames('absolute cursor-pointer top-0 left-0 right-0 bottom-0 border border-transparent', 'transition-colors duration-200 rounded-2xl', 'focus:outline-none focus:outline-offset-0 focus:shadow-[0_0_0_0.2rem_rgba(191,219,254,1)] dark:focus:shadow-[0_0_0_0.2rem_rgba(147,197,253,0.5)]', "before:absolute before:content-'' before:top-1/2 before:bg-white before:dark:bg-gray-900 before:w-5 before:h-5 before:left-1 before:-mt-2.5 before:rounded-full before:transition-duration-200", {
'bg-gray-200 dark:bg-gray-800 hover:bg-gray-300 hover:dark:bg-gray-700 ': !props.checked,
'bg-blue-500 before:transform before:translate-x-5': props.checked
})
};
}
},
cascadeselect: {
root: function root(_ref43) {
var props = _ref43.props;
return {
className: classNames('inline-flex cursor-pointer select-none relative', 'bg-white dark:bg-gray-900 border border-gray-300 dark:border-blue-900/40 transition duration-200 ease-in-out rounded-lg', {
'opac