Skip to content

Commit

Permalink
Merge pull request #87 from bcgov/6686-embedded-help
Browse files Browse the repository at this point in the history
6686 embedded help
  • Loading branch information
weskubo-cgi authored May 24, 2022
2 parents 57bcb7f + 08fee05 commit 51e7f40
Show file tree
Hide file tree
Showing 19 changed files with 421 additions and 130 deletions.
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"@bcgov/bc-sans": "^1.0.1",
"@braks/revue-draggable": "^0.4.2",
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/vue-fontawesome": "prerelease",
Expand Down
86 changes: 45 additions & 41 deletions frontend/src/assets/css/main.css
Original file line number Diff line number Diff line change
@@ -1,77 +1,81 @@
/* Body */
body {
background-color: #F1F1F1;
padding-bottom: 20px;
background-color: #f1f1f1;
padding-bottom: 20px;
}

hr {
background-color: #606060;
border: 1px solid #606060;
background-color: #606060;
border: 1px solid #606060;
}

th div {
float: left;
}

/* Main */
main {
max-width: 1320px;
min-width: 1100px;
width: 100%;
min-height: calc(100vh - 168px);
margin: 0 auto;
padding: 20px 60px 60px 60px;
background-color: #FFFFFF;
max-width: 1320px;
min-width: 1100px;
width: 100%;
min-height: calc(100vh - 168px);
margin: 0 auto;
padding: 20px 60px 60px 60px;
background-color: #ffffff;
}
main .content {
padding: 0;
font-size: 1rem;
padding: 0;
font-size: 1rem;
}
main .content:after {
content: "";
display: table;
clear: both;
content: '';
display: table;
clear: both;
}

/* Sub groups */
.subgroup {
/*.v-card.subgroup*/
padding: 20px; margin:0px -20px 20px -20px; max-width: 110%;
padding: 20px;
margin: 0px -20px 20px -20px;
max-width: 110%;
}
.subgroup h2 {
font-weight: 100;
color: #999;
font-size: 24px;
line-height: 30px;
text-transform: uppercase;
margin-top: 0;
margin-bottom: 20px;
font-weight: 100;
color: #999;
font-size: 24px;
line-height: 30px;
text-transform: uppercase;
margin-top: 0;
margin-bottom: 20px;
}

/* Input */
/* Input */
input {
display: block;
width: 100%;
display: block;
width: 100%;
}

.checkbox-group .v-input--selection-controls {
margin-top: 8px;
}

/* Vuetify Components */
/*.v-icon.v-icon {
vertical-align: baseline;
margin-top: 8px;
}
*/

/* tables */
.theme--light.v-data-table.base-table thead tr:last-child th {
border-top: 2px solid #003366;
border-bottom: 2px solid #003366;
border-top: 2px solid #003366;
border-bottom: 2px solid #003366;
}

