File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed
Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,19 @@ import {PartialConfig} from '@/lib/types/config';
22
33const config : PartialConfig = {
44 globalClass : '' ,
5+
6+ transitions : {
7+ flyFade : {
8+ name : 'flyFade' ,
9+ effectReference : 'fly' ,
10+ animation : {
11+ x : 5 ,
12+ y : 5 ,
13+ duration : 200 ,
14+ } ,
15+ } ,
16+ } ,
17+
518 components : {
619 button : {
720 class : 'font-bold py-2 px-4 rounded outline-none' ,
@@ -12,7 +25,7 @@ const config: PartialConfig = {
1225 } ,
1326
1427 dropdown : {
15- transition : null ,
28+ transition : 'flyFade' ,
1629 isProperties : {
1730 multiselect : 'rounded border-solid border border-gray-300 py-2 px-4' ,
1831 search : 'rounded border-solid border border-gray-300' ,
Original file line number Diff line number Diff line change 6868 if (! this .name ) return {name: ' ' , animation: {}, options: {}};
6969
7070 const {transitions} = this .$iui ;
71- const transition = transitions [this .name ];
71+ let transition = transitions [this .name ];
7272
7373 if (! transition ) {
7474 throw new Error (
7575 ` Transition ${this .name } is not configured.\n
7676 Expected one of the names: ${Object .keys (transitions ).join (' , ' )} `
7777 );
7878 } else {
79+ if (transition .effectReference ) {
80+ const reference = transitions [transition .effectReference ];
81+ transition = {
82+ ... reference ,
83+ ... transition ,
84+ animation: {... reference ?.animation , ... transition ?.animation },
85+ };
86+ }
7987 return {
8088 ... transition ,
8189 animation: {... transition .animation , ... this .animation },
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ export interface AnimationOptions {
2626}
2727
2828export interface TransitionOptions {
29+ // Reference this effect and give it another animation properties, but leave hooks untouched
30+ effectReference : string ,
31+
2932 animation : Partial < AnimationOptions > ,
3033
3134 appear ?: boolean ,
You can’t perform that action at this time.
0 commit comments