1
- import { ChangeDetectionStrategy , Component , CUSTOM_ELEMENTS_SCHEMA , signal , viewChild } from '@angular/core' ;
1
+ import { ChangeDetectionStrategy , Component , CUSTOM_ELEMENTS_SCHEMA , input , signal , viewChild } from '@angular/core' ;
2
2
import { Meta } from '@storybook/angular' ;
3
3
import { NgtMesh } from 'angular-three' ;
4
4
import { NgtsOrbitControls } from 'angular-three-soba/controls' ;
5
- import { NgtsTransformControls } from 'angular-three-soba/gizmos' ;
6
- import { makeDecorators , makeStoryFunction } from '../setup-canvas' ;
5
+ import { NgtsTransformControls , NgtsTransformControlsOptions } from 'angular-three-soba/gizmos' ;
6
+ import { makeDecorators , makeStoryFunction , makeStoryObject , select } from '../setup-canvas' ;
7
7
8
8
@Component ( {
9
9
standalone : true ,
@@ -59,7 +59,7 @@ class LockControlsStory {}
59
59
@Component ( {
60
60
standalone : true ,
61
61
template : `
62
- <ngts-transform-controls>
62
+ <ngts-transform-controls [options]="{ mode: mode() }" >
63
63
<ngt-mesh>
64
64
<ngt-box-geometry />
65
65
<ngt-mesh-basic-material [wireframe]="true" />
@@ -74,6 +74,8 @@ class LockControlsStory {}
74
74
} ,
75
75
} )
76
76
class DefaultTransformControlsStory {
77
+ mode = input < NgtsTransformControlsOptions [ 'mode' ] > ( 'translate' ) ;
78
+
77
79
private transformControls = viewChild . required ( NgtsTransformControls ) ;
78
80
79
81
onKeyDown ( event : KeyboardEvent ) {
@@ -89,6 +91,10 @@ export default {
89
91
decorators : makeDecorators ( ) ,
90
92
} as Meta ;
91
93
92
- export const Default = makeStoryFunction ( DefaultTransformControlsStory ) ;
94
+ export const Default = makeStoryObject ( DefaultTransformControlsStory , {
95
+ argsOptions : {
96
+ mode : select ( 'translate' , { options : [ 'translate' , 'rotate' , 'scale' ] } ) ,
97
+ } ,
98
+ } ) ;
93
99
export const LockControls = makeStoryFunction ( LockControlsStory , { controls : false } ) ;
94
100
export const WithSelection = makeStoryFunction ( WithSelectionStory ) ;
0 commit comments