-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(comp:button,checkbox,radio): add waveless prop
- Loading branch information
1 parent
0a59283
commit ad51683
Showing
34 changed files
with
241 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//import { mount, MountingOptions } from '@vue/test-utils' | ||
import { renderWork } from '@tests' | ||
|
||
import Wave from '../src/Wave' | ||
import { WaveProps } from '../src/types' | ||
|
||
describe('Wave', () => { | ||
//const WaveMount = (options?: MountingOptions<Partial<WaveProps>>) => mount(Wave, { ...(options as MountingOptions<WaveProps>)}) | ||
|
||
renderWork<WaveProps>(Wave, { | ||
props: {}, | ||
}) | ||
}) |
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,20 @@ | ||
/** | ||
* @license | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://github.com/IDuxFE/idux/blob/main/LICENSE | ||
*/ | ||
|
||
import type { WaveComponent } from './src/types' | ||
|
||
import Wave from './src/Wave' | ||
|
||
const ɵWave = Wave as unknown as WaveComponent | ||
|
||
export { ɵWave } | ||
|
||
export type { | ||
WaveInstance as ɵWaveInstance, | ||
WaveComponent as ɵWaveComponent, | ||
WavePublicProps as ɵWaveProps, | ||
} from './src/types' |
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,57 @@ | ||
/** | ||
* @license | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://github.com/IDuxFE/idux/blob/main/LICENSE | ||
*/ | ||
|
||
import { computed, defineComponent, nextTick, ref } from 'vue' | ||
|
||
import { useGlobalConfig } from '@idux/components/config' | ||
|
||
import { waveProps } from './types' | ||
|
||
export default defineComponent({ | ||
name: 'ɵWave', | ||
props: waveProps, | ||
setup(_, { expose }) { | ||
const common = useGlobalConfig('common') | ||
const mergedPrefixCls = computed(() => `${common.prefixCls}-wave`) | ||
|
||
const selfRef = ref<HTMLElement>() | ||
|
||
const play = () => { | ||
nextTick(() => { | ||
if (selfRef.value && selfRef.value.parentElement && selfRef.value.animate) { | ||
const borderColor = getComputedStyle(selfRef.value.parentElement).borderColor | ||
selfRef.value.animate( | ||
[ | ||
{ | ||
// from | ||
opacity: 0.6, | ||
boxShadow: `0 0 1px 0 ${borderColor}`, | ||
zIndex: 1, | ||
easing: 'cubic-bezier(0, 0, 0.2, 1)', | ||
}, | ||
{ | ||
// to | ||
opacity: 0, | ||
zIndex: 0, | ||
boxShadow: `0 0 1px 5px ${borderColor}`, | ||
}, | ||
], | ||
600, | ||
) | ||
} | ||
}) | ||
} | ||
|
||
expose({ | ||
play, | ||
}) | ||
|
||
return () => { | ||
return <div ref={selfRef} aria-hidden class={mergedPrefixCls.value} /> | ||
} | ||
}, | ||
}) |
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,20 @@ | ||
/** | ||
* @license | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://github.com/IDuxFE/idux/blob/main/LICENSE | ||
*/ | ||
|
||
import type { ExtractInnerPropTypes, ExtractPublicPropTypes } from '@idux/cdk/utils' | ||
import type { DefineComponent, HTMLAttributes } from 'vue' | ||
|
||
export const waveProps = {} as const | ||
|
||
export interface WaveBindings { | ||
play: () => void | ||
} | ||
|
||
export type WaveProps = ExtractInnerPropTypes<typeof waveProps> | ||
export type WavePublicProps = ExtractPublicPropTypes<typeof waveProps> | ||
export type WaveComponent = DefineComponent<Omit<HTMLAttributes, keyof WavePublicProps> & WavePublicProps> | ||
export type WaveInstance = InstanceType<DefineComponent<WaveProps, WaveBindings>> |
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,9 @@ | ||
.@{wave-prefix} { | ||
position: absolute; | ||
left: 0; | ||
right: 0; | ||
top: 0; | ||
bottom: 0; | ||
border-radius: inherit; | ||
pointer-events: none; | ||
} |
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,3 @@ | ||
@import './default.variable.less'; | ||
|
||
@import '../index.less'; |
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,2 @@ | ||
// style dependencies | ||
import './default.less' |
Empty file.
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,3 @@ | ||
@import './seer.variable.less'; | ||
|
||
@import '../index.less'; |
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,2 @@ | ||
// style dependencies | ||
import './seer.less' |
1 change: 1 addition & 0 deletions
1
packages/components/_private/wave/style/themes/seer.variable.less
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 @@ | ||
@import './default.variable.less'; |
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
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,5 +1,5 @@ | ||
// style dependencies | ||
|
||
import '@idux/components/_private/wave/style/themes/default' | ||
import '@idux/components/icon/style/themes/default' | ||
|
||
import './default.less' |
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,5 +1,5 @@ | ||
// style dependencies | ||
|
||
import '@idux/components/_private/wave/style/themes/seer' | ||
import '@idux/components/icon/style/themes/seer' | ||
|
||
import './seer.less' |
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
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
Oops, something went wrong.