@mapomodule/uikit 1.0.0 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +199 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/module.d.mts +60 -0
- package/dist/module.d.ts +55 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +179 -0
- package/dist/runtime/adapters/defaultMediaAdapter.d.ts +14 -0
- package/dist/runtime/adapters/defaultMediaAdapter.d.ts.map +1 -0
- package/dist/runtime/adapters/defaultMediaAdapter.js +30 -0
- package/dist/runtime/assets/main.css +1 -0
- package/dist/runtime/components/MapoConfirmDialog.vue +35 -0
- package/dist/runtime/components/MapoConfirmDialog.vue.d.ts +4 -0
- package/dist/runtime/components/MapoConfirmDialog.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoDetail.vue +606 -0
- package/dist/runtime/components/MapoDetail.vue.d.ts +401 -0
- package/dist/runtime/components/MapoDetail.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoDetailLangSwitch.vue +126 -0
- package/dist/runtime/components/MapoDetailLangSwitch.vue.d.ts +23 -0
- package/dist/runtime/components/MapoDetailLangSwitch.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoDropArea.vue +99 -0
- package/dist/runtime/components/MapoDropArea.vue.d.ts +33 -0
- package/dist/runtime/components/MapoDropArea.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoLangSwitcher.vue +39 -0
- package/dist/runtime/components/MapoLangSwitcher.vue.d.ts +18 -0
- package/dist/runtime/components/MapoLangSwitcher.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoList.vue +191 -0
- package/dist/runtime/components/MapoList.vue.d.ts +111 -0
- package/dist/runtime/components/MapoList.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListActions.vue +119 -0
- package/dist/runtime/components/MapoListActions.vue.d.ts +33 -0
- package/dist/runtime/components/MapoListActions.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListFilters.vue +246 -0
- package/dist/runtime/components/MapoListFilters.vue.d.ts +38 -0
- package/dist/runtime/components/MapoListFilters.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListHead.vue +9 -0
- package/dist/runtime/components/MapoListHead.vue.d.ts +14 -0
- package/dist/runtime/components/MapoListHead.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListQuickEdit.vue +123 -0
- package/dist/runtime/components/MapoListQuickEdit.vue.d.ts +47 -0
- package/dist/runtime/components/MapoListQuickEdit.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListTable.vue +665 -0
- package/dist/runtime/components/MapoListTable.vue.d.ts +105 -0
- package/dist/runtime/components/MapoListTable.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListTabs.vue +38 -0
- package/dist/runtime/components/MapoListTabs.vue.d.ts +26 -0
- package/dist/runtime/components/MapoListTabs.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoLogin.vue +196 -0
- package/dist/runtime/components/MapoLogin.vue.d.ts +22 -0
- package/dist/runtime/components/MapoLogin.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoLogoutButton.vue +27 -0
- package/dist/runtime/components/MapoLogoutButton.vue.d.ts +29 -0
- package/dist/runtime/components/MapoLogoutButton.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaBreadcrumbs.vue +47 -0
- package/dist/runtime/components/MapoMediaBreadcrumbs.vue.d.ts +4 -0
- package/dist/runtime/components/MapoMediaBreadcrumbs.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaEditor.vue +320 -0
- package/dist/runtime/components/MapoMediaEditor.vue.d.ts +8 -0
- package/dist/runtime/components/MapoMediaEditor.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaFileChanger.vue +112 -0
- package/dist/runtime/components/MapoMediaFileChanger.vue.d.ts +15 -0
- package/dist/runtime/components/MapoMediaFileChanger.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaFolders.vue +220 -0
- package/dist/runtime/components/MapoMediaFolders.vue.d.ts +4 -0
- package/dist/runtime/components/MapoMediaFolders.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaGallery.vue +219 -0
- package/dist/runtime/components/MapoMediaGallery.vue.d.ts +4 -0
- package/dist/runtime/components/MapoMediaGallery.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaManager.vue +140 -0
- package/dist/runtime/components/MapoMediaManager.vue.d.ts +35 -0
- package/dist/runtime/components/MapoMediaManager.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaManagerDialog.vue +116 -0
- package/dist/runtime/components/MapoMediaManagerDialog.vue.d.ts +41 -0
- package/dist/runtime/components/MapoMediaManagerDialog.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaPreview.vue +92 -0
- package/dist/runtime/components/MapoMediaPreview.vue.d.ts +19 -0
- package/dist/runtime/components/MapoMediaPreview.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaUploader.vue +290 -0
- package/dist/runtime/components/MapoMediaUploader.vue.d.ts +8 -0
- package/dist/runtime/components/MapoMediaUploader.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMenuManager.vue +273 -0
- package/dist/runtime/components/MapoMenuManager.vue.d.ts +92 -0
- package/dist/runtime/components/MapoMenuManager.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMenuNodeEditor.vue +201 -0
- package/dist/runtime/components/MapoMenuNodeEditor.vue.d.ts +61 -0
- package/dist/runtime/components/MapoMenuNodeEditor.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMenuTreeview.vue +181 -0
- package/dist/runtime/components/MapoMenuTreeview.vue.d.ts +57 -0
- package/dist/runtime/components/MapoMenuTreeview.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMenuTreeviewNode.vue +175 -0
- package/dist/runtime/components/MapoMenuTreeviewNode.vue.d.ts +27 -0
- package/dist/runtime/components/MapoMenuTreeviewNode.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoRootComponents.vue +9 -0
- package/dist/runtime/components/MapoRootComponents.vue.d.ts +4 -0
- package/dist/runtime/components/MapoRootComponents.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebar.vue +89 -0
- package/dist/runtime/components/MapoSidebar.vue.d.ts +22 -0
- package/dist/runtime/components/MapoSidebar.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebarList.vue +27 -0
- package/dist/runtime/components/MapoSidebarList.vue.d.ts +8 -0
- package/dist/runtime/components/MapoSidebarList.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebarListItem.vue +74 -0
- package/dist/runtime/components/MapoSidebarListItem.vue.d.ts +9 -0
- package/dist/runtime/components/MapoSidebarListItem.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebarProfile.vue +55 -0
- package/dist/runtime/components/MapoSidebarProfile.vue.d.ts +10 -0
- package/dist/runtime/components/MapoSidebarProfile.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSnackBar.vue +38 -0
- package/dist/runtime/components/MapoSnackBar.vue.d.ts +4 -0
- package/dist/runtime/components/MapoSnackBar.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoThemeToggle.vue +23 -0
- package/dist/runtime/components/MapoThemeToggle.vue.d.ts +4 -0
- package/dist/runtime/components/MapoThemeToggle.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoTopbar.vue +30 -0
- package/dist/runtime/components/MapoTopbar.vue.d.ts +15 -0
- package/dist/runtime/components/MapoTopbar.vue.d.ts.map +1 -0
- package/dist/runtime/components/menuDndContext.d.ts +19 -0
- package/dist/runtime/components/menuDndContext.d.ts.map +1 -0
- package/dist/runtime/components/menuDndContext.js +3 -0
- package/dist/runtime/layouts/default.vue +43 -0
- package/dist/runtime/layouts/default.vue.d.ts +20 -0
- package/dist/runtime/layouts/default.vue.d.ts.map +1 -0
- package/dist/runtime/layouts/empty.vue +9 -0
- package/dist/runtime/layouts/empty.vue.d.ts +14 -0
- package/dist/runtime/layouts/empty.vue.d.ts.map +1 -0
- package/dist/runtime/page-meta.nuxt.d.ts +45 -0
- package/dist/runtime/pages/index.vue +14 -0
- package/dist/runtime/pages/index.vue.d.ts +4 -0
- package/dist/runtime/pages/index.vue.d.ts.map +1 -0
- package/dist/runtime/pages/login.vue +3 -0
- package/dist/runtime/pages/login.vue.d.ts +4 -0
- package/dist/runtime/pages/login.vue.d.ts.map +1 -0
- package/dist/runtime/plugins/media-adapter.d.ts +18 -0
- package/dist/runtime/plugins/media-adapter.d.ts.map +1 -0
- package/dist/runtime/plugins/media-adapter.js +8 -0
- package/dist/runtime/stores/media.d.ts +462 -0
- package/dist/runtime/stores/media.d.ts.map +1 -0
- package/dist/runtime/stores/media.js +344 -0
- package/dist/runtime/types/list.d.ts +59 -0
- package/dist/runtime/types/list.d.ts.map +1 -0
- package/dist/runtime/types/list.js +0 -0
- package/dist/runtime/types/media.d.ts +116 -0
- package/dist/runtime/types/media.d.ts.map +1 -0
- package/dist/runtime/types/media.js +0 -0
- package/dist/runtime/types/menu.d.ts +66 -0
- package/dist/runtime/types/menu.d.ts.map +1 -0
- package/dist/runtime/types/menu.js +30 -0
- package/dist/types.d.mts +9 -0
- package/package.json +67 -12
- package/src/index.ts +30 -0
- package/src/module.ts +311 -0
- package/src/runtime/adapters/defaultMediaAdapter.ts +57 -0
- package/src/runtime/assets/main.css +59 -0
- package/src/runtime/components/MapoConfirmDialog.vue +36 -0
- package/src/runtime/components/MapoDetail.vue +864 -0
- package/src/runtime/components/MapoDetailLangSwitch.vue +166 -0
- package/src/runtime/components/MapoDropArea.vue +127 -0
- package/src/runtime/components/MapoLangSwitcher.vue +74 -0
- package/src/runtime/components/MapoList.vue +339 -0
- package/src/runtime/components/MapoListActions.vue +158 -0
- package/src/runtime/components/MapoListFilters.vue +292 -0
- package/src/runtime/components/MapoListHead.vue +12 -0
- package/src/runtime/components/MapoListQuickEdit.vue +166 -0
- package/src/runtime/components/MapoListTable.vue +931 -0
- package/src/runtime/components/MapoListTabs.vue +48 -0
- package/src/runtime/components/MapoLogin.vue +212 -0
- package/src/runtime/components/MapoLogoutButton.vue +48 -0
- package/src/runtime/components/MapoMediaBreadcrumbs.vue +53 -0
- package/src/runtime/components/MapoMediaEditor.vue +350 -0
- package/src/runtime/components/MapoMediaFileChanger.vue +136 -0
- package/src/runtime/components/MapoMediaFolders.vue +239 -0
- package/src/runtime/components/MapoMediaGallery.vue +239 -0
- package/src/runtime/components/MapoMediaManager.vue +180 -0
- package/src/runtime/components/MapoMediaManagerDialog.vue +148 -0
- package/src/runtime/components/MapoMediaPreview.vue +111 -0
- package/src/runtime/components/MapoMediaUploader.vue +351 -0
- package/src/runtime/components/MapoMenuManager.vue +402 -0
- package/src/runtime/components/MapoMenuNodeEditor.vue +282 -0
- package/src/runtime/components/MapoMenuTreeview.vue +264 -0
- package/src/runtime/components/MapoMenuTreeviewNode.vue +234 -0
- package/src/runtime/components/MapoRootComponents.vue +9 -0
- package/src/runtime/components/MapoSidebar.vue +114 -0
- package/src/runtime/components/MapoSidebarList.vue +35 -0
- package/src/runtime/components/MapoSidebarListItem.vue +79 -0
- package/src/runtime/components/MapoSidebarProfile.vue +61 -0
- package/src/runtime/components/MapoSnackBar.vue +42 -0
- package/src/runtime/components/MapoThemeToggle.vue +27 -0
- package/src/runtime/components/MapoTopbar.vue +36 -0
- package/src/runtime/components/menuDndContext.ts +22 -0
- package/src/runtime/layouts/default.vue +53 -0
- package/src/runtime/layouts/empty.vue +9 -0
- package/src/runtime/page-meta.nuxt.d.ts +45 -0
- package/src/runtime/pages/index.vue +15 -0
- package/src/runtime/pages/login.vue +3 -0
- package/src/runtime/plugins/media-adapter.ts +33 -0
- package/src/runtime/stores/media.ts +474 -0
- package/src/runtime/types/list.ts +64 -0
- package/src/runtime/types/media.ts +126 -0
- package/src/runtime/types/menu.ts +105 -0
- package/CHANGELOG.md +0 -1030
- package/assets/mixins.scss +0 -22
- package/assets/variables.scss +0 -18
- package/components/ConfirmDialog.vue +0 -173
- package/components/Detail/Detail.vue +0 -696
- package/components/Detail/DetailLangSwitch.vue +0 -79
- package/components/DropArea.vue +0 -257
- package/components/Form/Form.vue +0 -218
- package/components/Form/FormField.vue +0 -216
- package/components/Form/FormGroup.vue +0 -146
- package/components/Form/FormTabs.vue +0 -188
- package/components/Form/defaults.js +0 -98
- package/components/Form/fields/ColorField.vue +0 -79
- package/components/Form/fields/DateField.vue +0 -77
- package/components/Form/fields/DateTimeField.vue +0 -271
- package/components/Form/fields/EnhancedMediaField.vue +0 -224
- package/components/Form/fields/FileField.vue +0 -125
- package/components/Form/fields/FksField.vue +0 -115
- package/components/Form/fields/MediaField.vue +0 -159
- package/components/Form/fields/MediaM2mField.vue +0 -149
- package/components/Form/fields/Repeater.vue +0 -618
- package/components/Form/fields/SeoPreview.vue +0 -89
- package/components/Form/fields/TimeField.vue +0 -154
- package/components/Form/fields/mapField/leaflet.injector.js +0 -39
- package/components/Form/fields/mapField/mapField.vue +0 -350
- package/components/Form/fields/wygEditor/defaults.js +0 -25
- package/components/Form/fields/wygEditor/utils/events.js +0 -64
- package/components/Form/fields/wygEditor/utils/mapomedia.plugin.js +0 -32
- package/components/Form/fields/wygEditor/utils/tinymce.injector.js +0 -29
- package/components/Form/fields/wygEditor/wygEditor.vue +0 -285
- package/components/Form/fields/wygEditorCKE/defaults.js +0 -103
- package/components/Form/fields/wygEditorCKE/utils/ckeditor.injector.js +0 -29
- package/components/Form/fields/wygEditorCKE/wygEditorCKE.vue +0 -270
- package/components/LangSwitcher.vue +0 -44
- package/components/List/List.vue +0 -271
- package/components/List/ListActions.vue +0 -164
- package/components/List/ListFilters.vue +0 -372
- package/components/List/ListHead.vue +0 -67
- package/components/List/ListQuickEdit.vue +0 -228
- package/components/List/ListTable.vue +0 -484
- package/components/List/ListTabs.vue +0 -65
- package/components/Login.vue +0 -125
- package/components/Logo.vue +0 -79
- package/components/LogoutButton.vue +0 -54
- package/components/MediaManager/MediaBreadcrumbs.vue +0 -45
- package/components/MediaManager/MediaEditor.vue +0 -340
- package/components/MediaManager/MediaFileChanger.vue +0 -78
- package/components/MediaManager/MediaFolders.vue +0 -287
- package/components/MediaManager/MediaGallery.vue +0 -281
- package/components/MediaManager/MediaManager.vue +0 -159
- package/components/MediaManager/MediaManagerDialog.vue +0 -104
- package/components/MediaManager/MediaPreview.vue +0 -258
- package/components/MediaManager/MediaUploader.vue +0 -163
- package/components/MenuManager/MenuManager.vue +0 -332
- package/components/MenuManager/MenuNodeEditor.vue +0 -270
- package/components/MenuManager/MenuTreeview.vue +0 -237
- package/components/MenuManager/MenuTreeviewNode.vue +0 -208
- package/components/PagePreview.vue +0 -58
- package/components/RootComponents.vue +0 -25
- package/components/SnackBar.vue +0 -69
- package/components/ThemeToggle.vue +0 -13
- package/components/layout/Sidebar/Sidebar.vue +0 -89
- package/components/layout/Sidebar/SidebarList.vue +0 -49
- package/components/layout/Sidebar/SidebarListItem.vue +0 -185
- package/components/layout/Sidebar/SidebarProfile.vue +0 -42
- package/components/layout/Sidebar/SidebarTitle.vue +0 -45
- package/components/layout/Topbar/Topbar.vue +0 -29
- package/components/layout/routebuilder.js +0 -48
- package/defaults/i18n.js +0 -37
- package/defaults/vuetify.js +0 -34
- package/layouts/default.vue +0 -47
- package/layouts/empty.vue +0 -16
- package/module.js +0 -80
- package/pages/index.vue +0 -37
- package/pages/login.vue +0 -10
- package/static/mapo/ckeditor/plugins/image2/dev/assets/image1.jpg +0 -0
- package/static/mapo/ckeditor/plugins/image2/dev/assets/image2.jpg +0 -0
- package/static/mapo/ckeditor/plugins/image2/dev/contents.css +0 -35
- package/static/mapo/ckeditor/plugins/image2/dev/image2.html +0 -338
- package/static/mapo/ckeditor/plugins/image2/dialogs/image2.js +0 -557
- package/static/mapo/ckeditor/plugins/image2/icons/hidpi/image.png +0 -0
- package/static/mapo/ckeditor/plugins/image2/icons/image.png +0 -0
- package/static/mapo/ckeditor/plugins/image2/lang/af.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ar.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/az.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/bg.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/bn.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/bs.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ca.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/cs.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/cy.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/da.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/de-ch.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/de.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/el.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/en-au.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/en-ca.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/en-gb.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/en.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/eo.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/es-mx.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/es.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/et.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/eu.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fa.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fi.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fo.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fr-ca.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/fr.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/gl.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/gu.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/he.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/hi.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/hr.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/hu.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/id.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/is.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/it.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ja.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ka.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/km.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ko.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ku.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/lt.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/lv.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/mk.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/mn.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ms.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/nb.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/nl.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/no.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/oc.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/pl.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/pt-br.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/pt.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ro.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ru.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/si.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sk.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sl.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sq.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sr-latn.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sr.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/sv.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/th.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/tr.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/tt.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/ug.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/uk.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/vi.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/zh-cn.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/lang/zh.js +0 -21
- package/static/mapo/ckeditor/plugins/image2/plugin.js +0 -1798
- package/static/mapo/ckeditor/plugins/image2/samples/assets/image1.jpg +0 -0
- package/static/mapo/ckeditor/plugins/image2/samples/assets/image2.jpg +0 -0
- package/static/mapo/ckeditor/plugins/image2/samples/image2.html +0 -68
- package/static/mapo/ckeditor/skins/moono/dev/icons16.png +0 -0
- package/static/mapo/ckeditor/skins/moono/dev/icons16.svg +0 -2374
- package/static/mapo/ckeditor/skins/moono/dev/icons32.png +0 -0
- package/static/mapo/ckeditor/skins/moono/dev/icons32.svg +0 -2722
- package/static/mapo/ckeditor/skins/moono/dev/locations.json +0 -144
- package/static/mapo/ckeditor/skins/moono/dialog.css +0 -5
- package/static/mapo/ckeditor/skins/moono/dialog_ie.css +0 -5
- package/static/mapo/ckeditor/skins/moono/dialog_ie7.css +0 -5
- package/static/mapo/ckeditor/skins/moono/dialog_ie8.css +0 -5
- package/static/mapo/ckeditor/skins/moono/dialog_iequirks.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_gecko.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_ie.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_ie7.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_ie8.css +0 -5
- package/static/mapo/ckeditor/skins/moono/editor_iequirks.css +0 -5
- package/static/mapo/ckeditor/skins/moono/icons.png +0 -0
- package/static/mapo/ckeditor/skins/moono/icons_hidpi.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/anchor.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/arrow.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/close.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/anchor.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/close.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/lock-open.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/lock.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/refresh.png +0 -0
- package/static/mapo/ckeditor/skins/moono/images/spinner.gif +0 -0
- package/static/mapo/ckeditor/skins/moono/readme.md +0 -49
- package/static/mapo/ckeditor/skins/moono/skin.js +0 -10
- package/static/mapo/ckeditor/skins/moono-dark/dialog.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/dialog_ie.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/dialog_ie7.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/dialog_ie8.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/dialog_iequirks.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_gecko.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_ie.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_ie7.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_ie8.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/editor_iequirks.css +0 -5
- package/static/mapo/ckeditor/skins/moono-dark/icons.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/icons_hidpi.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/arrow.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/close.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/close.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/lock-open.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/lock.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/hidpi/refresh.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/lock-open.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/lock.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/images/refresh.png +0 -0
- package/static/mapo/ckeditor/skins/moono-dark/readme.md +0 -51
- package/static/mapo/ckeditor/skins/moono-dark/skin.js +0 -5
- package/static/mapo/favicon.ico +0 -0
- package/static/mapo/tinymce-skins/mapo-dark/content.inline.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-dark/content.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-dark/content.mobile.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-dark/skin.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-dark/skin.mobile.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/content.inline.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/content.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/content.mobile.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/skin.min.css +0 -7
- package/static/mapo/tinymce-skins/mapo-light/skin.mobile.min.css +0 -7
- package/translations/en-US.js +0 -177
- package/translations/it-IT.js +0 -180
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, computed, watch, onMounted, nextTick } from "vue";
|
|
3
|
+
import { useRoute, useRouter } from "#app";
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(
|
|
6
|
+
defineProps<{
|
|
7
|
+
modelValue: string;
|
|
8
|
+
langs: string[];
|
|
9
|
+
errors?: Record<string, string[]>;
|
|
10
|
+
noRouteChange?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Number of languages above which the select also shows a dropdown
|
|
13
|
+
* alongside the tab bar (for quick navigation). Default: `8`.
|
|
14
|
+
*/
|
|
15
|
+
langThreshold?: number;
|
|
16
|
+
}>(),
|
|
17
|
+
{
|
|
18
|
+
errors: () => ({}),
|
|
19
|
+
noRouteChange: false,
|
|
20
|
+
langThreshold: 8,
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const emit = defineEmits<{ (e: "update:modelValue", lang: string): void }>();
|
|
25
|
+
|
|
26
|
+
const route = useRoute();
|
|
27
|
+
const router = useRouter();
|
|
28
|
+
|
|
29
|
+
// ─── Tab refs for scrollIntoView ─────────────────────────────────────────────
|
|
30
|
+
|
|
31
|
+
const tabRefs = ref<Record<string, HTMLElement | null>>({});
|
|
32
|
+
|
|
33
|
+
function setTabRef(lang: string, el: Element | null) {
|
|
34
|
+
tabRefs.value[lang] = el as HTMLElement | null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function scrollActiveIntoView(lang: string) {
|
|
38
|
+
nextTick(() => {
|
|
39
|
+
tabRefs.value[lang]?.scrollIntoView({
|
|
40
|
+
behavior: "smooth",
|
|
41
|
+
block: "nearest",
|
|
42
|
+
inline: "nearest",
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
48
|
+
|
|
49
|
+
function hasErrors(lang: string): boolean {
|
|
50
|
+
const prefix = `translations.${lang}.`;
|
|
51
|
+
return Object.keys(props.errors || {}).some((k) => k.startsWith(prefix));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function selectLang(lang: string) {
|
|
55
|
+
emit("update:modelValue", lang);
|
|
56
|
+
if (!props.noRouteChange && route.query.lang !== lang) {
|
|
57
|
+
router.replace({ query: { ...route.query, lang } });
|
|
58
|
+
}
|
|
59
|
+
scrollActiveIntoView(lang);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function onSelectChange(v: unknown) {
|
|
63
|
+
const lang =
|
|
64
|
+
typeof v === "object" && v !== null
|
|
65
|
+
? (v as { value: string }).value
|
|
66
|
+
: (v as string);
|
|
67
|
+
if (lang) selectLang(lang);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ─── Select menu items ────────────────────────────────────────────────────────
|
|
71
|
+
|
|
72
|
+
const selectItems = computed(() =>
|
|
73
|
+
props.langs.map((lang) => ({
|
|
74
|
+
label: lang.toUpperCase(),
|
|
75
|
+
value: lang,
|
|
76
|
+
trailingIcon: hasErrors(lang) ? "i-lucide-alert-circle" : undefined,
|
|
77
|
+
})),
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
// ─── Lifecycle ────────────────────────────────────────────────────────────────
|
|
81
|
+
|
|
82
|
+
onMounted(() => {
|
|
83
|
+
const queryLang = route.query.lang as string | undefined;
|
|
84
|
+
if (
|
|
85
|
+
queryLang &&
|
|
86
|
+
props.langs.includes(queryLang) &&
|
|
87
|
+
queryLang !== props.modelValue
|
|
88
|
+
) {
|
|
89
|
+
emit("update:modelValue", queryLang);
|
|
90
|
+
}
|
|
91
|
+
scrollActiveIntoView(props.modelValue);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
watch(
|
|
95
|
+
() => props.modelValue,
|
|
96
|
+
(val) => {
|
|
97
|
+
if (!props.noRouteChange && route.query.lang !== val) {
|
|
98
|
+
router.replace({ query: { ...route.query, lang: val } });
|
|
99
|
+
}
|
|
100
|
+
scrollActiveIntoView(val);
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<template>
|
|
106
|
+
<div
|
|
107
|
+
class="flex items-end gap-0 border-b border-gray-200 dark:border-gray-700 mt-2 mb-4"
|
|
108
|
+
>
|
|
109
|
+
<!-- Language select — always visible, aligned at bottom of row -->
|
|
110
|
+
<USelectMenu
|
|
111
|
+
:model-value="modelValue"
|
|
112
|
+
:items="selectItems"
|
|
113
|
+
value-key="value"
|
|
114
|
+
label-key="label"
|
|
115
|
+
size="sm"
|
|
116
|
+
class="w-28 shrink-0 mb-px"
|
|
117
|
+
@update:model-value="onSelectChange"
|
|
118
|
+
>
|
|
119
|
+
<template #default="{ open }">
|
|
120
|
+
<UButton
|
|
121
|
+
size="sm"
|
|
122
|
+
variant="ghost"
|
|
123
|
+
color="neutral"
|
|
124
|
+
:trailing-icon="
|
|
125
|
+
open ? 'i-lucide-chevron-up' : 'i-lucide-chevron-down'
|
|
126
|
+
"
|
|
127
|
+
class="w-full justify-between font-medium"
|
|
128
|
+
>
|
|
129
|
+
<span class="flex items-center gap-1">
|
|
130
|
+
<span
|
|
131
|
+
v-if="hasErrors(modelValue)"
|
|
132
|
+
class="inline-block h-2 w-2 rounded-full bg-red-500"
|
|
133
|
+
/>
|
|
134
|
+
{{ modelValue.toUpperCase() }}
|
|
135
|
+
</span>
|
|
136
|
+
</UButton>
|
|
137
|
+
</template>
|
|
138
|
+
</USelectMenu>
|
|
139
|
+
|
|
140
|
+
<!-- Divider -->
|
|
141
|
+
<div class="h-5 w-px bg-gray-200 dark:bg-gray-700 mx-2 shrink-0" />
|
|
142
|
+
|
|
143
|
+
<!-- Tab bar — always shown, scrollable -->
|
|
144
|
+
<div class="flex gap-1 overflow-x-auto scrollbar-none flex-1">
|
|
145
|
+
<button
|
|
146
|
+
v-for="lang in langs"
|
|
147
|
+
:key="lang"
|
|
148
|
+
:ref="(el) => setTabRef(lang, el as Element | null)"
|
|
149
|
+
type="button"
|
|
150
|
+
class="relative shrink-0 px-4 py-2 text-sm font-medium transition-colors focus:outline-none"
|
|
151
|
+
:class="[
|
|
152
|
+
lang === modelValue
|
|
153
|
+
? 'text-primary-600 border-b-2 border-primary-600 -mb-px'
|
|
154
|
+
: 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300',
|
|
155
|
+
]"
|
|
156
|
+
@click="selectLang(lang)"
|
|
157
|
+
>
|
|
158
|
+
{{ lang.toUpperCase() }}
|
|
159
|
+
<span
|
|
160
|
+
v-if="hasErrors(lang)"
|
|
161
|
+
class="absolute top-1 right-1 w-2 h-2 rounded-full bg-red-500"
|
|
162
|
+
/>
|
|
163
|
+
</button>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</template>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
|
|
5
|
+
const { t } = useI18n();
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(
|
|
8
|
+
defineProps<{
|
|
9
|
+
accept?: string;
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}>(),
|
|
13
|
+
{
|
|
14
|
+
accept: "*/*",
|
|
15
|
+
multiple: true,
|
|
16
|
+
disabled: false,
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const emit = defineEmits<{
|
|
21
|
+
files: [files: File[]];
|
|
22
|
+
}>();
|
|
23
|
+
|
|
24
|
+
const isDragging = ref(false);
|
|
25
|
+
const fileInput = ref<HTMLInputElement | null>(null);
|
|
26
|
+
let dragCounter = 0;
|
|
27
|
+
|
|
28
|
+
function onDragEnter(e: DragEvent) {
|
|
29
|
+
if (props.disabled) return;
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
dragCounter++;
|
|
32
|
+
isDragging.value = true;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function onDragLeave() {
|
|
36
|
+
dragCounter--;
|
|
37
|
+
if (dragCounter <= 0) {
|
|
38
|
+
dragCounter = 0;
|
|
39
|
+
isDragging.value = false;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function onDrop(e: DragEvent) {
|
|
44
|
+
if (props.disabled) return;
|
|
45
|
+
isDragging.value = false;
|
|
46
|
+
dragCounter = 0;
|
|
47
|
+
const files = filterFiles(Array.from(e.dataTransfer?.files ?? []));
|
|
48
|
+
if (files.length) emit("files", files);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function onFileInput(e: Event) {
|
|
52
|
+
const input = e.target as HTMLInputElement;
|
|
53
|
+
const files = filterFiles(Array.from(input.files ?? []));
|
|
54
|
+
if (files.length) emit("files", files);
|
|
55
|
+
input.value = "";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function triggerPick() {
|
|
59
|
+
if (!props.disabled) fileInput.value?.click();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function filterFiles(files: File[]): File[] {
|
|
63
|
+
if (!props.accept || props.accept === "*/*") return files;
|
|
64
|
+
return files.filter((f) => matchesMime(f.type, props.accept));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function matchesMime(mime: string, accept: string): boolean {
|
|
68
|
+
return accept.split(",").some((pattern) => {
|
|
69
|
+
const p = pattern.trim();
|
|
70
|
+
if (p === "*/*") return true;
|
|
71
|
+
if (p.endsWith("/*")) return mime.startsWith(p.replace("/*", "/"));
|
|
72
|
+
return mime === p;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
defineExpose({ triggerPick });
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<template>
|
|
80
|
+
<div
|
|
81
|
+
class="mapo-drop-area relative"
|
|
82
|
+
:class="{
|
|
83
|
+
'mapo-drop-area--dragging': isDragging,
|
|
84
|
+
'opacity-50 pointer-events-none': disabled,
|
|
85
|
+
}"
|
|
86
|
+
@dragenter.prevent="onDragEnter"
|
|
87
|
+
@dragover.prevent
|
|
88
|
+
@dragleave="onDragLeave"
|
|
89
|
+
@drop.prevent="onDrop"
|
|
90
|
+
>
|
|
91
|
+
<input
|
|
92
|
+
ref="fileInput"
|
|
93
|
+
type="file"
|
|
94
|
+
class="sr-only"
|
|
95
|
+
:accept="accept"
|
|
96
|
+
:multiple="multiple"
|
|
97
|
+
@change="onFileInput"
|
|
98
|
+
/>
|
|
99
|
+
|
|
100
|
+
<slot :trigger-pick="triggerPick" :is-dragging="isDragging" />
|
|
101
|
+
|
|
102
|
+
<Transition name="drop-overlay">
|
|
103
|
+
<div
|
|
104
|
+
v-if="isDragging"
|
|
105
|
+
class="pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-primary bg-default/80"
|
|
106
|
+
>
|
|
107
|
+
<div class="flex flex-col items-center gap-2 text-primary">
|
|
108
|
+
<UIcon name="i-lucide-upload-cloud" class="size-10" />
|
|
109
|
+
<span class="text-sm font-medium">{{
|
|
110
|
+
t("mapo.dropArea.dropHere")
|
|
111
|
+
}}</span>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</Transition>
|
|
115
|
+
</div>
|
|
116
|
+
</template>
|
|
117
|
+
|
|
118
|
+
<style scoped>
|
|
119
|
+
.drop-overlay-enter-active,
|
|
120
|
+
.drop-overlay-leave-active {
|
|
121
|
+
transition: opacity 0.15s ease;
|
|
122
|
+
}
|
|
123
|
+
.drop-overlay-enter-from,
|
|
124
|
+
.drop-overlay-leave-to {
|
|
125
|
+
opacity: 0;
|
|
126
|
+
}
|
|
127
|
+
</style>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import type { Ref } from "vue";
|
|
4
|
+
import { useI18n } from "vue-i18n";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* UI locale switcher — lists the locales configured in `@nuxtjs/i18n`
|
|
8
|
+
* (via `@mapomodule/i18n`) and switches the interface language with
|
|
9
|
+
* cookie persistence. Port of the v1 `LangSwitcher`.
|
|
10
|
+
*/
|
|
11
|
+
const props = withDefaults(
|
|
12
|
+
defineProps<{
|
|
13
|
+
/** Show the flag emoji derived from the locale `language` tag. */
|
|
14
|
+
flags?: boolean;
|
|
15
|
+
/** Nuxt UI USelectMenu `size` prop. */
|
|
16
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
17
|
+
}>(),
|
|
18
|
+
{ flags: true, size: "sm" },
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
interface SwitcherLocale {
|
|
22
|
+
code: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
language?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// `locales` and `setLocale` are @nuxtjs/i18n Composer extensions; the uikit
|
|
28
|
+
// package only depends on vue-i18n types, so they are typed structurally.
|
|
29
|
+
const { locale, locales, setLocale } = useI18n() as unknown as {
|
|
30
|
+
locale: Ref<string>;
|
|
31
|
+
locales: Ref<SwitcherLocale[]>;
|
|
32
|
+
setLocale: (code: string) => Promise<void>;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** Regional-indicator flag emoji from a BCP-47 tag (e.g. `en-US` → 🇺🇸). */
|
|
36
|
+
function getFlag(language?: string): string {
|
|
37
|
+
const region = language?.split("-").at(-1);
|
|
38
|
+
if (!region || region.length !== 2 || !/^[A-Za-z]+$/.test(region)) return "";
|
|
39
|
+
const codePoints = region
|
|
40
|
+
.toUpperCase()
|
|
41
|
+
.split("")
|
|
42
|
+
.map((char) => 127397 + char.charCodeAt(0));
|
|
43
|
+
return String.fromCodePoint(...codePoints);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const items = computed(() =>
|
|
47
|
+
locales.value.map((l) => ({
|
|
48
|
+
label:
|
|
49
|
+
props.flags && getFlag(l.language)
|
|
50
|
+
? `${getFlag(l.language)} ${l.name ?? l.code.toUpperCase()}`
|
|
51
|
+
: (l.name ?? l.code.toUpperCase()),
|
|
52
|
+
value: l.code,
|
|
53
|
+
})),
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const current = computed({
|
|
57
|
+
get: () => locale.value,
|
|
58
|
+
set: (code: string) => {
|
|
59
|
+
if (code && code !== locale.value) setLocale(code);
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<USelectMenu
|
|
66
|
+
v-model="current"
|
|
67
|
+
:items="items"
|
|
68
|
+
value-key="value"
|
|
69
|
+
label-key="label"
|
|
70
|
+
:size="size"
|
|
71
|
+
:search-input="false"
|
|
72
|
+
class="w-40"
|
|
73
|
+
/>
|
|
74
|
+
</template>
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
<script setup lang="ts" generic="T extends object">
|
|
2
|
+
import { ref, computed, watch, useSlots } from "vue";
|
|
3
|
+
import type { Ref } from "vue";
|
|
4
|
+
import type {
|
|
5
|
+
ListColumn,
|
|
6
|
+
FilterDescriptor,
|
|
7
|
+
FilterChoice,
|
|
8
|
+
ActiveFilter,
|
|
9
|
+
ActionDescriptor,
|
|
10
|
+
ListTabItem,
|
|
11
|
+
} from "../types/list.js";
|
|
12
|
+
import type { AnyFieldDescriptor, FieldRegistry } from "@mapomodule/form/types";
|
|
13
|
+
import { debounce } from "@mapomodule/utils";
|
|
14
|
+
import { useRoute, useRouter } from "#app";
|
|
15
|
+
|
|
16
|
+
const props = withDefaults(
|
|
17
|
+
defineProps<{
|
|
18
|
+
endpoint?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Offline mode: pass a local array to drive the list entirely in memory.
|
|
21
|
+
* Search, filters, sort, pagination, drag-reorder and delete all happen
|
|
22
|
+
* client-side. Mutations emit `update:items` so the parent owns the array.
|
|
23
|
+
* When set, `endpoint` is ignored.
|
|
24
|
+
*/
|
|
25
|
+
items?: T[];
|
|
26
|
+
/**
|
|
27
|
+
* Hybrid mode: with `endpoint` set and `clientSide: true`, the list fetches
|
|
28
|
+
* the full dataset ONCE and runs search/filter/sort/pagination locally.
|
|
29
|
+
* Mutations (delete, drag, quick-edit) still hit the backend, then refetch.
|
|
30
|
+
* Ignored when `items` is provided.
|
|
31
|
+
*/
|
|
32
|
+
clientSide?: boolean;
|
|
33
|
+
columns: ListColumn<T>[];
|
|
34
|
+
lookup?: string;
|
|
35
|
+
// Filters
|
|
36
|
+
filters?: FilterDescriptor[];
|
|
37
|
+
// Actions
|
|
38
|
+
actions?: ActionDescriptor<T>[];
|
|
39
|
+
// Tabs
|
|
40
|
+
tabs?: ListTabItem[];
|
|
41
|
+
defaultTab?: string;
|
|
42
|
+
tabQueryParam?: string;
|
|
43
|
+
// Table features
|
|
44
|
+
searchable?: boolean;
|
|
45
|
+
draggable?: boolean;
|
|
46
|
+
positionField?: string;
|
|
47
|
+
// Quick edit
|
|
48
|
+
editFields?: AnyFieldDescriptor<T>[];
|
|
49
|
+
languages?: string[];
|
|
50
|
+
registry?: FieldRegistry;
|
|
51
|
+
/** Base path for the detail page link on each row. E.g. "/news" → links to "/news/42". */
|
|
52
|
+
detailBase?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Django model label used to gate row-level edit and delete buttons via permissions.
|
|
55
|
+
* E.g. `"article"` hides the pencil unless the user has `change_article`, and
|
|
56
|
+
* hides the trash unless the user has `delete_article`. Omit to always show both.
|
|
57
|
+
*/
|
|
58
|
+
permissionModel?: string;
|
|
59
|
+
// Pagination
|
|
60
|
+
/** Initial page size. Default: 20. */
|
|
61
|
+
defaultPageSize?: number;
|
|
62
|
+
/** Page size options shown in the per-page selector. Default: [10, 20, 50, 100]. */
|
|
63
|
+
pageSizeOptions?: number[];
|
|
64
|
+
/**
|
|
65
|
+
* Custom response parser. Replaces the built-in DRF / flat-array detection.
|
|
66
|
+
* Return `{ items, total }` from any shape your backend returns.
|
|
67
|
+
* @example (raw) => ({ items: raw.data, total: raw.meta.total })
|
|
68
|
+
*/
|
|
69
|
+
responseAdapter?: (raw: unknown) => { items: T[]; total: number };
|
|
70
|
+
/**
|
|
71
|
+
* Custom pagination query params factory. Replaces default `{ page, page_size }`.
|
|
72
|
+
* @example ({ page, pageSize }) => ({ offset: (page - 1) * pageSize, limit: pageSize })
|
|
73
|
+
*/
|
|
74
|
+
paginationParams?: (state: {
|
|
75
|
+
page: number;
|
|
76
|
+
pageSize: number;
|
|
77
|
+
}) => Record<string, unknown>;
|
|
78
|
+
}>(),
|
|
79
|
+
{
|
|
80
|
+
endpoint: "",
|
|
81
|
+
items: undefined,
|
|
82
|
+
clientSide: false,
|
|
83
|
+
lookup: "id",
|
|
84
|
+
filters: () => [],
|
|
85
|
+
actions: () => [],
|
|
86
|
+
tabs: () => [],
|
|
87
|
+
tabQueryParam: "tab",
|
|
88
|
+
searchable: true,
|
|
89
|
+
draggable: false,
|
|
90
|
+
positionField: "position",
|
|
91
|
+
editFields: () => [],
|
|
92
|
+
defaultPageSize: 20,
|
|
93
|
+
pageSizeOptions: () => [10, 20, 50, 100],
|
|
94
|
+
},
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const emit = defineEmits<{
|
|
98
|
+
"update:items": [value: T[]];
|
|
99
|
+
}>();
|
|
100
|
+
|
|
101
|
+
// --- URL state (read once on mount, then write on change) ---
|
|
102
|
+
const route = useRoute();
|
|
103
|
+
const router = useRouter();
|
|
104
|
+
|
|
105
|
+
// --- Selection state ---
|
|
106
|
+
const selection = ref<T[] | "all">([]) as Ref<T[] | "all">;
|
|
107
|
+
const selectionQuery = ref(new URLSearchParams());
|
|
108
|
+
|
|
109
|
+
// --- Tabs state (restored from URL) ---
|
|
110
|
+
function restoreTabFromUrl(): string {
|
|
111
|
+
const urlTab = route.query[props.tabQueryParam] as string | undefined;
|
|
112
|
+
if (urlTab && props.tabs.some((t) => t.value === urlTab)) return urlTab;
|
|
113
|
+
return props.defaultTab ?? props.tabs[0]?.value ?? "";
|
|
114
|
+
}
|
|
115
|
+
const activeTab = ref(restoreTabFromUrl());
|
|
116
|
+
|
|
117
|
+
// --- Filters state (restored from URL) ---
|
|
118
|
+
function restoreFiltersFromUrl(): ActiveFilter[] {
|
|
119
|
+
const result: ActiveFilter[] = [];
|
|
120
|
+
for (const fd of props.filters) {
|
|
121
|
+
const urlVal = route.query[`f_${fd.value}`];
|
|
122
|
+
if (!urlVal) continue;
|
|
123
|
+
const rawValue = String(urlVal);
|
|
124
|
+
let active: FilterChoice[];
|
|
125
|
+
if (fd.datepicker) {
|
|
126
|
+
const parts = rawValue.split(",");
|
|
127
|
+
if (parts.length === 2) {
|
|
128
|
+
active = [
|
|
129
|
+
{
|
|
130
|
+
text: parts
|
|
131
|
+
.map((d) => new Date(d).toLocaleDateString())
|
|
132
|
+
.join(" → "),
|
|
133
|
+
value: rawValue,
|
|
134
|
+
},
|
|
135
|
+
];
|
|
136
|
+
} else continue;
|
|
137
|
+
} else {
|
|
138
|
+
const rawValues = rawValue.split(",");
|
|
139
|
+
active = rawValues
|
|
140
|
+
.map((rv) => fd.choices?.find((c) => String(c.value) === rv))
|
|
141
|
+
.filter(Boolean) as FilterChoice[];
|
|
142
|
+
}
|
|
143
|
+
if (active.length) result.push({ ...fd, active });
|
|
144
|
+
}
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
const activeFilters = ref<ActiveFilter[]>(restoreFiltersFromUrl());
|
|
148
|
+
|
|
149
|
+
// Write current tab + filter state back to URL (debounced to avoid history spam).
|
|
150
|
+
const writeUrlState = debounce(() => {
|
|
151
|
+
const query: Record<string, string | undefined> = {
|
|
152
|
+
...(route.query as Record<string, string>),
|
|
153
|
+
};
|
|
154
|
+
// Tab
|
|
155
|
+
if (props.tabs.length) {
|
|
156
|
+
if (activeTab.value) query[props.tabQueryParam] = activeTab.value;
|
|
157
|
+
else delete query[props.tabQueryParam];
|
|
158
|
+
}
|
|
159
|
+
// Remove stale f_ params, then re-write current ones
|
|
160
|
+
for (const k of Object.keys(query)) {
|
|
161
|
+
if (k.startsWith("f_")) delete query[k];
|
|
162
|
+
}
|
|
163
|
+
for (const f of activeFilters.value) {
|
|
164
|
+
if (!f.active.length) continue;
|
|
165
|
+
query[`f_${f.value}`] = f.active.map((c) => String(c.value)).join(",");
|
|
166
|
+
}
|
|
167
|
+
router.replace({ query });
|
|
168
|
+
}, 150);
|
|
169
|
+
|
|
170
|
+
watch([activeTab, activeFilters], writeUrlState, { deep: true });
|
|
171
|
+
|
|
172
|
+
// --- crudEndpoint: base path for mutations (no query string). ---
|
|
173
|
+
const crudEndpoint = computed(
|
|
174
|
+
() => (props.endpoint ?? "").split("?")[0] || (props.endpoint ?? ""),
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
// --- filterParams: active tab + active filters → backend query params. ---
|
|
178
|
+
// v1 contract: each filter is sent as `filter.value=v1,v2,...` (bare key, comma-joined
|
|
179
|
+
// values). Datepicker ranges are a single `key=start,end` value (no __gte/__lte split).
|
|
180
|
+
// This keeps the backend contract identical to Mapo v1; the `f_` prefix is used only for
|
|
181
|
+
// URL persistence (see writeUrlState), never towards the backend.
|
|
182
|
+
const filterParams = computed<Record<string, unknown>>(() => {
|
|
183
|
+
const params: Record<string, unknown> = {};
|
|
184
|
+
if (props.tabs.length && activeTab.value) {
|
|
185
|
+
params[props.tabQueryParam] = activeTab.value;
|
|
186
|
+
}
|
|
187
|
+
for (const f of activeFilters.value) {
|
|
188
|
+
if (!f.active.length) continue;
|
|
189
|
+
params[f.value] = f.active.map((c) => String(c.value)).join(",");
|
|
190
|
+
}
|
|
191
|
+
return params;
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
// --- Table ref for refresh ---
|
|
195
|
+
const tableRef = ref<{ refresh: () => void } | null>(null);
|
|
196
|
+
|
|
197
|
+
function refresh() {
|
|
198
|
+
tableRef.value?.refresh();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
defineExpose({ refresh });
|
|
202
|
+
|
|
203
|
+
defineSlots<
|
|
204
|
+
{
|
|
205
|
+
/** Content rendered inside the list head area (title, breadcrumbs, action buttons). */
|
|
206
|
+
head(): unknown;
|
|
207
|
+
/** Extra content rendered alongside the search input in the table toolbar. */
|
|
208
|
+
"dtable.toolbar"(): unknown;
|
|
209
|
+
/** Override for the empty state displayed when no rows are found. */
|
|
210
|
+
"dtable.empty"(): unknown;
|
|
211
|
+
/** Override for the loading skeleton displayed while data is being fetched. */
|
|
212
|
+
"dtable.loading"(): unknown;
|
|
213
|
+
/**
|
|
214
|
+
* Per-filter custom panel content. Slot name: `filter.{filter.value}`
|
|
215
|
+
* (plus `.title` / `.content` / `.icon` sub-slots).
|
|
216
|
+
* Bindings mirror MapoListFilters: `filter` is always provided, the rest
|
|
217
|
+
* varies per sub-slot.
|
|
218
|
+
*/
|
|
219
|
+
[K: `filter.${string}`]: (props: {
|
|
220
|
+
filter: FilterDescriptor & { dates?: string[] };
|
|
221
|
+
choice?: FilterChoice;
|
|
222
|
+
toggleChoice?: (filter: FilterDescriptor, choice: FilterChoice) => void;
|
|
223
|
+
removeFilter?: (filter: FilterDescriptor) => void;
|
|
224
|
+
isChoiceActive?: (
|
|
225
|
+
filter: FilterDescriptor,
|
|
226
|
+
choice: FilterChoice,
|
|
227
|
+
) => boolean;
|
|
228
|
+
}) => unknown;
|
|
229
|
+
/**
|
|
230
|
+
* Extra content rendered below the quick-edit form.
|
|
231
|
+
* Receives `{ model: T }` — the current reactive form model.
|
|
232
|
+
*/
|
|
233
|
+
"qedit.extra": (props: { model: T }) => unknown;
|
|
234
|
+
} & {
|
|
235
|
+
/**
|
|
236
|
+
* Per-column cell override. Slot name: `cell.{column.key}`.
|
|
237
|
+
*/
|
|
238
|
+
[K in keyof T as `cell.${K & string}`]: (props: {
|
|
239
|
+
item: T;
|
|
240
|
+
value: T[K];
|
|
241
|
+
}) => unknown;
|
|
242
|
+
}
|
|
243
|
+
>();
|
|
244
|
+
|
|
245
|
+
// Loosely-typed slot names for the dynamic forwarding templates below.
|
|
246
|
+
// A `[K: string]` catch-all in defineSlots would make `$slots[name]` indexable,
|
|
247
|
+
// but it degrades the typed `cell.*` slot props to `any` for consumers —
|
|
248
|
+
// so the forwarding iterates over this untyped name list instead.
|
|
249
|
+
const slots = useSlots();
|
|
250
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
251
|
+
const forwardedSlotNames = computed(() => Object.keys(slots) as any[]);
|
|
252
|
+
|
|
253
|
+
// Reset selection when the active tab or filters change
|
|
254
|
+
watch([activeTab, activeFilters], () => {
|
|
255
|
+
selection.value = [];
|
|
256
|
+
});
|
|
257
|
+
</script>
|
|
258
|
+
|
|
259
|
+
<template>
|
|
260
|
+
<div class="mapo-list space-y-4">
|
|
261
|
+
<!-- Head slot -->
|
|
262
|
+
<MapoListHead>
|
|
263
|
+
<template #head>
|
|
264
|
+
<slot name="head" />
|
|
265
|
+
</template>
|
|
266
|
+
</MapoListHead>
|
|
267
|
+
|
|
268
|
+
<!-- Tabs -->
|
|
269
|
+
<MapoListTabs
|
|
270
|
+
v-if="tabs.length"
|
|
271
|
+
:tabs="tabs"
|
|
272
|
+
:model-value="activeTab"
|
|
273
|
+
@update:model-value="activeTab = $event"
|
|
274
|
+
/>
|
|
275
|
+
|
|
276
|
+
<!-- Toolbar: filters + actions -->
|
|
277
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
278
|
+
<MapoListFilters
|
|
279
|
+
:filters="filters"
|
|
280
|
+
:model-value="activeFilters"
|
|
281
|
+
@update:model-value="activeFilters = $event"
|
|
282
|
+
>
|
|
283
|
+
<template
|
|
284
|
+
v-for="name in forwardedSlotNames"
|
|
285
|
+
:key="name"
|
|
286
|
+
#[name]="slotProps"
|
|
287
|
+
>
|
|
288
|
+
<slot :name="name" v-bind="slotProps ?? {}" />
|
|
289
|
+
</template>
|
|
290
|
+
</MapoListFilters>
|
|
291
|
+
|
|
292
|
+
<div class="ml-auto">
|
|
293
|
+
<MapoListActions
|
|
294
|
+
:actions="actions"
|
|
295
|
+
:selection="selection"
|
|
296
|
+
:selection-query="selectionQuery"
|
|
297
|
+
:endpoint="crudEndpoint"
|
|
298
|
+
:lookup="lookup"
|
|
299
|
+
@action-completed="refresh"
|
|
300
|
+
/>
|
|
301
|
+
</div>
|
|
302
|
+
</div>
|
|
303
|
+
|
|
304
|
+
<!-- Table -->
|
|
305
|
+
<MapoListTable
|
|
306
|
+
ref="tableRef"
|
|
307
|
+
:endpoint="endpoint"
|
|
308
|
+
:items="items"
|
|
309
|
+
:client-side="clientSide"
|
|
310
|
+
:crud-endpoint="crudEndpoint"
|
|
311
|
+
:filter-params="filterParams"
|
|
312
|
+
:columns="columns"
|
|
313
|
+
:lookup="lookup"
|
|
314
|
+
:searchable="searchable"
|
|
315
|
+
:draggable="draggable"
|
|
316
|
+
:position-field="positionField"
|
|
317
|
+
:edit-fields="editFields"
|
|
318
|
+
:languages="languages"
|
|
319
|
+
:registry="registry"
|
|
320
|
+
:detail-base="detailBase"
|
|
321
|
+
:default-page-size="defaultPageSize"
|
|
322
|
+
:page-size-options="pageSizeOptions"
|
|
323
|
+
:response-adapter="responseAdapter"
|
|
324
|
+
:pagination-params="paginationParams"
|
|
325
|
+
:permission-model="permissionModel"
|
|
326
|
+
@update:selection="selection = $event"
|
|
327
|
+
@update:selection-query="selectionQuery = $event"
|
|
328
|
+
@update:items="emit('update:items', $event)"
|
|
329
|
+
>
|
|
330
|
+
<template
|
|
331
|
+
v-for="name in forwardedSlotNames"
|
|
332
|
+
:key="name"
|
|
333
|
+
#[name]="slotProps"
|
|
334
|
+
>
|
|
335
|
+
<slot :name="name" v-bind="slotProps ?? {}" />
|
|
336
|
+
</template>
|
|
337
|
+
</MapoListTable>
|
|
338
|
+
</div>
|
|
339
|
+
</template>
|