Skip to content
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

Merged
merged 15 commits into from
Mar 19, 2025
Merged

z-Telephone #3

merged 15 commits into from
Mar 19, 2025

Conversation

LupeBezz
Copy link
Contributor

No description provided.

@LupeBezz LupeBezz requested a review from pfumagalli March 13, 2025 15:29
@pfumagalli pfumagalli requested a review from Copilot March 13, 2025 19:15

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"
@LupeBezz LupeBezz requested a review from pfumagalli March 17, 2025 09:15
pfumagalli
pfumagalli previously approved these changes Mar 19, 2025
Copy link
Member

@pfumagalli pfumagalli left a 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.

@pfumagalli pfumagalli merged commit 05dc490 into main Mar 19, 2025
1 check passed
@pfumagalli pfumagalli deleted the telephone branch March 19, 2025 14:54
Copy link

@Copilot Copilot AI left a 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. */
Copy link
Preview

Copilot AI Mar 19, 2025

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'.

Suggested change
/** 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.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
import type { ITUPrefix } from '../assets/prefixes'
import type { ZValidator } from '../composition/validators'

/** Describes a vaild, checked ITU phone prefix */
Copy link
Preview

Copilot AI Mar 19, 2025

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'.

Suggested change
/** 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.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
prefix: ITUPrefix | ''
/** The regional number (that is digits without the country prefix) */
number: string
/** The normalized number as `+{prefix}{number}` even if invalud */
Copy link
Preview

Copilot AI Mar 19, 2025

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'.

Suggested change
/** 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.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants