AlaskaAirlines / auro-input

Custom HTML element for inputting string data in forms
https://auro.alaskaair.com/components/auro/input
Apache License 2.0
2 stars 4 forks source link

feat(api): add register static method #343

Closed sun-mota closed 1 week ago

sun-mota commented 2 weeks ago

Alaska Airlines Pull Request

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Resolves: #342

Summary:

AuroInput.register is to easily register the element without extra importing import "@aurodesignsystem/auro-input" will still register this element to <auro-input> import { AuroInput } from '../src/auro-input.js won't register this element until AuroInput.register gets called

Type of change:

Please delete options that are not relevant.

Checklist:

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!
-- Auro Design System Team

Summary by Sourcery

Add a static 'register' method to the AuroInput class to facilitate the registration of custom elements, replacing the previous method of registration. Update documentation to guide users on using the new method for element registration.

New Features:

Enhancements:

Documentation:

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This pull request adds a new static register method to the AuroInput class, simplifying the process of registering the component with a custom name. It also updates the documentation and demo to reflect this new functionality.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Add static register method to AuroInput class
  • Implement register method using AuroLibraryRuntimeUtils.prototype.registerComponent
  • Add JSDoc comments for the new method
  • Remove default internal definition of 'auro-input' custom element
src/auro-input.js
Update documentation to use new register method
  • Replace RuntimeUtils.default.prototype.registerComponent with AuroInput.register
  • Remove import of RuntimeUtils
  • Update code examples in documentation
demo/index.md
docs/partials/index.md
Update demo to use new register method
  • Replace RuntimeUtils.default.prototype.registerComponent with AuroInput.register
  • Remove import of RuntimeUtils
demo/index.html

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
blackfalcon commented 2 days ago

:tada: This PR is included in version 4.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: