-
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
f448714
commit 3e79f7f
Showing
51 changed files
with
1,845 additions
and
349 deletions.
There are no files selected for viewing
8 changes: 7 additions & 1 deletion
8
packages/components/_private/footer/__tests__/__snapshots__/footer.spec.ts.snap
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,9 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`Footer > render work 1`] = `"<div><button class=\\"ix-button ix-button-primary ix-button-md\\" type=\\"button\\"><span>ok</span></button><button class=\\"ix-button ix-button-default ix-button-md\\" type=\\"button\\"><span>cancel</span></button></div>"`; | ||
exports[`Footer > render work 1`] = ` | ||
"<div><button class=\\"ix-button ix-button-primary ix-button-md\\" type=\\"button\\"><span>ok</span> | ||
<div aria-hidden=\\"true\\" class=\\"ix-wave\\"></div> | ||
</button><button class=\\"ix-button ix-button-default ix-button-md\\" type=\\"button\\"><span>cancel</span> | ||
<div aria-hidden=\\"true\\" class=\\"ix-wave\\"></div> | ||
</button></div>" | ||
`; |
3 changes: 3 additions & 0 deletions
3
packages/components/_private/wave/__tests__/__snapshots__/wave.spec.ts.snap
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 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`Wave > render work 1`] = `"<div aria-hidden=\\"true\\" class=\\"ix-wave\\"></div>"`; |
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 '../../../../style/themes/default.less'; | ||
@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,4 @@ | ||
@import '../../../../style/themes/seer.less'; | ||
@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'; |
6 changes: 5 additions & 1 deletion
6
packages/components/button/__tests__/__snapshots__/button.spec.ts.snap
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,7 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`Button > render work 1`] = `"<button class=\\"ix-button ix-button-default ix-button-md\\" type=\\"button\\"></button>"`; | ||
exports[`Button > render work 1`] = ` | ||
"<button class=\\"ix-button ix-button-default ix-button-md\\" type=\\"button\\"> | ||
<div aria-hidden=\\"true\\" class=\\"ix-wave\\"></div> | ||
</button>" | ||
`; |
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' |
3 changes: 2 additions & 1 deletion
3
packages/components/checkbox/__tests__/__snapshots__/checkbox.spec.ts.snap
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.