'use client' import React, {useRef, useImperativeHandle} from 'react'; import 'jb-time-input'; // eslint-disable-next-line no-duplicate-imports import type {JBTimeInputWebComponent } from 'jb-time-input'; import {type EventProps,useEvents} from './events-hook.js'; import { useJBTimeInputAttribute, type JBTimeInputAttributes } from './attributes-hook.js'; import type { JBElementStandardProps } from 'jb-core/react'; import './module-declaration.js'; // eslint-disable-next-line react/display-name const JBTimeInput = React.forwardRef((props:Props, ref)=>{ const element = useRef(null); useImperativeHandle( ref, () => (element?element.current:undefined), [element], ); // placeholder label message are in other Props const {onBeforeInput,onBlur,onChange,onEnter,onFocus,onInit,onInput,onKeyDown,onKeyPress,onKeyUp,onLoad, disabled,frontalZero,initialValue,optionalUnits,secondEnabled,showPersianNumber,value,validationList,closeButtonText,error,label,message,placeholder, children, ...otherProps} = props; useEvents(element, {onBeforeInput,onBlur,onChange,onEnter,onFocus,onInit,onInput,onKeyDown,onKeyPress,onKeyUp,onLoad}); useJBTimeInputAttribute(element,{disabled,frontalZero,initialValue,optionalUnits,secondEnabled,showPersianNumber,value,validationList}); return ( {children} ); }); JBTimeInput.displayName = "JBTimeInput"; type TimeInputProps = EventProps & JBTimeInputAttributes &{ label?: string | null, closeButtonText?: string | null, error?: string | null, placeholder?: string | null, message?:string | null, } export type Props= TimeInputProps & JBElementStandardProps export {JBTimeInput};