Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jamie configure model matrix fixes #2865

Merged
merged 36 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1b3f539
feat: darker text in content switcher buttons
jamiewaese-uncharted Jul 13, 2023
696ff88
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 14, 2023
3f29442
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 14, 2023
8d271e0
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 14, 2023
9e059d3
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 17, 2023
0733410
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 17, 2023
36bbf01
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 18, 2023
fb88e51
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 19, 2023
6bb287f
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 19, 2023
1cdc024
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 19, 2023
1919fd1
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 20, 2023
dc47094
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 21, 2023
6f52d1e
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jul 24, 2023
305bf66
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jan 4, 2024
3e34780
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jan 8, 2024
a5d6c81
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jan 11, 2024
305a650
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jan 22, 2024
ee17593
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jan 24, 2024
83d6dcf
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jan 26, 2024
e06bc7a
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Jan 26, 2024
3350006
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Feb 7, 2024
4f5ef99
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Feb 8, 2024
24ff234
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Feb 14, 2024
6ea41bf
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Feb 15, 2024
e8f4983
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Feb 20, 2024
b13d607
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Feb 20, 2024
07bb154
Merge branch 'main' of https://github.com/DARPA-ASKEM/Terarium
jamiewaese-uncharted Feb 21, 2024
283381f
changed checkbox to InputSwitch, aligned elements correctly
jamiewaese-uncharted Feb 21, 2024
a8aa865
made cell content vertical, swapped order of cell content, added form…
jamiewaese-uncharted Feb 21, 2024
9efcacc
removed a space
jamiewaese-uncharted Feb 21, 2024
dc95e05
Merge branch 'main' into jamie-configure-model-matrix-fixes
jamiewaese-uncharted Feb 28, 2024
91e7416
simplified column labels, moved controllers list into a tooltip
jamiewaese-uncharted Feb 28, 2024
393a9d8
Refactor matrix display and input styles
jamiewaese-uncharted Feb 28, 2024
7d27614
Refactor matrix display and input styles
jamiewaese-uncharted Feb 28, 2024
1f178ed
Merge branch 'main' into jamie-configure-model-matrix-fixes
jamiewaese-uncharted Feb 28, 2024
b336670
Merge branch 'main' into jamie-configure-model-matrix-fixes
YohannParis Feb 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<template>
<tera-modal @modal-mask-clicked="emit('close-modal')">
<template #header>
<h4>{{ id }}</h4>
<span>Configure the matrix values</span>
<div class="flex align-items-center">
<Checkbox
inputId="matrixShouldEval"
v-model="matrixShouldEval"
:binary="true"
label="Evaluate expressions?"
/>
<label for="matrixShouldEval" class="ml-2"> Evaluate Expressions? </label>
<div class="flex align-items-center justify-space-between">
<h4 class="w-full">{{ id }} matrix</h4>
<div class="flex align-items-center gap-2 white-space-nowrap">
<label for="matrixShouldEval" class="mr-2">Evaluate expressions</label>
<InputSwitch
inputId="matrixShouldEval"
v-model="matrixShouldEval"
:binary="true"
label="Evaluate expressions?"
/>
</div>
</div>
</template>
<template #default>
Expand Down Expand Up @@ -44,8 +45,14 @@
/>
</template>
<template #footer>
<Button label="OK" @click="emit('close-modal')" />
<Button class="p-button-outlined" label="Cancel" @click="emit('close-modal')" />
<Button size="large" label="OK" @click="emit('close-modal')" />
<Button
size="large"
severity="secondary"
class="p-button-outlined"
label="Cancel"
@click="emit('close-modal')"
/>
</template>
</tera-modal>
</template>
Expand All @@ -54,7 +61,7 @@
import { ref } from 'vue';
import { StratifiedModel } from '@/model-representation/petrinet/petrinet-service';
import type { ModelConfiguration } from '@/types/Types';
import Checkbox from 'primevue/checkbox';
import InputSwitch from 'primevue/inputswitch';
import Button from 'primevue/button';
import TeraModal from '@/components/widgets/tera-modal.vue';
import { StratifiedMatrix } from '@/types/Model';
Expand All @@ -72,3 +79,9 @@ const emit = defineEmits(['close-modal', 'update-configuration']);

const matrixShouldEval = ref(true);
</script>

