File tree Expand file tree Collapse file tree 7 files changed +53
-31
lines changed
Expand file tree Collapse file tree 7 files changed +53
-31
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,11 @@ export function toInternalDatum(items: FunctionPlotDatum[]) {
133133export type InputProps = {
134134 dataItem : InternalDatum ;
135135 fnType : FnType ;
136+ } ;
137+
138+ export type InputPropsWithFold = {
139+ dataItem : InternalDatum ;
140+ fnType : FnType ;
136141 blockFolded : boolean ;
137142} ;
138143
Original file line number Diff line number Diff line change 7373 </div >
7474
7575 <div class =" inputs" >
76- <StrInputs
77- :dataItem =" dataItem"
78- :fnType =" fnType"
79- :blockFolded =" blockFolded"
80- />
76+ <StrInputs :dataItem =" dataItem" :fnType =" fnType" />
8177 <CoordInputs
8278 v-if =" fnType.coord"
8379 :dataItem =" dataItem"
8480 :fnType =" fnType"
85- :blockFolded =" blockFolded "
81+ :blockFolded =" false "
8682 />
8783 <CoordArrInputs
8884 v-if =" fnType.coordArr"
8985 :dataItem =" dataItem"
9086 :fnType =" fnType"
91- :blockFolded =" blockFolded"
92- />
93- <OptInputs
94- v-if =" fnType.optInput"
95- :dataItem =" dataItem"
96- :fnType =" fnType"
97- :blockFolded =" blockFolded"
9887 />
9988 <SwitchInputs
10089 v-if =" fnType.switches"
10190 :dataItem =" dataItem"
10291 :fnType =" fnType"
103- :blockFolded =" blockFolded "
92+ :blockFolded =" false "
10493 />
10594 </div >
95+ <s-fold :folded =" blockFolded" >
96+ <div class =" inputs optional" >
97+ <s-divider >{{ t("title.moreOptions") }}</s-divider >
98+ <CoordInputs
99+ v-if =" fnType.coord"
100+ :dataItem =" dataItem"
101+ :fnType =" fnType"
102+ :blockFolded =" true"
103+ />
104+ <OptInputs
105+ v-if =" fnType.optInput"
106+ :dataItem =" dataItem"
107+ :fnType =" fnType"
108+ />
109+ <SwitchInputs
110+ v-if =" fnType.switches"
111+ :dataItem =" dataItem"
112+ :fnType =" fnType"
113+ :blockFolded =" true"
114+ />
115+ </div >
116+ </s-fold >
106117 </div >
107118 </s-fold >
108119</template >
@@ -201,6 +212,20 @@ watch(locale, () => selectKey.value++);
201212 </script >
202213
203214<style >
215+ .inputs {
216+ display : flex ;
217+ flex-direction : column ;
218+ gap : 10px ;
219+ }
220+ .inputs.optional {
221+ margin-top : 10px ;
222+ margin-bottom : 5px ;
223+ }
224+
225+ .inputs .input-box {
226+ position : relative ;
227+ display : flex ;
228+ }
204229.plot-data {
205230 position : relative ;
206231 padding : 20px 15px ;
Original file line number Diff line number Diff line change 11<template >
22 <div
33 v-for =" input in fnType.coord?.filter(
4- ({ folded }) => !( folded && blockFolded)
4+ ({ folded }) => !! folded === blockFolded
55 ) ?? []"
66 class =" input-box coord"
77 :class =" { optional: input.optional }"
3333import { useI18n } from " vue-i18n" ;
3434const { t } = useI18n ();
3535
36- import { CoordType , InternalDatum , InputProps } from " ../../consts" ;
36+ import { CoordType , InternalDatum , InputPropsWithFold } from " ../../consts" ;
3737
38- const { dataItem, fnType } = defineProps <InputProps >();
38+ const { dataItem, fnType } = defineProps <InputPropsWithFold >();
3939
4040function handleCoordInput(
4141 dataItem : InternalDatum ,
Original file line number Diff line number Diff line change 11<template >
22 <div
3- v-if =" !blockFolded"
43 v-for =" input in fnType.optInput ?? []"
54 class =" input-box opt-input optional"
65 >
Original file line number Diff line number Diff line change @@ -36,15 +36,6 @@ const emit = defineEmits(["blur"]);
3636 </script >
3737
3838<style >
39- .inputs {
40- display : flex ;
41- flex-direction : column ;
42- gap : 10px ;
43- }
44- .inputs .input-box {
45- position : relative ;
46- display : flex ;
47- }
4839.inputs .input-box .input-title {
4940 font-size : 25px ;
5041 margin : auto 5px ;
Original file line number Diff line number Diff line change 11<template >
22 <div
33 v-for =" input in fnType.switches?.filter(
4- ({ folded }) => !( folded && blockFolded)
4+ ({ folded }) => !! folded === blockFolded
55 ) ?? []"
66 class =" input-box switches"
77 @click ="
1919import { useI18n } from " vue-i18n" ;
2020const { t } = useI18n ();
2121
22- import { InputProps } from " ../../consts" ;
22+ import { InputPropsWithFold } from " ../../consts" ;
2323
24- const { dataItem, fnType } = defineProps <InputProps >();
24+ const { dataItem, fnType } = defineProps <InputPropsWithFold >();
2525 </script >
2626
2727<style >
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ export default {
5959 importFail : "导入失败" ,
6060 copySuccess : "已复制" ,
6161 deleteSuccess : "已删除" ,
62+ moreOptions : "更多选项" ,
6263 } ,
6364 } ,
6465 "en-US" : {
@@ -101,7 +102,7 @@ export default {
101102 range : "Range" ,
102103 color : "Color" ,
103104 colorPlaceholder : "RGB / HEX / Color name" ,
104- nSamples : "Samples " ,
105+ nSamples : "Sample number " ,
105106 nSamplesPlaceholder : "Default to width" ,
106107 closed : "Close and fill" ,
107108 vectorValue : "Size" ,
@@ -115,6 +116,7 @@ export default {
115116 importFail : "Import failed" ,
116117 copySuccess : "Copied" ,
117118 deleteSuccess : "Deleted" ,
119+ moreOptions : "More options" ,
118120 } ,
119121 } ,
120122 } ,
You can’t perform that action at this time.
0 commit comments