File tree Expand file tree Collapse file tree 4 files changed +69
-9
lines changed Expand file tree Collapse file tree 4 files changed +69
-9
lines changed Original file line number Diff line number Diff line change 11<template >
2- <s-scroll-view >
2+ <s-scroll-view class = " list-view " >
33 <VueDraggable
44 v-model =" profile.annotations"
55 :animation =" 200"
1515 </AnimatedListItem >
1616 </AnimatedList >
1717 </VueDraggable >
18- <div class =" plot-data add-data" @click =" profile.addAnnotation" >
18+ <button class =" plot-data add-data" @click =" profile.addAnnotation" >
1919 <s-icon name =" add" />
2020 {{ t("editor.add") }}
2121 <s-ripple attached ></s-ripple >
22- </div >
22+ </button >
2323 </s-scroll-view >
2424</template >
2525
Original file line number Diff line number Diff line change 11<template >
2- <s-scroll-view >
2+ <s-scroll-view ref = " scrollView " class = " list-view " >
33 <VueDraggable
44 v-model =" profile.datum"
55 :animation =" 200"
1111 :key =" item.key"
1212 class =" datumFolder"
1313 >
14- <DataItem :self =" item" :index =" i" />
14+ <DataItem :self =" item" :index =" i" />
1515 </AnimatedListItem >
1616 </AnimatedList >
1717 </VueDraggable >
18- <div class =" plot-data add-data" @click =" profile. addData" >
18+ <button class =" plot-data add-data" @click =" addData" >
1919 <s-icon name =" add" />
20- {{ t(' editor.add' ) }}
20+ {{ t(" editor.add" ) }}
2121 <s-ripple attached ></s-ripple >
22- </div >
22+ </button >
2323 </s-scroll-view >
2424</template >
2525
@@ -38,20 +38,78 @@ import { useProfile } from "@/states";
3838const profile = useProfile ();
3939
4040import " ./inputs/inputs.scss" ;
41+ import { ref } from " vue" ;
42+
43+ const scrollView = ref <HTMLElementTagNameMap [" s-scroll-view" ] | null >(null );
44+ function addData() {
45+ profile .addData ();
46+ setTimeout (() => {
47+ if (! scrollView .value ) return ;
48+ const lastInput = (<HTMLInputElement []>[
49+ ... scrollView .value .querySelectorAll (" .function-input-real" ),
50+ ]).at (- 1 );
51+ if (! lastInput ) return ;
52+ lastInput .focus ();
53+ console .log (lastInput );
54+ }, 250 );
55+ }
4156 </script >
4257
43- <style >
58+ <style lang="scss" >
4459.datumFolder {
4560 border-bottom : var (--s-color-outline-variant ) 1px solid ;
4661}
4762
63+ .list-view {
64+ display : flex ;
65+ align-items : stretch ;
66+ flex-direction : column ;
67+ }
68+
4869.plot-data.add-data {
4970 position : relative ;
5071 padding-top : 15px ;
5172 padding-bottom : 15px ;
5273 margin-bottom : 50px ;
5374 display : flex ;
75+ align-items : center ;
5476 gap : 5px ;
5577 cursor : pointer ;
78+ border-radius : 0 ;
79+ background : transparent ;
80+ border : none ;
81+ font-size : inherit ;
82+ color : inherit ;
83+ line-height : 1 ;
84+ transition : color 0.1s ;
85+
86+ & ::before {
87+ content : " " ;
88+ position : absolute ;
89+ top : 0 ;
90+ left : 0 ;
91+ right : 0 ;
92+ bottom : 0 ;
93+ background-color : var (--s-color-primary );
94+ opacity : 0 ;
95+ transition : opacity 0.1s ;
96+ }
97+
98+ & :hover ::before {
99+ opacity : 0 !important ;
100+ }
101+
102+ & :focus-visible {
103+ outline : none ;
104+ color : var (--s-color-primary );
105+ }
106+
107+ & :focus-visible ::before {
108+ opacity : 0.1 ;
109+ }
110+
111+ s-icon {
112+ color : inherit ;
113+ }
56114}
57115 </style >
Original file line number Diff line number Diff line change 1010 type =" text"
1111 v-model =" value"
1212 ref =" inputRef"
13+ class =" function-input-real"
1314 />
1415 </div >
1516 </div >
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ s-page {
124124 --s-color-tertiary-container : #eedbff ;
125125 --s-color-on-tertiary-container : #231533 ;
126126 --s-color-inverse-primary : #96ccff ;
127+ --s-color-outline : #899297 ;
127128 --s-color-dark-primary : #96ccff ;
128129 --s-color-dark-on-primary : #003353 ;
129130 --s-color-dark-primary-container : #004a75 ;
You can’t perform that action at this time.
0 commit comments