<style scoped>
main:deep(.content) {
min-width: 40rem;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<tr v-for="(row, rowIdx) in matrix" :key="rowIdx">
<td v-if="matrix.length > 0" class="p-frozen-column">
<template v-if="stratifiedMatrixType === StratifiedMatrix.Initials">
{{ Object.values(row[0].rowCriteria).join(' / ') }}
{{ Object.values(row[0].rowCriteria)[0] }}
</template>
<template v-else>
{{ row[0].rowCriteria }}
Expand All @@ -25,35 +25,52 @@
v-for="(cell, colIdx) in row"
:key="colIdx"
tabindex="0"
:class="editableCellStates[rowIdx][colIdx] && 'is-editing'"
:class="{
'is-editing': editableCellStates[rowIdx][colIdx],
'n-a-cell': !cell.content.id
}"
@keyup.enter="onEnterValueCell(cell.content.id, rowIdx, colIdx)"
@click="onEnterValueCell(cell.content.id, rowIdx, colIdx)"
>
<template v-if="cell.content.id">
<InputText
v-if="editableCellStates[rowIdx][colIdx]"
class="cell-input"
v-model.lazy="valueToEdit"
v-focus
@focusout="updateModelConfigValue(cell.content.id, rowIdx, colIdx)"
@keyup.stop.enter="updateModelConfigValue(cell.content.id, rowIdx, colIdx)"
/>
<section v-else>
<div>
<section class="flex flex-column">
<InputText
v-if="editableCellStates[rowIdx][colIdx]"
class="cell-input"
:class="stratifiedMatrixType !== StratifiedMatrix.Initials && 'big-cell-input'"
v-model.lazy="valueToEdit"
v-focus
@focusout="updateModelConfigValue(cell.content.id, rowIdx, colIdx)"
@keyup.stop.enter="updateModelConfigValue(cell.content.id, rowIdx, colIdx)"
/>
<div
class="w-full"
:class="{ 'hide-content': editableCellStates[rowIdx][colIdx] }"
>
<div
class="mathml-container"
v-html="matrixExpressionsList?.[rowIdx]?.[colIdx] ?? '...'"
/>
<template v-if="cell?.content?.controllers">
controllers: {{ cell?.content?.controllers }}
</template>
</div>
<div class="subdue">
{{ cell?.content.id }}
class="subdue mb-1 flex align-items-center gap-1 w-full justify-content-between"
v-if="stratifiedMatrixType !== StratifiedMatrix.Initials"
>
{{ cell?.content.id }}
<span
v-if="cell?.content?.controllers"
class="pi pi-info-circle"
v-tooltip.top="{
value: `Controllers:\n ${cell?.content?.controllers}`,
pt: 'grid col'
}"
/>
</div>
<div>
<div
class="mathml-container"
v-html="matrixExpressionsList?.[rowIdx]?.[colIdx] ?? '...'"
/>
</div>
</div>
</section>
</template>
<span v-else class="subdue">N/A</span>
<span v-else class="subdue">n/a</span>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -272,23 +289,44 @@ onMounted(() => {

.p-datatable .p-datatable-tbody > tr > td.is-editing {
padding: 0;
padding-bottom: 0;
}

.editable-cell {
display: flex;
justify-content: space-between;
align-items: center;
visibility: visible;
width: 100%;
}

.n-a-cell {
background-color: var(--surface-b);
}
.hide-content {
visibility: hidden;
height: 0px;
padding-left: 2rem;
}
.cell-input {
height: 4rem;
min-width: 8rem;
width: 100%;
padding-left: 12px;
padding-left: var(--gap-small);
padding-right: var(--gap);
margin-bottom: 0 !important;
font-feature-settings: 'tnum';
text-align: right;
height: 44px;
}

.big-cell-input {
height: 66px;
}

.mathml-container {
width: 100%;
text-align: right;
}
.mathml-container:deep(mn) {
font-family: var(--font-family);
font-feature-settings: 'tnum';
text-align: right !important;
}
.p-datatable-scrollable .p-frozen-column {
padding-right: 1rem;
}
Expand All @@ -301,6 +339,9 @@ onMounted(() => {
color: var(--text-color-subdued);
}

.controllers {
font-size: var(--font-caption);
}
section {
display: flex;
justify-content: space-between;
Expand Down
Loading