.v-data-table td, .v-data-table th {
padding: 0 16px;
.v-data-table td,
.v-data-table th {
padding: 0 16px;
}
.select-table tr {
cursor: pointer;
cursor: pointer;
}
.select-table tr.v-data-table__empty-wrapper {
cursor: default;
cursor: default;
}

.flex {
display: flex;
}
7 changes: 4 additions & 3 deletions frontend/src/components/ui/AppCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ export default {
display: block;
position: relative;
padding-left: 25px;
margin-bottom: 12px;
margin: 5px 0px 7px 3px;
cursor: pointer;
font-family: BCSans’, ‘Noto Sans, Verdana, Arial, sans-serif;
font-family: 'BCSans', 'Noto Sans', Verdana, Arial, sans-serif;
font-size: 16px;
font-weight: 400;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand All @@ -62,7 +63,7 @@ export default {
/* Create a custom checkbox */
.checkmark {
position: absolute;
top: 0;
top: 3px;
left: 0;
height: 16px;
width: 16px;
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/components/ui/AppDateInput.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<template>
<div class="text_label">
<label>{{ label }}</label>
<AppTooltip v-if="tooltip" :tooltipText="tooltipText">
<font-awesome-icon class="tooltip-icon" icon="question-circle" />
</AppTooltip>
<AppTooltip v-if="$slots.tooltip"><slot name="tooltip"></slot></AppTooltip>
</div>
<div v-bind="$attrs">
<Datepicker :autoApply="true" :class="inputClass" :enableTimePicker="false" :format="inputDateFormat" :placeholder="placeholder" :text-input="true" :monthPicker="$attrs.monthPicker" :uid="$attrs.id" v-model="value" />
Expand Down Expand Up @@ -37,8 +35,6 @@ export default {
default: OUTPUT_DATE_FORMAT,
type: String,
},
tooltip: Boolean,
tooltipText: String,
},
computed: {
value: {
Expand Down
34 changes: 34 additions & 0 deletions frontend/src/components/ui/AppHelp.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>
<div class="instructions">
<a href="#" id="show-modal" @click="showModal = true">Instructions</a>
</div>
<Teleport to="body">
<!-- use the modal component, pass in the prop -->
<AppModal :show="showModal" @close="showModal = false">
<template #header>
<h3>Instructions</h3>
</template>
<template #body>
<slot></slot>
</template>
<template #footer></template>
</AppModal>
</Teleport>
</template>
<script>
import AppModal from './AppModal.vue'
export default {
name: 'AppHelp',
components: { AppModal },
data() {
return {
showModal: false,
}
},
}
</script>
<style scoped>
.instructions {
float: right;
}
</style>
32 changes: 17 additions & 15 deletions frontend/src/components/ui/AppInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@ import AppInputError from './AppInputError.vue'
</script>

<template>

<div class="text_label">
<label>{{label}}</label>
<label>{{ label }}</label>
<AppTooltip v-if="$slots.tooltip">
<slot name="tooltip"></slot>
</AppTooltip>
</div>

<input :class="inputClass" :value="modelValue" @input='$emit("update:modelValue", $event.target.value)' v-bind="$attrs"/>

<AppInputError :e-model="eModel" :label="label"/>

<input :class="inputClass" :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" v-bind="$attrs" />

<AppInputError :e-model="eModel" :label="label" />
</template>

<script>
import AppTooltip from './AppTooltip.vue'
export default {
name: 'AppInput',
components: { AppTooltip },
props: {
eModel: {
type: Object,
Expand All @@ -28,11 +31,11 @@ export default {
computed: {
inputClass() {
return {
'text_input': true,
'error-input' : this.eModel?.$error,
text_input: true,
'error-input': this.eModel?.$error,
}
}
}
},
},
}
</script>
Expand All @@ -51,8 +54,8 @@ export default {
padding: 5px 5px 5px 7px;
}
.text_input[type="text"]:focus {
outline: 2px solid #3B99FC;
.text_input[type='text']:focus {
outline: 2px solid #3b99fc;
outline-offset: 1px;
}
Expand All @@ -61,7 +64,6 @@ export default {
}
.error-input {
border-color: #D8292F !important;
border-color: #d8292f !important;
}
</style>
</style>
107 changes: 107 additions & 0 deletions frontend/src/components/ui/AppModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<template>
<Transition name="modal">
<div v-if="show" class="modal-mask" @keydown.esc="$emit('close')" tabindex="0">
<div class="modal-wrapper">
<div class="modal-container" v-draggable="">
<div class="modal-header">
<slot name="header"></slot>
</div>

<div class="modal-body">
<slot name="body"></slot>
</div>

<div class="modal-footer">
<slot name="footer">
<AppButton class="modal-default-button" mode="secondary" @click="$emit('close')">OK</AppButton>
</slot>
</div>
</div>
</div>
</div>
</Transition>
</template>
<script>
export default {
props: {
show: Boolean,
},
}
</script>

<style>
.modal-mask {
position: fixed;
z-index: 9998;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: table;
transition: opacity 0.3s ease;
}
.modal-wrapper {
display: table-cell;
vertical-align: middle;
}
.modal-container {
width: 600px;
margin: 0px auto;
padding: 20px 30px;
background-color: #fff;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);
transition: all 0.3s ease;
cursor: grab;
max-height: 600px;
overflow: auto;
}
.modal-header h3 {
margin-top: 0;
color: #003366;
}
.modal-body {
margin: 20px 0;
}
.modal-footer {
padding-bottom: 40px;
}
.modal-default-button {
float: right;
}
:slotted(ul) {
list-style: disc;
margin-left: 20px;
}
/*
* The following styles are auto-applied to elements with
* transition="modal" when their visibility is toggled
* by Vue.js.
*
* You can easily play with the modal transition by editing
* these styles.
*/
.modal-enter-from {
opacity: 0;
}
.modal-leave-to {
opacity: 0;
}
.modal-enter-from .modal-container,
.modal-leave-to .modal-container {
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
</style>
Loading

0 comments on commit 51e7f40

Please sign in to comment.