| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  | <template> | 
					
						
							|  |  |  |   <BaseDialog | 
					
						
							|  |  |  |     v-model="dialog" | 
					
						
							|  |  |  |     :icon="$globals.icons.printerSettings" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |     :title="$t('general.print-preferences')" | 
					
						
							| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  |     width="70%" | 
					
						
							| 
									
										
										
										
											2023-03-21 14:52:18 -05:00
										 |  |  |     max-width="816px" | 
					
						
							| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  |   > | 
					
						
							|  |  |  |     <div class="pa-6"> | 
					
						
							|  |  |  |       <v-container class="print-config mb-3 pa-0"> | 
					
						
							|  |  |  |         <v-row> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |           <v-col | 
					
						
							|  |  |  |             cols="auto" | 
					
						
							|  |  |  |             align-self="center" | 
					
						
							|  |  |  |             class="text-center" | 
					
						
							|  |  |  |           > | 
					
						
							|  |  |  |             <div | 
					
						
							|  |  |  |               class="text-subtitle-2" | 
					
						
							|  |  |  |               style="text-align: center;" | 
					
						
							|  |  |  |             > | 
					
						
							|  |  |  |               {{ $t('recipe.recipe-image') }} | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |             <v-btn-toggle | 
					
						
							|  |  |  |               v-model="preferences.imagePosition" | 
					
						
							|  |  |  |               mandatory="force" | 
					
						
							|  |  |  |               style="width: fit-content;" | 
					
						
							|  |  |  |             > | 
					
						
							| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  |               <v-btn :value="ImagePosition.left"> | 
					
						
							|  |  |  |                 <v-icon>{{ $globals.icons.dockLeft }}</v-icon> | 
					
						
							|  |  |  |               </v-btn> | 
					
						
							|  |  |  |               <v-btn :value="ImagePosition.right"> | 
					
						
							|  |  |  |                 <v-icon>{{ $globals.icons.dockRight }}</v-icon> | 
					
						
							|  |  |  |               </v-btn> | 
					
						
							|  |  |  |               <v-btn :value="ImagePosition.hidden"> | 
					
						
							|  |  |  |                 <v-icon>{{ $globals.icons.windowClose }}</v-icon> | 
					
						
							|  |  |  |               </v-btn> | 
					
						
							|  |  |  |             </v-btn-toggle> | 
					
						
							|  |  |  |           </v-col> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |           <v-col | 
					
						
							|  |  |  |             cols="auto" | 
					
						
							|  |  |  |             align-self="start" | 
					
						
							|  |  |  |           > | 
					
						
							| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  |             <v-row no-gutters> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |               <v-switch | 
					
						
							|  |  |  |                 v-model="preferences.showDescription" | 
					
						
							|  |  |  |                 hide-details | 
					
						
							| 
									
										
										
										
											2025-07-30 20:37:02 +02:00
										 |  |  |                 color="primary" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |                 :label="$t('recipe.description')" | 
					
						
							|  |  |  |               /> | 
					
						
							| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  |             </v-row> | 
					
						
							|  |  |  |             <v-row no-gutters> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |               <v-switch | 
					
						
							|  |  |  |                 v-model="preferences.showNotes" | 
					
						
							|  |  |  |                 hide-details | 
					
						
							| 
									
										
										
										
											2025-07-30 20:37:02 +02:00
										 |  |  |                 color="primary" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |                 :label="$t('recipe.notes')" | 
					
						
							|  |  |  |               /> | 
					
						
							| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  |             </v-row> | 
					
						
							|  |  |  |           </v-col> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |           <v-col | 
					
						
							|  |  |  |             cols="auto" | 
					
						
							|  |  |  |             align-self="start" | 
					
						
							|  |  |  |           > | 
					
						
							| 
									
										
										
										
											2024-06-18 11:08:22 +02:00
										 |  |  |             <v-row no-gutters> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |               <v-switch | 
					
						
							|  |  |  |                 v-model="preferences.showNutrition" | 
					
						
							|  |  |  |                 hide-details | 
					
						
							| 
									
										
										
										
											2025-07-30 20:37:02 +02:00
										 |  |  |                 color="primary" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |                 :label="$t('recipe.nutrition')" | 
					
						
							|  |  |  |               /> | 
					
						
							| 
									
										
										
										
											2024-06-18 11:08:22 +02:00
										 |  |  |             </v-row> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |             <v-row no-gutters /> | 
					
						
							| 
									
										
										
										
											2024-06-18 11:08:22 +02:00
										 |  |  |           </v-col> | 
					
						
							| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  |         </v-row> | 
					
						
							|  |  |  |       </v-container> | 
					
						
							|  |  |  |       <v-card | 
					
						
							|  |  |  |         height="fit-content" | 
					
						
							|  |  |  |         max-height="40vh" | 
					
						
							|  |  |  |         width="100%" | 
					
						
							|  |  |  |         class="print-preview" | 
					
						
							|  |  |  |         style="overflow-y: auto;" | 
					
						
							|  |  |  |       > | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |         <RecipePrintView :recipe="recipe" /> | 
					
						
							| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  |       </v-card> | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |   </BaseDialog> | 
					
						
							|  |  |  | </template> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-30 20:37:02 +02:00
										 |  |  | <script setup lang="ts"> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  | import type { Recipe } from "~/lib/api/types/recipe"; | 
					
						
							| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  | import { ImagePosition, useUserPrintPreferences } from "~/composables/use-users/preferences"; | 
					
						
							|  |  |  | import RecipePrintView from "~/components/Domain/Recipe/RecipePrintView.vue"; | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  | import type { NoUndefinedField } from "~/lib/api/types/non-generated"; | 
					
						
							| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-30 20:37:02 +02:00
										 |  |  | interface Props { | 
					
						
							|  |  |  |   recipe?: NoUndefinedField<Recipe>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | withDefaults(defineProps<Props>(), { | 
					
						
							|  |  |  |   recipe: undefined, | 
					
						
							| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  | }); | 
					
						
							| 
									
										
										
										
											2025-07-30 20:37:02 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | const dialog = defineModel<boolean>({ default: false }); | 
					
						
							|  |  |  | const preferences = useUserPrintPreferences(); | 
					
						
							| 
									
										
										
										
											2023-02-19 18:37:18 -06:00
										 |  |  | </script> |