File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 11import { reactive } from 'vue'
22
3+ type PivotUiState = {
4+ unusedOrder : string [ ]
5+ zIndices : Record < string , number >
6+ maxZIndex : number
7+ openStatus : Record < string , boolean >
8+ }
9+
310export function usePivotUiState ( ) {
4- const pivotUiState = reactive ( {
11+ const pivotUiState = reactive < PivotUiState > ( {
512 unusedOrder : [ ] ,
613 zIndices : { } ,
714 maxZIndex : 1000 ,
815 openStatus : { }
916 } )
1017
11- const onMoveFilterBoxToTop = ( attributeName ) => {
18+ const onMoveFilterBoxToTop = ( attributeName : string ) => {
1219 pivotUiState . maxZIndex ++
1320 pivotUiState . zIndices [ attributeName ] = pivotUiState . maxZIndex
1421 }
1522
16- const onUpdateOpenStatus = ( { key, value } ) => {
23+ const onUpdateOpenStatus = ( {
24+ key,
25+ value
26+ } : {
27+ key : string
28+ value : boolean
29+ } ) => {
1730 pivotUiState . openStatus [ key ] = value
1831 }
1932
20- const onUpdateUnusedOrder = ( newOrder ) => {
33+ const onUpdateUnusedOrder = ( newOrder : string [ ] ) => {
2134 pivotUiState . unusedOrder = newOrder
2235 }
2336
You can’t perform that action at this time.
0 commit comments