UNPKG

jb-mobile-input

Version:
256 lines (255 loc) 8.37 kB
{ "schemaVersion": "1.0.0", "readme": "README.md", "modules": [ { "kind": "javascript-module", "path": "lib/jb-mobile-input.ts", "declarations": [ { "kind": "class", "description": "Mobile number input web component built on jb-input. It accepts Persian digits, removes non-numeric characters, normalizes Iranian mobile numbers to a 09xxxxxxxxx value, formats display as 09xx xxxxxxx, and adds built-in mobile-number validation.", "name": "JBMobileInputWebComponent", "tagName": "jb-mobile-input", "customElement": true, "superclass": { "name": "JBInputWebComponent", "module": "jb-input" }, "attributes": [ { "name": "value", "description": "Initial or reflected mobile value. Prefer the value property for controlled updates. The stored value is normalized without spaces.", "type": { "text": "string" } }, { "name": "label", "description": "Visible label text and accessible aria label inherited from jb-input.", "type": { "text": "string" } }, { "name": "message", "description": "Helper text shown below the input when no validation error is visible.", "type": { "text": "string" } }, { "name": "name", "description": "Form field name inherited from jb-input.", "type": { "text": "string" } }, { "name": "placeholder", "description": "Placeholder text forwarded to the inner native input.", "type": { "text": "string" } }, { "name": "disabled", "description": "Disables the input.", "type": { "text": "boolean" } }, { "name": "required", "description": "Enables required validation. A string value is used as the required validation message.", "type": { "text": "boolean | string" } }, { "name": "error", "description": "External validation error message inherited from jb-input.", "type": { "text": "string" } }, { "name": "disable-auto-validation", "description": "Stops automatic validation inherited from jb-input.", "type": { "text": "boolean" } }, { "name": "size", "description": "Visual size variant inherited from jb-input.", "type": { "text": "'xs' | 'sm' | 'md' | 'lg' | 'xl'" } } ], "members": [ { "kind": "field", "name": "value", "description": "Canonical normalized value without spaces, for example 09123456789.", "type": { "text": "string" } }, { "kind": "field", "name": "displayValue", "description": "Formatted value rendered in the input, for example 0912 3456789.", "type": { "text": "string" }, "readonly": true }, { "kind": "field", "name": "validation", "description": "jb-validation helper inherited from jb-input with an added mobile-number validation.", "type": { "text": "ValidationHelper<ValidationValue>" }, "readonly": true }, { "kind": "field", "name": "isDirty", "description": "True when current value differs from initialValue.", "type": { "text": "boolean" }, "readonly": true }, { "kind": "field", "name": "validationMessage", "description": "Current native validation message from ElementInternals.", "type": { "text": "string" }, "readonly": true } ], "methods": [ { "name": "checkValidity", "description": "Runs validation without showing the error message.", "return": { "type": { "text": "boolean" } } }, { "name": "reportValidity", "description": "Runs validation and shows the first error message.", "return": { "type": { "text": "boolean" } } }, { "name": "focus", "description": "Focuses the inner native input." }, { "name": "setSelectionRange", "description": "Forwards setSelectionRange to the inner native input." }, { "name": "addStandardValueCallback", "description": "Inherited jb-input standardization extension point. jb-mobile-input already registers its own mobile standardizer." } ], "events": [ { "name": "input", "description": "Dispatched on each user input after value standardization." }, { "name": "change", "description": "Dispatched when the value is committed." }, { "name": "beforeinput", "description": "Cancelable event dispatched before the native input changes." }, { "name": "enter", "description": "Dispatched when Enter is pressed." }, { "name": "invalid", "description": "Dispatched when validation finds an invalid value." } ], "slots": [ { "name": "start-section", "description": "Inherited jb-input slot rendered before the native input." }, { "name": "end-section", "description": "Inherited jb-input slot rendered after the native input." } ], "cssParts": [ { "name": "label", "description": "The label element inherited from jb-input." }, { "name": "input-box", "description": "The wrapper around slots and inner input inherited from jb-input." }, { "name": "input", "description": "The inner native input inherited from jb-input." }, { "name": "message", "description": "The helper or validation message element inherited from jb-input." } ], "cssProperties": [ { "name": "--jb-mobile-input-input-direction", "description": "Direction of the inner input text. Default is ltr." } ] } ], "exports": [ { "kind": "js", "name": "JBMobileInputWebComponent", "declaration": { "name": "JBMobileInputWebComponent", "module": "lib/jb-mobile-input.ts" } }, { "kind": "js", "name": "dictionary", "declaration": { "name": "dictionary", "module": "lib/jb-mobile-input.ts" } }, { "kind": "custom-element-definition", "name": "jb-mobile-input", "declaration": { "name": "JBMobileInputWebComponent", "module": "lib/jb-mobile-input.ts" } } ] } ] }