@@ -97,9 +97,38 @@ export class TreeOptions {
97
97
98
98
constructor ( private options : ITreeOptions = { } ) {
99
99
this . actionMapping = {
100
- ...defaultActionMapping ,
101
- ...this . options . actionMapping ,
102
- } ;
100
+ mouse : {
101
+ click : this . options ?. actionMapping ?. mouse ?. click ?? defaultActionMapping . mouse . click ,
102
+ dblClick : this . options ?. actionMapping ?. mouse ?. dblClick ?? defaultActionMapping . mouse . dblClick ,
103
+ contextMenu : this . options ?. actionMapping ?. mouse ?. contextMenu ?? defaultActionMapping . mouse . contextMenu ,
104
+ expanderClick : this . options ?. actionMapping ?. mouse ?. expanderClick ?? defaultActionMapping . mouse . expanderClick ,
105
+ checkboxClick : this . options ?. actionMapping ?. mouse ?. checkboxClick ?? defaultActionMapping . mouse . checkboxClick ,
106
+ drop : this . options ?. actionMapping ?. mouse ?. drop ?? defaultActionMapping . mouse . drop ,
107
+ dragStart : this . options ?. actionMapping ?. mouse ?. dragStart ?? undefined ,
108
+ drag : this . options ?. actionMapping ?. mouse ?. drag ?? undefined ,
109
+ dragEnd : this . options ?. actionMapping ?. mouse ?. dragEnd ?? undefined ,
110
+ dragOver : this . options ?. actionMapping ?. mouse ?. dragOver ?? undefined ,
111
+ dragLeave : this . options ?. actionMapping ?. mouse ?. dragLeave ?? undefined ,
112
+ dragEnter : this . options ?. actionMapping ?. mouse ?. dragEnter ?? undefined ,
113
+ mouseOver : this . options ?. actionMapping ?. mouse ?. mouseOver ?? undefined ,
114
+ mouseOut : this . options ?. actionMapping ?. mouse ?. mouseOut ?? undefined ,
115
+ } ,
116
+ keys : {
117
+ [ KEYS . RIGHT ] : TREE_ACTIONS . DRILL_DOWN ,
118
+ [ KEYS . LEFT ] : TREE_ACTIONS . DRILL_UP ,
119
+ [ KEYS . DOWN ] : TREE_ACTIONS . NEXT_NODE ,
120
+ [ KEYS . UP ] : TREE_ACTIONS . PREVIOUS_NODE ,
121
+ [ KEYS . SPACE ] : TREE_ACTIONS . TOGGLE_ACTIVE ,
122
+ [ KEYS . ENTER ] : TREE_ACTIONS . TOGGLE_ACTIVE
123
+ }
124
+ }
125
+
126
+ if ( this . options ?. actionMapping ?. keys ) {
127
+ this . actionMapping . keys = {
128
+ ...this . actionMapping . keys ,
129
+ ...this . options . actionMapping . keys
130
+ }
131
+ }
103
132
104
133
if ( options . rtl ) {
105
134
this . actionMapping . keys [ KEYS . RIGHT ] = < IActionHandler > options . actionMapping ?. keys [ KEYS . RIGHT ] || TREE_ACTIONS . DRILL_UP ;
0 commit comments