@@ -37,9 +37,25 @@ const { title, allowPrint, showConfirmationButtons, fluid, headerPrimary, top, h
3737 type: Boolean ,
3838 default: false ,
3939 },
40+ confirmKey: {
41+ type: String ,
42+ default: ' success' ,
43+ },
44+ cancelKey: {
45+ type: String ,
46+ default: ' cancel' ,
47+ },
48+ confirmIcon: {
49+ type: String ,
50+ default: null ,
51+ },
52+ cancelIcon: {
53+ type: String ,
54+ default: null ,
55+ },
4056 /**
41- * Hide the modal with backdrop, can be used to temporarily hide the modal without loosing its
42- * content
57+ * Hide the modal with backdrop, can be used to temporarily hide the modal without loosing
58+ * its content
4359 */
4460 hide: {
4561 type: Boolean ,
@@ -69,7 +85,7 @@ function onHideParentModal(hide) {
6985<template >
7086 <teleport to =" #main-component" >
7187 <!-- Must teleport inside main-component in order for dynamic outlines to work and to be
72- sure that it is always on top of the reset . -->
88+ sure that it is always on top of the rest . -->
7389 <div
7490 v-show =" !hide && !hideForPrint"
7591 data-cy =" modal-with-backdrop"
@@ -94,11 +110,11 @@ function onHideParentModal(hide) {
94110 >
95111 <div
96112 class =" card-header d-flex align-middle"
97- :class =" { 'bg-primary text-white border-primary': headerPrimary }"
113+ :class =" { 'bg-primary border-primary text-white ': headerPrimary }"
98114 >
99115 <span
100116 v-if =" title"
101- class =" flex-grow-1 text-start text-truncate "
117+ class =" flex-grow-1 text-truncate text-start "
102118 data-cy =" modal-with-backdrop-title"
103119 >
104120 {{ title }}
@@ -122,27 +138,35 @@ function onHideParentModal(hide) {
122138 </div >
123139 <div
124140 ref =" modalContent"
125- class =" card-body pt-3 ps-4 pe-4 "
141+ class =" card-body pe-4 ps-4 pt-3 "
126142 data-cy =" modal-content"
127143 >
128144 <slot />
129145 <div
130146 v-if =" showConfirmationButtons"
131- class =" mt-1 d-flex justify-content-end"
147+ class =" d-flex justify-content-end mt-1 "
132148 >
133149 <button
134150 class =" btn btn-light me-2"
135151 data-cy =" modal-cancel-button"
136152 @click.stop =" onClose(false)"
137153 >
138- {{ t('cancel') }}
154+ <FontAwesomeIcon
155+ v-if =" !!cancelIcon"
156+ :icon =" cancelIcon"
157+ ></FontAwesomeIcon >
158+ {{ t(cancelKey) }}
139159 </button >
140160 <button
141161 class =" btn btn-primary"
142162 data-cy =" modal-confirm-button"
143163 @click.stop =" onClose(true)"
144164 >
145- {{ t('success') }}
165+ <FontAwesomeIcon
166+ v-if =" !!confirmIcon"
167+ :icon =" confirmIcon"
168+ ></FontAwesomeIcon >
169+ {{ t(confirmKey) }}
146170 </button >
147171 </div >
148172 </div >
0 commit comments