File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 2323 "url" : " git+https://github.com/opencor/webapp.git"
2424 },
2525 "type" : " module" ,
26- "version" : " 0.20251211.1 " ,
26+ "version" : " 0.20251211.2 " ,
2727 "scripts" : {
2828 "archive:web" : " bun src/renderer/scripts/archive.web.js" ,
2929 "build" : " electron-vite build" ,
Original file line number Diff line number Diff line change 3939 },
4040 "./style.css" : " ./dist/opencor.css"
4141 },
42- "version" : " 0.20251211.1 " ,
42+ "version" : " 0.20251211.2 " ,
4343 "scripts" : {
4444 "build" : " vite build" ,
4545 "build:lib" : " vite build --config vite.lib.config.ts && cp index.d.ts dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -223,7 +223,22 @@ const interactiveUiJsonIssues = vue.ref<locApi.IIssue[]>(
223223);
224224const interactiveInstanceIssues = vue .ref <locApi .IIssue []>([]);
225225const interactiveInputValues = vue .ref <number []>(
226- interactiveModeAvailable .value ? props .uiJson .input .map ((input : locApi .IUiJsonInput ) => input .defaultValue ) : []
226+ interactiveModeAvailable .value
227+ ? props .uiJson .input .map ((input : locApi .IUiJsonInput ) => {
228+ // If the input has some possible values then we want to return the index of the possible value that matches the
229+ // default value otherwise we just return the default value.
230+
231+ if (input .possibleValues !== undefined ) {
232+ for (let i = 0 ; i < input .possibleValues .length ; ++ i ) {
233+ if (input .possibleValues [i ].value === input .defaultValue ) {
234+ return i ;
235+ }
236+ }
237+ }
238+
239+ return input .defaultValue ;
240+ })
241+ : []
227242);
228243const interactiveShowInput = vue .ref <string []>(
229244 interactiveModeAvailable .value ? props .uiJson .input .map ((input : locApi .IUiJsonInput ) => input .visible ?? ' true' ) : []
@@ -271,6 +286,7 @@ interactiveMath.import(
271286 },
272287 { override: true }
273288);
289+
274290function evaluateValue(value : string ): mathjs .MathType {
275291 const parser = interactiveMath .parser ();
276292 let index = - 1 ;
You can’t perform that action at this time.
0 commit comments