-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): add register static method #21
- `AuroForm.register` is to easily register the element without extra importing - `import '@aurodesignsystem/auro-form'` will still register this element to `<auro-form>` - `import { AuroForm } from '../src/auro-form'` wont register this element until `AuroForm.register` gets called
- Loading branch information
Showing
9 changed files
with
196 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
import '../src/index.js'; | ||
import { AuroForm } from "../src/auro-form.js" | ||
|
||
AuroForm.register(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
import '../src/index.js'; | ||
import { AuroForm } from '../src/auro-form.js'; | ||
|
||
AuroForm.register(); | ||
AuroForm.register('custom-form'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
import { AuroForm } from './auro-form.js'; | ||
|
||
/** | ||
* Register Custom Element. | ||
* @param {Object} name - Name to use for custom element. | ||
* @returns {void} | ||
*/ | ||
const registerComponent = (name = 'custom-form') => { | ||
// alias definition | ||
if (!customElements.get(name)) { | ||
customElements.define(name, class extends AuroForm {}); | ||
} | ||
}; | ||
|
||
export { registerComponent }; | ||
AuroForm.register(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters