| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  | <template> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |   <v-container | 
					
						
							|  |  |  |     v-if="shoppingList" | 
					
						
							|  |  |  |     class="md-container" | 
					
						
							|  |  |  |   > | 
					
						
							|  |  |  |     <BaseDialog | 
					
						
							| 
									
										
										
										
											2025-08-14 00:23:11 -05:00
										 |  |  |       v-model="state.checkAllDialog" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |       :title="$t('general.confirm')" | 
					
						
							|  |  |  |       can-confirm | 
					
						
							|  |  |  |       @confirm="checkAll" | 
					
						
							|  |  |  |     > | 
					
						
							|  |  |  |       <v-card-text> | 
					
						
							|  |  |  |         {{ $t('shopping-list.are-you-sure-you-want-to-check-all-items') }} | 
					
						
							|  |  |  |       </v-card-text> | 
					
						
							| 
									
										
										
										
											2024-06-28 10:37:21 +01:00
										 |  |  |     </BaseDialog> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |     <BaseDialog | 
					
						
							| 
									
										
										
										
											2025-08-14 00:23:11 -05:00
										 |  |  |       v-model="state.uncheckAllDialog" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |       :title="$t('general.confirm')" | 
					
						
							|  |  |  |       can-confirm | 
					
						
							|  |  |  |       @confirm="uncheckAll" | 
					
						
							|  |  |  |     > | 
					
						
							|  |  |  |       <v-card-text> | 
					
						
							|  |  |  |         {{ $t('shopping-list.are-you-sure-you-want-to-uncheck-all-items') }} | 
					
						
							|  |  |  |       </v-card-text> | 
					
						
							| 
									
										
										
										
											2024-06-28 10:37:21 +01:00
										 |  |  |     </BaseDialog> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |     <BaseDialog | 
					
						
							| 
									
										
										
										
											2025-08-14 00:23:11 -05:00
										 |  |  |       v-model="state.deleteCheckedDialog" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |       :title="$t('general.confirm')" | 
					
						
							|  |  |  |       can-confirm | 
					
						
							|  |  |  |       @confirm="deleteChecked" | 
					
						
							|  |  |  |     > | 
					
						
							|  |  |  |       <v-card-text> | 
					
						
							|  |  |  |         {{ $t('shopping-list.are-you-sure-you-want-to-delete-checked-items') }} | 
					
						
							|  |  |  |       </v-card-text> | 
					
						
							| 
									
										
										
										
											2024-06-28 10:37:21 +01:00
										 |  |  |     </BaseDialog> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  |     <!-- Reorder Labels --> | 
					
						
							|  |  |  |     <BaseDialog | 
					
						
							|  |  |  |       v-model="reorderLabelsDialog" | 
					
						
							|  |  |  |       :icon="$globals.icons.tagArrowUp" | 
					
						
							|  |  |  |       :title="$t('shopping-list.reorder-labels')" | 
					
						
							|  |  |  |       :submit-icon="$globals.icons.save" | 
					
						
							|  |  |  |       :submit-text="$t('general.save')" | 
					
						
							|  |  |  |       can-submit | 
					
						
							|  |  |  |       @submit="saveLabelOrder" | 
					
						
							|  |  |  |       @close="cancelLabelOrder" | 
					
						
							|  |  |  |     > | 
					
						
							|  |  |  |       <v-card height="fit-content" max-height="70vh" style="overflow-y: auto;"> | 
					
						
							|  |  |  |         <VueDraggable | 
					
						
							|  |  |  |           v-if="localLabels" | 
					
						
							|  |  |  |           v-model="localLabels" | 
					
						
							|  |  |  |           handle=".handle" | 
					
						
							|  |  |  |           :delay="250" | 
					
						
							|  |  |  |           :delay-on-touch-only="true" | 
					
						
							|  |  |  |           class="my-2" | 
					
						
							|  |  |  |           @update:model-value="updateLabelOrder" | 
					
						
							|  |  |  |         > | 
					
						
							|  |  |  |           <div v-for="(labelSetting, index) in localLabels" :key="labelSetting.id"> | 
					
						
							|  |  |  |             <MultiPurposeLabelSection v-model="localLabels[index]" use-color /> | 
					
						
							|  |  |  |           </div> | 
					
						
							|  |  |  |         </VueDraggable> | 
					
						
							|  |  |  |       </v-card> | 
					
						
							|  |  |  |     </BaseDialog> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |     <BasePageTitle divider> | 
					
						
							|  |  |  |       <template #header> | 
					
						
							| 
									
										
										
										
											2025-09-03 18:26:25 +09:00
										 |  |  |         <v-container class="px-0"> | 
					
						
							|  |  |  |           <v-row no-gutters> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |             <v-col | 
					
						
							|  |  |  |               class="text-left" | 
					
						
							|  |  |  |             > | 
					
						
							|  |  |  |               <ButtonLink | 
					
						
							|  |  |  |                 :to="`/shopping-lists?disableRedirect=true`" | 
					
						
							|  |  |  |                 :text="$t('shopping-list.all-lists')" | 
					
						
							|  |  |  |                 :icon="$globals.icons.backArrow" | 
					
						
							|  |  |  |               /> | 
					
						
							| 
									
										
										
										
											2024-06-21 22:17:39 +10:00
										 |  |  |             </v-col> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |             <v-col | 
					
						
							| 
									
										
										
										
											2025-06-20 11:59:13 +02:00
										 |  |  |               v-if="mdAndUp" | 
					
						
							|  |  |  |               cols="6" | 
					
						
							| 
									
										
										
										
											2025-06-20 04:42:12 -05:00
										 |  |  |               class="d-none d-sm-flex justify-center" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |             > | 
					
						
							|  |  |  |               <v-img | 
					
						
							|  |  |  |                 max-height="100" | 
					
						
							|  |  |  |                 max-width="100" | 
					
						
							| 
									
										
										
										
											2025-09-03 00:44:52 -05:00
										 |  |  |                 src="/svgs/shopping-cart.svg" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |               /> | 
					
						
							| 
									
										
										
										
											2024-06-21 22:17:39 +10:00
										 |  |  |             </v-col> | 
					
						
							| 
									
										
										
										
											2025-01-26 08:04:40 -06:00
										 |  |  |             <v-col class="d-flex justify-end"> | 
					
						
							|  |  |  |               <BaseButtonGroup | 
					
						
							| 
									
										
										
										
											2025-09-03 18:26:25 +09:00
										 |  |  |                 class="d-flex" | 
					
						
							| 
									
										
										
										
											2025-01-26 08:04:40 -06:00
										 |  |  |                 :buttons="[ | 
					
						
							|  |  |  |                   { | 
					
						
							|  |  |  |                     icon: $globals.icons.contentCopy, | 
					
						
							|  |  |  |                     text: '', | 
					
						
							|  |  |  |                     event: 'edit', | 
					
						
							|  |  |  |                     children: [ | 
					
						
							|  |  |  |                       { | 
					
						
							|  |  |  |                         icon: $globals.icons.contentCopy, | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |                         text: $t('shopping-list.copy-as-text'), | 
					
						
							| 
									
										
										
										
											2025-01-26 08:04:40 -06:00
										 |  |  |                         event: 'copy-plain', | 
					
						
							|  |  |  |                       }, | 
					
						
							|  |  |  |                       { | 
					
						
							|  |  |  |                         icon: $globals.icons.contentCopy, | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |                         text: $t('shopping-list.copy-as-markdown'), | 
					
						
							| 
									
										
										
										
											2025-01-26 08:04:40 -06:00
										 |  |  |                         event: 'copy-markdown', | 
					
						
							|  |  |  |                       }, | 
					
						
							|  |  |  |                     ], | 
					
						
							|  |  |  |                   }, | 
					
						
							|  |  |  |                   { | 
					
						
							|  |  |  |                     icon: $globals.icons.checkboxOutline, | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |                     text: $t('shopping-list.check-all-items'), | 
					
						
							| 
									
										
										
										
											2025-01-26 08:04:40 -06:00
										 |  |  |                     event: 'check', | 
					
						
							|  |  |  |                   }, | 
					
						
							|  |  |  |                   { | 
					
						
							|  |  |  |                     icon: $globals.icons.dotsVertical, | 
					
						
							|  |  |  |                     text: '', | 
					
						
							|  |  |  |                     event: 'three-dot', | 
					
						
							|  |  |  |                     children: [ | 
					
						
							|  |  |  |                       { | 
					
						
							|  |  |  |                         icon: $globals.icons.tags, | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |                         text: $t('shopping-list.reorder-labels'), | 
					
						
							| 
									
										
										
										
											2025-01-26 08:04:40 -06:00
										 |  |  |                         event: 'reorder-labels', | 
					
						
							|  |  |  |                       }, | 
					
						
							|  |  |  |                       { | 
					
						
							|  |  |  |                         icon: $globals.icons.tags, | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |                         text: $t('shopping-list.manage-labels'), | 
					
						
							| 
									
										
										
										
											2025-01-26 08:04:40 -06:00
										 |  |  |                         event: 'manage-labels', | 
					
						
							|  |  |  |                       }, | 
					
						
							|  |  |  |                     ], | 
					
						
							|  |  |  |                   }, | 
					
						
							|  |  |  |                 ]" | 
					
						
							|  |  |  |                 @edit="edit = true" | 
					
						
							|  |  |  |                 @three-dot="threeDot = true" | 
					
						
							|  |  |  |                 @check="openCheckAll" | 
					
						
							|  |  |  |                 @copy-plain="copyListItems('plain')" | 
					
						
							|  |  |  |                 @copy-markdown="copyListItems('markdown')" | 
					
						
							|  |  |  |                 @reorder-labels="toggleReorderLabelsDialog()" | 
					
						
							|  |  |  |                 @manage-labels="$router.push(`/group/data/labels`)" | 
					
						
							|  |  |  |               /> | 
					
						
							|  |  |  |             </v-col> | 
					
						
							| 
									
										
										
										
											2024-06-21 22:17:39 +10:00
										 |  |  |           </v-row> | 
					
						
							|  |  |  |         </v-container> | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |       </template> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |       <template #title> | 
					
						
							|  |  |  |         {{ shoppingList.name }} | 
					
						
							|  |  |  |       </template> | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |     </BasePageTitle> | 
					
						
							| 
									
										
										
										
											2024-06-29 04:58:58 -05:00
										 |  |  |     <BannerWarning | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |       v-if="isOffline" | 
					
						
							|  |  |  |       :title="$t('shopping-list.you-are-offline')" | 
					
						
							|  |  |  |       :description="$t('shopping-list.you-are-offline-description')" | 
					
						
							| 
									
										
										
										
											2024-06-29 04:58:58 -05:00
										 |  |  |     /> | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |     <!-- Viewer --> | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  |     <section v-if="!edit" class="py-2 d-flex flex-column ga-4"> | 
					
						
							| 
									
										
										
										
											2025-08-08 00:47:21 +09:00
										 |  |  |       <!-- Create Item --> | 
					
						
							|  |  |  |       <div v-if="createEditorOpen"> | 
					
						
							|  |  |  |         <ShoppingListItemEditor | 
					
						
							|  |  |  |           v-model="createListItemData" | 
					
						
							|  |  |  |           class="my-4" | 
					
						
							|  |  |  |           :labels="allLabels || []" | 
					
						
							|  |  |  |           :units="allUnits || []" | 
					
						
							|  |  |  |           :foods="allFoods || []" | 
					
						
							|  |  |  |           :allow-delete="false" | 
					
						
							|  |  |  |           @delete="createEditorOpen = false" | 
					
						
							|  |  |  |           @cancel="createEditorOpen = false" | 
					
						
							|  |  |  |           @save="createListItem" | 
					
						
							|  |  |  |         /> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  |       <div v-else class="d-flex justify-end"> | 
					
						
							|  |  |  |         <BaseButton | 
					
						
							|  |  |  |           create | 
					
						
							|  |  |  |           @click="createEditorOpen = true" | 
					
						
							|  |  |  |         > | 
					
						
							|  |  |  |           {{ $t('general.add') }} | 
					
						
							|  |  |  |         </BaseButton> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  |       <BaseExpansionPanels v-for="(value, key) in itemsByLabel" :key="key" :v-model="0" start-open> | 
					
						
							|  |  |  |         <v-expansion-panel class="shopping-list-section"> | 
					
						
							|  |  |  |           <v-expansion-panel-title | 
					
						
							|  |  |  |             :color="getLabelColor(key)" | 
					
						
							|  |  |  |             class="body-1 font-weight-bold section-title" | 
					
						
							|  |  |  |           > | 
					
						
							|  |  |  |             {{ key }} | 
					
						
							|  |  |  |           </v-expansion-panel-title> | 
					
						
							|  |  |  |           <v-expansion-panel-text eager> | 
					
						
							| 
									
										
										
										
											2025-08-14 00:23:11 -05:00
										 |  |  |             <VueDraggable | 
					
						
							|  |  |  |               :model-value="value" | 
					
						
							|  |  |  |               handle=".handle" | 
					
						
							|  |  |  |               :delay="250" | 
					
						
							|  |  |  |               :delay-on-touch-only="true" | 
					
						
							|  |  |  |               @start="loadingCounter += 1" | 
					
						
							|  |  |  |               @end="loadingCounter -= 1" | 
					
						
							|  |  |  |               @update:model-value="updateIndexUncheckedByLabel(key.toString(), $event)" | 
					
						
							|  |  |  |             > | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  |               <ShoppingListItem | 
					
						
							| 
									
										
										
										
											2025-08-14 00:23:11 -05:00
										 |  |  |                 v-for="(item, index) in value" | 
					
						
							|  |  |  |                 :key="item.id" | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  |                 v-model="value[index]" | 
					
						
							|  |  |  |                 class="ml-2 my-2 w-auto" | 
					
						
							|  |  |  |                 :labels="allLabels || []" | 
					
						
							|  |  |  |                 :units="allUnits || []" | 
					
						
							|  |  |  |                 :foods="allFoods || []" | 
					
						
							|  |  |  |                 :recipes="recipeMap" | 
					
						
							|  |  |  |                 @checked="saveListItem" | 
					
						
							|  |  |  |                 @save="saveListItem" | 
					
						
							|  |  |  |                 @delete="deleteListItem(item)" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |               /> | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  |             </VueDraggable> | 
					
						
							|  |  |  |           </v-expansion-panel-text> | 
					
						
							|  |  |  |         </v-expansion-panel> | 
					
						
							|  |  |  |       </BaseExpansionPanels> | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  |       <!-- Checked Items --> | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  |       <v-expansion-panels flat> | 
					
						
							|  |  |  |         <v-expansion-panel v-if="listItems.checked && listItems.checked.length > 0"> | 
					
						
							|  |  |  |           <v-expansion-panel-title class="border-solid border-thin py-1"> | 
					
						
							|  |  |  |             <div class="d-flex align-center flex-0-1-100"> | 
					
						
							|  |  |  |               <div class="flex-1-0"> | 
					
						
							|  |  |  |                 {{ $t('shopping-list.items-checked-count', listItems.checked ? listItems.checked.length : 0) }} | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |               <div class="justify-end"> | 
					
						
							|  |  |  |                 <BaseButtonGroup | 
					
						
							|  |  |  |                   :buttons="[ | 
					
						
							|  |  |  |                     { | 
					
						
							|  |  |  |                       icon: $globals.icons.checkboxBlankOutline, | 
					
						
							|  |  |  |                       text: $t('shopping-list.uncheck-all-items'), | 
					
						
							|  |  |  |                       event: 'uncheck', | 
					
						
							|  |  |  |                     }, | 
					
						
							|  |  |  |                     { | 
					
						
							|  |  |  |                       icon: $globals.icons.delete, | 
					
						
							|  |  |  |                       text: $t('shopping-list.delete-checked'), | 
					
						
							|  |  |  |                       event: 'delete', | 
					
						
							|  |  |  |                     }, | 
					
						
							|  |  |  |                   ]" | 
					
						
							|  |  |  |                   @uncheck="openUncheckAll" | 
					
						
							|  |  |  |                   @delete="openDeleteChecked" | 
					
						
							|  |  |  |                 /> | 
					
						
							|  |  |  |               </div> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |           </v-expansion-panel-title> | 
					
						
							|  |  |  |           <v-expansion-panel-text eager> | 
					
						
							|  |  |  |             <div v-for="(item, idx) in listItems.checked" :key="item.id"> | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  |               <ShoppingListItem | 
					
						
							|  |  |  |                 v-model="listItems.checked[idx]" | 
					
						
							|  |  |  |                 class="strike-through-note" | 
					
						
							| 
									
										
										
										
											2023-01-28 18:45:02 -06:00
										 |  |  |                 :labels="allLabels || []" | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  |                 :units="allUnits || []" | 
					
						
							|  |  |  |                 :foods="allFoods || []" | 
					
						
							| 
									
										
										
										
											2023-01-08 11:23:24 -06:00
										 |  |  |                 @checked="saveListItem" | 
					
						
							|  |  |  |                 @save="saveListItem" | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  |                 @delete="deleteListItem(item)" | 
					
						
							|  |  |  |               /> | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |             </div> | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  |           </v-expansion-panel-text> | 
					
						
							|  |  |  |         </v-expansion-panel> | 
					
						
							|  |  |  |       </v-expansion-panels> | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |     </section> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  |     <!-- Recipe References --> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |     <v-lazy | 
					
						
							|  |  |  |       v-if="shoppingList.recipeReferences && shoppingList.recipeReferences.length > 0" | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  |       class="mt-6" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |     > | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  |       <section> | 
					
						
							|  |  |  |         <div> | 
					
						
							|  |  |  |           <span> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |             <v-icon start class="mb-1"> | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  |               {{ $globals.icons.primary }} | 
					
						
							|  |  |  |             </v-icon> | 
					
						
							|  |  |  |           </span> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |           {{ $t('shopping-list.linked-recipes-count', shoppingList.recipeReferences | 
					
						
							|  |  |  |             ? shoppingList.recipeReferences.length | 
					
						
							|  |  |  |             : 0) }} | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |         </div> | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  |         <v-divider /> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |         <RecipeList | 
					
						
							| 
									
										
										
										
											2025-08-14 00:23:11 -05:00
										 |  |  |           :recipes="recipeList" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |           show-description | 
					
						
							|  |  |  |           :disabled="isOffline" | 
					
						
							|  |  |  |         > | 
					
						
							|  |  |  |           <template | 
					
						
							| 
									
										
										
										
											2025-08-14 00:23:11 -05:00
										 |  |  |             v-for="(recipe, index) in recipeList" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |             #[`actions-${recipe.id}`] | 
					
						
							|  |  |  |             :key="'item-actions-decrease' + recipe.id" | 
					
						
							|  |  |  |           > | 
					
						
							|  |  |  |             <v-list-item-action> | 
					
						
							|  |  |  |               <v-btn | 
					
						
							|  |  |  |                 v-if="recipe" | 
					
						
							|  |  |  |                 icon | 
					
						
							| 
									
										
										
										
											2025-07-30 20:37:02 +02:00
										 |  |  |                 flat | 
					
						
							|  |  |  |                 class="bg-transparent" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |                 :disabled="isOffline" | 
					
						
							|  |  |  |                 @click.prevent="removeRecipeReferenceToList(recipe.id!)" | 
					
						
							|  |  |  |               > | 
					
						
							|  |  |  |                 <v-icon color="grey-lighten-1"> | 
					
						
							|  |  |  |                   {{ $globals.icons.minus }} | 
					
						
							|  |  |  |                 </v-icon> | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  |               </v-btn> | 
					
						
							|  |  |  |             </v-list-item-action> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |             <div class="pl-3"> | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  |               {{ shoppingList.recipeReferences[index].recipeQuantity }} | 
					
						
							|  |  |  |             </div> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |             <v-list-item-action> | 
					
						
							|  |  |  |               <v-btn | 
					
						
							|  |  |  |                 icon | 
					
						
							|  |  |  |                 :disabled="isOffline" | 
					
						
							| 
									
										
										
										
											2025-07-30 20:37:02 +02:00
										 |  |  |                 flat | 
					
						
							|  |  |  |                 class="bg-transparent" | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |                 @click.prevent="addRecipeReferenceToList(recipe.id!)" | 
					
						
							|  |  |  |               > | 
					
						
							|  |  |  |                 <v-icon color="grey-lighten-1"> | 
					
						
							|  |  |  |                   {{ $globals.icons.createAlt }} | 
					
						
							|  |  |  |                 </v-icon> | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  |               </v-btn> | 
					
						
							|  |  |  |             </v-list-item-action> | 
					
						
							|  |  |  |           </template> | 
					
						
							|  |  |  |         </RecipeList> | 
					
						
							|  |  |  |       </section> | 
					
						
							|  |  |  |     </v-lazy> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |     <WakelockSwitch /> | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |   </v-container> | 
					
						
							|  |  |  | </template> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script lang="ts"> | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  | import { VueDraggable } from "vue-draggable-plus"; | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  | import RecipeList from "~/components/Domain/Recipe/RecipeList.vue"; | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  | import MultiPurposeLabelSection from "~/components/Domain/ShoppingList/MultiPurposeLabelSection.vue"; | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  | import ShoppingListItem from "~/components/Domain/ShoppingList/ShoppingListItem.vue"; | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  | import ShoppingListItemEditor from "~/components/Domain/ShoppingList/ShoppingListItemEditor.vue"; | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  | import { useShoppingListPage } from "~/composables/shopping-list-page/use-shopping-list-page"; | 
					
						
							| 
									
										
										
										
											2022-06-25 14:39:38 -05:00
										 |  |  | import { useFoodStore, useLabelStore, useUnitStore } from "~/composables/store"; | 
					
						
							| 
									
										
										
										
											2024-10-01 10:47:51 -05:00
										 |  |  | import { getTextColor } from "~/composables/use-text-color"; | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  | import { useShoppingListPreferences } from "~/composables/use-users/preferences"; | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  | export default defineNuxtComponent({ | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |   components: { | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |     VueDraggable, | 
					
						
							| 
									
										
										
										
											2023-02-21 21:58:41 -06:00
										 |  |  |     MultiPurposeLabelSection, | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |     ShoppingListItem, | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  |     RecipeList, | 
					
						
							|  |  |  |     ShoppingListItemEditor, | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |   }, | 
					
						
							|  |  |  |   setup() { | 
					
						
							| 
									
										
										
										
											2025-06-20 11:59:13 +02:00
										 |  |  |     const { mdAndUp } = useDisplay(); | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |     const i18n = useI18n(); | 
					
						
							|  |  |  |     const $auth = useMealieAuth(); | 
					
						
							| 
									
										
										
										
											2023-02-21 21:58:41 -06:00
										 |  |  |     const preferences = useShoppingListPreferences(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |     useSeoMeta({ | 
					
						
							|  |  |  |       title: i18n.t("shopping-list.shopping-list"), | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |     const route = useRoute(); | 
					
						
							| 
									
										
										
										
											2025-06-20 00:09:12 +07:00
										 |  |  |     const groupSlug = computed(() => route.params.groupSlug as string || $auth.user.value?.groupSlug || ""); | 
					
						
							|  |  |  |     const id = route.params.id as string; | 
					
						
							| 
									
										
										
										
											2024-05-04 22:27:04 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-14 00:23:11 -05:00
										 |  |  |     const shoppingListPage = useShoppingListPage(id); | 
					
						
							| 
									
										
										
										
											2024-09-22 09:59:20 -05:00
										 |  |  |     const { store: allLabels } = useLabelStore(); | 
					
						
							|  |  |  |     const { store: allUnits } = useUnitStore(); | 
					
						
							|  |  |  |     const { store: allFoods } = useFoodStore(); | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  | 
 | 
					
						
							|  |  |  |     return { | 
					
						
							| 
									
										
										
										
											2023-11-05 19:07:02 -06:00
										 |  |  |       groupSlug, | 
					
						
							| 
									
										
										
										
											2023-02-21 21:58:41 -06:00
										 |  |  |       preferences, | 
					
						
							| 
									
										
										
										
											2025-08-14 00:23:11 -05:00
										 |  |  |       allLabels, | 
					
						
							| 
									
										
										
										
											2022-01-16 15:24:24 -09:00
										 |  |  |       allUnits, | 
					
						
							|  |  |  |       allFoods, | 
					
						
							| 
									
										
										
										
											2024-10-01 10:47:51 -05:00
										 |  |  |       getTextColor, | 
					
						
							| 
									
										
										
										
											2025-06-20 11:59:13 +02:00
										 |  |  |       mdAndUp, | 
					
						
							| 
									
										
										
										
											2025-08-14 00:23:11 -05:00
										 |  |  |       ...shoppingListPage, | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  |     }; | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  | <style> | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  | .number-input-container { | 
					
						
							|  |  |  |   max-width: 50px; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-10-24 09:43:55 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | .shopping-list-section { | 
					
						
							|  |  |  |   .section-title { | 
					
						
							|  |  |  |     font-size: 1rem; | 
					
						
							|  |  |  |     min-height: 48px !important; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   .v-expansion-panel-text__wrapper { | 
					
						
							|  |  |  |     padding: 0; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-01-08 22:24:34 -09:00
										 |  |  | </style> |