-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/custom-elements-for-core-integration' into fix/cus…
…tomElements-not-defined
- Loading branch information
Showing
19 changed files
with
575 additions
and
15 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
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,8 +1,15 @@ | ||
import { defineCustomElement } from 'vue' | ||
import { withInstall } from '@puik/utils' | ||
|
||
import ButtonGroup from './src/button-group.vue' | ||
|
||
export const PuikButtonGroup = withInstall(ButtonGroup) | ||
export default PuikButtonGroup | ||
export const PuikButtonGroupCe = defineCustomElement(PuikButtonGroup) | ||
|
||
if (!customElements.get('puik-button-group-ce')) { | ||
customElements.define('puik-button-group-ce', PuikButtonGroupCe) | ||
} | ||
|
||
export * from './src/button-group' | ||
|
||
export default PuikButtonGroup |
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,8 +1,15 @@ | ||
import { defineCustomElement } from 'vue' | ||
import { withInstall } from '@puik/utils' | ||
|
||
import Button from './src/button.vue' | ||
|
||
export const PuikButton = withInstall(Button) | ||
export default PuikButton | ||
export const PuikButtonCe = defineCustomElement(PuikButton) | ||
|
||
if (!customElements.get('puik-button-ce')) { | ||
customElements.define('puik-button-ce', PuikButtonCe) | ||
} | ||
|
||
export * from './src/button' | ||
|
||
export default PuikButton |
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,8 +1,15 @@ | ||
import { defineCustomElement } from 'vue' | ||
import { withInstall } from '@puik/utils' | ||
|
||
import Input from './src/input.vue' | ||
|
||
export const PuikInput = withInstall(Input) | ||
export default PuikInput | ||
export const PuikInputCe = defineCustomElement(PuikInput) | ||
|
||
if (!customElements.get('puik-input-ce')) { | ||
customElements.define('puik-input-ce', PuikInputCe) | ||
} | ||
|
||
export * from './src/input' | ||
|
||
export default PuikInput |
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
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,3 +1,6 @@ | ||
.puik-icon { | ||
@apply font-materialIcons; | ||
} | ||
.puik-icon.material-icons-round { | ||
@apply flex; | ||
} |
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,4 +1,5 @@ | ||
@use './common/typography.scss'; | ||
|
||
.puik-input { | ||
@apply flex flex-col; | ||
&__wrapper { | ||
|
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { App, Directive, DirectiveBinding } from 'vue' | ||
|
||
const directive: Directive = { | ||
mounted(el: HTMLInputElement, binding: DirectiveBinding) { | ||
el.addEventListener('input', (event) => { | ||
if (event.target) { | ||
binding.instance?.$emit( | ||
binding.arg!, | ||
(event.target as HTMLInputElement).value | ||
) | ||
} | ||
}) | ||
}, | ||
beforeUnmount(el: HTMLInputElement) { | ||
el.removeEventListener('input', () => { | ||
console.log('before unmount') | ||
}) | ||
}, | ||
} | ||
|
||
export const vCustomModelDirective = { | ||
install(app: App) { | ||
app.directive('custom-model', directive) | ||
}, | ||
} |
Oops, something went wrong.