Skip to content

Commit

Permalink
Updated NewGen docs: InputMask
Browse files Browse the repository at this point in the history
  • Loading branch information
habubey committed Nov 16, 2022
1 parent 333bc47 commit 6898d8f
Show file tree
Hide file tree
Showing 9 changed files with 267 additions and 233 deletions.
446 changes: 224 additions & 222 deletions components/doc/inputmask/apidoc.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions components/doc/inputmask/basicdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function BasicDoc(props) {
import { useState } from "react";
import { InputMask } from "primereact/inputmask";
export default function BasicDemo() {
export default function BasicDoc() {
const [value, setValue] = useState('');
return (
Expand All @@ -26,7 +26,7 @@ export default function BasicDemo() {
import { useState } from "react";
import { InputMask, InputMaskChangeParams } from "primereact/inputmask";
export default function BasicDemo() {
export default function BasicDoc() {
const [value, setValue] = useState<string>('');
return (
Expand All @@ -39,7 +39,9 @@ export default function BasicDemo() {
return (
<>
<DocSectionText {...props}>
InputMask is used as a controlled input with <i>value</i> and <i>onChange</i> properties, <i>mask</i> property is required to define the mask of the input.
<p>
InputMask is used as a controlled input with <i>value</i> and <i>onChange</i> properties, <i>mask</i> property is required to define the mask of the input.
</p>
</DocSectionText>
<div className="card flex justify-content-center">
<InputMask value={value} onChange={(e) => setValue(e.target.value)} mask="99-999999" placeholder="99-999999" />
Expand Down
4 changes: 3 additions & 1 deletion components/doc/inputmask/disableddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export default function DisabledDemo() {
return (
<>
<DocSectionText {...props}>
<i>disabled</i> prop prevents an input from being editable.
<p>
<i>disabled</i> prop prevents an input from being editable.
</p>
</DocSectionText>
<div className="card flex justify-content-center">
<InputMask mask="99-999999" placeholder="99-999999" disabled />
Expand Down
4 changes: 3 additions & 1 deletion components/doc/inputmask/floatlabeldoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export default function FloatLabelDemo() {
return (
<>
<DocSectionText {...props}>
A floating label is implemented by wrapping the input and the label inside a container having <i>.p-float-label</i> style class.
<p>
A floating label is implemented by wrapping the input and the label inside a container having <i>.p-float-label</i> style class.
</p>
</DocSectionText>
<div className="card flex justify-content-center">
<span className="p-float-label">
Expand Down
4 changes: 3 additions & 1 deletion components/doc/inputmask/invaliddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export default function InvalidDemo() {
return (
<>
<DocSectionText {...props}>
Applying <i>p-invalid</i> class to an input element indicates a failed validation.
<p>
Applying <i>p-invalid</i> class to an input element indicates a failed validation.
</p>
</DocSectionText>
<div className="card flex justify-content-center">
<InputMask mask="99-999999" placeholder="99-999999" className="p-invalid" />
Expand Down
6 changes: 4 additions & 2 deletions components/doc/inputmask/maskdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ export default function MaskDemo() {
return (
<>
<DocSectionText {...props}>
Mask format can be a combination of the the following definitions; <i>a</i> for alphabetic characters, <i>9</i> for numeric characters and * for alphanumberic characters. In addition, formatting characters like <i>(</i> , <i>)</i> ,{' '}
<i>-</i> are also accepted.
<p>
Mask format can be a combination of the the following definitions; <i>a</i> for alphabetic characters, <i>9</i> for numeric characters and * for alphanumberic characters. In addition, formatting characters like <i>(</i> , <i>)</i>{' '}
, <i>-</i> are also accepted.
</p>
</DocSectionText>
<div className="card">
<div className="p-fluid flex flex-column lg:flex-row gap-3">
Expand Down
4 changes: 3 additions & 1 deletion components/doc/inputmask/optionaldoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export default function OptionalDemo() {
return (
<>
<DocSectionText {...props}>
When the input does not complete the mask definition, it is cleared by default. Use <i>autoClear</i> property to control this behavior. In addition, <i>?</i> is used to mark anything after the question mark optional.
<p>
When the input does not complete the mask definition, it is cleared by default. Use <i>autoClear</i> property to control this behavior. In addition, <i>?</i> is used to mark anything after the question mark optional.
</p>
</DocSectionText>
<div className="card flex justify-content-center">
<InputMask value={value} onChange={(e) => setValue(e.target.value)} mask="(999) 999-9999? x999" placeholder="(999) 999-9999? x999" />
Expand Down
4 changes: 3 additions & 1 deletion components/doc/inputmask/slotchardoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export default function SlotCharDemo() {
return (
<>
<DocSectionText {...props}>
Default placeholder for a mask is underscore and it can be customized using <i>slotChart</i> option.
<p>
Default placeholder for a mask is underscore and it can be customized using <i>slotChart</i> option.
</p>
</DocSectionText>
<div className="card flex justify-content-center">
<InputMask value={value} onChange={(e) => setValue(e.target.value)} mask="99/99/9999" placeholder="99/99/9999" slotChar="mm/dd/yyyy" />
Expand Down
20 changes: 19 additions & 1 deletion pages/inputmask/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,25 @@ const InputMaskDemo = () => {
{
id: 'api',
label: 'API',
component: ApiDoc
component: ApiDoc,
children: [
{
id: 'properties',
label: 'Properties'
},
{
id: 'events',
label: 'Events'
},
{
id: 'styling',
label: 'Styling'
},
{
id: 'accessibility',
label: 'Accessibility'
}
]
}
];

Expand Down

0 comments on commit 6898d8f

Please sign in to comment.