refactor: replace common confirm dialogs with maintenance CRUD dialogs and streamline form handling in MasterDetailMntC.vue and SingleRecordMnt.vue
This commit is contained in:
@@ -28,17 +28,43 @@ v-if="favoritesConfig.showAdd" class="favorite-add" color="primary" size="small"
|
||||
</v-col>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup lang="ts">
|
||||
import { mdiEyeOff, mdiPlus } from '@mdi/js'
|
||||
defineProps({
|
||||
features: { type: Object, default: () => ({}) },
|
||||
showFavoritesBar: { type: Boolean, default: true },
|
||||
isMobile: { type: Boolean, default: false },
|
||||
favoritesConfig: { type: Object, default: () => ({}) },
|
||||
favoriteItems: { type: Array, default: () => [] },
|
||||
import type { AdminLayoutFavoritesConfig, AdminLayoutFeatures, AdminLayoutMenuItem } from './types'
|
||||
|
||||
interface Props {
|
||||
features?: AdminLayoutFeatures
|
||||
showFavoritesBar?: boolean
|
||||
isMobile?: boolean
|
||||
favoritesConfig?: AdminLayoutFavoritesConfig
|
||||
favoriteItems?: AdminLayoutMenuItem[]
|
||||
}
|
||||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
features: () => ({
|
||||
showThemeToggle: false,
|
||||
showFavorites: true,
|
||||
showBreadcrumb: true,
|
||||
showSearch: true,
|
||||
showToolbarActions: true,
|
||||
showUserInfo: true,
|
||||
}),
|
||||
showFavoritesBar: true,
|
||||
isMobile: false,
|
||||
favoritesConfig: () => ({
|
||||
label: '',
|
||||
addLabel: '',
|
||||
showAdd: false,
|
||||
}),
|
||||
favoriteItems: () => [],
|
||||
})
|
||||
|
||||
const emit = defineEmits(['select', 'add-favorite', 'remove-favorite', 'toggle-favorites-bar'])
|
||||
const emit = defineEmits<{
|
||||
select: [item: AdminLayoutMenuItem]
|
||||
'add-favorite': []
|
||||
'remove-favorite': [item: AdminLayoutMenuItem]
|
||||
'toggle-favorites-bar': [value: boolean]
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user