-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
z-Telephone #3
z-Telephone #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new telephone input component ("ZTelephone") to extend the project's input capabilities.
- Introduces the ZTelephone component and registers it in the main index.
- Demonstrates telephone input usage in the demo (src/inputs.vue).
- Updates related input components (ZText and ZString) to support a prefix property, and adjusts flag display in the country input.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
lib/index.ts | Registers and exports the new ZTelephone component |
src/inputs.vue | Adds telephone input demonstration |
lib/inputs/text.vue | Adds a prefix property to ZText |
lib/inputs/telephone.vue | Implements the new telephone input component |
lib/inputs/string.vue | Adds a prefix property to ZString |
lib/inputs/country.vue | Adjusts flag display property naming |
Comments suppressed due to low confidence (2)
lib/inputs/telephone.vue:25
- [nitpick] Consider using a semicolon instead of a comma to chain function calls in the @clear handler to ensure both functions are executed as intended.
@clear="_setPrefix(), _setFlag()"
lib/inputs/country.vue:18
- [nitpick] The recent changes to the flag display binding (switching from a 'prefix' prop to using '_flag') may be confusing; consider renaming the property (e.g., to 'flagIcon') or adjusting the binding to more clearly reflect its purpose.
:prefix="_flag"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heavily rewritten in my latest commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new telephone input component ("ZTelephone") to support input of international phone numbers using ITU prefixes. Key changes include:
- Adding a new file (lib/inputs/telephone.vue) that implements telephone number parsing and formatting.
- Extending asset data (lib/assets/prefixes.ts) to include ITU prefixes and updating component registrations in lib/index.ts.
- Adjusting existing input components (country.vue, string.vue, text.vue) and demo usage (src/inputs.vue) to support the new telephone input.
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
lib/assets/prefixes.ts | Introduces telephone prefixes with a minor comment typo. |
lib/index.ts | Registers the new ZTelephone component. |
lib/inputs/country.vue | Updates prefix/suffix bindings to correctly display flags. |
lib/inputs/string.vue | Adds support for a prefix prop. |
lib/inputs/telephone.vue | Implements telephone input with phone number parsing logic. |
lib/inputs/text.vue | Updates to include prefix support. |
src/inputs.vue | Demonstrates the new telephone input usage. |
Files not reviewed (1)
- package.json: Language not supported
ZW: [ '263' ], | ||
} as const satisfies Record<ISOCountry, `${number}`[]> | ||
|
||
/** Known ISO countries keyed by ITU prefixe. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in comment: 'prefixe' should be spelled 'prefix'.
/** Known ISO countries keyed by ITU prefixe. */ | |
/** Known ISO countries keyed by ITU prefix. */ |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
import type { ITUPrefix } from '../assets/prefixes' | ||
import type { ZValidator } from '../composition/validators' | ||
|
||
/** Describes a vaild, checked ITU phone prefix */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in comment: 'vaild' should be corrected to 'valid'.
/** Describes a vaild, checked ITU phone prefix */ | |
/** Describes a valid, checked ITU phone prefix */ |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
prefix: ITUPrefix | '' | ||
/** The regional number (that is digits without the country prefix) */ | ||
number: string | ||
/** The normalized number as `+{prefix}{number}` even if invalud */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in comment: 'invalud' should be corrected to 'invalid'.
/** The normalized number as `+{prefix}{number}` even if invalud */ | |
/** The normalized number as `+{prefix}{number}` even if invalid */ |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
No description provided.