|
6 | 6 | v-show="!loading && !hide"
|
7 | 7 | class="modal"
|
8 | 8 | role="document"
|
9 |
| - :class="[ |
10 |
| - modalClass ?? 'flx --flxColumn --flx-start-stretch --width', |
11 |
| - `--bgColor-${themeValues[1]}`, |
12 |
| - ]" |
| 9 | + :class="[modalClass ?? 'flx --flxColumn --flx-start-stretch --width', themeClasses]" |
13 | 10 | v-bind="$attrs"
|
14 | 11 | >
|
15 |
| - <slot name="modal-header" v-bind="{ toggleModal, model }"> |
| 12 | + <slot name="modal-header" v-bind="{ toggleModal, model, invertedTheme }"> |
16 | 13 | <div v-if="title" class="flx --flxRow --flx-between-center">
|
17 | 14 | <div class="txt --gaping-none">
|
18 | 15 | <h5>{{ title }}</h5>
|
19 | 16 | <p v-if="subtitle" class="--txtSize-xs">{{ subtitle }}</p>
|
20 | 17 | </div>
|
21 | 18 | <ActionLink
|
22 |
| - :theme="theme" |
| 19 | + :theme="invertedTheme" |
23 | 20 | :aria-label="cancelButtonOptions.title"
|
24 | 21 | @click.stop="closeModal()"
|
25 | 22 | >
|
26 | 23 | <IconFa name="xmark" size="20" />
|
27 | 24 | </ActionLink>
|
28 | 25 | </div>
|
29 | 26 | </slot>
|
30 |
| - <div class="scroll --vertical"><slot v-bind="{ toggleModal, model }"></slot></div> |
31 |
| - <slot name="modal-footer" v-bind="{ toggleModal, model }"> |
| 27 | + <div class="scroll --vertical"> |
| 28 | + <!-- Main modal content --> |
| 29 | + <slot v-bind="{ toggleModal, model, invertedTheme }"></slot> |
| 30 | + </div> |
| 31 | + <slot name="modal-footer" v-bind="{ toggleModal, model, invertedTheme }"> |
32 | 32 | <div v-if="!hideFooter" class="flx --flxRow --flx-end-center">
|
33 | 33 | <ActionButton
|
34 | 34 | v-if="saveButtonOptions.visible"
|
35 |
| - :theme="theme" |
| 35 | + :theme="invertedTheme" |
36 | 36 | :aria-label="saveButtonOptions.title"
|
37 | 37 | :class="saveButtonOptions.btnClass"
|
38 | 38 | @click="emit('save', closeModal, $event)"
|
|
41 | 41 | </ActionButton>
|
42 | 42 | <ActionButtonToggle
|
43 | 43 | v-if="cancelButtonOptions.visible"
|
44 |
| - :theme="theme" |
| 44 | + :theme="invertedTheme" |
45 | 45 | :aria-label="cancelButtonOptions.title"
|
46 | 46 | :class="cancelButtonOptions.btnClass"
|
47 | 47 | data-dismiss="modal"
|
|
57 | 57 | </div>
|
58 | 58 | </slot>
|
59 | 59 | </div>
|
60 |
| - <LoaderSimple v-if="loading || hide" :theme="theme"> |
| 60 | + <LoaderSimple v-if="loading || hide" :theme="invertedTheme"> |
61 | 61 | <transition name="fade">
|
62 | 62 | <div
|
63 | 63 | v-if="loadingTooLong || (props.hide && props.hideMessage)"
|
|
66 | 66 | <p class="--txtColor-light --txtShadow --txtSize-sm">
|
67 | 67 | {{ props.hideMessage ? props.hideMessage : t("modal_taking_too_long") }}
|
68 | 68 | </p>
|
69 |
| - <ActionButton :theme="theme" :aria-label="t('close')" @click="closeModal()"> |
| 69 | + <ActionButton |
| 70 | + :theme="invertedTheme" |
| 71 | + :aria-label="t('close')" |
| 72 | + @click="closeModal()" |
| 73 | + > |
70 | 74 | {{ t("close") }}
|
71 | 75 | </ActionButton>
|
72 | 76 | </div>
|
73 | 77 | </transition>
|
74 | 78 | </LoaderSimple>
|
75 | 79 | </dialog>
|
76 | 80 | </Teleport>
|
77 |
| - <slot v-else v-bind="{ toggleModal, model }"></slot> |
| 81 | + <slot v-else v-bind="{ toggleModal, model, invertedTheme }"></slot> |
78 | 82 | </template>
|
79 | 83 |
|
80 | 84 | <script setup lang="ts">
|
|
160 | 164 |
|
161 | 165 | const { t } = useHelpers(useI18n);
|
162 | 166 | const Swal = useHelpers(useSwal);
|
163 |
| - const { themeValues } = useTheme(props, true); |
| 167 | + const { themeClasses, invertedTheme } = useTheme(props, true); |
164 | 168 | const { uuid } = useUUID();
|
165 | 169 |
|
166 | 170 | const resolver = ref<(r?: boolean) => void>();
|
|
0 commit comments