mirror of
https://github.com/plankanban/planka.git
synced 2025-07-25 16:19:47 +02:00
Initial commit
This commit is contained in:
commit
5ffef61fe7
613 changed files with 91659 additions and 0 deletions
28
client/src/lib/custom-ui/components/Input/Input.jsx
Executable file
28
client/src/lib/custom-ui/components/Input/Input.jsx
Executable file
|
@ -0,0 +1,28 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Input as SemanticUIInput } from 'semantic-ui-react';
|
||||
|
||||
import MaskedInput from './MaskedInput';
|
||||
|
||||
const Input = React.forwardRef(({ mask, maskChar, ...props }, ref) => {
|
||||
const nextProps = props;
|
||||
|
||||
if (mask) {
|
||||
nextProps.input = <MaskedInput mask={mask} maskChar={maskChar} />;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
return <SemanticUIInput {...nextProps} ref={ref} />;
|
||||
});
|
||||
|
||||
Input.propTypes = {
|
||||
mask: PropTypes.string,
|
||||
maskChar: PropTypes.string,
|
||||
};
|
||||
|
||||
Input.defaultProps = {
|
||||
mask: undefined,
|
||||
maskChar: undefined,
|
||||
};
|
||||
|
||||
export default React.memo(Input);
|
11
client/src/lib/custom-ui/components/Input/MaskedInput.jsx
Executable file
11
client/src/lib/custom-ui/components/Input/MaskedInput.jsx
Executable file
|
@ -0,0 +1,11 @@
|
|||
import InputMask from 'react-input-mask';
|
||||
|
||||
export default class MaskedInput extends InputMask {
|
||||
focus() {
|
||||
this.getInputDOMNode().focus();
|
||||
}
|
||||
|
||||
select() {
|
||||
this.getInputDOMNode().select();
|
||||
}
|
||||
}
|
3
client/src/lib/custom-ui/components/Input/index.js
Executable file
3
client/src/lib/custom-ui/components/Input/index.js
Executable file
|
@ -0,0 +1,3 @@
|
|||
import Input from './Input';
|
||||
|
||||
export default Input;
|
Loading…
Add table
Add a link
Reference in a new issue